{"version":3,"file":"glamorous.umd.js","sources":["../src/dom-elements.js","../src/constants.js","../src/react-compat.js","../src/with-theme.js","../node_modules/brcast/dist/brcast.es.js","../src/theme-provider.js","../src/get-glamor-classname.js","../src/create-glamorous.js","../node_modules/fast-memoize/src/index.js","../node_modules/react-html-attributes/dist/index.js","../src/react-props.js","../src/should-forward-property.js","../src/split-props.js","../src/index.js","../src/umd-entry.js"],"sourcesContent":["import htmlTagNames from 'html-tag-names'\nimport svgTagNames from 'svg-tag-names'\n\nconst domElements = htmlTagNames\n .concat(svgTagNames)\n .filter((tag, index, array) => array.indexOf(tag) === index)\n\nexport default domElements\n","export const CHANNEL = '__glamorous__'\n","import React from 'react'\n\nlet PropTypes\n\n/* istanbul ignore next */\nif (React.version.slice(0, 4) === '15.5') {\n /* istanbul ignore next */\n try {\n PropTypes = require('prop-types')\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, {Component} from 'react'\n\nimport {CHANNEL} from './constants'\nimport {PropTypes} from './react-compat'\n\nfunction generateWarningMessage(componentName) {\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(ComponentToTheme) {\n class ThemedComponent extends Component {\n state = {theme: {}}\n setTheme = theme => this.setState({theme})\n\n componentWillMount() {\n if (!this.context[CHANNEL]) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\n generateWarningMessage(\n ComponentToTheme.displayName ||\n ComponentToTheme.name ||\n 'Stateless Function',\n ),\n )\n }\n\n return\n }\n\n this.setState({theme: this.context[CHANNEL].getState()})\n }\n\n componentDidMount() {\n if (this.context[CHANNEL]) {\n this.unsubscribe = this.context[CHANNEL].subscribe(this.setTheme)\n }\n }\n\n componentWillUnmount() {\n // cleanup subscription\n this.unsubscribe && this.unsubscribe()\n }\n\n render() {\n return \n }\n }\n\n ThemedComponent.contextTypes = {\n [CHANNEL]: PropTypes.object,\n }\n\n return ThemedComponent\n}\n","function createBroadcast (initialState) {\n var listeners = [];\n var _state = initialState;\n\n var getState = function () { return _state; };\n\n var setState = function (state) {\n _state = state;\n listeners.forEach(function (listener) { return listener(_state); });\n };\n\n var subscribe = function (listener) {\n listeners.push(listener);\n\n return function unsubscribe () {\n listeners = listeners.filter(function (item) { return item !== listener; });\n }\n };\n\n return { getState: getState, setState: setState, subscribe: subscribe }\n}\n\nexport default createBroadcast;\n","import React, {Component} from 'react'\nimport brcast from 'brcast'\nimport {PropTypes} from './react-compat'\nimport {CHANNEL} from './constants'\n/**\n * This is a component which will provide a theme to the entire tree\n * via context and event listener\n * (because pure components block context updates)\n * inspired by the styled-components implementation\n * https://github.com/styled-components/styled-components\n * @param {Object} theme the theme object..\n */\nclass ThemeProvider extends Component {\n broadcast = brcast(this.props.theme)\n\n // create theme, by merging with outer theme, if present\n getTheme(passedTheme) {\n const theme = passedTheme || this.props.theme\n return {...this.outerTheme, ...theme}\n }\n\n getChildContext() {\n return {\n [CHANNEL]: this.broadcast,\n }\n }\n\n setOuterTheme = theme => {\n this.outerTheme = theme\n }\n\n componentDidMount() {\n // create a new subscription for keeping track of outer theme, if present\n if (this.context[CHANNEL]) {\n this.unsubscribe = this.context[CHANNEL].subscribe(this.setOuterTheme)\n }\n }\n\n componentWillMount() {\n // set broadcast state by merging outer theme with own\n if (this.context[CHANNEL]) {\n this.setOuterTheme(this.context[CHANNEL].getState())\n this.broadcast.setState(this.getTheme())\n }\n }\n\n componentWillReceiveProps(nextProps) {\n if (this.props.theme !== nextProps.theme) {\n this.broadcast.setState(this.getTheme(nextProps.theme))\n }\n }\n\n componentWillUnmount() {\n this.unsubscribe && this.unsubscribe()\n }\n\n render() {\n return this.props.children ?\n React.Children.only(this.props.children) :\n null\n }\n}\n\nThemeProvider.childContextTypes = {\n [CHANNEL]: PropTypes.object.isRequired,\n}\n\nThemeProvider.contextTypes = {\n [CHANNEL]: PropTypes.object,\n}\n\nThemeProvider.propTypes = {\n theme: PropTypes.object.isRequired,\n children: PropTypes.node,\n}\n\nexport default ThemeProvider\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 return className.toString().split(' ').reduce((groups, name) => {\n if (name.indexOf('css-') === 0) {\n const style = getGlamorStylesFromClassName(name)\n groups.glamorStyles.push(style)\n } else {\n // eslint-disable-next-line max-len\n groups.glamorlessClassName = `${groups.glamorlessClassName} ${name}`.trim()\n }\n return groups\n }, {glamorlessClassName: '', glamorStyles: []})\n}\n\nexport default getGlamorClassName\n\nfunction getGlamorClassName(styles, props, cssOverrides, theme, context) {\n const {mappedArgs, nonGlamorClassNames} = handleStyles(\n styles,\n props,\n theme,\n context,\n )\n const {\n mappedArgs: cssOverridesArgs,\n nonGlamorClassNames: cssOverridesClassNames,\n } = handleStyles([cssOverrides], props, theme, context)\n const {\n glamorStyles: parentGlamorStyles,\n glamorlessClassName,\n } = extractGlamorStyles(props.className)\n\n const glamorClassName = css(\n ...mappedArgs,\n ...parentGlamorStyles,\n ...cssOverridesArgs,\n ).toString()\n const extras = nonGlamorClassNames.concat(cssOverridesClassNames).join(' ')\n return `${glamorlessClassName} ${glamorClassName} ${extras}`.trim()\n}\n\nfunction handleStyles(styles, props, theme, context) {\n let current\n const mappedArgs = []\n const nonGlamorClassNames = []\n for (let i = 0; i < styles.length; i++) {\n current = styles[i]\n if (typeof current === 'function') {\n const result = current(props, theme, context)\n if (typeof result === 'string') {\n processStringClass(result, mappedArgs, nonGlamorClassNames)\n } else {\n mappedArgs.push(result)\n }\n } else if (typeof current === 'string') {\n processStringClass(current, mappedArgs, nonGlamorClassNames)\n } else {\n mappedArgs.push(current)\n }\n }\n return {mappedArgs, nonGlamorClassNames}\n}\n\nfunction processStringClass(str, mappedArgs, nonGlamorClassNames) {\n const className = getGlamorStylesFromClassName(str)\n if (className) {\n mappedArgs.push(className)\n } else {\n nonGlamorClassNames.push(str)\n }\n}\n\nfunction getGlamorStylesFromClassName(className) {\n const id = className.slice('css-'.length)\n if (styleSheet.registered[id]) {\n return styleSheet.registered[id].style\n } else {\n return null\n }\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, {Component} from 'react'\nimport {PropTypes} from './react-compat'\nimport {CHANNEL} from './constants'\nimport getGlamorClassName from './get-glamor-classname'\n\nexport default createGlamorous\n\nfunction createGlamorous(splitProps) {\n // TODO: in a breaking version, make this default to true\n glamorous.config = {useDisplayNameInClassName: false}\n\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, {rootEl, displayName, forwardProps = []} = {}) {\n return glamorousComponentFactory\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 * @param {Object} theme the theme object\n * @return {ReactElement} React.createElement\n */\n class GlamorousComponent extends Component {\n state = {theme: null}\n setTheme = theme => this.setState({theme})\n\n componentWillMount() {\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.unsubscribe = this.context[CHANNEL].subscribe(this.setTheme)\n }\n }\n\n componentWillUnmount() {\n // cleanup subscription\n this.unsubscribe && this.unsubscribe()\n }\n\n render() {\n // in this function, we're willing to sacrafice a little on\n // readability to get better performance because it actually\n // matters.\n const props = this.props\n const {toForward, cssOverrides} = splitProps(\n props,\n GlamorousComponent,\n )\n\n // freeze the theme object in dev mode\n const theme = process.env.NODE_ENV === 'production' ?\n this.state.theme :\n Object.freeze(this.state.theme)\n\n // create className to apply\n const fullClassName = getGlamorClassName(\n GlamorousComponent.styles,\n props,\n cssOverrides,\n theme,\n this.context,\n )\n const debugClassName = glamorous.config.useDisplayNameInClassName ?\n cleanClassname(GlamorousComponent.displayName) :\n ''\n const className = `${fullClassName} ${debugClassName}`.trim()\n\n return React.createElement(GlamorousComponent.comp, {\n ref: props.innerRef,\n ...toForward,\n className,\n })\n }\n }\n\n GlamorousComponent.propTypes = {\n className: PropTypes.string,\n cssOverrides: PropTypes.object,\n theme: PropTypes.object,\n innerRef: PropTypes.func,\n glam: PropTypes.object,\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(GlamorousComponent, '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 function withComponent(newComp, options = {}) {\n return glamorous(newComp, {\n forwardProps: GlamorousComponent.forwardProps,\n ...options,\n })(GlamorousComponent.styles)\n }\n\n Object.assign(\n GlamorousComponent,\n getGlamorousComponentMetadata({\n comp,\n styles,\n rootEl,\n forwardProps,\n displayName,\n }),\n {withComponent},\n )\n return GlamorousComponent\n }\n }\n\n function getGlamorousComponentMetadata({\n comp,\n styles,\n rootEl,\n forwardProps,\n displayName,\n }) {\n const componentsComp = comp.comp ? comp.comp : comp\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 || componentsComp,\n // join forwardProps (for anyone doing: glamorous(glamorous.a({}), {}))\n forwardProps: when(comp.forwardProps, forwardProps),\n // set the displayName to something that's slightly more\n // helpful than `GlamorousComponent` :)\n displayName: displayName || `glamorous(${getDisplayName(comp)})`,\n }\n }\n\n function when(comp, prop) {\n return comp ? comp.concat(prop) : prop\n }\n\n function getDisplayName(comp) {\n return typeof comp === 'string' ?\n comp :\n comp.displayName || comp.name || 'unknown'\n }\n}\n\nfunction cleanClassname(className) {\n return className.replace(/ /g, '-').replace(/[^A-Za-z0-9\\-_]/g, '_')\n}\n","//\n// Main\n//\n\nmodule.exports = function memoize (fn, options) {\n var cache = options && options.cache\n ? options.cache\n : cacheDefault\n\n var serializer = options && options.serializer\n ? options.serializer\n : serializerDefault\n\n var strategy = options && options.strategy\n ? options.strategy\n : strategyDefault\n\n return strategy(fn, {\n cache: cache,\n serializer: serializer\n })\n}\n\n//\n// Strategy\n//\n\nfunction isPrimitive (value) {\n return value == null || (typeof value !== 'function' && typeof value !== 'object')\n}\n\nfunction monadic (fn, cache, serializer, arg) {\n var cacheKey = isPrimitive(arg) ? arg : serializer(arg)\n\n if (!cache.has(cacheKey)) {\n var computedValue = fn.call(this, arg)\n cache.set(cacheKey, computedValue)\n return computedValue\n }\n\n return cache.get(cacheKey)\n}\n\nfunction variadic (fn, cache, serializer) {\n var args = Array.prototype.slice.call(arguments, 3)\n var cacheKey = serializer(args)\n\n if (!cache.has(cacheKey)) {\n var computedValue = fn.apply(this, args)\n cache.set(cacheKey, computedValue)\n return computedValue\n }\n\n return cache.get(cacheKey)\n}\n\nfunction strategyDefault (fn, options) {\n var memoized = fn.length === 1 ? monadic : variadic\n\n memoized = memoized.bind(\n this,\n fn,\n options.cache.create(),\n options.serializer\n )\n\n return memoized\n}\n\n//\n// Serializer\n//\n\nfunction serializerDefault () {\n return JSON.stringify(arguments)\n}\n\n//\n// Cache\n//\n\nfunction ObjectWithoutPrototypeCache () {\n this.cache = Object.create(null)\n}\n\nObjectWithoutPrototypeCache.prototype.has = function (key) {\n return (key in this.cache)\n}\n\nObjectWithoutPrototypeCache.prototype.get = function (key) {\n return this.cache[key]\n}\n\nObjectWithoutPrototypeCache.prototype.set = function (key, value) {\n this.cache[key] = value\n}\n\nvar cacheDefault = {\n create: function create () {\n return new ObjectWithoutPrototypeCache()\n }\n}\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar reactHtmlAttributes = require('./react-html-attributes.json');\n\nexports.default = reactHtmlAttributes;\n\nmodule.exports = reactHtmlAttributes; // for CommonJS compatibility","/*\n * This is used to check if a property name is one of the React-specific\n * properties and determine if that property should be forwarded\n * to the React component\n */\n\n/* Logic copied from ReactDOMUnknownPropertyHook */\nexport default [\n 'children',\n 'dangerouslySetInnerHTML',\n 'key',\n 'ref',\n 'autoFocus',\n 'defaultValue',\n 'valueLink',\n 'defaultChecked',\n 'checkedLink',\n 'innerHTML',\n 'suppressContentEditableWarning',\n 'onFocusIn',\n 'onFocusOut',\n 'className',\n\n /* List copied from https://facebook.github.io/react/docs/events.html */\n 'onCopy',\n 'onCut',\n 'onPaste',\n 'onCompositionEnd',\n 'onCompositionStart',\n 'onCompositionUpdate',\n 'onKeyDown',\n 'onKeyPress',\n 'onKeyUp',\n 'onFocus',\n 'onBlur',\n 'onChange',\n 'onInput',\n 'onSubmit',\n 'onClick',\n 'onContextMenu',\n 'onDoubleClick',\n 'onDrag',\n 'onDragEnd',\n 'onDragEnter',\n 'onDragExit',\n 'onDragLeave',\n 'onDragOver',\n 'onDragStart',\n 'onDrop',\n 'onMouseDown',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onSelect',\n 'onTouchCancel',\n 'onTouchEnd',\n 'onTouchMove',\n 'onTouchStart',\n 'onScroll',\n 'onWheel',\n 'onAbort',\n 'onCanPlay',\n 'onCanPlayThrough',\n 'onDurationChange',\n 'onEmptied',\n 'onEncrypted',\n 'onEnded',\n 'onError',\n 'onLoadedData',\n 'onLoadedMetadata',\n 'onLoadStart',\n 'onPause',\n 'onPlay',\n 'onPlaying',\n 'onProgress',\n 'onRateChange',\n 'onSeeked',\n 'onSeeking',\n 'onStalled',\n 'onSuspend',\n 'onTimeUpdate',\n 'onVolumeChange',\n 'onWaiting',\n 'onLoad',\n 'onAnimationStart',\n 'onAnimationEnd',\n 'onAnimationIteration',\n 'onTransitionEnd',\n\n 'onCopyCapture',\n 'onCutCapture',\n 'onPasteCapture',\n 'onCompositionEndCapture',\n 'onCompositionStartCapture',\n 'onCompositionUpdateCapture',\n 'onKeyDownCapture',\n 'onKeyPressCapture',\n 'onKeyUpCapture',\n 'onFocusCapture',\n 'onBlurCapture',\n 'onChangeCapture',\n 'onInputCapture',\n 'onSubmitCapture',\n 'onClickCapture',\n 'onContextMenuCapture',\n 'onDoubleClickCapture',\n 'onDragCapture',\n 'onDragEndCapture',\n 'onDragEnterCapture',\n 'onDragExitCapture',\n 'onDragLeaveCapture',\n 'onDragOverCapture',\n 'onDragStartCapture',\n 'onDropCapture',\n 'onMouseDownCapture',\n 'onMouseEnterCapture',\n 'onMouseLeaveCapture',\n 'onMouseMoveCapture',\n 'onMouseOutCapture',\n 'onMouseOverCapture',\n 'onMouseUpCapture',\n 'onSelectCapture',\n 'onTouchCancelCapture',\n 'onTouchEndCapture',\n 'onTouchMoveCapture',\n 'onTouchStartCapture',\n 'onScrollCapture',\n 'onWheelCapture',\n 'onAbortCapture',\n 'onCanPlayCapture',\n 'onCanPlayThroughCapture',\n 'onDurationChangeCapture',\n 'onEmptiedCapture',\n 'onEncryptedCapture',\n 'onEndedCapture',\n 'onErrorCapture',\n 'onLoadedDataCapture',\n 'onLoadedMetadataCapture',\n 'onLoadStartCapture',\n 'onPauseCapture',\n 'onPlayCapture',\n 'onPlayingCapture',\n 'onProgressCapture',\n 'onRateChangeCapture',\n 'onSeekedCapture',\n 'onSeekingCapture',\n 'onStalledCapture',\n 'onSuspendCapture',\n 'onTimeUpdateCapture',\n 'onVolumeChangeCapture',\n 'onWaitingCapture',\n 'onLoadCapture',\n 'onAnimationStartCapture',\n 'onAnimationEndCapture',\n 'onAnimationIterationCapture',\n 'onTransitionEndCapture',\n]\n","/* eslint max-lines:0, func-style:0 */\n// copied from:\n// https://github.com/styled-components/styled-components/tree/\n// 956e8210b6277860c89404f9cb08735f97eaa7e1/src/utils/validAttr.js\n/* Trying to avoid the unknown-prop errors on glamorous components\n by filtering by React's attribute whitelist.\n */\n\nimport memoize from 'fast-memoize'\nimport reactHTMLAttributes from 'react-html-attributes'\nimport reactProps from './react-props'\n\nconst globalReactHtmlProps = reactHTMLAttributes['*']\nconst supportedSVGTagNames = reactHTMLAttributes.elements.svg\n\n// these are valid attributes that have the\n// same name as CSS properties, and is used\n// for css overrides API\nconst cssProps = ['color', 'height', 'width']\n\n/* From DOMProperty */\nconst ATTRIBUTE_NAME_START_CHAR =\n // eslint-disable-next-line max-len\n ':A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD'\n// eslint-disable-next-line max-len\nconst ATTRIBUTE_NAME_CHAR = `${ATTRIBUTE_NAME_START_CHAR}\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040`\nconst isCustomAttribute = RegExp.prototype.test.bind(\n new RegExp(`^(data|aria)-[${ATTRIBUTE_NAME_CHAR}]*$`),\n)\n\nconst isSvgTag = tagName => supportedSVGTagNames.indexOf(tagName) !== -1\nconst isHtmlProp = (name, tagName) => {\n let elementAttributes\n\n if (isSvgTag(tagName)) {\n // all SVG attributes supported by React are grouped under 'svg'\n elementAttributes = reactHTMLAttributes.svg\n } else {\n elementAttributes = reactHTMLAttributes[tagName] || []\n }\n\n return (\n globalReactHtmlProps.indexOf(name) !== -1 ||\n elementAttributes.indexOf(name) !== -1\n )\n}\nconst isCssProp = name => cssProps.indexOf(name) !== -1\nconst isReactProp = name => reactProps.indexOf(name) !== -1\n\n// eslint-disable-next-line complexity\nconst shouldForwardProperty = (tagName, name) =>\n typeof tagName !== 'string' ||\n ((isHtmlProp(name, tagName) ||\n isReactProp(name) ||\n isCustomAttribute(name.toLowerCase())) &&\n (!isCssProp(name) || isSvgTag(tagName)))\n\nexport default memoize(shouldForwardProperty)\n","import shouldForwardProperty from './should-forward-property'\n\nexport default function splitProps(\n {\n css: cssOverrides = {},\n // these are plucked off\n theme, // because they\n className, // should never\n innerRef, // be forwarded\n glam, // to the lower\n // component ever\n ...rest\n },\n {propsAreCssOverrides, rootEl, forwardProps},\n) {\n const returnValue = {toForward: {}, cssOverrides}\n if (!propsAreCssOverrides) {\n if (typeof rootEl !== 'string') {\n // if it's not a string, then we can forward everything\n // (because it's a component)\n returnValue.toForward = rest\n return returnValue\n }\n }\n return Object.keys(rest).reduce((split, propName) => {\n if (\n forwardProps.indexOf(propName) !== -1 ||\n shouldForwardProperty(rootEl, propName)\n ) {\n split.toForward[propName] = rest[propName]\n } else if (propsAreCssOverrides) {\n split.cssOverrides[propName] = rest[propName]\n }\n return split\n }, returnValue)\n}\n","import domElements from './dom-elements'\nimport withTheme from './with-theme'\nimport ThemeProvider from './theme-provider'\nimport createGlamorous from './create-glamorous'\nimport splitProps from './split-props'\n\nconst glamorous = createGlamorous(splitProps)\n\n/*\n * This creates a glamorousComponentFactory for every DOM element so you can\n * simply do:\n * const GreenButton = glamorous.button({\n * backgroundColor: 'green',\n * padding: 20,\n * })\n * Click Me!\n */\nObject.assign(\n glamorous,\n domElements.reduce((getters, tag) => {\n // TODO: next breaking change, let's make\n // the `displayName` be: `glamorous.${tag}`\n getters[tag] = glamorous(tag)\n return getters\n }, {}),\n)\n\n/*\n * This creates a glamorous component for each DOM element so you can\n * simply do:\n * \n * I'm green!\n * \n */\nObject.assign(\n glamorous,\n domElements.reduce((comps, tag) => {\n const capitalTag = capitalize(tag)\n comps[capitalTag] = glamorous[tag]()\n comps[capitalTag].displayName = `glamorous.${capitalTag}`\n comps[capitalTag].propsAreCssOverrides = true\n return comps\n }, {}),\n)\n\nfunction capitalize(s) {\n return s.slice(0, 1).toUpperCase() + s.slice(1)\n}\n\n/*\n * Fix importing in typescript after rollup compilation\n * https://github.com/rollup/rollup/issues/1156\n * https://github.com/Microsoft/TypeScript/issues/13017#issuecomment-268657860\n */\nglamorous.default = glamorous\n\nexport default glamorous\nexport {ThemeProvider, withTheme}\n","import * as glamorousStar from './'\n\nconst glamorous = glamorousStar.default\n\nObject.assign(\n glamorous,\n Object.keys(glamorousStar).reduce((e, prop) => {\n if (prop !== 'default') {\n // eslint-disable-next-line import/namespace\n e[prop] = glamorousStar[prop]\n }\n return e\n }, {}),\n)\n\nexport default glamorous\n"],"names":["domElements","htmlTagNames","concat","svgTagNames","filter","tag","index","array","indexOf","CHANNEL","PropTypes","React","version","slice","require","error","generateWarningMessage","componentName","withTheme","ComponentToTheme","ThemedComponent","state","theme","setTheme","setState","context","warn","displayName","name","getState","unsubscribe","subscribe","props","Component","contextTypes","object","ThemeProvider","broadcast","brcast","setOuterTheme","outerTheme","passedTheme","getTheme","nextProps","children","Children","only","childContextTypes","isRequired","propTypes","node","extractGlamorStyles","className","toString","split","reduce","groups","style","getGlamorStylesFromClassName","glamorStyles","push","glamorlessClassName","trim","getGlamorClassName","styles","cssOverrides","handleStyles","mappedArgs","nonGlamorClassNames","cssOverridesArgs","cssOverridesClassNames","parentGlamorStyles","glamorClassName","css","extras","join","current","i","length","result","processStringClass","str","id","styleSheet","registered","createGlamorous","splitProps","config","useDisplayNameInClassName","glamorous","comp","rootEl","forwardProps","glamorousComponentFactory","GlamorousComponent","toForward","Object","freeze","fullClassName","debugClassName","cleanClassname","createElement","innerRef","string","func","defaultContextTypes","userDefinedContextTypes","defineProperty","value","withComponent","newComp","options","assign","getGlamorousComponentMetadata","componentsComp","when","getDisplayName","prop","replace","reactHtmlAttributes","globalReactHtmlProps","reactHTMLAttributes","supportedSVGTagNames","elements","svg","cssProps","ATTRIBUTE_NAME_START_CHAR","ATTRIBUTE_NAME_CHAR","isCustomAttribute","RegExp","prototype","test","bind","isSvgTag","tagName","isHtmlProp","elementAttributes","isCssProp","isReactProp","reactProps","shouldForwardProperty","toLowerCase","memoize","propsAreCssOverrides","glam","rest","returnValue","keys","propName","getters","comps","capitalTag","capitalize","s","toUpperCase","default","glamorousStar","e"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAMA,cAAcC,aACjBC,MADiB,CACVC,WADU,EAEjBC,MAFiB,CAEV,UAACC,GAA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