@vitus-labs/rocketstories 0.18.0 → 0.21.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"vitus-labs-rocketstories.js","sources":["../../rocketstyle/lib/vitus-labs-rocketstyle.module.js","../src/components/NotFound.tsx","../src/utils/theme.ts","../src/utils/code.ts","../src/constants/controls.ts","../src/utils/controls/attrs.ts","../src/utils/controls/dimensionToControls.ts","../src/utils/controls/disableControls.ts","../src/utils/controls/filterDefaultValues.ts","../src/utils/controls/constants.ts","../src/utils/controls/makeControls.ts","../src/controls/element.ts","../src/controls/list.ts","../src/controls/overlay.ts","../src/controls/rocketstyle.ts","../src/controls/text.ts","../src/utils/controls/valuesToControls.ts","../src/stories/dimension.tsx","../src/utils/dimensions.ts","../src/stories/main.tsx","../src/stories/story.tsx","../src/rocketstories.tsx"],"sourcesContent":["import { isEmpty, set, get, merge, config, Provider as Provider$1, context, renderContent, pick, omit, compose } from '@vitus-labs/core';\nexport { context } from '@vitus-labs/core';\nimport React, { useState, useContext, forwardRef, createContext, useRef, useImperativeHandle, useMemo } from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nconst handleEvent = (e) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n};\r\nconst usePseudoState = (props) => {\r\n const [hover, setHover] = useState(false);\r\n const [focus, setFocus] = useState(false);\r\n const [pressed, setPressed] = useState(false);\r\n const onMouseEnter = (e) => {\r\n handleEvent(e);\r\n setHover(true);\r\n if (props.onMouseEnter)\r\n props.onMouseEnter(e);\r\n };\r\n const onMouseLeave = (e) => {\r\n handleEvent(e);\r\n setHover(false);\r\n setPressed(false);\r\n if (props.onMouseLeave)\r\n props.onMouseLeave(e);\r\n };\r\n const onMouseDown = (e) => {\r\n handleEvent(e);\r\n setPressed(true);\r\n if (props.onMouseDown)\r\n props.onMouseDown(e);\r\n };\r\n const onMouseUp = (e) => {\r\n handleEvent(e);\r\n setPressed(false);\r\n if (props.onMouseUp)\r\n props.onMouseUp(e);\r\n };\r\n const onFocus = (e) => {\r\n handleEvent(e);\r\n setFocus(true);\r\n if (props.onFocus)\r\n props.onFocus(e);\r\n };\r\n const onBlur = (e) => {\r\n handleEvent(e);\r\n setFocus(false);\r\n if (props.onBlur)\r\n props.onBlur(e);\r\n };\r\n return {\r\n state: {\r\n hover,\r\n focus,\r\n pressed,\r\n },\r\n events: {\r\n onMouseEnter,\r\n onMouseLeave,\r\n onMouseDown,\r\n onMouseUp,\r\n onFocus,\r\n onBlur,\r\n },\r\n };\r\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\n/* eslint-disable import/prefer-default-export */\r\nconst chainOptions = (opts, defaultOpts = []) => {\r\n const result = [...defaultOpts];\r\n if (typeof opts === 'function')\r\n result.push(opts);\r\n else if (typeof opts === 'object')\r\n result.push(() => opts);\r\n return result;\r\n};\r\nconst removeNullableValues = (obj) => Object.entries(obj)\r\n .filter(([, v]) => v != null && v !== false)\r\n .reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {});\r\nconst removeAllEmptyValues = (obj) => Object.entries(obj)\r\n .filter(([, v]) => v != null)\r\n .reduce((acc, [k, v]) => ({\r\n ...acc,\r\n [k]: typeof v === 'object' ? removeAllEmptyValues(v) : v,\r\n}), {});\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\nconst isValidKey = (value) => value !== undefined && value !== null && value !== false;\r\nconst isMultiKey = (value) => {\r\n if (typeof value === 'object')\r\n return [true, get(value, 'propName')];\r\n return [false, value];\r\n};\r\nconst calculateDimensionsMap = ({ themes, useBooleans, }) => {\r\n const result = { keysMap: {}, keywords: {} };\r\n if (isEmpty(themes))\r\n return result;\r\n return Object.entries(themes).reduce((accumulator, [key, value]) => {\r\n const { keysMap, keywords } = accumulator;\r\n keywords[key] = true;\r\n Object.entries(value).forEach(([itemKey, itemValue]) => {\r\n if (!isValidKey(itemValue))\r\n return;\r\n if (useBooleans) {\r\n keywords[itemKey] = true;\r\n }\r\n set(keysMap, [key, itemKey], true);\r\n });\r\n return accumulator;\r\n }, result);\r\n};\r\nconst getKeys = (obj) => Object.keys(obj);\r\nconst getValues = (obj) => Object.values(obj);\r\nconst getDimensionsValues = (obj) => getValues(obj).map((item) => {\r\n if (typeof item === 'object') {\r\n return item.propName;\r\n }\r\n return item;\r\n});\r\nconst getMultipleDimensions = (obj) => getValues(obj).reduce((accumulator, value) => {\r\n if (typeof value === 'object') {\r\n // eslint-disable-next-line no-param-reassign\r\n if (value.multi === true)\r\n accumulator[value.propName] = true;\r\n }\r\n return accumulator;\r\n}, {});\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\n// --------------------------------------------------------\r\n// theme mode callback\r\n// --------------------------------------------------------\r\nconst themeModeCb = (...params) => (mode) => {\r\n if (!mode || mode === 'light')\r\n return params[0];\r\n return params[1];\r\n};\r\nconst calculateDimensionThemes = (theme, options, cb) => {\r\n const result = {};\r\n if (isEmpty(options.dimensions))\r\n return result;\r\n return Object.entries(options.dimensions).reduce((accumulator, [key, value]) => {\r\n const [, dimension] = isMultiKey(value);\r\n const helper = options[key];\r\n if (Array.isArray(helper) && helper.length > 0) {\r\n const finalDimensionThemes = calculateChainOptions$1(helper, [\r\n theme,\r\n cb,\r\n config.css,\r\n ]);\r\n // eslint-disable-next-line no-param-reassign\r\n accumulator[dimension] = removeNullableValues(finalDimensionThemes);\r\n }\r\n return accumulator;\r\n }, result);\r\n};\r\nconst calculateChainOptions$1 = (options, args) => {\r\n const result = {};\r\n if (isEmpty(options))\r\n return result;\r\n const helper = options.reduce((acc, item) => merge(acc, item(...args)), result);\r\n return removeAllEmptyValues(helper);\r\n};\r\nconst calculateTheme = ({ rocketstate, themes, baseTheme, }) => {\r\n // generate final theme which will be passed to styled component\r\n let finalTheme = { ...baseTheme };\r\n Object.entries(rocketstate).forEach(([key, value]) => {\r\n const keyTheme = themes[key];\r\n if (Array.isArray(value)) {\r\n value.forEach((item) => {\r\n finalTheme = merge(finalTheme, keyTheme[item]);\r\n });\r\n }\r\n else {\r\n finalTheme = merge(finalTheme, keyTheme[value]);\r\n }\r\n });\r\n return finalTheme;\r\n};\r\nconst calculateThemeMode = (themes, variant) => {\r\n const callback = themeModeCb().toString();\r\n const result = {};\r\n Object.entries(themes).forEach(([key, value]) => {\r\n if (typeof value === 'object') {\r\n result[key] = calculateThemeMode(value, variant);\r\n }\r\n else if (typeof value === 'function' && value.toString() === callback) {\r\n result[key] = value(variant);\r\n }\r\n else {\r\n result[key] = value;\r\n }\r\n });\r\n return result;\r\n};\n\nconst useTheme = ({ theme, options, cb }) => {\r\n const themes = calculateDimensionThemes(theme, options, cb);\r\n const { keysMap, keywords } = calculateDimensionsMap({\r\n themes,\r\n useBooleans: options.useBooleans,\r\n });\r\n // eslint-disable-next-line no-underscore-dangle\r\n const __ROCKETSTYLE__ = {\r\n dimensions: keysMap,\r\n reservedPropNames: keywords,\r\n baseTheme: calculateChainOptions$1(options.theme, [theme, cb, config.css]),\r\n themes,\r\n };\r\n return __ROCKETSTYLE__;\r\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\nconst Provider = ({ theme, mode, children, inversed, provider: RocketstyleProvider = Provider$1, }) => {\r\n if (inversed) {\r\n const { provider: InnerProvider, mode: ctxMode, ...ctx } = useContext(context);\r\n const isDark = ctxMode === 'dark';\r\n const inversedTheme = isDark ? 'light' : 'dark';\r\n if (!InnerProvider)\r\n return React.createElement(React.Fragment, null, children);\r\n return (React.createElement(InnerProvider, { mode: inversedTheme, isDark: isDark, isLight: !isDark, ...ctx }, children));\r\n }\r\n const isDark = mode === 'dark';\r\n return (React.createElement(RocketstyleProvider, { mode: mode, isDark: isDark, isLight: !isDark, theme: theme, provider: RocketstyleProvider }, children));\r\n};\n\nconst PSEUDO_KEYS = ['hover', 'active', 'focus', 'pressed'];\r\nconst THEME_MODES = {\r\n light: true,\r\n dark: true,\r\n};\r\nconst THEME_MODES_INVERSED = {\r\n dark: 'light',\r\n light: 'dark',\r\n};\r\nconst CONFIG_KEYS = [\r\n 'provider',\r\n 'consumer',\r\n 'DEBUG',\r\n 'name',\r\n 'component',\r\n 'inversed',\r\n 'passProps',\r\n 'styled',\r\n];\r\nconst STYLING_KEYS = ['theme', 'attrs', 'styles'];\r\nconst STATIC_KEYS = [...STYLING_KEYS, 'compose'];\r\nconst ALL_RESERVED_KEYS = [\r\n ...Object.keys(THEME_MODES),\r\n ...CONFIG_KEYS,\r\n ...STATIC_KEYS,\r\n];\n\nconst useThemeOptions = ({ inversed }) => {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const { theme, mode: ctxMode, isDark: ctxDark } = useContext(context);\r\n const mode = inversed ? THEME_MODES_INVERSED[ctxMode] : ctxMode;\r\n const isDark = inversed ? !ctxDark : ctxDark;\r\n const isLight = !isDark;\r\n return { theme, mode, isDark, isLight };\r\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\nconst pickStyledProps = (props, keywords) => {\r\n const result = {};\r\n Object.entries(props).forEach(([key, value]) => {\r\n if (keywords[key])\r\n result[key] = value;\r\n });\r\n return result;\r\n};\r\nconst calculateChainOptions = (options) => (args) => {\r\n const result = {};\r\n if (isEmpty(options))\r\n return result;\r\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\r\n // @ts-ignore\r\n return options.reduce((acc, item) => Object.assign(acc, item(...args)), result);\r\n};\r\nconst calculateStylingAttrs = ({ useBooleans, multiKeys }) => ({ props, dimensions }) => {\r\n const result = {};\r\n // (1) find dimension keys values & initialize\r\n // object with possible options\r\n Object.keys(dimensions).forEach((item) => {\r\n const pickedProp = props[item];\r\n const valueTypes = ['number', 'string'];\r\n // if the property is mutli key, allow assign array as well\r\n if (multiKeys && multiKeys[item] && Array.isArray(pickedProp)) {\r\n result[item] = pickedProp;\r\n }\r\n // assign when it's only a string or number otherwise it's considered\r\n // as invalid param\r\n else if (valueTypes.includes(typeof pickedProp)) {\r\n result[item] = pickedProp;\r\n }\r\n else {\r\n result[item] = undefined;\r\n }\r\n });\r\n // (2) if booleans are being used let's find the rest\r\n if (useBooleans) {\r\n const propsKeys = Object.keys(props).reverse();\r\n Object.entries(result).forEach(([key, value]) => {\r\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\r\n // @ts-ignore\r\n const isMultiKey = multiKeys[key];\r\n // when value in result is not assigned yet\r\n if (!value) {\r\n let newDimensionValue;\r\n const keywords = Object.keys(dimensions[key]);\r\n if (isMultiKey) {\r\n newDimensionValue = propsKeys.filter((key) => keywords.includes(key));\r\n }\r\n else {\r\n // reverse props to guarantee the last one will have\r\n // a priority over previous ones\r\n newDimensionValue = propsKeys.find((key) => {\r\n if (keywords.includes(key) && props[key])\r\n return key;\r\n return false;\r\n });\r\n }\r\n result[key] = newDimensionValue;\r\n }\r\n });\r\n }\r\n return result;\r\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\nconst rocketStyleHOC = ({ inversed, attrs }) => {\r\n // --------------------------------------------------\r\n // .attrs(...)\r\n // first we need to calculate final props which are\r\n // being returned by using `attr` chaining method\r\n // --------------------------------------------------\r\n const _calculateChainOptions = calculateChainOptions(attrs);\r\n const Enhanced = (WrappedComponent) => forwardRef((props, ref) => {\r\n const { theme, mode, isDark, isLight } = useThemeOptions({\r\n inversed,\r\n });\r\n const calculatedAttrs = _calculateChainOptions([\r\n props,\r\n theme,\r\n {\r\n renderContent,\r\n mode,\r\n isDark,\r\n isLight,\r\n },\r\n ]);\r\n return (React.createElement(WrappedComponent, { \"$rocketstyleRef\": ref, ...calculatedAttrs, ...props }));\r\n });\r\n return Enhanced;\r\n};\n\nvar localContext = createContext({});\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\nconst RocketStyleProviderComponent = (WrappedComponent) => forwardRef(({ onMouseEnter, onMouseLeave, onMouseUp, onMouseDown, onFocus, onBlur, $rocketstate, ...props }, ref) => {\r\n // pseudo hook to detect states hover / pressed / focus\r\n const pseudo = usePseudoState({\r\n onMouseEnter,\r\n onMouseLeave,\r\n onMouseUp,\r\n onMouseDown,\r\n onFocus,\r\n onBlur,\r\n });\r\n const updatedState = {\r\n ...$rocketstate,\r\n pseudo: { ...$rocketstate.pseudo, ...pseudo.state },\r\n };\r\n return (React.createElement(localContext.Provider, { value: updatedState },\r\n React.createElement(WrappedComponent, { ...props, ...pseudo.events, ref: ref, \"$rocketstate\": updatedState })));\r\n});\n\nconst calculateStyles = (styles, css) => {\r\n if (!styles)\r\n return [];\r\n return styles.map((item) => item(css));\r\n};\n\n/* eslint-disable no-underscore-dangle */\r\nconst orOptions = (keys, opts, defaultOpts) => keys.reduce((acc, item) => ({ ...acc, [item]: opts[item] || defaultOpts[item] }), {});\r\nconst chainReservedOptions = (keys, opts, defaultOpts) => keys.reduce((acc, item) => ({\r\n ...acc,\r\n [item]: chainOptions(opts[item], defaultOpts[item]),\r\n}), {});\r\n// --------------------------------------------------------\r\n// helpers for create statics on class\r\n// --------------------------------------------------------\r\nconst createStaticsEnhancers = ({ context, dimensionKeys, func, opts }) => {\r\n dimensionKeys.forEach((item) => {\r\n // eslint-disable-next-line no-param-reassign\r\n context[item] = (props) => func({ [item]: props }, opts);\r\n });\r\n};\r\nconst cloneAndEnhance = (opts, defaultOpts) => styleComponent({\r\n ...defaultOpts,\r\n compose: { ...defaultOpts.compose, ...opts.compose },\r\n ...orOptions(CONFIG_KEYS, opts, defaultOpts),\r\n ...chainReservedOptions([...defaultOpts.dimensionKeys, ...STYLING_KEYS], opts, defaultOpts),\r\n});\r\n// --------------------------------------------------------\r\n// styleComponent\r\n// helper function which allows function chaining\r\n// always returns a valid React component with static functions\r\n// assigned, so it can be even rendered as a valid component\r\n// or styles can be extended via its statics\r\n// --------------------------------------------------------\r\nconst styleComponent = (options) => {\r\n const { component, styles } = options;\r\n const { styled } = config;\r\n // const _calculateChainOptions = calculateChainOptions(options.attrs)\r\n const _calculateStylingAttrs = calculateStylingAttrs({\r\n multiKeys: options.multiKeys,\r\n useBooleans: options.useBooleans,\r\n });\r\n const componentName = options.name || options.component.displayName || options.component.name;\r\n // create styled component with all options.styles if available\r\n const STYLED_COMPONENT = component.IS_ROCKETSTYLE || options.styled === false\r\n ? component\r\n : styled(component) `\n ${calculateStyles(styles, config.css)};\n `;\r\n // --------------------------------------------------------\r\n // final component to be rendered\r\n // --------------------------------------------------------\r\n const RenderComponent = options.provider\r\n ? RocketStyleProviderComponent(STYLED_COMPONENT)\r\n : STYLED_COMPONENT;\r\n // --------------------------------------------------------\r\n // hocs\r\n // --------------------------------------------------------\r\n const calculateHocsFuncs = Object.values(options.compose || {})\r\n .filter((item) => typeof item === 'function')\r\n .reverse();\r\n const hocsFuncs = [rocketStyleHOC(options), ...calculateHocsFuncs];\r\n // --------------------------------------------------------\r\n // ENHANCED COMPONENT (returned component)\r\n // --------------------------------------------------------\r\n // .attrs() chaining option is calculated in HOC and passed as props already\r\n const EnhancedComponent = forwardRef(({ $rocketstyleRef, // it's forwarded from HOC which is always on top of hocs\r\n ...props }, ref) => {\r\n // --------------------------------------------------\r\n // handle refs\r\n // (1) one is passed from inner HOC - $rocketstyleRef\r\n // (2) second one is used to be used directly (e.g. inside hocs)\r\n // --------------------------------------------------\r\n const internalRef = useRef(null);\r\n if ($rocketstyleRef)\r\n useImperativeHandle($rocketstyleRef, () => internalRef.current, [\r\n $rocketstyleRef,\r\n ]);\r\n if (ref)\r\n useImperativeHandle(ref, () => internalRef.current, [ref]);\r\n // --------------------------------------------------\r\n // hover - focus - pressed state passed via context from parent component\r\n // --------------------------------------------------\r\n const rocketstyleCtx = options.consumer ? useContext(localContext) : {};\r\n // --------------------------------------------------\r\n // general theme and theme mode dark / light passed in context\r\n // --------------------------------------------------\r\n const { theme, mode } = useThemeOptions(options);\r\n // --------------------------------------------------\r\n // calculate themes for all possible styling dimensions\r\n // .theme(...) + defined dimensions like .states(...), .sizes(...)\r\n // --------------------------------------------------\r\n const __ROCKETSTYLE__ = useMemo(() => useTheme({\r\n theme,\r\n options,\r\n cb: themeModeCb,\r\n }), \r\n // recalculate this only when theme changes\r\n [theme]);\r\n const { reservedPropNames, themes: rocketThemes, dimensions, baseTheme: rocketBaseTheme, } = __ROCKETSTYLE__;\r\n const { baseTheme, themes } = useMemo(() => calculateThemeMode({ themes: rocketThemes, baseTheme: rocketBaseTheme }, mode), \r\n // recalculate this only when theme mode changes dark / light\r\n [mode]);\r\n // --------------------------------------------------\r\n // calculate reserved Keys defined in dimensions as styling keys\r\n // there is no need to calculate this each time - keys are based on\r\n // dimensions definitions\r\n // --------------------------------------------------\r\n const RESERVED_STYLING_PROPS_KEYS = useMemo(() => Object.keys(reservedPropNames), []);\r\n // --------------------------------------------------\r\n // get final props which are (latest has the highest priority):\r\n // (1) merged styling from context,\r\n // (2) `attrs` chaining method, and from\r\n // (3) passing them directly to component\r\n // --------------------------------------------------\r\n const { pseudo = {}, ...mergeProps } = {\r\n ...(options.consumer\r\n ? options.consumer((callback) => callback(rocketstyleCtx))\r\n : {}),\r\n ...props,\r\n };\r\n // --------------------------------------------------\r\n // rocketstate\r\n // calculate final component state including pseudo state\r\n // passed as $rocketstate prop\r\n // --------------------------------------------------\r\n const rocketstate = _calculateStylingAttrs({\r\n props: pickStyledProps(mergeProps, reservedPropNames),\r\n dimensions,\r\n });\r\n // --------------------------------------------------\r\n // pseudo state\r\n // calculate final component pseudo state including pseudo state\r\n // from props and override by pseudo props from context\r\n // --------------------------------------------------\r\n const finalPseudo = {\r\n ...pick(props, PSEUDO_KEYS),\r\n ...pseudo,\r\n };\r\n const finalRocketstate = { ...rocketstate, pseudo: finalPseudo };\r\n // --------------------------------------------------\r\n // rocketstyle\r\n // calculated (based on styling props) final theme which will be passed\r\n // to our styled component\r\n // passed as $rocketstyle prop\r\n // --------------------------------------------------\r\n const rocketstyle = calculateTheme({\r\n rocketstate,\r\n themes,\r\n baseTheme,\r\n });\r\n // --------------------------------------------------\r\n // final props\r\n // final props passed to WrappedComponent\r\n // excluding: styling props\r\n // including: $rocketstyle, $rocketstate\r\n // --------------------------------------------------\r\n const finalProps = {\r\n // this removes styling state from props and passes its state\r\n // under rocketstate key only\r\n ...omit(mergeProps, [...RESERVED_STYLING_PROPS_KEYS, ...PSEUDO_KEYS]),\r\n // if enforced to pass styling props, we pass them directly\r\n ...(options.passProps ? pick(mergeProps, options.passProps) : {}),\r\n ref: ref || $rocketstyleRef ? internalRef : undefined,\r\n // state props passed to styled component only, therefore the `$` symbol\r\n $rocketstyle: rocketstyle,\r\n $rocketstate: finalRocketstate,\r\n };\r\n // all the development stuff injected\r\n if (process.env.NODE_ENV !== 'production') {\r\n finalProps['data-rocketstyle'] = componentName;\r\n }\r\n return React.createElement(RenderComponent, { ...finalProps });\r\n });\r\n // ------------------------------------------------------\r\n // This will hoist and generate dynamically next static methods\r\n // for all dimensions available in configuration\r\n // ------------------------------------------------------\r\n const RocketComponent = compose(...hocsFuncs)(EnhancedComponent);\r\n RocketComponent.IS_ROCKETSTYLE = true;\r\n RocketComponent.displayName = componentName;\r\n hoistNonReactStatics(RocketComponent, options.component);\r\n createStaticsEnhancers({\r\n context: RocketComponent,\r\n dimensionKeys: [...options.dimensionKeys, ...STATIC_KEYS],\r\n func: cloneAndEnhance,\r\n opts: options,\r\n });\r\n // ------------------------------------------------------\r\n RocketComponent.IS_ROCKETSTYLE = true;\r\n RocketComponent.displayName = componentName;\r\n // ------------------------------------------------------\r\n RocketComponent.config = (opts = {}) => {\r\n const result = pick(opts, CONFIG_KEYS);\r\n return cloneAndEnhance(result, options);\r\n };\r\n RocketComponent.getStaticDimensions = (theme) => {\r\n const themes = useTheme({ theme, options, cb: themeModeCb });\r\n return {\r\n dimensions: themes.dimensions,\r\n useBooleans: options.useBooleans,\r\n multiKeys: options.multiKeys,\r\n };\r\n };\r\n RocketComponent.getDefaultAttrs = (props, theme, mode) => {\r\n const result = calculateChainOptions(options.attrs)([\r\n props,\r\n theme,\r\n {\r\n renderContent,\r\n mode,\r\n isDark: mode === 'light',\r\n isLight: mode === 'dark',\r\n },\r\n ]);\r\n return result;\r\n };\r\n return RocketComponent;\r\n};\n\nconst DEFAULT_DIMENSIONS = {\r\n states: 'state',\r\n sizes: 'size',\r\n variants: 'variant',\r\n multiple: {\r\n propName: 'multiple',\r\n multi: true,\r\n },\r\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\nconst rocketstyle = () => ({ dimensions = DEFAULT_DIMENSIONS, useBooleans = true } = {}) => ({ name, component }) => {\r\n // --------------------------------------------------------\r\n // handle ERRORS in development mode\r\n // --------------------------------------------------------\r\n if (process.env.NODE_ENV !== 'production') {\r\n const errors = {};\r\n if (!component) {\r\n errors.component = 'Parameter `component` is missing in params!';\r\n }\r\n if (!name) {\r\n errors.name = 'Parameter `name` is missing in params!';\r\n }\r\n if (isEmpty(dimensions)) {\r\n errors.dimensions = 'Parameter `dimensions` is missing in params!';\r\n }\r\n else {\r\n const definedDimensions = getKeys(dimensions);\r\n const invalidDimension = ALL_RESERVED_KEYS.some((item) => definedDimensions.includes(item));\r\n if (invalidDimension) {\r\n errors.invalidDimensions = `Some of your \\`dimensions\\` is invalid and uses reserved static keys which are\n ${DEFAULT_DIMENSIONS.toString()}`;\r\n }\r\n }\r\n if (!isEmpty(errors)) {\r\n throw Error(JSON.stringify(errors));\r\n }\r\n }\r\n return styleComponent({\r\n name,\r\n component,\r\n useBooleans,\r\n dimensions,\r\n dimensionKeys: getKeys(dimensions),\r\n dimensionValues: getDimensionsValues(dimensions),\r\n multiKeys: getMultipleDimensions(dimensions),\r\n });\r\n};\n\nconst isRocketComponent = (component) => {\r\n if (typeof component === 'object' &&\r\n component !== null &&\r\n component.IS_ROCKETSTYLE) {\r\n return true;\r\n }\r\n return false;\r\n};\n\nexport { Provider, rocketstyle as default, isRocketComponent };\n//# sourceMappingURL=vitus-labs-rocketstyle.module.js.map\n","import React, { VFC } from 'react'\nimport { config } from '@vitus-labs/core'\n\nconst Wrapper = config.styled.div`\n display: flex;\n font-size: 32px;\n`\n\nconst component: VFC = () => <Wrapper>Nothing here</Wrapper>\n\ncomponent.displayName = '@vitus-labs/rocketstories/Empty'\n\nexport default component\n","/* eslint-disable no-underscore-dangle */\n\ndeclare global {\n interface Window {\n __VITUS_LABS_STORIES__: {\n decorators: {\n theme: Record<string, unknown>\n }\n }\n }\n}\n\ntype GetTheme = () => Record<string, unknown>\nconst getTheme: GetTheme = () => window.__VITUS_LABS_STORIES__.decorators.theme\n\nexport default getTheme\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-param-reassign */\nimport { get } from '@vitus-labs/core'\nimport type { Control, SimpleValue, Obj } from '~/types'\n\n// --------------------------------------------------------\n// parseProps\n// --------------------------------------------------------\ntype ObjValue = Control\n\ntype ParseProps = <\n T extends Record<string, SimpleValue | Array<SimpleValue> | ObjValue>\n>(\n props: T\n) => Record<keyof T, unknown>\n\nconst parseProps: ParseProps = (props) =>\n Object.entries(props).reduce((acc, [key, value]) => {\n if (value === null) return acc\n\n const valueType = typeof value\n\n if (['string', 'number', 'boolean', 'bigint'].includes(valueType)) {\n return { ...acc, [key]: value }\n }\n\n if (Array.isArray(value)) {\n return { ...acc, [key]: value }\n }\n\n if (valueType === 'object') {\n const type = get(value, 'type')\n const options = get(value, 'options')\n const defaultValue = get(value, 'value')\n\n // if has custom knobs configuration\n if (type && options && defaultValue) {\n return { ...acc, [key]: defaultValue || options }\n }\n\n return { ...acc, [key]: value }\n }\n\n return acc\n }, {} as any)\n\n// --------------------------------------------------------\n// stringifyArray\n// --------------------------------------------------------\ntype StringifyArray = (props: Array<unknown>) => string\n\nconst stringifyArray: StringifyArray = (props) => {\n let result = '['\n\n const arrayLength = props.length\n\n result += props.reduce((acc, value, i) => {\n if (Array.isArray(value)) {\n // TODO: parse arrays\n acc += `${stringifyArray(value)}`\n } else if (typeof value === 'object' && value !== null) {\n acc += `${stringifyObject(value as Record<string, any>)}`\n } else if (['number', 'string'].includes(typeof value)) {\n acc += `\"${value}\"`\n } else {\n acc += `${value}`\n }\n\n // if not last item, add comma and space\n if (arrayLength !== i + 1) {\n acc += `, `\n }\n\n return acc\n }, '')\n\n result += ']'\n\n return result\n}\n\n// --------------------------------------------------------\n// stringifyObject\n// --------------------------------------------------------\ntype StringifyObject = (props: Obj) => string\n\nconst stringifyObject: StringifyObject = (props) => {\n let result = '{ '\n\n const propsArray = Object.entries(props)\n const arrayLength = propsArray.length\n\n result += propsArray.reduce((acc, [key, value], i) => {\n if (Array.isArray(value)) {\n // TODO: parse arrays\n acc += `${key}: ${value}`\n } else if (typeof value === 'object' && value !== null) {\n acc += `${key}: ${stringifyObject(value)}`\n } else if (['string'].includes(typeof value)) {\n acc += `${key}: \"${value}\"`\n } else {\n acc += `${key}: ${value}`\n }\n\n if (arrayLength !== i + 1) {\n acc += `, `\n }\n\n return acc\n }, '')\n\n result += ' }'\n\n return result\n}\n\n// --------------------------------------------------------\n// stringifyObject\n// --------------------------------------------------------\ntype StringifyProps = (props: Obj) => string\n\nconst stringifyProps: StringifyProps = (props) => {\n const parsedProps = parseProps(props)\n const arrayProps = Object.entries(parsedProps)\n const arrayLength = arrayProps.length\n\n return arrayProps.reduce((acc, [key, value], i) => {\n if (typeof value === 'boolean') {\n if (value === true) acc += `${key}`\n else acc += `${key}=${value}`\n } else if (\n ['string', 'number'].includes(typeof value) ||\n value === null ||\n value === undefined\n ) {\n acc += `${key}=\"${value}\"`\n } else if (Array.isArray(value)) {\n acc += `${key}={${stringifyArray(value)}}`\n } else if (typeof value === 'object' && value !== null) {\n acc += `${key}={${stringifyObject(value as Record<string, any>)}}`\n }\n\n if (arrayLength !== i + 1) {\n acc += ' '\n }\n\n return acc\n }, '')\n}\n\nconst parseComponentName = (name) => {\n const helper = name.split('/')\n\n if (helper.length > 1) {\n return helper[helper.length - 1]\n }\n\n return name\n}\n\n// --------------------------------------------------------\n// createJSXCode\n// --------------------------------------------------------\ntype CreateJSXCode = (name: string, props: Obj) => string\n\nexport const createJSXCode: CreateJSXCode = (name, props) => {\n const componentName = parseComponentName(name)\n\n let result = `<${componentName} `\n\n result += stringifyProps(props)\n\n result += ` />`\n\n return result\n}\n\n// --------------------------------------------------------\n// createJSXCodeArray\n// --------------------------------------------------------\ntype CreateJSXCodeArray = (\n name: string,\n props: Obj,\n dimensionName: string,\n dimensions: Obj,\n useBooleans: boolean,\n isMultiKey: boolean\n) => string\n\nexport const createJSXCodeArray: CreateJSXCodeArray = (\n name,\n props,\n dimensionName,\n dimensions,\n useBooleans,\n isMultiKey\n) => {\n if (!dimensions) return `// nothing here`\n\n let result = ''\n\n const finalProps = { ...props }\n delete finalProps[dimensionName]\n\n result += Object.keys(dimensions).reduce((acc, key) => {\n acc += createJSXCode(name, {\n [dimensionName]: isMultiKey ? [key] : key,\n ...finalProps,\n })\n acc += `\\n`\n return acc\n }, '')\n\n if (useBooleans) {\n result += `\\n\\n`\n result += `// Or alternatively use boolean ${dimensionName} props (${Object.keys(\n dimensions\n ).toString()})`\n result += `\\n`\n\n result += Object.keys(dimensions).reduce((acc, key) => {\n acc += createJSXCode(name, { [key]: true, ...finalProps })\n acc += `\\n`\n return acc\n }, '')\n }\n\n return result\n}\n\n// --------------------------------------------------------\n// createMainJSX\n// --------------------------------------------------------\ntype CreateMainJSX = ({\n name,\n dimensions,\n params,\n booleanDimensions,\n}: {\n name: string\n dimensions: any\n params: any\n booleanDimensions: any\n}) => any\n\nexport const createMainJSX: CreateMainJSX = ({\n name,\n dimensions,\n params,\n booleanDimensions,\n}) => {\n let result = ''\n\n result += createJSXCode(name, { ...dimensions, ...params })\n\n if (booleanDimensions) {\n result += `\\n\\n`\n result += `// Or alternatively use boolean props (e.g. ${Object.keys(\n booleanDimensions\n )})`\n result += `\\n`\n result += createJSXCode(name, { ...booleanDimensions, ...params })\n }\n\n return result\n}\n","export const CONTROL_TYPES = [\n 'tag',\n 'text',\n 'number',\n 'range',\n 'boolean',\n 'color',\n 'select',\n 'multi-select',\n 'object',\n 'array',\n 'radio',\n 'inline-radio',\n 'check',\n 'inline-check',\n] as const\n\nexport type T_CONTROL_TYPES = typeof CONTROL_TYPES[number]\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { omit } from '@vitus-labs/core'\nimport { CONTROL_TYPES } from '~/constants/controls'\n\n// --------------------------------------------------------\n// Is valid control\n// --------------------------------------------------------\ntype IsValidControl = (value: any) => boolean\n\nconst isValidControl: IsValidControl = (value: any) =>\n typeof value === 'object' &&\n value !== null &&\n CONTROL_TYPES.includes(value.type)\n\n// --------------------------------------------------------\n// Filter controls\n// --------------------------------------------------------\ntype FilterControls = (obj: Record<string, any>) => Record<string, any>\n\nconst filterControls: FilterControls = (obj) =>\n Object.entries(obj).reduce((acc, [key, value]) => {\n if (isValidControl(value)) return { ...acc, [key]: value }\n\n return acc\n }, {})\n\n// --------------------------------------------------------\n// Filter values\n// --------------------------------------------------------\n\ntype FilterValues = (obj: Record<string, any>) => Record<string, any>\n\nconst filterValues: FilterValues = (obj) => {\n const controls = filterControls(obj)\n const controlKeys = Object.keys(controls)\n\n return omit(obj, controlKeys)\n}\n\nexport { filterControls, filterValues }\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { Controls } from '../../types'\n\n// --------------------------------------------------------\n// transformDimensionsToControls\n// --------------------------------------------------------\ntype DimensionsToControls = ({\n dimensions,\n multiKeys,\n}: {\n dimensions: Record<string, any>\n multiKeys: Record<string, true>\n}) => Controls\n\nconst dimensionsToControls: DimensionsToControls = ({\n dimensions,\n multiKeys,\n}) =>\n Object.entries(dimensions).reduce((acc, [key, value]) => {\n const valueKeys = Object.keys(value)\n const isMultiKey = !!multiKeys[key]\n\n const control = {\n type: isMultiKey ? 'multi-select' : 'select',\n value: isMultiKey ? undefined : valueKeys[0],\n options: valueKeys,\n group: 'Rocketstyle',\n }\n\n return { ...acc, [key]: control }\n }, {})\n\nexport default dimensionsToControls\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n// --------------------------------------------------------\n// disableControl\n// --------------------------------------------------------\ntype DisableControl = (\n name: string\n) => Record<string, { table: { disable: true } }>\n\nconst disableControl: DisableControl = (name) => ({\n [name]: { table: { disable: true } },\n})\n\n// --------------------------------------------------------\n// disableDimensionControls\n// --------------------------------------------------------\ntype DisableDimensionControls = (\n dimensions: Record<string, boolean>,\n name?: string\n) => any\n\nconst disableDimensionControls: DisableDimensionControls = (\n dimensions,\n dimensionName\n) => {\n const result = dimensionName ? disableControl(dimensionName) : {}\n const dimensionKeys = Object.values(dimensions)\n\n return dimensionKeys.reduce((acc, value) => {\n Object.keys(value).forEach((item) => {\n // eslint-disable-next-line no-param-reassign\n acc = { ...acc, ...disableControl(item) }\n })\n\n return acc\n }, result)\n}\n\nexport default disableDimensionControls\n","import { get } from '@vitus-labs/core'\nimport type { Controls, Control } from '~/types'\n\n// --------------------------------------------------------\n// filterDefaultValues\n// --------------------------------------------------------\ntype FilterDefaultValues = (props: Controls) => Record<string, Control['value']>\n\nconst filterDefaultValues: FilterDefaultValues = (props = {}) =>\n Object.entries(props).reduce((acc, [key, value]) => {\n const val = get(value, 'value')\n if (val) return { ...acc, [key]: val }\n\n return acc\n }, {})\n\nexport default filterDefaultValues\n","import { htmlTags } from '@vitus-labs/core'\nimport { CONTROL_TYPES } from '../../constants/controls'\n\nconst LABEL_SIMPLE = 'Simple Values'\nconst LABEL_OPTIONS = 'Options'\n\nexport const STORYBOOK_CONTROL_TYPES = CONTROL_TYPES\n\nexport const CONTROL_MAP = {\n tag: 'select',\n} as const\n\nexport const CONTROL_OPTIONS = {\n tag: htmlTags,\n} as const\n\nexport const CONTROL_TYPES_GROUPS = {\n text: LABEL_SIMPLE,\n number: LABEL_SIMPLE,\n color: LABEL_SIMPLE,\n range: LABEL_OPTIONS,\n object: LABEL_OPTIONS,\n array: LABEL_OPTIONS,\n select: LABEL_OPTIONS,\n 'multi-select': LABEL_OPTIONS,\n radio: LABEL_OPTIONS,\n 'inline-radio': LABEL_OPTIONS,\n check: LABEL_OPTIONS,\n 'check-radio': LABEL_OPTIONS,\n tag: 'HTML Semantics',\n boolean: 'Booleans',\n dateTime: 'Date & Time',\n events: 'Events',\n data: 'Data',\n} as const\n","import { CONTROL_OPTIONS, CONTROL_MAP, CONTROL_TYPES_GROUPS } from './constants'\n\nimport type { Control, StorybookControl } from '~/types'\n\n// --------------------------------------------------------\n// Make Controls\n// --------------------------------------------------------\ntype MakeControls = (\n obj: Record<string, Control>\n) => Record<string, StorybookControl>\n\nconst makeControls: MakeControls = (obj) =>\n Object.entries(obj).reduce(\n (acc, [key, value]) => ({\n ...acc,\n [key]: {\n control: { type: CONTROL_MAP[value.type] || value.type },\n defaultValue: value.value,\n description: value.description,\n options: value.options || CONTROL_OPTIONS[value.type],\n table: {\n disabled: value.disabled,\n category: value.group || CONTROL_TYPES_GROUPS[value.type],\n type: {\n summary: value.valueType,\n },\n },\n },\n }),\n {}\n )\n\nexport default makeControls\n","import { htmlTags } from '@vitus-labs/core'\n\nconst DIRECTION = {\n type: 'select',\n options: ['-----', 'rows', 'inline', 'reverseInline', 'reverseRows'],\n value: 'inline',\n group: 'Element',\n valueType: 'inline | rows | reverseRows | reverseInline | object | array',\n}\n\nconst ALIGN_X = {\n type: 'select',\n options: [\n '-----',\n 'left',\n 'center',\n 'right',\n 'block',\n 'spaceBetween',\n 'spaceAround',\n ],\n group: 'Element',\n value: 'left',\n valueType: 'left | center | right | block | spaceBetween | spaceAround',\n}\n\nconst ALIGN_Y = {\n type: 'select',\n options: ['top', 'center', 'block', 'spaceBetween', 'spaceAround'],\n value: 'center',\n group: 'Element',\n valueType: 'top | center | block | spaceBetween | spaceAround',\n}\n\nconst CSS = {\n type: 'text',\n group: 'Element',\n valueType: 'string | callback | css | object | array',\n}\n\nexport default {\n tag: {\n type: 'select',\n options: htmlTags,\n group: 'Element',\n valueType: 'HTMLTag',\n description: 'A prop which will change HTML tag of the element',\n },\n children: {\n description: 'React children',\n group: 'Element',\n valueType: 'ReactNode',\n },\n content: {\n type: 'text',\n valueType: 'ReactNode',\n group: 'Element',\n description: 'A prop which can be used instead of `children`',\n },\n label: {\n type: 'text',\n group: 'Element',\n valueType: 'ReactNode',\n description: 'A prop which can be used instead of `children`',\n },\n block: {\n type: 'boolean',\n group: 'Element',\n valueType: 'boolean | object | array',\n description: 'Whether should behave as `inline` or `block` element',\n },\n direction: {\n ...DIRECTION,\n value: '',\n description:\n 'Define whether element should render horizontally or vertically. Does the same job as `vertical` prop and takes a precedence over that prop',\n },\n alignX: {\n ...ALIGN_X,\n description:\n 'Define alignment of `beforeContent`, `content`, and `afterContent` with respect to root element',\n },\n alignY: {\n ...ALIGN_Y,\n description:\n 'Define alignment of `beforeContent`, `content`, and `afterContent` with respect to the root element',\n },\n contentDirection: {\n ...DIRECTION,\n description:\n 'Define whether children in content wrapper should be rendered in line or in rows',\n },\n contentAlignX: {\n ...ALIGN_X,\n description: 'Define how children in content wrapper should be aligned',\n },\n contentAlignY: {\n ...ALIGN_Y,\n description: 'Define how children in content wrapper should be aligned',\n },\n beforeContentDirection: {\n ...DIRECTION,\n description:\n 'Define whether children in beforeContent wrapper should be rendered in line or in rows',\n },\n beforeContentAlignX: {\n ...ALIGN_X,\n description:\n 'Define how children in beforeContent wrapper should be aligned',\n },\n beforeContentAlignY: {\n ...ALIGN_Y,\n description:\n 'Define how children in beforeContent wrapper should be aligned',\n },\n afterContentDirection: {\n ...DIRECTION,\n description:\n 'Define whether children in afterContent wrapper should be rendered in line or in rows',\n },\n afterContentAlignX: {\n ...ALIGN_X,\n description:\n 'Define how children in afterContent wrapper should be aligned',\n },\n afterContentAlignY: {\n ...ALIGN_Y,\n description:\n 'Define how children in afterContent wrapper should be aligned',\n },\n equalCols: {\n type: 'boolean',\n group: 'Element',\n valueType: 'boolean | object | array',\n description:\n 'Whether should all inner elements have the same `width` / `height`',\n },\n gap: {\n type: 'number',\n group: 'Element',\n valueType: 'number | object | array',\n description:\n 'Defines space between `beforeContent`, `content` and `afterContent`',\n },\n vertical: {\n type: 'boolean',\n group: 'Element',\n valueType: 'boolean | object | array',\n description:\n 'Define whether element should render horizontally or vertically',\n },\n beforeContent: {\n group: 'Element',\n valueType: 'ReactNode',\n description: 'A children to be rendered inside `beforeContent` wrapper.',\n },\n afterContent: {\n group: 'Element',\n valueType: 'ReactNode',\n description: 'A children to be rendered inside `afterContent` wrapper.',\n },\n css: {\n ...CSS,\n description:\n 'If you need to add an additional styling to the `root` element, you can do so by injecting styles using this property',\n },\n contentCss: {\n ...CSS,\n description:\n 'If you need to add an additional styling to the `content` element, you can do so by injecting styles using this property.',\n },\n beforeContentCss: {\n ...CSS,\n description:\n 'If you need to add an additional styling to the `beforeContent` element, you can do so by injecting styles using this property',\n },\n afterContentCss: {\n ...CSS,\n description:\n 'If you need to add an additional styling to the `afterContent` element, you can do so by injecting styles using this property.',\n },\n} as const\n","export default {\n rootElement: {\n type: 'boolean',\n group: 'List',\n valueType: 'boolean | object | array',\n description:\n 'Whether a `root` element should be rendered or the output should be just a type of React `Fragment`',\n },\n data: {\n type: 'array',\n group: 'List',\n valueType: 'string[] | number[] | object[]',\n description: 'An array of item values to be passed to item component',\n },\n valueName: {\n type: 'text',\n group: 'List',\n valueType: `string[] | number[] | object[]`,\n description:\n 'Can be used when `data` consists of `strings` or `numbers` to name value being passed as a prop',\n },\n itemProps: {\n group: 'List',\n valueType: `object | callack`,\n description:\n 'A customizable hook for dynamically render props for each `item` component',\n },\n wrapProps: {\n group: 'List',\n valueType: `object | callack`,\n description:\n 'A customizable hook for dynamically render props for each `wrapComponent`',\n },\n itemKey: {\n group: 'List',\n valueType: `string | callack`,\n description:\n \"Prop for defining item key `name` / `value` if default behavior doesn't work out\",\n },\n label: {\n disable: true,\n },\n content: {\n disable: true,\n },\n component: {\n group: 'List',\n valueType: `ComponentType`,\n description: 'A component to be rendered per item',\n },\n wrapComponent: {\n group: 'List',\n valueType: `string[] | number[] | object[]`,\n description:\n 'A component to be used as a wrapper component for item component',\n },\n} as const\n","export default {\n refName: {\n type: 'text',\n value: 'ref',\n description:\n \"Overlay component access `ref` to directly mutate styles when calculation position to prevent re-renders. It's being used for both `trigger`, and `children` element at the same time. Your components must accept refs with the same naming.\",\n group: 'Overlay',\n },\n triggerRefName: {\n type: 'text',\n description: 'A key name how a `ref` should be passed to trigger component',\n group: 'Overlay',\n },\n contentRefName: {\n type: 'text',\n description: 'A key name how a `ref` should be passed to content component',\n group: 'Overlay',\n },\n isOpen: {\n type: 'boolean',\n value: false,\n description: '',\n group: 'Overlay',\n },\n openOn: {\n type: 'select',\n options: ['click', 'hover'],\n value: 'click',\n description: '',\n group: 'Overlay',\n },\n closeOn: {\n type: 'select',\n options: ['click', 'triggerClick', 'hover', 'manual'],\n value: 'click',\n description: '',\n group: 'Overlay',\n },\n type: {\n type: 'select',\n options: ['dropdown', 'tooltip', 'popover', 'modal'],\n value: 'dropdown',\n description: '',\n group: 'Overlay',\n },\n align: {\n type: 'select',\n options: ['top', 'left', 'bottom', 'right'],\n value: 'bottom',\n description: '',\n group: 'Overlay',\n },\n alignX: {\n type: 'select',\n options: ['left', 'center', 'right'],\n value: 'left',\n description: '',\n group: 'Overlay',\n },\n alignY: {\n type: 'select',\n options: ['top', 'center', 'bottom'],\n value: 'bottom',\n description: '',\n group: 'Overlay',\n },\n position: {\n type: 'select',\n options: ['fixed', 'absolute', 'relative', 'static'],\n value: 'fixed',\n description: '',\n group: 'Overlay',\n },\n offsetX: {\n type: 'number',\n value: 0,\n description: '',\n group: 'Overlay',\n },\n offsetY: {\n type: 'number',\n value: 0,\n description: '',\n group: 'Overlay',\n },\n throttleDelay: {\n type: 'number',\n value: 200,\n description: '',\n group: 'Overlay',\n },\n children: {\n description: 'A content to be rendered when Overlay is open',\n },\n} as const\n","export default {\n hover: {\n type: 'boolean',\n group: 'Rocketstyle',\n },\n active: {\n type: 'boolean',\n group: 'Rocketstyle',\n },\n pressed: {\n type: 'boolean',\n group: 'Rocketstyle',\n },\n focus: {\n type: 'boolean',\n group: 'Rocketstyle',\n },\n onMouseEnter: {\n group: 'Rocketstyle',\n },\n onMouseLeave: {\n group: 'Rocketstyle',\n },\n onMouseDown: {\n group: 'Rocketstyle',\n },\n onMouseUp: {\n group: 'Rocketstyle',\n },\n onFocus: {\n group: 'Rocketstyle',\n },\n onBlur: {\n group: 'Rocketstyle',\n },\n} as const\n","import { htmlTags } from '@vitus-labs/core'\n\nexport default {\n paragraph: {\n type: 'boolean',\n group: 'Text',\n },\n tag: {\n type: 'select',\n options: htmlTags,\n group: 'Text',\n },\n children: {\n type: 'text',\n group: 'Text',\n },\n label: {\n type: 'text',\n group: 'Text',\n },\n extendCss: {\n type: 'text',\n group: 'Text',\n },\n} as const\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as CONTROLS from '~/controls'\nimport type { Controls, RocketComponent } from '~/types'\n\n// --------------------------------------------------------\n// isColor\n// --------------------------------------------------------\ntype IsColor = (value: string) => boolean\n\nconst isColor: IsColor = (value) => {\n const s = new Option().style\n s.color = value\n // eslint-disable-next-line eqeqeq\n return s.color == value\n}\n\n// --------------------------------------------------------\n// getControlType\n// --------------------------------------------------------\ntype GetControlType = (\n value: any\n) => 'array' | 'boolean' | 'number' | 'color' | 'text' | 'object' | undefined\n\nconst getControlType: GetControlType = (value) => {\n const primitiveType = typeof value\n\n if (Array.isArray(value)) return 'array'\n\n if (primitiveType === 'boolean') return primitiveType\n\n if (['number', 'bigint'].includes(primitiveType)) return 'number'\n\n if (primitiveType === 'string') {\n if (isColor(value)) return 'color'\n\n return 'text'\n }\n\n if (primitiveType === 'object' && value !== null) return primitiveType\n\n return undefined\n}\n\n// --------------------------------------------------------\n// transformToControls\n// --------------------------------------------------------\ntype TransformToControls = (props: Record<string, unknown>) => Controls\n\nconst transformToControls: TransformToControls = (props) =>\n Object.entries(props).reduce((acc, [key, value]) => {\n const type = getControlType(value)\n\n return {\n ...acc,\n [key]: {\n type,\n value,\n },\n }\n }, {})\n\n// --------------------------------------------------------\n// get Predefined Controls\n// --------------------------------------------------------\ntype GetPredefinedControls = (obj: Controls, defaultProps: Controls) => Controls\n\nconst getPredefinedControls: GetPredefinedControls = (obj, defaultProps) =>\n Object.entries(obj).reduce((acc, [key, value]) => {\n const attrControl = defaultProps[key]\n\n if (!value.type) return acc\n\n if (attrControl) {\n return {\n ...acc,\n [key]: {\n ...value,\n value: attrControl.value || value.value,\n options: attrControl.options || value.options,\n },\n }\n }\n\n return acc\n }, obj)\n\n// --------------------------------------------------------\n// values to controls\n// --------------------------------------------------------\ntype ValuesToControls = ({\n component,\n values,\n dimensionControls,\n}: {\n component: RocketComponent\n values: Record<string, any>\n dimensionControls: Record<string, any>\n}) => Controls\n\nconst valuesToControls: ValuesToControls = ({\n component,\n values,\n dimensionControls = {},\n}) => {\n const { IS_ROCKETSTYLE, VITUS_LABS__COMPONENT } = component\n\n const IS_ELEMENT = VITUS_LABS__COMPONENT === '@vitus-labs/elements/Element'\n const IS_LIST = VITUS_LABS__COMPONENT === '@vitus-labs/elements/List'\n const IS_TEXT = VITUS_LABS__COMPONENT === '@vitus-labs/elements/Text'\n const IS_OVERLAY = VITUS_LABS__COMPONENT === '@vitus-labs/elements/Overlay'\n\n const attrsControls = transformToControls(values)\n\n return {\n ...(IS_ELEMENT || IS_LIST\n ? getPredefinedControls(CONTROLS.ELEMENT_CONTROLS as any, attrsControls)\n : {}),\n\n ...(IS_LIST\n ? getPredefinedControls(CONTROLS.LIST_CONTROLS as any, attrsControls)\n : {}),\n\n ...(IS_TEXT\n ? getPredefinedControls(CONTROLS.TEXT_CONTROLS as any, attrsControls)\n : {}),\n\n ...(IS_OVERLAY\n ? getPredefinedControls(CONTROLS.OVERLAY_CONTROLS as any, attrsControls)\n : {}),\n\n ...dimensionControls,\n\n ...(IS_ROCKETSTYLE\n ? getPredefinedControls(\n CONTROLS.ROCKETSTYLE_CONTROLS as any,\n attrsControls\n )\n : {}),\n }\n}\n\nexport default valuesToControls\n","import React, { createElement, Fragment } from 'react'\nimport { pick, isEmpty } from '@vitus-labs/core'\nimport { Element, Text } from '@vitus-labs/elements'\nimport NotFound from '~/components/NotFound'\nimport getTheme from '~/utils/theme'\nimport { createJSXCodeArray } from '~/utils/code'\nimport {\n filterDefaultValues,\n disableDimensionControls,\n dimensionsToControls,\n makeControls,\n filterControls,\n filterValues,\n valuesToControls,\n} from '~/utils/controls'\n\nimport type { RocketComponent, StoryComponent, Configuration } from '~/types'\n\ntype MakeDimensionStories = ({\n name,\n component,\n dimension,\n attrs,\n}: {\n name: string\n component: RocketComponent\n dimension: string\n attrs: Configuration['attrs']\n storyOptions: Configuration['storyOptions']\n ignore: any\n}) => StoryComponent\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst makeDimensionStories: MakeDimensionStories = ({\n name,\n component,\n dimension,\n attrs = {},\n storyOptions = {},\n ignore,\n // config = { pseudo: true },\n}) => {\n // ------------------------------------------------------\n // ROCKETSTYLE COMPONENT INFO\n // ------------------------------------------------------\n const theme = getTheme()\n const statics = component.getStaticDimensions(theme)\n const defaultAttrs = component.getDefaultAttrs(attrs, theme, 'light')\n const { dimensions, useBooleans, multiKeys } = statics\n\n const allStoryAttrs = { ...defaultAttrs, ...attrs }\n\n // ------------------------------------------------------\n // CURRENT ROCKETSTYLE DIMENSION INFO\n // ------------------------------------------------------\n const currentDimension = dimensions[dimension]\n const isMultiKey = !!multiKeys[dimension]\n\n // ------------------------------------------------------\n //\n // RENDER EMPTY PAGE WHEN DIMENSION IS NOT AVAILABLE\n //\n // ------------------------------------------------------\n const DONT_RENDER = isEmpty(currentDimension)\n if (DONT_RENDER) return NotFound\n\n // ------------------------------------------------------\n // CONTROLS GENERATION\n // ------------------------------------------------------\n const definedControls = filterControls(allStoryAttrs)\n const values = filterValues(allStoryAttrs)\n\n const dimensionControls = dimensionsToControls(statics)\n\n const controls = valuesToControls({\n component,\n values,\n dimensionControls,\n })\n\n const storybookControls = makeControls({\n ...controls,\n ...definedControls,\n })\n\n // ------------------------------------------------------\n // CONTROLS DEFAULT VALUES\n // ------------------------------------------------------\n const args = filterDefaultValues(controls)\n\n // ------------------------------------------------------\n // STORY COMPONENT\n // ------------------------------------------------------\n const WrapElement = isEmpty(storyOptions) ? Fragment : Element\n\n const Enhanced = (props) => {\n return (\n <WrapElement\n block\n contentDirection={storyOptions.direction}\n contentAlignX={storyOptions.alignX}\n contentAlignY={storyOptions.alignY}\n // @ts-ignore\n style={{ gap: storyOptions.gap }}\n >\n {Object.keys(currentDimension).map((item) => {\n const shouldBeIgnored = ignore.includes(item)\n const key = `${dimension}-${item}`\n\n // do not render ignored dimension keys\n if (shouldBeIgnored) return null\n\n if (storyOptions.pseudo) {\n return (\n <WrapElement\n key={key}\n data-story={key}\n contentDirection={\n storyOptions.direction === 'rows' ? 'inline' : 'rows'\n }\n contentAlignX={storyOptions.alignX}\n contentAlignY={storyOptions.alignY}\n // @ts-ignore\n style={{ gap: storyOptions.gap / 2 }}\n >\n <div>\n <Text paragraph>Base</Text>\n {createElement(component, {\n ...props,\n [dimension]: isMultiKey ? [item] : item,\n })}\n </div>\n\n <div>\n <Text paragraph>Hover</Text>\n {createElement(component, {\n ...props,\n [dimension]: isMultiKey ? [item] : item,\n hover: true,\n })}\n </div>\n\n <div>\n <Text paragraph>Pressed</Text>\n {createElement(component, {\n ...props,\n [dimension]: isMultiKey ? [item] : item,\n pressed: true,\n })}\n </div>\n\n <div>\n <Text paragraph>Active</Text>\n {createElement(component, {\n ...props,\n [dimension]: isMultiKey ? [item] : item,\n active: true,\n })}\n </div>\n </WrapElement>\n )\n }\n\n return (\n <WrapElement\n key={key}\n data-story={`${dimension}-${item}`}\n {...storyOptions}\n contentDirection=\"rows\"\n >\n {createElement(component, {\n ...props,\n [dimension]: isMultiKey ? [item] : item,\n })}\n </WrapElement>\n )\n })}\n </WrapElement>\n )\n }\n\n Enhanced.args = args\n Enhanced.argTypes = {\n ...storybookControls,\n ...disableDimensionControls(dimensions, dimension),\n }\n\n Enhanced.parameters = {\n docs: {\n // description: {\n // story: 'some story **markdown**',\n // },\n source: {\n code: createJSXCodeArray(\n name,\n pick(args, Object.keys(attrs)),\n dimension,\n currentDimension,\n useBooleans,\n isMultiKey\n ),\n },\n },\n }\n\n return Enhanced\n}\n\nexport default makeDimensionStories\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n// --------------------------------------------------------\n// extractDefaultBooleanProps\n// --------------------------------------------------------\ntype ExtractDefaultBooleanProps = ({\n dimensions,\n multiKeys,\n}: {\n dimensions: Record<string, any>\n multiKeys: Record<string, true>\n}) => Record<string, any>\n\n// eslint-disable-next-line import/prefer-default-export\nexport const extractDefaultBooleanProps: ExtractDefaultBooleanProps = ({\n dimensions,\n multiKeys,\n}) =>\n Object.entries(dimensions).reduce((acc, [key, value]) => {\n if (!multiKeys[key]) {\n const propName = Object.keys(value)[0]\n\n return { ...acc, [propName]: true }\n }\n\n return acc\n }, {})\n","import React, { createElement } from 'react'\nimport { pick } from '@vitus-labs/core'\nimport getTheme from '~/utils/theme'\nimport { createMainJSX } from '~/utils/code'\nimport { extractDefaultBooleanProps } from '~/utils/dimensions'\n\nimport {\n filterDefaultValues,\n makeControls,\n filterControls,\n filterValues,\n valuesToControls,\n dimensionsToControls,\n disableDimensionControls,\n} from '~/utils/controls'\n\nimport type { RocketComponent, StoryComponent } from '~/types'\n\ntype MainStory = ({\n name,\n component,\n attrs,\n}: {\n name: string\n component: RocketComponent\n attrs: Record<string, unknown>\n}) => StoryComponent\n\nconst mainStory: MainStory = ({ name, component, attrs }) => {\n // ------------------------------------------------------\n // ROCKETSTYLE COMPONENT INFO\n // ------------------------------------------------------\n const theme = getTheme()\n const statics = component.getStaticDimensions(theme)\n const defaultAttrs = component.getDefaultAttrs(attrs, theme, 'light')\n const { dimensions, useBooleans, multiKeys } = statics\n\n const allStoryAttrs = { ...defaultAttrs, ...attrs }\n\n // ------------------------------------------------------\n // CONTROLS GENERATION\n // ------------------------------------------------------\n const definedControls = filterControls(allStoryAttrs)\n const values = filterValues(allStoryAttrs)\n\n const dimensionControls = dimensionsToControls(statics)\n\n const controls = valuesToControls({\n component,\n values,\n dimensionControls,\n })\n\n const storybookControls = makeControls({\n ...controls,\n ...definedControls,\n })\n\n // ------------------------------------------------------\n // CONTROLS DEFAULT VALUES\n // ------------------------------------------------------\n const args = filterDefaultValues(controls)\n\n // ------------------------------------------------------\n // PROPS TO BE PASSED TO ODE GENERATION\n // ------------------------------------------------------\n const codeDimensionProps = Object.entries(dimensionControls).reduce(\n (acc, [key, value]) => ({ ...acc, [key]: value.value }),\n {}\n )\n\n const codeProps = pick(args, Object.keys(attrs))\n\n // ------------------------------------------------------\n // STORY COMPONENT\n // ------------------------------------------------------\n const Enhanced = (props) => <>{createElement(component, props)}</>\n\n Enhanced.args = args\n Enhanced.argTypes = {\n ...storybookControls,\n ...disableDimensionControls(dimensions),\n }\n\n Enhanced.parameters = {\n docs: {\n source: {\n code: createMainJSX({\n name,\n dimensions: codeDimensionProps,\n params: codeProps,\n booleanDimensions: useBooleans\n ? extractDefaultBooleanProps({\n dimensions,\n multiKeys,\n })\n : null,\n }),\n },\n },\n }\n\n return Enhanced\n}\n\nexport default mainStory\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { createElement, VFC, ComponentType } from 'react'\nimport {\n filterControls,\n filterValues,\n valuesToControls,\n makeControls,\n} from '~/utils/controls'\nimport filterDefaultValues from '~/utils/controls/filterDefaultValues'\n\ntype Story = ({\n component,\n attrs,\n}: {\n component: ComponentType\n attrs: Record<string, unknown>\n}) => VFC & { args: any; argTypes: any }\n\nconst story: Story = ({ component, attrs }) => {\n const definedControls = filterControls(attrs)\n const values = filterValues(attrs)\n\n const controls = valuesToControls({\n component: component as any,\n values,\n dimensionControls: {},\n })\n\n const storybookControls = makeControls({\n ...controls,\n ...definedControls,\n })\n\n const args = filterDefaultValues(controls)\n\n const Enhanced = (props) => createElement(component, props)\n\n Enhanced.args = args\n Enhanced.argTypes = storybookControls\n\n return Enhanced\n}\n\nexport default story\n","import { get } from '@vitus-labs/core'\nimport { isRocketComponent } from '@vitus-labs/rocketstyle'\nimport { dimensionStory, mainStory, generalStory } from './stories'\nimport type {\n Element,\n RocketComponent,\n Configuration,\n AttrsTypes,\n} from './types'\n\ntype Init = ({\n decorators,\n storyOptions,\n}: Partial<Pick<Configuration, 'decorators' | 'storyOptions'>>) => <\n T extends Element | RocketComponent = any\n>(\n component: T\n) => T extends RocketComponent\n ? ReturnType<CreateRocketStories<T>>\n : ReturnType<CreateStories<T>>\n\nconst init: Init = ({ decorators = [], storyOptions = {} }) => (component) =>\n rocketstories(component, { decorators, storyOptions })\n\n// --------------------------------------------------------\n// rocketstories\n// --------------------------------------------------------\ntype Rocketstories = <T extends Element | RocketComponent = any>(\n component: T,\n {\n decorators,\n storyOptions,\n }?: Partial<Pick<Configuration<T>, 'storyOptions' | 'decorators'>> | any\n) => T extends RocketComponent\n ? ReturnType<CreateRocketStories<T>>\n : ReturnType<CreateStories<T>>\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst rocketstories: Rocketstories = (\n component,\n { decorators = [], storyOptions = {} } = {}\n) => {\n if (!isRocketComponent(component)) {\n return createStories(\n {\n component,\n name: component.displayName || component.name,\n attrs: {},\n storyOptions: { gap: 16, direction: 'rows', ...storyOptions },\n decorators,\n },\n {} as Configuration\n )\n }\n\n return createRocketstories(\n {\n component,\n name: component.displayName || component.name,\n attrs: {},\n storyOptions: { gap: 16, direction: 'rows', ...storyOptions },\n decorators,\n },\n {} as Configuration\n )\n}\n\n// --------------------------------------------------------\n// create Stories\n// --------------------------------------------------------\ntype CreateStories<C = Element> = (\n options: Partial<Configuration>,\n defaultOptions: Configuration\n) => {\n attrs: (params: AttrsTypes<C>) => ReturnType<CreateStories<C>>\n config: () => {\n component: Element\n title: string\n decorators?: Configuration['decorators']\n }\n main: () => ReturnType<typeof generalStory>\n}\n\nconst createStories: CreateStories = (options, defaultOptions) => {\n const result = {\n ...defaultOptions,\n name: get(options, 'component')\n ? get(options, 'component.displayName')\n : defaultOptions.name,\n component: options.component || defaultOptions.component,\n attrs: { ...defaultOptions.attrs, ...options.attrs },\n storyOptions: { ...defaultOptions.storyOptions, ...options.storyOptions },\n decorators: [...defaultOptions.decorators, ...(options.decorators || [])],\n } as Configuration\n\n return {\n attrs: (attrs) => createStories({ attrs }, result),\n\n // create object for `export default` in stories\n config: () => ({\n component: result.component,\n title: result.name as string,\n decorators: result.decorators,\n }),\n\n main: () => generalStory(result),\n }\n}\n\n// --------------------------------------------------------\n// create rocket stories\n// --------------------------------------------------------\n\ntype ExtractDimensions<C extends RocketComponent> = keyof C['$$rocketstyle']\n\ntype CreateRocketStories<C extends RocketComponent = any> = (\n options: Partial<Configuration<C>>,\n defaultOptions: Configuration<C>\n) => {\n attrs: (params: AttrsTypes<C>) => ReturnType<CreateRocketStories<C>>\n config: () => { component: Element; title: string }\n main: () => ReturnType<typeof mainStory>\n storyOptions: (\n options: Configuration['storyOptions']\n ) => ReturnType<CreateRocketStories<C>>\n dimension: <A extends ExtractDimensions<C>, B = keyof C['$$rocketstyle'][A]>(\n dimension: A,\n params?: Partial<{ ignore: any }>\n ) => ReturnType<typeof dimensionStory>\n}\n\nconst createRocketstories: CreateRocketStories = (options, defaultOptions) => {\n const result = {\n ...defaultOptions,\n name: get(options, 'component')\n ? get(options, 'component.displayName')\n : defaultOptions.name,\n component: options.component || defaultOptions.component,\n attrs: { ...defaultOptions.attrs, ...options.attrs },\n storyOptions: { ...defaultOptions.storyOptions, ...options.storyOptions },\n decorators: [...defaultOptions.decorators, ...(options.decorators || [])],\n } as Configuration\n\n return {\n attrs: (attrs: Configuration['attrs']) =>\n createRocketstories({ attrs }, result),\n\n // create object for `export default` in stories\n config: () => ({\n component: result.component,\n title: result.name,\n decorators: result.decorators,\n }),\n\n // generate main story\n main: () => mainStory(result as any),\n\n //define storyOptions\n storyOptions: (storyOptions) =>\n createRocketstories({ storyOptions }, result),\n\n // generate stories of defined dimension\n dimension: (dimension, params = {}) => {\n const { ignore = [] } = params\n\n return dimensionStory({\n ...result,\n ignore,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n dimension,\n })\n },\n }\n}\n\nexport { init }\n\nexport default rocketstories\n"],"names":["createContext","config","React","get","omit","htmlTags","CONTROLS.ELEMENT_CONTROLS","CONTROLS.LIST_CONTROLS","CONTROLS.TEXT_CONTROLS","CONTROLS.OVERLAY_CONTROLS","CONTROLS.ROCKETSTYLE_CONTROLS","component","isEmpty","NotFound","Fragment","Element","Text","createElement","pick","generalStory","dimensionStory"],"mappings":";;;;;;;;;;;;;AAoOA,MAAM,WAAW,GAAG;AACpB,IAAI,KAAK,EAAE,IAAI;AACf,IAAI,IAAI,EAAE,IAAI;AACd,CAAC,CAAC;AAKF,MAAM,WAAW,GAAG;AACpB,IAAI,UAAU;AACd,IAAI,UAAU;AACd,IAAI,OAAO;AACX,IAAI,MAAM;AACV,IAAI,WAAW;AACf,IAAI,UAAU;AACd,IAAI,WAAW;AACf,IAAI,QAAQ;AACZ,CAAC,CAAC;AACF,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAClD,MAAM,WAAW,GAAG,CAAC,GAAG,YAAY,EAAE,SAAS,CAAC,CAAC;AACvB;AAC1B,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;AAC/B,IAAI,GAAG,WAAW;AAClB,IAAI,GAAG,WAAW;AAClB,EAAE;AAwGF;AACmBA,mBAAa,CAAC,EAAE,EAAE;AAiSrC;AACA,MAAM,iBAAiB,GAAG,CAAC,SAAS,KAAK;AACzC,IAAI,IAAI,OAAO,SAAS,KAAK,QAAQ;AACrC,QAAQ,SAAS,KAAK,IAAI;AAC1B,QAAQ,SAAS,CAAC,cAAc,EAAE;AAClC,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,IAAI,OAAO,KAAK,CAAC;AACjB,CAAC;;AC3oBD,MAAM,OAAO,GAAGC,WAAM,CAAC,MAAM,CAAC,GAAG,CAAA;;;CAGhC,CAAA;AAED,MAAM,SAAS,GAAQ,MAAMC,wCAAC,OAAO,uBAAuB,C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SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,cAAc,CAAC,SAAS;QACxD,KAAK,EAAE,EAAE,GAAG,cAAc,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE;QACpD,YAAY,EAAE,EAAE,GAAG,cAAc,CAAC,YAAY,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE;QACzE,UAAU,EAAE,CAAC,GAAG,cAAc,CAAC,UAAU,EAAE,IAAI,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;KACzD,CAAA;IAElB,OAAO;QACL,KAAK,EAAE,CAAC,KAA6B,KACnC,mBAAmB,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,CAAC;;QAGxC,MAAM,EAAE,OAAO;YACb,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,KAAK,EAAE,MAAM,CAAC,IAAI;YAClB,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;;QAGF,IAAI,EAAE,MAAM,SAAS,CAAC,MAAa,CAAC;;QAGpC,YAAY,EAAE,CAAC,YAAY,KACzB,mBAAmB,CAAC,EAAE,YAAY,EAAE,EAAE,MAAM,CAAC;;QAG/C,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,EAAE;YAChC,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,MAAM,CAAA;YAE9B,OAAOiB,oBAAc,CAAC;gBACpB,GAAG,MAAM;gBACT,MAAM;;;gBAGN,SAAS;aACV,CAAC,CAAA;SACH;KACF,CAAA;AACH,CAAC;;;;;"}
1
+ {"version":3,"file":"vitus-labs-rocketstories.js","sources":["../../rocketstyle/lib/vitus-labs-rocketstyle.module.js","../src/components/NotFound.tsx","../src/utils/theme.ts","../src/utils/code.ts","../src/constants/controls.ts","../src/utils/controls/attrs.ts","../src/utils/controls/dimensionToControls.ts","../src/utils/controls/disableControls.ts","../src/utils/controls/filterDefaultValues.ts","../src/utils/controls/constants.ts","../src/utils/controls/makeControls.ts","../src/controls/element.ts","../src/controls/list.ts","../src/controls/overlay.ts","../src/controls/rocketstyle.ts","../src/controls/text.ts","../src/utils/controls/valuesToControls.ts","../src/stories/dimension.tsx","../src/utils/dimensions.ts","../src/stories/main.tsx","../src/stories/story.tsx","../src/rocketstories.tsx"],"sourcesContent":["import { isEmpty, set, get, merge, config, Provider as Provider$1, context, renderContent, pick, omit, compose } from '@vitus-labs/core';\nexport { context } from '@vitus-labs/core';\nimport React, { useState, useCallback, useContext, forwardRef, createContext, useRef, useImperativeHandle, useMemo } from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nconst handleEvent = (e) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n};\r\nconst usePseudoState = (props) => {\r\n const [hover, setHover] = useState(false);\r\n const [focus, setFocus] = useState(false);\r\n const [pressed, setPressed] = useState(false);\r\n const onMouseEnter = useCallback((e) => {\r\n handleEvent(e);\r\n setHover(true);\r\n if (props.onMouseEnter)\r\n props.onMouseEnter(e);\r\n }, [props.onMouseEnter]);\r\n const onMouseLeave = useCallback((e) => {\r\n handleEvent(e);\r\n setHover(false);\r\n setPressed(false);\r\n if (props.onMouseLeave)\r\n props.onMouseLeave(e);\r\n }, [props.onMouseLeave]);\r\n const onMouseDown = useCallback((e) => {\r\n handleEvent(e);\r\n setPressed(true);\r\n if (props.onMouseDown)\r\n props.onMouseDown(e);\r\n }, [props.onMouseDown]);\r\n const onMouseUp = useCallback((e) => {\r\n handleEvent(e);\r\n setPressed(false);\r\n if (props.onMouseUp)\r\n props.onMouseUp(e);\r\n }, [props.onMouseUp]);\r\n const onFocus = useCallback((e) => {\r\n handleEvent(e);\r\n setFocus(true);\r\n if (props.onFocus)\r\n props.onFocus(e);\r\n }, [props.onFocus]);\r\n const onBlur = useCallback((e) => {\r\n handleEvent(e);\r\n setFocus(false);\r\n if (props.onBlur)\r\n props.onBlur(e);\r\n }, [props.onBlur]);\r\n return {\r\n state: {\r\n hover,\r\n focus,\r\n pressed,\r\n },\r\n events: {\r\n onMouseEnter,\r\n onMouseLeave,\r\n onMouseDown,\r\n onMouseUp,\r\n onFocus,\r\n onBlur,\r\n },\r\n };\r\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\n/* eslint-disable import/prefer-default-export */\r\nconst chainOptions = (opts, defaultOpts = []) => {\r\n const result = [...defaultOpts];\r\n if (typeof opts === 'function')\r\n result.push(opts);\r\n else if (typeof opts === 'object')\r\n result.push(() => opts);\r\n return result;\r\n};\r\nconst removeNullableValues = (obj) => Object.entries(obj)\r\n .filter(([, v]) => v != null && v !== false)\r\n .reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {});\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\nconst isValidKey = (value) => value !== undefined && value !== null && value !== false;\r\nconst isMultiKey = (value) => {\r\n if (typeof value === 'object')\r\n return [true, get(value, 'propName')];\r\n return [false, value];\r\n};\r\nconst calculateDimensionsMap = ({ themes, useBooleans, }) => {\r\n const result = { keysMap: {}, keywords: {} };\r\n if (isEmpty(themes))\r\n return result;\r\n return Object.entries(themes).reduce((accumulator, [key, value]) => {\r\n const { keysMap, keywords } = accumulator;\r\n keywords[key] = true;\r\n Object.entries(value).forEach(([itemKey, itemValue]) => {\r\n if (!isValidKey(itemValue))\r\n return;\r\n if (useBooleans) {\r\n keywords[itemKey] = true;\r\n }\r\n set(keysMap, [key, itemKey], true);\r\n });\r\n return accumulator;\r\n }, result);\r\n};\r\nconst getKeys = (obj) => Object.keys(obj);\r\nconst getValues = (obj) => Object.values(obj);\r\nconst getDimensionsValues = (obj) => getValues(obj).map((item) => {\r\n if (typeof item === 'object') {\r\n return item.propName;\r\n }\r\n return item;\r\n});\r\nconst getMultipleDimensions = (obj) => getValues(obj).reduce((accumulator, value) => {\r\n if (typeof value === 'object') {\r\n // eslint-disable-next-line no-param-reassign\r\n if (value.multi === true)\r\n accumulator[value.propName] = true;\r\n }\r\n return accumulator;\r\n}, {});\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\n// --------------------------------------------------------\r\n// theme mode callback\r\n// --------------------------------------------------------\r\nconst themeModeCb = (...params) => (mode) => {\r\n if (!mode || mode === 'light')\r\n return params[0];\r\n return params[1];\r\n};\r\nconst calculateDimensionThemes = (theme, options, cb) => {\r\n const result = {};\r\n if (isEmpty(options.dimensions))\r\n return result;\r\n return Object.entries(options.dimensions).reduce((accumulator, [key, value]) => {\r\n const [, dimension] = isMultiKey(value);\r\n const helper = options[key];\r\n if (Array.isArray(helper) && helper.length > 0) {\r\n const finalDimensionThemes = calculateChainOptions$1(helper, [\r\n theme,\r\n cb,\r\n config.css,\r\n ]);\r\n // eslint-disable-next-line no-param-reassign\r\n accumulator[dimension] = removeNullableValues(finalDimensionThemes);\r\n }\r\n return accumulator;\r\n }, result);\r\n};\r\nconst calculateChainOptions$1 = (options, args) => {\r\n const result = {};\r\n if (isEmpty(options))\r\n return result;\r\n return options.reduce((acc, item) => {\r\n return merge(acc, item(...args));\r\n }, result);\r\n // using this does not allow overriding themes properly\r\n // return removeAllEmptyValues(helper)\r\n};\r\nconst calculateTheme = ({ rocketstate, themes, baseTheme, }) => {\r\n // generate final theme which will be passed to styled component\r\n let finalTheme = { ...baseTheme };\r\n Object.entries(rocketstate).forEach(([key, value]) => {\r\n const keyTheme = themes[key];\r\n if (Array.isArray(value)) {\r\n value.forEach((item) => {\r\n finalTheme = merge({}, finalTheme, keyTheme[item]);\r\n });\r\n }\r\n else {\r\n finalTheme = merge({}, finalTheme, keyTheme[value]);\r\n }\r\n });\r\n return finalTheme;\r\n};\r\nconst calculateThemeMode = (themes, variant) => {\r\n const callback = themeModeCb().toString();\r\n const isModeCallback = (value) => value.toString() === callback;\r\n const result = {};\r\n Object.entries(themes).forEach(([key, value]) => {\r\n if (typeof value === 'object' && value !== null) {\r\n result[key] = calculateThemeMode(value, variant);\r\n }\r\n else if (typeof value === 'function' && isModeCallback(value)) {\r\n result[key] = value(variant);\r\n }\r\n else {\r\n result[key] = value;\r\n }\r\n });\r\n return result;\r\n};\n\nconst useTheme = ({ theme, options, cb }) => {\r\n const themes = calculateDimensionThemes(theme, options, cb);\r\n const { keysMap, keywords } = calculateDimensionsMap({\r\n themes,\r\n useBooleans: options.useBooleans,\r\n });\r\n // eslint-disable-next-line no-underscore-dangle\r\n const __ROCKETSTYLE__ = {\r\n dimensions: keysMap,\r\n reservedPropNames: keywords,\r\n baseTheme: calculateChainOptions$1(options.theme, [theme, cb, config.css]),\r\n themes,\r\n };\r\n return __ROCKETSTYLE__;\r\n};\n\nconst Provider = ({ theme, mode, children, inversed, provider: RocketstyleProvider = Provider$1, }) => {\r\n if (inversed) {\r\n const { provider: InnerProvider, mode: ctxMode, ...ctx } = useContext(context);\r\n const isDark = ctxMode === 'dark';\r\n const inversedTheme = isDark ? 'light' : 'dark';\r\n if (!InnerProvider)\r\n return React.createElement(React.Fragment, null, children);\r\n return (React.createElement(InnerProvider, { mode: inversedTheme, isDark: isDark, isLight: !isDark, ...ctx }, children));\r\n }\r\n const isDark = mode === 'dark';\r\n return (React.createElement(RocketstyleProvider, { mode: mode, isDark: isDark, isLight: !isDark, theme: theme, provider: RocketstyleProvider }, children));\r\n};\n\nconst PSEUDO_KEYS = ['hover', 'active', 'focus', 'pressed'];\r\nconst THEME_MODES = {\r\n light: true,\r\n dark: true,\r\n};\r\nconst THEME_MODES_INVERSED = {\r\n dark: 'light',\r\n light: 'dark',\r\n};\r\nconst CONFIG_KEYS = [\r\n 'provider',\r\n 'consumer',\r\n 'DEBUG',\r\n 'name',\r\n 'component',\r\n 'inversed',\r\n 'passProps',\r\n 'styled',\r\n];\r\nconst STYLING_KEYS = ['theme', 'attrs', 'styles'];\r\nconst STATIC_KEYS = [...STYLING_KEYS, 'compose'];\r\nconst ALL_RESERVED_KEYS = [\r\n ...Object.keys(THEME_MODES),\r\n ...CONFIG_KEYS,\r\n ...STATIC_KEYS,\r\n];\n\nconst useThemeOptions = ({ inversed }) => {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const { theme, mode: ctxMode, isDark: ctxDark } = useContext(context);\r\n const mode = inversed ? THEME_MODES_INVERSED[ctxMode] : ctxMode;\r\n const isDark = inversed ? !ctxDark : ctxDark;\r\n const isLight = !isDark;\r\n return { theme, mode, isDark, isLight };\r\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\nconst pickStyledProps = (props, keywords) => {\r\n const result = {};\r\n Object.entries(props).forEach(([key, value]) => {\r\n if (keywords[key])\r\n result[key] = value;\r\n });\r\n return result;\r\n};\r\nconst calculateChainOptions = (options) => (args) => {\r\n const result = {};\r\n if (isEmpty(options))\r\n return result;\r\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\r\n // @ts-ignore\r\n return options.reduce((acc, item) => Object.assign(acc, item(...args)), result);\r\n};\r\nconst calculateStylingAttrs = ({ useBooleans, multiKeys }) => ({ props, dimensions }) => {\r\n const result = {};\r\n // (1) find dimension keys values & initialize\r\n // object with possible options\r\n Object.keys(dimensions).forEach((item) => {\r\n const pickedProp = props[item];\r\n const valueTypes = ['number', 'string'];\r\n // if the property is mutli key, allow assign array as well\r\n if (multiKeys && multiKeys[item] && Array.isArray(pickedProp)) {\r\n result[item] = pickedProp;\r\n }\r\n // assign when it's only a string or number otherwise it's considered\r\n // as invalid param\r\n else if (valueTypes.includes(typeof pickedProp)) {\r\n result[item] = pickedProp;\r\n }\r\n else {\r\n result[item] = undefined;\r\n }\r\n });\r\n // (2) if booleans are being used let's find the rest\r\n if (useBooleans) {\r\n const propsKeys = Object.keys(props).reverse();\r\n Object.entries(result).forEach(([key, value]) => {\r\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\r\n // @ts-ignore\r\n const isMultiKey = multiKeys[key];\r\n // when value in result is not assigned yet\r\n if (!value) {\r\n let newDimensionValue;\r\n const keywords = Object.keys(dimensions[key]);\r\n if (isMultiKey) {\r\n newDimensionValue = propsKeys.filter((key) => keywords.includes(key));\r\n }\r\n else {\r\n // reverse props to guarantee the last one will have\r\n // a priority over previous ones\r\n newDimensionValue = propsKeys.find((key) => {\r\n if (keywords.includes(key) && props[key])\r\n return key;\r\n return false;\r\n });\r\n }\r\n result[key] = newDimensionValue;\r\n }\r\n });\r\n }\r\n return result;\r\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\nconst rocketStyleHOC = ({ inversed, attrs }) => {\r\n // --------------------------------------------------\r\n // .attrs(...)\r\n // first we need to calculate final props which are\r\n // being returned by using `attr` chaining method\r\n // --------------------------------------------------\r\n const _calculateChainOptions = calculateChainOptions(attrs);\r\n const Enhanced = (WrappedComponent) => forwardRef((props, ref) => {\r\n const { theme, mode, isDark, isLight } = useThemeOptions({\r\n inversed,\r\n });\r\n const calculatedAttrs = _calculateChainOptions([\r\n props,\r\n theme,\r\n {\r\n renderContent,\r\n mode,\r\n isDark,\r\n isLight,\r\n },\r\n ]);\r\n return (React.createElement(WrappedComponent, { \"$rocketstyleRef\": ref, ...calculatedAttrs, ...props }));\r\n });\r\n return Enhanced;\r\n};\n\nvar localContext = createContext({});\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\nconst RocketStyleProviderComponent = (WrappedComponent) => forwardRef(({ onMouseEnter, onMouseLeave, onMouseUp, onMouseDown, onFocus, onBlur, $rocketstate, ...props }, ref) => {\r\n // pseudo hook to detect states hover / pressed / focus\r\n const pseudo = usePseudoState({\r\n onMouseEnter,\r\n onMouseLeave,\r\n onMouseUp,\r\n onMouseDown,\r\n onFocus,\r\n onBlur,\r\n });\r\n const updatedState = {\r\n ...$rocketstate,\r\n pseudo: { ...$rocketstate.pseudo, ...pseudo.state },\r\n };\r\n return (React.createElement(localContext.Provider, { value: updatedState },\r\n React.createElement(WrappedComponent, { ...props, ...pseudo.events, ref: ref, \"$rocketstate\": updatedState })));\r\n});\n\nconst calculateStyles = (styles, css) => {\r\n if (!styles)\r\n return [];\r\n return styles.map((item) => item(css));\r\n};\n\n/* eslint-disable no-underscore-dangle */\r\nconst orOptions = (keys, opts, defaultOpts) => keys.reduce((acc, item) => ({ ...acc, [item]: opts[item] || defaultOpts[item] }), {});\r\nconst chainReservedOptions = (keys, opts, defaultOpts) => keys.reduce((acc, item) => ({\r\n ...acc,\r\n [item]: chainOptions(opts[item], defaultOpts[item]),\r\n}), {});\r\n// --------------------------------------------------------\r\n// helpers for create statics chainin methods on component\r\n// --------------------------------------------------------\r\nconst createStaticsChainingEnhancers = ({ context, dimensionKeys, func, opts, }) => {\r\n dimensionKeys.forEach((item) => {\r\n // eslint-disable-next-line no-param-reassign\r\n context[item] = (props) => func({ [item]: props }, opts);\r\n });\r\n};\r\n// --------------------------------------------------------\r\n// helpers for create statics on component\r\n// --------------------------------------------------------\r\nconst createStaticsEnhancers = ({ context, opts }) => {\r\n if (!isEmpty(opts)) {\r\n Object.assign(context, opts);\r\n }\r\n};\r\nconst cloneAndEnhance = (opts, defaultOpts) => styleComponent({\r\n ...defaultOpts,\r\n statics: { ...defaultOpts.statics, ...opts.statics },\r\n compose: { ...defaultOpts.compose, ...opts.compose },\r\n ...orOptions(CONFIG_KEYS, opts, defaultOpts),\r\n ...chainReservedOptions([...defaultOpts.dimensionKeys, ...STYLING_KEYS], opts, defaultOpts),\r\n});\r\n// --------------------------------------------------------\r\n// styleComponent\r\n// helper function which allows function chaining\r\n// always returns a valid React component with static functions\r\n// assigned, so it can be even rendered as a valid component\r\n// or styles can be extended via its statics\r\n// --------------------------------------------------------\r\nconst styleComponent = (options) => {\r\n const { component, styles } = options;\r\n const { styled } = config;\r\n // const _calculateChainOptions = calculateChainOptions(options.attrs)\r\n const _calculateStylingAttrs = calculateStylingAttrs({\r\n multiKeys: options.multiKeys,\r\n useBooleans: options.useBooleans,\r\n });\r\n const componentName = options.name || options.component.displayName || options.component.name;\r\n // create styled component with all options.styles if available\r\n const STYLED_COMPONENT = component.IS_ROCKETSTYLE || options.styled === false\r\n ? component\r\n : styled(component) `\n ${calculateStyles(styles, config.css)};\n `;\r\n // --------------------------------------------------------\r\n // final component to be rendered\r\n // --------------------------------------------------------\r\n const RenderComponent = options.provider\r\n ? RocketStyleProviderComponent(STYLED_COMPONENT)\r\n : STYLED_COMPONENT;\r\n // --------------------------------------------------------\r\n // hocs\r\n // --------------------------------------------------------\r\n const calculateHocsFuncs = Object.values(options.compose || {})\r\n .filter((item) => typeof item === 'function')\r\n .reverse();\r\n const hocsFuncs = [rocketStyleHOC(options), ...calculateHocsFuncs];\r\n // --------------------------------------------------------\r\n // ENHANCED COMPONENT (returned component)\r\n // --------------------------------------------------------\r\n // .attrs() chaining option is calculated in HOC and passed as props already\r\n const EnhancedComponent = forwardRef(({ $rocketstyleRef, // it's forwarded from HOC which is always on top of hocs\r\n ...props }, ref) => {\r\n // --------------------------------------------------\r\n // handle refs\r\n // (1) one is passed from inner HOC - $rocketstyleRef\r\n // (2) second one is used to be used directly (e.g. inside hocs)\r\n // --------------------------------------------------\r\n const internalRef = useRef(null);\r\n if ($rocketstyleRef)\r\n useImperativeHandle($rocketstyleRef, () => internalRef.current, [\r\n $rocketstyleRef,\r\n ]);\r\n if (ref)\r\n useImperativeHandle(ref, () => internalRef.current, [ref]);\r\n // --------------------------------------------------\r\n // hover - focus - pressed state passed via context from parent component\r\n // --------------------------------------------------\r\n const rocketstyleCtx = options.consumer ? useContext(localContext) : {};\r\n // --------------------------------------------------\r\n // general theme and theme mode dark / light passed in context\r\n // --------------------------------------------------\r\n const { theme, mode } = useThemeOptions(options);\r\n // --------------------------------------------------\r\n // calculate themes for all possible styling dimensions\r\n // .theme(...) + defined dimensions like .states(...), .sizes(...)\r\n // --------------------------------------------------\r\n const __ROCKETSTYLE__ = useMemo(() => useTheme({\r\n theme,\r\n options,\r\n cb: themeModeCb,\r\n }), \r\n // recalculate this only when theme changes\r\n [theme]);\r\n const { reservedPropNames, themes: rocketThemes, dimensions, baseTheme: rocketBaseTheme, } = __ROCKETSTYLE__;\r\n const { baseTheme, themes } = useMemo(() => calculateThemeMode({ themes: rocketThemes, baseTheme: rocketBaseTheme }, mode), \r\n // recalculate this only when theme mode changes dark / light\r\n [mode]);\r\n // --------------------------------------------------\r\n // calculate reserved Keys defined in dimensions as styling keys\r\n // there is no need to calculate this each time - keys are based on\r\n // dimensions definitions\r\n // --------------------------------------------------\r\n const RESERVED_STYLING_PROPS_KEYS = useMemo(() => Object.keys(reservedPropNames), []);\r\n // --------------------------------------------------\r\n // get final props which are (latest has the highest priority):\r\n // (1) merged styling from context,\r\n // (2) `attrs` chaining method, and from\r\n // (3) passing them directly to component\r\n // --------------------------------------------------\r\n const { pseudo = {}, ...mergeProps } = {\r\n ...(options.consumer\r\n ? options.consumer((callback) => callback(rocketstyleCtx))\r\n : {}),\r\n ...props,\r\n };\r\n // --------------------------------------------------\r\n // rocketstate\r\n // calculate final component state including pseudo state\r\n // passed as $rocketstate prop\r\n // --------------------------------------------------\r\n const rocketstate = _calculateStylingAttrs({\r\n props: pickStyledProps(mergeProps, reservedPropNames),\r\n dimensions,\r\n });\r\n // --------------------------------------------------\r\n // pseudo state\r\n // calculate final component pseudo state including pseudo state\r\n // from props and override by pseudo props from context\r\n // --------------------------------------------------\r\n const finalPseudo = {\r\n ...pick(props, PSEUDO_KEYS),\r\n ...pseudo,\r\n };\r\n const finalRocketstate = { ...rocketstate, pseudo: finalPseudo };\r\n // --------------------------------------------------\r\n // rocketstyle\r\n // calculated (based on styling props) final theme which will be passed\r\n // to our styled component\r\n // passed as $rocketstyle prop\r\n // --------------------------------------------------\r\n const rocketstyle = calculateTheme({\r\n rocketstate,\r\n themes,\r\n baseTheme,\r\n });\r\n // --------------------------------------------------\r\n // final props\r\n // final props passed to WrappedComponent\r\n // excluding: styling props\r\n // including: $rocketstyle, $rocketstate\r\n // --------------------------------------------------\r\n const finalProps = {\r\n // this removes styling state from props and passes its state\r\n // under rocketstate key only\r\n ...omit(mergeProps, [...RESERVED_STYLING_PROPS_KEYS, ...PSEUDO_KEYS]),\r\n // if enforced to pass styling props, we pass them directly\r\n ...(options.passProps ? pick(mergeProps, options.passProps) : {}),\r\n ref: ref || $rocketstyleRef ? internalRef : undefined,\r\n // state props passed to styled component only, therefore the `$` symbol\r\n $rocketstyle: rocketstyle,\r\n $rocketstate: finalRocketstate,\r\n };\r\n // all the development stuff injected\r\n if (process.env.NODE_ENV !== 'production') {\r\n finalProps['data-rocketstyle'] = componentName;\r\n }\r\n return React.createElement(RenderComponent, { ...finalProps });\r\n });\r\n // ------------------------------------------------------\r\n // This will hoist and generate dynamically next static methods\r\n // for all dimensions available in configuration\r\n // ------------------------------------------------------\r\n const RocketComponent = compose(...hocsFuncs)(EnhancedComponent);\r\n RocketComponent.IS_ROCKETSTYLE = true;\r\n RocketComponent.displayName = componentName;\r\n hoistNonReactStatics(RocketComponent, options.component);\r\n // ------------------------------------------------------\r\n // enhance for chaining methods\r\n // ------------------------------------------------------\r\n createStaticsChainingEnhancers({\r\n context: RocketComponent,\r\n dimensionKeys: [...options.dimensionKeys, ...STATIC_KEYS],\r\n func: cloneAndEnhance,\r\n opts: options,\r\n });\r\n // ------------------------------------------------------\r\n RocketComponent.IS_ROCKETSTYLE = true;\r\n RocketComponent.displayName = componentName;\r\n RocketComponent.is = {};\r\n // ------------------------------------------------------\r\n // ------------------------------------------------------\r\n // enhance for statics\r\n // ------------------------------------------------------\r\n createStaticsEnhancers({\r\n context: RocketComponent.is,\r\n opts: options.statics,\r\n });\r\n RocketComponent.config = (opts = {}) => {\r\n const result = pick(opts, CONFIG_KEYS);\r\n return cloneAndEnhance(result, options);\r\n };\r\n RocketComponent.statics = (opts = {}) => {\r\n return cloneAndEnhance({ statics: opts }, options);\r\n };\r\n RocketComponent.getStaticDimensions = (theme) => {\r\n const themes = useTheme({ theme, options, cb: themeModeCb });\r\n return {\r\n dimensions: themes.dimensions,\r\n useBooleans: options.useBooleans,\r\n multiKeys: options.multiKeys,\r\n };\r\n };\r\n RocketComponent.getDefaultAttrs = (props, theme, mode) => {\r\n const result = calculateChainOptions(options.attrs)([\r\n props,\r\n theme,\r\n {\r\n renderContent,\r\n mode,\r\n isDark: mode === 'light',\r\n isLight: mode === 'dark',\r\n },\r\n ]);\r\n return result;\r\n };\r\n return RocketComponent;\r\n};\n\nconst DEFAULT_DIMENSIONS = {\r\n states: 'state',\r\n sizes: 'size',\r\n variants: 'variant',\r\n multiple: {\r\n propName: 'multiple',\r\n multi: true,\r\n },\r\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\nconst rocketstyle = () => ({ dimensions = DEFAULT_DIMENSIONS, useBooleans = true } = {}) => ({ name, component }) => {\r\n // --------------------------------------------------------\r\n // handle ERRORS in development mode\r\n // --------------------------------------------------------\r\n if (process.env.NODE_ENV !== 'production') {\r\n const errors = {};\r\n if (!component) {\r\n errors.component = 'Parameter `component` is missing in params!';\r\n }\r\n if (!name) {\r\n errors.name = 'Parameter `name` is missing in params!';\r\n }\r\n if (isEmpty(dimensions)) {\r\n errors.dimensions = 'Parameter `dimensions` is missing in params!';\r\n }\r\n else {\r\n const definedDimensions = getKeys(dimensions);\r\n const invalidDimension = ALL_RESERVED_KEYS.some((item) => definedDimensions.includes(item));\r\n if (invalidDimension) {\r\n errors.invalidDimensions = `Some of your \\`dimensions\\` is invalid and uses reserved static keys which are\n ${DEFAULT_DIMENSIONS.toString()}`;\r\n }\r\n }\r\n if (!isEmpty(errors)) {\r\n throw Error(JSON.stringify(errors));\r\n }\r\n }\r\n return styleComponent({\r\n name,\r\n component,\r\n useBooleans,\r\n dimensions,\r\n dimensionKeys: getKeys(dimensions),\r\n dimensionValues: getDimensionsValues(dimensions),\r\n multiKeys: getMultipleDimensions(dimensions),\r\n });\r\n};\n\nconst isRocketComponent = (component) => {\r\n if (typeof component === 'object' &&\r\n component !== null &&\r\n component.IS_ROCKETSTYLE) {\r\n return true;\r\n }\r\n return false;\r\n};\n\nexport { Provider, rocketstyle as default, isRocketComponent };\n//# sourceMappingURL=vitus-labs-rocketstyle.module.js.map\n","import React, { VFC } from 'react'\nimport { config } from '@vitus-labs/core'\n\nconst Wrapper = config.styled.div`\n display: flex;\n font-size: 32px;\n`\n\nconst component: VFC = () => <Wrapper>Nothing here</Wrapper>\n\ncomponent.displayName = '@vitus-labs/rocketstories/Empty'\n\nexport default component\n","/* eslint-disable no-underscore-dangle */\n\ndeclare global {\n interface Window {\n __VITUS_LABS_STORIES__: {\n decorators: {\n theme: Record<string, unknown>\n }\n }\n }\n}\n\ntype GetTheme = () => Record<string, unknown>\nconst getTheme: GetTheme = () => window.__VITUS_LABS_STORIES__.decorators.theme\n\nexport default getTheme\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-param-reassign */\nimport { get } from '@vitus-labs/core'\nimport type { Control, SimpleValue, Obj } from '~/types'\n\n// --------------------------------------------------------\n// parseProps\n// --------------------------------------------------------\ntype ObjValue = Control\n\ntype ParseProps = <\n T extends Record<string, SimpleValue | Array<SimpleValue> | ObjValue>\n>(\n props: T\n) => Record<keyof T, unknown>\n\nconst parseProps: ParseProps = (props) =>\n Object.entries(props).reduce((acc, [key, value]) => {\n if (value === null) return acc\n\n const valueType = typeof value\n\n if (['string', 'number', 'boolean', 'bigint'].includes(valueType)) {\n return { ...acc, [key]: value }\n }\n\n if (Array.isArray(value)) {\n return { ...acc, [key]: value }\n }\n\n if (valueType === 'object') {\n const type = get(value, 'type')\n const options = get(value, 'options')\n const defaultValue = get(value, 'value')\n\n // if has custom knobs configuration\n if (type && options && defaultValue) {\n return { ...acc, [key]: defaultValue || options }\n }\n\n return { ...acc, [key]: value }\n }\n\n return acc\n }, {} as any)\n\n// --------------------------------------------------------\n// stringifyArray\n// --------------------------------------------------------\ntype StringifyArray = (props: Array<unknown>) => string\n\nconst stringifyArray: StringifyArray = (props) => {\n let result = '['\n\n const arrayLength = props.length\n\n result += props.reduce((acc, value, i) => {\n if (Array.isArray(value)) {\n // TODO: parse arrays\n acc += `${stringifyArray(value)}`\n } else if (typeof value === 'object' && value !== null) {\n acc += `${stringifyObject(value as Record<string, any>)}`\n } else if (['number', 'string'].includes(typeof value)) {\n acc += `\"${value}\"`\n } else {\n acc += `${value}`\n }\n\n // if not last item, add comma and space\n if (arrayLength !== i + 1) {\n acc += `, `\n }\n\n return acc\n }, '')\n\n result += ']'\n\n return result\n}\n\n// --------------------------------------------------------\n// stringifyObject\n// --------------------------------------------------------\ntype StringifyObject = (props: Obj) => string\n\nconst stringifyObject: StringifyObject = (props) => {\n let result = '{ '\n\n const propsArray = Object.entries(props)\n const arrayLength = propsArray.length\n\n result += propsArray.reduce((acc, [key, value], i) => {\n if (Array.isArray(value)) {\n // TODO: parse arrays\n acc += `${key}: ${value}`\n } else if (typeof value === 'object' && value !== null) {\n acc += `${key}: ${stringifyObject(value)}`\n } else if (['string'].includes(typeof value)) {\n acc += `${key}: \"${value}\"`\n } else {\n acc += `${key}: ${value}`\n }\n\n if (arrayLength !== i + 1) {\n acc += `, `\n }\n\n return acc\n }, '')\n\n result += ' }'\n\n return result\n}\n\n// --------------------------------------------------------\n// stringifyObject\n// --------------------------------------------------------\ntype StringifyProps = (props: Obj) => string\n\nconst stringifyProps: StringifyProps = (props) => {\n const parsedProps = parseProps(props)\n const arrayProps = Object.entries(parsedProps)\n const arrayLength = arrayProps.length\n\n return arrayProps.reduce((acc, [key, value], i) => {\n if (typeof value === 'boolean') {\n if (value === true) acc += `${key}`\n else acc += `${key}=${value}`\n } else if (\n ['string', 'number'].includes(typeof value) ||\n value === null ||\n value === undefined\n ) {\n acc += `${key}=\"${value}\"`\n } else if (Array.isArray(value)) {\n acc += `${key}={${stringifyArray(value)}}`\n } else if (typeof value === 'object' && value !== null) {\n acc += `${key}={${stringifyObject(value as Record<string, any>)}}`\n }\n\n if (arrayLength !== i + 1) {\n acc += ' '\n }\n\n return acc\n }, '')\n}\n\nconst parseComponentName = (name) => {\n const helper = name.split('/')\n\n if (helper.length > 1) {\n return helper[helper.length - 1]\n }\n\n return name\n}\n\n// --------------------------------------------------------\n// createJSXCode\n// --------------------------------------------------------\ntype CreateJSXCode = (name: string, props: Obj) => string\n\nexport const createJSXCode: CreateJSXCode = (name, props) => {\n const componentName = parseComponentName(name)\n\n let result = `<${componentName} `\n\n result += stringifyProps(props)\n\n result += ` />`\n\n return result\n}\n\n// --------------------------------------------------------\n// createJSXCodeArray\n// --------------------------------------------------------\ntype CreateJSXCodeArray = (\n name: string,\n props: Obj,\n dimensionName: string,\n dimensions: Obj,\n useBooleans: boolean,\n isMultiKey: boolean\n) => string\n\nexport const createJSXCodeArray: CreateJSXCodeArray = (\n name,\n props,\n dimensionName,\n dimensions,\n useBooleans,\n isMultiKey\n) => {\n if (!dimensions) return `// nothing here`\n\n let result = ''\n\n const finalProps = { ...props }\n delete finalProps[dimensionName]\n\n result += Object.keys(dimensions).reduce((acc, key) => {\n acc += createJSXCode(name, {\n [dimensionName]: isMultiKey ? [key] : key,\n ...finalProps,\n })\n acc += `\\n`\n return acc\n }, '')\n\n if (useBooleans) {\n result += `\\n\\n`\n result += `// Or alternatively use boolean ${dimensionName} props (${Object.keys(\n dimensions\n ).toString()})`\n result += `\\n`\n\n result += Object.keys(dimensions).reduce((acc, key) => {\n acc += createJSXCode(name, { [key]: true, ...finalProps })\n acc += `\\n`\n return acc\n }, '')\n }\n\n return result\n}\n\n// --------------------------------------------------------\n// createMainJSX\n// --------------------------------------------------------\ntype CreateMainJSX = ({\n name,\n dimensions,\n params,\n booleanDimensions,\n}: {\n name: string\n dimensions: any\n params: any\n booleanDimensions: any\n}) => any\n\nexport const createMainJSX: CreateMainJSX = ({\n name,\n dimensions,\n params,\n booleanDimensions,\n}) => {\n let result = ''\n\n result += createJSXCode(name, { ...dimensions, ...params })\n\n if (booleanDimensions) {\n result += `\\n\\n`\n result += `// Or alternatively use boolean props (e.g. ${Object.keys(\n booleanDimensions\n )})`\n result += `\\n`\n result += createJSXCode(name, { ...booleanDimensions, ...params })\n }\n\n return result\n}\n","export const CONTROL_TYPES = [\n 'tag',\n 'text',\n 'number',\n 'range',\n 'boolean',\n 'color',\n 'select',\n 'multi-select',\n 'object',\n 'array',\n 'radio',\n 'inline-radio',\n 'check',\n 'inline-check',\n] as const\n\nexport type T_CONTROL_TYPES = typeof CONTROL_TYPES[number]\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { omit } from '@vitus-labs/core'\nimport { CONTROL_TYPES } from '~/constants/controls'\n\n// --------------------------------------------------------\n// Is valid control\n// --------------------------------------------------------\ntype IsValidControl = (value: any) => boolean\n\nconst isValidControl: IsValidControl = (value: any) =>\n typeof value === 'object' &&\n value !== null &&\n CONTROL_TYPES.includes(value.type)\n\n// --------------------------------------------------------\n// Filter controls\n// --------------------------------------------------------\ntype FilterControls = (obj: Record<string, any>) => Record<string, any>\n\nconst filterControls: FilterControls = (obj) =>\n Object.entries(obj).reduce((acc, [key, value]) => {\n if (isValidControl(value)) return { ...acc, [key]: value }\n\n return acc\n }, {})\n\n// --------------------------------------------------------\n// Filter values\n// --------------------------------------------------------\n\ntype FilterValues = (obj: Record<string, any>) => Record<string, any>\n\nconst filterValues: FilterValues = (obj) => {\n const controls = filterControls(obj)\n const controlKeys = Object.keys(controls)\n\n return omit(obj, controlKeys)\n}\n\nexport { filterControls, filterValues }\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { Controls } from '../../types'\n\n// --------------------------------------------------------\n// transformDimensionsToControls\n// --------------------------------------------------------\ntype DimensionsToControls = ({\n dimensions,\n multiKeys,\n}: {\n dimensions: Record<string, any>\n multiKeys: Record<string, true>\n}) => Controls\n\nconst dimensionsToControls: DimensionsToControls = ({\n dimensions,\n multiKeys,\n}) =>\n Object.entries(dimensions).reduce((acc, [key, value]) => {\n const valueKeys = Object.keys(value)\n const isMultiKey = !!multiKeys[key]\n\n const control = {\n type: isMultiKey ? 'multi-select' : 'select',\n value: isMultiKey ? undefined : valueKeys[0],\n options: valueKeys,\n group: 'Rocketstyle',\n }\n\n return { ...acc, [key]: control }\n }, {})\n\nexport default dimensionsToControls\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n// --------------------------------------------------------\n// disableControl\n// --------------------------------------------------------\ntype DisableControl = (\n name: string\n) => Record<string, { table: { disable: true } }>\n\nconst disableControl: DisableControl = (name) => ({\n [name]: { table: { disable: true } },\n})\n\n// --------------------------------------------------------\n// disableDimensionControls\n// --------------------------------------------------------\ntype DisableDimensionControls = (\n dimensions: Record<string, boolean>,\n name?: string\n) => any\n\nconst disableDimensionControls: DisableDimensionControls = (\n dimensions,\n dimensionName\n) => {\n const result = dimensionName ? disableControl(dimensionName) : {}\n const dimensionKeys = Object.values(dimensions)\n\n return dimensionKeys.reduce((acc, value) => {\n Object.keys(value).forEach((item) => {\n // eslint-disable-next-line no-param-reassign\n acc = { ...acc, ...disableControl(item) }\n })\n\n return acc\n }, result)\n}\n\nexport default disableDimensionControls\n","import { get } from '@vitus-labs/core'\nimport type { Controls, Control } from '~/types'\n\n// --------------------------------------------------------\n// filterDefaultValues\n// --------------------------------------------------------\ntype FilterDefaultValues = (props: Controls) => Record<string, Control['value']>\n\nconst filterDefaultValues: FilterDefaultValues = (props = {}) =>\n Object.entries(props).reduce((acc, [key, value]) => {\n const val = get(value, 'value')\n if (val) return { ...acc, [key]: val }\n\n return acc\n }, {})\n\nexport default filterDefaultValues\n","import { htmlTags } from '@vitus-labs/core'\nimport { CONTROL_TYPES } from '../../constants/controls'\n\nconst LABEL_SIMPLE = 'Simple Values'\nconst LABEL_OPTIONS = 'Options'\n\nexport const STORYBOOK_CONTROL_TYPES = CONTROL_TYPES\n\nexport const CONTROL_MAP = {\n tag: 'select',\n} as const\n\nexport const CONTROL_OPTIONS = {\n tag: htmlTags,\n} as const\n\nexport const CONTROL_TYPES_GROUPS = {\n text: LABEL_SIMPLE,\n number: LABEL_SIMPLE,\n color: LABEL_SIMPLE,\n range: LABEL_OPTIONS,\n object: LABEL_OPTIONS,\n array: LABEL_OPTIONS,\n select: LABEL_OPTIONS,\n 'multi-select': LABEL_OPTIONS,\n radio: LABEL_OPTIONS,\n 'inline-radio': LABEL_OPTIONS,\n check: LABEL_OPTIONS,\n 'check-radio': LABEL_OPTIONS,\n tag: 'HTML Semantics',\n boolean: 'Booleans',\n dateTime: 'Date & Time',\n events: 'Events',\n data: 'Data',\n} as const\n","import { CONTROL_OPTIONS, CONTROL_MAP, CONTROL_TYPES_GROUPS } from './constants'\n\nimport type { Control, StorybookControl } from '~/types'\n\n// --------------------------------------------------------\n// Make Controls\n// --------------------------------------------------------\ntype MakeControls = (\n obj: Record<string, Control>\n) => Record<string, StorybookControl>\n\nconst makeControls: MakeControls = (obj) =>\n Object.entries(obj).reduce(\n (acc, [key, value]) => ({\n ...acc,\n [key]: {\n control: { type: CONTROL_MAP[value.type] || value.type },\n defaultValue: value.value,\n description: value.description,\n options: value.options || CONTROL_OPTIONS[value.type],\n table: {\n disabled: value.disabled,\n category: value.group || CONTROL_TYPES_GROUPS[value.type],\n type: {\n summary: value.valueType,\n },\n },\n },\n }),\n {}\n )\n\nexport default makeControls\n","import { htmlTags } from '@vitus-labs/core'\n\nconst DIRECTION = {\n type: 'select',\n options: ['-----', 'rows', 'inline', 'reverseInline', 'reverseRows'],\n value: 'inline',\n group: 'Element',\n valueType: 'inline | rows | reverseRows | reverseInline | object | array',\n}\n\nconst ALIGN_X = {\n type: 'select',\n options: [\n '-----',\n 'left',\n 'center',\n 'right',\n 'block',\n 'spaceBetween',\n 'spaceAround',\n ],\n group: 'Element',\n value: 'left',\n valueType: 'left | center | right | block | spaceBetween | spaceAround',\n}\n\nconst ALIGN_Y = {\n type: 'select',\n options: ['top', 'center', 'block', 'spaceBetween', 'spaceAround'],\n value: 'center',\n group: 'Element',\n valueType: 'top | center | block | spaceBetween | spaceAround',\n}\n\nconst CSS = {\n type: 'text',\n group: 'Element',\n valueType: 'string | callback | css | object | array',\n}\n\nexport default {\n tag: {\n type: 'select',\n options: htmlTags,\n group: 'Element',\n valueType: 'HTMLTag',\n description: 'A prop which will change HTML tag of the element',\n },\n children: {\n description: 'React children',\n group: 'Element',\n valueType: 'ReactNode',\n },\n content: {\n type: 'text',\n valueType: 'ReactNode',\n group: 'Element',\n description: 'A prop which can be used instead of `children`',\n },\n label: {\n type: 'text',\n group: 'Element',\n valueType: 'ReactNode',\n description: 'A prop which can be used instead of `children`',\n },\n block: {\n type: 'boolean',\n group: 'Element',\n valueType: 'boolean | object | array',\n description: 'Whether should behave as `inline` or `block` element',\n },\n direction: {\n ...DIRECTION,\n value: '',\n description:\n 'Define whether element should render horizontally or vertically. Does the same job as `vertical` prop and takes a precedence over that prop',\n },\n alignX: {\n ...ALIGN_X,\n description:\n 'Define alignment of `beforeContent`, `content`, and `afterContent` with respect to root element',\n },\n alignY: {\n ...ALIGN_Y,\n description:\n 'Define alignment of `beforeContent`, `content`, and `afterContent` with respect to the root element',\n },\n contentDirection: {\n ...DIRECTION,\n description:\n 'Define whether children in content wrapper should be rendered in line or in rows',\n },\n contentAlignX: {\n ...ALIGN_X,\n description: 'Define how children in content wrapper should be aligned',\n },\n contentAlignY: {\n ...ALIGN_Y,\n description: 'Define how children in content wrapper should be aligned',\n },\n beforeContentDirection: {\n ...DIRECTION,\n description:\n 'Define whether children in beforeContent wrapper should be rendered in line or in rows',\n },\n beforeContentAlignX: {\n ...ALIGN_X,\n description:\n 'Define how children in beforeContent wrapper should be aligned',\n },\n beforeContentAlignY: {\n ...ALIGN_Y,\n description:\n 'Define how children in beforeContent wrapper should be aligned',\n },\n afterContentDirection: {\n ...DIRECTION,\n description:\n 'Define whether children in afterContent wrapper should be rendered in line or in rows',\n },\n afterContentAlignX: {\n ...ALIGN_X,\n description:\n 'Define how children in afterContent wrapper should be aligned',\n },\n afterContentAlignY: {\n ...ALIGN_Y,\n description:\n 'Define how children in afterContent wrapper should be aligned',\n },\n equalCols: {\n type: 'boolean',\n group: 'Element',\n valueType: 'boolean | object | array',\n description:\n 'Whether should all inner elements have the same `width` / `height`',\n },\n gap: {\n type: 'number',\n group: 'Element',\n valueType: 'number | object | array',\n description:\n 'Defines space between `beforeContent`, `content` and `afterContent`',\n },\n vertical: {\n type: 'boolean',\n group: 'Element',\n valueType: 'boolean | object | array',\n description:\n 'Define whether element should render horizontally or vertically',\n },\n beforeContent: {\n group: 'Element',\n valueType: 'ReactNode',\n description: 'A children to be rendered inside `beforeContent` wrapper.',\n },\n afterContent: {\n group: 'Element',\n valueType: 'ReactNode',\n description: 'A children to be rendered inside `afterContent` wrapper.',\n },\n css: {\n ...CSS,\n description:\n 'If you need to add an additional styling to the `root` element, you can do so by injecting styles using this property',\n },\n contentCss: {\n ...CSS,\n description:\n 'If you need to add an additional styling to the `content` element, you can do so by injecting styles using this property.',\n },\n beforeContentCss: {\n ...CSS,\n description:\n 'If you need to add an additional styling to the `beforeContent` element, you can do so by injecting styles using this property',\n },\n afterContentCss: {\n ...CSS,\n description:\n 'If you need to add an additional styling to the `afterContent` element, you can do so by injecting styles using this property.',\n },\n} as const\n","export default {\n rootElement: {\n type: 'boolean',\n group: 'List',\n valueType: 'boolean | object | array',\n description:\n 'Whether a `root` element should be rendered or the output should be just a type of React `Fragment`',\n },\n data: {\n type: 'array',\n group: 'List',\n valueType: 'string[] | number[] | object[]',\n description: 'An array of item values to be passed to item component',\n },\n valueName: {\n type: 'text',\n group: 'List',\n valueType: `string[] | number[] | object[]`,\n description:\n 'Can be used when `data` consists of `strings` or `numbers` to name value being passed as a prop',\n },\n itemProps: {\n group: 'List',\n valueType: `object | callack`,\n description:\n 'A customizable hook for dynamically render props for each `item` component',\n },\n wrapProps: {\n group: 'List',\n valueType: `object | callack`,\n description:\n 'A customizable hook for dynamically render props for each `wrapComponent`',\n },\n itemKey: {\n group: 'List',\n valueType: `string | callack`,\n description:\n \"Prop for defining item key `name` / `value` if default behavior doesn't work out\",\n },\n label: {\n disable: true,\n },\n content: {\n disable: true,\n },\n component: {\n group: 'List',\n valueType: `ComponentType`,\n description: 'A component to be rendered per item',\n },\n wrapComponent: {\n group: 'List',\n valueType: `string[] | number[] | object[]`,\n description:\n 'A component to be used as a wrapper component for item component',\n },\n} as const\n","export default {\n refName: {\n type: 'text',\n value: 'ref',\n description:\n \"Overlay component access `ref` to directly mutate styles when calculation position to prevent re-renders. It's being used for both `trigger`, and `children` element at the same time. Your components must accept refs with the same naming.\",\n group: 'Overlay',\n },\n triggerRefName: {\n type: 'text',\n description: 'A key name how a `ref` should be passed to trigger component',\n group: 'Overlay',\n },\n contentRefName: {\n type: 'text',\n description: 'A key name how a `ref` should be passed to content component',\n group: 'Overlay',\n },\n isOpen: {\n type: 'boolean',\n value: false,\n description: '',\n group: 'Overlay',\n },\n openOn: {\n type: 'select',\n options: ['click', 'hover'],\n value: 'click',\n description: '',\n group: 'Overlay',\n },\n closeOn: {\n type: 'select',\n options: ['click', 'triggerClick', 'hover', 'manual'],\n value: 'click',\n description: '',\n group: 'Overlay',\n },\n type: {\n type: 'select',\n options: ['dropdown', 'tooltip', 'popover', 'modal'],\n value: 'dropdown',\n description: '',\n group: 'Overlay',\n },\n align: {\n type: 'select',\n options: ['top', 'left', 'bottom', 'right'],\n value: 'bottom',\n description: '',\n group: 'Overlay',\n },\n alignX: {\n type: 'select',\n options: ['left', 'center', 'right'],\n value: 'left',\n description: '',\n group: 'Overlay',\n },\n alignY: {\n type: 'select',\n options: ['top', 'center', 'bottom'],\n value: 'bottom',\n description: '',\n group: 'Overlay',\n },\n position: {\n type: 'select',\n options: ['fixed', 'absolute', 'relative', 'static'],\n value: 'fixed',\n description: '',\n group: 'Overlay',\n },\n offsetX: {\n type: 'number',\n value: 0,\n description: '',\n group: 'Overlay',\n },\n offsetY: {\n type: 'number',\n value: 0,\n description: '',\n group: 'Overlay',\n },\n throttleDelay: {\n type: 'number',\n value: 200,\n description: '',\n group: 'Overlay',\n },\n children: {\n description: 'A content to be rendered when Overlay is open',\n },\n} as const\n","export default {\n hover: {\n type: 'boolean',\n group: 'Rocketstyle',\n },\n active: {\n type: 'boolean',\n group: 'Rocketstyle',\n },\n pressed: {\n type: 'boolean',\n group: 'Rocketstyle',\n },\n focus: {\n type: 'boolean',\n group: 'Rocketstyle',\n },\n onMouseEnter: {\n group: 'Rocketstyle',\n },\n onMouseLeave: {\n group: 'Rocketstyle',\n },\n onMouseDown: {\n group: 'Rocketstyle',\n },\n onMouseUp: {\n group: 'Rocketstyle',\n },\n onFocus: {\n group: 'Rocketstyle',\n },\n onBlur: {\n group: 'Rocketstyle',\n },\n} as const\n","import { htmlTags } from '@vitus-labs/core'\n\nexport default {\n paragraph: {\n type: 'boolean',\n group: 'Text',\n },\n tag: {\n type: 'select',\n options: htmlTags,\n group: 'Text',\n },\n children: {\n type: 'text',\n group: 'Text',\n },\n label: {\n type: 'text',\n group: 'Text',\n },\n extendCss: {\n type: 'text',\n group: 'Text',\n },\n} as const\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as CONTROLS from '~/controls'\nimport type { Controls, RocketComponent } from '~/types'\n\n// --------------------------------------------------------\n// isColor\n// --------------------------------------------------------\ntype IsColor = (value: string) => boolean\n\nconst isColor: IsColor = (value) => {\n const s = new Option().style\n s.color = value\n // eslint-disable-next-line eqeqeq\n return s.color == value\n}\n\n// --------------------------------------------------------\n// getControlType\n// --------------------------------------------------------\ntype GetControlType = (\n value: any\n) => 'array' | 'boolean' | 'number' | 'color' | 'text' | 'object' | undefined\n\nconst getControlType: GetControlType = (value) => {\n const primitiveType = typeof value\n\n if (Array.isArray(value)) return 'array'\n\n if (primitiveType === 'boolean') return primitiveType\n\n if (['number', 'bigint'].includes(primitiveType)) return 'number'\n\n if (primitiveType === 'string') {\n if (isColor(value)) return 'color'\n\n return 'text'\n }\n\n if (primitiveType === 'object' && value !== null) return primitiveType\n\n return undefined\n}\n\n// --------------------------------------------------------\n// transformToControls\n// --------------------------------------------------------\ntype TransformToControls = (props: Record<string, unknown>) => Controls\n\nconst transformToControls: TransformToControls = (props) =>\n Object.entries(props).reduce((acc, [key, value]) => {\n const type = getControlType(value)\n\n return {\n ...acc,\n [key]: {\n type,\n value,\n },\n }\n }, {})\n\n// --------------------------------------------------------\n// get Predefined Controls\n// --------------------------------------------------------\ntype GetPredefinedControls = (obj: Controls, defaultProps: Controls) => Controls\n\nconst getPredefinedControls: GetPredefinedControls = (obj, defaultProps) =>\n Object.entries(obj).reduce((acc, [key, value]) => {\n const attrControl = defaultProps[key]\n\n if (!value.type) return acc\n\n if (attrControl) {\n return {\n ...acc,\n [key]: {\n ...value,\n value: attrControl.value || value.value,\n options: attrControl.options || value.options,\n },\n }\n }\n\n return acc\n }, obj)\n\n// --------------------------------------------------------\n// values to controls\n// --------------------------------------------------------\ntype ValuesToControls = ({\n component,\n values,\n dimensionControls,\n}: {\n component: RocketComponent\n values: Record<string, any>\n dimensionControls: Record<string, any>\n}) => Controls\n\nconst valuesToControls: ValuesToControls = ({\n component,\n values,\n dimensionControls = {},\n}) => {\n const { IS_ROCKETSTYLE, VITUS_LABS__COMPONENT } = component\n\n const IS_ELEMENT = VITUS_LABS__COMPONENT === '@vitus-labs/elements/Element'\n const IS_LIST = VITUS_LABS__COMPONENT === '@vitus-labs/elements/List'\n const IS_TEXT = VITUS_LABS__COMPONENT === '@vitus-labs/elements/Text'\n const IS_OVERLAY = VITUS_LABS__COMPONENT === '@vitus-labs/elements/Overlay'\n\n const attrsControls = transformToControls(values)\n\n return {\n ...(IS_ELEMENT || IS_LIST\n ? getPredefinedControls(CONTROLS.ELEMENT_CONTROLS as any, attrsControls)\n : {}),\n\n ...(IS_LIST\n ? getPredefinedControls(CONTROLS.LIST_CONTROLS as any, attrsControls)\n : {}),\n\n ...(IS_TEXT\n ? getPredefinedControls(CONTROLS.TEXT_CONTROLS as any, attrsControls)\n : {}),\n\n ...(IS_OVERLAY\n ? getPredefinedControls(CONTROLS.OVERLAY_CONTROLS as any, attrsControls)\n : {}),\n\n ...dimensionControls,\n\n ...(IS_ROCKETSTYLE\n ? getPredefinedControls(\n CONTROLS.ROCKETSTYLE_CONTROLS as any,\n attrsControls\n )\n : {}),\n }\n}\n\nexport default valuesToControls\n","import React, { createElement, Fragment } from 'react'\nimport { pick, isEmpty } from '@vitus-labs/core'\nimport { Element, Text } from '@vitus-labs/elements'\nimport NotFound from '~/components/NotFound'\nimport getTheme from '~/utils/theme'\nimport { createJSXCodeArray } from '~/utils/code'\nimport {\n filterDefaultValues,\n disableDimensionControls,\n dimensionsToControls,\n makeControls,\n filterControls,\n filterValues,\n valuesToControls,\n} from '~/utils/controls'\n\nimport type { RocketComponent, StoryComponent, Configuration } from '~/types'\n\ntype MakeDimensionStories = ({\n name,\n component,\n dimension,\n attrs,\n}: {\n name: string\n component: RocketComponent\n dimension: string\n attrs: Configuration['attrs']\n storyOptions: Configuration['storyOptions']\n ignore: any\n}) => StoryComponent\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst makeDimensionStories: MakeDimensionStories = ({\n name,\n component,\n dimension,\n attrs = {},\n storyOptions = {},\n ignore,\n // config = { pseudo: true },\n}) => {\n // ------------------------------------------------------\n // ROCKETSTYLE COMPONENT INFO\n // ------------------------------------------------------\n const theme = getTheme()\n const statics = component.getStaticDimensions(theme)\n const defaultAttrs = component.getDefaultAttrs(attrs, theme, 'light')\n const { dimensions, useBooleans, multiKeys } = statics\n\n const allStoryAttrs = { ...defaultAttrs, ...attrs }\n\n // ------------------------------------------------------\n // CURRENT ROCKETSTYLE DIMENSION INFO\n // ------------------------------------------------------\n const currentDimension = dimensions[dimension]\n const isMultiKey = !!multiKeys[dimension]\n\n // ------------------------------------------------------\n //\n // RENDER EMPTY PAGE WHEN DIMENSION IS NOT AVAILABLE\n //\n // ------------------------------------------------------\n const DONT_RENDER = isEmpty(currentDimension)\n if (DONT_RENDER) return NotFound\n\n // ------------------------------------------------------\n // CONTROLS GENERATION\n // ------------------------------------------------------\n const definedControls = filterControls(allStoryAttrs)\n const values = filterValues(allStoryAttrs)\n\n const dimensionControls = dimensionsToControls(statics)\n\n const controls = valuesToControls({\n component,\n values,\n dimensionControls,\n })\n\n const storybookControls = makeControls({\n ...controls,\n ...definedControls,\n })\n\n // ------------------------------------------------------\n // CONTROLS DEFAULT VALUES\n // ------------------------------------------------------\n const args = filterDefaultValues(controls)\n\n // ------------------------------------------------------\n // STORY COMPONENT\n // ------------------------------------------------------\n const WrapElement = isEmpty(storyOptions) ? Fragment : Element\n\n const Enhanced = (props) => {\n return (\n <WrapElement\n block\n contentDirection={storyOptions.direction}\n contentAlignX={storyOptions.alignX}\n contentAlignY={storyOptions.alignY}\n // @ts-ignore\n style={{ gap: storyOptions.gap }}\n >\n {Object.keys(currentDimension).map((item) => {\n const shouldBeIgnored = ignore.includes(item)\n const key = `${dimension}-${item}`\n\n // do not render ignored dimension keys\n if (shouldBeIgnored) return null\n\n if (storyOptions.pseudo) {\n return (\n <WrapElement\n key={key}\n data-story={key}\n contentDirection={\n storyOptions.direction === 'rows' ? 'inline' : 'rows'\n }\n contentAlignX={storyOptions.alignX}\n contentAlignY={storyOptions.alignY}\n // @ts-ignore\n style={{ gap: storyOptions.gap / 2 }}\n >\n <div>\n <Text paragraph>Base</Text>\n {createElement(component, {\n ...props,\n [dimension]: isMultiKey ? [item] : item,\n })}\n </div>\n\n <div>\n <Text paragraph>Hover</Text>\n {createElement(component, {\n ...props,\n [dimension]: isMultiKey ? [item] : item,\n hover: true,\n })}\n </div>\n\n <div>\n <Text paragraph>Pressed</Text>\n {createElement(component, {\n ...props,\n [dimension]: isMultiKey ? [item] : item,\n pressed: true,\n })}\n </div>\n\n <div>\n <Text paragraph>Active</Text>\n {createElement(component, {\n ...props,\n [dimension]: isMultiKey ? [item] : item,\n active: true,\n })}\n </div>\n </WrapElement>\n )\n }\n\n return (\n <WrapElement\n key={key}\n data-story={`${dimension}-${item}`}\n {...storyOptions}\n contentDirection=\"rows\"\n >\n {createElement(component, {\n ...props,\n [dimension]: isMultiKey ? [item] : item,\n })}\n </WrapElement>\n )\n })}\n </WrapElement>\n )\n }\n\n Enhanced.args = args\n Enhanced.argTypes = {\n ...storybookControls,\n ...disableDimensionControls(dimensions, dimension),\n }\n\n Enhanced.parameters = {\n docs: {\n // description: {\n // story: 'some story **markdown**',\n // },\n source: {\n code: createJSXCodeArray(\n name,\n pick(args, Object.keys(attrs)),\n dimension,\n currentDimension,\n useBooleans,\n isMultiKey\n ),\n },\n },\n }\n\n return Enhanced\n}\n\nexport default makeDimensionStories\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n// --------------------------------------------------------\n// extractDefaultBooleanProps\n// --------------------------------------------------------\ntype ExtractDefaultBooleanProps = ({\n dimensions,\n multiKeys,\n}: {\n dimensions: Record<string, any>\n multiKeys: Record<string, true>\n}) => Record<string, any>\n\n// eslint-disable-next-line import/prefer-default-export\nexport const extractDefaultBooleanProps: ExtractDefaultBooleanProps = ({\n dimensions,\n multiKeys,\n}) =>\n Object.entries(dimensions).reduce((acc, [key, value]) => {\n if (!multiKeys[key]) {\n const propName = Object.keys(value)[0]\n\n return { ...acc, [propName]: true }\n }\n\n return acc\n }, {})\n","import React, { createElement } from 'react'\nimport { pick } from '@vitus-labs/core'\nimport getTheme from '~/utils/theme'\nimport { createMainJSX } from '~/utils/code'\nimport { extractDefaultBooleanProps } from '~/utils/dimensions'\n\nimport {\n filterDefaultValues,\n makeControls,\n filterControls,\n filterValues,\n valuesToControls,\n dimensionsToControls,\n disableDimensionControls,\n} from '~/utils/controls'\n\nimport type { RocketComponent, StoryComponent } from '~/types'\n\ntype MainStory = ({\n name,\n component,\n attrs,\n}: {\n name: string\n component: RocketComponent\n attrs: Record<string, unknown>\n}) => StoryComponent\n\nconst mainStory: MainStory = ({ name, component, attrs }) => {\n // ------------------------------------------------------\n // ROCKETSTYLE COMPONENT INFO\n // ------------------------------------------------------\n const theme = getTheme()\n const statics = component.getStaticDimensions(theme)\n const defaultAttrs = component.getDefaultAttrs(attrs, theme, 'light')\n const { dimensions, useBooleans, multiKeys } = statics\n\n const allStoryAttrs = { ...defaultAttrs, ...attrs }\n\n // ------------------------------------------------------\n // CONTROLS GENERATION\n // ------------------------------------------------------\n const definedControls = filterControls(allStoryAttrs)\n const values = filterValues(allStoryAttrs)\n\n const dimensionControls = dimensionsToControls(statics)\n\n const controls = valuesToControls({\n component,\n values,\n dimensionControls,\n })\n\n const storybookControls = makeControls({\n ...controls,\n ...definedControls,\n })\n\n // ------------------------------------------------------\n // CONTROLS DEFAULT VALUES\n // ------------------------------------------------------\n const args = filterDefaultValues(controls)\n\n // ------------------------------------------------------\n // PROPS TO BE PASSED TO ODE GENERATION\n // ------------------------------------------------------\n const codeDimensionProps = Object.entries(dimensionControls).reduce(\n (acc, [key, value]) => ({ ...acc, [key]: value.value }),\n {}\n )\n\n const codeProps = pick(args, Object.keys(attrs))\n\n // ------------------------------------------------------\n // STORY COMPONENT\n // ------------------------------------------------------\n const Enhanced = (props) => <>{createElement(component, props)}</>\n\n Enhanced.args = args\n Enhanced.argTypes = {\n ...storybookControls,\n ...disableDimensionControls(dimensions),\n }\n\n Enhanced.parameters = {\n docs: {\n source: {\n code: createMainJSX({\n name,\n dimensions: codeDimensionProps,\n params: codeProps,\n booleanDimensions: useBooleans\n ? extractDefaultBooleanProps({\n dimensions,\n multiKeys,\n })\n : null,\n }),\n },\n },\n }\n\n return Enhanced\n}\n\nexport default mainStory\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { createElement, VFC, ComponentType } from 'react'\nimport {\n filterControls,\n filterValues,\n valuesToControls,\n makeControls,\n} from '~/utils/controls'\nimport filterDefaultValues from '~/utils/controls/filterDefaultValues'\n\ntype Story = ({\n component,\n attrs,\n}: {\n component: ComponentType\n attrs: Record<string, unknown>\n}) => VFC & { args: any; argTypes: any }\n\nconst story: Story = ({ component, attrs }) => {\n const definedControls = filterControls(attrs)\n const values = filterValues(attrs)\n\n const controls = valuesToControls({\n component: component as any,\n values,\n dimensionControls: {},\n })\n\n const storybookControls = makeControls({\n ...controls,\n ...definedControls,\n })\n\n const args = filterDefaultValues(controls)\n\n const Enhanced = (props) => createElement(component, props)\n\n Enhanced.args = args\n Enhanced.argTypes = storybookControls\n\n return Enhanced\n}\n\nexport default story\n","import { get } from '@vitus-labs/core'\nimport { isRocketComponent } from '@vitus-labs/rocketstyle'\nimport { dimensionStory, mainStory, generalStory } from './stories'\nimport type {\n Element,\n RocketComponent,\n Configuration,\n AttrsTypes,\n} from './types'\n\ntype Init = ({\n decorators,\n storyOptions,\n}: Partial<Pick<Configuration, 'decorators' | 'storyOptions'>>) => <\n T extends Element | RocketComponent = any\n>(\n component: T\n) => T extends RocketComponent\n ? ReturnType<CreateRocketStories<T>>\n : ReturnType<CreateStories<T>>\n\nconst init: Init = ({ decorators = [], storyOptions = {} }) => (component) =>\n rocketstories(component, { decorators, storyOptions })\n\n// --------------------------------------------------------\n// rocketstories\n// --------------------------------------------------------\ntype Rocketstories = <T extends Element | RocketComponent = any>(\n component: T,\n {\n decorators,\n storyOptions,\n }?: Partial<Pick<Configuration<T>, 'storyOptions' | 'decorators'>> | any\n) => T extends RocketComponent\n ? ReturnType<CreateRocketStories<T>>\n : ReturnType<CreateStories<T>>\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst rocketstories: Rocketstories = (\n component,\n { decorators = [], storyOptions = {} } = {}\n) => {\n if (!isRocketComponent(component)) {\n return createStories(\n {\n component,\n name: component.displayName || component.name,\n attrs: {},\n storyOptions: { gap: 16, direction: 'rows', ...storyOptions },\n decorators,\n },\n {} as Configuration\n )\n }\n\n return createRocketstories(\n {\n component,\n name: component.displayName || component.name,\n attrs: {},\n storyOptions: { gap: 16, direction: 'rows', ...storyOptions },\n decorators,\n },\n {} as Configuration\n )\n}\n\n// --------------------------------------------------------\n// create Stories\n// --------------------------------------------------------\ntype CreateStories<C = Element> = (\n options: Partial<Configuration>,\n defaultOptions: Configuration\n) => {\n attrs: (params: AttrsTypes<C>) => ReturnType<CreateStories<C>>\n config: () => {\n component: Element\n title: string\n decorators?: Configuration['decorators']\n }\n main: () => ReturnType<typeof generalStory>\n}\n\nconst createStories: CreateStories = (options, defaultOptions) => {\n const result = {\n ...defaultOptions,\n name: get(options, 'component')\n ? get(options, 'component.displayName')\n : defaultOptions.name,\n component: options.component || defaultOptions.component,\n attrs: { ...defaultOptions.attrs, ...options.attrs },\n storyOptions: { ...defaultOptions.storyOptions, ...options.storyOptions },\n decorators: [\n ...(defaultOptions.decorators || []),\n ...(options.decorators || []),\n ],\n } as Configuration\n\n return {\n attrs: (attrs) => createStories({ attrs }, result),\n\n // create object for `export default` in stories\n config: () => ({\n component: result.component,\n title: result.name as string,\n decorators: result.decorators,\n }),\n\n main: () => generalStory(result),\n }\n}\n\n// --------------------------------------------------------\n// create rocket stories\n// --------------------------------------------------------\n\ntype ExtractDimensions<C extends RocketComponent> = keyof C['$$rocketstyle']\n\ntype CreateRocketStories<C extends RocketComponent = any> = (\n options: Partial<Configuration<C>>,\n defaultOptions: Configuration<C>\n) => {\n attrs: (params: AttrsTypes<C>) => ReturnType<CreateRocketStories<C>>\n config: () => { component: Element; title: string }\n main: () => ReturnType<typeof mainStory>\n storyOptions: (\n options: Configuration['storyOptions']\n ) => ReturnType<CreateRocketStories<C>>\n dimension: <A extends ExtractDimensions<C>, B = keyof C['$$rocketstyle'][A]>(\n dimension: A,\n params?: Partial<{ ignore: any }>\n ) => ReturnType<typeof dimensionStory>\n}\n\nconst createRocketstories: CreateRocketStories = (options, defaultOptions) => {\n const result = {\n ...defaultOptions,\n name: get(options, 'component')\n ? get(options, 'component.displayName')\n : defaultOptions.name,\n component: options.component || defaultOptions.component,\n attrs: { ...defaultOptions.attrs, ...options.attrs },\n storyOptions: { ...defaultOptions.storyOptions, ...options.storyOptions },\n decorators: [\n ...(defaultOptions.decorators || []),\n ...(options.decorators || []),\n ],\n } as Configuration\n\n return {\n attrs: (attrs: Configuration['attrs']) =>\n createRocketstories({ attrs }, result),\n\n // create object for `export default` in stories\n config: () => ({\n component: result.component,\n title: result.name,\n decorators: result.decorators,\n }),\n\n // generate main story\n main: () => mainStory(result as any),\n\n //define storyOptions\n storyOptions: (storyOptions) =>\n createRocketstories({ storyOptions }, result),\n\n // generate stories of defined dimension\n dimension: (dimension, params = {}) => {\n const { ignore = [] } = params\n\n return dimensionStory({\n ...result,\n ignore,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n dimension,\n })\n },\n }\n}\n\nexport { init }\n\nexport default rocketstories\n"],"names":["createContext","config","React","get","omit","htmlTags","CONTROLS.ELEMENT_CONTROLS","CONTROLS.LIST_CONTROLS","CONTROLS.TEXT_CONTROLS","CONTROLS.OVERLAY_CONTROLS","CONTROLS.ROCKETSTYLE_CONTROLS","component","isEmpty","NotFound","Fragment","Element","Text","createElement","pick","generalStory","dimensionStory"],"mappings":";;;;;;;;;;;;;AAiOA,MAAM,WAAW,GAAG;AACpB,IAAI,KAAK,EAAE,IAAI;AACf,IAAI,IAAI,EAAE,IAAI;AACd,CAAC,CAAC;AAKF,MAAM,WAAW,GAAG;AACpB,IAAI,UAAU;AACd,IAAI,UAAU;AACd,IAAI,OAAO;AACX,IAAI,MAAM;AACV,IAAI,WAAW;AACf,IAAI,UAAU;AACd,IAAI,WAAW;AACf,IAAI,QAAQ;AACZ,CAAC,CAAC;AACF,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAClD,MAAM,WAAW,GAAG,CAAC,GAAG,YAAY,EAAE,SAAS,CAAC,CAAC;AACvB;AAC1B,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;AAC/B,IAAI,GAAG,WAAW;AAClB,IAAI,GAAG,WAAW;AAClB,EAAE;AAwGF;AACmBA,mBAAa,CAAC,EAAE,EAAE;AAwTrC;AACA,MAAM,iBAAiB,GAAG,CAAC,SAAS,KAAK;AACzC,IAAI,IAAI,OAAO,SAAS,KAAK,QAAQ;AACrC,QAAQ,SAAS,KAAK,IAAI;AAC1B,QAAQ,SAAS,CAAC,cAAc,EAAE;AAClC,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,IAAI,OAAO,KAAK,CAAC;AACjB,CAAC;;AC/pBD,MAAM,OAAO,GAAGC,WAAM,CAAC,MAAM,CAAC,GAAG,CAAA;;;CAG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AC;cAC3BA,QAAG,CAAC,OAAO,EAAE,uBAAuB,CAAC;cACrC,cAAc,CAAC,IAAI;QACvB,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,cAAc,CAAC,SAAS;QACxD,KAAK,EAAE,EAAE,GAAG,cAAc,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE;QACpD,YAAY,EAAE,EAAE,GAAG,cAAc,CAAC,YAAY,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE;QACzE,UAAU,EAAE;YACV,IAAI,cAAc,CAAC,UAAU,IAAI,EAAE,CAAC;YACpC,IAAI,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;SAC9B;KACe,CAAA;IAElB,OAAO;QACL,KAAK,EAAE,CAAC,KAA6B,KACnC,mBAAmB,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,CAAC;;QAGxC,MAAM,EAAE,OAAO;YACb,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,KAAK,EAAE,MAAM,CAAC,IAAI;YAClB,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;;QAGF,IAAI,EAAE,MAAM,SAAS,CAAC,MAAa,CAAC;;QAGpC,YAAY,EAAE,CAAC,YAAY,KACzB,mBAAmB,CAAC,EAAE,YAAY,EAAE,EAAE,MAAM,CAAC;;QAG/C,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,EAAE;YAChC,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,MAAM,CAAA;YAE9B,OAAOiB,oBAAc,CAAC;gBACpB,GAAG,MAAM;gBACT,MAAM;;;gBAGN,SAAS;aACV,CAAC,CAAA;SACH;KACF,CAAA;AACH,CAAC;;;;;"}
@@ -992,7 +992,10 @@ const createStories = (options, defaultOptions) => {
992
992
  component: options.component || defaultOptions.component,
993
993
  attrs: { ...defaultOptions.attrs, ...options.attrs },
994
994
  storyOptions: { ...defaultOptions.storyOptions, ...options.storyOptions },
995
- decorators: [...defaultOptions.decorators, ...(options.decorators || [])],
995
+ decorators: [
996
+ ...(defaultOptions.decorators || []),
997
+ ...(options.decorators || []),
998
+ ],
996
999
  };
997
1000
  return {
998
1001
  attrs: (attrs) => createStories({ attrs }, result),
@@ -1014,7 +1017,10 @@ const createRocketstories = (options, defaultOptions) => {
1014
1017
  component: options.component || defaultOptions.component,
1015
1018
  attrs: { ...defaultOptions.attrs, ...options.attrs },
1016
1019
  storyOptions: { ...defaultOptions.storyOptions, ...options.storyOptions },
1017
- decorators: [...defaultOptions.decorators, ...(options.decorators || [])],
1020
+ decorators: [
1021
+ ...(defaultOptions.decorators || []),
1022
+ ...(options.decorators || []),
1023
+ ],
1018
1024
  };
1019
1025
  return {
1020
1026
  attrs: (attrs) => createRocketstories({ attrs }, result),