@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
|
@@ -2,9 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
import './motion-devtools.css';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
useCallback,
|
|
7
|
+
useEffect,
|
|
8
|
+
useRef,
|
|
9
|
+
useState,
|
|
10
|
+
type CSSProperties,
|
|
11
|
+
type MouseEvent as ReactMouseEvent,
|
|
12
|
+
type PointerEvent as ReactPointerEvent,
|
|
13
|
+
} from 'react';
|
|
6
14
|
import { createPortal } from 'react-dom';
|
|
7
15
|
|
|
16
|
+
import { startDrag } from '../../engine';
|
|
8
17
|
import { cx } from '../internal/utils/cx';
|
|
9
18
|
import { Button } from '../primitives/button/Button';
|
|
10
19
|
import { Checkbox } from '../primitives/checkbox/Checkbox';
|
|
@@ -14,11 +23,12 @@ import { motionSlowmo, shouldBeActive, type SlowmoState } from './slowmo-engine'
|
|
|
14
23
|
export type MotionDevtoolsPlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
15
24
|
|
|
16
25
|
export interface MotionDevtoolsProps {
|
|
17
|
-
/** Which corner of the viewport
|
|
26
|
+
/** Which corner of the viewport the panel rests in. Dragging moves it off. @default 'bottom-right' */
|
|
18
27
|
placement?: MotionDevtoolsPlacement;
|
|
19
|
-
/** Distance from the viewport edges, in px. @default 16 */
|
|
28
|
+
/** Distance from the viewport edges at rest, in px. @default 16 */
|
|
20
29
|
offset?: number;
|
|
21
|
-
/** Quick-select slow-down factors (1 = real time).
|
|
30
|
+
/** Quick-select slow-down factors (1 = real time). Also the ladder the slower/faster
|
|
31
|
+
* shortcuts step through. @default [1, 2, 4, 8, 16] */
|
|
22
32
|
presets?: number[];
|
|
23
33
|
/** Upper bound of the fine slider. @default 16 */
|
|
24
34
|
maxFactor?: number;
|
|
@@ -27,18 +37,80 @@ export interface MotionDevtoolsProps {
|
|
|
27
37
|
/** Scale setTimeout/setInterval too, so duration-coupled JS cleanups don't truncate
|
|
28
38
|
* slowed CSS. Exposed as a live toggle in the panel. @default true */
|
|
29
39
|
scaleTimers?: boolean;
|
|
30
|
-
/**
|
|
40
|
+
/** Bind the global Alt-chord shortcuts. The panel lists them under Shortcuts. @default true */
|
|
41
|
+
hotkeys?: boolean;
|
|
42
|
+
/** Let the panel be dragged anywhere in the viewport by its header. @default true */
|
|
43
|
+
draggable?: boolean;
|
|
44
|
+
/** Remember the chosen factor and dragged position across reloads (localStorage). @default true */
|
|
31
45
|
persist?: boolean;
|
|
32
46
|
/** Start with the full panel open rather than collapsed to its header. @default false */
|
|
33
47
|
defaultOpen?: boolean;
|
|
48
|
+
/** Extra class on the panel root, e.g. a host token scope. */
|
|
49
|
+
className?: string;
|
|
34
50
|
}
|
|
35
51
|
|
|
52
|
+
type ChordId = 'freeze' | 'slower' | 'faster' | 'realtime' | 'panel';
|
|
53
|
+
|
|
54
|
+
interface Chord {
|
|
55
|
+
id: ChordId;
|
|
56
|
+
code: string;
|
|
57
|
+
label: string;
|
|
58
|
+
keys: string[];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const CHORDS: Chord[] = [
|
|
62
|
+
{ id: 'freeze', code: 'KeyP', label: 'Freeze / resume', keys: ['P'] },
|
|
63
|
+
{ id: 'slower', code: 'Comma', label: 'Slower', keys: [','] },
|
|
64
|
+
{ id: 'faster', code: 'Period', label: 'Faster', keys: ['.'] },
|
|
65
|
+
{ id: 'realtime', code: 'Digit0', label: 'Real time', keys: ['0'] },
|
|
66
|
+
{ id: 'panel', code: 'KeyM', label: 'Show / hide', keys: ['M'] },
|
|
67
|
+
];
|
|
68
|
+
|
|
36
69
|
const STORAGE_KEY = 'zyncat-ui:motion-devtools';
|
|
70
|
+
const DRAG_SLOP_PX = 4;
|
|
71
|
+
const TEXT_INPUT_TYPES = new Set([
|
|
72
|
+
'text',
|
|
73
|
+
'search',
|
|
74
|
+
'email',
|
|
75
|
+
'url',
|
|
76
|
+
'tel',
|
|
77
|
+
'password',
|
|
78
|
+
'number',
|
|
79
|
+
'date',
|
|
80
|
+
'time',
|
|
81
|
+
'datetime-local',
|
|
82
|
+
'month',
|
|
83
|
+
'week',
|
|
84
|
+
]);
|
|
85
|
+
|
|
37
86
|
const fmt = (n: number) => (Number.isInteger(n) ? String(n) : n.toFixed(1));
|
|
87
|
+
const clampRange = (min: number, max: number, v: number) => (v < min ? min : v > max ? max : v);
|
|
88
|
+
const altLabel = () => (/mac|iphone|ipad|ipod/i.test(navigator.userAgent) ? '⌥' : 'Alt');
|
|
89
|
+
|
|
90
|
+
function isTextEntry(target: EventTarget | null): boolean {
|
|
91
|
+
if (!(target instanceof HTMLElement)) return false;
|
|
92
|
+
if (target.isContentEditable) return true;
|
|
93
|
+
if (target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement) return true;
|
|
94
|
+
return target instanceof HTMLInputElement && TEXT_INPUT_TYPES.has(target.type);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function Chevron({ open }: { open: boolean }) {
|
|
98
|
+
return (
|
|
99
|
+
<svg
|
|
100
|
+
className={'zc-mdt__chevron' + (open ? ' zc-mdt__chevron--open' : '')}
|
|
101
|
+
width="12"
|
|
102
|
+
height="12"
|
|
103
|
+
viewBox="0 0 12 12"
|
|
104
|
+
aria-hidden="true"
|
|
105
|
+
>
|
|
106
|
+
<path d="M2.5 4.5 6 8l3.5-3.5" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" />
|
|
107
|
+
</svg>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
38
110
|
|
|
39
111
|
function GaugeGlyph() {
|
|
40
112
|
return (
|
|
41
|
-
<svg className="mdt__glyph" width="15" height="15" viewBox="0 0 24 24" aria-hidden="true">
|
|
113
|
+
<svg className="zc-mdt__glyph" width="15" height="15" viewBox="0 0 24 24" aria-hidden="true">
|
|
42
114
|
<path
|
|
43
115
|
d="M12 4a8 8 0 0 1 8 8 8 8 0 0 1-.6 3"
|
|
44
116
|
fill="none"
|
|
@@ -60,6 +132,14 @@ function GaugeGlyph() {
|
|
|
60
132
|
);
|
|
61
133
|
}
|
|
62
134
|
|
|
135
|
+
function PauseGlyph() {
|
|
136
|
+
return (
|
|
137
|
+
<svg className="zc-mdt__glyph" width="15" height="15" viewBox="0 0 24 24" aria-hidden="true">
|
|
138
|
+
<path d="M9 5v14M15 5v14" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" />
|
|
139
|
+
</svg>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
63
143
|
export function MotionDevtools({
|
|
64
144
|
placement = 'bottom-right',
|
|
65
145
|
offset = 16,
|
|
@@ -67,27 +147,100 @@ export function MotionDevtools({
|
|
|
67
147
|
maxFactor = 16,
|
|
68
148
|
defaultFactor = 1,
|
|
69
149
|
scaleTimers = true,
|
|
150
|
+
hotkeys = true,
|
|
151
|
+
draggable = true,
|
|
70
152
|
persist = true,
|
|
71
153
|
defaultOpen = false,
|
|
154
|
+
className,
|
|
72
155
|
}: MotionDevtoolsProps) {
|
|
73
156
|
const [mounted, setMounted] = useState(false);
|
|
74
157
|
const [open, setOpen] = useState(defaultOpen);
|
|
158
|
+
const [showKeys, setShowKeys] = useState(false);
|
|
75
159
|
const [snap, setSnap] = useState<SlowmoState>(() => motionSlowmo.get());
|
|
76
160
|
const [timers, setTimers] = useState(scaleTimers);
|
|
77
161
|
|
|
162
|
+
const rootRef = useRef<HTMLDivElement>(null);
|
|
163
|
+
const posRef = useRef({ x: 0, y: 0 });
|
|
164
|
+
const pressRef = useRef({ x: 0, y: 0 });
|
|
165
|
+
const runChordRef = useRef<(id: ChordId) => void>(() => {});
|
|
166
|
+
|
|
167
|
+
const writePos = useCallback(() => {
|
|
168
|
+
const el = rootRef.current;
|
|
169
|
+
if (el) el.style.translate = `${posRef.current.x}px ${posRef.current.y}px`;
|
|
170
|
+
}, []);
|
|
171
|
+
|
|
172
|
+
const clampIntoView = useCallback(() => {
|
|
173
|
+
const el = rootRef.current;
|
|
174
|
+
if (!el) return;
|
|
175
|
+
writePos();
|
|
176
|
+
const rect = el.getBoundingClientRect();
|
|
177
|
+
const restLeft = rect.left - posRef.current.x;
|
|
178
|
+
const restTop = rect.top - posRef.current.y;
|
|
179
|
+
posRef.current = {
|
|
180
|
+
x: clampRange(-restLeft, window.innerWidth - rect.width - restLeft, posRef.current.x),
|
|
181
|
+
y: clampRange(-restTop, window.innerHeight - rect.height - restTop, posRef.current.y),
|
|
182
|
+
};
|
|
183
|
+
writePos();
|
|
184
|
+
}, [writePos]);
|
|
185
|
+
|
|
186
|
+
const savePrefs = useCallback(() => {
|
|
187
|
+
if (!persist) return;
|
|
188
|
+
const { factor, paused } = motionSlowmo.get();
|
|
189
|
+
try {
|
|
190
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify({ factor, paused, ...posRef.current }));
|
|
191
|
+
} catch {}
|
|
192
|
+
}, [persist]);
|
|
193
|
+
|
|
194
|
+
const setFactor = (factor: number) => motionSlowmo.set({ factor, paused: false });
|
|
195
|
+
|
|
196
|
+
const stepFactor = (direction: 1 | -1) => {
|
|
197
|
+
const ladder = [...new Set(presets)].sort((a, b) => a - b);
|
|
198
|
+
const current = motionSlowmo.get().factor;
|
|
199
|
+
const next = direction > 0 ? ladder.find((p) => p > current) : ladder.findLast((p) => p < current);
|
|
200
|
+
if (next !== undefined) setFactor(next);
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
const onHeadPointerDown = (e: ReactPointerEvent<HTMLButtonElement>) => {
|
|
204
|
+
pressRef.current = { x: e.clientX, y: e.clientY };
|
|
205
|
+
const el = rootRef.current;
|
|
206
|
+
if (!draggable || e.button !== 0 || !el) return;
|
|
207
|
+
const start = { ...posRef.current };
|
|
208
|
+
let moved = false;
|
|
209
|
+
startDrag(e, {
|
|
210
|
+
onMove: (info) => {
|
|
211
|
+
if (!moved && Math.hypot(info.offset.x, info.offset.y) < DRAG_SLOP_PX) return;
|
|
212
|
+
moved = true;
|
|
213
|
+
el.dataset.dragging = '';
|
|
214
|
+
posRef.current = { x: start.x + info.offset.x, y: start.y + info.offset.y };
|
|
215
|
+
clampIntoView();
|
|
216
|
+
},
|
|
217
|
+
onEnd: () => {
|
|
218
|
+
if (!moved) return;
|
|
219
|
+
delete el.dataset.dragging;
|
|
220
|
+
savePrefs();
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
const isDragRelease = (e: ReactMouseEvent<HTMLButtonElement>) =>
|
|
226
|
+
e.detail !== 0 && Math.hypot(e.clientX - pressRef.current.x, e.clientY - pressRef.current.y) >= DRAG_SLOP_PX;
|
|
227
|
+
|
|
78
228
|
useEffect(() => motionSlowmo.subscribe(setSnap), []);
|
|
79
229
|
|
|
80
230
|
useEffect(() => {
|
|
81
231
|
setMounted(true);
|
|
82
|
-
let
|
|
232
|
+
let stored: { factor?: number; paused?: boolean; x?: number; y?: number } = {};
|
|
83
233
|
if (persist) {
|
|
84
234
|
try {
|
|
85
235
|
const raw = localStorage.getItem(STORAGE_KEY);
|
|
86
|
-
if (raw)
|
|
236
|
+
if (raw) stored = JSON.parse(raw);
|
|
87
237
|
} catch {}
|
|
88
238
|
}
|
|
89
|
-
|
|
90
|
-
|
|
239
|
+
posRef.current = { x: stored.x ?? 0, y: stored.y ?? 0 };
|
|
240
|
+
const factor = stored.factor ?? defaultFactor;
|
|
241
|
+
const paused = stored.paused ?? false;
|
|
242
|
+
motionSlowmo.set({ factor, paused });
|
|
243
|
+
if (shouldBeActive(factor, paused)) setOpen(true);
|
|
91
244
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
92
245
|
}, []);
|
|
93
246
|
|
|
@@ -96,57 +249,103 @@ export function MotionDevtools({
|
|
|
96
249
|
}, [timers]);
|
|
97
250
|
|
|
98
251
|
useEffect(() => {
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
252
|
+
if (mounted) savePrefs();
|
|
253
|
+
}, [snap.factor, snap.paused, mounted, savePrefs]);
|
|
254
|
+
|
|
255
|
+
useEffect(() => {
|
|
256
|
+
const el = rootRef.current;
|
|
257
|
+
if (!mounted || !el) return;
|
|
258
|
+
const observer = new ResizeObserver(clampIntoView);
|
|
259
|
+
observer.observe(el);
|
|
260
|
+
window.addEventListener('resize', clampIntoView);
|
|
261
|
+
return () => {
|
|
262
|
+
observer.disconnect();
|
|
263
|
+
window.removeEventListener('resize', clampIntoView);
|
|
264
|
+
};
|
|
265
|
+
}, [mounted, clampIntoView]);
|
|
266
|
+
|
|
267
|
+
useEffect(() => {
|
|
268
|
+
runChordRef.current = (id: ChordId) => {
|
|
269
|
+
const live = motionSlowmo.get();
|
|
270
|
+
switch (id) {
|
|
271
|
+
case 'freeze':
|
|
272
|
+
return motionSlowmo.set({ paused: !live.paused });
|
|
273
|
+
case 'slower':
|
|
274
|
+
return stepFactor(1);
|
|
275
|
+
case 'faster':
|
|
276
|
+
return stepFactor(-1);
|
|
277
|
+
case 'realtime':
|
|
278
|
+
return motionSlowmo.reset();
|
|
279
|
+
case 'panel':
|
|
280
|
+
return setOpen((o) => !o);
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
useEffect(() => {
|
|
286
|
+
if (!hotkeys) return;
|
|
287
|
+
const onKeyDown = (e: KeyboardEvent) => {
|
|
288
|
+
if (!e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || isTextEntry(e.target)) return;
|
|
289
|
+
const chord = CHORDS.find((c) => c.code === e.code);
|
|
290
|
+
if (!chord) return;
|
|
291
|
+
e.preventDefault();
|
|
292
|
+
e.stopPropagation();
|
|
293
|
+
runChordRef.current(chord.id);
|
|
294
|
+
};
|
|
295
|
+
window.addEventListener('keydown', onKeyDown, true);
|
|
296
|
+
return () => window.removeEventListener('keydown', onKeyDown, true);
|
|
297
|
+
}, [hotkeys]);
|
|
104
298
|
|
|
105
299
|
if (!mounted) return null;
|
|
106
300
|
|
|
107
301
|
const active = shouldBeActive(snap.factor, snap.paused);
|
|
108
|
-
const rootClass = cx('mdt', `mdt--${placement}`, active && 'mdt--active', snap.paused && 'mdt--paused');
|
|
109
|
-
|
|
110
|
-
const setFactor = (factor: number) => motionSlowmo.set({ factor, paused: false });
|
|
111
302
|
const fill = `${((Math.min(snap.factor, maxFactor) - 1) / Math.max(1, maxFactor - 1)) * 100}%`;
|
|
112
|
-
const
|
|
303
|
+
const alt = altLabel();
|
|
304
|
+
|
|
305
|
+
const readout = snap.paused
|
|
306
|
+
? { value: 'Paused', unit: 'frozen' }
|
|
307
|
+
: snap.factor === 1
|
|
308
|
+
? { value: 'Normal', unit: 'real-time' }
|
|
309
|
+
: { value: `${fmt(snap.factor)}×`, unit: 'slower' };
|
|
310
|
+
|
|
311
|
+
const rootClass = cx(
|
|
312
|
+
'zc-mdt',
|
|
313
|
+
`zc-mdt--${placement}`,
|
|
314
|
+
active && 'zc-mdt--active',
|
|
315
|
+
snap.paused && 'zc-mdt--paused',
|
|
316
|
+
draggable && 'zc-mdt--draggable',
|
|
317
|
+
className,
|
|
318
|
+
);
|
|
113
319
|
|
|
114
320
|
return createPortal(
|
|
115
|
-
<div className={rootClass} style={{ '--mdt-offset': `${offset}px` } as CSSProperties}>
|
|
116
|
-
<div className={'mdt__panel' + (open ? ' is-open' : '')} role="group" aria-label="Motion devtools">
|
|
321
|
+
<div ref={rootRef} className={rootClass} style={{ '--mdt-offset': `${offset}px` } as CSSProperties}>
|
|
322
|
+
<div className={'zc-mdt__panel' + (open ? ' zc-is-open' : '')} role="group" aria-label="Motion devtools">
|
|
117
323
|
<button
|
|
118
|
-
className="mdt__head"
|
|
119
|
-
|
|
324
|
+
className="zc-mdt__head"
|
|
325
|
+
onPointerDown={onHeadPointerDown}
|
|
326
|
+
onClick={(e) => {
|
|
327
|
+
if (!isDragRelease(e)) setOpen((o) => !o);
|
|
328
|
+
}}
|
|
120
329
|
aria-expanded={open}
|
|
121
|
-
title=
|
|
330
|
+
title={draggable ? 'Motion devtools - drag to move' : 'Motion devtools'}
|
|
122
331
|
aria-label={open ? 'Collapse motion devtools' : 'Expand motion devtools'}
|
|
123
332
|
>
|
|
124
|
-
<GaugeGlyph />
|
|
125
|
-
<span className="mdt__spacer" />
|
|
126
|
-
<span className="mdt__badge">{
|
|
127
|
-
<
|
|
128
|
-
className={'mdt__chevron' + (open ? ' mdt__chevron--open' : '')}
|
|
129
|
-
width="12"
|
|
130
|
-
height="12"
|
|
131
|
-
viewBox="0 0 12 12"
|
|
132
|
-
aria-hidden="true"
|
|
133
|
-
>
|
|
134
|
-
<path d="M2.5 4.5 6 8l3.5-3.5" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" />
|
|
135
|
-
</svg>
|
|
333
|
+
{snap.paused ? <PauseGlyph /> : <GaugeGlyph />}
|
|
334
|
+
<span className="zc-mdt__spacer" />
|
|
335
|
+
<span className="zc-mdt__badge">{`${fmt(snap.factor)}×`}</span>
|
|
336
|
+
<Chevron open={open} />
|
|
136
337
|
</button>
|
|
137
338
|
|
|
138
339
|
<Collapse open={open} fade>
|
|
139
|
-
<div className="mdt__body">
|
|
140
|
-
<span className="mdt__title">Motion</span>
|
|
141
|
-
<div className="mdt__readout">
|
|
142
|
-
<span className="mdt__value">
|
|
143
|
-
|
|
144
|
-
</span>
|
|
145
|
-
<span className="mdt__unit">{snap.paused ? 'frozen' : snap.factor === 1 ? 'real-time' : 'slower'}</span>
|
|
340
|
+
<div className="zc-mdt__body">
|
|
341
|
+
<span className="zc-mdt__title">Motion</span>
|
|
342
|
+
<div className="zc-mdt__readout">
|
|
343
|
+
<span className="zc-mdt__value">{readout.value}</span>
|
|
344
|
+
<span className="zc-mdt__unit">{readout.unit}</span>
|
|
146
345
|
</div>
|
|
147
346
|
|
|
148
347
|
<input
|
|
149
|
-
className="mdt__slider"
|
|
348
|
+
className="zc-mdt__slider"
|
|
150
349
|
type="range"
|
|
151
350
|
min={1}
|
|
152
351
|
max={maxFactor}
|
|
@@ -157,7 +356,7 @@ export function MotionDevtools({
|
|
|
157
356
|
aria-label="Slow-down factor"
|
|
158
357
|
/>
|
|
159
358
|
|
|
160
|
-
<div className="mdt__chips">
|
|
359
|
+
<div className="zc-mdt__chips">
|
|
161
360
|
{presets.map((p) => (
|
|
162
361
|
<Button
|
|
163
362
|
key={p}
|
|
@@ -170,7 +369,7 @@ export function MotionDevtools({
|
|
|
170
369
|
))}
|
|
171
370
|
</div>
|
|
172
371
|
|
|
173
|
-
<div className="mdt__row">
|
|
372
|
+
<div className="zc-mdt__row">
|
|
174
373
|
<Button
|
|
175
374
|
size="sm"
|
|
176
375
|
variant={snap.paused ? 'primary' : 'secondary'}
|
|
@@ -183,12 +382,34 @@ export function MotionDevtools({
|
|
|
183
382
|
</Button>
|
|
184
383
|
</div>
|
|
185
384
|
|
|
186
|
-
<div className="mdt__opt">
|
|
385
|
+
<div className="zc-mdt__opt">
|
|
187
386
|
<Checkbox size="sm" checked={timers} onChange={(e) => setTimers(e.target.checked)} label="Scale timers" />
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
387
|
+
|
|
388
|
+
<button className="zc-mdt__more" onClick={() => setShowKeys((k) => !k)} aria-expanded={showKeys}>
|
|
389
|
+
<span>Shortcuts</span>
|
|
390
|
+
<Chevron open={showKeys} />
|
|
391
|
+
</button>
|
|
392
|
+
|
|
393
|
+
<Collapse open={showKeys} fade>
|
|
394
|
+
<dl className="zc-mdt__keys">
|
|
395
|
+
{CHORDS.map((chord) => (
|
|
396
|
+
<div className="zc-mdt__keyrow" key={chord.id}>
|
|
397
|
+
<dt>{chord.label}</dt>
|
|
398
|
+
<dd>
|
|
399
|
+
<kbd className="zc-mdt__key">{alt}</kbd>
|
|
400
|
+
{chord.keys.map((key) => (
|
|
401
|
+
<kbd className="zc-mdt__key" key={key}>
|
|
402
|
+
{key}
|
|
403
|
+
</kbd>
|
|
404
|
+
))}
|
|
405
|
+
</dd>
|
|
406
|
+
</div>
|
|
407
|
+
))}
|
|
408
|
+
</dl>
|
|
409
|
+
<p className="zc-mdt__hint">
|
|
410
|
+
Timer scaling keeps duration-based cleanups from cutting slowed animations short.
|
|
411
|
+
</p>
|
|
412
|
+
</Collapse>
|
|
192
413
|
</div>
|
|
193
414
|
</div>
|
|
194
415
|
</Collapse>
|
|
@@ -4,10 +4,18 @@ Group: dev
|
|
|
4
4
|
|
|
5
5
|
Dev-only floating panel that slows or freezes EVERY animation at once (CSS and WAAPI) for motion debugging.
|
|
6
6
|
|
|
7
|
-
Mount once at the app root
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
Mount once at the app root behind a dev check: no provider, no wrapper, and no effect on any other
|
|
8
|
+
component. `placement` top-left|top-right|bottom-left|bottom-right, `offset`, `presets`, `maxFactor`,
|
|
9
|
+
`defaultFactor`, `defaultOpen`, `scaleTimers`, `hotkeys`, `draggable`, `persist`, `className` (extra
|
|
10
|
+
class on the panel root, e.g. a host token scope). While `hotkeys` is on, Alt chords reach it from
|
|
11
|
+
anywhere on the page: Alt P freezes or resumes, Alt , and Alt . step down and up the `presets` ladder,
|
|
12
|
+
Alt 0 returns to real time, Alt M shows or hides the panel. They match the physical key, so a layout
|
|
13
|
+
where Option+P types another character still fires them, they want Alt alone, and they stay quiet
|
|
14
|
+
while you are typing in a field. The open panel lists them under Shortcuts at its foot, closed until
|
|
15
|
+
you ask for it, with the note on what timer scaling buys you. With `draggable` on the header is a drag
|
|
16
|
+
handle: the panel goes anywhere in the viewport and snaps to nothing, held inside the edges as you
|
|
17
|
+
drag, as the window resizes, and as it widens on open. `persist` remembers where you dropped it
|
|
18
|
+
alongside the chosen factor. `motionSlowmo` is exported too, to drive the same state from the console.
|
|
11
19
|
|
|
12
20
|
```tsx
|
|
13
21
|
{
|