@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
package/MIGRATION.md DELETED
@@ -1,99 +0,0 @@
1
- # Migrating from 3.x to 3.2
2
-
3
- 3.2 reorganises the package into layers and tidies the public surface. Most of the change is where you import from and a few removed names. Runtime behaviour is the same apart from one bug fix (see [Fixed](#fixed)) and the components that are no longer `memo()`.
4
-
5
- ## The framework holds no design
6
-
7
- Coming from 3.1.0, note that 3.2 also includes an unreleased step in which every visual decision moved to the app:
8
-
9
- - `./styles.css`, the `styles/` folder, design tokens (`Z_INDEX`, motion presets), default recipes, tones, default motion, icon names and `templates/motion` are removed. Supply them from your app's `ui`.
10
- - Atoms and `utils/cn` are removed. Use the vocabulary-free `cn` and the `./ui` components (`Button`, `Icon`, `Loader`, `Tooltip`). `Button` takes `href` to render a link.
11
- - Components ship an anatomy of empty parts plus the states they set (`checked`, `active`, `visible`, `loading`). Without a `ui`, they render no classes.
12
- - Component motion comes from `motion/react` variants in your `ui`. A missing key means no animation, and reduced motion uses your `still` variant.
13
- - Modules take stacking from theme styles (the modal reads `styles.layer`). The dock loader is now a `surfaceLoader` slot.
14
- - `defineMotion`, `retime`, `gpuTransform` and `cssTransition` live in the server-safe `./utils` entry.
15
-
16
- The subpath table below maps the previous build's layout. In it, the `./design` paths correspond to 3.1.0's `./ui`.
17
-
18
- ## Requirements
19
-
20
- - Node `>=22` (see `engines` in `package.json`).
21
- - React and React DOM `>=19.2.0` (peer dependencies; 3.x accepted `>=19.0.0`). 3.2 uses `useEffectEvent`, which is stable only from React 19.2. If you are on React 19.0 or 19.1, upgrade `react` and `react-dom` first.
22
-
23
- ## Subpath changes
24
-
25
- | 3.x | 3.2 |
26
- | ---------------------------------------- | --------------------------------------------- |
27
- | `.` | `.` |
28
- | `./result` | `./result` |
29
- | `./events` | `./events` |
30
- | `./utils` | `./utils` |
31
- | `./design/recipes` | **`./recipes`** |
32
- | `./hooks` | `./hooks` |
33
- | `./theme` | `./theme` |
34
- | `./design` | **`./ui`** |
35
- | `./kernel` | `./kernel` |
36
- | `./error` | `./error` |
37
- | `./provider` | `./provider` |
38
- | `./modules` | `./modules` |
39
- | `./dock` ... `./navigation` (10 modules) | unchanged |
40
- | `./ambient/server`, `./ambient/worker` | unchanged |
41
- | `./modules/*` | **removed** (use `./<module>` or `./modules`) |
42
-
43
- Notes:
44
-
45
- - `./ui` exports only the UI components and `UiProvider`. For convenience it also re-exports `./recipes`, which 3.x served from `./design`.
46
- - `getOrCreateGlobalContext` is still re-exported from `./kernel`.
47
-
48
- ## Removed names
49
-
50
- | Removed | Replacement |
51
- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
52
- | `useModuleTheme` (from `./theme` and `.`) | `useTheme`, same signature and behaviour |
53
- | `useIsomorphicLayoutEffect` (from `./hooks` and `.`) | `useLayoutEffect` from `react`. React 19 no longer warns about `useLayoutEffect` during server rendering. |
54
-
55
- ## Fixed
56
-
57
- - The YouTube background's companion audio volume now falls back to `1` when the video's volume is unset. In 3.x the fallback never applied, because `Number(video.volume) ?? 1` ignores `NaN`.
58
-
59
- ## Components that are no longer `memo()`
60
-
61
- These public components were wrapped in `React.memo` in 3.x and are now plain function components:
62
-
63
- - `DockCardBanner`, `DockCardHeader`, `DockDescription`, `DockIcon`, `DockTitle` (from `./dock`)
64
- - `YouTubeBackgroundPlayer` (from `./background`)
65
-
66
- Rendering is the same. What changes:
67
-
68
- - Their type is a function component, not `MemoExoticComponent`. Code that names the type (`typeof DockTitle` with `.type`, `MemoExoticComponent<…>`) needs updating.
69
- - They re-render with their parent. The published build compiles them with the React Compiler, which skips work when props are unchanged. If you bundle the source without the compiler and relied on the memo, wrap them yourself: `const MemoTitle = memo(DockTitle)`.
70
-
71
- ## React Compiler and bundle size
72
-
73
- The published JavaScript is built with `babel-plugin-react-compiler`. Components and hooks memoize automatically, so the source no longer carries most hand-written `useMemo`/`useCallback`/`memo`. Behaviour does not depend on the compiler: identities that effects, subscriptions, context values and public hook returns rely on stay stable in uncompiled code too.
74
-
75
- The compiled output is larger. Total gzipped JavaScript is about 35% above the previous build (about 273 KB vs 201 KB across all entries and chunks). The compiler accounts for most of that, about 25%. Bundlers still tree-shake per entry, so an app pays only for the entries it imports.
76
-
77
- ## Tooltip without Radix (3.2.2)
78
-
79
- `Tooltip` and `TooltipProvider` no longer wrap `@radix-ui/react-tooltip`; placement, delay groups and presence are built in. `@radix-ui/react-tooltip`, `clsx` and `loading-dev` are no longer dependencies, so a fresh install pulls less. The public props are the same except:
80
-
81
- - `contentProps` takes plain `div` attributes and `data-*` hooks. Radix-only props (`onEscapeKeyDown`, `onPointerDownOutside`, `avoidCollisions`, `forceMount`, `asChild`, `hideWhenDetached`, `sticky`) are gone; flipping and shifting into the viewport always apply.
82
- - CSS variables are renamed: `--radix-tooltip-content-transform-origin` → `--tooltip-transform-origin`, `--radix-tooltip-content-available-width/height` → `--tooltip-available-width/height`, `--radix-tooltip-trigger-width/height` → `--tooltip-trigger-width/height`.
83
- - The portal wrapper is `[data-tooltip-wrapper]` (was `[data-radix-popper-content-wrapper]`). It still copies the content's `z-index`.
84
- - `data-state` (`delayed-open`, `instant-open`, `closed`) and `data-side` keep their values; `data-align` is new, and so is the `align` prop (`start`, `center`, `end`).
85
- - A `TooltipProvider` is optional. A `Tooltip` outside one uses a shared default group (700 ms delay, 300 ms skip window).
86
- - `ClassValue` from `clsx` is no longer re-exported through `cn`'s types; `cn` takes the framework's `Classes` type, which accepts the same strings, arrays, objects and falsy values.
87
-
88
- The modal overlay now loads with `React.lazy` instead of `next/dynamic`, mounts only after the first modal opens, and preloads its chunk when the browser is idle.
89
-
90
- ## Ambient grounds and dock sizing (3.3.0)
91
-
92
- Ambient palettes are now made for a **ground**, the kind of page they lie on: `"dark"` (the default, as before) or `"light"`. Set it once with `configureAmbient({ analysis: { ground: "light" } })` and pass the same `analysis` to the server extractor.
93
-
94
- - `AmbientPalette.shadow` is replaced by `page` (the page tone for the ground) and `presence` (how colourful the image is, `0` to `1`). Palettes also carry `ground`.
95
- - The `--ambient-shadow` variable is now `--ambient-page`, and `--ambient-presence` is new. In `cssVars`, rename `shadow` to `page`; `presence` can be renamed or turned off the same way.
96
- - `AmbientAnalysisOptions.shadowLightness` is replaced by `ground`. On the dark ground the page tone keeps its old lightness (0.16).
97
- - An `initialPalette` made for another ground than the configured one is ignored. Palettes cached across deploys should carry `AMBIENT_ANALYSIS_VERSION` in their key.
98
-
99
- The dock card is sized to its content plus `motion.deck.padding` above and below (default 10 px), instead of a fixed 68 px base. `motion.deck.width` sets the resting card width (default 460 px). `motion.deck.heightVar` names the CSS variable published on `<html>` (default `--dock-h`); `false` publishes none, so an app can read `dockHeight` from state and avoid restyling the whole page on every height change.
@@ -1,17 +0,0 @@
1
- import { navigationModule } from './chunk-DMQKXBWO.js';
2
- import { ambientModule } from './chunk-E2QQJZYY.js';
3
- import { backgroundModule } from './chunk-DGVRHX3C.js';
4
- import { contextMenuModule } from './chunk-KRHH3UQ6.js';
5
- import { controlsModule } from './chunk-M36DFIJ6.js';
6
- import { dockModule } from './chunk-HPJWMBUS.js';
7
- import { notificationModule } from './chunk-VMR7ZKIF.js';
8
- import { loadingModule } from './chunk-7A47AXKI.js';
9
- import { mediaModule } from './chunk-C3SEBNF5.js';
10
- import { modalModule } from './chunk-DC4XZPDK.js';
11
-
12
- // src/modules/index.ts
13
- var defaultModules = Object.freeze([backgroundModule, ambientModule, navigationModule, dockModule, controlsModule, contextMenuModule, loadingModule, mediaModule, modalModule, notificationModule]);
14
-
15
- export { defaultModules };
16
- //# sourceMappingURL=chunk-2E6OASVV.js.map
17
- //# sourceMappingURL=chunk-2E6OASVV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/react/theme/index.tsx"],"names":["defineThemeSpec","id","Object","freeze","defineTheme","spec","config","EMPTY","Map","ThemeContext","getOrCreateGlobalContext","DEFAULT_MOTION","defineMotion","NO_MOTION_PROVIDER","reduced","tempo","NEUTRAL_TEMPO","tokens","MotionContext","MotionProvider","t0","$","_c","children","prefersReduced","useReducedMotion","reducedMotion","t1","still","state","t2","ThemeProvider","motion","themes","map","_temp","configs","inheritsMotion","use","providesMotion","Boolean","content","t3","entry","missingTheme","Error","useTheme","get","slots","styles","motionTokens","WeakMap","useMotionTokens","getOrInsert","resolvedMotion","resolveModuleMotion","byConfig","retimeModuleMotion","useModuleMotion","useOptionalModuleMotion","ModuleMotionConfig"],"mappings":";;;;;;;AAwDO,SAASA,gBACdC,EAAAA,EACiB;AACjB,EAAA,OAAOC,OAAOC,MAAAA,CAAO;AAAEF,IAAAA;GAAI,CAAA;AAC7B;AAKO,SAASG,WAAAA,CACdC,MACAC,MAAAA,EACY;AACZ,EAAA,OAAO;AAAEL,IAAAA,EAAAA,EAAII,IAAAA,CAAKJ,EAAAA;AAAIK,IAAAA;AAAO,GAAA;AAC/B;AAIA,IAAMC,KAAAA,uBAAuDC,GAAAA,EAAI;AACjE,IAAMC,YAAAA,GAAeC,wBAAAA,CAEnB,cAAA,EAAgBH,KAAK,CAAA;AAMvB,IAAMI,cAAAA,GAAiBC,YAAAA,CAAa,EAAE,CAAA;AAC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AA,CAAC,YAAA,EAAA,EAA4B,aAAA,EAAAV,MAAAA,CAAMS,eAAiBH,QAAAA,EAAS,CAAA;AAAeF,IAAAA,CAAAA,CAAA,CAAA,CAAA,GAAAE,QAAAA;AAAAF,IAAAA,CAAAA,CAAA,CAAA,IAAAJ,MAAAA,CAAAS,aAAAA;AAAAL,IAAAA,CAAAA,CAAA,CAAA,CAAA,GAAAM,EAAAA;EAAA,CAAA,MAAA;AAAAA,IAAAA,EAAAA,GAAAN,EAAA,CAAA,CAAA;AAAA,EAAA;AAAA,EAAA,OAA5EM,EAAAA;AAA4E","file":"chunk-3JLG24KI.js","sourcesContent":["\"use client\";\n\nimport { MotionConfig, useReducedMotion } from \"motion/react\";\nimport { type CSSProperties, type ReactNode, use, useMemo } from \"react\";\n\nimport { getOrInsert } from \"@/foundation/utils/collections\";\nimport {\n defineMotion,\n type MotionClock,\n type MotionTokens,\n NEUTRAL_TEMPO,\n retimeModuleMotion,\n} from \"@/foundation/utils/tempo\";\nimport { getOrCreateGlobalContext } from \"@/react/context\";\n\n// ---- Theme definitions ----\n\n/**\n * A theme's identity and, through its type parameters, its slot names and motion shape.\n */\nexport interface ThemeSpec<S extends string = string, M = never> {\n readonly id: string;\n readonly _slots?: S;\n readonly _motion?: M;\n}\n\ninterface ThemeVisuals<S extends string> {\n slots: Readonly<Record<S, string>>;\n styles?: Readonly<Partial<Record<S, CSSProperties>>>;\n}\n\n/**\n * The slot classes, styles and (when the spec has motion) motion of a theme.\n */\nexport type ThemeConfig<S extends string, M = never> = ThemeVisuals<S> &\n ([M] extends [never] ? { motion?: undefined } : { motion: M });\n\n/**\n * The slot classes and styles a component receives from `useTheme`.\n */\nexport interface ResolvedTheme<S extends string> {\n readonly slots: Readonly<Record<S, string>>;\n readonly styles: Readonly<Partial<Record<S, CSSProperties>>>;\n}\n\n/**\n * A theme id paired with its configuration, as passed to `ThemeProvider`.\n */\nexport interface ThemeEntry {\n readonly id: string;\n readonly config: ThemeVisuals<string> & { motion?: unknown };\n}\n\n/**\n * Declares a theme's identity with its slot names and optional motion type.\n */\nexport function defineThemeSpec<S extends string, M = never>(\n id: string,\n): ThemeSpec<S, M> {\n return Object.freeze({ id });\n}\n\n/**\n * Binds a configuration to a theme spec.\n */\nexport function defineTheme<S extends string, M = never>(\n spec: ThemeSpec<S, M>,\n config: ThemeConfig<NoInfer<S>, NoInfer<M>>,\n): ThemeEntry {\n return { id: spec.id, config };\n}\n\n// ---- Contexts and providers ----\n\nconst EMPTY: ReadonlyMap<string, ThemeEntry[\"config\"]> = new Map();\nconst ThemeContext = getOrCreateGlobalContext<\n ReadonlyMap<string, ThemeEntry[\"config\"]>\n>(\"ThemeContext\", EMPTY);\n\ninterface MotionState extends MotionClock {\n readonly tokens: MotionTokens;\n}\n\nconst DEFAULT_MOTION = defineMotion({});\nconst NO_MOTION_PROVIDER: MotionState = Object.freeze({\n reduced: false,\n tempo: NEUTRAL_TEMPO,\n tokens: DEFAULT_MOTION,\n});\nconst MotionContext = getOrCreateGlobalContext<MotionState>(\n \"MotionContext\",\n NO_MOTION_PROVIDER,\n);\n\ninterface MotionProviderProps {\n children?: ReactNode;\n tokens: MotionTokens;\n}\n\nfunction MotionProvider({ children, tokens }: MotionProviderProps) {\n const prefersReduced = useReducedMotion() === true;\n const reduced =\n tokens.reducedMotion === \"always\" ||\n (tokens.reducedMotion === \"user\" && prefersReduced);\n // stable identity: consumers subscribe by reference\n const state = useMemo<MotionState>(\n () =>\n Object.freeze({\n reduced,\n still: tokens.still,\n tempo: tokens.tempo,\n tokens,\n }),\n [reduced, tokens],\n );\n return <MotionContext value={state}>{children}</MotionContext>;\n}\n\ninterface ThemeProviderProps {\n children?: ReactNode;\n motion?: MotionTokens;\n themes: readonly ThemeEntry[];\n}\n\n/**\n * Provides themes, and motion tokens when given, to the tree below it.\n */\nexport function ThemeProvider({\n children,\n motion,\n themes,\n}: ThemeProviderProps) {\n // stable identity: consumers subscribe by reference\n const configs = useMemo(\n () => new Map(themes.map((entry) => [entry.id, entry.config])),\n [themes],\n );\n const inheritsMotion = use(MotionContext) !== NO_MOTION_PROVIDER;\n const providesMotion = Boolean(motion) || !inheritsMotion;\n const content = providesMotion ? (\n <MotionProvider tokens={motion ?? DEFAULT_MOTION}>\n {children}\n </MotionProvider>\n ) : (\n children\n );\n return <ThemeContext value={configs}>{content}</ThemeContext>;\n}\n\n// ---- Hooks ----\n\nfunction missingTheme(id: string): Error {\n return new Error(\n `Theme \"${id}\" is missing. Ensure its theme configuration is provided to <ThemeProvider themes={[...]}> (e.g. in src/config/ or your theme setup).`,\n );\n}\n\n/**\n * Returns the slot classes and styles configured for a theme spec.\n */\nexport function useTheme<S extends string>(\n spec: ThemeSpec<S, unknown>,\n): ResolvedTheme<S> {\n const config = use(ThemeContext).get(spec.id);\n if (!config) throw missingTheme(spec.id);\n return {\n slots: config.slots,\n styles: config.styles ?? {},\n };\n}\n\n// Cached per motion state, so `useMotionTokens` returns a stable object without memo.\nconst motionTokens = new WeakMap<\n MotionState,\n MotionTokens & { readonly reduced: boolean }\n>();\n\n/**\n * Returns the current motion tokens plus whether motion is reduced.\n */\nexport function useMotionTokens<T extends MotionTokens = MotionTokens>(): T & {\n readonly reduced: boolean;\n} {\n const state = use(MotionContext);\n const tokens = getOrInsert(motionTokens, state, () => ({\n ...state.tokens,\n reduced: state.reduced,\n }));\n return tokens as T & { readonly reduced: boolean };\n}\n\n// Retimed module motion, cached per motion state and motion config.\nconst resolvedMotion = new WeakMap<MotionState, WeakMap<object, unknown>>();\n\nfunction resolveModuleMotion(state: MotionState, motion: object): unknown {\n const byConfig = getOrInsert(resolvedMotion, state, () => new WeakMap());\n return getOrInsert(byConfig, motion, () => retimeModuleMotion(motion, state));\n}\n\n/**\n * Returns a theme's motion, retimed to the current tempo; throws if it has none.\n */\nexport function useModuleMotion<M>(spec: ThemeSpec<string, M>): M {\n const config = use(ThemeContext).get(spec.id);\n const state = use(MotionContext);\n if (!config) throw missingTheme(spec.id);\n if (!config.motion || typeof config.motion !== \"object\") {\n throw new Error(\n `Motion for theme \"${spec.id}\" is missing. Add \\`motion\\` to its defineTheme(...) next to \\`slots\\` (see docs/theming.md).`,\n );\n }\n return resolveModuleMotion(state, config.motion) as M;\n}\n\n/**\n * Like `useModuleMotion`, but returns null when the theme has no motion.\n */\nexport function useOptionalModuleMotion<M>(\n spec: ThemeSpec<string, M>,\n): M | null {\n const motion = use(ThemeContext).get(spec.id)?.motion;\n const state = use(MotionContext);\n if (!motion || typeof motion !== \"object\") return null;\n return resolveModuleMotion(state, motion) as M;\n}\n\n// ---- Motion config ----\n\ninterface ModuleMotionConfigProps {\n children?: ReactNode;\n}\n\n/**\n * Applies the motion tokens' reduced-motion policy to motion components below it.\n */\nexport function ModuleMotionConfig({ children }: ModuleMotionConfigProps) {\n const { tokens } = use(MotionContext);\n return (\n <MotionConfig reducedMotion={tokens.reducedMotion}>{children}</MotionConfig>\n );\n}\n"]}
@@ -1,448 +0,0 @@
1
- import { defineRecipe, createCn, extendRecipe, compileRecipe } from './chunk-ICFPSAJZ.js';
2
- import { useMotionTokens } from './chunk-3JLG24KI.js';
3
- import { getOrCreateGlobalContext } from './chunk-J3VTDBC6.js';
4
- import { getOrInsert, retimeModuleMotion } from './chunk-YHWA7FXX.js';
5
- import { c } from 'react/compiler-runtime';
6
- import { use } from 'react';
7
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
- import { Icon as Icon$1 } from '@iconify-icon/react';
9
-
10
- // src/foundation/recipes/anatomy.ts
11
- var part = () => defineRecipe({});
12
- var flag = { false: "", true: "" };
13
- var layout = { fill: "", intrinsic: "" };
14
- var ANATOMY = {
15
- button: {
16
- root: defineRecipe({ variants: { intent: {} } }),
17
- bare: part(),
18
- busy: part(),
19
- busyLabel: part(),
20
- busySpinner: part()
21
- },
22
- input: { field: part(), area: part() },
23
- switch: { track: part(), thumb: part() },
24
- checkbox: {
25
- root: part(),
26
- box: defineRecipe({ variants: { checked: flag } }),
27
- glyph: defineRecipe({ variants: { checked: flag } })
28
- },
29
- segmented: {
30
- root: part(),
31
- segment: defineRecipe({ variants: { active: flag } }),
32
- pill: part(),
33
- chosen: part(),
34
- icon: part(),
35
- count: part()
36
- },
37
- select: {
38
- root: part(),
39
- trigger: part(),
40
- value: part(),
41
- label: part(),
42
- placeholder: part(),
43
- chevron: part(),
44
- menu: part(),
45
- option: part(),
46
- highlight: part(),
47
- optionBody: part(),
48
- text: part(),
49
- description: part(),
50
- icon: part(),
51
- check: part(),
52
- empty: part()
53
- },
54
- carousel: {
55
- root: part(),
56
- track: part(),
57
- slide: part(),
58
- arrow: defineRecipe({
59
- variants: { side: { left: "", right: "" }, visible: flag }
60
- }),
61
- icon: part()
62
- },
63
- tooltip: { content: part(), label: part() },
64
- loader: {
65
- root: defineRecipe({ variants: { over: flag } }),
66
- label: part(),
67
- overlay: part(),
68
- dots: part(),
69
- dot: part(),
70
- spinner: part(),
71
- icon: part()
72
- },
73
- skeleton: { block: part(), lines: part(), line: part(), bar: part() },
74
- image: {
75
- frame: defineRecipe({ variants: { layout, loading: flag } }),
76
- picture: defineRecipe({ variants: { layout } }),
77
- fallback: part()
78
- },
79
- avatar: { root: part(), image: part(), initials: part() },
80
- highlight: { fill: part() }
81
- };
82
-
83
- // src/foundation/recipes/define.ts
84
- var DEFAULT_LABELS = {
85
- loading: "Loading",
86
- placeholder: "Select an option...",
87
- empty: "No options available",
88
- previous: "Scroll left",
89
- next: "Scroll right"
90
- };
91
- function compileComponent(defaults, own, cn) {
92
- const parts = {};
93
- for (const part2 of /* @__PURE__ */ new Set([...Object.keys(defaults), ...Object.keys(own)])) {
94
- const def = defaults[part2] ? extendRecipe(defaults[part2], own[part2]) : own[part2];
95
- parts[part2] = compileRecipe(def, cn);
96
- }
97
- return parts;
98
- }
99
- function compileParts(config, cn) {
100
- const out = {};
101
- const overrides = config.parts ?? {};
102
- const names = /* @__PURE__ */ new Set([...Object.keys(ANATOMY), ...Object.keys(overrides)]);
103
- for (const component of names) {
104
- const defaults = ANATOMY[component] ?? {};
105
- out[component] = compileComponent(defaults, overrides[component] ?? {}, cn);
106
- }
107
- return out;
108
- }
109
- function defineUi(config) {
110
- const own = config ?? {};
111
- const cn = createCn(own.merge);
112
- return Object.freeze({
113
- // compileParts returns generic parts; the option type narrows them per component.
114
- parts: compileParts(own, cn),
115
- cn,
116
- motion: Object.freeze({ ...own.motion }),
117
- icons: Object.freeze({ ...own.icons }),
118
- labels: Object.freeze({ ...DEFAULT_LABELS, ...own.labels }),
119
- config: own
120
- });
121
- }
122
- var defaultUi = defineUi();
123
- var UiContext = getOrCreateGlobalContext("UiContext", defaultUi);
124
- function UiProvider(t0) {
125
- const $ = c(3);
126
- const {
127
- children,
128
- ui
129
- } = t0;
130
- const t1 = ui;
131
- let t2;
132
- if ($[0] !== children || $[1] !== t1) {
133
- t2 = /* @__PURE__ */ jsx(UiContext, { value: t1, children });
134
- $[0] = children;
135
- $[1] = t1;
136
- $[2] = t2;
137
- } else {
138
- t2 = $[2];
139
- }
140
- return t2;
141
- }
142
- function useUi() {
143
- return use(UiContext);
144
- }
145
- var retimed = /* @__PURE__ */ new WeakMap();
146
- function useUiMotion() {
147
- const $ = c(3);
148
- const {
149
- motion
150
- } = useUi();
151
- const tokens = useMotionTokens();
152
- let t0;
153
- if ($[0] !== motion || $[1] !== tokens) {
154
- const byTokens = getOrInsert(retimed, motion, _temp);
155
- t0 = getOrInsert(byTokens, tokens, () => ({
156
- ...retimeModuleMotion(motion, tokens),
157
- reduced: tokens.reduced
158
- }));
159
- $[0] = motion;
160
- $[1] = tokens;
161
- $[2] = t0;
162
- } else {
163
- t0 = $[2];
164
- }
165
- return t0;
166
- }
167
- function _temp() {
168
- return /* @__PURE__ */ new WeakMap();
169
- }
170
- function Icon(t0) {
171
- const $ = c(19);
172
- let className;
173
- let color;
174
- let icon;
175
- let onClick;
176
- let props;
177
- let size;
178
- let style;
179
- if ($[0] !== t0) {
180
- ({
181
- className,
182
- color,
183
- icon,
184
- onClick,
185
- size,
186
- style,
187
- ...props
188
- } = t0);
189
- $[0] = t0;
190
- $[1] = className;
191
- $[2] = color;
192
- $[3] = icon;
193
- $[4] = onClick;
194
- $[5] = props;
195
- $[6] = size;
196
- $[7] = style;
197
- } else {
198
- className = $[1];
199
- color = $[2];
200
- icon = $[3];
201
- onClick = $[4];
202
- props = $[5];
203
- size = $[6];
204
- style = $[7];
205
- }
206
- let t1;
207
- if ($[8] !== color || $[9] !== size || $[10] !== style) {
208
- t1 = size === void 0 ? {
209
- color,
210
- ...style
211
- } : {
212
- color,
213
- height: size,
214
- width: size,
215
- ...style
216
- };
217
- $[8] = color;
218
- $[9] = size;
219
- $[10] = style;
220
- $[11] = t1;
221
- } else {
222
- t1 = $[11];
223
- }
224
- let t2;
225
- if ($[12] !== className || $[13] !== icon || $[14] !== onClick || $[15] !== props || $[16] !== size || $[17] !== t1) {
226
- t2 = /* @__PURE__ */ jsx(Icon$1, { className, height: size, icon, onClick, style: t1, width: size, ...props });
227
- $[12] = className;
228
- $[13] = icon;
229
- $[14] = onClick;
230
- $[15] = props;
231
- $[16] = size;
232
- $[17] = t1;
233
- $[18] = t2;
234
- } else {
235
- t2 = $[18];
236
- }
237
- return t2;
238
- }
239
- function Dots(t0) {
240
- const $ = c(25);
241
- const {
242
- color,
243
- size
244
- } = t0;
245
- const {
246
- parts
247
- } = useUi();
248
- let t1;
249
- if ($[0] !== parts.loader) {
250
- t1 = parts.loader.dots();
251
- $[0] = parts.loader;
252
- $[1] = t1;
253
- } else {
254
- t1 = $[1];
255
- }
256
- let t2;
257
- if ($[2] !== size) {
258
- t2 = size === void 0 ? null : {
259
- "--loader-size": `${size}px`
260
- };
261
- $[2] = size;
262
- $[3] = t2;
263
- } else {
264
- t2 = $[3];
265
- }
266
- let t3;
267
- if ($[4] !== color || $[5] !== t2) {
268
- t3 = {
269
- color,
270
- ...t2
271
- };
272
- $[4] = color;
273
- $[5] = t2;
274
- $[6] = t3;
275
- } else {
276
- t3 = $[6];
277
- }
278
- let t4;
279
- if ($[7] !== parts.loader) {
280
- t4 = parts.loader.dot();
281
- $[7] = parts.loader;
282
- $[8] = t4;
283
- } else {
284
- t4 = $[8];
285
- }
286
- let t5;
287
- if ($[9] !== t4) {
288
- t5 = /* @__PURE__ */ jsx("span", { className: t4 });
289
- $[9] = t4;
290
- $[10] = t5;
291
- } else {
292
- t5 = $[10];
293
- }
294
- let t6;
295
- if ($[11] !== parts.loader) {
296
- t6 = parts.loader.dot();
297
- $[11] = parts.loader;
298
- $[12] = t6;
299
- } else {
300
- t6 = $[12];
301
- }
302
- let t7;
303
- if ($[13] !== t6) {
304
- t7 = /* @__PURE__ */ jsx("span", { className: t6 });
305
- $[13] = t6;
306
- $[14] = t7;
307
- } else {
308
- t7 = $[14];
309
- }
310
- let t8;
311
- if ($[15] !== parts.loader) {
312
- t8 = parts.loader.dot();
313
- $[15] = parts.loader;
314
- $[16] = t8;
315
- } else {
316
- t8 = $[16];
317
- }
318
- let t9;
319
- if ($[17] !== t8) {
320
- t9 = /* @__PURE__ */ jsx("span", { className: t8 });
321
- $[17] = t8;
322
- $[18] = t9;
323
- } else {
324
- t9 = $[18];
325
- }
326
- let t10;
327
- if ($[19] !== t1 || $[20] !== t3 || $[21] !== t5 || $[22] !== t7 || $[23] !== t9) {
328
- t10 = /* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: t1, style: t3, children: [
329
- t5,
330
- t7,
331
- t9
332
- ] });
333
- $[19] = t1;
334
- $[20] = t3;
335
- $[21] = t5;
336
- $[22] = t7;
337
- $[23] = t9;
338
- $[24] = t10;
339
- } else {
340
- t10 = $[24];
341
- }
342
- return t10;
343
- }
344
- function Loader(t0) {
345
- const $ = c(14);
346
- const {
347
- children,
348
- className,
349
- color,
350
- size
351
- } = t0;
352
- const {
353
- labels,
354
- parts
355
- } = useUi();
356
- const over = Boolean(children);
357
- const t1 = labels.loading;
358
- let t2;
359
- if ($[0] !== className || $[1] !== over || $[2] !== parts.loader) {
360
- t2 = parts.loader.root({
361
- over,
362
- className
363
- });
364
- $[0] = className;
365
- $[1] = over;
366
- $[2] = parts.loader;
367
- $[3] = t2;
368
- } else {
369
- t2 = $[3];
370
- }
371
- let t3;
372
- if ($[4] !== children || $[5] !== color || $[6] !== over || $[7] !== parts.loader || $[8] !== size) {
373
- t3 = over ? /* @__PURE__ */ jsxs(Fragment, { children: [
374
- /* @__PURE__ */ jsx("span", { className: parts.loader.label(), children }),
375
- /* @__PURE__ */ jsx("span", { className: parts.loader.overlay(), children: /* @__PURE__ */ jsx(Dots, { color, size }) })
376
- ] }) : /* @__PURE__ */ jsx(Dots, { color, size });
377
- $[4] = children;
378
- $[5] = color;
379
- $[6] = over;
380
- $[7] = parts.loader;
381
- $[8] = size;
382
- $[9] = t3;
383
- } else {
384
- t3 = $[9];
385
- }
386
- let t4;
387
- if ($[10] !== labels.loading || $[11] !== t2 || $[12] !== t3) {
388
- t4 = /* @__PURE__ */ jsx("span", { "aria-label": t1, className: t2, role: "status", children: t3 });
389
- $[10] = labels.loading;
390
- $[11] = t2;
391
- $[12] = t3;
392
- $[13] = t4;
393
- } else {
394
- t4 = $[13];
395
- }
396
- return t4;
397
- }
398
- function Spinner(t0) {
399
- const $ = c(11);
400
- const {
401
- className,
402
- icon,
403
- size
404
- } = t0;
405
- const {
406
- icons,
407
- labels,
408
- parts
409
- } = useUi();
410
- const glyph = icon ?? icons.spinner;
411
- const t1 = labels.loading;
412
- let t2;
413
- if ($[0] !== className || $[1] !== parts.loader) {
414
- t2 = parts.loader.spinner({
415
- className
416
- });
417
- $[0] = className;
418
- $[1] = parts.loader;
419
- $[2] = t2;
420
- } else {
421
- t2 = $[2];
422
- }
423
- let t3;
424
- if ($[3] !== glyph || $[4] !== parts.loader || $[5] !== size) {
425
- t3 = glyph ? /* @__PURE__ */ jsx(Icon, { className: parts.loader.icon(), icon: glyph, size }) : null;
426
- $[3] = glyph;
427
- $[4] = parts.loader;
428
- $[5] = size;
429
- $[6] = t3;
430
- } else {
431
- t3 = $[6];
432
- }
433
- let t4;
434
- if ($[7] !== labels.loading || $[8] !== t2 || $[9] !== t3) {
435
- t4 = /* @__PURE__ */ jsx("span", { "aria-label": t1, className: t2, role: "status", children: t3 });
436
- $[7] = labels.loading;
437
- $[8] = t2;
438
- $[9] = t3;
439
- $[10] = t4;
440
- } else {
441
- t4 = $[10];
442
- }
443
- return t4;
444
- }
445
-
446
- export { ANATOMY, DEFAULT_LABELS, Icon, Loader, Spinner, UiProvider, defaultUi, defineUi, useUi, useUiMotion };
447
- //# sourceMappingURL=chunk-6LWCTP2Y.js.map
448
- //# sourceMappingURL=chunk-6LWCTP2Y.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/foundation/recipes/anatomy.ts","../src/foundation/recipes/define.ts","../src/react/ui/provider.tsx","../src/react/ui/components/icon.tsx","../src/react/ui/components/loader.tsx"],"names":["part","UiContext","getOrCreateGlobalContext","defaultUi","UiProvider","t0","$","_c","children","ui","t1","t2","useUi","use","retimed","WeakMap","useUiMotion","motion","tokens","useMotionTokens","byTokens","getOrInsert","_temp","retimeModuleMotion","reduced","Icon","className","color","icon","onClick","props","size","style","undefined","height","width","jsx","IconifyIcon","Dots","parts","loader","dots","t3","t4","dot","t5","t6","t7","t8","t9","t10","Loader","labels","over","Boolean","loading","root","label","overlay","Spinner","icons","glyph","spinner"],"mappings":";;;;;;;;;;AAEA,IAAM,IAAA,GAAO,MAAM,YAAA,CAAa,EAAE,CAAA;AAElC,IAAM,IAAA,GAAO,EAAE,KAAA,EAAO,EAAA,EAAI,MAAM,EAAA,EAAG;AAEnC,IAAM,MAAA,GAAS,EAAE,IAAA,EAAM,EAAA,EAAI,WAAW,EAAA,EAAG;AAKlC,IAAM,OAAA,GAAU;AAAA,EACrB,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,aAAa,EAAE,QAAA,EAAU,EAAE,MAAA,EAAQ,EAAC,EAAE,EAAG,CAAA;AAAA,IAC/C,MAAM,IAAA,EAAK;AAAA,IACX,MAAM,IAAA,EAAK;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AA,CAAA,CAAA,KAAAoC,EAAAA,EAAA;AAPVC,IAAAA,EAAAA,mBAAAP,IAAA,MAAA,EAAA,EACc,YAAA,EAAA1B,IACD,SAAA,EAAAC,EAAAA,EACN,IAAA,EAAA,QAAA,EAEJ+B,QAAAA,EAAAA,EAAAA,EAGH,CAAA;AAAOpC,IAAAA,CAAAA,CAAA,CAAA,IAAA8C,MAAAA,CAAAG,OAAAA;AAAAjD,IAAAA,CAAAA,CAAA,CAAA,CAAA,GAAAK,EAAAA;AAAAL,IAAAA,CAAAA,CAAA,CAAA,CAAA,GAAAoC,EAAAA;AAAApC,IAAAA,CAAAA,CAAA,EAAA,CAAA,GAAAqC,EAAAA;EAAA,CAAA,MAAA;AAAAA,IAAAA,EAAAA,GAAArC,EAAA,EAAA,CAAA;AAAA,EAAA;AAAA,EAAA,OARPqC,EAAAA;AAQO","file":"chunk-6LWCTP2Y.js","sourcesContent":["import { defineRecipe } from \"./recipe\";\n\nconst part = () => defineRecipe({});\n\nconst flag = { false: \"\", true: \"\" } as const;\n\nconst layout = { fill: \"\", intrinsic: \"\" } as const;\n\n/**\n * The built-in component parts and their variants that `defineUi` can restyle.\n */\nexport const ANATOMY = {\n button: {\n root: defineRecipe({ variants: { intent: {} } }),\n bare: part(),\n busy: part(),\n busyLabel: part(),\n busySpinner: part(),\n },\n input: { field: part(), area: part() },\n switch: { track: part(), thumb: part() },\n checkbox: {\n root: part(),\n box: defineRecipe({ variants: { checked: flag } }),\n glyph: defineRecipe({ variants: { checked: flag } }),\n },\n segmented: {\n root: part(),\n segment: defineRecipe({ variants: { active: flag } }),\n pill: part(),\n chosen: part(),\n icon: part(),\n count: part(),\n },\n select: {\n root: part(),\n trigger: part(),\n value: part(),\n label: part(),\n placeholder: part(),\n chevron: part(),\n menu: part(),\n option: part(),\n highlight: part(),\n optionBody: part(),\n text: part(),\n description: part(),\n icon: part(),\n check: part(),\n empty: part(),\n },\n carousel: {\n root: part(),\n track: part(),\n slide: part(),\n arrow: defineRecipe({\n variants: { side: { left: \"\", right: \"\" }, visible: flag },\n }),\n icon: part(),\n },\n tooltip: { content: part(), label: part() },\n loader: {\n root: defineRecipe({ variants: { over: flag } }),\n label: part(),\n overlay: part(),\n dots: part(),\n dot: part(),\n spinner: part(),\n icon: part(),\n },\n skeleton: { block: part(), lines: part(), line: part(), bar: part() },\n image: {\n frame: defineRecipe({ variants: { layout, loading: flag } }),\n picture: defineRecipe({ variants: { layout } }),\n fallback: part(),\n },\n avatar: { root: part(), image: part(), initials: part() },\n highlight: { fill: part() },\n} as const;\n\n/**\n * Type of `ANATOMY`.\n */\nexport type Anatomy = typeof ANATOMY;\n","import type { UiRegister } from \"@/foundation/recipes\";\n\nimport { ANATOMY, type Anatomy } from \"./anatomy\";\nimport { createCn, type MergeVocabulary } from \"./cn\";\nimport {\n type Classes,\n compileRecipe,\n extendRecipe,\n type MergedVariants,\n type Recipe,\n type RecipeDef,\n type RecipeOverride,\n type VariantsOf,\n} from \"./recipe\";\n\ntype Ease = readonly [number, number, number, number];\n\n/**\n * A motion transition object.\n */\nexport type UiTransition = Readonly<Record<string, unknown>>;\n\n/**\n * Named motion variants, each a transition or a function of a custom index.\n */\nexport type UiVariants = Readonly<\n Record<string, UiTransition | ((custom: number) => UiTransition)>\n>;\n\n/**\n * Motion settings that components read from the UI definition.\n */\nexport interface UiMotion {\n readonly follow?: UiTransition;\n readonly menu?: UiVariants;\n readonly option?: UiVariants;\n readonly glide?: { readonly duration: number; readonly ease: Ease };\n}\n\n/**\n * Icon names that components use for built-in glyphs.\n */\nexport interface UiIcons {\n readonly check?: string;\n readonly selected?: string;\n readonly chevron?: string;\n readonly previous?: string;\n readonly next?: string;\n readonly spinner?: string;\n}\n\n/**\n * Default texts used by components.\n */\nexport interface UiLabels {\n readonly loading: string;\n readonly placeholder: string;\n readonly empty: string;\n readonly previous: string;\n readonly next: string;\n}\n\n/**\n * The labels used when the UI definition does not override them.\n */\nexport const DEFAULT_LABELS: UiLabels = {\n loading: \"Loading\",\n placeholder: \"Select an option...\",\n empty: \"No options available\",\n previous: \"Scroll left\",\n next: \"Scroll right\",\n};\n\ntype Parts = Readonly<Record<string, unknown>>;\ntype Registry = Readonly<Record<string, Parts>>;\n\n/**\n * Per-component, per-part recipe overrides.\n */\nexport type UiPartOverrides<D extends Registry = Anatomy> = {\n readonly [C in keyof D]?: {\n readonly [P in keyof D[C]]?: RecipeOverride<VariantsOf<D[C][P]>>;\n };\n} & Readonly<\n Record<\n string,\n Readonly<Record<string, RecipeOverride | RecipeDef>> | undefined\n >\n>;\n\n/**\n * Input of `defineUi`: part overrides, merge vocabulary, motion, icons and labels.\n */\nexport interface UiConfig {\n readonly parts?: UiPartOverrides;\n readonly merge?: MergeVocabulary;\n readonly motion?: UiMotion;\n readonly icons?: UiIcons;\n readonly labels?: Partial<UiLabels>;\n}\n\ntype MergedParts<D extends Parts, O> = {\n readonly [P in keyof D | keyof O]: Recipe<\n P extends keyof D\n ? P extends keyof O\n ? MergedVariants<D[P], O[P]>\n : VariantsOf<D[P]>\n : P extends keyof O\n ? VariantsOf<O[P]>\n : {}\n >;\n};\n\ntype PartsOverride<O, C> = O extends { readonly parts?: infer X }\n ? C extends keyof X\n ? NonNullable<X[C]>\n : {}\n : {};\n\n/**\n * The compiled recipes of every component part, including app-defined ones.\n */\nexport type UiParts<O = {}> = {\n readonly [\n C in\n | keyof Anatomy\n | Exclude<\n keyof NonNullable<O extends { parts?: infer X } ? X : {}>,\n number | symbol\n >\n ]: C extends keyof Anatomy\n ? MergedParts<Anatomy[C], PartsOverride<O, C>>\n : MergedParts<{}, PartsOverride<O, C>>;\n};\n\n/**\n * A compiled UI definition: part recipes, class joiner, motion, icons and labels.\n */\nexport interface Ui<O = {}> {\n readonly parts: UiParts<O>;\n readonly cn: (...inputs: Classes[]) => string;\n readonly motion: UiMotion;\n readonly icons: UiIcons;\n readonly labels: UiLabels;\n readonly config: UiConfig;\n}\n\ntype CompiledParts = Record<string, Recipe>;\n\nfunction compileComponent(\n defaults: Parts,\n own: Record<string, RecipeOverride>,\n cn: (...inputs: Classes[]) => string,\n): CompiledParts {\n const parts: CompiledParts = {};\n for (const part of new Set([...Object.keys(defaults), ...Object.keys(own)])) {\n const def = defaults[part]\n ? extendRecipe(defaults[part], own[part])\n : (own[part] as RecipeDef);\n parts[part] = compileRecipe(def, cn);\n }\n return parts;\n}\n\nfunction compileParts(\n config: UiConfig,\n cn: (...inputs: Classes[]) => string,\n): Record<string, CompiledParts> {\n const out: Record<string, CompiledParts> = {};\n const overrides = (config.parts ?? {}) as Record<\n string,\n Record<string, RecipeOverride> | undefined\n >;\n const names = new Set([...Object.keys(ANATOMY), ...Object.keys(overrides)]);\n for (const component of names) {\n // ANATOMY is a literal table, indexed here by component name.\n const defaults = (ANATOMY as unknown as Registry)[component] ?? {};\n out[component] = compileComponent(defaults, overrides[component] ?? {}, cn);\n }\n return out;\n}\n\n/**\n * Compiles a UI definition from the built-in anatomy and the given overrides.\n */\nexport function defineUi<const O extends UiConfig = {}>(config?: O): Ui<O> {\n const own = (config ?? {}) as UiConfig;\n const cn = createCn(own.merge);\n return Object.freeze({\n // compileParts returns generic parts; the option type narrows them per component.\n parts: compileParts(own, cn) as unknown as UiParts<O>,\n cn,\n motion: Object.freeze({ ...own.motion }),\n icons: Object.freeze({ ...own.icons }),\n labels: Object.freeze({ ...DEFAULT_LABELS, ...own.labels }),\n config: own,\n });\n}\n\n/**\n * The UI definition used when the app does not provide one.\n */\nexport const defaultUi = defineUi();\n\n/**\n * The app's UI definition type, taken from the `UiRegister` augmentation.\n */\nexport type RegisteredUi = UiRegister extends { ui: infer U }\n ? U\n : typeof defaultUi;\n\ntype RegisteredParts = RegisteredUi extends { parts: infer P } ? P : never;\n\n/**\n * The variant props of one part of one component.\n */\nexport type PartProps<\n C extends keyof RegisteredParts,\n P extends keyof RegisteredParts[C],\n> =\n RegisteredParts[C][P] extends Recipe<infer V>\n ? {\n -readonly [K in keyof V]?: keyof V[K] & string extends infer Key\n ? Key extends \"true\" | \"false\"\n ? boolean\n : Key\n : never;\n }\n : never;\n\n/**\n * Extra class names keyed by part name for one component.\n */\nexport type PartClassNames<C extends keyof RegisteredParts> = {\n readonly [P in keyof RegisteredParts[C]]?: string;\n};\n\ntype Choices<T, K> = K extends keyof T ? NonNullable<T[K]> : never;\n\n/**\n * The combined variant props of several parts of one component.\n */\nexport type PartsProps<\n C extends keyof RegisteredParts,\n P extends keyof RegisteredParts[C],\n> = {\n -readonly [\n K in P extends unknown ? keyof PartProps<C, P> : never\n ]?: P extends unknown ? Choices<PartProps<C, P>, K> : never;\n};\n","\"use client\";\n\nimport { type ReactNode, use } from \"react\";\n\nimport {\n defaultUi,\n type RegisteredUi,\n type Ui,\n type UiMotion,\n} from \"@/foundation/recipes/define\";\nimport { getOrInsert } from \"@/foundation/utils/collections\";\nimport { retimeModuleMotion } from \"@/foundation/utils/tempo\";\nimport { getOrCreateGlobalContext } from \"@/react/context\";\nimport { useMotionTokens } from \"@/react/theme\";\n\n// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- RegisteredUi collapses to Ui here but differs once consumers augment it\nconst UiContext = getOrCreateGlobalContext<Ui>(\"UiContext\", defaultUi as Ui);\n\ninterface UiProviderProps {\n children?: ReactNode;\n // eslint-disable-next-line @typescript-eslint/no-duplicate-type-constituents -- RegisteredUi collapses to Ui here but differs once consumers augment it\n ui: RegisteredUi | Ui;\n}\n\n/**\n * Provides a UI definition (from `defineUi`) to the components below it.\n */\nexport function UiProvider({ children, ui }: UiProviderProps) {\n // RegisteredUi is the augmented Ui; the context stores the base Ui type.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- RegisteredUi collapses to Ui here but differs once consumers augment it\n return <UiContext value={ui as Ui}>{children}</UiContext>;\n}\n\n/**\n * Returns the current UI definition.\n */\nexport function useUi(): Ui {\n return use(UiContext);\n}\n\n// Cached per UI motion and motion tokens, so the hook returns a stable object\n// without memo.\nconst retimed = new WeakMap<\n UiMotion,\n WeakMap<object, UiMotion & { readonly reduced: boolean }>\n>();\n\n/**\n * Returns the UI definition's motion retimed to the current tempo, plus whether motion is reduced.\n */\nexport function useUiMotion(): UiMotion & { readonly reduced: boolean } {\n const { motion } = useUi();\n const tokens = useMotionTokens();\n const byTokens = getOrInsert(retimed, motion, () => new WeakMap());\n return getOrInsert(byTokens, tokens, () => ({\n ...retimeModuleMotion(motion, tokens),\n reduced: tokens.reduced,\n }));\n}\n","\"use client\";\n\nimport { Icon as IconifyIcon } from \"@iconify-icon/react\";\n\nimport type { IconProps } from \"@/react/ui/types\";\n\n/**\n * Renders an icon by name or data.\n */\nexport function Icon({\n className,\n color,\n icon,\n onClick,\n size,\n style,\n ...props\n}: IconProps) {\n return (\n <IconifyIcon\n className={className}\n height={size}\n icon={icon}\n onClick={onClick}\n style={\n size === undefined\n ? { color, ...style }\n : { color, height: size, width: size, ...style }\n }\n width={size}\n {...props}\n />\n );\n}\n","\"use client\";\n\nimport type { LoaderProps, SpinnerProps } from \"@/react/ui/types\";\n\nimport { useUi } from \"../provider\";\nimport { Icon } from \"./icon\";\n\ninterface DotsProps {\n color?: string;\n size?: number;\n}\n\nfunction Dots({ color, size }: DotsProps) {\n const { parts } = useUi();\n return (\n <span\n aria-hidden=\"true\"\n className={parts.loader.dots()}\n style={{\n color,\n ...(size === undefined ? null : { \"--loader-size\": `${size}px` }),\n }}\n >\n <span className={parts.loader.dot()} />\n <span className={parts.loader.dot()} />\n <span className={parts.loader.dot()} />\n </span>\n );\n}\n\n/**\n * An animated status indicator; with children it overlays them while loading.\n */\nexport function Loader({ children, className, color, size }: LoaderProps) {\n const { labels, parts } = useUi();\n const over = Boolean(children);\n return (\n <span\n aria-label={labels.loading}\n className={parts.loader.root({ over, className })}\n role=\"status\"\n >\n {over ? (\n <>\n <span className={parts.loader.label()}>{children}</span>\n <span className={parts.loader.overlay()}>\n <Dots color={color} size={size} />\n </span>\n </>\n ) : (\n <Dots color={color} size={size} />\n )}\n </span>\n );\n}\n\n/**\n * A spinning icon status indicator.\n */\nexport function Spinner({ className, icon, size }: SpinnerProps) {\n const { icons, labels, parts } = useUi();\n const glyph = icon ?? icons.spinner;\n return (\n <span\n aria-label={labels.loading}\n className={parts.loader.spinner({ className })}\n role=\"status\"\n >\n {glyph ? (\n <Icon className={parts.loader.icon()} icon={glyph} size={size} />\n ) : null}\n </span>\n );\n}\n"]}