@hanzo/ui 8.27.91 → 8.29.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-picker.cjs +194 -0
- package/dist/backends/gui/icon-picker.d.ts +51 -0
- package/dist/backends/gui/icon-picker.d.ts.map +1 -0
- package/dist/backends/gui/icon-picker.js +155 -0
- package/dist/backends/gui/icon-picker.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/icons.cjs +381 -0
- package/dist/backends/gui/icons.d.ts +53 -0
- package/dist/backends/gui/icons.d.ts.map +1 -0
- package/dist/backends/gui/icons.js +377 -0
- package/dist/backends/gui/icons.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 +105 -7
- package/dist/backends/gui/index.d.ts +47 -2
- package/dist/backends/gui/index.d.ts.map +1 -1
- package/dist/backends/gui/index.js +37 -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/icons.cjs +19 -0
- package/dist/gallery/icons.d.ts +2 -0
- package/dist/gallery/icons.d.ts.map +1 -0
- package/dist/gallery/icons.js +17 -0
- package/dist/gallery/icons.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 +34 -0
- package/dist/gallery/records.d.ts +2 -0
- package/dist/gallery/records.d.ts.map +1 -0
- package/dist/gallery/records.js +32 -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 +1594 -256
- package/dist/gallery.js +3 -9
- package/dist/gallery.js.map +1 -1
- package/dist/gui-config.cjs +33 -4
- package/dist/gui-config.d.ts +11 -3
- package/dist/gui-config.d.ts.map +1 -1
- package/dist/gui-config.js +33 -4
- package/dist/gui-config.js.map +1 -1
- package/dist/index.cjs +73 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/index.node.cjs +73 -2
- package/dist/index.node.js +10 -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/CONCEPTS.cjs +8 -0
- package/dist/primitives/CONCEPTS.d.ts +2 -0
- package/dist/primitives/CONCEPTS.d.ts.map +1 -0
- package/dist/primitives/CONCEPTS.js +5 -0
- package/dist/primitives/CONCEPTS.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/FIELD_ICONS.cjs +8 -0
- package/dist/primitives/FIELD_ICONS.d.ts +2 -0
- package/dist/primitives/FIELD_ICONS.d.ts.map +1 -0
- package/dist/primitives/FIELD_ICONS.js +5 -0
- package/dist/primitives/FIELD_ICONS.js.map +1 -0
- package/dist/primitives/Glyph.cjs +8 -0
- package/dist/primitives/Glyph.d.ts +2 -0
- package/dist/primitives/Glyph.d.ts.map +1 -0
- package/dist/primitives/Glyph.js +5 -0
- package/dist/primitives/Glyph.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/IconPicker.cjs +8 -0
- package/dist/primitives/IconPicker.d.ts +2 -0
- package/dist/primitives/IconPicker.d.ts.map +1 -0
- package/dist/primitives/IconPicker.js +5 -0
- package/dist/primitives/IconPicker.js.map +1 -0
- 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/TABLER.cjs +8 -0
- package/dist/primitives/TABLER.d.ts +2 -0
- package/dist/primitives/TABLER.d.ts.map +1 -0
- package/dist/primitives/TABLER.js +5 -0
- package/dist/primitives/TABLER.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/iconWords.cjs +8 -0
- package/dist/primitives/iconWords.d.ts +2 -0
- package/dist/primitives/iconWords.d.ts.map +1 -0
- package/dist/primitives/iconWords.js +5 -0
- package/dist/primitives/iconWords.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/loadIcons.cjs +8 -0
- package/dist/primitives/loadIcons.d.ts +2 -0
- package/dist/primitives/loadIcons.d.ts.map +1 -0
- package/dist/primitives/loadIcons.js +5 -0
- package/dist/primitives/loadIcons.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/resolveIcon.cjs +8 -0
- package/dist/primitives/resolveIcon.d.ts +2 -0
- package/dist/primitives/resolveIcon.d.ts.map +1 -0
- package/dist/primitives/resolveIcon.js +5 -0
- package/dist/primitives/resolveIcon.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/primitives/useIcons.cjs +8 -0
- package/dist/primitives/useIcons.d.ts +2 -0
- package/dist/primitives/useIcons.d.ts.map +1 -0
- package/dist/primitives/useIcons.js +5 -0
- package/dist/primitives/useIcons.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 +1460 -127
- package/dist/theme.css +944 -0
- package/package.json +2 -1
|
@@ -68,6 +68,17 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
68
68
|
* draws instead of an outline.
|
|
69
69
|
*
|
|
70
70
|
* Moved here from @hanzo/build, where hanzo.ai's sidebar and asides used it.
|
|
71
|
+
*
|
|
72
|
+
* `bar` draws a handle a person can see before reaching for it (twenty-ui's
|
|
73
|
+
* ResizeHandle, MIT, NOTICE): a pill in the middle of the band, 4×48 on an edge
|
|
74
|
+
* (`edge`) or 3×32 between two panes (`inline`), the raised rung at rest, the
|
|
75
|
+
* soft one under the pointer, and the strong edge while it moves, lengthened by
|
|
76
|
+
* a fifth whenever it is reached for. A drag in progress is cancelled by Escape,
|
|
77
|
+
* which puts the box back where the drag found it. `step` sets the key's step.
|
|
78
|
+
*
|
|
79
|
+
* It is THE standalone resizer: the docked side panel's edge, a drawer's width
|
|
80
|
+
* and an editor's height are a Grip; `ResizableHandle` is the separator inside
|
|
81
|
+
* a `ResizablePanelGroup` and nothing else.
|
|
71
82
|
*/
|
|
72
83
|
const gui_1 = require("@hanzo/gui");
|
|
73
84
|
const React = __importStar(require("react"));
|
|
@@ -78,7 +89,7 @@ const LONG = 32;
|
|
|
78
89
|
const SLACK = 48;
|
|
79
90
|
/** The grab band's thickness, px; the line drawn inside it is 2. */
|
|
80
91
|
const BAND = 8;
|
|
81
|
-
function Grip({ side, span, floor, ceil, reset, onReset, onSpan, onKeep, onShut, label, ...rest }) {
|
|
92
|
+
function Grip({ side, span, floor, ceil, reset, onReset, onSpan, onKeep, onShut, label, bar, step: unit = STEP, ...rest }) {
|
|
82
93
|
const tall = side === 'top';
|
|
83
94
|
/** +1 when the pointer moving away from the pinned edge grows the box. */
|
|
84
95
|
const grows = side === 'right' ? -1 : 1;
|
|
@@ -89,6 +100,8 @@ function Grip({ side, span, floor, ceil, reset, onReset, onSpan, onKeep, onShut,
|
|
|
89
100
|
// keeps nothing.
|
|
90
101
|
const drag = React.useRef('none');
|
|
91
102
|
const want = React.useRef(span);
|
|
103
|
+
// The size the drag began at, for Escape to put back.
|
|
104
|
+
const began = React.useRef(span);
|
|
92
105
|
const frame = React.useRef(0);
|
|
93
106
|
const [hovered, setHovered] = React.useState(false);
|
|
94
107
|
const [keyed, setKeyed] = React.useState(false);
|
|
@@ -119,6 +132,21 @@ function Grip({ side, span, floor, ceil, reset, onReset, onSpan, onKeep, onShut,
|
|
|
119
132
|
if (moved)
|
|
120
133
|
settle(want.current);
|
|
121
134
|
};
|
|
135
|
+
// Escape cancels a drag. The press took no focus (pointerdown is prevented so
|
|
136
|
+
// no text selection starts), so the key arrives at the document, not here.
|
|
137
|
+
React.useEffect(() => {
|
|
138
|
+
if (!moving || typeof window === 'undefined')
|
|
139
|
+
return;
|
|
140
|
+
const cancel = (e) => {
|
|
141
|
+
if (e.key !== 'Escape' || drag.current === 'none')
|
|
142
|
+
return;
|
|
143
|
+
e.preventDefault();
|
|
144
|
+
stop();
|
|
145
|
+
onSpan(began.current);
|
|
146
|
+
};
|
|
147
|
+
window.addEventListener('keydown', cancel, true);
|
|
148
|
+
return () => window.removeEventListener('keydown', cancel, true);
|
|
149
|
+
});
|
|
122
150
|
const wider = side === 'left' ? 'ArrowRight' : side === 'right' ? 'ArrowLeft' : 'ArrowDown';
|
|
123
151
|
const narrower = side === 'left' ? 'ArrowLeft' : side === 'right' ? 'ArrowRight' : 'ArrowUp';
|
|
124
152
|
const edge = tall
|
|
@@ -135,6 +163,7 @@ function Grip({ side, span, floor, ceil, reset, onReset, onSpan, onKeep, onShut,
|
|
|
135
163
|
const now = drawn(e.currentTarget);
|
|
136
164
|
held.current = along(e) - grows * now;
|
|
137
165
|
want.current = clamp(now);
|
|
166
|
+
began.current = clamp(now);
|
|
138
167
|
drag.current = 'held';
|
|
139
168
|
setMoving(true);
|
|
140
169
|
}, onPointerMove: (e) => {
|
|
@@ -158,7 +187,7 @@ function Grip({ side, span, floor, ceil, reset, onReset, onSpan, onKeep, onShut,
|
|
|
158
187
|
},
|
|
159
188
|
// A drag ends when the pointer is let go: lifted, or taken by the browser.
|
|
160
189
|
onPointerUp: end, onPointerCancel: end, onDoubleClick: () => (onReset ? onReset() : settle(clamp(reset ?? span))), onKeyDown: (e) => {
|
|
161
|
-
const step = e.shiftKey ? LONG :
|
|
190
|
+
const step = e.shiftKey ? LONG : unit;
|
|
162
191
|
const now = drawn(e.currentTarget);
|
|
163
192
|
const to = e.key === wider
|
|
164
193
|
? now + step
|
|
@@ -175,5 +204,8 @@ function Grip({ side, span, floor, ceil, reset, onReset, onSpan, onKeep, onShut,
|
|
|
175
204
|
if (onShut && to < floor)
|
|
176
205
|
return onShut();
|
|
177
206
|
settle(clamp(to));
|
|
178
|
-
}, ...rest, children: (0, jsx_runtime_1.jsx)(gui_1.YStack, {
|
|
207
|
+
}, ...rest, children: bar ? ((0, jsx_runtime_1.jsx)(gui_1.YStack, { "data-slot": "grip-bar", ...(() => {
|
|
208
|
+
const [thick, long] = bar === 'edge' ? [4, 48] : [3, 32];
|
|
209
|
+
return tall ? { height: thick, width: long } : { width: thick, height: long };
|
|
210
|
+
})(), self: "center", rounded: "$10", bg: moving ? '$rim' : keyed ? '$outlineColor' : hovered ? '$hint' : '$raised', [tall ? 'scaleX' : 'scaleY']: moving || hovered || keyed ? 1.2 : 1, animation: "quickest", pointerEvents: "none" })) : ((0, jsx_runtime_1.jsx)(gui_1.YStack, { ...(tall ? { height: 2, width: '100%' } : { width: 2, height: '100%' }), rounded: 1, bg: keyed || moving ? '$outlineColor' : hovered ? '$rim' : 'transparent', pointerEvents: "none" })) }));
|
|
179
211
|
}
|
|
@@ -30,6 +30,17 @@
|
|
|
30
30
|
* draws instead of an outline.
|
|
31
31
|
*
|
|
32
32
|
* Moved here from @hanzo/build, where hanzo.ai's sidebar and asides used it.
|
|
33
|
+
*
|
|
34
|
+
* `bar` draws a handle a person can see before reaching for it (twenty-ui's
|
|
35
|
+
* ResizeHandle, MIT, NOTICE): a pill in the middle of the band, 4×48 on an edge
|
|
36
|
+
* (`edge`) or 3×32 between two panes (`inline`), the raised rung at rest, the
|
|
37
|
+
* soft one under the pointer, and the strong edge while it moves, lengthened by
|
|
38
|
+
* a fifth whenever it is reached for. A drag in progress is cancelled by Escape,
|
|
39
|
+
* which puts the box back where the drag found it. `step` sets the key's step.
|
|
40
|
+
*
|
|
41
|
+
* It is THE standalone resizer: the docked side panel's edge, a drawer's width
|
|
42
|
+
* and an editor's height are a Grip; `ResizableHandle` is the separator inside
|
|
43
|
+
* a `ResizablePanelGroup` and nothing else.
|
|
33
44
|
*/
|
|
34
45
|
import { type YStackProps } from '@hanzo/gui';
|
|
35
46
|
import * as React from 'react';
|
|
@@ -46,6 +57,10 @@ export interface GripProps extends Omit<YStackProps, 'children'> {
|
|
|
46
57
|
onShut?: () => void;
|
|
47
58
|
/** The separator's accessible name: "Resize sidebar", "Resize Input". */
|
|
48
59
|
label: string;
|
|
60
|
+
/** A visible handle: `edge` 4×48 on a box's edge, `inline` 3×32 between panes. Absent, the line alone. */
|
|
61
|
+
bar?: 'edge' | 'inline';
|
|
62
|
+
/** A key's step, px (32 with Shift). Default 8. */
|
|
63
|
+
step?: number;
|
|
49
64
|
}
|
|
50
|
-
export declare function Grip({ side, span, floor, ceil, reset, onReset, onSpan, onKeep, onShut, label, ...rest }: GripProps): React.JSX.Element;
|
|
65
|
+
export declare function Grip({ side, span, floor, ceil, reset, onReset, onSpan, onKeep, onShut, label, bar, step: unit, ...rest }: GripProps): React.JSX.Element;
|
|
51
66
|
//# sourceMappingURL=grip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grip.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/grip.tsx"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"grip.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/grip.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAY9B,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAA;AAE/C,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC;IAC9D,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3B,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAA;IACb,0GAA0G;IAC1G,GAAG,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IACvB,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAKD,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,OAAO,EACP,MAAM,EACN,MAAM,EACN,MAAM,EACN,KAAK,EACL,GAAG,EACH,IAAI,EAAE,IAAW,EACjB,GAAG,IAAI,EACR,EAAE,SAAS,qBAsKX"}
|
|
@@ -32,6 +32,17 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
32
32
|
* draws instead of an outline.
|
|
33
33
|
*
|
|
34
34
|
* Moved here from @hanzo/build, where hanzo.ai's sidebar and asides used it.
|
|
35
|
+
*
|
|
36
|
+
* `bar` draws a handle a person can see before reaching for it (twenty-ui's
|
|
37
|
+
* ResizeHandle, MIT, NOTICE): a pill in the middle of the band, 4×48 on an edge
|
|
38
|
+
* (`edge`) or 3×32 between two panes (`inline`), the raised rung at rest, the
|
|
39
|
+
* soft one under the pointer, and the strong edge while it moves, lengthened by
|
|
40
|
+
* a fifth whenever it is reached for. A drag in progress is cancelled by Escape,
|
|
41
|
+
* which puts the box back where the drag found it. `step` sets the key's step.
|
|
42
|
+
*
|
|
43
|
+
* It is THE standalone resizer: the docked side panel's edge, a drawer's width
|
|
44
|
+
* and an editor's height are a Grip; `ResizableHandle` is the separator inside
|
|
45
|
+
* a `ResizablePanelGroup` and nothing else.
|
|
35
46
|
*/
|
|
36
47
|
import { YStack } from '@hanzo/gui';
|
|
37
48
|
import * as React from 'react';
|
|
@@ -42,7 +53,7 @@ const LONG = 32;
|
|
|
42
53
|
const SLACK = 48;
|
|
43
54
|
/** The grab band's thickness, px; the line drawn inside it is 2. */
|
|
44
55
|
const BAND = 8;
|
|
45
|
-
export function Grip({ side, span, floor, ceil, reset, onReset, onSpan, onKeep, onShut, label, ...rest }) {
|
|
56
|
+
export function Grip({ side, span, floor, ceil, reset, onReset, onSpan, onKeep, onShut, label, bar, step: unit = STEP, ...rest }) {
|
|
46
57
|
const tall = side === 'top';
|
|
47
58
|
/** +1 when the pointer moving away from the pinned edge grows the box. */
|
|
48
59
|
const grows = side === 'right' ? -1 : 1;
|
|
@@ -53,6 +64,8 @@ export function Grip({ side, span, floor, ceil, reset, onReset, onSpan, onKeep,
|
|
|
53
64
|
// keeps nothing.
|
|
54
65
|
const drag = React.useRef('none');
|
|
55
66
|
const want = React.useRef(span);
|
|
67
|
+
// The size the drag began at, for Escape to put back.
|
|
68
|
+
const began = React.useRef(span);
|
|
56
69
|
const frame = React.useRef(0);
|
|
57
70
|
const [hovered, setHovered] = React.useState(false);
|
|
58
71
|
const [keyed, setKeyed] = React.useState(false);
|
|
@@ -83,6 +96,21 @@ export function Grip({ side, span, floor, ceil, reset, onReset, onSpan, onKeep,
|
|
|
83
96
|
if (moved)
|
|
84
97
|
settle(want.current);
|
|
85
98
|
};
|
|
99
|
+
// Escape cancels a drag. The press took no focus (pointerdown is prevented so
|
|
100
|
+
// no text selection starts), so the key arrives at the document, not here.
|
|
101
|
+
React.useEffect(() => {
|
|
102
|
+
if (!moving || typeof window === 'undefined')
|
|
103
|
+
return;
|
|
104
|
+
const cancel = (e) => {
|
|
105
|
+
if (e.key !== 'Escape' || drag.current === 'none')
|
|
106
|
+
return;
|
|
107
|
+
e.preventDefault();
|
|
108
|
+
stop();
|
|
109
|
+
onSpan(began.current);
|
|
110
|
+
};
|
|
111
|
+
window.addEventListener('keydown', cancel, true);
|
|
112
|
+
return () => window.removeEventListener('keydown', cancel, true);
|
|
113
|
+
});
|
|
86
114
|
const wider = side === 'left' ? 'ArrowRight' : side === 'right' ? 'ArrowLeft' : 'ArrowDown';
|
|
87
115
|
const narrower = side === 'left' ? 'ArrowLeft' : side === 'right' ? 'ArrowRight' : 'ArrowUp';
|
|
88
116
|
const edge = tall
|
|
@@ -99,6 +127,7 @@ export function Grip({ side, span, floor, ceil, reset, onReset, onSpan, onKeep,
|
|
|
99
127
|
const now = drawn(e.currentTarget);
|
|
100
128
|
held.current = along(e) - grows * now;
|
|
101
129
|
want.current = clamp(now);
|
|
130
|
+
began.current = clamp(now);
|
|
102
131
|
drag.current = 'held';
|
|
103
132
|
setMoving(true);
|
|
104
133
|
}, onPointerMove: (e) => {
|
|
@@ -122,7 +151,7 @@ export function Grip({ side, span, floor, ceil, reset, onReset, onSpan, onKeep,
|
|
|
122
151
|
},
|
|
123
152
|
// A drag ends when the pointer is let go: lifted, or taken by the browser.
|
|
124
153
|
onPointerUp: end, onPointerCancel: end, onDoubleClick: () => (onReset ? onReset() : settle(clamp(reset ?? span))), onKeyDown: (e) => {
|
|
125
|
-
const step = e.shiftKey ? LONG :
|
|
154
|
+
const step = e.shiftKey ? LONG : unit;
|
|
126
155
|
const now = drawn(e.currentTarget);
|
|
127
156
|
const to = e.key === wider
|
|
128
157
|
? now + step
|
|
@@ -139,6 +168,9 @@ export function Grip({ side, span, floor, ceil, reset, onReset, onSpan, onKeep,
|
|
|
139
168
|
if (onShut && to < floor)
|
|
140
169
|
return onShut();
|
|
141
170
|
settle(clamp(to));
|
|
142
|
-
}, ...rest, children: _jsx(YStack, {
|
|
171
|
+
}, ...rest, children: bar ? (_jsx(YStack, { "data-slot": "grip-bar", ...(() => {
|
|
172
|
+
const [thick, long] = bar === 'edge' ? [4, 48] : [3, 32];
|
|
173
|
+
return tall ? { height: thick, width: long } : { width: thick, height: long };
|
|
174
|
+
})(), self: "center", rounded: "$10", bg: moving ? '$rim' : keyed ? '$outlineColor' : hovered ? '$hint' : '$raised', [tall ? 'scaleX' : 'scaleY']: moving || hovered || keyed ? 1.2 : 1, animation: "quickest", pointerEvents: "none" })) : (_jsx(YStack, { ...(tall ? { height: 2, width: '100%' } : { width: 2, height: '100%' }), rounded: 1, bg: keyed || moving ? '$outlineColor' : hovered ? '$rim' : 'transparent', pointerEvents: "none" })) }));
|
|
143
175
|
}
|
|
144
176
|
//# sourceMappingURL=grip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grip.js","sourceRoot":"","sources":["../../../src/backends/gui/grip.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ
|
|
1
|
+
{"version":3,"file":"grip.js","sourceRoot":"","sources":["../../../src/backends/gui/grip.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,EAAE,MAAM,EAAoB,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,kDAAkD;AAClD,MAAM,IAAI,GAAG,CAAC,CAAA;AACd,MAAM,IAAI,GAAG,EAAE,CAAA;AAEf,4GAA4G;AAC5G,MAAM,KAAK,GAAG,EAAE,CAAA;AAEhB,oEAAoE;AACpE,MAAM,IAAI,GAAG,CAAC,CAAA;AAyBd,MAAM,UAAU,IAAI,CAAC,EACnB,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,OAAO,EACP,MAAM,EACN,MAAM,EACN,MAAM,EACN,KAAK,EACL,GAAG,EACH,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,GAAG,IA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,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAEvE,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EACxE,SAAS,EAAC,UAAU,EACpB,aAAa,EAAC,MAAM,GACpB,CACH,CAAC,CAAC,CAAC,CAEF,KAAC,MAAM,OACD,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EACxE,OAAO,EAAE,CAAC,EACV,EAAE,EAAE,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,EACxE,aAAa,EAAC,MAAM,GACpB,CACH,GACM,CACV,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client';"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Heading = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Heading — gui's semantic heading, with a `tone`.
|
|
7
|
+
*
|
|
8
|
+
* Sizes stay gui's own rungs, and the record headings are four of them: a
|
|
9
|
+
* settings section or a widget title is `size="$2"` (13), a group header `$1`
|
|
10
|
+
* (12, also twenty-ui's xs, since 12px is Hanzo's text floor), a dialog or
|
|
11
|
+
* empty-state title `$4` (15) — twenty-ui's xs/sm/md/lg
|
|
12
|
+
* (11/12/13/16, MIT, see NOTICE) on Hanzo's ramp. `tone` is the new axis:
|
|
13
|
+
* primary ink, secondary or tertiary, at the heading's own weight. A styled
|
|
14
|
+
* extension rather than a wrapper, so `styled(Heading, …)` in a host still
|
|
15
|
+
* extends the component it always did.
|
|
16
|
+
*/
|
|
17
|
+
const gui_1 = require("@hanzo/gui");
|
|
18
|
+
exports.Heading = (0, gui_1.styled)(gui_1.Heading, {
|
|
19
|
+
name: 'Heading',
|
|
20
|
+
variants: {
|
|
21
|
+
tone: {
|
|
22
|
+
primary: { color: '$ink' },
|
|
23
|
+
secondary: { color: '$aside' },
|
|
24
|
+
tertiary: { color: '$hint' },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
export declare const Heading: import("@hanzogui/web").GuiComponent<import("@hanzogui/web").TamaDefer, any, import("@hanzogui/web").TextNonStyleProps, import("@hanzogui/web").TextStylePropsBase, {
|
|
3
|
+
size?: import("@hanzogui/web").FontSizeTokens | undefined;
|
|
4
|
+
tone?: "primary" | "secondary" | "tertiary" | undefined;
|
|
5
|
+
unstyled?: boolean | undefined;
|
|
6
|
+
}, import("@hanzogui/web").StaticConfigPublic>;
|
|
7
|
+
export type HeadingProps = ComponentProps<typeof Heading>;
|
|
8
|
+
//# sourceMappingURL=heading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/heading.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C,eAAO,MAAM,OAAO;;;;8CASlB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,OAAO,OAAO,CAAC,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
/**
|
|
3
|
+
* Heading — gui's semantic heading, with a `tone`.
|
|
4
|
+
*
|
|
5
|
+
* Sizes stay gui's own rungs, and the record headings are four of them: a
|
|
6
|
+
* settings section or a widget title is `size="$2"` (13), a group header `$1`
|
|
7
|
+
* (12, also twenty-ui's xs, since 12px is Hanzo's text floor), a dialog or
|
|
8
|
+
* empty-state title `$4` (15) — twenty-ui's xs/sm/md/lg
|
|
9
|
+
* (11/12/13/16, MIT, see NOTICE) on Hanzo's ramp. `tone` is the new axis:
|
|
10
|
+
* primary ink, secondary or tertiary, at the heading's own weight. A styled
|
|
11
|
+
* extension rather than a wrapper, so `styled(Heading, …)` in a host still
|
|
12
|
+
* extends the component it always did.
|
|
13
|
+
*/
|
|
14
|
+
import { Heading as GuiHeading, styled } from '@hanzo/gui';
|
|
15
|
+
export const Heading = styled(GuiHeading, {
|
|
16
|
+
name: 'Heading',
|
|
17
|
+
variants: {
|
|
18
|
+
tone: {
|
|
19
|
+
primary: { color: '$ink' },
|
|
20
|
+
secondary: { color: '$aside' },
|
|
21
|
+
tertiary: { color: '$hint' },
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=heading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heading.js","sourceRoot":"","sources":["../../../src/backends/gui/heading.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAG1D,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE;IACxC,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;YAC1B,SAAS,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE;YAC9B,QAAQ,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;SAC7B;KACO;CACX,CAAC,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.hueOr = exports.isHue = exports.neutrals = exports.hues = void 0;
|
|
5
|
+
exports.useTone = useTone;
|
|
6
|
+
/**
|
|
7
|
+
* A data hue on a component: the colour a person chose for a record, carried as
|
|
8
|
+
* custom properties so the component's rules are written once.
|
|
9
|
+
*
|
|
10
|
+
* A tag, an avatar, an icon tile and a status pill can each take any of thirty
|
|
11
|
+
* hues, and which one is DATA — read from a record at run time. Spelling the
|
|
12
|
+
* hue into each style prop would mint one atomic class per hue per step, every
|
|
13
|
+
* one of which the shipped sheet would have to hold before first paint. So the
|
|
14
|
+
* element states its hue once, inline — `--tone-3: var(--data-red-3)` — and the
|
|
15
|
+
* styled parts read `var(--tone-3)`: one class per step, whatever the hue, and
|
|
16
|
+
* the value still follows the theme, because `--data-red-3` is declared per
|
|
17
|
+
* theme in @hanzo/tokens' data.css.
|
|
18
|
+
*
|
|
19
|
+
* Off the web there are no custom properties, so `tone(step)` hands back the
|
|
20
|
+
* step's own hex for the theme being rendered (from `scales`), and `style` is
|
|
21
|
+
* empty.
|
|
22
|
+
*/
|
|
23
|
+
const gui_1 = require("@hanzo/gui");
|
|
24
|
+
const data_1 = require("@hanzo/tokens/data");
|
|
25
|
+
Object.defineProperty(exports, "hues", { enumerable: true, get: function () { return data_1.hues; } });
|
|
26
|
+
Object.defineProperty(exports, "neutrals", { enumerable: true, get: function () { return data_1.neutrals; } });
|
|
27
|
+
/** Whether `v` names one of the thirty data hues. */
|
|
28
|
+
const isHue = (v) => typeof v === 'string' && Object.hasOwn(data_1.scales, v);
|
|
29
|
+
exports.isHue = isHue;
|
|
30
|
+
/** `v` when it is a hue, `gray` otherwise — an unknown colour reads as the neutral, never as nothing. */
|
|
31
|
+
const hueOr = (v, fallback = 'gray') => ((0, exports.isHue)(v) ? v : fallback);
|
|
32
|
+
exports.hueOr = hueOr;
|
|
33
|
+
/**
|
|
34
|
+
* The hue's steps for one element.
|
|
35
|
+
*
|
|
36
|
+
* `style` goes on the element that roots the part (its children inherit the
|
|
37
|
+
* properties); `tone(step)` is the value a style prop reads.
|
|
38
|
+
*/
|
|
39
|
+
function useTone(hue, steps) {
|
|
40
|
+
const theme = (0, gui_1.useThemeName)();
|
|
41
|
+
if (!gui_1.isWeb) {
|
|
42
|
+
const scale = data_1.scales[hue][String(theme).startsWith('light') ? 'light' : 'dark'];
|
|
43
|
+
return { style: {}, tone: (step) => scale[step - 1] };
|
|
44
|
+
}
|
|
45
|
+
const style = {};
|
|
46
|
+
for (const s of steps)
|
|
47
|
+
style[`--tone-${s}`] = `var(--data-${hue}-${s})`;
|
|
48
|
+
return { style, tone: (step) => `var(--tone-${step})` };
|
|
49
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { hues, neutrals, type DataHue } from '@hanzo/tokens/data';
|
|
2
|
+
export type { DataHue };
|
|
3
|
+
export { hues, neutrals };
|
|
4
|
+
/** Whether `v` names one of the thirty data hues. */
|
|
5
|
+
export declare const isHue: (v: unknown) => v is DataHue;
|
|
6
|
+
/** `v` when it is a hue, `gray` otherwise — an unknown colour reads as the neutral, never as nothing. */
|
|
7
|
+
export declare const hueOr: (v: unknown, fallback?: DataHue) => DataHue;
|
|
8
|
+
/**
|
|
9
|
+
* The hue's steps for one element.
|
|
10
|
+
*
|
|
11
|
+
* `style` goes on the element that roots the part (its children inherit the
|
|
12
|
+
* properties); `tone(step)` is the value a style prop reads.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useTone(hue: DataHue, steps: readonly number[]): {
|
|
15
|
+
style: Record<string, string>;
|
|
16
|
+
tone: (step: number) => string;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=hue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hue.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/hue.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAU,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAEzE,YAAY,EAAE,OAAO,EAAE,CAAA;AACvB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAA;AAEzB,qDAAqD;AACrD,eAAO,MAAM,KAAK,MAAO,OAAO,KAAG,CAAC,IAAI,OAA4D,CAAA;AAEpG,yGAAyG;AACzG,eAAO,MAAM,KAAK,MAAO,OAAO,aAAY,OAAO,KAAY,OAAoC,CAAA;AAEnG;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE;;iBAQ/B,MAAM;EACpC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
/**
|
|
3
|
+
* A data hue on a component: the colour a person chose for a record, carried as
|
|
4
|
+
* custom properties so the component's rules are written once.
|
|
5
|
+
*
|
|
6
|
+
* A tag, an avatar, an icon tile and a status pill can each take any of thirty
|
|
7
|
+
* hues, and which one is DATA — read from a record at run time. Spelling the
|
|
8
|
+
* hue into each style prop would mint one atomic class per hue per step, every
|
|
9
|
+
* one of which the shipped sheet would have to hold before first paint. So the
|
|
10
|
+
* element states its hue once, inline — `--tone-3: var(--data-red-3)` — and the
|
|
11
|
+
* styled parts read `var(--tone-3)`: one class per step, whatever the hue, and
|
|
12
|
+
* the value still follows the theme, because `--data-red-3` is declared per
|
|
13
|
+
* theme in @hanzo/tokens' data.css.
|
|
14
|
+
*
|
|
15
|
+
* Off the web there are no custom properties, so `tone(step)` hands back the
|
|
16
|
+
* step's own hex for the theme being rendered (from `scales`), and `style` is
|
|
17
|
+
* empty.
|
|
18
|
+
*/
|
|
19
|
+
import { isWeb, useThemeName } from '@hanzo/gui';
|
|
20
|
+
import { hues, neutrals, scales } from '@hanzo/tokens/data';
|
|
21
|
+
export { hues, neutrals };
|
|
22
|
+
/** Whether `v` names one of the thirty data hues. */
|
|
23
|
+
export const isHue = (v) => typeof v === 'string' && Object.hasOwn(scales, v);
|
|
24
|
+
/** `v` when it is a hue, `gray` otherwise — an unknown colour reads as the neutral, never as nothing. */
|
|
25
|
+
export const hueOr = (v, fallback = 'gray') => (isHue(v) ? v : fallback);
|
|
26
|
+
/**
|
|
27
|
+
* The hue's steps for one element.
|
|
28
|
+
*
|
|
29
|
+
* `style` goes on the element that roots the part (its children inherit the
|
|
30
|
+
* properties); `tone(step)` is the value a style prop reads.
|
|
31
|
+
*/
|
|
32
|
+
export function useTone(hue, steps) {
|
|
33
|
+
const theme = useThemeName();
|
|
34
|
+
if (!isWeb) {
|
|
35
|
+
const scale = scales[hue][String(theme).startsWith('light') ? 'light' : 'dark'];
|
|
36
|
+
return { style: {}, tone: (step) => scale[step - 1] };
|
|
37
|
+
}
|
|
38
|
+
const style = {};
|
|
39
|
+
for (const s of steps)
|
|
40
|
+
style[`--tone-${s}`] = `var(--data-${hue}-${s})`;
|
|
41
|
+
return { style, tone: (step) => `var(--tone-${step})` };
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=hue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hue.js","sourceRoot":"","sources":["../../../src/backends/gui/hue.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAgB,MAAM,oBAAoB,CAAA;AAGzE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAA;AAEzB,qDAAqD;AACrD,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAU,EAAgB,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AAEpG,yGAAyG;AACzG,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAU,EAAE,QAAQ,GAAY,MAAM,EAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;AAEnG;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,GAAY,EAAE,KAAwB;IAC5D,MAAM,KAAK,GAAG,YAAY,EAAE,CAAA;IAC5B,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;QAC/E,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,CAAA;IAC/D,CAAC;IACD,MAAM,KAAK,GAA2B,EAAE,CAAA;IACxC,KAAK,MAAM,CAAC,IAAI,KAAK;QAAE,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,cAAc,GAAG,IAAI,CAAC,GAAG,CAAA;IACvE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,cAAc,IAAI,GAAG,EAAE,CAAA;AACjE,CAAC"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
'use client';"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.PICKER_W = void 0;
|
|
38
|
+
exports.loadIcons = loadIcons;
|
|
39
|
+
exports.useIcons = useIcons;
|
|
40
|
+
exports.Glyph = Glyph;
|
|
41
|
+
exports.IconPicker = IconPicker;
|
|
42
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
43
|
+
/**
|
|
44
|
+
* Glyph and IconPicker — a stored icon name, drawn; and the grid a person picks
|
|
45
|
+
* one from.
|
|
46
|
+
*
|
|
47
|
+
* Both load Lucide through ONE dynamic import of @hanzogui/lucide-icons-2
|
|
48
|
+
* (`loadIcons`), so a page that never draws a stored icon pays nothing, and a
|
|
49
|
+
* page that does loads one chunk once: every later Glyph reads the module-level
|
|
50
|
+
* cache and draws on its first render. The name is resolved by `resolveIcon`
|
|
51
|
+
* (icons.ts): a Lucide name, a Tabler name with its pair, a same-name match, or
|
|
52
|
+
* the kind's fallback.
|
|
53
|
+
*
|
|
54
|
+
* The picker is the data-model editor's icon picker (twenty-ui's icon picker,
|
|
55
|
+
* MIT, NOTICE): 176 wide, a search field over the names and the concepts each
|
|
56
|
+
* icon draws, and a grid of 32px cells five across, run by the arrows in two
|
|
57
|
+
* dimensions, Home/End, and Enter. It shows the first 150 matches and says how
|
|
58
|
+
* many more a search would narrow to, rather than mounting 1,760 icons at once.
|
|
59
|
+
*/
|
|
60
|
+
const gui_1 = require("@hanzo/gui");
|
|
61
|
+
const react_1 = require("react");
|
|
62
|
+
const button_1 = require("./button.cjs");
|
|
63
|
+
const density_1 = require("./density.cjs");
|
|
64
|
+
const icons_1 = require("./icons.cjs");
|
|
65
|
+
const input_1 = require("./input.cjs");
|
|
66
|
+
const popover_1 = require("./popover.cjs");
|
|
67
|
+
const search_list_1 = require("./search-list.cjs");
|
|
68
|
+
const slot_1 = require("./slot.cjs");
|
|
69
|
+
let cache = null;
|
|
70
|
+
let pending = null;
|
|
71
|
+
/** Every Lucide icon, loaded once, by name. */
|
|
72
|
+
function loadIcons() {
|
|
73
|
+
if (cache)
|
|
74
|
+
return Promise.resolve(cache);
|
|
75
|
+
pending ??= Promise.resolve().then(() => __importStar(require('@hanzogui/lucide-icons-2'))).then((mod) => {
|
|
76
|
+
const table = mod;
|
|
77
|
+
// The barrel exports the icons and nothing else (1,760, each by its name).
|
|
78
|
+
const list = Object.keys(table).filter((k) => /^[A-Z]/.test(k)).sort();
|
|
79
|
+
cache = { names: new Set(list), get: (n) => table[n], list };
|
|
80
|
+
return cache;
|
|
81
|
+
});
|
|
82
|
+
return pending;
|
|
83
|
+
}
|
|
84
|
+
/** The icon set, once it has loaded (`null` until then). */
|
|
85
|
+
function useIcons() {
|
|
86
|
+
const [icons, setIcons] = (0, react_1.useState)(cache);
|
|
87
|
+
(0, react_1.useEffect)(() => {
|
|
88
|
+
if (icons)
|
|
89
|
+
return;
|
|
90
|
+
let live = true;
|
|
91
|
+
loadIcons().then((loaded) => live && setIcons(loaded));
|
|
92
|
+
return () => {
|
|
93
|
+
live = false;
|
|
94
|
+
};
|
|
95
|
+
}, [icons]);
|
|
96
|
+
return icons;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* A stored icon name, drawn. Holds its box while the set loads, so a row of
|
|
100
|
+
* glyphs does not shift when they arrive; draws nothing (and still holds the
|
|
101
|
+
* box) for a name with no icon and no fallback.
|
|
102
|
+
*/
|
|
103
|
+
function Glyph({ name, kind = 'other', size = 16, color }) {
|
|
104
|
+
const icons = useIcons();
|
|
105
|
+
const resolved = icons ? (0, icons_1.resolveIcon)(name, icons.names, kind) : null;
|
|
106
|
+
const Icon = resolved ? icons?.get(resolved) : undefined;
|
|
107
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.XStack, { ...(0, slot_1.slot)('glyph'), width: size, height: size, items: "center", justify: "center", shrink: 0, "aria-hidden": true, children: Icon ? (0, jsx_runtime_1.jsx)(Icon, { size: size, ...(color ? { color } : null) }) : null }));
|
|
108
|
+
}
|
|
109
|
+
const COLUMNS = 5;
|
|
110
|
+
const CELL = 32;
|
|
111
|
+
const GAP = 2;
|
|
112
|
+
const INSET = 4;
|
|
113
|
+
/** Five cells of 32 with 2 between and 4 round: twenty-ui's 176px picker. */
|
|
114
|
+
exports.PICKER_W = INSET * 2 + COLUMNS * CELL + (COLUMNS - 1) * GAP;
|
|
115
|
+
const SHOWN = 150;
|
|
116
|
+
/** The names a query keeps: every word of it in the name or a concept it draws. */
|
|
117
|
+
const filterIcons = (list, q) => {
|
|
118
|
+
const words = q.trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
119
|
+
if (!words.length)
|
|
120
|
+
return [...list];
|
|
121
|
+
return list.filter((n) => {
|
|
122
|
+
const hay = (0, icons_1.iconWords)(n);
|
|
123
|
+
return words.every((w) => hay.includes(w));
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
function IconPicker({ value, onValueChange, kind = 'other', trigger, open: openProp, defaultOpen, onOpenChange, label = 'Icon', searchLabel = 'Search icons', emptyLabel = 'No icon matches', disabled, }) {
|
|
127
|
+
const density = (0, density_1.useDensity)();
|
|
128
|
+
const [open, setOpen] = (0, search_list_1.useOpen)(openProp, defaultOpen, onOpenChange);
|
|
129
|
+
const icons = useIcons();
|
|
130
|
+
const [q, setQ] = (0, react_1.useState)('');
|
|
131
|
+
const [cursor, setCursor] = (0, react_1.useState)(0);
|
|
132
|
+
const grid = (0, react_1.useRef)(null);
|
|
133
|
+
const matches = (0, react_1.useMemo)(() => (icons ? filterIcons(icons.list, q) : []), [icons, q]);
|
|
134
|
+
const shown = matches.slice(0, SHOWN);
|
|
135
|
+
const chosen = icons ? (0, icons_1.resolveIcon)(value, icons.names, kind) : null;
|
|
136
|
+
// A fresh open starts on the chosen icon when it is in view, else the first.
|
|
137
|
+
(0, react_1.useEffect)(() => {
|
|
138
|
+
if (!open)
|
|
139
|
+
return;
|
|
140
|
+
const at = chosen ? shown.indexOf(chosen) : -1;
|
|
141
|
+
setCursor(at >= 0 ? at : 0);
|
|
142
|
+
// Only the opening and a new result set reset the cursor.
|
|
143
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
144
|
+
}, [open, q, icons]);
|
|
145
|
+
(0, react_1.useEffect)(() => {
|
|
146
|
+
if (!open)
|
|
147
|
+
setQ('');
|
|
148
|
+
}, [open]);
|
|
149
|
+
const pick = (name) => {
|
|
150
|
+
onValueChange?.(name);
|
|
151
|
+
setOpen(false);
|
|
152
|
+
};
|
|
153
|
+
const move = (e) => {
|
|
154
|
+
const last = shown.length - 1;
|
|
155
|
+
if (last < 0)
|
|
156
|
+
return;
|
|
157
|
+
const step = { ArrowRight: 1, ArrowLeft: -1, ArrowDown: COLUMNS, ArrowUp: -COLUMNS };
|
|
158
|
+
let next = cursor;
|
|
159
|
+
if (e.key && e.key in step)
|
|
160
|
+
next = Math.min(last, Math.max(0, cursor + step[e.key]));
|
|
161
|
+
else if (e.key === 'Home')
|
|
162
|
+
next = 0;
|
|
163
|
+
else if (e.key === 'End')
|
|
164
|
+
next = last;
|
|
165
|
+
else if (e.key === 'Enter') {
|
|
166
|
+
e.preventDefault?.();
|
|
167
|
+
if (shown[cursor])
|
|
168
|
+
pick(shown[cursor]);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
else
|
|
172
|
+
return;
|
|
173
|
+
e.preventDefault?.();
|
|
174
|
+
setCursor(next);
|
|
175
|
+
};
|
|
176
|
+
(0, react_1.useEffect)(() => {
|
|
177
|
+
const el = grid.current?.querySelector?.(`[data-index="${cursor}"]`);
|
|
178
|
+
el?.scrollIntoView?.({ block: 'nearest' });
|
|
179
|
+
}, [cursor]);
|
|
180
|
+
const ActiveIcon = chosen ? icons?.get(chosen) : undefined;
|
|
181
|
+
const id = `icon-picker-${(0, react_1.useId)().replace(/:/g, '')}`;
|
|
182
|
+
return ((0, jsx_runtime_1.jsxs)(popover_1.Popover, { open: open, onOpenChange: setOpen, placement: "bottom-start", children: [(0, jsx_runtime_1.jsx)(popover_1.PopoverTrigger, { asChild: true, children: trigger ?? ((0, jsx_runtime_1.jsx)(button_1.Button, { size: "icon-sm", variant: "outline", disabled: disabled, "aria-label": chosen ? `${label}: ${chosen}` : label, ...{ 'aria-haspopup': 'listbox' }, children: ActiveIcon ? (0, jsx_runtime_1.jsx)(ActiveIcon, { size: 16 }) : (0, jsx_runtime_1.jsx)(gui_1.XStack, { width: 16, height: 16 }) })) }), (0, jsx_runtime_1.jsx)(popover_1.PopoverContent, { ...(0, slot_1.slot)('icon-picker'), p: 0, width: exports.PICKER_W, sideOffset: 8, overflow: "hidden", children: (0, jsx_runtime_1.jsx)(density_1.Density, { value: density, children: (0, jsx_runtime_1.jsxs)(gui_1.YStack, { children: [(0, jsx_runtime_1.jsx)(gui_1.XStack, { p: INSET, borderBottomWidth: 1, borderColor: "$borderColor", children: (0, jsx_runtime_1.jsx)(input_1.Input, { size: "xs", value: q, onChangeText: (t) => setQ(t), placeholder: searchLabel, "aria-label": searchLabel, "aria-controls": id, "aria-activedescendant": shown[cursor] ? `${id}-${cursor}` : undefined, autoFocus: true, ...{ onKeyDown: move } }) }), !icons ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", color: "$hint", p: "$2", role: "status", "aria-live": "polite", children: "Loading\u2026" })) : shown.length === 0 ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", color: "$hint", p: "$2", role: "status", "aria-live": "polite", children: emptyLabel })) : ((0, jsx_runtime_1.jsx)(gui_1.XStack, { ref: grid, ...(0, slot_1.slot)('icon-picker-grid'), ...{ id, role: 'listbox', 'aria-label': label }, flexWrap: "wrap", gap: GAP, p: INSET, maxH: CELL * 6 + GAP * 5 + INSET * 2, overflow: "scroll", children: shown.map((name, i) => {
|
|
183
|
+
const Icon = icons.get(name);
|
|
184
|
+
const on = name === chosen;
|
|
185
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.XStack, { ...{
|
|
186
|
+
id: `${id}-${i}`,
|
|
187
|
+
role: 'option',
|
|
188
|
+
'aria-selected': on,
|
|
189
|
+
'aria-label': name,
|
|
190
|
+
'data-index': i,
|
|
191
|
+
title: name,
|
|
192
|
+
}, width: CELL, height: CELL, items: "center", justify: "center", rounded: "$xs", cursor: "pointer", bg: i === cursor ? '$hover' : on ? '$raised' : 'transparent', hoverStyle: { bg: '$hover' }, onPress: () => pick(name), children: Icon ? (0, jsx_runtime_1.jsx)(Icon, { size: 16, color: on ? '$ink' : '$aside' }) : null }, name));
|
|
193
|
+
}) })), icons && matches.length > SHOWN ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", color: "$hint", px: "$2", pb: "$2", role: "status", "aria-live": "polite", children: `${matches.length - SHOWN} more — type to narrow` })) : null] }) }) })] }));
|
|
194
|
+
}
|