UNPKG

29.2 kBSource Map (JSON)View Raw
1{"version":3,"file":"glamorous.umd.tiny.js","sources":["../src/constants.js","../src/react-compat.js","../src/with-theme.js","../src/get-glamor-classname.js","../src/create-glamorous.js","../src/tiny.js"],"sourcesContent":["/* istanbul ignore next */\nimport preval from 'preval.macro'\n\nexport const CHANNEL = '__glamorous__'\nexport const isPreact = preval`module.exports = process.env.BUILD_PREACT === 'true'`\n","import React from 'react'\nimport codegen from 'codegen.macro'\nimport {isPreact} from './constants'\n\nlet PropTypes\n\n/* istanbul ignore next */\nif (isPreact) {\n if (!React.PropTypes) {\n PropTypes = () => PropTypes\n const allTypes = [\n 'array',\n 'bool',\n 'func',\n 'number',\n 'object',\n 'string',\n 'symbol',\n 'any',\n 'arrayOf',\n 'element',\n 'instanceOf',\n 'node',\n 'objectOf',\n 'oneOf',\n 'oneOfType',\n 'shape',\n 'exact',\n ]\n allTypes.forEach(type => {\n PropTypes[type] = PropTypes\n })\n }\n // copied from preact-compat\n /* eslint-disable no-eq-null, eqeqeq, consistent-return */\n if (!React.Children) {\n const Children = {\n map(children, fn, ctx) {\n if (children == null) {\n return null\n }\n children = Children.toArray(children)\n if (ctx && ctx !== children) {\n fn = fn.bind(ctx)\n }\n return children.map(fn)\n },\n forEach(children, fn, ctx) {\n if (children == null) {\n return null\n }\n children = Children.toArray(children)\n if (ctx && ctx !== children) {\n fn = fn.bind(ctx)\n }\n children.forEach(fn)\n },\n count(children) {\n return (children && children.length) || 0\n },\n only(children) {\n children = Children.toArray(children)\n if (children.length !== 1) {\n throw new Error('Children.only() expects only one child.')\n }\n return children[0]\n },\n toArray(children) {\n if (children == null) {\n return []\n }\n return [].concat(children)\n },\n }\n React.Children = Children\n }\n /* eslint-enable no-eq-null, eqeqeq, consistent-return */\n} else if (parseFloat(React.version.slice(0, 4)) >= 15.5) {\n /* istanbul ignore next */\n try {\n PropTypes = codegen`\n if (process.env.BUILD_FORMAT === 'umd') {\n module.exports = \"(typeof window !== 'undefined' ? window : global).PropTypes\"\n } else {\n module.exports = \"require('prop-types')\"\n }\n `\n /* istanbul ignore next */\n } catch (error) {\n // ignore\n }\n}\n/* istanbul ignore next */\nPropTypes = PropTypes || React.PropTypes\n\nexport {PropTypes}\n\n/*\neslint\n import/no-mutable-exports:0,\n import/prefer-default-export:0,\n react/no-deprecated:0\n */\n","import React from 'react'\n\nimport {CHANNEL} from './constants'\nimport {PropTypes} from './react-compat'\n\nfunction generateWarningMessage(Comp) {\n const componentName = Comp.displayName || Comp.name || 'FunctionComponent'\n // eslint-disable-next-line max-len\n return `glamorous warning: Expected component called \"${componentName}\" which uses withTheme to be within a ThemeProvider but none was found.`\n}\n\nexport default function withTheme(\n ComponentToTheme,\n {noWarn = false, createElement = true} = {},\n) {\n class ThemedComponent extends React.Component {\n static propTypes = {\n theme: PropTypes.object,\n }\n warned = noWarn\n state = {theme: {}}\n setTheme = theme => this.setState({theme})\n\n // eslint-disable-next-line complexity\n componentWillMount() {\n if (!this.context[CHANNEL]) {\n if (process.env.NODE_ENV !== 'production' && !this.warned) {\n this.warned = true\n // eslint-disable-next-line no-console\n console.warn(generateWarningMessage(ComponentToTheme))\n }\n }\n const {theme} = this.props\n if (this.context[CHANNEL]) {\n // if a theme is provided via props,\n // it takes precedence over context\n this.setTheme(theme ? theme : this.context[CHANNEL].getState())\n } else {\n this.setTheme(theme || {})\n }\n }\n\n componentWillReceiveProps(nextProps) {\n if (this.props.theme !== nextProps.theme) {\n this.setTheme(nextProps.theme)\n }\n }\n\n componentDidMount() {\n if (this.context[CHANNEL] && !this.props.theme) {\n // subscribe to future theme changes\n this.subscriptionId = this.context[CHANNEL].subscribe(this.setTheme)\n }\n }\n\n componentWillUnmount() {\n // cleanup subscription\n this.subscriptionId &&\n this.context[CHANNEL].unsubscribe(this.subscriptionId)\n }\n\n render() {\n if (createElement) {\n return <ComponentToTheme {...this.props} {...this.state} />\n } else {\n // this allows us to effectively use the GlamorousComponent\n // as our `render` method without going through lifecycle hooks.\n // Also allows us to forward the context in the scenario where\n // a user wants to add more context.\n // eslint-disable-next-line babel/new-cap\n return ComponentToTheme.call(\n this,\n {...this.props, ...this.state},\n this.context,\n )\n }\n }\n }\n\n const defaultContextTypes = {\n [CHANNEL]: PropTypes.object,\n }\n\n let userDefinedContextTypes = null\n\n // configure the contextTypes to be settable by the user,\n // however also retaining the glamorous channel.\n Object.defineProperty(ThemedComponent, 'contextTypes', {\n enumerable: true,\n configurable: true,\n set(value) {\n userDefinedContextTypes = value\n },\n get() {\n // if the user has provided a contextTypes definition,\n // merge the default context types with the provided ones.\n if (userDefinedContextTypes) {\n return {\n ...defaultContextTypes,\n ...userDefinedContextTypes,\n }\n }\n return defaultContextTypes\n },\n })\n\n return ThemedComponent\n}\n","import {css, styleSheet} from 'glamor'\n/**\n * This function takes a className string and gets all the\n * associated glamor styles. It's used to merge glamor styles\n * from a className to make sure that specificity is not\n * a problem when passing a className to a component.\n * @param {String} [className=''] the className string\n * @return {Object} { glamorStyles, glamorlessClassName }\n * - glamorStyles is an array of all the glamor styles objects\n * - glamorlessClassName is the rest of the className string\n * without the glamor classNames\n */\nfunction extractGlamorStyles(className) {\n const glamorlessClassName = []\n const glamorStyles = []\n className\n .toString()\n .split(' ')\n .forEach(name => {\n if (styleSheet.registered[name.substring(4)] === undefined) {\n glamorlessClassName.push(name)\n } else {\n const style = buildGlamorSrcFromClassName(name)\n glamorStyles.push(style)\n }\n })\n\n return {glamorlessClassName, glamorStyles}\n}\n\n/** Glamor's css function returns an object with the shape\n *\n * {\n * [`data-css-${hash}`]: '',\n * toString() { return `css-${hash}` }\n * }\n *\n * Whenever glamor's build function encounters an object with\n * this shape it just pulls the resulting styles from the cache.\n *\n * note: the toString method is not needed to qualify the shape\n **/\nfunction buildGlamorSrcFromClassName(className) {\n return {[`data-${className}`]: ''}\n}\n\nexport default getGlamorClassName\n\nfunction getGlamorClassName({\n styles,\n props,\n cssOverrides,\n cssProp,\n context,\n displayName,\n}) {\n const {mappedArgs, nonGlamorClassNames} = handleStyles(\n [...styles, props.className, cssOverrides, cssProp],\n props,\n context,\n )\n // eslint-disable-next-line max-len\n const isDev = process.env.NODE_ENV === 'development' || !process.env.NODE_ENV\n const devRules = isDev ? {label: displayName} : null\n const glamorClassName = css(devRules, ...mappedArgs).toString()\n const extras = nonGlamorClassNames.join(' ').trim()\n return `${glamorClassName} ${extras}`.trim()\n}\n\n// this next function is on a \"hot\" code-path\n// so it's pretty complex to make sure it's fast.\n// eslint-disable-next-line complexity\nfunction handleStyles(styles, props, context) {\n let current\n const mappedArgs = []\n const nonGlamorClassNames = []\n for (let i = 0; i < styles.length; i++) {\n current = styles[i]\n while (typeof current === 'function') {\n current = current(props, context)\n }\n if (typeof current === 'string') {\n const {glamorStyles, glamorlessClassName} = extractGlamorStyles(current)\n mappedArgs.push(...glamorStyles)\n nonGlamorClassNames.push(...glamorlessClassName)\n } else if (Array.isArray(current)) {\n const recursed = handleStyles(current, props, context)\n mappedArgs.push(...recursed.mappedArgs)\n nonGlamorClassNames.push(...recursed.nonGlamorClassNames)\n } else {\n mappedArgs.push(current)\n }\n }\n return {mappedArgs, nonGlamorClassNames}\n}\n","/*\n * This is a relatively small abstraction that's ripe for open sourcing.\n * Documentation is in the README.md\n */\nimport React from 'react'\nimport {PropTypes} from './react-compat'\nimport withTheme from './with-theme'\nimport getGlamorClassName from './get-glamor-classname'\n\nexport default createGlamorous\n\nfunction createGlamorous(splitProps) {\n return glamorous\n\n /**\n * This is the main export and the function that people\n * interact with most directly.\n *\n * It accepts a component which can be a string or\n * a React Component and returns\n * a \"glamorousComponentFactory\"\n * @param {String|ReactComponent} comp the component to render\n * @param {Object} options helpful info for the GlamorousComponents\n * @return {Function} the glamorousComponentFactory\n */\n function glamorous(comp, config = {}) {\n const {\n rootEl,\n displayName,\n shouldClassNameUpdate,\n filterProps = [],\n forwardProps = [],\n propsAreCssOverrides = comp.propsAreCssOverrides,\n withProps: basePropsToApply,\n } = config\n Object.assign(glamorousComponentFactory, {withConfig})\n return glamorousComponentFactory\n\n function withConfig(newConfig) {\n return glamorous(comp, {...config, ...newConfig})\n }\n\n /**\n * This returns a React Component that renders the comp (closure)\n * with a className based on the given glamor styles object(s)\n * @param {...Object|Function} styles the styles to create with glamor.\n * If any of these are functions, they are invoked with the component\n * props and the return value is used.\n * @return {ReactComponent} the ReactComponent function\n */\n function glamorousComponentFactory(...styles) {\n /**\n * This is a component which will render the comp (closure)\n * with the glamorous styles (closure). Forwards any valid\n * props to the underlying component.\n */\n const GlamorousComponent = withTheme(\n function GlamorousInnerComponent(props, context) {\n props = getPropsToApply(\n GlamorousComponent.propsToApply,\n {},\n props,\n context,\n )\n const updateClassName = shouldUpdate(props, context, this.previous)\n\n if (shouldClassNameUpdate) {\n this.previous = {props, context}\n }\n\n const {toForward, cssOverrides, cssProp} = splitProps(\n props,\n GlamorousComponent,\n )\n\n // create className to apply\n this.className = updateClassName\n ? getGlamorClassName({\n styles: GlamorousComponent.styles,\n props,\n cssOverrides,\n cssProp,\n context,\n displayName: GlamorousComponent.displayName,\n })\n : this.className\n\n return React.createElement(GlamorousComponent.comp, {\n // if innerRef is forwarded we don't want to apply it here\n ref: 'innerRef' in toForward ? undefined : props.innerRef,\n ...toForward,\n className: this.className,\n })\n },\n {noWarn: true, createElement: false},\n )\n\n GlamorousComponent.propTypes = {\n // className accepts an object due to glamor's css function\n // returning an object with a toString method that gives the className\n className: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n cssOverrides: PropTypes.object,\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n glam: PropTypes.object,\n }\n\n function withComponent(newComp, options = {}) {\n const {\n forwardProps: fwp,\n filterProps: flp,\n ...componentProperties\n } = GlamorousComponent\n return glamorous(\n {\n ...componentProperties,\n comp: newComp,\n rootEl: getRootEl(newComp),\n },\n {\n // allows the forwardProps and filterProps to be overridden\n forwardProps: fwp,\n filterProps: flp,\n ...options,\n },\n )()\n }\n\n function withProps(...propsToApply) {\n return glamorous(GlamorousComponent, {withProps: propsToApply})()\n }\n\n function shouldUpdate(props, context, previous) {\n // exiting early so components which do not use this\n // optimization are not penalized by hanging onto\n // references to previous props and context\n if (!shouldClassNameUpdate) {\n return true\n }\n let update = true\n if (previous) {\n if (\n !shouldClassNameUpdate(\n previous.props,\n props,\n previous.context,\n context,\n )\n ) {\n update = false\n }\n }\n\n return update\n }\n\n Object.assign(\n GlamorousComponent,\n getGlamorousComponentMetadata({\n comp,\n styles,\n rootEl,\n filterProps,\n forwardProps,\n displayName,\n propsToApply: basePropsToApply,\n }),\n {\n isGlamorousComponent: true,\n propsAreCssOverrides,\n withComponent,\n withProps,\n withConfig,\n },\n )\n return GlamorousComponent\n }\n }\n\n function getGlamorousComponentMetadata({\n comp,\n styles,\n rootEl,\n filterProps,\n forwardProps,\n displayName,\n propsToApply: basePropsToApply,\n }) {\n const componentsComp = comp.comp ? comp.comp : comp\n const propsToApply = comp.propsToApply\n ? [...comp.propsToApply, ...arrayify(basePropsToApply)]\n : arrayify(basePropsToApply)\n return {\n // join styles together (for anyone doing: glamorous(glamorous.a({}), {}))\n styles: when(comp.styles, styles),\n // keep track of the ultimate rootEl to render (we never\n // actually render anything but\n // the base component, even when people wrap a glamorous\n // component in glamorous\n comp: componentsComp,\n rootEl: rootEl || getRootEl(comp),\n // join forwardProps and filterProps\n // (for anyone doing: glamorous(glamorous.a({}), {}))\n forwardProps: when(comp.forwardProps, forwardProps),\n filterProps: when(comp.filterProps, filterProps),\n // set the displayName to something that's slightly more\n // helpful than `GlamorousComponent` :)\n displayName: displayName || `glamorous(${getDisplayName(comp)})`,\n // these are props that should be applied to the component at render time\n propsToApply,\n }\n }\n}\n\n/**\n * reduces the propsToApply given to a single props object\n * @param {Array} propsToApply an array of propsToApply objects:\n * - object\n * - array of propsToApply items\n * - function that accepts the accumulated props and the context\n * @param {Object} accumulator an object to apply props onto\n * @param {Object} props the props that should ultimately take precedence\n * @param {*} context the context object\n * @return {Object} the reduced props\n */\nfunction getPropsToApply(propsToApply, accumulator, props, context) {\n // using forEach rather than reduce here because the reduce solution\n // effectively did the same thing because we manipulate the `accumulator`\n propsToApply.forEach(propsToApplyItem => {\n if (typeof propsToApplyItem === 'function') {\n return Object.assign(\n accumulator,\n propsToApplyItem(Object.assign({}, accumulator, props), context),\n )\n } else if (Array.isArray(propsToApplyItem)) {\n return Object.assign(\n accumulator,\n getPropsToApply(propsToApplyItem, accumulator, props, context),\n )\n }\n return Object.assign(accumulator, propsToApplyItem)\n })\n // props wins\n return Object.assign(accumulator, props)\n}\n\nfunction arrayify(x = []) {\n return Array.isArray(x) ? x : [x]\n}\n\nfunction when(comp, prop) {\n return comp ? comp.concat(prop) : prop\n}\n\nfunction getRootEl(comp) {\n return comp.rootEl ? comp.rootEl : comp.comp || comp\n}\n\nfunction getDisplayName(comp) {\n return typeof comp === 'string'\n ? comp\n : comp.displayName || comp.name || 'unknown'\n}\n","/* eslint no-unused-vars:0 */\nimport createGlamorous from './create-glamorous'\n\nfunction splitProps(\n {\n css: cssProp,\n innerRef,\n // these are plucked off\n theme, // because they\n className, // should never\n glam, // be forwarded\n // to the lower\n // component ever\n ...rest\n },\n {forwardProps},\n) {\n // forward innerRef if user wishes to do so\n if (innerRef !== undefined && forwardProps.indexOf('innerRef') !== -1) {\n rest.innerRef = innerRef\n }\n return {toForward: rest, cssProp}\n}\n\nconst glamorous = createGlamorous(splitProps)\n\nexport default glamorous\n"],"names":["CHANNEL","isPreact","PropTypes","React","forEach","type","Children","children","fn","ctx","toArray","bind","map","length","Error","concat","parseFloat","version","slice","error","generateWarningMessage","Comp","componentName","displayName","name","withTheme","ComponentToTheme","noWarn","createElement","ThemedComponent","warned","state","theme","setTheme","setState","componentWillMount","context","warn","props","getState","componentWillReceiveProps","nextProps","componentDidMount","subscriptionId","subscribe","componentWillUnmount","unsubscribe","render","call","Component","propTypes","object","defaultContextTypes","userDefinedContextTypes","defineProperty","value","extractGlamorStyles","className","glamorlessClassName","glamorStyles","toString","split","styleSheet","registered","substring","undefined","push","style","buildGlamorSrcFromClassName","getGlamorClassName","styles","cssOverrides","cssProp","handleStyles","mappedArgs","nonGlamorClassNames","devRules","label","glamorClassName","css","extras","join","trim","current","i","Array","isArray","recursed","createGlamorous","splitProps","glamorous","comp","config","rootEl","shouldClassNameUpdate","filterProps","forwardProps","propsAreCssOverrides","basePropsToApply","withProps","assign","glamorousComponentFactory","withConfig","newConfig","GlamorousComponent","getPropsToApply","propsToApply","updateClassName","shouldUpdate","previous","toForward","innerRef","oneOfType","string","func","update","getGlamorousComponentMetadata","newComp","options","fwp","flp","componentProperties","getRootEl","componentsComp","arrayify","when","getDisplayName","accumulator","propsToApplyItem","Object","x","prop","glam","rest","indexOf"],"mappings":";;;;;;;;AAGO,IAAMA,UAAU,eAAhB;;AACP,AAAO,IAAMC,WAJL,KAID;;ACAP,IAAIC,mBAAJ;;;AAGA,IAAID,QAAJ,EAAc;MACR,CAACE,MAAMD,SAAX,EAAsB;iBACR;aAAMA,UAAN;KAAZ;;KAEE,OADe,EAEf,MAFe,EAGf,MAHe,EAIf,QAJe,EAKf,QALe,EAMf,QANe,EAOf,QAPe,EAQf,KARe,EASf,SATe,EAUf,SAVe,EAWf,YAXe,EAYf,MAZe,EAaf,UAbe,EAcf,OAde,EAef,WAfe,EAgBf,OAhBe,EAiBf,OAjBe,CAmBjB,CAASE,OAAT,CAAiB,gBAAQ;iBACbC,IAAV,IAAkBH,UAAlB;KADF;;;;MAME,CAACC,MAAMG,QAAX,EAAqB;QACbA,WAAW;SAAA,eACXC,QADW,EACDC,EADC,EACGC,GADH,EACQ;YACjBF,YAAY,IAAhB,EAAsB;iBACb,IAAP;;mBAESD,SAASI,OAAT,CAAiBH,QAAjB,CAAX;YACIE,OAAOA,QAAQF,QAAnB,EAA6B;eACtBC,GAAGG,IAAH,CAAQF,GAAR,CAAL;;eAEKF,SAASK,GAAT,CAAaJ,EAAb,CAAP;OATa;aAAA,mBAWPD,QAXO,EAWGC,EAXH,EAWOC,GAXP,EAWY;YACrBF,YAAY,I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