aeon-ui-engine 1.0.2 → 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.
- package/CHANGELOG.md +13 -0
- package/CONSUMER.md +86 -0
- package/INTEGRATION.md +2 -0
- package/README.md +15 -4
- package/package.json +17 -1
- package/packages/core/dist/index.d.ts +257 -0
- package/packages/core/dist/index.js +378 -0
- package/packages/core/node_modules/.bin/esbuild +21 -0
- package/packages/core/node_modules/.bin/jiti +21 -0
- package/packages/core/node_modules/.bin/tsc +21 -0
- package/packages/core/node_modules/.bin/tsserver +21 -0
- package/packages/core/node_modules/.bin/tsup +21 -0
- package/packages/core/node_modules/.bin/tsup-node +21 -0
- package/packages/core/node_modules/.bin/tsx +21 -0
- package/packages/core/node_modules/.bin/vite +21 -0
- package/packages/core/node_modules/.bin/vitest +21 -0
- package/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/geometry/dist/index.d.ts +50 -0
- package/packages/geometry/dist/index.js +88 -0
- package/packages/geometry/node_modules/.bin/esbuild +21 -0
- package/packages/geometry/node_modules/.bin/jiti +21 -0
- package/packages/geometry/node_modules/.bin/tsc +21 -0
- package/packages/geometry/node_modules/.bin/tsserver +21 -0
- package/packages/geometry/node_modules/.bin/tsup +21 -0
- package/packages/geometry/node_modules/.bin/tsup-node +21 -0
- package/packages/geometry/node_modules/.bin/tsx +21 -0
- package/packages/primitives/dist/chunk-5S4DIRL4.js +42 -0
- package/packages/primitives/dist/chunk-H4KOEPYC.js +52 -0
- package/packages/primitives/dist/chunk-HONROWUG.js +41 -0
- package/packages/primitives/dist/chunk-J6JHKMVM.js +90 -0
- package/packages/primitives/dist/chunk-JBAG5E6W.js +46 -0
- package/packages/primitives/dist/chunk-LVNCD5F2.js +43 -0
- package/packages/primitives/dist/chunk-PB3LFHXU.js +72 -0
- package/packages/primitives/dist/chunk-SZV6KGXN.js +49 -0
- package/packages/primitives/dist/chunk-WVICCOQH.js +56 -0
- package/packages/primitives/dist/chunk-ZMGRX64G.js +74 -0
- package/packages/primitives/dist/index.d.ts +11 -0
- package/packages/primitives/dist/index.js +60 -0
- package/packages/primitives/dist/machines/accordion.d.ts +34 -0
- package/packages/primitives/dist/machines/accordion.js +6 -0
- package/packages/primitives/dist/machines/async.d.ts +111 -0
- package/packages/primitives/dist/machines/async.js +12 -0
- package/packages/primitives/dist/machines/button.d.ts +45 -0
- package/packages/primitives/dist/machines/button.js +8 -0
- package/packages/primitives/dist/machines/dialog.d.ts +57 -0
- package/packages/primitives/dist/machines/dialog.js +6 -0
- package/packages/primitives/dist/machines/field.d.ts +72 -0
- package/packages/primitives/dist/machines/field.js +12 -0
- package/packages/primitives/dist/machines/popover.d.ts +54 -0
- package/packages/primitives/dist/machines/popover.js +6 -0
- package/packages/primitives/dist/machines/slider.d.ts +71 -0
- package/packages/primitives/dist/machines/slider.js +10 -0
- package/packages/primitives/dist/machines/tabs.d.ts +39 -0
- package/packages/primitives/dist/machines/tabs.js +6 -0
- package/packages/primitives/dist/machines/toast.d.ts +31 -0
- package/packages/primitives/dist/machines/toast.js +6 -0
- package/packages/primitives/dist/machines/toggle.d.ts +54 -0
- package/packages/primitives/dist/machines/toggle.js +6 -0
- package/packages/primitives/node_modules/.bin/jiti +21 -0
- package/packages/primitives/node_modules/.bin/tsc +21 -0
- package/packages/primitives/node_modules/.bin/tsserver +21 -0
- package/packages/primitives/node_modules/.bin/tsup +21 -0
- package/packages/primitives/node_modules/.bin/tsup-node +21 -0
- package/packages/primitives/node_modules/.bin/tsx +21 -0
- package/packages/primitives/node_modules/.bin/vitest +21 -0
- package/packages/primitives/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/react/dist/index.d.ts +564 -0
- package/packages/react/dist/index.js +3461 -0
- package/packages/react/node_modules/.bin/jiti +21 -0
- package/packages/react/node_modules/.bin/tsc +21 -0
- package/packages/react/node_modules/.bin/tsserver +21 -0
- package/packages/react/node_modules/.bin/tsup +21 -0
- package/packages/react/node_modules/.bin/tsup-node +21 -0
- package/packages/react/node_modules/.bin/tsx +21 -0
- package/packages/react/node_modules/.bin/vitest +21 -0
- package/packages/react/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/react-scene/dist/index.d.ts +121 -0
- package/packages/react-scene/dist/index.js +430 -0
- package/packages/react-scene/node_modules/.bin/jiti +21 -0
- package/packages/react-scene/node_modules/.bin/tsc +21 -0
- package/packages/react-scene/node_modules/.bin/tsserver +21 -0
- package/packages/react-scene/node_modules/.bin/tsup +21 -0
- package/packages/react-scene/node_modules/.bin/tsup-node +21 -0
- package/packages/react-scene/node_modules/.bin/tsx +21 -0
- package/packages/scene/dist/index.d.ts +46 -0
- package/packages/scene/dist/index.js +54 -0
- package/packages/scene/node_modules/.bin/jiti +21 -0
- package/packages/scene/node_modules/.bin/tsc +21 -0
- package/packages/scene/node_modules/.bin/tsserver +21 -0
- package/packages/scene/node_modules/.bin/tsup +21 -0
- package/packages/scene/node_modules/.bin/tsup-node +21 -0
- package/packages/scene/node_modules/.bin/tsx +21 -0
- package/packages/signal/dist/index.d.ts +54 -0
- package/packages/signal/dist/index.js +169 -0
- package/packages/signal/node_modules/.bin/jiti +21 -0
- package/packages/signal/node_modules/.bin/tsc +21 -0
- package/packages/signal/node_modules/.bin/tsserver +21 -0
- package/packages/signal/node_modules/.bin/tsup +21 -0
- package/packages/signal/node_modules/.bin/tsup-node +21 -0
- package/packages/signal/node_modules/.bin/tsx +21 -0
- package/packages/site/dist/index.d.ts +31 -0
- package/packages/site/dist/index.js +62 -0
- package/packages/site/node_modules/.bin/jiti +21 -0
- package/packages/site/node_modules/.bin/tsc +21 -0
- package/packages/site/node_modules/.bin/tsserver +21 -0
- package/packages/site/node_modules/.bin/tsup +21 -0
- package/packages/site/node_modules/.bin/tsup-node +21 -0
- package/packages/site/node_modules/.bin/tsx +21 -0
- package/packages/solid/dist/index.d.ts +30 -0
- package/packages/solid/dist/index.js +174 -0
- package/packages/solid/node_modules/.bin/jiti +21 -0
- package/packages/solid/node_modules/.bin/tsc +21 -0
- package/packages/solid/node_modules/.bin/tsserver +21 -0
- package/packages/solid/node_modules/.bin/tsup +21 -0
- package/packages/solid/node_modules/.bin/tsup-node +21 -0
- package/packages/solid/node_modules/.bin/tsx +21 -0
- package/packages/surface/dist/index.d.ts +8 -0
- package/packages/surface/dist/index.js +14 -0
- package/packages/surface/node_modules/.bin/jiti +21 -0
- package/packages/surface/node_modules/.bin/tsc +21 -0
- package/packages/surface/node_modules/.bin/tsserver +21 -0
- package/packages/surface/node_modules/.bin/tsup +21 -0
- package/packages/surface/node_modules/.bin/tsup-node +21 -0
- package/packages/surface/node_modules/.bin/tsx +21 -0
- package/packages/svelte/dist/index.d.ts +12 -0
- package/packages/svelte/dist/index.js +15 -0
- package/packages/svelte/node_modules/.bin/acorn +21 -0
- package/packages/svelte/node_modules/.bin/jiti +21 -0
- package/packages/svelte/node_modules/.bin/svelte-check +21 -0
- package/packages/svelte/node_modules/.bin/tsc +21 -0
- package/packages/svelte/node_modules/.bin/tsserver +21 -0
- package/packages/svelte/node_modules/.bin/tsup +21 -0
- package/packages/svelte/node_modules/.bin/tsup-node +21 -0
- package/packages/svelte/node_modules/.bin/tsx +21 -0
- package/packages/svelte/node_modules/.bin/vite +21 -0
- package/packages/ui/dist/index.d.ts +200 -0
- package/packages/ui/dist/index.js +429 -0
- package/packages/ui/node_modules/.bin/jiti +21 -0
- package/packages/ui/node_modules/.bin/tsc +21 -0
- package/packages/ui/node_modules/.bin/tsserver +21 -0
- package/packages/ui/node_modules/.bin/tsup +21 -0
- package/packages/ui/node_modules/.bin/tsup-node +21 -0
- package/packages/ui/node_modules/.bin/tsx +21 -0
- package/packages/vue/dist/index.d.ts +71 -0
- package/packages/vue/dist/index.js +193 -0
- package/packages/vue/node_modules/.bin/jiti +21 -0
- package/packages/vue/node_modules/.bin/tsc +21 -0
- package/packages/vue/node_modules/.bin/tsserver +21 -0
- package/packages/vue/node_modules/.bin/tsup +21 -0
- package/packages/vue/node_modules/.bin/tsup-node +21 -0
- package/packages/vue/node_modules/.bin/tsx +21 -0
- package/scripts/vite-aliases.mjs +125 -0
- package/.changeset/README.md +0 -23
- package/.changeset/combobox-and-changesets.md +0 -9
- package/.changeset/config.json +0 -31
- package/.changeset/framework-adapters.md +0 -12
- package/.changeset/scene-3d.md +0 -6
- package/.changeset/scene-plane.md +0 -8
- package/.changeset/site-og.md +0 -5
- package/.cursor/rules/aeon-ui.mdc +0 -22
- package/ACCESSIBILITY.md +0 -32
- package/AGENTS.md +0 -226
- package/COMPONENTS.md +0 -41
- package/FRAMEWORKS.md +0 -57
- package/PHILOSOPHY.md +0 -71
- package/PUBLISHING.md +0 -105
- package/SCENE.md +0 -113
- package/STATES.md +0 -243
- package/apps/demo/index.html +0 -31
- package/apps/demo/og.config.mjs +0 -20
- package/apps/demo/package.json +0 -41
- package/apps/demo/public/favicon.svg +0 -16
- package/apps/demo/public/og-aeon-ui-engine.png +0 -0
- package/apps/demo/public/og.svg +0 -35
- package/apps/demo/scripts/generate-og-png.mjs +0 -62
- package/apps/demo/src/App.tsx +0 -31
- package/apps/demo/src/aeonDiagrams.ts +0 -42
- package/apps/demo/src/app.css +0 -16
- package/apps/demo/src/components/ActionCluster.tsx +0 -20
- package/apps/demo/src/components/AsyncMachineDemo.tsx +0 -97
- package/apps/demo/src/components/ButtonLifecycleDemo.tsx +0 -63
- package/apps/demo/src/components/CodeExample.tsx +0 -7
- package/apps/demo/src/components/ComboboxDemo.tsx +0 -30
- package/apps/demo/src/components/DiagramsSection.tsx +0 -37
- package/apps/demo/src/components/FieldStateDemo.tsx +0 -51
- package/apps/demo/src/components/GridMesh.tsx +0 -8
- package/apps/demo/src/components/HeroInstall.tsx +0 -13
- package/apps/demo/src/components/LandingFaq.tsx +0 -29
- package/apps/demo/src/components/LandingFooter.tsx +0 -30
- package/apps/demo/src/components/LandingHeader.tsx +0 -62
- package/apps/demo/src/components/LandingHero.tsx +0 -55
- package/apps/demo/src/components/LayersSection.tsx +0 -47
- package/apps/demo/src/components/MermaidDiagram.tsx +0 -86
- package/apps/demo/src/components/PhilosophySection.tsx +0 -31
- package/apps/demo/src/components/PlaygroundBlock.tsx +0 -18
- package/apps/demo/src/components/PlaygroundControlsDemo.tsx +0 -63
- package/apps/demo/src/components/PlaygroundSection.tsx +0 -120
- package/apps/demo/src/components/ScrollRegionDemo.tsx +0 -74
- package/apps/demo/src/components/ThemeSwitcher.tsx +0 -79
- package/apps/demo/src/demo-layout.css +0 -293
- package/apps/demo/src/landing.css +0 -1143
- package/apps/demo/src/main.tsx +0 -14
- package/apps/demo/src/nav.ts +0 -9
- package/apps/demo/src/site.ts +0 -218
- package/apps/demo/tsconfig.json +0 -17
- package/apps/demo/vite-plugins/og-meta.ts +0 -30
- package/apps/demo/vite.config.ts +0 -69
- package/docs/API_PATTERNS.md +0 -234
- package/docs/ARCHITECTURE.md +0 -125
- package/docs/COMPONENT_CHECKLIST.md +0 -103
- package/docs/FILE_MAP.md +0 -122
- package/docs/GLOSSARY.md +0 -125
- package/docs/INDEX.md +0 -53
- package/docs/LAYOUT_COORDINATES.md +0 -178
- package/docs/MACHINES.md +0 -171
- package/docs/MIGRATION_FROM_ARK.md +0 -295
- package/docs/VITE_CONSUMER.md +0 -114
- package/pnpm-workspace.yaml +0 -3
- package/vercel.json +0 -12
|
@@ -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,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 };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as xstate from 'xstate';
|
|
2
|
+
|
|
3
|
+
declare const BUTTON_LIFECYCLE_STATES: readonly ["idle", "pending", "success", "failure", "disabled"];
|
|
4
|
+
type ButtonLifecycleState = (typeof BUTTON_LIFECYCLE_STATES)[number];
|
|
5
|
+
type ButtonLifecycleEvent = {
|
|
6
|
+
type: 'PRESS';
|
|
7
|
+
} | {
|
|
8
|
+
type: 'SUCCEED';
|
|
9
|
+
} | {
|
|
10
|
+
type: 'FAIL';
|
|
11
|
+
} | {
|
|
12
|
+
type: 'RESET';
|
|
13
|
+
} | {
|
|
14
|
+
type: 'DISABLE';
|
|
15
|
+
} | {
|
|
16
|
+
type: 'ENABLE';
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Submit / action button lifecycle — idle → pending → success | failure.
|
|
20
|
+
* Use for controls that represent an in-flight operation, not mere `disabled`.
|
|
21
|
+
*/
|
|
22
|
+
declare const buttonLifecycleMachine: xstate.StateMachine<xstate.MachineContext, {
|
|
23
|
+
type: "PRESS";
|
|
24
|
+
} | {
|
|
25
|
+
type: "SUCCEED";
|
|
26
|
+
} | {
|
|
27
|
+
type: "FAIL";
|
|
28
|
+
} | {
|
|
29
|
+
type: "RESET";
|
|
30
|
+
} | {
|
|
31
|
+
type: "DISABLE";
|
|
32
|
+
} | {
|
|
33
|
+
type: "ENABLE";
|
|
34
|
+
}, {}, never, never, never, never, "disabled" | "idle" | "success" | "failure" | "pending", string, xstate.NonReducibleUnknown, xstate.NonReducibleUnknown, xstate.EventObject, xstate.MetaObject, {
|
|
35
|
+
id: "buttonLifecycle";
|
|
36
|
+
states: {
|
|
37
|
+
readonly idle: {};
|
|
38
|
+
readonly pending: {};
|
|
39
|
+
readonly success: {};
|
|
40
|
+
readonly failure: {};
|
|
41
|
+
readonly disabled: {};
|
|
42
|
+
};
|
|
43
|
+
}>;
|
|
44
|
+
|
|
45
|
+
export { BUTTON_LIFECYCLE_STATES, type ButtonLifecycleEvent, type ButtonLifecycleState, buttonLifecycleMachine };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as xstate from 'xstate';
|
|
2
|
+
|
|
3
|
+
interface DialogContext {
|
|
4
|
+
open: boolean;
|
|
5
|
+
}
|
|
6
|
+
type DialogEvent = {
|
|
7
|
+
type: 'OPEN';
|
|
8
|
+
} | {
|
|
9
|
+
type: 'CLOSE';
|
|
10
|
+
} | {
|
|
11
|
+
type: 'TOGGLE';
|
|
12
|
+
} | {
|
|
13
|
+
type: 'SET_OPEN';
|
|
14
|
+
open: boolean;
|
|
15
|
+
} | {
|
|
16
|
+
type: 'ESCAPE';
|
|
17
|
+
} | {
|
|
18
|
+
type: 'POINTER_DOWN_OUTSIDE';
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Dialog visibility is a single orthogonal region: closed | open.
|
|
22
|
+
* Open and closed are distinct, stable states.
|
|
23
|
+
*/
|
|
24
|
+
declare const dialogMachine: xstate.StateMachine<DialogContext, {
|
|
25
|
+
type: "OPEN";
|
|
26
|
+
} | {
|
|
27
|
+
type: "CLOSE";
|
|
28
|
+
} | {
|
|
29
|
+
type: "TOGGLE";
|
|
30
|
+
} | {
|
|
31
|
+
type: "SET_OPEN";
|
|
32
|
+
open: boolean;
|
|
33
|
+
} | {
|
|
34
|
+
type: "ESCAPE";
|
|
35
|
+
} | {
|
|
36
|
+
type: "POINTER_DOWN_OUTSIDE";
|
|
37
|
+
}, {}, never, {
|
|
38
|
+
type: "markOpen";
|
|
39
|
+
params: xstate.NonReducibleUnknown;
|
|
40
|
+
} | {
|
|
41
|
+
type: "markClosed";
|
|
42
|
+
params: xstate.NonReducibleUnknown;
|
|
43
|
+
} | {
|
|
44
|
+
type: "toggleOpen";
|
|
45
|
+
params: xstate.NonReducibleUnknown;
|
|
46
|
+
} | {
|
|
47
|
+
type: "setOpen";
|
|
48
|
+
params: xstate.NonReducibleUnknown;
|
|
49
|
+
}, never, never, "open" | "closed", string, DialogContext, xstate.NonReducibleUnknown, xstate.EventObject, xstate.MetaObject, {
|
|
50
|
+
id: "dialog";
|
|
51
|
+
states: {
|
|
52
|
+
readonly closed: {};
|
|
53
|
+
readonly open: {};
|
|
54
|
+
};
|
|
55
|
+
}>;
|
|
56
|
+
|
|
57
|
+
export { type DialogContext, type DialogEvent, dialogMachine };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as xstate from 'xstate';
|
|
2
|
+
|
|
3
|
+
declare const FIELD_INTERACTION_STATES: readonly ["pristine", "dirty"];
|
|
4
|
+
declare const FIELD_VALIDATION_STATES: readonly ["valid", "invalid"];
|
|
5
|
+
declare const FIELD_SUBMISSION_STATES: readonly ["idle", "pending"];
|
|
6
|
+
type FieldInteractionState = (typeof FIELD_INTERACTION_STATES)[number];
|
|
7
|
+
type FieldValidationState = (typeof FIELD_VALIDATION_STATES)[number];
|
|
8
|
+
type FieldSubmissionState = (typeof FIELD_SUBMISSION_STATES)[number];
|
|
9
|
+
type FieldEvent = {
|
|
10
|
+
type: 'INPUT';
|
|
11
|
+
} | {
|
|
12
|
+
type: 'BLUR';
|
|
13
|
+
} | {
|
|
14
|
+
type: 'VALIDATE';
|
|
15
|
+
valid: boolean;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'SUBMIT';
|
|
18
|
+
} | {
|
|
19
|
+
type: 'SUBMIT_DONE';
|
|
20
|
+
} | {
|
|
21
|
+
type: 'SUBMIT_FAIL';
|
|
22
|
+
} | {
|
|
23
|
+
type: 'RESET';
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Orthogonal field regions — interaction, validation, and submission evolve independently.
|
|
27
|
+
* Snapshot value is nested; flatten with `stateToAttr` for `data-aeon-state`.
|
|
28
|
+
*/
|
|
29
|
+
declare const fieldMachine: xstate.StateMachine<xstate.MachineContext, {
|
|
30
|
+
type: "INPUT";
|
|
31
|
+
} | {
|
|
32
|
+
type: "BLUR";
|
|
33
|
+
} | {
|
|
34
|
+
type: "VALIDATE";
|
|
35
|
+
valid: boolean;
|
|
36
|
+
} | {
|
|
37
|
+
type: "SUBMIT";
|
|
38
|
+
} | {
|
|
39
|
+
type: "SUBMIT_DONE";
|
|
40
|
+
} | {
|
|
41
|
+
type: "SUBMIT_FAIL";
|
|
42
|
+
} | {
|
|
43
|
+
type: "RESET";
|
|
44
|
+
}, {}, never, never, never, never, {
|
|
45
|
+
interaction: "pristine" | "dirty";
|
|
46
|
+
validation: "valid" | "invalid";
|
|
47
|
+
submission: "idle" | "pending";
|
|
48
|
+
}, string, xstate.NonReducibleUnknown, xstate.NonReducibleUnknown, xstate.EventObject, xstate.MetaObject, {
|
|
49
|
+
id: "field";
|
|
50
|
+
states: {
|
|
51
|
+
readonly interaction: {
|
|
52
|
+
states: {
|
|
53
|
+
readonly pristine: {};
|
|
54
|
+
readonly dirty: {};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
readonly validation: {
|
|
58
|
+
states: {
|
|
59
|
+
readonly valid: {};
|
|
60
|
+
readonly invalid: {};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
readonly submission: {
|
|
64
|
+
states: {
|
|
65
|
+
readonly idle: {};
|
|
66
|
+
readonly pending: {};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
}>;
|
|
71
|
+
|
|
72
|
+
export { FIELD_INTERACTION_STATES, FIELD_SUBMISSION_STATES, FIELD_VALIDATION_STATES, type FieldEvent, type FieldInteractionState, type FieldSubmissionState, type FieldValidationState, fieldMachine };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as xstate from 'xstate';
|
|
2
|
+
|
|
3
|
+
interface PopoverContext {
|
|
4
|
+
open: boolean;
|
|
5
|
+
}
|
|
6
|
+
type PopoverEvent = {
|
|
7
|
+
type: 'OPEN';
|
|
8
|
+
} | {
|
|
9
|
+
type: 'CLOSE';
|
|
10
|
+
} | {
|
|
11
|
+
type: 'TOGGLE';
|
|
12
|
+
} | {
|
|
13
|
+
type: 'SET_OPEN';
|
|
14
|
+
open: boolean;
|
|
15
|
+
} | {
|
|
16
|
+
type: 'ESCAPE';
|
|
17
|
+
} | {
|
|
18
|
+
type: 'POINTER_DOWN_OUTSIDE';
|
|
19
|
+
};
|
|
20
|
+
/** Floating surface: menu, popover, select listbox — closed | open. */
|
|
21
|
+
declare const popoverMachine: xstate.StateMachine<PopoverContext, {
|
|
22
|
+
type: "OPEN";
|
|
23
|
+
} | {
|
|
24
|
+
type: "CLOSE";
|
|
25
|
+
} | {
|
|
26
|
+
type: "TOGGLE";
|
|
27
|
+
} | {
|
|
28
|
+
type: "SET_OPEN";
|
|
29
|
+
open: boolean;
|
|
30
|
+
} | {
|
|
31
|
+
type: "ESCAPE";
|
|
32
|
+
} | {
|
|
33
|
+
type: "POINTER_DOWN_OUTSIDE";
|
|
34
|
+
}, {}, never, {
|
|
35
|
+
type: "markOpen";
|
|
36
|
+
params: xstate.NonReducibleUnknown;
|
|
37
|
+
} | {
|
|
38
|
+
type: "markClosed";
|
|
39
|
+
params: xstate.NonReducibleUnknown;
|
|
40
|
+
} | {
|
|
41
|
+
type: "toggleOpen";
|
|
42
|
+
params: xstate.NonReducibleUnknown;
|
|
43
|
+
} | {
|
|
44
|
+
type: "setOpen";
|
|
45
|
+
params: xstate.NonReducibleUnknown;
|
|
46
|
+
}, never, never, "open" | "closed", string, PopoverContext, xstate.NonReducibleUnknown, xstate.EventObject, xstate.MetaObject, {
|
|
47
|
+
id: "popover";
|
|
48
|
+
states: {
|
|
49
|
+
readonly closed: {};
|
|
50
|
+
readonly open: {};
|
|
51
|
+
};
|
|
52
|
+
}>;
|
|
53
|
+
|
|
54
|
+
export { type PopoverContext, type PopoverEvent, popoverMachine };
|