@zyncat/ui 0.20.0 → 0.22.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/dist/alert.js +11 -10
- package/dist/alert.js.map +1 -1
- package/dist/avatar.css +1 -1
- package/dist/badge.css +20 -11
- package/dist/badge.js +4 -1
- package/dist/{bloom-HV23M4AW.js → bloom-5MZXLNKG.js} +23 -5
- package/dist/bloom-5MZXLNKG.js.map +1 -0
- package/dist/button.css +24 -27
- package/dist/button.js +3 -3
- package/dist/checkbox.css +0 -1
- package/dist/chunk-2EPNCOLN.js +177 -0
- package/dist/chunk-2EPNCOLN.js.map +1 -0
- package/dist/{chunk-LNAV5E7S.js → chunk-2GYZ3HP3.js} +8 -4
- package/dist/chunk-2GYZ3HP3.js.map +1 -0
- package/dist/chunk-4M5FMCFJ.js +16 -0
- package/dist/chunk-4M5FMCFJ.js.map +1 -0
- package/dist/{chunk-ODRO3KS6.js → chunk-7GTACTZD.js} +8 -6
- package/dist/chunk-7GTACTZD.js.map +1 -0
- package/dist/{chunk-V6QAAOA5.js → chunk-AK2AXGEC.js} +38 -8
- package/dist/chunk-AK2AXGEC.js.map +1 -0
- package/dist/{chunk-5VC3TUZ2.js → chunk-BA4ALXQW.js} +2 -2
- package/dist/{chunk-5VC3TUZ2.js.map → chunk-BA4ALXQW.js.map} +1 -1
- package/dist/{chunk-N43NDSME.js → chunk-CF6ZFXRV.js} +19 -11
- package/dist/chunk-CF6ZFXRV.js.map +1 -0
- package/dist/{chunk-BRKGYLEQ.js → chunk-DOAR4PJ3.js} +9 -4
- package/dist/chunk-DOAR4PJ3.js.map +1 -0
- package/dist/{tide-DJZMDAFT.js → chunk-DVLKB3CZ.js} +15 -12
- package/dist/chunk-DVLKB3CZ.js.map +1 -0
- package/dist/chunk-EUAXI6OF.js +16 -0
- package/dist/chunk-EUAXI6OF.js.map +1 -0
- package/dist/{chunk-RLNCRDAL.js → chunk-G2TOUG2A.js} +7 -6
- package/dist/chunk-G2TOUG2A.js.map +1 -0
- package/dist/{chunk-VQFILXQN.js → chunk-HRP4UFWN.js} +70 -8
- package/dist/chunk-HRP4UFWN.js.map +1 -0
- package/dist/chunk-INK2GJTA.js +102 -0
- package/dist/chunk-INK2GJTA.js.map +1 -0
- package/dist/chunk-ITW5UCVU.js +24 -0
- package/dist/chunk-ITW5UCVU.js.map +1 -0
- package/dist/{chunk-F64Z42PJ.js → chunk-JJHEVW4M.js} +5 -6
- package/dist/chunk-JJHEVW4M.js.map +1 -0
- package/dist/{chunk-7NHY2CRA.js → chunk-JUC35N3C.js} +2 -2
- package/dist/chunk-JUC35N3C.js.map +1 -0
- package/dist/{chunk-PXQBJMPJ.js → chunk-LFJ4C7ZP.js} +7 -7
- package/dist/chunk-LFJ4C7ZP.js.map +1 -0
- package/dist/{chunk-TDHLZY6I.js → chunk-MCOIR3CK.js} +77 -18
- package/dist/chunk-MCOIR3CK.js.map +1 -0
- package/dist/chunk-NATK4DDW.js +108 -0
- package/dist/chunk-NATK4DDW.js.map +1 -0
- package/dist/{chunk-BIDVNLJO.js → chunk-O3RMSMBP.js} +8 -3
- package/dist/{chunk-BIDVNLJO.js.map → chunk-O3RMSMBP.js.map} +1 -1
- package/dist/{chunk-UKPX3RIP.js → chunk-ODO2TCTS.js} +27 -13
- package/dist/chunk-ODO2TCTS.js.map +1 -0
- package/dist/{chunk-M2KGLH2G.js → chunk-P3QSWNED.js} +11 -11
- package/dist/{chunk-M2KGLH2G.js.map → chunk-P3QSWNED.js.map} +1 -1
- package/dist/{chunk-QDAN43B6.js → chunk-Q4K337QY.js} +6 -6
- package/dist/chunk-Q4K337QY.js.map +1 -0
- package/dist/{chunk-2YGHPQ66.js → chunk-Q5N24VII.js} +2 -2
- package/dist/{chunk-2YGHPQ66.js.map → chunk-Q5N24VII.js.map} +1 -1
- package/dist/{chunk-VJXP256V.js → chunk-RLRZJAF7.js} +20 -8
- package/dist/chunk-RLRZJAF7.js.map +1 -0
- package/dist/{chunk-VZXML7EH.js → chunk-SY5UA6WS.js} +39 -10
- package/dist/chunk-SY5UA6WS.js.map +1 -0
- package/dist/{chunk-XKDR22VE.js → chunk-TFC5SCAB.js} +37 -14
- package/dist/chunk-TFC5SCAB.js.map +1 -0
- package/dist/{chunk-HBWRKEW4.js → chunk-VBALIMST.js} +3 -3
- package/dist/{chunk-HBWRKEW4.js.map → chunk-VBALIMST.js.map} +1 -1
- package/dist/{chunk-JINATP4N.js → chunk-VXQ7A6ZI.js} +8 -9
- package/dist/chunk-VXQ7A6ZI.js.map +1 -0
- package/dist/{chunk-TBLPZQSI.js → chunk-W7CHDHRV.js} +114 -42
- package/dist/chunk-W7CHDHRV.js.map +1 -0
- package/dist/{chunk-AIAPXRCI.js → chunk-WBWVOOKM.js} +201 -123
- package/dist/chunk-WBWVOOKM.js.map +1 -0
- package/dist/{chunk-6H3IJ752.js → chunk-WJEZWKEY.js} +20 -10
- package/dist/chunk-WJEZWKEY.js.map +1 -0
- package/dist/{chunk-TRPAKUIB.js → chunk-WMTOAYGP.js} +9 -9
- package/dist/{chunk-TRPAKUIB.js.map → chunk-WMTOAYGP.js.map} +1 -1
- package/dist/{chunk-C3D32LE3.js → chunk-WTHIUPVJ.js} +3 -3
- package/dist/{chunk-C3D32LE3.js.map → chunk-WTHIUPVJ.js.map} +1 -1
- package/dist/{chunk-F2TB3TT6.js → chunk-XCTMTOGT.js} +5 -5
- package/dist/{chunk-F2TB3TT6.js.map → chunk-XCTMTOGT.js.map} +1 -1
- package/dist/chunk-XMJ343KF.js +18 -0
- package/dist/chunk-XMJ343KF.js.map +1 -0
- package/dist/collapse.js +1 -1
- package/dist/combobox.css +7 -0
- package/dist/combobox.js +183 -0
- package/dist/combobox.js.map +1 -0
- package/dist/confetti.js +2 -2
- package/dist/crossfade-UHUQBUVG.js +133 -0
- package/dist/crossfade-UHUQBUVG.js.map +1 -0
- package/dist/date-field.js +27 -22
- package/dist/date-field.js.map +1 -1
- package/dist/date-picker.css +25 -41
- package/dist/date-range-field.js +463 -279
- package/dist/date-range-field.js.map +1 -1
- package/dist/datetime-field.js +28 -23
- package/dist/datetime-field.js.map +1 -1
- package/dist/dialog-sheet.css +31 -0
- package/dist/dialog.css +3 -0
- package/dist/dialog.js +44 -42
- package/dist/dialog.js.map +1 -1
- package/dist/dropdown.css +14 -11
- package/dist/dropdown.js +79 -37
- package/dist/dropdown.js.map +1 -1
- package/dist/emoji-picker.js +22 -21
- package/dist/emoji-picker.js.map +1 -1
- package/dist/flow-field.js +2 -2
- package/dist/glide.js +3 -3
- package/dist/input.css +54 -34
- package/dist/instagram-feed.js +3 -3
- package/dist/lens.js +184 -160
- package/dist/lens.js.map +1 -1
- package/dist/mcp.js +29 -22
- package/dist/menu-surface.css +81 -7
- package/dist/modal.js +11 -10
- package/dist/modal.js.map +1 -1
- package/dist/morphing-text.js +2 -2
- package/dist/motion-devtools.css +6 -5
- package/dist/motion-devtools.js +6 -6
- package/dist/motion-tokens.js +1 -1
- package/dist/motion.js +10 -0
- package/dist/motion.js.map +1 -0
- package/dist/multi-select.js +63 -24
- package/dist/multi-select.js.map +1 -1
- package/dist/number-field.js +122 -75
- package/dist/number-field.js.map +1 -1
- package/dist/odometer.css +27 -16
- package/dist/odometer.js +225 -73
- package/dist/odometer.js.map +1 -1
- package/dist/otp-field.js +49 -12
- package/dist/otp-field.js.map +1 -1
- package/dist/overlay.css +1 -0
- package/dist/pagination.css +1 -1
- package/dist/pagination.js +6 -6
- package/dist/{paint-CJQCM6ZO.js → paint-NLTI6TEF.js} +5 -3
- package/dist/paint-NLTI6TEF.js.map +1 -0
- package/dist/popover.js +12 -11
- package/dist/radio-group.css +9 -6
- package/dist/radio-group.js +9 -8
- package/dist/radio-group.js.map +1 -1
- package/dist/range-sheet-days.css +35 -0
- package/dist/range-sheet.css +80 -0
- package/dist/range-summary.css +67 -0
- package/dist/scroll-area.css +150 -0
- package/dist/scroll-area.js +85 -0
- package/dist/scroll-area.js.map +1 -0
- package/dist/select.css +55 -7
- package/dist/select.js +29 -15
- package/dist/select.js.map +1 -1
- package/dist/sheet.js +12 -11
- package/dist/support-rail.css +2 -2
- package/dist/support-rail.js +17 -15
- package/dist/support-rail.js.map +1 -1
- package/dist/table-detail.css +27 -0
- package/dist/table.css +41 -14
- package/dist/table.js +341 -172
- package/dist/table.js.map +1 -1
- package/dist/tabs.css +32 -13
- package/dist/tabs.js +69 -55
- package/dist/tabs.js.map +1 -1
- package/dist/tag.css +2 -4
- package/dist/tag.js +8 -7
- package/dist/tag.js.map +1 -1
- package/dist/text-field.js +4 -4
- package/dist/textarea.css +26 -41
- package/dist/textarea.js +43 -32
- package/dist/textarea.js.map +1 -1
- package/dist/theme-grid.js +8 -7
- package/dist/theme-switcher.js +19 -18
- package/dist/theme-switcher.js.map +1 -1
- package/dist/{theme-transition-VGLPZDJI.js → theme-transition-F3CBENM5.js} +29 -9
- package/dist/theme-transition-F3CBENM5.js.map +1 -0
- package/dist/theme-transition.css +49 -0
- package/dist/theme.js +5 -4
- package/dist/theme.js.map +1 -1
- package/dist/tide-AGGMQEJV.js +4 -0
- package/dist/tide-AGGMQEJV.js.map +1 -0
- package/dist/tiktok.js +3 -3
- package/dist/time-field.js +15 -8
- package/dist/time-field.js.map +1 -1
- package/dist/toast.css +1 -1
- package/dist/toast.js +11 -10
- package/dist/toast.js.map +1 -1
- package/dist/toggle-tag.js +2 -2
- package/dist/toggle-tag.js.map +1 -1
- package/dist/toggle.css +0 -1
- package/dist/toggle.js +4 -15
- package/dist/toggle.js.map +1 -1
- package/dist/tooltip.css +1 -1
- package/dist/tooltip.js +22 -17
- package/dist/tooltip.js.map +1 -1
- package/dist/trigger.css +0 -1
- package/dist/types/components/composites/combobox/Combobox.d.ts +51 -0
- package/dist/types/components/composites/combobox/caret.d.ts +8 -0
- package/dist/types/components/composites/combobox/use-combobox.d.ts +52 -0
- package/dist/types/components/composites/date-picker/DateField.d.ts +1 -1
- package/dist/types/components/composites/date-picker/DateRangeField.d.ts +6 -3
- package/dist/types/components/composites/date-picker/DateTimeField.d.ts +1 -1
- package/dist/types/components/composites/date-picker/TimeField.d.ts +1 -1
- package/dist/types/components/composites/date-picker/date-utils.d.ts +2 -0
- package/dist/types/components/composites/date-picker/field-shell.d.ts +8 -1
- package/dist/types/components/composites/date-picker/month-swipe.d.ts +3 -0
- package/dist/types/components/composites/date-picker/range-day.d.ts +11 -0
- package/dist/types/components/composites/date-picker/range-month.d.ts +14 -0
- package/dist/types/components/composites/date-picker/range-panel.d.ts +4 -18
- package/dist/types/components/composites/date-picker/range-presets.d.ts +24 -0
- package/dist/types/components/composites/date-picker/range-sheet.d.ts +12 -0
- package/dist/types/components/composites/date-picker/range-summary.d.ts +9 -0
- package/dist/types/components/composites/date-picker/typed-key.d.ts +3 -0
- package/dist/types/components/composites/date-picker/use-month-view.d.ts +14 -0
- package/dist/types/components/composites/date-picker/use-range-panel.d.ts +44 -0
- package/dist/types/components/composites/dialog/Dialog.d.ts +3 -2
- package/dist/types/components/composites/dialog/surface.d.ts +17 -0
- package/dist/types/components/composites/dropdown/Dropdown.d.ts +21 -4
- package/dist/types/components/composites/dropdown/types.d.ts +9 -3
- package/dist/types/components/composites/scroll-area/ScrollArea.d.ts +29 -0
- package/dist/types/components/composites/select/MultiSelect.d.ts +31 -5
- package/dist/types/components/composites/select/Select.d.ts +20 -4
- package/dist/types/components/composites/select/core/index.d.ts +2 -1
- package/dist/types/components/composites/select/core/menu.d.ts +10 -5
- package/dist/types/components/composites/select/core/panel.d.ts +7 -4
- package/dist/types/components/composites/select/core/trigger.d.ts +7 -2
- package/dist/types/components/composites/select/core/types.d.ts +9 -0
- package/dist/types/components/composites/select/core/use-listbox.d.ts +8 -6
- package/dist/types/components/composites/select/presets.d.ts +17 -0
- package/dist/types/components/composites/table/Table.d.ts +3 -74
- package/dist/types/components/composites/table/body.d.ts +15 -0
- package/dist/types/components/composites/table/detail.d.ts +24 -0
- package/dist/types/components/composites/table/head.d.ts +16 -0
- package/dist/types/components/composites/table/types.d.ts +86 -0
- package/dist/types/components/composites/table/use-scroller.d.ts +12 -0
- package/dist/types/components/composites/table/use-table-state.d.ts +16 -0
- package/dist/types/components/composites/tabs/Tabs.d.ts +4 -69
- package/dist/types/components/composites/tabs/tab-panel.d.ts +26 -0
- package/dist/types/components/composites/tabs/types.d.ts +48 -0
- package/dist/types/components/composites/tabs/use-ink.d.ts +5 -0
- package/dist/types/components/composites/tooltip/Tooltip.d.ts +1 -1
- package/dist/types/components/compound/support-rail/SupportRail.d.ts +1 -1
- package/dist/types/components/expressive/lens/Lens.d.ts +1 -1
- package/dist/types/components/expressive/lens/input.d.ts +2 -0
- package/dist/types/components/expressive/lens/optics.d.ts +37 -0
- package/dist/types/components/expressive/lens/paint.d.ts +2 -0
- package/dist/types/components/expressive/lens/use-lens.d.ts +10 -0
- package/dist/types/components/expressive/odometer/Odometer.d.ts +1 -1
- package/dist/types/components/expressive/odometer/roll.d.ts +18 -0
- package/dist/types/components/expressive/odometer/spring.d.ts +11 -0
- package/dist/types/components/expressive/theme-transition/scene.d.ts +3 -0
- package/dist/types/components/internal/hooks/use-hold-repeat.d.ts +8 -0
- package/dist/types/components/internal/icon/Icon.d.ts +2 -0
- package/dist/types/components/internal/menu/highlight.d.ts +9 -1
- package/dist/types/components/internal/menu/menu-row.d.ts +4 -0
- package/dist/types/components/internal/menu/use-anchor-width.d.ts +2 -0
- package/dist/types/components/internal/overlay/layer.d.ts +5 -8
- package/dist/types/components/internal/overlay/track-anchor.d.ts +5 -0
- package/dist/types/components/internal/support/types.d.ts +1 -1
- package/dist/types/components/internal/utils/activation.d.ts +1 -0
- package/dist/types/components/primitives/badge/Badge.d.ts +17 -8
- package/dist/types/components/primitives/badge/morph-label.d.ts +3 -0
- package/dist/types/components/primitives/badge/use-glint-on-change.d.ts +2 -0
- package/dist/types/components/primitives/button/Button.d.ts +4 -8
- package/dist/types/components/primitives/button/button-style.d.ts +8 -4
- package/dist/types/components/primitives/collapse/Collapse.d.ts +3 -2
- package/dist/types/components/primitives/input/NumberField.d.ts +1 -1
- package/dist/types/components/primitives/input/OtpField.d.ts +7 -3
- package/dist/types/components/primitives/input/TextField.d.ts +1 -1
- package/dist/types/components/primitives/input/field-chrome.d.ts +2 -1
- package/dist/types/components/primitives/input/use-number-value.d.ts +16 -0
- package/dist/types/components/primitives/tag/Tag.d.ts +1 -1
- package/dist/types/components/primitives/tag/ToggleTag.d.ts +2 -2
- package/dist/types/components/primitives/textarea/Textarea.d.ts +5 -3
- package/dist/types/components/primitives/textarea/char-meter.d.ts +6 -0
- package/dist/types/components/primitives/toggle/switch-glyph.d.ts +6 -0
- package/dist/types/engine/flip.d.ts +3 -1
- package/dist/types/engine/index.d.ts +2 -2
- package/dist/types/engine/loop.d.ts +5 -2
- package/dist/types/motion/before-paint.d.ts +4 -0
- package/dist/types/motion/crossfade.d.ts +4 -0
- package/dist/types/motion/element.d.ts +16 -4
- package/dist/types/motion/flip.d.ts +12 -3
- package/dist/types/motion/holders.d.ts +4 -0
- package/dist/types/motion/motion.d.ts +7 -0
- package/dist/types/motion/use-motion.d.ts +3 -1
- package/dist/types/theme-scope.d.ts +5 -0
- package/dist/types/tokens/component-styles.generated.d.ts +0 -2
- package/dist/types/tokens/motion-defaults.generated.d.ts +2 -0
- package/dist/types/tokens/motion-scale.d.ts +18 -15
- package/dist/types/tokens/motion-tokens.d.ts +1 -1
- package/dist/types/tokens/theme-store.d.ts +4 -4
- package/dist/types/tokens/theme-tokens.generated.d.ts +77 -59
- package/dist/types/tokens/theme.d.ts +1 -1
- package/dist/typing-lines.js +2 -2
- package/dist/youtube.js +3 -3
- package/package.json +16 -11
- package/skills/zyncat-ui/SKILL.md +8 -8
- package/skills/zyncat-ui/references/components.md +6 -5
- package/skills/zyncat-ui/references/recipes.md +1 -1
- package/skills/zyncat-ui/references/theming.md +3 -3
- package/src/components/composites/combobox/Combobox.tsx +100 -0
- package/src/components/composites/combobox/Combobox.usage.md +32 -0
- package/src/components/composites/combobox/caret.ts +41 -0
- package/src/components/composites/combobox/combobox.css +7 -0
- package/src/components/composites/combobox/use-combobox.ts +112 -0
- package/src/components/composites/date-picker/DateField.tsx +4 -0
- package/src/components/composites/date-picker/DateRangeField.tsx +15 -18
- package/src/components/composites/date-picker/DateTimeField.tsx +4 -0
- package/src/components/composites/date-picker/TimeField.tsx +12 -4
- package/src/components/composites/date-picker/date-picker.css +25 -41
- package/src/components/composites/date-picker/date-utils.ts +4 -0
- package/src/components/composites/date-picker/field-shell.tsx +45 -8
- package/src/components/composites/date-picker/month-swipe.ts +41 -0
- package/src/components/composites/date-picker/range-day.tsx +112 -0
- package/src/components/composites/date-picker/range-month.tsx +79 -0
- package/src/components/composites/date-picker/range-panel.tsx +30 -356
- package/src/components/composites/date-picker/range-presets.tsx +104 -0
- package/src/components/composites/date-picker/range-sheet-days.css +35 -0
- package/src/components/composites/date-picker/range-sheet.css +80 -0
- package/src/components/composites/date-picker/range-sheet.tsx +72 -0
- package/src/components/composites/date-picker/range-summary.css +67 -0
- package/src/components/composites/date-picker/range-summary.tsx +69 -0
- package/src/components/composites/date-picker/time-core.tsx +23 -17
- package/src/components/composites/date-picker/typed-key.ts +9 -0
- package/src/components/composites/date-picker/use-month-view.ts +32 -0
- package/src/components/composites/date-picker/use-range-panel.ts +145 -0
- package/src/components/composites/dialog/Dialog.tsx +28 -110
- package/src/components/composites/dialog/dialog-sheet.css +31 -0
- package/src/components/composites/dialog/dialog.css +3 -0
- package/src/components/composites/dialog/surface.tsx +93 -0
- package/src/components/composites/dropdown/Dropdown.tsx +49 -7
- package/src/components/composites/dropdown/Dropdown.usage.md +2 -0
- package/src/components/composites/dropdown/dropdown.css +14 -11
- package/src/components/composites/dropdown/menu-panel.tsx +49 -26
- package/src/components/composites/dropdown/types.ts +9 -3
- package/src/components/composites/pagination/pagination.css +1 -1
- package/src/components/composites/scroll-area/ScrollArea.tsx +114 -0
- package/src/components/composites/scroll-area/ScrollArea.usage.md +28 -0
- package/src/components/composites/scroll-area/scroll-area.css +150 -0
- package/src/components/composites/select/MultiSelect.tsx +71 -12
- package/src/components/composites/select/MultiSelect.usage.md +10 -0
- package/src/components/composites/select/Select.tsx +32 -2
- package/src/components/composites/select/Select.usage.md +13 -1
- package/src/components/composites/select/core/index.ts +2 -1
- package/src/components/composites/select/core/menu.tsx +34 -17
- package/src/components/composites/select/core/panel.tsx +62 -55
- package/src/components/composites/select/core/trigger.tsx +44 -13
- package/src/components/composites/select/core/types.ts +10 -0
- package/src/components/composites/select/core/use-listbox.ts +91 -38
- package/src/components/composites/select/presets.tsx +47 -0
- package/src/components/composites/select/select.css +55 -7
- package/src/components/composites/sheet/use-sheet-drag.ts +13 -0
- package/src/components/composites/table/Table.tsx +65 -305
- package/src/components/composites/table/Table.usage.md +19 -2
- package/src/components/composites/table/body.tsx +147 -0
- package/src/components/composites/table/detail.tsx +76 -0
- package/src/components/composites/table/head.tsx +90 -0
- package/src/components/composites/table/table-detail.css +27 -0
- package/src/components/composites/table/table.css +41 -14
- package/src/components/composites/table/types.ts +97 -0
- package/src/components/composites/table/use-scroller.ts +53 -0
- package/src/components/composites/table/use-table-state.ts +98 -0
- package/src/components/composites/tabs/Tabs.tsx +23 -188
- package/src/components/composites/tabs/tab-panel.tsx +63 -0
- package/src/components/composites/tabs/tabs.css +32 -13
- package/src/components/composites/tabs/types.ts +51 -0
- package/src/components/composites/tabs/use-ink.ts +87 -0
- package/src/components/composites/toast/toast.css +1 -1
- package/src/components/composites/tooltip/Tooltip.tsx +6 -5
- package/src/components/composites/tooltip/tooltip-host.tsx +10 -6
- package/src/components/composites/tooltip/tooltip.css +1 -1
- package/src/components/compound/support-rail/SupportRail.tsx +3 -2
- package/src/components/compound/support-rail/support-rail.css +2 -2
- package/src/components/dev/motion-devtools.css +6 -5
- package/src/components/expressive/lens/Lens.tsx +11 -368
- package/src/components/expressive/lens/input.ts +91 -0
- package/src/components/expressive/lens/optics.ts +119 -0
- package/src/components/expressive/lens/paint.ts +60 -0
- package/src/components/expressive/lens/use-lens.ts +121 -0
- package/src/components/expressive/odometer/Odometer.tsx +78 -99
- package/src/components/expressive/odometer/Odometer.usage.md +2 -2
- package/src/components/expressive/odometer/odometer.css +27 -16
- package/src/components/expressive/odometer/roll.ts +139 -0
- package/src/components/expressive/odometer/spring.ts +86 -0
- package/src/components/expressive/theme-transition/bloom.ts +22 -2
- package/src/components/expressive/theme-transition/paint.ts +2 -0
- package/src/components/expressive/theme-transition/scene.ts +3 -0
- package/src/components/expressive/theme-transition/theme-transition.css +49 -0
- package/src/components/expressive/theme-transition/theme-transition.ts +21 -1
- package/src/components/expressive/theme-transition/tide.ts +15 -10
- package/src/components/internal/hooks/use-hold-repeat.ts +43 -0
- package/src/components/internal/hooks/use-scroll-edges.ts +6 -1
- package/src/components/internal/icon/Icon.tsx +4 -0
- package/src/components/internal/menu/highlight.ts +20 -2
- package/src/components/internal/menu/menu-row.tsx +36 -8
- package/src/components/internal/menu/menu-surface.css +81 -7
- package/src/components/internal/menu/use-anchor-width.ts +26 -0
- package/src/components/internal/overlay/layer.tsx +11 -23
- package/src/components/internal/overlay/overlay.css +1 -0
- package/src/components/internal/overlay/position.ts +17 -6
- package/src/components/internal/overlay/track-anchor.ts +69 -0
- package/src/components/internal/overlay/trigger.css +0 -1
- package/src/components/internal/support/types.ts +1 -1
- package/src/components/internal/utils/activation.ts +7 -2
- package/src/components/primitives/avatar/avatar.css +1 -1
- package/src/components/primitives/badge/Badge.tsx +38 -15
- package/src/components/primitives/badge/Badge.usage.md +12 -5
- package/src/components/primitives/badge/badge.css +20 -11
- package/src/components/primitives/badge/morph-label.tsx +71 -0
- package/src/components/primitives/badge/use-glint-on-change.ts +16 -0
- package/src/components/primitives/button/Button.tsx +5 -8
- package/src/components/primitives/button/Button.usage.md +5 -4
- package/src/components/primitives/button/button-style.ts +11 -5
- package/src/components/primitives/button/button.css +24 -27
- package/src/components/primitives/checkbox/checkbox.css +0 -1
- package/src/components/primitives/collapse/Collapse.tsx +3 -2
- package/src/components/primitives/input/NumberField.tsx +38 -46
- package/src/components/primitives/input/OtpField.tsx +52 -11
- package/src/components/primitives/input/OtpField.usage.md +2 -1
- package/src/components/primitives/input/TextField.tsx +5 -3
- package/src/components/primitives/input/field-chrome.tsx +3 -2
- package/src/components/primitives/input/input.css +54 -34
- package/src/components/primitives/input/use-number-value.ts +38 -0
- package/src/components/primitives/radio-group/radio-group.css +9 -6
- package/src/components/primitives/tag/Tag.tsx +1 -1
- package/src/components/primitives/tag/ToggleTag.tsx +2 -2
- package/src/components/primitives/tag/tag.css +2 -4
- package/src/components/primitives/textarea/Textarea.tsx +44 -30
- package/src/components/primitives/textarea/char-meter.tsx +19 -0
- package/src/components/primitives/textarea/textarea.css +26 -41
- package/src/components/primitives/toggle/Toggle.tsx +3 -12
- package/src/components/primitives/toggle/switch-glyph.tsx +25 -0
- package/src/components/primitives/toggle/toggle.css +0 -1
- package/src/engine/animate.ts +5 -3
- package/src/engine/flip.ts +28 -4
- package/src/engine/index.ts +2 -2
- package/src/engine/loop.ts +17 -6
- package/src/mcp/server.ts +30 -20
- package/src/motion/before-paint.ts +15 -0
- package/src/motion/crossfade.ts +143 -0
- package/src/motion/element.tsx +29 -8
- package/src/motion/flip.ts +102 -31
- package/src/motion/glide.tsx +5 -0
- package/src/motion/holders.ts +10 -0
- package/src/motion/motion.ts +7 -0
- package/src/motion/motion.usage.md +34 -0
- package/src/motion/presence.tsx +22 -9
- package/src/motion/use-motion.ts +45 -6
- package/src/theme-scope.ts +19 -0
- package/src/tokens/base.css +7 -5
- package/src/tokens/color.css +17 -15
- package/src/tokens/component-styles.generated.ts +0 -2
- package/src/tokens/dark.css +8 -5
- package/src/tokens/decisions.css +5 -3
- package/src/tokens/motion-defaults.generated.ts +15 -8
- package/src/tokens/motion-scale.ts +18 -15
- package/src/tokens/motion-tokens.ts +4 -4
- package/src/tokens/motion.css +19 -11
- package/src/tokens/reset.css +1 -0
- package/src/tokens/semantic.css +20 -14
- package/src/tokens/spacing.css +5 -3
- package/src/tokens/theme-store.ts +4 -4
- package/src/tokens/theme-sync.tsx +4 -2
- package/src/tokens/theme-tokens.generated.ts +78 -59
- package/src/tokens/theme.tsx +1 -1
- package/tailwind.css +6 -0
- package/dist/bloom-HV23M4AW.js.map +0 -1
- package/dist/chunk-2DNKZ57E.js +0 -72
- package/dist/chunk-2DNKZ57E.js.map +0 -1
- package/dist/chunk-6H3IJ752.js.map +0 -1
- package/dist/chunk-7NHY2CRA.js.map +0 -1
- package/dist/chunk-AIAPXRCI.js.map +0 -1
- package/dist/chunk-BRKGYLEQ.js.map +0 -1
- package/dist/chunk-F64Z42PJ.js.map +0 -1
- package/dist/chunk-JINATP4N.js.map +0 -1
- package/dist/chunk-KSAJ6DED.js +0 -16
- package/dist/chunk-KSAJ6DED.js.map +0 -1
- package/dist/chunk-LNAV5E7S.js.map +0 -1
- package/dist/chunk-N43NDSME.js.map +0 -1
- package/dist/chunk-ODRO3KS6.js.map +0 -1
- package/dist/chunk-PXQBJMPJ.js.map +0 -1
- package/dist/chunk-QDAN43B6.js.map +0 -1
- package/dist/chunk-RJENXXTI.js +0 -93
- package/dist/chunk-RJENXXTI.js.map +0 -1
- package/dist/chunk-RLNCRDAL.js.map +0 -1
- package/dist/chunk-RW2A4M2Q.js +0 -57
- package/dist/chunk-RW2A4M2Q.js.map +0 -1
- package/dist/chunk-TBLPZQSI.js.map +0 -1
- package/dist/chunk-TDHLZY6I.js.map +0 -1
- package/dist/chunk-UKPX3RIP.js.map +0 -1
- package/dist/chunk-V6QAAOA5.js.map +0 -1
- package/dist/chunk-VDOBLABP.js +0 -38
- package/dist/chunk-VDOBLABP.js.map +0 -1
- package/dist/chunk-VJXP256V.js.map +0 -1
- package/dist/chunk-VQFILXQN.js.map +0 -1
- package/dist/chunk-VZXML7EH.js.map +0 -1
- package/dist/chunk-XKDR22VE.js.map +0 -1
- package/dist/count-badge.js +0 -13
- package/dist/count-badge.js.map +0 -1
- package/dist/paint-CJQCM6ZO.js.map +0 -1
- package/dist/status-badge.js +0 -72
- package/dist/status-badge.js.map +0 -1
- package/dist/theme-transition-VGLPZDJI.js.map +0 -1
- package/dist/tide-DJZMDAFT.js.map +0 -1
- package/dist/types/components/primitives/badge/CountBadge.d.ts +0 -8
- package/dist/types/components/primitives/badge/StatusBadge.d.ts +0 -15
- package/src/components/primitives/badge/CountBadge.tsx +0 -20
- package/src/components/primitives/badge/CountBadge.usage.md +0 -13
- package/src/components/primitives/badge/StatusBadge.tsx +0 -113
- package/src/components/primitives/badge/StatusBadge.usage.md +0 -14
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { clampedCurve, sample, settleSeconds, wrappedCurve, type Spring } from './spring';
|
|
2
|
+
|
|
3
|
+
const RUN = 10;
|
|
4
|
+
const BOUNCE = 0.28;
|
|
5
|
+
const SETTLE_DECAYS = 4;
|
|
6
|
+
const CARRY_SOFTENING = 0.88;
|
|
7
|
+
const CARRY_FLOOR = 0.55;
|
|
8
|
+
const OPEN_RATE = 1.25;
|
|
9
|
+
const REST_CELL = 0.004;
|
|
10
|
+
const LAP: Keyframe[] = [{ translate: '0 0%' }, { translate: '0 -50%' }];
|
|
11
|
+
const GATE: Keyframe[] = [{ '--_odometer-reveal': 0 }, { '--_odometer-reveal': 1 }];
|
|
12
|
+
|
|
13
|
+
export const MIN_ROLL = 0.08;
|
|
14
|
+
export const DIGIT = /\d/;
|
|
15
|
+
export const RUN_TEXT = Array.from({ length: RUN * 2 }, (_, i) => i % RUN).join('\n');
|
|
16
|
+
|
|
17
|
+
export type Slot = (HTMLElement | null)[];
|
|
18
|
+
|
|
19
|
+
export interface Place extends Spring {
|
|
20
|
+
digit: number;
|
|
21
|
+
roll: Animation | null;
|
|
22
|
+
gate: Spring;
|
|
23
|
+
reveal: Animation | null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const charAt = (core: string, i: number) => (i < core.length ? core[core.length - 1 - i] : '');
|
|
27
|
+
|
|
28
|
+
export function parts(text: string): [string, string, string] {
|
|
29
|
+
const first = text.search(DIGIT);
|
|
30
|
+
if (first < 0) return [text, '', ''];
|
|
31
|
+
const last = text.search(/\d\D*$/);
|
|
32
|
+
return [text.slice(0, first), text.slice(first, last + 1), text.slice(last + 1)];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const motions = (places: Place[]) => places.flatMap((p) => [p.roll, p.reveal]).filter((m) => m !== null);
|
|
36
|
+
|
|
37
|
+
function settle(s: Spring): void {
|
|
38
|
+
s.at = s.to;
|
|
39
|
+
s.rate = 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function rebase(p: Place): void {
|
|
43
|
+
const shift = Math.floor(p.at / RUN) * RUN;
|
|
44
|
+
p.at -= shift;
|
|
45
|
+
p.to -= shift;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function land(strip: HTMLElement | null, p: Place): void {
|
|
49
|
+
settle(p);
|
|
50
|
+
rebase(p);
|
|
51
|
+
p.roll?.cancel();
|
|
52
|
+
p.roll = null;
|
|
53
|
+
if (strip) strip.style.translate = `0 calc(var(--_odometer-cell) * ${(-p.at).toFixed(4)})`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function shut(col: HTMLElement | null, p: Place): void {
|
|
57
|
+
settle(p.gate);
|
|
58
|
+
p.reveal?.cancel();
|
|
59
|
+
p.reveal = null;
|
|
60
|
+
col?.style.setProperty('--_odometer-reveal', String(p.gate.to));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function follow(s: Spring, motion: Animation | null): void {
|
|
64
|
+
if (!motion) return;
|
|
65
|
+
if (motion.playState === 'finished') settle(s);
|
|
66
|
+
else [s.at, s.rate] = sample(s, Number(motion.currentTime ?? 0) / 1000);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function aim(places: Place[], grid: string, core: string, zero: number, seconds: number, dir: number): void {
|
|
70
|
+
const zeta = 1 - BOUNCE;
|
|
71
|
+
for (let i = 0, ordinal = 0; i < grid.length; i++) {
|
|
72
|
+
const omega = (SETTLE_DECAYS / (zeta * seconds)) * Math.max(CARRY_FLOOR, CARRY_SOFTENING ** ordinal);
|
|
73
|
+
const open = i < zero ? 1 : 0;
|
|
74
|
+
const p = (places[i] ??= {
|
|
75
|
+
at: 0,
|
|
76
|
+
rate: 0,
|
|
77
|
+
to: 0,
|
|
78
|
+
zeta,
|
|
79
|
+
omega,
|
|
80
|
+
digit: 0,
|
|
81
|
+
roll: null,
|
|
82
|
+
gate: { at: open, rate: 0, to: open, omega, zeta: 1 },
|
|
83
|
+
reveal: null,
|
|
84
|
+
});
|
|
85
|
+
follow(p, p.roll);
|
|
86
|
+
rebase(p);
|
|
87
|
+
follow(p.gate, p.reveal);
|
|
88
|
+
p.omega = omega;
|
|
89
|
+
p.gate.omega = omega * OPEN_RATE;
|
|
90
|
+
p.gate.to = i < core.length ? 1 : 0;
|
|
91
|
+
const char = charAt(core, i) || charAt(grid, i);
|
|
92
|
+
if (!DIGIT.test(char)) continue;
|
|
93
|
+
const digit = i < core.length ? Number(char) : 0;
|
|
94
|
+
p.to += (((((digit - p.digit) * dir) % RUN) + RUN) % RUN) * dir;
|
|
95
|
+
p.digit = digit;
|
|
96
|
+
ordinal++;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function launch(places: Place[], strips: Slot, cols: Slot, rate: number, paused: boolean): void {
|
|
101
|
+
const now = document.timeline.currentTime;
|
|
102
|
+
const start = (el: HTMLElement, frames: Keyframe[], seconds: number, easing: string) => {
|
|
103
|
+
const motion = el.animate(frames, { duration: seconds * 1000, easing, fill: 'forwards' });
|
|
104
|
+
motion.playbackRate = rate;
|
|
105
|
+
motion.startTime = now;
|
|
106
|
+
if (paused) motion.pause();
|
|
107
|
+
return motion;
|
|
108
|
+
};
|
|
109
|
+
for (let i = 0; i < places.length; i++) {
|
|
110
|
+
const p = places[i];
|
|
111
|
+
const [strip, col] = [strips[i], cols[i]];
|
|
112
|
+
const rolling = settleSeconds(p, REST_CELL);
|
|
113
|
+
const opening = settleSeconds(p.gate, REST_CELL);
|
|
114
|
+
if (!rolling) land(strip, p);
|
|
115
|
+
else if (strip) {
|
|
116
|
+
p.roll?.cancel();
|
|
117
|
+
p.roll = start(strip, LAP, rolling, wrappedCurve(p, rolling, RUN));
|
|
118
|
+
}
|
|
119
|
+
if (!opening) shut(col, p);
|
|
120
|
+
else if (col) {
|
|
121
|
+
p.reveal?.cancel();
|
|
122
|
+
p.reveal = start(col, GATE, opening, clampedCurve(p.gate, opening));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function hold(places: Place[], paused: boolean): void {
|
|
128
|
+
for (const motion of motions(places)) {
|
|
129
|
+
if (paused && motion.playState === 'running') motion.pause();
|
|
130
|
+
if (!paused && motion.playState === 'paused') motion.play();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export function snap(places: Place[], cols: Slot, strips: Slot): void {
|
|
135
|
+
for (let i = 0; i < places.length; i++) {
|
|
136
|
+
shut(cols[i], places[i]);
|
|
137
|
+
land(strips[i], places[i]);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const TUNED_AT_HZ = 144;
|
|
2
|
+
const DT = 1 / TUNED_AT_HZ;
|
|
3
|
+
const SAMPLE_SECONDS = 1 / 120;
|
|
4
|
+
const CIRCULAR = [Math.cos, Math.sin, Math.acos] as const;
|
|
5
|
+
const HYPERBOLIC = [Math.cosh, Math.sinh, Math.acosh] as const;
|
|
6
|
+
|
|
7
|
+
export interface Spring {
|
|
8
|
+
at: number;
|
|
9
|
+
rate: number;
|
|
10
|
+
to: number;
|
|
11
|
+
omega: number;
|
|
12
|
+
zeta: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface Shape {
|
|
16
|
+
a: number;
|
|
17
|
+
b: number;
|
|
18
|
+
decay: number;
|
|
19
|
+
freq: number;
|
|
20
|
+
fade: number;
|
|
21
|
+
cos: (x: number) => number;
|
|
22
|
+
sin: (x: number) => number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const trim = (n: number) => Math.round(n * 1e4) / 1e4;
|
|
26
|
+
const stop = (value: number, progress: number) => `${trim(value)} ${trim(progress * 100)}%`;
|
|
27
|
+
|
|
28
|
+
function shape(s: Spring): Shape {
|
|
29
|
+
const shrink = 1 - 2 * s.zeta * s.omega * DT;
|
|
30
|
+
const radius = Math.sqrt(shrink);
|
|
31
|
+
const ratio = (1 + shrink - s.omega * s.omega * DT * DT) / (2 * radius);
|
|
32
|
+
const realRoots = ratio > 1;
|
|
33
|
+
const [cos, sin, arc] = realRoots ? HYPERBOLIC : CIRCULAR;
|
|
34
|
+
const turn = arc(ratio);
|
|
35
|
+
const a = s.at - s.to;
|
|
36
|
+
const next = a + (s.rate - (s.omega * s.omega * a + 2 * s.zeta * s.omega * s.rate) * DT) * DT;
|
|
37
|
+
const b = (next / radius - a * cos(turn)) / sin(turn);
|
|
38
|
+
const decay = -Math.log(radius) / DT;
|
|
39
|
+
const freq = turn / DT;
|
|
40
|
+
return { a, b, cos, sin, decay, freq, fade: realRoots ? decay - freq : decay };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const offset = (k: Shape, t: number) => Math.exp(-k.decay * t) * (k.a * k.cos(k.freq * t) + k.b * k.sin(k.freq * t));
|
|
44
|
+
|
|
45
|
+
export function sample(s: Spring, t: number): [at: number, rate: number] {
|
|
46
|
+
const k = shape(s);
|
|
47
|
+
const now = offset(k, t);
|
|
48
|
+
return [s.to + now, (now - offset(k, t - DT)) / DT];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function settleSeconds(s: Spring, rest: number): number {
|
|
52
|
+
const k = shape(s);
|
|
53
|
+
const amplitude = Math.hypot(k.a, k.b);
|
|
54
|
+
return amplitude > rest ? Math.log(amplitude / rest) / k.fade : 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function track(s: Spring, seconds: number): [x: number, progress: number][] {
|
|
58
|
+
const k = shape(s);
|
|
59
|
+
const steps = Math.max(1, Math.ceil(seconds / SAMPLE_SECONDS));
|
|
60
|
+
const at = (i: number) => (i === 0 ? s.at : i === steps ? s.to : s.to + offset(k, (i / steps) * seconds));
|
|
61
|
+
return Array.from({ length: steps + 1 }, (_, i) => [at(i), i / steps]);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function clampedCurve(s: Spring, seconds: number): string {
|
|
65
|
+
return `linear(${track(s, seconds)
|
|
66
|
+
.map(([x, t]) => stop(Math.min(1, Math.max(0, x)), t))
|
|
67
|
+
.join(', ')})`;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function wrappedCurve(s: Spring, seconds: number, run: number): string {
|
|
71
|
+
const wrap = (x: number) => (((x % run) + run) % run) / run;
|
|
72
|
+
const points: string[] = [];
|
|
73
|
+
let [last, then] = [s.at, 0];
|
|
74
|
+
for (const [x, t] of track(s, seconds)) {
|
|
75
|
+
const lap = Math.floor(last / run);
|
|
76
|
+
const next = Math.floor(x / run);
|
|
77
|
+
if (lap !== next) {
|
|
78
|
+
const edge = Math.max(lap, next) * run;
|
|
79
|
+
const progress = then + ((edge - last) / (x - last)) * (t - then);
|
|
80
|
+
points.push(stop(next > lap ? 1 : 0, progress), stop(next > lap ? 0 : 1, progress));
|
|
81
|
+
}
|
|
82
|
+
points.push(stop(wrap(x), t));
|
|
83
|
+
[last, then] = [x, t];
|
|
84
|
+
}
|
|
85
|
+
return `linear(${points.join(', ')})`;
|
|
86
|
+
}
|
|
@@ -20,6 +20,7 @@ const BLOB_WAVES: readonly [lobes: number, depth: number, phase: number, drift:
|
|
|
20
20
|
interface Outline {
|
|
21
21
|
vertices: number;
|
|
22
22
|
innermost: number;
|
|
23
|
+
outermost?: number;
|
|
23
24
|
radial(theta: number, progress: number): number;
|
|
24
25
|
turn(progress: number): number;
|
|
25
26
|
}
|
|
@@ -45,6 +46,7 @@ const OUTLINES: Record<Exclude<BloomShape, 'circle'>, (relief: number) => Outlin
|
|
|
45
46
|
return {
|
|
46
47
|
vertices: CURVE_VERTICES,
|
|
47
48
|
innermost: 1 - BLOB_WAVES.reduce((sum, [, depth]) => sum + depth * swell, 0),
|
|
49
|
+
outermost: 1 + BLOB_WAVES.reduce((sum, [, depth]) => sum + depth * swell, 0),
|
|
48
50
|
radial: (theta, progress) =>
|
|
49
51
|
BLOB_WAVES.reduce(
|
|
50
52
|
(r, [lobes, depth, phase, drift]) => r + depth * swell * Math.sin(lobes * theta + phase + drift * progress),
|
|
@@ -78,11 +80,29 @@ export const bloom: EffectFactory = (scene) => {
|
|
|
78
80
|
);
|
|
79
81
|
const ease = kind === 'polarity' ? easeInOut : easeOut;
|
|
80
82
|
const outline = shape === 'circle' ? null : OUTLINES[shape](relief);
|
|
81
|
-
const
|
|
83
|
+
const innermost = outline?.innermost ?? 1;
|
|
84
|
+
const reach = (farthest * COVER_MARGIN) / innermost;
|
|
82
85
|
const at = ` at ${ox.toFixed(1)}px ${oy.toFixed(1)}px)`;
|
|
83
86
|
const clipAt = (p: number) => {
|
|
84
87
|
const e = ease(p);
|
|
85
88
|
return outline ? polygonAt(outline, reach * e, e, ox, oy) : `circle(${(reach * e).toFixed(1)}px${at}`;
|
|
86
89
|
};
|
|
87
|
-
|
|
90
|
+
|
|
91
|
+
if (kind === 'polarity') {
|
|
92
|
+
return { duration: DURATION.polarity, clips: sample(DURATION.polarity, SAMPLE_MS, clipAt) };
|
|
93
|
+
}
|
|
94
|
+
const outermost = outline?.outermost ?? 1;
|
|
95
|
+
const exitSpan = farthest * (COVER_MARGIN - 1);
|
|
96
|
+
const front = (p: number) => innermost * reach * ease(p);
|
|
97
|
+
return {
|
|
98
|
+
duration: DURATION.palette,
|
|
99
|
+
clips: sample(DURATION.palette, SAMPLE_MS, clipAt),
|
|
100
|
+
wash: sample(
|
|
101
|
+
DURATION.palette,
|
|
102
|
+
SAMPLE_MS,
|
|
103
|
+
(p) => [front(p), clamp((front(p) - farthest) / exitSpan, 0, 1)] as const,
|
|
104
|
+
),
|
|
105
|
+
washOrigin: [ox, oy] as const,
|
|
106
|
+
washSpread: (outermost - innermost) / innermost,
|
|
107
|
+
};
|
|
88
108
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { clamp, sample, TAU, type EffectFactory } from './scene';
|
|
2
|
+
import { tide } from './tide';
|
|
2
3
|
|
|
3
4
|
const DURATION = { polarity: 2200, palette: 800 };
|
|
4
5
|
const PLANS = {
|
|
@@ -80,6 +81,7 @@ const controlPoints = (Q: Float32Array, pn: number) => {
|
|
|
80
81
|
};
|
|
81
82
|
|
|
82
83
|
export const paint: EffectFactory = (scene) => {
|
|
84
|
+
if (scene.kind === 'palette') return tide(scene);
|
|
83
85
|
const { width: W, height: H, kind } = scene;
|
|
84
86
|
const P = PLANS[kind];
|
|
85
87
|
const rnd = Math.random;
|
|
@@ -16,6 +16,9 @@ export interface Scene {
|
|
|
16
16
|
export interface Effect {
|
|
17
17
|
duration: number;
|
|
18
18
|
clips: readonly string[];
|
|
19
|
+
wash?: readonly (readonly [front: number, exit: number])[];
|
|
20
|
+
washOrigin?: readonly [x: number, y: number];
|
|
21
|
+
washSpread?: number;
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
export type EffectFactory = (scene: Scene) => Effect;
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
@layer zyncat.reset, zyncat.tokens, zyncat.base, zyncat.components;
|
|
2
2
|
|
|
3
|
+
@property --theme-transition-front {
|
|
4
|
+
syntax: '<length>';
|
|
5
|
+
inherits: true;
|
|
6
|
+
initial-value: 0px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@property --theme-transition-exit {
|
|
10
|
+
syntax: '<number>';
|
|
11
|
+
inherits: true;
|
|
12
|
+
initial-value: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
3
15
|
@layer zyncat.components {
|
|
4
16
|
.zc-theme-transition {
|
|
5
17
|
/* The z-index the arriving page paints at, above every panel it covers. */
|
|
@@ -21,6 +33,43 @@
|
|
|
21
33
|
}
|
|
22
34
|
.zc-theme-transition__inner {
|
|
23
35
|
box-sizing: border-box;
|
|
36
|
+
z-index: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.zc-theme-transition[data-kind='palette'] {
|
|
40
|
+
--theme-transition-band: 320px;
|
|
41
|
+
--theme-transition-wash: color-mix(in oklab, var(--accent) 26%, transparent);
|
|
42
|
+
}
|
|
43
|
+
.zc-theme-transition[data-kind='palette']::after {
|
|
44
|
+
--theme-transition-trail: calc(var(--theme-transition-band) * (1 - var(--theme-transition-exit)));
|
|
45
|
+
|
|
46
|
+
content: '';
|
|
47
|
+
position: absolute;
|
|
48
|
+
inset: 0;
|
|
49
|
+
z-index: 1;
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
background: linear-gradient(
|
|
52
|
+
90deg,
|
|
53
|
+
transparent calc(var(--theme-transition-front) - var(--theme-transition-trail)),
|
|
54
|
+
var(--theme-transition-wash) var(--theme-transition-front),
|
|
55
|
+
transparent calc(var(--theme-transition-front) + 1px)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
.zc-theme-transition[data-kind='palette'][data-direction='left']::after {
|
|
59
|
+
background: linear-gradient(
|
|
60
|
+
270deg,
|
|
61
|
+
transparent calc(var(--theme-transition-front) - var(--theme-transition-trail)),
|
|
62
|
+
var(--theme-transition-wash) var(--theme-transition-front),
|
|
63
|
+
transparent calc(var(--theme-transition-front) + 1px)
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
.zc-theme-transition[data-kind='palette'][data-wash='radial']::after {
|
|
67
|
+
background: radial-gradient(
|
|
68
|
+
circle at var(--theme-transition-origin),
|
|
69
|
+
transparent calc(var(--theme-transition-front) - var(--theme-transition-trail)),
|
|
70
|
+
var(--theme-transition-wash) var(--theme-transition-front),
|
|
71
|
+
transparent calc(var(--theme-transition-front) * (1 + var(--theme-transition-spread)) + 1px)
|
|
72
|
+
);
|
|
24
73
|
}
|
|
25
74
|
.zc-theme-transition *,
|
|
26
75
|
.zc-theme-transition *::before,
|
|
@@ -318,8 +318,28 @@ const build = (run: Run, { change, current, settings, factory }: Plan) => {
|
|
|
318
318
|
const effect = factory(scene);
|
|
319
319
|
const total = effect.duration / settings.speed;
|
|
320
320
|
const overlay = buildOverlay(next, effect.clips[0], ramp);
|
|
321
|
+
const wash = effect.wash;
|
|
322
|
+
if (wash) {
|
|
323
|
+
overlay.root.setAttribute('data-kind', scene.kind);
|
|
324
|
+
overlay.root.setAttribute('data-direction', scene.direction);
|
|
325
|
+
}
|
|
326
|
+
const washOrigin = effect.washOrigin;
|
|
327
|
+
if (washOrigin) {
|
|
328
|
+
const [x, y] = washOrigin;
|
|
329
|
+
overlay.root.setAttribute('data-wash', 'radial');
|
|
330
|
+
overlay.root.style.setProperty('--theme-transition-origin', `${x.toFixed(1)}px ${y.toFixed(1)}px`);
|
|
331
|
+
overlay.root.style.setProperty('--theme-transition-spread', String(effect.washSpread ?? 0));
|
|
332
|
+
}
|
|
321
333
|
const reveal = overlay.root.animate(
|
|
322
|
-
effect.clips.map((clipPath) =>
|
|
334
|
+
effect.clips.map((clipPath, index) => {
|
|
335
|
+
if (!wash) return { clipPath };
|
|
336
|
+
const [front, exit] = wash[index];
|
|
337
|
+
return {
|
|
338
|
+
clipPath,
|
|
339
|
+
'--theme-transition-front': `${front.toFixed(1)}px`,
|
|
340
|
+
'--theme-transition-exit': exit.toFixed(4),
|
|
341
|
+
};
|
|
342
|
+
}),
|
|
323
343
|
{ duration: total, easing: 'linear', fill: 'both' },
|
|
324
344
|
);
|
|
325
345
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { easeInOut, easeOut, sample, SAMPLE_MS, TAU, type EffectFactory } from './scene';
|
|
1
|
+
import { clamp, easeInOut, easeOut, sample, SAMPLE_MS, TAU, type EffectFactory } from './scene';
|
|
2
2
|
|
|
3
3
|
const DURATION = { polarity: 1250, palette: 560 };
|
|
4
4
|
const POINTS = 72;
|
|
@@ -35,17 +35,21 @@ export const tide: EffectFactory = (scene) => {
|
|
|
35
35
|
return waveOf(points, down ? `L${W} 0 L0 0Z` : `L${W} ${H} L0 ${H}Z`);
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
+
if (kind === 'polarity') {
|
|
39
|
+
return { duration: DURATION.polarity, clips: sample(DURATION.polarity, SAMPLE_MS, polarityFrame) };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const swell = Math.min(W * PALETTE_WAVE.widthShare, PALETTE_WAVE.maxAmplitude) * intensity;
|
|
43
|
+
const tilt = H * PALETTE_WAVE.tiltShare;
|
|
44
|
+
const margin = swell + tilt / 2 + PALETTE_WAVE.margin;
|
|
45
|
+
const reach = (p: number) => easeOut(p) * (W + 2 * margin) - margin;
|
|
46
|
+
|
|
38
47
|
const paletteFrame = (p: number, t: number) => {
|
|
39
48
|
const points: string[] = [];
|
|
40
|
-
const e = easeOut(p);
|
|
41
49
|
const env = Math.sin(Math.PI * p);
|
|
42
|
-
const
|
|
43
|
-
const amp = A0 * (REST_AMPLITUDE + (1 - REST_AMPLITUDE) * env);
|
|
44
|
-
const tilt = H * PALETTE_WAVE.tiltShare;
|
|
45
|
-
const m = A0 + tilt / 2 + PALETTE_WAVE.margin;
|
|
46
|
-
const span = W + 2 * m;
|
|
50
|
+
const amp = swell * (REST_AMPLITUDE + (1 - REST_AMPLITUDE) * env);
|
|
47
51
|
const right = direction === 'right';
|
|
48
|
-
const front = right ?
|
|
52
|
+
const front = right ? reach(p) : W - reach(p);
|
|
49
53
|
const sign = right ? 1 : -1;
|
|
50
54
|
for (let i = 0; i <= POINTS; i++) {
|
|
51
55
|
const v = i / POINTS;
|
|
@@ -59,7 +63,8 @@ export const tide: EffectFactory = (scene) => {
|
|
|
59
63
|
};
|
|
60
64
|
|
|
61
65
|
return {
|
|
62
|
-
duration: DURATION
|
|
63
|
-
clips: sample(DURATION
|
|
66
|
+
duration: DURATION.palette,
|
|
67
|
+
clips: sample(DURATION.palette, SAMPLE_MS, paletteFrame),
|
|
68
|
+
wash: sample(DURATION.palette, SAMPLE_MS, (p) => [reach(p), clamp((reach(p) - W) / margin, 0, 1)] as const),
|
|
64
69
|
};
|
|
65
70
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import type { PointerEvent } from 'react';
|
|
5
|
+
|
|
6
|
+
const FIRST_REPEAT_MS = 400;
|
|
7
|
+
const FASTEST_REPEAT_MS = 40;
|
|
8
|
+
const ACCELERATION = 0.8;
|
|
9
|
+
|
|
10
|
+
export function useHoldRepeat(onStep: (direction: 1 | -1) => boolean) {
|
|
11
|
+
const stepRef = useRef(onStep);
|
|
12
|
+
const timerRef = useRef<ReturnType<typeof setTimeout>>(undefined);
|
|
13
|
+
const repeatedRef = useRef(false);
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
stepRef.current = onStep;
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const stop = () => clearTimeout(timerRef.current);
|
|
20
|
+
useEffect(() => stop, []);
|
|
21
|
+
|
|
22
|
+
return (direction: 1 | -1) => ({
|
|
23
|
+
onPointerDown: (e: PointerEvent) => {
|
|
24
|
+
if (e.button !== 0 || e.currentTarget.matches(':disabled')) return;
|
|
25
|
+
repeatedRef.current = false;
|
|
26
|
+
let delay = FIRST_REPEAT_MS;
|
|
27
|
+
const tick = () => {
|
|
28
|
+
repeatedRef.current = true;
|
|
29
|
+
if (!stepRef.current(direction)) return;
|
|
30
|
+
delay = Math.max(FASTEST_REPEAT_MS, delay * ACCELERATION);
|
|
31
|
+
timerRef.current = setTimeout(tick, delay);
|
|
32
|
+
};
|
|
33
|
+
timerRef.current = setTimeout(tick, delay);
|
|
34
|
+
},
|
|
35
|
+
onPointerUp: stop,
|
|
36
|
+
onPointerLeave: stop,
|
|
37
|
+
onPointerCancel: stop,
|
|
38
|
+
onClick: () => {
|
|
39
|
+
if (!repeatedRef.current) stepRef.current(direction);
|
|
40
|
+
repeatedRef.current = false;
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
@@ -35,11 +35,16 @@ export function useScrollEdges(
|
|
|
35
35
|
sync();
|
|
36
36
|
el.addEventListener('scroll', sync, { passive: true });
|
|
37
37
|
const ro = new ResizeObserver(sync);
|
|
38
|
+
const mo = new MutationObserver(sync);
|
|
38
39
|
ro.observe(el);
|
|
39
|
-
if (content && el.firstElementChild)
|
|
40
|
+
if (content && el.firstElementChild) {
|
|
41
|
+
ro.observe(el.firstElementChild);
|
|
42
|
+
mo.observe(el.firstElementChild, { childList: true, subtree: true });
|
|
43
|
+
}
|
|
40
44
|
return () => {
|
|
41
45
|
el.removeEventListener('scroll', sync);
|
|
42
46
|
ro.disconnect();
|
|
47
|
+
mo.disconnect();
|
|
43
48
|
};
|
|
44
49
|
}, [sync, content]);
|
|
45
50
|
return sync;
|
|
@@ -16,6 +16,8 @@ import {
|
|
|
16
16
|
Clock,
|
|
17
17
|
Info,
|
|
18
18
|
MagnifyingGlass,
|
|
19
|
+
Minus,
|
|
20
|
+
Plus,
|
|
19
21
|
Warning,
|
|
20
22
|
WarningCircle,
|
|
21
23
|
X,
|
|
@@ -37,6 +39,8 @@ const REGISTRY = {
|
|
|
37
39
|
'caret-left': CaretLeft,
|
|
38
40
|
'caret-right': CaretRight,
|
|
39
41
|
'magnifying-glass': MagnifyingGlass,
|
|
42
|
+
minus: Minus,
|
|
43
|
+
plus: Plus,
|
|
40
44
|
calendar: Calendar,
|
|
41
45
|
'calendar-dot': CalendarDot,
|
|
42
46
|
clock: Clock,
|
|
@@ -2,11 +2,29 @@ import type { DataAttributes } from '../../../dom-props';
|
|
|
2
2
|
|
|
3
3
|
export type MenuHighlight = 'neutral' | 'accent';
|
|
4
4
|
|
|
5
|
+
export type MenuSize = 'sm' | 'md' | 'lg';
|
|
6
|
+
|
|
7
|
+
export type MenuWeight = 'regular' | 'medium' | 'semibold';
|
|
8
|
+
|
|
9
|
+
export type MenuWidth = 'auto' | 'trigger' | 'sm' | 'md' | 'lg';
|
|
10
|
+
|
|
5
11
|
export interface MenuHighlightProps {
|
|
6
12
|
highlight?: MenuHighlight;
|
|
7
13
|
rail?: boolean;
|
|
8
14
|
}
|
|
9
15
|
|
|
10
|
-
export
|
|
11
|
-
|
|
16
|
+
export interface MenuSurfaceProps extends MenuHighlightProps {
|
|
17
|
+
size?: MenuSize;
|
|
18
|
+
weight?: MenuWeight;
|
|
19
|
+
width?: MenuWidth;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function menuSurfaceAttrs({ highlight, rail, size, weight, width }: MenuSurfaceProps): DataAttributes {
|
|
23
|
+
return {
|
|
24
|
+
'data-highlight': highlight === 'accent' ? 'accent' : undefined,
|
|
25
|
+
'data-rail': rail ? 'true' : undefined,
|
|
26
|
+
'data-size': size ?? 'md',
|
|
27
|
+
'data-weight': weight ?? 'medium',
|
|
28
|
+
'data-width': width ?? 'auto',
|
|
29
|
+
};
|
|
12
30
|
}
|
|
@@ -5,9 +5,35 @@ import './menu-surface.css';
|
|
|
5
5
|
import type { HTMLAttributes, ReactNode, Ref } from 'react';
|
|
6
6
|
|
|
7
7
|
import type { DataAttributes } from '../../../dom-props';
|
|
8
|
-
import {
|
|
8
|
+
import { Motion } from '../../../motion/element';
|
|
9
|
+
import type { MotionSpecs } from '../../../motion/use-motion';
|
|
10
|
+
import { UIMotion } from '../../../tokens/motion-tokens';
|
|
9
11
|
import { cx } from '../utils/cx';
|
|
10
12
|
|
|
13
|
+
const FADE_STAGGER = 0.06;
|
|
14
|
+
|
|
15
|
+
function collapseMotion(): MotionSpecs {
|
|
16
|
+
const size = { duration: UIMotion.dur.slow, ease: UIMotion.ease.entrance };
|
|
17
|
+
return {
|
|
18
|
+
animate: [
|
|
19
|
+
{ height: [0, 'auto'], timing: size },
|
|
20
|
+
{ opacity: [0, 1], timing: { ...size, delay: FADE_STAGGER } },
|
|
21
|
+
],
|
|
22
|
+
exit: [
|
|
23
|
+
{ height: [0], timing: size },
|
|
24
|
+
{ opacity: [0], timing: { duration: UIMotion.dur.base, ease: UIMotion.ease.standard } },
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function MenuGroupLabel({ className, children }: { className?: string; children: ReactNode }) {
|
|
30
|
+
return (
|
|
31
|
+
<Motion className={cx('zc-menu-group-label', className)} {...collapseMotion()}>
|
|
32
|
+
{children}
|
|
33
|
+
</Motion>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
11
37
|
export interface MenuRowProps extends HTMLAttributes<HTMLDivElement>, DataAttributes {
|
|
12
38
|
ref?: Ref<HTMLDivElement>;
|
|
13
39
|
icon?: ReactNode;
|
|
@@ -18,17 +44,19 @@ export interface MenuRowProps extends HTMLAttributes<HTMLDivElement>, DataAttrib
|
|
|
18
44
|
|
|
19
45
|
export function MenuRow({ ref, icon, label, description, trailing, className, ...rest }: MenuRowProps) {
|
|
20
46
|
return (
|
|
21
|
-
<
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
47
|
+
<Motion
|
|
48
|
+
ref={ref as Ref<HTMLElement | null>}
|
|
49
|
+
className={cx('zc-menu-row', className)}
|
|
50
|
+
{...collapseMotion()}
|
|
51
|
+
{...rest}
|
|
52
|
+
data-desc={description ? 'true' : undefined}
|
|
53
|
+
>
|
|
54
|
+
{icon && <span className="zc-menu-row__icon">{icon}</span>}
|
|
27
55
|
<span className="zc-menu-row__text">
|
|
28
56
|
<span className="zc-menu-row__label">{label}</span>
|
|
29
57
|
{description && <span className="zc-menu-row__desc">{description}</span>}
|
|
30
58
|
</span>
|
|
31
59
|
{trailing}
|
|
32
|
-
</
|
|
60
|
+
</Motion>
|
|
33
61
|
);
|
|
34
62
|
}
|