@hanzo/ui 8.27.90 → 8.28.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/NOTICE +25 -0
- package/README.md +1 -1
- package/dist/backends/gui/alert-dialog.cjs +24 -6
- package/dist/backends/gui/alert-dialog.d.ts +11 -3
- package/dist/backends/gui/alert-dialog.d.ts.map +1 -1
- package/dist/backends/gui/alert-dialog.js +24 -6
- package/dist/backends/gui/alert-dialog.js.map +1 -1
- package/dist/backends/gui/alert.cjs +32 -1
- package/dist/backends/gui/alert.d.ts +36 -3
- package/dist/backends/gui/alert.d.ts.map +1 -1
- package/dist/backends/gui/alert.js +32 -2
- package/dist/backends/gui/alert.js.map +1 -1
- package/dist/backends/gui/avatar-group.cjs +28 -0
- package/dist/backends/gui/avatar-group.d.ts +33 -0
- package/dist/backends/gui/avatar-group.d.ts.map +1 -0
- package/dist/backends/gui/avatar-group.js +26 -0
- package/dist/backends/gui/avatar-group.js.map +1 -0
- package/dist/backends/gui/avatar.cjs +53 -3
- package/dist/backends/gui/avatar.d.ts +46 -4
- package/dist/backends/gui/avatar.d.ts.map +1 -1
- package/dist/backends/gui/avatar.js +52 -3
- package/dist/backends/gui/avatar.js.map +1 -1
- package/dist/backends/gui/badge.cjs +40 -2
- package/dist/backends/gui/badge.d.ts +7 -2
- package/dist/backends/gui/badge.d.ts.map +1 -1
- package/dist/backends/gui/badge.js +40 -2
- package/dist/backends/gui/badge.js.map +1 -1
- package/dist/backends/gui/banner.cjs +40 -1
- package/dist/backends/gui/banner.d.ts +36 -3
- package/dist/backends/gui/banner.d.ts.map +1 -1
- package/dist/backends/gui/banner.js +42 -4
- package/dist/backends/gui/banner.js.map +1 -1
- package/dist/backends/gui/breadcrumb.cjs +28 -10
- package/dist/backends/gui/breadcrumb.d.ts +20 -11
- package/dist/backends/gui/breadcrumb.d.ts.map +1 -1
- package/dist/backends/gui/breadcrumb.js +28 -10
- package/dist/backends/gui/breadcrumb.js.map +1 -1
- package/dist/backends/gui/button-group.cjs +43 -0
- package/dist/backends/gui/button-group.d.ts +48 -0
- package/dist/backends/gui/button-group.d.ts.map +1 -0
- package/dist/backends/gui/button-group.js +40 -0
- package/dist/backends/gui/button-group.js.map +1 -0
- package/dist/backends/gui/button.cjs +177 -4
- package/dist/backends/gui/button.d.ts +69 -4
- package/dist/backends/gui/button.d.ts.map +1 -1
- package/dist/backends/gui/button.js +179 -6
- package/dist/backends/gui/button.js.map +1 -1
- package/dist/backends/gui/card.cjs +50 -21
- package/dist/backends/gui/card.d.ts +16 -7
- package/dist/backends/gui/card.d.ts.map +1 -1
- package/dist/backends/gui/card.js +50 -21
- package/dist/backends/gui/card.js.map +1 -1
- package/dist/backends/gui/checkbox.cjs +86 -14
- package/dist/backends/gui/checkbox.d.ts +30 -2
- package/dist/backends/gui/checkbox.d.ts.map +1 -1
- package/dist/backends/gui/checkbox.js +87 -15
- package/dist/backends/gui/checkbox.js.map +1 -1
- package/dist/backends/gui/chip.cjs +51 -0
- package/dist/backends/gui/chip.d.ts +47 -0
- package/dist/backends/gui/chip.d.ts.map +1 -0
- package/dist/backends/gui/chip.js +49 -0
- package/dist/backends/gui/chip.js.map +1 -0
- package/dist/backends/gui/choice.cjs +18 -3
- package/dist/backends/gui/choice.d.ts +10 -2
- package/dist/backends/gui/choice.d.ts.map +1 -1
- package/dist/backends/gui/choice.js +19 -4
- package/dist/backends/gui/choice.js.map +1 -1
- package/dist/backends/gui/code-editor.cjs +16 -5
- package/dist/backends/gui/code-editor.d.ts +18 -1
- package/dist/backends/gui/code-editor.d.ts.map +1 -1
- package/dist/backends/gui/code-editor.js +16 -5
- package/dist/backends/gui/code-editor.js.map +1 -1
- package/dist/backends/gui/color-sample.cjs +24 -0
- package/dist/backends/gui/color-sample.d.ts +23 -0
- package/dist/backends/gui/color-sample.d.ts.map +1 -0
- package/dist/backends/gui/color-sample.js +22 -0
- package/dist/backends/gui/color-sample.js.map +1 -0
- package/dist/backends/gui/control.cjs +5 -3
- package/dist/backends/gui/control.d.ts +13 -3
- package/dist/backends/gui/control.d.ts.map +1 -1
- package/dist/backends/gui/control.js +5 -3
- package/dist/backends/gui/control.js.map +1 -1
- package/dist/backends/gui/country-select.cjs +69 -0
- package/dist/backends/gui/country-select.d.ts +30 -0
- package/dist/backends/gui/country-select.d.ts.map +1 -0
- package/dist/backends/gui/country-select.js +67 -0
- package/dist/backends/gui/country-select.js.map +1 -0
- package/dist/backends/gui/currency-picker.cjs +48 -0
- package/dist/backends/gui/currency-picker.d.ts +37 -0
- package/dist/backends/gui/currency-picker.d.ts.map +1 -0
- package/dist/backends/gui/currency-picker.js +46 -0
- package/dist/backends/gui/currency-picker.js.map +1 -0
- package/dist/backends/gui/density.cjs +32 -0
- package/dist/backends/gui/density.d.ts +27 -0
- package/dist/backends/gui/density.d.ts.map +1 -0
- package/dist/backends/gui/density.js +27 -0
- package/dist/backends/gui/density.js.map +1 -0
- package/dist/backends/gui/dialog.cjs +65 -7
- package/dist/backends/gui/dialog.d.ts +68 -3
- package/dist/backends/gui/dialog.d.ts.map +1 -1
- package/dist/backends/gui/dialog.js +63 -7
- package/dist/backends/gui/dialog.js.map +1 -1
- package/dist/backends/gui/dropdown-menu.cjs +361 -31
- package/dist/backends/gui/dropdown-menu.d.ts +151 -15
- package/dist/backends/gui/dropdown-menu.d.ts.map +1 -1
- package/dist/backends/gui/dropdown-menu.js +353 -34
- package/dist/backends/gui/dropdown-menu.js.map +1 -1
- package/dist/backends/gui/feedback.cjs +78 -0
- package/dist/backends/gui/feedback.d.ts +46 -0
- package/dist/backends/gui/feedback.d.ts.map +1 -0
- package/dist/backends/gui/feedback.js +74 -0
- package/dist/backends/gui/feedback.js.map +1 -0
- package/dist/backends/gui/field.cjs +71 -14
- package/dist/backends/gui/field.d.ts +43 -3
- package/dist/backends/gui/field.d.ts.map +1 -1
- package/dist/backends/gui/field.js +69 -14
- package/dist/backends/gui/field.js.map +1 -1
- package/dist/backends/gui/flag.cjs +17 -0
- package/dist/backends/gui/flag.d.ts +9 -0
- package/dist/backends/gui/flag.d.ts.map +1 -0
- package/dist/backends/gui/flag.js +14 -0
- package/dist/backends/gui/flag.js.map +1 -0
- package/dist/backends/gui/grip.cjs +35 -3
- package/dist/backends/gui/grip.d.ts +16 -1
- package/dist/backends/gui/grip.d.ts.map +1 -1
- package/dist/backends/gui/grip.js +35 -3
- package/dist/backends/gui/grip.js.map +1 -1
- package/dist/backends/gui/heading.cjs +27 -0
- package/dist/backends/gui/heading.d.ts +8 -0
- package/dist/backends/gui/heading.d.ts.map +1 -0
- package/dist/backends/gui/heading.js +25 -0
- package/dist/backends/gui/heading.js.map +1 -0
- package/dist/backends/gui/hue.cjs +49 -0
- package/dist/backends/gui/hue.d.ts +18 -0
- package/dist/backends/gui/hue.d.ts.map +1 -0
- package/dist/backends/gui/hue.js +43 -0
- package/dist/backends/gui/hue.js.map +1 -0
- package/dist/backends/gui/icon-tile.cjs +36 -0
- package/dist/backends/gui/icon-tile.d.ts +26 -0
- package/dist/backends/gui/icon-tile.d.ts.map +1 -0
- package/dist/backends/gui/icon-tile.js +32 -0
- package/dist/backends/gui/icon-tile.js.map +1 -0
- package/dist/backends/gui/image-input.cjs +78 -0
- package/dist/backends/gui/image-input.d.ts +32 -0
- package/dist/backends/gui/image-input.d.ts.map +1 -0
- package/dist/backends/gui/image-input.js +74 -0
- package/dist/backends/gui/image-input.js.map +1 -0
- package/dist/backends/gui/index.cjs +93 -7
- package/dist/backends/gui/index.d.ts +45 -2
- package/dist/backends/gui/index.d.ts.map +1 -1
- package/dist/backends/gui/index.js +35 -1
- package/dist/backends/gui/index.js.map +1 -1
- package/dist/backends/gui/input-group.cjs +49 -0
- package/dist/backends/gui/input-group.d.ts +46 -0
- package/dist/backends/gui/input-group.d.ts.map +1 -0
- package/dist/backends/gui/input-group.js +46 -0
- package/dist/backends/gui/input-group.js.map +1 -0
- package/dist/backends/gui/input.cjs +32 -4
- package/dist/backends/gui/input.d.ts +5 -1
- package/dist/backends/gui/input.d.ts.map +1 -1
- package/dist/backends/gui/input.js +33 -5
- package/dist/backends/gui/input.js.map +1 -1
- package/dist/backends/gui/item.cjs +34 -2
- package/dist/backends/gui/item.d.ts +21 -5
- package/dist/backends/gui/item.d.ts.map +1 -1
- package/dist/backends/gui/item.js +35 -3
- package/dist/backends/gui/item.js.map +1 -1
- package/dist/backends/gui/json-tree.cjs +103 -15
- package/dist/backends/gui/json-tree.d.ts +39 -3
- package/dist/backends/gui/json-tree.d.ts.map +1 -1
- package/dist/backends/gui/json-tree.js +104 -16
- package/dist/backends/gui/json-tree.js.map +1 -1
- package/dist/backends/gui/kbd.cjs +18 -2
- package/dist/backends/gui/kbd.d.ts +5 -2
- package/dist/backends/gui/kbd.d.ts.map +1 -1
- package/dist/backends/gui/kbd.js +18 -2
- package/dist/backends/gui/kbd.js.map +1 -1
- package/dist/backends/gui/label.cjs +14 -3
- package/dist/backends/gui/label.d.ts +12 -3
- package/dist/backends/gui/label.d.ts.map +1 -1
- package/dist/backends/gui/label.js +14 -3
- package/dist/backends/gui/label.js.map +1 -1
- package/dist/backends/gui/layout.cjs +5 -1
- package/dist/backends/gui/layout.d.ts +1 -1
- package/dist/backends/gui/layout.d.ts.map +1 -1
- package/dist/backends/gui/layout.js +5 -1
- package/dist/backends/gui/layout.js.map +1 -1
- package/dist/backends/gui/number-field.cjs +163 -0
- package/dist/backends/gui/number-field.d.ts +34 -0
- package/dist/backends/gui/number-field.d.ts.map +1 -0
- package/dist/backends/gui/number-field.js +160 -0
- package/dist/backends/gui/number-field.js.map +1 -0
- package/dist/backends/gui/overflowing-list.cjs +79 -0
- package/dist/backends/gui/overflowing-list.d.ts +42 -0
- package/dist/backends/gui/overflowing-list.d.ts.map +1 -0
- package/dist/backends/gui/overflowing-list.js +76 -0
- package/dist/backends/gui/overflowing-list.js.map +1 -0
- package/dist/backends/gui/phone-country-picker.cjs +60 -0
- package/dist/backends/gui/phone-country-picker.d.ts +34 -0
- package/dist/backends/gui/phone-country-picker.d.ts.map +1 -0
- package/dist/backends/gui/phone-country-picker.js +57 -0
- package/dist/backends/gui/phone-country-picker.js.map +1 -0
- package/dist/backends/gui/popover.cjs +20 -4
- package/dist/backends/gui/popover.d.ts +12 -1
- package/dist/backends/gui/popover.d.ts.map +1 -1
- package/dist/backends/gui/popover.js +21 -5
- package/dist/backends/gui/popover.js.map +1 -1
- package/dist/backends/gui/progress-ring.cjs +38 -0
- package/dist/backends/gui/progress-ring.d.ts +37 -0
- package/dist/backends/gui/progress-ring.d.ts.map +1 -0
- package/dist/backends/gui/progress-ring.js +36 -0
- package/dist/backends/gui/progress-ring.js.map +1 -0
- package/dist/backends/gui/progress.cjs +31 -7
- package/dist/backends/gui/progress.d.ts +25 -3
- package/dist/backends/gui/progress.d.ts.map +1 -1
- package/dist/backends/gui/progress.js +32 -8
- package/dist/backends/gui/progress.js.map +1 -1
- package/dist/backends/gui/radio-group.cjs +28 -2
- package/dist/backends/gui/radio-group.d.ts +20 -2
- package/dist/backends/gui/radio-group.d.ts.map +1 -1
- package/dist/backends/gui/radio-group.js +28 -2
- package/dist/backends/gui/radio-group.js.map +1 -1
- package/dist/backends/gui/search-list.cjs +62 -0
- package/dist/backends/gui/search-list.d.ts +65 -0
- package/dist/backends/gui/search-list.d.ts.map +1 -0
- package/dist/backends/gui/search-list.js +58 -0
- package/dist/backends/gui/search-list.js.map +1 -0
- package/dist/backends/gui/select.cjs +50 -16
- package/dist/backends/gui/select.d.ts +12 -3
- package/dist/backends/gui/select.d.ts.map +1 -1
- package/dist/backends/gui/select.js +51 -17
- package/dist/backends/gui/select.js.map +1 -1
- package/dist/backends/gui/shortcut.cjs +122 -0
- package/dist/backends/gui/shortcut.d.ts +58 -0
- package/dist/backends/gui/shortcut.d.ts.map +1 -0
- package/dist/backends/gui/shortcut.js +115 -0
- package/dist/backends/gui/shortcut.js.map +1 -0
- package/dist/backends/gui/skeleton.cjs +41 -10
- package/dist/backends/gui/skeleton.d.ts +46 -8
- package/dist/backends/gui/skeleton.d.ts.map +1 -1
- package/dist/backends/gui/skeleton.js +39 -8
- package/dist/backends/gui/skeleton.js.map +1 -1
- package/dist/backends/gui/snippet.cjs +12 -1
- package/dist/backends/gui/snippet.d.ts +4 -2
- package/dist/backends/gui/snippet.d.ts.map +1 -1
- package/dist/backends/gui/snippet.js +12 -1
- package/dist/backends/gui/snippet.js.map +1 -1
- package/dist/backends/gui/spinner.cjs +8 -1
- package/dist/backends/gui/spinner.d.ts +11 -2
- package/dist/backends/gui/spinner.d.ts.map +1 -1
- package/dist/backends/gui/spinner.js +9 -2
- package/dist/backends/gui/spinner.js.map +1 -1
- package/dist/backends/gui/stack-icon.cjs +17 -0
- package/dist/backends/gui/stack-icon.d.ts +15 -0
- package/dist/backends/gui/stack-icon.d.ts.map +1 -0
- package/dist/backends/gui/stack-icon.js +15 -0
- package/dist/backends/gui/stack-icon.js.map +1 -0
- package/dist/backends/gui/status.cjs +38 -1
- package/dist/backends/gui/status.d.ts +16 -2
- package/dist/backends/gui/status.d.ts.map +1 -1
- package/dist/backends/gui/status.js +38 -2
- package/dist/backends/gui/status.js.map +1 -1
- package/dist/backends/gui/stepper.cjs +73 -3
- package/dist/backends/gui/stepper.d.ts +25 -1
- package/dist/backends/gui/stepper.d.ts.map +1 -1
- package/dist/backends/gui/stepper.js +71 -5
- package/dist/backends/gui/stepper.js.map +1 -1
- package/dist/backends/gui/switch.cjs +35 -20
- package/dist/backends/gui/switch.d.ts +12 -2
- package/dist/backends/gui/switch.d.ts.map +1 -1
- package/dist/backends/gui/switch.js +35 -20
- package/dist/backends/gui/switch.js.map +1 -1
- package/dist/backends/gui/tabs.cjs +63 -17
- package/dist/backends/gui/tabs.d.ts +35 -6
- package/dist/backends/gui/tabs.d.ts.map +1 -1
- package/dist/backends/gui/tabs.js +65 -19
- package/dist/backends/gui/tabs.js.map +1 -1
- package/dist/backends/gui/tag.cjs +48 -0
- package/dist/backends/gui/tag.d.ts +53 -0
- package/dist/backends/gui/tag.d.ts.map +1 -0
- package/dist/backends/gui/tag.js +46 -0
- package/dist/backends/gui/tag.js.map +1 -0
- package/dist/backends/gui/tags.cjs +9 -2
- package/dist/backends/gui/tags.d.ts +6 -5
- package/dist/backends/gui/tags.d.ts.map +1 -1
- package/dist/backends/gui/tags.js +9 -2
- package/dist/backends/gui/tags.js.map +1 -1
- package/dist/backends/gui/textarea.cjs +22 -6
- package/dist/backends/gui/textarea.d.ts +10 -1
- package/dist/backends/gui/textarea.d.ts.map +1 -1
- package/dist/backends/gui/textarea.js +22 -6
- package/dist/backends/gui/textarea.js.map +1 -1
- package/dist/backends/gui/toaster.cjs +167 -3
- package/dist/backends/gui/toaster.d.ts +28 -2
- package/dist/backends/gui/toaster.d.ts.map +1 -1
- package/dist/backends/gui/toaster.js +167 -5
- package/dist/backends/gui/toaster.js.map +1 -1
- package/dist/backends/gui/toggle-group.cjs +13 -0
- package/dist/backends/gui/toggle-group.d.ts +7 -1
- package/dist/backends/gui/toggle-group.d.ts.map +1 -1
- package/dist/backends/gui/toggle-group.js +13 -0
- package/dist/backends/gui/toggle-group.js.map +1 -1
- package/dist/backends/gui/tooltip.cjs +29 -6
- package/dist/backends/gui/tooltip.d.ts +23 -4
- package/dist/backends/gui/tooltip.d.ts.map +1 -1
- package/dist/backends/gui/tooltip.js +31 -8
- package/dist/backends/gui/tooltip.js.map +1 -1
- package/dist/backends/gui/truncated-text.cjs +102 -0
- package/dist/backends/gui/truncated-text.d.ts +55 -0
- package/dist/backends/gui/truncated-text.d.ts.map +1 -0
- package/dist/backends/gui/truncated-text.js +97 -0
- package/dist/backends/gui/truncated-text.js.map +1 -0
- package/dist/gallery/compound.cjs +60 -0
- package/dist/gallery/compound.d.ts +2 -0
- package/dist/gallery/compound.d.ts.map +1 -0
- package/dist/gallery/compound.js +58 -0
- package/dist/gallery/compound.js.map +1 -0
- package/dist/gallery/display.cjs +47 -0
- package/dist/gallery/display.d.ts +3 -0
- package/dist/gallery/display.d.ts.map +1 -0
- package/dist/gallery/display.js +45 -0
- package/dist/gallery/display.js.map +1 -0
- package/dist/gallery/feedback.cjs +38 -0
- package/dist/gallery/feedback.d.ts +2 -0
- package/dist/gallery/feedback.d.ts.map +1 -0
- package/dist/gallery/feedback.js +36 -0
- package/dist/gallery/feedback.js.map +1 -0
- package/dist/gallery/fields.cjs +53 -0
- package/dist/gallery/fields.d.ts +2 -0
- package/dist/gallery/fields.d.ts.map +1 -0
- package/dist/gallery/fields.js +51 -0
- package/dist/gallery/fields.js.map +1 -0
- package/dist/gallery/frames.cjs +47 -0
- package/dist/gallery/frames.d.ts +2 -0
- package/dist/gallery/frames.d.ts.map +1 -0
- package/dist/gallery/frames.js +45 -0
- package/dist/gallery/frames.js.map +1 -0
- package/dist/gallery/menus.cjs +64 -0
- package/dist/gallery/menus.d.ts +15 -0
- package/dist/gallery/menus.d.ts.map +1 -0
- package/dist/gallery/menus.js +58 -0
- package/dist/gallery/menus.js.map +1 -0
- package/dist/gallery/records.cjs +33 -0
- package/dist/gallery/records.d.ts +2 -0
- package/dist/gallery/records.d.ts.map +1 -0
- package/dist/gallery/records.js +31 -0
- package/dist/gallery/records.js.map +1 -0
- package/dist/gallery/section.cjs +17 -0
- package/dist/gallery/section.d.ts +10 -0
- package/dist/gallery/section.d.ts.map +1 -0
- package/dist/gallery/section.js +14 -0
- package/dist/gallery/section.js.map +1 -0
- package/dist/gallery.cjs +8 -14
- package/dist/gallery.d.ts.map +1 -1
- package/dist/gallery.html +1613 -265
- package/dist/gallery.js +3 -9
- package/dist/gallery.js.map +1 -1
- package/dist/gui-config.cjs +37 -7
- package/dist/gui-config.d.ts +11 -3
- package/dist/gui-config.d.ts.map +1 -1
- package/dist/gui-config.js +37 -7
- package/dist/gui-config.js.map +1 -1
- package/dist/index.cjs +61 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/index.node.cjs +61 -2
- package/dist/index.node.js +7 -1
- package/dist/motion.cjs +25 -1
- package/dist/motion.d.ts +16 -1
- package/dist/motion.d.ts.map +1 -1
- package/dist/motion.js +24 -1
- package/dist/motion.js.map +1 -1
- package/dist/primitives/AvatarGroup.cjs +8 -0
- package/dist/primitives/AvatarGroup.d.ts +2 -0
- package/dist/primitives/AvatarGroup.d.ts.map +1 -0
- package/dist/primitives/AvatarGroup.js +5 -0
- package/dist/primitives/AvatarGroup.js.map +1 -0
- package/dist/primitives/BannerAction.cjs +8 -0
- package/dist/primitives/BannerAction.d.ts +2 -0
- package/dist/primitives/BannerAction.d.ts.map +1 -0
- package/dist/primitives/BannerAction.js +5 -0
- package/dist/primitives/BannerAction.js.map +1 -0
- package/dist/primitives/ButtonGroup.cjs +8 -0
- package/dist/primitives/ButtonGroup.d.ts +2 -0
- package/dist/primitives/ButtonGroup.d.ts.map +1 -0
- package/dist/primitives/ButtonGroup.js +5 -0
- package/dist/primitives/ButtonGroup.js.map +1 -0
- package/dist/primitives/ButtonGroupContext.cjs +8 -0
- package/dist/primitives/ButtonGroupContext.d.ts +2 -0
- package/dist/primitives/ButtonGroupContext.d.ts.map +1 -0
- package/dist/primitives/ButtonGroupContext.js +5 -0
- package/dist/primitives/ButtonGroupContext.js.map +1 -0
- package/dist/primitives/CalloutAction.cjs +8 -0
- package/dist/primitives/CalloutAction.d.ts +2 -0
- package/dist/primitives/CalloutAction.d.ts.map +1 -0
- package/dist/primitives/CalloutAction.js +5 -0
- package/dist/primitives/CalloutAction.js.map +1 -0
- package/dist/primitives/Chip.cjs +8 -0
- package/dist/primitives/Chip.d.ts +2 -0
- package/dist/primitives/Chip.d.ts.map +1 -0
- package/dist/primitives/Chip.js +5 -0
- package/dist/primitives/Chip.js.map +1 -0
- package/dist/primitives/ColorSample.cjs +8 -0
- package/dist/primitives/ColorSample.d.ts +2 -0
- package/dist/primitives/ColorSample.d.ts.map +1 -0
- package/dist/primitives/ColorSample.js +5 -0
- package/dist/primitives/ColorSample.js.map +1 -0
- package/dist/primitives/CountrySelect.cjs +8 -0
- package/dist/primitives/CountrySelect.d.ts +2 -0
- package/dist/primitives/CountrySelect.d.ts.map +1 -0
- package/dist/primitives/CountrySelect.js +5 -0
- package/dist/primitives/CountrySelect.js.map +1 -0
- package/dist/primitives/CurrencyPicker.cjs +8 -0
- package/dist/primitives/CurrencyPicker.d.ts +2 -0
- package/dist/primitives/CurrencyPicker.d.ts.map +1 -0
- package/dist/primitives/CurrencyPicker.js +5 -0
- package/dist/primitives/CurrencyPicker.js.map +1 -0
- package/dist/primitives/Density.cjs +8 -0
- package/dist/primitives/Density.d.ts +2 -0
- package/dist/primitives/Density.d.ts.map +1 -0
- package/dist/primitives/Density.js +5 -0
- package/dist/primitives/Density.js.map +1 -0
- package/dist/primitives/DialogBody.cjs +8 -0
- package/dist/primitives/DialogBody.d.ts +2 -0
- package/dist/primitives/DialogBody.d.ts.map +1 -0
- package/dist/primitives/DialogBody.js +5 -0
- package/dist/primitives/DialogBody.js.map +1 -0
- package/dist/primitives/DropdownMenuBack.cjs +8 -0
- package/dist/primitives/DropdownMenuBack.d.ts +2 -0
- package/dist/primitives/DropdownMenuBack.d.ts.map +1 -0
- package/dist/primitives/DropdownMenuBack.js +5 -0
- package/dist/primitives/DropdownMenuBack.js.map +1 -0
- package/dist/primitives/DropdownMenuClose.cjs +8 -0
- package/dist/primitives/DropdownMenuClose.d.ts +2 -0
- package/dist/primitives/DropdownMenuClose.d.ts.map +1 -0
- package/dist/primitives/DropdownMenuClose.js +5 -0
- package/dist/primitives/DropdownMenuClose.js.map +1 -0
- package/dist/primitives/DropdownMenuEmpty.cjs +8 -0
- package/dist/primitives/DropdownMenuEmpty.d.ts +2 -0
- package/dist/primitives/DropdownMenuEmpty.d.ts.map +1 -0
- package/dist/primitives/DropdownMenuEmpty.js +5 -0
- package/dist/primitives/DropdownMenuEmpty.js.map +1 -0
- package/dist/primitives/DropdownMenuHeader.cjs +8 -0
- package/dist/primitives/DropdownMenuHeader.d.ts +2 -0
- package/dist/primitives/DropdownMenuHeader.d.ts.map +1 -0
- package/dist/primitives/DropdownMenuHeader.js +5 -0
- package/dist/primitives/DropdownMenuHeader.js.map +1 -0
- package/dist/primitives/DropdownMenuLoading.cjs +8 -0
- package/dist/primitives/DropdownMenuLoading.d.ts +2 -0
- package/dist/primitives/DropdownMenuLoading.d.ts.map +1 -0
- package/dist/primitives/DropdownMenuLoading.js +5 -0
- package/dist/primitives/DropdownMenuLoading.js.map +1 -0
- package/dist/primitives/DropdownMenuOptionItem.cjs +8 -0
- package/dist/primitives/DropdownMenuOptionItem.d.ts +2 -0
- package/dist/primitives/DropdownMenuOptionItem.d.ts.map +1 -0
- package/dist/primitives/DropdownMenuOptionItem.js +5 -0
- package/dist/primitives/DropdownMenuOptionItem.js.map +1 -0
- package/dist/primitives/DropdownMenuPage.cjs +8 -0
- package/dist/primitives/DropdownMenuPage.d.ts +2 -0
- package/dist/primitives/DropdownMenuPage.d.ts.map +1 -0
- package/dist/primitives/DropdownMenuPage.js +5 -0
- package/dist/primitives/DropdownMenuPage.js.map +1 -0
- package/dist/primitives/DropdownMenuSearch.cjs +8 -0
- package/dist/primitives/DropdownMenuSearch.d.ts +2 -0
- package/dist/primitives/DropdownMenuSearch.d.ts.map +1 -0
- package/dist/primitives/DropdownMenuSearch.js +5 -0
- package/dist/primitives/DropdownMenuSearch.js.map +1 -0
- package/dist/primitives/DropdownMenuSection.cjs +8 -0
- package/dist/primitives/DropdownMenuSection.d.ts +2 -0
- package/dist/primitives/DropdownMenuSection.d.ts.map +1 -0
- package/dist/primitives/DropdownMenuSection.js +5 -0
- package/dist/primitives/DropdownMenuSection.js.map +1 -0
- package/dist/primitives/DropdownMenuSelectionGroup.cjs +8 -0
- package/dist/primitives/DropdownMenuSelectionGroup.d.ts +2 -0
- package/dist/primitives/DropdownMenuSelectionGroup.d.ts.map +1 -0
- package/dist/primitives/DropdownMenuSelectionGroup.js +5 -0
- package/dist/primitives/DropdownMenuSelectionGroup.js.map +1 -0
- package/dist/primitives/DropdownMenuTitle.cjs +8 -0
- package/dist/primitives/DropdownMenuTitle.d.ts +2 -0
- package/dist/primitives/DropdownMenuTitle.d.ts.map +1 -0
- package/dist/primitives/DropdownMenuTitle.js +5 -0
- package/dist/primitives/DropdownMenuTitle.js.map +1 -0
- package/dist/primitives/Heading.cjs +2 -2
- package/dist/primitives/Heading.d.ts +1 -1
- package/dist/primitives/Heading.d.ts.map +1 -1
- package/dist/primitives/Heading.js +1 -1
- package/dist/primitives/Heading.js.map +1 -1
- package/dist/primitives/IconTile.cjs +8 -0
- package/dist/primitives/IconTile.d.ts +2 -0
- package/dist/primitives/IconTile.d.ts.map +1 -0
- package/dist/primitives/IconTile.js +5 -0
- package/dist/primitives/IconTile.js.map +1 -0
- package/dist/primitives/ImageInput.cjs +8 -0
- package/dist/primitives/ImageInput.d.ts +2 -0
- package/dist/primitives/ImageInput.d.ts.map +1 -0
- package/dist/primitives/ImageInput.js +5 -0
- package/dist/primitives/ImageInput.js.map +1 -0
- package/dist/primitives/InputGroup.cjs +8 -0
- package/dist/primitives/InputGroup.d.ts +2 -0
- package/dist/primitives/InputGroup.d.ts.map +1 -0
- package/dist/primitives/InputGroup.js +5 -0
- package/dist/primitives/InputGroup.js.map +1 -0
- package/dist/primitives/NumberField.cjs +8 -0
- package/dist/primitives/NumberField.d.ts +2 -0
- package/dist/primitives/NumberField.d.ts.map +1 -0
- package/dist/primitives/NumberField.js +5 -0
- package/dist/primitives/NumberField.js.map +1 -0
- package/dist/primitives/OverflowingList.cjs +8 -0
- package/dist/primitives/OverflowingList.d.ts +2 -0
- package/dist/primitives/OverflowingList.d.ts.map +1 -0
- package/dist/primitives/OverflowingList.js +5 -0
- package/dist/primitives/OverflowingList.js.map +1 -0
- package/dist/primitives/PhoneCountryPicker.cjs +8 -0
- package/dist/primitives/PhoneCountryPicker.d.ts +2 -0
- package/dist/primitives/PhoneCountryPicker.d.ts.map +1 -0
- package/dist/primitives/PhoneCountryPicker.js +5 -0
- package/dist/primitives/PhoneCountryPicker.js.map +1 -0
- package/dist/primitives/ProgressRing.cjs +8 -0
- package/dist/primitives/ProgressRing.d.ts +2 -0
- package/dist/primitives/ProgressRing.d.ts.map +1 -0
- package/dist/primitives/ProgressRing.js +5 -0
- package/dist/primitives/ProgressRing.js.map +1 -0
- package/dist/primitives/RadioCircle.cjs +8 -0
- package/dist/primitives/RadioCircle.d.ts +2 -0
- package/dist/primitives/RadioCircle.d.ts.map +1 -0
- package/dist/primitives/RadioCircle.js +5 -0
- package/dist/primitives/RadioCircle.js.map +1 -0
- package/dist/primitives/SKELETON_HEIGHT.cjs +8 -0
- package/dist/primitives/SKELETON_HEIGHT.d.ts +2 -0
- package/dist/primitives/SKELETON_HEIGHT.d.ts.map +1 -0
- package/dist/primitives/SKELETON_HEIGHT.js +5 -0
- package/dist/primitives/SKELETON_HEIGHT.js.map +1 -0
- package/dist/primitives/STATUS_COLOR.cjs +8 -0
- package/dist/primitives/STATUS_COLOR.d.ts +2 -0
- package/dist/primitives/STATUS_COLOR.d.ts.map +1 -0
- package/dist/primitives/STATUS_COLOR.js +5 -0
- package/dist/primitives/STATUS_COLOR.js.map +1 -0
- package/dist/primitives/STATUS_HUE.cjs +8 -0
- package/dist/primitives/STATUS_HUE.d.ts +2 -0
- package/dist/primitives/STATUS_HUE.d.ts.map +1 -0
- package/dist/primitives/STATUS_HUE.js +5 -0
- package/dist/primitives/STATUS_HUE.js.map +1 -0
- package/dist/primitives/STATUS_PAINT.cjs +8 -0
- package/dist/primitives/STATUS_PAINT.d.ts +2 -0
- package/dist/primitives/STATUS_PAINT.d.ts.map +1 -0
- package/dist/primitives/STATUS_PAINT.js +5 -0
- package/dist/primitives/STATUS_PAINT.js.map +1 -0
- package/dist/primitives/Shortcut.cjs +8 -0
- package/dist/primitives/Shortcut.d.ts +2 -0
- package/dist/primitives/Shortcut.d.ts.map +1 -0
- package/dist/primitives/Shortcut.js +5 -0
- package/dist/primitives/Shortcut.js.map +1 -0
- package/dist/primitives/StackIcon.cjs +8 -0
- package/dist/primitives/StackIcon.d.ts +2 -0
- package/dist/primitives/StackIcon.d.ts.map +1 -0
- package/dist/primitives/StackIcon.js +5 -0
- package/dist/primitives/StackIcon.js.map +1 -0
- package/dist/primitives/TOAST_DURATION.cjs +8 -0
- package/dist/primitives/TOAST_DURATION.d.ts +2 -0
- package/dist/primitives/TOAST_DURATION.d.ts.map +1 -0
- package/dist/primitives/TOAST_DURATION.js +5 -0
- package/dist/primitives/TOAST_DURATION.js.map +1 -0
- package/dist/primitives/Tag.cjs +8 -0
- package/dist/primitives/Tag.d.ts +2 -0
- package/dist/primitives/Tag.d.ts.map +1 -0
- package/dist/primitives/Tag.js +5 -0
- package/dist/primitives/Tag.js.map +1 -0
- package/dist/primitives/ToastCard.cjs +8 -0
- package/dist/primitives/ToastCard.d.ts +2 -0
- package/dist/primitives/ToastCard.d.ts.map +1 -0
- package/dist/primitives/ToastCard.js +5 -0
- package/dist/primitives/ToastCard.js.map +1 -0
- package/dist/primitives/ToastFace.cjs +8 -0
- package/dist/primitives/ToastFace.d.ts +2 -0
- package/dist/primitives/ToastFace.d.ts.map +1 -0
- package/dist/primitives/ToastFace.js +5 -0
- package/dist/primitives/ToastFace.js.map +1 -0
- package/dist/primitives/TruncatedText.cjs +8 -0
- package/dist/primitives/TruncatedText.d.ts +2 -0
- package/dist/primitives/TruncatedText.d.ts.map +1 -0
- package/dist/primitives/TruncatedText.js +5 -0
- package/dist/primitives/TruncatedText.js.map +1 -0
- package/dist/primitives/TruncatedTextProvider.cjs +8 -0
- package/dist/primitives/TruncatedTextProvider.d.ts +2 -0
- package/dist/primitives/TruncatedTextProvider.d.ts.map +1 -0
- package/dist/primitives/TruncatedTextProvider.js +5 -0
- package/dist/primitives/TruncatedTextProvider.js.map +1 -0
- package/dist/primitives/VisuallyHidden.cjs +8 -0
- package/dist/primitives/VisuallyHidden.d.ts +2 -0
- package/dist/primitives/VisuallyHidden.d.ts.map +1 -0
- package/dist/primitives/VisuallyHidden.js +5 -0
- package/dist/primitives/VisuallyHidden.js.map +1 -0
- package/dist/primitives/fieldSize.cjs +8 -0
- package/dist/primitives/fieldSize.d.ts +2 -0
- package/dist/primitives/fieldSize.d.ts.map +1 -0
- package/dist/primitives/fieldSize.js +5 -0
- package/dist/primitives/fieldSize.js.map +1 -0
- package/dist/primitives/flag.cjs +8 -0
- package/dist/primitives/flag.d.ts +2 -0
- package/dist/primitives/flag.d.ts.map +1 -0
- package/dist/primitives/flag.js +5 -0
- package/dist/primitives/flag.js.map +1 -0
- package/dist/primitives/formatShortcut.cjs +8 -0
- package/dist/primitives/formatShortcut.d.ts +2 -0
- package/dist/primitives/formatShortcut.d.ts.map +1 -0
- package/dist/primitives/formatShortcut.js +5 -0
- package/dist/primitives/formatShortcut.js.map +1 -0
- package/dist/primitives/initialOf.cjs +8 -0
- package/dist/primitives/initialOf.d.ts +2 -0
- package/dist/primitives/initialOf.d.ts.map +1 -0
- package/dist/primitives/initialOf.js +5 -0
- package/dist/primitives/initialOf.js.map +1 -0
- package/dist/primitives/parseNumber.cjs +8 -0
- package/dist/primitives/parseNumber.d.ts +2 -0
- package/dist/primitives/parseNumber.d.ts.map +1 -0
- package/dist/primitives/parseNumber.js +5 -0
- package/dist/primitives/parseNumber.js.map +1 -0
- package/dist/primitives/speakShortcut.cjs +8 -0
- package/dist/primitives/speakShortcut.d.ts +2 -0
- package/dist/primitives/speakShortcut.d.ts.map +1 -0
- package/dist/primitives/speakShortcut.js +5 -0
- package/dist/primitives/speakShortcut.js.map +1 -0
- package/dist/primitives/tileTones.cjs +8 -0
- package/dist/primitives/tileTones.d.ts +2 -0
- package/dist/primitives/tileTones.d.ts.map +1 -0
- package/dist/primitives/tileTones.js +5 -0
- package/dist/primitives/tileTones.js.map +1 -0
- package/dist/primitives/useDensity.cjs +8 -0
- package/dist/primitives/useDensity.d.ts +2 -0
- package/dist/primitives/useDensity.d.ts.map +1 -0
- package/dist/primitives/useDensity.js +5 -0
- package/dist/primitives/useDensity.js.map +1 -0
- package/dist/primitives/useField.cjs +8 -0
- package/dist/primitives/useField.d.ts +2 -0
- package/dist/primitives/useField.d.ts.map +1 -0
- package/dist/primitives/useField.js +5 -0
- package/dist/primitives/useField.js.map +1 -0
- package/dist/product/ComboBox.cjs +25 -7
- package/dist/product/ComboBox.d.ts +3 -1
- package/dist/product/ComboBox.d.ts.map +1 -1
- package/dist/product/ComboBox.js +25 -7
- package/dist/product/ComboBox.js.map +1 -1
- package/dist/product/CommandMenu.cjs +137 -0
- package/dist/product/CommandMenu.d.ts +77 -0
- package/dist/product/CommandMenu.d.ts.map +1 -0
- package/dist/product/CommandMenu.js +134 -0
- package/dist/product/CommandMenu.js.map +1 -0
- package/dist/product/DetailPane.cjs +154 -12
- package/dist/product/DetailPane.d.ts +80 -2
- package/dist/product/DetailPane.d.ts.map +1 -1
- package/dist/product/DetailPane.js +153 -16
- package/dist/product/DetailPane.js.map +1 -1
- package/dist/product/Fact.cjs +6 -1
- package/dist/product/Fact.d.ts +16 -1
- package/dist/product/Fact.d.ts.map +1 -1
- package/dist/product/Fact.js +6 -1
- package/dist/product/Fact.js.map +1 -1
- package/dist/product/Field.cjs +14 -2
- package/dist/product/Field.d.ts +16 -1
- package/dist/product/Field.d.ts.map +1 -1
- package/dist/product/Field.js +14 -2
- package/dist/product/Field.js.map +1 -1
- package/dist/product/Filters.cjs +61 -9
- package/dist/product/Filters.d.ts +37 -6
- package/dist/product/Filters.d.ts.map +1 -1
- package/dist/product/Filters.js +62 -10
- package/dist/product/Filters.js.map +1 -1
- package/dist/product/MenuRow.cjs +81 -2
- package/dist/product/MenuRow.d.ts +76 -6
- package/dist/product/MenuRow.d.ts.map +1 -1
- package/dist/product/MenuRow.js +81 -4
- package/dist/product/MenuRow.js.map +1 -1
- package/dist/product/PrimaryButton.cjs +5 -1
- package/dist/product/PrimaryButton.d.ts +8 -0
- package/dist/product/PrimaryButton.d.ts.map +1 -1
- package/dist/product/PrimaryButton.js +5 -1
- package/dist/product/PrimaryButton.js.map +1 -1
- package/dist/product/Skeleton.cjs +7 -6
- package/dist/product/Skeleton.d.ts +3 -20
- package/dist/product/Skeleton.d.ts.map +1 -1
- package/dist/product/Skeleton.js +8 -7
- package/dist/product/Skeleton.js.map +1 -1
- package/dist/product/index.cjs +2 -0
- package/dist/product/index.d.ts +1 -0
- package/dist/product/index.d.ts.map +1 -1
- package/dist/product/index.js +2 -0
- package/dist/product/index.js.map +1 -1
- package/dist/settings/Section.cjs +11 -2
- package/dist/settings/Section.d.ts +8 -1
- package/dist/settings/Section.d.ts.map +1 -1
- package/dist/settings/Section.js +11 -2
- package/dist/settings/Section.js.map +1 -1
- package/dist/styles/motion.css +70 -0
- package/dist/styles.css +1479 -136
- package/dist/theme.css +963 -9
- package/package.json +2 -1
|
@@ -39,15 +39,28 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
39
39
|
const React = __importStar(require("react"));
|
|
40
40
|
const gui_1 = require("@hanzo/gui");
|
|
41
41
|
const control_1 = require("./control.cjs");
|
|
42
|
+
const density_1 = require("./density.cjs");
|
|
43
|
+
const field_1 = require("./field.cjs");
|
|
42
44
|
const slot_1 = require("./slot.cjs");
|
|
43
45
|
/** Floor for the grown row count. */
|
|
44
46
|
const MIN_ROWS = 3;
|
|
47
|
+
/**
|
|
48
|
+
* The line each size sets its text on. The record sizes (`sm`, `xs`) set 13px
|
|
49
|
+
* text on a 16px line, as twenty-ui's Textarea does (MIT, NOTICE); the regular
|
|
50
|
+
* ones keep the 20px line of the 14px rung.
|
|
51
|
+
*/
|
|
52
|
+
const LINE = { default: 20, lg: 20, sm: 16, xs: 16 };
|
|
45
53
|
const rowsOf = (v) => typeof v === "string" ? v.split("\n").length : 0;
|
|
46
|
-
const Textarea = /* @__PURE__ */ React.forwardRef(function Textarea({ rows, value, defaultValue, style, size
|
|
47
|
-
const
|
|
54
|
+
const Textarea = /* @__PURE__ */ React.forwardRef(function Textarea({ rows, value, defaultValue, style, size, fill = false, maxRows, ...props }, ref) {
|
|
55
|
+
const density = (0, density_1.useDensity)();
|
|
56
|
+
const field = (0, field_1.useField)();
|
|
57
|
+
const resolved = (0, density_1.fieldSize)(size, density);
|
|
58
|
+
const box = control_1.BOX[resolved];
|
|
59
|
+
const line = LINE[resolved];
|
|
60
|
+
const dense = resolved === "sm" || resolved === "xs";
|
|
48
61
|
const [typed, setTyped] = React.useState(() => rowsOf(defaultValue));
|
|
49
62
|
const uncontrolled = value === undefined;
|
|
50
|
-
const invalid = props["aria-invalid"];
|
|
63
|
+
const invalid = (0, field_1.invalidOf)(props["aria-invalid"], field);
|
|
51
64
|
const node = React.useRef(null);
|
|
52
65
|
const [grown, setGrown] = React.useState(undefined);
|
|
53
66
|
// Both refs reach the same host: ours to measure it, and the caller's.
|
|
@@ -72,7 +85,10 @@ const Textarea = /* @__PURE__ */ React.forwardRef(function Textarea({ rows, valu
|
|
|
72
85
|
el.style.height = held;
|
|
73
86
|
setGrown((h) => (h === measured ? h : measured));
|
|
74
87
|
}, [shown]);
|
|
75
|
-
return ((0, jsx_runtime_1.jsx)(gui_1.TextArea, { ref: hold, ...(0, slot_1.slot)("textarea"), rows: Math.max(rows ?? MIN_ROWS, uncontrolled ? typed : rowsOf(value)), value: value, defaultValue: defaultValue, onChangeText: uncontrolled ? (t) => setTyped(rowsOf(t)) : undefined, ...control_1.FIELD, ...(fill ? control_1.FILL : null), width: "100%",
|
|
88
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.TextArea, { ref: hold, ...(0, slot_1.slot)("textarea"), rows: Math.max(rows ?? MIN_ROWS, uncontrolled ? typed : rowsOf(value)), value: value, defaultValue: defaultValue, onChangeText: uncontrolled ? (t) => setTyped(rowsOf(t)) : undefined, ...control_1.FIELD, ...(density === "compact" ? { bg: "$panel" } : null), ...(fill ? control_1.FILL : null), width: "100%",
|
|
89
|
+
// Three lines of the size's own leading, its risers and its two edges —
|
|
90
|
+
// 64 on the regular rungs, as it has always been; a dense box is shorter.
|
|
91
|
+
minH: dense ? MIN_ROWS * line + 2 * box.riser + 2 : 64, ...(maxRows ? { maxH: maxRows * line + 2 * box.riser + 2 } : null),
|
|
76
92
|
// The gutter has to be NAMED, both ways. Left unsaid the HORIZONTAL one
|
|
77
93
|
// came from gui's `textAreaSizeVariant`, which computes its own and landed
|
|
78
94
|
// on 20 — so the one field a form makes tall was also the one indented
|
|
@@ -84,11 +100,11 @@ const Textarea = /* @__PURE__ */ React.forwardRef(function Textarea({ rows, valu
|
|
|
84
100
|
// first line sat 1px under the edge where its neighbours' sat at 8. In a
|
|
85
101
|
// form the two are read together, and the text looked like it was falling
|
|
86
102
|
// out of the top of the box. The riser is that arithmetic, per size.
|
|
87
|
-
px: box.gutter, pt: box.riser, pb: box.riser, borderColor: invalid
|
|
103
|
+
px: box.gutter, pt: box.riser, pb: box.riser, borderColor: invalid ? "$red7" : "$borderColor", ...(invalid ? { focusStyle: { borderColor: "$red8" } } : null),
|
|
88
104
|
// The value at the full ink, the hint at the placeholder token. gui's
|
|
89
105
|
// Input sub-theme draws its value at 80% grey, which left a typed value
|
|
90
106
|
// and a sample placeholder one rung apart.
|
|
91
|
-
color: "$ink", placeholderTextColor: "$placeholderColor", fontSize:
|
|
107
|
+
color: "$ink", placeholderTextColor: "$placeholderColor", fontSize: box.font, ...(dense ? { lineHeight: line } : null), opacity: props.disabled ? 0.5 : 1, ...(invalid ? { "aria-invalid": true } : null), ...props,
|
|
92
108
|
// After the caller's props, so a passed `style` cannot silently disable
|
|
93
109
|
// growth. A fixed height is asked for with `height`.
|
|
94
110
|
style: { ...style, ...(grown ? { height: grown } : null) } }));
|
|
@@ -23,10 +23,19 @@ import { type FieldSize } from "./control.js";
|
|
|
23
23
|
* a type that never matched the runtime.
|
|
24
24
|
*/
|
|
25
25
|
export type TextareaProps = Omit<React.ComponentProps<typeof TextArea>, "children" | "size"> & Pick<React.ComponentProps<"textarea">, "onKeyDown" | "rows"> & {
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* The gutter and riser of the Input it stands under (control.ts `BOX`).
|
|
28
|
+
* Unset, the nearest `<Density>` decides.
|
|
29
|
+
*/
|
|
27
30
|
size?: FieldSize;
|
|
28
31
|
/** On the raised ground instead of a bare edge (control.ts `FILL`). */
|
|
29
32
|
fill?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The tallest the field grows, in lines, before it scrolls: the box is
|
|
35
|
+
* capped at `maxRows` lines plus its risers and edges. A `maxH` the caller
|
|
36
|
+
* states still wins.
|
|
37
|
+
*/
|
|
38
|
+
maxRows?: number;
|
|
30
39
|
};
|
|
31
40
|
declare const Textarea: React.ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
32
41
|
export { Textarea };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/textarea.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/textarea.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,WAAW,CAAA;AAkB5D;;;;;;;;;;;;;;;GAeG;AACH;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC,GAC1F,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC,GAAG;IAC7D;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,uEAAuE;IACvE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAEH,QAAA,MAAM,QAAQ,wGA0Fb,CAAA;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -3,15 +3,28 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { TextArea } from "@hanzo/gui";
|
|
5
5
|
import { BOX, FIELD, FILL } from "./control.js";
|
|
6
|
+
import { fieldSize, useDensity } from "./density.js";
|
|
7
|
+
import { invalidOf, useField } from "./field.js";
|
|
6
8
|
import { slot } from "./slot.js";
|
|
7
9
|
/** Floor for the grown row count. */
|
|
8
10
|
const MIN_ROWS = 3;
|
|
11
|
+
/**
|
|
12
|
+
* The line each size sets its text on. The record sizes (`sm`, `xs`) set 13px
|
|
13
|
+
* text on a 16px line, as twenty-ui's Textarea does (MIT, NOTICE); the regular
|
|
14
|
+
* ones keep the 20px line of the 14px rung.
|
|
15
|
+
*/
|
|
16
|
+
const LINE = { default: 20, lg: 20, sm: 16, xs: 16 };
|
|
9
17
|
const rowsOf = (v) => typeof v === "string" ? v.split("\n").length : 0;
|
|
10
|
-
const Textarea = /* @__PURE__ */ React.forwardRef(function Textarea({ rows, value, defaultValue, style, size
|
|
11
|
-
const
|
|
18
|
+
const Textarea = /* @__PURE__ */ React.forwardRef(function Textarea({ rows, value, defaultValue, style, size, fill = false, maxRows, ...props }, ref) {
|
|
19
|
+
const density = useDensity();
|
|
20
|
+
const field = useField();
|
|
21
|
+
const resolved = fieldSize(size, density);
|
|
22
|
+
const box = BOX[resolved];
|
|
23
|
+
const line = LINE[resolved];
|
|
24
|
+
const dense = resolved === "sm" || resolved === "xs";
|
|
12
25
|
const [typed, setTyped] = React.useState(() => rowsOf(defaultValue));
|
|
13
26
|
const uncontrolled = value === undefined;
|
|
14
|
-
const invalid = props["aria-invalid"];
|
|
27
|
+
const invalid = invalidOf(props["aria-invalid"], field);
|
|
15
28
|
const node = React.useRef(null);
|
|
16
29
|
const [grown, setGrown] = React.useState(undefined);
|
|
17
30
|
// Both refs reach the same host: ours to measure it, and the caller's.
|
|
@@ -36,7 +49,10 @@ const Textarea = /* @__PURE__ */ React.forwardRef(function Textarea({ rows, valu
|
|
|
36
49
|
el.style.height = held;
|
|
37
50
|
setGrown((h) => (h === measured ? h : measured));
|
|
38
51
|
}, [shown]);
|
|
39
|
-
return (_jsx(TextArea, { ref: hold, ...slot("textarea"), rows: Math.max(rows ?? MIN_ROWS, uncontrolled ? typed : rowsOf(value)), value: value, defaultValue: defaultValue, onChangeText: uncontrolled ? (t) => setTyped(rowsOf(t)) : undefined, ...FIELD, ...(fill ? FILL : null), width: "100%",
|
|
52
|
+
return (_jsx(TextArea, { ref: hold, ...slot("textarea"), rows: Math.max(rows ?? MIN_ROWS, uncontrolled ? typed : rowsOf(value)), value: value, defaultValue: defaultValue, onChangeText: uncontrolled ? (t) => setTyped(rowsOf(t)) : undefined, ...FIELD, ...(density === "compact" ? { bg: "$panel" } : null), ...(fill ? FILL : null), width: "100%",
|
|
53
|
+
// Three lines of the size's own leading, its risers and its two edges —
|
|
54
|
+
// 64 on the regular rungs, as it has always been; a dense box is shorter.
|
|
55
|
+
minH: dense ? MIN_ROWS * line + 2 * box.riser + 2 : 64, ...(maxRows ? { maxH: maxRows * line + 2 * box.riser + 2 } : null),
|
|
40
56
|
// The gutter has to be NAMED, both ways. Left unsaid the HORIZONTAL one
|
|
41
57
|
// came from gui's `textAreaSizeVariant`, which computes its own and landed
|
|
42
58
|
// on 20 — so the one field a form makes tall was also the one indented
|
|
@@ -48,11 +64,11 @@ const Textarea = /* @__PURE__ */ React.forwardRef(function Textarea({ rows, valu
|
|
|
48
64
|
// first line sat 1px under the edge where its neighbours' sat at 8. In a
|
|
49
65
|
// form the two are read together, and the text looked like it was falling
|
|
50
66
|
// out of the top of the box. The riser is that arithmetic, per size.
|
|
51
|
-
px: box.gutter, pt: box.riser, pb: box.riser, borderColor: invalid
|
|
67
|
+
px: box.gutter, pt: box.riser, pb: box.riser, borderColor: invalid ? "$red7" : "$borderColor", ...(invalid ? { focusStyle: { borderColor: "$red8" } } : null),
|
|
52
68
|
// The value at the full ink, the hint at the placeholder token. gui's
|
|
53
69
|
// Input sub-theme draws its value at 80% grey, which left a typed value
|
|
54
70
|
// and a sample placeholder one rung apart.
|
|
55
|
-
color: "$ink", placeholderTextColor: "$placeholderColor", fontSize:
|
|
71
|
+
color: "$ink", placeholderTextColor: "$placeholderColor", fontSize: box.font, ...(dense ? { lineHeight: line } : null), opacity: props.disabled ? 0.5 : 1, ...(invalid ? { "aria-invalid": true } : null), ...props,
|
|
56
72
|
// After the caller's props, so a passed `style` cannot silently disable
|
|
57
73
|
// growth. A fixed height is asked for with `height`.
|
|
58
74
|
style: { ...style, ...(grown ? { height: grown } : null) } }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../src/backends/gui/textarea.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAkB,MAAM,WAAW,CAAA;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,qCAAqC;AACrC,MAAM,QAAQ,GAAG,CAAC,CAAA;AAElB,MAAM,MAAM,GAAG,CAAC,CAAU,EAAE,EAAE,CAC5B,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../src/backends/gui/textarea.tsx"],"names":[],"m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ports, "__esModule", { value: true });
|
|
4
|
-
exports.toast = exports.Toaster = void 0;
|
|
4
|
+
exports.toast = exports.Toaster = exports.TOAST_DURATION = void 0;
|
|
5
|
+
exports.ToastFace = ToastFace;
|
|
6
|
+
exports.ToastCard = ToastCard;
|
|
5
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
/**
|
|
9
|
+
* Toaster — the toast viewport, mounted once near the root of an app, and
|
|
10
|
+
* `toast()`, the sonner-shaped call that fills it.
|
|
11
|
+
*
|
|
12
|
+
* gui owns the machinery: `@hanzogui/toast/v2`'s observer (`toast()`), its
|
|
13
|
+
* stack, its swipe and its exit animation. This file draws the toast itself, on
|
|
14
|
+
* the composable API (`Toast` → `Viewport` → `List` with a `renderItem`), in the
|
|
15
|
+
* record kit's shape — twenty-ui's Toast and Toaster (MIT, NOTICE):
|
|
16
|
+
*
|
|
17
|
+
* · 296 wide on the floating material (`glass(2)`), 8px corners, padding
|
|
18
|
+
* 8 8 4, 8px between toasts, at the bottom-right 12px in; on a phone (≤768)
|
|
19
|
+
* the full width at the top with square corners.
|
|
20
|
+
* · A header row: the status icon (16), the message (12px, quiet, medium),
|
|
21
|
+
* then a "Cancel" text button and a 24px close button pushed right.
|
|
22
|
+
* · The description under it at 12px, soft, indented 24 to clear the icon.
|
|
23
|
+
* · An action as a footer: a hairline, then the button at the end.
|
|
24
|
+
* · The COUNTDOWN as a fill behind the whole toast in its status's tint,
|
|
25
|
+
* draining linearly over the toast's duration (6s unless told) and PAUSED
|
|
26
|
+
* while the pointer is over the toast or focus is inside it. A
|
|
27
|
+
* `data: { progress }` (0–100) replaces the countdown with a progress fill,
|
|
28
|
+
* and such a toast stays until it is dismissed or updated.
|
|
29
|
+
* · At most three at once: a fourth closes the oldest.
|
|
30
|
+
*
|
|
31
|
+
* The timer is OURS, not gui's. gui's pauses only while the whole viewport is
|
|
32
|
+
* hovered and restarts from the full duration when it resumes, so a fill drawn
|
|
33
|
+
* over it would empty before the toast went. Each item hands gui a copy of its
|
|
34
|
+
* toast with an infinite duration and runs the one clock both the fill and the
|
|
35
|
+
* dismissal read.
|
|
36
|
+
*
|
|
37
|
+
* `toast()` keeps its signature. Status is its type — `toast()` neutral,
|
|
38
|
+
* `toast.info|success|warning|error()`; `id` is the dedupe key (a second toast
|
|
39
|
+
* with a visible one's id updates it rather than adding one); `cancel`,
|
|
40
|
+
* `action`, `description`, `duration`, `icon`, `onDismiss`, `onAutoClose` as in
|
|
41
|
+
* sonner. `className`, `style`, `richColors` and the per-part `classNames` stay
|
|
42
|
+
* accepted and inert.
|
|
43
|
+
*/
|
|
44
|
+
const gui_1 = require("@hanzo/gui");
|
|
45
|
+
const lucide_icons_2_1 = require("@hanzogui/lucide-icons-2");
|
|
6
46
|
const v2_1 = require("@hanzogui/toast/v2");
|
|
7
47
|
Object.defineProperty(exports, "toast", { enumerable: true, get: function () { return v2_1.toast; } });
|
|
8
48
|
const react_1 = require("react");
|
|
49
|
+
const glass_1 = require("../../glass.cjs");
|
|
50
|
+
const button_1 = require("./button.cjs");
|
|
51
|
+
const feedback_1 = require("./feedback.cjs");
|
|
52
|
+
const slot_1 = require("./slot.cjs");
|
|
53
|
+
/** A toast's default life, ms. */
|
|
54
|
+
exports.TOAST_DURATION = 6000;
|
|
55
|
+
const WIDTH = 296;
|
|
56
|
+
const GAP = 8;
|
|
57
|
+
const INSET = 12;
|
|
58
|
+
const STATUS = {
|
|
59
|
+
default: 'neutral',
|
|
60
|
+
loading: 'neutral',
|
|
61
|
+
info: 'info',
|
|
62
|
+
success: 'success',
|
|
63
|
+
warning: 'warning',
|
|
64
|
+
error: 'error',
|
|
65
|
+
};
|
|
66
|
+
const ICON = {
|
|
67
|
+
neutral: lucide_icons_2_1.TriangleAlert,
|
|
68
|
+
info: lucide_icons_2_1.Info,
|
|
69
|
+
success: lucide_icons_2_1.SquareCheck,
|
|
70
|
+
warning: lucide_icons_2_1.TriangleAlert,
|
|
71
|
+
error: lucide_icons_2_1.TriangleAlert,
|
|
72
|
+
};
|
|
73
|
+
const read = (v) => (typeof v === 'function' ? v() : v);
|
|
74
|
+
/** The progress a toast carries in `data.progress`, 0–100, if it carries one. */
|
|
75
|
+
const progressOf = (t) => {
|
|
76
|
+
const p = t.data?.progress;
|
|
77
|
+
return typeof p === 'number' && Number.isFinite(p) ? Math.max(0, Math.min(100, p)) : null;
|
|
78
|
+
};
|
|
79
|
+
/** The frame every toast wears: the floating material, 296 wide. */
|
|
80
|
+
const frame = (phone) => ({
|
|
81
|
+
...(0, glass_1.glass)(2),
|
|
82
|
+
width: phone ? '100%' : WIDTH,
|
|
83
|
+
rounded: phone ? 0 : '$3',
|
|
84
|
+
borderWidth: 0,
|
|
85
|
+
p: 0,
|
|
86
|
+
overflow: 'hidden',
|
|
87
|
+
});
|
|
88
|
+
/**
|
|
89
|
+
* The body inside it, padded 8 8 4 and holding the fill. It is the body that
|
|
90
|
+
* hears the pointer and the focus: gui's item does not hand its own hover
|
|
91
|
+
* handlers on (measured — a pointer over the item reached none of them), and
|
|
92
|
+
* the body covers the whole toast.
|
|
93
|
+
*/
|
|
94
|
+
const body = { position: 'relative', pt: '$2', px: '$2', pb: '$1' };
|
|
95
|
+
/**
|
|
96
|
+
* What a toast shows, without the stack around it: the fill, the header, the
|
|
97
|
+
* description and the footer. `Toaster` draws one inside each gui item; the
|
|
98
|
+
* gallery draws one alone so its rules ship in the sheet.
|
|
99
|
+
*/
|
|
100
|
+
function ToastFace({ t, duration, paused = false, onClose, onHold }) {
|
|
101
|
+
const status = STATUS[t.type ?? 'default'] ?? 'neutral';
|
|
102
|
+
const p = (0, feedback_1.paint)(status);
|
|
103
|
+
const Icon = ICON[status];
|
|
104
|
+
const progress = progressOf(t);
|
|
105
|
+
const title = read(t.title);
|
|
106
|
+
const description = t.description ? read(t.description) : null;
|
|
107
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('toast-body'), ...body, ...(onHold
|
|
108
|
+
? {
|
|
109
|
+
onHoverIn: () => onHold(true),
|
|
110
|
+
onHoverOut: () => onHold(false),
|
|
111
|
+
onFocus: () => onHold(true),
|
|
112
|
+
onBlur: () => onHold(false),
|
|
113
|
+
}
|
|
114
|
+
: null), children: [progress !== null ? ((0, jsx_runtime_1.jsx)(gui_1.View, { ...(0, slot_1.slot)('toast-progress'), position: "absolute", t: 0, l: 0, b: 0, bg: p.tint, style: { width: `${progress}%`, transition: 'width 300ms linear' }, pointerEvents: "none" })) : duration !== undefined ? ((0, jsx_runtime_1.jsx)(gui_1.View, { ...(0, slot_1.slot)('toast-countdown'), "data-motion": "drain", "data-paused": paused ? '' : undefined, position: "absolute", t: 0, l: 0, r: 0, b: 0, bg: p.tint, pointerEvents: "none", style: { ['--drain']: `${duration}ms` } })) : null, (0, jsx_runtime_1.jsxs)(gui_1.XStack, { ...(0, slot_1.slot)('toast-header'), items: "center", gap: "$2", mb: "$1", minH: 24, children: [(0, jsx_runtime_1.jsx)(gui_1.View, { shrink: 0, width: 16, height: 16, items: "center", justify: "center", children: t.icon ?? (0, jsx_runtime_1.jsx)(Icon, { size: 16, color: p.ink, "aria-label": status }) }), (0, jsx_runtime_1.jsx)(gui_1.SizableText, { ...(0, slot_1.slot)('toast-message'), flex: 1, size: "$1", fontWeight: "500", color: "$aside", numberOfLines: 2, children: title }), t.cancel ? ((0, jsx_runtime_1.jsx)(button_1.Button, { ...(0, slot_1.slot)('toast-cancel'), size: "xs", variant: "ghost", fontWeight: "400", onPress: (e) => {
|
|
115
|
+
t.cancel?.onClick?.(e);
|
|
116
|
+
onClose?.();
|
|
117
|
+
}, children: t.cancel.label || 'Cancel' })) : null, t.dismissible === false ? null : ((0, jsx_runtime_1.jsx)(button_1.Button, { ...(0, slot_1.slot)('toast-close'), size: "icon-xs", variant: "ghost", emphasis: "subtle", "aria-label": "Close", onPress: onClose, children: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.X, {}) }))] }), description ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { ...(0, slot_1.slot)('toast-description'), size: "$1", color: "$hint", pl: 24, maxW: 224, numberOfLines: 1, mb: "$1", children: description })) : null, t.action ? ((0, jsx_runtime_1.jsx)(gui_1.YStack, { ...(0, slot_1.slot)('toast-footer'), mt: "$2", borderTopWidth: 1, borderColor: "$borderColor", pt: "$1", items: "flex-end", children: (0, jsx_runtime_1.jsx)(button_1.Button, { size: "xs", variant: "ghost", onPress: (e) => {
|
|
118
|
+
t.action?.onClick?.(e);
|
|
119
|
+
if (!e?.defaultPrevented)
|
|
120
|
+
onClose?.();
|
|
121
|
+
}, children: t.action.label }) })) : null] }));
|
|
122
|
+
}
|
|
123
|
+
/** A toast at rest, outside any stack — the gallery's, and a docs page's. */
|
|
124
|
+
function ToastCard({ phone = false, ...props }) {
|
|
125
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.YStack, { ...(0, slot_1.slot)('toast'), position: "relative", ...frame(phone), children: (0, jsx_runtime_1.jsx)(ToastFace, { ...props }) }));
|
|
126
|
+
}
|
|
127
|
+
function ToastItem({ t, index, fallback, phone, }) {
|
|
128
|
+
const progress = progressOf(t);
|
|
129
|
+
const duration = t.duration ?? fallback;
|
|
130
|
+
const timed = progress === null && t.type !== 'loading' && Number.isFinite(duration) && duration > 0;
|
|
131
|
+
const [paused, setPaused] = (0, react_1.useState)(false);
|
|
132
|
+
const remaining = (0, react_1.useRef)(duration);
|
|
133
|
+
const done = (0, react_1.useRef)(false);
|
|
134
|
+
// The one clock: the fill drains on it and the toast closes on it. Once:
|
|
135
|
+
// the dismissal re-renders the item with a new toast object, and the clock
|
|
136
|
+
// must not start over on it.
|
|
137
|
+
(0, react_1.useEffect)(() => {
|
|
138
|
+
if (!timed || paused || done.current)
|
|
139
|
+
return;
|
|
140
|
+
const start = Date.now();
|
|
141
|
+
const id = setTimeout(() => {
|
|
142
|
+
done.current = true;
|
|
143
|
+
t.onAutoClose?.(t);
|
|
144
|
+
v2_1.toast.dismiss(t.id);
|
|
145
|
+
}, remaining.current);
|
|
146
|
+
return () => {
|
|
147
|
+
clearTimeout(id);
|
|
148
|
+
remaining.current = Math.max(0, remaining.current - (Date.now() - start));
|
|
149
|
+
};
|
|
150
|
+
}, [timed, paused, t]);
|
|
151
|
+
// gui sees an untimed toast, so its own clock never fires (see the header).
|
|
152
|
+
const held = (0, react_1.useMemo)(() => ({ ...t, duration: Number.POSITIVE_INFINITY }), [t]);
|
|
153
|
+
const close = () => {
|
|
154
|
+
t.onDismiss?.(t);
|
|
155
|
+
v2_1.toast.dismiss(t.id);
|
|
156
|
+
};
|
|
157
|
+
return ((0, jsx_runtime_1.jsx)(v2_1.Toast.Item, { toast: held, index: index, ...frame(phone), "data-status": STATUS[t.type ?? 'default'] ?? 'neutral', children: (0, jsx_runtime_1.jsx)(ToastFace, { t: t, duration: timed ? duration : undefined, paused: paused, onClose: close, onHold: setPaused }) }));
|
|
158
|
+
}
|
|
159
|
+
/** Closes the oldest once more than `limit` are on screen. */
|
|
160
|
+
function Limit({ limit }) {
|
|
161
|
+
const { toasts } = (0, v2_1.useToasts)();
|
|
162
|
+
const live = toasts.filter((t) => !t.delete);
|
|
163
|
+
(0, react_1.useEffect)(() => {
|
|
164
|
+
// Newest first: the ones past the limit are the oldest.
|
|
165
|
+
for (const t of live.slice(limit))
|
|
166
|
+
v2_1.toast.dismiss(t.id);
|
|
167
|
+
}, [live, limit]);
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
9
170
|
const Toaster = /* @__PURE__ */ (0, react_1.forwardRef)(function Toaster(props, ref) {
|
|
10
|
-
const { theme = 'system', toastOptions, richColors: _richColors, ...rest } = props;
|
|
11
|
-
|
|
171
|
+
const { theme = 'system', toastOptions, richColors: _richColors, className: _className, style: _style, position, offset, gap, limit = 3, duration, containerAriaLabel = 'Notifications', hotkey, ...rest } = props;
|
|
172
|
+
const media = (0, gui_1.useMedia)();
|
|
173
|
+
const phone = !!media['max-md'];
|
|
174
|
+
const fallback = toastOptions?.duration ?? duration ?? exports.TOAST_DURATION;
|
|
175
|
+
return ((0, jsx_runtime_1.jsx)(v2_1.Toast, { ...rest, theme: theme, position: position ?? (phone ? 'top-center' : 'bottom-right'), gap: gap ?? GAP, visibleToasts: limit, duration: Number.POSITIVE_INFINITY, children: (0, jsx_runtime_1.jsxs)(v2_1.Toast.Viewport, { ref: ref, ...(0, slot_1.slot)('toaster'), offset: offset ?? (phone ? 0 : INSET), hotkey: hotkey, label: containerAriaLabel, ...(phone ? { width: '100%' } : null), children: [(0, jsx_runtime_1.jsx)(Limit, { limit: limit }), (0, jsx_runtime_1.jsx)(v2_1.Toast.List, { renderItem: ({ toast: t, index }) => (0, jsx_runtime_1.jsx)(ToastItem, { t: t, index: index, fallback: fallback, phone: phone }, t.id) })] }) }));
|
|
12
176
|
});
|
|
13
177
|
exports.Toaster = Toaster;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toast, type ExternalToast, type ToasterProps as GuiToasterProps } from '@hanzogui/toast/v2';
|
|
1
|
+
import { toast, type ExternalToast, type ToasterProps as GuiToasterProps, type ToastT } from '@hanzogui/toast/v2';
|
|
2
2
|
/** Sonner's per-part class hooks. Inert — see the note above. */
|
|
3
3
|
export type ToasterClassNames = Partial<Record<'toast' | 'title' | 'description' | 'icon' | 'actionButton' | 'cancelButton' | 'closeButton', string>>;
|
|
4
4
|
export interface ToasterProps extends Omit<GuiToasterProps, 'toastOptions'> {
|
|
@@ -6,12 +6,38 @@ export interface ToasterProps extends Omit<GuiToasterProps, 'toastOptions'> {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
/** Inert. gui themes the viewport from tokens. */
|
|
8
8
|
style?: Record<string, string | number>;
|
|
9
|
-
/** Inert. Sonner's semantic palette;
|
|
9
|
+
/** Inert. Sonner's semantic palette; the status colours are the kit's own. */
|
|
10
10
|
richColors?: boolean;
|
|
11
11
|
toastOptions?: ExternalToast & {
|
|
12
12
|
classNames?: ToasterClassNames;
|
|
13
13
|
};
|
|
14
|
+
/** How many show at once; a further one closes the oldest. Default 3. */
|
|
15
|
+
limit?: number;
|
|
14
16
|
}
|
|
17
|
+
/** A toast's default life, ms. */
|
|
18
|
+
export declare const TOAST_DURATION = 6000;
|
|
19
|
+
export type ToastFaceProps = {
|
|
20
|
+
/** The toast, as `toast()` made it. */
|
|
21
|
+
t: Pick<ToastT, 'title' | 'description' | 'type' | 'icon' | 'action' | 'cancel' | 'dismissible' | 'data'>;
|
|
22
|
+
/** Its life in ms, when it is timed; the countdown drains over it. */
|
|
23
|
+
duration?: number;
|
|
24
|
+
/** Whether the countdown is held. */
|
|
25
|
+
paused?: boolean;
|
|
26
|
+
/** Close it — the close button, and Cancel or the action after their own handler. */
|
|
27
|
+
onClose?: () => void;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* What a toast shows, without the stack around it: the fill, the header, the
|
|
31
|
+
* description and the footer. `Toaster` draws one inside each gui item; the
|
|
32
|
+
* gallery draws one alone so its rules ship in the sheet.
|
|
33
|
+
*/
|
|
34
|
+
export declare function ToastFace({ t, duration, paused, onClose, onHold }: ToastFaceProps & {
|
|
35
|
+
onHold?: (held: boolean) => void;
|
|
36
|
+
}): import("react").JSX.Element;
|
|
37
|
+
/** A toast at rest, outside any stack — the gallery's, and a docs page's. */
|
|
38
|
+
export declare function ToastCard({ phone, ...props }: ToastFaceProps & {
|
|
39
|
+
phone?: boolean;
|
|
40
|
+
}): import("react").JSX.Element;
|
|
15
41
|
declare const Toaster: import("react").ForwardRefExoticComponent<ToasterProps & import("react").RefAttributes<any>>;
|
|
16
42
|
export { Toaster, toast };
|
|
17
43
|
//# sourceMappingURL=toaster.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toaster.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/toaster.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toaster.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/toaster.tsx"],"names":[],"mappings":"AAwCA,OAAO,EAEL,KAAK,EAEL,KAAK,aA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OAAO,KAAK,IAAI,CAAA;CAAE,+BA8FhI;AAED,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,EAAE,KAAa,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,+BAM1F;AAmED,QAAA,MAAM,OAAO,8FA2CX,CAAA;AAEF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -1,10 +1,172 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Toaster — the toast viewport, mounted once near the root of an app, and
|
|
5
|
+
* `toast()`, the sonner-shaped call that fills it.
|
|
6
|
+
*
|
|
7
|
+
* gui owns the machinery: `@hanzogui/toast/v2`'s observer (`toast()`), its
|
|
8
|
+
* stack, its swipe and its exit animation. This file draws the toast itself, on
|
|
9
|
+
* the composable API (`Toast` → `Viewport` → `List` with a `renderItem`), in the
|
|
10
|
+
* record kit's shape — twenty-ui's Toast and Toaster (MIT, NOTICE):
|
|
11
|
+
*
|
|
12
|
+
* · 296 wide on the floating material (`glass(2)`), 8px corners, padding
|
|
13
|
+
* 8 8 4, 8px between toasts, at the bottom-right 12px in; on a phone (≤768)
|
|
14
|
+
* the full width at the top with square corners.
|
|
15
|
+
* · A header row: the status icon (16), the message (12px, quiet, medium),
|
|
16
|
+
* then a "Cancel" text button and a 24px close button pushed right.
|
|
17
|
+
* · The description under it at 12px, soft, indented 24 to clear the icon.
|
|
18
|
+
* · An action as a footer: a hairline, then the button at the end.
|
|
19
|
+
* · The COUNTDOWN as a fill behind the whole toast in its status's tint,
|
|
20
|
+
* draining linearly over the toast's duration (6s unless told) and PAUSED
|
|
21
|
+
* while the pointer is over the toast or focus is inside it. A
|
|
22
|
+
* `data: { progress }` (0–100) replaces the countdown with a progress fill,
|
|
23
|
+
* and such a toast stays until it is dismissed or updated.
|
|
24
|
+
* · At most three at once: a fourth closes the oldest.
|
|
25
|
+
*
|
|
26
|
+
* The timer is OURS, not gui's. gui's pauses only while the whole viewport is
|
|
27
|
+
* hovered and restarts from the full duration when it resumes, so a fill drawn
|
|
28
|
+
* over it would empty before the toast went. Each item hands gui a copy of its
|
|
29
|
+
* toast with an infinite duration and runs the one clock both the fill and the
|
|
30
|
+
* dismissal read.
|
|
31
|
+
*
|
|
32
|
+
* `toast()` keeps its signature. Status is its type — `toast()` neutral,
|
|
33
|
+
* `toast.info|success|warning|error()`; `id` is the dedupe key (a second toast
|
|
34
|
+
* with a visible one's id updates it rather than adding one); `cancel`,
|
|
35
|
+
* `action`, `description`, `duration`, `icon`, `onDismiss`, `onAutoClose` as in
|
|
36
|
+
* sonner. `className`, `style`, `richColors` and the per-part `classNames` stay
|
|
37
|
+
* accepted and inert.
|
|
38
|
+
*/
|
|
39
|
+
import { SizableText, View, XStack, YStack, useMedia } from '@hanzo/gui';
|
|
40
|
+
import { Info, SquareCheck, TriangleAlert, X } from '@hanzogui/lucide-icons-2';
|
|
41
|
+
import { Toast, toast, useToasts, } from '@hanzogui/toast/v2';
|
|
42
|
+
import { forwardRef, useEffect, useMemo, useRef, useState } from 'react';
|
|
43
|
+
import { glass } from '../../glass.js';
|
|
44
|
+
import { Button } from './button.js';
|
|
45
|
+
import { paint } from './feedback.js';
|
|
46
|
+
import { slot } from './slot.js';
|
|
47
|
+
/** A toast's default life, ms. */
|
|
48
|
+
export const TOAST_DURATION = 6000;
|
|
49
|
+
const WIDTH = 296;
|
|
50
|
+
const GAP = 8;
|
|
51
|
+
const INSET = 12;
|
|
52
|
+
const STATUS = {
|
|
53
|
+
default: 'neutral',
|
|
54
|
+
loading: 'neutral',
|
|
55
|
+
info: 'info',
|
|
56
|
+
success: 'success',
|
|
57
|
+
warning: 'warning',
|
|
58
|
+
error: 'error',
|
|
59
|
+
};
|
|
60
|
+
const ICON = {
|
|
61
|
+
neutral: TriangleAlert,
|
|
62
|
+
info: Info,
|
|
63
|
+
success: SquareCheck,
|
|
64
|
+
warning: TriangleAlert,
|
|
65
|
+
error: TriangleAlert,
|
|
66
|
+
};
|
|
67
|
+
const read = (v) => (typeof v === 'function' ? v() : v);
|
|
68
|
+
/** The progress a toast carries in `data.progress`, 0–100, if it carries one. */
|
|
69
|
+
const progressOf = (t) => {
|
|
70
|
+
const p = t.data?.progress;
|
|
71
|
+
return typeof p === 'number' && Number.isFinite(p) ? Math.max(0, Math.min(100, p)) : null;
|
|
72
|
+
};
|
|
73
|
+
/** The frame every toast wears: the floating material, 296 wide. */
|
|
74
|
+
const frame = (phone) => ({
|
|
75
|
+
...glass(2),
|
|
76
|
+
width: phone ? '100%' : WIDTH,
|
|
77
|
+
rounded: phone ? 0 : '$3',
|
|
78
|
+
borderWidth: 0,
|
|
79
|
+
p: 0,
|
|
80
|
+
overflow: 'hidden',
|
|
81
|
+
});
|
|
82
|
+
/**
|
|
83
|
+
* The body inside it, padded 8 8 4 and holding the fill. It is the body that
|
|
84
|
+
* hears the pointer and the focus: gui's item does not hand its own hover
|
|
85
|
+
* handlers on (measured — a pointer over the item reached none of them), and
|
|
86
|
+
* the body covers the whole toast.
|
|
87
|
+
*/
|
|
88
|
+
const body = { position: 'relative', pt: '$2', px: '$2', pb: '$1' };
|
|
89
|
+
/**
|
|
90
|
+
* What a toast shows, without the stack around it: the fill, the header, the
|
|
91
|
+
* description and the footer. `Toaster` draws one inside each gui item; the
|
|
92
|
+
* gallery draws one alone so its rules ship in the sheet.
|
|
93
|
+
*/
|
|
94
|
+
export function ToastFace({ t, duration, paused = false, onClose, onHold }) {
|
|
95
|
+
const status = STATUS[t.type ?? 'default'] ?? 'neutral';
|
|
96
|
+
const p = paint(status);
|
|
97
|
+
const Icon = ICON[status];
|
|
98
|
+
const progress = progressOf(t);
|
|
99
|
+
const title = read(t.title);
|
|
100
|
+
const description = t.description ? read(t.description) : null;
|
|
101
|
+
return (_jsxs(YStack, { ...slot('toast-body'), ...body, ...(onHold
|
|
102
|
+
? {
|
|
103
|
+
onHoverIn: () => onHold(true),
|
|
104
|
+
onHoverOut: () => onHold(false),
|
|
105
|
+
onFocus: () => onHold(true),
|
|
106
|
+
onBlur: () => onHold(false),
|
|
107
|
+
}
|
|
108
|
+
: null), children: [progress !== null ? (_jsx(View, { ...slot('toast-progress'), position: "absolute", t: 0, l: 0, b: 0, bg: p.tint, style: { width: `${progress}%`, transition: 'width 300ms linear' }, pointerEvents: "none" })) : duration !== undefined ? (_jsx(View, { ...slot('toast-countdown'), "data-motion": "drain", "data-paused": paused ? '' : undefined, position: "absolute", t: 0, l: 0, r: 0, b: 0, bg: p.tint, pointerEvents: "none", style: { ['--drain']: `${duration}ms` } })) : null, _jsxs(XStack, { ...slot('toast-header'), items: "center", gap: "$2", mb: "$1", minH: 24, children: [_jsx(View, { shrink: 0, width: 16, height: 16, items: "center", justify: "center", children: t.icon ?? _jsx(Icon, { size: 16, color: p.ink, "aria-label": status }) }), _jsx(SizableText, { ...slot('toast-message'), flex: 1, size: "$1", fontWeight: "500", color: "$aside", numberOfLines: 2, children: title }), t.cancel ? (_jsx(Button, { ...slot('toast-cancel'), size: "xs", variant: "ghost", fontWeight: "400", onPress: (e) => {
|
|
109
|
+
t.cancel?.onClick?.(e);
|
|
110
|
+
onClose?.();
|
|
111
|
+
}, children: t.cancel.label || 'Cancel' })) : null, t.dismissible === false ? null : (_jsx(Button, { ...slot('toast-close'), size: "icon-xs", variant: "ghost", emphasis: "subtle", "aria-label": "Close", onPress: onClose, children: _jsx(X, {}) }))] }), description ? (_jsx(SizableText, { ...slot('toast-description'), size: "$1", color: "$hint", pl: 24, maxW: 224, numberOfLines: 1, mb: "$1", children: description })) : null, t.action ? (_jsx(YStack, { ...slot('toast-footer'), mt: "$2", borderTopWidth: 1, borderColor: "$borderColor", pt: "$1", items: "flex-end", children: _jsx(Button, { size: "xs", variant: "ghost", onPress: (e) => {
|
|
112
|
+
t.action?.onClick?.(e);
|
|
113
|
+
if (!e?.defaultPrevented)
|
|
114
|
+
onClose?.();
|
|
115
|
+
}, children: t.action.label }) })) : null] }));
|
|
116
|
+
}
|
|
117
|
+
/** A toast at rest, outside any stack — the gallery's, and a docs page's. */
|
|
118
|
+
export function ToastCard({ phone = false, ...props }) {
|
|
119
|
+
return (_jsx(YStack, { ...slot('toast'), position: "relative", ...frame(phone), children: _jsx(ToastFace, { ...props }) }));
|
|
120
|
+
}
|
|
121
|
+
function ToastItem({ t, index, fallback, phone, }) {
|
|
122
|
+
const progress = progressOf(t);
|
|
123
|
+
const duration = t.duration ?? fallback;
|
|
124
|
+
const timed = progress === null && t.type !== 'loading' && Number.isFinite(duration) && duration > 0;
|
|
125
|
+
const [paused, setPaused] = useState(false);
|
|
126
|
+
const remaining = useRef(duration);
|
|
127
|
+
const done = useRef(false);
|
|
128
|
+
// The one clock: the fill drains on it and the toast closes on it. Once:
|
|
129
|
+
// the dismissal re-renders the item with a new toast object, and the clock
|
|
130
|
+
// must not start over on it.
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (!timed || paused || done.current)
|
|
133
|
+
return;
|
|
134
|
+
const start = Date.now();
|
|
135
|
+
const id = setTimeout(() => {
|
|
136
|
+
done.current = true;
|
|
137
|
+
t.onAutoClose?.(t);
|
|
138
|
+
toast.dismiss(t.id);
|
|
139
|
+
}, remaining.current);
|
|
140
|
+
return () => {
|
|
141
|
+
clearTimeout(id);
|
|
142
|
+
remaining.current = Math.max(0, remaining.current - (Date.now() - start));
|
|
143
|
+
};
|
|
144
|
+
}, [timed, paused, t]);
|
|
145
|
+
// gui sees an untimed toast, so its own clock never fires (see the header).
|
|
146
|
+
const held = useMemo(() => ({ ...t, duration: Number.POSITIVE_INFINITY }), [t]);
|
|
147
|
+
const close = () => {
|
|
148
|
+
t.onDismiss?.(t);
|
|
149
|
+
toast.dismiss(t.id);
|
|
150
|
+
};
|
|
151
|
+
return (_jsx(Toast.Item, { toast: held, index: index, ...frame(phone), "data-status": STATUS[t.type ?? 'default'] ?? 'neutral', children: _jsx(ToastFace, { t: t, duration: timed ? duration : undefined, paused: paused, onClose: close, onHold: setPaused }) }));
|
|
152
|
+
}
|
|
153
|
+
/** Closes the oldest once more than `limit` are on screen. */
|
|
154
|
+
function Limit({ limit }) {
|
|
155
|
+
const { toasts } = useToasts();
|
|
156
|
+
const live = toasts.filter((t) => !t.delete);
|
|
157
|
+
useEffect(() => {
|
|
158
|
+
// Newest first: the ones past the limit are the oldest.
|
|
159
|
+
for (const t of live.slice(limit))
|
|
160
|
+
toast.dismiss(t.id);
|
|
161
|
+
}, [live, limit]);
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
5
164
|
const Toaster = /* @__PURE__ */ forwardRef(function Toaster(props, ref) {
|
|
6
|
-
const { theme = 'system', toastOptions, richColors: _richColors, ...rest } = props;
|
|
7
|
-
|
|
165
|
+
const { theme = 'system', toastOptions, richColors: _richColors, className: _className, style: _style, position, offset, gap, limit = 3, duration, containerAriaLabel = 'Notifications', hotkey, ...rest } = props;
|
|
166
|
+
const media = useMedia();
|
|
167
|
+
const phone = !!media['max-md'];
|
|
168
|
+
const fallback = toastOptions?.duration ?? duration ?? TOAST_DURATION;
|
|
169
|
+
return (_jsx(Toast, { ...rest, theme: theme, position: position ?? (phone ? 'top-center' : 'bottom-right'), gap: gap ?? GAP, visibleToasts: limit, duration: Number.POSITIVE_INFINITY, children: _jsxs(Toast.Viewport, { ref: ref, ...slot('toaster'), offset: offset ?? (phone ? 0 : INSET), hotkey: hotkey, label: containerAriaLabel, ...(phone ? { width: '100%' } : null), children: [_jsx(Limit, { limit: limit }), _jsx(Toast.List, { renderItem: ({ toast: t, index }) => _jsx(ToastItem, { t: t, index: index, fallback: fallback, phone: phone }, t.id) })] }) }));
|
|
8
170
|
});
|
|
9
171
|
export { Toaster, toast };
|
|
10
172
|
//# sourceMappingURL=toaster.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toaster.js","sourceRoot":"","sources":["../../../src/backends/gui/toaster.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;
|
|
1
|
+
{"version":3,"file":"toaster.js","sourceRoot":"","sources":["../../../src/backends/gui/toaster.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAmB,MAAM,YAAY,CAAA;AACzF,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,EAAE,MAAM,0BAA0B,CAAA;AAC9E,OAAO,EACL,KAAK,EACL,KAAK,EACL,SAAS,GAIV,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AACxF,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,KAAK,EAAuB,MAAM,YAAY,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AA4B7B,kCAAkC;AAClC,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAA;AAClC,MAAM,KAAK,GAAG,GAAG,CAAA;AACjB,MAAM,GAAG,GAAG,CAAC,CAAA;AACb,MAAM,KAAK,GAAG,EAAE,CAAA;AAEhB,MAAM,MAAM,GAAmC;IAC7C,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACf,CAAA;AAED,MAAM,IAAI,GAAwC;IAChD,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,IAAI;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