{"version":3,"file":"glamorous.umd.js","sources":["../src/should-forward-property.js","../src/dom-elements.js","../src/react-compat.js","../node_modules/brcast/dist/brcast.es.js","../src/theme-provider.js","../src/index.js","../src/umd-entry.js"],"sourcesContent":["/* 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\n/* Logic copied from ReactDOMUnknownPropertyHook */\nconst reactProps = [\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\n/* From HTMLDOMPropertyConfig */\nconst htmlProps = [\n /**\n * Standard Properties\n */\n 'accept',\n 'acceptCharset',\n 'accessKey',\n 'action',\n 'allowFullScreen',\n 'allowTransparency',\n 'alt',\n // specifies target context for links with `preload` type\n 'as',\n 'async',\n 'autoComplete',\n // autoFocus is polyfilled/normalized by AutoFocusUtils\n '// autoFocus',\n 'autoPlay',\n 'capture',\n 'cellPadding',\n 'cellSpacing',\n 'charSet',\n 'challenge',\n 'checked',\n 'cite',\n 'classID',\n 'className',\n 'cols',\n 'colSpan',\n 'content',\n 'contentEditable',\n 'contextMenu',\n 'controls',\n 'coords',\n 'crossOrigin',\n 'data', // For `<object />` acts as `src`.\n 'dateTime',\n 'default',\n 'defer',\n 'dir',\n 'disabled',\n 'download',\n 'draggable',\n 'encType',\n 'form',\n 'formAction',\n 'formEncType',\n 'formMethod',\n 'formNoValidate',\n 'formTarget',\n 'frameBorder',\n 'headers',\n 'height',\n 'hidden',\n 'high',\n 'href',\n 'hrefLang',\n 'htmlFor',\n 'httpEquiv',\n 'icon',\n 'id',\n 'inputMode',\n 'integrity',\n 'is',\n 'keyParams',\n 'keyType',\n 'kind',\n 'label',\n 'lang',\n 'list',\n 'loop',\n 'low',\n 'manifest',\n 'marginHeight',\n 'marginWidth',\n 'max',\n 'maxLength',\n 'media',\n 'mediaGroup',\n 'method',\n 'min',\n 'minLength',\n // Caution; `option.selected` is not updated if `select.multiple` is\n // disabled with `removeAttribute`.\n 'multiple',\n 'muted',\n 'name',\n 'nonce',\n 'noValidate',\n 'open',\n 'optimum',\n 'pattern',\n 'placeholder',\n 'playsInline',\n 'poster',\n 'preload',\n 'profile',\n 'radioGroup',\n 'readOnly',\n 'referrerPolicy',\n 'rel',\n 'required',\n 'reversed',\n 'role',\n 'rows',\n 'rowSpan',\n 'sandbox',\n 'scope',\n 'scoped',\n 'scrolling',\n 'seamless',\n 'selected',\n 'shape',\n 'size',\n 'sizes',\n 'span',\n 'spellCheck',\n 'src',\n 'srcDoc',\n 'srcLang',\n 'srcSet',\n 'start',\n 'step',\n 'style',\n 'summary',\n 'tabIndex',\n 'target',\n 'title',\n // Setting .type throws on non-<input> tags\n 'type',\n 'useMap',\n 'value',\n 'width',\n 'wmode',\n 'wrap',\n\n /**\n * RDFa Properties\n */\n 'about',\n 'datatype',\n 'inlist',\n 'prefix',\n // property is also supported for OpenGraph in meta tags.\n 'property',\n 'resource',\n 'typeof',\n 'vocab',\n\n /**\n * Non-standard Properties\n */\n // autoCapitalize and autoCorrect are supported in Mobile Safari for\n // keyboard hints.\n 'autoCapitalize',\n 'autoCorrect',\n // autoSave allows WebKit/Blink to persist values of\n // input fields on page reloads\n 'autoSave',\n // color is for Safari mask-icon link\n 'color',\n // itemProp, itemScope, itemType are for\n // Microdata support. See http://schema.org/docs/gs.html\n 'itemProp',\n 'itemScope',\n 'itemType',\n // itemID and itemRef are for Microdata support as well but\n // only specified in the WHATWG spec document. See\n // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api\n 'itemID',\n 'itemRef',\n // results show looking glass icon and recent searches on input\n // search fields in WebKit/Blink\n 'results',\n // IE-only attribute that specifies security restrictions on an iframe\n // as an alternative to the sandbox attribute on IE<10\n 'security',\n // IE-only attribute that controls focus behavior\n 'unselectable',\n]\n\nconst svgProps = [\n 'accentHeight',\n 'accumulate',\n 'additive',\n 'alignmentBaseline',\n 'allowReorder',\n 'alphabetic',\n 'amplitude',\n 'arabicForm',\n 'ascent',\n 'attributeName',\n 'attributeType',\n 'autoReverse',\n 'azimuth',\n 'baseFrequency',\n 'baseProfile',\n 'baselineShift',\n 'bbox',\n 'begin',\n 'bias',\n 'by',\n 'calcMode',\n 'capHeight',\n 'clip',\n 'clipPath',\n 'clipRule',\n 'clipPathUnits',\n 'colorInterpolation',\n 'colorInterpolationFilters',\n 'colorProfile',\n 'colorRendering',\n 'contentScriptType',\n 'contentStyleType',\n 'cursor',\n 'cx',\n 'cy',\n 'd',\n 'decelerate',\n 'descent',\n 'diffuseConstant',\n 'direction',\n 'display',\n 'divisor',\n 'dominantBaseline',\n 'dur',\n 'dx',\n 'dy',\n 'edgeMode',\n 'elevation',\n 'enableBackground',\n 'end',\n 'exponent',\n 'externalResourcesRequired',\n 'fill',\n 'fillOpacity',\n 'fillRule',\n 'filter',\n 'filterRes',\n 'filterUnits',\n 'floodColor',\n 'floodOpacity',\n 'focusable',\n 'fontFamily',\n 'fontSize',\n 'fontSizeAdjust',\n 'fontStretch',\n 'fontStyle',\n 'fontVariant',\n 'fontWeight',\n 'format',\n 'from',\n 'fx',\n 'fy',\n 'g1',\n 'g2',\n 'glyphName',\n 'glyphOrientationHorizontal',\n 'glyphOrientationVertical',\n 'glyphRef',\n 'gradientTransform',\n 'gradientUnits',\n 'hanging',\n 'horizAdvX',\n 'horizOriginX',\n 'ideographic',\n 'imageRendering',\n 'in',\n 'in2',\n 'intercept',\n 'k',\n 'k1',\n 'k2',\n 'k3',\n 'k4',\n 'kernelMatrix',\n 'kernelUnitLength',\n 'kerning',\n 'keyPoints',\n 'keySplines',\n 'keyTimes',\n 'lengthAdjust',\n 'letterSpacing',\n 'lightingColor',\n 'limitingConeAngle',\n 'local',\n 'markerEnd',\n 'markerMid',\n 'markerStart',\n 'markerHeight',\n 'markerUnits',\n 'markerWidth',\n 'mask',\n 'maskContentUnits',\n 'maskUnits',\n 'mathematical',\n 'mode',\n 'numOctaves',\n 'offset',\n 'opacity',\n 'operator',\n 'order',\n 'orient',\n 'orientation',\n 'origin',\n 'overflow',\n 'overlinePosition',\n 'overlineThickness',\n 'paintOrder',\n 'panose1',\n 'pathLength',\n 'patternContentUnits',\n 'patternTransform',\n 'patternUnits',\n 'pointerEvents',\n 'points',\n 'pointsAtX',\n 'pointsAtY',\n 'pointsAtZ',\n 'preserveAlpha',\n 'preserveAspectRatio',\n 'primitiveUnits',\n 'r',\n 'radius',\n 'refX',\n 'refY',\n 'renderingIntent',\n 'repeatCount',\n 'repeatDur',\n 'requiredExtensions',\n 'requiredFeatures',\n 'restart',\n 'result',\n 'rotate',\n 'rx',\n 'ry',\n 'scale',\n 'seed',\n 'shapeRendering',\n 'slope',\n 'spacing',\n 'specularConstant',\n 'specularExponent',\n 'speed',\n 'spreadMethod',\n 'startOffset',\n 'stdDeviation',\n 'stemh',\n 'stemv',\n 'stitchTiles',\n 'stopColor',\n 'stopOpacity',\n 'strikethroughPosition',\n 'strikethroughThickness',\n 'string',\n 'stroke',\n 'strokeDasharray',\n 'strokeDashoffset',\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit',\n 'strokeOpacity',\n 'strokeWidth',\n 'surfaceScale',\n 'systemLanguage',\n 'tableValues',\n 'targetX',\n 'targetY',\n 'textAnchor',\n 'textDecoration',\n 'textRendering',\n 'textLength',\n 'to',\n 'transform',\n 'u1',\n 'u2',\n 'underlinePosition',\n 'underlineThickness',\n 'unicode',\n 'unicodeBidi',\n 'unicodeRange',\n 'unitsPerEm',\n 'vAlphabetic',\n 'vHanging',\n 'vIdeographic',\n 'vMathematical',\n 'values',\n 'vectorEffect',\n 'version',\n 'vertAdvY',\n 'vertOriginX',\n 'vertOriginY',\n 'viewBox',\n 'viewTarget',\n 'visibility',\n 'widths',\n 'wordSpacing',\n 'writingMode',\n 'x',\n 'xHeight',\n 'x1',\n 'x2',\n 'xChannelSelector',\n 'xlinkActuate',\n 'xlinkArcrole',\n 'xlinkHref',\n 'xlinkRole',\n 'xlinkShow',\n 'xlinkTitle',\n 'xlinkType',\n 'xmlBase',\n 'xmlns',\n 'xmlnsXlink',\n 'xmlLang',\n 'xmlSpace',\n 'y',\n 'y1',\n 'y2',\n 'yChannelSelector',\n 'z',\n 'zoomAndPan',\n]\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 */\n// eslint-disable-next-line max-len\nconst ATTRIBUTE_NAME_START_CHAR = ':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 hasItem = (list, name) => list.indexOf(name) !== -1\nconst isHtmlProp = name => hasItem(htmlProps, name)\nconst isCssProp = name => hasItem(cssProps, name)\nconst isSvgProp = (tagName, name) =>\n tagName === 'svg' && hasItem(svgProps, name)\nconst isReactProp = name => hasItem(reactProps, name)\n\n// eslint-disable-next-line complexity\nconst shouldForwardProperty = (tagName, name) =>\n typeof tagName !== 'string' ||\n ((isHtmlProp(name) ||\n isSvgProp(tagName, name) ||\n isCustomAttribute(name.toLowerCase()) ||\n isReactProp(name)) &&\n (tagName === 'svg' || !isCssProp(name)))\n\nexport default shouldForwardProperty\n","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","/* eslint import/no-mutable-exports:0, import/prefer-default-export:0 */\nimport 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","/** Mitt: Tiny (~200b) functional event emitter / pubsub.\n * @name mitt\n * @returns {Mitt}\n */\nfunction mitt(all) {\n\tall = all || Object.create(null);\n\n\treturn {\n\t\t/**\n\t\t * Register an event handler for the given type.\n\t\t *\n\t\t * @param {String} type Type of event to listen for, or `\"*\"` for all events\n\t\t * @param {Function} handler Function to call in response to given event\n\t\t * @return {Object} the `mitt` instance for chaining\n\t\t * @memberOf mitt\n\t\t */\n\t\ton: function on(type, handler) {\n\t\t\t(all[type] || (all[type] = [])).push(handler);\n\t\t},\n\n\t\t/**\n\t\t * Remove an event handler for the given type.\n\t\t *\n\t\t * @param {String} type Type of event to unregister `handler` from, or `\"*\"`\n\t\t * @param {Function} handler Handler function to remove\n\t\t * @return {Object} the `mitt` instance for chaining\n\t\t * @memberOf mitt\n\t\t */\n\t\toff: function off(type, handler) {\n\t\t\tvar e = all[type] || (all[type] = []);\n\t\t\te.splice(e.indexOf(handler) >>> 0, 1);\n\t\t},\n\n\t\t/**\n\t\t * Invoke all handlers for the given type.\n\t\t * If present, `\"*\"` handlers are invoked prior to type-matched handlers.\n\t\t *\n\t\t * @param {String} type The event type to invoke\n\t\t * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler\n\t\t * @return {Object} the `mitt` instance for chaining\n\t\t * @memberof mitt\n\t\t */\n\t\temit: function emit(type, evt) {\n\t\t\t(all[type] || []).map(function (handler) { handler(evt); });\n\t\t\t(all['*'] || []).map(function (handler) { handler(type, evt); });\n\t\t}\n\t};\n}\n\nfunction createBroadcast (initialState, channel) {\n if ( channel === void 0 ) channel = '__brcast__';\n\n var emitter = mitt();\n var currentState = initialState;\n\n var getState = function () { return currentState; };\n\n var setState = function (state) {\n currentState = state;\n emitter.emit(channel, currentState);\n };\n\n var subscribe = function (listener) {\n emitter.on(channel, listener);\n\n return function unsubscribe () {\n emitter.off(channel, 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'\n\nexport const CHANNEL = '__glamorous__'\n\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","/*\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 {css, styleSheet} from 'glamor'\nimport shouldForwardProperty from './should-forward-property'\nimport domElements from './dom-elements'\nimport {PropTypes} from './react-compat'\nimport ThemeProvider, {CHANNEL} from './theme-provider'\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 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 */\nfunction glamorous(comp, {rootEl, displayName} = {}) {\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, 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 const {className, ...rest} = this.props\n const {toForward, cssOverrides} = splitProps(rest, GlamorousComponent)\n // create className to apply\n const mappedArgs = GlamorousComponent.styles.map(glamorRules => {\n if (typeof glamorRules === 'function') {\n return glamorRules(this.props, {...this.state.theme})\n }\n return glamorRules\n })\n const {\n glamorStyles: parentGlamorStyles,\n glamorlessClassName,\n } = extractGlamorStyles(className)\n const glamorClassName = css(\n ...mappedArgs,\n ...parentGlamorStyles,\n cssOverrides,\n ).toString()\n const fullClassName = joinClasses(glamorlessClassName, glamorClassName)\n\n return React.createElement(GlamorousComponent.comp, {\n className: fullClassName,\n ...toForward,\n })\n }\n }\n\n GlamorousComponent.propTypes = {\n className: PropTypes.string,\n cssOverrides: PropTypes.object,\n theme: PropTypes.object,\n }\n\n GlamorousComponent.contextTypes = {\n [CHANNEL]: PropTypes.object,\n }\n\n Object.assign(\n GlamorousComponent,\n getGlamorousComponentMetadata({comp, styles, rootEl, displayName}),\n )\n return GlamorousComponent\n }\n}\n\nfunction getGlamorousComponentMetadata({comp, styles, rootEl, displayName}) {\n const componentsComp = comp.comp ? comp.comp : comp\n return {\n // join styles together (for anyone doing: glamorous(glamorous.a({}), {}))\n styles: comp.styles ? comp.styles.concat(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 // set the displayName to something that's slightly more\n // helpful than `GlamorousComponent` :)\n displayName: displayName || `glamorous(${getDisplayName(comp)})`,\n }\n}\n\nfunction getDisplayName(comp) {\n return typeof comp === 'string' ?\n comp :\n comp.displayName || comp.name || 'unknown'\n}\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 * <GreenButton>Click Me!</GreenButton>\n */\nObject.assign(\n glamorous,\n domElements.reduce(\n (getters, tag) => {\n getters[tag] = glamorous(tag)\n return getters\n },\n {},\n ),\n)\n\n/*\n * This creates a glamorous component for each DOM element so you can\n * simply do:\n * <glamorous.Div\n * color=\"green\"\n * marginLeft={20}\n * >\n * I'm green!\n * </glamorous.Div>\n */\nObject.assign(\n glamorous,\n domElements.reduce(\n (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 ),\n)\n\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 id = name.slice('css-'.length)\n const {style} = styleSheet.registered[id]\n groups.glamorStyles.push(style)\n } else {\n groups.glamorlessClassName = joinClasses(\n groups.glamorlessClassName,\n name,\n )\n }\n return groups\n }, {glamorlessClassName: '', glamorStyles: []})\n}\n\nfunction splitProps(\n {css: cssOverrides = {}, ...rest},\n {propsAreCssOverrides, rootEl},\n) {\n const returnValue = {toForward: {}, cssOverrides: {}}\n if (!propsAreCssOverrides) {\n returnValue.cssOverrides = cssOverrides\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(\n (split, propName) => {\n if (shouldForwardProperty(rootEl, propName)) {\n split.toForward[propName] = rest[propName]\n } else if (propsAreCssOverrides) {\n split.cssOverrides[propName] = rest[propName]\n }\n return split\n },\n returnValue,\n )\n}\n\nfunction capitalize(s) {\n return s.slice(0, 1).toUpperCase() + s.slice(1)\n}\n\nfunction joinClasses(...classes) {\n return classes.filter(Boolean).join(' ')\n}\n\nexport default glamorous\nexport {ThemeProvider}\n","import * as glamorousStar from './'\n\nconst glamorous = glamorousStar.default\n\nObject.assign(\n glamorous,\n Object.keys(glamorousStar).reduce(\n (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 ),\n)\n\nexport default glamorous\n"],"names":["reactProps","htmlProps","svgProps","cssProps","ATTRIBUTE_NAME_START_CHAR","ATTRIBUTE_NAME_CHAR","isCustomAttribute","RegExp","prototype","test","bind","hasItem","list","name","indexOf","isHtmlProp","isCssProp","isSvgProp","tagName","isReactProp","shouldForwardProperty","toLowerCase","domElements","htmlTagNames","concat","svgTagNames","filter","tag","index","array","PropTypes","React","version","slice","require","error","CHANNEL","ThemeProvider","broadcast","brcast","props","theme","setOuterTheme","outerTheme","passedTheme","context","unsubscribe","subscribe","getState","setState","getTheme","nextProps","children","Children","only","Component","childContextTypes","object","isRequired","contextTypes","propTypes","node","glamorous","comp","rootEl","displayName","glamorousComponentFactory","styles","GlamorousComponent","state","setTheme","className","rest","splitProps","toForward","cssOverrides","mappedArgs","map","glamorRules","extractGlamorStyles","parentGlamorStyles","glamorStyles","glamorlessClassName","glamorClassName","css","toString","fullClassName","joinClasses","createElement","string","assign","getGlamorousComponentMetadata","componentsComp","getDisplayName","Object","reduce","getters","comps","capitalTag","capitalize","propsAreCssOverrides","split","groups","id","length","style","styleSheet","registered","push","returnValue","keys","propName","s","toUpperCase","classes","Boolean","join","glamorousStar","e","prop"],"mappings":";;;;;;;;AAAA;;;;;;;;;AASA,IAAMA,aAAa,CACjB,UADiB,EAEjB,yBAFiB,EAGjB,KAHiB,EAIjB,KAJiB,EAKjB,WALiB,EAMjB,cANiB,EAOjB,WAPiB,EAQjB,gBARiB,EASjB,aATiB,EAUjB,WAViB,EAWjB,gCAXiB,EAYjB,WAZiB,EAajB,YAbiB,EAcjB,WAdiB;;;AAiBjB,QAjBiB,EAkBjB,OAlBiB,EAmBjB,SAnBiB,EAoBjB,kBApBiB,EAqBjB,oBArBiB,EAsBjB,qBAtBiB,EAuBjB,WAvBiB,EAwBjB,YAxBiB,EAyBjB,SAzBiB,EA0BjB,SA1BiB,EA2BjB,QA3BiB,EA4BjB,UA5BiB,EA6BjB,SA7BiB,EA8BjB,UA9BiB,EA+BjB,SA/BiB,EAgCjB,eAhCiB,EAiCjB,eAjCiB,EAkCjB,QAlCiB,EAmCjB,WAnCiB,EAoCjB,aApCiB,EAqCjB,YArCiB,EAsCjB,aAtCiB,EAuCjB,YAvCiB,EAwCjB,aAxCiB,EAyCjB,QAzCiB,EA0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