Repository: react-mdc/react-material-components-web Branch: develop Commit: 1627e3e1e0a0 Files: 383 Total size: 462.0 KB Directory structure: gitextract_41q20qop/ ├── .gitignore ├── .npmignore ├── .travis.yml ├── README.md ├── docs/ │ ├── .gitignore │ ├── config/ │ │ └── webpack/ │ │ ├── app.js │ │ ├── constants.js │ │ └── vendor.js │ ├── index.html │ ├── package.json │ ├── postcss.config.js │ ├── src/ │ │ ├── js/ │ │ │ ├── Container/ │ │ │ │ ├── MainToolbar.tsx │ │ │ │ ├── index.tsx │ │ │ │ └── styles.scss │ │ │ ├── common/ │ │ │ │ └── types.ts │ │ │ ├── compat.ts │ │ │ ├── components/ │ │ │ │ ├── Code.tsx │ │ │ │ ├── CodeMirror.tsx │ │ │ │ ├── ComponentPage/ │ │ │ │ │ ├── Content.tsx │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── styles.scss │ │ │ │ ├── DarkTheme.tsx │ │ │ │ ├── FullSize.tsx │ │ │ │ ├── Icon.tsx │ │ │ │ ├── Name.tsx │ │ │ │ ├── Page/ │ │ │ │ │ ├── Content.tsx │ │ │ │ │ ├── Footer.tsx │ │ │ │ │ ├── Responsive.tsx │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── styles.scss │ │ │ │ ├── ShowCase/ │ │ │ │ │ ├── Item.tsx │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── styles.scss │ │ │ │ ├── Table.tsx │ │ │ │ └── styles.scss │ │ │ ├── index.tsx │ │ │ ├── pages/ │ │ │ │ ├── ButtonPage/ │ │ │ │ │ └── index.tsx │ │ │ │ ├── CardPage/ │ │ │ │ │ └── index.tsx │ │ │ │ ├── CheckboxPage/ │ │ │ │ │ └── index.tsx │ │ │ │ ├── DialogPage/ │ │ │ │ │ └── index.tsx │ │ │ │ ├── ElevationPage/ │ │ │ │ │ └── index.tsx │ │ │ │ ├── FABPage/ │ │ │ │ │ └── index.tsx │ │ │ │ ├── FormFieldPage/ │ │ │ │ │ └── index.tsx │ │ │ │ ├── LayoutGridPage/ │ │ │ │ │ └── index.tsx │ │ │ │ ├── NotFoundPage/ │ │ │ │ │ └── index.tsx │ │ │ │ ├── RadioPage/ │ │ │ │ │ └── index.tsx │ │ │ │ ├── RipplePage/ │ │ │ │ │ └── index.tsx │ │ │ │ ├── SwitchPage/ │ │ │ │ │ └── index.tsx │ │ │ │ ├── TextfieldPage/ │ │ │ │ │ └── index.tsx │ │ │ │ ├── TypographyPage/ │ │ │ │ │ └── index.tsx │ │ │ │ └── WelcomePage/ │ │ │ │ ├── index.tsx │ │ │ │ └── styles.scss │ │ │ ├── routes.tsx │ │ │ └── utils/ │ │ │ └── code.ts │ │ └── style/ │ │ ├── index.scss │ │ ├── layout.scss │ │ ├── preload.scss │ │ └── vars/ │ │ └── _theme.scss │ ├── tsconfig.json │ ├── tslint.json │ ├── typings/ │ │ ├── cssmodule.d.ts │ │ ├── images.d.ts │ │ └── raw-loader.d.ts │ └── vendor.js ├── lerna.json ├── package.json ├── packages/ │ ├── base/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── ClassNameMetaBase.tsx │ │ │ ├── DefaultComponentBase.ts │ │ │ ├── MetaBase.tsx │ │ │ ├── NativeDOMAdapter.tsx │ │ │ ├── __tests__/ │ │ │ │ ├── ClassNameMetaBase.spec.tsx │ │ │ │ ├── DefaultComponentBase.spec.tsx │ │ │ │ ├── MetaBase.spec.tsx │ │ │ │ ├── NativeDOMAdapter.spec.tsx │ │ │ │ └── util.spec.tsx │ │ │ ├── event.ts │ │ │ ├── index.tsx │ │ │ ├── types.tsx │ │ │ └── util.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── button/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── Button.tsx │ │ │ ├── __tests__/ │ │ │ │ └── Button.spec.tsx │ │ │ ├── constants.tsx │ │ │ └── index.tsx │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── card/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── Action.tsx │ │ │ ├── Actions.tsx │ │ │ ├── Container.tsx │ │ │ ├── HorizontalBlock.tsx │ │ │ ├── Media.tsx │ │ │ ├── MediaItem.tsx │ │ │ ├── Primary.tsx │ │ │ ├── Subtitle.tsx │ │ │ ├── SupportingText.tsx │ │ │ ├── Title.tsx │ │ │ ├── __tests__/ │ │ │ │ ├── Action.spec.tsx │ │ │ │ ├── Actions.spec.tsx │ │ │ │ ├── Container.spec.tsx │ │ │ │ ├── HorizontalBlock.spec.tsx │ │ │ │ ├── Media.spec.tsx │ │ │ │ ├── MediaItem.spec.tsx │ │ │ │ ├── Primary.spec.tsx │ │ │ │ ├── Subtitle.spec.tsx │ │ │ │ ├── SupportingText.spec.tsx │ │ │ │ └── Title.spec.tsx │ │ │ ├── constants.ts │ │ │ └── index.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── checkbox/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── Background.tsx │ │ │ ├── Checkmark.tsx │ │ │ ├── Container.tsx │ │ │ ├── Default.tsx │ │ │ ├── Mixedmark.tsx │ │ │ ├── NativeControl.tsx │ │ │ ├── __tests__/ │ │ │ │ ├── Background.spec.tsx │ │ │ │ ├── Checkmark.spec.tsx │ │ │ │ ├── Container.spec.tsx │ │ │ │ ├── Default.spec.tsx │ │ │ │ ├── Mixedmark.spec.tsx │ │ │ │ ├── NativeControl.spec.tsx │ │ │ │ └── adapter.spec.ts │ │ │ ├── adapter.ts │ │ │ ├── constants.ts │ │ │ └── index.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── dialog/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── Backdrop.tsx │ │ │ ├── Body.tsx │ │ │ ├── Container.tsx │ │ │ ├── Footer/ │ │ │ │ ├── Button.tsx │ │ │ │ ├── Container.tsx │ │ │ │ ├── __tests__/ │ │ │ │ │ ├── Button.spec.tsx │ │ │ │ │ └── Container.spec.tsx │ │ │ │ ├── constants.ts │ │ │ │ └── index.ts │ │ │ ├── Header/ │ │ │ │ ├── Container.tsx │ │ │ │ ├── Title.tsx │ │ │ │ ├── __tests__/ │ │ │ │ │ ├── Container.spec.tsx │ │ │ │ │ └── Title.spec.tsx │ │ │ │ ├── constants.ts │ │ │ │ └── index.ts │ │ │ ├── Surface.tsx │ │ │ ├── __tests__/ │ │ │ │ ├── Backdrop.spec.tsx │ │ │ │ ├── Body.spec.tsx │ │ │ │ ├── Container.spec.tsx │ │ │ │ └── Surface.spec.tsx │ │ │ ├── adapter.ts │ │ │ ├── constants.ts │ │ │ └── index.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── drawer/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── Permanent/ │ │ │ │ ├── Container.tsx │ │ │ │ ├── Content.tsx │ │ │ │ ├── ToolbarSpacer.tsx │ │ │ │ ├── __tests__/ │ │ │ │ │ ├── Container.spec.tsx │ │ │ │ │ ├── Content.spec.tsx │ │ │ │ │ └── ToolbarSpacer.spec.tsx │ │ │ │ ├── constants.ts │ │ │ │ └── index.ts │ │ │ ├── Temporary/ │ │ │ │ ├── Container.tsx │ │ │ │ ├── Content.tsx │ │ │ │ ├── Drawer.tsx │ │ │ │ ├── Header.tsx │ │ │ │ ├── HeaderContent.tsx │ │ │ │ ├── ToolbarSpacer.tsx │ │ │ │ ├── __tests__/ │ │ │ │ │ ├── Container.spec.tsx │ │ │ │ │ ├── Content.spec.tsx │ │ │ │ │ ├── Drawer.spec.tsx │ │ │ │ │ ├── Header.spec.tsx │ │ │ │ │ ├── HeaderContent.spec.tsx │ │ │ │ │ └── ToolbarSpacer.spec.tsx │ │ │ │ ├── adapter.ts │ │ │ │ ├── constants.ts │ │ │ │ ├── drawerUtil.ts │ │ │ │ └── index.ts │ │ │ └── index.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── elevation/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── Elevation.tsx │ │ │ ├── __tests__/ │ │ │ │ ├── Elevation.spec.tsx │ │ │ │ └── utils.spec.ts │ │ │ ├── constants.ts │ │ │ ├── index.tsx │ │ │ ├── types.ts │ │ │ └── utils.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── fab/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── Container.tsx │ │ │ ├── Icon.tsx │ │ │ ├── __tests__/ │ │ │ │ ├── Container.spec.tsx │ │ │ │ └── Icon.spec.tsx │ │ │ ├── constants.ts │ │ │ └── index.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── form-field/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── FormField.tsx │ │ │ ├── __tests__/ │ │ │ │ └── FormField.spec.tsx │ │ │ ├── constants.ts │ │ │ └── index.tsx │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── layout-grid/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── Cell.tsx │ │ │ ├── Container.tsx │ │ │ ├── __tests__/ │ │ │ │ ├── Cell.spec.tsx │ │ │ │ ├── Container.spec.tsx │ │ │ │ └── utils.spec.ts │ │ │ ├── constants.ts │ │ │ ├── index.ts │ │ │ ├── types.ts │ │ │ └── utils.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── list/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── Container.tsx │ │ │ ├── Divider.tsx │ │ │ ├── Group/ │ │ │ │ ├── Container.tsx │ │ │ │ ├── Subheader.tsx │ │ │ │ ├── __tests__/ │ │ │ │ │ ├── Container.spec.tsx │ │ │ │ │ └── Subheader.spec.tsx │ │ │ │ ├── constants.ts │ │ │ │ └── index.ts │ │ │ ├── Item/ │ │ │ │ ├── Container.tsx │ │ │ │ ├── EndDetail.tsx │ │ │ │ ├── StartDetail.tsx │ │ │ │ ├── __tests__/ │ │ │ │ │ ├── Container.spec.tsx │ │ │ │ │ ├── EndDetail.spec.tsx │ │ │ │ │ └── StartDetail.spec.tsx │ │ │ │ ├── constants.ts │ │ │ │ └── index.ts │ │ │ ├── __tests__/ │ │ │ │ ├── Container.spec.tsx │ │ │ │ └── Divider.spec.tsx │ │ │ ├── constants.ts │ │ │ └── index.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── radio/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── Background.tsx │ │ │ ├── Container.tsx │ │ │ ├── Default.tsx │ │ │ ├── InnerCircle.tsx │ │ │ ├── NativeControl.tsx │ │ │ ├── OuterCircle.tsx │ │ │ ├── __tests__/ │ │ │ │ ├── Background.spec.tsx │ │ │ │ ├── Container.spec.tsx │ │ │ │ ├── Default.spec.tsx │ │ │ │ ├── InnerCircle.spec.tsx │ │ │ │ ├── NativeControl.spec.tsx │ │ │ │ ├── OuterCircle.spec.tsx │ │ │ │ └── adapter.spec.ts │ │ │ ├── adapter.ts │ │ │ ├── constants.ts │ │ │ └── index.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── react-material-components-web/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ └── index.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── ripple/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── Ripple.tsx │ │ │ ├── __tests__/ │ │ │ │ ├── Ripple.spec.tsx │ │ │ │ └── utils.spec.ts │ │ │ ├── adapter.ts │ │ │ ├── constants.ts │ │ │ ├── index.tsx │ │ │ ├── rippleUtil.ts │ │ │ ├── types.ts │ │ │ └── utils.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── switch/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── Background.tsx │ │ │ ├── Container.tsx │ │ │ ├── Default.tsx │ │ │ ├── Knob.tsx │ │ │ ├── Label.tsx │ │ │ ├── NativeControl.tsx │ │ │ ├── __tests__/ │ │ │ │ ├── Background.spec.tsx │ │ │ │ ├── Container.spec.tsx │ │ │ │ ├── Default.spec.tsx │ │ │ │ ├── Knob.tsx │ │ │ │ ├── Label.spec.tsx │ │ │ │ └── NativeControl.spec.tsx │ │ │ ├── constants.ts │ │ │ └── index.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── textfield/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── Container.tsx │ │ │ ├── Default.tsx │ │ │ ├── Input.tsx │ │ │ ├── Label.tsx │ │ │ ├── __tests__/ │ │ │ │ ├── Container.spec.tsx │ │ │ │ ├── Default.spec.tsx │ │ │ │ ├── Input.spec.tsx │ │ │ │ ├── Label.spec.tsx │ │ │ │ └── adapter.spec.ts │ │ │ ├── adapter.ts │ │ │ ├── constants.ts │ │ │ └── index.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── theme/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── Theme.tsx │ │ │ ├── __tests__/ │ │ │ │ ├── Theme.spec.tsx │ │ │ │ └── utils.spec.ts │ │ │ ├── constants.ts │ │ │ ├── index.ts │ │ │ ├── types.ts │ │ │ └── utils.ts │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── toolbar/ │ │ ├── .npmignore │ │ ├── package.json │ │ ├── src/ │ │ │ ├── Container.tsx │ │ │ ├── FixedToolbarAdjusted.tsx │ │ │ ├── Icon.tsx │ │ │ ├── Row.tsx │ │ │ ├── Section.tsx │ │ │ ├── Title.tsx │ │ │ ├── __tests__/ │ │ │ │ ├── Container.spec.tsx │ │ │ │ ├── FixedToolbarAdjusted.spec.tsx │ │ │ │ ├── Icon.spec.tsx │ │ │ │ ├── Row.spec.tsx │ │ │ │ ├── Section.spec.tsx │ │ │ │ ├── Title.spec.tsx │ │ │ │ └── utils.spec.ts │ │ │ ├── constants.tsx │ │ │ ├── index.ts │ │ │ ├── types.tsx │ │ │ └── utils.tsx │ │ ├── tsconfig.json │ │ └── tslint.json │ └── typography/ │ ├── .npmignore │ ├── package.json │ ├── src/ │ │ ├── Container.tsx │ │ ├── Text.tsx │ │ ├── __tests__/ │ │ │ ├── Container.spec.tsx │ │ │ ├── Text.spec.tsx │ │ │ └── utils.spec.ts │ │ ├── constants.tsx │ │ ├── index.tsx │ │ ├── shortcuts.tsx │ │ ├── types.tsx │ │ └── utils.tsx │ ├── tsconfig.json │ └── tslint.json ├── scripts/ │ ├── package.py │ └── requirements.txt ├── tsconfig.base.json ├── tsconfig.json ├── tslint.base.json └── tslint.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ ### Project ### # Docs /docs/build/ # Don't use yarn for library project yarn.lock # Transpiled source directory lib/ ### VS Code ### .vscode/ ### WebStorm ### .idea/ ### Node ### # Logs logs *.log npm-debug.log* # Compiled binary addons (http://nodejs.org/api/addons.html) build/Release # Dependency directories node_modules # Optional npm cache directory .npm # Optional eslint cache .eslintcache # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity ### For Vim Users ### # swap [._]*.s[a-v][a-z] [._]*.sw[a-p] [._]s[a-v][a-z] [._]sw[a-p] # session Session.vim # temporary .netrwhist *~ # auto-generated tag files tags ### Python ### *.pyc ### Jest Generated Files ### /packages/**/jest_0 ================================================ FILE: .npmignore ================================================ .git/ node_modules/ src/ yarn.lock **/__mocks__/** **/__tests__/** ================================================ FILE: .travis.yml ================================================ language: node_js node_js: - "7" sudo: false cache: directories: - "node_modules" before_script: - lerna bootstrap - npm run clean script: - npm run build - npm run test ================================================ FILE: README.md ================================================ React Material Components Web ============================= [![License: MIT](https://img.shields.io/github/license/mashape/apistatus.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/react-material-components-web.svg)](https://www.npmjs.com/package/react-material-components-web) [![Build Status](https://img.shields.io/travis/react-mdc/react-material-components-web.svg)](https://travis-ci.org/react-mdc/react-material-components-web) React wrapper of [Material Components Web]( https://github.com/material-components/material-components-web) Under Active Development ------------------------ The project is under active development. Every updates can contain breaking changes before 0.2.0. We **do not** recommend you to use this library for produciton applications at this time. Documentation ------------- You can find documentation with live demo at https://react-mdc.github.io/ Features -------- * Typed strictly with [TypeScript](http://typescriptlang.org) You can access typing support by also using TypeScript * Stylesheet independent Since *Material Components Web* can be customized with scss, it does not depend on specific stylesheet. You can load your own stylesheet or a default one. * Each component packaged individually Like *Material Components Web*, You can access all components individually, under [@react-mdc npm scope](https://www.npmjs.com/%7Ereact-mdc). Getting Start ------------- Install the library ``` bash $ npm install --save @react-mdc/typography ``` Import the stylesheet ``` html ``` Or load using webpack and scss-loader `my-mdc.scss` ``` scss // My main Sass file. $mdc-theme-primary: #9c27b0; $mdc-theme-accent: #76ff03; $mdc-theme-background: #fff; @import "material-components-web/material-components-web"; ``` `app.js` ``` javascript import * as React from 'react'; import * as ReactDOM from 'react-dom'; import "./stylesheets/my-mdc.scss"; import Main from './main.js'; ReactDOM.render(
, document.getElementById('root')); ``` And import *@react-mdc* then give it a shot. `main.js` ``` typescript import * as React from "react"; import Typography from "@react-mdc/typography"; export default class Main extends React.Component<{}, {}> { render () { return ( This is an example Hello world! ); } } ``` Setup for Development --------------------- Bootstrap ``` shell $ lerna bootstrap ``` Build ``` shell $ npm run build ``` Run Docs -------- ``` shell $ cd docs $ npm start ``` Watch for Changes and Build --------------------------- ``` shell $ npm run watch ``` Run Test -------- ``` shell $ npm test ``` to watch ``` shell $ npm test:watch ``` ================================================ FILE: docs/.gitignore ================================================ ### Typescript ### .awcache/ ### Node ### # Logs logs *.log npm-debug.log* # Compiled binary addons (http://nodejs.org/api/addons.html) build/Release # Dependency directories node_modules # Optional npm cache directory .npm # Optional eslint cache .eslintcache # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity ### For Vim Users ### # swap [._]*.s[a-v][a-z] [._]*.sw[a-p] [._]s[a-v][a-z] [._]sw[a-p] # session Session.vim # temporary .netrwhist *~ # auto-generated tag files tags ================================================ FILE: docs/config/webpack/app.js ================================================ const fs = require("fs"); const path = require("path"); const webpack = require("webpack"); const ExtractTextPlugin = require("extract-text-webpack-plugin"); const { TsConfigPathsPlugin, CheckerPlugin } = require("awesome-typescript-loader"); const { DOCS_ROOT, BUILD_PATH, SRC_ROOT, PRODUCTION } = require("./constants"); function loadManifest(name) { const manifestName = name + "-manifest.json"; return JSON.parse(fs.readFileSync(path.resolve(BUILD_PATH, manifestName), "utf-8")); } /* Configure plugins */ const extractVendorStyle = new ExtractTextPlugin({ filename: "vendor.css" }); const extractLocalStyle = new ExtractTextPlugin({ filename: "local.css" }); const ENV_PLUGINS = PRODUCTION ? [ new webpack.DefinePlugin({ "process.env": { NODE_ENV: JSON.stringify(process.env.NODE_ENV) } }), new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }) ] : []; module.exports = { context: DOCS_ROOT, entry: { app: [path.resolve(SRC_ROOT, "js", "index.tsx")] }, plugins: [ extractVendorStyle, extractLocalStyle, new webpack.DllReferencePlugin({ context: DOCS_ROOT, manifest: loadManifest("vendor") }), new TsConfigPathsPlugin(), new CheckerPlugin() ].concat(ENV_PLUGINS), output: { path: BUILD_PATH, publicPath: "/build/", filename: "bundle.js" }, resolve: { alias: { app: SRC_ROOT }, extensions: ["*", ".js", ".ts", ".tsx"] }, module: { loaders: [ /* Typescript */ { test: /\.tsx?$/, loader: "awesome-typescript-loader", options: { useCache: true, } }, { test: /\.tsx?$/, enforce: 'pre', loader: 'tslint-loader', options: { emitErrors: true, } }, /* Styles */ { // Don't compile external stylesheets test: /\.css$/, include: /node_modules/, loader: extractVendorStyle.extract({ use: "css-loader", // use style-loader in development fallback: "style-loader" }) }, /* SCSS */ { test: /\.scss$/, loader: extractLocalStyle.extract({ use: [{ loader: 'css-loader', options: { localIdentName: '[local]--[hash:base64:5]', importLoaders: 1 } }, 'postcss-loader', { loader: 'sass-loader', options: { includePaths: [ path.resolve(DOCS_ROOT, 'node_modules'), path.resolve(DOCS_ROOT, 'src') ] } } ], // use style-loader in development fallback: 'style-loader' }) }, /* Assets */ { exclude: [ /\.html$/, /\.(ts|tsx)$/, /\.css$/, /\.scss$/, /\.json$/, /\.svg$/, /\.js$/ ], loader: "url-loader", options: { limit: 10000, name: "static/media/[name].[hash:8].[ext]" } }, { test: /\.json$/, loader: "json-loader" }, { test: /\.svg$/, loader: "file-loader", query: { name: "static/media/[name].[hash:8].[ext]" } } ] }, devtool: "source-map" }; ================================================ FILE: docs/config/webpack/constants.js ================================================ const path = require("path"); const PROJECT_ROOT = module.exports.PROJECT_ROOT = path.resolve(__dirname, "..", "..", ".."); const DOCS_ROOT = module.exports.DOCS_ROOT = path.resolve(PROJECT_ROOT, "docs"); const BUILD_PATH = module.exports.BUILD_PATH = path.resolve(DOCS_ROOT, "build"); const SRC_ROOT = module.exports.SRC_ROOT = path.resolve(DOCS_ROOT, "src"); const PRODUCTION = module.exports.PRODUCTION = process.env.NODE_ENV === "production"; ================================================ FILE: docs/config/webpack/vendor.js ================================================ const path = require("path"); const webpack = require("webpack"); const { DOCS_ROOT, BUILD_PATH, PRODUCTION } = require("./constants"); const ENV_PLUGINS = PRODUCTION ? [ new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }), new webpack.DefinePlugin({ "process.env": { NODE_ENV: JSON.stringify(process.env.NODE_ENV) } }) ] : []; module.exports = { context: DOCS_ROOT, entry: { vendor: [path.resolve(DOCS_ROOT, "vendor.js")] }, plugins: [ new webpack.DllPlugin({ context: DOCS_ROOT, path: path.resolve(BUILD_PATH, "[name]-manifest.json"), name: "[name]_dll" }) ].concat(ENV_PLUGINS), output: { path: BUILD_PATH, publicPath: "/build/", filename: "[name].dll.js", library: "[name]_dll" }, devtool: "source-map" }; ================================================ FILE: docs/index.html ================================================ React Material Components Web: React Components for Material Components Web
Loading...
================================================ FILE: docs/package.json ================================================ { "name": "Document", "author": "Choi Geonu", "license": "MIT", "private": true, "dependencies": { "@react-mdc/base": "^0.1.12", "@react-mdc/button": "^0.1.8", "@react-mdc/card": "^0.1.9", "@react-mdc/checkbox": "^0.1.12", "@react-mdc/dialog": "^0.1.7", "@react-mdc/drawer": "^0.1.13", "@react-mdc/elevation": "^0.1.9", "@react-mdc/fab": "^0.1.9", "@react-mdc/form-field": "^0.1.8", "@react-mdc/layout-grid": "^0.1.9", "@react-mdc/list": "^0.1.9", "@react-mdc/radio": "^0.1.12", "@react-mdc/ripple": "^0.1.11", "@react-mdc/switch": "^0.1.9", "@react-mdc/textfield": "^0.1.11", "@react-mdc/theme": "^0.1.8", "@react-mdc/toolbar": "^0.1.11", "@react-mdc/typography": "^0.1.8", "@types/codemirror": "0.0.40", "@types/react": "^15.0.18", "@types/react-dom": "^0.14.23", "classnames": "^2.2.5", "codemirror": "^5.25.2", "core-js": "^2.4.1", "material-components-web": "^0.10.0", "react": "^15.0.0", "react-dom": "^15.4.2", "react-router": "^3.0.2" }, "devDependencies": { "@types/enzyme": "^2.8.0", "autoprefixer": "^7.0.1", "awesome-typescript-loader": "^3.1.3", "cross-env": "^4.0.0", "css-loader": "^0.28.1", "enzyme": "^2.8.2", "extract-text-webpack-plugin": "2.1.0", "file-loader": "^0.11.1", "gh-pages": "^1.0.0", "json-loader": "^0.5.4", "node-sass": "^4.5.0", "npm-run-all": "^4.0.2", "postcss-loader": "^2.0.5", "raw-loader": "^0.5.1", "sass-loader": "^6.0.5", "shelljs": "^0.7.7", "shx": "^0.2.2", "style-loader": "^0.17.0", "tslint": "^5.2.0", "tslint-loader": "^3.5.3", "tslint-react": "^3.0.0", "typescript": "^2.4.1", "url-loader": "^0.5.7", "webpack": "^2.2.1", "webpack-dev-server": "^2.3.0" }, "scripts": { "clean": "shx rm -rf build/", "precompile": "npm run clean", "postinstall": "npm run compile:vendor", "compile:vendor": "webpack --progress --config config/webpack/vendor.js", "compile:app": "webpack --progress --config config/webpack/app.js", "compile": "npm-run-all compile:vendor compile:app", "start:webpack-dev-server": "webpack-dev-server --progress --config config/webpack/app.js", "start": "npm-run-all compile:vendor start:webpack-dev-server", "release:compile": "cross-env NODE_ENV=production npm run compile", "release:gh-pages": "gh-pages -d . -m 'Update Docs' --remove node_modules --repo https://github.com/react-mdc/react-mdc.github.io.git --branch master --dotfiles true", "release": "npm-run-all clean release:compile release:gh-pages" }, "version": "0.1.7" } ================================================ FILE: docs/postcss.config.js ================================================ module.exports = { plugins: [ require('autoprefixer')({ /* ...options */ }) ] }; ================================================ FILE: docs/src/js/Container/MainToolbar.tsx ================================================ import * as React from "react"; import { Link } from "react-router"; import * as classNames from "classnames"; import Toolbar from "@react-mdc/toolbar"; import DarkTheme from "app/js/components/DarkTheme"; import { MaterialIcon } from "app/js/components/Icon"; import * as styles from "./styles.scss"; export type Props = { className?: string, }; export default class MainToolbar extends React.Component { public props: Props; public render() { return ( layers React Material Components Web ); } } ================================================ FILE: docs/src/js/Container/index.tsx ================================================ import * as React from "react"; import Toolbar from "@react-mdc/toolbar"; import Typography from "@react-mdc/typography"; import MainToolbar from "./MainToolbar"; import * as styles from "./styles.scss"; export default class Container extends React.Component<{ children?: React.ReactChild }, {}> { public render() { return ( {this.props.children} ); } } ================================================ FILE: docs/src/js/Container/styles.scss ================================================ @import "style/vars/theme"; :local { .container { flex: 1; } .toolbar { /* Codemirror has z-index > 3 */ z-index: 4; } .toolbar-title { text-decoration: none; @include mdc-theme-dark { @include mdc-theme-prop(color, text-primary-on-dark); } } .toolbar-icon { padding-right: 16px; } .toolbar-title-text { font-family: Roboto Mono; } } ================================================ FILE: docs/src/js/common/types.ts ================================================ ================================================ FILE: docs/src/js/compat.ts ================================================ /** * Compatibility */ // ES2017 Polyfills import "core-js/es7/index.js"; ================================================ FILE: docs/src/js/components/Code.tsx ================================================ import * as React from "react"; import * as classNames from "classnames"; import { default as CodeMirror, Props as CodeMirrorProps } from "./CodeMirror"; import * as styles from "./styles.scss"; type Props = CodeMirrorProps & { className?: string, options?: any, mode?: string, lineNumbers?: boolean, readOnly?: boolean, }; function ifNull(nullable: T | null | undefined, then: T): T { if (nullable == null) { return then; } else { return nullable; } } export default function Code(p: Props) { let { className, options, mode, lineNumbers, readOnly, ...props, } = p; className = classNames(styles.code, className); const mergedOptions: { [key: string]: any, } = {}; mergedOptions.mode = ifNull(mode, "jsx"); mergedOptions.lineNumbers = ifNull(lineNumbers, false); mergedOptions.readOnly = ifNull(readOnly, true); options = { ...mergedOptions, ...options, }; return (
); } ================================================ FILE: docs/src/js/components/CodeMirror.tsx ================================================ import * as React from "react"; import * as ReactDOM from "react-dom"; import * as classNames from "classnames"; import * as CodeMirror from "codemirror"; import * as _ from "lodash"; function normalizeLineEndings(str: string | null | undefined) { if (str == null) { return str; } return str.replace(/\r\n|\r/g, "\n"); } type CodemirrorType = typeof CodeMirror; export type Props = { value: string, className?: string, codeMirrorInstance?: CodemirrorType, defaultValue?: string, onFocusChange?: (focused: boolean) => void, onChange?: (value: string, change: CodeMirror.EditorChangeLinkedList) => void, onScroll?: (instance: CodeMirror.Editor) => void, options?: object, path?: string, preserveScrollPosition?: boolean, }; type State = { focused: false, }; export default class ReactCodemirror extends React.Component { public static defaultProps = { preserveScrollPosition: false, }; public state: State = { focused: false, }; private codeMirror: CodeMirror.EditorFromTextArea | null = null; public componentWillMount() { this.componentWillReceiveProps = _.debounce(this.componentWillReceiveProps, 0); } public componentWillUnmount() { // is there a lighter-weight way to remove the cm instance? if (this.codeMirror) { this.codeMirror.toTextArea(); } } public componentWillReceiveProps(nextProps: Props) { if (this.codeMirror && nextProps.value !== undefined && normalizeLineEndings(this.codeMirror.getValue()) !== normalizeLineEndings(nextProps.value)) { if (this.props.preserveScrollPosition) { const prevScrollPosition = this.codeMirror.getScrollInfo(); this.codeMirror.setValue(nextProps.value); this.codeMirror.scrollTo(prevScrollPosition.left, prevScrollPosition.top); } else { this.codeMirror.setValue(nextProps.value); } } if (this.codeMirror != null && typeof nextProps.options === "object") { for (const optionName in nextProps.options) { if (nextProps.options.hasOwnProperty(optionName)) { this.codeMirror.setOption(optionName, nextProps.options[optionName]); } } } } public render() { const editorClassName = classNames( "ReactCodeMirror", this.state.focused ? "ReactCodeMirror--focused" : null, this.props.className, ); return (