@stridge/noctis 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -0
- package/dist/_virtual/_rolldown/runtime.js +27 -0
- package/dist/components/accordion/accordion.context.js +15 -0
- package/dist/components/accordion/accordion.d.ts +136 -0
- package/dist/components/accordion/accordion.js +132 -0
- package/dist/components/accordion/accordion.props.d.ts +45 -0
- package/dist/components/accordion/accordion.props.js +53 -0
- package/dist/components/accordion/accordion.slots.d.ts +24 -0
- package/dist/components/accordion/accordion.slots.js +39 -0
- package/dist/components/accordion/accordion.types.d.ts +11 -0
- package/dist/components/accordion/index.d.ts +3 -0
- package/dist/components/alert-dialog/alert-dialog.context.js +16 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +324 -0
- package/dist/components/alert-dialog/alert-dialog.js +279 -0
- package/dist/components/alert-dialog/alert-dialog.props.d.ts +85 -0
- package/dist/components/alert-dialog/alert-dialog.props.js +84 -0
- package/dist/components/alert-dialog/alert-dialog.slots.d.ts +29 -0
- package/dist/components/alert-dialog/alert-dialog.slots.js +52 -0
- package/dist/components/alert-dialog/alert-dialog.types.d.ts +22 -0
- package/dist/components/alert-dialog/index.d.ts +3 -0
- package/dist/components/autocomplete/autocomplete.context.d.ts +5 -0
- package/dist/components/autocomplete/autocomplete.context.js +13 -0
- package/dist/components/autocomplete/autocomplete.d.ts +364 -0
- package/dist/components/autocomplete/autocomplete.js +373 -0
- package/dist/components/autocomplete/autocomplete.props.d.ts +83 -0
- package/dist/components/autocomplete/autocomplete.props.js +63 -0
- package/dist/components/autocomplete/autocomplete.slots.d.ts +32 -0
- package/dist/components/autocomplete/autocomplete.slots.js +61 -0
- package/dist/components/autocomplete/index.d.ts +3 -0
- package/dist/components/avatar/avatar.context.js +21 -0
- package/dist/components/avatar/avatar.d.ts +235 -0
- package/dist/components/avatar/avatar.js +208 -0
- package/dist/components/avatar/avatar.props.d.ts +86 -0
- package/dist/components/avatar/avatar.props.js +78 -0
- package/dist/components/avatar/avatar.slots.d.ts +35 -0
- package/dist/components/avatar/avatar.slots.js +49 -0
- package/dist/components/avatar/avatar.types.d.ts +28 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/button/button.d.ts +91 -0
- package/dist/components/button/button.js +82 -0
- package/dist/components/button/button.props.d.ts +48 -0
- package/dist/components/button/button.props.js +25 -0
- package/dist/components/button/button.slots.d.ts +30 -0
- package/dist/components/button/button.slots.js +40 -0
- package/dist/components/button/button.types.d.ts +12 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button-group/button-group.context.js +15 -0
- package/dist/components/button-group/button-group.d.ts +60 -0
- package/dist/components/button-group/button-group.js +50 -0
- package/dist/components/button-group/button-group.props.d.ts +22 -0
- package/dist/components/button-group/button-group.props.js +33 -0
- package/dist/components/button-group/button-group.slots.d.ts +12 -0
- package/dist/components/button-group/button-group.slots.js +18 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/checkbox/checkbox-group.d.ts +46 -0
- package/dist/components/checkbox/checkbox-group.js +31 -0
- package/dist/components/checkbox/checkbox.context.js +15 -0
- package/dist/components/checkbox/checkbox.d.ts +130 -0
- package/dist/components/checkbox/checkbox.js +117 -0
- package/dist/components/checkbox/checkbox.props.d.ts +84 -0
- package/dist/components/checkbox/checkbox.props.js +49 -0
- package/dist/components/checkbox/checkbox.slots.d.ts +27 -0
- package/dist/components/checkbox/checkbox.slots.js +40 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/code-block/brand-logo.d.ts +37 -0
- package/dist/components/code-block/brand-logo.js +212 -0
- package/dist/components/code-block/code-block.context.js +13 -0
- package/dist/components/code-block/code-block.d.ts +190 -0
- package/dist/components/code-block/code-block.js +267 -0
- package/dist/components/code-block/code-block.props.d.ts +42 -0
- package/dist/components/code-block/code-block.props.js +51 -0
- package/dist/components/code-block/code-block.slots.d.ts +16 -0
- package/dist/components/code-block/code-block.slots.js +31 -0
- package/dist/components/code-block/index.d.ts +3 -0
- package/dist/components/code-block/language-label.js +43 -0
- package/dist/components/collapsible/collapsible.context.js +18 -0
- package/dist/components/collapsible/collapsible.d.ts +167 -0
- package/dist/components/collapsible/collapsible.js +182 -0
- package/dist/components/collapsible/collapsible.props.d.ts +33 -0
- package/dist/components/collapsible/collapsible.props.js +44 -0
- package/dist/components/collapsible/collapsible.slots.d.ts +25 -0
- package/dist/components/collapsible/collapsible.slots.js +40 -0
- package/dist/components/collapsible/collapsible.types.d.ts +23 -0
- package/dist/components/collapsible/index.d.ts +2 -0
- package/dist/components/color-picker/area.d.ts +11 -0
- package/dist/components/color-picker/area.js +148 -0
- package/dist/components/color-picker/color-picker.d.ts +110 -0
- package/dist/components/color-picker/color-picker.js +149 -0
- package/dist/components/color-picker/color-picker.props.d.ts +69 -0
- package/dist/components/color-picker/color-picker.props.js +74 -0
- package/dist/components/color-picker/color-picker.slots.js +21 -0
- package/dist/components/color-picker/color.d.ts +18 -0
- package/dist/components/color-picker/color.js +224 -0
- package/dist/components/color-picker/context.d.ts +25 -0
- package/dist/components/color-picker/context.js +23 -0
- package/dist/components/color-picker/eyedropper.d.ts +14 -0
- package/dist/components/color-picker/eyedropper.js +50 -0
- package/dist/components/color-picker/format-tabs.d.ts +11 -0
- package/dist/components/color-picker/format-tabs.js +35 -0
- package/dist/components/color-picker/index.d.ts +3 -0
- package/dist/components/color-picker/inputs.d.ts +16 -0
- package/dist/components/color-picker/inputs.js +61 -0
- package/dist/components/color-picker/sliders.d.ts +17 -0
- package/dist/components/color-picker/sliders.js +94 -0
- package/dist/components/color-picker/store.js +48 -0
- package/dist/components/color-picker/swatch.d.ts +15 -0
- package/dist/components/color-picker/swatch.js +25 -0
- package/dist/components/color-swatch/color-swatch-picker.d.ts +87 -0
- package/dist/components/color-swatch/color-swatch-picker.js +73 -0
- package/dist/components/color-swatch/color-swatch.context.js +8 -0
- package/dist/components/color-swatch/color-swatch.d.ts +55 -0
- package/dist/components/color-swatch/color-swatch.js +48 -0
- package/dist/components/color-swatch/color-swatch.props.d.ts +54 -0
- package/dist/components/color-swatch/color-swatch.props.js +32 -0
- package/dist/components/color-swatch/color-swatch.slots.js +13 -0
- package/dist/components/color-swatch/index.d.ts +2 -0
- package/dist/components/combobox/combobox.context.js +13 -0
- package/dist/components/combobox/combobox.d.ts +328 -0
- package/dist/components/combobox/combobox.js +315 -0
- package/dist/components/combobox/combobox.props.d.ts +85 -0
- package/dist/components/combobox/combobox.props.js +79 -0
- package/dist/components/combobox/combobox.slots.d.ts +28 -0
- package/dist/components/combobox/combobox.slots.js +63 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/context-menu/context-menu.d.ts +254 -0
- package/dist/components/context-menu/context-menu.js +150 -0
- package/dist/components/context-menu/context-menu.props.d.ts +22 -0
- package/dist/components/context-menu/context-menu.props.js +32 -0
- package/dist/components/context-menu/context-menu.slots.d.ts +24 -0
- package/dist/components/context-menu/context-menu.slots.js +42 -0
- package/dist/components/context-menu/index.d.ts +2 -0
- package/dist/components/copy-button/copy-button.d.ts +56 -0
- package/dist/components/copy-button/copy-button.js +88 -0
- package/dist/components/copy-button/copy-button.props.d.ts +27 -0
- package/dist/components/copy-button/copy-button.props.js +51 -0
- package/dist/components/copy-button/copy-button.slots.d.ts +20 -0
- package/dist/components/copy-button/copy-button.slots.js +36 -0
- package/dist/components/copy-button/index.d.ts +2 -0
- package/dist/components/dialog/dialog.context.js +15 -0
- package/dist/components/dialog/dialog.d.ts +299 -0
- package/dist/components/dialog/dialog.js +263 -0
- package/dist/components/dialog/dialog.props.d.ts +71 -0
- package/dist/components/dialog/dialog.props.js +75 -0
- package/dist/components/dialog/dialog.slots.d.ts +26 -0
- package/dist/components/dialog/dialog.slots.js +46 -0
- package/dist/components/dialog/dialog.types.d.ts +16 -0
- package/dist/components/dialog/index.d.ts +3 -0
- package/dist/components/field/field.d.ts +221 -0
- package/dist/components/field/field.js +192 -0
- package/dist/components/field/field.props.d.ts +66 -0
- package/dist/components/field/field.props.js +65 -0
- package/dist/components/field/field.slots.d.ts +35 -0
- package/dist/components/field/field.slots.js +54 -0
- package/dist/components/field/field.types.d.ts +5 -0
- package/dist/components/field/index.d.ts +4 -0
- package/dist/components/inline-code/index.d.ts +1 -0
- package/dist/components/inline-code/inline-code.d.ts +46 -0
- package/dist/components/inline-code/inline-code.js +36 -0
- package/dist/components/inline-code/inline-code.props.d.ts +17 -0
- package/dist/components/inline-code/inline-code.props.js +27 -0
- package/dist/components/inline-code/inline-code.slots.js +8 -0
- package/dist/components/input/index.d.ts +3 -0
- package/dist/components/input/input.context.js +13 -0
- package/dist/components/input/input.d.ts +161 -0
- package/dist/components/input/input.js +117 -0
- package/dist/components/input/input.props.d.ts +51 -0
- package/dist/components/input/input.props.js +50 -0
- package/dist/components/input/input.slots.d.ts +35 -0
- package/dist/components/input/input.slots.js +46 -0
- package/dist/components/input/input.types.d.ts +12 -0
- package/dist/components/kbd/glyphs.js +45 -0
- package/dist/components/kbd/index.d.ts +1 -0
- package/dist/components/kbd/kbd.d.ts +61 -0
- package/dist/components/kbd/kbd.js +233 -0
- package/dist/components/kbd/kbd.props.d.ts +30 -0
- package/dist/components/kbd/kbd.props.js +39 -0
- package/dist/components/kbd/kbd.slots.js +14 -0
- package/dist/components/kbd/use-apple-platform.js +25 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/menu.d.ts +355 -0
- package/dist/components/menu/menu.js +263 -0
- package/dist/components/menu/menu.props.d.ts +92 -0
- package/dist/components/menu/menu.props.js +97 -0
- package/dist/components/menu/menu.slots.d.ts +32 -0
- package/dist/components/menu/menu.slots.js +60 -0
- package/dist/components/menubar/index.d.ts +2 -0
- package/dist/components/menubar/menubar.context.js +13 -0
- package/dist/components/menubar/menubar.d.ts +162 -0
- package/dist/components/menubar/menubar.js +122 -0
- package/dist/components/menubar/menubar.props.d.ts +41 -0
- package/dist/components/menubar/menubar.props.js +45 -0
- package/dist/components/menubar/menubar.slots.d.ts +26 -0
- package/dist/components/menubar/menubar.slots.js +40 -0
- package/dist/components/meter/index.d.ts +2 -0
- package/dist/components/meter/meter.context.d.ts +9 -0
- package/dist/components/meter/meter.context.js +13 -0
- package/dist/components/meter/meter.d.ts +163 -0
- package/dist/components/meter/meter.js +121 -0
- package/dist/components/meter/meter.props.d.ts +50 -0
- package/dist/components/meter/meter.props.js +33 -0
- package/dist/components/meter/meter.slots.d.ts +18 -0
- package/dist/components/meter/meter.slots.js +31 -0
- package/dist/components/navigation-menu/index.d.ts +2 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +328 -0
- package/dist/components/navigation-menu/navigation-menu.js +274 -0
- package/dist/components/navigation-menu/navigation-menu.props.d.ts +98 -0
- package/dist/components/navigation-menu/navigation-menu.props.js +90 -0
- package/dist/components/navigation-menu/navigation-menu.slots.d.ts +34 -0
- package/dist/components/navigation-menu/navigation-menu.slots.js +60 -0
- package/dist/components/number-field/index.d.ts +2 -0
- package/dist/components/number-field/number-field.context.d.ts +13 -0
- package/dist/components/number-field/number-field.context.js +13 -0
- package/dist/components/number-field/number-field.d.ts +197 -0
- package/dist/components/number-field/number-field.js +187 -0
- package/dist/components/number-field/number-field.props.d.ts +66 -0
- package/dist/components/number-field/number-field.props.js +50 -0
- package/dist/components/number-field/number-field.slots.d.ts +31 -0
- package/dist/components/number-field/number-field.slots.js +48 -0
- package/dist/components/otp-field/index.d.ts +3 -0
- package/dist/components/otp-field/otp-field.context.js +13 -0
- package/dist/components/otp-field/otp-field.d.ts +99 -0
- package/dist/components/otp-field/otp-field.js +76 -0
- package/dist/components/otp-field/otp-field.props.d.ts +48 -0
- package/dist/components/otp-field/otp-field.props.js +43 -0
- package/dist/components/otp-field/otp-field.slots.d.ts +28 -0
- package/dist/components/otp-field/otp-field.slots.js +39 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/popover.d.ts +192 -0
- package/dist/components/popover/popover.js +152 -0
- package/dist/components/popover/popover.props.d.ts +34 -0
- package/dist/components/popover/popover.props.js +44 -0
- package/dist/components/popover/popover.slots.d.ts +22 -0
- package/dist/components/popover/popover.slots.js +42 -0
- package/dist/components/preview-card/index.d.ts +2 -0
- package/dist/components/preview-card/preview-card.d.ts +182 -0
- package/dist/components/preview-card/preview-card.js +146 -0
- package/dist/components/preview-card/preview-card.props.d.ts +37 -0
- package/dist/components/preview-card/preview-card.props.js +48 -0
- package/dist/components/preview-card/preview-card.slots.d.ts +22 -0
- package/dist/components/preview-card/preview-card.slots.js +39 -0
- package/dist/components/progress/index.d.ts +3 -0
- package/dist/components/progress/progress.context.d.ts +9 -0
- package/dist/components/progress/progress.context.js +13 -0
- package/dist/components/progress/progress.d.ts +139 -0
- package/dist/components/progress/progress.js +92 -0
- package/dist/components/progress/progress.props.d.ts +56 -0
- package/dist/components/progress/progress.props.js +38 -0
- package/dist/components/progress/progress.slots.d.ts +24 -0
- package/dist/components/progress/progress.slots.js +37 -0
- package/dist/components/radio/index.d.ts +2 -0
- package/dist/components/radio/radio.context.js +5 -0
- package/dist/components/radio/radio.d.ts +205 -0
- package/dist/components/radio/radio.js +168 -0
- package/dist/components/radio/radio.props.d.ts +106 -0
- package/dist/components/radio/radio.props.js +65 -0
- package/dist/components/radio/radio.slots.d.ts +29 -0
- package/dist/components/radio/radio.slots.js +44 -0
- package/dist/components/rail/index.d.ts +3 -0
- package/dist/components/rail/rail.context.d.ts +17 -0
- package/dist/components/rail/rail.context.js +23 -0
- package/dist/components/rail/rail.d.ts +232 -0
- package/dist/components/rail/rail.js +254 -0
- package/dist/components/rail/rail.props.d.ts +98 -0
- package/dist/components/rail/rail.props.js +64 -0
- package/dist/components/rail/rail.slots.d.ts +20 -0
- package/dist/components/rail/rail.slots.js +40 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/scroll-area.context.js +15 -0
- package/dist/components/scroll-area/scroll-area.d.ts +217 -0
- package/dist/components/scroll-area/scroll-area.js +153 -0
- package/dist/components/scroll-area/scroll-area.props.d.ts +73 -0
- package/dist/components/scroll-area/scroll-area.props.js +64 -0
- package/dist/components/scroll-area/scroll-area.slots.d.ts +40 -0
- package/dist/components/scroll-area/scroll-area.slots.js +54 -0
- package/dist/components/scroll-area/scroll-area.types.d.ts +24 -0
- package/dist/components/search-dialog/index.d.ts +3 -0
- package/dist/components/search-dialog/parts/input.d.ts +24 -0
- package/dist/components/search-dialog/parts/input.js +53 -0
- package/dist/components/search-dialog/parts/messages.d.ts +80 -0
- package/dist/components/search-dialog/parts/messages.js +75 -0
- package/dist/components/search-dialog/parts/results.d.ts +43 -0
- package/dist/components/search-dialog/parts/results.js +63 -0
- package/dist/components/search-dialog/parts/root.d.ts +54 -0
- package/dist/components/search-dialog/parts/root.js +99 -0
- package/dist/components/search-dialog/search-dialog.context.d.ts +15 -0
- package/dist/components/search-dialog/search-dialog.context.js +20 -0
- package/dist/components/search-dialog/search-dialog.d.ts +84 -0
- package/dist/components/search-dialog/search-dialog.js +43 -0
- package/dist/components/search-dialog/search-dialog.props.d.ts +45 -0
- package/dist/components/search-dialog/search-dialog.props.js +49 -0
- package/dist/components/search-dialog/search-dialog.slots.d.ts +16 -0
- package/dist/components/search-dialog/search-dialog.slots.js +32 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/select.context.js +17 -0
- package/dist/components/select/select.d.ts +356 -0
- package/dist/components/select/select.js +314 -0
- package/dist/components/select/select.props.d.ts +110 -0
- package/dist/components/select/select.props.js +103 -0
- package/dist/components/select/select.slots.d.ts +38 -0
- package/dist/components/select/select.slots.js +67 -0
- package/dist/components/separator/index.d.ts +2 -0
- package/dist/components/separator/separator.d.ts +69 -0
- package/dist/components/separator/separator.js +44 -0
- package/dist/components/separator/separator.props.d.ts +30 -0
- package/dist/components/separator/separator.props.js +30 -0
- package/dist/components/separator/separator.slots.d.ts +22 -0
- package/dist/components/separator/separator.slots.js +21 -0
- package/dist/components/separator/separator.types.d.ts +5 -0
- package/dist/components/sheet/index.d.ts +3 -0
- package/dist/components/sheet/sheet-stack.d.ts +106 -0
- package/dist/components/sheet/sheet-stack.js +146 -0
- package/dist/components/sheet/sheet.d.ts +279 -0
- package/dist/components/sheet/sheet.js +264 -0
- package/dist/components/sheet/sheet.props.d.ts +74 -0
- package/dist/components/sheet/sheet.props.js +77 -0
- package/dist/components/sheet/sheet.slots.js +22 -0
- package/dist/components/sheet/sheet.types.d.ts +12 -0
- package/dist/components/slider/index.d.ts +3 -0
- package/dist/components/slider/slider.context.d.ts +5 -0
- package/dist/components/slider/slider.context.js +29 -0
- package/dist/components/slider/slider.d.ts +230 -0
- package/dist/components/slider/slider.js +274 -0
- package/dist/components/slider/slider.props.d.ts +72 -0
- package/dist/components/slider/slider.props.js +59 -0
- package/dist/components/slider/slider.slots.d.ts +30 -0
- package/dist/components/slider/slider.slots.js +50 -0
- package/dist/components/surface/index.d.ts +1 -0
- package/dist/components/surface/surface.d.ts +84 -0
- package/dist/components/surface/surface.js +48 -0
- package/dist/components/surface/surface.props.d.ts +35 -0
- package/dist/components/surface/surface.props.js +26 -0
- package/dist/components/surface/surface.slots.js +9 -0
- package/dist/components/surface/surface.types.d.ts +14 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/switch.context.js +14 -0
- package/dist/components/switch/switch.d.ts +110 -0
- package/dist/components/switch/switch.js +92 -0
- package/dist/components/switch/switch.props.d.ts +68 -0
- package/dist/components/switch/switch.props.js +41 -0
- package/dist/components/switch/switch.slots.d.ts +23 -0
- package/dist/components/switch/switch.slots.js +35 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/table.d.ts +104 -0
- package/dist/components/table/table.js +92 -0
- package/dist/components/table/table.props.d.ts +38 -0
- package/dist/components/table/table.props.js +49 -0
- package/dist/components/table/table.slots.js +17 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/tabs.context.d.ts +9 -0
- package/dist/components/tabs/tabs.context.js +13 -0
- package/dist/components/tabs/tabs.d.ts +139 -0
- package/dist/components/tabs/tabs.js +118 -0
- package/dist/components/tabs/tabs.props.d.ts +59 -0
- package/dist/components/tabs/tabs.props.js +39 -0
- package/dist/components/tabs/tabs.slots.d.ts +20 -0
- package/dist/components/tabs/tabs.slots.js +33 -0
- package/dist/components/textarea/index.d.ts +3 -0
- package/dist/components/textarea/textarea.context.js +13 -0
- package/dist/components/textarea/textarea.d.ts +142 -0
- package/dist/components/textarea/textarea.js +129 -0
- package/dist/components/textarea/textarea.props.d.ts +44 -0
- package/dist/components/textarea/textarea.props.js +32 -0
- package/dist/components/textarea/textarea.slots.d.ts +23 -0
- package/dist/components/textarea/textarea.slots.js +33 -0
- package/dist/components/textarea/textarea.types.d.ts +5 -0
- package/dist/components/toast/index.d.ts +4 -0
- package/dist/components/toast/toast.d.ts +241 -0
- package/dist/components/toast/toast.js +193 -0
- package/dist/components/toast/toast.manager.d.ts +76 -0
- package/dist/components/toast/toast.manager.js +71 -0
- package/dist/components/toast/toast.props.d.ts +66 -0
- package/dist/components/toast/toast.props.js +74 -0
- package/dist/components/toast/toast.slots.d.ts +30 -0
- package/dist/components/toast/toast.slots.js +49 -0
- package/dist/components/toast/toast.types.d.ts +19 -0
- package/dist/components/toggle/index.d.ts +2 -0
- package/dist/components/toggle/toggle.context.d.ts +11 -0
- package/dist/components/toggle/toggle.context.js +14 -0
- package/dist/components/toggle/toggle.d.ts +136 -0
- package/dist/components/toggle/toggle.js +101 -0
- package/dist/components/toggle/toggle.props.d.ts +51 -0
- package/dist/components/toggle/toggle.props.js +29 -0
- package/dist/components/toggle/toggle.slots.d.ts +26 -0
- package/dist/components/toggle/toggle.slots.js +36 -0
- package/dist/components/toolbar/index.d.ts +3 -0
- package/dist/components/toolbar/toolbar.context.js +23 -0
- package/dist/components/toolbar/toolbar.d.ts +218 -0
- package/dist/components/toolbar/toolbar.js +197 -0
- package/dist/components/toolbar/toolbar.props.d.ts +54 -0
- package/dist/components/toolbar/toolbar.props.js +55 -0
- package/dist/components/toolbar/toolbar.slots.d.ts +24 -0
- package/dist/components/toolbar/toolbar.slots.js +37 -0
- package/dist/components/toolbar/toolbar.types.d.ts +15 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/tooltip.d.ts +170 -0
- package/dist/components/tooltip/tooltip.js +143 -0
- package/dist/components/tooltip/tooltip.props.d.ts +36 -0
- package/dist/components/tooltip/tooltip.props.js +42 -0
- package/dist/components/tooltip/tooltip.slots.d.ts +26 -0
- package/dist/components/tooltip/tooltip.slots.js +42 -0
- package/dist/core/derive-threshold-tone.js +35 -0
- package/dist/core/merge-class-name.d.ts +17 -0
- package/dist/core/merge-class-name.js +16 -0
- package/dist/core/noctis-provider.d.ts +38 -0
- package/dist/core/noctis-provider.js +44 -0
- package/dist/core/primitive/index.d.ts +1 -0
- package/dist/core/primitive/primitive.d.ts +44 -0
- package/dist/core/primitive/primitive.js +27 -0
- package/dist/core/radius-scope/index.d.ts +2 -0
- package/dist/core/radius-scope/radius-scope.d.ts +43 -0
- package/dist/core/radius-scope/radius-scope.js +36 -0
- package/dist/core/radius-scope/radius-scope.styles.d.ts +13 -0
- package/dist/core/radius-scope/radius-scope.styles.js +11 -0
- package/dist/core/render.d.ts +24 -0
- package/dist/core/render.js +12 -0
- package/dist/core/use-copy.d.ts +13 -0
- package/dist/core/use-copy.js +30 -0
- package/dist/core/use-injected-labels.js +55 -0
- package/dist/core/use-reduced-motion.d.ts +9 -0
- package/dist/core/use-reduced-motion.js +26 -0
- package/dist/core/visually-hidden/index.d.ts +1 -0
- package/dist/core/visually-hidden/visually-hidden.d.ts +24 -0
- package/dist/core/visually-hidden/visually-hidden.js +19 -0
- package/dist/i18n/default-messages.d.ts +12 -0
- package/dist/i18n/default-messages.js +10 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.js +2 -0
- package/dist/i18n/messages/index.d.ts +2 -0
- package/dist/i18n/messages/index.js +2 -0
- package/dist/icons/glyphs.d.ts +2 -0
- package/dist/icons/glyphs.js +2 -0
- package/dist/icons/icon.d.ts +40 -0
- package/dist/icons/icon.js +26 -0
- package/dist/icons/icon.styles.d.ts +9 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/index.d.ts +126 -0
- package/dist/index.js +112 -0
- package/dist/primitives/accordion.d.ts +7 -0
- package/dist/primitives/accordion.js +8 -0
- package/dist/primitives/alert-dialog.d.ts +7 -0
- package/dist/primitives/alert-dialog.js +8 -0
- package/dist/primitives/autocomplete/autocomplete.d.ts +58 -0
- package/dist/primitives/autocomplete/autocomplete.js +58 -0
- package/dist/primitives/autocomplete/index.d.ts +1 -0
- package/dist/primitives/autocomplete.d.ts +2 -0
- package/dist/primitives/autocomplete.js +2 -0
- package/dist/primitives/avatar.d.ts +7 -0
- package/dist/primitives/avatar.js +8 -0
- package/dist/primitives/button.d.ts +7 -0
- package/dist/primitives/button.js +8 -0
- package/dist/primitives/checkbox-group.d.ts +7 -0
- package/dist/primitives/checkbox-group.js +8 -0
- package/dist/primitives/checkbox.d.ts +7 -0
- package/dist/primitives/checkbox.js +8 -0
- package/dist/primitives/collapsible.d.ts +7 -0
- package/dist/primitives/collapsible.js +8 -0
- package/dist/primitives/combobox/combobox.d.ts +71 -0
- package/dist/primitives/combobox/combobox.js +66 -0
- package/dist/primitives/combobox/index.d.ts +1 -0
- package/dist/primitives/combobox.d.ts +2 -0
- package/dist/primitives/combobox.js +2 -0
- package/dist/primitives/context-menu.d.ts +7 -0
- package/dist/primitives/context-menu.js +8 -0
- package/dist/primitives/csp-provider.d.ts +1 -0
- package/dist/primitives/csp-provider.js +2 -0
- package/dist/primitives/dialog.d.ts +7 -0
- package/dist/primitives/dialog.js +8 -0
- package/dist/primitives/direction-provider.d.ts +1 -0
- package/dist/primitives/direction-provider.js +8 -0
- package/dist/primitives/drawer.d.ts +1 -0
- package/dist/primitives/drawer.js +2 -0
- package/dist/primitives/field.d.ts +7 -0
- package/dist/primitives/field.js +8 -0
- package/dist/primitives/fieldset.d.ts +7 -0
- package/dist/primitives/fieldset.js +8 -0
- package/dist/primitives/form.d.ts +7 -0
- package/dist/primitives/form.js +8 -0
- package/dist/primitives/index.d.ts +79 -0
- package/dist/primitives/index.js +113 -0
- package/dist/primitives/input.d.ts +7 -0
- package/dist/primitives/input.js +8 -0
- package/dist/primitives/menu.d.ts +7 -0
- package/dist/primitives/menu.js +8 -0
- package/dist/primitives/menubar.d.ts +7 -0
- package/dist/primitives/menubar.js +8 -0
- package/dist/primitives/meter/index.d.ts +1 -0
- package/dist/primitives/meter/meter.d.ts +56 -0
- package/dist/primitives/meter/meter.js +59 -0
- package/dist/primitives/meter.d.ts +2 -0
- package/dist/primitives/meter.js +2 -0
- package/dist/primitives/navigation-menu.d.ts +7 -0
- package/dist/primitives/navigation-menu.js +8 -0
- package/dist/primitives/number-field/context.d.ts +13 -0
- package/dist/primitives/number-field/context.js +36 -0
- package/dist/primitives/number-field/index.d.ts +2 -0
- package/dist/primitives/number-field/number-field.d.ts +90 -0
- package/dist/primitives/number-field/number-field.js +107 -0
- package/dist/primitives/number-field.d.ts +3 -0
- package/dist/primitives/number-field.js +2 -0
- package/dist/primitives/otp-field.d.ts +7 -0
- package/dist/primitives/otp-field.js +8 -0
- package/dist/primitives/popover.d.ts +7 -0
- package/dist/primitives/popover.js +8 -0
- package/dist/primitives/preview-card.d.ts +7 -0
- package/dist/primitives/preview-card.js +8 -0
- package/dist/primitives/progress/index.d.ts +1 -0
- package/dist/primitives/progress/progress.d.ts +56 -0
- package/dist/primitives/progress/progress.js +59 -0
- package/dist/primitives/progress.d.ts +2 -0
- package/dist/primitives/progress.js +2 -0
- package/dist/primitives/radio-group.d.ts +7 -0
- package/dist/primitives/radio-group.js +8 -0
- package/dist/primitives/radio.d.ts +7 -0
- package/dist/primitives/radio.js +8 -0
- package/dist/primitives/scroll-area.d.ts +7 -0
- package/dist/primitives/scroll-area.js +8 -0
- package/dist/primitives/select.d.ts +7 -0
- package/dist/primitives/select.js +8 -0
- package/dist/primitives/separator.d.ts +7 -0
- package/dist/primitives/separator.js +8 -0
- package/dist/primitives/slider/context.d.ts +12 -0
- package/dist/primitives/slider/context.js +18 -0
- package/dist/primitives/slider/index.d.ts +2 -0
- package/dist/primitives/slider/slider.d.ts +83 -0
- package/dist/primitives/slider/slider.js +99 -0
- package/dist/primitives/slider.d.ts +3 -0
- package/dist/primitives/slider.js +2 -0
- package/dist/primitives/switch.d.ts +1 -0
- package/dist/primitives/switch.js +2 -0
- package/dist/primitives/tabs.d.ts +7 -0
- package/dist/primitives/tabs.js +8 -0
- package/dist/primitives/toast/context.d.ts +11 -0
- package/dist/primitives/toast/context.js +18 -0
- package/dist/primitives/toast/index.d.ts +2 -0
- package/dist/primitives/toast/toast.d.ts +122 -0
- package/dist/primitives/toast/toast.js +133 -0
- package/dist/primitives/toast.d.ts +3 -0
- package/dist/primitives/toast.js +2 -0
- package/dist/primitives/toggle-group.d.ts +7 -0
- package/dist/primitives/toggle-group.js +8 -0
- package/dist/primitives/toggle.d.ts +7 -0
- package/dist/primitives/toggle.js +8 -0
- package/dist/primitives/toolbar.d.ts +7 -0
- package/dist/primitives/toolbar.js +8 -0
- package/dist/primitives/tooltip.d.ts +7 -0
- package/dist/primitives/tooltip.js +8 -0
- package/dist/props.d.ts +46 -0
- package/dist/props.js +46 -0
- package/dist/styles.css +11513 -0
- package/dist/tailwind/cn.d.ts +33 -0
- package/dist/tailwind/cn.js +42 -0
- package/dist/tailwind/index.d.ts +3 -0
- package/dist/tailwind/index.js +3 -0
- package/dist/tailwind/tv.d.ts +20 -0
- package/dist/tailwind/tv.js +11 -0
- package/dist/tailwind.css +485 -0
- package/dist/theme/react.d.ts +1 -0
- package/dist/theme/react.js +1 -0
- package/dist/theme.d.ts +1 -0
- package/dist/theme.js +1 -0
- package/dist/tokens/react.d.ts +1 -0
- package/dist/tokens/react.js +1 -0
- package/dist/tokens.d.ts +1 -0
- package/dist/tokens.js +1 -0
- package/package.json +121 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, use } from "react";
|
|
3
|
+
//#region src/components/toolbar/toolbar.context.ts
|
|
4
|
+
const ToolbarContext = createContext(null);
|
|
5
|
+
const ToolbarProvider = ToolbarContext.Provider;
|
|
6
|
+
/**
|
|
7
|
+
* Read the enclosing `Toolbar.Root`'s density, or `null` when a toolbar item is used standalone. Used by
|
|
8
|
+
* every hosted item (`Toolbar.Button`, `Toolbar.Link`, `Toolbar.Toggle`, `Toolbar.ToggleGroup`) to map
|
|
9
|
+
* the toolbar `size` onto the hosted control's size so the whole row sits at one height.
|
|
10
|
+
*/
|
|
11
|
+
function useToolbar() {
|
|
12
|
+
return use(ToolbarContext);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Map the toolbar density onto the hosted `Button`/`Toggle` size scale — toolbar `md`→`sm` (control-sm)
|
|
16
|
+
* and toolbar `sm`→`xs` (control-xs). One mapping for every item kind, so they line up.
|
|
17
|
+
*/
|
|
18
|
+
const ITEM_SIZE_FOR_TOOLBAR = {
|
|
19
|
+
md: "sm",
|
|
20
|
+
sm: "xs"
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { ITEM_SIZE_FOR_TOOLBAR, ToolbarProvider, useToolbar };
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { IconGlyph } from "../../icons/glyphs.js";
|
|
2
|
+
import { Button } from "../button/button.js";
|
|
3
|
+
import { toolbar_d_exports } from "../../primitives/toolbar.js";
|
|
4
|
+
import { Toggle, ToggleGroup } from "../toggle/toggle.js";
|
|
5
|
+
import { ToolbarSize, ToolbarVariant } from "./toolbar.types.js";
|
|
6
|
+
import { ToolbarPartProps, groupProps, inputProps, rootProps, separatorProps, spacerProps } from "./toolbar.props.js";
|
|
7
|
+
import { ReactElement } from "react";
|
|
8
|
+
|
|
9
|
+
//#region src/components/toolbar/toolbar.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* The row container. Owns the roving-tabindex focus model (one tab stop into the row, arrow keys move
|
|
12
|
+
* between items) and the orientation. Works `horizontal` (default) or `vertical`; pass `loopFocus`
|
|
13
|
+
* (default `true`) to control whether arrow navigation wraps at the ends. `size` (`sm | md`) sets the
|
|
14
|
+
* density and `variant` (`framed | plain | floating`) the frame. Compose `Toolbar.Button`,
|
|
15
|
+
* `Toolbar.Link`, `Toolbar.Group`, `Toolbar.ToggleGroup`/`Toolbar.Toggle`, `Toolbar.Input`,
|
|
16
|
+
* `Toolbar.Spacer`, and `Toolbar.Separator` inside it.
|
|
17
|
+
*
|
|
18
|
+
* **Always pass an `aria-label`** (or `aria-labelledby`) — the APG toolbar pattern requires the row be
|
|
19
|
+
* named, and the toolbar must never be the sole way to reach an action.
|
|
20
|
+
*/
|
|
21
|
+
declare function ToolbarRoot({
|
|
22
|
+
size,
|
|
23
|
+
variant,
|
|
24
|
+
className,
|
|
25
|
+
onKeyDown,
|
|
26
|
+
...props
|
|
27
|
+
}: Toolbar.Root.Props): ReactElement;
|
|
28
|
+
/**
|
|
29
|
+
* A toolbar button — one roving item. Renders the shipped `Button` (ghost) so it shares the system's
|
|
30
|
+
* sizing, padding, focus ring, and disabled affordance instead of a forked recipe; the toolbar only
|
|
31
|
+
* coordinates its radius. Its `size` maps from the toolbar density unless set. Optional leading `icon`;
|
|
32
|
+
* provide an `aria-label` when icon-only. Compose a `Menu`/`Select`/`Dialog` trigger through `render`.
|
|
33
|
+
*/
|
|
34
|
+
declare function ToolbarButton({
|
|
35
|
+
size: sizeProp,
|
|
36
|
+
icon,
|
|
37
|
+
iconOnly,
|
|
38
|
+
disabled,
|
|
39
|
+
...props
|
|
40
|
+
}: Toolbar.Button.Props): ReactElement;
|
|
41
|
+
/**
|
|
42
|
+
* A toolbar link — a roving item rendered as an `<a>`, sharing the exact button look (the same `Button`
|
|
43
|
+
* ghost recipe rendered as an anchor), so it never drifts in size or weight from the buttons beside it.
|
|
44
|
+
* Pass `href`; its `size` maps from the toolbar density unless set.
|
|
45
|
+
*/
|
|
46
|
+
declare function ToolbarLink({
|
|
47
|
+
size: sizeProp,
|
|
48
|
+
icon,
|
|
49
|
+
className,
|
|
50
|
+
children,
|
|
51
|
+
...props
|
|
52
|
+
}: Toolbar.Link.Props): ReactElement;
|
|
53
|
+
/** Welds several items into one segmented cluster — abutting, with only the cluster's outer corners rounded. */
|
|
54
|
+
declare function ToolbarGroup({
|
|
55
|
+
className,
|
|
56
|
+
...props
|
|
57
|
+
}: Toolbar.Group.Props): ReactElement;
|
|
58
|
+
/** A hairline divider between item clusters. Decorative by default; Base UI gives it the separator role. */
|
|
59
|
+
declare function ToolbarSeparator({
|
|
60
|
+
className,
|
|
61
|
+
...props
|
|
62
|
+
}: Toolbar.Separator.Props): ReactElement;
|
|
63
|
+
/**
|
|
64
|
+
* A pressable toggle that is one roving toolbar item — a Bold/Italic/view-switcher button that shows an
|
|
65
|
+
* on state. Renders the shipped `Toggle` (neutral pressed fill, `aria-pressed`) through Base UI's
|
|
66
|
+
* `Toolbar.Button`, so it keeps the roving order while owning its pressed state. Its `size` maps from the
|
|
67
|
+
* toolbar's density unless set explicitly; pass `aria-label` when icon-only.
|
|
68
|
+
*/
|
|
69
|
+
declare function ToolbarToggle({
|
|
70
|
+
size: sizeProp,
|
|
71
|
+
...props
|
|
72
|
+
}: Toolbar.Toggle.Props): ReactElement;
|
|
73
|
+
/**
|
|
74
|
+
* A set of toggles that coordinate selection — single-select (a view switcher / alignment) or `multiple`
|
|
75
|
+
* (Bold/Italic/Underline) — sharing the shipped `ToggleGroup`'s value model and roving. The toggles are a
|
|
76
|
+
* plain, gap-separated row spaced like the buttons, so the group never reads as a toolbar nested inside
|
|
77
|
+
* the toolbar. `size` maps from the toolbar's density unless set.
|
|
78
|
+
*/
|
|
79
|
+
declare function ToolbarToggleGroup({
|
|
80
|
+
size: sizeProp,
|
|
81
|
+
...props
|
|
82
|
+
}: Toolbar.ToggleGroup.Props): ReactElement;
|
|
83
|
+
/**
|
|
84
|
+
* A roving field item — a zoom %, a font size, an inline search. Renders Base UI's `Toolbar.Input` (a
|
|
85
|
+
* native input that stays one roving stop) styled with the field roles. Mark it `aria-invalid` to paint
|
|
86
|
+
* the invalid border; provide an accessible name (`aria-label`).
|
|
87
|
+
*/
|
|
88
|
+
declare function ToolbarInput({
|
|
89
|
+
className,
|
|
90
|
+
...props
|
|
91
|
+
}: Toolbar.Input.Props): ReactElement;
|
|
92
|
+
/**
|
|
93
|
+
* A logical flex slot that pushes the items after it to the inline-end — for a left tools / right actions
|
|
94
|
+
* split. RTL-safe by construction (logical flex), presentational (`aria-hidden`), and not a roving stop.
|
|
95
|
+
*/
|
|
96
|
+
declare function ToolbarSpacer({
|
|
97
|
+
className,
|
|
98
|
+
...props
|
|
99
|
+
}: Toolbar.Spacer.Props): ReactElement;
|
|
100
|
+
/**
|
|
101
|
+
* A toolbar: a framed row of related controls — buttons, links, and welded groups, divided by hairline
|
|
102
|
+
* separators — sharing a single roving-tabindex focus model. Built on Base UI's Toolbar, so the row is
|
|
103
|
+
* one tab stop, the arrow keys move between items (looping at the ends by default), the look mirrors
|
|
104
|
+
* under RTL, and focus rings respect `:focus-visible`.
|
|
105
|
+
*
|
|
106
|
+
* Compose from parts: `Toolbar.Root` owns the orientation, density (`size`), frame (`variant`), and
|
|
107
|
+
* roving focus; `Toolbar.Button` / `Toolbar.Link` are the items; `Toolbar.ToggleGroup` /
|
|
108
|
+
* `Toolbar.Toggle` add pressable on/off controls; `Toolbar.Input` is a roving field; `Toolbar.Group`
|
|
109
|
+
* welds a set into one segmented cluster; `Toolbar.Spacer` justifies a trailing cluster; and
|
|
110
|
+
* `Toolbar.Separator` rules between clusters. A `Menu` "More" trigger composes via `Button`'s `render`.
|
|
111
|
+
*
|
|
112
|
+
* The runtime compound is a plain object (kept tree-shakeable); per-part prop and state types are
|
|
113
|
+
* exposed through the matching `Toolbar` namespace — e.g. `Toolbar.Button.Props`.
|
|
114
|
+
*/
|
|
115
|
+
declare const Toolbar: {
|
|
116
|
+
/** The row container. `Toolbar.Root.props({ size, variant })` → its spreadable prop bag. */Root: typeof ToolbarRoot & {
|
|
117
|
+
props: typeof rootProps;
|
|
118
|
+
}; /** A button item — the shipped `Button` (ghost) as a roving toolbar item. Use `Button.props()` for the escape hatch. */
|
|
119
|
+
Button: typeof ToolbarButton; /** A link item — the `Button` recipe rendered as an `<a>`. */
|
|
120
|
+
Link: typeof ToolbarLink; /** A welded set of coordinating toggles (segmented). Composes the shipped `ToggleGroup`. */
|
|
121
|
+
ToggleGroup: typeof ToolbarToggleGroup; /** A single pressable toggle that roves as one toolbar item. Composes the shipped `Toggle`. */
|
|
122
|
+
Toggle: typeof ToolbarToggle; /** A roving field item (zoom %, font size). `Toolbar.Input.props({ disabled })` → its prop bag. */
|
|
123
|
+
Input: typeof ToolbarInput & {
|
|
124
|
+
props: typeof inputProps;
|
|
125
|
+
}; /** A welded cluster. `Toolbar.Group.props({ disabled })` → its spreadable prop bag. */
|
|
126
|
+
Group: typeof ToolbarGroup & {
|
|
127
|
+
props: typeof groupProps;
|
|
128
|
+
}; /** A justifying flex slot. `Toolbar.Spacer.props()` → its spreadable prop bag. */
|
|
129
|
+
Spacer: typeof ToolbarSpacer & {
|
|
130
|
+
props: typeof spacerProps;
|
|
131
|
+
}; /** A hairline divider. `Toolbar.Separator.props()` → its spreadable prop bag. */
|
|
132
|
+
Separator: typeof ToolbarSeparator & {
|
|
133
|
+
props: typeof separatorProps;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Per-part prop and state types, mirroring Base UI's `Component.Part.Props` convention. Types-only —
|
|
138
|
+
* it emits no runtime code and merges with the `Toolbar` object above, so `Toolbar.Button` is the
|
|
139
|
+
* component value while `Toolbar.Button.Props` is its prop type.
|
|
140
|
+
*/
|
|
141
|
+
declare namespace Toolbar {
|
|
142
|
+
/** The spreadable data-attribute prop bag every `Toolbar.*.props()` returns (D12). */
|
|
143
|
+
type PartProps = ToolbarPartProps;
|
|
144
|
+
/** The toolbar density (`sm` | `md`). */
|
|
145
|
+
type Size = ToolbarSize;
|
|
146
|
+
/** The toolbar frame (`framed` | `plain` | `floating`). */
|
|
147
|
+
type Variant = ToolbarVariant;
|
|
148
|
+
namespace Root {
|
|
149
|
+
type Props = Omit<toolbar_d_exports.Toolbar.Root.Props, "className"> & {
|
|
150
|
+
/**
|
|
151
|
+
* Density — re-points the button/input metrics and maps onto the hosted toggles.
|
|
152
|
+
* @default "md"
|
|
153
|
+
*/
|
|
154
|
+
size?: ToolbarSize;
|
|
155
|
+
/**
|
|
156
|
+
* Frame — `framed` (bordered surface), `plain` (no frame, for use inside a Surface), or
|
|
157
|
+
* `floating` (elevated shadow for a bubble/selection bar). All stay sharp.
|
|
158
|
+
* @default "framed"
|
|
159
|
+
*/
|
|
160
|
+
variant?: ToolbarVariant; /** Classes merged onto the root. */
|
|
161
|
+
className?: string;
|
|
162
|
+
};
|
|
163
|
+
type State = toolbar_d_exports.Toolbar.Root.State;
|
|
164
|
+
/** `horizontal` | `vertical`. */
|
|
165
|
+
type Orientation = toolbar_d_exports.Toolbar.Root.Orientation;
|
|
166
|
+
}
|
|
167
|
+
namespace Button {
|
|
168
|
+
/** Mirrors the shipped `Button`'s props (rendered ghost as a roving item), plus the friendly `icon`. */
|
|
169
|
+
type Props = Button.Props & {
|
|
170
|
+
/** Leading glyph (maps to the Button's `startIcon`); an iconed button with no label is icon-only. */icon?: IconGlyph;
|
|
171
|
+
};
|
|
172
|
+
type State = toolbar_d_exports.Toolbar.Button.State;
|
|
173
|
+
}
|
|
174
|
+
namespace Link {
|
|
175
|
+
/** A real anchor styled with the `Button` (ghost) recipe — pass anchor props (`href`, `target`, …). */
|
|
176
|
+
type Props = Omit<toolbar_d_exports.Toolbar.Link.Props, "className"> & {
|
|
177
|
+
/** Item density; maps from the toolbar `size` unless set. */size?: Button.Size; /** Optional leading glyph. */
|
|
178
|
+
icon?: IconGlyph; /** Classes merged onto the link. */
|
|
179
|
+
className?: string;
|
|
180
|
+
};
|
|
181
|
+
type State = toolbar_d_exports.Toolbar.Link.State;
|
|
182
|
+
}
|
|
183
|
+
namespace Group {
|
|
184
|
+
type Props = Omit<toolbar_d_exports.Toolbar.Group.Props, "className"> & {
|
|
185
|
+
/** Classes merged onto the group. */className?: string;
|
|
186
|
+
};
|
|
187
|
+
type State = toolbar_d_exports.Toolbar.Group.State;
|
|
188
|
+
}
|
|
189
|
+
namespace Toggle {
|
|
190
|
+
/** Mirrors the shipped `Toggle`'s props — it is hosted as a roving toolbar item. */
|
|
191
|
+
type Props = Toggle.Props;
|
|
192
|
+
type State = Toggle.State;
|
|
193
|
+
}
|
|
194
|
+
namespace ToggleGroup {
|
|
195
|
+
/** Mirrors the shipped `ToggleGroup`'s props (value model, `variant`/`size`, `multiple`). */
|
|
196
|
+
type Props = ToggleGroup.Props;
|
|
197
|
+
type State = ToggleGroup.State;
|
|
198
|
+
}
|
|
199
|
+
namespace Input {
|
|
200
|
+
type Props = Omit<toolbar_d_exports.Toolbar.Input.Props, "className"> & {
|
|
201
|
+
/** Classes merged onto the input. */className?: string;
|
|
202
|
+
};
|
|
203
|
+
type State = toolbar_d_exports.Toolbar.Input.State;
|
|
204
|
+
}
|
|
205
|
+
namespace Spacer {
|
|
206
|
+
type Props = {
|
|
207
|
+
/** Classes merged onto the spacer. */className?: string;
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
namespace Separator {
|
|
211
|
+
type Props = Omit<toolbar_d_exports.Toolbar.Separator.Props, "className"> & {
|
|
212
|
+
/** Classes merged onto the separator. */className?: string;
|
|
213
|
+
};
|
|
214
|
+
type State = toolbar_d_exports.Toolbar.Separator.State;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
export { Toolbar };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Icon } from "../../icons/icon.js";
|
|
3
|
+
import { Surface } from "../surface/surface.js";
|
|
4
|
+
import { Button } from "../button/button.js";
|
|
5
|
+
import { toolbar_exports } from "../../primitives/toolbar.js";
|
|
6
|
+
import { Toggle, ToggleGroup } from "../toggle/toggle.js";
|
|
7
|
+
import { ITEM_SIZE_FOR_TOOLBAR, ToolbarProvider, useToolbar } from "./toolbar.context.js";
|
|
8
|
+
import { TOOLBAR_SLOTS } from "./toolbar.slots.js";
|
|
9
|
+
import { groupProps, inputProps, rootProps, separatorProps, spacerProps } from "./toolbar.props.js";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
//#region src/components/toolbar/toolbar.tsx
|
|
12
|
+
/**
|
|
13
|
+
* The row container. Owns the roving-tabindex focus model (one tab stop into the row, arrow keys move
|
|
14
|
+
* between items) and the orientation. Works `horizontal` (default) or `vertical`; pass `loopFocus`
|
|
15
|
+
* (default `true`) to control whether arrow navigation wraps at the ends. `size` (`sm | md`) sets the
|
|
16
|
+
* density and `variant` (`framed | plain | floating`) the frame. Compose `Toolbar.Button`,
|
|
17
|
+
* `Toolbar.Link`, `Toolbar.Group`, `Toolbar.ToggleGroup`/`Toolbar.Toggle`, `Toolbar.Input`,
|
|
18
|
+
* `Toolbar.Spacer`, and `Toolbar.Separator` inside it.
|
|
19
|
+
*
|
|
20
|
+
* **Always pass an `aria-label`** (or `aria-labelledby`) — the APG toolbar pattern requires the row be
|
|
21
|
+
* named, and the toolbar must never be the sole way to reach an action.
|
|
22
|
+
*/
|
|
23
|
+
function ToolbarRoot({ size = "md", variant = "framed", className, onKeyDown, ...props }) {
|
|
24
|
+
const handleKeyDown = (event) => {
|
|
25
|
+
onKeyDown?.(event);
|
|
26
|
+
if (event.defaultPrevented || event.key !== "Home" && event.key !== "End") return;
|
|
27
|
+
const items = event.currentTarget.querySelectorAll("[data-focusable]");
|
|
28
|
+
const target = event.key === "Home" ? items[0] : items[items.length - 1];
|
|
29
|
+
if (target) {
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
target.focus();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const surface = variant === "floating" ? /* @__PURE__ */ jsx(Surface, {
|
|
35
|
+
elevation: "elevated",
|
|
36
|
+
bordered: true,
|
|
37
|
+
shadow: "popover"
|
|
38
|
+
}) : void 0;
|
|
39
|
+
return /* @__PURE__ */ jsx(ToolbarProvider, {
|
|
40
|
+
value: { size },
|
|
41
|
+
children: /* @__PURE__ */ jsx(toolbar_exports.Toolbar.Root, {
|
|
42
|
+
...props,
|
|
43
|
+
onKeyDown: handleKeyDown,
|
|
44
|
+
render: surface,
|
|
45
|
+
"data-slot": TOOLBAR_SLOTS.root,
|
|
46
|
+
"data-size": size,
|
|
47
|
+
"data-variant": variant,
|
|
48
|
+
className
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A toolbar button — one roving item. Renders the shipped `Button` (ghost) so it shares the system's
|
|
54
|
+
* sizing, padding, focus ring, and disabled affordance instead of a forked recipe; the toolbar only
|
|
55
|
+
* coordinates its radius. Its `size` maps from the toolbar density unless set. Optional leading `icon`;
|
|
56
|
+
* provide an `aria-label` when icon-only. Compose a `Menu`/`Select`/`Dialog` trigger through `render`.
|
|
57
|
+
*/
|
|
58
|
+
function ToolbarButton({ size: sizeProp, icon, iconOnly, disabled, ...props }) {
|
|
59
|
+
const toolbar = useToolbar();
|
|
60
|
+
const size = sizeProp ?? (toolbar ? ITEM_SIZE_FOR_TOOLBAR[toolbar.size] : void 0);
|
|
61
|
+
const square = iconOnly ?? (icon != null && props.children == null);
|
|
62
|
+
return /* @__PURE__ */ jsx(toolbar_exports.Toolbar.Button, {
|
|
63
|
+
disabled,
|
|
64
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
65
|
+
variant: "ghost",
|
|
66
|
+
size,
|
|
67
|
+
startIcon: icon,
|
|
68
|
+
iconOnly: square,
|
|
69
|
+
...props
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A toolbar link — a roving item rendered as an `<a>`, sharing the exact button look (the same `Button`
|
|
75
|
+
* ghost recipe rendered as an anchor), so it never drifts in size or weight from the buttons beside it.
|
|
76
|
+
* Pass `href`; its `size` maps from the toolbar density unless set.
|
|
77
|
+
*/
|
|
78
|
+
function ToolbarLink({ size: sizeProp, icon, className, children, ...props }) {
|
|
79
|
+
const toolbar = useToolbar();
|
|
80
|
+
const size = sizeProp ?? (toolbar ? ITEM_SIZE_FOR_TOOLBAR[toolbar.size] : void 0);
|
|
81
|
+
return /* @__PURE__ */ jsxs(toolbar_exports.Toolbar.Link, {
|
|
82
|
+
...Button.props({
|
|
83
|
+
variant: "ghost",
|
|
84
|
+
size,
|
|
85
|
+
className
|
|
86
|
+
}),
|
|
87
|
+
...props,
|
|
88
|
+
children: [icon ? /* @__PURE__ */ jsx(Icon, {
|
|
89
|
+
icon,
|
|
90
|
+
size: "sm"
|
|
91
|
+
}) : null, children]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/** Welds several items into one segmented cluster — abutting, with only the cluster's outer corners rounded. */
|
|
95
|
+
function ToolbarGroup({ className, ...props }) {
|
|
96
|
+
return /* @__PURE__ */ jsx(toolbar_exports.Toolbar.Group, {
|
|
97
|
+
"data-slot": TOOLBAR_SLOTS.group,
|
|
98
|
+
className,
|
|
99
|
+
...props
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/** A hairline divider between item clusters. Decorative by default; Base UI gives it the separator role. */
|
|
103
|
+
function ToolbarSeparator({ className, ...props }) {
|
|
104
|
+
return /* @__PURE__ */ jsx(toolbar_exports.Toolbar.Separator, {
|
|
105
|
+
"data-slot": TOOLBAR_SLOTS.separator,
|
|
106
|
+
className,
|
|
107
|
+
...props
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* A pressable toggle that is one roving toolbar item — a Bold/Italic/view-switcher button that shows an
|
|
112
|
+
* on state. Renders the shipped `Toggle` (neutral pressed fill, `aria-pressed`) through Base UI's
|
|
113
|
+
* `Toolbar.Button`, so it keeps the roving order while owning its pressed state. Its `size` maps from the
|
|
114
|
+
* toolbar's density unless set explicitly; pass `aria-label` when icon-only.
|
|
115
|
+
*/
|
|
116
|
+
function ToolbarToggle({ size: sizeProp, ...props }) {
|
|
117
|
+
const toolbar = useToolbar();
|
|
118
|
+
const size = sizeProp ?? (toolbar ? ITEM_SIZE_FOR_TOOLBAR[toolbar.size] : void 0);
|
|
119
|
+
return /* @__PURE__ */ jsx(toolbar_exports.Toolbar.Button, { render: /* @__PURE__ */ jsx(Toggle, {
|
|
120
|
+
size,
|
|
121
|
+
...props
|
|
122
|
+
}) });
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* A set of toggles that coordinate selection — single-select (a view switcher / alignment) or `multiple`
|
|
126
|
+
* (Bold/Italic/Underline) — sharing the shipped `ToggleGroup`'s value model and roving. The toggles are a
|
|
127
|
+
* plain, gap-separated row spaced like the buttons, so the group never reads as a toolbar nested inside
|
|
128
|
+
* the toolbar. `size` maps from the toolbar's density unless set.
|
|
129
|
+
*/
|
|
130
|
+
function ToolbarToggleGroup({ size: sizeProp, ...props }) {
|
|
131
|
+
const toolbar = useToolbar();
|
|
132
|
+
return /* @__PURE__ */ jsx(ToggleGroup, {
|
|
133
|
+
size: sizeProp ?? (toolbar ? ITEM_SIZE_FOR_TOOLBAR[toolbar.size] : void 0),
|
|
134
|
+
...props
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* A roving field item — a zoom %, a font size, an inline search. Renders Base UI's `Toolbar.Input` (a
|
|
139
|
+
* native input that stays one roving stop) styled with the field roles. Mark it `aria-invalid` to paint
|
|
140
|
+
* the invalid border; provide an accessible name (`aria-label`).
|
|
141
|
+
*/
|
|
142
|
+
function ToolbarInput({ className, ...props }) {
|
|
143
|
+
return /* @__PURE__ */ jsx(toolbar_exports.Toolbar.Input, {
|
|
144
|
+
"data-slot": TOOLBAR_SLOTS.input,
|
|
145
|
+
className,
|
|
146
|
+
...props
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* A logical flex slot that pushes the items after it to the inline-end — for a left tools / right actions
|
|
151
|
+
* split. RTL-safe by construction (logical flex), presentational (`aria-hidden`), and not a roving stop.
|
|
152
|
+
*/
|
|
153
|
+
function ToolbarSpacer({ className, ...props }) {
|
|
154
|
+
return /* @__PURE__ */ jsx("div", {
|
|
155
|
+
"data-slot": TOOLBAR_SLOTS.spacer,
|
|
156
|
+
"aria-hidden": true,
|
|
157
|
+
className,
|
|
158
|
+
...props
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* A toolbar: a framed row of related controls — buttons, links, and welded groups, divided by hairline
|
|
163
|
+
* separators — sharing a single roving-tabindex focus model. Built on Base UI's Toolbar, so the row is
|
|
164
|
+
* one tab stop, the arrow keys move between items (looping at the ends by default), the look mirrors
|
|
165
|
+
* under RTL, and focus rings respect `:focus-visible`.
|
|
166
|
+
*
|
|
167
|
+
* Compose from parts: `Toolbar.Root` owns the orientation, density (`size`), frame (`variant`), and
|
|
168
|
+
* roving focus; `Toolbar.Button` / `Toolbar.Link` are the items; `Toolbar.ToggleGroup` /
|
|
169
|
+
* `Toolbar.Toggle` add pressable on/off controls; `Toolbar.Input` is a roving field; `Toolbar.Group`
|
|
170
|
+
* welds a set into one segmented cluster; `Toolbar.Spacer` justifies a trailing cluster; and
|
|
171
|
+
* `Toolbar.Separator` rules between clusters. A `Menu` "More" trigger composes via `Button`'s `render`.
|
|
172
|
+
*
|
|
173
|
+
* The runtime compound is a plain object (kept tree-shakeable); per-part prop and state types are
|
|
174
|
+
* exposed through the matching `Toolbar` namespace — e.g. `Toolbar.Button.Props`.
|
|
175
|
+
*/
|
|
176
|
+
const Toolbar = {
|
|
177
|
+
/** The row container. `Toolbar.Root.props({ size, variant })` → its spreadable prop bag. */
|
|
178
|
+
Root: Object.assign(ToolbarRoot, { props: rootProps }),
|
|
179
|
+
/** A button item — the shipped `Button` (ghost) as a roving toolbar item. Use `Button.props()` for the escape hatch. */
|
|
180
|
+
Button: ToolbarButton,
|
|
181
|
+
/** A link item — the `Button` recipe rendered as an `<a>`. */
|
|
182
|
+
Link: ToolbarLink,
|
|
183
|
+
/** A welded set of coordinating toggles (segmented). Composes the shipped `ToggleGroup`. */
|
|
184
|
+
ToggleGroup: ToolbarToggleGroup,
|
|
185
|
+
/** A single pressable toggle that roves as one toolbar item. Composes the shipped `Toggle`. */
|
|
186
|
+
Toggle: ToolbarToggle,
|
|
187
|
+
/** A roving field item (zoom %, font size). `Toolbar.Input.props({ disabled })` → its prop bag. */
|
|
188
|
+
Input: Object.assign(ToolbarInput, { props: inputProps }),
|
|
189
|
+
/** A welded cluster. `Toolbar.Group.props({ disabled })` → its spreadable prop bag. */
|
|
190
|
+
Group: Object.assign(ToolbarGroup, { props: groupProps }),
|
|
191
|
+
/** A justifying flex slot. `Toolbar.Spacer.props()` → its spreadable prop bag. */
|
|
192
|
+
Spacer: Object.assign(ToolbarSpacer, { props: spacerProps }),
|
|
193
|
+
/** A hairline divider. `Toolbar.Separator.props()` → its spreadable prop bag. */
|
|
194
|
+
Separator: Object.assign(ToolbarSeparator, { props: separatorProps })
|
|
195
|
+
};
|
|
196
|
+
//#endregion
|
|
197
|
+
export { Toolbar };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ToolbarSize, ToolbarVariant } from "./toolbar.types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/toolbar/toolbar.props.d.ts
|
|
4
|
+
/** A spreadable data-attribute prop bag — the shape every `Toolbar.*.props()` returns. */
|
|
5
|
+
type ToolbarPartProps = {
|
|
6
|
+
/** The slot value the matching `toolbar.css` rules anchor on. */"data-slot": string; /** Forwarded verbatim — styling is attribute-driven, so this is an optional consumer passthrough. */
|
|
7
|
+
className?: string; /** A data-attribute present (empty string) or absent (`undefined`); never `false`. */
|
|
8
|
+
[attr: `data-${string}`]: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
/** Common shape: every part's `.props()` accepts an optional `className` passthrough. */
|
|
11
|
+
interface BasePropsArgs {
|
|
12
|
+
/** Forwarded verbatim onto the returned prop bag. */
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Argument to a part that can be disabled (`Toolbar.Button`, `Toolbar.Group`). */
|
|
16
|
+
interface ToolbarDisableablePropsArgs extends BasePropsArgs {
|
|
17
|
+
/** Whether the part is disabled (drives the not-allowed affordance via `data-disabled`). */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Argument to a stateless part's `.props(...)` — no state of its own; look flows from the row. */
|
|
21
|
+
type ToolbarStatelessPropsArgs = BasePropsArgs;
|
|
22
|
+
/** Argument to `Toolbar.Root.props(...)` — the row's density + frame the CSS keys its metrics off. */
|
|
23
|
+
interface ToolbarRootPropsArgs extends BasePropsArgs {
|
|
24
|
+
/** Density — re-points the button/input metrics via `data-size`. @default "md" */
|
|
25
|
+
size?: ToolbarSize;
|
|
26
|
+
/** Frame — `framed` | `plain` | `floating`, stamped as `data-variant`. @default "framed" */
|
|
27
|
+
variant?: ToolbarVariant;
|
|
28
|
+
}
|
|
29
|
+
/** Root prop bag: slot anchor plus the `data-size`/`data-variant` axes (orientation flows from Base UI). */
|
|
30
|
+
declare function rootProps({
|
|
31
|
+
size,
|
|
32
|
+
variant,
|
|
33
|
+
className
|
|
34
|
+
}?: ToolbarRootPropsArgs): ToolbarPartProps;
|
|
35
|
+
/** Separator prop bag: just the slot anchor. */
|
|
36
|
+
declare function separatorProps({
|
|
37
|
+
className
|
|
38
|
+
}?: ToolbarStatelessPropsArgs): ToolbarPartProps;
|
|
39
|
+
/** Group prop bag: slot anchor plus the `data-disabled` state. */
|
|
40
|
+
declare function groupProps({
|
|
41
|
+
disabled,
|
|
42
|
+
className
|
|
43
|
+
}?: ToolbarDisableablePropsArgs): ToolbarPartProps;
|
|
44
|
+
/** Input prop bag: slot anchor plus the `data-disabled` state (a roving field item). */
|
|
45
|
+
declare function inputProps({
|
|
46
|
+
disabled,
|
|
47
|
+
className
|
|
48
|
+
}?: ToolbarDisableablePropsArgs): ToolbarPartProps;
|
|
49
|
+
/** Spacer prop bag: just the slot anchor (a logical flex slot that pushes following items to the end). */
|
|
50
|
+
declare function spacerProps({
|
|
51
|
+
className
|
|
52
|
+
}?: ToolbarStatelessPropsArgs): ToolbarPartProps;
|
|
53
|
+
//#endregion
|
|
54
|
+
export { ToolbarPartProps, groupProps, inputProps, rootProps, separatorProps, spacerProps };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { TOOLBAR_SLOTS } from "./toolbar.slots.js";
|
|
2
|
+
//#region src/components/toolbar/toolbar.props.ts
|
|
3
|
+
/**
|
|
4
|
+
* The D12 unified variant contract for Toolbar — the data-attribute-native escape hatch.
|
|
5
|
+
*
|
|
6
|
+
* Each compound part exposes a `props(...)` builder returning a **spreadable props object** of the form
|
|
7
|
+
* `{ "data-slot": "noctis-toolbar-<part>", ...dataAttrs }`. Under the single-`data-slot` anchor model
|
|
8
|
+
* the `data-slot` is the only styling hook needed — `toolbar.css` keys every rule off it — so spreading
|
|
9
|
+
* a part's `props()` onto a *foreign* element styles it as that part:
|
|
10
|
+
*
|
|
11
|
+
* <button {...Toolbar.Button.props()}>Bold</button>
|
|
12
|
+
* // → <button data-slot="noctis-toolbar-button">
|
|
13
|
+
*
|
|
14
|
+
* The escape hatch carries no className (styling is attribute-driven); an optional `className`
|
|
15
|
+
* passthrough is accepted and forwarded verbatim. The same slot mapping is emitted as data from the
|
|
16
|
+
* token graph so non-React / agent consumers can hand-write the markup from the docs.
|
|
17
|
+
*/
|
|
18
|
+
/** Stamp a boolean state as a bare data-attribute: present (`""`) when on, absent (`undefined`) when off. */
|
|
19
|
+
const flag = (on) => on ? "" : void 0;
|
|
20
|
+
const withClassName = (bag, className) => className === void 0 ? bag : {
|
|
21
|
+
...bag,
|
|
22
|
+
className
|
|
23
|
+
};
|
|
24
|
+
/** Root prop bag: slot anchor plus the `data-size`/`data-variant` axes (orientation flows from Base UI). */
|
|
25
|
+
function rootProps({ size = "md", variant = "framed", className } = {}) {
|
|
26
|
+
return withClassName({
|
|
27
|
+
"data-slot": TOOLBAR_SLOTS.root,
|
|
28
|
+
"data-size": size,
|
|
29
|
+
"data-variant": variant
|
|
30
|
+
}, className);
|
|
31
|
+
}
|
|
32
|
+
/** Separator prop bag: just the slot anchor. */
|
|
33
|
+
function separatorProps({ className } = {}) {
|
|
34
|
+
return withClassName({ "data-slot": TOOLBAR_SLOTS.separator }, className);
|
|
35
|
+
}
|
|
36
|
+
/** Group prop bag: slot anchor plus the `data-disabled` state. */
|
|
37
|
+
function groupProps({ disabled, className } = {}) {
|
|
38
|
+
return withClassName({
|
|
39
|
+
"data-slot": TOOLBAR_SLOTS.group,
|
|
40
|
+
"data-disabled": flag(disabled)
|
|
41
|
+
}, className);
|
|
42
|
+
}
|
|
43
|
+
/** Input prop bag: slot anchor plus the `data-disabled` state (a roving field item). */
|
|
44
|
+
function inputProps({ disabled, className } = {}) {
|
|
45
|
+
return withClassName({
|
|
46
|
+
"data-slot": TOOLBAR_SLOTS.input,
|
|
47
|
+
"data-disabled": flag(disabled)
|
|
48
|
+
}, className);
|
|
49
|
+
}
|
|
50
|
+
/** Spacer prop bag: just the slot anchor (a logical flex slot that pushes following items to the end). */
|
|
51
|
+
function spacerProps({ className } = {}) {
|
|
52
|
+
return withClassName({ "data-slot": TOOLBAR_SLOTS.spacer }, className);
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { groupProps, inputProps, rootProps, separatorProps, spacerProps };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/components/toolbar/toolbar.slots.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The `data-*` hooks `Toolbar` stamps on its parts, for host-side styling and tests. Slot values mark
|
|
4
|
+
* each rendered element; the state attributes are emitted by Base UI's Toolbar — pair a slot with a
|
|
5
|
+
* state to target, say, only a disabled button or a vertical row.
|
|
6
|
+
*/
|
|
7
|
+
declare enum ToolbarDataAttributes {
|
|
8
|
+
/** The element's slot — the styling and testing hook. */
|
|
9
|
+
slot = "data-slot",
|
|
10
|
+
/** `sm` | `md` — the toolbar density, stamped on the root; re-points the button/input metrics. */
|
|
11
|
+
size = "data-size",
|
|
12
|
+
/** `framed` | `plain` | `floating` — the toolbar frame, stamped on the root. */
|
|
13
|
+
variant = "data-variant",
|
|
14
|
+
/** `horizontal` | `vertical` — the row's orientation, stamped on every part. */
|
|
15
|
+
orientation = "data-orientation",
|
|
16
|
+
/** Present on a disabled toolbar button or group. */
|
|
17
|
+
disabled = "data-disabled",
|
|
18
|
+
/** Present on a hosted toolbar toggle while it is pressed (on). */
|
|
19
|
+
pressed = "data-pressed",
|
|
20
|
+
/** Present on the item the keyboard's roving focus currently rests on. */
|
|
21
|
+
highlighted = "data-highlighted"
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { ToolbarDataAttributes };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region src/components/toolbar/toolbar.slots.ts
|
|
2
|
+
/**
|
|
3
|
+
* The slot vocabulary every `Toolbar` part stamps as its `data-slot`. The authored source the
|
|
4
|
+
* orchestration file reads from, kebab-cased `{component}-{part}`; SLOTS.md still generates from the
|
|
5
|
+
* token-graph declarations.
|
|
6
|
+
*/
|
|
7
|
+
const TOOLBAR_SLOTS = {
|
|
8
|
+
root: "noctis-toolbar",
|
|
9
|
+
separator: "noctis-toolbar-separator",
|
|
10
|
+
group: "noctis-toolbar-group",
|
|
11
|
+
input: "noctis-toolbar-input",
|
|
12
|
+
spacer: "noctis-toolbar-spacer"
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The `data-*` hooks `Toolbar` stamps on its parts, for host-side styling and tests. Slot values mark
|
|
16
|
+
* each rendered element; the state attributes are emitted by Base UI's Toolbar — pair a slot with a
|
|
17
|
+
* state to target, say, only a disabled button or a vertical row.
|
|
18
|
+
*/
|
|
19
|
+
let ToolbarDataAttributes = /* @__PURE__ */ function(ToolbarDataAttributes) {
|
|
20
|
+
/** The element's slot — the styling and testing hook. */
|
|
21
|
+
ToolbarDataAttributes["slot"] = "data-slot";
|
|
22
|
+
/** `sm` | `md` — the toolbar density, stamped on the root; re-points the button/input metrics. */
|
|
23
|
+
ToolbarDataAttributes["size"] = "data-size";
|
|
24
|
+
/** `framed` | `plain` | `floating` — the toolbar frame, stamped on the root. */
|
|
25
|
+
ToolbarDataAttributes["variant"] = "data-variant";
|
|
26
|
+
/** `horizontal` | `vertical` — the row's orientation, stamped on every part. */
|
|
27
|
+
ToolbarDataAttributes["orientation"] = "data-orientation";
|
|
28
|
+
/** Present on a disabled toolbar button or group. */
|
|
29
|
+
ToolbarDataAttributes["disabled"] = "data-disabled";
|
|
30
|
+
/** Present on a hosted toolbar toggle while it is pressed (on). */
|
|
31
|
+
ToolbarDataAttributes["pressed"] = "data-pressed";
|
|
32
|
+
/** Present on the item the keyboard's roving focus currently rests on. */
|
|
33
|
+
ToolbarDataAttributes["highlighted"] = "data-highlighted";
|
|
34
|
+
return ToolbarDataAttributes;
|
|
35
|
+
}({});
|
|
36
|
+
//#endregion
|
|
37
|
+
export { TOOLBAR_SLOTS, ToolbarDataAttributes };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/components/toolbar/toolbar.types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Shared value unions for the Toolbar axes — kept in one module so the orchestration, the props
|
|
4
|
+
* builders, and the context provider all read the same source.
|
|
5
|
+
*/
|
|
6
|
+
/** The toolbar density. `md` (default) is `control-sm`; `sm` drops to `control-xs`. */
|
|
7
|
+
type ToolbarSize = "sm" | "md";
|
|
8
|
+
/**
|
|
9
|
+
* The toolbar's frame. `framed` (default) is a bordered surface row; `plain` drops the border and
|
|
10
|
+
* background for a toolbar already inside a Surface/Card; `floating` lifts a bubble/selection bar off
|
|
11
|
+
* the page with an elevated shadow. All stay sharp.
|
|
12
|
+
*/
|
|
13
|
+
type ToolbarVariant = "framed" | "plain" | "floating";
|
|
14
|
+
//#endregion
|
|
15
|
+
export { ToolbarSize, ToolbarVariant };
|