aeon-ui-engine 1.5.1 → 1.9.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/CHANGELOG.md +140 -0
- package/package.json +6 -3
- package/packages/core/dist/index.d.ts +116 -1
- package/packages/core/dist/index.js +202 -1
- package/packages/core/src/anatomy.ts +13 -1
- package/packages/core/src/index.ts +2 -0
- package/packages/core/src/list-window.ts +149 -0
- package/packages/core/src/sound.ts +154 -0
- package/packages/panda/package.json +6 -3
- package/packages/panda/panda.config.ts +12 -0
- package/packages/panda/src/recipes/clipboard.ts +40 -0
- package/packages/panda/src/recipes/composer.ts +4 -3
- package/packages/panda/src/recipes/index.ts +4 -0
- package/packages/panda/src/recipes/prose.ts +110 -0
- package/packages/panda/src/recipes/segment-group.ts +50 -0
- package/packages/panda/src/recipes/textarea.ts +60 -0
- package/packages/panda/styled-system/css/conditions.d.ts +7 -0
- package/packages/panda/styled-system/css/conditions.js +32 -0
- package/packages/panda/styled-system/css/css.d.ts +6 -6
- package/packages/panda/styled-system/css/css.js +63 -0
- package/packages/panda/styled-system/css/cva.d.ts +2 -3
- package/packages/panda/styled-system/css/cva.js +51 -0
- package/packages/panda/styled-system/css/cx.d.ts +5 -4
- package/packages/panda/styled-system/css/{cx.mjs → cx.js} +5 -4
- package/packages/panda/styled-system/css/first-that-works.d.ts +22 -0
- package/packages/panda/styled-system/css/first-that-works.js +1 -0
- package/packages/panda/styled-system/css/index.d.ts +6 -3
- package/packages/panda/styled-system/css/index.js +8 -0
- package/packages/panda/styled-system/css/keyframes.d.ts +5 -0
- package/packages/panda/styled-system/css/keyframes.js +8 -0
- package/packages/panda/styled-system/css/position-try.d.ts +5 -0
- package/packages/panda/styled-system/css/position-try.js +11 -0
- package/packages/panda/styled-system/css/sva.d.ts +1 -2
- package/packages/panda/styled-system/css/sva.js +49 -0
- package/packages/panda/styled-system/css/view-transition.d.ts +7 -0
- package/packages/panda/styled-system/css/view-transition.js +18 -0
- package/packages/panda/styled-system/helpers.d.ts +67 -0
- package/packages/panda/styled-system/helpers.js +624 -0
- package/packages/panda/styled-system/jsx/aspect-ratio.d.ts +3 -6
- package/packages/panda/styled-system/jsx/aspect-ratio.js +11 -0
- package/packages/panda/styled-system/jsx/bleed.d.ts +4 -7
- package/packages/panda/styled-system/jsx/bleed.js +11 -0
- package/packages/panda/styled-system/jsx/box.d.ts +4 -7
- package/packages/panda/styled-system/jsx/box.js +11 -0
- package/packages/panda/styled-system/jsx/center.d.ts +4 -7
- package/packages/panda/styled-system/jsx/center.js +11 -0
- package/packages/panda/styled-system/jsx/circle.d.ts +4 -7
- package/packages/panda/styled-system/jsx/circle.js +11 -0
- package/packages/panda/styled-system/jsx/container.d.ts +4 -7
- package/packages/panda/styled-system/jsx/container.js +11 -0
- package/packages/panda/styled-system/jsx/cq.d.ts +4 -7
- package/packages/panda/styled-system/jsx/cq.js +11 -0
- package/packages/panda/styled-system/jsx/create-recipe-context.d.ts +31 -0
- package/packages/panda/styled-system/jsx/create-recipe-context.js +38 -0
- package/packages/panda/styled-system/jsx/create-slot-recipe-context.d.ts +49 -0
- package/packages/panda/styled-system/jsx/create-slot-recipe-context.js +124 -0
- package/packages/panda/styled-system/jsx/divider.d.ts +4 -7
- package/packages/panda/styled-system/jsx/divider.js +11 -0
- package/packages/panda/styled-system/jsx/factory.d.ts +2 -2
- package/packages/panda/styled-system/jsx/factory.js +91 -0
- package/packages/panda/styled-system/jsx/flex.d.ts +4 -7
- package/packages/panda/styled-system/jsx/flex.js +11 -0
- package/packages/panda/styled-system/jsx/float.d.ts +4 -7
- package/packages/panda/styled-system/jsx/float.js +11 -0
- package/packages/panda/styled-system/jsx/grid-item.d.ts +4 -7
- package/packages/panda/styled-system/jsx/grid-item.js +11 -0
- package/packages/panda/styled-system/jsx/grid.d.ts +4 -7
- package/packages/panda/styled-system/jsx/grid.js +11 -0
- package/packages/panda/styled-system/jsx/helper.d.ts +34 -0
- package/packages/panda/styled-system/jsx/helper.js +92 -0
- package/packages/panda/styled-system/jsx/hstack.d.ts +4 -7
- package/packages/panda/styled-system/jsx/hstack.js +11 -0
- package/packages/panda/styled-system/jsx/index.d.ts +17 -17
- package/packages/panda/styled-system/jsx/index.js +24 -0
- package/packages/panda/styled-system/jsx/is-valid-prop.d.ts +5 -10
- package/packages/panda/styled-system/jsx/is-valid-prop.js +12 -0
- package/packages/panda/styled-system/jsx/link-overlay.d.ts +4 -7
- package/packages/panda/styled-system/jsx/link-overlay.js +11 -0
- package/packages/panda/styled-system/jsx/spacer.d.ts +4 -7
- package/packages/panda/styled-system/jsx/spacer.js +11 -0
- package/packages/panda/styled-system/jsx/square.d.ts +4 -7
- package/packages/panda/styled-system/jsx/square.js +11 -0
- package/packages/panda/styled-system/jsx/stack.d.ts +4 -7
- package/packages/panda/styled-system/jsx/stack.js +11 -0
- package/packages/panda/styled-system/jsx/visually-hidden.d.ts +4 -7
- package/packages/panda/styled-system/jsx/visually-hidden.js +11 -0
- package/packages/panda/styled-system/jsx/vstack.d.ts +4 -7
- package/packages/panda/styled-system/jsx/vstack.js +11 -0
- package/packages/panda/styled-system/jsx/wrap.d.ts +4 -7
- package/packages/panda/styled-system/jsx/wrap.js +11 -0
- package/packages/panda/styled-system/patterns/aspect-ratio.d.ts +8 -9
- package/packages/panda/styled-system/patterns/aspect-ratio.js +37 -0
- package/packages/panda/styled-system/patterns/bleed.d.ts +9 -10
- package/packages/panda/styled-system/patterns/bleed.js +30 -0
- package/packages/panda/styled-system/patterns/box.d.ts +8 -11
- package/packages/panda/styled-system/patterns/box.js +16 -0
- package/packages/panda/styled-system/patterns/center.d.ts +8 -9
- package/packages/panda/styled-system/patterns/center.js +22 -0
- package/packages/panda/styled-system/patterns/circle.d.ts +8 -9
- package/packages/panda/styled-system/patterns/circle.js +26 -0
- package/packages/panda/styled-system/patterns/container.d.ts +8 -11
- package/packages/panda/styled-system/patterns/container.js +26 -0
- package/packages/panda/styled-system/patterns/cq.d.ts +10 -10
- package/packages/panda/styled-system/patterns/cq.js +24 -0
- package/packages/panda/styled-system/patterns/divider.d.ts +11 -11
- package/packages/panda/styled-system/patterns/divider.js +31 -0
- package/packages/panda/styled-system/patterns/flex.d.ts +14 -15
- package/packages/panda/styled-system/patterns/flex.js +27 -0
- package/packages/panda/styled-system/patterns/float.d.ts +12 -12
- package/packages/panda/styled-system/patterns/float.js +84 -0
- package/packages/panda/styled-system/patterns/grid-item.d.ts +13 -14
- package/packages/panda/styled-system/patterns/grid-item.js +26 -0
- package/packages/panda/styled-system/patterns/grid.d.ts +13 -13
- package/packages/panda/styled-system/patterns/grid.js +30 -0
- package/packages/panda/styled-system/patterns/hstack.d.ts +9 -10
- package/packages/panda/styled-system/patterns/hstack.js +27 -0
- package/packages/panda/styled-system/patterns/index.d.ts +14 -15
- package/packages/panda/styled-system/patterns/index.js +20 -0
- package/packages/panda/styled-system/patterns/link-overlay.d.ts +8 -11
- package/packages/panda/styled-system/patterns/link-overlay.js +25 -0
- package/packages/panda/styled-system/patterns/runtime.js +25 -0
- package/packages/panda/styled-system/patterns/spacer.d.ts +9 -9
- package/packages/panda/styled-system/patterns/spacer.js +26 -0
- package/packages/panda/styled-system/patterns/square.d.ts +8 -9
- package/packages/panda/styled-system/patterns/square.js +25 -0
- package/packages/panda/styled-system/patterns/stack.d.ts +11 -12
- package/packages/panda/styled-system/patterns/stack.js +30 -0
- package/packages/panda/styled-system/patterns/visually-hidden.d.ts +8 -11
- package/packages/panda/styled-system/patterns/visually-hidden.js +19 -0
- package/packages/panda/styled-system/patterns/vstack.d.ts +9 -10
- package/packages/panda/styled-system/patterns/vstack.js +27 -0
- package/packages/panda/styled-system/patterns/wrap.d.ts +12 -13
- package/packages/panda/styled-system/patterns/wrap.js +26 -0
- package/packages/panda/styled-system/recipes/aeon-accordion.d.ts +9 -26
- package/packages/panda/styled-system/recipes/aeon-accordion.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-app-shell.d.ts +10 -26
- package/packages/panda/styled-system/recipes/aeon-app-shell.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-async.d.ts +9 -26
- package/packages/panda/styled-system/recipes/aeon-async.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-avatar.d.ts +10 -28
- package/packages/panda/styled-system/recipes/aeon-avatar.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-badge.d.ts +8 -26
- package/packages/panda/styled-system/recipes/aeon-badge.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-bar.d.ts +13 -32
- package/packages/panda/styled-system/recipes/aeon-bar.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-button-group.d.ts +10 -33
- package/packages/panda/styled-system/recipes/aeon-button-group.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-button.d.ts +10 -33
- package/packages/panda/styled-system/recipes/aeon-button.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-checkbox.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-checkbox.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-clipboard.d.ts +16 -0
- package/packages/panda/styled-system/recipes/aeon-clipboard.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-combobox.d.ts +9 -26
- package/packages/panda/styled-system/recipes/aeon-combobox.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-composer.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-composer.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-content.d.ts +10 -26
- package/packages/panda/styled-system/recipes/aeon-content.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-conversation.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-conversation.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-dialog.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-dialog.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-entry.d.ts +11 -30
- package/packages/panda/styled-system/recipes/aeon-entry.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-field.d.ts +9 -26
- package/packages/panda/styled-system/recipes/aeon-field.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-file-upload.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-file-upload.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-identity.d.ts +10 -28
- package/packages/panda/styled-system/recipes/aeon-identity.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-list-row.d.ts +9 -26
- package/packages/panda/styled-system/recipes/aeon-list-row.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-menu.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-menu.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-metric-strip.d.ts +10 -28
- package/packages/panda/styled-system/recipes/aeon-metric-strip.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-nav.d.ts +11 -30
- package/packages/panda/styled-system/recipes/aeon-nav.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-panel.d.ts +10 -26
- package/packages/panda/styled-system/recipes/aeon-panel.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-pin-input.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-pin-input.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-popover.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-popover.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-profile-header.d.ts +10 -28
- package/packages/panda/styled-system/recipes/aeon-profile-header.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-progress.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-progress.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-prose.d.ts +16 -0
- package/packages/panda/styled-system/recipes/aeon-prose.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-radio-group.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-radio-group.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-range-slider.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-range-slider.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-scroll.d.ts +12 -36
- package/packages/panda/styled-system/recipes/aeon-scroll.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-segment-group.d.ts +18 -0
- package/packages/panda/styled-system/recipes/aeon-segment-group.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-select.d.ts +9 -26
- package/packages/panda/styled-system/recipes/aeon-select.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-separator.d.ts +10 -26
- package/packages/panda/styled-system/recipes/aeon-separator.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-slider.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-slider.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-switch.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-switch.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-tabs.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-tabs.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-textarea.d.ts +18 -0
- package/packages/panda/styled-system/recipes/aeon-textarea.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-theme-switcher.d.ts +10 -26
- package/packages/panda/styled-system/recipes/aeon-theme-switcher.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-thread.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-thread.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-toast.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-toast.js +5 -0
- package/packages/panda/styled-system/recipes/aeon-tooltip.d.ts +9 -24
- package/packages/panda/styled-system/recipes/aeon-tooltip.js +5 -0
- package/packages/panda/styled-system/recipes/index.d.ts +31 -28
- package/packages/panda/styled-system/recipes/index.js +43 -0
- package/packages/panda/styled-system/recipes/runtime.js +133 -0
- package/packages/panda/styled-system/styles.css +1899 -2110
- package/packages/panda/styled-system/tokens/index.d.ts +4 -5
- package/packages/panda/styled-system/tokens/index.js +18 -0
- package/packages/panda/styled-system/types/index.d.ts +3 -6
- package/packages/panda/styled-system/types/jsx.d.ts +36 -27
- package/packages/panda/styled-system/types/pattern.d.ts +18 -70
- package/packages/panda/styled-system/types/recipe.d.ts +50 -154
- package/packages/panda/styled-system/types/system.d.ts +1826 -0
- package/packages/panda/styled-system/types/tokens.d.ts +65 -0
- package/packages/panda/tsconfig.json +3 -1
- package/packages/primitives/dist/chunk-5BNAV4S2.js +258 -0
- package/packages/primitives/dist/chunk-HYHCIMHC.js +45 -0
- package/packages/primitives/dist/index.d.ts +2 -0
- package/packages/primitives/dist/index.js +30 -12
- package/packages/primitives/dist/machines/app-nav.d.ts +3 -3
- package/packages/primitives/dist/machines/cache.d.ts +223 -0
- package/packages/primitives/dist/machines/cache.js +14 -0
- package/packages/primitives/dist/machines/clipboard.d.ts +46 -0
- package/packages/primitives/dist/machines/clipboard.js +8 -0
- package/packages/primitives/dist/machines/tabs.d.ts +2 -2
- package/packages/primitives/src/index.ts +2 -0
- package/packages/primitives/src/machines/cache.ts +395 -0
- package/packages/primitives/src/machines/clipboard.ts +56 -0
- package/packages/react/dist/index.d.ts +134 -13
- package/packages/react/dist/index.js +1429 -1016
- package/packages/react/src/clipboard/index.tsx +117 -0
- package/packages/react/src/composer/index.tsx +14 -5
- package/packages/react/src/dialog/index.tsx +11 -3
- package/packages/react/src/floating/FloatingPositioner.tsx +11 -1
- package/packages/react/src/index.ts +4 -0
- package/packages/react/src/menu/index.tsx +8 -3
- package/packages/react/src/popover/index.tsx +25 -4
- package/packages/react/src/prose/index.tsx +11 -0
- package/packages/react/src/radio-group/index.tsx +2 -1
- package/packages/react/src/scroll/index.tsx +1 -0
- package/packages/react/src/scroll/use-windowed-range.ts +118 -0
- package/packages/react/src/segment-group/index.tsx +171 -0
- package/packages/react/src/select/index.tsx +11 -2
- package/packages/react/src/slider/index.tsx +13 -6
- package/packages/react/src/tabs/index.tsx +19 -7
- package/packages/react/src/textarea/index.tsx +75 -0
- package/packages/react/src/utils/assign-ref.ts +7 -0
- package/packages/schemas/dist/index.d.ts +8 -0
- package/packages/schemas/dist/index.js +62 -1
- package/packages/schemas/json/catalog.json +493 -0
- package/packages/schemas/json/clipboard.json +136 -0
- package/packages/schemas/json/prose.json +103 -0
- package/packages/schemas/json/segmentGroup.json +131 -0
- package/packages/schemas/json/textarea.json +119 -0
- package/packages/schemas/prompts/statecharts.md +1 -1
- package/packages/schemas/registry/catalog.json +34 -0
- package/packages/schemas/registry/components/clipboard.json +136 -0
- package/packages/schemas/registry/components/prose.json +103 -0
- package/packages/schemas/registry/components/segmentGroup.json +131 -0
- package/packages/schemas/registry/components/textarea.json +119 -0
- package/packages/schemas/registry/machines/clipboard.json +110 -0
- package/packages/schemas/registry/machines/slider.json +18 -1
- package/packages/schemas/scripts/emit.ts +2 -0
- package/packages/schemas/src/components.ts +63 -0
- package/packages/tree/README.md +29 -0
- package/packages/tree/dist/index.d.ts +97 -0
- package/packages/tree/dist/index.js +107 -0
- package/packages/tree/package.json +42 -0
- package/packages/tree/src/exclusive-action.ts +104 -0
- package/packages/tree/src/index.ts +7 -0
- package/packages/tree/src/interpret.tsx +45 -0
- package/packages/tree/src/totality.ts +20 -0
- package/packages/tree/src/widget.ts +31 -0
- package/packages/tree/tsconfig.json +8 -0
- package/packages/tree/vitest.config.ts +8 -0
- package/packages/ui/dist/index.d.ts +27 -3
- package/packages/ui/dist/index.js +232 -165
- package/packages/ui/src/clipboard.tsx +51 -0
- package/packages/ui/src/index.ts +4 -0
- package/packages/ui/src/prose.tsx +15 -0
- package/packages/ui/src/segment-group.tsx +28 -0
- package/packages/ui/src/textarea.tsx +17 -0
- package/scripts/vite-aliases.mjs +5 -2
- package/packages/cli/node_modules/.bin/esbuild +0 -21
- package/packages/cli/node_modules/.bin/jiti +0 -21
- package/packages/cli/node_modules/.bin/tsc +0 -21
- package/packages/cli/node_modules/.bin/tsserver +0 -21
- package/packages/cli/node_modules/.bin/tsup +0 -21
- package/packages/cli/node_modules/.bin/tsup-node +0 -21
- package/packages/cli/node_modules/.bin/tsx +0 -21
- package/packages/cli/node_modules/.bin/vite +0 -21
- package/packages/cli/node_modules/.bin/vitest +0 -21
- package/packages/core/node_modules/.bin/esbuild +0 -21
- package/packages/core/node_modules/.bin/jiti +0 -21
- package/packages/core/node_modules/.bin/tsc +0 -21
- package/packages/core/node_modules/.bin/tsserver +0 -21
- package/packages/core/node_modules/.bin/tsup +0 -21
- package/packages/core/node_modules/.bin/tsup-node +0 -21
- package/packages/core/node_modules/.bin/tsx +0 -21
- package/packages/core/node_modules/.bin/vite +0 -21
- package/packages/core/node_modules/.bin/vitest +0 -21
- package/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/core/src/identicon.test.ts +0 -39
- package/packages/core/src/machine.test.ts +0 -79
- package/packages/core/src/theme.test.ts +0 -14
- package/packages/geometry/node_modules/.bin/esbuild +0 -21
- package/packages/geometry/node_modules/.bin/jiti +0 -21
- package/packages/geometry/node_modules/.bin/tsc +0 -21
- package/packages/geometry/node_modules/.bin/tsserver +0 -21
- package/packages/geometry/node_modules/.bin/tsup +0 -21
- package/packages/geometry/node_modules/.bin/tsup-node +0 -21
- package/packages/geometry/node_modules/.bin/tsx +0 -21
- package/packages/panda/styled-system/css/conditions.mjs +0 -36
- package/packages/panda/styled-system/css/css.mjs +0 -45
- package/packages/panda/styled-system/css/cva.mjs +0 -87
- package/packages/panda/styled-system/css/index.mjs +0 -4
- package/packages/panda/styled-system/css/sva.mjs +0 -46
- package/packages/panda/styled-system/helpers.mjs +0 -328
- package/packages/panda/styled-system/jsx/aspect-ratio.mjs +0 -14
- package/packages/panda/styled-system/jsx/bleed.mjs +0 -14
- package/packages/panda/styled-system/jsx/box.mjs +0 -14
- package/packages/panda/styled-system/jsx/center.mjs +0 -14
- package/packages/panda/styled-system/jsx/circle.mjs +0 -14
- package/packages/panda/styled-system/jsx/container.mjs +0 -14
- package/packages/panda/styled-system/jsx/cq.mjs +0 -14
- package/packages/panda/styled-system/jsx/create-style-context.d.ts +0 -54
- package/packages/panda/styled-system/jsx/create-style-context.mjs +0 -121
- package/packages/panda/styled-system/jsx/divider.mjs +0 -14
- package/packages/panda/styled-system/jsx/factory-helper.mjs +0 -22
- package/packages/panda/styled-system/jsx/factory.mjs +0 -89
- package/packages/panda/styled-system/jsx/flex.mjs +0 -14
- package/packages/panda/styled-system/jsx/float.mjs +0 -14
- package/packages/panda/styled-system/jsx/grid-item.mjs +0 -14
- package/packages/panda/styled-system/jsx/grid.mjs +0 -14
- package/packages/panda/styled-system/jsx/hstack.mjs +0 -14
- package/packages/panda/styled-system/jsx/index.mjs +0 -23
- package/packages/panda/styled-system/jsx/is-valid-prop.mjs +0 -17
- package/packages/panda/styled-system/jsx/link-overlay.mjs +0 -14
- package/packages/panda/styled-system/jsx/spacer.mjs +0 -14
- package/packages/panda/styled-system/jsx/square.mjs +0 -14
- package/packages/panda/styled-system/jsx/stack.mjs +0 -14
- package/packages/panda/styled-system/jsx/visually-hidden.mjs +0 -14
- package/packages/panda/styled-system/jsx/vstack.mjs +0 -14
- package/packages/panda/styled-system/jsx/wrap.mjs +0 -14
- package/packages/panda/styled-system/patterns/aspect-ratio.mjs +0 -38
- package/packages/panda/styled-system/patterns/bleed.mjs +0 -24
- package/packages/panda/styled-system/patterns/box.mjs +0 -15
- package/packages/panda/styled-system/patterns/center.mjs +0 -21
- package/packages/panda/styled-system/patterns/circle.mjs +0 -25
- package/packages/panda/styled-system/patterns/container.mjs +0 -21
- package/packages/panda/styled-system/patterns/cq.mjs +0 -21
- package/packages/panda/styled-system/patterns/divider.mjs +0 -25
- package/packages/panda/styled-system/patterns/flex.mjs +0 -26
- package/packages/panda/styled-system/patterns/float.mjs +0 -52
- package/packages/panda/styled-system/patterns/grid-item.mjs +0 -25
- package/packages/panda/styled-system/patterns/grid.mjs +0 -27
- package/packages/panda/styled-system/patterns/hstack.mjs +0 -24
- package/packages/panda/styled-system/patterns/index.mjs +0 -20
- package/packages/panda/styled-system/patterns/link-overlay.mjs +0 -24
- package/packages/panda/styled-system/patterns/spacer.mjs +0 -25
- package/packages/panda/styled-system/patterns/square.mjs +0 -24
- package/packages/panda/styled-system/patterns/stack.mjs +0 -24
- package/packages/panda/styled-system/patterns/visually-hidden.mjs +0 -18
- package/packages/panda/styled-system/patterns/vstack.mjs +0 -24
- package/packages/panda/styled-system/patterns/wrap.mjs +0 -25
- package/packages/panda/styled-system/recipes/aeon-accordion.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-app-shell.mjs +0 -70
- package/packages/panda/styled-system/recipes/aeon-async.mjs +0 -57
- package/packages/panda/styled-system/recipes/aeon-avatar.mjs +0 -57
- package/packages/panda/styled-system/recipes/aeon-badge.mjs +0 -32
- package/packages/panda/styled-system/recipes/aeon-bar.mjs +0 -77
- package/packages/panda/styled-system/recipes/aeon-button-group.mjs +0 -37
- package/packages/panda/styled-system/recipes/aeon-button.mjs +0 -39
- package/packages/panda/styled-system/recipes/aeon-checkbox.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-combobox.mjs +0 -53
- package/packages/panda/styled-system/recipes/aeon-composer.mjs +0 -57
- package/packages/panda/styled-system/recipes/aeon-content.mjs +0 -70
- package/packages/panda/styled-system/recipes/aeon-conversation.mjs +0 -61
- package/packages/panda/styled-system/recipes/aeon-dialog.mjs +0 -61
- package/packages/panda/styled-system/recipes/aeon-entry.mjs +0 -100
- package/packages/panda/styled-system/recipes/aeon-field.mjs +0 -53
- package/packages/panda/styled-system/recipes/aeon-file-upload.mjs +0 -61
- package/packages/panda/styled-system/recipes/aeon-identity.mjs +0 -63
- package/packages/panda/styled-system/recipes/aeon-list-row.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-menu.mjs +0 -53
- package/packages/panda/styled-system/recipes/aeon-metric-strip.mjs +0 -54
- package/packages/panda/styled-system/recipes/aeon-nav.mjs +0 -69
- package/packages/panda/styled-system/recipes/aeon-panel.mjs +0 -58
- package/packages/panda/styled-system/recipes/aeon-pin-input.mjs +0 -37
- package/packages/panda/styled-system/recipes/aeon-popover.mjs +0 -53
- package/packages/panda/styled-system/recipes/aeon-profile-header.mjs +0 -62
- package/packages/panda/styled-system/recipes/aeon-progress.mjs +0 -45
- package/packages/panda/styled-system/recipes/aeon-radio-group.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-range-slider.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-scroll.mjs +0 -64
- package/packages/panda/styled-system/recipes/aeon-select.mjs +0 -57
- package/packages/panda/styled-system/recipes/aeon-separator.mjs +0 -42
- package/packages/panda/styled-system/recipes/aeon-slider.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-switch.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-tabs.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-theme-switcher.mjs +0 -59
- package/packages/panda/styled-system/recipes/aeon-thread.mjs +0 -73
- package/packages/panda/styled-system/recipes/aeon-toast.mjs +0 -49
- package/packages/panda/styled-system/recipes/aeon-tooltip.mjs +0 -49
- package/packages/panda/styled-system/recipes/create-recipe.mjs +0 -82
- package/packages/panda/styled-system/recipes/index.mjs +0 -39
- package/packages/panda/styled-system/tokens/index.mjs +0 -2224
- package/packages/panda/styled-system/tokens/tokens.d.ts +0 -60
- package/packages/panda/styled-system/types/composition.d.ts +0 -227
- package/packages/panda/styled-system/types/conditions.d.ts +0 -346
- package/packages/panda/styled-system/types/csstype.d.ts +0 -22570
- package/packages/panda/styled-system/types/global.d.ts +0 -20
- package/packages/panda/styled-system/types/parts.d.ts +0 -8
- package/packages/panda/styled-system/types/prop-type.d.ts +0 -250
- package/packages/panda/styled-system/types/selectors.d.ts +0 -59
- package/packages/panda/styled-system/types/static-css.d.ts +0 -56
- package/packages/panda/styled-system/types/style-props.d.ts +0 -8089
- package/packages/panda/styled-system/types/system-types.d.ts +0 -151
- package/packages/primitives/node_modules/.bin/esbuild +0 -21
- package/packages/primitives/node_modules/.bin/jiti +0 -21
- package/packages/primitives/node_modules/.bin/tsc +0 -21
- package/packages/primitives/node_modules/.bin/tsserver +0 -21
- package/packages/primitives/node_modules/.bin/tsup +0 -21
- package/packages/primitives/node_modules/.bin/tsup-node +0 -21
- package/packages/primitives/node_modules/.bin/tsx +0 -21
- package/packages/primitives/node_modules/.bin/vite +0 -21
- package/packages/primitives/node_modules/.bin/vitest +0 -21
- package/packages/primitives/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/primitives/src/__tests__/app-nav.test.ts +0 -30
- package/packages/primitives/src/__tests__/file-upload.test.ts +0 -25
- package/packages/primitives/src/__tests__/floating-surface.test.ts +0 -29
- package/packages/primitives/src/__tests__/range-slider.test.ts +0 -39
- package/packages/react/node_modules/.bin/esbuild +0 -21
- package/packages/react/node_modules/.bin/jiti +0 -21
- package/packages/react/node_modules/.bin/tsc +0 -21
- package/packages/react/node_modules/.bin/tsserver +0 -21
- package/packages/react/node_modules/.bin/tsup +0 -21
- package/packages/react/node_modules/.bin/tsup-node +0 -21
- package/packages/react/node_modules/.bin/tsx +0 -21
- package/packages/react/node_modules/.bin/vite +0 -21
- package/packages/react/node_modules/.bin/vitest +0 -21
- package/packages/react/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/react/src/avatar/avatar.test.tsx +0 -27
- package/packages/react/src/dialog/dialog.test.tsx +0 -50
- package/packages/react/src/select/select.test.tsx +0 -81
- package/packages/react/src/toast/toast.test.tsx +0 -40
- package/packages/react/src/tooltip/tooltip.test.tsx +0 -122
- package/packages/react-scene/node_modules/.bin/jiti +0 -21
- package/packages/react-scene/node_modules/.bin/tsc +0 -21
- package/packages/react-scene/node_modules/.bin/tsserver +0 -21
- package/packages/react-scene/node_modules/.bin/tsup +0 -21
- package/packages/react-scene/node_modules/.bin/tsup-node +0 -21
- package/packages/react-scene/node_modules/.bin/tsx +0 -21
- package/packages/scene/node_modules/.bin/jiti +0 -21
- package/packages/scene/node_modules/.bin/tsc +0 -21
- package/packages/scene/node_modules/.bin/tsserver +0 -21
- package/packages/scene/node_modules/.bin/tsup +0 -21
- package/packages/scene/node_modules/.bin/tsup-node +0 -21
- package/packages/scene/node_modules/.bin/tsx +0 -21
- package/packages/schemas/node_modules/.bin/esbuild +0 -21
- package/packages/schemas/node_modules/.bin/jiti +0 -21
- package/packages/schemas/node_modules/.bin/tsc +0 -21
- package/packages/schemas/node_modules/.bin/tsserver +0 -21
- package/packages/schemas/node_modules/.bin/tsup +0 -21
- package/packages/schemas/node_modules/.bin/tsup-node +0 -21
- package/packages/schemas/node_modules/.bin/tsx +0 -21
- package/packages/schemas/node_modules/.bin/vite +0 -21
- package/packages/schemas/node_modules/.bin/vitest +0 -21
- package/packages/schemas/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/schemas/src/aeon-to-schema.test.ts +0 -70
- package/packages/schemas/src/index.test.ts +0 -108
- package/packages/signal/node_modules/.bin/jiti +0 -21
- package/packages/signal/node_modules/.bin/tsc +0 -21
- package/packages/signal/node_modules/.bin/tsserver +0 -21
- package/packages/signal/node_modules/.bin/tsup +0 -21
- package/packages/signal/node_modules/.bin/tsup-node +0 -21
- package/packages/signal/node_modules/.bin/tsx +0 -21
- package/packages/site/node_modules/.bin/jiti +0 -21
- package/packages/site/node_modules/.bin/tsc +0 -21
- package/packages/site/node_modules/.bin/tsserver +0 -21
- package/packages/site/node_modules/.bin/tsup +0 -21
- package/packages/site/node_modules/.bin/tsup-node +0 -21
- package/packages/site/node_modules/.bin/tsx +0 -21
- package/packages/solid/node_modules/.bin/jiti +0 -21
- package/packages/solid/node_modules/.bin/tsc +0 -21
- package/packages/solid/node_modules/.bin/tsserver +0 -21
- package/packages/solid/node_modules/.bin/tsup +0 -21
- package/packages/solid/node_modules/.bin/tsup-node +0 -21
- package/packages/solid/node_modules/.bin/tsx +0 -21
- package/packages/surface/node_modules/.bin/jiti +0 -21
- package/packages/surface/node_modules/.bin/tsc +0 -21
- package/packages/surface/node_modules/.bin/tsserver +0 -21
- package/packages/surface/node_modules/.bin/tsup +0 -21
- package/packages/surface/node_modules/.bin/tsup-node +0 -21
- package/packages/surface/node_modules/.bin/tsx +0 -21
- package/packages/svelte/node_modules/.bin/acorn +0 -21
- package/packages/svelte/node_modules/.bin/esbuild +0 -21
- package/packages/svelte/node_modules/.bin/jiti +0 -21
- package/packages/svelte/node_modules/.bin/svelte-check +0 -21
- package/packages/svelte/node_modules/.bin/tsc +0 -21
- package/packages/svelte/node_modules/.bin/tsserver +0 -21
- package/packages/svelte/node_modules/.bin/tsup +0 -21
- package/packages/svelte/node_modules/.bin/tsup-node +0 -21
- package/packages/svelte/node_modules/.bin/tsx +0 -21
- package/packages/svelte/node_modules/.bin/vite +0 -21
- package/packages/ui/node_modules/.bin/jiti +0 -21
- package/packages/ui/node_modules/.bin/tsc +0 -21
- package/packages/ui/node_modules/.bin/tsserver +0 -21
- package/packages/ui/node_modules/.bin/tsup +0 -21
- package/packages/ui/node_modules/.bin/tsup-node +0 -21
- package/packages/ui/node_modules/.bin/tsx +0 -21
- package/packages/vue/node_modules/.bin/jiti +0 -21
- package/packages/vue/node_modules/.bin/tsc +0 -21
- package/packages/vue/node_modules/.bin/tsserver +0 -21
- package/packages/vue/node_modules/.bin/tsup +0 -21
- package/packages/vue/node_modules/.bin/tsup-node +0 -21
- package/packages/vue/node_modules/.bin/tsx +0 -21
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Windowed slice of a long list or grid: which items to mount and how much
|
|
3
|
+
* space stands in for the rest. Geometry, not lifecycle, so like Scroll it is
|
|
4
|
+
* a pure function over measurements, never a machine.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export interface ListWindow {
|
|
8
|
+
/** First mounted item index. */
|
|
9
|
+
start: number
|
|
10
|
+
/** One past the last mounted item index. */
|
|
11
|
+
end: number
|
|
12
|
+
/** Pixels standing in for the rows above the window. */
|
|
13
|
+
padStart: number
|
|
14
|
+
/** Pixels standing in for the rows below the window. */
|
|
15
|
+
padEnd: number
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** The direction a list scrolls: rows down a column, or items along a strip. */
|
|
19
|
+
export type ListWindowAxis = 'y' | 'x'
|
|
20
|
+
|
|
21
|
+
export interface ListWindowInput {
|
|
22
|
+
total: number
|
|
23
|
+
/** Row pitch in pixels along the scroll axis, gap included. */
|
|
24
|
+
rowExtent: number
|
|
25
|
+
/** Items per row; 1 for a list. */
|
|
26
|
+
columns?: number
|
|
27
|
+
/** Rows mounted beyond each edge of the viewport. */
|
|
28
|
+
overscan?: number
|
|
29
|
+
/** How far the list's content has moved past the start of its viewport. */
|
|
30
|
+
scrolledPast: number
|
|
31
|
+
/** Viewport length along the scroll axis. */
|
|
32
|
+
viewportHeight: number
|
|
33
|
+
/** Below this many items the whole list mounts. */
|
|
34
|
+
minItems?: number
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Below this, windowing costs more than it saves and a mis-measured row would
|
|
39
|
+
* visibly shift a short list.
|
|
40
|
+
*/
|
|
41
|
+
export const LIST_WINDOW_MIN_ITEMS = 60
|
|
42
|
+
|
|
43
|
+
export function fullListWindow(total: number): ListWindow {
|
|
44
|
+
return { start: 0, end: Math.max(0, total), padStart: 0, padEnd: 0 }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function sameListWindow(a: ListWindow, b: ListWindow): boolean {
|
|
48
|
+
return a.start === b.start && a.end === b.end && a.padStart === b.padStart && a.padEnd === b.padEnd
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function computeListWindow(input: ListWindowInput): ListWindow {
|
|
52
|
+
const total = Math.max(0, Math.floor(input.total))
|
|
53
|
+
const minItems = input.minItems ?? LIST_WINDOW_MIN_ITEMS
|
|
54
|
+
const rowExtent = input.rowExtent
|
|
55
|
+
if (total < minItems || !(rowExtent > 0)) return fullListWindow(total)
|
|
56
|
+
const columns = Math.max(1, Math.floor(input.columns ?? 1))
|
|
57
|
+
const overscan = Math.max(0, Math.floor(input.overscan ?? 8))
|
|
58
|
+
const rows = Math.ceil(total / columns)
|
|
59
|
+
const firstRow = Math.max(0, Math.floor(Math.max(0, input.scrolledPast) / rowExtent) - overscan)
|
|
60
|
+
const visibleRows = Math.ceil(Math.max(0, input.viewportHeight) / rowExtent) + overscan * 2
|
|
61
|
+
const startRow = Math.min(firstRow, Math.max(0, rows - visibleRows))
|
|
62
|
+
const endRow = Math.min(rows, startRow + visibleRows)
|
|
63
|
+
return {
|
|
64
|
+
start: startRow * columns,
|
|
65
|
+
end: Math.min(total, endRow * columns),
|
|
66
|
+
padStart: startRow * rowExtent,
|
|
67
|
+
padEnd: Math.max(0, (rows - endRow) * rowExtent),
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Attribute that marks a spacer, so row measuring skips it. */
|
|
72
|
+
export const LIST_WINDOW_PAD_ATTR = 'data-aeon-window-pad'
|
|
73
|
+
|
|
74
|
+
export function listWindowPadAttrs(edge: 'start' | 'end'): Record<string, string | boolean> {
|
|
75
|
+
return { [LIST_WINDOW_PAD_ATTR]: edge, 'aria-hidden': true }
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** The element that actually scrolls a list: the nearest ancestor overflowing on the axis, else the window. */
|
|
79
|
+
export function resolveScrollRoot(el: HTMLElement | null, axis: ListWindowAxis = 'y'): HTMLElement | Window {
|
|
80
|
+
let node: HTMLElement | null = el
|
|
81
|
+
while (node) {
|
|
82
|
+
const style = getComputedStyle(node)
|
|
83
|
+
const overflow = axis === 'x' ? style.overflowX : style.overflowY
|
|
84
|
+
if (overflow === 'auto' || overflow === 'scroll') return node
|
|
85
|
+
node = node.parentElement
|
|
86
|
+
}
|
|
87
|
+
return window
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function scrollRootHeight(root: HTMLElement | Window): number {
|
|
91
|
+
return root === window ? window.innerHeight : (root as HTMLElement).clientHeight
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Viewport length along the axis. */
|
|
95
|
+
export function scrollRootExtent(root: HTMLElement | Window, axis: ListWindowAxis = 'y'): number {
|
|
96
|
+
if (axis === 'y') return scrollRootHeight(root)
|
|
97
|
+
return root === window ? window.innerWidth : (root as HTMLElement).clientWidth
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function scrollRootTop(root: HTMLElement | Window): number {
|
|
101
|
+
return root === window ? 0 : (root as HTMLElement).getBoundingClientRect().top
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* How far the list's content has moved past the viewport. A list that is its
|
|
106
|
+
* own scroll root reports its scroll offset: subtracting its own edge from
|
|
107
|
+
* itself is always 0, which kept the first rows mounted while the scrollbar
|
|
108
|
+
* travelled through the end spacer.
|
|
109
|
+
*/
|
|
110
|
+
export function scrollRootScrolledPast(
|
|
111
|
+
root: HTMLElement | Window,
|
|
112
|
+
list: HTMLElement,
|
|
113
|
+
axis: ListWindowAxis = 'y',
|
|
114
|
+
): number {
|
|
115
|
+
if (root === list) return axis === 'x' ? list.scrollLeft : list.scrollTop
|
|
116
|
+
if (axis === 'y') return Math.max(0, scrollRootTop(root) - list.getBoundingClientRect().top)
|
|
117
|
+
const rootLeft = root === window ? 0 : (root as HTMLElement).getBoundingClientRect().left
|
|
118
|
+
return Math.max(0, rootLeft - list.getBoundingClientRect().left)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Real column count for a grid; 1 for a list. The hint is only a fallback. */
|
|
122
|
+
export function measureListColumns(style: CSSStyleDeclaration, hint = 1): number {
|
|
123
|
+
if (!style.display.includes('grid')) return 1
|
|
124
|
+
const tracks = style.gridTemplateColumns.trim()
|
|
125
|
+
if (!tracks || tracks === 'none') return Math.max(1, hint)
|
|
126
|
+
return Math.max(1, tracks.split(/\s+/).length)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Row pitch along the axis from a rendered row, so spacers match what is on screen. */
|
|
130
|
+
export function measureListRowExtent(
|
|
131
|
+
list: HTMLElement,
|
|
132
|
+
style: CSSStyleDeclaration,
|
|
133
|
+
hint: number,
|
|
134
|
+
rowSelector?: string,
|
|
135
|
+
axis: ListWindowAxis = 'y',
|
|
136
|
+
): number {
|
|
137
|
+
const row = Array.from(list.children).find(
|
|
138
|
+
(node): node is HTMLElement =>
|
|
139
|
+
node instanceof HTMLElement &&
|
|
140
|
+
!node.hasAttribute(LIST_WINDOW_PAD_ATTR) &&
|
|
141
|
+
(!rowSelector || node.matches(rowSelector)),
|
|
142
|
+
)
|
|
143
|
+
if (!row) return hint
|
|
144
|
+
const rect = row.getBoundingClientRect()
|
|
145
|
+
const size = axis === 'x' ? rect.width : rect.height
|
|
146
|
+
if (size <= 0) return hint
|
|
147
|
+
const gap = Number.parseFloat(axis === 'x' ? style.columnGap : style.rowGap)
|
|
148
|
+
return size + (Number.isFinite(gap) ? gap : 0)
|
|
149
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Short UI sounds synthesized with Web Audio: no files to ship or license.
|
|
3
|
+
* Silent until an app calls `configureSounds({ enabled: true })`.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export type SoundName = 'tap' | 'copy' | 'send' | 'success' | 'attention' | 'error' | 'ready'
|
|
7
|
+
|
|
8
|
+
export interface Tone {
|
|
9
|
+
/** Start frequency in Hz. */
|
|
10
|
+
freq: number
|
|
11
|
+
/** End frequency in Hz; glides from `freq` over the tone. */
|
|
12
|
+
to?: number
|
|
13
|
+
/** Offset from the sound's start, in seconds. */
|
|
14
|
+
at: number
|
|
15
|
+
/** Time to fade out, in seconds. */
|
|
16
|
+
duration: number
|
|
17
|
+
type?: OscillatorType
|
|
18
|
+
/** Peak gain before the master volume, 0 to 1. */
|
|
19
|
+
gain: number
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** A soft mallet note with a faint metal-bar shimmer: quiet inharmonic partials (2.76x, 5.4x) over the fundamental. */
|
|
23
|
+
const pluck = (freq: number, at: number, duration: number, gain: number): Tone[] => [
|
|
24
|
+
{ freq, at, duration, type: 'sine', gain },
|
|
25
|
+
{ freq: freq * 2.76, at, duration: duration * 0.4, type: 'sine', gain: gain * 0.05 },
|
|
26
|
+
{ freq: freq * 5.4, at, duration: Math.min(0.03, duration * 0.2), type: 'sine', gain: gain * 0.02 },
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
export const soundPresets: Record<SoundName, readonly Tone[]> = {
|
|
30
|
+
tap: pluck(880, 0, 0.07, 0.28),
|
|
31
|
+
copy: [...pluck(784, 0, 0.09, 0.3), ...pluck(1175, 0.06, 0.16, 0.26)],
|
|
32
|
+
send: [...pluck(587, 0, 0.1, 0.3), ...pluck(880, 0.05, 0.18, 0.26)],
|
|
33
|
+
success: [...pluck(523, 0, 0.22, 0.28), ...pluck(659, 0.08, 0.24, 0.25), ...pluck(784, 0.16, 0.42, 0.24)],
|
|
34
|
+
attention: [...pluck(988, 0, 0.16, 0.24), ...pluck(988, 0.15, 0.3, 0.18)],
|
|
35
|
+
error: [
|
|
36
|
+
{ freq: 392, at: 0, duration: 0.14, type: 'triangle', gain: 0.3 },
|
|
37
|
+
{ freq: 311, at: 0.12, duration: 0.24, type: 'triangle', gain: 0.28 },
|
|
38
|
+
],
|
|
39
|
+
ready: [...pluck(659, 0, 0.16, 0.22), ...pluck(784, 0.07, 0.18, 0.22), ...pluck(988, 0.14, 0.2, 0.22), ...pluck(1319, 0.21, 0.5, 0.2)],
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface SoundSettings {
|
|
43
|
+
enabled: boolean
|
|
44
|
+
/** Master volume, 0 to 1. */
|
|
45
|
+
volume: number
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** The slice of `AudioContext` the player uses; tests pass a fake. */
|
|
49
|
+
export type SoundContext = Pick<AudioContext, 'currentTime' | 'state' | 'resume' | 'createOscillator' | 'createGain' | 'createBiquadFilter' | 'destination'>
|
|
50
|
+
|
|
51
|
+
export interface SoundPlayer {
|
|
52
|
+
play(name: SoundName): void
|
|
53
|
+
configure(settings: Partial<SoundSettings>): void
|
|
54
|
+
settings(): SoundSettings
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const ATTACK = 0.004
|
|
58
|
+
/** Rounds off the top end so no preset sounds harsh on laptop speakers. */
|
|
59
|
+
const LOWPASS_HZ = 4600
|
|
60
|
+
const FLOOR = 0.0001
|
|
61
|
+
/** The same sound fired again within this many seconds is dropped. */
|
|
62
|
+
const REPEAT_GAP = 0.06
|
|
63
|
+
|
|
64
|
+
const clamp01 = (n: number) => (Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 0)
|
|
65
|
+
|
|
66
|
+
function browserContext(): SoundContext | null {
|
|
67
|
+
const Ctor =
|
|
68
|
+
typeof window === 'undefined'
|
|
69
|
+
? undefined
|
|
70
|
+
: (window.AudioContext ?? (window as unknown as { webkitAudioContext?: typeof AudioContext }).webkitAudioContext)
|
|
71
|
+
return Ctor ? new Ctor() : null
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function resumeOnGesture(ctx: SoundContext) {
|
|
75
|
+
if (typeof window === 'undefined') return
|
|
76
|
+
const resume = () => {
|
|
77
|
+
void ctx.resume().catch(() => {})
|
|
78
|
+
window.removeEventListener('pointerdown', resume, true)
|
|
79
|
+
window.removeEventListener('keydown', resume, true)
|
|
80
|
+
}
|
|
81
|
+
window.addEventListener('pointerdown', resume, true)
|
|
82
|
+
window.addEventListener('keydown', resume, true)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function createSoundPlayer(
|
|
86
|
+
createContext: () => SoundContext | null = browserContext,
|
|
87
|
+
initial: Partial<SoundSettings> = {},
|
|
88
|
+
): SoundPlayer {
|
|
89
|
+
let current: SoundSettings = { enabled: false, volume: 0.5, ...initial }
|
|
90
|
+
current.volume = clamp01(current.volume)
|
|
91
|
+
let ctx: SoundContext | null | undefined
|
|
92
|
+
let output: AudioNode | null = null
|
|
93
|
+
const lastPlayed = new Map<SoundName, number>()
|
|
94
|
+
|
|
95
|
+
const context = () => {
|
|
96
|
+
if (ctx === undefined) {
|
|
97
|
+
try {
|
|
98
|
+
ctx = createContext()
|
|
99
|
+
} catch {
|
|
100
|
+
ctx = null
|
|
101
|
+
}
|
|
102
|
+
if (ctx) {
|
|
103
|
+
const filter = ctx.createBiquadFilter()
|
|
104
|
+
filter.type = 'lowpass'
|
|
105
|
+
filter.frequency.value = LOWPASS_HZ
|
|
106
|
+
filter.connect(ctx.destination)
|
|
107
|
+
output = filter
|
|
108
|
+
if (ctx.state === 'suspended') resumeOnGesture(ctx)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return ctx
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
play(name) {
|
|
116
|
+
if (!current.enabled || current.volume === 0) return
|
|
117
|
+
const audio = context()
|
|
118
|
+
if (!audio || !output || audio.state === 'closed') return
|
|
119
|
+
const now = audio.currentTime
|
|
120
|
+
const last = lastPlayed.get(name)
|
|
121
|
+
if (last !== undefined && now - last < REPEAT_GAP) return
|
|
122
|
+
lastPlayed.set(name, now)
|
|
123
|
+
for (const tone of soundPresets[name]) {
|
|
124
|
+
const start = now + tone.at
|
|
125
|
+
const end = start + tone.duration
|
|
126
|
+
const osc = audio.createOscillator()
|
|
127
|
+
const gain = audio.createGain()
|
|
128
|
+
osc.type = tone.type ?? 'sine'
|
|
129
|
+
osc.frequency.setValueAtTime(tone.freq, start)
|
|
130
|
+
if (tone.to !== undefined) osc.frequency.exponentialRampToValueAtTime(tone.to, end)
|
|
131
|
+
gain.gain.setValueAtTime(FLOOR, start)
|
|
132
|
+
gain.gain.linearRampToValueAtTime(Math.max(FLOOR, tone.gain * current.volume), start + ATTACK)
|
|
133
|
+
gain.gain.exponentialRampToValueAtTime(FLOOR, end)
|
|
134
|
+
osc.connect(gain)
|
|
135
|
+
gain.connect(output)
|
|
136
|
+
osc.start(start)
|
|
137
|
+
osc.stop(end + 0.02)
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
configure(settings) {
|
|
141
|
+
current = { ...current, ...settings }
|
|
142
|
+
current.volume = clamp01(current.volume)
|
|
143
|
+
},
|
|
144
|
+
settings: () => ({ ...current }),
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const shared = createSoundPlayer()
|
|
149
|
+
|
|
150
|
+
/** Play a preset through the shared player; a no-op while sounds are off. */
|
|
151
|
+
export const playSound = (name: SoundName) => shared.play(name)
|
|
152
|
+
/** Turn the shared player on or off and set its volume. */
|
|
153
|
+
export const configureSounds = (settings: Partial<SoundSettings>) => shared.configure(settings)
|
|
154
|
+
export const soundSettings = () => shared.settings()
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"./themes/config": "./src/theme/themes.config.ts",
|
|
17
17
|
"./styled-system/css": {
|
|
18
18
|
"types": "./styled-system/css/index.d.ts",
|
|
19
|
-
"import": "./styled-system/css/index.
|
|
19
|
+
"import": "./styled-system/css/index.js"
|
|
20
20
|
},
|
|
21
21
|
"./styled-system/recipes": {
|
|
22
22
|
"types": "./styled-system/recipes/index.d.ts",
|
|
23
|
-
"import": "./styled-system/recipes/index.
|
|
23
|
+
"import": "./styled-system/recipes/index.js"
|
|
24
24
|
},
|
|
25
25
|
"./preset": "./panda.config.ts",
|
|
26
26
|
"./themes": "./src/theme/index.ts"
|
|
@@ -33,7 +33,10 @@
|
|
|
33
33
|
"scripts"
|
|
34
34
|
],
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@pandacss/dev": "^
|
|
36
|
+
"@pandacss/dev": "^2.3.0",
|
|
37
|
+
"@pandacss/preset-base": "^2.3.0",
|
|
38
|
+
"@pandacss/preset-panda": "^2.3.0",
|
|
39
|
+
"@pandacss/types": "^2.3.0",
|
|
37
40
|
"tsx": "^4.19.4",
|
|
38
41
|
"typescript": "^5.8.3"
|
|
39
42
|
}
|
|
@@ -28,6 +28,10 @@ import {
|
|
|
28
28
|
switchRecipe,
|
|
29
29
|
tabsRecipe,
|
|
30
30
|
separatorRecipe,
|
|
31
|
+
proseRecipe,
|
|
32
|
+
textareaRecipe,
|
|
33
|
+
segmentGroupRecipe,
|
|
34
|
+
clipboardRecipe,
|
|
31
35
|
progressRecipe,
|
|
32
36
|
radioGroupRecipe,
|
|
33
37
|
sliderRecipe,
|
|
@@ -44,6 +48,8 @@ import { semanticTokens } from './src/theme/semantic-tokens.js'
|
|
|
44
48
|
import { tokens } from './src/theme/tokens.js'
|
|
45
49
|
|
|
46
50
|
export default defineConfig({
|
|
51
|
+
// v2 adds no presets by itself; v1 added both of these when none were listed.
|
|
52
|
+
presets: ['@pandacss/preset-base', '@pandacss/preset-panda'],
|
|
47
53
|
preflight: true,
|
|
48
54
|
include: [
|
|
49
55
|
'../ui/src/**/*.{ts,tsx}',
|
|
@@ -68,6 +74,8 @@ export default defineConfig({
|
|
|
68
74
|
aeonProfileHeader: [{ align: ['*'] }],
|
|
69
75
|
aeonEntry: [{ density: ['*'], layout: ['*'] }],
|
|
70
76
|
aeonThemeSwitcher: [{ size: ['*'] }],
|
|
77
|
+
aeonTextarea: [{ variant: ['*'] }],
|
|
78
|
+
aeonSegmentGroup: [{ size: ['*'] }],
|
|
71
79
|
},
|
|
72
80
|
},
|
|
73
81
|
conditions: {
|
|
@@ -120,6 +128,10 @@ export default defineConfig({
|
|
|
120
128
|
aeonDialog: dialogRecipe,
|
|
121
129
|
aeonTabs: tabsRecipe,
|
|
122
130
|
aeonSeparator: separatorRecipe,
|
|
131
|
+
aeonProse: proseRecipe,
|
|
132
|
+
aeonTextarea: textareaRecipe,
|
|
133
|
+
aeonSegmentGroup: segmentGroupRecipe,
|
|
134
|
+
aeonClipboard: clipboardRecipe,
|
|
123
135
|
aeonProgress: progressRecipe,
|
|
124
136
|
aeonRadioGroup: radioGroupRecipe,
|
|
125
137
|
aeonSlider: sliderRecipe,
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev'
|
|
2
|
+
|
|
3
|
+
const slots = ['root', 'trigger', 'indicator', 'status'] as const
|
|
4
|
+
|
|
5
|
+
export const clipboardRecipe = defineSlotRecipe({
|
|
6
|
+
className: 'aeonClipboard',
|
|
7
|
+
description: 'Copy a value with one click; the trigger confirms copied or failed',
|
|
8
|
+
slots,
|
|
9
|
+
base: {
|
|
10
|
+
root: {},
|
|
11
|
+
trigger: {
|
|
12
|
+
display: 'inline-flex',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
gap: '0.35em',
|
|
16
|
+
minW: '1.75rem',
|
|
17
|
+
h: '1.75rem',
|
|
18
|
+
px: '0.4rem',
|
|
19
|
+
border: '0',
|
|
20
|
+
borderRadius: 'md',
|
|
21
|
+
bg: 'transparent',
|
|
22
|
+
color: 'muted',
|
|
23
|
+
fontFamily: 'ui',
|
|
24
|
+
fontSize: 'xs',
|
|
25
|
+
cursor: 'pointer',
|
|
26
|
+
outline: 'none',
|
|
27
|
+
transitionProperty: 'color, background-color',
|
|
28
|
+
transitionDuration: 'normal',
|
|
29
|
+
_hover: { bg: 'surfaceRaised', color: 'fg' },
|
|
30
|
+
_focusVisible: { boxShadow: 'focusRing' },
|
|
31
|
+
'&[data-aeon-state=copied]': { color: 'accent' },
|
|
32
|
+
'&[data-aeon-state=failed]': { color: 'danger' },
|
|
33
|
+
},
|
|
34
|
+
indicator: {
|
|
35
|
+
display: 'inline-flex',
|
|
36
|
+
'& svg': { width: '0.875rem', height: '0.875rem' },
|
|
37
|
+
},
|
|
38
|
+
status: {},
|
|
39
|
+
},
|
|
40
|
+
})
|
|
@@ -46,9 +46,10 @@ export const composerRecipe = defineSlotRecipe({
|
|
|
46
46
|
},
|
|
47
47
|
input: {
|
|
48
48
|
width: '100%',
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
/* Grows with its content; rows come from Composer.Input's minRows / maxRows. */
|
|
50
|
+
fieldSizing: 'content',
|
|
51
|
+
minH: 'max(token(spacing.controlMinHSm), calc(var(--aeon-textarea-min-rows, 1) * 1lh + 0.7rem + 2px))',
|
|
52
|
+
maxH: 'calc(var(--aeon-textarea-max-rows, 4) * 1lh + 0.7rem + 2px)',
|
|
52
53
|
resize: 'none',
|
|
53
54
|
overflowY: 'auto',
|
|
54
55
|
boxSizing: 'border-box',
|
|
@@ -27,6 +27,10 @@ export { switchRecipe } from './switch.js'
|
|
|
27
27
|
export { themeSwitcherRecipe } from './theme-switcher.js'
|
|
28
28
|
export { tabsRecipe } from './tabs.js'
|
|
29
29
|
export { separatorRecipe } from './separator.js'
|
|
30
|
+
export { proseRecipe } from './prose.js'
|
|
31
|
+
export { textareaRecipe } from './textarea.js'
|
|
32
|
+
export { segmentGroupRecipe } from './segment-group.js'
|
|
33
|
+
export { clipboardRecipe } from './clipboard.js'
|
|
30
34
|
export { progressRecipe } from './progress.js'
|
|
31
35
|
export { radioGroupRecipe } from './radio-group.js'
|
|
32
36
|
export { sliderRecipe } from './slider.js'
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev'
|
|
2
|
+
|
|
3
|
+
const slots = ['root'] as const
|
|
4
|
+
|
|
5
|
+
const blocks = ':is(p, ul, ol, pre, blockquote, table)'
|
|
6
|
+
|
|
7
|
+
/** Sizes are in em so prose follows the font size it is placed in. */
|
|
8
|
+
export const proseRecipe = defineSlotRecipe({
|
|
9
|
+
className: 'aeonProse',
|
|
10
|
+
description: 'Long-form rich text: markdown output, docs, agent answers',
|
|
11
|
+
slots,
|
|
12
|
+
base: {
|
|
13
|
+
root: {
|
|
14
|
+
minW: '0',
|
|
15
|
+
color: 'fg',
|
|
16
|
+
fontFamily: 'ui',
|
|
17
|
+
lineHeight: '1.6',
|
|
18
|
+
overflowWrap: 'anywhere',
|
|
19
|
+
[`& ${blocks}`]: { m: '0', mb: '0.75em' },
|
|
20
|
+
'& > :first-child': { mt: '0' },
|
|
21
|
+
'& > :last-child': { mb: '0' },
|
|
22
|
+
'& :is(h1, h2, h3, h4, h5, h6)': {
|
|
23
|
+
mt: '1.1em',
|
|
24
|
+
mb: '0.4em',
|
|
25
|
+
color: 'fg',
|
|
26
|
+
fontWeight: 'semibold',
|
|
27
|
+
lineHeight: '1.3',
|
|
28
|
+
},
|
|
29
|
+
'& h1': { fontSize: '1.4em' },
|
|
30
|
+
'& h2': { fontSize: '1.2em' },
|
|
31
|
+
'& h3': { fontSize: '1.08em' },
|
|
32
|
+
'& :is(h4, h5, h6)': { fontSize: '1em' },
|
|
33
|
+
'& strong': { fontWeight: 'semibold' },
|
|
34
|
+
/* The Aeon reset strips list-style, so markers are drawn. list-item honours <ol start>. */
|
|
35
|
+
'& :is(ul, ol)': { pl: '1.3em', listStyle: 'none' },
|
|
36
|
+
'& li': { position: 'relative' },
|
|
37
|
+
'& li + li': { mt: '0.3em' },
|
|
38
|
+
[`& li > ${blocks}`]: { mt: '0.3em', mb: '0' },
|
|
39
|
+
'& li > p:first-child': { mt: '0' },
|
|
40
|
+
'& ul > li::before': {
|
|
41
|
+
content: '""',
|
|
42
|
+
position: 'absolute',
|
|
43
|
+
left: '-0.9em',
|
|
44
|
+
top: '0.68em',
|
|
45
|
+
width: '0.3em',
|
|
46
|
+
height: '0.3em',
|
|
47
|
+
borderRadius: 'full',
|
|
48
|
+
bg: 'muted',
|
|
49
|
+
},
|
|
50
|
+
'& ol > li::before': {
|
|
51
|
+
content: 'counter(list-item) "."',
|
|
52
|
+
position: 'absolute',
|
|
53
|
+
right: 'calc(100% + 0.45em)',
|
|
54
|
+
color: 'muted',
|
|
55
|
+
fontVariantNumeric: 'tabular-nums',
|
|
56
|
+
},
|
|
57
|
+
'& blockquote': {
|
|
58
|
+
pl: '0.8em',
|
|
59
|
+
borderLeftWidth: '2px',
|
|
60
|
+
borderLeftStyle: 'solid',
|
|
61
|
+
borderLeftColor: 'border',
|
|
62
|
+
color: 'muted',
|
|
63
|
+
},
|
|
64
|
+
'& hr': {
|
|
65
|
+
my: '1em',
|
|
66
|
+
border: '0',
|
|
67
|
+
borderTopWidth: '1px',
|
|
68
|
+
borderTopStyle: 'solid',
|
|
69
|
+
borderTopColor: 'border',
|
|
70
|
+
},
|
|
71
|
+
'& a': {
|
|
72
|
+
color: 'accent',
|
|
73
|
+
textDecoration: 'none',
|
|
74
|
+
borderRadius: 'sm',
|
|
75
|
+
outline: 'none',
|
|
76
|
+
_hover: { textDecoration: 'underline' },
|
|
77
|
+
_focusVisible: { boxShadow: 'focusRing' },
|
|
78
|
+
},
|
|
79
|
+
'& :not(pre) > code': {
|
|
80
|
+
px: '0.35em',
|
|
81
|
+
py: '0.1em',
|
|
82
|
+
borderRadius: 'sm',
|
|
83
|
+
bg: 'surfaceRaised',
|
|
84
|
+
fontFamily: 'mono',
|
|
85
|
+
fontSize: '0.9em',
|
|
86
|
+
},
|
|
87
|
+
'& pre': {
|
|
88
|
+
p: '0.75em',
|
|
89
|
+
borderRadius: 'md',
|
|
90
|
+
bg: 'bg',
|
|
91
|
+
overflow: 'auto',
|
|
92
|
+
fontFamily: 'mono',
|
|
93
|
+
fontSize: '0.9em',
|
|
94
|
+
lineHeight: '1.5',
|
|
95
|
+
},
|
|
96
|
+
'& pre code': { fontFamily: 'inherit', fontSize: 'inherit' },
|
|
97
|
+
'& table': { width: '100%', borderCollapse: 'collapse', fontSize: '0.95em' },
|
|
98
|
+
'& :is(th, td)': {
|
|
99
|
+
px: '0.6em',
|
|
100
|
+
py: '0.35em',
|
|
101
|
+
borderBottomWidth: '1px',
|
|
102
|
+
borderBottomStyle: 'solid',
|
|
103
|
+
borderBottomColor: 'border',
|
|
104
|
+
textAlign: 'start',
|
|
105
|
+
},
|
|
106
|
+
'& th': { fontWeight: 'semibold' },
|
|
107
|
+
'& img': { maxW: '100%', borderRadius: 'md' },
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
})
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev'
|
|
2
|
+
|
|
3
|
+
const slots = ['root', 'item'] as const
|
|
4
|
+
|
|
5
|
+
export const segmentGroupRecipe = defineSlotRecipe({
|
|
6
|
+
className: 'aeonSegmentGroup',
|
|
7
|
+
description: 'Compact single choice: adjacent buttons on a shared track',
|
|
8
|
+
slots,
|
|
9
|
+
base: {
|
|
10
|
+
root: {
|
|
11
|
+
display: 'inline-flex',
|
|
12
|
+
flexShrink: 0,
|
|
13
|
+
alignItems: 'stretch',
|
|
14
|
+
gap: '2px',
|
|
15
|
+
p: '2px',
|
|
16
|
+
borderRadius: 'md',
|
|
17
|
+
bg: 'surfaceRaised',
|
|
18
|
+
fontFamily: 'ui',
|
|
19
|
+
'&[data-orientation=vertical]': { flexDirection: 'column' },
|
|
20
|
+
_disabled: { opacity: 0.6 },
|
|
21
|
+
},
|
|
22
|
+
item: {
|
|
23
|
+
display: 'inline-flex',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
gap: '0.35em',
|
|
27
|
+
border: '0',
|
|
28
|
+
borderRadius: 'calc(token(radii.md) - 2px)',
|
|
29
|
+
bg: 'transparent',
|
|
30
|
+
color: 'muted',
|
|
31
|
+
fontWeight: 'semibold',
|
|
32
|
+
whiteSpace: 'nowrap',
|
|
33
|
+
cursor: 'pointer',
|
|
34
|
+
outline: 'none',
|
|
35
|
+
transitionProperty: 'color, background-color',
|
|
36
|
+
transitionDuration: 'normal',
|
|
37
|
+
_hover: { color: 'fg' },
|
|
38
|
+
_focusVisible: { boxShadow: 'focusRing' },
|
|
39
|
+
_aeonSelected: { bg: 'bg', color: 'fg' },
|
|
40
|
+
_disabled: { cursor: 'not-allowed', _hover: { color: 'muted' } },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
variants: {
|
|
44
|
+
size: {
|
|
45
|
+
sm: { item: { fontSize: 'xs', px: '0.6rem', py: '0.2rem' } },
|
|
46
|
+
md: { item: { fontSize: 'sm', px: 'insetXSm', py: 'insetYSm' } },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
defaultVariants: { size: 'md' },
|
|
50
|
+
})
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev'
|
|
2
|
+
|
|
3
|
+
const slots = ['root'] as const
|
|
4
|
+
|
|
5
|
+
const pad = 'var(--aeon-textarea-pad)'
|
|
6
|
+
|
|
7
|
+
export const textareaRecipe = defineSlotRecipe({
|
|
8
|
+
className: 'aeonTextarea',
|
|
9
|
+
description: 'Multi-line input that grows with content between min and max rows',
|
|
10
|
+
slots,
|
|
11
|
+
base: {
|
|
12
|
+
root: {
|
|
13
|
+
'--aeon-textarea-pad': 'token(spacing.insetYSm)',
|
|
14
|
+
display: 'block',
|
|
15
|
+
width: '100%',
|
|
16
|
+
boxSizing: 'border-box',
|
|
17
|
+
/* Rows are set by the headless part; 1lh is one line at the current line height. */
|
|
18
|
+
fieldSizing: 'content',
|
|
19
|
+
minH: `calc(var(--aeon-textarea-min-rows, 2) * 1lh + 2 * ${pad} + 2px)`,
|
|
20
|
+
maxH: `calc(var(--aeon-textarea-max-rows, 1e4) * 1lh + 2 * ${pad} + 2px)`,
|
|
21
|
+
overflowY: 'auto',
|
|
22
|
+
resize: 'none',
|
|
23
|
+
m: '0',
|
|
24
|
+
px: 'insetX',
|
|
25
|
+
py: pad,
|
|
26
|
+
borderWidth: '1px',
|
|
27
|
+
borderStyle: 'solid',
|
|
28
|
+
borderColor: 'border',
|
|
29
|
+
borderRadius: 'md',
|
|
30
|
+
bg: 'surface',
|
|
31
|
+
color: 'fg',
|
|
32
|
+
fontFamily: 'ui',
|
|
33
|
+
fontSize: 'sm',
|
|
34
|
+
lineHeight: '1.5',
|
|
35
|
+
outline: 'none',
|
|
36
|
+
transitionProperty: 'border-color',
|
|
37
|
+
transitionDuration: 'normal',
|
|
38
|
+
_placeholder: { color: 'muted' },
|
|
39
|
+
_focusVisible: { borderColor: 'accent' },
|
|
40
|
+
'&[aria-invalid=true]': { borderColor: 'danger' },
|
|
41
|
+
_disabled: { opacity: 0.6, cursor: 'not-allowed' },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
variants: {
|
|
45
|
+
variant: {
|
|
46
|
+
outline: {},
|
|
47
|
+
/* Bare text inside a container that draws its own chrome (composers, inline editors). */
|
|
48
|
+
ghost: {
|
|
49
|
+
root: {
|
|
50
|
+
'--aeon-textarea-pad': '0px',
|
|
51
|
+
px: '0',
|
|
52
|
+
borderColor: 'transparent',
|
|
53
|
+
bg: 'transparent',
|
|
54
|
+
_focusVisible: { borderColor: 'transparent' },
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
defaultVariants: { variant: 'outline' },
|
|
60
|
+
})
|