@zyncat/ui 0.13.1 → 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 +135 -23
- 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
|
@@ -27,7 +27,6 @@ import {
|
|
|
27
27
|
|
|
28
28
|
const RING_C = (2 * Math.PI * 7).toFixed(2);
|
|
29
29
|
|
|
30
|
-
/** The native <textarea> props Textarea surfaces at the top level (the rest live in `htmlProps`). */
|
|
31
30
|
type TextareaNative = Pick<
|
|
32
31
|
TextareaHTMLAttributes<HTMLTextAreaElement>,
|
|
33
32
|
'placeholder' | 'disabled' | 'readOnly' | 'onKeyDown'
|
|
@@ -96,7 +95,7 @@ export function Textarea({
|
|
|
96
95
|
const count = text.length;
|
|
97
96
|
const over = max ? Math.max(count - max, 0) : 0;
|
|
98
97
|
const remaining = max ? max - count : 0;
|
|
99
|
-
const meterState = over ? 'is-over' : max && remaining <= warnAt ? 'is-near' : '';
|
|
98
|
+
const meterState = over ? 'zc-is-over' : max && remaining <= warnAt ? 'zc-is-near' : '';
|
|
100
99
|
|
|
101
100
|
const { state, msg, msgIcon } = resolveFieldMessage(error, warning, success, helper);
|
|
102
101
|
const autoId = useId();
|
|
@@ -141,22 +140,22 @@ export function Textarea({
|
|
|
141
140
|
onKeyDown?.(e);
|
|
142
141
|
};
|
|
143
142
|
|
|
144
|
-
const cls = cx('fld', 'fld--txa', size === 'lg' && 'fld--lg', state, className);
|
|
145
|
-
const boxCls = cx('txa', disabled && 'is-disabled', readOnly && 'is-readonly');
|
|
143
|
+
const cls = cx('zc-fld', 'zc-fld--txa', size === 'lg' && 'zc-fld--lg', state, className);
|
|
144
|
+
const boxCls = cx('zc-txa', disabled && 'zc-is-disabled', readOnly && 'zc-is-readonly');
|
|
146
145
|
|
|
147
146
|
return (
|
|
148
147
|
<div className={cls} style={style}>
|
|
149
148
|
<FieldLabel id={id} label={label} required={required} optional={optional} />
|
|
150
149
|
<div className={boxCls} style={{ '--txa-min-rows': minRows, '--txa-max-rows': maxRows } as CSSProperties}>
|
|
151
|
-
<div className="txa__stack" ref={stackRef}>
|
|
152
|
-
<div className="txa__mirror" ref={mirrorRef} aria-hidden="true">
|
|
150
|
+
<div className="zc-txa__stack" ref={stackRef}>
|
|
151
|
+
<div className="zc-txa__mirror" ref={mirrorRef} aria-hidden="true">
|
|
153
152
|
{over ? text.slice(0, max) : text}
|
|
154
153
|
{over ? <mark>{text.slice(max)}</mark> : null}
|
|
155
154
|
{'\n'}
|
|
156
155
|
</div>
|
|
157
156
|
<textarea
|
|
158
157
|
id={id}
|
|
159
|
-
className="txa__input"
|
|
158
|
+
className="zc-txa__input"
|
|
160
159
|
ref={taRef}
|
|
161
160
|
rows={minRows}
|
|
162
161
|
value={text}
|
|
@@ -175,19 +174,19 @@ export function Textarea({
|
|
|
175
174
|
/>
|
|
176
175
|
</div>
|
|
177
176
|
{(max || hint) && (
|
|
178
|
-
<div className="txa__bar">
|
|
179
|
-
{hint && <span className="txa__hint">{hint}</span>}
|
|
177
|
+
<div className="zc-txa__bar">
|
|
178
|
+
{hint && <span className="zc-txa__hint">{hint}</span>}
|
|
180
179
|
{max && (
|
|
181
|
-
<span className={cx('txa__meter', meterState)}>
|
|
182
|
-
<span className="txa__count">{over || remaining <= warnAt ? remaining : `${count} / ${max}`}</span>
|
|
180
|
+
<span className={cx('zc-txa__meter', meterState)}>
|
|
181
|
+
<span className="zc-txa__count">{over || remaining <= warnAt ? remaining : `${count} / ${max}`}</span>
|
|
183
182
|
<svg
|
|
184
|
-
className="txa__ring"
|
|
183
|
+
className="zc-txa__ring"
|
|
185
184
|
viewBox="0 0 16 16"
|
|
186
185
|
aria-hidden="true"
|
|
187
186
|
style={{ '--txa-ring-c': RING_C, '--txa-ring-p': Math.min(count / max, 1) } as CSSProperties}
|
|
188
187
|
>
|
|
189
|
-
<circle className="txa__ring-trk" cx="8" cy="8" r="7" />
|
|
190
|
-
<circle className="txa__ring-prg" cx="8" cy="8" r="7" />
|
|
188
|
+
<circle className="zc-txa__ring-trk" cx="8" cy="8" r="7" />
|
|
189
|
+
<circle className="zc-txa__ring-prg" cx="8" cy="8" r="7" />
|
|
191
190
|
</svg>
|
|
192
191
|
</span>
|
|
193
192
|
)}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
@layer zyncat.tokens, zyncat.components;
|
|
2
2
|
|
|
3
3
|
@layer zyncat.components {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
.txa {
|
|
4
|
+
.zc-txa {
|
|
7
5
|
--txa-pad-y: var(--space-3);
|
|
8
6
|
--txa-pad-x: var(--space-4);
|
|
9
7
|
--txa-lh: var(--leading-body);
|
|
@@ -16,32 +14,32 @@
|
|
|
16
14
|
border: var(--border-hairline) solid var(--border-default);
|
|
17
15
|
border-radius: var(--radius-lg);
|
|
18
16
|
transition: var(--transition-control);
|
|
17
|
+
outline: var(--ring-rest);
|
|
19
18
|
}
|
|
20
|
-
.txa:hover:not(.is-disabled):not(.is-readonly):not(:focus-within) {
|
|
19
|
+
.zc-txa:hover:not(.zc-is-disabled):not(.zc-is-readonly):not(:focus-within) {
|
|
21
20
|
border-color: var(--border-strong);
|
|
22
21
|
}
|
|
23
|
-
.txa:focus-within {
|
|
22
|
+
.zc-txa:focus-within {
|
|
24
23
|
border-color: var(--accent);
|
|
25
24
|
background: var(--bg-surface);
|
|
26
|
-
|
|
25
|
+
outline: var(--ring-accent);
|
|
27
26
|
}
|
|
28
|
-
.txa.is-disabled {
|
|
27
|
+
.zc-txa.zc-is-disabled {
|
|
29
28
|
background: var(--bg-muted);
|
|
30
29
|
}
|
|
31
|
-
.txa.is-readonly {
|
|
30
|
+
.zc-txa.zc-is-readonly {
|
|
32
31
|
background: var(--bg-subtle);
|
|
33
32
|
}
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
.txa__stack {
|
|
34
|
+
.zc-txa__stack {
|
|
37
35
|
position: relative;
|
|
38
36
|
min-height: calc(var(--txa-min-rows) * var(--txa-lh) + 2 * var(--txa-pad-y));
|
|
39
37
|
max-height: calc(var(--txa-max-rows) * var(--txa-lh) + 2 * var(--txa-pad-y));
|
|
40
|
-
overflow: clip;
|
|
38
|
+
overflow: clip; /* clip, not hidden: a hidden box scrolls to the caret and jumps; JS flips it to auto past max rows */
|
|
41
39
|
transition: height var(--duration-base) var(--ease-standard);
|
|
42
40
|
}
|
|
43
|
-
.txa__input,
|
|
44
|
-
.txa__mirror {
|
|
41
|
+
.zc-txa__input,
|
|
42
|
+
.zc-txa__mirror {
|
|
45
43
|
box-sizing: border-box;
|
|
46
44
|
width: 100%;
|
|
47
45
|
font: var(--type-body);
|
|
@@ -51,7 +49,7 @@
|
|
|
51
49
|
overflow-wrap: break-word;
|
|
52
50
|
word-break: break-word;
|
|
53
51
|
}
|
|
54
|
-
.txa__input {
|
|
52
|
+
.zc-txa__input {
|
|
55
53
|
position: relative;
|
|
56
54
|
z-index: 1;
|
|
57
55
|
display: block;
|
|
@@ -65,19 +63,18 @@
|
|
|
65
63
|
color: var(--text-strong);
|
|
66
64
|
overflow: hidden;
|
|
67
65
|
}
|
|
68
|
-
.txa__input::placeholder {
|
|
66
|
+
.zc-txa__input::placeholder {
|
|
69
67
|
color: var(--text-disabled);
|
|
70
68
|
}
|
|
71
|
-
.txa__input:disabled {
|
|
69
|
+
.zc-txa__input:disabled {
|
|
72
70
|
color: var(--text-disabled);
|
|
73
71
|
cursor: not-allowed;
|
|
74
72
|
}
|
|
75
|
-
.txa__input[readonly] {
|
|
73
|
+
.zc-txa__input[readonly] {
|
|
76
74
|
color: var(--text-body);
|
|
77
75
|
}
|
|
78
76
|
|
|
79
|
-
|
|
80
|
-
.txa__mirror {
|
|
77
|
+
.zc-txa__mirror {
|
|
81
78
|
position: absolute;
|
|
82
79
|
top: 0;
|
|
83
80
|
left: 0;
|
|
@@ -87,7 +84,7 @@
|
|
|
87
84
|
pointer-events: none;
|
|
88
85
|
user-select: none;
|
|
89
86
|
}
|
|
90
|
-
.txa__mirror mark {
|
|
87
|
+
.zc-txa__mirror mark {
|
|
91
88
|
color: transparent;
|
|
92
89
|
background: var(--danger-subtle);
|
|
93
90
|
border-radius: var(--radius-sm);
|
|
@@ -99,7 +96,7 @@
|
|
|
99
96
|
box-decoration-break: clone;
|
|
100
97
|
}
|
|
101
98
|
|
|
102
|
-
.txa__bar {
|
|
99
|
+
.zc-txa__bar {
|
|
103
100
|
display: flex;
|
|
104
101
|
align-items: center;
|
|
105
102
|
gap: var(--space-3);
|
|
@@ -107,10 +104,10 @@
|
|
|
107
104
|
border-top: var(--border-hairline) solid var(--border-subtle);
|
|
108
105
|
transition: border-color var(--duration-fast) var(--ease-standard);
|
|
109
106
|
}
|
|
110
|
-
.txa:focus-within .txa__bar {
|
|
107
|
+
.zc-txa:focus-within .zc-txa__bar {
|
|
111
108
|
border-top-color: var(--border-default);
|
|
112
109
|
}
|
|
113
|
-
.txa__hint {
|
|
110
|
+
.zc-txa__hint {
|
|
114
111
|
font: var(--type-micro);
|
|
115
112
|
color: var(--text-subtle);
|
|
116
113
|
display: inline-flex;
|
|
@@ -122,15 +119,15 @@
|
|
|
122
119
|
white-space: nowrap;
|
|
123
120
|
}
|
|
124
121
|
|
|
125
|
-
.txa__meter {
|
|
122
|
+
.zc-txa__meter {
|
|
126
123
|
margin-left: auto;
|
|
127
124
|
flex: none;
|
|
128
125
|
display: inline-flex;
|
|
129
126
|
align-items: center;
|
|
130
127
|
gap: var(--space-2);
|
|
131
128
|
}
|
|
132
|
-
.txa__count {
|
|
133
|
-
font-family: var(--font-
|
|
129
|
+
.zc-txa__count {
|
|
130
|
+
font-family: var(--font-code);
|
|
134
131
|
font-size: var(--size-micro);
|
|
135
132
|
line-height: 1;
|
|
136
133
|
font-variant-numeric: tabular-nums;
|
|
@@ -138,20 +135,20 @@
|
|
|
138
135
|
white-space: nowrap;
|
|
139
136
|
transition: color var(--duration-fast) var(--ease-standard);
|
|
140
137
|
}
|
|
141
|
-
.txa__ring {
|
|
138
|
+
.zc-txa__ring {
|
|
142
139
|
width: var(--icon-sm);
|
|
143
140
|
height: var(--icon-sm);
|
|
144
141
|
flex: none;
|
|
145
142
|
transform: rotate(-90deg);
|
|
146
143
|
}
|
|
147
|
-
.txa__ring circle {
|
|
144
|
+
.zc-txa__ring circle {
|
|
148
145
|
fill: none;
|
|
149
146
|
stroke-width: 2;
|
|
150
147
|
}
|
|
151
|
-
.txa__ring .txa__ring-trk {
|
|
148
|
+
.zc-txa__ring .zc-txa__ring-trk {
|
|
152
149
|
stroke: var(--border-default);
|
|
153
150
|
}
|
|
154
|
-
.txa__ring .txa__ring-prg {
|
|
151
|
+
.zc-txa__ring .zc-txa__ring-prg {
|
|
155
152
|
stroke: var(--accent);
|
|
156
153
|
stroke-linecap: round;
|
|
157
154
|
stroke-dasharray: var(--txa-ring-c);
|
|
@@ -160,54 +157,54 @@
|
|
|
160
157
|
stroke-dashoffset var(--duration-base) var(--ease-standard),
|
|
161
158
|
stroke var(--duration-fast) var(--ease-standard);
|
|
162
159
|
}
|
|
163
|
-
.txa__meter.is-near .txa__ring-prg {
|
|
160
|
+
.zc-txa__meter.zc-is-near .zc-txa__ring-prg {
|
|
164
161
|
stroke: var(--warning);
|
|
165
162
|
}
|
|
166
|
-
.txa__meter.is-near .txa__count {
|
|
163
|
+
.zc-txa__meter.zc-is-near .zc-txa__count {
|
|
167
164
|
color: var(--warning-text);
|
|
168
165
|
}
|
|
169
|
-
.txa__meter.is-over .txa__ring-prg {
|
|
166
|
+
.zc-txa__meter.zc-is-over .zc-txa__ring-prg {
|
|
170
167
|
stroke: var(--danger);
|
|
171
168
|
}
|
|
172
|
-
.txa__meter.is-over .txa__count {
|
|
169
|
+
.zc-txa__meter.zc-is-over .zc-txa__count {
|
|
173
170
|
color: var(--danger-text);
|
|
174
171
|
font-weight: var(--weight-medium);
|
|
175
172
|
}
|
|
176
173
|
|
|
177
|
-
.fld.is-error .txa {
|
|
174
|
+
.zc-fld.zc-is-error .zc-txa {
|
|
178
175
|
border-color: var(--danger);
|
|
179
176
|
}
|
|
180
|
-
.fld.is-error .txa:hover:not(.is-disabled):not(.is-readonly):not(:focus-within) {
|
|
177
|
+
.zc-fld.zc-is-error .zc-txa:hover:not(.zc-is-disabled):not(.zc-is-readonly):not(:focus-within) {
|
|
181
178
|
border-color: var(--danger-text);
|
|
182
179
|
}
|
|
183
|
-
.fld.is-error .txa:focus-within {
|
|
184
|
-
|
|
180
|
+
.zc-fld.zc-is-error .zc-txa:focus-within {
|
|
181
|
+
outline: var(--ring-danger);
|
|
185
182
|
}
|
|
186
|
-
.fld.is-warning .txa {
|
|
183
|
+
.zc-fld.zc-is-warning .zc-txa {
|
|
187
184
|
border-color: var(--warning);
|
|
188
185
|
}
|
|
189
|
-
.fld.is-warning .txa:hover:not(.is-disabled):not(.is-readonly):not(:focus-within) {
|
|
186
|
+
.zc-fld.zc-is-warning .zc-txa:hover:not(.zc-is-disabled):not(.zc-is-readonly):not(:focus-within) {
|
|
190
187
|
border-color: var(--warning-text);
|
|
191
188
|
}
|
|
192
|
-
.fld.is-warning .txa:focus-within {
|
|
193
|
-
|
|
189
|
+
.zc-fld.zc-is-warning .zc-txa:focus-within {
|
|
190
|
+
outline: var(--ring-warning);
|
|
194
191
|
}
|
|
195
|
-
.fld.is-success .txa {
|
|
192
|
+
.zc-fld.zc-is-success .zc-txa {
|
|
196
193
|
border-color: var(--success);
|
|
197
194
|
}
|
|
198
|
-
.fld.is-success .txa:hover:not(.is-disabled):not(.is-readonly):not(:focus-within) {
|
|
195
|
+
.zc-fld.zc-is-success .zc-txa:hover:not(.zc-is-disabled):not(.zc-is-readonly):not(:focus-within) {
|
|
199
196
|
border-color: var(--success-text);
|
|
200
197
|
}
|
|
201
|
-
.fld.is-success .txa:focus-within {
|
|
202
|
-
|
|
198
|
+
.zc-fld.zc-is-success .zc-txa:focus-within {
|
|
199
|
+
outline: var(--ring-success);
|
|
203
200
|
}
|
|
204
201
|
|
|
205
|
-
.fld--txa.fld--lg .txa {
|
|
202
|
+
.zc-fld--txa.zc-fld--lg .zc-txa {
|
|
206
203
|
--txa-pad-y: var(--space-4);
|
|
207
204
|
--txa-lh: var(--leading-body-lg);
|
|
208
205
|
}
|
|
209
|
-
.fld--txa.fld--lg .txa__input,
|
|
210
|
-
.fld--txa.fld--lg .txa__mirror {
|
|
206
|
+
.zc-fld--txa.zc-fld--lg .zc-txa__input,
|
|
207
|
+
.zc-fld--txa.zc-fld--lg .zc-txa__mirror {
|
|
211
208
|
font: var(--type-body-lg);
|
|
212
209
|
}
|
|
213
210
|
}
|
|
@@ -55,7 +55,7 @@ export function Toggle({
|
|
|
55
55
|
}: ToggleProps) {
|
|
56
56
|
const [isOn, setOn] = useControllable(checked, !!defaultChecked);
|
|
57
57
|
|
|
58
|
-
const cls = cx('sw', size === 'sm' && 'sw--sm', disabled && 'sw--disabled', className);
|
|
58
|
+
const cls = cx('zc-sw', size === 'sm' && 'zc-sw--sm', disabled && 'zc-sw--disabled', className);
|
|
59
59
|
|
|
60
60
|
const [pressed, setPressed] = useState(false);
|
|
61
61
|
function press(on: boolean) {
|
|
@@ -81,7 +81,7 @@ export function Toggle({
|
|
|
81
81
|
<input
|
|
82
82
|
type="checkbox"
|
|
83
83
|
role="switch"
|
|
84
|
-
className="sw__input"
|
|
84
|
+
className="zc-sw__input"
|
|
85
85
|
disabled={disabled}
|
|
86
86
|
checked={isOn}
|
|
87
87
|
onChange={handleChange}
|
|
@@ -89,17 +89,17 @@ export function Toggle({
|
|
|
89
89
|
defaultChecked={undefined}
|
|
90
90
|
/>
|
|
91
91
|
<span
|
|
92
|
-
className="sw__track"
|
|
92
|
+
className="zc-sw__track"
|
|
93
93
|
data-on={isOn ? 'true' : undefined}
|
|
94
94
|
data-pressed={pressed ? 'true' : undefined}
|
|
95
95
|
aria-hidden="true"
|
|
96
96
|
>
|
|
97
|
-
<span className="sw__thumb"></span>
|
|
97
|
+
<span className="zc-sw__thumb"></span>
|
|
98
98
|
</span>
|
|
99
99
|
{label || description ? (
|
|
100
|
-
<span className="sw__text">
|
|
101
|
-
{label ? <span className="sw__label">{label}</span> : null}
|
|
102
|
-
{description ? <span className="sw__desc">{description}</span> : null}
|
|
100
|
+
<span className="zc-sw__text">
|
|
101
|
+
{label ? <span className="zc-sw__label">{label}</span> : null}
|
|
102
|
+
{description ? <span className="zc-sw__desc">{description}</span> : null}
|
|
103
103
|
</span>
|
|
104
104
|
) : null}
|
|
105
105
|
</label>
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
@layer zyncat.tokens, zyncat.components;
|
|
2
2
|
|
|
3
3
|
@layer zyncat.components {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
.sw {
|
|
7
|
-
--sw-on-fill: linear-gradient(180deg, var(--accent), var(--accent-hover));
|
|
4
|
+
.zc-sw {
|
|
5
|
+
--sw-on-fill: linear-gradient(180deg, var(--accent-fill), var(--accent-hover));
|
|
8
6
|
--sw-off-fill: var(--bg-muted);
|
|
9
|
-
--sw-on-border: var(--accent);
|
|
7
|
+
--sw-on-border: var(--accent-fill);
|
|
10
8
|
--sw-off-border: var(--border-strong);
|
|
11
9
|
--sw-ring: var(--ring-accent);
|
|
12
|
-
/* track size is the only input; thumb + travel derive from it */
|
|
13
10
|
--sw-w: var(--control-height);
|
|
14
11
|
--sw-h: var(--control-switch);
|
|
15
12
|
--sw-inset: calc(2 * var(--space-px));
|
|
16
|
-
/* inner track height minus both borders and the gap each side, so the inset is uniform on all edges */
|
|
17
13
|
--sw-thumb: calc(var(--sw-h) - 2 * var(--border-hairline) - 2 * var(--sw-inset));
|
|
18
|
-
/* colors read this flag; the thumb is moved by transform, not by it */
|
|
19
14
|
--sw-checked: 0;
|
|
20
15
|
|
|
21
16
|
display: inline-flex;
|
|
@@ -31,18 +26,18 @@
|
|
|
31
26
|
--sw-checked: 1;
|
|
32
27
|
}
|
|
33
28
|
|
|
34
|
-
&:not(.sw--disabled):hover {
|
|
29
|
+
&:not(.zc-sw--disabled):hover {
|
|
35
30
|
background: var(--bg-muted);
|
|
36
31
|
}
|
|
37
|
-
&:not(.sw--disabled):hover:not(:has(:checked)) {
|
|
32
|
+
&:not(.zc-sw--disabled):hover:not(:has(:checked)) {
|
|
38
33
|
--sw-off-border: var(--text-subtle);
|
|
39
34
|
}
|
|
40
|
-
&:has(:focus-visible) .sw__track {
|
|
41
|
-
|
|
35
|
+
&:has(:focus-visible) .zc-sw__track {
|
|
36
|
+
outline: var(--sw-ring);
|
|
42
37
|
}
|
|
43
38
|
}
|
|
44
39
|
|
|
45
|
-
.sw__input {
|
|
40
|
+
.zc-sw__input {
|
|
46
41
|
position: absolute;
|
|
47
42
|
width: 1px;
|
|
48
43
|
height: 1px;
|
|
@@ -55,7 +50,7 @@
|
|
|
55
50
|
overflow: hidden;
|
|
56
51
|
}
|
|
57
52
|
|
|
58
|
-
.sw__track {
|
|
53
|
+
.zc-sw__track {
|
|
59
54
|
position: relative;
|
|
60
55
|
flex: none;
|
|
61
56
|
display: flex;
|
|
@@ -74,6 +69,7 @@
|
|
|
74
69
|
border-color var(--duration-base) var(--ease-standard),
|
|
75
70
|
background-color var(--duration-base) var(--ease-standard),
|
|
76
71
|
box-shadow var(--duration-fast) var(--ease-standard),
|
|
72
|
+
outline-color var(--duration-fast) var(--ease-standard),
|
|
77
73
|
transform var(--duration-fast) var(--ease-spring);
|
|
78
74
|
|
|
79
75
|
&::before {
|
|
@@ -85,9 +81,9 @@
|
|
|
85
81
|
opacity: var(--sw-checked);
|
|
86
82
|
transition: opacity var(--duration-base) var(--ease-standard);
|
|
87
83
|
}
|
|
84
|
+
outline: var(--ring-rest);
|
|
88
85
|
}
|
|
89
|
-
|
|
90
|
-
.sw__thumb {
|
|
86
|
+
.zc-sw__thumb {
|
|
91
87
|
--sw-tx: 0px;
|
|
92
88
|
--sw-sx: 1;
|
|
93
89
|
position: relative;
|
|
@@ -101,55 +97,54 @@
|
|
|
101
97
|
transform: translateX(var(--sw-tx)) scaleX(var(--sw-sx));
|
|
102
98
|
transition: transform var(--duration-base) var(--ease-spring);
|
|
103
99
|
}
|
|
104
|
-
/* React-set
|
|
105
|
-
.sw__track[data-on='true'] .sw__thumb {
|
|
100
|
+
/* React-set, not :has(:checked): a :has() twin would move the thumb out from under the spring and snap it. */
|
|
101
|
+
.zc-sw__track[data-on='true'] .zc-sw__thumb {
|
|
106
102
|
--sw-tx: calc(var(--sw-w) - var(--sw-h));
|
|
107
103
|
}
|
|
108
|
-
.sw__track[data-pressed='true'] {
|
|
104
|
+
.zc-sw__track[data-pressed='true'] {
|
|
109
105
|
transform: scale(0.96);
|
|
110
106
|
}
|
|
111
|
-
.sw__track[data-pressed='true'] .sw__thumb {
|
|
107
|
+
.zc-sw__track[data-pressed='true'] .zc-sw__thumb {
|
|
112
108
|
--sw-sx: 1.16;
|
|
113
109
|
}
|
|
114
110
|
|
|
115
|
-
.sw__text {
|
|
111
|
+
.zc-sw__text {
|
|
116
112
|
display: grid;
|
|
117
113
|
gap: var(--space-1);
|
|
118
114
|
}
|
|
119
|
-
.sw__label {
|
|
115
|
+
.zc-sw__label {
|
|
120
116
|
font: var(--type-label);
|
|
121
117
|
color: var(--text-strong);
|
|
122
118
|
}
|
|
123
|
-
.sw__desc {
|
|
119
|
+
.zc-sw__desc {
|
|
124
120
|
font: var(--type-caption);
|
|
125
121
|
color: var(--text-muted);
|
|
126
122
|
}
|
|
127
123
|
|
|
128
|
-
.sw--sm {
|
|
124
|
+
.zc-sw--sm {
|
|
129
125
|
--sw-w: var(--control-height-sm);
|
|
130
126
|
--sw-h: var(--space-4);
|
|
131
|
-
& .sw__label {
|
|
127
|
+
& .zc-sw__label {
|
|
132
128
|
font: var(--type-caption);
|
|
133
129
|
font-weight: var(--weight-medium);
|
|
134
130
|
color: var(--text-strong);
|
|
135
131
|
}
|
|
136
|
-
& .sw__track {
|
|
132
|
+
& .zc-sw__track {
|
|
137
133
|
margin-top: calc((var(--leading-caption) - var(--sw-h)) / 2);
|
|
138
134
|
}
|
|
139
135
|
}
|
|
140
136
|
|
|
141
|
-
|
|
142
|
-
.sw--disabled {
|
|
137
|
+
.zc-sw--disabled {
|
|
143
138
|
cursor: not-allowed;
|
|
144
139
|
--sw-on-fill: var(--accent-disabled);
|
|
145
140
|
--sw-off-fill: var(--bg-muted);
|
|
146
141
|
--sw-on-border: var(--accent-disabled);
|
|
147
142
|
--sw-off-border: var(--border-default);
|
|
148
|
-
& .sw__thumb {
|
|
143
|
+
& .zc-sw__thumb {
|
|
149
144
|
box-shadow: var(--shadow-xs);
|
|
150
145
|
}
|
|
151
|
-
& .sw__label,
|
|
152
|
-
& .sw__desc {
|
|
146
|
+
& .zc-sw__label,
|
|
147
|
+
& .zc-sw__desc {
|
|
153
148
|
color: var(--text-disabled);
|
|
154
149
|
}
|
|
155
150
|
}
|
package/src/engine/animate.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sharedSlot } from '../shared-slot';
|
|
1
2
|
import { resolveTiming, type Timing } from './ease';
|
|
2
3
|
|
|
3
4
|
export const clock = { scale: 1 };
|
|
@@ -85,7 +86,7 @@ export interface PropertyHolder {
|
|
|
85
86
|
cancel(): void;
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
const owned = new WeakMap<HTMLElement, Map<string, PropertyHolder>>();
|
|
89
|
+
const owned = sharedSlot('engine.owned@1', () => new WeakMap<HTMLElement, Map<string, PropertyHolder>>());
|
|
89
90
|
|
|
90
91
|
export function claim(el: HTMLElement, keys: string[], holder: PropertyHolder | null): void {
|
|
91
92
|
const map = owned.get(el) ?? new Map<string, PropertyHolder>();
|
package/src/engine/flip.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sharedSlot } from '../shared-slot';
|
|
1
2
|
import { animate, type Layer, type Playback } from './animate';
|
|
2
3
|
import type { Timing } from './ease';
|
|
3
4
|
|
|
@@ -22,7 +23,7 @@ export function measure(el: HTMLElement): Box {
|
|
|
22
23
|
return { left: rect.left + window.scrollX, top: rect.top + window.scrollY, width: rect.width, height: rect.height };
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
const shared = new Map<string, Box>();
|
|
26
|
+
const shared = sharedSlot('engine.flip-shared@1', () => new Map<string, Box>());
|
|
26
27
|
|
|
27
28
|
export function keepShared(key: string, box: Box): void {
|
|
28
29
|
shared.set(key, box);
|
package/src/mcp/server.ts
CHANGED
|
@@ -131,11 +131,13 @@ function getComponent(raw: unknown): string {
|
|
|
131
131
|
return modules.map((m) => renderModule(d, m)).join('\n\n');
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
const DECISIONS_FILE = 'decisions.css';
|
|
135
|
+
|
|
134
136
|
const tokenFiles = (root: string): string[] =>
|
|
135
137
|
existsSync(join(root, 'src/tokens'))
|
|
136
138
|
? readdirSync(join(root, 'src/tokens'))
|
|
137
139
|
.filter((f) => f.endsWith('.css'))
|
|
138
|
-
.sort()
|
|
140
|
+
.sort((a, b) => Number(b === DECISIONS_FILE) - Number(a === DECISIONS_FILE) || a.localeCompare(b))
|
|
139
141
|
: [];
|
|
140
142
|
|
|
141
143
|
interface Hit {
|
package/src/motion/flip.ts
CHANGED
|
@@ -12,11 +12,12 @@ import {
|
|
|
12
12
|
type FlipOptions,
|
|
13
13
|
type Playback,
|
|
14
14
|
} from '../engine';
|
|
15
|
+
import { sharedSlot } from '../shared-slot';
|
|
15
16
|
import { UIMotion } from '../tokens/motion-tokens';
|
|
16
17
|
|
|
17
18
|
export type FlipTuning = FlipOptions;
|
|
18
19
|
|
|
19
|
-
const sharedOwner = new Map<string, HTMLElement>();
|
|
20
|
+
const sharedOwner = sharedSlot('motion.flip-owner@1', () => new Map<string, HTMLElement>());
|
|
20
21
|
|
|
21
22
|
const usable = (box: Box | null): box is Box => !!box && box.width > 0 && box.height > 0;
|
|
22
23
|
|
|
@@ -26,25 +27,23 @@ export function useFlip<T extends HTMLElement>(
|
|
|
26
27
|
enabled = true,
|
|
27
28
|
): RefObject<T | null> {
|
|
28
29
|
const ref = useRef<T | null>(null);
|
|
29
|
-
const privateBox = useRef<Box | null>(null);
|
|
30
30
|
const playing = useRef<{ play: Playback; el: T } | null>(null);
|
|
31
31
|
const interrupted = useRef<Box | null>(null);
|
|
32
32
|
const { size, timing } = tuning;
|
|
33
|
+
const lastCommitted = enabled && sharedId === null && ref.current ? measure(ref.current) : null;
|
|
33
34
|
|
|
34
35
|
useLayoutEffect(() => {
|
|
35
36
|
const el = ref.current;
|
|
36
37
|
if (!el || !enabled) return;
|
|
37
38
|
const live = playing.current;
|
|
38
39
|
let from: Box | null;
|
|
39
|
-
if (
|
|
40
|
+
if (sharedId === null) from = lastCommitted;
|
|
41
|
+
else if (live && live.el === el) from = measure(el);
|
|
40
42
|
else if (interrupted.current) from = interrupted.current;
|
|
41
|
-
else if (sharedId === null) from = privateBox.current;
|
|
42
43
|
else from = sharedOwner.get(sharedId) === el ? null : readShared(sharedId);
|
|
43
44
|
live?.play.stop();
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
else {
|
|
47
|
-
keepShared(sharedId, settled);
|
|
45
|
+
if (sharedId !== null) {
|
|
46
|
+
keepShared(sharedId, measure(el));
|
|
48
47
|
sharedOwner.set(sharedId, el);
|
|
49
48
|
}
|
|
50
49
|
const next = usable(from) && !UIMotion.reduced ? flip(el, from, { size, timing }) : null;
|
package/src/motion/glide.tsx
CHANGED
|
@@ -1,44 +1,59 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useRef, type RefObject } from 'react';
|
|
3
|
+
import { useCallback, useMemo, useRef, type RefObject } from 'react';
|
|
4
4
|
|
|
5
|
-
import { animate, flip, measure, set } from '../engine';
|
|
5
|
+
import { animate, flip, measure, set, type Box } from '../engine';
|
|
6
6
|
import { UIMotion as SM } from '../tokens/motion-tokens';
|
|
7
7
|
|
|
8
8
|
export type GlideApi = ReturnType<typeof useGlide>;
|
|
9
9
|
|
|
10
|
+
function layoutBox(target: HTMLElement, container: HTMLElement): Box | null {
|
|
11
|
+
let left = 0;
|
|
12
|
+
let top = 0;
|
|
13
|
+
let el = target;
|
|
14
|
+
while (el !== container) {
|
|
15
|
+
left += el.offsetLeft;
|
|
16
|
+
top += el.offsetTop;
|
|
17
|
+
const parent = el.offsetParent;
|
|
18
|
+
if (!(parent instanceof HTMLElement)) return null;
|
|
19
|
+
if (parent !== container) {
|
|
20
|
+
left += parent.clientLeft;
|
|
21
|
+
top += parent.clientTop;
|
|
22
|
+
}
|
|
23
|
+
el = parent;
|
|
24
|
+
}
|
|
25
|
+
return { left, top, width: target.offsetWidth, height: target.offsetHeight };
|
|
26
|
+
}
|
|
27
|
+
|
|
10
28
|
export function useGlide<T extends HTMLElement>(containerRef: RefObject<T | null>) {
|
|
11
29
|
const ref = useRef<HTMLSpanElement | null>(null);
|
|
12
30
|
const visible = useRef(false);
|
|
13
31
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function leave() {
|
|
32
|
+
const enter = useCallback(
|
|
33
|
+
(target: HTMLElement | null) => {
|
|
34
|
+
const box = containerRef.current,
|
|
35
|
+
pill = ref.current;
|
|
36
|
+
if (!box || !pill || !target) return;
|
|
37
|
+
const at = layoutBox(target, box);
|
|
38
|
+
if (!at) return;
|
|
39
|
+
const was = measure(pill);
|
|
40
|
+
set(pill, { x: [at.left], y: [at.top], width: [at.width], height: [at.height] });
|
|
41
|
+
animate(pill, { opacity: [1], timing: { duration: SM.dur.fast, ease: SM.ease.standard } });
|
|
42
|
+
const glided = visible.current && !SM.reduced && was.width > 0 && was.height > 0;
|
|
43
|
+
visible.current = true;
|
|
44
|
+
if (glided) flip(pill, was, { size: 'morph', timing: SM.t.glide });
|
|
45
|
+
},
|
|
46
|
+
[containerRef],
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const leave = useCallback(() => {
|
|
35
50
|
visible.current = false;
|
|
36
51
|
if (ref.current) animate(ref.current, { opacity: [0], timing: { duration: SM.dur.fast, ease: SM.ease.exit } });
|
|
37
|
-
}
|
|
52
|
+
}, []);
|
|
38
53
|
|
|
39
|
-
return { ref, enter, leave };
|
|
54
|
+
return useMemo(() => ({ ref, enter, leave }), [enter, leave]);
|
|
40
55
|
}
|
|
41
56
|
|
|
42
57
|
export function GlidePill({ className, glide }: { className?: string; glide: GlideApi }) {
|
|
43
|
-
return <span ref={glide.ref} className={className} aria-hidden="true" />;
|
|
58
|
+
return <span ref={glide.ref} className={className} style={{ overflowAnchor: 'none' }} aria-hidden="true" />;
|
|
44
59
|
}
|