@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
|
@@ -9,60 +9,74 @@ import {
|
|
|
9
9
|
type CSSProperties,
|
|
10
10
|
type HTMLAttributes,
|
|
11
11
|
type ReactNode,
|
|
12
|
-
type PointerEvent as ReactPointerEvent,
|
|
13
12
|
type RefObject,
|
|
14
13
|
} from 'react';
|
|
15
14
|
|
|
16
15
|
import type { DataAttributes } from '../../../dom-props';
|
|
17
|
-
import {
|
|
16
|
+
import { animate, type Layer } from '../../../engine';
|
|
18
17
|
import { Motion } from '../../../motion/element';
|
|
18
|
+
import { resolveMotionTiming } from '../../../motion/motion-timing';
|
|
19
19
|
import { Presence } from '../../../motion/presence';
|
|
20
20
|
import { usePresence } from '../../../motion/presence-context';
|
|
21
|
+
import type { DisableableAnimation } from '../../../motion/timing';
|
|
21
22
|
import type { SupportRailStyle } from '../../../tokens/component-styles.generated';
|
|
22
|
-
import { UIMotion } from '../../../tokens/motion-tokens';
|
|
23
|
+
import { UIMotion, type MotionTransition } from '../../../tokens/motion-tokens';
|
|
23
24
|
import { useControllable } from '../../internal/hooks/use-controllable';
|
|
25
|
+
import { Icon } from '../../internal/icon/Icon';
|
|
24
26
|
import { useReturnFocus } from '../../internal/overlay/focus';
|
|
25
27
|
import { useOutsidePress, useOverlayEntry } from '../../internal/overlay/layer';
|
|
26
28
|
import type { SupportAction } from '../../internal/support/types';
|
|
27
29
|
import { cx } from '../../internal/utils/cx';
|
|
30
|
+
import { Button } from '../../primitives/button/Button';
|
|
31
|
+
import { buttonClass } from '../../primitives/button/button-style';
|
|
28
32
|
|
|
29
33
|
export type { SupportAction };
|
|
30
34
|
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
const RAIL_TIMING = {
|
|
36
|
+
open: { duration: 'slower', ease: 'spring' },
|
|
37
|
+
close: { duration: 'slow', ease: 'exit' },
|
|
38
|
+
} as const;
|
|
39
|
+
|
|
35
40
|
const CONTENT_FADE_IN_DELAY_RATIO = 0.55;
|
|
36
|
-
const NEUTRAL_RATIO = 1;
|
|
37
41
|
const STAGGER_STEPS_MAX = 8;
|
|
38
42
|
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
const INDEX_PROPERTY = '--_support-rail-index';
|
|
44
|
+
const MORPHING_ATTRIBUTE = 'data-morphing';
|
|
45
|
+
|
|
46
|
+
interface ShellBox {
|
|
47
|
+
width: number;
|
|
48
|
+
height: number;
|
|
49
|
+
radius: string;
|
|
50
|
+
}
|
|
45
51
|
|
|
46
|
-
const
|
|
52
|
+
const contentFadeIn = (): Layer => ({
|
|
47
53
|
opacity: [0, 1],
|
|
48
54
|
timing: { duration: UIMotion.dur.slow, ease: 'linear', delay: UIMotion.dur.base * CONTENT_FADE_IN_DELAY_RATIO },
|
|
49
|
-
};
|
|
50
|
-
const
|
|
55
|
+
});
|
|
56
|
+
const contentFadeOut = (): Layer => ({ opacity: [0], timing: { duration: UIMotion.dur.fast, ease: 'linear' } });
|
|
51
57
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
function collapseRatio(needleSpan: number, panelSpan: number): number {
|
|
55
|
-
return panelSpan > 0 ? needleSpan / panelSpan : NEUTRAL_RATIO;
|
|
58
|
+
function measureShell(shell: HTMLElement): ShellBox {
|
|
59
|
+
return { width: shell.offsetWidth, height: shell.offsetHeight, radius: getComputedStyle(shell).borderRadius };
|
|
56
60
|
}
|
|
57
61
|
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
function morphShell(shell: HTMLElement, from: ShellBox, to: ShellBox, transition: MotionTransition) {
|
|
63
|
+
return animate(shell, {
|
|
64
|
+
width: [from.width, to.width],
|
|
65
|
+
height: [from.height, to.height],
|
|
66
|
+
radius: [from.radius, to.radius],
|
|
67
|
+
timing: { ...transition, fill: 'none' },
|
|
68
|
+
});
|
|
61
69
|
}
|
|
62
70
|
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
|
|
71
|
+
function fadeTab(tab: HTMLElement, open: boolean, transition: MotionTransition) {
|
|
72
|
+
const timing = open
|
|
73
|
+
? { duration: UIMotion.dur.fast, ease: 'linear' as const }
|
|
74
|
+
: {
|
|
75
|
+
duration: UIMotion.dur.fast,
|
|
76
|
+
ease: 'linear' as const,
|
|
77
|
+
delay: Math.max(0, transition.duration - UIMotion.dur.fast),
|
|
78
|
+
};
|
|
79
|
+
animate(tab, { opacity: open ? [1, 0] : [0, 1], timing });
|
|
66
80
|
}
|
|
67
81
|
|
|
68
82
|
function indexStyle(index: number): CSSProperties {
|
|
@@ -77,9 +91,7 @@ function SupportRailBody({
|
|
|
77
91
|
children,
|
|
78
92
|
panelId,
|
|
79
93
|
titleId,
|
|
80
|
-
|
|
81
|
-
needleRef,
|
|
82
|
-
onGrab,
|
|
94
|
+
shellRef,
|
|
83
95
|
requestClose,
|
|
84
96
|
onSelect,
|
|
85
97
|
}: {
|
|
@@ -90,18 +102,16 @@ function SupportRailBody({
|
|
|
90
102
|
children?: ReactNode;
|
|
91
103
|
panelId: string;
|
|
92
104
|
titleId: string;
|
|
93
|
-
|
|
94
|
-
needleRef: RefObject<HTMLElement>;
|
|
95
|
-
onGrab: GrabHandler;
|
|
105
|
+
shellRef: RefObject<HTMLElement>;
|
|
96
106
|
requestClose: () => void;
|
|
97
107
|
onSelect?: (id: string, action: SupportAction) => void;
|
|
98
108
|
}) {
|
|
99
109
|
const bodyRef = useRef<HTMLElement>(null);
|
|
100
110
|
const { isPresent } = usePresence();
|
|
101
|
-
const entry = useOverlayEntry({ nodeRef:
|
|
111
|
+
const entry = useOverlayEntry({ nodeRef: shellRef, dismissible: isPresent, requestClose });
|
|
102
112
|
|
|
103
|
-
useOutsidePress({ entry, refs: [
|
|
104
|
-
useReturnFocus(
|
|
113
|
+
useOutsidePress({ entry, refs: [shellRef], enabled: isPresent, onPress: requestClose });
|
|
114
|
+
useReturnFocus(shellRef);
|
|
105
115
|
|
|
106
116
|
useLayoutEffect(() => {
|
|
107
117
|
bodyRef.current?.focus({ preventScroll: true });
|
|
@@ -116,66 +126,66 @@ function SupportRailBody({
|
|
|
116
126
|
<Motion
|
|
117
127
|
as="div"
|
|
118
128
|
ref={bodyRef}
|
|
119
|
-
animate={
|
|
120
|
-
exit={
|
|
121
|
-
className="support-rail__body"
|
|
129
|
+
animate={contentFadeIn()}
|
|
130
|
+
exit={contentFadeOut()}
|
|
131
|
+
className="zc-support-rail__body"
|
|
122
132
|
id={panelId}
|
|
123
133
|
role="dialog"
|
|
124
134
|
aria-modal="false"
|
|
125
135
|
aria-labelledby={titleId}
|
|
126
136
|
tabIndex={-1}
|
|
127
137
|
>
|
|
128
|
-
<
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
<div className="support-rail__stack">
|
|
133
|
-
<div className="support-rail__header">
|
|
134
|
-
<div className="support-rail__heading">
|
|
135
|
-
<div className="support-rail__title" id={titleId}>
|
|
136
|
-
{title}
|
|
137
|
-
</div>
|
|
138
|
-
{status && <div className="support-rail__status">{status}</div>}
|
|
138
|
+
<div className="zc-support-rail__header">
|
|
139
|
+
<div className="zc-support-rail__heading">
|
|
140
|
+
<div className="zc-support-rail__title" id={titleId}>
|
|
141
|
+
{title}
|
|
139
142
|
</div>
|
|
140
|
-
<
|
|
141
|
-
<svg width="9" height="9" viewBox="0 0 9 9" fill="none" stroke="currentColor" strokeWidth="1.3">
|
|
142
|
-
<path d="M1 1l7 7M8 1l-7 7" />
|
|
143
|
-
</svg>
|
|
144
|
-
</button>
|
|
143
|
+
{status && <div className="zc-support-rail__status">{status}</div>}
|
|
145
144
|
</div>
|
|
145
|
+
<Button
|
|
146
|
+
variant="ghost"
|
|
147
|
+
size="icon"
|
|
148
|
+
className="zc-support-rail__close"
|
|
149
|
+
aria-label="Close"
|
|
150
|
+
onClick={requestClose}
|
|
151
|
+
>
|
|
152
|
+
<Icon name="x" size="sm" />
|
|
153
|
+
</Button>
|
|
154
|
+
</div>
|
|
146
155
|
|
|
147
|
-
|
|
156
|
+
<div className="zc-support-rail__scroll">
|
|
157
|
+
<ul className="zc-support-rail__list">
|
|
148
158
|
{actions.map((action, index) => (
|
|
149
159
|
<li key={action.id}>
|
|
150
160
|
<button
|
|
151
161
|
type="button"
|
|
152
|
-
className="support-rail__row"
|
|
162
|
+
className="zc-support-rail__row"
|
|
153
163
|
style={indexStyle(index)}
|
|
154
164
|
onClick={() => commit(action)}
|
|
155
165
|
>
|
|
156
|
-
<span className="support-rail__row-icon" aria-hidden="true">
|
|
166
|
+
<span className="zc-support-rail__row-icon" aria-hidden="true">
|
|
157
167
|
{action.icon}
|
|
158
168
|
</span>
|
|
159
|
-
<span className="support-rail__row-text">
|
|
160
|
-
<span className="support-rail__row-label">{action.label}</span>
|
|
161
|
-
{action.description && <span className="support-rail__row-note">{action.description}</span>}
|
|
169
|
+
<span className="zc-support-rail__row-text">
|
|
170
|
+
<span className="zc-support-rail__row-label">{action.label}</span>
|
|
171
|
+
{action.description && <span className="zc-support-rail__row-note">{action.description}</span>}
|
|
162
172
|
</span>
|
|
163
|
-
{action.meta && <span className="support-rail__row-meta">{action.meta}</span>}
|
|
173
|
+
{action.meta && <span className="zc-support-rail__row-meta">{action.meta}</span>}
|
|
164
174
|
</button>
|
|
165
175
|
</li>
|
|
166
176
|
))}
|
|
167
177
|
</ul>
|
|
168
178
|
|
|
169
|
-
<div className="support-rail__extra" style={indexStyle(actions.length)}>
|
|
179
|
+
<div className="zc-support-rail__extra" style={indexStyle(actions.length)}>
|
|
170
180
|
{children}
|
|
171
181
|
</div>
|
|
172
|
-
|
|
173
|
-
{footer && (
|
|
174
|
-
<div className="support-rail__footer" style={indexStyle(actions.length + 1)}>
|
|
175
|
-
{footer}
|
|
176
|
-
</div>
|
|
177
|
-
)}
|
|
178
182
|
</div>
|
|
183
|
+
|
|
184
|
+
{footer && (
|
|
185
|
+
<div className="zc-support-rail__footer" style={indexStyle(actions.length + 1)}>
|
|
186
|
+
{footer}
|
|
187
|
+
</div>
|
|
188
|
+
)}
|
|
179
189
|
</Motion>
|
|
180
190
|
);
|
|
181
191
|
}
|
|
@@ -185,9 +195,9 @@ export interface SupportRailOwnProps {
|
|
|
185
195
|
actions: SupportAction[];
|
|
186
196
|
/** Panel heading, and the panel's accessible name. @default 'Talk to us' */
|
|
187
197
|
title?: string;
|
|
188
|
-
/** Small
|
|
198
|
+
/** Small mono line under the heading - opening hours, queue depth, a shift note. */
|
|
189
199
|
status?: string;
|
|
190
|
-
/** Container edge the rail pins to. Flips the
|
|
200
|
+
/** Container edge the rail pins to. Flips the tab, the morph origin and the panel's border. @default 'right' */
|
|
191
201
|
side?: 'right' | 'left';
|
|
192
202
|
/** Controlled open state. Omit to stay uncontrolled. */
|
|
193
203
|
open?: boolean;
|
|
@@ -197,11 +207,12 @@ export interface SupportRailOwnProps {
|
|
|
197
207
|
onOpenChange?: (open: boolean) => void;
|
|
198
208
|
/** Fires when a row commits - gets its `id` and the full action. The rail stays open; render what happens next in `children`. */
|
|
199
209
|
onSelect?: (id: string, action: SupportAction) => void;
|
|
200
|
-
/**
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
|
|
204
|
-
|
|
210
|
+
/** Retune the morph, per direction. `null` turns it off and the rail snaps. */
|
|
211
|
+
animation?: DisableableAnimation;
|
|
212
|
+
/** What sits inside the edge tab - an icon, a word, an avatar. The rail owns the tab itself: its
|
|
213
|
+
* edge, its ARIA and its morph. Defaults to a chat glyph; `title` names it either way. */
|
|
214
|
+
trigger?: ReactNode;
|
|
215
|
+
/** Arbitrary content under the rows, inside the same scroll region. */
|
|
205
216
|
children?: ReactNode;
|
|
206
217
|
/** Pinned bottom strip - on-shift avatars, an SLA line, a link out. */
|
|
207
218
|
footer?: ReactNode;
|
|
@@ -225,8 +236,8 @@ export function SupportRail({
|
|
|
225
236
|
defaultOpen = false,
|
|
226
237
|
onOpenChange,
|
|
227
238
|
onSelect,
|
|
228
|
-
|
|
229
|
-
|
|
239
|
+
animation,
|
|
240
|
+
trigger,
|
|
230
241
|
children,
|
|
231
242
|
footer,
|
|
232
243
|
className = '',
|
|
@@ -235,88 +246,67 @@ export function SupportRail({
|
|
|
235
246
|
}: SupportRailProps) {
|
|
236
247
|
const [open, setOpen] = useControllable(controlledOpen, defaultOpen, onOpenChange);
|
|
237
248
|
const rootRef = useRef<HTMLDivElement>(null);
|
|
238
|
-
const
|
|
239
|
-
const
|
|
240
|
-
const
|
|
249
|
+
const shellRef = useRef<HTMLElement>(null);
|
|
250
|
+
const tabRef = useRef<HTMLButtonElement>(null);
|
|
251
|
+
const fromBox = useRef<ShellBox | null>(null);
|
|
241
252
|
const autoId = useId();
|
|
242
253
|
const panelId = 'support-rail-' + autoId;
|
|
243
254
|
const titleId = panelId + '-title';
|
|
244
|
-
const
|
|
245
|
-
const requestClose = () => setOpen(false);
|
|
255
|
+
const timings = resolveMotionTiming(animation, RAIL_TIMING);
|
|
246
256
|
|
|
247
|
-
const
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
250
|
-
|
|
251
|
-
root.setAttribute(DRAGGING_ATTRIBUTE, '');
|
|
252
|
-
detach.current = startDrag(event, {
|
|
253
|
-
onMove: (info: PanInfo) =>
|
|
254
|
-
root.style.setProperty(DRAG_PROPERTY, railTravel(info.offset.x, dismissSign) * dismissSign + 'px'),
|
|
255
|
-
onEnd: (info: PanInfo) => {
|
|
256
|
-
detach.current = null;
|
|
257
|
-
root.removeAttribute(DRAGGING_ATTRIBUTE);
|
|
258
|
-
const travel = railTravel(info.offset.x, dismissSign);
|
|
259
|
-
if (railDismisses(travel, info.velocity.x * dismissSign)) requestClose();
|
|
260
|
-
else root.style.setProperty(DRAG_PROPERTY, NO_DRAG);
|
|
261
|
-
},
|
|
262
|
-
});
|
|
257
|
+
const toggle = (next: boolean) => {
|
|
258
|
+
const shell = shellRef.current;
|
|
259
|
+
if (shell) fromBox.current = measureShell(shell);
|
|
260
|
+
setOpen(next);
|
|
263
261
|
};
|
|
264
262
|
|
|
265
263
|
useLayoutEffect(() => {
|
|
266
264
|
const root = rootRef.current;
|
|
267
|
-
const
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
root.style.setProperty(COLLAPSE_Y_PROPERTY, String(collapseRatio(needle.offsetHeight, panel.offsetHeight)));
|
|
273
|
-
};
|
|
274
|
-
remeasure();
|
|
275
|
-
const sizes = new ResizeObserver(remeasure);
|
|
276
|
-
sizes.observe(panel);
|
|
277
|
-
sizes.observe(needle);
|
|
278
|
-
return () => sizes.disconnect();
|
|
279
|
-
}, [side]);
|
|
265
|
+
const shell = shellRef.current;
|
|
266
|
+
const tab = tabRef.current;
|
|
267
|
+
const from = fromBox.current;
|
|
268
|
+
fromBox.current = null;
|
|
269
|
+
if (!root || !shell || !tab || !from) return undefined;
|
|
280
270
|
|
|
281
|
-
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
root.removeAttribute(DRAGGING_ATTRIBUTE);
|
|
286
|
-
}, [open]);
|
|
271
|
+
const transition = open ? timings.open : timings.close;
|
|
272
|
+
const morph = morphShell(shell, from, measureShell(shell), transition);
|
|
273
|
+
fadeTab(tab, open, transition);
|
|
274
|
+
if (!morph) return undefined;
|
|
287
275
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
|
|
276
|
+
root.setAttribute(MORPHING_ATTRIBUTE, '');
|
|
277
|
+
let live = true;
|
|
278
|
+
morph.finished.then(() => {
|
|
279
|
+
if (live) root.removeAttribute(MORPHING_ATTRIBUTE);
|
|
280
|
+
});
|
|
281
|
+
return () => {
|
|
282
|
+
live = false;
|
|
283
|
+
root.removeAttribute(MORPHING_ATTRIBUTE);
|
|
284
|
+
};
|
|
285
|
+
}, [open]);
|
|
295
286
|
|
|
296
287
|
return (
|
|
297
288
|
<div
|
|
298
289
|
ref={rootRef}
|
|
299
|
-
className={cx('support-rail', className)}
|
|
290
|
+
className={cx('zc-support-rail', className)}
|
|
300
291
|
style={style}
|
|
301
292
|
data-side={side}
|
|
302
293
|
data-open={open}
|
|
303
294
|
{...htmlProps}
|
|
304
295
|
>
|
|
305
|
-
<
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
296
|
+
<div ref={shellRef as RefObject<HTMLDivElement>} className="zc-support-rail__shell">
|
|
297
|
+
<button
|
|
298
|
+
type="button"
|
|
299
|
+
ref={tabRef}
|
|
300
|
+
className={buttonClass({ className: 'zc-support-rail__tab' })}
|
|
301
|
+
aria-expanded={open}
|
|
302
|
+
aria-haspopup="dialog"
|
|
303
|
+
aria-controls={open ? panelId : undefined}
|
|
304
|
+
aria-label={title}
|
|
305
|
+
onClick={() => toggle(true)}
|
|
306
|
+
>
|
|
307
|
+
{trigger ?? <Icon name="chat" />}
|
|
308
|
+
</button>
|
|
318
309
|
|
|
319
|
-
<div ref={panelRef as RefObject<HTMLDivElement>} className="support-rail__panel">
|
|
320
310
|
<Presence>
|
|
321
311
|
{open && (
|
|
322
312
|
<SupportRailBody
|
|
@@ -327,10 +317,8 @@ export function SupportRail({
|
|
|
327
317
|
footer={footer}
|
|
328
318
|
panelId={panelId}
|
|
329
319
|
titleId={titleId}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
onGrab={onGrab}
|
|
333
|
-
requestClose={requestClose}
|
|
320
|
+
shellRef={shellRef}
|
|
321
|
+
requestClose={() => toggle(false)}
|
|
334
322
|
onSelect={onSelect}
|
|
335
323
|
>
|
|
336
324
|
{children}
|
|
@@ -7,12 +7,13 @@ An edge tab that grows a support panel out of its own measured box.
|
|
|
7
7
|
|
|
8
8
|
Pick it over Sheet when the affordance must stay visible and the panel must not take the screen
|
|
9
9
|
over. actions renders the rows; selecting one fires onSelect and leaves the rail open, so render
|
|
10
|
-
what happens next in children. title names the panel, status is the mono line under it,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
what happens next in children. title names the panel and the tab, status is the mono line under it,
|
|
11
|
+
footer pins a bottom strip. trigger is what sits inside the tab - an icon, a word, an avatar; the
|
|
12
|
+
rail keeps the tab's edge, ARIA and fold, and falls back to a chat glyph. side right|left flips the
|
|
13
|
+
tab, the collapse origin and the panel's border. Escape, the close button and a press outside all
|
|
14
|
+
dismiss. The rows and children share one scroll region between the pinned header and footer. Row
|
|
15
|
+
padding is --support-rail-row-pad-block/-inline, not a density prop.
|
|
15
16
|
|
|
16
17
|
```tsx
|
|
17
|
-
<SupportRail actions={actions} status="Open - closes 20:00"
|
|
18
|
+
<SupportRail actions={actions} status="Open - closes 20:00" onSelect={route} />
|
|
18
19
|
```
|