@zyncat/ui 0.13.1 → 0.17.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 +46 -157
- package/dist/alert.css +27 -34
- package/dist/alert.js +26 -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 +53 -51
- package/dist/avatar.js +29 -7
- package/dist/avatar.js.map +1 -1
- package/dist/badge.css +31 -37
- package/dist/badge.js +1 -1
- package/dist/bloom-HV23M4AW.js +81 -0
- package/dist/bloom-HV23M4AW.js.map +1 -0
- package/dist/button.css +99 -118
- package/dist/button.js +3 -1
- package/dist/checkbox.css +28 -33
- package/dist/checkbox.js +2 -2
- package/dist/chunk-2YGHPQ66.js +16 -0
- package/dist/chunk-2YGHPQ66.js.map +1 -0
- package/dist/chunk-3MLUH2QL.js +53 -0
- package/dist/chunk-3MLUH2QL.js.map +1 -0
- package/dist/{chunk-RJFGWJ4W.js → chunk-3XRVPCIM.js} +6 -6
- package/dist/chunk-3XRVPCIM.js.map +1 -0
- package/dist/{chunk-FONOS5RN.js → chunk-4PQDVK23.js} +11 -10
- package/dist/chunk-4PQDVK23.js.map +1 -0
- 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-227ZW4V7.js → chunk-6IXLW7QA.js} +11 -11
- package/dist/chunk-6IXLW7QA.js.map +1 -0
- package/dist/chunk-7NHY2CRA.js +132 -0
- package/dist/chunk-7NHY2CRA.js.map +1 -0
- package/dist/{chunk-EF6RPXU7.js → chunk-7VTWJL72.js} +43 -35
- package/dist/chunk-7VTWJL72.js.map +1 -0
- package/dist/chunk-7ZSIUUC3.js +50 -0
- package/dist/chunk-7ZSIUUC3.js.map +1 -0
- package/dist/{chunk-TYHR4VNM.js → chunk-AREEMG47.js} +10 -8
- package/dist/chunk-AREEMG47.js.map +1 -0
- package/dist/{chunk-DDRSMHN4.js → chunk-DH7DT6EO.js} +3 -3
- package/dist/{chunk-DDRSMHN4.js.map → chunk-DH7DT6EO.js.map} +1 -1
- package/dist/chunk-EOWWVFBF.js +14 -0
- package/dist/chunk-EOWWVFBF.js.map +1 -0
- package/dist/{chunk-5PZ43DCG.js → chunk-FLDIRXFU.js} +12 -13
- package/dist/chunk-FLDIRXFU.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-M43IOM5C.js → chunk-GWCBTD63.js} +3 -3
- package/dist/{chunk-M43IOM5C.js.map → chunk-GWCBTD63.js.map} +1 -1
- package/dist/chunk-GZ6UMHCK.js +103 -0
- package/dist/chunk-GZ6UMHCK.js.map +1 -0
- package/dist/chunk-H3X2263Y.js +17 -0
- package/dist/chunk-H3X2263Y.js.map +1 -0
- package/dist/{chunk-IJS7TPGV.js → chunk-HWDIVGME.js} +14 -7
- package/dist/chunk-HWDIVGME.js.map +1 -0
- package/dist/chunk-KSAJ6DED.js +16 -0
- package/dist/chunk-KSAJ6DED.js.map +1 -0
- package/dist/chunk-LH2UIEKN.js +42 -0
- package/dist/chunk-LH2UIEKN.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-CF4QHO4N.js → chunk-M2A6PZ7J.js} +10 -10
- package/dist/{chunk-CF4QHO4N.js.map → chunk-M2A6PZ7J.js.map} +1 -1
- package/dist/chunk-NYQQH4R5.js +40 -0
- package/dist/chunk-NYQQH4R5.js.map +1 -0
- package/dist/{chunk-TVYH4AN7.js → chunk-ODRO3KS6.js} +13 -13
- package/dist/chunk-ODRO3KS6.js.map +1 -0
- package/dist/chunk-PU3QWBEL.js +39 -0
- package/dist/chunk-PU3QWBEL.js.map +1 -0
- package/dist/{chunk-4BSHB7R3.js → chunk-QDAN43B6.js} +9 -9
- package/dist/chunk-QDAN43B6.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-TUTXXC3W.js → chunk-RY35IU3G.js} +3 -3
- package/dist/{chunk-TUTXXC3W.js.map → chunk-RY35IU3G.js.map} +1 -1
- package/dist/{chunk-EAI4POPB.js → chunk-TBLPZQSI.js} +56 -50
- package/dist/chunk-TBLPZQSI.js.map +1 -0
- package/dist/{chunk-AADAJL7D.js → chunk-UKPX3RIP.js} +8 -9
- package/dist/chunk-UKPX3RIP.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-4C5RZXBT.js → chunk-VZXML7EH.js} +8 -8
- package/dist/chunk-VZXML7EH.js.map +1 -0
- package/dist/{chunk-43M6GQ4Q.js → chunk-WC45VSST.js} +51 -32
- package/dist/chunk-WC45VSST.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-WQKWPI6V.js +196 -0
- package/dist/chunk-WQKWPI6V.js.map +1 -0
- package/dist/{chunk-VAXCXZ53.js → chunk-WZUTBJC4.js} +5 -4
- package/dist/chunk-WZUTBJC4.js.map +1 -0
- package/dist/chunk-ZHMOH62S.js +101 -0
- package/dist/chunk-ZHMOH62S.js.map +1 -0
- package/dist/cli.js +356 -28
- package/dist/collapse.css +21 -33
- package/dist/collapse.js +1 -1
- package/dist/confetti.css +20 -13
- 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 +22 -19
- package/dist/date-field.js.map +1 -1
- package/dist/date-picker.css +287 -185
- package/dist/date-range-field.js +75 -59
- package/dist/date-range-field.js.map +1 -1
- package/dist/datetime-field.js +26 -23
- package/dist/datetime-field.js.map +1 -1
- package/dist/dialog.css +35 -44
- package/dist/dialog.js +23 -22
- package/dist/dialog.js.map +1 -1
- package/dist/digit-strip.css +17 -17
- package/dist/dropdown.css +37 -28
- 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 +146 -149
- package/dist/facebook-feed.js +106 -102
- package/dist/facebook-feed.js.map +1 -1
- package/dist/flow-field.css +9 -5
- package/dist/flow-field.js +8 -7
- package/dist/flow-field.js.map +1 -1
- package/dist/glide.js +4 -3
- package/dist/icon.css +8 -11
- package/dist/input.css +81 -86
- package/dist/instagram-feed.css +66 -67
- package/dist/instagram-feed.js +61 -44
- package/dist/instagram-feed.js.map +1 -1
- package/dist/lens.css +42 -39
- package/dist/lens.js +17 -16
- package/dist/lens.js.map +1 -1
- package/dist/mcp.js +4 -3
- package/dist/menu-surface.css +55 -35
- package/dist/modal.css +3 -5
- package/dist/modal.js +12 -11
- package/dist/modal.js.map +1 -1
- package/dist/morphing-text.css +27 -17
- package/dist/morphing-text.js +14 -13
- package/dist/morphing-text.js.map +1 -1
- package/dist/motion-devtools.css +118 -69
- package/dist/motion-devtools.js +230 -65
- 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 +15 -15
- package/dist/number-field.js.map +1 -1
- package/dist/odometer.css +23 -17
- 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 +5 -10
- package/dist/pagination.css +11 -16
- package/dist/pagination.js +13 -10
- package/dist/pagination.js.map +1 -1
- package/dist/paint-CJQCM6ZO.js +260 -0
- package/dist/paint-CJQCM6ZO.js.map +1 -0
- package/dist/popover.css +14 -16
- package/dist/popover.js +10 -9
- package/dist/radio-group.css +65 -76
- package/dist/radio-group.js +30 -29
- package/dist/radio-group.js.map +1 -1
- package/dist/select.css +67 -76
- package/dist/select.js +19 -14
- package/dist/select.js.map +1 -1
- package/dist/sheet.css +13 -15
- package/dist/sheet.js +11 -10
- package/dist/spinner.css +115 -0
- package/dist/spinner.js +4 -0
- package/dist/spinner.js.map +1 -0
- package/dist/status-badge.js +9 -9
- package/dist/status-badge.js.map +1 -1
- package/dist/styles.css +35 -35
- package/dist/support-rail.css +110 -256
- package/dist/support-rail.js +116 -123
- package/dist/support-rail.js.map +1 -1
- package/dist/table.css +77 -85
- package/dist/table.js +44 -41
- package/dist/table.js.map +1 -1
- package/dist/tabs.css +81 -93
- package/dist/tabs.js +23 -20
- package/dist/tabs.js.map +1 -1
- package/dist/tag.css +49 -54
- package/dist/tag.js +13 -12
- package/dist/tag.js.map +1 -1
- package/dist/text-field.js +5 -5
- package/dist/textarea.css +47 -50
- package/dist/textarea.js +16 -16
- package/dist/textarea.js.map +1 -1
- package/dist/theme-grid.js +11 -0
- package/dist/theme-grid.js.map +1 -0
- package/dist/theme-switcher.css +107 -0
- package/dist/theme-switcher.js +70 -0
- package/dist/theme-switcher.js.map +1 -0
- package/dist/theme-transition-LLC644ZR.js +346 -0
- package/dist/theme-transition-LLC644ZR.js.map +1 -0
- package/dist/theme-transition.css +48 -0
- package/dist/theme.js +74 -27
- package/dist/theme.js.map +1 -1
- package/dist/tide-DJZMDAFT.js +57 -0
- package/dist/tide-DJZMDAFT.js.map +1 -0
- package/dist/tiktok.css +114 -119
- 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 +51 -79
- package/dist/toast.js +34 -26
- package/dist/toast.js.map +1 -1
- package/dist/toggle-tag.js +23 -14
- package/dist/toggle-tag.js.map +1 -1
- package/dist/toggle.css +27 -32
- package/dist/toggle.js +7 -7
- package/dist/toggle.js.map +1 -1
- package/dist/tooltip.css +17 -24
- package/dist/tooltip.js +117 -95
- package/dist/tooltip.js.map +1 -1
- package/dist/trigger.css +4 -4
- 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/month-jump.d.ts +11 -0
- 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/theme-switcher/ThemeGrid.d.ts +20 -0
- package/dist/types/components/composites/theme-switcher/ThemeSwitcher.d.ts +24 -0
- 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/compound/support-rail/SupportRail.d.ts +10 -8
- package/dist/types/components/dev/MotionDevtools.d.ts +12 -5
- package/dist/types/components/expressive/theme-transition/bloom.d.ts +2 -0
- package/dist/types/components/expressive/theme-transition/paint.d.ts +2 -0
- package/dist/types/components/expressive/theme-transition/scene.d.ts +24 -0
- package/dist/types/components/expressive/theme-transition/theme-transition.d.ts +19 -0
- package/dist/types/components/expressive/theme-transition/tide.d.ts +2 -0
- package/dist/types/components/internal/hooks/use-host-election.d.ts +8 -0
- package/dist/types/components/internal/icon/Icon.d.ts +2 -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 +10 -13
- package/dist/types/components/primitives/button/button-style.d.ts +15 -0
- package/dist/types/components/primitives/input/TextField.d.ts +1 -2
- package/dist/types/components/primitives/spinner/Spinner.d.ts +27 -0
- package/dist/types/components/primitives/textarea/Textarea.d.ts +0 -1
- package/dist/types/engine/animate.d.ts +1 -0
- package/dist/types/shared-slot.d.ts +1 -0
- package/dist/types/tokens/component-styles.generated.d.ts +80 -155
- 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-store.d.ts +47 -0
- package/dist/types/tokens/theme-sync.d.ts +9 -0
- package/dist/types/tokens/theme-tokens.generated.d.ts +693 -1117
- package/dist/types/tokens/theme.d.ts +28 -5
- package/dist/typing-lines.css +18 -11
- package/dist/typing-lines.js +9 -8
- package/dist/typing-lines.js.map +1 -1
- package/dist/weight-field.css +32 -18
- package/dist/weight-field.js +4 -4
- package/dist/weight-field.js.map +1 -1
- package/dist/youtube.css +91 -97
- package/dist/youtube.js +87 -86
- package/dist/youtube.js.map +1 -1
- package/package.json +27 -31
- package/skills/zyncat-ui/SKILL.md +5 -3
- package/skills/zyncat-ui/references/components.md +7 -4
- package/skills/zyncat-ui/references/theming.md +105 -34
- package/src/components/composites/alert/Alert.tsx +15 -12
- package/src/components/composites/alert/alert.css +27 -34
- 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 +33 -22
- package/src/components/composites/date-picker/date-picker.css +287 -185
- package/src/components/composites/date-picker/field-shell.tsx +7 -7
- package/src/components/composites/date-picker/month-jump.tsx +192 -0
- package/src/components/composites/date-picker/range-panel.tsx +51 -36
- 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 +35 -44
- 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 +37 -28
- 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 +35 -35
- 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 +3 -5
- package/src/components/composites/pagination/Pagination.tsx +7 -7
- package/src/components/composites/pagination/pagination.css +11 -16
- package/src/components/composites/popover/Popover.tsx +2 -2
- package/src/components/composites/popover/popover.css +14 -16
- 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 +67 -76
- package/src/components/composites/sheet/Sheet.tsx +2 -2
- package/src/components/composites/sheet/sheet.css +13 -15
- 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 +77 -85
- 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 +81 -93
- package/src/components/composites/theme-switcher/ThemeGrid.tsx +133 -0
- package/src/components/composites/theme-switcher/ThemeGrid.usage.md +20 -0
- package/src/components/composites/theme-switcher/ThemeSwitcher.tsx +75 -0
- package/src/components/composites/theme-switcher/ThemeSwitcher.usage.md +21 -0
- package/src/components/composites/theme-switcher/theme-switcher.css +107 -0
- package/src/components/composites/toast/Toast.tsx +24 -18
- package/src/components/composites/toast/toast-store.ts +8 -6
- package/src/components/composites/toast/toast.css +51 -79
- 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 +17 -24
- package/src/components/compound/support-rail/SupportRail.tsx +132 -144
- package/src/components/compound/support-rail/SupportRail.usage.md +7 -6
- package/src/components/compound/support-rail/support-rail.css +110 -256
- package/src/components/dev/MotionDevtools.tsx +272 -51
- package/src/components/dev/MotionDevtools.usage.md +12 -4
- package/src/components/dev/motion-devtools.css +118 -69
- 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 +20 -13
- package/src/components/expressive/facebook-feed/chrome.tsx +2 -2
- package/src/components/expressive/facebook-feed/facebook-feed.css +146 -149
- 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 +5 -5
- package/src/components/expressive/flow-field/flow-field.css +9 -5
- package/src/components/expressive/instagram-feed/InstagramFeed.tsx +52 -44
- package/src/components/expressive/instagram-feed/instagram-feed.css +66 -67
- package/src/components/expressive/lens/Lens.tsx +14 -14
- package/src/components/expressive/lens/lens.css +42 -39
- package/src/components/expressive/morphing-text/MorphingText.tsx +12 -13
- package/src/components/expressive/morphing-text/morphing-text.css +27 -17
- package/src/components/expressive/odometer/Odometer.tsx +9 -9
- package/src/components/expressive/odometer/odometer.css +23 -17
- package/src/components/expressive/theme-transition/bloom.ts +88 -0
- package/src/components/expressive/theme-transition/paint.ts +296 -0
- package/src/components/expressive/theme-transition/scene.ts +38 -0
- package/src/components/expressive/theme-transition/theme-transition.css +48 -0
- package/src/components/expressive/theme-transition/theme-transition.ts +423 -0
- package/src/components/expressive/theme-transition/tide.ts +65 -0
- package/src/components/expressive/tiktok/TikTok.tsx +54 -54
- package/src/components/expressive/tiktok/tiktok.css +114 -119
- package/src/components/expressive/typing-lines/TypingLines.tsx +0 -0
- package/src/components/expressive/typing-lines/typing-lines.css +18 -11
- package/src/components/expressive/weight-field/WeightField.tsx +4 -4
- package/src/components/expressive/weight-field/weight-field.css +32 -18
- 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 +91 -97
- package/src/components/internal/glass/glass.css +20 -23
- 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 +3 -5
- package/src/components/internal/icon/IconSlot.tsx +1 -1
- package/src/components/internal/icon/icon.css +8 -11
- 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 +55 -35
- 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 +5 -10
- package/src/components/internal/overlay/trigger.css +4 -4
- 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 +53 -51
- 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 +31 -37
- package/src/components/primitives/badge/digit-strip.css +17 -17
- package/src/components/primitives/badge/digit-strip.tsx +4 -4
- package/src/components/primitives/button/Button.tsx +14 -28
- package/src/components/primitives/button/button-style.ts +28 -0
- package/src/components/primitives/button/button.css +99 -118
- 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 +28 -33
- package/src/components/primitives/collapse/Collapse.tsx +2 -2
- package/src/components/primitives/collapse/collapse.css +21 -33
- 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 +81 -86
- package/src/components/primitives/radio-group/RadioGroup.tsx +23 -23
- package/src/components/primitives/radio-group/radio-group.css +65 -76
- package/src/components/primitives/spinner/Spinner.tsx +70 -0
- package/src/components/primitives/spinner/Spinner.usage.md +19 -0
- package/src/components/primitives/spinner/spinner.css +115 -0
- 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 +49 -54
- package/src/components/primitives/textarea/Textarea.tsx +13 -14
- package/src/components/primitives/textarea/textarea.css +47 -50
- package/src/components/primitives/toggle/Toggle.tsx +7 -7
- package/src/components/primitives/toggle/toggle.css +27 -32
- package/src/engine/animate.ts +12 -3
- package/src/engine/flip.ts +2 -1
- package/src/mcp/server.ts +5 -2
- 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 +8 -16
- package/src/tokens/base.css +15 -0
- package/src/tokens/color.css +22 -63
- package/src/tokens/component-styles.generated.ts +81 -155
- package/src/tokens/dark.css +58 -0
- package/src/tokens/decisions.css +23 -0
- package/src/tokens/elevation.css +65 -23
- package/src/tokens/fonts.css +0 -2
- package/src/tokens/glass.css +17 -10
- 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 +18 -28
- package/src/tokens/radius.css +12 -10
- package/src/tokens/reset.css +36 -0
- package/src/tokens/semantic.css +51 -39
- package/src/tokens/spacing.css +6 -7
- package/src/tokens/theme-store.ts +187 -0
- package/src/tokens/theme-sync.tsx +62 -0
- package/src/tokens/theme-tokens.generated.ts +708 -1121
- package/src/tokens/theme.tsx +116 -38
- package/src/tokens/theme.usage.md +26 -19
- package/src/tokens/typography.css +18 -20
- package/tailwind.css +187 -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 +0 -52
- 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-TCUCYFT7.js +0 -25
- package/dist/chunk-TCUCYFT7.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
|
@@ -26,14 +26,17 @@ import { Presence } from '../../../motion/presence';
|
|
|
26
26
|
import { popOut } from '../../../motion/presets';
|
|
27
27
|
import { UIMotion } from '../../../tokens/motion-tokens';
|
|
28
28
|
import { fireGlint } from '../../internal/glass/glint';
|
|
29
|
+
import { hostRegistry, useElectedHost } from '../../internal/hooks/use-host-election';
|
|
29
30
|
import { Icon, type IconName } from '../../internal/icon/Icon';
|
|
30
31
|
import { cx } from '../../internal/utils/cx';
|
|
31
32
|
import { tokenPx } from '../../internal/utils/token-px';
|
|
32
33
|
import { Button } from '../../primitives/button/Button';
|
|
34
|
+
import { Spinner } from '../../primitives/spinner/Spinner';
|
|
33
35
|
import { DEFAULT_TOASTER_CONFIG, UIToast, type ToasterConfig, type ToastRecord, type ToastTone } from './toast-store';
|
|
34
36
|
|
|
35
37
|
const SM = UIMotion;
|
|
36
38
|
const store = UIToast;
|
|
39
|
+
const toasterReg = hostRegistry('toast.host@1');
|
|
37
40
|
|
|
38
41
|
const COLLAPSE_GRACE = 140;
|
|
39
42
|
const SWIPE_X = 64;
|
|
@@ -162,7 +165,7 @@ function ToastItem({
|
|
|
162
165
|
as="li"
|
|
163
166
|
ref={ref}
|
|
164
167
|
exit={popOut(SM.scale.floating, SM.t.exit)}
|
|
165
|
-
className="toast glass"
|
|
168
|
+
className="zc-toast zc-glass"
|
|
166
169
|
data-tone={t.tone}
|
|
167
170
|
data-behind={behind ? '' : undefined}
|
|
168
171
|
role={t.tone === 'danger' ? 'alert' : 'status'}
|
|
@@ -172,30 +175,30 @@ function ToastItem({
|
|
|
172
175
|
if (e.key === 'Escape' && t.dismissible) store.dismiss(t.id);
|
|
173
176
|
}}
|
|
174
177
|
>
|
|
175
|
-
{t.node ? <div className="toast__custom">{t.node as ReactNode}</div> : <ToastBody t={t} />}
|
|
178
|
+
{t.node ? <div className="zc-toast__custom">{t.node as ReactNode}</div> : <ToastBody t={t} />}
|
|
176
179
|
</Motion>
|
|
177
180
|
);
|
|
178
181
|
}
|
|
179
182
|
|
|
180
183
|
function ToastBody({ t }: { t: ToastRecord }) {
|
|
181
184
|
return (
|
|
182
|
-
<div className="toast__inner">
|
|
185
|
+
<div className="zc-toast__inner">
|
|
183
186
|
{(t.tone !== 'default' || isFinite(t.duration)) && (
|
|
184
|
-
<span className="toast__icon">
|
|
187
|
+
<span className="zc-toast__icon">
|
|
185
188
|
{t.tone !== 'default' && (
|
|
186
|
-
<Motion as="span" className="toast__icon-glyph" animate={GLYPH_POP} deps={[t.tone]}>
|
|
189
|
+
<Motion as="span" className="zc-toast__icon-glyph" animate={GLYPH_POP} deps={[t.tone]}>
|
|
187
190
|
{t.tone === 'loading' ? (
|
|
188
|
-
<
|
|
191
|
+
<Spinner label={null} className="zc-toast__spinner" />
|
|
189
192
|
) : (
|
|
190
193
|
<Icon name={TONE_ICON[t.tone] || 'info'} weight="fill" />
|
|
191
194
|
)}
|
|
192
195
|
</Motion>
|
|
193
196
|
)}
|
|
194
197
|
{isFinite(t.duration) && (
|
|
195
|
-
<svg key={'ring-' + t.timerKey} className="toast__ring" viewBox="0 0 36 36" aria-hidden="true">
|
|
196
|
-
<circle className="toast__ring-track" cx="18" cy="18" r="16.5"></circle>
|
|
198
|
+
<svg key={'ring-' + t.timerKey} className="zc-toast__ring" viewBox="0 0 36 36" aria-hidden="true">
|
|
199
|
+
<circle className="zc-toast__ring-track" cx="18" cy="18" r="16.5"></circle>
|
|
197
200
|
<circle
|
|
198
|
-
className="toast__ring-arc"
|
|
201
|
+
className="zc-toast__ring-arc"
|
|
199
202
|
cx="18"
|
|
200
203
|
cy="18"
|
|
201
204
|
r="16.5"
|
|
@@ -206,12 +209,12 @@ function ToastBody({ t }: { t: ToastRecord }) {
|
|
|
206
209
|
)}
|
|
207
210
|
</span>
|
|
208
211
|
)}
|
|
209
|
-
<Motion className="toast__text" animate={TEXT_FADE} deps={[String(t.message) + '-' + String(t.description)]}>
|
|
210
|
-
<p className="toast__message">{t.message}</p>
|
|
211
|
-
{t.description != null && <p className="toast__desc">{t.description}</p>}
|
|
212
|
+
<Motion className="zc-toast__text" animate={TEXT_FADE} deps={[String(t.message) + '-' + String(t.description)]}>
|
|
213
|
+
<p className="zc-toast__message">{t.message}</p>
|
|
214
|
+
{t.description != null && <p className="zc-toast__desc">{t.description}</p>}
|
|
212
215
|
</Motion>
|
|
213
216
|
{t.count > 1 && (
|
|
214
|
-
<Motion as="span" className="toast__count" animate={COUNT_POP} deps={[t.count]}>
|
|
217
|
+
<Motion as="span" className="zc-toast__count" animate={COUNT_POP} deps={[t.count]}>
|
|
215
218
|
×{t.count}
|
|
216
219
|
</Motion>
|
|
217
220
|
)}
|
|
@@ -219,7 +222,7 @@ function ToastBody({ t }: { t: ToastRecord }) {
|
|
|
219
222
|
<Button
|
|
220
223
|
variant="secondary"
|
|
221
224
|
size="sm"
|
|
222
|
-
className="toast__action"
|
|
225
|
+
className="zc-toast__action"
|
|
223
226
|
onClick={() => {
|
|
224
227
|
if (t.action.onClick) t.action.onClick();
|
|
225
228
|
store.dismiss(t.id);
|
|
@@ -229,7 +232,7 @@ function ToastBody({ t }: { t: ToastRecord }) {
|
|
|
229
232
|
</Button>
|
|
230
233
|
)}
|
|
231
234
|
{t.dismissible && (
|
|
232
|
-
<button type="button" className="toast__close" aria-label="Dismiss" onClick={() => store.dismiss(t.id)}>
|
|
235
|
+
<button type="button" className="zc-toast__close" aria-label="Dismiss" onClick={() => store.dismiss(t.id)}>
|
|
233
236
|
<Icon name="close" size="sm" />
|
|
234
237
|
</button>
|
|
235
238
|
)}
|
|
@@ -299,7 +302,7 @@ function ToastHost({ config, htmlProps }: { config: ToasterConfig; htmlProps?: H
|
|
|
299
302
|
return createPortal(
|
|
300
303
|
<ol
|
|
301
304
|
{...htmlProps}
|
|
302
|
-
className={cx('toast-viewport', paused && 'is-paused', htmlProps?.className)}
|
|
305
|
+
className={cx('zc-toast-viewport', paused && 'zc-is-paused', htmlProps?.className)}
|
|
303
306
|
data-position={config.position}
|
|
304
307
|
style={
|
|
305
308
|
config.offset
|
|
@@ -359,18 +362,21 @@ export interface ToasterProps extends Partial<ToasterConfig> {
|
|
|
359
362
|
htmlProps?: HTMLAttributes<HTMLOListElement> & DataAttributes;
|
|
360
363
|
}
|
|
361
364
|
|
|
362
|
-
export function Toaster({ htmlProps, ...props }: ToasterProps): ReactElement {
|
|
365
|
+
export function Toaster({ htmlProps, ...props }: ToasterProps): ReactElement | null {
|
|
363
366
|
const config: ToasterConfig = { ...DEFAULT_TOASTER_CONFIG, ...stripUndefined(props) };
|
|
367
|
+
const isHost = useElectedHost(toasterReg, 'toaster');
|
|
364
368
|
|
|
365
369
|
useEffect(() => {
|
|
370
|
+
if (!isHost) return undefined;
|
|
366
371
|
store.config = config;
|
|
367
372
|
store.mounted = true;
|
|
368
373
|
if (config.expand) store.setExpanded(true);
|
|
369
374
|
return () => {
|
|
370
375
|
store.mounted = false;
|
|
371
376
|
};
|
|
372
|
-
}, [config.position, config.duration, config.visibleToasts, config.gap, config.offset, config.expand]);
|
|
377
|
+
}, [isHost, config.position, config.duration, config.visibleToasts, config.gap, config.offset, config.expand]);
|
|
373
378
|
|
|
379
|
+
if (!isHost) return null;
|
|
374
380
|
return <ToastHost config={config} htmlProps={htmlProps} />;
|
|
375
381
|
}
|
|
376
382
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { sharedSlot } from '../../../shared-slot';
|
|
2
|
+
|
|
1
3
|
export type ToastTone = 'default' | 'success' | 'danger' | 'warning' | 'info' | 'loading' | 'custom';
|
|
2
4
|
|
|
3
5
|
export interface ToastAction {
|
|
@@ -62,8 +64,8 @@ const DURATION: Record<string, number> = {
|
|
|
62
64
|
loading: Infinity,
|
|
63
65
|
};
|
|
64
66
|
|
|
65
|
-
|
|
66
|
-
const timers = new Map<string, ReturnType<typeof setTimeout>>();
|
|
67
|
+
const ids = sharedSlot('toast.ids@1', () => ({ n: 0 }));
|
|
68
|
+
const timers = sharedSlot('toast.timers@1', () => new Map<string, ReturnType<typeof setTimeout>>());
|
|
67
69
|
|
|
68
70
|
interface ToastStore {
|
|
69
71
|
toasts: ToastRecord[];
|
|
@@ -85,7 +87,7 @@ interface ToastStore {
|
|
|
85
87
|
setExpanded(v: boolean): void;
|
|
86
88
|
}
|
|
87
89
|
|
|
88
|
-
const store: ToastStore = {
|
|
90
|
+
const store: ToastStore = sharedSlot('toast.store@1', (): ToastStore => ({
|
|
89
91
|
toasts: [],
|
|
90
92
|
paused: false,
|
|
91
93
|
expanded: false,
|
|
@@ -174,7 +176,7 @@ const store: ToastStore = {
|
|
|
174
176
|
store.expanded = v;
|
|
175
177
|
store.emit();
|
|
176
178
|
},
|
|
177
|
-
};
|
|
179
|
+
}));
|
|
178
180
|
|
|
179
181
|
let warned = false;
|
|
180
182
|
let warnScheduled = false;
|
|
@@ -201,7 +203,7 @@ function resolveDuration(tone: ToastTone, opt?: number): number {
|
|
|
201
203
|
|
|
202
204
|
function make(tone: ToastTone, message: string | null, opts: ToastOptions = {}): string {
|
|
203
205
|
warnIfDetached();
|
|
204
|
-
const id = opts.id != null ? String(opts.id) : 'toast-' + ++
|
|
206
|
+
const id = opts.id != null ? String(opts.id) : 'toast-' + ++ids.n;
|
|
205
207
|
const duration = resolveDuration(tone, opts.duration);
|
|
206
208
|
if (store.toasts.some((t) => t.id === id)) {
|
|
207
209
|
return store.update(id, {
|
|
@@ -273,7 +275,7 @@ toast.promise = function <T>(promise: Promise<T>, msgs: ToastPromiseMsgs<T> = {}
|
|
|
273
275
|
|
|
274
276
|
toast.custom = (node, opts = {}) => {
|
|
275
277
|
warnIfDetached();
|
|
276
|
-
const id = opts.id != null ? String(opts.id) : 'toast-' + ++
|
|
278
|
+
const id = opts.id != null ? String(opts.id) : 'toast-' + ++ids.n;
|
|
277
279
|
const duration = opts.duration != null ? opts.duration : Infinity;
|
|
278
280
|
if (store.toasts.some((t) => t.id === id)) return store.update(id, { node });
|
|
279
281
|
return store.add({
|
|
@@ -1,39 +1,34 @@
|
|
|
1
|
-
@layer zyncat.tokens, zyncat.components;
|
|
1
|
+
@layer zyncat.reset, zyncat.tokens, zyncat.components;
|
|
2
2
|
|
|
3
3
|
@layer zyncat.components {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
.toast-viewport {
|
|
4
|
+
.zc-toast-viewport {
|
|
7
5
|
position: fixed;
|
|
8
6
|
width: min(22.5rem, calc(100vw - 2 * var(--toast-offset, var(--space-6))));
|
|
9
7
|
z-index: var(--layer-toast);
|
|
10
8
|
margin: 0;
|
|
11
9
|
padding: 0;
|
|
12
10
|
list-style: none;
|
|
13
|
-
pointer-events: none;
|
|
11
|
+
pointer-events: none;
|
|
14
12
|
}
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
.toast-viewport[data-position^='top'] {
|
|
14
|
+
.zc-toast-viewport[data-position^='top'] {
|
|
18
15
|
top: var(--toast-offset, var(--space-6));
|
|
19
16
|
}
|
|
20
|
-
.toast-viewport[data-position^='bottom'] {
|
|
17
|
+
.zc-toast-viewport[data-position^='bottom'] {
|
|
21
18
|
bottom: var(--toast-offset, var(--space-6));
|
|
22
19
|
}
|
|
23
|
-
.toast-viewport[data-position$='right'] {
|
|
20
|
+
.zc-toast-viewport[data-position$='right'] {
|
|
24
21
|
right: var(--toast-offset, var(--space-6));
|
|
25
22
|
}
|
|
26
|
-
.toast-viewport[data-position$='left'] {
|
|
23
|
+
.zc-toast-viewport[data-position$='left'] {
|
|
27
24
|
left: var(--toast-offset, var(--space-6));
|
|
28
25
|
}
|
|
29
|
-
.toast-viewport[data-position$='center'] {
|
|
26
|
+
.zc-toast-viewport[data-position$='center'] {
|
|
30
27
|
left: 50%;
|
|
31
28
|
transform: translateX(-50%);
|
|
32
29
|
}
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
.toast {
|
|
36
|
-
/* tone hooks - set by [data-tone] below */
|
|
31
|
+
.zc-toast {
|
|
37
32
|
--toast-hue: var(--text-subtle);
|
|
38
33
|
--glass-fg: var(--text-strong);
|
|
39
34
|
--glass-tint: color-mix(in oklab, var(--glass-tint-neutral) 75%, transparent);
|
|
@@ -43,59 +38,55 @@
|
|
|
43
38
|
left: 0;
|
|
44
39
|
width: 100%;
|
|
45
40
|
box-sizing: border-box;
|
|
46
|
-
overflow: hidden;
|
|
41
|
+
overflow: hidden;
|
|
47
42
|
pointer-events: auto;
|
|
48
43
|
border-radius: var(--radius-lg);
|
|
49
44
|
|
|
50
|
-
/* Motion owns transform - keep only the color/shadow transitions (never smooth Motion's writes) */
|
|
51
45
|
transition:
|
|
52
46
|
background-color var(--duration-base) var(--ease-standard),
|
|
53
47
|
box-shadow var(--duration-base) var(--ease-standard);
|
|
54
48
|
}
|
|
55
49
|
|
|
56
|
-
|
|
57
|
-
.toast-viewport[data-position^='bottom'] .toast {
|
|
50
|
+
.zc-toast-viewport[data-position^='bottom'] .zc-toast {
|
|
58
51
|
bottom: 0;
|
|
59
52
|
transform-origin: center bottom;
|
|
60
53
|
}
|
|
61
|
-
.toast-viewport[data-position^='top'] .toast {
|
|
54
|
+
.zc-toast-viewport[data-position^='top'] .zc-toast {
|
|
62
55
|
top: 0;
|
|
63
56
|
transform-origin: center top;
|
|
64
57
|
}
|
|
65
58
|
|
|
66
|
-
|
|
67
|
-
.toast[data-tone='success'] {
|
|
59
|
+
.zc-toast[data-tone='success'] {
|
|
68
60
|
--toast-hue: var(--success);
|
|
69
61
|
--glass-fg: var(--success-text);
|
|
70
62
|
--glass-tint: color-mix(in oklab, var(--glass-tint-success) 70%, transparent);
|
|
71
63
|
}
|
|
72
|
-
.toast[data-tone='danger'] {
|
|
64
|
+
.zc-toast[data-tone='danger'] {
|
|
73
65
|
--toast-hue: var(--danger);
|
|
74
66
|
--glass-fg: var(--danger-text);
|
|
75
67
|
--glass-tint: color-mix(in oklab, var(--glass-tint-danger) 70%, transparent);
|
|
76
68
|
}
|
|
77
|
-
.toast[data-tone='warning'] {
|
|
69
|
+
.zc-toast[data-tone='warning'] {
|
|
78
70
|
--toast-hue: var(--warning);
|
|
79
71
|
--glass-fg: var(--warning-text);
|
|
80
72
|
--glass-tint: color-mix(in oklab, var(--glass-tint-warning) 70%, transparent);
|
|
81
73
|
}
|
|
82
|
-
.toast[data-tone='info'] {
|
|
74
|
+
.zc-toast[data-tone='info'] {
|
|
83
75
|
--toast-hue: var(--info);
|
|
84
76
|
--glass-fg: var(--info-text);
|
|
85
77
|
--glass-tint: color-mix(in oklab, var(--glass-tint-info) 70%, transparent);
|
|
86
78
|
}
|
|
87
79
|
|
|
88
|
-
|
|
89
|
-
.toast[data-behind] {
|
|
80
|
+
.zc-toast[data-behind] {
|
|
90
81
|
--glass-tint: color-mix(in oklab, var(--glass-tint-neutral) 75%, transparent);
|
|
91
82
|
--glass-sheen-rest: 0.3;
|
|
92
83
|
}
|
|
93
|
-
.toast[data-behind] .toast__inner,
|
|
94
|
-
.toast[data-behind] .toast__custom {
|
|
84
|
+
.zc-toast[data-behind] .zc-toast__inner,
|
|
85
|
+
.zc-toast[data-behind] .zc-toast__custom {
|
|
95
86
|
opacity: 0;
|
|
96
87
|
}
|
|
97
88
|
|
|
98
|
-
.toast__inner {
|
|
89
|
+
.zc-toast__inner {
|
|
99
90
|
display: flex;
|
|
100
91
|
align-items: center;
|
|
101
92
|
gap: var(--space-3);
|
|
@@ -103,8 +94,7 @@
|
|
|
103
94
|
transition: var(--transition-opacity);
|
|
104
95
|
}
|
|
105
96
|
|
|
106
|
-
|
|
107
|
-
.toast__icon {
|
|
97
|
+
.zc-toast__icon {
|
|
108
98
|
position: relative;
|
|
109
99
|
flex: none;
|
|
110
100
|
display: grid;
|
|
@@ -113,36 +103,35 @@
|
|
|
113
103
|
height: calc(var(--icon-md) + 2 * var(--space-2));
|
|
114
104
|
color: var(--toast-hue);
|
|
115
105
|
}
|
|
116
|
-
.toast__icon-glyph {
|
|
106
|
+
.zc-toast__icon-glyph {
|
|
117
107
|
display: grid;
|
|
118
108
|
place-items: center;
|
|
119
109
|
}
|
|
120
110
|
|
|
121
|
-
|
|
122
|
-
.toast__ring {
|
|
111
|
+
.zc-toast__ring {
|
|
123
112
|
position: absolute;
|
|
124
113
|
inset: 0;
|
|
125
114
|
width: 100%;
|
|
126
115
|
height: 100%;
|
|
127
|
-
transform: rotate(-90deg);
|
|
116
|
+
transform: rotate(-90deg);
|
|
128
117
|
pointer-events: none;
|
|
129
118
|
}
|
|
130
|
-
.toast__ring circle {
|
|
119
|
+
.zc-toast__ring circle {
|
|
131
120
|
fill: none;
|
|
132
121
|
stroke-width: var(--border-emphasis);
|
|
133
122
|
}
|
|
134
|
-
.toast__ring-track {
|
|
123
|
+
.zc-toast__ring-track {
|
|
135
124
|
stroke: color-mix(in oklab, var(--toast-hue) 16%, transparent);
|
|
136
125
|
}
|
|
137
|
-
.toast__ring-arc {
|
|
126
|
+
.zc-toast__ring-arc {
|
|
138
127
|
stroke: var(--toast-hue);
|
|
139
128
|
stroke-linecap: round;
|
|
140
|
-
stroke-dasharray: 1; /* pathLength=1
|
|
141
|
-
animation-name: toast-ring;
|
|
129
|
+
stroke-dasharray: 1; /* the circle sets pathLength=1 */
|
|
130
|
+
animation-name: toast-ring; /* the duration is inline, set to the toast's lifetime */
|
|
142
131
|
animation-timing-function: linear;
|
|
143
132
|
animation-fill-mode: both;
|
|
144
133
|
}
|
|
145
|
-
.toast-viewport.is-paused .toast__ring-arc {
|
|
134
|
+
.zc-toast-viewport.zc-is-paused .zc-toast__ring-arc {
|
|
146
135
|
animation-play-state: paused;
|
|
147
136
|
}
|
|
148
137
|
@keyframes toast-ring {
|
|
@@ -154,27 +143,26 @@
|
|
|
154
143
|
}
|
|
155
144
|
}
|
|
156
145
|
|
|
157
|
-
.toast__text {
|
|
146
|
+
.zc-toast__text {
|
|
158
147
|
flex: 1 1 auto;
|
|
159
148
|
min-width: 0;
|
|
160
149
|
}
|
|
161
|
-
.toast__message {
|
|
150
|
+
.zc-toast__message {
|
|
162
151
|
margin: 0;
|
|
163
152
|
font: var(--type-label);
|
|
164
153
|
color: var(--glass-fg);
|
|
165
154
|
text-wrap: pretty;
|
|
166
155
|
}
|
|
167
|
-
.toast__desc {
|
|
156
|
+
.zc-toast__desc {
|
|
168
157
|
margin: var(--space-1) 0 0;
|
|
169
158
|
font: var(--type-caption);
|
|
170
159
|
color: color-mix(in oklab, var(--glass-fg) 76%, transparent);
|
|
171
160
|
text-wrap: pretty;
|
|
172
161
|
}
|
|
173
162
|
|
|
174
|
-
|
|
175
|
-
.toast__count {
|
|
163
|
+
.zc-toast__count {
|
|
176
164
|
flex: none;
|
|
177
|
-
font-family: var(--font-
|
|
165
|
+
font-family: var(--font-code);
|
|
178
166
|
font-size: var(--size-micro);
|
|
179
167
|
line-height: var(--leading-micro);
|
|
180
168
|
font-variant-numeric: tabular-nums;
|
|
@@ -184,12 +172,11 @@
|
|
|
184
172
|
padding: 0 var(--space-1);
|
|
185
173
|
}
|
|
186
174
|
|
|
187
|
-
.toast__action {
|
|
175
|
+
.zc-toast__action {
|
|
188
176
|
flex: none;
|
|
189
177
|
}
|
|
190
178
|
|
|
191
|
-
|
|
192
|
-
.toast__close {
|
|
179
|
+
.zc-toast__close {
|
|
193
180
|
flex: none;
|
|
194
181
|
appearance: none;
|
|
195
182
|
display: grid;
|
|
@@ -208,53 +195,38 @@
|
|
|
208
195
|
var(--transition-control),
|
|
209
196
|
opacity var(--duration-fast) var(--ease-standard);
|
|
210
197
|
}
|
|
211
|
-
.toast:hover .toast__close,
|
|
212
|
-
.toast:focus-within .toast__close {
|
|
198
|
+
.zc-toast:hover .zc-toast__close,
|
|
199
|
+
.zc-toast:focus-within .zc-toast__close {
|
|
213
200
|
opacity: 1;
|
|
214
201
|
}
|
|
215
|
-
.toast__close:hover {
|
|
202
|
+
.zc-toast__close:hover {
|
|
216
203
|
background: color-mix(in oklab, var(--glass-fg) 9%, transparent);
|
|
217
204
|
color: var(--glass-fg);
|
|
218
205
|
}
|
|
219
|
-
.toast__close:active {
|
|
206
|
+
.zc-toast__close:active {
|
|
220
207
|
background: color-mix(in oklab, var(--glass-fg) 14%, transparent);
|
|
221
208
|
}
|
|
222
|
-
.toast__close:focus-visible {
|
|
223
|
-
outline:
|
|
224
|
-
box-shadow: var(--focus-ring);
|
|
209
|
+
.zc-toast__close:focus-visible {
|
|
210
|
+
outline: var(--focus-ring);
|
|
225
211
|
opacity: 1;
|
|
226
212
|
}
|
|
227
213
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
display: block;
|
|
231
|
-
box-sizing: border-box;
|
|
232
|
-
width: var(--icon-sm);
|
|
233
|
-
height: var(--icon-sm);
|
|
234
|
-
border-radius: var(--radius-full);
|
|
235
|
-
border: var(--border-emphasis) solid currentColor;
|
|
236
|
-
border-right-color: transparent;
|
|
214
|
+
.zc-toast__spinner {
|
|
215
|
+
font-size: var(--icon-sm);
|
|
237
216
|
color: var(--text-muted);
|
|
238
|
-
animation: toast-spin var(--duration-spin) linear infinite;
|
|
239
|
-
}
|
|
240
|
-
@keyframes toast-spin {
|
|
241
|
-
to {
|
|
242
|
-
transform: rotate(1turn);
|
|
243
|
-
}
|
|
244
217
|
}
|
|
245
218
|
|
|
246
|
-
|
|
247
|
-
.toast__custom {
|
|
219
|
+
.zc-toast__custom {
|
|
248
220
|
padding: var(--space-3) var(--space-4);
|
|
249
221
|
transition: var(--transition-opacity);
|
|
250
222
|
}
|
|
251
223
|
|
|
252
224
|
@media (prefers-reduced-motion: reduce) {
|
|
253
|
-
/*
|
|
254
|
-
.toast,
|
|
255
|
-
.toast__close,
|
|
256
|
-
.toast__inner,
|
|
257
|
-
.toast__custom {
|
|
225
|
+
/* the ring keeps running: it is a clock, not decoration */
|
|
226
|
+
.zc-toast,
|
|
227
|
+
.zc-toast__close,
|
|
228
|
+
.zc-toast__inner,
|
|
229
|
+
.zc-toast__custom {
|
|
258
230
|
transition: none;
|
|
259
231
|
}
|
|
260
232
|
}
|
|
@@ -15,6 +15,8 @@ import {
|
|
|
15
15
|
} from 'react';
|
|
16
16
|
|
|
17
17
|
import type { DataAttributes } from '../../../dom-props';
|
|
18
|
+
import { usePresence } from '../../../motion/presence-context';
|
|
19
|
+
import { useControllable } from '../../internal/hooks/use-controllable';
|
|
18
20
|
import { cx } from '../../internal/utils/cx';
|
|
19
21
|
import { TooltipHost } from './tooltip-host';
|
|
20
22
|
import { CLOSE_GRACE, OPEN_DELAY, store, useHostElection, type Placement } from './tooltip-store';
|
|
@@ -26,6 +28,14 @@ export interface TooltipProps {
|
|
|
26
28
|
shortcut?: string | null;
|
|
27
29
|
/** Preferred side; flips automatically when out of viewport room. */
|
|
28
30
|
placement?: Placement;
|
|
31
|
+
/** Controlled visibility - shows with no hover or focus, and stays until you clear it.
|
|
32
|
+
* Omit to stay uncontrolled. One bubble shows at a time: the newest wins, and the ones
|
|
33
|
+
* under it come back when it leaves. */
|
|
34
|
+
open?: boolean;
|
|
35
|
+
/** Initial state when uncontrolled. Default false. */
|
|
36
|
+
defaultOpen?: boolean;
|
|
37
|
+
/** Fires whenever hover, focus, or Escape asks for a new state. Pair with `open` for controlled use. */
|
|
38
|
+
onOpenChange?: (open: boolean) => void;
|
|
29
39
|
/** Suppress the tooltip entirely (trigger renders untouched). */
|
|
30
40
|
disabled?: boolean;
|
|
31
41
|
/** ms before a cold hover shows; warm hovers + focus are instant. Default 350. */
|
|
@@ -45,6 +55,9 @@ export function Tooltip({
|
|
|
45
55
|
content,
|
|
46
56
|
shortcut = null,
|
|
47
57
|
placement = 'top',
|
|
58
|
+
open: controlledOpen,
|
|
59
|
+
defaultOpen = false,
|
|
60
|
+
onOpenChange,
|
|
48
61
|
disabled = false,
|
|
49
62
|
openDelay = OPEN_DELAY,
|
|
50
63
|
closeDelay = CLOSE_GRACE,
|
|
@@ -54,38 +67,46 @@ export function Tooltip({
|
|
|
54
67
|
}: TooltipProps) {
|
|
55
68
|
const wrapRef = useRef<HTMLSpanElement | null>(null);
|
|
56
69
|
const openTimer = useRef<ReturnType<typeof setTimeout> | 0>(0);
|
|
57
|
-
const
|
|
70
|
+
const autoId = useId();
|
|
71
|
+
const myId = id || 'tip-' + autoId;
|
|
58
72
|
const isHost = useHostElection();
|
|
73
|
+
const { isPresent } = usePresence();
|
|
74
|
+
const [open, setOpen] = useControllable(controlledOpen, defaultOpen, onOpenChange);
|
|
59
75
|
|
|
60
|
-
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (!open || disabled || !isPresent) return undefined;
|
|
78
|
+
store.open({
|
|
79
|
+
id: myId,
|
|
80
|
+
content,
|
|
81
|
+
shortcut,
|
|
82
|
+
placement,
|
|
83
|
+
anchor: () => (wrapRef.current?.firstElementChild as HTMLElement) ?? null,
|
|
84
|
+
dismiss: () => setOpen(false),
|
|
85
|
+
});
|
|
86
|
+
return () => store.close(myId, closeDelay);
|
|
87
|
+
}, [open, disabled, isPresent, content, shortcut, placement, closeDelay, myId, setOpen]);
|
|
88
|
+
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (!isPresent) store.close(myId, 0);
|
|
91
|
+
}, [isPresent, myId]);
|
|
61
92
|
|
|
62
93
|
useEffect(
|
|
63
94
|
() => () => {
|
|
64
95
|
clearTimeout(openTimer.current);
|
|
65
96
|
store.close(myId, 0);
|
|
66
97
|
},
|
|
67
|
-
[],
|
|
68
|
-
);
|
|
98
|
+
[myId],
|
|
99
|
+
);
|
|
69
100
|
|
|
70
101
|
function show(immediate: boolean) {
|
|
71
|
-
if (disabled) return;
|
|
72
102
|
clearTimeout(openTimer.current);
|
|
73
|
-
if (!
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
id: myId,
|
|
77
|
-
content,
|
|
78
|
-
shortcut,
|
|
79
|
-
placement,
|
|
80
|
-
anchor: anchorEl,
|
|
81
|
-
rect: () => anchorEl()!.getBoundingClientRect(),
|
|
82
|
-
});
|
|
83
|
-
if (immediate || store.isWarm()) open();
|
|
84
|
-
else openTimer.current = setTimeout(open, openDelay);
|
|
103
|
+
if (disabled || !wrapRef.current?.firstElementChild) return;
|
|
104
|
+
if (immediate || store.isWarm()) setOpen(true);
|
|
105
|
+
else openTimer.current = setTimeout(() => setOpen(true), openDelay);
|
|
85
106
|
}
|
|
86
107
|
function hide() {
|
|
87
108
|
clearTimeout(openTimer.current);
|
|
88
|
-
|
|
109
|
+
setOpen(false);
|
|
89
110
|
}
|
|
90
111
|
|
|
91
112
|
const onEnter = (e: PointerEvent) => {
|
|
@@ -100,7 +121,7 @@ export function Tooltip({
|
|
|
100
121
|
<span
|
|
101
122
|
{...htmlProps}
|
|
102
123
|
ref={wrapRef}
|
|
103
|
-
className={cx('tooltip-anchor', htmlProps?.className)}
|
|
124
|
+
className={cx('zc-tooltip-anchor', htmlProps?.className)}
|
|
104
125
|
onPointerEnter={onEnter}
|
|
105
126
|
onPointerLeave={hide}
|
|
106
127
|
onPointerDown={hide}
|
|
@@ -5,10 +5,18 @@ Docs: https://ui.zyncat.app/tooltip
|
|
|
5
5
|
|
|
6
6
|
Transient hint on hover/focus; wraps any child (no ref wiring needed).
|
|
7
7
|
|
|
8
|
-
content, shortcut, placement top|bottom|left|right
|
|
8
|
+
content, shortcut, placement top|bottom|left|right; open/defaultOpen/onOpenChange to drive it yourself, for a
|
|
9
|
+
hint no hover would ever fire. With open set, hover, focus and Escape decide nothing on their own - they only
|
|
10
|
+
report through onOpenChange, so a parent that ignores it keeps the bubble up. Scrolling never closes it: the
|
|
11
|
+
bubble tracks its anchor through page and container scroll, and leaves on pointer out, blur, or a handled Escape.
|
|
12
|
+
It also leaves the moment a surface around it starts animating out, so a tooltip inside a closing Popover or
|
|
13
|
+
Modal goes with it rather than outliving the panel.
|
|
9
14
|
|
|
10
15
|
```tsx
|
|
11
16
|
<Tooltip content="Save changes" shortcut="⌘S">
|
|
12
17
|
<Button>Save</Button>
|
|
13
18
|
</Tooltip>
|
|
19
|
+
<Tooltip content="Drafts land here" open={tour === 'drafts'} onOpenChange={(next) => !next && nextStep()}>
|
|
20
|
+
<Button variant="ghost">Drafts</Button>
|
|
21
|
+
</Tooltip>
|
|
14
22
|
```
|