@omerdlw/base-framework 3.4.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/dist/ambient/index.js +4 -5
  2. package/dist/background/index.js +3 -4
  3. package/dist/{chunk-DC4XZPDK.js → chunk-3FSDBJ7V.js} +4 -4
  4. package/dist/{chunk-DC4XZPDK.js.map → chunk-3FSDBJ7V.js.map} +1 -1
  5. package/dist/{chunk-GTJMM32W.js → chunk-5TQSH6KE.js} +6 -7
  6. package/dist/chunk-5TQSH6KE.js.map +1 -0
  7. package/dist/{chunk-DGVRHX3C.js → chunk-6P3F4JU3.js} +5 -6
  8. package/dist/{chunk-DGVRHX3C.js.map → chunk-6P3F4JU3.js.map} +1 -1
  9. package/dist/{chunk-3JLG24KI.js → chunk-AKPH5CEJ.js} +199 -9
  10. package/dist/chunk-AKPH5CEJ.js.map +1 -0
  11. package/dist/{chunk-KRHH3UQ6.js → chunk-AWLK2I56.js} +7 -8
  12. package/dist/{chunk-KRHH3UQ6.js.map → chunk-AWLK2I56.js.map} +1 -1
  13. package/dist/{chunk-M36DFIJ6.js → chunk-C527JOJQ.js} +4 -4
  14. package/dist/{chunk-M36DFIJ6.js.map → chunk-C527JOJQ.js.map} +1 -1
  15. package/dist/{chunk-E2QQJZYY.js → chunk-EXB7VFD3.js} +4 -4
  16. package/dist/{chunk-E2QQJZYY.js.map → chunk-EXB7VFD3.js.map} +1 -1
  17. package/dist/chunk-FG2AKFXP.js +108 -0
  18. package/dist/chunk-FG2AKFXP.js.map +1 -0
  19. package/dist/chunk-GA5SZ6E2.js +17 -0
  20. package/dist/{chunk-2E6OASVV.js.map → chunk-GA5SZ6E2.js.map} +1 -1
  21. package/dist/chunk-GG2ILNK2.js +44 -0
  22. package/dist/chunk-GG2ILNK2.js.map +1 -0
  23. package/dist/{chunk-VMR7ZKIF.js → chunk-JA75E4BG.js} +5 -5
  24. package/dist/{chunk-VMR7ZKIF.js.map → chunk-JA75E4BG.js.map} +1 -1
  25. package/dist/{chunk-BLWJZHRL.js → chunk-QZA5AIT6.js} +6 -9
  26. package/dist/chunk-QZA5AIT6.js.map +1 -0
  27. package/dist/{chunk-ST7QOM4O.js → chunk-T53WFIZN.js} +3 -3
  28. package/dist/{chunk-ST7QOM4O.js.map → chunk-T53WFIZN.js.map} +1 -1
  29. package/dist/{chunk-KN4KOTC7.js → chunk-WVED7PDH.js} +4 -4
  30. package/dist/{chunk-KN4KOTC7.js.map → chunk-WVED7PDH.js.map} +1 -1
  31. package/dist/{chunk-HPJWMBUS.js → chunk-XIFQMK2Z.js} +34 -37
  32. package/dist/chunk-XIFQMK2Z.js.map +1 -0
  33. package/dist/{chunk-7A47AXKI.js → chunk-YKHAFHB7.js} +4 -5
  34. package/dist/{chunk-7A47AXKI.js.map → chunk-YKHAFHB7.js.map} +1 -1
  35. package/dist/context-menu/index.js +7 -10
  36. package/dist/controls/index.js +3 -3
  37. package/dist/core/error/boundary.d.ts.map +1 -1
  38. package/dist/core/provider/index.d.ts +3 -8
  39. package/dist/core/provider/index.d.ts.map +1 -1
  40. package/dist/dock/index.js +6 -9
  41. package/dist/error/index.js +2 -5
  42. package/dist/foundation/recipes/index.d.ts +0 -7
  43. package/dist/foundation/recipes/index.d.ts.map +1 -1
  44. package/dist/index.js +15 -18
  45. package/dist/loading/index.js +2 -4
  46. package/dist/modal/index.js +10 -12
  47. package/dist/modal/index.js.map +1 -1
  48. package/dist/modules/dock/card/icon.d.ts.map +1 -1
  49. package/dist/modules/dock/card/use-card.d.ts +38 -38
  50. package/dist/modules/dock/media/controls.d.ts.map +1 -1
  51. package/dist/modules/dock/motion.d.ts +24 -24
  52. package/dist/modules/dock/status/model.d.ts.map +1 -1
  53. package/dist/modules/dock/surface/controls.d.ts.map +1 -1
  54. package/dist/modules/dock/surface/header-button.d.ts.map +1 -1
  55. package/dist/modules/dock/theme.d.ts +14 -14
  56. package/dist/modules/index.js +13 -16
  57. package/dist/modules/modal/container.d.ts.map +1 -1
  58. package/dist/notification/index.js +4 -4
  59. package/dist/overlay-ZCMQVNYT.js +12 -0
  60. package/dist/{overlay-YMLS3SAQ.js.map → overlay-ZCMQVNYT.js.map} +1 -1
  61. package/dist/provider/index.js +3 -8
  62. package/dist/react/theme/index.d.ts +7 -2
  63. package/dist/react/theme/index.d.ts.map +1 -1
  64. package/dist/react/theme/parts.d.ts +89 -0
  65. package/dist/react/theme/parts.d.ts.map +1 -0
  66. package/dist/recipes/index.js +1 -115
  67. package/dist/recipes/index.js.map +1 -1
  68. package/dist/theme/index.js +1 -1
  69. package/docs/README.md +11 -12
  70. package/docs/architecture-and-rules.md +8 -8
  71. package/docs/core-engine.md +11 -13
  72. package/docs/custom-modules.md +1 -1
  73. package/docs/design.md +60 -153
  74. package/docs/getting-started.md +3 -5
  75. package/docs/modules/README.md +1 -1
  76. package/docs/modules/background.md +1 -1
  77. package/docs/modules/context-menu.md +1 -1
  78. package/docs/modules/dock.md +23 -23
  79. package/docs/modules/error-boundary.md +1 -1
  80. package/docs/modules/loading.md +1 -1
  81. package/docs/modules/modal.md +1 -1
  82. package/package.json +1 -7
  83. package/templates/AGENTS.md +4 -3
  84. package/MIGRATION.md +0 -99
  85. package/dist/chunk-2E6OASVV.js +0 -17
  86. package/dist/chunk-3JLG24KI.js.map +0 -1
  87. package/dist/chunk-6LWCTP2Y.js +0 -448
  88. package/dist/chunk-6LWCTP2Y.js.map +0 -1
  89. package/dist/chunk-BLWJZHRL.js.map +0 -1
  90. package/dist/chunk-EBNZXYLT.js +0 -704
  91. package/dist/chunk-EBNZXYLT.js.map +0 -1
  92. package/dist/chunk-FLYL76ZT.js +0 -139
  93. package/dist/chunk-FLYL76ZT.js.map +0 -1
  94. package/dist/chunk-GTJMM32W.js.map +0 -1
  95. package/dist/chunk-HPJWMBUS.js.map +0 -1
  96. package/dist/chunk-ICFPSAJZ.js +0 -112
  97. package/dist/chunk-ICFPSAJZ.js.map +0 -1
  98. package/dist/chunk-S2ZOLTTS.js +0 -140
  99. package/dist/chunk-S2ZOLTTS.js.map +0 -1
  100. package/dist/foundation/recipes/anatomy.d.ts +0 -139
  101. package/dist/foundation/recipes/anatomy.d.ts.map +0 -1
  102. package/dist/foundation/recipes/define.d.ts +0 -133
  103. package/dist/foundation/recipes/define.d.ts.map +0 -1
  104. package/dist/overlay-YMLS3SAQ.js +0 -14
  105. package/dist/react/ui/components/avatar.d.ts +0 -10
  106. package/dist/react/ui/components/avatar.d.ts.map +0 -1
  107. package/dist/react/ui/components/button.d.ts +0 -6
  108. package/dist/react/ui/components/button.d.ts.map +0 -1
  109. package/dist/react/ui/components/carousel.d.ts +0 -27
  110. package/dist/react/ui/components/carousel.d.ts.map +0 -1
  111. package/dist/react/ui/components/checkbox.d.ts +0 -10
  112. package/dist/react/ui/components/checkbox.d.ts.map +0 -1
  113. package/dist/react/ui/components/icon.d.ts +0 -6
  114. package/dist/react/ui/components/icon.d.ts.map +0 -1
  115. package/dist/react/ui/components/image.d.ts +0 -6
  116. package/dist/react/ui/components/image.d.ts.map +0 -1
  117. package/dist/react/ui/components/indicator.d.ts +0 -55
  118. package/dist/react/ui/components/indicator.d.ts.map +0 -1
  119. package/dist/react/ui/components/input.d.ts +0 -10
  120. package/dist/react/ui/components/input.d.ts.map +0 -1
  121. package/dist/react/ui/components/loader.d.ts +0 -10
  122. package/dist/react/ui/components/loader.d.ts.map +0 -1
  123. package/dist/react/ui/components/segmented.d.ts +0 -6
  124. package/dist/react/ui/components/segmented.d.ts.map +0 -1
  125. package/dist/react/ui/components/select/options.d.ts +0 -22
  126. package/dist/react/ui/components/select/options.d.ts.map +0 -1
  127. package/dist/react/ui/components/select/select.d.ts +0 -6
  128. package/dist/react/ui/components/select/select.d.ts.map +0 -1
  129. package/dist/react/ui/components/skeleton.d.ts +0 -10
  130. package/dist/react/ui/components/skeleton.d.ts.map +0 -1
  131. package/dist/react/ui/components/switch.d.ts +0 -6
  132. package/dist/react/ui/components/switch.d.ts.map +0 -1
  133. package/dist/react/ui/components/tooltip/group.d.ts +0 -35
  134. package/dist/react/ui/components/tooltip/group.d.ts.map +0 -1
  135. package/dist/react/ui/components/tooltip/placement.d.ts +0 -42
  136. package/dist/react/ui/components/tooltip/placement.d.ts.map +0 -1
  137. package/dist/react/ui/components/tooltip/slot.d.ts +0 -23
  138. package/dist/react/ui/components/tooltip/slot.d.ts.map +0 -1
  139. package/dist/react/ui/components/tooltip/tooltip.d.ts +0 -13
  140. package/dist/react/ui/components/tooltip/tooltip.d.ts.map +0 -1
  141. package/dist/react/ui/index.d.ts +0 -20
  142. package/dist/react/ui/index.d.ts.map +0 -1
  143. package/dist/react/ui/provider.d.ts +0 -22
  144. package/dist/react/ui/provider.d.ts.map +0 -1
  145. package/dist/react/ui/types.d.ts +0 -341
  146. package/dist/react/ui/types.d.ts.map +0 -1
  147. package/dist/ui/index.d.ts +0 -1
  148. package/dist/ui/index.js +0 -2259
  149. package/dist/ui/index.js.map +0 -1
