@typestyles/react 0.3.1 → 0.3.3

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 (64) hide show
  1. package/README.md +1 -1
  2. package/dist/babel-plugin.cjs +14223 -152
  3. package/dist/babel-plugin.cjs.map +1 -1
  4. package/dist/babel-plugin.d.cts +10 -10
  5. package/dist/babel-plugin.d.cts.map +1 -0
  6. package/dist/babel-plugin.d.ts +10 -10
  7. package/dist/babel-plugin.d.ts.map +1 -0
  8. package/dist/babel-plugin.js +14223 -130
  9. package/dist/babel-plugin.js.map +1 -1
  10. package/dist/css-prop-DMDmFKhu.js +21 -0
  11. package/dist/css-prop-DMDmFKhu.js.map +1 -0
  12. package/dist/css-prop-DOMoNwJN.cjs +38 -0
  13. package/dist/css-prop-DOMoNwJN.cjs.map +1 -0
  14. package/dist/{css-prop-runtime-DHYMbbZm.d.ts → css-prop-runtime-zKybLO8E.d.cts} +7 -5
  15. package/dist/css-prop-runtime-zKybLO8E.d.cts.map +1 -0
  16. package/dist/{css-prop-runtime-DHYMbbZm.d.cts → css-prop-runtime-zKybLO8E.d.ts} +7 -5
  17. package/dist/css-prop-runtime-zKybLO8E.d.ts.map +1 -0
  18. package/dist/css-prop-runtime.cjs +6 -14
  19. package/dist/css-prop-runtime.cjs.map +1 -1
  20. package/dist/css-prop-runtime.d.cts +2 -2
  21. package/dist/css-prop-runtime.d.ts +2 -2
  22. package/dist/css-prop-runtime.js +8 -3
  23. package/dist/css-prop-runtime.js.map +1 -1
  24. package/dist/index.cjs +72 -110
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +23 -23
  27. package/dist/index.d.cts.map +1 -0
  28. package/dist/index.d.ts +23 -23
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +66 -78
  31. package/dist/index.js.map +1 -1
  32. package/dist/jsx-dev-runtime.cjs +19 -45
  33. package/dist/jsx-dev-runtime.cjs.map +1 -1
  34. package/dist/jsx-dev-runtime.d.cts +9 -11
  35. package/dist/jsx-dev-runtime.d.cts.map +1 -0
  36. package/dist/jsx-dev-runtime.d.ts +9 -11
  37. package/dist/jsx-dev-runtime.d.ts.map +1 -0
  38. package/dist/jsx-dev-runtime.js +18 -25
  39. package/dist/jsx-dev-runtime.js.map +1 -1
  40. package/dist/jsx-runtime.cjs +22 -48
  41. package/dist/jsx-runtime.cjs.map +1 -1
  42. package/dist/jsx-runtime.d.cts +10 -12
  43. package/dist/jsx-runtime.d.cts.map +1 -0
  44. package/dist/jsx-runtime.d.ts +10 -12
  45. package/dist/jsx-runtime.d.ts.map +1 -0
  46. package/dist/jsx-runtime.js +19 -27
  47. package/dist/jsx-runtime.js.map +1 -1
  48. package/dist/resolve-hash-class-DuqLJq6S.cjs +14 -0
  49. package/dist/resolve-hash-class-DuqLJq6S.cjs.map +1 -0
  50. package/dist/resolve-hash-class-Rs_7aMMQ.js +9 -0
  51. package/dist/resolve-hash-class-Rs_7aMMQ.js.map +1 -0
  52. package/dist/types-DcDsqg2q.d.cts +10 -0
  53. package/dist/types-DcDsqg2q.d.cts.map +1 -0
  54. package/dist/types-DcDsqg2q.d.ts +10 -0
  55. package/dist/types-DcDsqg2q.d.ts.map +1 -0
  56. package/package.json +8 -10
  57. package/dist/chunk-IHZMLPG2.js +0 -22
  58. package/dist/chunk-IHZMLPG2.js.map +0 -1
  59. package/dist/chunk-KM65VQPZ.js +0 -11
  60. package/dist/chunk-KM65VQPZ.js.map +0 -1
  61. package/dist/chunk-TLEOUPD2.js +0 -10
  62. package/dist/chunk-TLEOUPD2.js.map +0 -1
  63. package/dist/types-_vEO6H8X.d.cts +0 -9
  64. package/dist/types-_vEO6H8X.d.ts +0 -9
