Repository: FormidableLabs/radium Branch: master Commit: b8faaa0c1c4c Files: 97 Total size: 305.1 KB Directory structure: gitextract_taxgn3kc/ ├── .agignore ├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .flowconfig ├── .gitignore ├── .npmignore.publishr ├── .prettierignore ├── .prettierrc ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE-examples.md ├── LICENSE.md ├── README.md ├── appveyor.yml ├── bower.json ├── docs/ │ ├── README.md │ ├── api/ │ │ └── README.md │ ├── faq/ │ │ └── README.md │ └── guides/ │ ├── README.md │ └── upgrade-v0.16.x.md ├── examples/ │ ├── app.js │ ├── client.js │ ├── common.styles.js │ ├── components/ │ │ ├── button.js │ │ └── computed-well.js │ ├── index.html │ ├── server.js │ └── webpack.config.js ├── index.js ├── interfaces/ │ ├── hoist-non-react-statics.js │ └── inline-style-prefixer.js ├── karma.conf.coverage.js ├── karma.conf.ie.js ├── karma.conf.js ├── package.json ├── scripts/ │ └── update-prefix-data.js ├── src/ │ ├── __mocks__/ │ │ ├── exenv.js │ │ └── prefixer.js │ ├── __tests__/ │ │ ├── camel-case-props-to-dash-case-test.js │ │ ├── clean-state-key-test.js │ │ ├── enhancer-test.js │ │ ├── get-radium-style-state-test.js │ │ ├── get-state-key-test.js │ │ ├── get-state-test.js │ │ ├── keyframes-test.js │ │ ├── media-query-test.js │ │ ├── radium-test.js │ │ ├── remove-nested-styles-test.js │ │ ├── resolve-styles-test.js │ │ ├── style-component-test.js │ │ └── visited-test.js │ ├── append-important-to-each-value.js │ ├── append-px-if-needed.js │ ├── camel-case-props-to-dash-case.js │ ├── clean-state-key.js │ ├── components/ │ │ ├── style-root.js │ │ ├── style-sheet.js │ │ └── style.js │ ├── config.js │ ├── context.js │ ├── css-rule-set-to-string.js │ ├── enhancer.js │ ├── get-radium-style-state.js │ ├── get-state-key.js │ ├── get-state.js │ ├── hash.js │ ├── index.js │ ├── keyframes.js │ ├── map-object.js │ ├── merge-styles.js │ ├── plugins/ │ │ ├── check-props-plugin.js │ │ ├── index.js │ │ ├── keyframes-plugin.js │ │ ├── merge-style-array-plugin.js │ │ ├── mouse-up-listener.js │ │ ├── prefix-plugin.js │ │ ├── remove-nested-styles-plugin.js │ │ ├── resolve-interaction-styles-plugin.js │ │ ├── resolve-media-queries-plugin.js │ │ └── visited-plugin.js │ ├── prefix-data/ │ │ ├── dynamic.js │ │ └── static.js │ ├── prefixer.js │ ├── resolve-styles.js │ ├── style-keeper.js │ └── test-helpers.js ├── test/ │ ├── .eslintrc │ ├── enhancer-test.js │ ├── mocha.opts │ ├── radium-test.js │ ├── setup.js │ └── utils.js ├── webpack.config.js └── webpack.config.minified.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .agignore ================================================ dist lib ================================================ FILE: .babelrc ================================================ { "plugins": [ "@babel/plugin-transform-destructuring", [ "@babel/plugin-proposal-decorators", { "legacy": true } ], [ "@babel/plugin-proposal-class-properties", { "loose": true, }, ], ], "presets": [ [ "@babel/preset-env", { "modules": false } ], "@babel/preset-flow", "@babel/preset-react" ], "env": { "commonjs": { "plugins": [ "@babel/plugin-transform-destructuring", [ "@babel/plugin-proposal-decorators", { "legacy": true } ], [ "@babel/plugin-proposal-class-properties", { "loose": true, }, ], ], "presets": [ [ "@babel/preset-env", { "modules": "commonjs" } ], "@babel/preset-flow", "@babel/preset-react" ], } } } ================================================ FILE: .editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] indent_style = space indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false ================================================ FILE: .eslintignore ================================================ dist lib es coverage examples/dist node_modules ================================================ FILE: .eslintrc ================================================ parser: "babel-eslint" parserOptions: ecmaVersion: 2018 sourceType: "module" ecmaFeatures: jsx: true plugins: ["react", "flowtype", "prettier", "react-hooks"] settings: react: pragma: "React" version: "detect" env: browser: true node: true amd: false mocha: true jasmine: false globals: require: true module: true expect: true sinon: true ReactElement: true Reflect: true rules: ########################################################################### # # # POSSIBLE ERRORS: these rules point out areas where you might have # # made mistakes. # # # ########################################################################### no-cond-assign: 2 # disallow assignment in conditional expressions no-console: 2 # disallow use of console no-constant-condition: 2 # disallow use of constant expressions in conditions no-control-regex: 2 # disallow control characters in regular expressions no-debugger: 2 # disallow use of debugger no-dupe-keys: 2 # disallow duplicate keys when creating object literals no-empty: 2 # disallow empty statements no-empty-character-class: 2 # disallow the use of empty character classes in regular expressions no-ex-assign: 2 # disallow assigning to the exception in a catch block no-extra-boolean-cast: 2 # disallow double-negation boolean casts in a boolean context no-extra-parens: 0 # disallow unnecessary parentheses # NOTE: Allow for `return (/* JSX STUFF*/);` situations no-extra-semi: 2 # disallow unnecessary semicolons no-func-assign: 2 # disallow overwriting functions written as function declarations no-inner-declarations: 2 # disallow function or variable declarations in nested blocks no-invalid-regexp: 2 # disallow invalid regular expression strings in the RegExp # constructor no-irregular-whitespace: 2 # disallow irregular whitespace outside of strings and comments no-negated-in-lhs: 2 # disallow negation of the left operand of an in expression no-obj-calls: 2 # disallow the use of object properties of the global object (Math # and JSON) as functions no-regex-spaces: 2 # disallow multiple spaces in a regular expression literal no-sparse-arrays: 2 # disallow sparse arrays no-unreachable: 2 # disallow unreachable statements after a return, throw, continue, # or break statement use-isnan: 2 # disallow comparisons with the value NaN valid-typeof: 2 # ensure that the results of typeof are compared against a # valid string valid-jsdoc: # ensure JSDoc comments are valid [1, { "prefer": { "return": "returns" }, "requireReturn": false }] ########################################################################### # # # BEST PRACTICES: these rules are designed to prevent you from making # # mistakes. They either prescribe a better way of doing something or # # help you avoid pitfalls. # # # ########################################################################### block-scoped-var: 2 # treat var statements as if they were block scoped complexity: [2, 250] # specify the maximum cyclomatic complexity allowed in a program consistent-return: 0 # require return statements to either always or never specify values curly: 2 # specify curly brace conventions for all control statements default-case: 2 # require default case in switch statements dot-notation: 2 # encourages use of dot notation whenever possible eqeqeq: 2 # require the use of === and !== guard-for-in: 2 # make sure for-in loops have an if statement no-alert: 2 # disallow the use of alert, confirm, and prompt no-caller: 2 # disallow use of arguments.caller or arguments.callee no-div-regex: 2 # disallow division operators explicitly at beginning of regular # expression no-else-return: 2 # disallow else after a return in an if no-eq-null: 2 # disallow comparisons to null without a type-checking operator no-eval: 2 # disallow use of eval() no-extend-native: 2 # disallow adding to native types no-extra-bind: 2 # disallow unnecessary function binding no-fallthrough: 2 # disallow fallthrough of case statements no-floating-decimal: 2 # disallow the use of leading or trailing decimal points in numeric # literals no-implied-eval: 2 # disallow use of eval()-like methods no-iterator: 2 # disallow usage of __iterator__ property no-labels: 2 # disallow use of labeled statements no-lone-blocks: 2 # disallow unnecessary nested blocks no-loop-func: 0 # disallow creation of functions within loops no-multi-spaces: 0 # disallow use of multiple spaces no-multi-str: 2 # disallow use of multiline strings no-native-reassign: 2 # disallow reassignments of native objects no-new: 2 # disallow use of new operator when not part of the assignment or # comparison no-new-func: 2 # disallow use of new operator for Function object no-new-wrappers: 2 # disallows creating new instances of String,Number, and Boolean no-octal: 2 # disallow use of octal literals no-octal-escape: 2 # disallow use of octal escape sequences in string literals, such as # `var foo = "Copyright \251"` no-process-env: 0 # disallow use of process.env no-proto: 2 # disallow usage of __proto__ property no-redeclare: 2 # disallow declaring the same variable more then once no-return-assign: 0 # disallow use of assignment in return statement no-script-url: 2 # disallow use of javascript urls. no-self-compare: 2 # disallow comparisons where both sides are exactly the same no-sequences: 2 # disallow use of comma operator no-unused-expressions: 0 # disallow usage of expressions in statement position no-void: 2 # disallow use of void operator no-warning-comments: 0 # disallow usage of configurable warning terms in comments - e.g. # TODO or FIXME no-with: 2 # disallow use of the with statement radix: 2 # require use of the second argument for parseInt() vars-on-top: 0 # requires to declare all vars on top of their containing scope wrap-iife: [2, "inside"] # require immediate function invocation to be wrapped in parentheses yoda: [2, "never"] # require or disallow Yoda conditions ########################################################################### # # # STRICT MODE: these rules relate to using strict mode. # # # ########################################################################### strict: [2, "global"] # require that all modules have use strict ########################################################################### # # # VARIABLES: these rules have to do with variable declarations. # # # ########################################################################### no-catch-shadow: 2 # disallow the catch clause parameter name being the same as a # variable in the outer scope no-delete-var: 2 # disallow deletion of variables no-label-var: 2 # disallow labels that share a name with a variable no-shadow: 2 # disallow declaration of variables already declared in the # outer scope no-shadow-restricted-names: 2 # disallow shadowing of names such as arguments no-undef: 2 # disallow use of undeclared variables unless mentioned in a # /*global */ block no-undef-init: 2 # disallow use of undefined when initializing variables no-undefined: 0 # disallow use of undefined variable no-unused-vars: 2 # disallow declaration of variables that are not used in # the code no-use-before-define: [2, { "functions": false }] # disallow use of variables before they are defined no-var: 2 ########################################################################### # # # NODE: these rules relate to functionality provided in Node.js. # # # ########################################################################### handle-callback-err: 0 # enforces error handling in callbacks no-mixed-requires: [2, true] # disallow mixing regular variable and require declarations no-new-require: 2 # disallow use of new operator with the require function no-path-concat: 2 # disallow string concatenation with __dirname and __filename no-process-exit: 0 # disallow process.exit() no-restricted-modules: 0 # restrict usage of specified node modules no-sync: 0 # disallow use of synchronous methods ########################################################################### # # # STYLISTIC ISSUES: these rules are purely matters of style and, # # while valueable to enforce consistently across a project, are # # quite subjective. # # # ########################################################################### brace-style: # enforce one true brace style [2, "1tbs", { "allowSingleLine": true }] camelcase: # require camel case names, except in properties [2, { "properties": "never" }] comma-spacing: 2 # enforce spacing before and after comma consistent-this: [2, "self"] # enforces consistent naming when capturing the current execution context eol-last: 2 # enforce newline at the end of file, with no multiple empty lines func-names: 0 # require function expressions to have a name func-style: [0, "expression"] # enforces use of function expressions key-spacing: 2 # enforces spacing between keys and values in object literal properties max-nested-callbacks: [2, 4] # specify the maximum depth callbacks can be nested new-cap: 0 # require a capital letter for constructors new-parens: 2 # disallow the omission of parentheses when invoking a constructor with no arguments no-array-constructor: 2 # disallow use of the Array constructor no-lonely-if: 0 # disallow if as the only statement in an else block no-mixed-spaces-and-tabs: 2 # disallow mixed spaces and tabs for indentation no-nested-ternary: 2 # disallow nested ternary expressions no-new-object: 2 # disallow use of the Object constructor semi-spacing: 2 # disallow space before semicolon no-spaced-func: 2 # disallow space between function identifier and application no-ternary: 0 # disallow the use of ternary operators no-trailing-spaces: 2 # disallow trailing whitespace at the end of lines no-multiple-empty-lines: 2 # disallow multiple empty lines no-underscore-dangle: 0 # disallow dangling underscores in identifiers one-var: 0 # allow just one var statement per function padded-blocks: 0 # enforce padding within blocks quotes: # specify whether double or single quotes should be used [2, "single", "avoid-escape"] quote-props: 0 # require quotes around object literal property names semi: [2, "always"] # require or disallow use of semicolons instead of ASI sort-vars: 0 # sort variables within the same declaration block keyword-spacing: # require a space before and after certain keywords ["error", {"before": true, "after": true }] space-before-blocks: 2 # require or disallow space before blocks space-in-brackets: 0 # require or disallow spaces inside brackets space-in-parens: 0 # require or disallow spaces inside parentheses space-infix-ops: 2 # require spaces around operators spaced-comment: 2 # require or disallow a space immediately following # the // in a line comment wrap-regex: 0 # require regex literals to be wrapped in parentheses space-before-function-paren: [2, "never"] ########################################################################### # # # LEGACY: these rules are included for compatibility with JSHint and # # JSLint. While the names of the rules may not match up with their # # JSHint/JSLint counterpart, the functionality is the same. # # # ########################################################################### max-depth: 0 # specify the maximum depth that blocks can be nested max-len: [2, 100, 4] # specify the maximum length of a line in your program max-params: [2, 5] # limits the number of parameters that can be used in the function # declaration max-statements: 0 # specify the maximum number of statement allowed in a function no-bitwise: 0 # disallow use of bitwise operators no-plusplus: 0 # disallow use of unary operators, ++ and -- ########################################################################### # # # React JSX # # # ########################################################################### jsx-quotes: 2 react/jsx-boolean-value: 2 react/jsx-no-undef: 2 react/jsx-sort-props: 2 react/jsx-uses-react: 2 react/jsx-uses-vars: 2 react/no-did-mount-set-state: 2 react/no-did-update-set-state: 2 react/no-multi-comp: 0 react/no-unknown-property: 2 react/prop-types: 0 react/react-in-jsx-scope: 2 react/self-closing-comp: 2 react/sort-comp: 2 react/sort-prop-types: 2 react/jsx-wrap-multilines: 2 ########################################################################### # # # Flowtype # # # ########################################################################### flowtype/define-flow-type: 2 flowtype/use-flow-type: 2 ########################################################################### # # # Prettier # # # ########################################################################### prettier/prettier: [ "error", { "bracketSpacing": false, "singleQuote": true, "parser": "babylon" } ] ########################################################################### # # # React Hooks # # # ########################################################################### react-hooks/rules-of-hooks: 2 react-hooks/exhaustive-deps: 2 ================================================ FILE: .flowconfig ================================================ [ignore] .*/dist/.* .*/lib/.* .*/node_modules/.*/node_modules/.* .*/node_modules/babel-core/.* .*/node_modules/babel-loader/.* .*/node_modules/babel-register/.* .*/node_modules/config-chain/.* .*/node_modules/flow-bin/.* .*/node_modules/inline-style-prefixer/.* .*/node_modules/invariant/.* .*/node_modules/mkdirp/.* .*/node_modules/nodemon/.* .*/node_modules/npmconf/.* .*/node_modules/react-hot-loader/.* .*/node_modules/rimraf/.* .*/node_modules/watchify/.* .*/node_modules/webpack-dev-server/.* .*/node_modules/webpack/.* .*/node_modules/hoist-non-react-statics/.* [include] src [libs] interfaces [options] esproposal.class_static_fields=enable esproposal.class_instance_fields=enable ================================================ FILE: .gitignore ================================================ ### SublimeText ### *.sublime-workspace ### OSX ### .AppleDouble .DS_Store .LSOverride Icon # Thumbnails ._* # Files that might appear on external disk .Spotlight-V100 .Trashes ### Windows ### # Windows image file caches ehthumbs.db Thumbs.db # Folder config file Desktop.ini # Recycle Bin used on file shares $RECYCLE.BIN/ # App specific .tmp .vscode _site coverage dist es lib node_modules npm-debug.log* yarn-error.log* package-lock.json ================================================ FILE: .npmignore.publishr ================================================ /* !/es !/dist !/docs !/lib !/src !LICENSE.txt !CHANGELOG.md !README.md !package.json ================================================ FILE: .prettierignore ================================================ dist lib es coverage examples/dist node_modules ================================================ FILE: .prettierrc ================================================ { "bracketSpacing": false, "singleQuote": true } ================================================ FILE: .travis.yml ================================================ dist: trusty language: node_js addons: chrome: stable node_js: - "8" - "10" - "12" # Use container-based Travis infrastructure. sudo: false before_install: # GUI for real browsers. - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start # Headless chrome - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost & branches: only: - master notifications: email: on_success: change on_failure: always cache: yarn script: # Output useful info for debugging. - node --version - yarn --version # Make sure we can actually build the examples. - yarn run build-examples # Run tests - yarn run lint - yarn run build - yarn run test-coverage # Upload to coveralls, but don't _fail_ if coveralls is down. - cat coverage/lcov.info | node_modules/.bin/coveralls || echo "Coveralls upload failed" ================================================ FILE: CHANGELOG.md ================================================ # Radium Changelog ## 0.26.2 - Update `peerDependencies` for React to include 17. ## 0.26.1 (September 29, 2020) #### Dependency Upgrades - Bump handlebars from 4.1.2 to 4.5.3 (#1035) - Bump elliptic from 6.4.0 to 6.5.3 (#1045) - Bump eslint-utils from 1.3.1 to 1.4.3 (#1039) - Bump tree-kill from 1.2.0 to 1.2.2 (#1046) - Bump websocket-extensions from 0.1.1 to 0.1.4 (#1044) - Bump fstream from 1.0.11 to 1.0.12 (#1038) - Bump sshpk from 1.11.0 to 1.16.1 (#1037) - Bump webpack-dev-server from 2.11.1 to 3.1.11 (#1036) - Bump is-my-json-valid from 2.16.0 to 2.20.5 (#1048) - Bump http-proxy from 1.16.2 to 1.18.1 (#1047) #### Bug Fixes - Fix initial enhancer state for fn components (#1041) ## 0.26.0 (September 5, 2019) #### Bug Fixes - Add hook and forwardRef support (#1027) #### Breaking Changes - Radium now requires React@16.8.0+ (#1027) ## 0.25.2 (June 7, 2019) #### Bug Fixes - Bump handlebars from 4.0.6 to 4.1.2 (#1026) - Fixed bug with undefined \_extraRadiumStateKeys (#1025) - Update unitless CSS property list and licensing (#1020) ## 0.25.1 (December 16, 2018) #### Bug Fixes - Pass `snapshot` argument to `componentDidUpdate (#1013) #### Infra/Tooling - Fix console warnings when running examples (#1002) - Upgrade karma to 3.0 (#1003) - Refactor enhancer for readability (#1004) - Replace Isparta with Istanbul (#1011) - Prettier (#1012) ## 0.25.0 (September 16, 2018) - Use `Reflect` to construct es native classes in a way that preserves the value of `this` used in the constructor. (#999, #1001) - Handle multiple animationName props (#909) ## 0.24.1 (July 9, 2018) - Make `` manually update ` ``` ### Props #### rules An object of CSS rules to render. Each key of the rules object is a CSS selector and the value is an object of styles. If rules is empty, the component will render nothing. ```jsx var Radium = require('radium'); var Style = Radium.Style; // or import Radium, { Style } from 'radium';