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,86 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { setContext } from 'svelte'
|
|
3
|
+
import { partAttrs, switchAnatomy } from '@aeon-ui/core'
|
|
4
|
+
import { toggleMachine } from '@aeon-ui/primitives'
|
|
5
|
+
import { useAeonMachine } from './hooks/use-aeon-machine.js'
|
|
6
|
+
import { SWITCH_CTX, type SwitchContext } from './switch-context.js'
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
checked = undefined,
|
|
10
|
+
defaultChecked = false,
|
|
11
|
+
disabled = false,
|
|
12
|
+
onCheckedChange = undefined,
|
|
13
|
+
class: className = '',
|
|
14
|
+
children,
|
|
15
|
+
}: {
|
|
16
|
+
checked?: boolean
|
|
17
|
+
defaultChecked?: boolean
|
|
18
|
+
disabled?: boolean
|
|
19
|
+
onCheckedChange?: (checked: boolean) => void
|
|
20
|
+
class?: string
|
|
21
|
+
children?: import('svelte').Snippet
|
|
22
|
+
} = $props()
|
|
23
|
+
|
|
24
|
+
const { send, subscribe, getSnapshot } = useAeonMachine(toggleMachine, {
|
|
25
|
+
input: { checked: defaultChecked, disabled },
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
let snap = $state(getSnapshot())
|
|
29
|
+
$effect(() => subscribe((s) => (snap = s)))
|
|
30
|
+
|
|
31
|
+
const controlled = $derived(checked !== undefined)
|
|
32
|
+
const resolvedChecked = $derived(checked ?? snap.context.checked)
|
|
33
|
+
const pressState = $derived(snap.matches({ interaction: 'pressed' }) ? 'pressed' : 'idle')
|
|
34
|
+
|
|
35
|
+
$effect(() => {
|
|
36
|
+
if (checked !== undefined) send({ type: 'SET_CHECKED', checked })
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
$effect(() => {
|
|
40
|
+
if (!controlled) onCheckedChange?.(resolvedChecked)
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
function toggle() {
|
|
44
|
+
if (disabled) return
|
|
45
|
+
const next = !resolvedChecked
|
|
46
|
+
if (controlled) onCheckedChange?.(next)
|
|
47
|
+
else send({ type: 'TOGGLE' })
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
setContext<SwitchContext>(SWITCH_CTX, {
|
|
51
|
+
get checked() {
|
|
52
|
+
return resolvedChecked
|
|
53
|
+
},
|
|
54
|
+
get disabled() {
|
|
55
|
+
return disabled
|
|
56
|
+
},
|
|
57
|
+
get controlled() {
|
|
58
|
+
return controlled
|
|
59
|
+
},
|
|
60
|
+
onCheckedChange,
|
|
61
|
+
send,
|
|
62
|
+
get pressState() {
|
|
63
|
+
return pressState
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
const rootAttrs = $derived(
|
|
68
|
+
partAttrs(switchAnatomy.scope, switchAnatomy.root, {
|
|
69
|
+
state: `${resolvedChecked ? 'checked' : 'unchecked'} ${pressState}`,
|
|
70
|
+
disabled,
|
|
71
|
+
}),
|
|
72
|
+
)
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
|
76
|
+
<label
|
|
77
|
+
{...rootAttrs}
|
|
78
|
+
class={className}
|
|
79
|
+
onclick={(e) => {
|
|
80
|
+
const target = e.target as HTMLElement
|
|
81
|
+
if (target.closest(`[data-aeon-part="${switchAnatomy.control}"]`)) return
|
|
82
|
+
toggle()
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
{@render children?.()}
|
|
86
|
+
</label>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getContext } from 'svelte'
|
|
3
|
+
import { partAttrs, switchAnatomy } from '@aeon-ui/core'
|
|
4
|
+
import { SWITCH_CTX, type SwitchContext } from './switch-context.js'
|
|
5
|
+
|
|
6
|
+
let { ...rest }: Record<string, unknown> = $props()
|
|
7
|
+
const ctx = getContext<SwitchContext>(SWITCH_CTX)
|
|
8
|
+
|
|
9
|
+
function toggle() {
|
|
10
|
+
if (ctx.disabled) return
|
|
11
|
+
const next = !ctx.checked
|
|
12
|
+
if (ctx.controlled) ctx.onCheckedChange?.(next)
|
|
13
|
+
else ctx.send({ type: 'TOGGLE' })
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const attrs = $derived(
|
|
17
|
+
partAttrs(switchAnatomy.scope, switchAnatomy.control, {
|
|
18
|
+
state: `${ctx.checked ? 'checked' : 'unchecked'} ${ctx.pressState}`,
|
|
19
|
+
disabled: ctx.disabled,
|
|
20
|
+
}),
|
|
21
|
+
)
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<span
|
|
25
|
+
{...attrs}
|
|
26
|
+
{...rest}
|
|
27
|
+
role="switch"
|
|
28
|
+
aria-checked={ctx.checked}
|
|
29
|
+
tabindex={ctx.disabled ? -1 : 0}
|
|
30
|
+
onclick={(e) => {
|
|
31
|
+
toggle()
|
|
32
|
+
e.stopPropagation()
|
|
33
|
+
}}
|
|
34
|
+
onpointerdown={() => {
|
|
35
|
+
if (!ctx.disabled) ctx.send({ type: 'POINTER_DOWN' })
|
|
36
|
+
}}
|
|
37
|
+
onpointerup={() => ctx.send({ type: 'POINTER_UP' })}
|
|
38
|
+
onpointerleave={() => ctx.send({ type: 'POINTER_LEAVE' })}
|
|
39
|
+
onkeydown={(e) => {
|
|
40
|
+
if (e.key === ' ' || e.key === 'Enter') {
|
|
41
|
+
e.preventDefault()
|
|
42
|
+
toggle()
|
|
43
|
+
}
|
|
44
|
+
}}
|
|
45
|
+
></span>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getContext } from 'svelte'
|
|
3
|
+
import { partAttrs, switchAnatomy } from '@aeon-ui/core'
|
|
4
|
+
import { SWITCH_CTX, type SwitchContext } from './switch-context.js'
|
|
5
|
+
|
|
6
|
+
let { ...rest }: Record<string, unknown> = $props()
|
|
7
|
+
const ctx = getContext<SwitchContext>(SWITCH_CTX)
|
|
8
|
+
|
|
9
|
+
const attrs = partAttrs(switchAnatomy.scope, switchAnatomy.hiddenInput)
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<input type="checkbox" checked={ctx.checked} readonly tabindex={-1} aria-hidden {...attrs} {...rest} />
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { partAttrs, switchAnatomy } from '@aeon-ui/core'
|
|
3
|
+
|
|
4
|
+
let { children, ...rest }: { children?: import('svelte').Snippet } & Record<string, unknown> = $props()
|
|
5
|
+
|
|
6
|
+
const attrs = partAttrs(switchAnatomy.scope, switchAnatomy.label)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<span {...attrs} {...rest}>{@render children?.()}</span>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getContext } from 'svelte'
|
|
3
|
+
import { partAttrs, switchAnatomy } from '@aeon-ui/core'
|
|
4
|
+
import { SWITCH_CTX, type SwitchContext } from './switch-context.js'
|
|
5
|
+
|
|
6
|
+
let { ...rest }: Record<string, unknown> = $props()
|
|
7
|
+
const ctx = getContext<SwitchContext>(SWITCH_CTX)
|
|
8
|
+
|
|
9
|
+
const attrs = $derived(
|
|
10
|
+
partAttrs(switchAnatomy.scope, switchAnatomy.thumb, {
|
|
11
|
+
state: `${ctx.checked ? 'checked' : 'unchecked'} ${ctx.pressState}`,
|
|
12
|
+
}),
|
|
13
|
+
)
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<span {...attrs} {...rest}></span>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createActor, type AnyStateMachine, type Actor, type Subscription } from 'xstate'
|
|
2
|
+
|
|
3
|
+
export interface AeonMachineHandle<M extends AnyStateMachine> {
|
|
4
|
+
actor: Actor<M>
|
|
5
|
+
send: Actor<M>['send']
|
|
6
|
+
getSnapshot: () => ReturnType<Actor<M>['getSnapshot']>
|
|
7
|
+
subscribe: (listener: (snapshot: ReturnType<Actor<M>['getSnapshot']>) => void) => Subscription
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** XState actor wired for Svelte 5 runes ($effect + $state). */
|
|
11
|
+
export function useAeonMachine<M extends AnyStateMachine>(
|
|
12
|
+
machine: M,
|
|
13
|
+
options?: Parameters<typeof createActor<M>>[1],
|
|
14
|
+
): AeonMachineHandle<M> {
|
|
15
|
+
const actor = createActor(machine, options)
|
|
16
|
+
actor.start()
|
|
17
|
+
return {
|
|
18
|
+
actor,
|
|
19
|
+
send: actor.send.bind(actor),
|
|
20
|
+
getSnapshot: () => actor.getSnapshot(),
|
|
21
|
+
subscribe: (listener) => actor.subscribe(listener),
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { toggleMachine } from '@aeon-ui/primitives'
|
|
2
|
+
import type { useAeonMachine } from './hooks/use-aeon-machine.js'
|
|
3
|
+
|
|
4
|
+
export type SwitchContext = {
|
|
5
|
+
checked: boolean
|
|
6
|
+
disabled: boolean
|
|
7
|
+
controlled: boolean
|
|
8
|
+
onCheckedChange?: (checked: boolean) => void
|
|
9
|
+
send: ReturnType<typeof useAeonMachine<typeof toggleMachine>>['send']
|
|
10
|
+
pressState: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const SWITCH_CTX = Symbol('aeon-switch')
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# @aeon-ui/ui
|
|
2
|
+
|
|
3
|
+
**Styled compound components** — `@aeon-ui/react` + Panda `aeon*` recipes.
|
|
4
|
+
|
|
5
|
+
Fastest path for apps that want the Aeon look and state-driven styling.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @aeon-ui/ui @aeon-ui/react
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Import CSS once (see [INTEGRATION.md](../../INTEGRATION.md)):
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import '@aeon-ui/panda/styles.css'
|
|
17
|
+
import '@aeon-ui/panda/theme-runtime.css'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { Dialog, Button, Async, Field } from '@aeon-ui/ui'
|
|
24
|
+
|
|
25
|
+
<Async.Root>
|
|
26
|
+
<Async.Track />
|
|
27
|
+
<Async.Readout>Ready</Async.Readout>
|
|
28
|
+
<Async.Actions>
|
|
29
|
+
<Button.Root size="sm">Fetch</Button.Root>
|
|
30
|
+
</Async.Actions>
|
|
31
|
+
</Async.Root>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Exports
|
|
35
|
+
|
|
36
|
+
`Button`, `Switch`, `Checkbox`, `Dialog`, `Tabs`, `Accordion`, `Badge`, `Scroll`, `Select`, `Combobox`, `Menu`, `Popover`, `Tooltip`, `Toast`, `useToast`, `Async`, `Field`, `cn`.
|
|
37
|
+
|
|
38
|
+
## Implementation pattern
|
|
39
|
+
|
|
40
|
+
Each file in `src/<component>.tsx`:
|
|
41
|
+
|
|
42
|
+
1. Import headless from `@aeon-ui/react`
|
|
43
|
+
2. Import `aeon*` recipe from `@aeon-ui/panda/styled-system/recipes`
|
|
44
|
+
3. `className={cn(recipe({ variant, size }), className)}`
|
|
45
|
+
4. Forward `status`, `variant`, `size` to headless
|
|
46
|
+
|
|
47
|
+
Example: `src/button.tsx`.
|
|
48
|
+
|
|
49
|
+
## Customize
|
|
50
|
+
|
|
51
|
+
- **Tokens/themes:** `packages/panda/src/theme/themes.config.ts` + codegen
|
|
52
|
+
- **Recipes:** edit panda recipes, codegen, rebuild ui
|
|
53
|
+
- **Replace styles entirely:** use `@aeon-ui/react` + your CSS on `data-aeon-*`
|
|
54
|
+
|
|
55
|
+
## Agents
|
|
56
|
+
|
|
57
|
+
Do not add non-Panda styling inside this package.
|
|
58
|
+
Workflow: [docs/COMPONENT_CHECKLIST.md](../../docs/COMPONENT_CHECKLIST.md).
|
|
59
|
+
|
|
60
|
+
## Related
|
|
61
|
+
|
|
62
|
+
- [COMPONENTS.md](../../COMPONENTS.md)
|
|
63
|
+
- [STATES.md](../../STATES.md)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aeon-ui/ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Styled Aeon UI components (Panda CSS recipes)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/GenericCPU/aeon-ui.git",
|
|
9
|
+
"directory": "packages/ui"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": { "access": "public" },
|
|
12
|
+
"files": ["dist", "src/styles.css", "README.md"],
|
|
13
|
+
"keywords": ["aeon-ui", "react", "components", "design-system"],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"sideEffects": ["**/*.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
|
+
"./styles.css": {
|
|
24
|
+
"default": "./src/styles.css"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsup src/index.ts --format esm --dts --clean --external react --external react-dom --external @aeon-ui/panda/styled-system/css --external @aeon-ui/panda/styled-system/recipes",
|
|
29
|
+
"typecheck": "tsc --noEmit"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@aeon-ui/panda": "workspace:*",
|
|
33
|
+
"@aeon-ui/react": "workspace:*"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"react": "^18 || ^19",
|
|
37
|
+
"react-dom": "^18 || ^19"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/react": "^19.1.2",
|
|
41
|
+
"react": "^19.1.0",
|
|
42
|
+
"tsup": "^8.4.0",
|
|
43
|
+
"typescript": "^5.8.3"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Accordion as Headless } from '@aeon-ui/react'
|
|
2
|
+
import { css } from '@aeon-ui/panda/styled-system/css'
|
|
3
|
+
import { aeonAccordion } from '@aeon-ui/panda/styled-system/recipes'
|
|
4
|
+
import type { ComponentProps } from 'react'
|
|
5
|
+
import { cn } from './cn.js'
|
|
6
|
+
|
|
7
|
+
const accordion = aeonAccordion()
|
|
8
|
+
const triggerLabel = css({ flex: '1', minW: '0', pr: 'gapSm' })
|
|
9
|
+
|
|
10
|
+
export const Accordion = {
|
|
11
|
+
Root: ({ className, ...props }: ComponentProps<typeof Headless.Root>) => (
|
|
12
|
+
<Headless.Root className={cn(accordion.root, className)} {...props} />
|
|
13
|
+
),
|
|
14
|
+
Item: ({ className, ...props }: ComponentProps<typeof Headless.Item>) => (
|
|
15
|
+
<Headless.Item className={cn(accordion.item, className)} {...props} />
|
|
16
|
+
),
|
|
17
|
+
ItemTrigger: ({ className, children, ...props }: ComponentProps<typeof Headless.ItemTrigger>) => (
|
|
18
|
+
<Headless.ItemTrigger className={cn(accordion.itemTrigger, className)} {...props}>
|
|
19
|
+
<span className={triggerLabel}>{children}</span>
|
|
20
|
+
<Headless.ItemIndicator className={accordion.itemIndicator}>▾</Headless.ItemIndicator>
|
|
21
|
+
</Headless.ItemTrigger>
|
|
22
|
+
),
|
|
23
|
+
ItemContent: ({ className, ...props }: ComponentProps<typeof Headless.ItemContent>) => (
|
|
24
|
+
<Headless.ItemContent className={cn(accordion.itemContent, className)} {...props} />
|
|
25
|
+
),
|
|
26
|
+
ItemIndicator: Headless.ItemIndicator,
|
|
27
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Async as Headless, useAsyncContext } from '@aeon-ui/react'
|
|
2
|
+
import { aeonAsync } from '@aeon-ui/panda/styled-system/recipes'
|
|
3
|
+
import type { ComponentProps } from 'react'
|
|
4
|
+
import { cn } from './cn.js'
|
|
5
|
+
|
|
6
|
+
const styles = () => aeonAsync()
|
|
7
|
+
|
|
8
|
+
type RootProps = ComponentProps<typeof Headless.Root>
|
|
9
|
+
type TrackProps = ComponentProps<typeof Headless.Track>
|
|
10
|
+
type ReadoutProps = ComponentProps<typeof Headless.Readout>
|
|
11
|
+
type ActionsProps = ComponentProps<typeof Headless.Actions>
|
|
12
|
+
|
|
13
|
+
export const Async = {
|
|
14
|
+
Root: ({ className, ...props }: RootProps) => {
|
|
15
|
+
const s = styles()
|
|
16
|
+
return <Headless.Root className={cn(s.root, 'machine-console', className)} {...props} />
|
|
17
|
+
},
|
|
18
|
+
Track: ({ className, ...props }: TrackProps) => {
|
|
19
|
+
const s = styles()
|
|
20
|
+
return <Headless.Track className={cn(s.track, 'state-track', className)} {...props} />
|
|
21
|
+
},
|
|
22
|
+
Readout: ({ className, children, ...props }: ReadoutProps) => {
|
|
23
|
+
const s = styles()
|
|
24
|
+
const { status } = useAsyncContext()
|
|
25
|
+
const tone = ['idle', 'loading', 'success', 'failure', 'empty'].includes(status)
|
|
26
|
+
? status
|
|
27
|
+
: 'idle'
|
|
28
|
+
return (
|
|
29
|
+
<Headless.Readout
|
|
30
|
+
className={cn(s.readout, 'live-status', `live-status--${tone}`, className)}
|
|
31
|
+
{...props}
|
|
32
|
+
>
|
|
33
|
+
{children}
|
|
34
|
+
</Headless.Readout>
|
|
35
|
+
)
|
|
36
|
+
},
|
|
37
|
+
Actions: ({ className, ...props }: ActionsProps) => {
|
|
38
|
+
const s = styles()
|
|
39
|
+
return <Headless.Actions className={cn(s.actions, className)} {...props} />
|
|
40
|
+
},
|
|
41
|
+
Provider: Headless.Provider,
|
|
42
|
+
useContext: useAsyncContext,
|
|
43
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { aeonBadge } from '@aeon-ui/panda/styled-system/recipes'
|
|
2
|
+
import type { HTMLAttributes } from 'react'
|
|
3
|
+
import { cn } from './cn.js'
|
|
4
|
+
|
|
5
|
+
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
6
|
+
variant?: 'default' | 'accent' | 'danger'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function Badge({ className, variant = 'default', ...props }: BadgeProps) {
|
|
10
|
+
return (
|
|
11
|
+
<span
|
|
12
|
+
data-aeon-scope="badge"
|
|
13
|
+
data-aeon-part="root"
|
|
14
|
+
className={cn(aeonBadge({ variant }), className)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Button as Headless } from '@aeon-ui/react'
|
|
2
|
+
import { aeonButton, aeonButtonGroup } from '@aeon-ui/panda/styled-system/recipes'
|
|
3
|
+
import type { ComponentProps } from 'react'
|
|
4
|
+
import { cn } from './cn.js'
|
|
5
|
+
|
|
6
|
+
type ButtonProps = ComponentProps<typeof Headless.Root> & {
|
|
7
|
+
status?: ComponentProps<typeof Headless.Root>['status']
|
|
8
|
+
}
|
|
9
|
+
type ButtonGroupProps = ComponentProps<typeof Headless.Group> & {
|
|
10
|
+
orientation?: 'horizontal' | 'vertical'
|
|
11
|
+
gap?: 'sm' | 'md' | 'lg'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const Button = {
|
|
15
|
+
Root: ({ className, variant = 'solid', size = 'md', status = 'idle', ...props }: ButtonProps) => (
|
|
16
|
+
<Headless.Root
|
|
17
|
+
className={cn(aeonButton({ variant, size }), className)}
|
|
18
|
+
data-aeon-size={size}
|
|
19
|
+
variant={variant}
|
|
20
|
+
size={size}
|
|
21
|
+
status={status}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
),
|
|
25
|
+
Group: ({
|
|
26
|
+
className,
|
|
27
|
+
orientation = 'horizontal',
|
|
28
|
+
gap = 'sm',
|
|
29
|
+
...props
|
|
30
|
+
}: ButtonGroupProps) => (
|
|
31
|
+
<Headless.Group
|
|
32
|
+
className={cn(aeonButtonGroup({ orientation, gap }), className)}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
),
|
|
36
|
+
Label: Headless.Label,
|
|
37
|
+
Icon: Headless.Icon,
|
|
38
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Checkbox as Headless } from '@aeon-ui/react'
|
|
2
|
+
import { aeonCheckbox } from '@aeon-ui/panda/styled-system/recipes'
|
|
3
|
+
import type { ComponentProps } from 'react'
|
|
4
|
+
import { cn } from './cn.js'
|
|
5
|
+
|
|
6
|
+
const checkbox = aeonCheckbox()
|
|
7
|
+
|
|
8
|
+
export const Checkbox = {
|
|
9
|
+
Root: ({ className, ...props }: ComponentProps<typeof Headless.Root>) => (
|
|
10
|
+
<Headless.Root className={cn(checkbox.root, className)} {...props} />
|
|
11
|
+
),
|
|
12
|
+
Control: ({ className, ...props }: ComponentProps<typeof Headless.Control>) => (
|
|
13
|
+
<Headless.Control className={cn(checkbox.control, className)} {...props} />
|
|
14
|
+
),
|
|
15
|
+
Indicator: ({ className, children, ...props }: ComponentProps<typeof Headless.Indicator>) => (
|
|
16
|
+
<Headless.Indicator className={cn(checkbox.indicator, className)} {...props}>
|
|
17
|
+
{children ?? '✓'}
|
|
18
|
+
</Headless.Indicator>
|
|
19
|
+
),
|
|
20
|
+
Label: ({ className, ...props }: ComponentProps<typeof Headless.Label>) => (
|
|
21
|
+
<Headless.Label className={cn(checkbox.label, className)} {...props} />
|
|
22
|
+
),
|
|
23
|
+
HiddenInput: Headless.HiddenInput,
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { cx as cn } from '@aeon-ui/panda/styled-system/css'
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Combobox as Headless } from '@aeon-ui/react'
|
|
2
|
+
import { aeonCombobox } from '@aeon-ui/panda/styled-system/recipes'
|
|
3
|
+
import type { ComponentProps } from 'react'
|
|
4
|
+
import { cn } from './cn.js'
|
|
5
|
+
|
|
6
|
+
const styles = () => aeonCombobox()
|
|
7
|
+
|
|
8
|
+
export const Combobox = {
|
|
9
|
+
Root: ({ className, ...props }: ComponentProps<typeof Headless.Root>) => {
|
|
10
|
+
const s = styles()
|
|
11
|
+
return <Headless.Root className={cn(s.root, className)} {...props} />
|
|
12
|
+
},
|
|
13
|
+
Input: ({ className, ...props }: ComponentProps<typeof Headless.Input>) => {
|
|
14
|
+
const s = styles()
|
|
15
|
+
return <Headless.Input className={cn(s.input, className)} {...props} />
|
|
16
|
+
},
|
|
17
|
+
Content: ({ className, ...props }: ComponentProps<typeof Headless.Content>) => {
|
|
18
|
+
const s = styles()
|
|
19
|
+
return <Headless.Content className={cn(s.content, className)} {...props} />
|
|
20
|
+
},
|
|
21
|
+
Item: ({ className, ...props }: ComponentProps<typeof Headless.Item>) => {
|
|
22
|
+
const s = styles()
|
|
23
|
+
return <Headless.Item className={cn(s.item, className)} {...props} />
|
|
24
|
+
},
|
|
25
|
+
Empty: ({ className, ...props }: ComponentProps<typeof Headless.Empty>) => {
|
|
26
|
+
const s = styles()
|
|
27
|
+
return <Headless.Empty className={cn(s.empty, className)} {...props} />
|
|
28
|
+
},
|
|
29
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Dialog as Headless } from '@aeon-ui/react'
|
|
2
|
+
import { aeonDialog } from '@aeon-ui/panda/styled-system/recipes'
|
|
3
|
+
import type { ComponentProps } from 'react'
|
|
4
|
+
import { cn } from './cn.js'
|
|
5
|
+
|
|
6
|
+
const dialog = aeonDialog()
|
|
7
|
+
|
|
8
|
+
export const Dialog = {
|
|
9
|
+
Root: Headless.Root,
|
|
10
|
+
Trigger: ({ className, ...props }: ComponentProps<typeof Headless.Trigger>) => (
|
|
11
|
+
<Headless.Trigger className={cn(dialog.trigger, className)} {...props} />
|
|
12
|
+
),
|
|
13
|
+
Portal: Headless.Portal,
|
|
14
|
+
Backdrop: ({ className, ...props }: ComponentProps<typeof Headless.Backdrop>) => (
|
|
15
|
+
<Headless.Backdrop className={cn(dialog.backdrop, className)} {...props} />
|
|
16
|
+
),
|
|
17
|
+
Positioner: ({ className, ...props }: ComponentProps<typeof Headless.Positioner>) => (
|
|
18
|
+
<Headless.Positioner className={cn(dialog.positioner, className)} {...props} />
|
|
19
|
+
),
|
|
20
|
+
Content: ({ className, ...props }: ComponentProps<typeof Headless.Content>) => (
|
|
21
|
+
<Headless.Content className={cn(dialog.content, className)} {...props} />
|
|
22
|
+
),
|
|
23
|
+
Title: ({ className, ...props }: ComponentProps<typeof Headless.Title>) => (
|
|
24
|
+
<Headless.Title className={cn(dialog.title, className)} {...props} />
|
|
25
|
+
),
|
|
26
|
+
Description: ({ className, ...props }: ComponentProps<typeof Headless.Description>) => (
|
|
27
|
+
<Headless.Description className={cn(dialog.description, className)} {...props} />
|
|
28
|
+
),
|
|
29
|
+
CloseTrigger: ({ className, ...props }: ComponentProps<typeof Headless.CloseTrigger>) => (
|
|
30
|
+
<Headless.CloseTrigger className={cn(dialog.closeTrigger, className)} {...props} />
|
|
31
|
+
),
|
|
32
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Field as Headless } from '@aeon-ui/react'
|
|
2
|
+
import { aeonField } from '@aeon-ui/panda/styled-system/recipes'
|
|
3
|
+
import type { ComponentProps } from 'react'
|
|
4
|
+
import { cn } from './cn.js'
|
|
5
|
+
|
|
6
|
+
const styles = () => aeonField()
|
|
7
|
+
|
|
8
|
+
export const Field = {
|
|
9
|
+
Root: ({ className, ...props }: ComponentProps<typeof Headless.Root>) => {
|
|
10
|
+
const s = styles()
|
|
11
|
+
return <Headless.Root className={cn(s.root, className)} {...props} />
|
|
12
|
+
},
|
|
13
|
+
Label: ({ className, ...props }: ComponentProps<typeof Headless.Label>) => {
|
|
14
|
+
const s = styles()
|
|
15
|
+
return <Headless.Label className={cn(s.label, className)} {...props} />
|
|
16
|
+
},
|
|
17
|
+
Control: ({ className, ...props }: ComponentProps<typeof Headless.Control>) => {
|
|
18
|
+
const s = styles()
|
|
19
|
+
return <Headless.Control className={cn(s.control, className)} {...props} />
|
|
20
|
+
},
|
|
21
|
+
Textarea: ({ className, ...props }: ComponentProps<typeof Headless.Textarea>) => {
|
|
22
|
+
const s = styles()
|
|
23
|
+
return <Headless.Textarea className={cn(s.textarea, className)} {...props} />
|
|
24
|
+
},
|
|
25
|
+
Message: ({ className, ...props }: ComponentProps<typeof Headless.Message>) => {
|
|
26
|
+
const s = styles()
|
|
27
|
+
return <Headless.Message className={cn(s.message, className)} {...props} />
|
|
28
|
+
},
|
|
29
|
+
Hint: ({ className, ...props }: ComponentProps<typeof Headless.Hint>) => {
|
|
30
|
+
const s = styles()
|
|
31
|
+
return <Headless.Hint className={cn(s.hint, className)} {...props} />
|
|
32
|
+
},
|
|
33
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { Button } from './button.js'
|
|
2
|
+
export { Async } from './async.js'
|
|
3
|
+
export { Field } from './field.js'
|
|
4
|
+
export { Switch } from './switch.js'
|
|
5
|
+
export { Checkbox } from './checkbox.js'
|
|
6
|
+
export { Dialog } from './dialog.js'
|
|
7
|
+
export { Tabs } from './tabs.js'
|
|
8
|
+
export { Accordion } from './accordion.js'
|
|
9
|
+
export { Badge } from './badge.js'
|
|
10
|
+
export { Scroll } from './scroll.js'
|
|
11
|
+
export { Select } from './select.js'
|
|
12
|
+
export { Combobox } from './combobox.js'
|
|
13
|
+
export { Menu } from './menu.js'
|
|
14
|
+
export { Popover } from './popover.js'
|
|
15
|
+
export { Tooltip } from './tooltip.js'
|
|
16
|
+
export { Toast, useToast } from './toast.js'
|
|
17
|
+
export { cn } from './cn.js'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Menu as Headless } from '@aeon-ui/react'
|
|
2
|
+
import { aeonMenu } from '@aeon-ui/panda/styled-system/recipes'
|
|
3
|
+
import type { ComponentProps } from 'react'
|
|
4
|
+
import { cn } from './cn.js'
|
|
5
|
+
|
|
6
|
+
const menu = aeonMenu()
|
|
7
|
+
|
|
8
|
+
export const Menu = {
|
|
9
|
+
Root: Headless.Root,
|
|
10
|
+
Trigger: ({ className, ...props }: ComponentProps<typeof Headless.Trigger>) => (
|
|
11
|
+
<Headless.Trigger className={cn(menu.trigger, className)} {...props} />
|
|
12
|
+
),
|
|
13
|
+
Positioner: ({ className, ...props }: ComponentProps<typeof Headless.Positioner>) => (
|
|
14
|
+
<Headless.Positioner className={cn(menu.positioner, className)} {...props} />
|
|
15
|
+
),
|
|
16
|
+
Content: ({ className, ...props }: ComponentProps<typeof Headless.Content>) => (
|
|
17
|
+
<Headless.Content className={cn(menu.content, className)} {...props} />
|
|
18
|
+
),
|
|
19
|
+
Item: ({ className, ...props }: ComponentProps<typeof Headless.Item>) => (
|
|
20
|
+
<Headless.Item className={cn(menu.item, className)} {...props} />
|
|
21
|
+
),
|
|
22
|
+
Separator: ({ className, ...props }: ComponentProps<typeof Headless.Separator>) => (
|
|
23
|
+
<Headless.Separator className={cn(menu.separator, className)} {...props} />
|
|
24
|
+
),
|
|
25
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Popover as Headless } from '@aeon-ui/react'
|
|
2
|
+
import { aeonPopover } from '@aeon-ui/panda/styled-system/recipes'
|
|
3
|
+
import type { ComponentProps } from 'react'
|
|
4
|
+
import { cn } from './cn.js'
|
|
5
|
+
|
|
6
|
+
const popover = aeonPopover()
|
|
7
|
+
|
|
8
|
+
export const Popover = {
|
|
9
|
+
Root: Headless.Root,
|
|
10
|
+
Trigger: ({ className, ...props }: ComponentProps<typeof Headless.Trigger>) => (
|
|
11
|
+
<Headless.Trigger className={cn(popover.trigger, className)} {...props} />
|
|
12
|
+
),
|
|
13
|
+
Positioner: ({ className, ...props }: ComponentProps<typeof Headless.Positioner>) => (
|
|
14
|
+
<Headless.Positioner className={cn(popover.positioner, className)} {...props} />
|
|
15
|
+
),
|
|
16
|
+
Content: ({ className, ...props }: ComponentProps<typeof Headless.Content>) => (
|
|
17
|
+
<Headless.Content className={cn(popover.content, className)} {...props} />
|
|
18
|
+
),
|
|
19
|
+
CloseTrigger: ({ className, ...props }: ComponentProps<typeof Headless.CloseTrigger>) => (
|
|
20
|
+
<Headless.CloseTrigger className={cn(popover.closeTrigger, className)} {...props} />
|
|
21
|
+
),
|
|
22
|
+
}
|