package/dist/index.js CHANGED
@@ -1,91 +1,79 @@
1
- export { TypeStylesContext, TypeStylesProvider, resolveCssPropClass } from './chunk-IHZMLPG2.js';
2
- export { cssProp } from './chunk-TLEOUPD2.js';
3
- export { resolveHashClass } from './chunk-KM65VQPZ.js';
4
- import { forwardRef } from 'react';
5
- import { cx } from 'typestyles';
6
- import { jsx } from 'react/jsx-runtime';
7
-
8
- // src/split-props.ts
9
- var RESERVED_CONFIG_KEYS = /* @__PURE__ */ new Set([
10
- "base",
11
- "variants",
12
- "compoundVariants",
13
- "defaultVariants",
14
- "slots"
1
+ import { n as TypeStylesContext, r as TypeStylesProvider, t as resolveCssPropClass } from "./css-prop-DMDmFKhu.js";
2
+ import { t as resolveHashClass } from "./resolve-hash-class-Rs_7aMMQ.js";
3
+ import { cssProp } from "./css-prop-runtime.js";
4
+ import { forwardRef } from "react";
5
+ import { cx } from "typestyles";
6
+ import { jsx } from "react/jsx-runtime";
7
+ //#region src/split-props.ts
8
+ const RESERVED_CONFIG_KEYS = new Set([
9
+ "base",
10
+ "variants",
11
+ "compoundVariants",
12
+ "defaultVariants",
13
+ "slots"
15
14
  ]);
16
15
  function splitVariantProps(props, variantKeys) {
17
- const variants = {};
18
- const rest = { ...props };
19
- for (const key of variantKeys) {
20
- if (key in rest) {
21
- variants[key] = rest[key];
22
- delete rest[key];
23
- }
24
- }
25
- delete rest.className;
26
- delete rest.css;
27
- return {
28
- variants,
29
- rest
30
- };
16
+ const variants = {};
17
+ const rest = { ...props };
18
+ for (const key of variantKeys) if (key in rest) {
19
+ variants[key] = rest[key];
20
+ delete rest[key];
21
+ }
22
+ delete rest.className;
23
+ delete rest.css;
24
+ return {
25
+ variants,
26
+ rest
27
+ };
31
28
  }
32
29
  function getVariantKeysFromConfig(config) {
33
- if (typeof config === "function") {
34
- return [];
35
- }
36
- if ("variants" in config && config.variants && typeof config.variants === "object") {
37
- return Object.keys(config.variants);
38
- }
39
- return Object.keys(config).filter((key) => !RESERVED_CONFIG_KEYS.has(key));
30
+ if (typeof config === "function") return [];
31
+ if ("variants" in config && config.variants && typeof config.variants === "object") return Object.keys(config.variants);
32
+ return Object.keys(config).filter((key) => !RESERVED_CONFIG_KEYS.has(key));
40
33
  }
34
+ //#endregion
35
+ //#region src/create-styled.tsx
41
36
  function resolveRecipeFactory(api) {
42
- if ("recipe" in api) return api.recipe;
43
- return api.component;
37
+ if ("recipe" in api) return api.recipe;
38
+ return api.component;
44
39
  }
45
40
  function resolveStyledArgs(tag, configOrNamespace, maybeConfig) {
46
- if (typeof configOrNamespace === "string" && maybeConfig != null) {
47
- return { tag, namespace: configOrNamespace, config: maybeConfig };
48
- }
49
- const namespace = typeof tag === "string" ? tag : "styled";
50
- return {
51
- tag,
52
- namespace,
53
- config: configOrNamespace
54
- };
41
+ if (typeof configOrNamespace === "string" && maybeConfig != null) return {
42
+ tag,
43
+ namespace: configOrNamespace,
44
+ config: maybeConfig
45
+ };
46
+ return {
47
+ tag,
48
+ namespace: typeof tag === "string" ? tag : "styled",
49
+ config: configOrNamespace
50
+ };
55
51
  }
56
52
  function createStyled(api) {
57
- const makeRecipe = resolveRecipeFactory(api);
58
- function styled(tag, configOrNamespace, maybeConfig) {
59
- const {
60
- tag: element,
61
- namespace,
62
- config
63
- } = resolveStyledArgs(tag, configOrNamespace, maybeConfig);
64
- const recipe = makeRecipe({
65
- name: namespace,
66
- styles: config
67
- });
68
- const variantKeys = getVariantKeysFromConfig(
69
- config
70
- );
71
- const Component = forwardRef(
72
- function StyledComponent(props, ref) {
73
- const { className, ...propsWithoutClassName } = props;
74
- const { variants, rest } = splitVariantProps(
75
- propsWithoutClassName,
76
- variantKeys
77
- );
78
- const mergedClassName = cx(recipe(variants), className);
79
- const Element = element;
80
- return /* @__PURE__ */ jsx(Element, { ...rest, ref, className: mergedClassName });
81
- }
82
- );
83
- Component.displayName = namespace.charAt(0).toUpperCase() + namespace.slice(1);
84
- return Component;
85
- }
86
- return styled;
53
+ const makeRecipe = resolveRecipeFactory(api);
54
+ function styled(tag, configOrNamespace, maybeConfig) {
55
+ const { tag: element, namespace, config } = resolveStyledArgs(tag, configOrNamespace, maybeConfig);
56
+ const recipe = makeRecipe({
57
+ name: namespace,
58
+ styles: config
59
+ });
60
+ const variantKeys = getVariantKeysFromConfig(config);
61
+ const Component = forwardRef(function StyledComponent(props, ref) {
62
+ const { className, ...propsWithoutClassName } = props;
63
+ const { variants, rest } = splitVariantProps(propsWithoutClassName, variantKeys);
64
+ const mergedClassName = cx(recipe(variants), className);
65
+ return jsx(element, {
66
+ ...rest,
67
+ ref,
68
+ className: mergedClassName
69
+ });
70
+ });
71
+ Component.displayName = namespace.charAt(0).toUpperCase() + namespace.slice(1);
72
+ return Component;
73
+ }
74
+ return styled;
87
75
  }
76
+ //#endregion
77
+ export { TypeStylesContext, TypeStylesProvider, createStyled, cssProp, resolveCssPropClass, resolveHashClass };
88
78
 
89
- export { createStyled };
90
- //# sourceMappingURL=index.js.map
91
79
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/split-props.ts","../src/create-styled.tsx"],"names":[],"mappings":";;;;;;;;AAAA,IAAM,oBAAA,uBAA2B,GAAA,CAAI;AAAA,EACnC,MAAA;AAAA,EACA,UAAA;AAAA,EACA,kBAAA;AAAA,EACA,iBAAA;AAAA,EACA;AACF,CAAC,CAAA;AAEM,SAAS,iBAAA,CACd,OACA,WAAA,EAIA;AACA,EAAA,MAAM,WAAoC,EAAC;AAC3C,EAAA,MAAM,IAAA,GAAO,EAAE,GAAG,KAAA,EAAM;AAExB,EAAA,KAAA,MAAW,OAAO,WAAA,EAAa;AAC7B,IAAA,IAAI,OAAO,IAAA,EAAM;AACf,MAAA,QAAA,CAAS,GAAG,CAAA,GAAI,IAAA,CAAK,GAAG,CAAA;AACxB,MAAA,OAAO,KAAK,GAAG,CAAA;AAAA,IACjB;AAAA,EACF;AAEA,EAAA,OAAO,IAAA,CAAK,SAAA;AACZ,EAAA,OAAO,IAAA,CAAK,GAAA;AAEZ,EAAA,OAAO;AAAA,IACL,QAAA;AAAA,IACA;AAAA,GACF;AACF;AAEO,SAAS,yBACd,MAAA,EACmB;AACnB,EAAA,IAAI,OAAO,WAAW,UAAA,EAAY;AAChC,IAAA,OAAO,EAAC;AAAA,EACV;AAEA,EAAA,IAAI,cAAc,MAAA,IAAU,MAAA,CAAO,YAAY,OAAO,MAAA,CAAO,aAAa,QAAA,EAAU;AAClF,IAAA,OAAO,MAAA,CAAO,IAAA,CAAK,MAAA,CAAO,QAAQ,CAAA;AAAA,EACpC;AAEA,EAAA,OAAO,MAAA,CAAO,IAAA,CAAK,MAAM,CAAA,CAAE,MAAA,CAAO,CAAC,GAAA,KAAQ,CAAC,oBAAA,CAAqB,GAAA,CAAI,GAAG,CAAC,CAAA;AAC3E;ACIA,SAAS,qBAAqB,GAAA,EAA+B;AAC3D,EAAA,IAAI,QAAA,IAAY,GAAA,EAAK,OAAO,GAAA,CAAI,MAAA;AAChC,EAAA,OAAO,GAAA,CAAI,SAAA;AACb;AAEA,SAAS,iBAAA,CACP,GAAA,EACA,iBAAA,EAIA,WAAA,EAKA;AACA,EAAA,IAAI,OAAO,iBAAA,KAAsB,QAAA,IAAY,WAAA,IAAe,IAAA,EAAM;AAChE,IAAA,OAAO,EAAE,GAAA,EAAK,SAAA,EAAW,iBAAA,EAAmB,QAAQ,WAAA,EAAY;AAAA,EAClE;AAEA,EAAA,MAAM,SAAA,GAAY,OAAO,GAAA,KAAQ,QAAA,GAAW,GAAA,GAAM,QAAA;AAClD,EAAA,OAAO;AAAA,IACL,GAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA,EAAQ;AAAA,GAGV;AACF;AAEO,SAAS,aAAa,GAAA,EAA+B;AAC1D,EAAA,MAAM,UAAA,GAAa,qBAAqB,GAAG,CAAA;AAE3C,EAAA,SAAS,MAAA,CACP,GAAA,EACA,iBAAA,EAIA,WAAA,EACA;AACA,IAAA,MAAM;AAAA,MACJ,GAAA,EAAK,OAAA;AAAA,MACL,SAAA;AAAA,MACA;AAAA,KACF,GAAI,iBAAA,CAAkB,GAAA,EAAK,iBAAA,EAAmB,WAAW,CAAA;AAGzD,IAAA,MAAM,SACJ,UAAA,CAIA;AAAA,MACA,IAAA,EAAM,SAAA;AAAA,MACN,MAAA,EAAQ;AAAA,KACT,CAAA;AACD,IAAA,MAAM,WAAA,GAAc,wBAAA;AAAA,MAClB;AAAA,KACF;AAEA,IAAA,MAAM,SAAA,GAAY,UAAA;AAAA,MAChB,SAAS,eAAA,CAAgB,KAAA,EAAO,GAAA,EAAK;AACnC,QAAA,MAAM,EAAE,SAAA,EAAW,GAAG,qBAAA,EAAsB,GAAI,KAAA;AAChD,QAAA,MAAM,EAAE,QAAA,EAAU,IAAA,EAAK,GAAI,iBAAA;AAAA,UACzB,qBAAA;AAAA,UACA;AAAA,SACF;AACA,QAAA,MAAM,eAAA,GAAkB,EAAA,CAAG,MAAA,CAAO,QAAQ,GAAG,SAAS,CAAA;AACtD,QAAA,MAAM,OAAA,GAAU,OAAA;AAEhB,QAAA,2BAAQ,OAAA,EAAA,EAAS,GAAG,IAAA,EAAM,GAAA,EAAU,WAAW,eAAA,EAAiB,CAAA;AAAA,MAClE;AAAA,KACF;AAEA,IAAA,SAAA,CAAU,WAAA,GAAc,UAAU,MAAA,CAAO,CAAC,EAAE,WAAA,EAAY,GAAI,SAAA,CAAU,KAAA,CAAM,CAAC,CAAA;AAE7E,IAAA,OAAO,SAAA;AAAA,EACT;AAEA,EAAA,OAAO,MAAA;AACT","file":"index.js","sourcesContent":["const RESERVED_CONFIG_KEYS = new Set([\n 'base',\n 'variants',\n 'compoundVariants',\n 'defaultVariants',\n 'slots',\n]);\n\nexport function splitVariantProps<P extends Record<string, unknown>>(\n props: P,\n variantKeys: readonly string[],\n): {\n variants: Record<string, unknown>;\n rest: Omit<P, (typeof variantKeys)[number] | 'className' | 'css'>;\n} {\n const variants: Record<string, unknown> = {};\n const rest = { ...props } as Record<string, unknown>;\n\n for (const key of variantKeys) {\n if (key in rest) {\n variants[key] = rest[key];\n delete rest[key];\n }\n }\n\n delete rest.className;\n delete rest.css;\n\n return {\n variants,\n rest: rest as Omit<P, (typeof variantKeys)[number] | 'className' | 'css'>,\n };\n}\n\nexport function getVariantKeysFromConfig(\n config: Record<string, unknown> | ((ctx: unknown) => Record<string, unknown>),\n): readonly string[] {\n if (typeof config === 'function') {\n return [];\n }\n\n if ('variants' in config && config.variants && typeof config.variants === 'object') {\n return Object.keys(config.variants);\n }\n\n return Object.keys(config).filter((key) => !RESERVED_CONFIG_KEYS.has(key));\n}\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementType,\n type ForwardRefExoticComponent,\n type RefAttributes,\n} from 'react';\nimport type {\n ComponentConfigInput,\n ComponentReturn,\n ComponentVariants,\n FlatComponentConfigInput,\n FlatComponentReturn,\n StylesApi,\n TypeStylesApi,\n VariantDefinitions,\n} from 'typestyles';\nimport { cx } from 'typestyles';\nimport { getVariantKeysFromConfig, splitVariantProps } from './split-props';\n\ntype StyledComponentType<Tag extends ElementType, Recipe> = ForwardRefExoticComponent<\n ComponentPropsWithoutRef<Tag> & ComponentVariants<Recipe> & RefAttributes<Element>\n>;\n\nexport type StyledFactory = {\n <Tag extends ElementType, const V extends VariantDefinitions>(\n tag: Tag,\n config: ComponentConfigInput<V>,\n ): StyledComponentType<Tag, ComponentReturn<V>>;\n <Tag extends ElementType, const V extends VariantDefinitions, const N extends string>(\n tag: Tag,\n namespace: N,\n config: ComponentConfigInput<V>,\n ): StyledComponentType<Tag, ComponentReturn<V>>;\n <Tag extends ElementType, const K extends string>(\n tag: Tag,\n config: FlatComponentConfigInput<K>,\n ): StyledComponentType<Tag, FlatComponentReturn<K>>;\n <Tag extends ElementType, const K extends string, const N extends string>(\n tag: Tag,\n namespace: N,\n config: FlatComponentConfigInput<K>,\n ): StyledComponentType<Tag, FlatComponentReturn<K>>;\n};\n\ntype RecipeFactory = StylesApi['component'];\n\n/** Accepts `createTypeStyles()` (preferred) or a lower-level `createStyles()` instance. */\nexport type StyledApi = Pick<TypeStylesApi, 'recipe'> | StylesApi;\n\nfunction resolveRecipeFactory(api: StyledApi): RecipeFactory {\n if ('recipe' in api) return api.recipe;\n return api.component;\n}\n\nfunction resolveStyledArgs(\n tag: ElementType,\n configOrNamespace:\n | string\n | ComponentConfigInput<VariantDefinitions>\n | FlatComponentConfigInput<string>,\n maybeConfig?: ComponentConfigInput<VariantDefinitions> | FlatComponentConfigInput<string>,\n): {\n tag: ElementType;\n namespace: string;\n config: ComponentConfigInput<VariantDefinitions> | FlatComponentConfigInput<string>;\n} {\n if (typeof configOrNamespace === 'string' && maybeConfig != null) {\n return { tag, namespace: configOrNamespace, config: maybeConfig };\n }\n\n const namespace = typeof tag === 'string' ? tag : 'styled';\n return {\n tag,\n namespace,\n config: configOrNamespace as\n | ComponentConfigInput<VariantDefinitions>\n | FlatComponentConfigInput<string>,\n };\n}\n\nexport function createStyled(api: StyledApi): StyledFactory {\n const makeRecipe = resolveRecipeFactory(api);\n\n function styled<Tag extends ElementType>(\n tag: Tag,\n configOrNamespace:\n | string\n | ComponentConfigInput<VariantDefinitions>\n | FlatComponentConfigInput<string>,\n maybeConfig?: ComponentConfigInput<VariantDefinitions> | FlatComponentConfigInput<string>,\n ) {\n const {\n tag: element,\n namespace,\n config,\n } = resolveStyledArgs(tag, configOrNamespace, maybeConfig);\n // `styled` still takes the legacy config object (`base`, `variants`, flat keys).\n // The engine accepts that shape as `styles`; axes stay on `recipe()` itself.\n const recipe = (\n makeRecipe as (input: {\n name: string;\n styles: unknown;\n }) => (selections?: Record<string, unknown>) => { toString(): string }\n )({\n name: namespace,\n styles: config,\n });\n const variantKeys = getVariantKeysFromConfig(\n config as Record<string, unknown> | ((ctx: unknown) => Record<string, unknown>),\n );\n\n const Component = forwardRef<Element, ComponentPropsWithoutRef<Tag> & Record<string, unknown>>(\n function StyledComponent(props, ref) {\n const { className, ...propsWithoutClassName } = props;\n const { variants, rest } = splitVariantProps(\n propsWithoutClassName as Record<string, unknown>,\n variantKeys,\n );\n const mergedClassName = cx(recipe(variants), className);\n const Element = element;\n\n return <Element {...rest} ref={ref} className={mergedClassName} />;\n },\n );\n\n Component.displayName = namespace.charAt(0).toUpperCase() + namespace.slice(1);\n\n return Component;\n }\n\n return styled as StyledFactory;\n}\n"]}
1
+ {"version":3,"file":"index.js","names":["Element"],"sources":["../src/split-props.ts","../src/create-styled.tsx"],"sourcesContent":["const RESERVED_CONFIG_KEYS = new Set([\n 'base',\n 'variants',\n 'compoundVariants',\n 'defaultVariants',\n 'slots',\n]);\n\nexport function splitVariantProps<P extends Record<string, unknown>>(\n props: P,\n variantKeys: readonly string[],\n): {\n variants: Record<string, unknown>;\n rest: Omit<P, (typeof variantKeys)[number] | 'className' | 'css'>;\n} {\n const variants: Record<string, unknown> = {};\n const rest = { ...props } as Record<string, unknown>;\n\n for (const key of variantKeys) {\n if (key in rest) {\n variants[key] = rest[key];\n delete rest[key];\n }\n }\n\n delete rest.className;\n delete rest.css;\n\n return {\n variants,\n rest: rest as Omit<P, (typeof variantKeys)[number] | 'className' | 'css'>,\n };\n}\n\nexport function getVariantKeysFromConfig(\n config: Record<string, unknown> | ((ctx: unknown) => Record<string, unknown>),\n): readonly string[] {\n if (typeof config === 'function') {\n return [];\n }\n\n if ('variants' in config && config.variants && typeof config.variants === 'object') {\n return Object.keys(config.variants);\n }\n\n return Object.keys(config).filter((key) => !RESERVED_CONFIG_KEYS.has(key));\n}\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementType,\n type ForwardRefExoticComponent,\n type RefAttributes,\n} from 'react';\nimport type {\n ComponentConfigInput,\n ComponentReturn,\n ComponentVariants,\n FlatComponentConfigInput,\n FlatComponentReturn,\n StylesApi,\n TypeStylesApi,\n VariantDefinitions,\n} from 'typestyles';\nimport { cx } from 'typestyles';\nimport { getVariantKeysFromConfig, splitVariantProps } from './split-props';\n\ntype StyledComponentType<Tag extends ElementType, Recipe> = ForwardRefExoticComponent<\n ComponentPropsWithoutRef<Tag> & ComponentVariants<Recipe> & RefAttributes<Element>\n>;\n\nexport type StyledFactory = {\n <Tag extends ElementType, const V extends VariantDefinitions>(\n tag: Tag,\n config: ComponentConfigInput<V>,\n ): StyledComponentType<Tag, ComponentReturn<V>>;\n <Tag extends ElementType, const V extends VariantDefinitions, const N extends string>(\n tag: Tag,\n namespace: N,\n config: ComponentConfigInput<V>,\n ): StyledComponentType<Tag, ComponentReturn<V>>;\n <Tag extends ElementType, const K extends string>(\n tag: Tag,\n config: FlatComponentConfigInput<K>,\n ): StyledComponentType<Tag, FlatComponentReturn<K>>;\n <Tag extends ElementType, const K extends string, const N extends string>(\n tag: Tag,\n namespace: N,\n config: FlatComponentConfigInput<K>,\n ): StyledComponentType<Tag, FlatComponentReturn<K>>;\n};\n\ntype RecipeFactory = StylesApi['component'];\n\n/** Accepts `createTypeStyles()` (preferred) or a lower-level `createStyles()` instance. */\nexport type StyledApi = Pick<TypeStylesApi, 'recipe'> | StylesApi;\n\nfunction resolveRecipeFactory(api: StyledApi): RecipeFactory {\n if ('recipe' in api) return api.recipe;\n return api.component;\n}\n\nfunction resolveStyledArgs(\n tag: ElementType,\n configOrNamespace:\n | string\n | ComponentConfigInput<VariantDefinitions>\n | FlatComponentConfigInput<string>,\n maybeConfig?: ComponentConfigInput<VariantDefinitions> | FlatComponentConfigInput<string>,\n): {\n tag: ElementType;\n namespace: string;\n config: ComponentConfigInput<VariantDefinitions> | FlatComponentConfigInput<string>;\n} {\n if (typeof configOrNamespace === 'string' && maybeConfig != null) {\n return { tag, namespace: configOrNamespace, config: maybeConfig };\n }\n\n const namespace = typeof tag === 'string' ? tag : 'styled';\n return {\n tag,\n namespace,\n config: configOrNamespace as\n | ComponentConfigInput<VariantDefinitions>\n | FlatComponentConfigInput<string>,\n };\n}\n\nexport function createStyled(api: StyledApi): StyledFactory {\n const makeRecipe = resolveRecipeFactory(api);\n\n function styled<Tag extends ElementType>(\n tag: Tag,\n configOrNamespace:\n | string\n | ComponentConfigInput<VariantDefinitions>\n | FlatComponentConfigInput<string>,\n maybeConfig?: ComponentConfigInput<VariantDefinitions> | FlatComponentConfigInput<string>,\n ) {\n const {\n tag: element,\n namespace,\n config,\n } = resolveStyledArgs(tag, configOrNamespace, maybeConfig);\n // `styled` still takes the legacy config object (`base`, `variants`, flat keys).\n // The engine accepts that shape as `styles`; axes stay on `recipe()` itself.\n const recipe = (\n makeRecipe as (input: {\n name: string;\n styles: unknown;\n }) => (selections?: Record<string, unknown>) => { toString(): string }\n )({\n name: namespace,\n styles: config,\n });\n const variantKeys = getVariantKeysFromConfig(\n config as Record<string, unknown> | ((ctx: unknown) => Record<string, unknown>),\n );\n\n const Component = forwardRef<Element, ComponentPropsWithoutRef<Tag> & Record<string, unknown>>(\n function StyledComponent(props, ref) {\n const { className, ...propsWithoutClassName } = props;\n const { variants, rest } = splitVariantProps(\n propsWithoutClassName as Record<string, unknown>,\n variantKeys,\n );\n const mergedClassName = cx(recipe(variants), className);\n const Element = element;\n\n return <Element {...rest} ref={ref} className={mergedClassName} />;\n },\n );\n\n Component.displayName = namespace.charAt(0).toUpperCase() + namespace.slice(1);\n\n return Component;\n }\n\n return styled as StyledFactory;\n}\n"],"mappings":";;;;;;;AAAA,MAAM,uBAAuB,IAAI,IAAI;CACnC;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAgB,kBACd,OACA,aAIA;CACA,MAAM,WAAoC,CAAC;CAC3C,MAAM,OAAO,EAAE,GAAG,MAAM;CAExB,KAAK,MAAM,OAAO,aAChB,IAAI,OAAO,MAAM;EACf,SAAS,OAAO,KAAK;EACrB,OAAO,KAAK;CACd;CAGF,OAAO,KAAK;CACZ,OAAO,KAAK;CAEZ,OAAO;EACL;EACM;CACR;AACF;AAEA,SAAgB,yBACd,QACmB;CACnB,IAAI,OAAO,WAAW,YACpB,OAAO,CAAC;CAGV,IAAI,cAAc,UAAU,OAAO,YAAY,OAAO,OAAO,aAAa,UACxE,OAAO,OAAO,KAAK,OAAO,QAAQ;CAGpC,OAAO,OAAO,KAAK,MAAM,CAAC,CAAC,QAAQ,QAAQ,CAAC,qBAAqB,IAAI,GAAG,CAAC;AAC3E;;;ACIA,SAAS,qBAAqB,KAA+B;CAC3D,IAAI,YAAY,KAAK,OAAO,IAAI;CAChC,OAAO,IAAI;AACb;AAEA,SAAS,kBACP,KACA,mBAIA,aAKA;CACA,IAAI,OAAO,sBAAsB,YAAY,eAAe,MAC1D,OAAO;EAAE;EAAK,WAAW;EAAmB,QAAQ;CAAY;CAIlE,OAAO;EACL;EACA,WAHgB,OAAO,QAAQ,WAAW,MAAM;EAIhD,QAAQ;CAGV;AACF;AAEA,SAAgB,aAAa,KAA+B;CAC1D,MAAM,aAAa,qBAAqB,GAAG;CAE3C,SAAS,OACP,KACA,mBAIA,aACA;EACA,MAAM,EACJ,KAAK,SACL,WACA,WACE,kBAAkB,KAAK,mBAAmB,WAAW;EAGzD,MAAM,SACJ,WAIA;GACA,MAAM;GACN,QAAQ;EACV,CAAC;EACD,MAAM,cAAc,yBAClB,MACF;EAEA,MAAM,YAAY,WAChB,SAAS,gBAAgB,OAAO,KAAK;GACnC,MAAM,EAAE,WAAW,GAAG,0BAA0B;GAChD,MAAM,EAAE,UAAU,SAAS,kBACzB,uBACA,WACF;GACA,MAAM,kBAAkB,GAAG,OAAO,QAAQ,GAAG,SAAS;GAGtD,OAAO,IAACA,SAAD;IAAS,GAAI;IAAW;IAAK,WAAW;GAAkB,CAAA;EACnE,CACF;EAEA,UAAU,cAAc,UAAU,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,UAAU,MAAM,CAAC;EAE7E,OAAO;CACT;CAEA,OAAO;AACT"}
@@ -1,52 +1,26 @@
1
- 'use strict';
2
-
3
- var react = require('react');
4
- var jsxDevRuntime = require('react/jsx-dev-runtime');
5
- var typestyles = require('typestyles');
6
- require('react/jsx-runtime');
7
-
8
- // src/jsx-dev-runtime.ts
9
- function resolveCssPropClass(hashClass, css, className) {
10
- if (css && typeof css === "object") {
11
- return typestyles.cx(hashClass(css), className);
12
- }
13
- return typestyles.cx(className);
14
- }
15
- var TypeStylesContext = react.createContext(null);
16
-
17
- // src/resolve-hash-class.ts
18
- function resolveHashClass(api) {
19
- if ("hash" in api && typeof api.hash === "function") {
20
- return (properties, label) => api.hash(properties, { label });
21
- }
22
- return api.hashClass;
23
- }
24
-
25
- // src/jsx-dev-runtime.ts
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_css_prop = require("./css-prop-DOMoNwJN.cjs");
3
+ const require_resolve_hash_class = require("./resolve-hash-class-DuqLJq6S.cjs");
4
+ let react = require("react");
5
+ let react_jsx_dev_runtime = require("react/jsx-dev-runtime");
6
+ //#region src/jsx-dev-runtime.ts
26
7
  function processCssProp(props, hashClass) {
27
- if (props.css == null) {
28
- return props;
29
- }
30
- const { css, className, ...rest } = props;
31
- const nextProps = {
32
- ...rest,
33
- className: resolveCssPropClass(hashClass, css, className)
34
- };
35
- return nextProps;
8
+ if (props.css == null) return props;
9
+ const { css, className, ...rest } = props;
10
+ return {
11
+ ...rest,
12
+ className: require_css_prop.resolveCssPropClass(hashClass, css, className)
13
+ };
36
14
  }
37
- var Fragment = jsxDevRuntime.Fragment;
15
+ const Fragment = react_jsx_dev_runtime.Fragment;
38
16
  function jsxDEV(type, props, key, isStaticChildren, source, self) {
39
- const styles = react.useContext(TypeStylesContext);
40
- if (props.css != null && styles == null) {
41
- throw new Error(
42
- "[@typestyles/react] The `css` prop requires a `TypeStylesProvider` with a styles instance. Wrap your app in `<TypeStylesProvider styles={api}>` (from `createTypeStyles()`), or use the Babel plugin for zero-runtime css props."
43
- );
44
- }
45
- const nextProps = styles ? processCssProp(props, resolveHashClass(styles)) : props;
46
- return jsxDevRuntime.jsxDEV(type, nextProps, key, isStaticChildren, source, self);
17
+ const styles = (0, react.useContext)(require_css_prop.TypeStylesContext);
18
+ if (props.css != null && styles == null) throw new Error("[@typestyles/react] The `css` prop requires a `TypeStylesProvider` with a styles instance. Wrap your app in `<TypeStylesProvider styles={api}>` (from `createTypeStyles()`), or use the Babel plugin for zero-runtime css props.");
19
+ const nextProps = styles ? processCssProp(props, require_resolve_hash_class.resolveHashClass(styles)) : props;
20
+ return (0, react_jsx_dev_runtime.jsxDEV)(type, nextProps, key, isStaticChildren, source, self);
47
21
  }
48
-
22
+ //#endregion
49
23
  exports.Fragment = Fragment;
50
24
  exports.jsxDEV = jsxDEV;
51
- //# sourceMappingURL=jsx-dev-runtime.cjs.map
25
+
52
26
  //# sourceMappingURL=jsx-dev-runtime.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/css-prop.ts","../src/context.tsx","../src/resolve-hash-class.ts","../src/jsx-dev-runtime.ts"],"names":["cx","createContext","ReactFragment","useContext","reactJsxDEV"],"mappings":";;;;;;;;AAIO,SAAS,mBAAA,CACd,SAAA,EACA,GAAA,EACA,SAAA,EACQ;AACR,EAAA,IAAI,GAAA,IAAO,OAAO,GAAA,KAAQ,QAAA,EAAU;AAClC,IAAA,OAAOA,aAAA,CAAG,SAAA,CAAU,GAAG,CAAA,EAAG,SAAS,CAAA;AAAA,EACrC;AACA,EAAA,OAAOA,cAAG,SAAS,CAAA;AACrB;ACVO,IAAM,iBAAA,GAAoBC,oBAAoC,IAAI,CAAA;;;ACKlE,SAAS,iBAAiB,GAAA,EAAiC;AAChE,EAAA,IAAI,MAAA,IAAU,GAAA,IAAO,OAAO,GAAA,CAAI,SAAS,UAAA,EAAY;AACnD,IAAA,OAAO,CAAC,YAAY,KAAA,KAAU,GAAA,CAAI,KAAK,UAAA,EAAY,EAAE,OAAO,CAAA;AAAA,EAC9D;AACA,EAAA,OAAQ,GAAA,CAAkB,SAAA;AAC5B;;;ACLA,SAAS,cAAA,CACP,OACA,SAAA,EACG;AACH,EAAA,IAAI,KAAA,CAAM,OAAO,IAAA,EAAM;AACrB,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,MAAM,EAAE,GAAA,EAAK,SAAA,EAAW,GAAG,MAAK,GAAI,KAAA;AACpC,EAAA,MAAM,SAAA,GAAY;AAAA,IAChB,GAAG,IAAA;AAAA,IACH,SAAA,EAAW,mBAAA,CAAoB,SAAA,EAAW,GAAA,EAAK,SAAS;AAAA,GAC1D;AAEA,EAAA,OAAO,SAAA;AACT;AAEO,IAAM,QAAA,GAAWC;AAEjB,SAAS,OACd,IAAA,EACA,KAAA,EACA,GAAA,EACA,gBAAA,EACA,QACA,IAAA,EACoB;AACpB,EAAA,MAAM,MAAA,GAASC,iBAAW,iBAAiB,CAAA;AAE3C,EAAA,IAAI,KAAA,CAAM,GAAA,IAAO,IAAA,IAAQ,MAAA,IAAU,IAAA,EAAM;AACvC,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KAEF;AAAA,EACF;AAEA,EAAA,MAAM,YAAY,MAAA,GAAS,cAAA,CAAe,OAAO,gBAAA,CAAiB,MAAM,CAAC,CAAA,GAAK,KAAA;AAC9E,EAAA,OAAOC,qBAAY,IAAA,EAAM,SAAA,EAAW,GAAA,EAAK,gBAAA,EAAkB,QAAQ,IAAI,CAAA;AACzE","file":"jsx-dev-runtime.cjs","sourcesContent":["import type { CSSProperties } from 'typestyles';\nimport { cx } from 'typestyles';\nimport type { CssPropValue } from './types';\n\nexport function resolveCssPropClass(\n hashClass: (properties: CSSProperties, label?: string) => string,\n css: CssPropValue | undefined,\n className?: string,\n): string {\n if (css && typeof css === 'object') {\n return cx(hashClass(css), className);\n }\n return cx(className);\n}\n","import { createContext, type ReactNode } from 'react';\nimport type { CssStylesHost } from './resolve-hash-class';\n\nexport const TypeStylesContext = createContext<CssStylesHost | null>(null);\n\nexport function TypeStylesProvider({\n styles,\n children,\n}: {\n /** Prefer a `createTypeStyles()` result; `createStyles()` instances also work. */\n styles: CssStylesHost;\n children: ReactNode;\n}): React.JSX.Element {\n return <TypeStylesContext.Provider value={styles}>{children}</TypeStylesContext.Provider>;\n}\n","import type { CSSProperties, StylesApi, TypeStylesApi } from 'typestyles';\n\n/** Styles host for the css prop / TypeStylesProvider. */\nexport type CssStylesHost = Pick<TypeStylesApi, 'hash'> | StylesApi;\n\nexport type HashClassFn = (properties: CSSProperties, label?: string) => string;\n\n/** Normalize `hash` (createTypeStyles) and `hashClass` (createStyles). */\nexport function resolveHashClass(api: CssStylesHost): HashClassFn {\n if ('hash' in api && typeof api.hash === 'function') {\n return (properties, label) => api.hash(properties, { label });\n }\n return (api as StylesApi).hashClass;\n}\n","import { useContext, type ElementType, type ReactNode } from 'react';\nimport { jsxDEV as reactJsxDEV, Fragment as ReactFragment } from 'react/jsx-dev-runtime';\nimport type { CSSProperties } from 'typestyles';\nimport { resolveCssPropClass } from './css-prop';\nimport { TypeStylesContext } from './context';\nimport { resolveHashClass } from './resolve-hash-class';\nimport type { WithCssProp } from './types';\n\nfunction processCssProp<P extends Record<string, unknown>>(\n props: WithCssProp<P>,\n hashClass: (properties: CSSProperties, label?: string) => string,\n): P {\n if (props.css == null) {\n return props as P;\n }\n\n const { css, className, ...rest } = props;\n const nextProps = {\n ...rest,\n className: resolveCssPropClass(hashClass, css, className),\n } as unknown as P;\n\n return nextProps;\n}\n\nexport const Fragment = ReactFragment;\n\nexport function jsxDEV<P extends Record<string, unknown>>(\n type: ElementType,\n props: WithCssProp<P>,\n key: React.Key | undefined,\n isStaticChildren: boolean,\n source: object | undefined,\n self: unknown,\n): React.ReactElement {\n const styles = useContext(TypeStylesContext);\n\n if (props.css != null && styles == null) {\n throw new Error(\n '[@typestyles/react] The `css` prop requires a `TypeStylesProvider` with a styles instance. ' +\n 'Wrap your app in `<TypeStylesProvider styles={api}>` (from `createTypeStyles()`), or use the Babel plugin for zero-runtime css props.',\n );\n }\n\n const nextProps = styles ? processCssProp(props, resolveHashClass(styles)) : (props as P);\n return reactJsxDEV(type, nextProps, key, isStaticChildren, source, self);\n}\n\nexport type { ReactNode };\n"]}
1
+ {"version":3,"file":"jsx-dev-runtime.cjs","names":["resolveCssPropClass","ReactFragment","useContext","TypeStylesContext","resolveHashClass","reactJsxDEV"],"sources":["../src/jsx-dev-runtime.ts"],"sourcesContent":["import { useContext, type ElementType, type ReactNode } from 'react';\nimport { jsxDEV as reactJsxDEV, Fragment as ReactFragment } from 'react/jsx-dev-runtime';\nimport type { CSSProperties } from 'typestyles';\nimport { resolveCssPropClass } from './css-prop';\nimport { TypeStylesContext } from './context';\nimport { resolveHashClass } from './resolve-hash-class';\nimport type { WithCssProp } from './types';\n\nfunction processCssProp<P extends Record<string, unknown>>(\n props: WithCssProp<P>,\n hashClass: (properties: CSSProperties, label?: string) => string,\n): P {\n if (props.css == null) {\n return props as P;\n }\n\n const { css, className, ...rest } = props;\n const nextProps = {\n ...rest,\n className: resolveCssPropClass(hashClass, css, className),\n } as unknown as P;\n\n return nextProps;\n}\n\nexport const Fragment = ReactFragment;\n\nexport function jsxDEV<P extends Record<string, unknown>>(\n type: ElementType,\n props: WithCssProp<P>,\n key: React.Key | undefined,\n isStaticChildren: boolean,\n source: object | undefined,\n self: unknown,\n): React.ReactElement {\n const styles = useContext(TypeStylesContext);\n\n if (props.css != null && styles == null) {\n throw new Error(\n '[@typestyles/react] The `css` prop requires a `TypeStylesProvider` with a styles instance. ' +\n 'Wrap your app in `<TypeStylesProvider styles={api}>` (from `createTypeStyles()`), or use the Babel plugin for zero-runtime css props.',\n );\n }\n\n const nextProps = styles ? processCssProp(props, resolveHashClass(styles)) : (props as P);\n return reactJsxDEV(type, nextProps, key, isStaticChildren, source, self);\n}\n\nexport type { ReactNode };\n"],"mappings":";;;;;;AAQA,SAAS,eACP,OACA,WACG;CACH,IAAI,MAAM,OAAO,MACf,OAAO;CAGT,MAAM,EAAE,KAAK,WAAW,GAAG,SAAS;CAMpC,OAAO;EAJL,GAAG;EACH,WAAWA,iBAAAA,oBAAoB,WAAW,KAAK,SAAS;CAG3C;AACjB;AAEA,MAAa,WAAWC,sBAAAA;AAExB,SAAgB,OACd,MACA,OACA,KACA,kBACA,QACA,MACoB;CACpB,MAAM,UAAA,GAASC,MAAAA,WAAAA,CAAWC,iBAAAA,iBAAiB;CAE3C,IAAI,MAAM,OAAO,QAAQ,UAAU,MACjC,MAAM,IAAI,MACR,kOAEF;CAGF,MAAM,YAAY,SAAS,eAAe,OAAOC,2BAAAA,iBAAiB,MAAM,CAAC,IAAK;CAC9E,QAAA,GAAOC,sBAAAA,OAAAA,CAAY,MAAM,WAAW,KAAK,kBAAkB,QAAQ,IAAI;AACzE"}
@@ -1,12 +1,10 @@
1
- import * as react from 'react';
2
- import { ReactNode, ElementType } from 'react';
3
- export { ReactNode } from 'react';
4
- import { W as WithCssProp } from './types-_vEO6H8X.cjs';
5
- import 'typestyles';
6
-
7
- declare const Fragment: react.ExoticComponent<{
8
- children?: ReactNode | undefined;
1
+ import { n as WithCssProp } from "./types-DcDsqg2q.cjs";
2
+ import { ElementType, ReactNode } from "react";
3
+ //#region src/jsx-dev-runtime.d.ts
4
+ export declare const Fragment: import("react").ExoticComponent<{
5
+ children?: ReactNode | undefined;
9
6
  }>;
10
- declare function jsxDEV<P extends Record<string, unknown>>(type: ElementType, props: WithCssProp<P>, key: React.Key | undefined, isStaticChildren: boolean, source: object | undefined, self: unknown): React.ReactElement;
11
-
12
- export { Fragment, jsxDEV };
7
+ export declare function jsxDEV<P extends Record<string, unknown>>(type: ElementType, props: WithCssProp<P>, key: React.Key | undefined, isStaticChildren: boolean, source: object | undefined, self: unknown): React.ReactElement;
8
+ //#endregion
9
+ export type { ReactNode };
10
+ //# sourceMappingURL=jsx-dev-runtime.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-dev-runtime.d.cts","names":[],"sources":["../src/jsx-dev-runtime.ts"],"mappings":";;;qBAyBa,0BAAQ;;;wBAEL,OAAO,UAAU,yBAC/B,MAAM,aACN,OAAO,YAAY,IACnB,KAAK,MAAM,iBACX,2BACA,4BACA,gBACC,MAAM"}
@@ -1,12 +1,10 @@
1
- import * as react from 'react';
2
- import { ReactNode, ElementType } from 'react';
3
- export { ReactNode } from 'react';
4
- import { W as WithCssProp } from './types-_vEO6H8X.js';
5
- import 'typestyles';
6
-
7
- declare const Fragment: react.ExoticComponent<{
8
- children?: ReactNode | undefined;
1
+ import { n as WithCssProp } from "./types-DcDsqg2q.js";
2
+ import { ElementType, ReactNode } from "react";
3
+ //#region src/jsx-dev-runtime.d.ts
4
+ export declare const Fragment: import("react").ExoticComponent<{
5
+ children?: ReactNode | undefined;
9
6
  }>;
10
- declare function jsxDEV<P extends Record<string, unknown>>(type: ElementType, props: WithCssProp<P>, key: React.Key | undefined, isStaticChildren: boolean, source: object | undefined, self: unknown): React.ReactElement;
11
-
12
- export { Fragment, jsxDEV };
7
+ export declare function jsxDEV<P extends Record<string, unknown>>(type: ElementType, props: WithCssProp<P>, key: React.Key | undefined, isStaticChildren: boolean, source: object | undefined, self: unknown): React.ReactElement;
8
+ //#endregion
9
+ export type { ReactNode };
10
+ //# sourceMappingURL=jsx-dev-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-dev-runtime.d.ts","names":[],"sources":["../src/jsx-dev-runtime.ts"],"mappings":";;;qBAyBa,0BAAQ;;;wBAEL,OAAO,UAAU,yBAC/B,MAAM,aACN,OAAO,YAAY,IACnB,KAAK,MAAM,iBACX,2BACA,4BACA,gBACC,MAAM"}
@@ -1,31 +1,24 @@
1
- import { TypeStylesContext, resolveCssPropClass } from './chunk-IHZMLPG2.js';
2
- import { resolveHashClass } from './chunk-KM65VQPZ.js';
3
- import { useContext } from 'react';
4
- import { Fragment as Fragment$1, jsxDEV as jsxDEV$1 } from 'react/jsx-dev-runtime';
5
-
1
+ import { n as TypeStylesContext, t as resolveCssPropClass } from "./css-prop-DMDmFKhu.js";
2
+ import { t as resolveHashClass } from "./resolve-hash-class-Rs_7aMMQ.js";
3
+ import { useContext } from "react";
4
+ import { Fragment as Fragment$1, jsxDEV as jsxDEV$1 } from "react/jsx-dev-runtime";
5
+ //#region src/jsx-dev-runtime.ts
6
6
  function processCssProp(props, hashClass) {
7
- if (props.css == null) {
8
- return props;
9
- }
10
- const { css, className, ...rest } = props;
11
- const nextProps = {
12
- ...rest,
13
- className: resolveCssPropClass(hashClass, css, className)
14
- };
15
- return nextProps;
7
+ if (props.css == null) return props;
8
+ const { css, className, ...rest } = props;
9
+ return {
10
+ ...rest,
11
+ className: resolveCssPropClass(hashClass, css, className)
12
+ };
16
13
  }
17
- var Fragment = Fragment$1;
14
+ const Fragment = Fragment$1;
18
15
  function jsxDEV(type, props, key, isStaticChildren, source, self) {
19
- const styles = useContext(TypeStylesContext);
20
- if (props.css != null && styles == null) {
21
- throw new Error(
22
- "[@typestyles/react] The `css` prop requires a `TypeStylesProvider` with a styles instance. Wrap your app in `<TypeStylesProvider styles={api}>` (from `createTypeStyles()`), or use the Babel plugin for zero-runtime css props."
23
- );
24
- }
25
- const nextProps = styles ? processCssProp(props, resolveHashClass(styles)) : props;
26
- return jsxDEV$1(type, nextProps, key, isStaticChildren, source, self);
16
+ const styles = useContext(TypeStylesContext);
17
+ if (props.css != null && styles == null) throw new Error("[@typestyles/react] The `css` prop requires a `TypeStylesProvider` with a styles instance. Wrap your app in `<TypeStylesProvider styles={api}>` (from `createTypeStyles()`), or use the Babel plugin for zero-runtime css props.");
18
+ const nextProps = styles ? processCssProp(props, resolveHashClass(styles)) : props;
19
+ return jsxDEV$1(type, nextProps, key, isStaticChildren, source, self);
27
20
  }
28
-
21
+ //#endregion
29
22
  export { Fragment, jsxDEV };
30
- //# sourceMappingURL=jsx-dev-runtime.js.map
23
+
31
24
  //# sourceMappingURL=jsx-dev-runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/jsx-dev-runtime.ts"],"names":["ReactFragment","reactJsxDEV"],"mappings":";;;;;AAQA,SAAS,cAAA,CACP,OACA,SAAA,EACG;AACH,EAAA,IAAI,KAAA,CAAM,OAAO,IAAA,EAAM;AACrB,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,MAAM,EAAE,GAAA,EAAK,SAAA,EAAW,GAAG,MAAK,GAAI,KAAA;AACpC,EAAA,MAAM,SAAA,GAAY;AAAA,IAChB,GAAG,IAAA;AAAA,IACH,SAAA,EAAW,mBAAA,CAAoB,SAAA,EAAW,GAAA,EAAK,SAAS;AAAA,GAC1D;AAEA,EAAA,OAAO,SAAA;AACT;AAEO,IAAM,QAAA,GAAWA;AAEjB,SAAS,OACd,IAAA,EACA,KAAA,EACA,GAAA,EACA,gBAAA,EACA,QACA,IAAA,EACoB;AACpB,EAAA,MAAM,MAAA,GAAS,WAAW,iBAAiB,CAAA;AAE3C,EAAA,IAAI,KAAA,CAAM,GAAA,IAAO,IAAA,IAAQ,MAAA,IAAU,IAAA,EAAM;AACvC,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KAEF;AAAA,EACF;AAEA,EAAA,MAAM,YAAY,MAAA,GAAS,cAAA,CAAe,OAAO,gBAAA,CAAiB,MAAM,CAAC,CAAA,GAAK,KAAA;AAC9E,EAAA,OAAOC,SAAY,IAAA,EAAM,SAAA,EAAW,GAAA,EAAK,gBAAA,EAAkB,QAAQ,IAAI,CAAA;AACzE","file":"jsx-dev-runtime.js","sourcesContent":["import { useContext, type ElementType, type ReactNode } from 'react';\nimport { jsxDEV as reactJsxDEV, Fragment as ReactFragment } from 'react/jsx-dev-runtime';\nimport type { CSSProperties } from 'typestyles';\nimport { resolveCssPropClass } from './css-prop';\nimport { TypeStylesContext } from './context';\nimport { resolveHashClass } from './resolve-hash-class';\nimport type { WithCssProp } from './types';\n\nfunction processCssProp<P extends Record<string, unknown>>(\n props: WithCssProp<P>,\n hashClass: (properties: CSSProperties, label?: string) => string,\n): P {\n if (props.css == null) {\n return props as P;\n }\n\n const { css, className, ...rest } = props;\n const nextProps = {\n ...rest,\n className: resolveCssPropClass(hashClass, css, className),\n } as unknown as P;\n\n return nextProps;\n}\n\nexport const Fragment = ReactFragment;\n\nexport function jsxDEV<P extends Record<string, unknown>>(\n type: ElementType,\n props: WithCssProp<P>,\n key: React.Key | undefined,\n isStaticChildren: boolean,\n source: object | undefined,\n self: unknown,\n): React.ReactElement {\n const styles = useContext(TypeStylesContext);\n\n if (props.css != null && styles == null) {\n throw new Error(\n '[@typestyles/react] The `css` prop requires a `TypeStylesProvider` with a styles instance. ' +\n 'Wrap your app in `<TypeStylesProvider styles={api}>` (from `createTypeStyles()`), or use the Babel plugin for zero-runtime css props.',\n );\n }\n\n const nextProps = styles ? processCssProp(props, resolveHashClass(styles)) : (props as P);\n return reactJsxDEV(type, nextProps, key, isStaticChildren, source, self);\n}\n\nexport type { ReactNode };\n"]}
1
+ {"version":3,"file":"jsx-dev-runtime.js","names":["ReactFragment","reactJsxDEV"],"sources":["../src/jsx-dev-runtime.ts"],"sourcesContent":["import { useContext, type ElementType, type ReactNode } from 'react';\nimport { jsxDEV as reactJsxDEV, Fragment as ReactFragment } from 'react/jsx-dev-runtime';\nimport type { CSSProperties } from 'typestyles';\nimport { resolveCssPropClass } from './css-prop';\nimport { TypeStylesContext } from './context';\nimport { resolveHashClass } from './resolve-hash-class';\nimport type { WithCssProp } from './types';\n\nfunction processCssProp<P extends Record<string, unknown>>(\n props: WithCssProp<P>,\n hashClass: (properties: CSSProperties, label?: string) => string,\n): P {\n if (props.css == null) {\n return props as P;\n }\n\n const { css, className, ...rest } = props;\n const nextProps = {\n ...rest,\n className: resolveCssPropClass(hashClass, css, className),\n } as unknown as P;\n\n return nextProps;\n}\n\nexport const Fragment = ReactFragment;\n\nexport function jsxDEV<P extends Record<string, unknown>>(\n type: ElementType,\n props: WithCssProp<P>,\n key: React.Key | undefined,\n isStaticChildren: boolean,\n source: object | undefined,\n self: unknown,\n): React.ReactElement {\n const styles = useContext(TypeStylesContext);\n\n if (props.css != null && styles == null) {\n throw new Error(\n '[@typestyles/react] The `css` prop requires a `TypeStylesProvider` with a styles instance. ' +\n 'Wrap your app in `<TypeStylesProvider styles={api}>` (from `createTypeStyles()`), or use the Babel plugin for zero-runtime css props.',\n );\n }\n\n const nextProps = styles ? processCssProp(props, resolveHashClass(styles)) : (props as P);\n return reactJsxDEV(type, nextProps, key, isStaticChildren, source, self);\n}\n\nexport type { ReactNode };\n"],"mappings":";;;;;AAQA,SAAS,eACP,OACA,WACG;CACH,IAAI,MAAM,OAAO,MACf,OAAO;CAGT,MAAM,EAAE,KAAK,WAAW,GAAG,SAAS;CAMpC,OAAO;EAJL,GAAG;EACH,WAAW,oBAAoB,WAAW,KAAK,SAAS;CAG3C;AACjB;AAEA,MAAa,WAAWA;AAExB,SAAgB,OACd,MACA,OACA,KACA,kBACA,QACA,MACoB;CACpB,MAAM,SAAS,WAAW,iBAAiB;CAE3C,IAAI,MAAM,OAAO,QAAQ,UAAU,MACjC,MAAM,IAAI,MACR,kOAEF;CAGF,MAAM,YAAY,SAAS,eAAe,OAAO,iBAAiB,MAAM,CAAC,IAAK;CAC9E,OAAOC,SAAY,MAAM,WAAW,KAAK,kBAAkB,QAAQ,IAAI;AACzE"}
@@ -1,58 +1,32 @@
1
- 'use strict';
2
-
3
- var react = require('react');
4
- var jsxRuntime = require('react/jsx-runtime');
5
- var typestyles = require('typestyles');
6
-
7
- // src/jsx-runtime.ts
8
- function resolveCssPropClass(hashClass, css, className) {
9
- if (css && typeof css === "object") {
10
- return typestyles.cx(hashClass(css), className);
11
- }
12
- return typestyles.cx(className);
13
- }
14
- var TypeStylesContext = react.createContext(null);
15
-
16
- // src/resolve-hash-class.ts
17
- function resolveHashClass(api) {
18
- if ("hash" in api && typeof api.hash === "function") {
19
- return (properties, label) => api.hash(properties, { label });
20
- }
21
- return api.hashClass;
22
- }
23
-
24
- // src/jsx-runtime.ts
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_css_prop = require("./css-prop-DOMoNwJN.cjs");
3
+ const require_resolve_hash_class = require("./resolve-hash-class-DuqLJq6S.cjs");
4
+ let react = require("react");
5
+ let react_jsx_runtime = require("react/jsx-runtime");
6
+ //#region src/jsx-runtime.ts
25
7
  function processCssProp(props, hashClass) {
26
- if (props.css == null) {
27
- return props;
28
- }
29
- const { css, className, ...rest } = props;
30
- const nextProps = {
31
- ...rest,
32
- className: resolveCssPropClass(hashClass, css, className)
33
- };
34
- return nextProps;
8
+ if (props.css == null) return props;
9
+ const { css, className, ...rest } = props;
10
+ return {
11
+ ...rest,
12
+ className: require_css_prop.resolveCssPropClass(hashClass, css, className)
13
+ };
35
14
  }
36
15
  function wrapJsx(factory, type, props, key) {
37
- const styles = react.useContext(TypeStylesContext);
38
- if (props.css != null && styles == null) {
39
- throw new Error(
40
- "[@typestyles/react] The `css` prop requires a `TypeStylesProvider` with a styles instance. Wrap your app in `<TypeStylesProvider styles={api}>` (from `createTypeStyles()`), or use the Babel plugin for zero-runtime css props."
41
- );
42
- }
43
- const nextProps = styles ? processCssProp(props, resolveHashClass(styles)) : props;
44
- return factory(type, nextProps, key);
16
+ const styles = (0, react.useContext)(require_css_prop.TypeStylesContext);
17
+ if (props.css != null && styles == null) throw new Error("[@typestyles/react] The `css` prop requires a `TypeStylesProvider` with a styles instance. Wrap your app in `<TypeStylesProvider styles={api}>` (from `createTypeStyles()`), or use the Babel plugin for zero-runtime css props.");
18
+ return factory(type, styles ? processCssProp(props, require_resolve_hash_class.resolveHashClass(styles)) : props, key);
45
19
  }
46
- var Fragment = jsxRuntime.Fragment;
47
- function jsx2(type, props, key) {
48
- return wrapJsx(jsxRuntime.jsx, type, props, key);
20
+ const Fragment = react_jsx_runtime.Fragment;
21
+ function jsx(type, props, key) {
22
+ return wrapJsx(react_jsx_runtime.jsx, type, props, key);
49
23
  }
50
24
  function jsxs(type, props, key) {
51
- return wrapJsx(jsxRuntime.jsxs, type, props, key);
25
+ return wrapJsx(react_jsx_runtime.jsxs, type, props, key);
52
26
  }
53
-
27
+ //#endregion
54
28
  exports.Fragment = Fragment;
55
- exports.jsx = jsx2;
29
+ exports.jsx = jsx;
56
30
  exports.jsxs = jsxs;
57
- //# sourceMappingURL=jsx-runtime.cjs.map
31
+
58
32
  //# sourceMappingURL=jsx-runtime.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/css-prop.ts","../src/context.tsx","../src/resolve-hash-class.ts","../src/jsx-runtime.ts"],"names":["cx","createContext","useContext","ReactFragment","jsx","reactJsx","reactJsxs"],"mappings":";;;;;;;AAIO,SAAS,mBAAA,CACd,SAAA,EACA,GAAA,EACA,SAAA,EACQ;AACR,EAAA,IAAI,GAAA,IAAO,OAAO,GAAA,KAAQ,QAAA,EAAU;AAClC,IAAA,OAAOA,aAAA,CAAG,SAAA,CAAU,GAAG,CAAA,EAAG,SAAS,CAAA;AAAA,EACrC;AACA,EAAA,OAAOA,cAAG,SAAS,CAAA;AACrB;ACVO,IAAM,iBAAA,GAAoBC,oBAAoC,IAAI,CAAA;;;ACKlE,SAAS,iBAAiB,GAAA,EAAiC;AAChE,EAAA,IAAI,MAAA,IAAU,GAAA,IAAO,OAAO,GAAA,CAAI,SAAS,UAAA,EAAY;AACnD,IAAA,OAAO,CAAC,YAAY,KAAA,KAAU,GAAA,CAAI,KAAK,UAAA,EAAY,EAAE,OAAO,CAAA;AAAA,EAC9D;AACA,EAAA,OAAQ,GAAA,CAAkB,SAAA;AAC5B;;;ACLA,SAAS,cAAA,CACP,OACA,SAAA,EACG;AACH,EAAA,IAAI,KAAA,CAAM,OAAO,IAAA,EAAM;AACrB,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,MAAM,EAAE,GAAA,EAAK,SAAA,EAAW,GAAG,MAAK,GAAI,KAAA;AACpC,EAAA,MAAM,SAAA,GAAY;AAAA,IAChB,GAAG,IAAA;AAAA,IACH,SAAA,EAAW,mBAAA,CAAoB,SAAA,EAAW,GAAA,EAAK,SAAS;AAAA,GAC1D;AAEA,EAAA,OAAO,SAAA;AACT;AAEA,SAAS,OAAA,CACP,OAAA,EACA,IAAA,EACA,KAAA,EACA,GAAA,EACoB;AACpB,EAAA,MAAM,MAAA,GAASC,iBAAW,iBAAiB,CAAA;AAE3C,EAAA,IAAI,KAAA,CAAM,GAAA,IAAO,IAAA,IAAQ,MAAA,IAAU,IAAA,EAAM;AACvC,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KAEF;AAAA,EACF;AAEA,EAAA,MAAM,YAAY,MAAA,GAAS,cAAA,CAAe,OAAO,gBAAA,CAAiB,MAAM,CAAC,CAAA,GAAK,KAAA;AAC9E,EAAA,OAAO,OAAA,CAAQ,IAAA,EAAM,SAAA,EAAW,GAAG,CAAA;AACrC;AAEO,IAAM,QAAA,GAAWC;AAEjB,SAASC,IAAAA,CACd,IAAA,EACA,KAAA,EACA,GAAA,EACoB;AACpB,EAAA,OAAO,OAAA,CAAQC,cAAA,EAAU,IAAA,EAAM,KAAA,EAAO,GAAG,CAAA;AAC3C;AAEO,SAAS,IAAA,CACd,IAAA,EACA,KAAA,EACA,GAAA,EACoB;AACpB,EAAA,OAAO,OAAA,CAAQC,eAAA,EAAW,IAAA,EAAM,KAAA,EAAO,GAAG,CAAA;AAC5C","file":"jsx-runtime.cjs","sourcesContent":["import type { CSSProperties } from 'typestyles';\nimport { cx } from 'typestyles';\nimport type { CssPropValue } from './types';\n\nexport function resolveCssPropClass(\n hashClass: (properties: CSSProperties, label?: string) => string,\n css: CssPropValue | undefined,\n className?: string,\n): string {\n if (css && typeof css === 'object') {\n return cx(hashClass(css), className);\n }\n return cx(className);\n}\n","import { createContext, type ReactNode } from 'react';\nimport type { CssStylesHost } from './resolve-hash-class';\n\nexport const TypeStylesContext = createContext<CssStylesHost | null>(null);\n\nexport function TypeStylesProvider({\n styles,\n children,\n}: {\n /** Prefer a `createTypeStyles()` result; `createStyles()` instances also work. */\n styles: CssStylesHost;\n children: ReactNode;\n}): React.JSX.Element {\n return <TypeStylesContext.Provider value={styles}>{children}</TypeStylesContext.Provider>;\n}\n","import type { CSSProperties, StylesApi, TypeStylesApi } from 'typestyles';\n\n/** Styles host for the css prop / TypeStylesProvider. */\nexport type CssStylesHost = Pick<TypeStylesApi, 'hash'> | StylesApi;\n\nexport type HashClassFn = (properties: CSSProperties, label?: string) => string;\n\n/** Normalize `hash` (createTypeStyles) and `hashClass` (createStyles). */\nexport function resolveHashClass(api: CssStylesHost): HashClassFn {\n if ('hash' in api && typeof api.hash === 'function') {\n return (properties, label) => api.hash(properties, { label });\n }\n return (api as StylesApi).hashClass;\n}\n","import { useContext, type ElementType, type ReactNode } from 'react';\nimport { jsx as reactJsx, jsxs as reactJsxs, Fragment as ReactFragment } from 'react/jsx-runtime';\nimport type { CSSProperties } from 'typestyles';\nimport { resolveCssPropClass } from './css-prop';\nimport { TypeStylesContext } from './context';\nimport { resolveHashClass } from './resolve-hash-class';\nimport type { WithCssProp } from './types';\n\nfunction processCssProp<P extends Record<string, unknown>>(\n props: WithCssProp<P>,\n hashClass: (properties: CSSProperties, label?: string) => string,\n): P {\n if (props.css == null) {\n return props as P;\n }\n\n const { css, className, ...rest } = props;\n const nextProps = {\n ...rest,\n className: resolveCssPropClass(hashClass, css, className),\n } as unknown as P;\n\n return nextProps;\n}\n\nfunction wrapJsx<P extends Record<string, unknown>>(\n factory: typeof reactJsx,\n type: ElementType,\n props: WithCssProp<P>,\n key?: React.Key,\n): React.ReactElement {\n const styles = useContext(TypeStylesContext);\n\n if (props.css != null && styles == null) {\n throw new Error(\n '[@typestyles/react] The `css` prop requires a `TypeStylesProvider` with a styles instance. ' +\n 'Wrap your app in `<TypeStylesProvider styles={api}>` (from `createTypeStyles()`), or use the Babel plugin for zero-runtime css props.',\n );\n }\n\n const nextProps = styles ? processCssProp(props, resolveHashClass(styles)) : (props as P);\n return factory(type, nextProps, key);\n}\n\nexport const Fragment = ReactFragment;\n\nexport function jsx<P extends Record<string, unknown>>(\n type: ElementType,\n props: WithCssProp<P>,\n key?: React.Key,\n): React.ReactElement {\n return wrapJsx(reactJsx, type, props, key);\n}\n\nexport function jsxs<P extends Record<string, unknown>>(\n type: ElementType,\n props: WithCssProp<P>,\n key?: React.Key,\n): React.ReactElement {\n return wrapJsx(reactJsxs, type, props, key);\n}\n\nexport type { ReactNode };\n"]}
1
+ {"version":3,"file":"jsx-runtime.cjs","names":["resolveCssPropClass","useContext","TypeStylesContext","resolveHashClass","ReactFragment","reactJsx","reactJsxs"],"sources":["../src/jsx-runtime.ts"],"sourcesContent":["import { useContext, type ElementType, type ReactNode } from 'react';\nimport { jsx as reactJsx, jsxs as reactJsxs, Fragment as ReactFragment } from 'react/jsx-runtime';\nimport type { CSSProperties } from 'typestyles';\nimport { resolveCssPropClass } from './css-prop';\nimport { TypeStylesContext } from './context';\nimport { resolveHashClass } from './resolve-hash-class';\nimport type { WithCssProp } from './types';\n\nfunction processCssProp<P extends Record<string, unknown>>(\n props: WithCssProp<P>,\n hashClass: (properties: CSSProperties, label?: string) => string,\n): P {\n if (props.css == null) {\n return props as P;\n }\n\n const { css, className, ...rest } = props;\n const nextProps = {\n ...rest,\n className: resolveCssPropClass(hashClass, css, className),\n } as unknown as P;\n\n return nextProps;\n}\n\nfunction wrapJsx<P extends Record<string, unknown>>(\n factory: typeof reactJsx,\n type: ElementType,\n props: WithCssProp<P>,\n key?: React.Key,\n): React.ReactElement {\n const styles = useContext(TypeStylesContext);\n\n if (props.css != null && styles == null) {\n throw new Error(\n '[@typestyles/react] The `css` prop requires a `TypeStylesProvider` with a styles instance. ' +\n 'Wrap your app in `<TypeStylesProvider styles={api}>` (from `createTypeStyles()`), or use the Babel plugin for zero-runtime css props.',\n );\n }\n\n const nextProps = styles ? processCssProp(props, resolveHashClass(styles)) : (props as P);\n return factory(type, nextProps, key);\n}\n\nexport const Fragment = ReactFragment;\n\nexport function jsx<P extends Record<string, unknown>>(\n type: ElementType,\n props: WithCssProp<P>,\n key?: React.Key,\n): React.ReactElement {\n return wrapJsx(reactJsx, type, props, key);\n}\n\nexport function jsxs<P extends Record<string, unknown>>(\n type: ElementType,\n props: WithCssProp<P>,\n key?: React.Key,\n): React.ReactElement {\n return wrapJsx(reactJsxs, type, props, key);\n}\n\nexport type { ReactNode };\n"],"mappings":";;;;;;AAQA,SAAS,eACP,OACA,WACG;CACH,IAAI,MAAM,OAAO,MACf,OAAO;CAGT,MAAM,EAAE,KAAK,WAAW,GAAG,SAAS;CAMpC,OAAO;EAJL,GAAG;EACH,WAAWA,iBAAAA,oBAAoB,WAAW,KAAK,SAAS;CAG3C;AACjB;AAEA,SAAS,QACP,SACA,MACA,OACA,KACoB;CACpB,MAAM,UAAA,GAASC,MAAAA,WAAAA,CAAWC,iBAAAA,iBAAiB;CAE3C,IAAI,MAAM,OAAO,QAAQ,UAAU,MACjC,MAAM,IAAI,MACR,kOAEF;CAIF,OAAO,QAAQ,MADG,SAAS,eAAe,OAAOC,2BAAAA,iBAAiB,MAAM,CAAC,IAAK,OAC9C,GAAG;AACrC;AAEA,MAAa,WAAWC,kBAAAA;AAExB,SAAgB,IACd,MACA,OACA,KACoB;CACpB,OAAO,QAAQC,kBAAAA,KAAU,MAAM,OAAO,GAAG;AAC3C;AAEA,SAAgB,KACd,MACA,OACA,KACoB;CACpB,OAAO,QAAQC,kBAAAA,MAAW,MAAM,OAAO,GAAG;AAC5C"}
@@ -1,13 +1,11 @@
1
- import * as react from 'react';
2
- import { ReactNode, ElementType } from 'react';
3
- export { ReactNode } from 'react';
4
- import { W as WithCssProp } from './types-_vEO6H8X.cjs';
5
- import 'typestyles';
6
-
7
- declare const Fragment: react.ExoticComponent<{
8
- children?: ReactNode | undefined;
1
+ import { n as WithCssProp } from "./types-DcDsqg2q.cjs";
2
+ import { ElementType, ReactNode } from "react";
3
+ //#region src/jsx-runtime.d.ts
4
+ export declare const Fragment: import("react").ExoticComponent<{
5
+ children?: ReactNode | undefined;
9
6
  }>;
10
- declare function jsx<P extends Record<string, unknown>>(type: ElementType, props: WithCssProp<P>, key?: React.Key): React.ReactElement;
11
- declare function jsxs<P extends Record<string, unknown>>(type: ElementType, props: WithCssProp<P>, key?: React.Key): React.ReactElement;
12
-
13
- export { Fragment, jsx, jsxs };
7
+ export declare function jsx<P extends Record<string, unknown>>(type: ElementType, props: WithCssProp<P>, key?: React.Key): React.ReactElement;
8
+ export declare function jsxs<P extends Record<string, unknown>>(type: ElementType, props: WithCssProp<P>, key?: React.Key): React.ReactElement;
9
+ //#endregion
10
+ export type { ReactNode };
11
+ //# sourceMappingURL=jsx-runtime.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-runtime.d.cts","names":[],"sources":["../src/jsx-runtime.ts"],"mappings":";;;qBA4Ca,0BAAQ;;;wBAEL,IAAI,UAAU,yBAC5B,MAAM,aACN,OAAO,YAAY,IACnB,MAAM,MAAM,MACX,MAAM;wBAIO,KAAK,UAAU,yBAC7B,MAAM,aACN,OAAO,YAAY,IACnB,MAAM,MAAM,MACX,MAAM"}
@@ -1,13 +1,11 @@
1
- import * as react from 'react';
2
- import { ReactNode, ElementType } from 'react';
3
- export { ReactNode } from 'react';
4
- import { W as WithCssProp } from './types-_vEO6H8X.js';
5
- import 'typestyles';
6
-
7
- declare const Fragment: react.ExoticComponent<{
8
- children?: ReactNode | undefined;
1
+ import { n as WithCssProp } from "./types-DcDsqg2q.js";
2
+ import { ElementType, ReactNode } from "react";
3
+ //#region src/jsx-runtime.d.ts
4
+ export declare const Fragment: import("react").ExoticComponent<{
5
+ children?: ReactNode | undefined;
9
6
  }>;
10
- declare function jsx<P extends Record<string, unknown>>(type: ElementType, props: WithCssProp<P>, key?: React.Key): React.ReactElement;
11
- declare function jsxs<P extends Record<string, unknown>>(type: ElementType, props: WithCssProp<P>, key?: React.Key): React.ReactElement;
12
-
13
- export { Fragment, jsx, jsxs };
7
+ export declare function jsx<P extends Record<string, unknown>>(type: ElementType, props: WithCssProp<P>, key?: React.Key): React.ReactElement;
8
+ export declare function jsxs<P extends Record<string, unknown>>(type: ElementType, props: WithCssProp<P>, key?: React.Key): React.ReactElement;
9
+ //#endregion
10
+ export type { ReactNode };
11
+ //# sourceMappingURL=jsx-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-runtime.d.ts","names":[],"sources":["../src/jsx-runtime.ts"],"mappings":";;;qBA4Ca,0BAAQ;;;wBAEL,IAAI,UAAU,yBAC5B,MAAM,aACN,OAAO,YAAY,IACnB,MAAM,MAAM,MACX,MAAM;wBAIO,KAAK,UAAU,yBAC7B,MAAM,aACN,OAAO,YAAY,IACnB,MAAM,MAAM,MACX,MAAM"}