aeon-ui-engine 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/CONSUMER.md +86 -0
  3. package/INTEGRATION.md +2 -0
  4. package/README.md +15 -4
  5. package/package.json +17 -1
  6. package/packages/core/dist/index.d.ts +257 -0
  7. package/packages/core/dist/index.js +378 -0
  8. package/packages/core/node_modules/.bin/esbuild +21 -0
  9. package/packages/core/node_modules/.bin/jiti +21 -0
  10. package/packages/core/node_modules/.bin/tsc +21 -0
  11. package/packages/core/node_modules/.bin/tsserver +21 -0
  12. package/packages/core/node_modules/.bin/tsup +21 -0
  13. package/packages/core/node_modules/.bin/tsup-node +21 -0
  14. package/packages/core/node_modules/.bin/tsx +21 -0
  15. package/packages/core/node_modules/.bin/vite +21 -0
  16. package/packages/core/node_modules/.bin/vitest +21 -0
  17. package/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  18. package/packages/geometry/dist/index.d.ts +50 -0
  19. package/packages/geometry/dist/index.js +88 -0
  20. package/packages/geometry/node_modules/.bin/esbuild +21 -0
  21. package/packages/geometry/node_modules/.bin/jiti +21 -0
  22. package/packages/geometry/node_modules/.bin/tsc +21 -0
  23. package/packages/geometry/node_modules/.bin/tsserver +21 -0
  24. package/packages/geometry/node_modules/.bin/tsup +21 -0
  25. package/packages/geometry/node_modules/.bin/tsup-node +21 -0
  26. package/packages/geometry/node_modules/.bin/tsx +21 -0
  27. package/packages/panda/src/recipes/button.ts +4 -4
  28. package/packages/panda/src/recipes/combobox.ts +1 -1
  29. package/packages/panda/src/recipes/select.ts +1 -1
  30. package/packages/panda/src/theme/tokens.ts +5 -0
  31. package/packages/panda/styled-system/styles.css +10 -6
  32. package/packages/panda/styled-system/tokens/index.mjs +32 -0
  33. package/packages/panda/styled-system/tokens/tokens.d.ts +2 -2
  34. package/packages/primitives/dist/chunk-5S4DIRL4.js +42 -0
  35. package/packages/primitives/dist/chunk-H4KOEPYC.js +52 -0
  36. package/packages/primitives/dist/chunk-HONROWUG.js +41 -0
  37. package/packages/primitives/dist/chunk-J6JHKMVM.js +90 -0
  38. package/packages/primitives/dist/chunk-JBAG5E6W.js +46 -0
  39. package/packages/primitives/dist/chunk-LVNCD5F2.js +43 -0
  40. package/packages/primitives/dist/chunk-PB3LFHXU.js +72 -0
  41. package/packages/primitives/dist/chunk-SZV6KGXN.js +49 -0
  42. package/packages/primitives/dist/chunk-WVICCOQH.js +56 -0
  43. package/packages/primitives/dist/chunk-ZMGRX64G.js +74 -0
  44. package/packages/primitives/dist/index.d.ts +11 -0
  45. package/packages/primitives/dist/index.js +60 -0
  46. package/packages/primitives/dist/machines/accordion.d.ts +34 -0
  47. package/packages/primitives/dist/machines/accordion.js +6 -0
  48. package/packages/primitives/dist/machines/async.d.ts +111 -0
  49. package/packages/primitives/dist/machines/async.js +12 -0
  50. package/packages/primitives/dist/machines/button.d.ts +45 -0
  51. package/packages/primitives/dist/machines/button.js +8 -0
  52. package/packages/primitives/dist/machines/dialog.d.ts +57 -0
  53. package/packages/primitives/dist/machines/dialog.js +6 -0
  54. package/packages/primitives/dist/machines/field.d.ts +72 -0
  55. package/packages/primitives/dist/machines/field.js +12 -0
  56. package/packages/primitives/dist/machines/popover.d.ts +54 -0
  57. package/packages/primitives/dist/machines/popover.js +6 -0
  58. package/packages/primitives/dist/machines/slider.d.ts +71 -0
  59. package/packages/primitives/dist/machines/slider.js +10 -0
  60. package/packages/primitives/dist/machines/tabs.d.ts +39 -0
  61. package/packages/primitives/dist/machines/tabs.js +6 -0
  62. package/packages/primitives/dist/machines/toast.d.ts +31 -0
  63. package/packages/primitives/dist/machines/toast.js +6 -0
  64. package/packages/primitives/dist/machines/toggle.d.ts +54 -0
  65. package/packages/primitives/dist/machines/toggle.js +6 -0
  66. package/packages/primitives/node_modules/.bin/jiti +21 -0
  67. package/packages/primitives/node_modules/.bin/tsc +21 -0
  68. package/packages/primitives/node_modules/.bin/tsserver +21 -0
  69. package/packages/primitives/node_modules/.bin/tsup +21 -0
  70. package/packages/primitives/node_modules/.bin/tsup-node +21 -0
  71. package/packages/primitives/node_modules/.bin/tsx +21 -0
  72. package/packages/primitives/node_modules/.bin/vitest +21 -0
  73. package/packages/primitives/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  74. package/packages/react/dist/index.d.ts +564 -0
  75. package/packages/react/dist/index.js +3461 -0
  76. package/packages/react/node_modules/.bin/jiti +21 -0
  77. package/packages/react/node_modules/.bin/tsc +21 -0
  78. package/packages/react/node_modules/.bin/tsserver +21 -0
  79. package/packages/react/node_modules/.bin/tsup +21 -0
  80. package/packages/react/node_modules/.bin/tsup-node +21 -0
  81. package/packages/react/node_modules/.bin/tsx +21 -0
  82. package/packages/react/node_modules/.bin/vitest +21 -0
  83. package/packages/react/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  84. package/packages/react-scene/dist/index.d.ts +121 -0
  85. package/packages/react-scene/dist/index.js +430 -0
  86. package/packages/react-scene/node_modules/.bin/jiti +21 -0
  87. package/packages/react-scene/node_modules/.bin/tsc +21 -0
  88. package/packages/react-scene/node_modules/.bin/tsserver +21 -0
  89. package/packages/react-scene/node_modules/.bin/tsup +21 -0
  90. package/packages/react-scene/node_modules/.bin/tsup-node +21 -0
  91. package/packages/react-scene/node_modules/.bin/tsx +21 -0
  92. package/packages/scene/dist/index.d.ts +46 -0
  93. package/packages/scene/dist/index.js +54 -0
  94. package/packages/scene/node_modules/.bin/jiti +21 -0
  95. package/packages/scene/node_modules/.bin/tsc +21 -0
  96. package/packages/scene/node_modules/.bin/tsserver +21 -0
  97. package/packages/scene/node_modules/.bin/tsup +21 -0
  98. package/packages/scene/node_modules/.bin/tsup-node +21 -0
  99. package/packages/scene/node_modules/.bin/tsx +21 -0
  100. package/packages/signal/dist/index.d.ts +54 -0
  101. package/packages/signal/dist/index.js +169 -0
  102. package/packages/signal/node_modules/.bin/jiti +21 -0
  103. package/packages/signal/node_modules/.bin/tsc +21 -0
  104. package/packages/signal/node_modules/.bin/tsserver +21 -0
  105. package/packages/signal/node_modules/.bin/tsup +21 -0
  106. package/packages/signal/node_modules/.bin/tsup-node +21 -0
  107. package/packages/signal/node_modules/.bin/tsx +21 -0
  108. package/packages/site/dist/index.d.ts +31 -0
  109. package/packages/site/dist/index.js +62 -0
  110. package/packages/site/node_modules/.bin/jiti +21 -0
  111. package/packages/site/node_modules/.bin/tsc +21 -0
  112. package/packages/site/node_modules/.bin/tsserver +21 -0
  113. package/packages/site/node_modules/.bin/tsup +21 -0
  114. package/packages/site/node_modules/.bin/tsup-node +21 -0
  115. package/packages/site/node_modules/.bin/tsx +21 -0
  116. package/packages/solid/dist/index.d.ts +30 -0
  117. package/packages/solid/dist/index.js +174 -0
  118. package/packages/solid/node_modules/.bin/jiti +21 -0
  119. package/packages/solid/node_modules/.bin/tsc +21 -0
  120. package/packages/solid/node_modules/.bin/tsserver +21 -0
  121. package/packages/solid/node_modules/.bin/tsup +21 -0
  122. package/packages/solid/node_modules/.bin/tsup-node +21 -0
  123. package/packages/solid/node_modules/.bin/tsx +21 -0
  124. package/packages/surface/dist/index.d.ts +8 -0
  125. package/packages/surface/dist/index.js +14 -0
  126. package/packages/surface/node_modules/.bin/jiti +21 -0
  127. package/packages/surface/node_modules/.bin/tsc +21 -0
  128. package/packages/surface/node_modules/.bin/tsserver +21 -0
  129. package/packages/surface/node_modules/.bin/tsup +21 -0
  130. package/packages/surface/node_modules/.bin/tsup-node +21 -0
  131. package/packages/surface/node_modules/.bin/tsx +21 -0
  132. package/packages/svelte/dist/index.d.ts +12 -0
  133. package/packages/svelte/dist/index.js +15 -0
  134. package/packages/svelte/node_modules/.bin/acorn +21 -0
  135. package/packages/svelte/node_modules/.bin/jiti +21 -0
  136. package/packages/svelte/node_modules/.bin/svelte-check +21 -0
  137. package/packages/svelte/node_modules/.bin/tsc +21 -0
  138. package/packages/svelte/node_modules/.bin/tsserver +21 -0
  139. package/packages/svelte/node_modules/.bin/tsup +21 -0
  140. package/packages/svelte/node_modules/.bin/tsup-node +21 -0
  141. package/packages/svelte/node_modules/.bin/tsx +21 -0
  142. package/packages/svelte/node_modules/.bin/vite +21 -0
  143. package/packages/ui/dist/index.d.ts +200 -0
  144. package/packages/ui/dist/index.js +429 -0
  145. package/packages/ui/node_modules/.bin/jiti +21 -0
  146. package/packages/ui/node_modules/.bin/tsc +21 -0
  147. package/packages/ui/node_modules/.bin/tsserver +21 -0
  148. package/packages/ui/node_modules/.bin/tsup +21 -0
  149. package/packages/ui/node_modules/.bin/tsup-node +21 -0
  150. package/packages/ui/node_modules/.bin/tsx +21 -0
  151. package/packages/ui/src/select.tsx +3 -4
  152. package/packages/vue/dist/index.d.ts +71 -0
  153. package/packages/vue/dist/index.js +193 -0
  154. package/packages/vue/node_modules/.bin/jiti +21 -0
  155. package/packages/vue/node_modules/.bin/tsc +21 -0
  156. package/packages/vue/node_modules/.bin/tsserver +21 -0
  157. package/packages/vue/node_modules/.bin/tsup +21 -0
  158. package/packages/vue/node_modules/.bin/tsup-node +21 -0
  159. package/packages/vue/node_modules/.bin/tsx +21 -0
  160. package/scripts/vite-aliases.mjs +125 -0
  161. package/.changeset/README.md +0 -23
  162. package/.changeset/combobox-and-changesets.md +0 -9
  163. package/.changeset/config.json +0 -30
  164. package/.changeset/framework-adapters.md +0 -12
  165. package/.changeset/scene-3d.md +0 -6
  166. package/.changeset/scene-plane.md +0 -8
  167. package/.changeset/site-og.md +0 -5
  168. package/.cursor/rules/aeon-ui.mdc +0 -22
  169. package/ACCESSIBILITY.md +0 -32
  170. package/AGENTS.md +0 -226
  171. package/COMPONENTS.md +0 -41
  172. package/FRAMEWORKS.md +0 -57
  173. package/PHILOSOPHY.md +0 -71
  174. package/PUBLISHING.md +0 -85
  175. package/SCENE.md +0 -113
  176. package/STATES.md +0 -243
  177. package/apps/demo/index.html +0 -31
  178. package/apps/demo/og.config.mjs +0 -20
  179. package/apps/demo/package.json +0 -41
  180. package/apps/demo/public/favicon.svg +0 -16
  181. package/apps/demo/public/og-aeon-ui-engine.png +0 -0
  182. package/apps/demo/public/og.svg +0 -35
  183. package/apps/demo/scripts/generate-og-png.mjs +0 -62
  184. package/apps/demo/src/App.tsx +0 -31
  185. package/apps/demo/src/aeonDiagrams.ts +0 -42
  186. package/apps/demo/src/app.css +0 -16
  187. package/apps/demo/src/components/ActionCluster.tsx +0 -20
  188. package/apps/demo/src/components/AsyncMachineDemo.tsx +0 -97
  189. package/apps/demo/src/components/ButtonLifecycleDemo.tsx +0 -63
  190. package/apps/demo/src/components/CodeExample.tsx +0 -7
  191. package/apps/demo/src/components/ComboboxDemo.tsx +0 -30
  192. package/apps/demo/src/components/DiagramsSection.tsx +0 -37
  193. package/apps/demo/src/components/FieldStateDemo.tsx +0 -51
  194. package/apps/demo/src/components/GridMesh.tsx +0 -8
  195. package/apps/demo/src/components/HeroInstall.tsx +0 -13
  196. package/apps/demo/src/components/LandingFaq.tsx +0 -29
  197. package/apps/demo/src/components/LandingFooter.tsx +0 -30
  198. package/apps/demo/src/components/LandingHeader.tsx +0 -62
  199. package/apps/demo/src/components/LandingHero.tsx +0 -55
  200. package/apps/demo/src/components/LayersSection.tsx +0 -47
  201. package/apps/demo/src/components/MermaidDiagram.tsx +0 -86
  202. package/apps/demo/src/components/PhilosophySection.tsx +0 -31
  203. package/apps/demo/src/components/PlaygroundBlock.tsx +0 -18
  204. package/apps/demo/src/components/PlaygroundControlsDemo.tsx +0 -63
  205. package/apps/demo/src/components/PlaygroundSection.tsx +0 -120
  206. package/apps/demo/src/components/ScrollRegionDemo.tsx +0 -74
  207. package/apps/demo/src/components/ThemeSwitcher.tsx +0 -79
  208. package/apps/demo/src/demo-layout.css +0 -293
  209. package/apps/demo/src/landing.css +0 -1151
  210. package/apps/demo/src/main.tsx +0 -14
  211. package/apps/demo/src/nav.ts +0 -9
  212. package/apps/demo/src/site.ts +0 -218
  213. package/apps/demo/tsconfig.json +0 -17
  214. package/apps/demo/vite-plugins/og-meta.ts +0 -30
  215. package/apps/demo/vite.config.ts +0 -69
  216. package/docs/API_PATTERNS.md +0 -234
  217. package/docs/ARCHITECTURE.md +0 -125
  218. package/docs/COMPONENT_CHECKLIST.md +0 -103
  219. package/docs/FILE_MAP.md +0 -122
  220. package/docs/GLOSSARY.md +0 -125
  221. package/docs/INDEX.md +0 -53
  222. package/docs/LAYOUT_COORDINATES.md +0 -178
  223. package/docs/MACHINES.md +0 -171
  224. package/docs/MIGRATION_FROM_ARK.md +0 -295
  225. package/docs/VITE_CONSUMER.md +0 -114
  226. package/pnpm-workspace.yaml +0 -3
  227. package/vercel.json +0 -12
