next-yak 9.4.0 → 9.4.2

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.
Files changed (99) hide show
  1. package/README.md +57 -288
  2. package/dist/context/baseContext.cjs +6 -29
  3. package/dist/context/baseContext.cjs.map +1 -1
  4. package/dist/context/baseContext.d.cts +4 -2
  5. package/dist/context/baseContext.d.ts +4 -2
  6. package/dist/context/baseContext.js +5 -5
  7. package/dist/context/baseContext.js.map +1 -1
  8. package/dist/context/index.cjs +33 -41
  9. package/dist/context/index.cjs.map +1 -1
  10. package/dist/context/index.d.cts +12 -8
  11. package/dist/context/index.d.ts +12 -8
  12. package/dist/context/index.js +10 -13
  13. package/dist/context/index.js.map +1 -1
  14. package/dist/context/index.server.cjs +35 -41
  15. package/dist/context/index.server.cjs.map +1 -1
  16. package/dist/context/index.server.d.cts +13 -0
  17. package/dist/context/index.server.d.ts +13 -0
  18. package/dist/context/index.server.js +12 -14
  19. package/dist/context/index.server.js.map +1 -1
  20. package/dist/index.cjs +1 -4
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +52 -46
  23. package/dist/index.d.ts +52 -46
  24. package/dist/index.js +1 -4
  25. package/dist/index.js.map +1 -1
  26. package/dist/internal.cjs +464 -697
  27. package/dist/internal.cjs.map +1 -1
  28. package/dist/internal.d.cts +368 -0
  29. package/dist/internal.d.ts +368 -0
  30. package/dist/internal.js +297 -532
  31. package/dist/internal.js.map +1 -1
  32. package/dist/isolated-source-eval/index.d.ts +22 -20
  33. package/dist/isolated-source-eval/index.js +284 -298
  34. package/dist/isolated-source-eval/index.js.map +1 -1
  35. package/dist/isolated-source-eval/worker.js +53 -57
  36. package/dist/isolated-source-eval/worker.js.map +1 -1
  37. package/dist/jsx-dev-runtime.cjs +1 -1
  38. package/dist/jsx-dev-runtime.cjs.map +1 -1
  39. package/dist/jsx-dev-runtime.d.cts +9 -0
  40. package/dist/jsx-dev-runtime.d.ts +9 -0
  41. package/dist/jsx-dev-runtime.js +1 -1
  42. package/dist/jsx-dev-runtime.js.map +1 -1
  43. package/dist/jsx-runtime.cjs +1 -1
  44. package/dist/jsx-runtime.cjs.map +1 -1
  45. package/dist/jsx-runtime.d.cts +25 -24
  46. package/dist/jsx-runtime.d.ts +25 -24
  47. package/dist/jsx-runtime.js +1 -1
  48. package/dist/jsx-runtime.js.map +1 -1
  49. package/dist/loaders/turbo-loader.cjs +695 -983
  50. package/dist/loaders/turbo-loader.cjs.map +1 -1
  51. package/dist/loaders/turbo-loader.d.cts +7 -6
  52. package/dist/loaders/vite-plugin.d.ts +15 -13
  53. package/dist/loaders/vite-plugin.js +736 -1060
  54. package/dist/loaders/vite-plugin.js.map +1 -1
  55. package/dist/loaders/webpack-loader.cjs +629 -916
  56. package/dist/loaders/webpack-loader.cjs.map +1 -1
  57. package/dist/loaders/webpack-loader.d.cts +5 -4
  58. package/dist/static/chunk-WfQuXRBF.js +1 -0
  59. package/dist/static/index.cjs +1 -1
  60. package/dist/static/index.cjs.map +1 -1
  61. package/dist/static/index.d.cts +6 -7
  62. package/dist/static/index.d.ts +6 -7
  63. package/dist/static/index.js +1 -1
  64. package/dist/static/index.js.map +1 -1
  65. package/dist/withYak/index.cjs +135 -161
  66. package/dist/withYak/index.cjs.map +1 -1
  67. package/dist/withYak/index.d.cts +42 -40
  68. package/dist/withYak/index.d.ts +42 -40
  69. package/dist/withYak/index.js +114 -133
  70. package/dist/withYak/index.js.map +1 -1
  71. package/loaders/lib/__tests__/debugLogger.test.ts +11 -43
  72. package/loaders/lib/debugLogger.ts +6 -12
  73. package/loaders/lib/extractCss.ts +2 -6
  74. package/loaders/lib/resolveCrossFileSelectors.ts +105 -89
  75. package/loaders/turbo-evaluator.ts +7 -14
  76. package/loaders/turbo-loader.ts +5 -22
  77. package/loaders/vite-plugin.ts +19 -55
  78. package/loaders/webpack-loader.ts +1 -3
  79. package/package.json +131 -71
  80. package/runtime/__tests__/attrs.test.tsx +9 -16
  81. package/runtime/__tests__/cssLiteral.test.tsx +21 -45
  82. package/runtime/__tests__/cssProp.test.tsx +8 -17
  83. package/runtime/__tests__/cssPropTest.tsx +10 -13
  84. package/runtime/__tests__/styled.test.tsx +4 -13
  85. package/runtime/__tests__/tsconfig.json +1 -0
  86. package/runtime/__tests__/typeTest.tsx +7 -15
  87. package/runtime/atoms.tsx +1 -1
  88. package/runtime/context/README.md +11 -16
  89. package/runtime/context/index.server.tsx +2 -9
  90. package/runtime/cssLiteral.tsx +4 -13
  91. package/runtime/index.ts +1 -1
  92. package/runtime/internals/mergeCssProp.ts +1 -3
  93. package/runtime/jsx-runtime.ts +1 -2
  94. package/runtime/keyframes.tsx +1 -1
  95. package/runtime/mocks/cssLiteral.ts +3 -11
  96. package/runtime/mocks/keyframes.ts +1 -1
  97. package/runtime/publicStyledApi.ts +3 -13
  98. package/runtime/styled.tsx +19 -31
  99. package/withYak/index.ts +11 -19
