@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
package/README.md
CHANGED
|
@@ -1,114 +1,73 @@
|
|
|
1
1
|
# Zyncat UI
|
|
2
2
|
|
|
3
|
-
A premium React design system
|
|
4
|
-
consistently. Restraint, calm motion, no Tailwind, no CSS-in-JS, no UI libraries.
|
|
3
|
+
A premium React 19 design system: modern CSS, a small closed token vocabulary, a WAAPI motion engine. No Tailwind dependency, no CSS-in-JS, no UI library, zero runtime dependencies. Ships compiled ESM + types, one component per subpath, each loading its own CSS.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
link one base stylesheet - each component loads its own CSS automatically.
|
|
8
|
-
|
|
9
|
-
## What this is, and who it is for
|
|
10
|
-
|
|
11
|
-
Zyncat UI is built first for my own applications. Every component exists because a real
|
|
12
|
-
product needed it, and the API is the one that made that product simpler - not the one that
|
|
13
|
-
covers the widest set of hypothetical uses. That it also serves as a portfolio piece is a
|
|
14
|
-
side effect, not the goal.
|
|
15
|
-
|
|
16
|
-
That focus is the point. The token vocabulary stays small because one person has to hold it
|
|
17
|
-
in their head; the component set stays narrow because every component is a permanent
|
|
18
|
-
maintenance surface; the motion engine is small because the alternative was a dependency
|
|
19
|
-
with a hundred features I would not use. A design system built to please everyone ends up
|
|
20
|
-
with a settings panel instead of a point of view.
|
|
21
|
-
|
|
22
|
-
**On licensing and openness.** The code here is MIT-licensed and you are welcome to use it.
|
|
23
|
-
It is not, however, run as a community open-source project: there is no public roadmap, no
|
|
24
|
-
support commitment, no issue triage and no contribution process, and none of those are
|
|
25
|
-
planned right now. Development is driven by what my own applications need. Parts of it may
|
|
26
|
-
later move to an open-core or commercial arrangement - that decision has not been made. Use
|
|
27
|
-
it with those expectations, and pin a version.
|
|
5
|
+
Built first for my own applications: every component exists because a product needed it, and the API is the one that made that product simpler. MIT-licensed and yours to use, but not run as a community project - no public roadmap, support commitment, issue triage or contribution process - and parts may later move to an open-core or commercial arrangement. Pin a version.
|
|
28
6
|
|
|
29
7
|
## Install
|
|
30
8
|
|
|
31
|
-
One command, run inside your React project - installing the package is part of it, so there is no
|
|
32
|
-
separate `pnpm add` step:
|
|
33
|
-
|
|
34
9
|
```bash
|
|
35
10
|
pnpm dlx zyncat-ui init
|
|
36
|
-
#
|
|
11
|
+
# npx zyncat-ui init · yarn dlx zyncat-ui init · bunx zyncat-ui init
|
|
37
12
|
```
|
|
38
13
|
|
|
39
|
-
It installs `@zyncat/ui`
|
|
40
|
-
the base stylesheet at your app root, installs the agent skill into `.claude/skills/`, registers the
|
|
41
|
-
bundled MCP server in `.mcp.json`. Every step is idempotent and printed as it lands - re-run the
|
|
42
|
-
command after upgrading to refresh the skill.
|
|
43
|
-
Non-interactive shells get plain logs and no prompts; pass `--yes` to accept every default and
|
|
44
|
-
`--pm <pnpm|npm|yarn|bun>` to pin the package manager.
|
|
45
|
-
|
|
46
|
-
| Peer | Range | Used for |
|
|
47
|
-
| --------------------- | ----- | -------------------------------------------------------------------- |
|
|
48
|
-
| `react` / `react-dom` | `^19` | components; `createRoot`/`createPortal` for imperative toast/tooltip |
|
|
14
|
+
One command, inside your React project. It installs `@zyncat/ui` (and React 19 if missing), imports the base stylesheet at your app root, writes `zyncat.theme.css` beside it, installs the agent skill into `.claude/skills/` and registers the MCP server in `.mcp.json`. Every step is idempotent and printed as it lands. `--yes` accepts every default, `--pm <pnpm|npm|yarn|bun>` pins the package manager, and non-interactive shells get plain logs.
|
|
49
15
|
|
|
50
|
-
|
|
16
|
+
After upgrading, `npx zyncat-ui update` offers any new theme decisions without touching your values, and `init` again refreshes the skill.
|
|
51
17
|
|
|
52
|
-
|
|
18
|
+
Peers: `react` and `react-dom` `^19`. Animation and icons (a curated Phosphor set) are bundled.
|
|
53
19
|
|
|
54
20
|
## Use it
|
|
55
21
|
|
|
56
|
-
No bundler config and no `transpilePackages` - the package ships built ESM with the `'use client'`
|
|
57
|
-
directives intact, so Next.js App Router boundaries just work.
|
|
58
|
-
|
|
59
22
|
```tsx
|
|
23
|
+
import '@zyncat/ui/styles.css'; // once, at the app root - init adds it
|
|
24
|
+
|
|
60
25
|
import { Button } from '@zyncat/ui/button';
|
|
61
26
|
import { toast } from '@zyncat/ui/toast-store';
|
|
62
|
-
|
|
63
|
-
import '@zyncat/ui/styles.css'; // base layer - init adds this at the app root for you
|
|
64
27
|
```
|
|
65
28
|
|
|
66
|
-
`styles.css` is the
|
|
67
|
-
properties) and the shared `glass` utility. It is linked exactly once at the app root -
|
|
68
|
-
`init` inserts the import above your own stylesheets so yours keep winning the cascade.
|
|
29
|
+
`styles.css` is the base layer only: fonts, tokens, the shared `glass` utility. Each component imports its own stylesheet, so `@zyncat/ui/dialog` ships `dialog.css` and no one else's. No bundler config: the ESM keeps its `'use client'` directives, so Next.js App Router boundaries just work.
|
|
69
30
|
|
|
70
|
-
|
|
71
|
-
bundler code-splits and lazy-loads it with the component. Import `@zyncat/ui/dialog` and
|
|
72
|
-
only `dialog.css` ships (plus the `overlay`/`icon` styles it reuses, deduped) - not every
|
|
73
|
-
other component's CSS.
|
|
31
|
+
There is no barrel entry, deliberately. `import … from '@zyncat/ui'` does not resolve; subpaths make "one import, one component" structural instead of a tree-shaking promise.
|
|
74
32
|
|
|
75
33
|
## Theme it
|
|
76
34
|
|
|
35
|
+
Eight decisions, everything else derives. `init` wrote them into `zyncat.theme.css`; a retheme is editing a value there:
|
|
36
|
+
|
|
37
|
+
```css
|
|
38
|
+
:root {
|
|
39
|
+
--accent: oklch(0.58 0.19 292); /* hover, active, wash, ring and info follow */
|
|
40
|
+
--radius: 0.75rem; /* every corner step follows */
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Dark ships. `data-theme="dark"` on `<html>` turns the page, on any element it turns that subtree, and `data-theme="light"` inside makes a light island. Extend it in a `[data-theme='dark']` block of the same file.
|
|
45
|
+
|
|
46
|
+
For a theme that is data - several named themes, computed values - the same level has a type:
|
|
47
|
+
|
|
77
48
|
```tsx
|
|
78
49
|
import { defineTheme, ZyncatTheme } from '@zyncat/ui/theme';
|
|
79
50
|
|
|
80
|
-
const base = defineTheme({
|
|
81
|
-
|
|
82
|
-
radius: { radiusMd: '0.5rem' },
|
|
83
|
-
components: { odometer: { accent: 'var(--warning)' } },
|
|
84
|
-
});
|
|
85
|
-
const dark = defineTheme({ color: { bgApp: 'oklch(0.19 0.008 198)', textBody: 'oklch(0.92 0.004 198)' } });
|
|
51
|
+
const base = defineTheme({ color: { accent: 'oklch(0.58 0.19 292)' }, shape: { radius: '0.75rem' } });
|
|
52
|
+
const dark = defineTheme({ color: { accent: 'oklch(0.72 0.14 292)' } });
|
|
86
53
|
|
|
87
|
-
// once, at the app root
|
|
88
|
-
<ZyncatTheme theme={{ base, dark }} />;
|
|
54
|
+
<ZyncatTheme theme={{ base, dark }} />; // once, at the app root
|
|
89
55
|
```
|
|
90
56
|
|
|
91
|
-
|
|
92
|
-
compile error, and values take any CSS. `base` lands on `:root` and every other key becomes a
|
|
93
|
-
`[data-theme='<key>']` block, so switching themes - globally or for one subtree - is setting
|
|
94
|
-
that attribute. The types are generated from the token stylesheets, so upgrading the package
|
|
95
|
-
surfaces new tokens rather than drifting from them.
|
|
57
|
+
`ZyncatTheme` renders a `<style>` element: server-rendered, no provider, no build step, about a kilobyte. `base` lands on `:root` and every other key is a `[data-theme='<key>']` block, so switching is one attribute. The types are generated from the token CSS, so a typo is a compile error and an upgrade surfaces new tokens.
|
|
96
58
|
|
|
97
|
-
`
|
|
98
|
-
flash, no client hook), needs no PostCSS plugin, bundler plugin or build step, and adds about
|
|
99
|
-
a kilobyte. Durations you repoint keep their `prefers-reduced-motion` collapse automatically.
|
|
59
|
+
Four override levels, lowest first: **0** your own unlayered CSS beats every shipped rule, since all of it sits in `@layer zyncat.components`; **1** the tokens above; **2** an expressive component's `--<component>-*` properties; **3** `className` and `style` per instance, `htmlProps` for an overlay's panel. Replicas answer to none of them. Reduced motion is handled at the token layer, so repoint durations on `:root`, not a nested scope. The [theming docs](https://ui.zyncat.app/theming) walk through each level.
|
|
100
60
|
|
|
101
|
-
###
|
|
61
|
+
### With Tailwind v4
|
|
102
62
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
63
|
+
`init` puts one line above `tailwindcss` in the stylesheet Tailwind compiles:
|
|
64
|
+
|
|
65
|
+
```css
|
|
66
|
+
@import '@zyncat/ui/tailwind.css';
|
|
67
|
+
@import 'tailwindcss';
|
|
106
68
|
```
|
|
107
69
|
|
|
108
|
-
|
|
109
|
-
A barrel makes it possible for one import to pull in modules - and stylesheets - the app
|
|
110
|
-
never asked for, and no amount of tree-shaking makes that guarantee hold across every
|
|
111
|
-
bundler and every non-bundled setup. Subpaths make it structural instead.
|
|
70
|
+
Every role becomes a utility named after its token - `bg-surface`, `text-muted`, `border-subtle`, `text-caption`, `rounded-md`, `shadow-md`, `duration-fast` - reading the token itself, so themes and `dark:` (which follows `data-theme`) reach it. Spacing stays Tailwind's own scale.
|
|
112
71
|
|
|
113
72
|
## Components
|
|
114
73
|
|
|
@@ -124,105 +83,35 @@ bundler and every non-bundled setup. Subpaths make it structural instead.
|
|
|
124
83
|
| Replicas | FacebookFeed, InstagramFeed, TikTok, YouTube |
|
|
125
84
|
| Motion & dev | Glide / GlidePill, MotionDevtools |
|
|
126
85
|
|
|
127
|
-
Each is a named export from
|
|
128
|
-
inline in the types; each component also ships a usage doc (`*.usage.md` beside its source) with
|
|
129
|
-
a maintainer-written example.
|
|
130
|
-
|
|
131
|
-
The **Replicas** row is the exception to the token rule: those four reproduce a real platform
|
|
132
|
-
surface, so their metrics are pinned constants and your theme deliberately cannot move them.
|
|
133
|
-
Everything else answers to the token vocabulary.
|
|
86
|
+
Each is a named export from `@zyncat/ui/<kebab-name>`, with inline prop docs and a usage doc (`*.usage.md` beside its source). Replicas pin platform metrics as constants, so your theme cannot move them. Components take icons as any `ReactNode`; there is no `Icon` export.
|
|
134
87
|
|
|
135
88
|
## For AI coding agents
|
|
136
89
|
|
|
137
|
-
|
|
138
|
-
agent skill into `./.claude/skills/` (the component map, picker tables, recipes, theming guide -
|
|
139
|
-
the knowledge that should sit in the agent's context) and registers the bundled MCP server in
|
|
140
|
-
`./.mcp.json` (the live truth). Re-run it after upgrading the package so the skill matches the
|
|
141
|
-
installed version.
|
|
142
|
-
|
|
143
|
-
**The MCP server** is zero-dependency (stdio), also exposed as the `zyncat-ui-mcp` bin, and works
|
|
144
|
-
with any MCP client:
|
|
90
|
+
`init` installs the `zyncat-ui` skill (component map, picker tables, recipes, theming guide) and registers the zero-dependency MCP server, also exposed as the `zyncat-ui-mcp` bin:
|
|
145
91
|
|
|
146
92
|
```json
|
|
147
93
|
{ "mcpServers": { "zyncat-ui": { "command": "node", "args": ["./node_modules/@zyncat/ui/dist/mcp.js"] } } }
|
|
148
94
|
```
|
|
149
95
|
|
|
150
|
-
Three tools: `get_component` (batch
|
|
151
|
-
maintainer usage doc, live docs URL, complete prop types with the shared type chunks inlined;
|
|
152
|
-
an unknown name returns the whole catalog), `search_api` (ranked keyword search across usage
|
|
153
|
-
docs, prop types and tokens), `get_tokens` (the token vocabulary with real values plus the
|
|
154
|
-
theming levels). The server reads the installed package's usage docs, `dist/types/` declarations
|
|
155
|
-
and `src/tokens/*.css` at call time, so answers always match the installed version.
|
|
156
|
-
|
|
157
|
-
Without MCP, the same contract is readable directly:
|
|
158
|
-
|
|
159
|
-
- **Declaration files under `node_modules/@zyncat/ui/dist/types/`** - every component's props carry
|
|
160
|
-
inline TSDoc, and this is the machine-readable source of truth. Each subpath's `types` entry in
|
|
161
|
-
`package.json` points straight at its file: `./button` resolves to
|
|
162
|
-
`dist/types/components/primitives/button/Button.d.ts`, which fully describes `ButtonProps`.
|
|
163
|
-
- **Usage docs** - `node_modules/@zyncat/ui/src/**/*.usage.md`, one per component: purpose, when
|
|
164
|
-
to pick it, a verified example, the live docs URL.
|
|
165
|
-
- This README.
|
|
96
|
+
Three tools: `get_component` (batch: usage doc, docs URL, complete prop types), `search_api` (ranked search across usage docs, props and tokens), `get_tokens` (the vocabulary with live values and the theming levels). The server reads the installed package at call time, so answers match the installed version. Without MCP, the same contract is `dist/types/**/*.d.ts` and `src/**/*.usage.md` inside `node_modules/@zyncat/ui`.
|
|
166
97
|
|
|
167
98
|
## Copy-paste instead
|
|
168
99
|
|
|
169
|
-
The tarball
|
|
170
|
-
`node_modules/@zyncat/ui/src/components/<tier>/<name>/` into your project. Components aren't fully
|
|
171
|
-
self-contained - they share `src/tokens/`, the `motion-tokens` bridge, the internal `icon/`, and a
|
|
172
|
-
few `*-core` helpers - so copy those alongside. (A shadcn-style registry/CLI could automate this
|
|
173
|
-
later.)
|
|
174
|
-
|
|
175
|
-
## Icons
|
|
176
|
-
|
|
177
|
-
Components render their own glyphs from a small curated Phosphor set, **bundled in** - no icon peer
|
|
178
|
-
to install. Zyncat UI does **not** export an `Icon` component, so where a prop takes an icon
|
|
179
|
-
(`leadingIcon`, a `Tag`'s `icon`, ...) or a component composes icons as children (`Button`), pass
|
|
180
|
-
your own node - any `ReactNode` (e.g. an `@phosphor-icons/react` element, if you choose to use it).
|
|
181
|
-
|
|
182
|
-
## What's inside
|
|
183
|
-
|
|
184
|
-
```
|
|
185
|
-
src/ source (also shipped, for reading)
|
|
186
|
-
-- styles.css base layer: fonts + tokens + glass (link once)
|
|
187
|
-
-- tokens/ CSS custom properties + the TypeScript readers that mirror them
|
|
188
|
-
-- engine/ the WAAPI motion engine
|
|
189
|
-
-- motion/ the React motion layer: Presence, Motion, presets
|
|
190
|
-
-- components/ primitives/ composites/ compound/ expressive/ internal/ - each Tsx imports its own CSS
|
|
191
|
-
-- mcp/ the bundled MCP server
|
|
192
|
-
skills/ the agent skill `npx zyncat-ui init` installs into a consumer project
|
|
193
|
-
dist/ compiled ESM + .d.ts - what you import
|
|
194
|
-
```
|
|
100
|
+
The tarball ships `src/`, so a component can be lifted from `node_modules/@zyncat/ui/src/components/<tier>/<name>/`. Bring `src/tokens/`, the `motion-tokens` bridge, the internal `icon/` and the `*-core` helpers it shares.
|
|
195
101
|
|
|
196
102
|
## Notes
|
|
197
103
|
|
|
198
|
-
-
|
|
199
|
-
|
|
200
|
-
- **Four ways to override, and you never fork the source.** Load your stylesheet after
|
|
201
|
-
`@zyncat/ui/styles.css`, then take the lowest level that works. **0** - every shipped rule
|
|
202
|
-
sits in `@layer zyncat.components`, and unlayered CSS beats every layer at any specificity,
|
|
203
|
-
so `.btn { border-radius: 0 }` just lands. **1** - repoint the tokens to retheme the system,
|
|
204
|
-
in TypeScript with `defineTheme` (below) or on `:root` in your own CSS; the motion engine
|
|
205
|
-
reads the same values, so animation retimes with them.
|
|
206
|
-
**2** - retune one expressive or compound component through its `--<component>-*` properties.
|
|
207
|
-
**3** - `className` and `style` per instance (`htmlProps` for an overlay's panel).
|
|
208
|
-
[`skills/zyncat-ui/references/theming.md`](./skills/zyncat-ui/references/theming.md) has the
|
|
209
|
-
full vocabulary, and `get_tokens` prints it with live values.
|
|
210
|
-
- **Reduced motion is handled at the token layer.** Every `--duration-*` collapses to 1ms under
|
|
211
|
-
`prefers-reduced-motion`, so components need no per-component media query - but that collapse
|
|
212
|
-
targets `:root`, so repoint durations there and not on a nested scope.
|
|
104
|
+
- Fonts: `src/tokens/fonts.css` pulls Geist and Geist Mono from Google Fonts. Self-host them to drop the network hop.
|
|
105
|
+
- Layout: `src/` (tokens, engine, motion, components, mcp; shipped for reading), `skills/` the agent skill, `dist/` what you import.
|
|
213
106
|
|
|
214
107
|
## Develop
|
|
215
108
|
|
|
216
109
|
```bash
|
|
217
110
|
pnpm install
|
|
218
|
-
pnpm build
|
|
219
|
-
pnpm
|
|
220
|
-
pnpm
|
|
221
|
-
pnpm
|
|
222
|
-
pnpm check:usage # every subpath has a usage doc, and its example props are real
|
|
223
|
-
pnpm check:authoring # docs/authoring + CLAUDE.md still match the code
|
|
224
|
-
pnpm verify # every gate above, in order
|
|
111
|
+
pnpm build # dist/ (ESM + .d.ts) and the CLI
|
|
112
|
+
pnpm verify # every check plus the build, in parallel lanes
|
|
113
|
+
pnpm check <name...> # css contracts authoring exports tsconfig skill theme history shim usage props format typecheck
|
|
114
|
+
pnpm sync <name...> # theme shim exports tsconfig props skill
|
|
225
115
|
```
|
|
226
116
|
|
|
227
|
-
Contributing
|
|
228
|
-
[`docs/authoring/`](docs/authoring/).
|
|
117
|
+
Contributing? Start at [`CLAUDE.md`](CLAUDE.md), then [`docs/authoring/`](docs/authoring/).
|
package/dist/alert.css
CHANGED
|
@@ -1,69 +1,64 @@
|
|
|
1
|
-
@layer zyncat.tokens, zyncat.components;
|
|
1
|
+
@layer zyncat.reset, zyncat.tokens, zyncat.components;
|
|
2
2
|
|
|
3
3
|
@layer zyncat.components {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
.alert-shell {
|
|
4
|
+
.zc-alert-shell {
|
|
7
5
|
overflow: hidden;
|
|
8
6
|
}
|
|
9
7
|
|
|
10
|
-
.alert {
|
|
11
|
-
/* tone hooks - repointed by [data-tone] below; info is the default */
|
|
8
|
+
.zc-alert {
|
|
12
9
|
--alert-hue: var(--info);
|
|
13
10
|
--alert-fg: var(--info-text);
|
|
14
11
|
--alert-bg: var(--info-subtle);
|
|
15
|
-
--alert-wash: var(--
|
|
16
|
-
--alert-sheen: rgb(255 255 255 / 0.55);
|
|
12
|
+
--alert-wash: var(--info-wash);
|
|
13
|
+
--alert-sheen: rgb(255 255 255 / calc(0.55 * var(--sheen-strength)));
|
|
17
14
|
|
|
18
15
|
box-sizing: border-box;
|
|
19
16
|
display: flex;
|
|
20
17
|
align-items: center;
|
|
21
18
|
gap: var(--space-3);
|
|
22
19
|
padding: var(--space-3) var(--space-4);
|
|
23
|
-
/* the lit pane: top-light gradient over the tint + 1px inner highlight (Button's lighting model) */
|
|
24
20
|
background: linear-gradient(180deg, color-mix(in oklab, var(--bg-surface) 45%, var(--alert-bg)), var(--alert-bg));
|
|
25
21
|
border: var(--border-hairline) solid color-mix(in oklab, var(--alert-hue) 30%, transparent);
|
|
26
22
|
border-radius: var(--radius-lg);
|
|
23
|
+
background-origin: border-box;
|
|
27
24
|
box-shadow: inset 0 1px 0 0 var(--alert-sheen);
|
|
28
25
|
}
|
|
29
26
|
|
|
30
|
-
.alert[data-tone='success'] {
|
|
27
|
+
.zc-alert[data-tone='success'] {
|
|
31
28
|
--alert-hue: var(--success);
|
|
32
29
|
--alert-fg: var(--success-text);
|
|
33
30
|
--alert-bg: var(--success-subtle);
|
|
34
31
|
--alert-wash: var(--success-wash);
|
|
35
32
|
}
|
|
36
|
-
.alert[data-tone='warning'] {
|
|
33
|
+
.zc-alert[data-tone='warning'] {
|
|
37
34
|
--alert-hue: var(--warning);
|
|
38
35
|
--alert-fg: var(--warning-text);
|
|
39
36
|
--alert-bg: var(--warning-subtle);
|
|
40
37
|
--alert-wash: var(--warning-wash);
|
|
41
38
|
}
|
|
42
|
-
.alert[data-tone='danger'] {
|
|
39
|
+
.zc-alert[data-tone='danger'] {
|
|
43
40
|
--alert-hue: var(--danger);
|
|
44
41
|
--alert-fg: var(--danger-text);
|
|
45
42
|
--alert-bg: var(--danger-subtle);
|
|
46
43
|
--alert-wash: var(--danger-wash);
|
|
47
44
|
}
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
.alert:has(.alert__desc) {
|
|
46
|
+
.zc-alert:has(.zc-alert__desc) {
|
|
51
47
|
align-items: flex-start;
|
|
52
48
|
}
|
|
53
|
-
.alert:has(.alert__desc) .alert__action,
|
|
54
|
-
.alert:has(.alert__desc) .alert__close {
|
|
49
|
+
.zc-alert:has(.zc-alert__desc) .zc-alert__action,
|
|
50
|
+
.zc-alert:has(.zc-alert__desc) .zc-alert__close {
|
|
55
51
|
align-self: center;
|
|
56
52
|
}
|
|
57
53
|
|
|
58
|
-
.alert--banner {
|
|
54
|
+
.zc-alert--banner {
|
|
59
55
|
border-radius: 0;
|
|
60
56
|
border-block-start: 0;
|
|
61
57
|
border-inline: 0;
|
|
62
58
|
padding-inline: var(--space-6);
|
|
63
59
|
}
|
|
64
60
|
|
|
65
|
-
|
|
66
|
-
.alert__icon {
|
|
61
|
+
.zc-alert__icon {
|
|
67
62
|
flex: none;
|
|
68
63
|
display: grid;
|
|
69
64
|
place-items: center;
|
|
@@ -71,43 +66,41 @@
|
|
|
71
66
|
color: var(--alert-hue);
|
|
72
67
|
}
|
|
73
68
|
|
|
74
|
-
.alert__body {
|
|
69
|
+
.zc-alert__body {
|
|
75
70
|
flex: 1 1 auto;
|
|
76
71
|
min-width: 0;
|
|
77
72
|
}
|
|
78
|
-
.alert__title {
|
|
73
|
+
.zc-alert__title {
|
|
79
74
|
margin: 0;
|
|
80
75
|
font: var(--type-label);
|
|
81
76
|
color: var(--alert-fg);
|
|
82
77
|
text-wrap: pretty;
|
|
83
78
|
}
|
|
84
|
-
.alert__desc {
|
|
79
|
+
.zc-alert__desc {
|
|
85
80
|
margin: var(--space-1) 0 0;
|
|
86
81
|
font: var(--type-caption);
|
|
87
82
|
color: color-mix(in oklab, var(--alert-fg) 56%, var(--text-body));
|
|
88
83
|
text-wrap: pretty;
|
|
89
84
|
}
|
|
90
85
|
|
|
91
|
-
|
|
92
|
-
.alert__action {
|
|
86
|
+
.zc-alert__action {
|
|
93
87
|
flex: none;
|
|
94
88
|
color: var(--alert-fg);
|
|
95
89
|
background: transparent;
|
|
96
90
|
}
|
|
97
|
-
.alert__action:hover:not(:disabled) {
|
|
91
|
+
.zc-alert__action:hover:not(:disabled) {
|
|
98
92
|
color: var(--alert-fg);
|
|
99
93
|
background: var(--alert-wash);
|
|
100
94
|
}
|
|
101
|
-
.alert__action:active:not(:disabled) {
|
|
95
|
+
.zc-alert__action:active:not(:disabled) {
|
|
102
96
|
background: color-mix(in oklab, var(--alert-hue) 16%, transparent);
|
|
103
97
|
transform: translateY(var(--space-px));
|
|
104
98
|
}
|
|
105
|
-
.alert[data-tone='danger'] .alert__action {
|
|
99
|
+
.zc-alert[data-tone='danger'] .zc-alert__action {
|
|
106
100
|
--btn-ring: var(--ring-danger);
|
|
107
101
|
}
|
|
108
102
|
|
|
109
|
-
|
|
110
|
-
.alert__close {
|
|
103
|
+
.zc-alert__close {
|
|
111
104
|
flex: none;
|
|
112
105
|
appearance: none;
|
|
113
106
|
display: grid;
|
|
@@ -122,16 +115,16 @@
|
|
|
122
115
|
color: color-mix(in oklab, var(--alert-fg) 64%, transparent);
|
|
123
116
|
cursor: pointer;
|
|
124
117
|
transition: var(--transition-control);
|
|
118
|
+
outline: var(--ring-rest);
|
|
125
119
|
}
|
|
126
|
-
.alert__close:hover {
|
|
120
|
+
.zc-alert__close:hover {
|
|
127
121
|
background: color-mix(in oklab, var(--alert-fg) 9%, transparent);
|
|
128
122
|
color: var(--alert-fg);
|
|
129
123
|
}
|
|
130
|
-
.alert__close:active {
|
|
124
|
+
.zc-alert__close:active {
|
|
131
125
|
background: color-mix(in oklab, var(--alert-fg) 14%, transparent);
|
|
132
126
|
}
|
|
133
|
-
.alert__close:focus-visible {
|
|
134
|
-
outline:
|
|
135
|
-
box-shadow: var(--focus-ring);
|
|
127
|
+
.zc-alert__close:focus-visible {
|
|
128
|
+
outline: var(--focus-ring);
|
|
136
129
|
}
|
|
137
130
|
}
|
package/dist/alert.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
'use client';import { popOut } from './chunk-HDSFWZ7L.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Motion } from './chunk-
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
7
|
-
import
|
|
8
|
-
import { Icon } from './chunk-EAI4POPB.js';
|
|
2
|
+
import { resolveMotionTiming } from './chunk-RY35IU3G.js';
|
|
3
|
+
import { Presence } from './chunk-DH7DT6EO.js';
|
|
4
|
+
import { Motion } from './chunk-FLDIRXFU.js';
|
|
5
|
+
import './chunk-GWCBTD63.js';
|
|
6
|
+
import './chunk-HWDIVGME.js';
|
|
7
|
+
import './chunk-VNVVG47J.js';
|
|
9
8
|
import { useControllable } from './chunk-MMRIQNEN.js';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { IconSlot } from './chunk-WCWV5IX6.js';
|
|
10
|
+
import { Icon } from './chunk-TBLPZQSI.js';
|
|
11
|
+
import { UIMotion } from './chunk-ZHMOH62S.js';
|
|
12
|
+
import { buttonClass } from './chunk-KSAJ6DED.js';
|
|
12
13
|
import './chunk-DMX2F6B4.js';
|
|
13
14
|
import { cx } from './chunk-QGNC7LH5.js';
|
|
14
15
|
import './alert.css';
|
|
@@ -48,24 +49,32 @@ function Alert({
|
|
|
48
49
|
const dismiss = () => setOpen(false);
|
|
49
50
|
const h = resolveMotionTiming(animation, ALERT_HEIGHT_TIMING);
|
|
50
51
|
const o = resolveMotionTiming(animation, ALERT_OPACITY_TIMING);
|
|
51
|
-
const cls = cx("alert", banner && "alert--banner", className);
|
|
52
|
+
const cls = cx("zc-alert", banner && "zc-alert--banner", className);
|
|
52
53
|
return /* @__PURE__ */ jsx(Presence, { initial: false, children: isOpen && /* @__PURE__ */ jsx(
|
|
53
54
|
Motion,
|
|
54
55
|
{
|
|
55
|
-
className: "alert-shell",
|
|
56
|
+
className: "zc-alert-shell",
|
|
56
57
|
animate: [
|
|
57
58
|
{ height: [0, "auto"], timing: h.open },
|
|
58
59
|
{ opacity: [0, 1], timing: o.open }
|
|
59
60
|
],
|
|
60
61
|
exit: [popOut(UIMotion.scale.floating, o.close)],
|
|
61
62
|
children: /* @__PURE__ */ jsxs("div", { className: cls, style, "data-tone": tone, role: TONE_ROLE[tone] || "status", ...htmlProps, children: [
|
|
62
|
-
icon === null ? null : /* @__PURE__ */ jsx("span", { className: "alert__icon", "aria-hidden": "true", children: icon !== void 0 ? /* @__PURE__ */ jsx(IconSlot, { size: "md", children: icon }) : /* @__PURE__ */ jsx(Icon, { name: TONE_GLYPH[tone] || "info", size: "md" }) }),
|
|
63
|
-
/* @__PURE__ */ jsxs("div", { className: "alert__body", children: [
|
|
64
|
-
/* @__PURE__ */ jsx("p", { className: "alert__title", children: title }),
|
|
65
|
-
children != null && /* @__PURE__ */ jsx("p", { className: "alert__desc", children })
|
|
63
|
+
icon === null ? null : /* @__PURE__ */ jsx("span", { className: "zc-alert__icon", "aria-hidden": "true", children: icon !== void 0 ? /* @__PURE__ */ jsx(IconSlot, { size: "md", children: icon }) : /* @__PURE__ */ jsx(Icon, { name: TONE_GLYPH[tone] || "info", size: "md" }) }),
|
|
64
|
+
/* @__PURE__ */ jsxs("div", { className: "zc-alert__body", children: [
|
|
65
|
+
/* @__PURE__ */ jsx("p", { className: "zc-alert__title", children: title }),
|
|
66
|
+
children != null && /* @__PURE__ */ jsx("p", { className: "zc-alert__desc", children })
|
|
66
67
|
] }),
|
|
67
|
-
action && /* @__PURE__ */ jsx(
|
|
68
|
-
|
|
68
|
+
action && /* @__PURE__ */ jsx(
|
|
69
|
+
"button",
|
|
70
|
+
{
|
|
71
|
+
type: "button",
|
|
72
|
+
className: buttonClass({ size: "sm", className: "zc-alert__action" }),
|
|
73
|
+
onClick: action.onClick,
|
|
74
|
+
children: action.label
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
dismissible && /* @__PURE__ */ jsx("button", { type: "button", className: "zc-alert__close", "aria-label": "Dismiss", onClick: dismiss, children: /* @__PURE__ */ jsx(Icon, { name: "close", size: "sm" }) })
|
|
69
78
|
] })
|
|
70
79
|
},
|
|
71
80
|
"alert-shell"
|
package/dist/alert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/composites/alert/Alert.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/composites/alert/Alert.tsx"],"names":[],"mappings":"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","file":"alert.js","sourcesContent":["'use client';\n\nimport './alert.css';\n\nimport type { CSSProperties, HTMLAttributes, ReactNode } from 'react';\n\nimport type { DataAttributes } from '../../../dom-props';\nimport { Motion } from '../../../motion/element';\nimport { resolveMotionTiming } from '../../../motion/motion-timing';\nimport { Presence } from '../../../motion/presence';\nimport { popOut } from '../../../motion/presets';\nimport type { DisableableAnimation } from '../../../motion/timing';\nimport { UIMotion } from '../../../tokens/motion-tokens';\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { Icon, type IconName } from '../../internal/icon/Icon';\nimport { IconSlot } from '../../internal/icon/IconSlot';\nimport { cx } from '../../internal/utils/cx';\nimport { buttonClass } from '../../primitives/button/button-style';\n\nexport type AlertTone = 'info' | 'success' | 'warning' | 'danger';\n\nexport interface AlertAction {\n /** Sentence-case label, e.g. \"Update billing\". */\n label: string;\n onClick?: () => void;\n}\n\ninterface AlertOwnProps {\n /** Status of the message; info/success are polite, warning/danger assertive. Default 'info'. */\n tone?: AlertTone;\n /** The message - sentence case, ideally one line. */\n title: ReactNode;\n /** Optional description; stays neutral - tone marks the message, not the prose. */\n children?: ReactNode;\n /** One action max, rendered as the system secondary small button. */\n action?: AlertAction;\n /** Renders the always-visible close button. Uncontrolled unless `open` is given. */\n dismissible?: boolean;\n /** Fires on dismiss. With `open` set, the parent owns hiding the alert. */\n onDismiss?: () => void;\n /** Controlled visibility; omit for uncontrolled. The exit fades and scales down, then releases the slot. */\n open?: boolean;\n /** App-level strip: square corners, hairline below only. Paint modifier. */\n banner?: boolean;\n /** Override the tone glyph; pass null to render no glyph. */\n icon?: ReactNode | null;\n /** Extra class(es) merged onto the alert. */\n className?: string;\n /** Inline styles merged onto the alert. */\n style?: CSSProperties;\n /** Enter/exit timing - motion tokens only, or `null` to disable (enter and exit snap).\n * @default entrance height 'slow'/'entrance' + opacity 'base'/'entrance'; exit scale + opacity 'fast'/'exit' */\n animation?: DisableableAnimation;\n}\n\nexport interface AlertProps extends AlertOwnProps {\n /** Standard <div> attributes (aria-*, data-*, ...) forwarded to the alert. */\n htmlProps?: Omit<HTMLAttributes<HTMLDivElement>, keyof AlertOwnProps> & DataAttributes;\n}\n\nconst ALERT_HEIGHT_TIMING = {\n open: { duration: 'slow', ease: 'entrance' },\n close: { duration: 'slow', ease: 'entrance' },\n} as const;\nconst ALERT_OPACITY_TIMING = {\n open: { duration: 'base', ease: 'entrance' },\n close: { duration: 'fast', ease: 'exit' },\n} as const;\n\nconst TONE_GLYPH: Record<AlertTone, IconName> = {\n info: 'info',\n success: 'check-circle',\n warning: 'warning',\n danger: 'warning-circle',\n};\nconst TONE_ROLE: Record<AlertTone, string> = { info: 'status', success: 'status', warning: 'alert', danger: 'alert' };\n\nexport function Alert({\n tone = 'info',\n title,\n children = null,\n action = null,\n dismissible = false,\n onDismiss,\n open,\n banner = false,\n icon,\n className = '',\n style,\n htmlProps,\n animation,\n}: AlertProps) {\n const [isOpen, setOpen] = useControllable(open, true, onDismiss);\n const dismiss = () => setOpen(false);\n\n const h = resolveMotionTiming(animation, ALERT_HEIGHT_TIMING);\n const o = resolveMotionTiming(animation, ALERT_OPACITY_TIMING);\n\n const cls = cx('zc-alert', banner && 'zc-alert--banner', className);\n\n return (\n <Presence initial={false}>\n {isOpen && (\n <Motion\n key=\"alert-shell\"\n className=\"zc-alert-shell\"\n animate={[\n { height: [0, 'auto'], timing: h.open },\n { opacity: [0, 1], timing: o.open },\n ]}\n exit={[popOut(UIMotion.scale.floating, o.close)]}\n >\n <div className={cls} style={style} data-tone={tone} role={TONE_ROLE[tone] || 'status'} {...htmlProps}>\n {icon === null ? null : (\n <span className=\"zc-alert__icon\" aria-hidden=\"true\">\n {icon !== undefined ? (\n <IconSlot size=\"md\">{icon}</IconSlot>\n ) : (\n <Icon name={TONE_GLYPH[tone] || 'info'} size=\"md\" />\n )}\n </span>\n )}\n <div className=\"zc-alert__body\">\n <p className=\"zc-alert__title\">{title}</p>\n {children != null && <p className=\"zc-alert__desc\">{children}</p>}\n </div>\n {action && (\n <button\n type=\"button\"\n className={buttonClass({ size: 'sm', className: 'zc-alert__action' })}\n onClick={action.onClick}\n >\n {action.label}\n </button>\n )}\n {dismissible && (\n <button type=\"button\" className=\"zc-alert__close\" aria-label=\"Dismiss\" onClick={dismiss}>\n <Icon name=\"close\" size=\"sm\" />\n </button>\n )}\n </div>\n </Motion>\n )}\n </Presence>\n );\n}\n"]}
|
package/dist/avatar-group.js
CHANGED
|
@@ -7,11 +7,11 @@ function AvatarGroup({ children, max = 5, size = "md", className = "", style, ht
|
|
|
7
7
|
const items = Children.toArray(children);
|
|
8
8
|
const visible = max > 0 ? items.slice(0, max) : items;
|
|
9
9
|
const overflow = items.length - visible.length;
|
|
10
|
-
return /* @__PURE__ */ jsxs("span", { className: cx("avatar-group", className), style, ...htmlProps, children: [
|
|
10
|
+
return /* @__PURE__ */ jsxs("span", { className: cx("zc-avatar-group", className), style, ...htmlProps, children: [
|
|
11
11
|
visible.map(
|
|
12
12
|
(child, i) => isValidElement(child) ? cloneElement(child, { size, key: child.key ?? i }) : child
|
|
13
13
|
),
|
|
14
|
-
overflow > 0 && /* @__PURE__ */ jsx("span", { className: `avatar avatar--${size} avatar--overflow`, role: "img", "aria-label": `${overflow} more`, children: /* @__PURE__ */ jsx("span", { className: "avatar__face", children: /* @__PURE__ */ jsxs("span", { className: "avatar__initials", children: [
|
|
14
|
+
overflow > 0 && /* @__PURE__ */ jsx("span", { className: `zc-avatar zc-avatar--${size} zc-avatar--overflow`, role: "img", "aria-label": `${overflow} more`, children: /* @__PURE__ */ jsx("span", { className: "zc-avatar__face", children: /* @__PURE__ */ jsxs("span", { className: "zc-avatar__initials", children: [
|
|
15
15
|
"+",
|
|
16
16
|
overflow
|
|
17
17
|
] }) }) })
|
package/dist/avatar-group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/primitives/avatar/AvatarGroup.tsx"],"names":[],"mappings":";;;;;AAoCO,SAAS,WAAA,CAAY,EAAE,QAAA,EAAU,GAAA,GAAM,CAAA,EAAG,IAAA,GAAO,IAAA,EAAM,SAAA,GAAY,EAAA,EAAI,KAAA,EAAO,SAAA,EAAU,EAAqB;AAClH,EAAA,MAAM,KAAA,GAAQ,QAAA,CAAS,OAAA,CAAQ,QAAQ,CAAA;AACvC,EAAA,MAAM,UAAU,GAAA,GAAM,CAAA,GAAI,MAAM,KAAA,CAAM,CAAA,EAAG,GAAG,CAAA,GAAI,KAAA;AAChD,EAAA,MAAM,QAAA,GAAW,KAAA,CAAM,MAAA,GAAS,OAAA,CAAQ,MAAA;AAExC,EAAA,uBACE,IAAA,CAAC,UAAK,SAAA,EAAW,EAAA,CAAG,
|
|
1
|
+
{"version":3,"sources":["../src/components/primitives/avatar/AvatarGroup.tsx"],"names":[],"mappings":";;;;;AAoCO,SAAS,WAAA,CAAY,EAAE,QAAA,EAAU,GAAA,GAAM,CAAA,EAAG,IAAA,GAAO,IAAA,EAAM,SAAA,GAAY,EAAA,EAAI,KAAA,EAAO,SAAA,EAAU,EAAqB;AAClH,EAAA,MAAM,KAAA,GAAQ,QAAA,CAAS,OAAA,CAAQ,QAAQ,CAAA;AACvC,EAAA,MAAM,UAAU,GAAA,GAAM,CAAA,GAAI,MAAM,KAAA,CAAM,CAAA,EAAG,GAAG,CAAA,GAAI,KAAA;AAChD,EAAA,MAAM,QAAA,GAAW,KAAA,CAAM,MAAA,GAAS,OAAA,CAAQ,MAAA;AAExC,EAAA,uBACE,IAAA,CAAC,UAAK,SAAA,EAAW,EAAA,CAAG,mBAAmB,SAAS,CAAA,EAAG,KAAA,EAAe,GAAG,SAAA,EAClE,QAAA,EAAA;AAAA,IAAA,OAAA,CAAQ,GAAA;AAAA,MAAI,CAAC,KAAA,EAAO,CAAA,KACnB,cAAA,CAAe,KAAK,CAAA,GAChB,YAAA,CAAa,KAAA,EAA8C,EAAE,MAAM,GAAA,EAAK,KAAA,CAAM,GAAA,IAAO,CAAA,EAAG,CAAA,GACxF;AAAA,KACN;AAAA,IACC,QAAA,GAAW,qBACV,GAAA,CAAC,MAAA,EAAA,EAAK,WAAW,CAAA,qBAAA,EAAwB,IAAI,wBAAwB,IAAA,EAAK,KAAA,EAAM,cAAY,CAAA,EAAG,QAAQ,SACrG,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,WAAU,iBAAA,EACd,QAAA,kBAAA,IAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,qBAAA,EAAsB,QAAA,EAAA;AAAA,MAAA,GAAA;AAAA,MAAE;AAAA,KAAA,EAAS,GACnD,CAAA,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ","file":"avatar-group.js","sourcesContent":["'use client';\n\nimport './avatar.css';\n\nimport {\n Children,\n cloneElement,\n isValidElement,\n type CSSProperties,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\nimport type { DataAttributes } from '../../../dom-props';\nimport { cx } from '../../internal/utils/cx';\nimport type { AvatarSize } from './Avatar';\n\ninterface AvatarGroupOwnProps {\n /** The `Avatar` elements to stack; each is cloned to force `size`, then sliced to `max`. */\n children: ReactNode;\n /** Max visible avatars before \"+N\" overflow chip. Default 5. */\n max?: number;\n /** Uniform size applied to all children. Default 'md'. */\n size?: AvatarSize;\n /** Extra class(es) merged onto the group wrapper. */\n className?: string;\n /** Inline styles merged onto the group wrapper. */\n style?: CSSProperties;\n}\n\nexport interface AvatarGroupProps extends AvatarGroupOwnProps {\n /** Standard <span> attributes forwarded to the group wrapper. */\n htmlProps?: Omit<HTMLAttributes<HTMLSpanElement>, keyof AvatarGroupOwnProps> & DataAttributes;\n}\n\nexport function AvatarGroup({ children, max = 5, size = 'md', className = '', style, htmlProps }: AvatarGroupProps) {\n const items = Children.toArray(children);\n const visible = max > 0 ? items.slice(0, max) : items;\n const overflow = items.length - visible.length;\n\n return (\n <span className={cx('zc-avatar-group', className)} style={style} {...htmlProps}>\n {visible.map((child, i) =>\n isValidElement(child)\n ? cloneElement(child as ReactElement<{ size?: AvatarSize }>, { size, key: child.key ?? i })\n : child,\n )}\n {overflow > 0 && (\n <span className={`zc-avatar zc-avatar--${size} zc-avatar--overflow`} role=\"img\" aria-label={`${overflow} more`}>\n <span className=\"zc-avatar__face\">\n <span className=\"zc-avatar__initials\">+{overflow}</span>\n </span>\n </span>\n )}\n </span>\n );\n}\n"]}
|