@@ -1,112 +0,0 @@
1
- import { extendTailwindMerge } from 'tailwind-merge';
2
-
3
- // src/foundation/recipes/recipe.ts
4
- var key = (value) => (
5
- // eslint-disable-next-line @typescript-eslint/no-base-to-string -- any value is accepted; objects become "[object Object]"
6
- value === null || value === void 0 ? null : String(value)
7
- );
8
- function matches(selected, compound) {
9
- for (const [name, wanted] of Object.entries(compound)) {
10
- if (name === "class" || name === "className") continue;
11
- const actual = selected[name] ?? null;
12
- if (Array.isArray(wanted)) {
13
- if (!wanted.some((one) => key(one) === actual)) return false;
14
- } else if (key(wanted) !== actual) {
15
- return false;
16
- }
17
- }
18
- return true;
19
- }
20
- function resolveRecipe(def, props = {}) {
21
- const out = [def.base];
22
- const variants = def.variants ?? {};
23
- const defaults = def.defaultVariants ?? {};
24
- const selected = {};
25
- for (const name of Object.keys(variants)) {
26
- const value = props[name] === void 0 ? defaults[name] : props[name];
27
- const chosen = key(value);
28
- selected[name] = chosen;
29
- if (chosen !== null) out.push(variants[name][chosen]);
30
- }
31
- for (const compound of def.compoundVariants ?? []) {
32
- if (matches(selected, compound)) {
33
- out.push(compound.class, compound.className);
34
- }
35
- }
36
- out.push(props.class, props.className);
37
- return out;
38
- }
39
- function extendRecipe(base, override) {
40
- if (!override) return base;
41
- const { reset, ...rest } = override;
42
- if (reset) return rest;
43
- const variants = {};
44
- for (const [name, values] of Object.entries(base.variants ?? {})) {
45
- variants[name] = { ...values };
46
- }
47
- for (const [name, values] of Object.entries(rest.variants ?? {})) {
48
- const target = variants[name] ??= {};
49
- for (const [value, classes] of Object.entries(values)) {
50
- target[value] = target[value] === void 0 ? classes : [target[value], classes];
51
- }
52
- }
53
- return {
54
- base: rest.base === void 0 ? base.base : [base.base, rest.base],
55
- variants,
56
- compoundVariants: [
57
- ...base.compoundVariants ?? [],
58
- ...rest.compoundVariants ?? []
59
- ],
60
- defaultVariants: {
61
- ...base.defaultVariants,
62
- ...rest.defaultVariants
63
- }
64
- };
65
- }
66
- function defineRecipe(def) {
67
- return def;
68
- }
69
- function compileRecipe(def, merge) {
70
- const recipe = ((props) => merge(...resolveRecipe(def, props)));
71
- Object.defineProperty(recipe, "def", { value: def, enumerable: true });
72
- return recipe;
73
- }
74
- function appendClasses(value, out) {
75
- if (!value) return out;
76
- if (typeof value === "string" || typeof value === "number") {
77
- return out ? `${out} ${value}` : String(value);
78
- }
79
- if (typeof value !== "object") return out;
80
- if (Array.isArray(value)) {
81
- return value.reduce(
82
- (next2, item) => appendClasses(item, next2),
83
- out
84
- );
85
- }
86
- const record = value;
87
- let next = out;
88
- for (const key2 of Object.keys(record)) {
89
- if (record[key2]) next = next ? `${next} ${key2}` : key2;
90
- }
91
- return next;
92
- }
93
- var joinClasses = (...inputs) => appendClasses(inputs, "");
94
- function createCn(vocabulary = {}) {
95
- const merge = extendTailwindMerge({
96
- extend: {
97
- theme: vocabulary.theme ?? {},
98
- classGroups: Object.fromEntries(
99
- Object.entries(vocabulary.classGroups ?? {}).map(([group, names]) => [
100
- group,
101
- [...names]
102
- ])
103
- )
104
- }
105
- });
106
- return (...inputs) => merge(joinClasses(...inputs));
107
- }
108
- var cn = createCn();
109
-
110
- export { cn, compileRecipe, createCn, defineRecipe, extendRecipe, joinClasses, resolveRecipe };
111
- //# sourceMappingURL=chunk-ICFPSAJZ.js.map
112
- //# sourceMappingURL=chunk-ICFPSAJZ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/foundation/recipes/recipe.ts","../src/foundation/recipes/cn.ts"],"names":["next","key"],"mappings":";;;AAwGA,IAAM,MAAM,CAAC,KAAA;AAAA;AAAA,EAEX,UAAU,IAAA,IAAQ,KAAA,KAAU,MAAA,GAAY,IAAA,GAAO,OAAO,KAAK;AAAA,CAAA;AAE7D,SAAS,OAAA,CACP,UACA,QAAA,EACS;AACT,EAAA,KAAA,MAAW,CAAC,IAAA,EAAM,MAAM,KAAK,MAAA,CAAO,OAAA,CAAQ,QAAQ,CAAA,EAAG;AACrD,IAAA,IAAI,IAAA,KAAS,OAAA,IAAW,IAAA,KAAS,WAAA,EAAa;AAC9C,IAAA,MAAM,MAAA,GAAS,QAAA,CAAS,IAAI,CAAA,IAAK,IAAA;AACjC,IAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,MAAM,CAAA,EAAG;AACzB,MAAA,IAAI,CAAC,MAAA,CAAO,IAAA,CAAK,CAAC,GAAA,KAAQ,IAAI,GAAG,CAAA,KAAM,MAAM,CAAA,EAAG,OAAO,KAAA;AAAA,IACzD,CAAA,MAAA,IAAW,GAAA,CAAI,MAAM,CAAA,KAAM,MAAA,EAAQ;AACjC,MAAA,OAAO,KAAA;AAAA,IACT;AAAA,EACF;AACA,EAAA,OAAO,IAAA;AACT;AAKO,SAAS,aAAA,CACd,GAAA,EACA,KAAA,GAAiC,EAAC,EACvB;AACX,EAAA,MAAM,GAAA,GAAiB,CAAC,GAAA,CAAI,IAAI,CAAA;AAChC,EAAA,MAAM,QAAA,GAAW,GAAA,CAAI,QAAA,IAAY,EAAC;AAClC,EAAA,MA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,CAAC,KAAA,EAAO,KAAK,CAAA,KAAM;AAAA,UACnE,KAAA;AAAA,UACA,CAAC,GAAG,KAAK;AAAA,SACV;AAAA;AACH;AACF,GACD,CAAA;AACD,EAAA,OAAO,IAAI,MAAA,KAAW,KAAA,CAAM,WAAA,CAAY,GAAG,MAAM,CAAC,CAAA;AACpD;AAKO,IAAM,KAAK,QAAA","file":"chunk-ICFPSAJZ.js","sourcesContent":["/**\n * A class value: strings and numbers, nested arrays, and objects whose keys\n * apply when their value is truthy (the `clsx` contract).\n */\nexport type Classes =\n | string\n | number\n | bigint\n | boolean\n | null\n | undefined\n | readonly Classes[]\n | Readonly<Record<string, unknown>>;\n\n/**\n * Variant names mapped to their values and the classes each applies.\n */\nexport type VariantMap = Readonly<\n Record<string, Readonly<Record<string, Classes>>>\n>;\n\ntype ValueOf<K> = K extends \"true\" | \"false\" ? boolean | K : K;\n\n/**\n * The props a recipe accepts to pick a value for each variant.\n */\nexport type SelectionOf<V> = {\n -readonly [K in keyof V]?: ValueOf<keyof V[K] & string> | null;\n};\n\ntype CompoundMatch<V> = {\n -readonly [K in keyof V]?:\n ValueOf<keyof V[K] & string> | readonly ValueOf<keyof V[K] & string>[];\n};\n\n/**\n * Classes applied only when several variant values match together.\n */\nexport type CompoundVariant<V> = CompoundMatch<V> & {\n readonly class?: Classes;\n readonly className?: Classes;\n};\n\n/**\n * The declarative description of a recipe: base classes, variants, compounds and defaults.\n */\nexport interface RecipeDef<V extends VariantMap = VariantMap> {\n readonly base?: Classes;\n readonly variants?: V;\n readonly compoundVariants?: readonly CompoundVariant<V>[];\n readonly defaultVariants?: SelectionOf<V>;\n}\n\n/**\n * A partial recipe definition that extends, or with `reset` replaces, a default one.\n */\nexport interface RecipeOverride<V extends VariantMap = VariantMap> {\n readonly reset?: boolean;\n readonly base?: Classes;\n readonly variants?: {\n readonly [K in keyof V]?: {\n readonly [Value in keyof V[K]]?: Classes;\n } & Readonly<Record<string, Classes>>;\n } & Readonly<Record<string, Readonly<Record<string, Classes>>>>;\n readonly compoundVariants?: readonly ({\n readonly class?: Classes;\n readonly className?: Classes;\n } & Readonly<Record<string, unknown>>)[];\n readonly defaultVariants?: Readonly<Record<string, unknown>>;\n}\n\nexport type VariantsOf<R> = R extends { readonly variants?: infer V }\n ? V extends VariantMap\n ? V\n : {}\n : {};\n\ntype Union<A, B> = {\n readonly [K in keyof A | keyof B]: (K extends keyof A ? A[K] : {}) &\n (K extends keyof B ? B[K] : {});\n};\n\nexport type MergedVariants<D, O> = O extends { readonly reset: true }\n ? VariantsOf<O>\n : Union<VariantsOf<D>, VariantsOf<O>>;\n\n/**\n * A compiled recipe: call it with variant props to get a class string.\n */\nexport interface Recipe<V = VariantMap> {\n (\n props?: SelectionOf<V> & {\n readonly class?: Classes;\n readonly className?: Classes;\n },\n ): string;\n readonly def: RecipeDef;\n}\n\n/**\n * The variant props accepted by a recipe type.\n */\nexport type RecipeProps<R> = R extends Recipe<infer V> ? SelectionOf<V> : never;\n\nconst key = (value: unknown): string | null =>\n // eslint-disable-next-line @typescript-eslint/no-base-to-string -- any value is accepted; objects become \"[object Object]\"\n value === null || value === undefined ? null : String(value);\n\nfunction matches(\n selected: Record<string, string | null>,\n compound: Record<string, unknown>,\n): boolean {\n for (const [name, wanted] of Object.entries(compound)) {\n if (name === \"class\" || name === \"className\") continue;\n const actual = selected[name] ?? null;\n if (Array.isArray(wanted)) {\n if (!wanted.some((one) => key(one) === actual)) return false;\n } else if (key(wanted) !== actual) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Resolves a recipe definition and props to the ordered class list before merging.\n */\nexport function resolveRecipe(\n def: RecipeDef,\n props: Record<string, unknown> = {},\n): Classes[] {\n const out: Classes[] = [def.base];\n const variants = def.variants ?? {};\n const defaults = (def.defaultVariants ?? {}) as Record<string, unknown>;\n const selected: Record<string, string | null> = {};\n\n for (const name of Object.keys(variants)) {\n const value = props[name] === undefined ? defaults[name] : props[name];\n const chosen = key(value);\n selected[name] = chosen;\n if (chosen !== null) out.push(variants[name][chosen]);\n }\n for (const compound of def.compoundVariants ?? []) {\n if (matches(selected, compound)) {\n out.push(compound.class, compound.className);\n }\n }\n out.push(props.class as Classes, props.className as Classes);\n return out;\n}\n\n/**\n * Combines a default recipe definition with an override.\n */\nexport function extendRecipe(\n base: RecipeDef,\n override: RecipeOverride | undefined,\n): RecipeDef {\n if (!override) return base;\n const { reset, ...rest } = override;\n if (reset) return rest as RecipeDef;\n\n const variants: Record<string, Record<string, Classes>> = {};\n for (const [name, values] of Object.entries(base.variants ?? {})) {\n variants[name] = { ...values };\n }\n for (const [name, values] of Object.entries(rest.variants ?? {})) {\n const target = (variants[name] ??= {});\n for (const [value, classes] of Object.entries(values)) {\n target[value] =\n target[value] === undefined ? classes : [target[value], classes];\n }\n }\n\n return {\n base: rest.base === undefined ? base.base : [base.base, rest.base],\n variants,\n compoundVariants: [\n ...(base.compoundVariants ?? []),\n ...((rest.compoundVariants ?? []) as RecipeDef[\"compoundVariants\"] &\n object),\n ],\n defaultVariants: {\n ...base.defaultVariants,\n ...(rest.defaultVariants as RecipeDef[\"defaultVariants\"]),\n },\n };\n}\n\n/**\n * Declares a recipe definition with its variant types inferred.\n */\nexport function defineRecipe<const V extends VariantMap = {}>(\n def: RecipeDef<V>,\n): RecipeDef<V> {\n return def;\n}\n\n/**\n * Turns a recipe definition into a callable recipe using the given class merger.\n */\nexport function compileRecipe<V>(\n def: RecipeDef,\n merge: (...inputs: Classes[]) => string,\n): Recipe<V> {\n const recipe = ((props?: Record<string, unknown>) =>\n merge(...resolveRecipe(def, props))) as Recipe<V>;\n Object.defineProperty(recipe, \"def\", { value: def, enumerable: true });\n return recipe;\n}\n\nfunction appendClasses(value: Classes, out: string): string {\n if (!value) return out;\n if (typeof value === \"string\" || typeof value === \"number\") {\n return out ? `${out} ${value}` : String(value);\n }\n if (typeof value !== \"object\") return out;\n if (Array.isArray(value)) {\n return (value as readonly Classes[]).reduce<string>(\n (next, item) => appendClasses(item, next),\n out,\n );\n }\n const record = value as Readonly<Record<string, unknown>>;\n let next = out;\n for (const key of Object.keys(record)) {\n if (record[key]) next = next ? `${next} ${key}` : key;\n }\n return next;\n}\n\n/**\n * Joins class values without Tailwind conflict resolution.\n */\nexport const joinClasses = (...inputs: Classes[]): string =>\n appendClasses(inputs, \"\");\n","import { extendTailwindMerge } from \"tailwind-merge\";\n\nimport { type Classes, joinClasses } from \"./recipe\";\n\n/**\n * Extra Tailwind theme values and class groups that `cn` should merge correctly.\n */\nexport interface MergeVocabulary {\n readonly theme?: Readonly<Record<string, readonly string[]>>;\n readonly classGroups?: Readonly<Record<string, readonly string[]>>;\n}\n\n/**\n * Creates a class-name joiner that also resolves Tailwind conflicts using the given vocabulary.\n */\nexport function createCn(\n vocabulary: MergeVocabulary = {},\n): (...inputs: Classes[]) => string {\n const merge = extendTailwindMerge({\n extend: {\n theme: vocabulary.theme ?? {},\n classGroups: Object.fromEntries(\n Object.entries(vocabulary.classGroups ?? {}).map(([group, names]) => [\n group,\n [...names],\n ]),\n ),\n },\n });\n return (...inputs) => merge(joinClasses(...inputs));\n}\n\n/**\n * Joins class values and resolves Tailwind conflicts (default vocabulary).\n */\nexport const cn = createCn();\n"]}
@@ -1,140 +0,0 @@
1
- import { useUi, Loader } from './chunk-6LWCTP2Y.js';
2
- import { c } from 'react/compiler-runtime';
3
- import NextLink from 'next/link';
4
- import { jsxs, jsx } from 'react/jsx-runtime';
5
-
6
- // src/foundation/recipes/split.ts
7
- var names = /* @__PURE__ */ new WeakMap();
8
- function variantNames(recipe) {
9
- const def = recipe.def;
10
- let list = names.get(def);
11
- if (!list) {
12
- list = Object.keys(def.variants ?? {});
13
- names.set(def, list);
14
- }
15
- return list;
16
- }
17
- function splitVariants(props, ...recipes) {
18
- const variants = {};
19
- const rest = { ...props };
20
- for (const recipe of recipes) {
21
- for (const name of variantNames(recipe)) {
22
- if (name in rest) {
23
- variants[name] = rest[name];
24
- delete rest[name];
25
- }
26
- }
27
- }
28
- return [variants, rest];
29
- }
30
- function Button(t0) {
31
- const $ = c(26);
32
- const {
33
- children,
34
- className,
35
- loading: t1,
36
- ...props
37
- } = t0;
38
- const loading = t1 === void 0 ? false : t1;
39
- const {
40
- parts
41
- } = useUi();
42
- const [variants, element] = splitVariants(props, parts.button.root);
43
- const classes = variants.intent == null ? parts.button.bare({
44
- className
45
- }) : parts.button.root({
46
- ...variants,
47
- className
48
- });
49
- let t2;
50
- if ($[0] !== children || $[1] !== loading || $[2] !== parts.button) {
51
- t2 = loading ? /* @__PURE__ */ jsxs("span", { className: parts.button.busy(), children: [
52
- /* @__PURE__ */ jsx("span", { className: parts.button.busyLabel(), children }),
53
- /* @__PURE__ */ jsx("span", { className: parts.button.busySpinner(), children: /* @__PURE__ */ jsx(Loader, {}) })
54
- ] }) : children;
55
- $[0] = children;
56
- $[1] = loading;
57
- $[2] = parts.button;
58
- $[3] = t2;
59
- } else {
60
- t2 = $[3];
61
- }
62
- const content = t2;
63
- if (element.href != null) {
64
- const t32 = element;
65
- let link;
66
- let ref;
67
- if ($[4] !== t32) {
68
- ({
69
- ref,
70
- ...link
71
- } = t32);
72
- $[4] = t32;
73
- $[5] = link;
74
- $[6] = ref;
75
- } else {
76
- link = $[5];
77
- ref = $[6];
78
- }
79
- const t42 = loading ? true : void 0;
80
- let t52;
81
- if ($[7] !== classes || $[8] !== content || $[9] !== link || $[10] !== ref || $[11] !== t42) {
82
- t52 = /* @__PURE__ */ jsx(NextLink, { ...link, "aria-busy": t42, className: classes, ref, children: content });
83
- $[7] = classes;
84
- $[8] = content;
85
- $[9] = link;
86
- $[10] = ref;
87
- $[11] = t42;
88
- $[12] = t52;
89
- } else {
90
- t52 = $[12];
91
- }
92
- return t52;
93
- }
94
- const t3 = element;
95
- let button;
96
- let ref_0;
97
- let t4;
98
- let t5;
99
- if ($[13] !== t3) {
100
- ({
101
- disabled: t4,
102
- ref: ref_0,
103
- type: t5,
104
- ...button
105
- } = t3);
106
- $[13] = t3;
107
- $[14] = button;
108
- $[15] = ref_0;
109
- $[16] = t4;
110
- $[17] = t5;
111
- } else {
112
- button = $[14];
113
- ref_0 = $[15];
114
- t4 = $[16];
115
- t5 = $[17];
116
- }
117
- const disabled = t4 === void 0 ? false : t4;
118
- const type = t5 === void 0 ? "button" : t5;
119
- const t6 = loading ? true : void 0;
120
- const t7 = disabled || loading;
121
- let t8;
122
- if ($[18] !== button || $[19] !== classes || $[20] !== content || $[21] !== ref_0 || $[22] !== t6 || $[23] !== t7 || $[24] !== type) {
123
- t8 = /* @__PURE__ */ jsx("button", { ...button, "aria-busy": t6, className: classes, disabled: t7, ref: ref_0, type, children: content });
124
- $[18] = button;
125
- $[19] = classes;
126
- $[20] = content;
127
- $[21] = ref_0;
128
- $[22] = t6;
129
- $[23] = t7;
130
- $[24] = type;
131
- $[25] = t8;
132
- } else {
133
- t8 = $[25];
134
- }
135
- return t8;
136
- }
137
-
138
- export { Button, splitVariants, variantNames };
139
- //# sourceMappingURL=chunk-S2ZOLTTS.js.map
140
- //# sourceMappingURL=chunk-S2ZOLTTS.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/foundation/recipes/split.ts","../src/react/ui/components/button.tsx"],"names":["Button","t0","$","_c","children","className","loading","t1","props","undefined","parts","useUi","variants","element","splitVariants","button","root","classes","intent","bare","t2","busy","busyLabel","busySpinner","content","href","t3","link","ref","t4","t5","ref_0","disabled","type","t6","t7","t8"],"mappings":";;;;;;AAEA,IAAM,KAAA,uBAAY,OAAA,EAAmC;AAK9C,SAAS,aAAa,MAAA,EAAmC;AAC9D,EAAA,MAAM,MAAM,MAAA,CAAO,GAAA;AACnB,EAAA,IAAI,IAAA,GAAO,KAAA,CAAM,GAAA,CAAI,GAAG,CAAA;AACxB,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA,IAAA,GAAO,MAAA,CAAO,IAAA,CAAK,GAAA,CAAI,QAAA,IAAY,EAAE,CAAA;AACrC,IAAA,KAAA,CAAM,GAAA,CAAI,KAAK,IAAI,CAAA;AA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AA,EAAA,CAAA,KAAAe,OAAAA,IAAAf,CAAAA,CAAA,EAAA,CAAA,KAAAsB,OAAAA,IAAAtB,CAAAA,CAAA,EAAA,CAAA,KAAA6B,KAAAA,IAAA7B,CAAAA,CAAA,EAAA,CAAA,KAAAgC,EAAAA,IAAAhC,CAAAA,CAAA,EAAA,CAAA,KAAAiC,EAAAA,IAAAjC,CAAAA,CAAA,EAAA,CAAA,KAAA+B,IAAAA,EAAA;AAJ/BG,IAAAA,EAAAA,mBAAA,GAAA,CAAA,QAAA,EAAA,EASS,GARHrB,MAAAA,EACO,WAAA,EAAAmB,EAAAA,EACAjB,SAAAA,EAAAA,OAAAA,EACD,QAAA,EAAAkB,EAAAA,EACLP,GAAAA,EAAAA,KAAAA,EACCK,MAELT,QAAAA,EAAAA,OAAAA,EACH,CAAA;AAAStB,IAAAA,CAAAA,CAAA,EAAA,CAAA,GAAAa,MAAAA;AAAAb,IAAAA,CAAAA,CAAA,EAAA,CAAA,GAAAe,OAAAA;AAAAf,IAAAA,CAAAA,CAAA,EAAA,CAAA,GAAAsB,OAAAA;AAAAtB,IAAAA,CAAAA,CAAA,EAAA,CAAA,GAAA6B,KAAAA;AAAA7B,IAAAA,CAAAA,CAAA,EAAA,CAAA,GAAAgC,EAAAA;AAAAhC,IAAAA,CAAAA,CAAA,EAAA,CAAA,GAAAiC,EAAAA;AAAAjC,IAAAA,CAAAA,CAAA,EAAA,CAAA,GAAA+B,IAAAA;AAAA/B,IAAAA,CAAAA,CAAA,EAAA,CAAA,GAAAkC,EAAAA;EAAA,CAAA,MAAA;AAAAA,IAAAA,EAAAA,GAAAlC,EAAA,EAAA,CAAA;AAAA,EAAA;AAAA,EAAA,OATTkC,EAAAA;AASS","file":"chunk-S2ZOLTTS.js","sourcesContent":["import type { Recipe } from \"./recipe\";\n\nconst names = new WeakMap<object, readonly string[]>();\n\n/**\n * Lists the variant names a recipe accepts.\n */\nexport function variantNames(recipe: Recipe): readonly string[] {\n const def = recipe.def;\n let list = names.get(def);\n if (!list) {\n list = Object.keys(def.variants ?? {});\n names.set(def, list);\n }\n return list;\n}\n\n/**\n * Separates the variant props of the given recipes from the remaining props.\n */\nexport function splitVariants<P extends Record<string, unknown>>(\n props: P,\n ...recipes: Recipe[]\n): [variants: Record<string, unknown>, rest: P] {\n const variants: Record<string, unknown> = {};\n const rest: Record<string, unknown> = { ...props };\n for (const recipe of recipes) {\n for (const name of variantNames(recipe)) {\n if (name in rest) {\n variants[name] = rest[name];\n delete rest[name];\n }\n }\n }\n return [variants, rest as P];\n}\n","\"use client\";\n\nimport NextLink from \"next/link\";\n\nimport { splitVariants } from \"@/foundation/recipes/split\";\nimport type {\n ButtonBaseProps,\n ButtonElementProps,\n ButtonLinkProps,\n ButtonProps,\n} from \"@/react/ui/types\";\n\nimport { useUi } from \"../provider\";\nimport { Loader } from \"./loader\";\n\n/**\n * A button, or a link when `href` is set, with an optional busy state.\n */\nexport function Button({\n children,\n className,\n loading = false,\n ...props\n}: ButtonProps) {\n const { parts } = useUi();\n const [variants, element] = splitVariants(\n props as Record<string, unknown>,\n parts.button.root,\n );\n const classes =\n variants.intent == null\n ? parts.button.bare({ className })\n : parts.button.root({ ...variants, className });\n const content = loading ? (\n <span className={parts.button.busy()}>\n <span className={parts.button.busyLabel()}>{children}</span>\n <span className={parts.button.busySpinner()}>\n <Loader />\n </span>\n </span>\n ) : (\n children\n );\n\n if (element.href != null) {\n const { ref, ...link } = element as Omit<\n ButtonLinkProps,\n keyof ButtonBaseProps\n >;\n return (\n <NextLink\n {...link}\n aria-busy={loading ? true : undefined}\n className={classes}\n ref={ref}\n >\n {content}\n </NextLink>\n );\n }\n\n const {\n disabled = false,\n ref,\n type = \"button\",\n ...button\n } = element as Omit<ButtonElementProps, keyof ButtonBaseProps>;\n return (\n <button\n {...button}\n aria-busy={loading ? true : undefined}\n className={classes}\n disabled={disabled || loading}\n ref={ref}\n type={type}\n >\n {content}\n </button>\n );\n}\n"]}
@@ -1,139 +0,0 @@
1
- /**
2
- * The built-in component parts and their variants that `defineUi` can restyle.
3
- */
4
- export declare const ANATOMY: {
5
- readonly button: {
6
- readonly root: import("./recipe").RecipeDef<{
7
- readonly intent: {};
8
- }>;
9
- readonly bare: import("./recipe").RecipeDef<{}>;
10
- readonly busy: import("./recipe").RecipeDef<{}>;
11
- readonly busyLabel: import("./recipe").RecipeDef<{}>;
12
- readonly busySpinner: import("./recipe").RecipeDef<{}>;
13
- };
14
- readonly input: {
15
- readonly field: import("./recipe").RecipeDef<{}>;
16
- readonly area: import("./recipe").RecipeDef<{}>;
17
- };
18
- readonly switch: {
19
- readonly track: import("./recipe").RecipeDef<{}>;
20
- readonly thumb: import("./recipe").RecipeDef<{}>;
21
- };
22
- readonly checkbox: {
23
- readonly root: import("./recipe").RecipeDef<{}>;
24
- readonly box: import("./recipe").RecipeDef<{
25
- readonly checked: {
26
- readonly false: "";
27
- readonly true: "";
28
- };
29
- }>;
30
- readonly glyph: import("./recipe").RecipeDef<{
31
- readonly checked: {
32
- readonly false: "";
33
- readonly true: "";
34
- };
35
- }>;
36
- };
37
- readonly segmented: {
38
- readonly root: import("./recipe").RecipeDef<{}>;
39
- readonly segment: import("./recipe").RecipeDef<{
40
- readonly active: {
41
- readonly false: "";
42
- readonly true: "";
43
- };
44
- }>;
45
- readonly pill: import("./recipe").RecipeDef<{}>;
46
- readonly chosen: import("./recipe").RecipeDef<{}>;
47
- readonly icon: import("./recipe").RecipeDef<{}>;
48
- readonly count: import("./recipe").RecipeDef<{}>;
49
- };
50
- readonly select: {
51
- readonly root: import("./recipe").RecipeDef<{}>;
52
- readonly trigger: import("./recipe").RecipeDef<{}>;
53
- readonly value: import("./recipe").RecipeDef<{}>;
54
- readonly label: import("./recipe").RecipeDef<{}>;
55
- readonly placeholder: import("./recipe").RecipeDef<{}>;
56
- readonly chevron: import("./recipe").RecipeDef<{}>;
57
- readonly menu: import("./recipe").RecipeDef<{}>;
58
- readonly option: import("./recipe").RecipeDef<{}>;
59
- readonly highlight: import("./recipe").RecipeDef<{}>;
60
- readonly optionBody: import("./recipe").RecipeDef<{}>;
61
- readonly text: import("./recipe").RecipeDef<{}>;
62
- readonly description: import("./recipe").RecipeDef<{}>;
63
- readonly icon: import("./recipe").RecipeDef<{}>;
64
- readonly check: import("./recipe").RecipeDef<{}>;
65
- readonly empty: import("./recipe").RecipeDef<{}>;
66
- };
67
- readonly carousel: {
68
- readonly root: import("./recipe").RecipeDef<{}>;
69
- readonly track: import("./recipe").RecipeDef<{}>;
70
- readonly slide: import("./recipe").RecipeDef<{}>;
71
- readonly arrow: import("./recipe").RecipeDef<{
72
- readonly side: {
73
- readonly left: "";
74
- readonly right: "";
75
- };
76
- readonly visible: {
77
- readonly false: "";
78
- readonly true: "";
79
- };
80
- }>;
81
- readonly icon: import("./recipe").RecipeDef<{}>;
82
- };
83
- readonly tooltip: {
84
- readonly content: import("./recipe").RecipeDef<{}>;
85
- readonly label: import("./recipe").RecipeDef<{}>;
86
- };
87
- readonly loader: {
88
- readonly root: import("./recipe").RecipeDef<{
89
- readonly over: {
90
- readonly false: "";
91
- readonly true: "";
92
- };
93
- }>;
94
- readonly label: import("./recipe").RecipeDef<{}>;
95
- readonly overlay: import("./recipe").RecipeDef<{}>;
96
- readonly dots: import("./recipe").RecipeDef<{}>;
97
- readonly dot: import("./recipe").RecipeDef<{}>;
98
- readonly spinner: import("./recipe").RecipeDef<{}>;
99
- readonly icon: import("./recipe").RecipeDef<{}>;
100
- };
101
- readonly skeleton: {
102
- readonly block: import("./recipe").RecipeDef<{}>;
103
- readonly lines: import("./recipe").RecipeDef<{}>;
104
- readonly line: import("./recipe").RecipeDef<{}>;
105
- readonly bar: import("./recipe").RecipeDef<{}>;
106
- };
107
- readonly image: {
108
- readonly frame: import("./recipe").RecipeDef<{
109
- readonly layout: {
110
- readonly fill: "";
111
- readonly intrinsic: "";
112
- };
113
- readonly loading: {
114
- readonly false: "";
115
- readonly true: "";
116
- };
117
- }>;
118
- readonly picture: import("./recipe").RecipeDef<{
119
- readonly layout: {
120
- readonly fill: "";
121
- readonly intrinsic: "";
122
- };
123
- }>;
124
- readonly fallback: import("./recipe").RecipeDef<{}>;
125
- };
126
- readonly avatar: {
127
- readonly root: import("./recipe").RecipeDef<{}>;
128
- readonly image: import("./recipe").RecipeDef<{}>;
129
- readonly initials: import("./recipe").RecipeDef<{}>;
130
- };
131
- readonly highlight: {
132
- readonly fill: import("./recipe").RecipeDef<{}>;
133
- };
134
- };
135
- /**
136
- * Type of `ANATOMY`.
137
- */
138
- export type Anatomy = typeof ANATOMY;
139
- //# sourceMappingURL=anatomy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"anatomy.d.ts","sourceRoot":"","sources":["../../../src/foundation/recipes/anatomy.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmEV,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC"}
@@ -1,133 +0,0 @@
1
- import type { UiRegister } from "./";
2
- import { type Anatomy } from "./anatomy";
3
- import { type MergeVocabulary } from "./cn";
4
- import { type Classes, type MergedVariants, type Recipe, type RecipeDef, type RecipeOverride, type VariantsOf } from "./recipe";
5
- type Ease = readonly [number, number, number, number];
6
- /**
7
- * A motion transition object.
8
- */
9
- export type UiTransition = Readonly<Record<string, unknown>>;
10
- /**
11
- * Named motion variants, each a transition or a function of a custom index.
12
- */
13
- export type UiVariants = Readonly<Record<string, UiTransition | ((custom: number) => UiTransition)>>;
14
- /**
15
- * Motion settings that components read from the UI definition.
16
- */
17
- export interface UiMotion {
18
- readonly follow?: UiTransition;
19
- readonly menu?: UiVariants;
20
- readonly option?: UiVariants;
21
- readonly glide?: {
22
- readonly duration: number;
23
- readonly ease: Ease;
24
- };
25
- }
26
- /**
27
- * Icon names that components use for built-in glyphs.
28
- */
29
- export interface UiIcons {
30
- readonly check?: string;
31
- readonly selected?: string;
32
- readonly chevron?: string;
33
- readonly previous?: string;
34
- readonly next?: string;
35
- readonly spinner?: string;
36
- }
37
- /**
38
- * Default texts used by components.
39
- */
40
- export interface UiLabels {
41
- readonly loading: string;
42
- readonly placeholder: string;
43
- readonly empty: string;
44
- readonly previous: string;
45
- readonly next: string;
46
- }
47
- /**
48
- * The labels used when the UI definition does not override them.
49
- */
50
- export declare const DEFAULT_LABELS: UiLabels;
51
- type Parts = Readonly<Record<string, unknown>>;
52
- type Registry = Readonly<Record<string, Parts>>;
53
- /**
54
- * Per-component, per-part recipe overrides.
55
- */
56
- export type UiPartOverrides<D extends Registry = Anatomy> = {
57
- readonly [C in keyof D]?: {
58
- readonly [P in keyof D[C]]?: RecipeOverride<VariantsOf<D[C][P]>>;
59
- };
60
- } & Readonly<Record<string, Readonly<Record<string, RecipeOverride | RecipeDef>> | undefined>>;
61
- /**
62
- * Input of `defineUi`: part overrides, merge vocabulary, motion, icons and labels.
63
- */
64
- export interface UiConfig {
65
- readonly parts?: UiPartOverrides;
66
- readonly merge?: MergeVocabulary;
67
- readonly motion?: UiMotion;
68
- readonly icons?: UiIcons;
69
- readonly labels?: Partial<UiLabels>;
70
- }
71
- type MergedParts<D extends Parts, O> = {
72
- readonly [P in keyof D | keyof O]: Recipe<P extends keyof D ? P extends keyof O ? MergedVariants<D[P], O[P]> : VariantsOf<D[P]> : P extends keyof O ? VariantsOf<O[P]> : {}>;
73
- };
74
- type PartsOverride<O, C> = O extends {
75
- readonly parts?: infer X;
76
- } ? C extends keyof X ? NonNullable<X[C]> : {} : {};
77
- /**
78
- * The compiled recipes of every component part, including app-defined ones.
79
- */
80
- export type UiParts<O = {}> = {
81
- readonly [C in keyof Anatomy | Exclude<keyof NonNullable<O extends {
82
- parts?: infer X;
83
- } ? X : {}>, number | symbol>]: C extends keyof Anatomy ? MergedParts<Anatomy[C], PartsOverride<O, C>> : MergedParts<{}, PartsOverride<O, C>>;
84
- };
85
- /**
86
- * A compiled UI definition: part recipes, class joiner, motion, icons and labels.
87
- */
88
- export interface Ui<O = {}> {
89
- readonly parts: UiParts<O>;
90
- readonly cn: (...inputs: Classes[]) => string;
91
- readonly motion: UiMotion;
92
- readonly icons: UiIcons;
93
- readonly labels: UiLabels;
94
- readonly config: UiConfig;
95
- }
96
- /**
97
- * Compiles a UI definition from the built-in anatomy and the given overrides.
98
- */
99
- export declare function defineUi<const O extends UiConfig = {}>(config?: O): Ui<O>;
100
- /**
101
- * The UI definition used when the app does not provide one.
102
- */
103
- export declare const defaultUi: Ui<{}>;
104
- /**
105
- * The app's UI definition type, taken from the `UiRegister` augmentation.
106
- */
107
- export type RegisteredUi = UiRegister extends {
108
- ui: infer U;
109
- } ? U : typeof defaultUi;
110
- type RegisteredParts = RegisteredUi extends {
111
- parts: infer P;
112
- } ? P : never;
113
- /**
114
- * The variant props of one part of one component.
115
- */
116
- export type PartProps<C extends keyof RegisteredParts, P extends keyof RegisteredParts[C]> = RegisteredParts[C][P] extends Recipe<infer V> ? {
117
- -readonly [K in keyof V]?: keyof V[K] & string extends infer Key ? Key extends "true" | "false" ? boolean : Key : never;
118
- } : never;
119
- /**
120
- * Extra class names keyed by part name for one component.
121
- */
122
- export type PartClassNames<C extends keyof RegisteredParts> = {
123
- readonly [P in keyof RegisteredParts[C]]?: string;
124
- };
125
- type Choices<T, K> = K extends keyof T ? NonNullable<T[K]> : never;
126
- /**
127
- * The combined variant props of several parts of one component.
128
- */
129
- export type PartsProps<C extends keyof RegisteredParts, P extends keyof RegisteredParts[C]> = {
130
- -readonly [K in P extends unknown ? keyof PartProps<C, P> : never]?: P extends unknown ? Choices<PartProps<C, P>, K> : never;
131
- };
132
- export {};
133
- //# sourceMappingURL=define.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../../src/foundation/recipes/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GAC1B,OAAO,GACP,GAAG,GACL,KAAK;CACV,GACD,KAAK,CAAC;AAEZ;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,eAAe,IAAI;IAC5D,QAAQ,EAAE,CAAC,IAAI,MAAM,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM;CAClD,CAAC;AAEF,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,UAAU,CACpB,CAAC,SAAS,MAAM,eAAe,EAC/B,CAAC,SAAS,MAAM,eAAe,CAAC,CAAC,CAAC,IAChC;IACF,CAAC,UACC,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CACvD,CAAC,EAAE,CAAC,SAAS,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK;CAC5D,CAAC"}
@@ -1,14 +0,0 @@
1
- export { Modal } from './chunk-GTJMM32W.js';
2
- import './chunk-KN4KOTC7.js';
3
- import './chunk-ST7QOM4O.js';
4
- import './chunk-ED32WLAD.js';
5
- import './chunk-JWUKAZ3A.js';
6
- import './chunk-S2ZOLTTS.js';
7
- import './chunk-6LWCTP2Y.js';
8
- import './chunk-ICFPSAJZ.js';
9
- import './chunk-3JLG24KI.js';
10
- import './chunk-S67HGKJ2.js';
11
- import './chunk-J3VTDBC6.js';
12
- import './chunk-YHWA7FXX.js';
13
- //# sourceMappingURL=overlay-YMLS3SAQ.js.map
14
- //# sourceMappingURL=overlay-YMLS3SAQ.js.map
@@ -1,10 +0,0 @@
1
- import type { AvatarProps } from "../types";
2
- /**
3
- * A round image with an initials fallback when the image is missing or fails.
4
- */
5
- export declare function Avatar({ alt, children, className, classNames, fallback, name, ref, size, src, style, ...props }: AvatarProps): import("react").JSX.Element;
6
- /**
7
- * Up to two uppercase initials for a name, or "?" when there is none.
8
- */
9
- export declare function initialsOf(name?: string): string;
10
- //# sourceMappingURL=avatar.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../../src/react/ui/components/avatar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAOpD;;GAEG;AACH,wBAAgB,MAAM,CAAC,EACrB,GAAG,EACH,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,GAAG,EACH,KAAK,EACL,GAAG,KAAK,EACT,EAAE,WAAW,+BA+Bb;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAKhD"}
@@ -1,6 +0,0 @@
1
- import type { ButtonProps } from "../types";
2
- /**
3
- * A button, or a link when `href` is set, with an optional busy state.
4
- */
5
- export declare function Button({ children, className, loading, ...props }: ButtonProps): import("react").JSX.Element;
6
- //# sourceMappingURL=button.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/react/ui/components/button.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAIV,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAK1B;;GAEG;AACH,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,SAAS,EACT,OAAe,EACf,GAAG,KAAK,EACT,EAAE,WAAW,+BAwDb"}
@@ -1,27 +0,0 @@
1
- import { type RefObject } from "react";
2
- import type { CarouselProps, ScrollState } from "../types";
3
- /**
4
- * Default selector for the element inside a carousel slide that the clip follows.
5
- */
6
- export declare const FRAME_SELECTOR = "[data-carousel-frame]";
7
- /**
8
- * Whether a horizontal track can scroll further left and right.
9
- */
10
- export declare function readScroll(track: HTMLElement): ScrollState;
11
- /**
12
- * The scrollLeft a carousel should glide to for one step in a direction, snapping to slide edges.
13
- */
14
- export declare function glideTarget(track: HTMLElement, direction: -1 | 1): number;
15
- /**
16
- * A CSS clip-path that rounds the corners of a carousel frame inside its track, or null when not needed.
17
- */
18
- export declare function rackClip(track: HTMLElement, selector?: string): string | null;
19
- /**
20
- * Lets a mouse drag scroll the referenced horizontal track, suppressing the click that ends a drag.
21
- */
22
- export declare function useDragScroll(ref: RefObject<HTMLElement | null>): void;
23
- /**
24
- * A horizontally scrolling row of slides with arrows, drag scrolling and an end callback.
25
- */
26
- export declare function Carousel({ arrowClassName, children, className, classNames, frameSelector, glide, itemClassName, label, onNearEnd, ready, renderSlide, trackProps, }: CarouselProps): import("react").JSX.Element;
27
- //# sourceMappingURL=carousel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../../src/react/ui/components/carousel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EACV,aAAa,EAEb,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAoB1B;;GAEG;AACH,eAAO,MAAM,cAAc,0BAA0B,CAAC;AAItD;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,CAM1D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CA8BzE;AAqCD;;GAEG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,WAAW,EAClB,QAAQ,SAAiB,GACxB,MAAM,GAAG,IAAI,CAaf;AAsBD;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,IAAI,CA+CtE;AAkDD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EACvB,cAAc,EACd,QAAQ,EACR,SAAS,EACT,UAAe,EACf,aAA8B,EAC9B,KAAK,EACL,aAAa,EACb,KAAK,EACL,SAAS,EACT,KAAY,EACZ,WAA0B,EAC1B,UAAU,GACX,EAAE,aAAa,+BAmHf"}