@@ -0,0 +1,41 @@
1
+ // src/machines/tabs.ts
2
+ import { assign, setup } from "xstate";
3
+ var tabsMachine = setup({
4
+ types: {
5
+ context: {},
6
+ events: {},
7
+ input: {}
8
+ },
9
+ guards: {
10
+ notDisabled: ({ context }) => !context.disabled,
11
+ hasValue: ({ event }) => event.type === "SELECT" && Boolean(event.value)
12
+ },
13
+ actions: {
14
+ select: assign({
15
+ value: ({ event }) => event.type === "SELECT" ? event.value : ""
16
+ }),
17
+ setValue: assign({
18
+ value: ({ event }) => event.type === "SET_VALUE" ? event.value : ""
19
+ })
20
+ }
21
+ }).createMachine({
22
+ id: "tabs",
23
+ context: ({ input }) => ({
24
+ value: input.value ?? "",
25
+ disabled: input.disabled ?? false
26
+ }),
27
+ /** Single stable region: which trigger is active. */
28
+ initial: "active",
29
+ states: {
30
+ active: {
31
+ on: {
32
+ SELECT: { actions: "select", guard: "hasValue" },
33
+ SET_VALUE: { actions: "setValue" }
34
+ }
35
+ }
36
+ }
37
+ });
38
+
39
+ export {
40
+ tabsMachine
41
+ };
@@ -0,0 +1,90 @@
1
+ // src/machines/async.ts
2
+ import { assign, setup } from "xstate";
3
+ var ASYNC_LIFECYCLE_STATES = [
4
+ "idle",
5
+ "loading",
6
+ "success",
7
+ "failure",
8
+ "empty"
9
+ ];
10
+ function isEmptyAsyncData(data) {
11
+ if (data == null) return true;
12
+ if (typeof data === "string") return data.length === 0;
13
+ if (Array.isArray(data)) return data.length === 0;
14
+ return false;
15
+ }
16
+ function createAsyncMachine() {
17
+ return setup({
18
+ types: {
19
+ context: {},
20
+ events: {}
21
+ },
22
+ actions: {
23
+ clear: assign({ data: null, error: null }),
24
+ resolve: assign({
25
+ data: ({ event }) => event.type === "RESOLVE" ? event.data : null,
26
+ error: null,
27
+ stale: false
28
+ }),
29
+ markStale: assign({ stale: true }),
30
+ clearStale: assign({ stale: false }),
31
+ reject: assign({
32
+ error: ({ event }) => event.type === "REJECT" ? event.error : null,
33
+ data: null
34
+ })
35
+ }
36
+ }).createMachine({
37
+ id: "async",
38
+ context: { data: null, error: null },
39
+ initial: "idle",
40
+ states: {
41
+ idle: {
42
+ on: {
43
+ FETCH: "loading",
44
+ RESET: { actions: "clear" }
45
+ }
46
+ },
47
+ loading: {
48
+ on: {
49
+ RESOLVE: [
50
+ {
51
+ target: "empty",
52
+ actions: "resolve",
53
+ guard: ({ event }) => event.type === "RESOLVE" && isEmptyAsyncData(event.data)
54
+ },
55
+ { target: "success", actions: "resolve" }
56
+ ],
57
+ REJECT: { target: "failure", actions: "reject" }
58
+ }
59
+ },
60
+ empty: {
61
+ on: {
62
+ FETCH: "loading",
63
+ RESET: { target: "idle", actions: "clear" }
64
+ }
65
+ },
66
+ success: {
67
+ on: {
68
+ FETCH: { target: "loading", actions: "clearStale" },
69
+ STALE: { actions: "markStale" },
70
+ REFRESH: { actions: "clearStale" },
71
+ RESET: { target: "idle", actions: "clear" }
72
+ }
73
+ },
74
+ failure: {
75
+ on: {
76
+ FETCH: "loading",
77
+ RESET: { target: "idle", actions: "clear" }
78
+ }
79
+ }
80
+ }
81
+ });
82
+ }
83
+ var asyncMachine = createAsyncMachine();
84
+
85
+ export {
86
+ ASYNC_LIFECYCLE_STATES,
87
+ isEmptyAsyncData,
88
+ createAsyncMachine,
89
+ asyncMachine
90
+ };
@@ -0,0 +1,46 @@
1
+ // src/machines/accordion.ts
2
+ import { assign, setup } from "xstate";
3
+ function toggleItem(items, item, multiple, collapsible) {
4
+ const isOpen = items.includes(item);
5
+ if (!multiple) {
6
+ if (isOpen) return collapsible ? [] : items;
7
+ return [item];
8
+ }
9
+ if (isOpen) return items.filter((i) => i !== item);
10
+ return [...items, item];
11
+ }
12
+ var accordionMachine = setup({
13
+ types: {
14
+ context: {},
15
+ events: {},
16
+ input: {}
17
+ },
18
+ actions: {
19
+ toggle: assign({
20
+ value: ({ context, event }) => event.type === "TOGGLE" ? toggleItem(context.value, event.item, context.multiple, context.collapsible) : context.value
21
+ }),
22
+ setValue: assign({
23
+ value: ({ event }) => event.type === "SET_VALUE" ? event.value : []
24
+ })
25
+ }
26
+ }).createMachine({
27
+ id: "accordion",
28
+ context: ({ input }) => ({
29
+ value: input.value ?? [],
30
+ multiple: input.multiple ?? false,
31
+ collapsible: input.collapsible ?? true
32
+ }),
33
+ initial: "managing",
34
+ states: {
35
+ managing: {
36
+ on: {
37
+ TOGGLE: { actions: "toggle" },
38
+ SET_VALUE: { actions: "setValue" }
39
+ }
40
+ }
41
+ }
42
+ });
43
+
44
+ export {
45
+ accordionMachine
46
+ };
@@ -0,0 +1,43 @@
1
+ // src/machines/popover.ts
2
+ import { assign, setup } from "xstate";
3
+ var popoverMachine = setup({
4
+ types: {
5
+ context: {},
6
+ events: {},
7
+ input: {}
8
+ },
9
+ actions: {
10
+ markOpen: assign({ open: true }),
11
+ markClosed: assign({ open: false }),
12
+ toggleOpen: assign({ open: ({ context }) => !context.open }),
13
+ setOpen: assign({
14
+ open: ({ event }) => event.type === "SET_OPEN" ? event.open : false
15
+ })
16
+ }
17
+ }).createMachine({
18
+ id: "popover",
19
+ context: ({ input }) => ({ open: input.open ?? false }),
20
+ initial: "closed",
21
+ states: {
22
+ closed: {
23
+ on: {
24
+ OPEN: { target: "open", actions: "markOpen" },
25
+ TOGGLE: { target: "open", actions: "markOpen" },
26
+ SET_OPEN: [{ target: "open", actions: "markOpen", guard: ({ event }) => event.open }]
27
+ }
28
+ },
29
+ open: {
30
+ on: {
31
+ CLOSE: { target: "closed", actions: "markClosed" },
32
+ ESCAPE: { target: "closed", actions: "markClosed" },
33
+ POINTER_DOWN_OUTSIDE: { target: "closed", actions: "markClosed" },
34
+ TOGGLE: { target: "closed", actions: "markClosed" },
35
+ SET_OPEN: [{ target: "closed", actions: "markClosed", guard: ({ event }) => !event.open }]
36
+ }
37
+ }
38
+ }
39
+ });
40
+
41
+ export {
42
+ popoverMachine
43
+ };
@@ -0,0 +1,72 @@
1
+ // src/machines/slider.ts
2
+ import { assign, setup } from "xstate";
3
+ function clamp(value, min, max) {
4
+ return Math.min(max, Math.max(min, value));
5
+ }
6
+ function snap(value, min, max, step) {
7
+ if (step <= 0) return clamp(value, min, max);
8
+ const snapped = min + Math.round((value - min) / step) * step;
9
+ return clamp(snapped, min, max);
10
+ }
11
+ var sliderMachine = setup({
12
+ types: {
13
+ context: {},
14
+ events: {},
15
+ input: {}
16
+ },
17
+ guards: {
18
+ notDisabled: ({ context }) => !context.disabled
19
+ },
20
+ actions: {
21
+ setValue: assign({
22
+ value: ({ context, event }) => event.type === "SET_VALUE" ? snap(event.value, context.min, context.max, context.step) : context.value
23
+ }),
24
+ step: assign({
25
+ value: ({ context, event }) => event.type === "STEP" ? snap(context.value + event.delta, context.min, context.max, context.step) : context.value
26
+ }),
27
+ home: assign({
28
+ value: ({ context }) => context.min
29
+ }),
30
+ end: assign({
31
+ value: ({ context }) => context.max
32
+ })
33
+ }
34
+ }).createMachine({
35
+ id: "slider",
36
+ context: ({ input }) => ({
37
+ value: snap(input.value ?? input.min, input.min, input.max, input.step),
38
+ min: input.min,
39
+ max: input.max,
40
+ step: input.step,
41
+ disabled: input.disabled ?? false
42
+ }),
43
+ initial: "interaction",
44
+ states: {
45
+ interaction: {
46
+ initial: "idle",
47
+ states: {
48
+ idle: {
49
+ on: {
50
+ SET_VALUE: { actions: "setValue", guard: "notDisabled" },
51
+ STEP: { actions: "step", guard: "notDisabled" },
52
+ HOME: { actions: "home", guard: "notDisabled" },
53
+ END: { actions: "end", guard: "notDisabled" },
54
+ POINTER_DOWN: { target: "dragging", guard: "notDisabled" }
55
+ }
56
+ },
57
+ dragging: {
58
+ on: {
59
+ SET_VALUE: { actions: "setValue" },
60
+ POINTER_UP: "idle"
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
66
+ });
67
+
68
+ export {
69
+ clamp,
70
+ snap,
71
+ sliderMachine
72
+ };
@@ -0,0 +1,49 @@
1
+ // src/machines/dialog.ts
2
+ import { assign, setup } from "xstate";
3
+ var dialogMachine = setup({
4
+ types: {
5
+ context: {},
6
+ events: {},
7
+ input: {}
8
+ },
9
+ actions: {
10
+ markOpen: assign({ open: true }),
11
+ markClosed: assign({ open: false }),
12
+ toggleOpen: assign({ open: ({ context }) => !context.open }),
13
+ setOpen: assign({
14
+ open: ({ event }) => event.type === "SET_OPEN" ? event.open : false
15
+ })
16
+ }
17
+ }).createMachine({
18
+ id: "dialog",
19
+ context: ({ input }) => ({
20
+ open: input.open ?? false
21
+ }),
22
+ initial: "closed",
23
+ states: {
24
+ closed: {
25
+ on: {
26
+ OPEN: { target: "open", actions: "markOpen" },
27
+ TOGGLE: { target: "open", actions: "markOpen" },
28
+ SET_OPEN: [
29
+ { target: "open", actions: "markOpen", guard: ({ event }) => event.open }
30
+ ]
31
+ }
32
+ },
33
+ open: {
34
+ on: {
35
+ CLOSE: { target: "closed", actions: "markClosed" },
36
+ ESCAPE: { target: "closed", actions: "markClosed" },
37
+ POINTER_DOWN_OUTSIDE: { target: "closed", actions: "markClosed" },
38
+ TOGGLE: { target: "closed", actions: "markClosed" },
39
+ SET_OPEN: [
40
+ { target: "closed", actions: "markClosed", guard: ({ event }) => !event.open }
41
+ ]
42
+ }
43
+ }
44
+ }
45
+ });
46
+
47
+ export {
48
+ dialogMachine
49
+ };
@@ -0,0 +1,56 @@
1
+ // src/machines/button.ts
2
+ import { setup } from "xstate";
3
+ var BUTTON_LIFECYCLE_STATES = [
4
+ "idle",
5
+ "pending",
6
+ "success",
7
+ "failure",
8
+ "disabled"
9
+ ];
10
+ var buttonLifecycleMachine = setup({
11
+ types: {
12
+ events: {}
13
+ }
14
+ }).createMachine({
15
+ id: "buttonLifecycle",
16
+ initial: "idle",
17
+ states: {
18
+ idle: {
19
+ on: {
20
+ PRESS: "pending",
21
+ DISABLE: "disabled"
22
+ }
23
+ },
24
+ pending: {
25
+ on: {
26
+ SUCCEED: "success",
27
+ FAIL: "failure",
28
+ DISABLE: "disabled"
29
+ }
30
+ },
31
+ success: {
32
+ on: {
33
+ RESET: "idle",
34
+ PRESS: "pending",
35
+ DISABLE: "disabled"
36
+ }
37
+ },
38
+ failure: {
39
+ on: {
40
+ RESET: "idle",
41
+ PRESS: "pending",
42
+ DISABLE: "disabled"
43
+ }
44
+ },
45
+ disabled: {
46
+ on: {
47
+ ENABLE: "idle"
48
+ }
49
+ }
50
+ }
51
+ });
52
+
53
+ export {
54
+ BUTTON_LIFECYCLE_STATES,
55
+ buttonLifecycleMachine
56
+ };
@@ -0,0 +1,74 @@
1
+ // src/machines/field.ts
2
+ import { setup } from "xstate";
3
+ var FIELD_INTERACTION_STATES = ["pristine", "dirty"];
4
+ var FIELD_VALIDATION_STATES = ["valid", "invalid"];
5
+ var FIELD_SUBMISSION_STATES = ["idle", "pending"];
6
+ var fieldMachine = setup({
7
+ types: {
8
+ events: {}
9
+ }
10
+ }).createMachine({
11
+ id: "field",
12
+ type: "parallel",
13
+ states: {
14
+ interaction: {
15
+ initial: "pristine",
16
+ states: {
17
+ pristine: {
18
+ on: {
19
+ INPUT: "dirty",
20
+ BLUR: "dirty"
21
+ }
22
+ },
23
+ dirty: {
24
+ on: {
25
+ RESET: "pristine"
26
+ }
27
+ }
28
+ }
29
+ },
30
+ validation: {
31
+ initial: "valid",
32
+ states: {
33
+ valid: {
34
+ on: {
35
+ VALIDATE: [
36
+ { target: "invalid", guard: ({ event }) => event.type === "VALIDATE" && !event.valid }
37
+ ]
38
+ }
39
+ },
40
+ invalid: {
41
+ on: {
42
+ VALIDATE: [
43
+ { target: "valid", guard: ({ event }) => event.type === "VALIDATE" && event.valid }
44
+ ],
45
+ RESET: "valid"
46
+ }
47
+ }
48
+ }
49
+ },
50
+ submission: {
51
+ initial: "idle",
52
+ states: {
53
+ idle: {
54
+ on: {
55
+ SUBMIT: "pending"
56
+ }
57
+ },
58
+ pending: {
59
+ on: {
60
+ SUBMIT_DONE: "idle",
61
+ SUBMIT_FAIL: "idle"
62
+ }
63
+ }
64
+ }
65
+ }
66
+ }
67
+ });
68
+
69
+ export {
70
+ FIELD_INTERACTION_STATES,
71
+ FIELD_VALIDATION_STATES,
72
+ FIELD_SUBMISSION_STATES,
73
+ fieldMachine
74
+ };
@@ -0,0 +1,11 @@
1
+ export { ToggleContext, ToggleEvent, toggleMachine } from './machines/toggle.js';
2
+ export { DialogContext, DialogEvent, dialogMachine } from './machines/dialog.js';
3
+ export { TabsContext, TabsEvent, tabsMachine } from './machines/tabs.js';
4
+ export { AccordionContext, AccordionEvent, accordionMachine } from './machines/accordion.js';
5
+ export { ASYNC_LIFECYCLE_STATES, AsyncContext, AsyncEvent, AsyncLifecycleState, asyncMachine, createAsyncMachine, isEmptyAsyncData } from './machines/async.js';
6
+ export { BUTTON_LIFECYCLE_STATES, ButtonLifecycleEvent, ButtonLifecycleState, buttonLifecycleMachine } from './machines/button.js';
7
+ export { FIELD_INTERACTION_STATES, FIELD_SUBMISSION_STATES, FIELD_VALIDATION_STATES, FieldEvent, FieldInteractionState, FieldSubmissionState, FieldValidationState, fieldMachine } from './machines/field.js';
8
+ export { PopoverContext, PopoverEvent, popoverMachine } from './machines/popover.js';
9
+ export { ToastContext, ToastEvent, toastMachine } from './machines/toast.js';
10
+ export { SliderContext, SliderEvent, clampSliderValue, sliderMachine, snapSliderValue } from './machines/slider.js';
11
+ import 'xstate';
@@ -0,0 +1,60 @@
1
+ import {
2
+ tabsMachine
3
+ } from "./chunk-HONROWUG.js";
4
+ import {
5
+ toastMachine
6
+ } from "./chunk-5S4DIRL4.js";
7
+ import {
8
+ toggleMachine
9
+ } from "./chunk-H4KOEPYC.js";
10
+ import {
11
+ accordionMachine
12
+ } from "./chunk-JBAG5E6W.js";
13
+ import {
14
+ ASYNC_LIFECYCLE_STATES,
15
+ asyncMachine,
16
+ createAsyncMachine,
17
+ isEmptyAsyncData
18
+ } from "./chunk-J6JHKMVM.js";
19
+ import {
20
+ BUTTON_LIFECYCLE_STATES,
21
+ buttonLifecycleMachine
22
+ } from "./chunk-WVICCOQH.js";
23
+ import {
24
+ dialogMachine
25
+ } from "./chunk-SZV6KGXN.js";
26
+ import {
27
+ FIELD_INTERACTION_STATES,
28
+ FIELD_SUBMISSION_STATES,
29
+ FIELD_VALIDATION_STATES,
30
+ fieldMachine
31
+ } from "./chunk-ZMGRX64G.js";
32
+ import {
33
+ popoverMachine
34
+ } from "./chunk-LVNCD5F2.js";
35
+ import {
36
+ clamp,
37
+ sliderMachine,
38
+ snap
39
+ } from "./chunk-PB3LFHXU.js";
40
+ export {
41
+ ASYNC_LIFECYCLE_STATES,
42
+ BUTTON_LIFECYCLE_STATES,
43
+ FIELD_INTERACTION_STATES,
44
+ FIELD_SUBMISSION_STATES,
45
+ FIELD_VALIDATION_STATES,
46
+ accordionMachine,
47
+ asyncMachine,
48
+ buttonLifecycleMachine,
49
+ clamp as clampSliderValue,
50
+ createAsyncMachine,
51
+ dialogMachine,
52
+ fieldMachine,
53
+ isEmptyAsyncData,
54
+ popoverMachine,
55
+ sliderMachine,
56
+ snap as snapSliderValue,
57
+ tabsMachine,
58
+ toastMachine,
59
+ toggleMachine
60
+ };
@@ -0,0 +1,34 @@
1
+ import * as xstate from 'xstate';
2
+
3
+ interface AccordionContext {
4
+ value: string[];
5
+ multiple: boolean;
6
+ collapsible: boolean;
7
+ }
8
+ type AccordionEvent = {
9
+ type: 'TOGGLE';
10
+ item: string;
11
+ } | {
12
+ type: 'SET_VALUE';
13
+ value: string[];
14
+ };
15
+ declare const accordionMachine: xstate.StateMachine<AccordionContext, {
16
+ type: "TOGGLE";
17
+ item: string;
18
+ } | {
19
+ type: "SET_VALUE";
20
+ value: string[];
21
+ }, {}, never, {
22
+ type: "toggle";
23
+ params: xstate.NonReducibleUnknown;
24
+ } | {
25
+ type: "setValue";
26
+ params: xstate.NonReducibleUnknown;
27
+ }, never, never, "managing", string, AccordionContext, xstate.NonReducibleUnknown, xstate.EventObject, xstate.MetaObject, {
28
+ id: "accordion";
29
+ states: {
30
+ readonly managing: {};
31
+ };
32
+ }>;
33
+
34
+ export { type AccordionContext, type AccordionEvent, accordionMachine };
@@ -0,0 +1,6 @@
1
+ import {
2
+ accordionMachine
3
+ } from "../chunk-JBAG5E6W.js";
4
+ export {
5
+ accordionMachine
6
+ };
@@ -0,0 +1,111 @@
1
+ import * as xstate from 'xstate';
2
+
3
+ /** Stable lifecycle states for async data regions (see STATES.md). */
4
+ declare const ASYNC_LIFECYCLE_STATES: readonly ["idle", "loading", "success", "failure", "empty"];
5
+ type AsyncLifecycleState = (typeof ASYNC_LIFECYCLE_STATES)[number];
6
+ declare function isEmptyAsyncData(data: unknown): boolean;
7
+ /**
8
+ * Thesis §2.1: fetch lifecycle as sequential, well-defined states.
9
+ * This machine models fetch lifecycle as mutually exclusive states.
10
+ */
11
+ interface AsyncContext<T = unknown> {
12
+ data: T | null;
13
+ error: string | null;
14
+ /** Success with background refresh — style readout as `success stale` (see STATES.md). */
15
+ stale?: boolean;
16
+ }
17
+ type AsyncEvent<T = unknown> = {
18
+ type: 'FETCH';
19
+ } | {
20
+ type: 'RESOLVE';
21
+ data: T;
22
+ } | {
23
+ type: 'REJECT';
24
+ error: string;
25
+ } | {
26
+ type: 'RESET';
27
+ } | {
28
+ type: 'STALE';
29
+ } | {
30
+ type: 'REFRESH';
31
+ };
32
+ declare function createAsyncMachine<T = unknown>(): xstate.StateMachine<AsyncContext<T>, {
33
+ type: "FETCH";
34
+ } | {
35
+ type: "REJECT";
36
+ error: string;
37
+ } | {
38
+ type: "RESET";
39
+ } | {
40
+ type: "STALE";
41
+ } | {
42
+ type: "REFRESH";
43
+ } | {
44
+ type: "RESOLVE";
45
+ data: T;
46
+ }, {}, never, {
47
+ type: "clear";
48
+ params: xstate.NonReducibleUnknown;
49
+ } | {
50
+ type: "resolve";
51
+ params: xstate.NonReducibleUnknown;
52
+ } | {
53
+ type: "markStale";
54
+ params: xstate.NonReducibleUnknown;
55
+ } | {
56
+ type: "clearStale";
57
+ params: xstate.NonReducibleUnknown;
58
+ } | {
59
+ type: "reject";
60
+ params: xstate.NonReducibleUnknown;
61
+ }, never, never, "idle" | "loading" | "success" | "failure" | "empty", string, xstate.NonReducibleUnknown, xstate.NonReducibleUnknown, xstate.EventObject, xstate.MetaObject, {
62
+ id: "async";
63
+ states: {
64
+ readonly idle: {};
65
+ readonly loading: {};
66
+ readonly empty: {};
67
+ readonly success: {};
68
+ readonly failure: {};
69
+ };
70
+ }>;
71
+ declare const asyncMachine: xstate.StateMachine<AsyncContext<unknown>, {
72
+ type: "FETCH";
73
+ } | {
74
+ type: "REJECT";
75
+ error: string;
76
+ } | {
77
+ type: "RESET";
78
+ } | {
79
+ type: "STALE";
80
+ } | {
81
+ type: "REFRESH";
82
+ } | {
83
+ type: "RESOLVE";
84
+ data: unknown;
85
+ }, {}, never, {
86
+ type: "clear";
87
+ params: xstate.NonReducibleUnknown;
88
+ } | {
89
+ type: "resolve";
90
+ params: xstate.NonReducibleUnknown;
91
+ } | {
92
+ type: "markStale";
93
+ params: xstate.NonReducibleUnknown;
94
+ } | {
95
+ type: "clearStale";
96
+ params: xstate.NonReducibleUnknown;
97
+ } | {
98
+ type: "reject";
99
+ params: xstate.NonReducibleUnknown;
100
+ }, never, never, "idle" | "loading" | "success" | "failure" | "empty", string, xstate.NonReducibleUnknown, xstate.NonReducibleUnknown, xstate.EventObject, xstate.MetaObject, {
101
+ id: "async";
102
+ states: {
103
+ readonly idle: {};
104
+ readonly loading: {};
105
+ readonly empty: {};
106
+ readonly success: {};
107
+ readonly failure: {};
108
+ };
109
+ }>;
110
+
111
+ export { ASYNC_LIFECYCLE_STATES, type AsyncContext, type AsyncEvent, type AsyncLifecycleState, asyncMachine, createAsyncMachine, isEmptyAsyncData };