aeon-ui-engine 1.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.
- package/.changeset/README.md +23 -0
- package/.changeset/combobox-and-changesets.md +9 -0
- package/.changeset/config.json +30 -0
- package/.changeset/framework-adapters.md +12 -0
- package/.changeset/scene-3d.md +6 -0
- package/.changeset/scene-plane.md +8 -0
- package/.changeset/site-og.md +5 -0
- package/.cursor/rules/aeon-ui.mdc +22 -0
- package/ACCESSIBILITY.md +32 -0
- package/AGENTS.md +226 -0
- package/COMPONENTS.md +36 -0
- package/FRAMEWORKS.md +57 -0
- package/INTEGRATION.md +89 -0
- package/LICENSE +21 -0
- package/PHILOSOPHY.md +71 -0
- package/PUBLISHING.md +85 -0
- package/README.md +154 -0
- package/SCENE.md +113 -0
- package/STATES.md +243 -0
- package/apps/demo/index.html +31 -0
- package/apps/demo/og.config.mjs +15 -0
- package/apps/demo/package.json +41 -0
- package/apps/demo/public/favicon.svg +16 -0
- package/apps/demo/public/og.png +0 -0
- package/apps/demo/public/og.svg +35 -0
- package/apps/demo/scripts/generate-og-png.mjs +60 -0
- package/apps/demo/src/App.tsx +31 -0
- package/apps/demo/src/aeonDiagrams.ts +100 -0
- package/apps/demo/src/app.css +16 -0
- package/apps/demo/src/components/ActionCluster.tsx +20 -0
- package/apps/demo/src/components/AsyncMachineDemo.tsx +97 -0
- package/apps/demo/src/components/ButtonLifecycleDemo.tsx +63 -0
- package/apps/demo/src/components/CodeExample.tsx +7 -0
- package/apps/demo/src/components/ComboboxDemo.tsx +30 -0
- package/apps/demo/src/components/DiagramsSection.tsx +38 -0
- package/apps/demo/src/components/FieldStateDemo.tsx +51 -0
- package/apps/demo/src/components/GridMesh.tsx +8 -0
- package/apps/demo/src/components/HeroInstall.tsx +10 -0
- package/apps/demo/src/components/LandingFaq.tsx +29 -0
- package/apps/demo/src/components/LandingFooter.tsx +22 -0
- package/apps/demo/src/components/LandingHeader.tsx +60 -0
- package/apps/demo/src/components/LandingHero.tsx +55 -0
- package/apps/demo/src/components/LayersSection.tsx +51 -0
- package/apps/demo/src/components/MermaidDiagram.tsx +84 -0
- package/apps/demo/src/components/PhilosophySection.tsx +33 -0
- package/apps/demo/src/components/PlaygroundBlock.tsx +23 -0
- package/apps/demo/src/components/PlaygroundSection.tsx +204 -0
- package/apps/demo/src/components/SceneSection.tsx +157 -0
- package/apps/demo/src/components/ScrollRegionDemo.tsx +74 -0
- package/apps/demo/src/components/ThemeSwitcher.tsx +76 -0
- package/apps/demo/src/demo-layout.css +264 -0
- package/apps/demo/src/landing.css +1094 -0
- package/apps/demo/src/main.tsx +14 -0
- package/apps/demo/src/nav.ts +9 -0
- package/apps/demo/src/site.ts +347 -0
- package/apps/demo/tsconfig.json +17 -0
- package/apps/demo/vite-plugins/og-meta.ts +30 -0
- package/apps/demo/vite.config.ts +69 -0
- package/docs/API_PATTERNS.md +234 -0
- package/docs/ARCHITECTURE.md +125 -0
- package/docs/COMPONENT_CHECKLIST.md +103 -0
- package/docs/FILE_MAP.md +122 -0
- package/docs/GLOSSARY.md +125 -0
- package/docs/INDEX.md +53 -0
- package/docs/LAYOUT_COORDINATES.md +178 -0
- package/docs/MACHINES.md +166 -0
- package/docs/MIGRATION_FROM_ARK.md +295 -0
- package/docs/VITE_CONSUMER.md +114 -0
- package/package.json +25 -0
- package/packages/core/README.md +69 -0
- package/packages/core/package.json +37 -0
- package/packages/core/src/anatomy.ts +144 -0
- package/packages/core/src/attrs.ts +47 -0
- package/packages/core/src/index.ts +8 -0
- package/packages/core/src/layout.ts +176 -0
- package/packages/core/src/machine.test.ts +18 -0
- package/packages/core/src/machine.ts +15 -0
- package/packages/core/src/philosophy.ts +10 -0
- package/packages/core/src/scroll.ts +72 -0
- package/packages/core/src/theme.test.ts +14 -0
- package/packages/core/src/theme.ts +53 -0
- package/packages/core/src/types.ts +25 -0
- package/packages/core/theme-transition.css +58 -0
- package/packages/core/tsconfig.json +8 -0
- package/packages/core/vitest.config.ts +8 -0
- package/packages/geometry/README.md +7 -0
- package/packages/geometry/package.json +35 -0
- package/packages/geometry/src/index.ts +3 -0
- package/packages/geometry/src/patterns.ts +55 -0
- package/packages/geometry/src/scene-attrs.ts +11 -0
- package/packages/geometry/src/svg.ts +60 -0
- package/packages/geometry/tsconfig.json +8 -0
- package/packages/panda/README.md +66 -0
- package/packages/panda/package.json +40 -0
- package/packages/panda/panda.config.ts +229 -0
- package/packages/panda/scripts/emit-theme-runtime.ts +37 -0
- package/packages/panda/src/recipes/accordion.ts +95 -0
- package/packages/panda/src/recipes/async.ts +76 -0
- package/packages/panda/src/recipes/badge.ts +44 -0
- package/packages/panda/src/recipes/button-group.ts +33 -0
- package/packages/panda/src/recipes/button.ts +91 -0
- package/packages/panda/src/recipes/checkbox.ts +41 -0
- package/packages/panda/src/recipes/combobox.ts +121 -0
- package/packages/panda/src/recipes/dialog.ts +96 -0
- package/packages/panda/src/recipes/field-shared.ts +29 -0
- package/packages/panda/src/recipes/field.ts +72 -0
- package/packages/panda/src/recipes/floating.ts +170 -0
- package/packages/panda/src/recipes/index.ts +14 -0
- package/packages/panda/src/recipes/scroll-region.ts +55 -0
- package/packages/panda/src/recipes/select.ts +111 -0
- package/packages/panda/src/recipes/switch.ts +51 -0
- package/packages/panda/src/recipes/tabs.ts +50 -0
- package/packages/panda/src/theme/catalog-types.ts +24 -0
- package/packages/panda/src/theme/catalog.ts +73 -0
- package/packages/panda/src/theme/chrome.css +75 -0
- package/packages/panda/src/theme/global-theme-css.ts +42 -0
- package/packages/panda/src/theme/index.ts +5 -0
- package/packages/panda/src/theme/palette.ts +65 -0
- package/packages/panda/src/theme/scrollbars.css +96 -0
- package/packages/panda/src/theme/semantic-tokens.ts +17 -0
- package/packages/panda/src/theme/themes.config.ts +516 -0
- package/packages/panda/src/theme/tokens.ts +51 -0
- package/packages/panda/styled-system/css/conditions.mjs +36 -0
- package/packages/panda/styled-system/css/css.d.ts +22 -0
- package/packages/panda/styled-system/css/css.mjs +45 -0
- package/packages/panda/styled-system/css/cva.d.ts +6 -0
- package/packages/panda/styled-system/css/cva.mjs +87 -0
- package/packages/panda/styled-system/css/cx.d.ts +5 -0
- package/packages/panda/styled-system/css/cx.mjs +15 -0
- package/packages/panda/styled-system/css/index.d.ts +5 -0
- package/packages/panda/styled-system/css/index.mjs +4 -0
- package/packages/panda/styled-system/css/sva.d.ts +4 -0
- package/packages/panda/styled-system/css/sva.mjs +41 -0
- package/packages/panda/styled-system/helpers.mjs +339 -0
- package/packages/panda/styled-system/jsx/aspect-ratio.d.ts +10 -0
- package/packages/panda/styled-system/jsx/aspect-ratio.mjs +14 -0
- package/packages/panda/styled-system/jsx/bleed.d.ts +10 -0
- package/packages/panda/styled-system/jsx/bleed.mjs +14 -0
- package/packages/panda/styled-system/jsx/box.d.ts +10 -0
- package/packages/panda/styled-system/jsx/box.mjs +14 -0
- package/packages/panda/styled-system/jsx/center.d.ts +10 -0
- package/packages/panda/styled-system/jsx/center.mjs +14 -0
- package/packages/panda/styled-system/jsx/circle.d.ts +10 -0
- package/packages/panda/styled-system/jsx/circle.mjs +14 -0
- package/packages/panda/styled-system/jsx/container.d.ts +10 -0
- package/packages/panda/styled-system/jsx/container.mjs +14 -0
- package/packages/panda/styled-system/jsx/cq.d.ts +10 -0
- package/packages/panda/styled-system/jsx/cq.mjs +14 -0
- package/packages/panda/styled-system/jsx/divider.d.ts +10 -0
- package/packages/panda/styled-system/jsx/divider.mjs +14 -0
- package/packages/panda/styled-system/jsx/factory-helper.mjs +22 -0
- package/packages/panda/styled-system/jsx/factory.d.ts +3 -0
- package/packages/panda/styled-system/jsx/factory.mjs +80 -0
- package/packages/panda/styled-system/jsx/flex.d.ts +10 -0
- package/packages/panda/styled-system/jsx/flex.mjs +14 -0
- package/packages/panda/styled-system/jsx/float.d.ts +10 -0
- package/packages/panda/styled-system/jsx/float.mjs +14 -0
- package/packages/panda/styled-system/jsx/grid-item.d.ts +10 -0
- package/packages/panda/styled-system/jsx/grid-item.mjs +14 -0
- package/packages/panda/styled-system/jsx/grid.d.ts +10 -0
- package/packages/panda/styled-system/jsx/grid.mjs +14 -0
- package/packages/panda/styled-system/jsx/hstack.d.ts +10 -0
- package/packages/panda/styled-system/jsx/hstack.mjs +14 -0
- package/packages/panda/styled-system/jsx/index.d.ts +24 -0
- package/packages/panda/styled-system/jsx/index.mjs +22 -0
- package/packages/panda/styled-system/jsx/is-valid-prop.d.ts +11 -0
- package/packages/panda/styled-system/jsx/is-valid-prop.mjs +17 -0
- package/packages/panda/styled-system/jsx/link-overlay.d.ts +10 -0
- package/packages/panda/styled-system/jsx/link-overlay.mjs +14 -0
- package/packages/panda/styled-system/jsx/spacer.d.ts +10 -0
- package/packages/panda/styled-system/jsx/spacer.mjs +14 -0
- package/packages/panda/styled-system/jsx/square.d.ts +10 -0
- package/packages/panda/styled-system/jsx/square.mjs +14 -0
- package/packages/panda/styled-system/jsx/stack.d.ts +10 -0
- package/packages/panda/styled-system/jsx/stack.mjs +14 -0
- package/packages/panda/styled-system/jsx/visually-hidden.d.ts +10 -0
- package/packages/panda/styled-system/jsx/visually-hidden.mjs +14 -0
- package/packages/panda/styled-system/jsx/vstack.d.ts +10 -0
- package/packages/panda/styled-system/jsx/vstack.mjs +14 -0
- package/packages/panda/styled-system/jsx/wrap.d.ts +10 -0
- package/packages/panda/styled-system/jsx/wrap.mjs +14 -0
- package/packages/panda/styled-system/patterns/aspect-ratio.d.ts +21 -0
- package/packages/panda/styled-system/patterns/aspect-ratio.mjs +38 -0
- package/packages/panda/styled-system/patterns/bleed.d.ts +22 -0
- package/packages/panda/styled-system/patterns/bleed.mjs +24 -0
- package/packages/panda/styled-system/patterns/box.d.ts +21 -0
- package/packages/panda/styled-system/patterns/box.mjs +15 -0
- package/packages/panda/styled-system/patterns/center.d.ts +21 -0
- package/packages/panda/styled-system/patterns/center.mjs +21 -0
- package/packages/panda/styled-system/patterns/circle.d.ts +21 -0
- package/packages/panda/styled-system/patterns/circle.mjs +25 -0
- package/packages/panda/styled-system/patterns/container.d.ts +21 -0
- package/packages/panda/styled-system/patterns/container.mjs +21 -0
- package/packages/panda/styled-system/patterns/cq.d.ts +22 -0
- package/packages/panda/styled-system/patterns/cq.mjs +21 -0
- package/packages/panda/styled-system/patterns/divider.d.ts +23 -0
- package/packages/panda/styled-system/patterns/divider.mjs +25 -0
- package/packages/panda/styled-system/patterns/flex.d.ts +27 -0
- package/packages/panda/styled-system/patterns/flex.mjs +26 -0
- package/packages/panda/styled-system/patterns/float.d.ts +24 -0
- package/packages/panda/styled-system/patterns/float.mjs +52 -0
- package/packages/panda/styled-system/patterns/grid-item.d.ts +26 -0
- package/packages/panda/styled-system/patterns/grid-item.mjs +25 -0
- package/packages/panda/styled-system/patterns/grid.d.ts +25 -0
- package/packages/panda/styled-system/patterns/grid.mjs +27 -0
- package/packages/panda/styled-system/patterns/hstack.d.ts +22 -0
- package/packages/panda/styled-system/patterns/hstack.mjs +24 -0
- package/packages/panda/styled-system/patterns/index.d.ts +21 -0
- package/packages/panda/styled-system/patterns/index.mjs +20 -0
- package/packages/panda/styled-system/patterns/link-overlay.d.ts +21 -0
- package/packages/panda/styled-system/patterns/link-overlay.mjs +24 -0
- package/packages/panda/styled-system/patterns/spacer.d.ts +21 -0
- package/packages/panda/styled-system/patterns/spacer.mjs +21 -0
- package/packages/panda/styled-system/patterns/square.d.ts +21 -0
- package/packages/panda/styled-system/patterns/square.mjs +24 -0
- package/packages/panda/styled-system/patterns/stack.d.ts +24 -0
- package/packages/panda/styled-system/patterns/stack.mjs +24 -0
- package/packages/panda/styled-system/patterns/visually-hidden.d.ts +21 -0
- package/packages/panda/styled-system/patterns/visually-hidden.mjs +18 -0
- package/packages/panda/styled-system/patterns/vstack.d.ts +22 -0
- package/packages/panda/styled-system/patterns/vstack.mjs +24 -0
- package/packages/panda/styled-system/patterns/wrap.d.ts +25 -0
- package/packages/panda/styled-system/patterns/wrap.mjs +25 -0
- package/packages/panda/styled-system/recipes/aeon-accordion.d.ts +32 -0
- package/packages/panda/styled-system/recipes/aeon-accordion.mjs +48 -0
- package/packages/panda/styled-system/recipes/aeon-async.d.ts +32 -0
- package/packages/panda/styled-system/recipes/aeon-async.mjs +56 -0
- package/packages/panda/styled-system/recipes/aeon-badge.d.ts +31 -0
- package/packages/panda/styled-system/recipes/aeon-badge.mjs +32 -0
- package/packages/panda/styled-system/recipes/aeon-button-group.d.ts +39 -0
- package/packages/panda/styled-system/recipes/aeon-button-group.mjs +37 -0
- package/packages/panda/styled-system/recipes/aeon-button.d.ts +39 -0
- package/packages/panda/styled-system/recipes/aeon-button.mjs +39 -0
- package/packages/panda/styled-system/recipes/aeon-checkbox.d.ts +28 -0
- package/packages/panda/styled-system/recipes/aeon-checkbox.mjs +48 -0
- package/packages/panda/styled-system/recipes/aeon-combobox.d.ts +32 -0
- package/packages/panda/styled-system/recipes/aeon-combobox.mjs +52 -0
- package/packages/panda/styled-system/recipes/aeon-dialog.d.ts +28 -0
- package/packages/panda/styled-system/recipes/aeon-dialog.mjs +60 -0
- package/packages/panda/styled-system/recipes/aeon-field.d.ts +32 -0
- package/packages/panda/styled-system/recipes/aeon-field.mjs +52 -0
- package/packages/panda/styled-system/recipes/aeon-menu.d.ts +28 -0
- package/packages/panda/styled-system/recipes/aeon-menu.mjs +52 -0
- package/packages/panda/styled-system/recipes/aeon-popover.d.ts +28 -0
- package/packages/panda/styled-system/recipes/aeon-popover.mjs +52 -0
- package/packages/panda/styled-system/recipes/aeon-scroll.d.ts +43 -0
- package/packages/panda/styled-system/recipes/aeon-scroll.mjs +63 -0
- package/packages/panda/styled-system/recipes/aeon-select.d.ts +32 -0
- package/packages/panda/styled-system/recipes/aeon-select.mjs +56 -0
- package/packages/panda/styled-system/recipes/aeon-switch.d.ts +28 -0
- package/packages/panda/styled-system/recipes/aeon-switch.mjs +48 -0
- package/packages/panda/styled-system/recipes/aeon-tabs.d.ts +28 -0
- package/packages/panda/styled-system/recipes/aeon-tabs.mjs +48 -0
- package/packages/panda/styled-system/recipes/aeon-toast.d.ts +28 -0
- package/packages/panda/styled-system/recipes/aeon-toast.mjs +48 -0
- package/packages/panda/styled-system/recipes/aeon-tooltip.d.ts +28 -0
- package/packages/panda/styled-system/recipes/aeon-tooltip.mjs +48 -0
- package/packages/panda/styled-system/recipes/create-recipe.mjs +82 -0
- package/packages/panda/styled-system/recipes/index.d.ts +18 -0
- package/packages/panda/styled-system/recipes/index.mjs +17 -0
- package/packages/panda/styled-system/styles.css +2157 -0
- package/packages/panda/styled-system/tokens/index.d.ts +9 -0
- package/packages/panda/styled-system/tokens/index.mjs +2156 -0
- package/packages/panda/styled-system/tokens/tokens.d.ts +60 -0
- package/packages/panda/styled-system/types/composition.d.ts +164 -0
- package/packages/panda/styled-system/types/conditions.d.ts +322 -0
- package/packages/panda/styled-system/types/csstype.d.ts +21298 -0
- package/packages/panda/styled-system/types/global.d.ts +20 -0
- package/packages/panda/styled-system/types/index.d.ts +8 -0
- package/packages/panda/styled-system/types/jsx.d.ts +52 -0
- package/packages/panda/styled-system/types/parts.d.ts +8 -0
- package/packages/panda/styled-system/types/pattern.d.ts +78 -0
- package/packages/panda/styled-system/types/prop-type.d.ts +240 -0
- package/packages/panda/styled-system/types/recipe.d.ts +181 -0
- package/packages/panda/styled-system/types/selectors.d.ts +59 -0
- package/packages/panda/styled-system/types/static-css.d.ts +56 -0
- package/packages/panda/styled-system/types/style-props.d.ts +7491 -0
- package/packages/panda/styled-system/types/system-types.d.ts +193 -0
- package/packages/panda/theme-runtime.css +842 -0
- package/packages/panda/tsconfig.json +8 -0
- package/packages/primitives/README.md +54 -0
- package/packages/primitives/package.json +41 -0
- package/packages/primitives/src/__tests__/floating-surface.test.ts +29 -0
- package/packages/primitives/src/index.ts +9 -0
- package/packages/primitives/src/machines/accordion.ts +56 -0
- package/packages/primitives/src/machines/async.ts +108 -0
- package/packages/primitives/src/machines/button.ts +66 -0
- package/packages/primitives/src/machines/dialog.ts +61 -0
- package/packages/primitives/src/machines/field.ts +85 -0
- package/packages/primitives/src/machines/popover.ts +52 -0
- package/packages/primitives/src/machines/tabs.ts +46 -0
- package/packages/primitives/src/machines/toast.ts +48 -0
- package/packages/primitives/src/machines/toggle.ts +61 -0
- package/packages/primitives/tsconfig.json +8 -0
- package/packages/primitives/vitest.config.ts +8 -0
- package/packages/react/README.md +65 -0
- package/packages/react/package.json +52 -0
- package/packages/react/src/accordion/index.tsx +179 -0
- package/packages/react/src/async/actions.tsx +22 -0
- package/packages/react/src/async/context.tsx +54 -0
- package/packages/react/src/async/index.tsx +21 -0
- package/packages/react/src/async/legacy-region.tsx +38 -0
- package/packages/react/src/async/readout.tsx +34 -0
- package/packages/react/src/async/root.tsx +39 -0
- package/packages/react/src/async/track.tsx +59 -0
- package/packages/react/src/avatar/avatar.test.tsx +27 -0
- package/packages/react/src/avatar/index.tsx +122 -0
- package/packages/react/src/button/index.tsx +70 -0
- package/packages/react/src/checkbox/index.tsx +180 -0
- package/packages/react/src/combobox/index.tsx +430 -0
- package/packages/react/src/dialog/dialog.test.tsx +50 -0
- package/packages/react/src/dialog/index.tsx +275 -0
- package/packages/react/src/field/index.tsx +172 -0
- package/packages/react/src/hooks/use-aeon-machine.ts +10 -0
- package/packages/react/src/hooks/use-anchor-position.ts +33 -0
- package/packages/react/src/hooks/use-focus-trap.ts +51 -0
- package/packages/react/src/hooks/use-layout-mode.ts +22 -0
- package/packages/react/src/hooks/use-outside-click.ts +19 -0
- package/packages/react/src/hooks/use-portalled.ts +16 -0
- package/packages/react/src/hooks/use-scroll-lock.ts +13 -0
- package/packages/react/src/index.ts +18 -0
- package/packages/react/src/menu/index.tsx +195 -0
- package/packages/react/src/popover/index.tsx +191 -0
- package/packages/react/src/scroll/index.tsx +98 -0
- package/packages/react/src/scroll/use-scroll-state.ts +30 -0
- package/packages/react/src/select/index.tsx +372 -0
- package/packages/react/src/select/select.test.tsx +60 -0
- package/packages/react/src/switch/index.tsx +215 -0
- package/packages/react/src/tabs/index.tsx +140 -0
- package/packages/react/src/toast/context.tsx +28 -0
- package/packages/react/src/toast/index.tsx +20 -0
- package/packages/react/src/toast/primitives.tsx +129 -0
- package/packages/react/src/toast/provider.tsx +111 -0
- package/packages/react/src/toast/toast-item.tsx +32 -0
- package/packages/react/src/tooltip/index.tsx +191 -0
- package/packages/react/src/utils/merge-props.ts +24 -0
- package/packages/react/tsconfig.json +8 -0
- package/packages/react/vitest.config.ts +9 -0
- package/packages/react/vitest.setup.ts +5 -0
- package/packages/react-scene/README.md +11 -0
- package/packages/react-scene/package.json +47 -0
- package/packages/react-scene/scene-3d.css +37 -0
- package/packages/react-scene/scene-room.css +95 -0
- package/packages/react-scene/src/index.ts +20 -0
- package/packages/react-scene/src/procedural-grid.tsx +35 -0
- package/packages/react-scene/src/scene-layer.tsx +38 -0
- package/packages/react-scene/src/scene-plane.tsx +69 -0
- package/packages/react-scene/src/scene-room.tsx +81 -0
- package/packages/react-scene/src/scene-root.tsx +49 -0
- package/packages/react-scene/src/scene-slot.tsx +41 -0
- package/packages/react-scene/src/scene-stage.tsx +37 -0
- package/packages/react-scene/src/scene-surface.tsx +20 -0
- package/packages/react-scene/src/signal-bars.tsx +57 -0
- package/packages/react-scene/src/use-signal-visualizer.ts +103 -0
- package/packages/react-scene/tsconfig.json +8 -0
- package/packages/scene/README.md +5 -0
- package/packages/scene/package.json +32 -0
- package/packages/scene/src/index.ts +2 -0
- package/packages/scene/src/room.ts +40 -0
- package/packages/scene/src/transform.ts +60 -0
- package/packages/scene/tsconfig.json +8 -0
- package/packages/signal/README.md +9 -0
- package/packages/signal/package.json +32 -0
- package/packages/signal/src/analyser.ts +113 -0
- package/packages/signal/src/bands.ts +33 -0
- package/packages/signal/src/index.ts +3 -0
- package/packages/signal/src/motion.ts +80 -0
- package/packages/signal/tsconfig.json +8 -0
- package/packages/site/README.md +19 -0
- package/packages/site/package.json +32 -0
- package/packages/site/src/index.ts +8 -0
- package/packages/site/src/open-graph.ts +90 -0
- package/packages/site/tsconfig.json +8 -0
- package/packages/solid/README.md +30 -0
- package/packages/solid/package.json +42 -0
- package/packages/solid/src/hooks/use-aeon-machine.ts +10 -0
- package/packages/solid/src/index.ts +2 -0
- package/packages/solid/src/switch/index.tsx +191 -0
- package/packages/solid/src/utils/merge-props.ts +3 -0
- package/packages/solid/tsconfig.json +10 -0
- package/packages/surface/README.md +10 -0
- package/packages/surface/package.json +33 -0
- package/packages/surface/src/index.ts +1 -0
- package/packages/surface/src/materials.ts +14 -0
- package/packages/surface/surface.css +113 -0
- package/packages/surface/tsconfig.json +8 -0
- package/packages/svelte/README.md +45 -0
- package/packages/svelte/package.json +49 -0
- package/packages/svelte/src/Switch.svelte +86 -0
- package/packages/svelte/src/SwitchControl.svelte +45 -0
- package/packages/svelte/src/SwitchHiddenInput.svelte +12 -0
- package/packages/svelte/src/SwitchLabel.svelte +9 -0
- package/packages/svelte/src/SwitchThumb.svelte +16 -0
- package/packages/svelte/src/hooks/use-aeon-machine.ts +23 -0
- package/packages/svelte/src/index.ts +2 -0
- package/packages/svelte/src/switch-context.ts +13 -0
- package/packages/svelte/tsconfig.json +8 -0
- package/packages/ui/README.md +63 -0
- package/packages/ui/package.json +45 -0
- package/packages/ui/src/accordion.tsx +27 -0
- package/packages/ui/src/async.tsx +43 -0
- package/packages/ui/src/badge.tsx +18 -0
- package/packages/ui/src/button.tsx +38 -0
- package/packages/ui/src/checkbox.tsx +24 -0
- package/packages/ui/src/cn.ts +1 -0
- package/packages/ui/src/combobox.tsx +29 -0
- package/packages/ui/src/dialog.tsx +32 -0
- package/packages/ui/src/field.tsx +33 -0
- package/packages/ui/src/index.ts +17 -0
- package/packages/ui/src/menu.tsx +25 -0
- package/packages/ui/src/popover.tsx +22 -0
- package/packages/ui/src/scroll.tsx +51 -0
- package/packages/ui/src/select.tsx +33 -0
- package/packages/ui/src/styles.css +2 -0
- package/packages/ui/src/switch.tsx +22 -0
- package/packages/ui/src/tabs.tsx +22 -0
- package/packages/ui/src/toast.tsx +36 -0
- package/packages/ui/src/tooltip.tsx +19 -0
- package/packages/ui/tsconfig.json +12 -0
- package/packages/vue/README.md +40 -0
- package/packages/vue/package.json +42 -0
- package/packages/vue/src/hooks/use-aeon-machine.ts +10 -0
- package/packages/vue/src/index.ts +2 -0
- package/packages/vue/src/switch/index.ts +208 -0
- package/packages/vue/src/utils/part-props.ts +8 -0
- package/packages/vue/tsconfig.json +8 -0
- package/pnpm-workspace.yaml +3 -0
- package/scripts/ensure-headless-built.mjs +25 -0
- package/tsconfig.base.json +21 -0
- package/vercel.json +12 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export type OpenGraphConfig = {
|
|
2
|
+
title: string
|
|
3
|
+
description: string
|
|
4
|
+
/** Canonical page URL (absolute). */
|
|
5
|
+
url: string
|
|
6
|
+
/** Share image URL (absolute). Recommend 1200×630 PNG or JPEG. */
|
|
7
|
+
image: string
|
|
8
|
+
imageAlt?: string
|
|
9
|
+
siteName?: string
|
|
10
|
+
locale?: string
|
|
11
|
+
type?: 'website' | 'article'
|
|
12
|
+
twitterCard?: 'summary_large_image' | 'summary'
|
|
13
|
+
themeColor?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type MetaTag = {
|
|
17
|
+
tag: 'meta' | 'link'
|
|
18
|
+
name?: string
|
|
19
|
+
property?: string
|
|
20
|
+
content?: string
|
|
21
|
+
rel?: string
|
|
22
|
+
href?: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Flat list of meta/link tags for Open Graph + Twitter cards. */
|
|
26
|
+
export function openGraphTags(config: OpenGraphConfig): MetaTag[] {
|
|
27
|
+
const {
|
|
28
|
+
title,
|
|
29
|
+
description,
|
|
30
|
+
url,
|
|
31
|
+
image,
|
|
32
|
+
imageAlt = title,
|
|
33
|
+
siteName = title,
|
|
34
|
+
locale = 'en_US',
|
|
35
|
+
type = 'website',
|
|
36
|
+
twitterCard = 'summary_large_image',
|
|
37
|
+
themeColor = '#0c0e12',
|
|
38
|
+
} = config
|
|
39
|
+
|
|
40
|
+
return [
|
|
41
|
+
{ tag: 'meta', name: 'description', content: description },
|
|
42
|
+
{ tag: 'meta', name: 'theme-color', content: themeColor },
|
|
43
|
+
{ tag: 'meta', property: 'og:type', content: type },
|
|
44
|
+
{ tag: 'meta', property: 'og:site_name', content: siteName },
|
|
45
|
+
{ tag: 'meta', property: 'og:locale', content: locale },
|
|
46
|
+
{ tag: 'meta', property: 'og:title', content: title },
|
|
47
|
+
{ tag: 'meta', property: 'og:description', content: description },
|
|
48
|
+
{ tag: 'meta', property: 'og:url', content: url },
|
|
49
|
+
{ tag: 'meta', property: 'og:image', content: image },
|
|
50
|
+
{ tag: 'meta', property: 'og:image:secure_url', content: image },
|
|
51
|
+
{ tag: 'meta', property: 'og:image:type', content: 'image/png' },
|
|
52
|
+
{ tag: 'meta', property: 'og:image:alt', content: imageAlt },
|
|
53
|
+
{ tag: 'meta', property: 'og:image:width', content: '1200' },
|
|
54
|
+
{ tag: 'meta', property: 'og:image:height', content: '630' },
|
|
55
|
+
{ tag: 'meta', name: 'twitter:card', content: twitterCard },
|
|
56
|
+
{ tag: 'meta', name: 'twitter:title', content: title },
|
|
57
|
+
{ tag: 'meta', name: 'twitter:description', content: description },
|
|
58
|
+
{ tag: 'meta', name: 'twitter:image', content: image },
|
|
59
|
+
{ tag: 'meta', name: 'twitter:image:alt', content: imageAlt },
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function renderMetaTag(tag: MetaTag): string {
|
|
64
|
+
if (tag.tag === 'link') {
|
|
65
|
+
return `<link rel="${tag.rel}" href="${escapeAttr(tag.href ?? '')}" />`
|
|
66
|
+
}
|
|
67
|
+
if (tag.property) {
|
|
68
|
+
return `<meta property="${tag.property}" content="${escapeAttr(tag.content ?? '')}" />`
|
|
69
|
+
}
|
|
70
|
+
return `<meta name="${tag.name}" content="${escapeAttr(tag.content ?? '')}" />`
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** HTML fragment to inject before `</head>`. */
|
|
74
|
+
export function openGraphHeadHtml(config: OpenGraphConfig): string {
|
|
75
|
+
return openGraphTags(config).map(renderMetaTag).join('\n ')
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function escapeAttr(value: string): string {
|
|
79
|
+
return value
|
|
80
|
+
.replace(/&/g, '&')
|
|
81
|
+
.replace(/"/g, '"')
|
|
82
|
+
.replace(/</g, '<')
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Resolve a public asset path against a site origin. */
|
|
86
|
+
export function absoluteUrl(origin: string, path: string): string {
|
|
87
|
+
const base = origin.replace(/\/$/, '')
|
|
88
|
+
const p = path.startsWith('/') ? path : `/${path}`
|
|
89
|
+
return `${base}${p}`
|
|
90
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @aeon-ui/solid
|
|
2
|
+
|
|
3
|
+
Headless **SolidJS** bindings for [Aeon UI](https://github.com/GenericCPU/aeon-ui).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @aeon-ui/solid @aeon-ui/core @aeon-ui/primitives xstate solid-js
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { Switch } from '@aeon-ui/solid'
|
|
15
|
+
import { createSignal } from 'solid-js'
|
|
16
|
+
|
|
17
|
+
function Demo() {
|
|
18
|
+
const [on, setOn] = createSignal(true)
|
|
19
|
+
return (
|
|
20
|
+
<Switch.Root checked={on()} onCheckedChange={setOn}>
|
|
21
|
+
<Switch.Control>
|
|
22
|
+
<Switch.Thumb />
|
|
23
|
+
</Switch.Control>
|
|
24
|
+
<Switch.Label>Notifications</Switch.Label>
|
|
25
|
+
</Switch.Root>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
See [FRAMEWORKS.md](../../FRAMEWORKS.md).
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aeon-ui/solid",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Headless SolidJS components backed by Aeon XState machines",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/GenericCPU/aeon-ui.git",
|
|
9
|
+
"directory": "packages/solid"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": { "access": "public" },
|
|
12
|
+
"files": ["dist", "README.md"],
|
|
13
|
+
"keywords": ["aeon-ui", "solid", "solidjs", "headless", "xstate", "statechart"],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsup src/index.ts --format esm --dts --clean --external solid-js --external xstate --external @xstate/solid --external @aeon-ui/core --external @aeon-ui/primitives",
|
|
26
|
+
"typecheck": "tsc --noEmit"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@aeon-ui/core": "workspace:*",
|
|
30
|
+
"@aeon-ui/primitives": "workspace:*",
|
|
31
|
+
"@xstate/solid": "^2.0.0",
|
|
32
|
+
"xstate": "^5.19.2"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"solid-js": "^1.8.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"solid-js": "^1.9.5",
|
|
39
|
+
"tsup": "^8.4.0",
|
|
40
|
+
"typescript": "^5.8.3"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useMachine } from '@xstate/solid'
|
|
2
|
+
import type { AnyStateMachine } from 'xstate'
|
|
3
|
+
|
|
4
|
+
/** Bridge executable statecharts to Solid — UI = f(snapshot). */
|
|
5
|
+
export function useAeonMachine<M extends AnyStateMachine>(
|
|
6
|
+
machine: M,
|
|
7
|
+
options?: Parameters<typeof useMachine<M>>[1],
|
|
8
|
+
) {
|
|
9
|
+
return useMachine(machine, options)
|
|
10
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { partAttrs, switchAnatomy } from '@aeon-ui/core'
|
|
2
|
+
import { toggleMachine } from '@aeon-ui/primitives'
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
createEffect,
|
|
6
|
+
createMemo,
|
|
7
|
+
useContext,
|
|
8
|
+
type JSX,
|
|
9
|
+
type ParentProps,
|
|
10
|
+
} from 'solid-js'
|
|
11
|
+
import { useAeonMachine } from '../hooks/use-aeon-machine.js'
|
|
12
|
+
import { mergeProps } from '../utils/merge-props.js'
|
|
13
|
+
|
|
14
|
+
interface SwitchContextValue {
|
|
15
|
+
checked: () => boolean
|
|
16
|
+
disabled: () => boolean
|
|
17
|
+
controlled: () => boolean
|
|
18
|
+
onCheckedChange?: (checked: boolean) => void
|
|
19
|
+
send: ReturnType<typeof useAeonMachine<typeof toggleMachine>>[1]
|
|
20
|
+
pressState: () => string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const SwitchCtx = createContext<SwitchContextValue>()
|
|
24
|
+
|
|
25
|
+
function useSwitchCtx() {
|
|
26
|
+
const ctx = useContext(SwitchCtx)
|
|
27
|
+
if (!ctx) throw new Error('Switch parts must be used within Switch.Root')
|
|
28
|
+
return ctx
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type SwitchRootProps = ParentProps<{
|
|
32
|
+
checked?: boolean
|
|
33
|
+
defaultChecked?: boolean
|
|
34
|
+
disabled?: boolean
|
|
35
|
+
onCheckedChange?: (checked: boolean) => void
|
|
36
|
+
class?: string
|
|
37
|
+
}>
|
|
38
|
+
|
|
39
|
+
function Root(props: SwitchRootProps) {
|
|
40
|
+
const [snapshot, send] = useAeonMachine(toggleMachine, {
|
|
41
|
+
input: { checked: props.defaultChecked ?? false, disabled: props.disabled ?? false },
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const controlled = () => props.checked !== undefined
|
|
45
|
+
const resolvedChecked = createMemo(() => props.checked ?? snapshot.context.checked)
|
|
46
|
+
const pressState = createMemo(() =>
|
|
47
|
+
snapshot.matches({ interaction: 'pressed' }) ? 'pressed' : 'idle',
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
createEffect(() => {
|
|
51
|
+
if (props.checked !== undefined) send({ type: 'SET_CHECKED', checked: props.checked })
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
createEffect(() => {
|
|
55
|
+
if (!controlled()) props.onCheckedChange?.(resolvedChecked())
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const toggle = () => {
|
|
59
|
+
if (props.disabled) return
|
|
60
|
+
const next = !resolvedChecked()
|
|
61
|
+
if (controlled()) props.onCheckedChange?.(next)
|
|
62
|
+
else send({ type: 'TOGGLE' })
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const value: SwitchContextValue = {
|
|
66
|
+
checked: resolvedChecked,
|
|
67
|
+
disabled: () => props.disabled ?? false,
|
|
68
|
+
controlled,
|
|
69
|
+
onCheckedChange: props.onCheckedChange,
|
|
70
|
+
send,
|
|
71
|
+
pressState,
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<SwitchCtx.Provider value={value}>
|
|
76
|
+
<label
|
|
77
|
+
class={props.class}
|
|
78
|
+
{...mergeProps(
|
|
79
|
+
partAttrs(switchAnatomy.scope, switchAnatomy.root, {
|
|
80
|
+
state: `${resolvedChecked() ? 'checked' : 'unchecked'} ${pressState()}`,
|
|
81
|
+
disabled: props.disabled,
|
|
82
|
+
}) as Record<string, unknown>,
|
|
83
|
+
{
|
|
84
|
+
onClick: (e: MouseEvent) => {
|
|
85
|
+
const target = e.target as HTMLElement
|
|
86
|
+
if (target.closest(`[data-aeon-part="${switchAnatomy.control}"]`)) return
|
|
87
|
+
toggle()
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
)}
|
|
91
|
+
>
|
|
92
|
+
{props.children}
|
|
93
|
+
</label>
|
|
94
|
+
</SwitchCtx.Provider>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
type ControlProps = JSX.LabelHTMLAttributes<HTMLSpanElement>
|
|
99
|
+
|
|
100
|
+
function Control(props: ControlProps) {
|
|
101
|
+
const ctx = useSwitchCtx()
|
|
102
|
+
const toggle = () => {
|
|
103
|
+
if (ctx.disabled()) return
|
|
104
|
+
const next = !ctx.checked()
|
|
105
|
+
if (ctx.controlled()) ctx.onCheckedChange?.(next)
|
|
106
|
+
else ctx.send({ type: 'TOGGLE' })
|
|
107
|
+
}
|
|
108
|
+
const { class: className, ...rest } = props
|
|
109
|
+
return (
|
|
110
|
+
<span
|
|
111
|
+
role="switch"
|
|
112
|
+
aria-checked={ctx.checked()}
|
|
113
|
+
tabIndex={ctx.disabled() ? -1 : 0}
|
|
114
|
+
class={className}
|
|
115
|
+
{...mergeProps(
|
|
116
|
+
partAttrs(switchAnatomy.scope, switchAnatomy.control, {
|
|
117
|
+
state: `${ctx.checked() ? 'checked' : 'unchecked'} ${ctx.pressState()}`,
|
|
118
|
+
disabled: ctx.disabled(),
|
|
119
|
+
}) as Record<string, unknown>,
|
|
120
|
+
rest as Record<string, unknown>,
|
|
121
|
+
{
|
|
122
|
+
onClick: (e: MouseEvent) => {
|
|
123
|
+
toggle()
|
|
124
|
+
e.stopPropagation()
|
|
125
|
+
},
|
|
126
|
+
onPointerDown: () => {
|
|
127
|
+
if (!ctx.disabled()) ctx.send({ type: 'POINTER_DOWN' })
|
|
128
|
+
},
|
|
129
|
+
onPointerUp: () => ctx.send({ type: 'POINTER_UP' }),
|
|
130
|
+
onPointerLeave: () => ctx.send({ type: 'POINTER_LEAVE' }),
|
|
131
|
+
onKeyDown: (e: KeyboardEvent) => {
|
|
132
|
+
if (e.key === ' ' || e.key === 'Enter') {
|
|
133
|
+
e.preventDefault()
|
|
134
|
+
toggle()
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
)}
|
|
139
|
+
/>
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function Thumb(props: JSX.HTMLAttributes<HTMLSpanElement>) {
|
|
144
|
+
const ctx = useSwitchCtx()
|
|
145
|
+
const { class: className, ...rest } = props
|
|
146
|
+
return (
|
|
147
|
+
<span
|
|
148
|
+
class={className}
|
|
149
|
+
{...mergeProps(
|
|
150
|
+
partAttrs(switchAnatomy.scope, switchAnatomy.thumb, {
|
|
151
|
+
state: `${ctx.checked() ? 'checked' : 'unchecked'} ${ctx.pressState()}`,
|
|
152
|
+
}) as Record<string, unknown>,
|
|
153
|
+
rest as Record<string, unknown>,
|
|
154
|
+
)}
|
|
155
|
+
/>
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function Label(props: JSX.HTMLAttributes<HTMLSpanElement>) {
|
|
160
|
+
const { class: className, ...rest } = props
|
|
161
|
+
return (
|
|
162
|
+
<span
|
|
163
|
+
class={className}
|
|
164
|
+
{...mergeProps(
|
|
165
|
+
partAttrs(switchAnatomy.scope, switchAnatomy.label) as Record<string, unknown>,
|
|
166
|
+
rest as Record<string, unknown>,
|
|
167
|
+
)}
|
|
168
|
+
/>
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function HiddenInput(props: JSX.InputHTMLAttributes<HTMLInputElement>) {
|
|
173
|
+
const ctx = useSwitchCtx()
|
|
174
|
+
const { class: className, ...rest } = props
|
|
175
|
+
return (
|
|
176
|
+
<input
|
|
177
|
+
type="checkbox"
|
|
178
|
+
checked={ctx.checked()}
|
|
179
|
+
readOnly
|
|
180
|
+
tabIndex={-1}
|
|
181
|
+
aria-hidden
|
|
182
|
+
class={className}
|
|
183
|
+
{...mergeProps(
|
|
184
|
+
partAttrs(switchAnatomy.scope, switchAnatomy.hiddenInput) as Record<string, unknown>,
|
|
185
|
+
rest as Record<string, unknown>,
|
|
186
|
+
)}
|
|
187
|
+
/>
|
|
188
|
+
)
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export const Switch = { Root, Control, Thumb, Label, HiddenInput }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# @aeon-ui/surface
|
|
2
|
+
|
|
3
|
+
Procedural CSS material presets — no image assets required.
|
|
4
|
+
|
|
5
|
+
Materials: `stone`, `gravel`, `brick`, `pavement`, `kraft` (cardboard).
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import '@aeon-ui/surface/surface.css'
|
|
9
|
+
import { surfaceClass, surfaceMaterials } from '@aeon-ui/surface'
|
|
10
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aeon-ui/surface",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CSS texture presets (stone, gravel, brick) for Aeon Scene backgrounds",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/GenericCPU/aeon-ui.git",
|
|
9
|
+
"directory": "packages/surface"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": { "access": "public" },
|
|
12
|
+
"files": ["dist", "surface.css", "README.md"],
|
|
13
|
+
"keywords": ["aeon-ui", "texture", "background", "css"],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"sideEffects": ["./surface.css"],
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./surface.css": "./surface.css"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsup src/index.ts --format esm --dts --clean",
|
|
27
|
+
"typecheck": "tsc --noEmit"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"tsup": "^8.4.0",
|
|
31
|
+
"typescript": "^5.8.3"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './materials.js'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const surfaceMaterials = ['stone', 'gravel', 'brick', 'pavement', 'kraft'] as const
|
|
2
|
+
export type SurfaceMaterial = (typeof surfaceMaterials)[number]
|
|
3
|
+
|
|
4
|
+
const PREFIX = 'aeon-surface'
|
|
5
|
+
|
|
6
|
+
/** BEM class for a material layer (`aeon-surface aeon-surface--stone`). */
|
|
7
|
+
export function surfaceClass(material: SurfaceMaterial): string {
|
|
8
|
+
return `${PREFIX} ${PREFIX}--${material}`
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Optional inline vars to tune a surface on a custom element. */
|
|
12
|
+
export function surfaceStyleVars(material: SurfaceMaterial): Record<string, string> {
|
|
13
|
+
return { '--aeon-surface-material': material }
|
|
14
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/* @aeon-ui/surface — procedural materials (import once per app) */
|
|
2
|
+
|
|
3
|
+
.aeon-surface {
|
|
4
|
+
position: relative;
|
|
5
|
+
background-color: var(--aeon-surface-base, #2a2a2e);
|
|
6
|
+
background-blend-mode: overlay, soft-light, normal;
|
|
7
|
+
background-size:
|
|
8
|
+
4px 4px,
|
|
9
|
+
12px 12px,
|
|
10
|
+
cover;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.aeon-surface--stone {
|
|
14
|
+
--aeon-surface-base: #5c5a56;
|
|
15
|
+
background-image:
|
|
16
|
+
radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.12) 0%, transparent 45%),
|
|
17
|
+
radial-gradient(circle at 70% 60%, rgba(0, 0, 0, 0.15) 0%, transparent 40%),
|
|
18
|
+
linear-gradient(145deg, #6e6c68 0%, #4a4844 50%, #3d3b38 100%);
|
|
19
|
+
background-size: cover;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.aeon-surface--gravel {
|
|
23
|
+
--aeon-surface-base: #4a4845;
|
|
24
|
+
background-image:
|
|
25
|
+
radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
|
|
26
|
+
radial-gradient(circle, rgba(0, 0, 0, 0.12) 1px, transparent 1px),
|
|
27
|
+
linear-gradient(180deg, #5a5752 0%, #3e3c38 100%);
|
|
28
|
+
background-size:
|
|
29
|
+
3px 3px,
|
|
30
|
+
5px 5px,
|
|
31
|
+
cover;
|
|
32
|
+
background-position:
|
|
33
|
+
0 0,
|
|
34
|
+
2px 2px,
|
|
35
|
+
0 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.aeon-surface--brick {
|
|
39
|
+
--aeon-surface-base: #6b3a32;
|
|
40
|
+
background-image:
|
|
41
|
+
linear-gradient(180deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
|
|
42
|
+
linear-gradient(335deg, rgba(0, 0, 0, 0.3) 11px, transparent 11px),
|
|
43
|
+
linear-gradient(155deg, rgba(0, 0, 0, 0.24) 11px, transparent 11px),
|
|
44
|
+
linear-gradient(90deg, #9a5c4a 0%, #7a4038 25%, #8b4a42 50%, #6b3428 75%, #7a4038 100%);
|
|
45
|
+
background-size:
|
|
46
|
+
100% 7px,
|
|
47
|
+
44px 26px,
|
|
48
|
+
44px 26px,
|
|
49
|
+
cover;
|
|
50
|
+
background-position:
|
|
51
|
+
0 0,
|
|
52
|
+
0 0,
|
|
53
|
+
22px 13px,
|
|
54
|
+
0 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Asphalt alley ground — aggregate, seams, wear (no image assets). */
|
|
58
|
+
.aeon-surface--pavement {
|
|
59
|
+
--aeon-surface-base: #2a2a28;
|
|
60
|
+
background-image:
|
|
61
|
+
radial-gradient(ellipse 48% 32% at 28% 68%, rgba(255, 255, 255, 0.05) 0%, transparent 72%),
|
|
62
|
+
radial-gradient(ellipse 42% 28% at 74% 38%, rgba(0, 0, 0, 0.2) 0%, transparent 68%),
|
|
63
|
+
radial-gradient(circle, rgba(255, 255, 255, 0.07) 0.5px, transparent 0.5px),
|
|
64
|
+
radial-gradient(circle, rgba(0, 0, 0, 0.13) 0.5px, transparent 0.5px),
|
|
65
|
+
linear-gradient(180deg, #3a3a36 0%, #2e2e2c 42%, #242422 100%);
|
|
66
|
+
background-size:
|
|
67
|
+
100% 100%,
|
|
68
|
+
100% 100%,
|
|
69
|
+
4px 4px,
|
|
70
|
+
5px 5px,
|
|
71
|
+
cover;
|
|
72
|
+
background-position:
|
|
73
|
+
0 0,
|
|
74
|
+
0 0,
|
|
75
|
+
0 0,
|
|
76
|
+
2px 1px,
|
|
77
|
+
0 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Kraft cardboard — fiber grain, crease lines (board / marker surfaces). */
|
|
81
|
+
.aeon-surface--kraft {
|
|
82
|
+
--aeon-surface-base: #b8956a;
|
|
83
|
+
background-image:
|
|
84
|
+
repeating-linear-gradient(
|
|
85
|
+
0deg,
|
|
86
|
+
transparent 0,
|
|
87
|
+
transparent 2px,
|
|
88
|
+
rgba(92, 72, 56, 0.16) 2px,
|
|
89
|
+
rgba(92, 72, 56, 0.16) 3px
|
|
90
|
+
),
|
|
91
|
+
repeating-linear-gradient(
|
|
92
|
+
90deg,
|
|
93
|
+
transparent 0,
|
|
94
|
+
transparent 7px,
|
|
95
|
+
rgba(46, 36, 24, 0.06) 7px,
|
|
96
|
+
rgba(46, 36, 24, 0.06) 8px
|
|
97
|
+
),
|
|
98
|
+
radial-gradient(ellipse 90% 40% at 50% 0%, rgba(160, 120, 70, 0.1) 0%, transparent 55%),
|
|
99
|
+
radial-gradient(circle, rgba(100, 72, 40, 0.07) 0.8px, transparent 0.8px),
|
|
100
|
+
linear-gradient(168deg, #c4a070 0%, #b8956a 28%, #a08050 62%, #8a7048 100%);
|
|
101
|
+
background-size:
|
|
102
|
+
100% 3px,
|
|
103
|
+
100% 8px,
|
|
104
|
+
100% 100%,
|
|
105
|
+
5px 5px,
|
|
106
|
+
cover;
|
|
107
|
+
background-position:
|
|
108
|
+
0 0,
|
|
109
|
+
0 1px,
|
|
110
|
+
0 0,
|
|
111
|
+
1px 2px,
|
|
112
|
+
0 0;
|
|
113
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# @aeon-ui/svelte
|
|
2
|
+
|
|
3
|
+
Headless **Svelte** bindings for [Aeon UI](https://github.com/GenericCPU/aeon-ui). Machines live in `@aeon-ui/primitives`; anatomy in `@aeon-ui/core`.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @aeon-ui/svelte @aeon-ui/core @aeon-ui/primitives xstate
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer: `svelte` ^4 or ^5 (Svelte 5 runes used in shipped components).
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```svelte
|
|
16
|
+
<script lang="ts">
|
|
17
|
+
import Switch from '@aeon-ui/svelte/Switch.svelte'
|
|
18
|
+
import SwitchControl from '@aeon-ui/svelte/SwitchControl.svelte'
|
|
19
|
+
import SwitchThumb from '@aeon-ui/svelte/SwitchThumb.svelte'
|
|
20
|
+
import SwitchLabel from '@aeon-ui/svelte/SwitchLabel.svelte'
|
|
21
|
+
|
|
22
|
+
let on = $state(true)
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<Switch checked={on} onCheckedChange={(v) => (on = v)}>
|
|
26
|
+
<SwitchControl><SwitchThumb /></SwitchControl>
|
|
27
|
+
<SwitchLabel>Notifications</SwitchLabel>
|
|
28
|
+
</Switch>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## `useAeonMachine`
|
|
32
|
+
|
|
33
|
+
For custom components, subscribe with `$effect`:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { useAeonMachine } from '@aeon-ui/svelte'
|
|
37
|
+
|
|
38
|
+
const { send, subscribe, getSnapshot } = useAeonMachine(myMachine)
|
|
39
|
+
let snap = $state(getSnapshot())
|
|
40
|
+
$effect(() => subscribe((s) => (snap = s)))
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## v0.1 scope
|
|
44
|
+
|
|
45
|
+
Reference **Switch** port + hook. More components follow [FRAMEWORKS.md](../../FRAMEWORKS.md).
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aeon-ui/svelte",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Headless Svelte bindings for Aeon XState machines",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/GenericCPU/aeon-ui.git",
|
|
9
|
+
"directory": "packages/svelte"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": { "access": "public" },
|
|
12
|
+
"files": ["dist", "src/**/*.svelte", "README.md"],
|
|
13
|
+
"keywords": ["aeon-ui", "svelte", "headless", "xstate", "statechart"],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"svelte": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./Switch.svelte": "./src/Switch.svelte",
|
|
25
|
+
"./SwitchControl.svelte": "./src/SwitchControl.svelte",
|
|
26
|
+
"./SwitchThumb.svelte": "./src/SwitchThumb.svelte",
|
|
27
|
+
"./SwitchLabel.svelte": "./src/SwitchLabel.svelte",
|
|
28
|
+
"./SwitchHiddenInput.svelte": "./src/SwitchHiddenInput.svelte"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsup src/index.ts --format esm --dts --clean --external svelte --external xstate --external @aeon-ui/core --external @aeon-ui/primitives",
|
|
32
|
+
"typecheck": "tsc --noEmit"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@aeon-ui/core": "workspace:*",
|
|
36
|
+
"@aeon-ui/primitives": "workspace:*",
|
|
37
|
+
"xstate": "^5.19.2"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"svelte": "^4.0.0 || ^5.0.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
|
44
|
+
"svelte": "^5.28.2",
|
|
45
|
+
"svelte-check": "^4.1.5",
|
|
46
|
+
"tsup": "^8.4.0",
|
|
47
|
+
"typescript": "^5.8.3"
|
|
48
|
+
}
|
|
49
|
+
}
|