@zyncat/ui 0.21.0 → 0.22.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/dist/alert.js +10 -9
- package/dist/alert.js.map +1 -1
- package/dist/avatar.css +1 -1
- package/dist/badge.css +1 -1
- package/dist/badge.js +5 -100
- package/dist/badge.js.map +1 -1
- package/dist/button.css +24 -27
- package/dist/button.js +3 -3
- package/dist/checkbox.css +0 -1
- package/dist/chunk-2EPNCOLN.js +177 -0
- package/dist/chunk-2EPNCOLN.js.map +1 -0
- package/dist/{chunk-3HE7N3UK.js → chunk-2GYZ3HP3.js} +3 -3
- package/dist/chunk-2GYZ3HP3.js.map +1 -0
- package/dist/{chunk-ODRO3KS6.js → chunk-7GTACTZD.js} +8 -6
- package/dist/chunk-7GTACTZD.js.map +1 -0
- package/dist/{chunk-BWGK3OD6.js → chunk-AK2AXGEC.js} +33 -6
- package/dist/chunk-AK2AXGEC.js.map +1 -0
- package/dist/{chunk-5VC3TUZ2.js → chunk-BA4ALXQW.js} +2 -2
- package/dist/{chunk-5VC3TUZ2.js.map → chunk-BA4ALXQW.js.map} +1 -1
- package/dist/{chunk-AXZBD7LY.js → chunk-CF6ZFXRV.js} +16 -11
- package/dist/chunk-CF6ZFXRV.js.map +1 -0
- package/dist/{chunk-AQMR7ZYO.js → chunk-DOAR4PJ3.js} +4 -4
- package/dist/{chunk-AQMR7ZYO.js.map → chunk-DOAR4PJ3.js.map} +1 -1
- package/dist/chunk-EUAXI6OF.js +16 -0
- package/dist/chunk-EUAXI6OF.js.map +1 -0
- package/dist/{chunk-AOEO2LCZ.js → chunk-G2TOUG2A.js} +6 -5
- package/dist/chunk-G2TOUG2A.js.map +1 -0
- package/dist/{chunk-CYZKPUCG.js → chunk-HRP4UFWN.js} +3 -3
- package/dist/chunk-HRP4UFWN.js.map +1 -0
- package/dist/chunk-INK2GJTA.js +102 -0
- package/dist/chunk-INK2GJTA.js.map +1 -0
- package/dist/{chunk-GM7IPTTT.js → chunk-JJHEVW4M.js} +5 -5
- package/dist/{chunk-GM7IPTTT.js.map → chunk-JJHEVW4M.js.map} +1 -1
- package/dist/{chunk-7NHY2CRA.js → chunk-JUC35N3C.js} +2 -2
- package/dist/chunk-JUC35N3C.js.map +1 -0
- package/dist/{chunk-LC6NQQER.js → chunk-LFJ4C7ZP.js} +7 -7
- package/dist/chunk-LFJ4C7ZP.js.map +1 -0
- package/dist/{chunk-JQZ3FTHP.js → chunk-MCOIR3CK.js} +3 -3
- package/dist/{chunk-JQZ3FTHP.js.map → chunk-MCOIR3CK.js.map} +1 -1
- package/dist/{chunk-TXJQUN7C.js → chunk-NATK4DDW.js} +15 -15
- package/dist/{chunk-TXJQUN7C.js.map → chunk-NATK4DDW.js.map} +1 -1
- package/dist/{chunk-BIDVNLJO.js → chunk-O3RMSMBP.js} +8 -3
- package/dist/{chunk-BIDVNLJO.js.map → chunk-O3RMSMBP.js.map} +1 -1
- package/dist/{chunk-47OMFFIB.js → chunk-ODO2TCTS.js} +27 -13
- package/dist/chunk-ODO2TCTS.js.map +1 -0
- package/dist/{chunk-LV442ZOR.js → chunk-P3QSWNED.js} +11 -11
- package/dist/{chunk-LV442ZOR.js.map → chunk-P3QSWNED.js.map} +1 -1
- package/dist/{chunk-QDAN43B6.js → chunk-Q4K337QY.js} +6 -6
- package/dist/chunk-Q4K337QY.js.map +1 -0
- package/dist/{chunk-ZSP4ZTII.js → chunk-RLRZJAF7.js} +20 -8
- package/dist/chunk-RLRZJAF7.js.map +1 -0
- package/dist/{chunk-V4ZN5RD4.js → chunk-SY5UA6WS.js} +29 -9
- package/dist/chunk-SY5UA6WS.js.map +1 -0
- package/dist/{chunk-SPFHWHJ6.js → chunk-TFC5SCAB.js} +32 -13
- package/dist/chunk-TFC5SCAB.js.map +1 -0
- package/dist/{chunk-HBWRKEW4.js → chunk-VBALIMST.js} +3 -3
- package/dist/{chunk-HBWRKEW4.js.map → chunk-VBALIMST.js.map} +1 -1
- package/dist/{chunk-2W7FOMWE.js → chunk-VXQ7A6ZI.js} +8 -8
- package/dist/{chunk-2W7FOMWE.js.map → chunk-VXQ7A6ZI.js.map} +1 -1
- package/dist/{chunk-TBLPZQSI.js → chunk-W7CHDHRV.js} +114 -42
- package/dist/chunk-W7CHDHRV.js.map +1 -0
- package/dist/{chunk-DEZIQTBW.js → chunk-WBWVOOKM.js} +58 -53
- package/dist/chunk-WBWVOOKM.js.map +1 -0
- package/dist/{chunk-6H3IJ752.js → chunk-WJEZWKEY.js} +20 -10
- package/dist/chunk-WJEZWKEY.js.map +1 -0
- package/dist/{chunk-TBIY5YR5.js → chunk-WMTOAYGP.js} +9 -9
- package/dist/{chunk-TBIY5YR5.js.map → chunk-WMTOAYGP.js.map} +1 -1
- package/dist/{chunk-C3D32LE3.js → chunk-WTHIUPVJ.js} +3 -3
- package/dist/{chunk-C3D32LE3.js.map → chunk-WTHIUPVJ.js.map} +1 -1
- package/dist/{chunk-PNFFK5HY.js → chunk-XCTMTOGT.js} +5 -5
- package/dist/{chunk-PNFFK5HY.js.map → chunk-XCTMTOGT.js.map} +1 -1
- package/dist/chunk-XMJ343KF.js +18 -0
- package/dist/chunk-XMJ343KF.js.map +1 -0
- package/dist/collapse.js +1 -1
- package/dist/combobox.css +7 -0
- package/dist/combobox.js +183 -0
- package/dist/combobox.js.map +1 -0
- package/dist/confetti.js +2 -2
- package/dist/{crossfade-XFZLFLT7.js → crossfade-UHUQBUVG.js} +53 -11
- package/dist/crossfade-UHUQBUVG.js.map +1 -0
- package/dist/date-field.js +23 -20
- package/dist/date-field.js.map +1 -1
- package/dist/date-picker.css +25 -40
- package/dist/date-range-field.js +458 -276
- package/dist/date-range-field.js.map +1 -1
- package/dist/datetime-field.js +24 -21
- package/dist/datetime-field.js.map +1 -1
- package/dist/dialog-sheet.css +31 -0
- package/dist/dialog.css +3 -0
- package/dist/dialog.js +42 -40
- package/dist/dialog.js.map +1 -1
- package/dist/dropdown.css +2 -2
- package/dist/dropdown.js +56 -31
- package/dist/dropdown.js.map +1 -1
- package/dist/emoji-picker.js +20 -19
- package/dist/emoji-picker.js.map +1 -1
- package/dist/flow-field.js +2 -2
- package/dist/glide.js +3 -3
- package/dist/input.css +54 -34
- package/dist/instagram-feed.js +3 -3
- package/dist/lens.js +184 -160
- package/dist/lens.js.map +1 -1
- package/dist/mcp.js +29 -22
- package/dist/modal.js +10 -9
- package/dist/modal.js.map +1 -1
- package/dist/morphing-text.js +2 -2
- package/dist/motion-devtools.css +6 -5
- package/dist/motion-devtools.js +6 -6
- package/dist/motion-tokens.js +1 -1
- package/dist/motion.js +6 -5
- package/dist/multi-select.js +41 -20
- package/dist/multi-select.js.map +1 -1
- package/dist/number-field.js +121 -74
- package/dist/number-field.js.map +1 -1
- package/dist/odometer.css +12 -7
- package/dist/odometer.js +158 -39
- package/dist/odometer.js.map +1 -1
- package/dist/otp-field.js +32 -3
- package/dist/otp-field.js.map +1 -1
- package/dist/overlay.css +1 -0
- package/dist/pagination.css +1 -1
- package/dist/pagination.js +6 -6
- package/dist/popover.js +11 -10
- package/dist/radio-group.css +1 -2
- package/dist/radio-group.js +9 -8
- package/dist/radio-group.js.map +1 -1
- package/dist/range-sheet-days.css +35 -0
- package/dist/range-sheet.css +80 -0
- package/dist/range-summary.css +67 -0
- package/dist/scroll-area.css +150 -0
- package/dist/scroll-area.js +85 -0
- package/dist/scroll-area.js.map +1 -0
- package/dist/select.css +22 -1
- package/dist/select.js +15 -14
- package/dist/select.js.map +1 -1
- package/dist/sheet.js +11 -10
- package/dist/support-rail.css +2 -2
- package/dist/support-rail.js +15 -13
- package/dist/support-rail.js.map +1 -1
- package/dist/table-detail.css +27 -0
- package/dist/table.css +35 -13
- package/dist/table.js +341 -172
- package/dist/table.js.map +1 -1
- package/dist/tabs.css +16 -11
- package/dist/tabs.js +68 -56
- package/dist/tabs.js.map +1 -1
- package/dist/tag.css +2 -4
- package/dist/tag.js +8 -7
- package/dist/tag.js.map +1 -1
- package/dist/text-field.js +4 -4
- package/dist/textarea.css +15 -42
- package/dist/textarea.js +24 -26
- package/dist/textarea.js.map +1 -1
- package/dist/theme-grid.js +8 -7
- package/dist/theme-switcher.js +17 -16
- package/dist/theme-switcher.js.map +1 -1
- package/dist/{theme-transition-FDF2REFD.js → theme-transition-F3CBENM5.js} +5 -5
- package/dist/{theme-transition-FDF2REFD.js.map → theme-transition-F3CBENM5.js.map} +1 -1
- package/dist/theme.js +5 -4
- package/dist/theme.js.map +1 -1
- package/dist/tiktok.js +3 -3
- package/dist/time-field.js +13 -8
- package/dist/time-field.js.map +1 -1
- package/dist/toast.css +1 -1
- package/dist/toast.js +11 -10
- package/dist/toast.js.map +1 -1
- package/dist/toggle-tag.js.map +1 -1
- package/dist/toggle.css +0 -1
- package/dist/tooltip.css +1 -1
- package/dist/tooltip.js +21 -15
- package/dist/tooltip.js.map +1 -1
- package/dist/types/components/composites/combobox/Combobox.d.ts +51 -0
- package/dist/types/components/composites/combobox/caret.d.ts +8 -0
- package/dist/types/components/composites/combobox/use-combobox.d.ts +52 -0
- package/dist/types/components/composites/date-picker/DateField.d.ts +1 -1
- package/dist/types/components/composites/date-picker/DateRangeField.d.ts +6 -3
- package/dist/types/components/composites/date-picker/DateTimeField.d.ts +1 -1
- package/dist/types/components/composites/date-picker/TimeField.d.ts +1 -1
- package/dist/types/components/composites/date-picker/date-utils.d.ts +2 -0
- package/dist/types/components/composites/date-picker/field-shell.d.ts +4 -1
- package/dist/types/components/composites/date-picker/month-swipe.d.ts +3 -0
- package/dist/types/components/composites/date-picker/range-day.d.ts +11 -0
- package/dist/types/components/composites/date-picker/range-month.d.ts +14 -0
- package/dist/types/components/composites/date-picker/range-panel.d.ts +4 -18
- package/dist/types/components/composites/date-picker/range-presets.d.ts +24 -0
- package/dist/types/components/composites/date-picker/range-sheet.d.ts +12 -0
- package/dist/types/components/composites/date-picker/range-summary.d.ts +9 -0
- package/dist/types/components/composites/date-picker/typed-key.d.ts +3 -0
- package/dist/types/components/composites/date-picker/use-month-view.d.ts +14 -0
- package/dist/types/components/composites/date-picker/use-range-panel.d.ts +44 -0
- package/dist/types/components/composites/dialog/Dialog.d.ts +3 -2
- package/dist/types/components/composites/dialog/surface.d.ts +17 -0
- package/dist/types/components/composites/dropdown/Dropdown.d.ts +9 -3
- package/dist/types/components/composites/dropdown/types.d.ts +4 -1
- package/dist/types/components/composites/scroll-area/ScrollArea.d.ts +29 -0
- package/dist/types/components/composites/select/MultiSelect.d.ts +9 -3
- package/dist/types/components/composites/select/core/menu.d.ts +3 -1
- package/dist/types/components/composites/select/core/panel.d.ts +4 -3
- package/dist/types/components/composites/select/core/use-listbox.d.ts +5 -5
- package/dist/types/components/composites/select/presets.d.ts +17 -0
- package/dist/types/components/composites/table/Table.d.ts +3 -74
- package/dist/types/components/composites/table/body.d.ts +15 -0
- package/dist/types/components/composites/table/detail.d.ts +24 -0
- package/dist/types/components/composites/table/head.d.ts +16 -0
- package/dist/types/components/composites/table/types.d.ts +86 -0
- package/dist/types/components/composites/table/use-scroller.d.ts +12 -0
- package/dist/types/components/composites/table/use-table-state.d.ts +16 -0
- package/dist/types/components/composites/tabs/Tabs.d.ts +3 -71
- package/dist/types/components/composites/tabs/tab-panel.d.ts +26 -0
- package/dist/types/components/composites/tabs/types.d.ts +48 -0
- package/dist/types/components/composites/tabs/use-ink.d.ts +5 -0
- package/dist/types/components/composites/tooltip/Tooltip.d.ts +1 -1
- package/dist/types/components/compound/support-rail/SupportRail.d.ts +1 -1
- package/dist/types/components/expressive/lens/Lens.d.ts +1 -1
- package/dist/types/components/expressive/lens/input.d.ts +2 -0
- package/dist/types/components/expressive/lens/optics.d.ts +37 -0
- package/dist/types/components/expressive/lens/paint.d.ts +2 -0
- package/dist/types/components/expressive/lens/use-lens.d.ts +10 -0
- package/dist/types/components/expressive/odometer/roll.d.ts +9 -11
- package/dist/types/components/expressive/odometer/spring.d.ts +11 -0
- package/dist/types/components/internal/hooks/use-hold-repeat.d.ts +8 -0
- package/dist/types/components/internal/icon/Icon.d.ts +2 -0
- package/dist/types/components/internal/support/types.d.ts +1 -1
- package/dist/types/components/primitives/button/Button.d.ts +4 -8
- package/dist/types/components/primitives/button/button-style.d.ts +8 -4
- package/dist/types/components/primitives/collapse/Collapse.d.ts +3 -2
- package/dist/types/components/primitives/input/NumberField.d.ts +1 -1
- package/dist/types/components/primitives/input/OtpField.d.ts +5 -1
- package/dist/types/components/primitives/input/TextField.d.ts +1 -1
- package/dist/types/components/primitives/input/field-chrome.d.ts +2 -1
- package/dist/types/components/primitives/input/use-number-value.d.ts +16 -0
- package/dist/types/components/primitives/tag/Tag.d.ts +1 -1
- package/dist/types/components/primitives/tag/ToggleTag.d.ts +2 -2
- package/dist/types/components/primitives/textarea/Textarea.d.ts +3 -1
- package/dist/types/engine/flip.d.ts +3 -1
- package/dist/types/engine/index.d.ts +2 -2
- package/dist/types/engine/loop.d.ts +5 -2
- package/dist/types/motion/before-paint.d.ts +4 -0
- package/dist/types/motion/crossfade.d.ts +2 -1
- package/dist/types/motion/element.d.ts +14 -5
- package/dist/types/motion/flip.d.ts +6 -3
- package/dist/types/motion/holders.d.ts +4 -0
- package/dist/types/motion/use-motion.d.ts +3 -1
- package/dist/types/tokens/motion-defaults.generated.d.ts +2 -0
- package/dist/types/tokens/motion-scale.d.ts +18 -15
- package/dist/types/tokens/motion-tokens.d.ts +1 -1
- package/dist/types/tokens/theme-store.d.ts +4 -4
- package/dist/types/tokens/theme-tokens.generated.d.ts +43 -31
- package/dist/types/tokens/theme.d.ts +1 -1
- package/dist/typing-lines.js +2 -2
- package/dist/youtube.js +3 -3
- package/package.json +11 -1
- package/skills/zyncat-ui/SKILL.md +6 -6
- package/skills/zyncat-ui/references/components.md +4 -2
- package/skills/zyncat-ui/references/recipes.md +1 -1
- package/src/components/composites/combobox/Combobox.tsx +100 -0
- package/src/components/composites/combobox/Combobox.usage.md +32 -0
- package/src/components/composites/combobox/caret.ts +41 -0
- package/src/components/composites/combobox/combobox.css +7 -0
- package/src/components/composites/combobox/use-combobox.ts +112 -0
- package/src/components/composites/date-picker/DateField.tsx +2 -0
- package/src/components/composites/date-picker/DateRangeField.tsx +13 -18
- package/src/components/composites/date-picker/DateTimeField.tsx +2 -0
- package/src/components/composites/date-picker/TimeField.tsx +10 -4
- package/src/components/composites/date-picker/date-picker.css +25 -40
- package/src/components/composites/date-picker/date-utils.ts +4 -0
- package/src/components/composites/date-picker/field-shell.tsx +31 -7
- package/src/components/composites/date-picker/month-swipe.ts +41 -0
- package/src/components/composites/date-picker/range-day.tsx +112 -0
- package/src/components/composites/date-picker/range-month.tsx +79 -0
- package/src/components/composites/date-picker/range-panel.tsx +30 -356
- package/src/components/composites/date-picker/range-presets.tsx +104 -0
- package/src/components/composites/date-picker/range-sheet-days.css +35 -0
- package/src/components/composites/date-picker/range-sheet.css +80 -0
- package/src/components/composites/date-picker/range-sheet.tsx +72 -0
- package/src/components/composites/date-picker/range-summary.css +67 -0
- package/src/components/composites/date-picker/range-summary.tsx +69 -0
- package/src/components/composites/date-picker/time-core.tsx +23 -17
- package/src/components/composites/date-picker/typed-key.ts +9 -0
- package/src/components/composites/date-picker/use-month-view.ts +32 -0
- package/src/components/composites/date-picker/use-range-panel.ts +145 -0
- package/src/components/composites/dialog/Dialog.tsx +28 -110
- package/src/components/composites/dialog/dialog-sheet.css +31 -0
- package/src/components/composites/dialog/dialog.css +3 -0
- package/src/components/composites/dialog/surface.tsx +93 -0
- package/src/components/composites/dropdown/Dropdown.tsx +31 -6
- package/src/components/composites/dropdown/dropdown.css +2 -2
- package/src/components/composites/dropdown/menu-panel.tsx +22 -14
- package/src/components/composites/dropdown/types.ts +4 -1
- package/src/components/composites/pagination/pagination.css +1 -1
- package/src/components/composites/scroll-area/ScrollArea.tsx +114 -0
- package/src/components/composites/scroll-area/ScrollArea.usage.md +28 -0
- package/src/components/composites/scroll-area/scroll-area.css +150 -0
- package/src/components/composites/select/MultiSelect.tsx +15 -7
- package/src/components/composites/select/core/menu.tsx +6 -2
- package/src/components/composites/select/core/panel.tsx +9 -7
- package/src/components/composites/select/core/trigger.tsx +1 -3
- package/src/components/composites/select/core/use-listbox.ts +35 -28
- package/src/components/composites/select/presets.tsx +47 -0
- package/src/components/composites/select/select.css +22 -1
- package/src/components/composites/sheet/use-sheet-drag.ts +13 -0
- package/src/components/composites/table/Table.tsx +65 -305
- package/src/components/composites/table/Table.usage.md +19 -2
- package/src/components/composites/table/body.tsx +147 -0
- package/src/components/composites/table/detail.tsx +76 -0
- package/src/components/composites/table/head.tsx +90 -0
- package/src/components/composites/table/table-detail.css +27 -0
- package/src/components/composites/table/table.css +35 -13
- package/src/components/composites/table/types.ts +97 -0
- package/src/components/composites/table/use-scroller.ts +53 -0
- package/src/components/composites/table/use-table-state.ts +98 -0
- package/src/components/composites/tabs/Tabs.tsx +21 -191
- package/src/components/composites/tabs/tab-panel.tsx +63 -0
- package/src/components/composites/tabs/tabs.css +16 -11
- package/src/components/composites/tabs/types.ts +51 -0
- package/src/components/composites/tabs/use-ink.ts +87 -0
- package/src/components/composites/toast/toast.css +1 -1
- package/src/components/composites/tooltip/Tooltip.tsx +6 -5
- package/src/components/composites/tooltip/tooltip-host.tsx +9 -5
- package/src/components/composites/tooltip/tooltip.css +1 -1
- package/src/components/compound/support-rail/SupportRail.tsx +3 -2
- package/src/components/compound/support-rail/support-rail.css +2 -2
- package/src/components/dev/motion-devtools.css +6 -5
- package/src/components/expressive/lens/Lens.tsx +11 -368
- package/src/components/expressive/lens/input.ts +91 -0
- package/src/components/expressive/lens/optics.ts +119 -0
- package/src/components/expressive/lens/paint.ts +60 -0
- package/src/components/expressive/lens/use-lens.ts +121 -0
- package/src/components/expressive/odometer/Odometer.tsx +38 -12
- package/src/components/expressive/odometer/odometer.css +12 -7
- package/src/components/expressive/odometer/roll.ts +85 -40
- package/src/components/expressive/odometer/spring.ts +86 -0
- package/src/components/internal/hooks/use-hold-repeat.ts +43 -0
- package/src/components/internal/hooks/use-scroll-edges.ts +6 -1
- package/src/components/internal/icon/Icon.tsx +4 -0
- package/src/components/internal/overlay/overlay.css +1 -0
- package/src/components/internal/overlay/track-anchor.ts +1 -1
- package/src/components/internal/support/types.ts +1 -1
- package/src/components/internal/utils/activation.ts +2 -2
- package/src/components/primitives/avatar/avatar.css +1 -1
- package/src/components/primitives/badge/badge.css +1 -1
- package/src/components/primitives/button/Button.tsx +5 -8
- package/src/components/primitives/button/Button.usage.md +5 -4
- package/src/components/primitives/button/button-style.ts +11 -5
- package/src/components/primitives/button/button.css +24 -27
- package/src/components/primitives/checkbox/checkbox.css +0 -1
- package/src/components/primitives/collapse/Collapse.tsx +3 -2
- package/src/components/primitives/input/NumberField.tsx +38 -46
- package/src/components/primitives/input/OtpField.tsx +35 -2
- package/src/components/primitives/input/OtpField.usage.md +2 -1
- package/src/components/primitives/input/TextField.tsx +5 -3
- package/src/components/primitives/input/field-chrome.tsx +3 -2
- package/src/components/primitives/input/input.css +54 -34
- package/src/components/primitives/input/use-number-value.ts +38 -0
- package/src/components/primitives/radio-group/radio-group.css +1 -2
- package/src/components/primitives/tag/Tag.tsx +1 -1
- package/src/components/primitives/tag/ToggleTag.tsx +2 -2
- package/src/components/primitives/tag/tag.css +2 -4
- package/src/components/primitives/textarea/Textarea.tsx +24 -6
- package/src/components/primitives/textarea/char-meter.tsx +1 -16
- package/src/components/primitives/textarea/textarea.css +15 -42
- package/src/components/primitives/toggle/toggle.css +0 -1
- package/src/engine/animate.ts +5 -3
- package/src/engine/flip.ts +23 -3
- package/src/engine/index.ts +2 -2
- package/src/engine/loop.ts +17 -6
- package/src/mcp/server.ts +30 -20
- package/src/motion/before-paint.ts +15 -0
- package/src/motion/crossfade.ts +54 -8
- package/src/motion/element.tsx +22 -4
- package/src/motion/flip.ts +69 -37
- package/src/motion/holders.ts +10 -0
- package/src/motion/presence.tsx +18 -9
- package/src/motion/use-motion.ts +38 -4
- package/src/tokens/base.css +0 -5
- package/src/tokens/dark.css +5 -5
- package/src/tokens/motion-defaults.generated.ts +15 -8
- package/src/tokens/motion-scale.ts +18 -15
- package/src/tokens/motion-tokens.ts +4 -4
- package/src/tokens/motion.css +19 -11
- package/src/tokens/reset.css +1 -0
- package/src/tokens/semantic.css +8 -8
- package/src/tokens/spacing.css +5 -3
- package/src/tokens/theme-store.ts +4 -4
- package/src/tokens/theme-sync.tsx +4 -2
- package/src/tokens/theme-tokens.generated.ts +44 -31
- package/src/tokens/theme.tsx +1 -1
- package/tailwind.css +4 -0
- package/dist/chunk-3HE7N3UK.js.map +0 -1
- package/dist/chunk-47OMFFIB.js.map +0 -1
- package/dist/chunk-6BY5G7BI.js +0 -122
- package/dist/chunk-6BY5G7BI.js.map +0 -1
- package/dist/chunk-6H3IJ752.js.map +0 -1
- package/dist/chunk-7NHY2CRA.js.map +0 -1
- package/dist/chunk-AOEO2LCZ.js.map +0 -1
- package/dist/chunk-AXZBD7LY.js.map +0 -1
- package/dist/chunk-BWGK3OD6.js.map +0 -1
- package/dist/chunk-CYZKPUCG.js.map +0 -1
- package/dist/chunk-DEZIQTBW.js.map +0 -1
- package/dist/chunk-KSAJ6DED.js +0 -16
- package/dist/chunk-KSAJ6DED.js.map +0 -1
- package/dist/chunk-LC6NQQER.js.map +0 -1
- package/dist/chunk-ODRO3KS6.js.map +0 -1
- package/dist/chunk-QDAN43B6.js.map +0 -1
- package/dist/chunk-SPFHWHJ6.js.map +0 -1
- package/dist/chunk-TBLPZQSI.js.map +0 -1
- package/dist/chunk-V4ZN5RD4.js.map +0 -1
- package/dist/chunk-ZSP4ZTII.js.map +0 -1
- package/dist/crossfade-XFZLFLT7.js.map +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ActivateOn } from '../../internal/utils/activation';
|
|
2
|
+
import type { RangePanel } from './use-range-panel';
|
|
3
|
+
interface RangeMonthProps {
|
|
4
|
+
panel: RangePanel;
|
|
5
|
+
offset: number;
|
|
6
|
+
withPrev: boolean;
|
|
7
|
+
withNext: boolean;
|
|
8
|
+
min?: string;
|
|
9
|
+
max?: string;
|
|
10
|
+
months: number;
|
|
11
|
+
activateOn?: ActivateOn;
|
|
12
|
+
}
|
|
13
|
+
export declare function RangeMonth({ panel, offset, withPrev, withNext, min, max, months, activateOn }: RangeMonthProps): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -1,24 +1,10 @@
|
|
|
1
1
|
import './date-picker.css';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/** Range start, inclusive - `'YYYY-MM-DD'`. */
|
|
6
|
-
start: string;
|
|
7
|
-
/** Range end, inclusive - `'YYYY-MM-DD'`. Never before `start`. */
|
|
8
|
-
end: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function drpRangeText(start: string, end: string): string;
|
|
11
|
-
interface DrpPanelProps {
|
|
12
|
-
value: DateRange | null;
|
|
13
|
-
commit: (value: DateRange) => void;
|
|
14
|
-
close: () => void;
|
|
15
|
-
min?: string;
|
|
16
|
-
max?: string;
|
|
2
|
+
import type { ActivateOn } from '../../internal/utils/activation';
|
|
3
|
+
import { type RangeOptions } from './use-range-panel';
|
|
4
|
+
interface DrpPanelProps extends Omit<RangeOptions, 'months'> {
|
|
17
5
|
timezone?: string;
|
|
18
6
|
label?: string;
|
|
19
|
-
months: number;
|
|
20
|
-
layout: 'popover' | 'sheet';
|
|
21
7
|
activateOn?: ActivateOn;
|
|
22
8
|
}
|
|
23
|
-
export declare function DrpPanel({ value, commit, close, min, max, timezone, label,
|
|
9
|
+
export declare function DrpPanel({ value, commit, close, min, max, maxDays, timezone, label, activateOn }: DrpPanelProps): import("react").JSX.Element;
|
|
24
10
|
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ActivateOn } from '../../internal/utils/activation';
|
|
2
|
+
/** A date range as wall-clock 'YYYY-MM-DD' endpoints, inclusive. */
|
|
3
|
+
export interface DateRange {
|
|
4
|
+
/** Range start, inclusive - `'YYYY-MM-DD'`. */
|
|
5
|
+
start: string;
|
|
6
|
+
/** Range end, inclusive - `'YYYY-MM-DD'`. Never before `start`. */
|
|
7
|
+
end: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DrpPreset {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
start: string;
|
|
13
|
+
end: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function drpRangeText(start: string, end: string): string;
|
|
16
|
+
export declare const drpDays: (start: string, end: string) => number;
|
|
17
|
+
interface RangePresetsProps {
|
|
18
|
+
draft: DateRange | null;
|
|
19
|
+
fits: (p: DrpPreset) => boolean;
|
|
20
|
+
onPick: (p: DrpPreset) => void;
|
|
21
|
+
activateOn?: ActivateOn;
|
|
22
|
+
}
|
|
23
|
+
export declare function RangePresets({ draft, fits, onPick, activateOn }: RangePresetsProps): import("react").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import './date-picker.css';
|
|
2
|
+
import './range-sheet.css';
|
|
3
|
+
import './range-sheet-days.css';
|
|
4
|
+
import type { ActivateOn } from '../../internal/utils/activation';
|
|
5
|
+
import { type RangeOptions } from './use-range-panel';
|
|
6
|
+
interface DrpSheetProps extends Omit<RangeOptions, 'months'> {
|
|
7
|
+
title: string;
|
|
8
|
+
timezone?: string;
|
|
9
|
+
activateOn?: ActivateOn;
|
|
10
|
+
}
|
|
11
|
+
export declare function DrpSheet({ value, commit, close, min, max, maxDays, title, timezone, activateOn }: DrpSheetProps): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './range-summary.css';
|
|
2
|
+
import type { RangePanel } from './use-range-panel';
|
|
3
|
+
interface RangeSummaryProps {
|
|
4
|
+
panel: RangePanel;
|
|
5
|
+
title: string;
|
|
6
|
+
timezone?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function RangeSummary({ panel, title, timezone }: RangeSummaryProps): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function useMonthView(seed: Date): {
|
|
2
|
+
view: {
|
|
3
|
+
y: number;
|
|
4
|
+
m: number;
|
|
5
|
+
};
|
|
6
|
+
setView: import("react").Dispatch<import("react").SetStateAction<{
|
|
7
|
+
y: number;
|
|
8
|
+
m: number;
|
|
9
|
+
}>>;
|
|
10
|
+
viewIdx: number;
|
|
11
|
+
nav: (dir: number) => void;
|
|
12
|
+
navDir: number;
|
|
13
|
+
jumpToMonth: (y: number, m: number, offset: number) => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type KeyboardEvent } from 'react';
|
|
2
|
+
import { type DateRange, type DrpPreset } from './range-presets';
|
|
3
|
+
export interface RangeOptions {
|
|
4
|
+
value: DateRange | null;
|
|
5
|
+
commit: (value: DateRange) => void;
|
|
6
|
+
close: () => void;
|
|
7
|
+
min?: string;
|
|
8
|
+
max?: string;
|
|
9
|
+
maxDays?: number;
|
|
10
|
+
months: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function useRangePanel({ value, commit, close, min, max, maxDays, months }: RangeOptions): {
|
|
13
|
+
view: {
|
|
14
|
+
y: number;
|
|
15
|
+
m: number;
|
|
16
|
+
};
|
|
17
|
+
viewIdx: number;
|
|
18
|
+
navDir: number;
|
|
19
|
+
nav: (dir: number) => void;
|
|
20
|
+
jumpToMonth: (y: number, m: number, offset: number) => void;
|
|
21
|
+
draft: DateRange;
|
|
22
|
+
anchor: string;
|
|
23
|
+
focusKey: string;
|
|
24
|
+
setHoverKey: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
25
|
+
daysRef: import("react").RefObject<HTMLDivElement>;
|
|
26
|
+
gridGlide: {
|
|
27
|
+
ref: import("react").RefObject<HTMLSpanElement>;
|
|
28
|
+
enter: (target: HTMLElement | null) => void;
|
|
29
|
+
leave: () => void;
|
|
30
|
+
};
|
|
31
|
+
capLoId: string;
|
|
32
|
+
capHiId: string;
|
|
33
|
+
inBounds: (key: string) => boolean;
|
|
34
|
+
fits: (p: DrpPreset) => boolean;
|
|
35
|
+
lo: string;
|
|
36
|
+
hi: string;
|
|
37
|
+
provisional: boolean;
|
|
38
|
+
pickDay: (key: string) => void;
|
|
39
|
+
applyPreset: (p: DrpPreset) => void;
|
|
40
|
+
done: () => void;
|
|
41
|
+
onGridKeyDown: (e: KeyboardEvent<HTMLDivElement>) => void;
|
|
42
|
+
todayKey: string;
|
|
43
|
+
};
|
|
44
|
+
export type RangePanel = ReturnType<typeof useRangePanel>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import './dialog.css';
|
|
2
|
+
import './dialog-sheet.css';
|
|
2
3
|
import { type HTMLAttributes, type ReactElement, type ReactNode } from 'react';
|
|
3
4
|
import type { DataAttributes } from '../../../dom-props';
|
|
4
5
|
import type { DisableableAnimation } from '../../../motion/timing';
|
|
@@ -18,7 +19,7 @@ export interface DialogProps {
|
|
|
18
19
|
title?: ReactNode;
|
|
19
20
|
/** Subtext under the title - wired to `aria-describedby`. @default null */
|
|
20
21
|
description?: ReactNode;
|
|
21
|
-
/** Panel width. @default 'md' */
|
|
22
|
+
/** Panel width. Below 40rem the dialog opens as a bottom sheet, and 'lg' fills its height. @default 'md' */
|
|
22
23
|
size?: 'sm' | 'md' | 'lg';
|
|
23
24
|
/** 'danger' tints the header icon badge + is the convention for destructive confirms. */
|
|
24
25
|
tone?: 'default' | 'danger';
|
|
@@ -41,4 +42,4 @@ export interface DialogProps {
|
|
|
41
42
|
/** Open/close timing - motion tokens only, or `null` to disable. @default open 'slow'/'entrance', close 'base'/'standard' */
|
|
42
43
|
animation?: DisableableAnimation;
|
|
43
44
|
}
|
|
44
|
-
export declare function Dialog({ open: controlledOpen, defaultOpen, onOpenChange, trigger, activateOn,
|
|
45
|
+
export declare function Dialog({ open: controlledOpen, defaultOpen, onOpenChange, trigger, activateOn, dismissible, container, id, animation, ...surfaceProps }: DialogProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import type { DataAttributes } from '../../../dom-props';
|
|
3
|
+
interface DialogSurfaceProps {
|
|
4
|
+
panelId: string;
|
|
5
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
tone?: 'default' | 'danger';
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
title?: ReactNode;
|
|
9
|
+
description?: ReactNode;
|
|
10
|
+
dismissible: boolean;
|
|
11
|
+
footer?: ReactNode | ((close: () => void) => ReactNode);
|
|
12
|
+
requestClose: () => void;
|
|
13
|
+
htmlProps?: HTMLAttributes<HTMLElement> & DataAttributes;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare function DialogSurface({ panelId, size, tone, icon, title, description, dismissible, footer, requestClose, htmlProps, children, }: DialogSurfaceProps): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import { type HTMLAttributes, type ReactElement } from 'react';
|
|
|
3
3
|
import type { DataAttributes } from '../../../dom-props';
|
|
4
4
|
import type { DisableableAnimation } from '../../../motion/timing';
|
|
5
5
|
import type { MenuSize, MenuWeight, MenuWidth } from '../../internal/menu/highlight';
|
|
6
|
+
import type { VirtualAnchor } from '../../internal/overlay/position';
|
|
6
7
|
import { type ActivateOn } from '../../internal/utils/activation';
|
|
7
8
|
import { type DropdownItem, type DropdownItems } from './types';
|
|
8
9
|
export type { DropdownItem, DropdownGroup } from './types';
|
|
@@ -10,8 +11,13 @@ export interface DropdownProps {
|
|
|
10
11
|
/** The rows - a flat `DropdownItem[]`, or `DropdownGroup[]` to render divided sections.
|
|
11
12
|
* A row with its own `items` opens a submenu instead of committing. @default [] */
|
|
12
13
|
items: DropdownItems;
|
|
13
|
-
/** Cloned to toggle the menu, and used as the anchor
|
|
14
|
-
|
|
14
|
+
/** Cloned to toggle the menu, and used as the anchor unless `anchor` is set. Gets the
|
|
15
|
+
* `aria-haspopup="menu"` wiring. */
|
|
16
|
+
trigger?: ReactElement | null;
|
|
17
|
+
/** Anchor to an arbitrary rect instead of the trigger - any `{ getBoundingClientRect() }`, which an element
|
|
18
|
+
* also satisfies. Drive `open` yourself, name the menu with `ariaLabel` when there is no trigger, and pass
|
|
19
|
+
* a new object to re-place a moving anchor. Submenus always anchor to their row. */
|
|
20
|
+
anchor?: VirtualAnchor | null;
|
|
15
21
|
/** Whether the trigger and the rows fire on `pointerdown` (snappier) or wait for `click`. @default 'pointerdown' */
|
|
16
22
|
activateOn?: ActivateOn;
|
|
17
23
|
/** Controlled open state. Omit to stay uncontrolled. */
|
|
@@ -53,4 +59,4 @@ export interface DropdownProps {
|
|
|
53
59
|
/** Open/close timing - motion tokens only, or `null` to disable. @default open 'base'/'entrance', close 'fast'/'exit' */
|
|
54
60
|
animation?: DisableableAnimation;
|
|
55
61
|
}
|
|
56
|
-
export declare function Dropdown({ items, trigger, activateOn, open: controlledOpen, defaultOpen, onOpenChange, onSelect, returnFocus, side, align, highlight, rail, size, weight, width, id, ariaLabel, htmlProps, animation, }: DropdownProps): import("react").JSX.Element;
|
|
62
|
+
export declare function Dropdown({ items, trigger, anchor, activateOn, open: controlledOpen, defaultOpen, onOpenChange, onSelect, returnFocus, side, align, highlight, rail, size, weight, width, id, ariaLabel, htmlProps, animation, }: DropdownProps): import("react").JSX.Element;
|
|
@@ -2,6 +2,7 @@ import type { HTMLAttributes, ReactNode, RefObject } from 'react';
|
|
|
2
2
|
import type { DataAttributes } from '../../../dom-props';
|
|
3
3
|
import { type NormalizedGroup } from '../../internal/collection/collection';
|
|
4
4
|
import type { MenuHighlight, MenuSize, MenuWeight, MenuWidth } from '../../internal/menu/highlight';
|
|
5
|
+
import type { VirtualAnchor } from '../../internal/overlay/position';
|
|
5
6
|
import type { ActivateOn } from '../../internal/utils/activation';
|
|
6
7
|
export interface DropdownItem {
|
|
7
8
|
/** Unique id - what `onSelect` receives, and what identifies this row's open submenu. */
|
|
@@ -12,7 +13,7 @@ export interface DropdownItem {
|
|
|
12
13
|
description?: string;
|
|
13
14
|
/** Your own icon node shown before the label. */
|
|
14
15
|
icon?: ReactNode;
|
|
15
|
-
/** Keyboard hint shown at the trailing edge
|
|
16
|
+
/** Keyboard hint shown at the trailing edge. Display only - you still bind the key. */
|
|
16
17
|
shortcut?: string;
|
|
17
18
|
/** Destructive action - the row reads in the danger hue. @default false */
|
|
18
19
|
danger?: boolean;
|
|
@@ -62,6 +63,8 @@ export type SeedFocus = 'first' | 'last' | 'selected' | 'none';
|
|
|
62
63
|
export interface MenuChain {
|
|
63
64
|
levels: Level[];
|
|
64
65
|
menuId: string;
|
|
66
|
+
triggerId: string;
|
|
67
|
+
anchor?: VirtualAnchor | null;
|
|
65
68
|
activateOn?: ActivateOn;
|
|
66
69
|
side: 'top' | 'bottom' | 'left' | 'right';
|
|
67
70
|
align: 'start' | 'center' | 'end';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import './scroll-area.css';
|
|
2
|
+
import { type CSSProperties, type ReactNode, type Ref } from 'react';
|
|
3
|
+
import { type ActivateOn } from '../../internal/utils/activation';
|
|
4
|
+
export interface ScrollAreaProps {
|
|
5
|
+
/** Scroll direction. `'x'` lays the children out as a rail, one item each, with a paging door
|
|
6
|
+
* on each faded edge for a mouse. @default 'y' */
|
|
7
|
+
axis?: 'x' | 'y';
|
|
8
|
+
/** `'fade'` fades an edge while content hides past it. `'depth'` also shrinks each child as it
|
|
9
|
+
* crosses a faded edge; pass the items as direct children. @default 'fade' */
|
|
10
|
+
variant?: 'fade' | 'depth';
|
|
11
|
+
/** With `axis="x"`, sizes the row to the scroller instead of to its items: `flex: 1` children
|
|
12
|
+
* share its width down to their `min-width` and then scroll, and every child fills its height.
|
|
13
|
+
* For a board or a toolbar. @default false */
|
|
14
|
+
fill?: boolean;
|
|
15
|
+
/** Names the scroller as a region landmark. Omit for an unnamed scroller. */
|
|
16
|
+
ariaLabel?: string;
|
|
17
|
+
/** The element that scrolls: a virtualizer's `getScrollElement`, an IntersectionObserver's
|
|
18
|
+
* `root`, or `scrollTo` for a jump. */
|
|
19
|
+
ref?: Ref<HTMLDivElement>;
|
|
20
|
+
/** When a rail's edge door pages: on `pointerdown` (snappier) or on `click`. @default 'pointerdown' */
|
|
21
|
+
activateOn?: ActivateOn;
|
|
22
|
+
/** Extra class(es) merged onto the root. */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** Inline styles merged onto the root. A `'y'` scroller takes its height or max-height here. */
|
|
25
|
+
style?: CSSProperties;
|
|
26
|
+
/** The scrolled content. */
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export declare function ScrollArea({ axis, variant, fill, ariaLabel, ref, activateOn, className, style, children, }: ScrollAreaProps): import("react").JSX.Element;
|
|
@@ -5,7 +5,9 @@ import type { DisableableAnimation } from '../../../motion/timing';
|
|
|
5
5
|
import type { MenuSize, MenuWeight, MenuWidth } from '../../internal/menu/highlight';
|
|
6
6
|
import type { ActivateOn } from '../../internal/utils/activation';
|
|
7
7
|
import { type CustomTrigger, type SelectGroup, type SelectMenuHtmlProps, type SelectOption } from './core';
|
|
8
|
+
import { type MultiSelectPreset } from './presets';
|
|
8
9
|
export type { SelectOption, SelectGroup } from './core';
|
|
10
|
+
export type { MultiSelectPreset } from './presets';
|
|
9
11
|
export interface MultiSelectProps {
|
|
10
12
|
/** The choices - a flat `SelectOption[]`, or `SelectGroup[]` to render labeled sections. @default [] */
|
|
11
13
|
options: SelectOption[] | SelectGroup[];
|
|
@@ -13,8 +15,12 @@ export interface MultiSelectProps {
|
|
|
13
15
|
value?: string[];
|
|
14
16
|
/** Initial selection when uncontrolled. @default [] */
|
|
15
17
|
defaultValue?: string[];
|
|
16
|
-
/** Fires with the NEXT array and the option that was toggled
|
|
17
|
-
|
|
18
|
+
/** Fires with the NEXT array and the option that was toggled, or no option when a preset replaced
|
|
19
|
+
* the selection. Committing keeps the menu open. */
|
|
20
|
+
onChange?: (value: string[], toggled?: SelectOption) => void;
|
|
21
|
+
/** One-press selections, shown as chips between the filter field and the list. A press replaces
|
|
22
|
+
* the selection with the preset's `value` as given and keeps the menu open. @default [] */
|
|
23
|
+
presets?: MultiSelectPreset[];
|
|
18
24
|
/** Trigger text when nothing is selected. @default 'Select options' */
|
|
19
25
|
placeholder?: string;
|
|
20
26
|
/** Trigger height, type and padding. The menu follows it unless `menuSize` overrides. @default 'md' */
|
|
@@ -67,4 +73,4 @@ export interface MultiSelectProps {
|
|
|
67
73
|
* element that forwards its props and ref. Pass a function to read `{ open, selected }`. */
|
|
68
74
|
trigger?: CustomTrigger<SelectOption[]>;
|
|
69
75
|
}
|
|
70
|
-
export declare function MultiSelect({ options, value: controlledValue, defaultValue, onChange, placeholder, size, menuSize, disabled, invalid, loading, searchable, searchPlaceholder, highlight, rail, weight, marker, width, leadingIcon, id, ariaLabel, htmlProps, menuProps, activateOn, animation, trigger, }: MultiSelectProps): import("react").JSX.Element;
|
|
76
|
+
export declare function MultiSelect({ options, value: controlledValue, defaultValue, onChange, presets, placeholder, size, menuSize, disabled, invalid, loading, searchable, searchPlaceholder, highlight, rail, weight, marker, width, leadingIcon, id, ariaLabel, htmlProps, menuProps, activateOn, animation, trigger, }: MultiSelectProps): import("react").JSX.Element;
|
|
@@ -2,15 +2,17 @@ import { type HTMLAttributes, type ReactNode, type RefObject } from 'react';
|
|
|
2
2
|
import type { DataAttributes } from '../../../../dom-props';
|
|
3
3
|
import type { DisableableAnimation } from '../../../../motion/timing';
|
|
4
4
|
import { type MenuSurfaceProps } from '../../../internal/menu/highlight';
|
|
5
|
+
import { type VirtualAnchor } from '../../../internal/overlay/position';
|
|
5
6
|
export type SelectMenuHtmlProps = HTMLAttributes<HTMLDivElement> & DataAttributes;
|
|
6
7
|
export interface SelectMenuProps extends MenuSurfaceProps {
|
|
7
8
|
open: boolean;
|
|
8
9
|
menuId: string;
|
|
9
10
|
requestClose: () => void;
|
|
10
11
|
triggerRef: RefObject<HTMLElement | null>;
|
|
12
|
+
anchor?: VirtualAnchor | null;
|
|
11
13
|
multiple?: boolean;
|
|
12
14
|
animation?: DisableableAnimation;
|
|
13
15
|
menuProps?: SelectMenuHtmlProps;
|
|
14
16
|
children?: ReactNode;
|
|
15
17
|
}
|
|
16
|
-
export declare function SelectMenu({ open, menuId, requestClose, triggerRef, multiple, highlight, rail, size, weight, width, animation, menuProps, children, }: SelectMenuProps): import("react").JSX.Element;
|
|
18
|
+
export declare function SelectMenu({ open, menuId, requestClose, triggerRef, anchor, multiple, highlight, rail, size, weight, width, animation, menuProps, children, }: SelectMenuProps): import("react").JSX.Element;
|
|
@@ -3,9 +3,9 @@ import type { ReactNode } from 'react';
|
|
|
3
3
|
import type { DisableableAnimation } from '../../../../motion/timing';
|
|
4
4
|
import type { MenuSurfaceProps } from '../../../internal/menu/highlight';
|
|
5
5
|
import { type ActivateOn } from '../../../internal/utils/activation';
|
|
6
|
-
import { type SelectMenuHtmlProps } from './menu';
|
|
6
|
+
import { type SelectMenuHtmlProps, type SelectMenuProps } from './menu';
|
|
7
7
|
import type { ListboxState } from './use-listbox';
|
|
8
|
-
export interface ListboxPanelProps extends MenuSurfaceProps {
|
|
8
|
+
export interface ListboxPanelProps extends MenuSurfaceProps, Pick<SelectMenuProps, 'anchor'> {
|
|
9
9
|
lb: ListboxState;
|
|
10
10
|
loading: boolean;
|
|
11
11
|
searchable: boolean;
|
|
@@ -16,5 +16,6 @@ export interface ListboxPanelProps extends MenuSurfaceProps {
|
|
|
16
16
|
animation?: DisableableAnimation;
|
|
17
17
|
menuProps?: SelectMenuHtmlProps;
|
|
18
18
|
check?: (selected: boolean) => ReactNode;
|
|
19
|
+
presets?: ReactNode;
|
|
19
20
|
}
|
|
20
|
-
export declare function ListboxPanel({ lb, loading, searchable, searchPlaceholder, ariaLabel, multiple, highlight, rail, size, weight, width, activateOn, animation, menuProps, check, }: ListboxPanelProps): import("react").JSX.Element;
|
|
21
|
+
export declare function ListboxPanel({ lb, anchor, loading, searchable, searchPlaceholder, ariaLabel, multiple, highlight, rail, size, weight, width, activateOn, animation, menuProps, check, presets, }: ListboxPanelProps): import("react").JSX.Element;
|
|
@@ -10,12 +10,13 @@ export interface UseListboxArgs {
|
|
|
10
10
|
isSelected: (value: string) => boolean;
|
|
11
11
|
onCommit: (opt: SelectOption) => void;
|
|
12
12
|
closeOnCommit: boolean;
|
|
13
|
+
autoHighlight?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export type ListboxState = ReturnType<typeof useListbox>;
|
|
15
|
-
export declare function useListbox({ options, disabled, loading, searchable, id, idPrefix, isSelected, onCommit, closeOnCommit, }: UseListboxArgs): {
|
|
16
|
+
export declare function useListbox({ options, disabled, loading, searchable, id, idPrefix, isSelected, onCommit, closeOnCommit, autoHighlight, }: UseListboxArgs): {
|
|
16
17
|
open: boolean;
|
|
17
18
|
query: string;
|
|
18
|
-
setQuery: (
|
|
19
|
+
setQuery: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
19
20
|
triggerRef: import("react").RefObject<HTMLElement>;
|
|
20
21
|
listRef: import("react").RefObject<HTMLDivElement>;
|
|
21
22
|
contentRef: import("react").RefObject<HTMLDivElement>;
|
|
@@ -24,7 +25,6 @@ export declare function useListbox({ options, disabled, loading, searchable, id,
|
|
|
24
25
|
menuId: string;
|
|
25
26
|
listId: string;
|
|
26
27
|
optId: (value: string) => string;
|
|
27
|
-
adId: string;
|
|
28
28
|
groups: import("./types").NormalizedGroup[];
|
|
29
29
|
flat: SelectOption[];
|
|
30
30
|
sections: ListSection[];
|
|
@@ -38,7 +38,7 @@ export declare function useListbox({ options, disabled, loading, searchable, id,
|
|
|
38
38
|
show: () => void;
|
|
39
39
|
requestClose: () => void;
|
|
40
40
|
commit: (opt: SelectOption) => void;
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
commitActive: () => void;
|
|
42
|
+
navigate: (i: number) => void;
|
|
43
43
|
onMenuKeyDown: (e: KeyboardEvent) => void;
|
|
44
44
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import '../../primitives/tag/tag.css';
|
|
2
|
+
import { type KeyboardEvent } from 'react';
|
|
3
|
+
import type { MenuSize } from '../../internal/menu/highlight';
|
|
4
|
+
export interface MultiSelectPreset {
|
|
5
|
+
/** Chip text. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** The selection a press applies, replacing the current one as given. */
|
|
8
|
+
value: string[];
|
|
9
|
+
}
|
|
10
|
+
interface PresetRowProps {
|
|
11
|
+
presets: MultiSelectPreset[];
|
|
12
|
+
size: MenuSize;
|
|
13
|
+
apply: (value: string[]) => void;
|
|
14
|
+
onMenuKeyDown: (e: KeyboardEvent) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function PresetRow({ presets, size, apply, onMenuKeyDown }: PresetRowProps): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -1,75 +1,4 @@
|
|
|
1
1
|
import './table.css';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export type TableAlign = 'start' | 'end' | 'center';
|
|
6
|
-
export type TableHideBelow = 'sm' | 'md';
|
|
7
|
-
export interface TableColumn<Row = any> {
|
|
8
|
-
/** Unique column id; also the default data accessor (row[key]). */
|
|
9
|
-
key: string;
|
|
10
|
-
/** Header cell content; omit for a header-less column (e.g. an actions column). */
|
|
11
|
-
label?: ReactNode;
|
|
12
|
-
/** Cell + header alignment. Default 'start'. */
|
|
13
|
-
align?: TableAlign;
|
|
14
|
-
/** Mono + tabular numerals (timestamps, counts, IDs - section E). */
|
|
15
|
-
mono?: boolean;
|
|
16
|
-
/** Identity emphasis: strong text, medium weight. */
|
|
17
|
-
strong?: boolean;
|
|
18
|
-
/** The one greedy column - absorbs slack width. Others size to content. */
|
|
19
|
-
grow?: boolean;
|
|
20
|
-
/** Header becomes a sort control. Sort is local; asc - desc, no third state. */
|
|
21
|
-
sortable?: boolean;
|
|
22
|
-
/** Sort accessor: a row property name, or a function. Defaults to row[key]. */
|
|
23
|
-
sortBy?: string | ((row: Row) => unknown);
|
|
24
|
-
/** Collapse this column below a container breakpoint (30rem / 42rem). */
|
|
25
|
-
hideBelow?: TableHideBelow;
|
|
26
|
-
/** Custom cell renderer. Defaults to row[key]. */
|
|
27
|
-
render?: (row: Row) => ReactNode;
|
|
28
|
-
}
|
|
29
|
-
export interface TableSort {
|
|
30
|
-
/** `key` of the column being sorted by. */
|
|
31
|
-
key: string;
|
|
32
|
-
/** Sort direction - `asc` or `desc`. */
|
|
33
|
-
dir: 'asc' | 'desc';
|
|
34
|
-
}
|
|
35
|
-
export interface TableProps<Row = any> {
|
|
36
|
-
/** Column defs, rendered left to right. */
|
|
37
|
-
columns: TableColumn<Row>[];
|
|
38
|
-
/** The row data; sorted locally per the active sort before render. */
|
|
39
|
-
rows: Row[];
|
|
40
|
-
/** Row identity property. Default 'id'. Must be unique and stable. */
|
|
41
|
-
rowKey?: string;
|
|
42
|
-
/** Accessible name for the <table>. */
|
|
43
|
-
ariaLabel?: string;
|
|
44
|
-
/** Checkbox column + bulk bar. Selection is a Set of row keys, owned here. */
|
|
45
|
-
selectable?: boolean;
|
|
46
|
-
/** Fires with the selected row keys after every selection change. */
|
|
47
|
-
onSelectionChange?: (keys: Array<string | number>) => void;
|
|
48
|
-
/** Rendered in the bulk bar between the count and the built-in Clear. */
|
|
49
|
-
bulkActions?: (keys: Array<string | number>, clear: () => void) => ReactNode;
|
|
50
|
-
/** Per-row checkbox aria-label. Default 'Select row'. */
|
|
51
|
-
selectionLabel?: (row: Row) => string;
|
|
52
|
-
/** Initial sort; sorting stays local and uncontrolled after that. */
|
|
53
|
-
defaultSort?: TableSort | null;
|
|
54
|
-
/** Notification only - fires after the local sort updates. */
|
|
55
|
-
onSortChange?: (sort: TableSort) => void;
|
|
56
|
-
/** Row rhythm. Default 'cozy' (46px rows); 'compact' is 38px. */
|
|
57
|
-
density?: 'cozy' | 'compact';
|
|
58
|
-
/** Pin checkbox + first column under horizontal overflow. Default true. */
|
|
59
|
-
pinFirst?: boolean;
|
|
60
|
-
/** Rows recede and go inert (list-fetch convention). */
|
|
61
|
-
loading?: boolean;
|
|
62
|
-
/** Shown when rows is empty and not loading. Default 'Nothing to show'. */
|
|
63
|
-
empty?: ReactNode;
|
|
64
|
-
/** Footer strip - pagination, summaries. */
|
|
65
|
-
footer?: ReactNode;
|
|
66
|
-
/** Makes rows clickable (checkbox cell excluded). */
|
|
67
|
-
onRowClick?: (row: Row) => void;
|
|
68
|
-
/** Whether a sortable header fires on `pointerdown` (snappier) or waits for `click`. @default 'pointerdown' */
|
|
69
|
-
activateOn?: ActivateOn;
|
|
70
|
-
/** Size the table here - the internal scroller absorbs the constraint. */
|
|
71
|
-
className?: string;
|
|
72
|
-
/** Standard <div> attributes (style, data-*, aria-*, ...) forwarded to the table wrapper. */
|
|
73
|
-
htmlProps?: Omit<HTMLAttributes<HTMLDivElement>, 'className'> & DataAttributes;
|
|
74
|
-
}
|
|
75
|
-
export declare function Table<Row = any>({ columns, rows, rowKey, ariaLabel, selectable, onSelectionChange, bulkActions, selectionLabel, defaultSort, onSortChange, density, pinFirst, loading, empty, footer, onRowClick, activateOn, className, htmlProps, }: TableProps<Row>): import("react").JSX.Element;
|
|
2
|
+
import type { TableProps } from './types';
|
|
3
|
+
export type { TableAlign, TableColumn, TableHideBelow, TableProps, TableSort } from './types';
|
|
4
|
+
export declare function Table<Row = any>({ columns, rows, rowKey, ariaLabel, selectable, onSelectionChange, bulkActions, selectionLabel, defaultSort, onSortChange, renderDetail, expanded, onExpandedChange, expandMode, density, pinFirst, loading, empty, footer, onRowClick, activateOn, className, htmlProps, }: TableProps<Row>): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TableColumn, TableProps } from './types';
|
|
2
|
+
import type { Selection } from './use-table-state';
|
|
3
|
+
type TableBodyProps<Row> = Pick<TableProps<Row>, 'columns' | 'selectionLabel' | 'renderDetail' | 'expanded' | 'onExpandedChange' | 'empty' | 'onRowClick'> & Required<Pick<TableProps<Row>, 'selectable' | 'expandMode' | 'loading'>> & {
|
|
4
|
+
rows: Row[];
|
|
5
|
+
keyOf: (row: Row) => string | number;
|
|
6
|
+
mods: (col: TableColumn<Row>, i: number) => string[];
|
|
7
|
+
selection: Selection;
|
|
8
|
+
checkCellCls: string;
|
|
9
|
+
checkSize: 'sm' | 'md';
|
|
10
|
+
toggleSize: 'xs' | 'sm';
|
|
11
|
+
hoverRow: (row: Element | null) => void;
|
|
12
|
+
leaveRows: () => void;
|
|
13
|
+
};
|
|
14
|
+
export declare function TableBody<Row>({ rows, keyOf, columns, mods, selectable, selection, selectionLabel, checkCellCls, checkSize, toggleSize, renderDetail, expanded, onExpandedChange, expandMode, loading, empty, onRowClick, hoverRow, leaveRows, }: TableBodyProps<Row>): import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import './table-detail.css';
|
|
2
|
+
import type { PointerEventHandler, ReactNode } from 'react';
|
|
3
|
+
import { type MotionProps } from '../../../motion/element';
|
|
4
|
+
import { type ButtonSize } from '../../primitives/button/Button';
|
|
5
|
+
type RowKey = string | number;
|
|
6
|
+
export declare const rowNameId: (id: string) => string;
|
|
7
|
+
export declare function useExpanded(value: RowKey[] | undefined, onChange: ((keys: RowKey[]) => void) | undefined, mode: 'single' | 'multiple'): readonly [RowKey[], (key: RowKey) => void];
|
|
8
|
+
interface DetailToggleProps {
|
|
9
|
+
id: string;
|
|
10
|
+
open: boolean;
|
|
11
|
+
size: ButtonSize;
|
|
12
|
+
onToggle: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function DetailToggle({ id, open, size, onToggle }: DetailToggleProps): import("react").JSX.Element;
|
|
15
|
+
interface DetailRowProps {
|
|
16
|
+
id: string;
|
|
17
|
+
open: boolean;
|
|
18
|
+
span: number;
|
|
19
|
+
motion: Pick<MotionProps, 'layout' | 'layoutTransition' | 'animate' | 'exit'>;
|
|
20
|
+
onPointerEnter: PointerEventHandler<HTMLElement>;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export declare function DetailRow({ id, open, span, motion, onPointerEnter, children }: DetailRowProps): import("react").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type ActivateOn } from '../../internal/utils/activation';
|
|
3
|
+
import type { TableColumn, TableSort } from './types';
|
|
4
|
+
export declare function cellMods(col: TableColumn, i: number, pinFirst: boolean, selectable: boolean): string[];
|
|
5
|
+
interface TableHeadProps<Row> {
|
|
6
|
+
columns: TableColumn<Row>[];
|
|
7
|
+
sort: TableSort | null;
|
|
8
|
+
onSort: (col: TableColumn<Row>) => void;
|
|
9
|
+
activateOn: ActivateOn;
|
|
10
|
+
mods: (col: TableColumn<Row>, i: number) => string[];
|
|
11
|
+
selectAll: ReactNode;
|
|
12
|
+
checkCellCls: string;
|
|
13
|
+
toggleColumn: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function TableHead<Row>({ columns, sort, onSort, activateOn, mods, selectAll, checkCellCls, toggleColumn, }: TableHeadProps<Row>): import("react").JSX.Element;
|
|
16
|
+
export {};
|