@@ -1 +1 @@
1
- {"version":3,"sources":["../runtime/internal.ts","../runtime/cssLiteral.tsx","../runtime/styled.tsx","../runtime/atoms.tsx","../runtime/keyframes.tsx","../runtime/internals/unitPostFix.ts","../runtime/internals/mergeCssProp.ts","../runtime/styledDom.tsx"],"sourcesContent":["/**\n * IMPORTANT: This file contains the internal implementation of next-yak's core APIs.\n *\n * Purpose:\n * - Provides the actual runtime implementations for styled, css, keyframes, etc.\n * - Referenced only by the compiled code \"next-yak/internal\"\n *\n * Usage:\n * - DO NOT import from this file directly in your application code.\n * - Always use `import { ... } from \"next-yak\"` in your source files.\n * - The Babel plugin will automatically transform those imports to use this internal module.\n *\n * Why this exists:\n * 1. Allows for cleaner separation between the public API and internal implementation\n * 2. Enables better typing for both pre-compilation (user code) and post-compilation scenarios\n * 3. Easier testing and snapshot comparisons without hashes (in index.ts)\n * 4. Makes next-yak work out-of-the-box with testing frameworks like Jest and Vitest\n *\n * Note for maintainers:\n * - Ensure that types from this file are not published to avoid exposing internal APIs.\n *\n * @internal This module is not intended for direct usage and may change without notice.\n */\n\nexport { css } from \"./cssLiteral.js\";\nexport { styled } from \"./styled.js\";\nexport { atoms } from \"./atoms.js\";\nexport { keyframes } from \"./keyframes.js\";\n\n// the following export is not relative as \"next-yak/context\"\n// links to one file for react server components and\n// to another file for classic react components\nexport { useTheme, YakThemeProvider } from \"next-yak/context\";\n\n// runtime internals (helpers which get injected by the compiler)\nexport { unitPostFix as __yak_unitPostFix } from \"./internals/unitPostFix.js\";\nexport { mergeCssProp as __yak_mergeCssProp } from \"./internals/mergeCssProp.js\";\n\n// export shorthand for DOM styled components (e.g. for styled.div)\nexport * from \"./styledDom.js\";\n","import type { YakTheme } from \"./index.d.ts\";\nimport { RuntimeStyleProcessor } from \"./publicStyledApi.js\";\n\nexport const yakComponentSymbol = Symbol(\"yak\");\n\nexport type ComponentStyles<TProps> = (props: TProps) => {\n className: string;\n style?: {\n [key: string]: string;\n };\n};\n\nexport type CSSInterpolation<TProps> =\n | string\n | number\n | undefined\n | null\n | false\n | ComponentStyles<TProps>\n | {\n // type only identifier to allow targeting components\n // e.g. styled.svg`${Button}:hover & { fill: red; }`\n [yakComponentSymbol]: any;\n }\n | ((props: TProps) => CSSInterpolation<TProps>);\n\ntype CSSStyles<TProps = {}> = {\n style: { [key: string]: string | ((props: TProps) => string) };\n};\n\ntype CSSFunction = <TProps = {}>(\n styles: TemplateStringsArray,\n ...values: CSSInterpolation<TProps & { theme: YakTheme }>[]\n) => ComponentStyles<TProps>;\n\nexport type NestedRuntimeStyleProcessor = (\n props: unknown,\n classNames: Set<string>,\n style: React.CSSProperties,\n) =>\n | {\n className?: string;\n style?: React.CSSProperties;\n }\n | void\n | NestedRuntimeStyleProcessor;\n\n/**\n * css() runtime factory of css``\n *\n * /!\\ next-yak transpiles css`` and styled``\n *\n * This changes the typings of the css`` and styled`` functions.\n * During development the user of next-yak wants to work with the\n * typings BEFORE compilation.\n *\n * Therefore this is only an internal function only and it must be cast to any\n * before exported to the user.\n *\n * The internal functioning of css`` is to return a single callback function that runs all functions\n * (or creates new ones if needed) that are passed as arguments. These functions receive the props, classNames, and style object as arguments\n * and operate directly on the classNames and style objects.\n */\nexport function css<TProps>(\n styles: TemplateStringsArray,\n ...values: CSSInterpolation<NoInfer<TProps> & { theme: YakTheme }>[]\n): ComponentStyles<TProps>;\nexport function css<TProps>(\n ...args: Array<any>\n): RuntimeStyleProcessor<TProps> {\n // Normally this could be an array of strings passed, but as we transpile the usage of css`` ourselves, we control the arguments\n // and ensure that only the first argument is a string (class name of the non-dynamic styles)\n let className: string | undefined;\n const dynamicCssFunctions: NestedRuntimeStyleProcessor[] = [];\n for (const arg of args as Array<string | CSSFunction | CSSStyles<any>>) {\n // A CSS-module class name which got auto generated during build from static css\n // e.g. css`color: red;`\n // compiled -> css(\"yak31e4\")\n if (typeof arg === \"string\") {\n className = arg;\n }\n // Dynamic CSS e.g.\n // css`${props => props.active && css`color: red;`}`\n // compiled -> css((props: { active: boolean }) => props.active && css(\"yak31e4\"))\n else if (typeof arg === \"function\") {\n dynamicCssFunctions.push(arg as unknown as NestedRuntimeStyleProcessor);\n }\n // Dynamic CSS with css variables e.g.\n // css`transform: translate(${props => props.x}, ${props => props.y});`\n // compiled -> css(\"yak31e4\", { style: { \"--yakVarX\": props => props.x }, \"--yakVarY\": props => props.y }})\n else if (typeof arg === \"object\" && \"style\" in arg) {\n dynamicCssFunctions.push((props, _, style) => {\n for (const key in arg.style) {\n const value = arg.style[key];\n if (typeof value === \"function\") {\n // @ts-expect-error CSSProperties don't allow css variables\n style[key] = String(\n // The value for a css value can be a theme dependent function e.g.:\n // const borderColor = (props: { theme: { mode: \"dark\" | \"light\" } }) => props.theme === \"dark\" ? \"black\" : \"white\";\n // css`border-color: ${borderColor};`\n // Therefore the value has to be extracted recursively\n recursivePropExecution(props, value),\n );\n } else {\n // @ts-expect-error CSSProperties don't allow css variables\n style[key] = String(value);\n }\n }\n });\n }\n }\n\n // Non Dynamic CSS\n // This is just an optimization for the common case where there are no dynamic css functions\n if (dynamicCssFunctions.length === 0) {\n return (_, classNames) => {\n if (className) {\n classNames.add(className);\n }\n return () => {};\n };\n }\n\n return (props, classNames, allStyles) => {\n if (className) {\n classNames.add(className);\n }\n for (let i = 0; i < dynamicCssFunctions.length; i++) {\n unwrapProps(props, dynamicCssFunctions[i], classNames, allStyles);\n }\n };\n}\n\n// Dynamic CSS with runtime logic\nconst unwrapProps = (\n props: unknown,\n fn: NestedRuntimeStyleProcessor,\n classNames: Set<string>,\n style: React.CSSProperties,\n) => {\n let result = fn(props, classNames, style);\n while (result) {\n if (typeof result === \"function\") {\n result = result(props, classNames, style);\n continue;\n } else if (typeof result === \"object\") {\n if (\"className\" in result && result.className) {\n classNames.add(result.className);\n }\n if (\"style\" in result && result.style) {\n for (const key in result.style) {\n // This is hard for typescript to infer\n style[key as keyof React.CSSProperties] = result.style[\n key as keyof React.CSSProperties\n ] as any;\n }\n }\n }\n break;\n }\n};\n\nconst recursivePropExecution = (\n props: unknown,\n fn: (props: unknown) => any,\n): string | number => {\n const result = fn(props);\n if (typeof result === \"function\") {\n return recursivePropExecution(props, result);\n }\n if (process.env.NODE_ENV === \"development\") {\n if (\n typeof result !== \"string\" &&\n typeof result !== \"number\" &&\n !(result instanceof String)\n ) {\n throw new Error(\n `Dynamic CSS functions must return a string or number but returned ${JSON.stringify(\n result,\n )}\\n\\nDynamic CSS function: ${fn.toString()}\\n`,\n );\n }\n }\n return result;\n};\n","import { css, CSSInterpolation, yakComponentSymbol } from \"./cssLiteral.js\";\nimport React from \"react\";\nimport type {\n Attrs,\n AttrsMerged,\n Styled,\n YakComponent,\n AttrsFunction,\n StyledFn,\n HtmlTags,\n Substitute,\n StyledLiteral,\n RuntimeStyleProcessor,\n} from \"./publicStyledApi.js\";\n\n// the following export is not relative as \"next-yak/context\"\n// links to one file for react server components and\n// to another file for classic react components\nimport { useTheme } from \"next-yak/context\";\nimport type { YakTheme } from \"./context/index.d.ts\";\n\n/**\n * This Symbol is a fake theme which was used instead of the real one from the context\n * to speed up rendering\n */\nconst noTheme: YakTheme = {};\n\n//\n// The `styled()` API without `styled.` syntax\n//\n// The API design is inspired by styled-components:\n// https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/constructors/styled.tsx\n// https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/models/StyledComponent.ts\n//\nconst styledFactory: StyledFn = (Component) =>\n Object.assign(yakStyled(Component), {\n attrs: (attrs: Attrs<any>) => yakStyled(Component, attrs),\n });\n\n/**\n * The `styled` method works perfectly on all of your own or any third-party component,\n * as long as they attach the passed className prop to a DOM element.\n *\n * @usage\n *\n * ```tsx\n * const StyledLink = styled(Link)`\n * color: #BF4F74;\n * font-weight: bold;\n * `;\n * ```\n */\nexport const styled = styledFactory as Styled;\n\nconst yakStyled: StyledInternal = (Component, attrs) => {\n const isYakComponent =\n typeof Component !== \"string\" && yakComponentSymbol in Component;\n\n // if the component that is wrapped is a yak component, we can extract it to render the underlying component directly\n // and we can also extract the attrs function and the dynamic style function to merge it with the current attrs function (or dynamic style function)\n // so that the sequence of the attrs functions is preserved\n const [parentYakComponent, parentAttrsFn, parentRuntimeStylesFn] =\n isYakComponent\n ? (Component[yakComponentSymbol] as [\n YakComponent<unknown>,\n ExtractAttrsFunction<typeof attrs>,\n RuntimeStyleProcessor<unknown>,\n ])\n : [];\n\n const mergedAttrsFn = buildRuntimeAttrsProcessor(attrs, parentAttrsFn);\n\n return (styles, ...values) => {\n // combine all interpolated logic into a single function\n // e.g. styled.button`color: ${props => props.color}; margin: ${props => props.margin};`\n const runtimeStylesFn = css(\n styles,\n ...(values as CSSInterpolation<unknown>[]),\n ) as RuntimeStyleProcessor<unknown>;\n const runtimeStyleProcessor = buildRuntimeStylesProcessor(\n runtimeStylesFn,\n parentRuntimeStylesFn,\n );\n const yak: React.FunctionComponent = (props) => {\n // if the css component does not require arguments\n // it can be called without arguments and we skip calling useTheme()\n //\n // `attrsFn || getRuntimeStyles.length` is NOT against the rule of hooks as\n // getRuntimeStyles and attrsFn are constants defined outside of the component\n //\n // for example\n //\n // const Button = styled.button`color: red;`\n // ^ does not need to have access to theme, so we skip calling useTheme()\n //\n // const Button = styled.button`${({ theme }) => css`color: ${theme.color};`}`\n // ^ must be have access to theme, so we call useTheme()\n const theme =\n mergedAttrsFn || runtimeStylesFn.length ? useTheme() : noTheme;\n\n // The first components which is not wrapped in a yak component will execute all attrs functions\n // starting from the innermost yak component to the outermost yak component (itself)\n const combinedProps =\n \"$__attrs\" in props\n ? ({\n theme,\n ...props,\n } as {\n theme: YakTheme;\n className?: string;\n style?: React.CSSProperties;\n })\n : // overwrite and merge the current props with the processed attrs\n combineProps(\n {\n theme,\n ...(props as {\n className?: string;\n style?: React.CSSProperties;\n }),\n // mark the props as processed\n $__attrs: true,\n },\n mergedAttrsFn?.({ theme, ...(props as any) }),\n );\n\n const classNames = new Set<string>(\n \"className\" in combinedProps ? combinedProps.className?.split(\" \") : [],\n );\n const styles = {\n ...(\"style\" in combinedProps ? combinedProps.style : {}),\n };\n\n // execute all functions inside the style literal if not already executed\n // e.g. styled.button`color: ${props => props.color};`\n if (!(\"$__runtimeStylesProcessed\" in combinedProps)) {\n runtimeStyleProcessor(combinedProps, classNames, styles);\n // @ts-expect-error this is not typed correctly\n combinedProps.$__runtimeStylesProcessed = true;\n }\n\n combinedProps.className = Array.from(classNames).join(\" \") || undefined;\n combinedProps.style = styles;\n\n // delete the yak theme from the props\n // this must happen after the runtimeStyles are calculated\n // prevents passing the theme prop to the DOM element of a styled component\n const { theme: themeAfterAttr, ...combinedPropsWithoutTheme } =\n combinedProps;\n const propsBeforeFiltering =\n themeAfterAttr === theme ? combinedPropsWithoutTheme : combinedProps;\n\n // remove all props that start with a $ sign for string components e.g. \"button\" or \"div\"\n // so that they are not passed to the DOM element\n const filteredProps = !isYakComponent\n ? removeNonDomProperties(propsBeforeFiltering)\n : propsBeforeFiltering;\n\n return parentYakComponent ? (\n // if the styled(Component) syntax is used and the component is a yak component\n // we can call the yak function directly without running through react createElement\n parentYakComponent(filteredProps)\n ) : (\n // if the final component is a string component e.g. styled(\"div\") or a custom non yak fn e.g. styled(MyComponent)\n <Component\n {...(filteredProps as React.ComponentProps<\n Exclude<typeof Component, string>\n >)}\n />\n );\n };\n\n // Assign the yakComponentSymbol directly without forwardRef\n return Object.assign(yak, {\n [yakComponentSymbol]: [yak, mergedAttrsFn, runtimeStyleProcessor] as [\n unknown,\n unknown,\n unknown,\n ],\n });\n };\n};\n\n/**\n * Remove all entries that start with a $ sign\n *\n * This allows to have props that are used for internal styling purposes\n * but are not be passed to the DOM element\n */\nconst removeNonDomProperties = <T extends Record<string, unknown>>(\n obj: T,\n): T => {\n const result = {} as T;\n for (const key in obj) {\n if (!key.startsWith(\"$\") && obj[key] !== undefined) {\n result[key] = obj[key];\n }\n }\n return result;\n};\n\n// util function to merge class names, as they are concatenated with a space\nconst mergeClassNames = (a?: string, b?: string) => {\n if (!a && !b) return undefined;\n if (!a) return b;\n if (!b) return a;\n return a + \" \" + b;\n};\n\n/**\n * merge props and processed props (including class names and styles)\n * e.g.:\\\n * `{ className: \"a\", foo: 1 }` and `{ className: \"b\", bar: 2 }` \\\n * => `{ className: \"a b\", foo: 1, bar: 2 }`\n */\nconst combineProps = <\n T extends {\n className?: string;\n style?: React.CSSProperties;\n },\n TOther extends\n | {\n className?: string;\n style?: React.CSSProperties;\n }\n | null\n | undefined,\n>(\n props: T,\n newProps: TOther,\n) =>\n newProps\n ? (props.className === newProps.className || !newProps.className) &&\n (props.style === newProps.style || !newProps.style)\n ? // shortcut if no style and class merging is necessary\n {\n ...props,\n ...newProps,\n }\n : // merge class names and styles\n {\n ...props,\n ...newProps,\n className: mergeClassNames(props.className, newProps.className),\n style: { ...(props.style || {}), ...(newProps.style || {}) },\n }\n : // if no new props are provided, no merging is necessary\n props;\n\n/**\n * Merges the attrs function of the current component with the attrs function of the parent component\n * in order to preserve the sequence of the attrs functions.\n * Note: In theory, the parentAttrsFn can have different types for TAttrsIn and TAttrsOut\n * but as this is only used internally, we can ignore and simplify this case\n * @param attrs The attrs object or function of the current component (if any)\n * @param parentAttrsFn The attrs function of the parent/wrapped component (if any)\n * @returns A function that receives the props and returns the transformed props\n */\nconst buildRuntimeAttrsProcessor = <\n T,\n TAttrsIn extends object,\n TAttrsOut extends AttrsMerged<T, TAttrsIn>,\n>(\n attrs?: Attrs<T, TAttrsIn, TAttrsOut>,\n parentAttrsFn?: AttrsFunction<T, TAttrsIn, TAttrsOut>,\n): AttrsFunction<T, TAttrsIn, TAttrsOut> | undefined => {\n const ownAttrsFn =\n attrs && (typeof attrs === \"function\" ? attrs : () => attrs);\n\n if (ownAttrsFn && parentAttrsFn) {\n return (props) => {\n const parentProps = parentAttrsFn(props);\n\n // overwrite and merge the parent props with the props received from the attrs function\n // after they went through the parent attrs function.\n //\n // This makes sure the linearity of the attrs functions is preserved and all attrs function receive\n // the whole props object calculated from the previous attrs functions\n return combineProps(\n parentProps,\n ownAttrsFn(combineProps(props, parentProps)),\n );\n };\n }\n\n return ownAttrsFn || parentAttrsFn;\n};\n\n/**\n * Merges the runtime style function of the current component with the runtime style function of the parent component\n * in order to preserve the sequence of the attrs functions.\n * @param runtimeStylesFn The current runtime styles function\n * @param parentRuntimeStylesFn The parent runtime styles function\n * @returns The merged runtime styles function\n */\nconst buildRuntimeStylesProcessor = <T,>(\n runtimeStylesFn: RuntimeStyleProcessor<T>,\n parentRuntimeStylesFn?: RuntimeStyleProcessor<T>,\n) => {\n if (runtimeStylesFn && parentRuntimeStylesFn) {\n const combined: RuntimeStyleProcessor<T> = (props, classNames, style) => {\n parentRuntimeStylesFn(props, classNames, style);\n runtimeStylesFn(props, classNames, style);\n };\n return combined;\n }\n return runtimeStylesFn || parentRuntimeStylesFn;\n};\n\n/**\n * Internal function where attrs are passed to be processed\n */\nexport type StyledInternal = <\n T extends object,\n TAttrsIn extends object = {},\n TAttrsOut extends AttrsMerged<T, TAttrsIn> = AttrsMerged<T, TAttrsIn>,\n>(\n Component: React.FunctionComponent<T> | YakComponent<T> | HtmlTags | string,\n attrs?: Attrs<T, TAttrsIn, TAttrsOut>,\n) => StyledLiteral<Substitute<T, TAttrsIn>>;\n\n/**\n * Utility type to extract the AttrsFunction from the Attrs type\n */\nexport type ExtractAttrsFunction<T> = T extends (p: any) => any ? T : never;\n","import { ComponentStyles, css } from \"./cssLiteral.js\";\nimport { RuntimeStyleProcessor as RuntimeStyleProcessor } from \"./publicStyledApi.js\";\n\n/**\n * Allows to use atomic CSS classes in a styled or css block\n *\n * @usage\n *\n * ```tsx\n * import { styled, atoms } from \"next-yak\";\n *\n * const Button = styled.button<{ $primary?: boolean }>`\n * ${atoms(\"text-teal-600\", \"text-base\", \"rounded-md\")}\n * ${props => props.$primary && atoms(\"shadow-md\")}\n * `;\n * ```\n */\nexport const atoms = <T,>(\n ...atoms: (string | RuntimeStyleProcessor<T> | false)[]\n): ComponentStyles<T> => {\n const staticClasses: string[] = [];\n const dynamicFunctions: RuntimeStyleProcessor<T>[] = [];\n\n for (const atom of atoms) {\n if (typeof atom === \"string\") {\n staticClasses.push(...atom.split(\" \"));\n } else if (typeof atom === \"function\") {\n dynamicFunctions.push(atom);\n }\n }\n\n const runtimeFunctions: RuntimeStyleProcessor<T>[] =\n staticClasses.length > 0\n ? [\n (_, classNames) => {\n staticClasses.forEach((cls) => classNames.add(cls));\n },\n ...dynamicFunctions,\n ]\n : dynamicFunctions;\n\n // @ts-expect-error the internal implementation of css is not typed\n return css(...runtimeFunctions);\n};\n","/**\n * Allows to use CSS keyframe animations in a styled or css block\n *\n * @usage\n *\n * ```tsx\n * import { styled, keyframes } from \"next-yak\";\n *\n * const rotate = keyframes`\n * from {\n * transform: rotate(0deg);\n * }\n * to {\n * transform: rotate(360deg);\n * }\n * `;\n *\n * const Spinner = styled.div`\n * animation: ${rotate} 1s linear infinite;\n * `;\n * ```\n */\nexport const keyframes = <T extends (string | number | bigint)[] = never>(\n styles: TemplateStringsArray,\n ...dynamic: T\n): string => {\n // during compilation all args of keyframe are compiled\n // to a string which references the animation name\n return styles as any as string;\n};\n","/**\n * Internal helper called by transformed code - Do not use directly\n *\n * Takes a function and a css unit and returns the result of the function concatenated with the unit\n *\n * ```tsx\n * import { styled } from \"next-yak\";\n *\n * const Button = styled.button<{ $width?: boolean }>`\n * width: ${({ $width }) => $width}px;\n * `;\n * ```\n *\n * Which will be transformed to:\n * ```tsx\n * import { styled } from \"next-yak/internals\";\n *\n * const Button = styled.button<{ $width?: boolean }>(\n * \"button\", {\n * width: unitPostFix({ $width }) => $width, \"px\")\n * });\n */\nexport const unitPostFix = (arg: unknown, unit: string) => {\n switch (typeof arg) {\n case \"function\":\n return (props: any) => unitPostFix(arg(props), unit);\n case \"number\":\n case \"string\":\n return `${arg}${unit}`;\n // Ignore falsy values\n default:\n return undefined;\n }\n};\n","import { RuntimeStyleProcessor } from \"../publicStyledApi.js\";\n\n/**\n * This is an internal helper function to merge relevant props of a native element with a css prop.\n * It's automatically added when using the `css` prop in a JSX element.\n * e.g.:\n * ```tsx\n * <p\n * className=\"foo\"\n * css={css`\n * color: green;\n * `}\n * {...{ style: { padding: \"30px\" }}}\n * />\n */\nexport const mergeCssProp = (\n relevantProps: {\n className?: string;\n style?: Record<string, string>;\n } & Record<string, unknown>,\n cssProp: RuntimeStyleProcessor<unknown>,\n) => {\n const existingClassName = relevantProps.className;\n const classNames = existingClassName\n ? new Set(existingClassName.split(\" \"))\n : new Set<string>();\n\n const existingStyle = relevantProps.style;\n const style = existingStyle ? { ...existingStyle } : {};\n\n cssProp({}, classNames, style);\n\n const result: { className?: string; style?: Record<string, string> } = {};\n\n if (Object.keys(style).length > 0) {\n result.style = style;\n }\n if (classNames.size > 0) {\n result.className = Array.from(classNames).join(\" \");\n }\n\n return result;\n};\n","import { styled } from \"./styled.js\";\n/// Internal API to create styled components\n/// Optimization for faster rendering and smaller bundle size in production\n/// thanks to better minification and dead code elimination\n///\n/// List taken from https://github.com/styled-components/styled-components/blob/e0019ba666fab4b5aaa2bff71ba6ad0005a299fd/packages/styled-components/src/utils/domElements.ts#L90\nexport const __yak_a = /*#__PURE__*/ styled(\"a\");\nexport const __yak_abbr = /*#__PURE__*/ styled(\"abbr\");\nexport const __yak_address = /*#__PURE__*/ styled(\"address\");\nexport const __yak_area = /*#__PURE__*/ styled(\"area\");\nexport const __yak_article = /*#__PURE__*/ styled(\"article\");\nexport const __yak_aside = /*#__PURE__*/ styled(\"aside\");\nexport const __yak_audio = /*#__PURE__*/ styled(\"audio\");\nexport const __yak_b = /*#__PURE__*/ styled(\"b\");\nexport const __yak_base = /*#__PURE__*/ styled(\"base\");\nexport const __yak_bdi = /*#__PURE__*/ styled(\"bdi\");\nexport const __yak_bdo = /*#__PURE__*/ styled(\"bdo\");\nexport const __yak_big = /*#__PURE__*/ styled(\"big\");\nexport const __yak_blockquote = /*#__PURE__*/ styled(\"blockquote\");\nexport const __yak_body = /*#__PURE__*/ styled(\"body\");\nexport const __yak_br = /*#__PURE__*/ styled(\"br\");\nexport const __yak_button = /*#__PURE__*/ styled(\"button\");\nexport const __yak_canvas = /*#__PURE__*/ styled(\"canvas\");\nexport const __yak_caption = /*#__PURE__*/ styled(\"caption\");\nexport const __yak_cite = /*#__PURE__*/ styled(\"cite\");\nexport const __yak_code = /*#__PURE__*/ styled(\"code\");\nexport const __yak_col = /*#__PURE__*/ styled(\"col\");\nexport const __yak_colgroup = /*#__PURE__*/ styled(\"colgroup\");\nexport const __yak_data = /*#__PURE__*/ styled(\"data\");\nexport const __yak_datalist = /*#__PURE__*/ styled(\"datalist\");\nexport const __yak_dd = /*#__PURE__*/ styled(\"dd\");\nexport const __yak_del = /*#__PURE__*/ styled(\"del\");\nexport const __yak_details = /*#__PURE__*/ styled(\"details\");\nexport const __yak_dfn = /*#__PURE__*/ styled(\"dfn\");\nexport const __yak_dialog = /*#__PURE__*/ styled(\"dialog\");\nexport const __yak_div = /*#__PURE__*/ styled(\"div\");\nexport const __yak_dl = /*#__PURE__*/ styled(\"dl\");\nexport const __yak_dt = /*#__PURE__*/ styled(\"dt\");\nexport const __yak_em = /*#__PURE__*/ styled(\"em\");\nexport const __yak_embed = /*#__PURE__*/ styled(\"embed\");\nexport const __yak_fieldset = /*#__PURE__*/ styled(\"fieldset\");\nexport const __yak_figcaption = /*#__PURE__*/ styled(\"figcaption\");\nexport const __yak_figure = /*#__PURE__*/ styled(\"figure\");\nexport const __yak_footer = /*#__PURE__*/ styled(\"footer\");\nexport const __yak_form = /*#__PURE__*/ styled(\"form\");\nexport const __yak_h1 = /*#__PURE__*/ styled(\"h1\");\nexport const __yak_h2 = /*#__PURE__*/ styled(\"h2\");\nexport const __yak_h3 = /*#__PURE__*/ styled(\"h3\");\nexport const __yak_h4 = /*#__PURE__*/ styled(\"h4\");\nexport const __yak_h5 = /*#__PURE__*/ styled(\"h5\");\nexport const __yak_h6 = /*#__PURE__*/ styled(\"h6\");\nexport const __yak_header = /*#__PURE__*/ styled(\"header\");\nexport const __yak_hgroup = /*#__PURE__*/ styled(\"hgroup\");\nexport const __yak_hr = /*#__PURE__*/ styled(\"hr\");\nexport const __yak_html = /*#__PURE__*/ styled(\"html\");\nexport const __yak_i = /*#__PURE__*/ styled(\"i\");\nexport const __yak_iframe = /*#__PURE__*/ styled(\"iframe\");\nexport const __yak_img = /*#__PURE__*/ styled(\"img\");\nexport const __yak_input = /*#__PURE__*/ styled(\"input\");\nexport const __yak_ins = /*#__PURE__*/ styled(\"ins\");\nexport const __yak_kbd = /*#__PURE__*/ styled(\"kbd\");\nexport const __yak_keygen = /*#__PURE__*/ styled(\"keygen\");\nexport const __yak_label = /*#__PURE__*/ styled(\"label\");\nexport const __yak_legend = /*#__PURE__*/ styled(\"legend\");\nexport const __yak_li = /*#__PURE__*/ styled(\"li\");\nexport const __yak_link = /*#__PURE__*/ styled(\"link\");\nexport const __yak_main = /*#__PURE__*/ styled(\"main\");\nexport const __yak_map = /*#__PURE__*/ styled(\"map\");\nexport const __yak_mark = /*#__PURE__*/ styled(\"mark\");\nexport const __yak_menu = /*#__PURE__*/ styled(\"menu\");\nexport const __yak_menuitem = /*#__PURE__*/ styled(\"menuitem\");\nexport const __yak_meta = /*#__PURE__*/ styled(\"meta\");\nexport const __yak_meter = /*#__PURE__*/ styled(\"meter\");\nexport const __yak_nav = /*#__PURE__*/ styled(\"nav\");\nexport const __yak_noscript = /*#__PURE__*/ styled(\"noscript\");\nexport const __yak_object = /*#__PURE__*/ styled(\"object\");\nexport const __yak_ol = /*#__PURE__*/ styled(\"ol\");\nexport const __yak_optgroup = /*#__PURE__*/ styled(\"optgroup\");\nexport const __yak_option = /*#__PURE__*/ styled(\"option\");\nexport const __yak_output = /*#__PURE__*/ styled(\"output\");\nexport const __yak_p = /*#__PURE__*/ styled(\"p\");\nexport const __yak_param = /*#__PURE__*/ styled(\"param\");\nexport const __yak_picture = /*#__PURE__*/ styled(\"picture\");\nexport const __yak_pre = /*#__PURE__*/ styled(\"pre\");\nexport const __yak_progress = /*#__PURE__*/ styled(\"progress\");\nexport const __yak_q = /*#__PURE__*/ styled(\"q\");\nexport const __yak_rp = /*#__PURE__*/ styled(\"rp\");\nexport const __yak_rt = /*#__PURE__*/ styled(\"rt\");\nexport const __yak_ruby = /*#__PURE__*/ styled(\"ruby\");\nexport const __yak_s = /*#__PURE__*/ styled(\"s\");\nexport const __yak_samp = /*#__PURE__*/ styled(\"samp\");\nexport const __yak_script = /*#__PURE__*/ styled(\"script\");\nexport const __yak_section = /*#__PURE__*/ styled(\"section\");\nexport const __yak_select = /*#__PURE__*/ styled(\"select\");\nexport const __yak_small = /*#__PURE__*/ styled(\"small\");\nexport const __yak_source = /*#__PURE__*/ styled(\"source\");\nexport const __yak_span = /*#__PURE__*/ styled(\"span\");\nexport const __yak_strong = /*#__PURE__*/ styled(\"strong\");\nexport const __yak_style = /*#__PURE__*/ styled(\"style\");\nexport const __yak_sub = /*#__PURE__*/ styled(\"sub\");\nexport const __yak_summary = /*#__PURE__*/ styled(\"summary\");\nexport const __yak_sup = /*#__PURE__*/ styled(\"sup\");\nexport const __yak_table = /*#__PURE__*/ styled(\"table\");\nexport const __yak_tbody = /*#__PURE__*/ styled(\"tbody\");\nexport const __yak_td = /*#__PURE__*/ styled(\"td\");\nexport const __yak_textarea = /*#__PURE__*/ styled(\"textarea\");\nexport const __yak_tfoot = /*#__PURE__*/ styled(\"tfoot\");\nexport const __yak_th = /*#__PURE__*/ styled(\"th\");\nexport const __yak_thead = /*#__PURE__*/ styled(\"thead\");\nexport const __yak_time = /*#__PURE__*/ styled(\"time\");\nexport const __yak_tr = /*#__PURE__*/ styled(\"tr\");\nexport const __yak_track = /*#__PURE__*/ styled(\"track\");\nexport const __yak_u = /*#__PURE__*/ styled(\"u\");\nexport const __yak_ul = /*#__PURE__*/ styled(\"ul\");\nexport const __yak_use = /*#__PURE__*/ styled(\"use\");\nexport const __yak_var = /*#__PURE__*/ styled(\"var\");\nexport const __yak_video = /*#__PURE__*/ styled(\"video\");\nexport const __yak_wbr = /*#__PURE__*/ styled(\"wbr\");\nexport const __yak_circle = /*#__PURE__*/ styled(\"circle\");\nexport const __yak_clipPath = /*#__PURE__*/ styled(\"clipPath\");\nexport const __yak_defs = /*#__PURE__*/ styled(\"defs\");\nexport const __yak_ellipse = /*#__PURE__*/ styled(\"ellipse\");\nexport const __yak_foreignObject = /*#__PURE__*/ styled(\"foreignObject\");\nexport const __yak_g = /*#__PURE__*/ styled(\"g\");\nexport const __yak_image = /*#__PURE__*/ styled(\"image\");\nexport const __yak_line = /*#__PURE__*/ styled(\"line\");\nexport const __yak_linearGradient = /*#__PURE__*/ styled(\"linearGradient\");\nexport const __yak_marker = /*#__PURE__*/ styled(\"marker\");\nexport const __yak_mask = /*#__PURE__*/ styled(\"mask\");\nexport const __yak_path = /*#__PURE__*/ styled(\"path\");\nexport const __yak_pattern = /*#__PURE__*/ styled(\"pattern\");\nexport const __yak_polygon = /*#__PURE__*/ styled(\"polygon\");\nexport const __yak_polyline = /*#__PURE__*/ styled(\"polyline\");\nexport const __yak_radialGradient = /*#__PURE__*/ styled(\"radialGradient\");\nexport const __yak_rect = /*#__PURE__*/ styled(\"rect\");\nexport const __yak_stop = /*#__PURE__*/ styled(\"stop\");\nexport const __yak_svg = /*#__PURE__*/ styled(\"svg\");\nexport const __yak_text = /*#__PURE__*/ styled(\"text\");\nexport const __yak_tspan = /*#__PURE__*/ styled(\"tspan\");\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,qBAAqB,uBAAO,KAAK;AAgEvC,SAAS,OACX,MAC4B;AAG/B,MAAI;AACJ,QAAM,sBAAqD,CAAC;AAC5D,aAAW,OAAO,MAAsD;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uBAAO,KAAK;AAC5C,IAAM,eAA6B,uBAAO,QAAQ;AAClD,IAAM,iBAA+B,uBAAO,UAAU;AACtD,IAAM,aAA2B,uBAAO,MAAM;AAC9C,IAAM,gBAA8B,uBAAO,SAAS;AACpD,IAAM,sBAAoC,uBAAO,eAAe;AAChE,IAAM,UAAwB,uBAAO,GAAG;AACxC,IAAM,cAA4B,uBAAO,OAAO;AAChD,IAAM,aAA2B,uBAAO,MAAM;AAC9C,IAAM,uBAAqC,uBAAO,gBAAgB;AAClE,IAAM,eAA6B,uBAAO,QAAQ;AAClD,IAAM,aAA2B,uBAAO,MAAM;AAC9C,IAAM,aAA2B,uBAAO,MAAM;AAC9C,IAAM,gBAA8B,uBAAO,SAAS;AACpD,IAAM,gBAA8B,uBAAO,SAAS;AACpD,IAAM,iBAA+B,uBAAO,UAAU;AACtD,IAAM,uBAAqC,uBAAO,gBAAgB;AAClE,IAAM,aAA2B,uBAAO,MAAM;AAC9C,IAAM,aAA2B,uBAAO,MAAM;AAC9C,IAAM,YAA0B,uBAAO,KAAK;AAC5C,IAAM,aAA2B,uBAAO,MAAM;AAC9C,IAAM,cAA4B,uBAAO,OAAO;","names":["styles","React","atoms","import_context"]}
1
+ {"version":3,"file":"internal.cjs","names":[],"sources":["../runtime/cssLiteral.tsx","../runtime/styled.tsx","../runtime/atoms.tsx","../runtime/keyframes.tsx","../runtime/internals/unitPostFix.ts","../runtime/internals/mergeCssProp.ts","../runtime/styledDom.tsx"],"sourcesContent":["import type { YakTheme } from \"./index.ts\";\nimport { RuntimeStyleProcessor } from \"./publicStyledApi.js\";\n\nexport const yakComponentSymbol = Symbol(\"yak\");\n\nexport type ComponentStyles<TProps> = (props: TProps) => {\n className: string;\n style?: {\n [key: string]: string;\n };\n};\n\nexport type CSSInterpolation<TProps> =\n | string\n | number\n | undefined\n | null\n | false\n | ComponentStyles<TProps>\n | {\n // type only identifier to allow targeting components\n // e.g. styled.svg`${Button}:hover & { fill: red; }`\n [yakComponentSymbol]: any;\n }\n | ((props: TProps) => CSSInterpolation<TProps>);\n\ntype CSSStyles<TProps = {}> = {\n style: { [key: string]: string | ((props: TProps) => string) };\n};\n\ntype CSSFunction = <TProps = {}>(\n styles: TemplateStringsArray,\n ...values: CSSInterpolation<TProps & { theme: YakTheme }>[]\n) => ComponentStyles<TProps>;\n\nexport type NestedRuntimeStyleProcessor = (\n props: unknown,\n classNames: Set<string>,\n style: React.CSSProperties,\n) =>\n | {\n className?: string;\n style?: React.CSSProperties;\n }\n | void\n | NestedRuntimeStyleProcessor;\n\n/**\n * css() runtime factory of css``\n *\n * /!\\ next-yak transpiles css`` and styled``\n *\n * This changes the typings of the css`` and styled`` functions.\n * During development the user of next-yak wants to work with the\n * typings BEFORE compilation.\n *\n * Therefore this is only an internal function only and it must be cast to any\n * before exported to the user.\n *\n * The internal functioning of css`` is to return a single callback function that runs all functions\n * (or creates new ones if needed) that are passed as arguments. These functions receive the props, classNames, and style object as arguments\n * and operate directly on the classNames and style objects.\n */\nexport function css<TProps>(\n styles: TemplateStringsArray,\n ...values: CSSInterpolation<NoInfer<TProps> & { theme: YakTheme }>[]\n): ComponentStyles<TProps>;\nexport function css<TProps>(...args: Array<any>): RuntimeStyleProcessor<TProps> {\n // Normally this could be an array of strings passed, but as we transpile the usage of css`` ourselves, we control the arguments\n // and ensure that only the first argument is a string (class name of the non-dynamic styles)\n let className: string | undefined;\n const dynamicCssFunctions: NestedRuntimeStyleProcessor[] = [];\n for (const arg of args as Array<string | CSSFunction | CSSStyles<any>>) {\n // A CSS-module class name which got auto generated during build from static css\n // e.g. css`color: red;`\n // compiled -> css(\"yak31e4\")\n if (typeof arg === \"string\") {\n className = arg;\n }\n // Dynamic CSS e.g.\n // css`${props => props.active && css`color: red;`}`\n // compiled -> css((props: { active: boolean }) => props.active && css(\"yak31e4\"))\n else if (typeof arg === \"function\") {\n dynamicCssFunctions.push(arg as unknown as NestedRuntimeStyleProcessor);\n }\n // Dynamic CSS with css variables e.g.\n // css`transform: translate(${props => props.x}, ${props => props.y});`\n // compiled -> css(\"yak31e4\", { style: { \"--yakVarX\": props => props.x }, \"--yakVarY\": props => props.y }})\n else if (typeof arg === \"object\" && \"style\" in arg) {\n dynamicCssFunctions.push((props, _, style) => {\n for (const key in arg.style) {\n const value = arg.style[key];\n if (typeof value === \"function\") {\n // @ts-expect-error CSSProperties don't allow css variables\n style[key] = String(\n // The value for a css value can be a theme dependent function e.g.:\n // const borderColor = (props: { theme: { mode: \"dark\" | \"light\" } }) => props.theme === \"dark\" ? \"black\" : \"white\";\n // css`border-color: ${borderColor};`\n // Therefore the value has to be extracted recursively\n recursivePropExecution(props, value),\n );\n } else {\n // @ts-expect-error CSSProperties don't allow css variables\n style[key] = String(value);\n }\n }\n });\n }\n }\n\n // Non Dynamic CSS\n // This is just an optimization for the common case where there are no dynamic css functions\n if (dynamicCssFunctions.length === 0) {\n return (_, classNames) => {\n if (className) {\n classNames.add(className);\n }\n return () => {};\n };\n }\n\n return (props, classNames, allStyles) => {\n if (className) {\n classNames.add(className);\n }\n for (let i = 0; i < dynamicCssFunctions.length; i++) {\n unwrapProps(props, dynamicCssFunctions[i], classNames, allStyles);\n }\n };\n}\n\n// Dynamic CSS with runtime logic\nconst unwrapProps = (\n props: unknown,\n fn: NestedRuntimeStyleProcessor,\n classNames: Set<string>,\n style: React.CSSProperties,\n) => {\n let result = fn(props, classNames, style);\n while (result) {\n if (typeof result === \"function\") {\n result = result(props, classNames, style);\n continue;\n } else if (typeof result === \"object\") {\n if (\"className\" in result && result.className) {\n classNames.add(result.className);\n }\n if (\"style\" in result && result.style) {\n for (const key in result.style) {\n // This is hard for typescript to infer\n style[key as keyof React.CSSProperties] = result.style[\n key as keyof React.CSSProperties\n ] as any;\n }\n }\n }\n break;\n }\n};\n\nconst recursivePropExecution = (props: unknown, fn: (props: unknown) => any): string | number => {\n const result = fn(props);\n if (typeof result === \"function\") {\n return recursivePropExecution(props, result);\n }\n if (process.env.NODE_ENV === \"development\") {\n if (typeof result !== \"string\" && typeof result !== \"number\" && !(result instanceof String)) {\n throw new Error(\n `Dynamic CSS functions must return a string or number but returned ${JSON.stringify(\n result,\n )}\\n\\nDynamic CSS function: ${fn.toString()}\\n`,\n );\n }\n }\n return result;\n};\n","import { css, CSSInterpolation, yakComponentSymbol } from \"./cssLiteral.js\";\nimport React from \"react\";\nimport type {\n Attrs,\n AttrsMerged,\n Styled,\n YakComponent,\n AttrsFunction,\n StyledFn,\n HtmlTags,\n Substitute,\n StyledLiteral,\n RuntimeStyleProcessor,\n} from \"./publicStyledApi.js\";\n\n// the following export is not relative as \"next-yak/context\"\n// links to one file for react server components and\n// to another file for classic react components\nimport { useTheme } from \"next-yak/context\";\nimport type { YakTheme } from \"./context/index.tsx\";\n\n/**\n * This Symbol is a fake theme which was used instead of the real one from the context\n * to speed up rendering\n */\nconst noTheme: YakTheme = {};\n\n//\n// The `styled()` API without `styled.` syntax\n//\n// The API design is inspired by styled-components:\n// https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/constructors/styled.tsx\n// https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/models/StyledComponent.ts\n//\nconst styledFactory: StyledFn = (Component) =>\n Object.assign(yakStyled(Component), {\n attrs: (attrs: Attrs<any>) => yakStyled(Component, attrs),\n });\n\n/**\n * The `styled` method works perfectly on all of your own or any third-party component,\n * as long as they attach the passed className prop to a DOM element.\n *\n * @usage\n *\n * ```tsx\n * const StyledLink = styled(Link)`\n * color: #BF4F74;\n * font-weight: bold;\n * `;\n * ```\n */\nexport const styled = styledFactory as Styled;\n\nconst yakStyled: StyledInternal = (Component, attrs) => {\n const isYakComponent = typeof Component !== \"string\" && yakComponentSymbol in Component;\n\n // if the component that is wrapped is a yak component, we can extract it to render the underlying component directly\n // and we can also extract the attrs function and the dynamic style function to merge it with the current attrs function (or dynamic style function)\n // so that the sequence of the attrs functions is preserved\n const [parentYakComponent, parentAttrsFn, parentRuntimeStylesFn] = isYakComponent\n ? (Component[yakComponentSymbol] as [\n YakComponent<unknown>,\n ExtractAttrsFunction<typeof attrs>,\n RuntimeStyleProcessor<unknown>,\n ])\n : [];\n\n const mergedAttrsFn = buildRuntimeAttrsProcessor(attrs, parentAttrsFn);\n\n return (styles, ...values) => {\n // combine all interpolated logic into a single function\n // e.g. styled.button`color: ${props => props.color}; margin: ${props => props.margin};`\n const runtimeStylesFn = css(\n styles,\n ...(values as CSSInterpolation<unknown>[]),\n ) as RuntimeStyleProcessor<unknown>;\n const runtimeStyleProcessor = buildRuntimeStylesProcessor(\n runtimeStylesFn,\n parentRuntimeStylesFn,\n );\n const Yak: React.FunctionComponent = (props) => {\n // if the css component does not require arguments\n // it can be called without arguments and we skip calling useTheme()\n //\n // `attrsFn || getRuntimeStyles.length` is NOT against the rule of hooks as\n // getRuntimeStyles and attrsFn are constants defined outside of the component\n //\n // for example\n //\n // const Button = styled.button`color: red;`\n // ^ does not need to have access to theme, so we skip calling useTheme()\n //\n // const Button = styled.button`${({ theme }) => css`color: ${theme.color};`}`\n // ^ must be have access to theme, so we call useTheme()\n const theme = mergedAttrsFn || runtimeStylesFn.length ? useTheme() : noTheme;\n\n // The first components which is not wrapped in a yak component will execute all attrs functions\n // starting from the innermost yak component to the outermost yak component (itself)\n const combinedProps =\n \"$__attrs\" in props\n ? ({\n theme,\n ...props,\n } as {\n theme: YakTheme;\n className?: string;\n style?: React.CSSProperties;\n })\n : // overwrite and merge the current props with the processed attrs\n combineProps(\n {\n theme,\n ...(props as {\n className?: string;\n style?: React.CSSProperties;\n }),\n // mark the props as processed\n $__attrs: true,\n },\n mergedAttrsFn?.({ theme, ...(props as any) }),\n );\n\n const classNames = new Set<string>(\n \"className\" in combinedProps ? combinedProps.className?.split(\" \") : [],\n );\n const styles = {\n ...(\"style\" in combinedProps ? combinedProps.style : {}),\n };\n\n // execute all functions inside the style literal if not already executed\n // e.g. styled.button`color: ${props => props.color};`\n if (!(\"$__runtimeStylesProcessed\" in combinedProps)) {\n runtimeStyleProcessor(combinedProps, classNames, styles);\n // @ts-expect-error this is not typed correctly\n combinedProps.$__runtimeStylesProcessed = true;\n }\n\n combinedProps.className = Array.from(classNames).join(\" \") || undefined;\n combinedProps.style = styles;\n\n // delete the yak theme from the props\n // this must happen after the runtimeStyles are calculated\n // prevents passing the theme prop to the DOM element of a styled component\n const { theme: themeAfterAttr, ...combinedPropsWithoutTheme } = combinedProps;\n const propsBeforeFiltering =\n themeAfterAttr === theme ? combinedPropsWithoutTheme : combinedProps;\n\n // remove all props that start with a $ sign for string components e.g. \"button\" or \"div\"\n // so that they are not passed to the DOM element\n const filteredProps = !isYakComponent\n ? removeNonDomProperties(propsBeforeFiltering)\n : propsBeforeFiltering;\n\n return parentYakComponent ? (\n // if the styled(Component) syntax is used and the component is a yak component\n // we can call the yak function directly without running through react createElement\n parentYakComponent(filteredProps)\n ) : (\n // if the final component is a string component e.g. styled(\"div\") or a custom non yak fn e.g. styled(MyComponent)\n <Component\n {...(filteredProps as React.ComponentProps<Exclude<typeof Component, string>>)}\n />\n );\n };\n\n // Assign the yakComponentSymbol directly without forwardRef\n return Object.assign(Yak, {\n [yakComponentSymbol]: [Yak, mergedAttrsFn, runtimeStyleProcessor] as [\n unknown,\n unknown,\n unknown,\n ],\n });\n };\n};\n\n/**\n * Remove all entries that start with a $ sign\n *\n * This allows to have props that are used for internal styling purposes\n * but are not be passed to the DOM element\n */\nconst removeNonDomProperties = <T extends Record<string, unknown>>(obj: T): T => {\n const result = {} as T;\n for (const key in obj) {\n if (!key.startsWith(\"$\") && obj[key] !== undefined) {\n result[key] = obj[key];\n }\n }\n return result;\n};\n\n// util function to merge class names, as they are concatenated with a space\nconst mergeClassNames = (a?: string, b?: string) => {\n if (!a && !b) return undefined;\n if (!a) return b;\n if (!b) return a;\n return a + \" \" + b;\n};\n\n/**\n * merge props and processed props (including class names and styles)\n * e.g.:\\\n * `{ className: \"a\", foo: 1 }` and `{ className: \"b\", bar: 2 }` \\\n * => `{ className: \"a b\", foo: 1, bar: 2 }`\n */\nconst combineProps = <\n T extends {\n className?: string;\n style?: React.CSSProperties;\n },\n TOther extends\n | {\n className?: string;\n style?: React.CSSProperties;\n }\n | null\n | undefined,\n>(\n props: T,\n newProps: TOther,\n) =>\n newProps\n ? (props.className === newProps.className || !newProps.className) &&\n (props.style === newProps.style || !newProps.style)\n ? // shortcut if no style and class merging is necessary\n {\n ...props,\n ...newProps,\n }\n : // merge class names and styles\n {\n ...props,\n ...newProps,\n className: mergeClassNames(props.className, newProps.className),\n style: { ...props.style, ...newProps.style },\n }\n : // if no new props are provided, no merging is necessary\n props;\n\n/**\n * Merges the attrs function of the current component with the attrs function of the parent component\n * in order to preserve the sequence of the attrs functions.\n * Note: In theory, the parentAttrsFn can have different types for TAttrsIn and TAttrsOut\n * but as this is only used internally, we can ignore and simplify this case\n * @param attrs The attrs object or function of the current component (if any)\n * @param parentAttrsFn The attrs function of the parent/wrapped component (if any)\n * @returns A function that receives the props and returns the transformed props\n */\nconst buildRuntimeAttrsProcessor = <\n T,\n TAttrsIn extends object,\n TAttrsOut extends AttrsMerged<T, TAttrsIn>,\n>(\n attrs?: Attrs<T, TAttrsIn, TAttrsOut>,\n parentAttrsFn?: AttrsFunction<T, TAttrsIn, TAttrsOut>,\n): AttrsFunction<T, TAttrsIn, TAttrsOut> | undefined => {\n const ownAttrsFn = attrs && (typeof attrs === \"function\" ? attrs : () => attrs);\n\n if (ownAttrsFn && parentAttrsFn) {\n return (props) => {\n const parentProps = parentAttrsFn(props);\n\n // overwrite and merge the parent props with the props received from the attrs function\n // after they went through the parent attrs function.\n //\n // This makes sure the linearity of the attrs functions is preserved and all attrs function receive\n // the whole props object calculated from the previous attrs functions\n return combineProps(parentProps, ownAttrsFn(combineProps(props, parentProps)));\n };\n }\n\n return ownAttrsFn || parentAttrsFn;\n};\n\n/**\n * Merges the runtime style function of the current component with the runtime style function of the parent component\n * in order to preserve the sequence of the attrs functions.\n * @param runtimeStylesFn The current runtime styles function\n * @param parentRuntimeStylesFn The parent runtime styles function\n * @returns The merged runtime styles function\n */\nconst buildRuntimeStylesProcessor = <T,>(\n runtimeStylesFn: RuntimeStyleProcessor<T>,\n parentRuntimeStylesFn?: RuntimeStyleProcessor<T>,\n) => {\n if (runtimeStylesFn && parentRuntimeStylesFn) {\n const combined: RuntimeStyleProcessor<T> = (props, classNames, style) => {\n parentRuntimeStylesFn(props, classNames, style);\n runtimeStylesFn(props, classNames, style);\n };\n return combined;\n }\n return runtimeStylesFn || parentRuntimeStylesFn;\n};\n\n/**\n * Internal function where attrs are passed to be processed\n */\nexport type StyledInternal = <\n T extends object,\n TAttrsIn extends object = {},\n TAttrsOut extends AttrsMerged<T, TAttrsIn> = AttrsMerged<T, TAttrsIn>,\n>(\n Component: React.FunctionComponent<T> | YakComponent<T> | HtmlTags | string,\n attrs?: Attrs<T, TAttrsIn, TAttrsOut>,\n) => StyledLiteral<Substitute<T, TAttrsIn>>;\n\n/**\n * Utility type to extract the AttrsFunction from the Attrs type\n */\nexport type ExtractAttrsFunction<T> = T extends (p: any) => any ? T : never;\n","import { ComponentStyles, css } from \"./cssLiteral.js\";\nimport { RuntimeStyleProcessor } from \"./publicStyledApi.js\";\n\n/**\n * Allows to use atomic CSS classes in a styled or css block\n *\n * @usage\n *\n * ```tsx\n * import { styled, atoms } from \"next-yak\";\n *\n * const Button = styled.button<{ $primary?: boolean }>`\n * ${atoms(\"text-teal-600\", \"text-base\", \"rounded-md\")}\n * ${props => props.$primary && atoms(\"shadow-md\")}\n * `;\n * ```\n */\nexport const atoms = <T,>(\n ...atoms: (string | RuntimeStyleProcessor<T> | false)[]\n): ComponentStyles<T> => {\n const staticClasses: string[] = [];\n const dynamicFunctions: RuntimeStyleProcessor<T>[] = [];\n\n for (const atom of atoms) {\n if (typeof atom === \"string\") {\n staticClasses.push(...atom.split(\" \"));\n } else if (typeof atom === \"function\") {\n dynamicFunctions.push(atom);\n }\n }\n\n const runtimeFunctions: RuntimeStyleProcessor<T>[] =\n staticClasses.length > 0\n ? [\n (_, classNames) => {\n staticClasses.forEach((cls) => classNames.add(cls));\n },\n ...dynamicFunctions,\n ]\n : dynamicFunctions;\n\n // @ts-expect-error the internal implementation of css is not typed\n return css(...runtimeFunctions);\n};\n","/**\n * Allows to use CSS keyframe animations in a styled or css block\n *\n * @usage\n *\n * ```tsx\n * import { styled, keyframes } from \"next-yak\";\n *\n * const rotate = keyframes`\n * from {\n * transform: rotate(0deg);\n * }\n * to {\n * transform: rotate(360deg);\n * }\n * `;\n *\n * const Spinner = styled.div`\n * animation: ${rotate} 1s linear infinite;\n * `;\n * ```\n */\nexport const keyframes = <T extends (string | number | bigint)[] = never>(\n styles: TemplateStringsArray,\n ..._dynamic: T\n): string => {\n // during compilation all args of keyframe are compiled\n // to a string which references the animation name\n return styles as any as string;\n};\n","/**\n * Internal helper called by transformed code - Do not use directly\n *\n * Takes a function and a css unit and returns the result of the function concatenated with the unit\n *\n * ```tsx\n * import { styled } from \"next-yak\";\n *\n * const Button = styled.button<{ $width?: boolean }>`\n * width: ${({ $width }) => $width}px;\n * `;\n * ```\n *\n * Which will be transformed to:\n * ```tsx\n * import { styled } from \"next-yak/internals\";\n *\n * const Button = styled.button<{ $width?: boolean }>(\n * \"button\", {\n * width: unitPostFix({ $width }) => $width, \"px\")\n * });\n */\nexport const unitPostFix = (arg: unknown, unit: string) => {\n switch (typeof arg) {\n case \"function\":\n return (props: any) => unitPostFix(arg(props), unit);\n case \"number\":\n case \"string\":\n return `${arg}${unit}`;\n // Ignore falsy values\n default:\n return undefined;\n }\n};\n","import { RuntimeStyleProcessor } from \"../publicStyledApi.js\";\n\n/**\n * This is an internal helper function to merge relevant props of a native element with a css prop.\n * It's automatically added when using the `css` prop in a JSX element.\n * e.g.:\n * ```tsx\n * <p\n * className=\"foo\"\n * css={css`\n * color: green;\n * `}\n * {...{ style: { padding: \"30px\" }}}\n * />\n */\nexport const mergeCssProp = (\n relevantProps: {\n className?: string;\n style?: Record<string, string>;\n } & Record<string, unknown>,\n cssProp: RuntimeStyleProcessor<unknown>,\n) => {\n const existingClassName = relevantProps.className;\n const classNames = existingClassName ? new Set(existingClassName.split(\" \")) : new Set<string>();\n\n const existingStyle = relevantProps.style;\n const style = existingStyle ? { ...existingStyle } : {};\n\n cssProp({}, classNames, style);\n\n const result: { className?: string; style?: Record<string, string> } = {};\n\n if (Object.keys(style).length > 0) {\n result.style = style;\n }\n if (classNames.size > 0) {\n result.className = Array.from(classNames).join(\" \");\n }\n\n return result;\n};\n","import { styled } from \"./styled.js\";\n/// Internal API to create styled components\n/// Optimization for faster rendering and smaller bundle size in production\n/// thanks to better minification and dead code elimination\n///\n/// List taken from https://github.com/styled-components/styled-components/blob/e0019ba666fab4b5aaa2bff71ba6ad0005a299fd/packages/styled-components/src/utils/domElements.ts#L90\nexport const __yak_a = /*#__PURE__*/ styled(\"a\");\nexport const __yak_abbr = /*#__PURE__*/ styled(\"abbr\");\nexport const __yak_address = /*#__PURE__*/ styled(\"address\");\nexport const __yak_area = /*#__PURE__*/ styled(\"area\");\nexport const __yak_article = /*#__PURE__*/ styled(\"article\");\nexport const __yak_aside = /*#__PURE__*/ styled(\"aside\");\nexport const __yak_audio = /*#__PURE__*/ styled(\"audio\");\nexport const __yak_b = /*#__PURE__*/ styled(\"b\");\nexport const __yak_base = /*#__PURE__*/ styled(\"base\");\nexport const __yak_bdi = /*#__PURE__*/ styled(\"bdi\");\nexport const __yak_bdo = /*#__PURE__*/ styled(\"bdo\");\nexport const __yak_big = /*#__PURE__*/ styled(\"big\");\nexport const __yak_blockquote = /*#__PURE__*/ styled(\"blockquote\");\nexport const __yak_body = /*#__PURE__*/ styled(\"body\");\nexport const __yak_br = /*#__PURE__*/ styled(\"br\");\nexport const __yak_button = /*#__PURE__*/ styled(\"button\");\nexport const __yak_canvas = /*#__PURE__*/ styled(\"canvas\");\nexport const __yak_caption = /*#__PURE__*/ styled(\"caption\");\nexport const __yak_cite = /*#__PURE__*/ styled(\"cite\");\nexport const __yak_code = /*#__PURE__*/ styled(\"code\");\nexport const __yak_col = /*#__PURE__*/ styled(\"col\");\nexport const __yak_colgroup = /*#__PURE__*/ styled(\"colgroup\");\nexport const __yak_data = /*#__PURE__*/ styled(\"data\");\nexport const __yak_datalist = /*#__PURE__*/ styled(\"datalist\");\nexport const __yak_dd = /*#__PURE__*/ styled(\"dd\");\nexport const __yak_del = /*#__PURE__*/ styled(\"del\");\nexport const __yak_details = /*#__PURE__*/ styled(\"details\");\nexport const __yak_dfn = /*#__PURE__*/ styled(\"dfn\");\nexport const __yak_dialog = /*#__PURE__*/ styled(\"dialog\");\nexport const __yak_div = /*#__PURE__*/ styled(\"div\");\nexport const __yak_dl = /*#__PURE__*/ styled(\"dl\");\nexport const __yak_dt = /*#__PURE__*/ styled(\"dt\");\nexport const __yak_em = /*#__PURE__*/ styled(\"em\");\nexport const __yak_embed = /*#__PURE__*/ styled(\"embed\");\nexport const __yak_fieldset = /*#__PURE__*/ styled(\"fieldset\");\nexport const __yak_figcaption = /*#__PURE__*/ styled(\"figcaption\");\nexport const __yak_figure = /*#__PURE__*/ styled(\"figure\");\nexport const __yak_footer = /*#__PURE__*/ styled(\"footer\");\nexport const __yak_form = /*#__PURE__*/ styled(\"form\");\nexport const __yak_h1 = /*#__PURE__*/ styled(\"h1\");\nexport const __yak_h2 = /*#__PURE__*/ styled(\"h2\");\nexport const __yak_h3 = /*#__PURE__*/ styled(\"h3\");\nexport const __yak_h4 = /*#__PURE__*/ styled(\"h4\");\nexport const __yak_h5 = /*#__PURE__*/ styled(\"h5\");\nexport const __yak_h6 = /*#__PURE__*/ styled(\"h6\");\nexport const __yak_header = /*#__PURE__*/ styled(\"header\");\nexport const __yak_hgroup = /*#__PURE__*/ styled(\"hgroup\");\nexport const __yak_hr = /*#__PURE__*/ styled(\"hr\");\nexport const __yak_html = /*#__PURE__*/ styled(\"html\");\nexport const __yak_i = /*#__PURE__*/ styled(\"i\");\nexport const __yak_iframe = /*#__PURE__*/ styled(\"iframe\");\nexport const __yak_img = /*#__PURE__*/ styled(\"img\");\nexport const __yak_input = /*#__PURE__*/ styled(\"input\");\nexport const __yak_ins = /*#__PURE__*/ styled(\"ins\");\nexport const __yak_kbd = /*#__PURE__*/ styled(\"kbd\");\nexport const __yak_keygen = /*#__PURE__*/ styled(\"keygen\");\nexport const __yak_label = /*#__PURE__*/ styled(\"label\");\nexport const __yak_legend = /*#__PURE__*/ styled(\"legend\");\nexport const __yak_li = /*#__PURE__*/ styled(\"li\");\nexport const __yak_link = /*#__PURE__*/ styled(\"link\");\nexport const __yak_main = /*#__PURE__*/ styled(\"main\");\nexport const __yak_map = /*#__PURE__*/ styled(\"map\");\nexport const __yak_mark = /*#__PURE__*/ styled(\"mark\");\nexport const __yak_menu = /*#__PURE__*/ styled(\"menu\");\nexport const __yak_menuitem = /*#__PURE__*/ styled(\"menuitem\");\nexport const __yak_meta = /*#__PURE__*/ styled(\"meta\");\nexport const __yak_meter = /*#__PURE__*/ styled(\"meter\");\nexport const __yak_nav = /*#__PURE__*/ styled(\"nav\");\nexport const __yak_noscript = /*#__PURE__*/ styled(\"noscript\");\nexport const __yak_object = /*#__PURE__*/ styled(\"object\");\nexport const __yak_ol = /*#__PURE__*/ styled(\"ol\");\nexport const __yak_optgroup = /*#__PURE__*/ styled(\"optgroup\");\nexport const __yak_option = /*#__PURE__*/ styled(\"option\");\nexport const __yak_output = /*#__PURE__*/ styled(\"output\");\nexport const __yak_p = /*#__PURE__*/ styled(\"p\");\nexport const __yak_param = /*#__PURE__*/ styled(\"param\");\nexport const __yak_picture = /*#__PURE__*/ styled(\"picture\");\nexport const __yak_pre = /*#__PURE__*/ styled(\"pre\");\nexport const __yak_progress = /*#__PURE__*/ styled(\"progress\");\nexport const __yak_q = /*#__PURE__*/ styled(\"q\");\nexport const __yak_rp = /*#__PURE__*/ styled(\"rp\");\nexport const __yak_rt = /*#__PURE__*/ styled(\"rt\");\nexport const __yak_ruby = /*#__PURE__*/ styled(\"ruby\");\nexport const __yak_s = /*#__PURE__*/ styled(\"s\");\nexport const __yak_samp = /*#__PURE__*/ styled(\"samp\");\nexport const __yak_script = /*#__PURE__*/ styled(\"script\");\nexport const __yak_section = /*#__PURE__*/ styled(\"section\");\nexport const __yak_select = /*#__PURE__*/ styled(\"select\");\nexport const __yak_small = /*#__PURE__*/ styled(\"small\");\nexport const __yak_source = /*#__PURE__*/ styled(\"source\");\nexport const __yak_span = /*#__PURE__*/ styled(\"span\");\nexport const __yak_strong = /*#__PURE__*/ styled(\"strong\");\nexport const __yak_style = /*#__PURE__*/ styled(\"style\");\nexport const __yak_sub = /*#__PURE__*/ styled(\"sub\");\nexport const __yak_summary = /*#__PURE__*/ styled(\"summary\");\nexport const __yak_sup = /*#__PURE__*/ styled(\"sup\");\nexport const __yak_table = /*#__PURE__*/ styled(\"table\");\nexport const __yak_tbody = /*#__PURE__*/ styled(\"tbody\");\nexport const __yak_td = /*#__PURE__*/ styled(\"td\");\nexport const __yak_textarea = /*#__PURE__*/ styled(\"textarea\");\nexport const __yak_tfoot = /*#__PURE__*/ styled(\"tfoot\");\nexport const __yak_th = /*#__PURE__*/ styled(\"th\");\nexport const __yak_thead = /*#__PURE__*/ styled(\"thead\");\nexport const __yak_time = /*#__PURE__*/ styled(\"time\");\nexport const __yak_tr = /*#__PURE__*/ styled(\"tr\");\nexport const __yak_track = /*#__PURE__*/ styled(\"track\");\nexport const __yak_u = /*#__PURE__*/ styled(\"u\");\nexport const __yak_ul = /*#__PURE__*/ styled(\"ul\");\nexport const __yak_use = /*#__PURE__*/ styled(\"use\");\nexport const __yak_var = /*#__PURE__*/ styled(\"var\");\nexport const __yak_video = /*#__PURE__*/ styled(\"video\");\nexport const __yak_wbr = /*#__PURE__*/ styled(\"wbr\");\nexport const __yak_circle = /*#__PURE__*/ styled(\"circle\");\nexport const __yak_clipPath = /*#__PURE__*/ styled(\"clipPath\");\nexport const __yak_defs = /*#__PURE__*/ styled(\"defs\");\nexport const __yak_ellipse = /*#__PURE__*/ styled(\"ellipse\");\nexport const __yak_foreignObject = /*#__PURE__*/ styled(\"foreignObject\");\nexport const __yak_g = /*#__PURE__*/ styled(\"g\");\nexport const __yak_image = /*#__PURE__*/ styled(\"image\");\nexport const __yak_line = /*#__PURE__*/ styled(\"line\");\nexport const __yak_linearGradient = /*#__PURE__*/ styled(\"linearGradient\");\nexport const __yak_marker = /*#__PURE__*/ styled(\"marker\");\nexport const __yak_mask = /*#__PURE__*/ styled(\"mask\");\nexport const __yak_path = /*#__PURE__*/ styled(\"path\");\nexport const __yak_pattern = /*#__PURE__*/ styled(\"pattern\");\nexport const __yak_polygon = /*#__PURE__*/ styled(\"polygon\");\nexport const __yak_polyline = /*#__PURE__*/ styled(\"polyline\");\nexport const __yak_radialGradient = /*#__PURE__*/ styled(\"radialGradient\");\nexport const __yak_rect = /*#__PURE__*/ styled(\"rect\");\nexport const __yak_stop = /*#__PURE__*/ styled(\"stop\");\nexport const __yak_svg = /*#__PURE__*/ styled(\"svg\");\nexport const __yak_text = /*#__PURE__*/ styled(\"text\");\nexport const __yak_tspan = /*#__PURE__*/ styled(\"tspan\");\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAa,qBAAqB,OAAO,MAAM;AAgE/C,SAAgB,IAAY,GAAG,MAAiD;CAG9E,IAAI;CACJ,MAAM,sBAAqD,EAAE;AAC7D,MAAK,MAAM,OAAO,KAIhB,KAAI,OAAO,QAAQ,SACjB,aAAY;UAKL,OAAO,QAAQ,WACtB,qBAAoB,KAAK,IAA8C;UAKhE,OAAO,QAAQ,YAAY,WAAW,IAC7C,qBAAoB,MAAM,OAAO,GAAG,UAAU;AAC5C,OAAK,MAAM,OAAO,IAAI,OAAO;GAC3B,MAAM,QAAQ,IAAI,MAAM;AACxB,OAAI,OAAO,UAAU,WAEnB,OAAM,OAAO,OAKX,uBAAuB,OAAO,MAAM,CACrC;OAGD,OAAM,OAAO,OAAO,MAAM;;GAG9B;AAMN,KAAI,oBAAoB,WAAW,EACjC,SAAQ,GAAG,eAAe;AACxB,MAAI,UACF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AO,OAAO;AACtD,MAAa,YAA0B,uBAAO,MAAM;AACpD,MAAa,aAA2B,uBAAO,OAAO;AACtD,MAAa,cAA4B,uBAAO,QAAQ"}
@@ -0,0 +1,368 @@
1
+ import { YakThemeProvider, useTheme } from "next-yak/context";
2
+ import * as _$react from "react";
3
+ import React$1 from "react";
4
+
5
+ //#region runtime/context/index.d.ts
6
+ interface YakTheme {}
7
+ //#endregion
8
+ //#region runtime/publicStyledApi.d.ts
9
+ /**
10
+ * Main styled interface that combines HTML tag mappings with the styled function.
11
+ * This is the primary entry point for creating styled components.
12
+ */
13
+ interface Styled extends MappedHtmlTags, StyledFn {}
14
+ /**
15
+ * Function interface for creating styled components from any component or HTML tag.
16
+ * Supports React components, HTML tags, and custom web components.
17
+ */
18
+ interface StyledFn {
19
+ <TProps extends object = React$1.DOMAttributes<Element> & React$1.RefAttributes<Element>>(Component: HtmlTags | React$1.FunctionComponent<TProps> | CustomWebComponentTag): LiteralWithAttrs<TProps>;
20
+ }
21
+ /**
22
+ * A yak component with a special symbol that allows component targeting
23
+ * and proper attrs function handling.
24
+ * @example styled.svg`${Button}:hover & { fill: red; }` or styled(Button)`color: red;`
25
+ */
26
+ interface YakComponent<T> extends React$1.FunctionComponent<T> {
27
+ [yakComponentSymbol]: [unknown, unknown, unknown];
28
+ }
29
+ /**
30
+ * Styled component with attrs method for adding default props.
31
+ * Extends StyledLiteral with the ability to specify default attributes.
32
+ */
33
+ interface LiteralWithAttrs<T extends object> extends StyledLiteral<T> {
34
+ attrs: <TAttrsIn extends object = {}, TAttrsOut extends AttrsMerged<T, TAttrsIn> = AttrsMerged<T, TAttrsIn>>(attrs: Attrs<T, TAttrsIn, TAttrsOut>) => StyledLiteral<Substitute<T, TAttrsIn>>;
35
+ }
36
+ /**
37
+ * Template literal function for defining CSS styles with interpolation support.
38
+ * Accepts CSS template strings and interpolated values with proper typing.
39
+ */
40
+ interface StyledLiteral<T> {
41
+ <TCSSProps>(styles: TemplateStringsArray, ...values: Array<CSSInterpolation<T & NoInfer<TCSSProps> & {
42
+ theme: YakTheme;
43
+ }>>): YakComponent<TCSSProps & T>;
44
+ }
45
+ /**
46
+ * Function variant of attrs that receives current props and returns additional props.
47
+ * Allows for dynamic prop generation based on component state.
48
+ */
49
+ interface AttrsFunction<TBaseProps, TIn extends object = {}, TOut extends AttrsMerged<TBaseProps, TIn> = AttrsMerged<TBaseProps, TIn>> {
50
+ (p: Substitute<TBaseProps & {
51
+ theme: YakTheme;
52
+ }, TIn>): Partial<TOut>;
53
+ }
54
+ /**
55
+ * Merges provided props with initial props, making specified props optional.
56
+ * Includes theme support for styled components.
57
+ */
58
+ type AttrsMerged<TBaseProps, TIn extends object = {}> = Substitute<TBaseProps & {
59
+ theme?: YakTheme;
60
+ }, TIn>;
61
+ /**
62
+ * Maps all HTML tag names to their corresponding styled component types with attributes support.
63
+ * Provides typed access to all standard HTML elements through the styled interface.
64
+ */
65
+ type MappedHtmlTags = { [Tag in HtmlTags]: LiteralWithAttrs<React$1.JSX.IntrinsicElements[Tag]> };
66
+ /**
67
+ * The attrs function allows adding additional props to a styled component.
68
+ * Props can be specified as an object or as a function that receives current props.
69
+ */
70
+ type Attrs<TBaseProps, TIn extends object = {}, TOut extends AttrsMerged<TBaseProps, TIn> = AttrsMerged<TBaseProps, TIn>> = Partial<TOut> | AttrsFunction<TBaseProps, TIn, TOut>;
71
+ /**
72
+ * Utility type to merge two object types, with properties from B taking precedence.
73
+ * If a property exists in both A and B, the property from B is used.
74
+ */
75
+ type Substitute<A extends object, B extends object> = FastOmit<A, keyof B> & B;
76
+ /**
77
+ * Union type of all valid HTML element tag names.
78
+ * Derived from React's JSX intrinsic elements.
79
+ */
80
+ type HtmlTags = keyof React$1.JSX.IntrinsicElements;
81
+ /**
82
+ * Custom web component tag pattern that must contain at least one hyphen.
83
+ * Follows the web component naming convention.
84
+ */
85
+ type CustomWebComponentTag = `${string}-${string}`;
86
+ /**
87
+ * Utility type to efficiently remove properties from an object type.
88
+ * More performant than the built-in Omit type for large object types.
89
+ */
90
+ type FastOmit<T extends object, U extends string | number | symbol> = { [K in keyof T as K extends U ? never : K]: T[K] };
91
+ /**
92
+ * Type of all functions that can be passed to manipulate styles
93
+ */
94
+ type RuntimeStyleProcessor<T> = (props: T, classNames: Set<string>, style: React$1.CSSProperties) => void;
95
+ //#endregion
96
+ //#region runtime/atoms.d.ts
97
+ /**
98
+ * Allows to use atomic CSS classes in a styled or css block
99
+ *
100
+ * @usage
101
+ *
102
+ * ```tsx
103
+ * import { styled, atoms } from "next-yak";
104
+ *
105
+ * const Button = styled.button<{ $primary?: boolean }>`
106
+ * ${atoms("text-teal-600", "text-base", "rounded-md")}
107
+ * ${props => props.$primary && atoms("shadow-md")}
108
+ * `;
109
+ * ```
110
+ */
111
+ declare const atoms: <T>(...atoms: (string | RuntimeStyleProcessor<T> | false)[]) => ComponentStyles<T>;
112
+ //#endregion
113
+ //#region runtime/keyframes.d.ts
114
+ /**
115
+ * Allows to use CSS keyframe animations in a styled or css block
116
+ *
117
+ * @usage
118
+ *
119
+ * ```tsx
120
+ * import { styled, keyframes } from "next-yak";
121
+ *
122
+ * const rotate = keyframes`
123
+ * from {
124
+ * transform: rotate(0deg);
125
+ * }
126
+ * to {
127
+ * transform: rotate(360deg);
128
+ * }
129
+ * `;
130
+ *
131
+ * const Spinner = styled.div`
132
+ * animation: ${rotate} 1s linear infinite;
133
+ * `;
134
+ * ```
135
+ */
136
+ declare const keyframes: <T extends (string | number | bigint)[] = never>(styles: TemplateStringsArray, ..._dynamic: T) => string;
137
+ //#endregion
138
+ //#region runtime/styled.d.ts
139
+ /**
140
+ * The `styled` method works perfectly on all of your own or any third-party component,
141
+ * as long as they attach the passed className prop to a DOM element.
142
+ *
143
+ * @usage
144
+ *
145
+ * ```tsx
146
+ * const StyledLink = styled(Link)`
147
+ * color: #BF4F74;
148
+ * font-weight: bold;
149
+ * `;
150
+ * ```
151
+ */
152
+ declare const styled: Styled;
153
+ //#endregion
154
+ //#region runtime/cssLiteral.d.ts
155
+ declare const yakComponentSymbol: unique symbol;
156
+ type ComponentStyles<TProps> = (props: TProps) => {
157
+ className: string;
158
+ style?: {
159
+ [key: string]: string;
160
+ };
161
+ };
162
+ type CSSInterpolation<TProps> = string | number | undefined | null | false | ComponentStyles<TProps> | {
163
+ [yakComponentSymbol]: any;
164
+ } | ((props: TProps) => CSSInterpolation<TProps>);
165
+ /**
166
+ * css() runtime factory of css``
167
+ *
168
+ * /!\ next-yak transpiles css`` and styled``
169
+ *
170
+ * This changes the typings of the css`` and styled`` functions.
171
+ * During development the user of next-yak wants to work with the
172
+ * typings BEFORE compilation.
173
+ *
174
+ * Therefore this is only an internal function only and it must be cast to any
175
+ * before exported to the user.
176
+ *
177
+ * The internal functioning of css`` is to return a single callback function that runs all functions
178
+ * (or creates new ones if needed) that are passed as arguments. These functions receive the props, classNames, and style object as arguments
179
+ * and operate directly on the classNames and style objects.
180
+ */
181
+ declare function css<TProps>(styles: TemplateStringsArray, ...values: CSSInterpolation<NoInfer<TProps> & {
182
+ theme: YakTheme;
183
+ }>[]): ComponentStyles<TProps>;
184
+ //#endregion
185
+ //#region runtime/internals/unitPostFix.d.ts
186
+ /**
187
+ * Internal helper called by transformed code - Do not use directly
188
+ *
189
+ * Takes a function and a css unit and returns the result of the function concatenated with the unit
190
+ *
191
+ * ```tsx
192
+ * import { styled } from "next-yak";
193
+ *
194
+ * const Button = styled.button<{ $width?: boolean }>`
195
+ * width: ${({ $width }) => $width}px;
196
+ * `;
197
+ * ```
198
+ *
199
+ * Which will be transformed to:
200
+ * ```tsx
201
+ * import { styled } from "next-yak/internals";
202
+ *
203
+ * const Button = styled.button<{ $width?: boolean }>(
204
+ * "button", {
205
+ * width: unitPostFix({ $width }) => $width, "px")
206
+ * });
207
+ */
208
+ declare const unitPostFix: (arg: unknown, unit: string) => string | ((props: any) => string | /*elided*/any | undefined) | undefined;
209
+ //#endregion
210
+ //#region runtime/internals/mergeCssProp.d.ts
211
+ /**
212
+ * This is an internal helper function to merge relevant props of a native element with a css prop.
213
+ * It's automatically added when using the `css` prop in a JSX element.
214
+ * e.g.:
215
+ * ```tsx
216
+ * <p
217
+ * className="foo"
218
+ * css={css`
219
+ * color: green;
220
+ * `}
221
+ * {...{ style: { padding: "30px" }}}
222
+ * />
223
+ */
224
+ declare const mergeCssProp: (relevantProps: {
225
+ className?: string;
226
+ style?: Record<string, string>;
227
+ } & Record<string, unknown>, cssProp: RuntimeStyleProcessor<unknown>) => {
228
+ className?: string;
229
+ style?: Record<string, string>;
230
+ };
231
+ //#endregion
232
+ //#region runtime/styledDom.d.ts
233
+ declare const __yak_a: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
234
+ declare const __yak_abbr: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
235
+ declare const __yak_address: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
236
+ declare const __yak_area: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
237
+ declare const __yak_article: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
238
+ declare const __yak_aside: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
239
+ declare const __yak_audio: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
240
+ declare const __yak_b: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
241
+ declare const __yak_base: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
242
+ declare const __yak_bdi: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
243
+ declare const __yak_bdo: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
244
+ declare const __yak_big: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
245
+ declare const __yak_blockquote: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
246
+ declare const __yak_body: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
247
+ declare const __yak_br: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
248
+ declare const __yak_button: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
249
+ declare const __yak_canvas: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
250
+ declare const __yak_caption: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
251
+ declare const __yak_cite: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
252
+ declare const __yak_code: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
253
+ declare const __yak_col: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
254
+ declare const __yak_colgroup: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
255
+ declare const __yak_data: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
256
+ declare const __yak_datalist: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
257
+ declare const __yak_dd: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
258
+ declare const __yak_del: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
259
+ declare const __yak_details: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
260
+ declare const __yak_dfn: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
261
+ declare const __yak_dialog: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
262
+ declare const __yak_div: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
263
+ declare const __yak_dl: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
264
+ declare const __yak_dt: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
265
+ declare const __yak_em: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
266
+ declare const __yak_embed: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
267
+ declare const __yak_fieldset: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
268
+ declare const __yak_figcaption: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
269
+ declare const __yak_figure: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
270
+ declare const __yak_footer: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
271
+ declare const __yak_form: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
272
+ declare const __yak_h1: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
273
+ declare const __yak_h2: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
274
+ declare const __yak_h3: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
275
+ declare const __yak_h4: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
276
+ declare const __yak_h5: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
277
+ declare const __yak_h6: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
278
+ declare const __yak_header: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
279
+ declare const __yak_hgroup: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
280
+ declare const __yak_hr: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
281
+ declare const __yak_html: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
282
+ declare const __yak_i: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
283
+ declare const __yak_iframe: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
284
+ declare const __yak_img: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
285
+ declare const __yak_input: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
286
+ declare const __yak_ins: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
287
+ declare const __yak_kbd: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
288
+ declare const __yak_keygen: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
289
+ declare const __yak_label: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
290
+ declare const __yak_legend: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
291
+ declare const __yak_li: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
292
+ declare const __yak_link: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
293
+ declare const __yak_main: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
294
+ declare const __yak_map: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
295
+ declare const __yak_mark: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
296
+ declare const __yak_menu: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
297
+ declare const __yak_menuitem: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
298
+ declare const __yak_meta: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
299
+ declare const __yak_meter: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
300
+ declare const __yak_nav: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
301
+ declare const __yak_noscript: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
302
+ declare const __yak_object: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
303
+ declare const __yak_ol: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
304
+ declare const __yak_optgroup: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
305
+ declare const __yak_option: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
306
+ declare const __yak_output: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
307
+ declare const __yak_p: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
308
+ declare const __yak_param: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
309
+ declare const __yak_picture: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
310
+ declare const __yak_pre: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
311
+ declare const __yak_progress: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
312
+ declare const __yak_q: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
313
+ declare const __yak_rp: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
314
+ declare const __yak_rt: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
315
+ declare const __yak_ruby: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
316
+ declare const __yak_s: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
317
+ declare const __yak_samp: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
318
+ declare const __yak_script: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
319
+ declare const __yak_section: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
320
+ declare const __yak_select: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
321
+ declare const __yak_small: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
322
+ declare const __yak_source: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
323
+ declare const __yak_span: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
324
+ declare const __yak_strong: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
325
+ declare const __yak_style: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
326
+ declare const __yak_sub: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
327
+ declare const __yak_summary: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
328
+ declare const __yak_sup: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
329
+ declare const __yak_table: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
330
+ declare const __yak_tbody: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
331
+ declare const __yak_td: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
332
+ declare const __yak_textarea: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
333
+ declare const __yak_tfoot: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
334
+ declare const __yak_th: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
335
+ declare const __yak_thead: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
336
+ declare const __yak_time: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
337
+ declare const __yak_tr: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
338
+ declare const __yak_track: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
339
+ declare const __yak_u: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
340
+ declare const __yak_ul: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
341
+ declare const __yak_use: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
342
+ declare const __yak_var: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
343
+ declare const __yak_video: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
344
+ declare const __yak_wbr: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
345
+ declare const __yak_circle: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
346
+ declare const __yak_clipPath: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
347
+ declare const __yak_defs: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
348
+ declare const __yak_ellipse: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
349
+ declare const __yak_foreignObject: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
350
+ declare const __yak_g: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
351
+ declare const __yak_image: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
352
+ declare const __yak_line: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
353
+ declare const __yak_linearGradient: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
354
+ declare const __yak_marker: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
355
+ declare const __yak_mask: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
356
+ declare const __yak_path: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
357
+ declare const __yak_pattern: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
358
+ declare const __yak_polygon: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
359
+ declare const __yak_polyline: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
360
+ declare const __yak_radialGradient: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
361
+ declare const __yak_rect: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
362
+ declare const __yak_stop: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
363
+ declare const __yak_svg: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
364
+ declare const __yak_text: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
365
+ declare const __yak_tspan: LiteralWithAttrs<_$react.DOMAttributes<Element> & _$react.RefAttributes<Element>>;
366
+ //#endregion
367
+ export { YakThemeProvider, __yak_a, __yak_abbr, __yak_address, __yak_area, __yak_article, __yak_aside, __yak_audio, __yak_b, __yak_base, __yak_bdi, __yak_bdo, __yak_big, __yak_blockquote, __yak_body, __yak_br, __yak_button, __yak_canvas, __yak_caption, __yak_circle, __yak_cite, __yak_clipPath, __yak_code, __yak_col, __yak_colgroup, __yak_data, __yak_datalist, __yak_dd, __yak_defs, __yak_del, __yak_details, __yak_dfn, __yak_dialog, __yak_div, __yak_dl, __yak_dt, __yak_ellipse, __yak_em, __yak_embed, __yak_fieldset, __yak_figcaption, __yak_figure, __yak_footer, __yak_foreignObject, __yak_form, __yak_g, __yak_h1, __yak_h2, __yak_h3, __yak_h4, __yak_h5, __yak_h6, __yak_header, __yak_hgroup, __yak_hr, __yak_html, __yak_i, __yak_iframe, __yak_image, __yak_img, __yak_input, __yak_ins, __yak_kbd, __yak_keygen, __yak_label, __yak_legend, __yak_li, __yak_line, __yak_linearGradient, __yak_link, __yak_main, __yak_map, __yak_mark, __yak_marker, __yak_mask, __yak_menu, __yak_menuitem, mergeCssProp as __yak_mergeCssProp, __yak_meta, __yak_meter, __yak_nav, __yak_noscript, __yak_object, __yak_ol, __yak_optgroup, __yak_option, __yak_output, __yak_p, __yak_param, __yak_path, __yak_pattern, __yak_picture, __yak_polygon, __yak_polyline, __yak_pre, __yak_progress, __yak_q, __yak_radialGradient, __yak_rect, __yak_rp, __yak_rt, __yak_ruby, __yak_s, __yak_samp, __yak_script, __yak_section, __yak_select, __yak_small, __yak_source, __yak_span, __yak_stop, __yak_strong, __yak_style, __yak_sub, __yak_summary, __yak_sup, __yak_svg, __yak_table, __yak_tbody, __yak_td, __yak_text, __yak_textarea, __yak_tfoot, __yak_th, __yak_thead, __yak_time, __yak_tr, __yak_track, __yak_tspan, __yak_u, __yak_ul, unitPostFix as __yak_unitPostFix, __yak_use, __yak_var, __yak_video, __yak_wbr, atoms, css, keyframes, styled, useTheme };
368
+ //# sourceMappingURL=internal.d.cts.map