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,11 @@
|
|
|
1
|
+
# @aeon-ui/react-scene
|
|
2
|
+
|
|
3
|
+
Optional React layer for ambient visuals — pair with `@aeon-ui/signal`, `@aeon-ui/geometry`, and `@aeon-ui/surface`.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { SceneRoot, ProceduralGrid, SignalBars, SceneStage, SceneLayer, ScenePlane } from '@aeon-ui/react-scene'
|
|
7
|
+
import '@aeon-ui/surface/surface.css'
|
|
8
|
+
import '@aeon-ui/react-scene/scene-3d.css'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
See [SCENE.md](../../SCENE.md).
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aeon-ui/react-scene",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "React bindings for Aeon Scene — visualizers, backdrops, textures",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/GenericCPU/aeon-ui.git",
|
|
9
|
+
"directory": "packages/react-scene"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": { "access": "public" },
|
|
12
|
+
"files": ["dist", "scene-3d.css", "README.md"],
|
|
13
|
+
"keywords": ["aeon-ui", "react", "visualizer", "background", "scene"],
|
|
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
|
+
"./scene-3d.css": "./scene-3d.css"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsup src/index.ts --format esm --dts --clean --external react --external react-dom --external @aeon-ui/geometry --external @aeon-ui/signal --external @aeon-ui/surface --external @aeon-ui/scene",
|
|
27
|
+
"typecheck": "tsc --noEmit"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@aeon-ui/geometry": "workspace:*",
|
|
31
|
+
"@aeon-ui/scene": "workspace:*",
|
|
32
|
+
"@aeon-ui/signal": "workspace:*",
|
|
33
|
+
"@aeon-ui/surface": "workspace:*"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"react": "^18 || ^19",
|
|
37
|
+
"react-dom": "^18 || ^19"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/react": "^19.1.2",
|
|
41
|
+
"@types/react-dom": "^19.1.2",
|
|
42
|
+
"react": "^19.1.0",
|
|
43
|
+
"react-dom": "^19.1.0",
|
|
44
|
+
"tsup": "^8.4.0",
|
|
45
|
+
"typescript": "^5.8.3"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* Optional — import when using SceneStage / SceneLayer / ScenePlane / SceneRoom */
|
|
2
|
+
@import './scene-room.css';
|
|
3
|
+
|
|
4
|
+
.aeon-scene-stage {
|
|
5
|
+
position: relative;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
transform-style: preserve-3d;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.aeon-scene-layer {
|
|
11
|
+
position: absolute;
|
|
12
|
+
inset: 0;
|
|
13
|
+
transform-style: preserve-3d;
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.aeon-scene-plane {
|
|
18
|
+
position: absolute;
|
|
19
|
+
transform-style: preserve-3d;
|
|
20
|
+
background-repeat: no-repeat;
|
|
21
|
+
background-size: cover;
|
|
22
|
+
background-position: center;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.aeon-scene-plane--fill {
|
|
26
|
+
inset: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.aeon-scene-slot {
|
|
30
|
+
position: absolute;
|
|
31
|
+
transform-style: preserve-3d;
|
|
32
|
+
pointer-events: auto;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.aeon-scene-slot--fill {
|
|
36
|
+
inset: 0;
|
|
37
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/* Box room — use with SceneRoom; requires .aeon-scene-stage perspective */
|
|
2
|
+
|
|
3
|
+
.aeon-scene-room-wrap {
|
|
4
|
+
position: absolute;
|
|
5
|
+
left: 50%;
|
|
6
|
+
top: var(--aeon-room-anchor-y, 46%);
|
|
7
|
+
transform-style: preserve-3d;
|
|
8
|
+
transform: translate3d(-50%, -50%, var(--aeon-room-offset-z, -120px))
|
|
9
|
+
rotateX(var(--aeon-room-pitch, 10deg)) rotateY(var(--aeon-room-yaw, 0deg));
|
|
10
|
+
pointer-events: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.aeon-scene-room {
|
|
14
|
+
position: relative;
|
|
15
|
+
width: var(--aeon-room-w);
|
|
16
|
+
height: var(--aeon-room-h);
|
|
17
|
+
transform-style: preserve-3d;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.aeon-scene-room__face {
|
|
21
|
+
position: absolute;
|
|
22
|
+
left: 50%;
|
|
23
|
+
top: 50%;
|
|
24
|
+
transform-style: preserve-3d;
|
|
25
|
+
backface-visibility: hidden;
|
|
26
|
+
-webkit-backface-visibility: hidden;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.aeon-scene-room__back {
|
|
30
|
+
width: var(--aeon-room-w);
|
|
31
|
+
height: var(--aeon-room-h);
|
|
32
|
+
margin: calc(var(--aeon-room-h) / -2) 0 0 calc(var(--aeon-room-w) / -2);
|
|
33
|
+
transform: translate3d(0, 0, calc(var(--aeon-room-d) / -2));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.aeon-scene-room__left {
|
|
37
|
+
width: var(--aeon-room-d);
|
|
38
|
+
height: var(--aeon-room-h);
|
|
39
|
+
margin: calc(var(--aeon-room-h) / -2) 0 0 calc(var(--aeon-room-d) / -2);
|
|
40
|
+
transform: rotateY(-90deg) translate3d(calc(var(--aeon-room-w) / -2), 0, 0);
|
|
41
|
+
transform-origin: right center;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.aeon-scene-room__right {
|
|
45
|
+
width: var(--aeon-room-d);
|
|
46
|
+
height: var(--aeon-room-h);
|
|
47
|
+
margin: calc(var(--aeon-room-h) / -2) 0 0 calc(var(--aeon-room-d) / -2);
|
|
48
|
+
transform: rotateY(90deg) translate3d(calc(var(--aeon-room-w) / 2), 0, 0);
|
|
49
|
+
transform-origin: left center;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.aeon-scene-room__floor {
|
|
53
|
+
width: var(--aeon-room-w);
|
|
54
|
+
height: var(--aeon-room-d);
|
|
55
|
+
margin: calc(var(--aeon-room-d) / -2) 0 0 calc(var(--aeon-room-w) / -2);
|
|
56
|
+
transform: rotateX(90deg) translate3d(0, calc(var(--aeon-room-h) / 2), 0);
|
|
57
|
+
transform-origin: center top;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.aeon-scene-room__floor-plane {
|
|
61
|
+
inset: 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.aeon-scene-room__ceiling {
|
|
65
|
+
width: var(--aeon-room-w);
|
|
66
|
+
height: var(--aeon-room-d);
|
|
67
|
+
margin: calc(var(--aeon-room-d) / -2) 0 0 calc(var(--aeon-room-w) / -2);
|
|
68
|
+
transform: rotateX(-90deg) translate3d(0, calc(var(--aeon-room-h) / -2), 0);
|
|
69
|
+
transform-origin: center bottom;
|
|
70
|
+
background: linear-gradient(180deg, #0a0908 0%, #1e1a16 55%, #2a2520 100%);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* UI on the floor: counter-rotate so controls face the camera */
|
|
74
|
+
.aeon-scene-room__floor-slot {
|
|
75
|
+
position: absolute;
|
|
76
|
+
inset: 10% 6% 14% 6%;
|
|
77
|
+
transform: rotateX(-90deg) translateZ(10px);
|
|
78
|
+
transform-origin: center center;
|
|
79
|
+
transform-style: preserve-3d;
|
|
80
|
+
pointer-events: auto;
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
align-items: stretch;
|
|
84
|
+
gap: 0.75rem;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.aeon-scene-room__vignette {
|
|
88
|
+
position: fixed;
|
|
89
|
+
inset: 0;
|
|
90
|
+
pointer-events: none;
|
|
91
|
+
background:
|
|
92
|
+
radial-gradient(ellipse 90% 70% at 50% 55%, transparent 35%, rgba(0, 0, 0, 0.55) 100%),
|
|
93
|
+
linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 22%, transparent 72%, rgba(0, 0, 0, 0.5) 100%);
|
|
94
|
+
z-index: 0;
|
|
95
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { SceneRoot, SceneBackdrop } from './scene-root.js'
|
|
2
|
+
export { ProceduralGrid } from './procedural-grid.js'
|
|
3
|
+
export { SceneSurface } from './scene-surface.js'
|
|
4
|
+
export { SignalBars } from './signal-bars.js'
|
|
5
|
+
export { useSignalVisualizer } from './use-signal-visualizer.js'
|
|
6
|
+
export { SceneStage } from './scene-stage.js'
|
|
7
|
+
export { SceneLayer } from './scene-layer.js'
|
|
8
|
+
export { ScenePlane } from './scene-plane.js'
|
|
9
|
+
export { SceneSlot } from './scene-slot.js'
|
|
10
|
+
export { SceneRoom } from './scene-room.js'
|
|
11
|
+
export type { SceneRootProps, SceneBackdropProps } from './scene-root.js'
|
|
12
|
+
export type { ProceduralGridProps } from './procedural-grid.js'
|
|
13
|
+
export type { SceneSurfaceProps } from './scene-surface.js'
|
|
14
|
+
export type { SignalBarsProps } from './signal-bars.js'
|
|
15
|
+
export type { UseSignalVisualizerOptions } from './use-signal-visualizer.js'
|
|
16
|
+
export type { SceneStageProps } from './scene-stage.js'
|
|
17
|
+
export type { SceneLayerProps } from './scene-layer.js'
|
|
18
|
+
export type { ScenePlaneProps } from './scene-plane.js'
|
|
19
|
+
export type { SceneSlotProps } from './scene-slot.js'
|
|
20
|
+
export type { SceneRoomProps } from './scene-room.js'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CSSProperties, HTMLAttributes } from 'react'
|
|
2
|
+
import { gridPatternStyle, vignetteStyle, sceneAttrs } from '@aeon-ui/geometry'
|
|
3
|
+
|
|
4
|
+
export type ProceduralGridProps = HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
cell?: number
|
|
6
|
+
lineColor?: string
|
|
7
|
+
vignette?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Layered grid lines + optional vignette for page/scene backgrounds. */
|
|
11
|
+
export function ProceduralGrid({
|
|
12
|
+
cell,
|
|
13
|
+
lineColor,
|
|
14
|
+
vignette = true,
|
|
15
|
+
className,
|
|
16
|
+
style,
|
|
17
|
+
...rest
|
|
18
|
+
}: ProceduralGridProps) {
|
|
19
|
+
const grid = gridPatternStyle({ cell, lineColor })
|
|
20
|
+
const merged: CSSProperties = {
|
|
21
|
+
position: 'absolute',
|
|
22
|
+
inset: 0,
|
|
23
|
+
pointerEvents: 'none',
|
|
24
|
+
...grid,
|
|
25
|
+
...style,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div {...rest} {...sceneAttrs('grid')} className={className} style={merged} aria-hidden>
|
|
30
|
+
{vignette ? (
|
|
31
|
+
<div style={{ position: 'absolute', inset: 0, ...vignetteStyle() }} aria-hidden />
|
|
32
|
+
) : null}
|
|
33
|
+
</div>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CSSProperties, HTMLAttributes, ReactNode } from 'react'
|
|
2
|
+
import { sceneAttrs } from '@aeon-ui/geometry'
|
|
3
|
+
import { sceneTransformStyle, type SceneTransform3d } from '@aeon-ui/scene'
|
|
4
|
+
|
|
5
|
+
export type SceneLayerProps = HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
part?: string
|
|
7
|
+
transform?: SceneTransform3d
|
|
8
|
+
origin?: string
|
|
9
|
+
children?: ReactNode
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Positioned 3D layer inside a `SceneStage` (absolute fill + transform). */
|
|
13
|
+
export function SceneLayer({
|
|
14
|
+
part = 'layer',
|
|
15
|
+
transform,
|
|
16
|
+
origin = '50% 50%',
|
|
17
|
+
className,
|
|
18
|
+
style,
|
|
19
|
+
children,
|
|
20
|
+
...rest
|
|
21
|
+
}: SceneLayerProps) {
|
|
22
|
+
const merged: CSSProperties = {
|
|
23
|
+
...(transform ? sceneTransformStyle(transform, { origin }) : { transformStyle: 'preserve-3d' }),
|
|
24
|
+
...style,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
{...rest}
|
|
30
|
+
{...sceneAttrs(part)}
|
|
31
|
+
className={['aeon-scene-layer', className].filter(Boolean).join(' ')}
|
|
32
|
+
style={merged}
|
|
33
|
+
aria-hidden={rest['aria-hidden'] ?? true}
|
|
34
|
+
>
|
|
35
|
+
{children}
|
|
36
|
+
</div>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { CSSProperties, HTMLAttributes, ReactNode } from 'react'
|
|
2
|
+
import { sceneAttrs } from '@aeon-ui/geometry'
|
|
3
|
+
import { sceneTransformStyle, sceneWallClip, type SceneTransform3d } from '@aeon-ui/scene'
|
|
4
|
+
import { surfaceClass, type SurfaceMaterial } from '@aeon-ui/surface'
|
|
5
|
+
|
|
6
|
+
export type ScenePlaneProps = HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
part?: string
|
|
8
|
+
/** Extra transform on this plane (in addition to parent `SceneLayer`). */
|
|
9
|
+
transform?: SceneTransform3d
|
|
10
|
+
origin?: string
|
|
11
|
+
/** Cover the parent layer (`inset: 0`). Default true. */
|
|
12
|
+
fill?: boolean
|
|
13
|
+
texture?: string
|
|
14
|
+
material?: SurfaceMaterial
|
|
15
|
+
/** Left or right wall trapezoid clip. */
|
|
16
|
+
wall?: 'left' | 'right'
|
|
17
|
+
children?: ReactNode
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Textured or material-filled plane in 3D space — ground, wall, backdrop, UI mount. */
|
|
21
|
+
export function ScenePlane({
|
|
22
|
+
part = 'plane',
|
|
23
|
+
transform,
|
|
24
|
+
origin = '50% 50%',
|
|
25
|
+
fill = true,
|
|
26
|
+
texture,
|
|
27
|
+
material,
|
|
28
|
+
wall,
|
|
29
|
+
className,
|
|
30
|
+
style,
|
|
31
|
+
children,
|
|
32
|
+
...rest
|
|
33
|
+
}: ScenePlaneProps) {
|
|
34
|
+
const merged: CSSProperties = {
|
|
35
|
+
...(transform ? sceneTransformStyle(transform, { origin }) : {}),
|
|
36
|
+
...(texture
|
|
37
|
+
? {
|
|
38
|
+
backgroundImage: `url(${texture})`,
|
|
39
|
+
backgroundSize: 'cover',
|
|
40
|
+
backgroundPosition: 'center',
|
|
41
|
+
}
|
|
42
|
+
: {}),
|
|
43
|
+
...(wall ? { clipPath: sceneWallClip(wall) } : {}),
|
|
44
|
+
...style,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const classes = [
|
|
48
|
+
'aeon-scene-plane',
|
|
49
|
+
fill ? 'aeon-scene-plane--fill' : '',
|
|
50
|
+
material ? surfaceClass(material) : '',
|
|
51
|
+
className,
|
|
52
|
+
]
|
|
53
|
+
.filter(Boolean)
|
|
54
|
+
.join(' ')
|
|
55
|
+
|
|
56
|
+
const interactive = Boolean(children)
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<div
|
|
60
|
+
{...rest}
|
|
61
|
+
{...sceneAttrs(part)}
|
|
62
|
+
className={classes}
|
|
63
|
+
style={merged}
|
|
64
|
+
aria-hidden={interactive ? undefined : true}
|
|
65
|
+
>
|
|
66
|
+
{children}
|
|
67
|
+
</div>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { CSSProperties, HTMLAttributes, ReactNode } from 'react'
|
|
2
|
+
import { sceneAttrs } from '@aeon-ui/geometry'
|
|
3
|
+
import { sceneRoomVars, type SceneRoomCamera, type SceneRoomSize } from '@aeon-ui/scene'
|
|
4
|
+
import type { SurfaceMaterial } from '@aeon-ui/surface'
|
|
5
|
+
import { ScenePlane } from './scene-plane.js'
|
|
6
|
+
|
|
7
|
+
export type SceneRoomProps = HTMLAttributes<HTMLDivElement> & {
|
|
8
|
+
size?: SceneRoomSize
|
|
9
|
+
camera?: SceneRoomCamera
|
|
10
|
+
floorMaterial?: SurfaceMaterial
|
|
11
|
+
wallMaterial?: SurfaceMaterial
|
|
12
|
+
/** Content mounted on the floor plane (counter-rotated to face the viewer). */
|
|
13
|
+
floor?: ReactNode
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const DEFAULT_SIZE: SceneRoomSize = { width: 1280, height: 680, depth: 920 }
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* CSS 3D box room — floor, ceiling, back, left, and right faces with a shared vanishing point.
|
|
20
|
+
* Mount UI via `floor` so it sits on the ground plane in the same transform space.
|
|
21
|
+
*/
|
|
22
|
+
export function SceneRoom({
|
|
23
|
+
size = DEFAULT_SIZE,
|
|
24
|
+
camera,
|
|
25
|
+
floorMaterial = 'pavement',
|
|
26
|
+
wallMaterial = 'brick',
|
|
27
|
+
floor,
|
|
28
|
+
className,
|
|
29
|
+
style,
|
|
30
|
+
children,
|
|
31
|
+
...rest
|
|
32
|
+
}: SceneRoomProps) {
|
|
33
|
+
const merged: CSSProperties = {
|
|
34
|
+
...sceneRoomVars(size, camera),
|
|
35
|
+
...style,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const interactive = Boolean(floor)
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div
|
|
42
|
+
{...rest}
|
|
43
|
+
{...sceneAttrs('room-wrap')}
|
|
44
|
+
className={['aeon-scene-room-wrap', className].filter(Boolean).join(' ')}
|
|
45
|
+
style={merged}
|
|
46
|
+
aria-hidden={rest['aria-hidden'] ?? (interactive ? undefined : true)}
|
|
47
|
+
>
|
|
48
|
+
<div {...sceneAttrs('room')} className="aeon-scene-room">
|
|
49
|
+
<ScenePlane
|
|
50
|
+
part="ceiling"
|
|
51
|
+
fill={false}
|
|
52
|
+
className="aeon-scene-room__face aeon-scene-room__ceiling"
|
|
53
|
+
/>
|
|
54
|
+
<ScenePlane
|
|
55
|
+
part="back-wall"
|
|
56
|
+
material={wallMaterial}
|
|
57
|
+
fill={false}
|
|
58
|
+
className="aeon-scene-room__face aeon-scene-room__back"
|
|
59
|
+
/>
|
|
60
|
+
<ScenePlane
|
|
61
|
+
part="wall-left"
|
|
62
|
+
material={wallMaterial}
|
|
63
|
+
fill={false}
|
|
64
|
+
className="aeon-scene-room__face aeon-scene-room__left"
|
|
65
|
+
/>
|
|
66
|
+
<ScenePlane
|
|
67
|
+
part="wall-right"
|
|
68
|
+
material={wallMaterial}
|
|
69
|
+
fill={false}
|
|
70
|
+
className="aeon-scene-room__face aeon-scene-room__right"
|
|
71
|
+
/>
|
|
72
|
+
<div className="aeon-scene-room__face aeon-scene-room__floor">
|
|
73
|
+
<ScenePlane part="ground" material={floorMaterial} fill className="aeon-scene-room__floor-plane">
|
|
74
|
+
{children}
|
|
75
|
+
</ScenePlane>
|
|
76
|
+
{floor ? <div className="aeon-scene-room__floor-slot">{floor}</div> : null}
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { CSSProperties, HTMLAttributes, ReactNode } from 'react'
|
|
2
|
+
import { sceneAttrs, type SceneState } from '@aeon-ui/geometry'
|
|
3
|
+
|
|
4
|
+
export type SceneRootProps = HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
part?: string
|
|
6
|
+
state?: SceneState
|
|
7
|
+
children?: ReactNode
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Root for an ambient scene region (`data-aeon-scope="scene"`). */
|
|
11
|
+
export function SceneRoot({
|
|
12
|
+
part = 'root',
|
|
13
|
+
state,
|
|
14
|
+
className,
|
|
15
|
+
style,
|
|
16
|
+
children,
|
|
17
|
+
...rest
|
|
18
|
+
}: SceneRootProps) {
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
{...rest}
|
|
22
|
+
{...sceneAttrs(part, state)}
|
|
23
|
+
className={className}
|
|
24
|
+
style={style}
|
|
25
|
+
>
|
|
26
|
+
{children}
|
|
27
|
+
</div>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type SceneBackdropProps = HTMLAttributes<HTMLDivElement> & {
|
|
32
|
+
state?: SceneState
|
|
33
|
+
style?: CSSProperties
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Full-bleed backdrop slot inside a scene. */
|
|
37
|
+
export function SceneBackdrop({ state, className, style, children, ...rest }: SceneBackdropProps) {
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
{...rest}
|
|
41
|
+
{...sceneAttrs('backdrop', state)}
|
|
42
|
+
className={className}
|
|
43
|
+
style={{ position: 'absolute', inset: 0, ...style }}
|
|
44
|
+
aria-hidden
|
|
45
|
+
>
|
|
46
|
+
{children}
|
|
47
|
+
</div>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { CSSProperties, HTMLAttributes, ReactNode } from 'react'
|
|
2
|
+
import { sceneAttrs } from '@aeon-ui/geometry'
|
|
3
|
+
import { sceneTransformStyle, type SceneTransform3d } from '@aeon-ui/scene'
|
|
4
|
+
|
|
5
|
+
export type SceneSlotProps = HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
part?: string
|
|
7
|
+
transform?: SceneTransform3d
|
|
8
|
+
origin?: string
|
|
9
|
+
fill?: boolean
|
|
10
|
+
children?: ReactNode
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Mount arbitrary UI (boards, HUD, controls) at a 3D transform — receives pointer events. */
|
|
14
|
+
export function SceneSlot({
|
|
15
|
+
part = 'slot',
|
|
16
|
+
transform,
|
|
17
|
+
origin = '50% 50%',
|
|
18
|
+
fill = false,
|
|
19
|
+
className,
|
|
20
|
+
style,
|
|
21
|
+
children,
|
|
22
|
+
...rest
|
|
23
|
+
}: SceneSlotProps) {
|
|
24
|
+
const merged: CSSProperties = {
|
|
25
|
+
...(transform ? sceneTransformStyle(transform, { origin }) : { transformStyle: 'preserve-3d' }),
|
|
26
|
+
...style,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div
|
|
31
|
+
{...rest}
|
|
32
|
+
{...sceneAttrs(part)}
|
|
33
|
+
className={['aeon-scene-slot', fill ? 'aeon-scene-slot--fill' : '', className]
|
|
34
|
+
.filter(Boolean)
|
|
35
|
+
.join(' ')}
|
|
36
|
+
style={merged}
|
|
37
|
+
>
|
|
38
|
+
{children}
|
|
39
|
+
</div>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CSSProperties, HTMLAttributes, ReactNode } from 'react'
|
|
2
|
+
import { sceneAttrs } from '@aeon-ui/geometry'
|
|
3
|
+
import { sceneStageStyle, type ScenePerspective } from '@aeon-ui/scene'
|
|
4
|
+
|
|
5
|
+
export type SceneStageProps = HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
perspective?: ScenePerspective
|
|
7
|
+
minHeight?: SceneUnit
|
|
8
|
+
children?: ReactNode
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type SceneUnit = number | string
|
|
12
|
+
|
|
13
|
+
export function SceneStage({
|
|
14
|
+
perspective,
|
|
15
|
+
minHeight = 320,
|
|
16
|
+
className,
|
|
17
|
+
style,
|
|
18
|
+
children,
|
|
19
|
+
...rest
|
|
20
|
+
}: SceneStageProps) {
|
|
21
|
+
const merged: CSSProperties = {
|
|
22
|
+
...sceneStageStyle(perspective),
|
|
23
|
+
minHeight: typeof minHeight === 'number' ? `${minHeight}px` : minHeight,
|
|
24
|
+
...style,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
{...rest}
|
|
30
|
+
{...sceneAttrs('stage')}
|
|
31
|
+
className={['aeon-scene-stage', className].filter(Boolean).join(' ')}
|
|
32
|
+
style={merged}
|
|
33
|
+
>
|
|
34
|
+
{children}
|
|
35
|
+
</div>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react'
|
|
2
|
+
import { surfaceClass, type SurfaceMaterial } from '@aeon-ui/surface'
|
|
3
|
+
import { sceneAttrs } from '@aeon-ui/geometry'
|
|
4
|
+
|
|
5
|
+
export type SceneSurfaceProps = HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
material: SurfaceMaterial
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Textured material layer (`@aeon-ui/surface` CSS + scene anatomy). */
|
|
10
|
+
export function SceneSurface({ material, className, children, ...rest }: SceneSurfaceProps) {
|
|
11
|
+
return (
|
|
12
|
+
<div
|
|
13
|
+
{...rest}
|
|
14
|
+
{...sceneAttrs('surface')}
|
|
15
|
+
className={[surfaceClass(material), className].filter(Boolean).join(' ')}
|
|
16
|
+
>
|
|
17
|
+
{children}
|
|
18
|
+
</div>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { barLayout, barScaleTransform, sceneAttrs } from '@aeon-ui/geometry'
|
|
2
|
+
import { useSignalVisualizer, type UseSignalVisualizerOptions } from './use-signal-visualizer.js'
|
|
3
|
+
|
|
4
|
+
export type SignalBarsProps = UseSignalVisualizerOptions & {
|
|
5
|
+
className?: string
|
|
6
|
+
viewWidth?: number
|
|
7
|
+
viewHeight?: number
|
|
8
|
+
fills?: readonly string[]
|
|
9
|
+
label?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** SVG bar visualizer driven by `@aeon-ui/signal` band motion. */
|
|
13
|
+
export function SignalBars({
|
|
14
|
+
className,
|
|
15
|
+
viewWidth = 80,
|
|
16
|
+
viewHeight = 52,
|
|
17
|
+
fills,
|
|
18
|
+
label = 'Audio visualizer',
|
|
19
|
+
barCount = 7,
|
|
20
|
+
...vizOptions
|
|
21
|
+
}: SignalBarsProps) {
|
|
22
|
+
const { scales, brightness, active } = useSignalVisualizer({ barCount, ...vizOptions })
|
|
23
|
+
const bars = barLayout({ count: barCount, viewWidth, viewHeight, fills })
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<svg
|
|
27
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
28
|
+
viewBox={`0 0 ${viewWidth} ${viewHeight}`}
|
|
29
|
+
role="img"
|
|
30
|
+
aria-label={label}
|
|
31
|
+
className={className}
|
|
32
|
+
{...sceneAttrs('visualizer', active ? 'active' : 'idle')}
|
|
33
|
+
style={{ display: 'block', overflow: 'visible' }}
|
|
34
|
+
>
|
|
35
|
+
{bars.map((bar, i) => {
|
|
36
|
+
const scale = scales[i] ?? 1
|
|
37
|
+
const bright = brightness[i] ?? 1
|
|
38
|
+
return (
|
|
39
|
+
<g
|
|
40
|
+
key={i}
|
|
41
|
+
transform={barScaleTransform(bar, scale)}
|
|
42
|
+
style={active ? { filter: `brightness(${bright})` } : undefined}
|
|
43
|
+
>
|
|
44
|
+
<rect
|
|
45
|
+
x={bar.x}
|
|
46
|
+
y={bar.y}
|
|
47
|
+
width={bar.w}
|
|
48
|
+
height={bar.h}
|
|
49
|
+
rx={bar.w / 2}
|
|
50
|
+
fill={bar.fill}
|
|
51
|
+
/>
|
|
52
|
+
</g>
|
|
53
|
+
)
|
|
54
|
+
})}
|
|
55
|
+
</svg>
|
|
56
|
+
)
|
|
57
|
+
}
|