@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,92 @@
|
|
|
1
|
+
//#region src/components/menu/menu.props.d.ts
|
|
2
|
+
/** A spreadable data-attribute prop bag — the shape every `Menu.*.props()` returns. */
|
|
3
|
+
type MenuPartProps = {
|
|
4
|
+
/** The slot value the matching `menu.css` rules anchor on. */"data-slot": string; /** Forwarded verbatim — styling is attribute-driven, so this is an optional consumer passthrough. */
|
|
5
|
+
className?: string; /** A data-attribute present (empty string) or absent (`undefined`); never `false`. */
|
|
6
|
+
[attr: `data-${string}`]: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
/** Common shape: every part's `.props()` accepts an optional `className` passthrough. */
|
|
9
|
+
interface BasePropsArgs {
|
|
10
|
+
/** Forwarded verbatim onto the returned prop bag. */
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Argument to `Menu.Item.props(...)` — the per-row tone + state the CSS keys its colour/affordance off. */
|
|
14
|
+
interface MenuItemPropsArgs extends BasePropsArgs {
|
|
15
|
+
/** Visual intent — `danger` re-points the row's label/highlight to the danger role via `data-variant`. @default "default" */
|
|
16
|
+
tone?: "default" | "danger";
|
|
17
|
+
/** Whether the pointer/keyboard is over this row (drives the highlight via `data-highlighted`). */
|
|
18
|
+
highlighted?: boolean;
|
|
19
|
+
/** Whether this row is disabled (drives the not-allowed affordance via `data-disabled`). */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Argument to a highlightable-but-tone-less part's `.props(...)` — checkbox/radio/submenu rows. */
|
|
23
|
+
interface MenuRowPropsArgs extends BasePropsArgs {
|
|
24
|
+
/** Whether the pointer/keyboard is over this row (drives the highlight via `data-highlighted`). */
|
|
25
|
+
highlighted?: boolean;
|
|
26
|
+
/** Whether this row is disabled (drives the not-allowed affordance via `data-disabled`). */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/** Argument to a stateless part's `.props(...)` — no variants/state of its own; look flows from the row. */
|
|
30
|
+
type MenuStatelessPropsArgs = BasePropsArgs;
|
|
31
|
+
/** Trigger prop bag: just the slot anchor. */
|
|
32
|
+
declare function triggerProps({
|
|
33
|
+
className
|
|
34
|
+
}?: MenuStatelessPropsArgs): MenuPartProps;
|
|
35
|
+
/** Content prop bag: just the slot anchor (the popup surface paint is owned by the composed Surface). */
|
|
36
|
+
declare function contentProps({
|
|
37
|
+
className
|
|
38
|
+
}?: MenuStatelessPropsArgs): MenuPartProps;
|
|
39
|
+
/** Group prop bag: just the slot anchor. */
|
|
40
|
+
declare function groupProps({
|
|
41
|
+
className
|
|
42
|
+
}?: MenuStatelessPropsArgs): MenuPartProps;
|
|
43
|
+
/** Group-label prop bag: just the slot anchor. */
|
|
44
|
+
declare function groupLabelProps({
|
|
45
|
+
className
|
|
46
|
+
}?: MenuStatelessPropsArgs): MenuPartProps;
|
|
47
|
+
/** Item prop bag: slot anchor plus the `data-variant` tone and `data-highlighted`/`data-disabled` state. */
|
|
48
|
+
declare function itemProps({
|
|
49
|
+
tone,
|
|
50
|
+
highlighted,
|
|
51
|
+
disabled,
|
|
52
|
+
className
|
|
53
|
+
}?: MenuItemPropsArgs): MenuPartProps;
|
|
54
|
+
/** Link-item prop bag: like `itemProps`, but anchors on the link-item slot (a navigable `<a>` row). */
|
|
55
|
+
declare function linkItemProps({
|
|
56
|
+
tone,
|
|
57
|
+
highlighted,
|
|
58
|
+
disabled,
|
|
59
|
+
className
|
|
60
|
+
}?: MenuItemPropsArgs): MenuPartProps;
|
|
61
|
+
/** Checkbox-item prop bag: slot anchor plus the `data-highlighted`/`data-disabled` state. */
|
|
62
|
+
declare function checkboxItemProps({
|
|
63
|
+
highlighted,
|
|
64
|
+
disabled,
|
|
65
|
+
className
|
|
66
|
+
}?: MenuRowPropsArgs): MenuPartProps;
|
|
67
|
+
/** Radio-group prop bag: just the slot anchor. */
|
|
68
|
+
declare function radioGroupProps({
|
|
69
|
+
className
|
|
70
|
+
}?: MenuStatelessPropsArgs): MenuPartProps;
|
|
71
|
+
/** Radio-item prop bag: slot anchor plus the `data-highlighted`/`data-disabled` state. */
|
|
72
|
+
declare function radioItemProps({
|
|
73
|
+
highlighted,
|
|
74
|
+
disabled,
|
|
75
|
+
className
|
|
76
|
+
}?: MenuRowPropsArgs): MenuPartProps;
|
|
77
|
+
/** Submenu-trigger prop bag: slot anchor plus the `data-highlighted`/`data-disabled` state. */
|
|
78
|
+
declare function submenuTriggerProps({
|
|
79
|
+
highlighted,
|
|
80
|
+
disabled,
|
|
81
|
+
className
|
|
82
|
+
}?: MenuRowPropsArgs): MenuPartProps;
|
|
83
|
+
/** Shortcut prop bag: just the slot anchor. */
|
|
84
|
+
declare function shortcutProps({
|
|
85
|
+
className
|
|
86
|
+
}?: MenuStatelessPropsArgs): MenuPartProps;
|
|
87
|
+
/** Separator prop bag: just the slot anchor. */
|
|
88
|
+
declare function separatorProps({
|
|
89
|
+
className
|
|
90
|
+
}?: MenuStatelessPropsArgs): MenuPartProps;
|
|
91
|
+
//#endregion
|
|
92
|
+
export { MenuItemPropsArgs, MenuPartProps, checkboxItemProps, contentProps, groupLabelProps, groupProps, itemProps, linkItemProps, radioGroupProps, radioItemProps, separatorProps, shortcutProps, submenuTriggerProps, triggerProps };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { MENU_SLOTS } from "./menu.slots.js";
|
|
2
|
+
//#region src/components/menu/menu.props.ts
|
|
3
|
+
/**
|
|
4
|
+
* The D12 unified variant contract for Menu — a per-part set of `props(...)` builders that each return
|
|
5
|
+
* a **spreadable props object** of the form `{ "data-slot": "noctis-menu-<part>", ...dataAttrs }`,
|
|
6
|
+
* derived from the part's variant/state inputs.
|
|
7
|
+
*
|
|
8
|
+
* Under the single-`data-slot` anchor model the `data-slot` is the only styling hook needed —
|
|
9
|
+
* `menu.css` keys every rule off it — so spreading a part's `props()` onto a *foreign* element styles
|
|
10
|
+
* it as that part:
|
|
11
|
+
*
|
|
12
|
+
* <li {...Menu.Item.props({ tone: "danger", highlighted: true })}>Delete</li>
|
|
13
|
+
* // → <li data-slot="noctis-menu-item" data-variant="danger" data-highlighted="">
|
|
14
|
+
*
|
|
15
|
+
* The escape hatch carries no className (styling is attribute-driven); an optional `className`
|
|
16
|
+
* passthrough is accepted and forwarded verbatim. The same variant→data-attribute→values mapping is
|
|
17
|
+
* emitted as data from the token graph (`generated/declarations.json` → `variantSchema`) so non-React /
|
|
18
|
+
* agent consumers can hand-write the markup from the docs.
|
|
19
|
+
*/
|
|
20
|
+
/** Stamp a boolean state as a bare data-attribute: present (`""`) when on, absent (`undefined`) when off. */
|
|
21
|
+
const flag = (on) => on ? "" : void 0;
|
|
22
|
+
const withClassName = (bag, className) => className === void 0 ? bag : {
|
|
23
|
+
...bag,
|
|
24
|
+
className
|
|
25
|
+
};
|
|
26
|
+
/** Trigger prop bag: just the slot anchor. */
|
|
27
|
+
function triggerProps({ className } = {}) {
|
|
28
|
+
return withClassName({ "data-slot": MENU_SLOTS.trigger }, className);
|
|
29
|
+
}
|
|
30
|
+
/** Content prop bag: just the slot anchor (the popup surface paint is owned by the composed Surface). */
|
|
31
|
+
function contentProps({ className } = {}) {
|
|
32
|
+
return withClassName({ "data-slot": MENU_SLOTS.content }, className);
|
|
33
|
+
}
|
|
34
|
+
/** Group prop bag: just the slot anchor. */
|
|
35
|
+
function groupProps({ className } = {}) {
|
|
36
|
+
return withClassName({ "data-slot": MENU_SLOTS.group }, className);
|
|
37
|
+
}
|
|
38
|
+
/** Group-label prop bag: just the slot anchor. */
|
|
39
|
+
function groupLabelProps({ className } = {}) {
|
|
40
|
+
return withClassName({ "data-slot": MENU_SLOTS.groupLabel }, className);
|
|
41
|
+
}
|
|
42
|
+
/** Item prop bag: slot anchor plus the `data-variant` tone and `data-highlighted`/`data-disabled` state. */
|
|
43
|
+
function itemProps({ tone = "default", highlighted, disabled, className } = {}) {
|
|
44
|
+
return withClassName({
|
|
45
|
+
"data-slot": MENU_SLOTS.item,
|
|
46
|
+
"data-variant": tone,
|
|
47
|
+
"data-highlighted": flag(highlighted),
|
|
48
|
+
"data-disabled": flag(disabled)
|
|
49
|
+
}, className);
|
|
50
|
+
}
|
|
51
|
+
/** Link-item prop bag: like `itemProps`, but anchors on the link-item slot (a navigable `<a>` row). */
|
|
52
|
+
function linkItemProps({ tone = "default", highlighted, disabled, className } = {}) {
|
|
53
|
+
return withClassName({
|
|
54
|
+
"data-slot": MENU_SLOTS.linkItem,
|
|
55
|
+
"data-variant": tone,
|
|
56
|
+
"data-highlighted": flag(highlighted),
|
|
57
|
+
"data-disabled": flag(disabled)
|
|
58
|
+
}, className);
|
|
59
|
+
}
|
|
60
|
+
/** Checkbox-item prop bag: slot anchor plus the `data-highlighted`/`data-disabled` state. */
|
|
61
|
+
function checkboxItemProps({ highlighted, disabled, className } = {}) {
|
|
62
|
+
return withClassName({
|
|
63
|
+
"data-slot": MENU_SLOTS.checkboxItem,
|
|
64
|
+
"data-highlighted": flag(highlighted),
|
|
65
|
+
"data-disabled": flag(disabled)
|
|
66
|
+
}, className);
|
|
67
|
+
}
|
|
68
|
+
/** Radio-group prop bag: just the slot anchor. */
|
|
69
|
+
function radioGroupProps({ className } = {}) {
|
|
70
|
+
return withClassName({ "data-slot": MENU_SLOTS.radioGroup }, className);
|
|
71
|
+
}
|
|
72
|
+
/** Radio-item prop bag: slot anchor plus the `data-highlighted`/`data-disabled` state. */
|
|
73
|
+
function radioItemProps({ highlighted, disabled, className } = {}) {
|
|
74
|
+
return withClassName({
|
|
75
|
+
"data-slot": MENU_SLOTS.radioItem,
|
|
76
|
+
"data-highlighted": flag(highlighted),
|
|
77
|
+
"data-disabled": flag(disabled)
|
|
78
|
+
}, className);
|
|
79
|
+
}
|
|
80
|
+
/** Submenu-trigger prop bag: slot anchor plus the `data-highlighted`/`data-disabled` state. */
|
|
81
|
+
function submenuTriggerProps({ highlighted, disabled, className } = {}) {
|
|
82
|
+
return withClassName({
|
|
83
|
+
"data-slot": MENU_SLOTS.submenuTrigger,
|
|
84
|
+
"data-highlighted": flag(highlighted),
|
|
85
|
+
"data-disabled": flag(disabled)
|
|
86
|
+
}, className);
|
|
87
|
+
}
|
|
88
|
+
/** Shortcut prop bag: just the slot anchor. */
|
|
89
|
+
function shortcutProps({ className } = {}) {
|
|
90
|
+
return withClassName({ "data-slot": MENU_SLOTS.shortcut }, className);
|
|
91
|
+
}
|
|
92
|
+
/** Separator prop bag: just the slot anchor. */
|
|
93
|
+
function separatorProps({ className } = {}) {
|
|
94
|
+
return withClassName({ "data-slot": MENU_SLOTS.separator }, className);
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { checkboxItemProps, contentProps, groupLabelProps, groupProps, itemProps, linkItemProps, radioGroupProps, radioItemProps, separatorProps, shortcutProps, submenuTriggerProps, triggerProps };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region src/components/menu/menu.slots.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The `data-*` hooks `Menu` 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 Menu — pair a slot with a state
|
|
5
|
+
* to target, say, the trigger only while its menu is open.
|
|
6
|
+
*/
|
|
7
|
+
declare enum MenuDataAttributes {
|
|
8
|
+
/** The trigger element. */
|
|
9
|
+
trigger = "data-slot",
|
|
10
|
+
/** Present on the trigger — and on a submenu trigger — while its menu is open. */
|
|
11
|
+
popupOpen = "data-popup-open",
|
|
12
|
+
/** The item's visual variant, mirroring its `tone` prop (`default`/`danger`); the component layer keys the row's token defaults off it. */
|
|
13
|
+
variant = "data-variant",
|
|
14
|
+
/** Present on the menu item the pointer or keyboard is currently over. */
|
|
15
|
+
highlighted = "data-highlighted",
|
|
16
|
+
/** Present on a disabled menu item. */
|
|
17
|
+
disabled = "data-disabled",
|
|
18
|
+
/** Present on a ticked checkbox item or the selected radio item (and its indicator). */
|
|
19
|
+
checked = "data-checked",
|
|
20
|
+
/** Present on an unticked checkbox item or an unselected radio item (and its indicator). */
|
|
21
|
+
unchecked = "data-unchecked",
|
|
22
|
+
/** The side of the anchor the content actually rendered on (`bottom`, `inline-end`, …). */
|
|
23
|
+
side = "data-side",
|
|
24
|
+
/** Present on the content for the first frame after mount — the transition's start state. */
|
|
25
|
+
startingStyle = "data-starting-style",
|
|
26
|
+
/** Present on the content while it transitions out before unmounting. */
|
|
27
|
+
endingStyle = "data-ending-style",
|
|
28
|
+
/** Present on the content when the change should not animate (keyboard open, dismissal). */
|
|
29
|
+
instant = "data-instant"
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { MenuDataAttributes };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
//#region src/components/menu/menu.slots.ts
|
|
2
|
+
/**
|
|
3
|
+
* The slot vocabulary every `Menu` part stamps as its `data-slot`. The authored source the
|
|
4
|
+
* orchestration file reads from, prefixed `noctis-{component}-{part}` (the precompiled `menu.css`
|
|
5
|
+
* keys every rule off these anchors); SLOTS.md still generates from the token-graph declarations.
|
|
6
|
+
*
|
|
7
|
+
* `positioner` and `insetSpacer` are styling-only anchors (a z-index wrapper and the icon-column
|
|
8
|
+
* spacer) — they carry no token mints, so they live here but not in the token-graph anatomy.
|
|
9
|
+
*/
|
|
10
|
+
const MENU_SLOTS = {
|
|
11
|
+
trigger: "noctis-menu-trigger",
|
|
12
|
+
positioner: "noctis-menu-positioner",
|
|
13
|
+
content: "noctis-menu-content",
|
|
14
|
+
viewport: "noctis-menu-viewport",
|
|
15
|
+
group: "noctis-menu-group",
|
|
16
|
+
groupLabel: "noctis-menu-group-label",
|
|
17
|
+
item: "noctis-menu-item",
|
|
18
|
+
linkItem: "noctis-menu-link-item",
|
|
19
|
+
checkboxItem: "noctis-menu-checkbox-item",
|
|
20
|
+
itemIndicator: "noctis-menu-item-indicator",
|
|
21
|
+
radioGroup: "noctis-menu-radio-group",
|
|
22
|
+
radioItem: "noctis-menu-radio-item",
|
|
23
|
+
radioDot: "noctis-menu-radio-dot",
|
|
24
|
+
insetSpacer: "noctis-menu-inset-spacer",
|
|
25
|
+
submenuTrigger: "noctis-menu-submenu-trigger",
|
|
26
|
+
shortcut: "noctis-menu-shortcut",
|
|
27
|
+
separator: "noctis-menu-separator"
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The `data-*` hooks `Menu` stamps on its parts, for host-side styling and tests. Slot values mark
|
|
31
|
+
* each rendered element; the state attributes are emitted by Base UI's Menu — pair a slot with a state
|
|
32
|
+
* to target, say, the trigger only while its menu is open.
|
|
33
|
+
*/
|
|
34
|
+
let MenuDataAttributes = /* @__PURE__ */ function(MenuDataAttributes) {
|
|
35
|
+
/** The trigger element. */
|
|
36
|
+
MenuDataAttributes["trigger"] = "data-slot";
|
|
37
|
+
/** Present on the trigger — and on a submenu trigger — while its menu is open. */
|
|
38
|
+
MenuDataAttributes["popupOpen"] = "data-popup-open";
|
|
39
|
+
/** The item's visual variant, mirroring its `tone` prop (`default`/`danger`); the component layer keys the row's token defaults off it. */
|
|
40
|
+
MenuDataAttributes["variant"] = "data-variant";
|
|
41
|
+
/** Present on the menu item the pointer or keyboard is currently over. */
|
|
42
|
+
MenuDataAttributes["highlighted"] = "data-highlighted";
|
|
43
|
+
/** Present on a disabled menu item. */
|
|
44
|
+
MenuDataAttributes["disabled"] = "data-disabled";
|
|
45
|
+
/** Present on a ticked checkbox item or the selected radio item (and its indicator). */
|
|
46
|
+
MenuDataAttributes["checked"] = "data-checked";
|
|
47
|
+
/** Present on an unticked checkbox item or an unselected radio item (and its indicator). */
|
|
48
|
+
MenuDataAttributes["unchecked"] = "data-unchecked";
|
|
49
|
+
/** The side of the anchor the content actually rendered on (`bottom`, `inline-end`, …). */
|
|
50
|
+
MenuDataAttributes["side"] = "data-side";
|
|
51
|
+
/** Present on the content for the first frame after mount — the transition's start state. */
|
|
52
|
+
MenuDataAttributes["startingStyle"] = "data-starting-style";
|
|
53
|
+
/** Present on the content while it transitions out before unmounting. */
|
|
54
|
+
MenuDataAttributes["endingStyle"] = "data-ending-style";
|
|
55
|
+
/** Present on the content when the change should not animate (keyboard open, dismissal). */
|
|
56
|
+
MenuDataAttributes["instant"] = "data-instant";
|
|
57
|
+
return MenuDataAttributes;
|
|
58
|
+
}({});
|
|
59
|
+
//#endregion
|
|
60
|
+
export { MENU_SLOTS, MenuDataAttributes };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, use } from "react";
|
|
3
|
+
//#region src/components/menubar/menubar.context.ts
|
|
4
|
+
/** Context carrying the bar's size from `Menubar.Root` to each `Menubar.Trigger`. */
|
|
5
|
+
const MenubarContext = createContext(null);
|
|
6
|
+
/** Read the surrounding `Menubar.Root` state; throws if a part is rendered outside one. */
|
|
7
|
+
function useMenubarContext(part) {
|
|
8
|
+
const context = use(MenubarContext);
|
|
9
|
+
if (context === null) throw new Error(`Menubar.${part} must be rendered inside a Menubar.Root.`);
|
|
10
|
+
return context;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { MenubarContext, useMenubarContext };
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { IconGlyph } from "../../icons/glyphs.js";
|
|
2
|
+
import { menu_d_exports } from "../../primitives/menu.js";
|
|
3
|
+
import { menubar_d_exports } from "../../primitives/menubar.js";
|
|
4
|
+
import { MenubarSize, rootProps, triggerProps } from "./menubar.props.js";
|
|
5
|
+
import { ReactElement } from "react";
|
|
6
|
+
|
|
7
|
+
//#region src/components/menubar/menubar.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* The bar that holds the top-level menus. A roving-tabindex `role="menubar"` row: arrow keys move the
|
|
10
|
+
* roving focus between triggers, Home/End jump to the first/last, and opening one menu while another is
|
|
11
|
+
* open switches to it. `Modal` by default — while a menu is open, outside content is inert and page
|
|
12
|
+
* scroll is locked; set `modal={false}` for a lighter bar that leaves the page interactive.
|
|
13
|
+
*/
|
|
14
|
+
declare function MenubarRoot({
|
|
15
|
+
size,
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
}: Menubar.Root.Props): ReactElement;
|
|
19
|
+
/**
|
|
20
|
+
* Owns one top-level menu's open state. Renders no element of its own — wrap a `Menubar.Trigger` and a
|
|
21
|
+
* `Menu.Content` (plus the `Menu` rows). It is `Menu.Root` under the hood, so it inherits every Menu
|
|
22
|
+
* behaviour (keyboard, typeahead, dismissal) and is detected by the surrounding bar as one of its
|
|
23
|
+
* menus, switching on hover/arrow between siblings.
|
|
24
|
+
*/
|
|
25
|
+
declare function MenubarMenu(props: Menubar.Menu.Props): ReactElement;
|
|
26
|
+
/**
|
|
27
|
+
* A top-level trigger in the bar — the labelled button that opens its menu. A menubar trigger is a
|
|
28
|
+
* bare word by platform convention (macOS / VS Code / Word), so no chevron is shown by default; opt
|
|
29
|
+
* one in with `chevron` for the rare dropdown-button-in-a-bar case. An optional leading `icon` covers
|
|
30
|
+
* a brand / app-menu slot. The button is styled as a quiet ghost that lights up on highlight and stays
|
|
31
|
+
* lit while its menu is open.
|
|
32
|
+
*/
|
|
33
|
+
declare function MenubarTrigger({
|
|
34
|
+
icon,
|
|
35
|
+
chevron,
|
|
36
|
+
className,
|
|
37
|
+
children,
|
|
38
|
+
...props
|
|
39
|
+
}: Menubar.Trigger.Props): ReactElement;
|
|
40
|
+
/**
|
|
41
|
+
* The trailing overflow trigger for the VS Code spillover model — an icon-only `menuitem` that holds
|
|
42
|
+
* the menus which don't fit the bar. Drop it inside a final `Menubar.Menu` in place of a
|
|
43
|
+
* `Menubar.Trigger`, then fill the dropdown with the spillover menus (as `Menu.Item`s or nested
|
|
44
|
+
* `Menu.SubmenuRoot`s):
|
|
45
|
+
*
|
|
46
|
+
* <Menubar.Menu>
|
|
47
|
+
* <Menubar.Overflow />
|
|
48
|
+
* <Menu.Content>…the menus that spilled…</Menu.Content>
|
|
49
|
+
* </Menubar.Menu>
|
|
50
|
+
*
|
|
51
|
+
* Defaults to a `…` glyph and a localized `"More menus"` `aria-label` (override either). Styled as the
|
|
52
|
+
* same ghost as a `Menubar.Trigger`, squared off for the single glyph via `data-overflow`.
|
|
53
|
+
*/
|
|
54
|
+
declare function MenubarOverflow({
|
|
55
|
+
icon,
|
|
56
|
+
className,
|
|
57
|
+
...props
|
|
58
|
+
}: Menubar.Overflow.Props): ReactElement;
|
|
59
|
+
/**
|
|
60
|
+
* An application menu bar: a row of top-level menus whose dropdowns share one visual language with the
|
|
61
|
+
* `Menu` component. Built on Base UI's Menubar + Menu for the roving-tabindex bar, the arrow-between-
|
|
62
|
+
* menus keyboard model, switch-on-hover, focus management, and `Escape`/outside-click dismissal.
|
|
63
|
+
*
|
|
64
|
+
* Compose from parts: `Menubar.Root` is the bar, each `Menubar.Menu` owns one menu's open state, its
|
|
65
|
+
* `Menubar.Trigger` opens it, and the dropdown is a `Menu.Content` holding the usual `Menu` rows —
|
|
66
|
+
* `Menu.Item`, `Menu.CheckboxItem`, `Menu.RadioGroup`/`RadioItem`, `Menu.Group` with a `GroupLabel`,
|
|
67
|
+
* `Menu.Separator`, `Menu.Shortcut`, and nested submenus via `Menu.SubmenuRoot`. Menubar ships no item
|
|
68
|
+
* parts of its own — reach for `Menu`'s, so a bar menu and a standalone dropdown look identical.
|
|
69
|
+
*
|
|
70
|
+
* Styling is precompiled in `menubar.css` (bar + trigger) and `menu.css` (the dropdown). Each part also
|
|
71
|
+
* carries the D12 `props()` escape hatch via `Object.assign` (e.g. `Menubar.Trigger.props({ open })`),
|
|
72
|
+
* returning a spreadable `{ "data-slot": "noctis-menubar-<part>", ...dataAttrs }` bag for a foreign
|
|
73
|
+
* element a `<Menubar.*>` can't wrap.
|
|
74
|
+
*
|
|
75
|
+
* The runtime compound is a plain object (kept tree-shakeable); per-part prop and state types are
|
|
76
|
+
* exposed through the matching `Menubar` namespace — e.g. `Menubar.Trigger.Props`.
|
|
77
|
+
*/
|
|
78
|
+
declare const Menubar: {
|
|
79
|
+
Root: typeof MenubarRoot & {
|
|
80
|
+
props: typeof rootProps;
|
|
81
|
+
};
|
|
82
|
+
Menu: typeof MenubarMenu;
|
|
83
|
+
Trigger: typeof MenubarTrigger & {
|
|
84
|
+
props: typeof triggerProps;
|
|
85
|
+
};
|
|
86
|
+
Overflow: typeof MenubarOverflow;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Per-part prop and state types, mirroring Base UI's `Component.Part.Props` convention. Types-only —
|
|
90
|
+
* it emits no runtime code and merges with the `Menubar` object above, so `Menubar.Trigger` is the
|
|
91
|
+
* component value while `Menubar.Trigger.Props` is its prop type.
|
|
92
|
+
*/
|
|
93
|
+
declare namespace Menubar {
|
|
94
|
+
/** The size step a menubar renders at; re-points the trigger metrics. */
|
|
95
|
+
type Size = MenubarSize;
|
|
96
|
+
namespace Root {
|
|
97
|
+
type Props = Omit<menubar_d_exports.Menubar.Props, "modal" | "loopFocus" | "orientation" | "disabled"> & {
|
|
98
|
+
/**
|
|
99
|
+
* The bar's size step, re-pointing the trigger height, padding, and label size.
|
|
100
|
+
* @default "md"
|
|
101
|
+
*/
|
|
102
|
+
size?: MenubarSize;
|
|
103
|
+
/**
|
|
104
|
+
* Whether an open menu is modal — outside content is made inert and page scroll is locked
|
|
105
|
+
* while a menu is open. Set `false` for a lighter bar that leaves the page interactive.
|
|
106
|
+
* @default true
|
|
107
|
+
*/
|
|
108
|
+
modal?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Whether arrow-key roving wraps from the last trigger back to the first (and vice versa).
|
|
111
|
+
* @default true
|
|
112
|
+
*/
|
|
113
|
+
loopFocus?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* The bar's layout axis. `vertical` stacks the triggers into a left-aligned rail and mirrors
|
|
116
|
+
* the arrow-key model (Up/Down traverse the bar); the value is stamped as `data-orientation`.
|
|
117
|
+
* @default "horizontal"
|
|
118
|
+
*/
|
|
119
|
+
orientation?: menubar_d_exports.Menubar.Props["orientation"];
|
|
120
|
+
/**
|
|
121
|
+
* Whether the whole bar is disabled — every trigger reads as unavailable but stays in the
|
|
122
|
+
* roving order (APG: disabled menu items remain focusable).
|
|
123
|
+
* @default false
|
|
124
|
+
*/
|
|
125
|
+
disabled?: boolean;
|
|
126
|
+
};
|
|
127
|
+
type State = menubar_d_exports.Menubar.State;
|
|
128
|
+
}
|
|
129
|
+
namespace Menu {
|
|
130
|
+
type Props = Omit<menu_d_exports.Menu.Root.Props, "open" | "defaultOpen" | "onOpenChange"> & {
|
|
131
|
+
/**
|
|
132
|
+
* Controls whether this menu is open. Pair with `onOpenChange` to drive which menu is open
|
|
133
|
+
* from host state — Base UI's Menubar tracks the open menu per `Menubar.Menu`, so the
|
|
134
|
+
* controlled-open seam lives here, not on `Menubar.Root`.
|
|
135
|
+
*/
|
|
136
|
+
open?: menu_d_exports.Menu.Root.Props["open"]; /** The menu's initial open state when uncontrolled. */
|
|
137
|
+
defaultOpen?: menu_d_exports.Menu.Root.Props["defaultOpen"]; /** Called when this menu opens or closes (pointer, keyboard, or sibling-switch). */
|
|
138
|
+
onOpenChange?: menu_d_exports.Menu.Root.Props["onOpenChange"];
|
|
139
|
+
};
|
|
140
|
+
type State = menu_d_exports.Menu.Root.State;
|
|
141
|
+
}
|
|
142
|
+
namespace Overflow {
|
|
143
|
+
type Props = menu_d_exports.Menu.Trigger.Props & {
|
|
144
|
+
/** The overflow glyph. @default MoreHorizontalIcon (`…`) */icon?: IconGlyph;
|
|
145
|
+
};
|
|
146
|
+
type State = menu_d_exports.Menu.Trigger.State;
|
|
147
|
+
}
|
|
148
|
+
namespace Trigger {
|
|
149
|
+
type Props = menu_d_exports.Menu.Trigger.Props & {
|
|
150
|
+
/** Optional leading glyph — a brand / app-menu affordance; off-pattern for ordinary menus. */icon?: IconGlyph;
|
|
151
|
+
/**
|
|
152
|
+
* Show a trailing dropdown chevron. Off by default — a menubar trigger is a bare word by
|
|
153
|
+
* platform convention; opt in only for a dropdown-button-style trigger.
|
|
154
|
+
* @default false
|
|
155
|
+
*/
|
|
156
|
+
chevron?: boolean;
|
|
157
|
+
};
|
|
158
|
+
type State = menu_d_exports.Menu.Trigger.State;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
162
|
+
export { Menubar };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Icon } from "../../icons/icon.js";
|
|
3
|
+
import { ChevronDownIcon, MoreHorizontalIcon } from "../../icons/glyphs.js";
|
|
4
|
+
import { useNoctisStringFormatter } from "../../core/use-injected-labels.js";
|
|
5
|
+
import { menu_exports } from "../../primitives/menu.js";
|
|
6
|
+
import { menubar_exports } from "../../primitives/menubar.js";
|
|
7
|
+
import { MenubarContext, useMenubarContext } from "./menubar.context.js";
|
|
8
|
+
import { MENUBAR_SLOTS } from "./menubar.slots.js";
|
|
9
|
+
import { rootProps, triggerProps } from "./menubar.props.js";
|
|
10
|
+
import clsx$1 from "clsx";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
//#region src/components/menubar/menubar.tsx
|
|
13
|
+
/**
|
|
14
|
+
* The bar that holds the top-level menus. A roving-tabindex `role="menubar"` row: arrow keys move the
|
|
15
|
+
* roving focus between triggers, Home/End jump to the first/last, and opening one menu while another is
|
|
16
|
+
* open switches to it. `Modal` by default — while a menu is open, outside content is inert and page
|
|
17
|
+
* scroll is locked; set `modal={false}` for a lighter bar that leaves the page interactive.
|
|
18
|
+
*/
|
|
19
|
+
function MenubarRoot({ size = "md", className, ...props }) {
|
|
20
|
+
const { "data-size": dataSize } = rootProps({ size });
|
|
21
|
+
return /* @__PURE__ */ jsx(MenubarContext.Provider, {
|
|
22
|
+
value: { size },
|
|
23
|
+
children: /* @__PURE__ */ jsx(menubar_exports.Menubar, {
|
|
24
|
+
"data-slot": MENUBAR_SLOTS.root,
|
|
25
|
+
"data-size": dataSize,
|
|
26
|
+
className: clsx$1(className),
|
|
27
|
+
...props
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Owns one top-level menu's open state. Renders no element of its own — wrap a `Menubar.Trigger` and a
|
|
33
|
+
* `Menu.Content` (plus the `Menu` rows). It is `Menu.Root` under the hood, so it inherits every Menu
|
|
34
|
+
* behaviour (keyboard, typeahead, dismissal) and is detected by the surrounding bar as one of its
|
|
35
|
+
* menus, switching on hover/arrow between siblings.
|
|
36
|
+
*/
|
|
37
|
+
function MenubarMenu(props) {
|
|
38
|
+
return /* @__PURE__ */ jsx(menu_exports.Menu.Root, { ...props });
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A top-level trigger in the bar — the labelled button that opens its menu. A menubar trigger is a
|
|
42
|
+
* bare word by platform convention (macOS / VS Code / Word), so no chevron is shown by default; opt
|
|
43
|
+
* one in with `chevron` for the rare dropdown-button-in-a-bar case. An optional leading `icon` covers
|
|
44
|
+
* a brand / app-menu slot. The button is styled as a quiet ghost that lights up on highlight and stays
|
|
45
|
+
* lit while its menu is open.
|
|
46
|
+
*/
|
|
47
|
+
function MenubarTrigger({ icon, chevron = false, className, children, ...props }) {
|
|
48
|
+
const { size } = useMenubarContext("Trigger");
|
|
49
|
+
return /* @__PURE__ */ jsxs(menu_exports.Menu.Trigger, {
|
|
50
|
+
"data-slot": MENUBAR_SLOTS.trigger,
|
|
51
|
+
className: clsx$1(className),
|
|
52
|
+
...props,
|
|
53
|
+
children: [
|
|
54
|
+
icon ? /* @__PURE__ */ jsx(Icon, {
|
|
55
|
+
icon,
|
|
56
|
+
size: size === "sm" ? "sm" : "md"
|
|
57
|
+
}) : null,
|
|
58
|
+
children,
|
|
59
|
+
chevron ? /* @__PURE__ */ jsx(Icon, {
|
|
60
|
+
icon: ChevronDownIcon,
|
|
61
|
+
size: "sm"
|
|
62
|
+
}) : null
|
|
63
|
+
]
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The trailing overflow trigger for the VS Code spillover model — an icon-only `menuitem` that holds
|
|
68
|
+
* the menus which don't fit the bar. Drop it inside a final `Menubar.Menu` in place of a
|
|
69
|
+
* `Menubar.Trigger`, then fill the dropdown with the spillover menus (as `Menu.Item`s or nested
|
|
70
|
+
* `Menu.SubmenuRoot`s):
|
|
71
|
+
*
|
|
72
|
+
* <Menubar.Menu>
|
|
73
|
+
* <Menubar.Overflow />
|
|
74
|
+
* <Menu.Content>…the menus that spilled…</Menu.Content>
|
|
75
|
+
* </Menubar.Menu>
|
|
76
|
+
*
|
|
77
|
+
* Defaults to a `…` glyph and a localized `"More menus"` `aria-label` (override either). Styled as the
|
|
78
|
+
* same ghost as a `Menubar.Trigger`, squared off for the single glyph via `data-overflow`.
|
|
79
|
+
*/
|
|
80
|
+
function MenubarOverflow({ icon = MoreHorizontalIcon, className, ...props }) {
|
|
81
|
+
const { size } = useMenubarContext("Overflow");
|
|
82
|
+
const formatter = useNoctisStringFormatter();
|
|
83
|
+
const label = props["aria-label"] ?? formatter.format("menubar.moreMenus");
|
|
84
|
+
return /* @__PURE__ */ jsx(menu_exports.Menu.Trigger, {
|
|
85
|
+
"data-slot": MENUBAR_SLOTS.trigger,
|
|
86
|
+
"data-overflow": "",
|
|
87
|
+
className: clsx$1(className),
|
|
88
|
+
...props,
|
|
89
|
+
"aria-label": label,
|
|
90
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
91
|
+
icon,
|
|
92
|
+
size: size === "sm" ? "sm" : "md"
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* An application menu bar: a row of top-level menus whose dropdowns share one visual language with the
|
|
98
|
+
* `Menu` component. Built on Base UI's Menubar + Menu for the roving-tabindex bar, the arrow-between-
|
|
99
|
+
* menus keyboard model, switch-on-hover, focus management, and `Escape`/outside-click dismissal.
|
|
100
|
+
*
|
|
101
|
+
* Compose from parts: `Menubar.Root` is the bar, each `Menubar.Menu` owns one menu's open state, its
|
|
102
|
+
* `Menubar.Trigger` opens it, and the dropdown is a `Menu.Content` holding the usual `Menu` rows —
|
|
103
|
+
* `Menu.Item`, `Menu.CheckboxItem`, `Menu.RadioGroup`/`RadioItem`, `Menu.Group` with a `GroupLabel`,
|
|
104
|
+
* `Menu.Separator`, `Menu.Shortcut`, and nested submenus via `Menu.SubmenuRoot`. Menubar ships no item
|
|
105
|
+
* parts of its own — reach for `Menu`'s, so a bar menu and a standalone dropdown look identical.
|
|
106
|
+
*
|
|
107
|
+
* Styling is precompiled in `menubar.css` (bar + trigger) and `menu.css` (the dropdown). Each part also
|
|
108
|
+
* carries the D12 `props()` escape hatch via `Object.assign` (e.g. `Menubar.Trigger.props({ open })`),
|
|
109
|
+
* returning a spreadable `{ "data-slot": "noctis-menubar-<part>", ...dataAttrs }` bag for a foreign
|
|
110
|
+
* element a `<Menubar.*>` can't wrap.
|
|
111
|
+
*
|
|
112
|
+
* The runtime compound is a plain object (kept tree-shakeable); per-part prop and state types are
|
|
113
|
+
* exposed through the matching `Menubar` namespace — e.g. `Menubar.Trigger.Props`.
|
|
114
|
+
*/
|
|
115
|
+
const Menubar = {
|
|
116
|
+
Root: Object.assign(MenubarRoot, { props: rootProps }),
|
|
117
|
+
Menu: MenubarMenu,
|
|
118
|
+
Trigger: Object.assign(MenubarTrigger, { props: triggerProps }),
|
|
119
|
+
Overflow: MenubarOverflow
|
|
120
|
+
};
|
|
121
|
+
//#endregion
|
|
122
|
+
export { Menubar };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//#region src/components/menubar/menubar.props.d.ts
|
|
2
|
+
/** A spreadable data-attribute prop bag — the shape every `Menubar.*.props()` returns. */
|
|
3
|
+
type MenubarPartProps = {
|
|
4
|
+
/** The slot value the matching `menubar.css` rules anchor on. */"data-slot": string; /** Forwarded verbatim — styling is attribute-driven, so this is an optional consumer passthrough. */
|
|
5
|
+
className?: string; /** A data-attribute present (empty string) or absent (`undefined`); never `false`. */
|
|
6
|
+
[attr: `data-${string}`]: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
/** The size step a menubar can render at; re-points the trigger height/padding/font-size internals. */
|
|
9
|
+
type MenubarSize = "sm" | "md" | "lg";
|
|
10
|
+
/** Argument to `Menubar.Root.props(...)` — the bar's size, stamped as `data-size` for the trigger re-point. */
|
|
11
|
+
interface MenubarRootPropsArgs {
|
|
12
|
+
/** The bar's size step (`sm`/`md`/`lg`), driving the trigger metrics. @default "md" */
|
|
13
|
+
size?: MenubarSize;
|
|
14
|
+
/** Forwarded verbatim onto the returned prop bag. */
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Argument to `Menubar.Trigger.props(...)` — the top-level trigger's open/highlight/disabled state. */
|
|
18
|
+
interface MenubarTriggerPropsArgs {
|
|
19
|
+
/** Whether this trigger's menu is open (drives the lit look via `data-popup-open`). */
|
|
20
|
+
open?: boolean;
|
|
21
|
+
/** Whether the pointer/keyboard is over this trigger (drives the highlight via `data-highlighted`). */
|
|
22
|
+
highlighted?: boolean;
|
|
23
|
+
/** Whether this trigger is disabled — dims and reads as unavailable, but stays focusable (via `data-disabled`). */
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** Forwarded verbatim onto the returned prop bag. */
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/** Root (bar) prop bag: the slot anchor plus the `data-size` axis the trigger metrics re-point off. */
|
|
29
|
+
declare function rootProps({
|
|
30
|
+
size,
|
|
31
|
+
className
|
|
32
|
+
}?: MenubarRootPropsArgs): MenubarPartProps;
|
|
33
|
+
/** Trigger prop bag: the slot anchor plus the `data-popup-open`/`data-highlighted`/`data-disabled` state. */
|
|
34
|
+
declare function triggerProps({
|
|
35
|
+
open,
|
|
36
|
+
highlighted,
|
|
37
|
+
disabled,
|
|
38
|
+
className
|
|
39
|
+
}?: MenubarTriggerPropsArgs): MenubarPartProps;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { MenubarSize, rootProps, triggerProps };
|