@zyncat/ui 0.13.0 → 0.15.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/README.md +72 -13
- package/dist/alert.css +26 -33
- package/dist/alert.js +18 -17
- package/dist/alert.js.map +1 -1
- package/dist/avatar-group.js +2 -2
- package/dist/avatar-group.js.map +1 -1
- package/dist/avatar.css +51 -50
- package/dist/avatar.js +29 -7
- package/dist/avatar.js.map +1 -1
- package/dist/badge.css +30 -36
- package/dist/badge.js +1 -1
- package/dist/button.css +80 -96
- package/dist/button.js +1 -1
- package/dist/checkbox.css +27 -32
- package/dist/checkbox.js +2 -2
- package/dist/{chunk-RJFGWJ4W.js → chunk-3XRVPCIM.js} +6 -6
- package/dist/chunk-3XRVPCIM.js.map +1 -0
- package/dist/{chunk-M43IOM5C.js → chunk-5GBV45YD.js} +3 -3
- package/dist/{chunk-M43IOM5C.js.map → chunk-5GBV45YD.js.map} +1 -1
- package/dist/{chunk-45R4Z5XN.js → chunk-5VC3TUZ2.js} +4 -4
- package/dist/{chunk-45R4Z5XN.js.map → chunk-5VC3TUZ2.js.map} +1 -1
- package/dist/{chunk-A5WTZACK.js → chunk-5W5TKANX.js} +3 -3
- package/dist/{chunk-A5WTZACK.js.map → chunk-5W5TKANX.js.map} +1 -1
- package/dist/{chunk-AADAJL7D.js → chunk-5X3MJRIM.js} +8 -9
- package/dist/chunk-5X3MJRIM.js.map +1 -0
- package/dist/{chunk-TCUCYFT7.js → chunk-6SUHSSOK.js} +3 -3
- package/dist/{chunk-TCUCYFT7.js.map → chunk-6SUHSSOK.js.map} +1 -1
- package/dist/{chunk-DDRSMHN4.js → chunk-6X3G4GIM.js} +3 -3
- package/dist/{chunk-DDRSMHN4.js.map → chunk-6X3G4GIM.js.map} +1 -1
- package/dist/{chunk-TYHR4VNM.js → chunk-AREEMG47.js} +10 -8
- package/dist/chunk-AREEMG47.js.map +1 -0
- package/dist/{chunk-EF6RPXU7.js → chunk-BH4JFWXQ.js} +36 -31
- package/dist/chunk-BH4JFWXQ.js.map +1 -0
- package/dist/{chunk-TVYH4AN7.js → chunk-BTF6DAE3.js} +13 -13
- package/dist/chunk-BTF6DAE3.js.map +1 -0
- package/dist/{chunk-CF4QHO4N.js → chunk-CAXQJSIE.js} +10 -10
- package/dist/{chunk-CF4QHO4N.js.map → chunk-CAXQJSIE.js.map} +1 -1
- package/dist/{chunk-4C5RZXBT.js → chunk-CFRGQJ23.js} +8 -8
- package/dist/chunk-CFRGQJ23.js.map +1 -0
- package/dist/{chunk-IJS7TPGV.js → chunk-FEXUS4SV.js} +6 -5
- package/dist/chunk-FEXUS4SV.js.map +1 -0
- package/dist/{chunk-227ZW4V7.js → chunk-FLQVOSFC.js} +11 -11
- package/dist/chunk-FLQVOSFC.js.map +1 -0
- package/dist/{chunk-FONOS5RN.js → chunk-FVPNICF4.js} +11 -10
- package/dist/chunk-FVPNICF4.js.map +1 -0
- package/dist/{chunk-I45AU6KH.js → chunk-GGDAMIBH.js} +13 -7
- package/dist/chunk-GGDAMIBH.js.map +1 -0
- package/dist/{chunk-4BSHB7R3.js → chunk-GJTHWB6O.js} +9 -9
- package/dist/chunk-GJTHWB6O.js.map +1 -0
- package/dist/{chunk-EAI4POPB.js → chunk-GOLSYGRA.js} +45 -75
- package/dist/chunk-GOLSYGRA.js.map +1 -0
- package/dist/chunk-H3X2263Y.js +17 -0
- package/dist/chunk-H3X2263Y.js.map +1 -0
- package/dist/chunk-K45CWVHS.js +53 -0
- package/dist/chunk-K45CWVHS.js.map +1 -0
- package/dist/{chunk-JY6A2ZJZ.js → chunk-LNAV5E7S.js} +2 -2
- package/dist/{chunk-JY6A2ZJZ.js.map → chunk-LNAV5E7S.js.map} +1 -1
- package/dist/{chunk-TUTXXC3W.js → chunk-MDSRZ4QR.js} +3 -3
- package/dist/{chunk-TUTXXC3W.js.map → chunk-MDSRZ4QR.js.map} +1 -1
- package/dist/chunk-N2GJEO5Z.js +101 -0
- package/dist/chunk-N2GJEO5Z.js.map +1 -0
- package/dist/chunk-PU3QWBEL.js +39 -0
- package/dist/chunk-PU3QWBEL.js.map +1 -0
- package/dist/{chunk-43M6GQ4Q.js → chunk-PWQVSVXR.js} +51 -32
- package/dist/chunk-PWQVSVXR.js.map +1 -0
- package/dist/chunk-QGVFFT2B.js +14 -0
- package/dist/chunk-QGVFFT2B.js.map +1 -0
- package/dist/{chunk-5PZ43DCG.js → chunk-RBSHRRNO.js} +12 -13
- package/dist/chunk-RBSHRRNO.js.map +1 -0
- package/dist/{chunk-XNIYSAMJ.js → chunk-RW2A4M2Q.js} +14 -9
- package/dist/chunk-RW2A4M2Q.js.map +1 -0
- package/dist/{chunk-HY5MPISE.js → chunk-UYSXJ7MH.js} +9 -9
- package/dist/chunk-UYSXJ7MH.js.map +1 -0
- package/dist/chunk-VDOBLABP.js +38 -0
- package/dist/chunk-VDOBLABP.js.map +1 -0
- package/dist/chunk-VNVVG47J.js +12 -0
- package/dist/chunk-VNVVG47J.js.map +1 -0
- package/dist/{chunk-3MPF7FZV.js → chunk-WCWV5IX6.js} +3 -3
- package/dist/{chunk-3MPF7FZV.js.map → chunk-WCWV5IX6.js.map} +1 -1
- package/dist/{chunk-VAXCXZ53.js → chunk-WZUTBJC4.js} +5 -4
- package/dist/chunk-WZUTBJC4.js.map +1 -0
- package/dist/cli.js +137 -25
- package/dist/collapse.css +15 -30
- package/dist/collapse.js +1 -1
- package/dist/confetti.css +19 -12
- package/dist/confetti.js +7 -6
- package/dist/confetti.js.map +1 -1
- package/dist/count-badge.js +2 -2
- package/dist/date-field.js +20 -19
- package/dist/date-field.js.map +1 -1
- package/dist/date-picker.css +131 -154
- package/dist/date-range-field.js +55 -54
- package/dist/date-range-field.js.map +1 -1
- package/dist/datetime-field.js +24 -23
- package/dist/datetime-field.js.map +1 -1
- package/dist/dialog.css +31 -41
- package/dist/dialog.js +23 -22
- package/dist/dialog.js.map +1 -1
- package/dist/digit-strip.css +16 -16
- package/dist/dropdown.css +36 -27
- package/dist/dropdown.js +77 -40
- package/dist/dropdown.js.map +1 -1
- package/dist/emoji-picker.js +44 -45
- package/dist/emoji-picker.js.map +1 -1
- package/dist/facebook-feed.css +145 -148
- package/dist/facebook-feed.js +106 -102
- package/dist/facebook-feed.js.map +1 -1
- package/dist/flow-field.css +8 -4
- package/dist/flow-field.js +7 -6
- package/dist/flow-field.js.map +1 -1
- package/dist/glide.js +4 -3
- package/dist/icon.css +7 -10
- package/dist/input.css +76 -84
- package/dist/instagram-feed.css +65 -66
- package/dist/instagram-feed.js +61 -44
- package/dist/instagram-feed.js.map +1 -1
- package/dist/lens.css +42 -38
- package/dist/lens.js +17 -16
- package/dist/lens.js.map +1 -1
- package/dist/mcp.js +3 -2
- package/dist/menu-surface.css +54 -34
- package/dist/modal.css +2 -4
- package/dist/modal.js +12 -11
- package/dist/modal.js.map +1 -1
- package/dist/morphing-text.css +26 -16
- package/dist/morphing-text.js +14 -13
- package/dist/morphing-text.js.map +1 -1
- package/dist/motion-devtools.css +42 -68
- package/dist/motion-devtools.js +47 -39
- package/dist/motion-devtools.js.map +1 -1
- package/dist/motion-tokens.js +1 -1
- package/dist/multi-select.js +21 -16
- package/dist/multi-select.js.map +1 -1
- package/dist/number-field.js +14 -14
- package/dist/number-field.js.map +1 -1
- package/dist/odometer.css +22 -16
- package/dist/odometer.js +12 -11
- package/dist/odometer.js.map +1 -1
- package/dist/otp-field.js +3 -3
- package/dist/otp-field.js.map +1 -1
- package/dist/overlay.css +4 -9
- package/dist/pagination.css +10 -15
- package/dist/pagination.js +11 -10
- package/dist/pagination.js.map +1 -1
- package/dist/popover.css +13 -15
- package/dist/popover.js +10 -9
- package/dist/radio-group.css +60 -73
- package/dist/radio-group.js +30 -29
- package/dist/radio-group.js.map +1 -1
- package/dist/select.css +66 -75
- package/dist/select.js +19 -14
- package/dist/select.js.map +1 -1
- package/dist/sheet.css +12 -14
- package/dist/sheet.js +11 -10
- package/dist/status-badge.js +9 -9
- package/dist/status-badge.js.map +1 -1
- package/dist/styles.css +34 -34
- package/dist/support-rail.css +116 -100
- package/dist/support-rail.js +41 -40
- package/dist/support-rail.js.map +1 -1
- package/dist/table.css +76 -84
- package/dist/table.js +42 -41
- package/dist/table.js.map +1 -1
- package/dist/tabs.css +82 -90
- package/dist/tabs.js +23 -20
- package/dist/tabs.js.map +1 -1
- package/dist/tag.css +48 -53
- package/dist/tag.js +13 -12
- package/dist/tag.js.map +1 -1
- package/dist/text-field.js +5 -5
- package/dist/textarea.css +46 -49
- package/dist/textarea.js +16 -16
- package/dist/textarea.js.map +1 -1
- package/dist/theme.js +31 -15
- package/dist/theme.js.map +1 -1
- package/dist/tiktok.css +113 -117
- package/dist/tiktok.js +53 -52
- package/dist/tiktok.js.map +1 -1
- package/dist/time-field.js +26 -20
- package/dist/time-field.js.map +1 -1
- package/dist/toast-store.js +2 -1
- package/dist/toast.css +49 -65
- package/dist/toast.js +32 -26
- package/dist/toast.js.map +1 -1
- package/dist/toggle-tag.js +22 -13
- package/dist/toggle-tag.js.map +1 -1
- package/dist/toggle.css +26 -31
- package/dist/toggle.js +7 -7
- package/dist/toggle.js.map +1 -1
- package/dist/tooltip.css +16 -23
- package/dist/tooltip.js +117 -95
- package/dist/tooltip.js.map +1 -1
- package/dist/trigger.css +3 -3
- package/dist/types/components/composites/alert/Alert.d.ts +1 -2
- package/dist/types/components/composites/date-picker/TimeField.d.ts +1 -2
- package/dist/types/components/composites/date-picker/field-shell.d.ts +1 -1
- package/dist/types/components/composites/date-picker/time-core.d.ts +1 -2
- package/dist/types/components/composites/dropdown/Dropdown.d.ts +9 -1
- package/dist/types/components/composites/dropdown/types.d.ts +14 -0
- package/dist/types/components/composites/emoji-picker/EmojiPickerPanel.d.ts +1 -1
- package/dist/types/components/composites/emoji-picker/data.d.ts +2 -5
- package/dist/types/components/composites/emoji-picker/react/useEmojiPicker.d.ts +0 -11
- package/dist/types/components/composites/emoji-picker/types.d.ts +3 -8
- package/dist/types/components/composites/select/MultiSelect.d.ts +6 -1
- package/dist/types/components/composites/select/Select.d.ts +6 -1
- package/dist/types/components/composites/select/core/index.d.ts +1 -1
- package/dist/types/components/composites/select/core/menu.d.ts +3 -3
- package/dist/types/components/composites/select/core/panel.d.ts +3 -3
- package/dist/types/components/composites/tabs/Tabs.d.ts +7 -10
- package/dist/types/components/composites/toast/Toast.d.ts +1 -1
- package/dist/types/components/composites/tooltip/Tooltip.d.ts +9 -1
- package/dist/types/components/composites/tooltip/tooltip-store.d.ts +5 -6
- package/dist/types/components/dev/MotionDevtools.d.ts +3 -1
- package/dist/types/components/internal/hooks/use-host-election.d.ts +8 -0
- package/dist/types/components/internal/icon/Icon.d.ts +1 -3
- package/dist/types/components/internal/menu/highlight.d.ts +7 -0
- package/dist/types/components/internal/utils/activation.d.ts +0 -4
- package/dist/types/components/primitives/avatar/Avatar.d.ts +1 -1
- package/dist/types/components/primitives/button/Button.d.ts +1 -1
- package/dist/types/components/primitives/input/TextField.d.ts +1 -2
- package/dist/types/components/primitives/textarea/Textarea.d.ts +0 -1
- package/dist/types/shared-slot.d.ts +1 -0
- package/dist/types/tokens/component-styles.generated.d.ts +79 -151
- package/dist/types/tokens/motion-defaults.generated.d.ts +34 -0
- package/dist/types/tokens/motion-scale.d.ts +2 -2
- package/dist/types/tokens/motion-tokens.d.ts +7 -0
- package/dist/types/tokens/theme-sync.d.ts +3 -0
- package/dist/types/tokens/theme-tokens.generated.d.ts +669 -1105
- package/dist/typing-lines.css +17 -10
- package/dist/typing-lines.js +9 -8
- package/dist/typing-lines.js.map +1 -1
- package/dist/weight-field.css +31 -17
- package/dist/weight-field.js +4 -4
- package/dist/weight-field.js.map +1 -1
- package/dist/youtube.css +90 -96
- package/dist/youtube.js +87 -86
- package/dist/youtube.js.map +1 -1
- package/package.json +3 -1
- package/skills/zyncat-ui/SKILL.md +5 -3
- package/skills/zyncat-ui/references/components.md +4 -4
- package/skills/zyncat-ui/references/theming.md +105 -34
- package/src/components/composites/alert/Alert.tsx +9 -10
- package/src/components/composites/alert/alert.css +26 -33
- package/src/components/composites/date-picker/DateField.tsx +1 -1
- package/src/components/composites/date-picker/DateRangeField.tsx +1 -1
- package/src/components/composites/date-picker/DateTimeField.tsx +4 -4
- package/src/components/composites/date-picker/TimeField.tsx +8 -5
- package/src/components/composites/date-picker/calendar-panel.tsx +25 -20
- package/src/components/composites/date-picker/date-picker.css +131 -154
- package/src/components/composites/date-picker/field-shell.tsx +7 -7
- package/src/components/composites/date-picker/range-panel.tsx +34 -34
- package/src/components/composites/date-picker/time-core.tsx +4 -6
- package/src/components/composites/date-picker/use-day-focus.ts +1 -1
- package/src/components/composites/dialog/Dialog.tsx +11 -11
- package/src/components/composites/dialog/dialog.css +31 -41
- package/src/components/composites/dropdown/Dropdown.tsx +15 -2
- package/src/components/composites/dropdown/Dropdown.usage.md +7 -4
- package/src/components/composites/dropdown/dropdown.css +36 -27
- package/src/components/composites/dropdown/menu-panel.tsx +56 -27
- package/src/components/composites/dropdown/types.ts +28 -6
- package/src/components/composites/emoji-picker/EmojiPickerPanel.tsx +5 -4
- package/src/components/composites/emoji-picker/EmojiPickerPanel.usage.md +4 -4
- package/src/components/composites/emoji-picker/data.ts +2 -5
- package/src/components/composites/emoji-picker/dom.ts +6 -6
- package/src/components/composites/emoji-picker/react/category-bar.tsx +6 -6
- package/src/components/composites/emoji-picker/react/useEmojiPicker.ts +0 -11
- package/src/components/composites/emoji-picker/scaffold.ts +7 -7
- package/src/components/composites/emoji-picker/search.ts +0 -7
- package/src/components/composites/emoji-picker/styles.css +34 -34
- package/src/components/composites/emoji-picker/types.ts +3 -8
- package/src/components/composites/modal/Modal.tsx +2 -2
- package/src/components/composites/modal/modal.css +2 -4
- package/src/components/composites/pagination/Pagination.tsx +7 -7
- package/src/components/composites/pagination/pagination.css +10 -15
- package/src/components/composites/popover/Popover.tsx +2 -2
- package/src/components/composites/popover/popover.css +13 -15
- package/src/components/composites/select/MultiSelect.tsx +11 -2
- package/src/components/composites/select/MultiSelect.usage.md +2 -1
- package/src/components/composites/select/Select.tsx +10 -1
- package/src/components/composites/select/Select.usage.md +2 -1
- package/src/components/composites/select/core/index.ts +1 -1
- package/src/components/composites/select/core/menu.tsx +19 -4
- package/src/components/composites/select/core/panel.tsx +19 -15
- package/src/components/composites/select/core/trigger.tsx +5 -5
- package/src/components/composites/select/select.css +66 -75
- package/src/components/composites/sheet/Sheet.tsx +2 -2
- package/src/components/composites/sheet/sheet.css +12 -14
- package/src/components/composites/sheet/use-sheet-drag.ts +1 -1
- package/src/components/composites/table/Table.tsx +35 -35
- package/src/components/composites/table/table.css +76 -84
- package/src/components/composites/tabs/Tabs.tsx +20 -21
- package/src/components/composites/tabs/Tabs.usage.md +3 -2
- package/src/components/composites/tabs/tabs.css +82 -90
- package/src/components/composites/toast/Toast.tsx +23 -18
- package/src/components/composites/toast/toast-store.ts +8 -6
- package/src/components/composites/toast/toast.css +49 -65
- package/src/components/composites/tooltip/Tooltip.tsx +40 -19
- package/src/components/composites/tooltip/Tooltip.usage.md +9 -1
- package/src/components/composites/tooltip/tooltip-host.tsx +55 -23
- package/src/components/composites/tooltip/tooltip-store.ts +36 -53
- package/src/components/composites/tooltip/tooltip.css +16 -23
- package/src/components/compound/support-rail/SupportRail.tsx +33 -33
- package/src/components/compound/support-rail/support-rail.css +116 -100
- package/src/components/dev/MotionDevtools.tsx +28 -17
- package/src/components/dev/MotionDevtools.usage.md +2 -2
- package/src/components/dev/motion-devtools.css +42 -68
- package/src/components/dev/slowmo-engine.ts +16 -15
- package/src/components/expressive/confetti/Confetti.tsx +4 -4
- package/src/components/expressive/confetti/confetti.css +19 -12
- package/src/components/expressive/facebook-feed/chrome.tsx +2 -2
- package/src/components/expressive/facebook-feed/facebook-feed.css +145 -148
- package/src/components/expressive/facebook-feed/post.tsx +39 -39
- package/src/components/expressive/facebook-feed/reel.tsx +41 -37
- package/src/components/expressive/facebook-feed/story.tsx +27 -27
- package/src/components/expressive/flow-field/FlowField.tsx +4 -4
- package/src/components/expressive/flow-field/flow-field.css +8 -4
- package/src/components/expressive/instagram-feed/InstagramFeed.tsx +52 -44
- package/src/components/expressive/instagram-feed/instagram-feed.css +65 -66
- package/src/components/expressive/lens/Lens.tsx +14 -14
- package/src/components/expressive/lens/lens.css +42 -38
- package/src/components/expressive/morphing-text/MorphingText.tsx +12 -13
- package/src/components/expressive/morphing-text/morphing-text.css +26 -16
- package/src/components/expressive/odometer/Odometer.tsx +9 -9
- package/src/components/expressive/odometer/odometer.css +22 -16
- package/src/components/expressive/tiktok/TikTok.tsx +54 -54
- package/src/components/expressive/tiktok/tiktok.css +113 -117
- package/src/components/expressive/typing-lines/TypingLines.tsx +0 -0
- package/src/components/expressive/typing-lines/typing-lines.css +17 -10
- package/src/components/expressive/weight-field/WeightField.tsx +4 -4
- package/src/components/expressive/weight-field/weight-field.css +31 -17
- package/src/components/expressive/youtube/YouTube.tsx +4 -4
- package/src/components/expressive/youtube/glyphs.tsx +16 -16
- package/src/components/expressive/youtube/media.tsx +3 -3
- package/src/components/expressive/youtube/post.tsx +28 -28
- package/src/components/expressive/youtube/short.tsx +25 -25
- package/src/components/expressive/youtube/video.tsx +13 -13
- package/src/components/expressive/youtube/youtube.css +90 -96
- package/src/components/internal/glass/glass.css +19 -22
- package/src/components/internal/glass/glint.ts +3 -3
- package/src/components/internal/hooks/use-host-election.ts +46 -0
- package/src/components/internal/icon/Icon.tsx +1 -5
- package/src/components/internal/icon/IconSlot.tsx +1 -1
- package/src/components/internal/icon/icon.css +7 -10
- package/src/components/internal/menu/highlight.ts +12 -0
- package/src/components/internal/menu/menu-row.tsx +5 -5
- package/src/components/internal/menu/menu-surface.css +54 -34
- package/src/components/internal/overlay/layer.tsx +2 -1
- package/src/components/internal/overlay/modal.tsx +5 -4
- package/src/components/internal/overlay/overlay.css +4 -9
- package/src/components/internal/overlay/trigger.css +3 -3
- package/src/components/internal/utils/activation.ts +0 -4
- package/src/components/primitives/avatar/Avatar.tsx +24 -8
- package/src/components/primitives/avatar/AvatarGroup.tsx +4 -4
- package/src/components/primitives/avatar/avatar.css +51 -50
- package/src/components/primitives/badge/Badge.tsx +9 -9
- package/src/components/primitives/badge/StatusBadge.tsx +7 -7
- package/src/components/primitives/badge/badge.css +30 -36
- package/src/components/primitives/badge/digit-strip.css +16 -16
- package/src/components/primitives/badge/digit-strip.tsx +4 -4
- package/src/components/primitives/button/Button.tsx +8 -8
- package/src/components/primitives/button/button.css +80 -96
- package/src/components/primitives/checkbox/Checkbox.tsx +10 -4
- package/src/components/primitives/checkbox/check-glyph.tsx +5 -5
- package/src/components/primitives/checkbox/checkbox.css +27 -32
- package/src/components/primitives/collapse/Collapse.tsx +2 -2
- package/src/components/primitives/collapse/collapse.css +15 -30
- package/src/components/primitives/collapse/collapse.typecheck.tsx +1 -1
- package/src/components/primitives/input/NumberField.tsx +11 -11
- package/src/components/primitives/input/OtpField.tsx +3 -3
- package/src/components/primitives/input/TextField.tsx +9 -10
- package/src/components/primitives/input/field-chrome.tsx +6 -6
- package/src/components/primitives/input/input.css +76 -84
- package/src/components/primitives/radio-group/RadioGroup.tsx +23 -23
- package/src/components/primitives/radio-group/radio-group.css +60 -73
- package/src/components/primitives/tag/Tag.tsx +5 -5
- package/src/components/primitives/tag/ToggleTag.tsx +11 -6
- package/src/components/primitives/tag/tag.css +48 -53
- package/src/components/primitives/textarea/Textarea.tsx +13 -14
- package/src/components/primitives/textarea/textarea.css +46 -49
- package/src/components/primitives/toggle/Toggle.tsx +7 -7
- package/src/components/primitives/toggle/toggle.css +26 -31
- package/src/engine/animate.ts +2 -1
- package/src/engine/flip.ts +2 -1
- package/src/mcp/server.ts +3 -1
- package/src/motion/flip.ts +7 -8
- package/src/motion/glide.tsx +41 -26
- package/src/shared-slot.ts +10 -0
- package/src/styles.css +7 -15
- package/src/tokens/base.css +15 -0
- package/src/tokens/color.css +19 -59
- package/src/tokens/component-styles.generated.ts +79 -151
- package/src/tokens/dark.css +63 -0
- package/src/tokens/decisions.css +26 -0
- package/src/tokens/elevation.css +71 -21
- package/src/tokens/fonts.css +0 -2
- package/src/tokens/glass.css +15 -9
- package/src/tokens/motion-defaults.generated.ts +21 -0
- package/src/tokens/motion-scale.ts +2 -2
- package/src/tokens/motion-tokens.ts +65 -40
- package/src/tokens/motion-tokens.usage.md +5 -2
- package/src/tokens/motion.css +12 -22
- package/src/tokens/radius.css +10 -9
- package/src/tokens/semantic.css +57 -37
- package/src/tokens/spacing.css +5 -6
- package/src/tokens/theme-sync.tsx +15 -0
- package/src/tokens/theme-tokens.generated.ts +682 -1109
- package/src/tokens/theme.tsx +22 -16
- package/src/tokens/theme.usage.md +19 -13
- package/src/tokens/typography.css +16 -19
- package/tailwind.css +193 -0
- package/dist/chunk-227ZW4V7.js.map +0 -1
- package/dist/chunk-43M6GQ4Q.js.map +0 -1
- package/dist/chunk-4BSHB7R3.js.map +0 -1
- package/dist/chunk-4C5RZXBT.js.map +0 -1
- package/dist/chunk-5PZ43DCG.js.map +0 -1
- package/dist/chunk-7IZJERGA.js +0 -80
- package/dist/chunk-7IZJERGA.js.map +0 -1
- package/dist/chunk-AADAJL7D.js.map +0 -1
- package/dist/chunk-CNWTIMIP.js +0 -39
- package/dist/chunk-CNWTIMIP.js.map +0 -1
- package/dist/chunk-EAI4POPB.js.map +0 -1
- package/dist/chunk-EF6RPXU7.js.map +0 -1
- package/dist/chunk-FONOS5RN.js.map +0 -1
- package/dist/chunk-FQEHSKEI.js +0 -38
- package/dist/chunk-FQEHSKEI.js.map +0 -1
- package/dist/chunk-HY5MPISE.js.map +0 -1
- package/dist/chunk-I45AU6KH.js.map +0 -1
- package/dist/chunk-IJS7TPGV.js.map +0 -1
- package/dist/chunk-OWNMRMPN.js +0 -14
- package/dist/chunk-OWNMRMPN.js.map +0 -1
- package/dist/chunk-RJFGWJ4W.js.map +0 -1
- package/dist/chunk-TVYH4AN7.js.map +0 -1
- package/dist/chunk-TYHR4VNM.js.map +0 -1
- package/dist/chunk-VAXCXZ53.js.map +0 -1
- package/dist/chunk-XNIYSAMJ.js.map +0 -1
- package/dist/chunk-Y2YA7QRF.js +0 -17
- package/dist/chunk-Y2YA7QRF.js.map +0 -1
- package/src/tokens/avatar.css +0 -24
- package/src/tokens/icons.css +0 -11
- package/src/tokens/layers.css +0 -11
package/src/tokens/elevation.css
CHANGED
|
@@ -1,33 +1,83 @@
|
|
|
1
|
-
/* Elevation -
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
panel reads soft and unanchored no matter how large the ambient blur is. */
|
|
1
|
+
/* Elevation - shadows, top-light highlights, rings and border widths, on every theme root.
|
|
2
|
+
Three strengths scale the lighting per polarity: every shadow, white highlight and cast-light
|
|
3
|
+
alpha is a multiple of --shadow-strength, --sheen-strength or --glow-strength. */
|
|
5
4
|
|
|
6
5
|
@layer zyncat.tokens, zyncat.components;
|
|
7
6
|
|
|
8
7
|
@layer zyncat.tokens {
|
|
9
8
|
:root {
|
|
10
|
-
|
|
11
|
-
--
|
|
12
|
-
--
|
|
9
|
+
/* Border widths - weight comes from the colour, not the thickness. */
|
|
10
|
+
--border-hairline: 1px;
|
|
11
|
+
--border-emphasis: 1.5px;
|
|
12
|
+
|
|
13
|
+
/* How far every focus ring reaches past the border box - the exact room a clipping
|
|
14
|
+
ancestor reserves so a ring is never cut. */
|
|
15
|
+
--ring-width: 3px;
|
|
16
|
+
|
|
17
|
+
--layer-overlay: 1000; /* a band - each overlay adds its stack depth, so a later one paints above an earlier one */
|
|
18
|
+
--layer-toast: 1050;
|
|
19
|
+
--layer-tooltip: 1100;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:root,
|
|
23
|
+
[data-theme='light'] {
|
|
24
|
+
/* Multiplies every shadow alpha - 1 on the white canvas; black on dark needs 3-4x to read. */
|
|
25
|
+
--shadow-strength: 1;
|
|
26
|
+
/* Multiplies every white top-light highlight - 1 on the white canvas, a fifth on dark. */
|
|
27
|
+
--sheen-strength: 1;
|
|
28
|
+
/* Multiplies the light a lifted hue fill casts around it - off on the white canvas, on in dark. */
|
|
29
|
+
--glow-strength: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:root,
|
|
33
|
+
[data-theme] {
|
|
34
|
+
--shadow-xs: 0 1px 1px rgb(var(--shadow-rgb) / calc(0.04 * var(--shadow-strength)));
|
|
35
|
+
--shadow-sm:
|
|
36
|
+
0 1px 2px rgb(var(--shadow-rgb) / calc(0.05 * var(--shadow-strength))),
|
|
37
|
+
0 1px 1px rgb(var(--shadow-rgb) / calc(0.04 * var(--shadow-strength)));
|
|
38
|
+
--shadow-md:
|
|
39
|
+
0 2px 4px rgb(var(--shadow-rgb) / calc(0.04 * var(--shadow-strength))),
|
|
40
|
+
0 6px 12px rgb(var(--shadow-rgb) / calc(0.07 * var(--shadow-strength)));
|
|
41
|
+
/* The floating steps are three layers: a tight contact shadow, a mid layer for form, a wide
|
|
42
|
+
ambient one. Without the contact layer the panel reads soft and unanchored. */
|
|
13
43
|
--shadow-lg:
|
|
14
|
-
0 1px 2px rgb(var(--shadow-rgb) / 0.06
|
|
15
|
-
0
|
|
44
|
+
0 1px 2px rgb(var(--shadow-rgb) / calc(0.06 * var(--shadow-strength))),
|
|
45
|
+
0 4px 8px rgb(var(--shadow-rgb) / calc(0.04 * var(--shadow-strength))),
|
|
46
|
+
0 12px 28px rgb(var(--shadow-rgb) / calc(0.1 * var(--shadow-strength)));
|
|
16
47
|
--shadow-xl:
|
|
17
|
-
0 1px 2px rgb(var(--shadow-rgb) / 0.06
|
|
18
|
-
0
|
|
48
|
+
0 1px 2px rgb(var(--shadow-rgb) / calc(0.06 * var(--shadow-strength))),
|
|
49
|
+
0 8px 16px rgb(var(--shadow-rgb) / calc(0.06 * var(--shadow-strength))),
|
|
50
|
+
0 24px 48px rgb(var(--shadow-rgb) / calc(0.14 * var(--shadow-strength)));
|
|
19
51
|
|
|
20
|
-
/*
|
|
21
|
-
|
|
22
|
-
--
|
|
52
|
+
/* Focus & selection ring hues - each tracks its role; danger rings on its fill tone, the
|
|
53
|
+
lighter face the destructive button rests on. */
|
|
54
|
+
--ring-color-accent: color-mix(in oklab, var(--accent) 32%, transparent);
|
|
55
|
+
--ring-color-danger: oklch(from var(--danger) 0.602 0.196 h / 0.3);
|
|
56
|
+
--ring-color-warning: color-mix(in oklab, var(--warning) 30%, transparent);
|
|
57
|
+
--ring-color-success: color-mix(in oklab, var(--success) 30%, transparent);
|
|
58
|
+
|
|
59
|
+
/* The rings themselves - outline values, so a ring never shares box-shadow with elevation and a
|
|
60
|
+
clipping ancestor can reserve exactly --ring-width. Outlines follow border-radius everywhere
|
|
61
|
+
this library supports. --ring-rest is the resting ring a control fades in from; --ring-inset
|
|
62
|
+
is the offset that turns a ring inward, for a control flush with a clipping edge. */
|
|
63
|
+
--ring-rest: var(--ring-width) solid transparent;
|
|
64
|
+
--ring-inset: calc(var(--ring-width) * -1);
|
|
65
|
+
--ring-accent: var(--ring-width) solid var(--ring-color-accent);
|
|
66
|
+
--ring-danger: var(--ring-width) solid var(--ring-color-danger);
|
|
67
|
+
--ring-warning: var(--ring-width) solid var(--ring-color-warning);
|
|
68
|
+
--ring-success: var(--ring-width) solid var(--ring-color-success);
|
|
23
69
|
|
|
24
|
-
/*
|
|
70
|
+
/* Cast light - the hover of the primary and destructive buttons; each tracks its ring's hue. */
|
|
71
|
+
--glow-accent: 0 4px 16px oklch(from var(--accent) l c h / calc(0.4 * var(--glow-strength)));
|
|
72
|
+
--glow-danger: 0 4px 16px oklch(from var(--danger) 0.602 0.196 h / calc(0.4 * var(--glow-strength)));
|
|
73
|
+
}
|
|
25
74
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
75
|
+
/* Forced colours repaint every outline-color, transparent included, so the resting ring would
|
|
76
|
+
sit on every control as a permanent border. It costs the fade-in, not the ring. */
|
|
77
|
+
@media (forced-colors: active) {
|
|
78
|
+
:root,
|
|
79
|
+
[data-theme] {
|
|
80
|
+
--ring-rest: none;
|
|
81
|
+
}
|
|
32
82
|
}
|
|
33
83
|
}
|
package/src/tokens/fonts.css
CHANGED
package/src/tokens/glass.css
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* Glass tokens - structural frosted-surface pieces; per-tone tints live in semantic.css. */
|
|
2
|
-
|
|
3
1
|
@layer zyncat.tokens, zyncat.components;
|
|
4
2
|
|
|
5
3
|
@layer zyncat.tokens {
|
|
@@ -8,17 +6,25 @@
|
|
|
8
6
|
--glass-blur-strong: 16px;
|
|
9
7
|
--glass-saturate: 1.5;
|
|
10
8
|
|
|
9
|
+
--glass-sheen-rest: 0.8;
|
|
10
|
+
--glass-sheen-hover: 1;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:root,
|
|
14
|
+
[data-theme] {
|
|
11
15
|
--glass-sheen: linear-gradient(
|
|
12
16
|
145deg,
|
|
13
|
-
rgb(255 255 255 / 0.55) 0%,
|
|
14
|
-
rgb(255 255 255 / 0.1) 24%,
|
|
17
|
+
rgb(255 255 255 / calc(0.55 * var(--sheen-strength))) 0%,
|
|
18
|
+
rgb(255 255 255 / calc(0.1 * var(--sheen-strength))) 24%,
|
|
15
19
|
rgb(255 255 255 / 0) 46%
|
|
16
20
|
);
|
|
17
|
-
--glass-
|
|
18
|
-
--glass-sheen-hover: 1;
|
|
21
|
+
--glass-highlight: inset 0 1px 0 0 rgb(255 255 255 / calc(0.55 * var(--sheen-strength)));
|
|
19
22
|
|
|
20
|
-
--glass-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
--glass-shadow:
|
|
24
|
+
0 1px 2px rgb(var(--shadow-rgb) / calc(0.05 * var(--shadow-strength))),
|
|
25
|
+
0 2px 5px rgb(var(--shadow-rgb) / calc(0.05 * var(--shadow-strength)));
|
|
26
|
+
--glass-shadow-hover:
|
|
27
|
+
0 2px 4px rgb(var(--shadow-rgb) / calc(0.06 * var(--shadow-strength))),
|
|
28
|
+
0 8px 18px rgb(var(--shadow-rgb) / calc(0.1 * var(--shadow-strength)));
|
|
23
29
|
}
|
|
24
30
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The motion tokens as numbers, for the readers that need a value before a stylesheet answers:
|
|
3
|
+
* durations in milliseconds, distances in pixels at a 16px root, easings as cubic-bezier points.
|
|
4
|
+
*
|
|
5
|
+
* Generated from the token and component CSS by `scripts/gen-theme.mjs` - `pnpm sync` rebuilds it.
|
|
6
|
+
*/
|
|
7
|
+
export const motionDefaults = {
|
|
8
|
+
duration: { fast: 140, base: 200, slow: 300, slower: 450, slowest: 900, spin: 600, pulse: 1600 } satisfies Record<
|
|
9
|
+
string,
|
|
10
|
+
number
|
|
11
|
+
>,
|
|
12
|
+
ease: {
|
|
13
|
+
standard: [0.2, 0, 0, 1],
|
|
14
|
+
entrance: [0.25, 1, 0.4, 1],
|
|
15
|
+
exit: [0.4, 0, 1, 1],
|
|
16
|
+
spring: [0.34, 1.4, 0.5, 1],
|
|
17
|
+
glide: [0.32, 0.55, 0, 1],
|
|
18
|
+
} satisfies Record<string, [number, number, number, number]>,
|
|
19
|
+
distance: { sm: 8, md: 16, lg: 24 } satisfies Record<string, number>,
|
|
20
|
+
scale: { panel: 0.98, floating: 0.96, chip: 0.9 } satisfies Record<string, number>,
|
|
21
|
+
};
|
|
@@ -12,8 +12,8 @@ export type DurationToken = 'fast' | 'base' | 'slow' | 'slower' | 'slowest';
|
|
|
12
12
|
* - `entrance` cubic-bezier(0.16, 1, 0.3, 1) - hard deceleration; content arriving on screen.
|
|
13
13
|
* - `exit` cubic-bezier(0.4, 0, 1, 1) - accelerates away; content leaving (pair with a faster duration).
|
|
14
14
|
* - `spring` cubic-bezier(0.34, 1.4, 0.5, 1) - overshoots then settles; playful confirmations.
|
|
15
|
-
* - `glide` cubic-bezier(0.
|
|
16
|
-
*
|
|
15
|
+
* - `glide` cubic-bezier(0.32, 0.55, 0, 1) - fast out, soft landing; a persistent element moving to a
|
|
16
|
+
* new target, never enter/exit. */
|
|
17
17
|
export type EaseToken = 'standard' | 'entrance' | 'exit' | 'spring' | 'glide';
|
|
18
18
|
|
|
19
19
|
export type DistanceToken = 'sm' | 'md' | 'lg';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { motionDefaults } from './motion-defaults.generated';
|
|
1
2
|
import type { DistanceToken, DurationToken, EaseToken, ScaleToken } from './motion-scale';
|
|
2
3
|
|
|
3
4
|
export interface MotionTransition {
|
|
@@ -32,22 +33,32 @@ export interface MotionTokens {
|
|
|
32
33
|
dist: Record<DistanceToken, number>;
|
|
33
34
|
scale: Record<ScaleToken, number>;
|
|
34
35
|
/** ready-made Motion transitions */
|
|
35
|
-
t: {
|
|
36
|
+
t: {
|
|
37
|
+
enter: MotionTransition;
|
|
38
|
+
exit: MotionTransition;
|
|
39
|
+
layout: MotionTransition;
|
|
40
|
+
settle: MotionTransition;
|
|
41
|
+
glide: MotionTransition;
|
|
42
|
+
};
|
|
36
43
|
reduced: boolean;
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
type MotionScales = Pick<MotionTokens, 'dur' | 'ease' | 'dist' | 'scale'>;
|
|
40
47
|
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
const DURATION_TOKENS: DurationToken[] = ['fast', 'base', 'slow', 'slower', 'slowest'];
|
|
49
|
+
const EASE_TOKENS: EaseToken[] = ['standard', 'entrance', 'exit', 'spring', 'glide'];
|
|
50
|
+
const DISTANCE_TOKENS: DistanceToken[] = ['sm', 'md', 'lg'];
|
|
51
|
+
const SCALE_TOKENS: ScaleToken[] = ['panel', 'floating', 'chip'];
|
|
52
|
+
|
|
53
|
+
const table = <K extends string, V>(keys: readonly K[], read: (key: K) => V): Record<K, V> =>
|
|
54
|
+
Object.fromEntries(keys.map((key) => [key, read(key)])) as Record<K, V>;
|
|
55
|
+
|
|
56
|
+
const DEFAULTS: MotionScales = {
|
|
57
|
+
dur: table(DURATION_TOKENS, (key) => motionDefaults.duration[key] / 1000),
|
|
58
|
+
ease: table(EASE_TOKENS, (key) => motionDefaults.ease[key]),
|
|
59
|
+
dist: table(DISTANCE_TOKENS, (key) => motionDefaults.distance[key]),
|
|
60
|
+
scale: table(SCALE_TOKENS, (key) => motionDefaults.scale[key]),
|
|
48
61
|
};
|
|
49
|
-
const DEFAULT_DIST: MotionTokens['dist'] = { sm: 8, md: 16, lg: 24 };
|
|
50
|
-
const DEFAULT_SCALE: MotionTokens['scale'] = { panel: 0.98, floating: 0.95, chip: 0.9 };
|
|
51
62
|
|
|
52
63
|
function build(scales: MotionScales): MotionTokens {
|
|
53
64
|
const { dur, ease } = scales;
|
|
@@ -60,13 +71,14 @@ function build(scales: MotionScales): MotionTokens {
|
|
|
60
71
|
exit: { duration: dur.fast, ease: ease.exit },
|
|
61
72
|
layout: { duration: dur.slow, ease: ease.entrance },
|
|
62
73
|
settle: reduced ? { duration: 0 } : { type: 'spring', visualDuration: dur.fast, bounce: 0.25 },
|
|
74
|
+
glide: { duration: dur.base, ease: ease.glide },
|
|
63
75
|
},
|
|
64
76
|
};
|
|
65
77
|
}
|
|
66
78
|
|
|
67
79
|
function readFromDom(): MotionTokens {
|
|
68
|
-
const cs = getComputedStyle(document.documentElement);
|
|
69
|
-
const rootFontSize = parseFloat(
|
|
80
|
+
const cs = getComputedStyle(document.body ?? document.documentElement);
|
|
81
|
+
const rootFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
|
|
70
82
|
const seconds = (name: string, fallback: number): number => {
|
|
71
83
|
const v = cs.getPropertyValue(name).trim();
|
|
72
84
|
const n = v.slice(-2) === 'ms' ? parseFloat(v) / 1000 : parseFloat(v);
|
|
@@ -87,36 +99,49 @@ function readFromDom(): MotionTokens {
|
|
|
87
99
|
return m && m.length === 4 ? (m.map(Number) as Bezier) : fallback;
|
|
88
100
|
};
|
|
89
101
|
return build({
|
|
90
|
-
dur: {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
slower: seconds('--duration-slower', DEFAULT_DUR.slower),
|
|
95
|
-
slowest: seconds('--duration-slowest', DEFAULT_DUR.slowest),
|
|
96
|
-
},
|
|
97
|
-
ease: {
|
|
98
|
-
standard: bezier('--ease-standard', DEFAULT_EASE.standard),
|
|
99
|
-
entrance: bezier('--ease-entrance', DEFAULT_EASE.entrance),
|
|
100
|
-
exit: bezier('--ease-exit', DEFAULT_EASE.exit),
|
|
101
|
-
spring: bezier('--ease-spring', DEFAULT_EASE.spring),
|
|
102
|
-
glide: bezier('--ease-glide', DEFAULT_EASE.glide),
|
|
103
|
-
},
|
|
104
|
-
dist: {
|
|
105
|
-
sm: pixels('--distance-sm', DEFAULT_DIST.sm),
|
|
106
|
-
md: pixels('--distance-md', DEFAULT_DIST.md),
|
|
107
|
-
lg: pixels('--distance-lg', DEFAULT_DIST.lg),
|
|
108
|
-
},
|
|
109
|
-
scale: {
|
|
110
|
-
panel: ratio('--scale-panel', DEFAULT_SCALE.panel),
|
|
111
|
-
floating: ratio('--scale-floating', DEFAULT_SCALE.floating),
|
|
112
|
-
chip: ratio('--scale-chip', DEFAULT_SCALE.chip),
|
|
113
|
-
},
|
|
102
|
+
dur: table(DURATION_TOKENS, (key) => seconds(`--duration-${key}`, DEFAULTS.dur[key])),
|
|
103
|
+
ease: table(EASE_TOKENS, (key) => bezier(`--ease-${key}`, DEFAULTS.ease[key])),
|
|
104
|
+
dist: table(DISTANCE_TOKENS, (key) => pixels(`--distance-${key}`, DEFAULTS.dist[key])),
|
|
105
|
+
scale: table(SCALE_TOKENS, (key) => ratio(`--scale-${key}`, DEFAULTS.scale[key])),
|
|
114
106
|
});
|
|
115
107
|
}
|
|
116
108
|
|
|
117
|
-
|
|
118
|
-
typeof
|
|
119
|
-
|
|
120
|
-
|
|
109
|
+
const isRecord = (value: unknown): value is Record<string, unknown> =>
|
|
110
|
+
typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
111
|
+
|
|
112
|
+
function replaceInto(target: Record<string, unknown>, next: Record<string, unknown>): void {
|
|
113
|
+
for (const key of Object.keys(target)) if (!(key in next)) delete target[key];
|
|
114
|
+
for (const [key, value] of Object.entries(next)) {
|
|
115
|
+
const current = target[key];
|
|
116
|
+
if (isRecord(current) && isRecord(value)) replaceInto(current, value);
|
|
117
|
+
else target[key] = value;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const hasDom = typeof document !== 'undefined';
|
|
122
|
+
|
|
123
|
+
export const UIMotion: MotionTokens = hasDom ? readFromDom() : build(DEFAULTS);
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Re-reads the motion tokens into `UIMotion` in place, so every held reference sees the new values. Runs on
|
|
127
|
+
* a `data-theme` change, a `prefers-reduced-motion` flip and after `ZyncatTheme` renders; call it yourself
|
|
128
|
+
* after injecting a stylesheet that retimes the `--duration-*` tokens.
|
|
129
|
+
*/
|
|
130
|
+
export function refreshMotionTokens(): MotionTokens {
|
|
131
|
+
if (hasDom)
|
|
132
|
+
replaceInto(UIMotion as unknown as Record<string, unknown>, readFromDom() as unknown as Record<string, unknown>);
|
|
133
|
+
return UIMotion;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (hasDom) {
|
|
137
|
+
if (typeof matchMedia === 'function')
|
|
138
|
+
matchMedia('(prefers-reduced-motion: reduce)').addEventListener('change', () => refreshMotionTokens());
|
|
139
|
+
if (typeof MutationObserver === 'function')
|
|
140
|
+
new MutationObserver(() => refreshMotionTokens()).observe(document.documentElement, {
|
|
141
|
+
attributes: true,
|
|
142
|
+
attributeFilter: ['data-theme'],
|
|
143
|
+
subtree: true,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
121
146
|
|
|
122
147
|
export default UIMotion;
|
|
@@ -6,8 +6,11 @@ TypeScript readers for the motion token vocabulary - duration/ease/distance/scal
|
|
|
6
6
|
|
|
7
7
|
Use it to time your own animation code off the same tokens the components read, so your motion
|
|
8
8
|
retimes with the theme and collapses under reduced motion exactly like the library's. UIMotion
|
|
9
|
-
carries dur/ease/dist/scale maps, ready-made enter/exit/layout/settle transitions on `t`, and
|
|
10
|
-
`reduced`, which reflects prefers-reduced-motion.
|
|
9
|
+
carries dur/ease/dist/scale maps, ready-made enter/exit/layout/settle/glide transitions on `t`, and
|
|
10
|
+
`reduced`, which reflects prefers-reduced-motion. It re-reads in place when `data-theme` changes on any
|
|
11
|
+
element, when prefers-reduced-motion flips and after `ZyncatTheme` renders, so read it at call time rather
|
|
12
|
+
than into a module constant; `refreshMotionTokens()` re-reads it after a stylesheet of your own retimes the `--duration-*`
|
|
13
|
+
tokens.
|
|
11
14
|
|
|
12
15
|
```tsx
|
|
13
16
|
import { UIMotion } from '@zyncat/ui/motion-tokens';
|
package/src/tokens/motion.css
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
/* Motion system - durations, brand curves, travel distances, rest scales, and pre-composed transitions;
|
|
2
|
-
smooths every layout shift by default. */
|
|
3
|
-
|
|
4
1
|
@layer zyncat.tokens, zyncat.components;
|
|
5
2
|
|
|
6
3
|
@layer zyncat.tokens {
|
|
7
4
|
:root {
|
|
8
|
-
--duration-fast: 140ms;
|
|
9
|
-
--duration-base: 200ms;
|
|
10
|
-
--duration-slow: 300ms;
|
|
5
|
+
--duration-fast: 140ms; /* micro feedback - hover washes, presses, control tint */
|
|
6
|
+
--duration-base: 200ms; /* standard element transitions - fades, toggles, badge morphs */
|
|
7
|
+
--duration-slow: 300ms; /* layout-scale movement - Collapse, panel resizes, reordering */
|
|
11
8
|
--duration-slower: 450ms; /* large-surface movement - dialog, sheet, page-scale reveals */
|
|
12
9
|
--duration-slowest: 900ms; /* hero-scale movement - card expansion, container transforms; the scale's ceiling */
|
|
13
10
|
--duration-spin: 600ms; /* continuous loaders only; deliberately outside the UI-transition scale */
|
|
@@ -18,42 +15,35 @@
|
|
|
18
15
|
--ease-exit: cubic-bezier(0.4, 0, 1, 1);
|
|
19
16
|
--ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
|
|
20
17
|
--ease-glide: cubic-bezier(
|
|
18
|
+
0.32,
|
|
21
19
|
0.55,
|
|
22
20
|
0,
|
|
23
|
-
0.15,
|
|
24
21
|
1
|
|
25
|
-
); /*
|
|
22
|
+
); /* fast out, soft landing - a persistent element moving to a new target, never enter/exit */
|
|
26
23
|
|
|
27
|
-
/* Travel - how far a surface moves on the way in or out. A magnitude scale, snapped to the 4px
|
|
28
|
-
spacing spine; pick by how far the surface has conceptually come, not by how big it is. */
|
|
29
24
|
--distance-sm: 0.5rem; /* 8px - settling into place; the surface is already where it belongs */
|
|
30
25
|
--distance-md: 1rem; /* 16px - arriving from an adjacent position - page turns, tab panels, paged ranges */
|
|
31
26
|
--distance-lg: 1.5rem; /* 24px - arriving from outside the surface - a toast joining its stack */
|
|
32
27
|
|
|
33
|
-
/* Rest scale -
|
|
34
|
-
|
|
35
|
-
needs a smaller one than a tag to land at the same perceived distance. */
|
|
28
|
+
/* Rest scale - picked by surface size: the same ratio reads as more movement the wider the
|
|
29
|
+
surface, so a dialog takes a smaller one than a tag to land at the same perceived distance. */
|
|
36
30
|
--scale-panel: 0.98; /* full-width surfaces - dialog, modal, sheet */
|
|
37
31
|
--scale-floating: 0.96; /* floating surfaces - popover, tooltip, menu, toast, alert */
|
|
38
32
|
--scale-chip: 0.9; /* small inline elements - tag, badge, count */
|
|
33
|
+
}
|
|
39
34
|
|
|
35
|
+
:root,
|
|
36
|
+
[data-theme] {
|
|
40
37
|
--transition-control:
|
|
41
38
|
color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard),
|
|
42
|
-
border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard)
|
|
39
|
+
border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard),
|
|
40
|
+
outline-color var(--duration-fast) var(--ease-standard);
|
|
43
41
|
--transition-colors:
|
|
44
42
|
color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard),
|
|
45
43
|
border-color var(--duration-fast) var(--ease-standard);
|
|
46
44
|
--transition-opacity: opacity var(--duration-base) var(--ease-standard);
|
|
47
|
-
--transition-transform: transform var(--duration-base) var(--ease-standard);
|
|
48
|
-
|
|
49
|
-
/* Layout transition - animatable stand-ins for width/height; apply wherever size may change. */
|
|
50
|
-
--transition-layout:
|
|
51
|
-
grid-template-rows var(--duration-slow) var(--ease-entrance),
|
|
52
|
-
grid-template-columns var(--duration-slow) var(--ease-entrance),
|
|
53
|
-
max-height var(--duration-slow) var(--ease-entrance), max-width var(--duration-slow) var(--ease-entrance);
|
|
54
45
|
}
|
|
55
46
|
|
|
56
|
-
/* Accessibility: honor reduced-motion globally - every consumer gets it free. */
|
|
57
47
|
@media (prefers-reduced-motion: reduce) {
|
|
58
48
|
:root {
|
|
59
49
|
--duration-fast: 1ms;
|
package/src/tokens/radius.css
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
/* Corner radii - a restrained set; --radius-md (6px) is the control default. */
|
|
2
|
-
|
|
3
1
|
@layer zyncat.tokens, zyncat.components;
|
|
4
2
|
|
|
5
3
|
@layer zyncat.tokens {
|
|
6
4
|
:root {
|
|
7
|
-
--radius-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
--radius-
|
|
13
|
-
--radius-
|
|
5
|
+
--radius-full: 624.9375rem; /* the pill - a shape, not a step of --radius, so it stays literal */
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
:root,
|
|
9
|
+
[data-theme] {
|
|
10
|
+
--radius-sm: calc(var(--radius) * 0.5);
|
|
11
|
+
--radius-md: calc(var(--radius) * 0.75);
|
|
12
|
+
--radius-lg: var(--radius);
|
|
13
|
+
--radius-xl: calc(var(--radius) * 1.5);
|
|
14
|
+
--radius-2xl: calc(var(--radius) * 2);
|
|
14
15
|
}
|
|
15
16
|
}
|
package/src/tokens/semantic.css
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
/* Semantic layer - the intent-named
|
|
1
|
+
/* Semantic layer - the intent-named roles components consume.
|
|
2
|
+
Neutral roles are a polarity: light values on `:root, [data-theme='light']`, dark ones in dark.css.
|
|
3
|
+
Derived roles sit on every theme root, so a subtree that repoints a decision re-derives them. */
|
|
2
4
|
|
|
3
5
|
@layer zyncat.tokens, zyncat.components;
|
|
4
6
|
|
|
5
7
|
@layer zyncat.tokens {
|
|
6
8
|
:root {
|
|
7
|
-
/* The
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/* The ink on a hue fill - white in either polarity, since the fills stay mid-lightness on dark. */
|
|
10
|
+
--text-on-accent: var(--gray-0);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:root,
|
|
14
|
+
[data-theme='light'] {
|
|
15
|
+
color-scheme: light;
|
|
16
|
+
|
|
17
|
+
/* The canvas is pure white and cards and panels share it, separated by hairlines and shadow the
|
|
18
|
+
way print separates with rules rather than tint; subtle < muted < inset step one ramp stop apart. */
|
|
11
19
|
--bg-app: var(--gray-0);
|
|
12
20
|
--bg-surface: var(--gray-0);
|
|
13
21
|
--bg-surface-raised: var(--gray-0);
|
|
@@ -22,47 +30,59 @@
|
|
|
22
30
|
--text-muted: var(--gray-600);
|
|
23
31
|
--text-subtle: var(--gray-500);
|
|
24
32
|
--text-disabled: var(--gray-400);
|
|
25
|
-
|
|
26
|
-
--text-on-accent: var(--gray-0);
|
|
33
|
+
/* The ink on a strong-ink fill - the canvas colour in either polarity. */
|
|
27
34
|
--text-inverse: var(--gray-0);
|
|
28
35
|
|
|
29
36
|
--border-subtle: var(--gray-150);
|
|
30
37
|
--border-default: var(--gray-200);
|
|
31
38
|
--border-strong: var(--gray-300);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:root,
|
|
42
|
+
[data-theme] {
|
|
43
|
+
/* Accent family. Fill is the resting face of a filled control, a step down on dark where it reads
|
|
44
|
+
as a light source; hover, active and lift step lightness from the accent, the tints take only its hue. */
|
|
45
|
+
--accent-fill: var(--accent);
|
|
46
|
+
--accent-lift: oklch(from var(--accent) calc(l + 0.075) calc(c - 0.006) h);
|
|
47
|
+
--accent-hover: oklch(from var(--accent) calc(l - 0.07) calc(c - 0.004) h);
|
|
48
|
+
--accent-active: oklch(from var(--accent) calc(l - 0.152) calc(c - 0.018) h);
|
|
49
|
+
--accent-subtle: oklch(from var(--accent) 0.972 0.02 h);
|
|
50
|
+
--accent-border: oklch(from var(--accent) 0.88 0.066 h);
|
|
51
|
+
--accent-disabled: oklch(from var(--accent) 0.795 0.092 h);
|
|
52
|
+
--accent-wash: oklch(from var(--accent) l c h / 0.08);
|
|
53
|
+
--text-accent: var(--accent-active);
|
|
54
|
+
|
|
55
|
+
/* Hover and press fills are translucent washes of the ink, never opaque near-whites: an opaque
|
|
56
|
+
patch vanishes on a tinted surface, and a dark theme's light ink washes light by itself. */
|
|
57
|
+
--neutral-wash: color-mix(in oklab, var(--text-secondary) 6%, transparent);
|
|
58
|
+
--neutral-wash-press: color-mix(in oklab, var(--text-secondary) 10%, transparent);
|
|
59
|
+
|
|
60
|
+
/* Info reads as the accent's own hue one step down; repoint --info to give it a hue of its own. */
|
|
61
|
+
--info: var(--accent-hover);
|
|
62
|
+
--info-subtle: oklch(from var(--info) 0.972 0.02 h);
|
|
63
|
+
--info-text: oklch(from var(--info) calc(l - 0.082) calc(c - 0.014) h);
|
|
64
|
+
--info-wash: oklch(from var(--info) 0.63 0.118 h / 0.08);
|
|
32
65
|
|
|
33
|
-
--
|
|
34
|
-
--
|
|
35
|
-
--
|
|
36
|
-
--accent-active: var(--teal-700);
|
|
37
|
-
--accent-subtle: var(--teal-50);
|
|
38
|
-
--accent-border: var(--teal-200);
|
|
39
|
-
--accent-disabled: var(--teal-300);
|
|
66
|
+
--success-subtle: oklch(from var(--success) 0.965 0.028 h);
|
|
67
|
+
--success-text: oklch(from var(--success) calc(l - 0.086) calc(c - 0.022) h);
|
|
68
|
+
--success-wash: oklch(from var(--success) 0.62 0.13 h / 0.1);
|
|
40
69
|
|
|
41
|
-
--
|
|
42
|
-
--
|
|
43
|
-
--
|
|
44
|
-
--warning-subtle: var(--amber-50);
|
|
45
|
-
--warning: var(--amber-600);
|
|
46
|
-
--warning-text: var(--amber-700);
|
|
47
|
-
--danger-subtle: var(--red-50);
|
|
48
|
-
--danger: var(--red-600);
|
|
49
|
-
--danger-text: var(--red-700);
|
|
50
|
-
--info-subtle: var(--teal-50);
|
|
51
|
-
--info: var(--teal-600);
|
|
52
|
-
--info-text: var(--teal-700);
|
|
53
|
-
--danger-disabled: var(--red-300);
|
|
70
|
+
--warning-subtle: oklch(from var(--warning) 0.972 0.034 h);
|
|
71
|
+
--warning-text: oklch(from var(--warning) calc(l - 0.14) calc(c - 0.024) h);
|
|
72
|
+
--warning-wash: oklch(from var(--warning) 0.76 0.14 h / 0.12);
|
|
54
73
|
|
|
55
|
-
/*
|
|
56
|
-
|
|
57
|
-
--
|
|
58
|
-
--
|
|
59
|
-
--
|
|
60
|
-
--
|
|
61
|
-
--
|
|
62
|
-
--danger-
|
|
74
|
+
/* Danger carries the destructive button's ladder too: fill is the resting face, one step
|
|
75
|
+
lighter than the --danger ink so white text sits on it; lift is the hover face above that. */
|
|
76
|
+
--danger-lift: oklch(from var(--danger) 0.64 0.2 h);
|
|
77
|
+
--danger-fill: oklch(from var(--danger) 0.602 0.196 h);
|
|
78
|
+
--danger-active: oklch(from var(--danger) calc(l - 0.067) calc(c - 0.024) h);
|
|
79
|
+
--danger-subtle: oklch(from var(--danger) 0.968 0.02 h);
|
|
80
|
+
--danger-text: var(--danger-active);
|
|
81
|
+
--danger-disabled: oklch(from var(--danger) 0.8 0.09 h);
|
|
82
|
+
--danger-wash: oklch(from var(--danger) 0.602 0.196 h / 0.1);
|
|
63
83
|
|
|
64
|
-
/*
|
|
65
|
-
--glass-tint-neutral: color-mix(in oklab, var(--
|
|
84
|
+
/* Per-tone glass tints - alpha kept low so the frost reads through. */
|
|
85
|
+
--glass-tint-neutral: color-mix(in oklab, var(--text-muted) 13%, transparent);
|
|
66
86
|
--glass-tint-info: color-mix(in oklab, var(--info) 17%, transparent);
|
|
67
87
|
--glass-tint-success: color-mix(in oklab, var(--success) 17%, transparent);
|
|
68
88
|
--glass-tint-warning: color-mix(in oklab, var(--warning) 21%, transparent);
|
package/src/tokens/spacing.css
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
/* Spacing spine - one 4px base and a short scale; every gap snaps to a step. */
|
|
2
|
-
|
|
3
1
|
@layer zyncat.tokens, zyncat.components;
|
|
4
2
|
|
|
5
3
|
@layer zyncat.tokens {
|
|
6
4
|
:root {
|
|
7
5
|
--space-px: 1px;
|
|
8
|
-
--space-0: 0;
|
|
9
6
|
--space-1: 0.25rem;
|
|
10
7
|
--space-2: 0.5rem;
|
|
11
8
|
--space-3: 0.75rem;
|
|
@@ -17,14 +14,16 @@
|
|
|
17
14
|
--space-9: 6rem;
|
|
18
15
|
--space-10: 8rem;
|
|
19
16
|
|
|
20
|
-
--container-max: 72rem;
|
|
21
17
|
--measure-prose: 38rem;
|
|
22
|
-
--sidebar-width: 16rem;
|
|
23
18
|
|
|
24
19
|
--control-height-sm: 1.75rem;
|
|
25
20
|
--control-height: 2rem;
|
|
26
21
|
--control-height-lg: 2.3rem;
|
|
27
22
|
--control-box: 1.125rem;
|
|
28
|
-
--control-switch: 1.25rem; /* switch track
|
|
23
|
+
--control-switch: 1.25rem; /* the switch track - the one control size off the scale */
|
|
24
|
+
|
|
25
|
+
--icon-sm: 17px;
|
|
26
|
+
--icon-md: 20px;
|
|
27
|
+
--icon-lg: 26px;
|
|
29
28
|
}
|
|
30
29
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
|
|
5
|
+
import { refreshMotionTokens } from './motion-tokens';
|
|
6
|
+
|
|
7
|
+
export function ThemeSync({ css }: { css: string }): null {
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
refreshMotionTokens();
|
|
10
|
+
return () => {
|
|
11
|
+
refreshMotionTokens();
|
|
12
|
+
};
|
|
13
|
+
}, [css]);
|
|
14
|
+
return null;
|
|
15
|
+
}
|