@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,49 @@
|
|
|
1
|
+
//#region src/components/avatar/avatar.slots.ts
|
|
2
|
+
/**
|
|
3
|
+
* The slot vocabulary every `Avatar` part stamps as its `data-slot`. The authored source the
|
|
4
|
+
* orchestration file reads from, kebab-cased `{component}[-{part}]` under the `noctis-` prefix;
|
|
5
|
+
* SLOTS.md still generates from the token-graph declarations.
|
|
6
|
+
*/
|
|
7
|
+
const AVATAR_SLOTS = {
|
|
8
|
+
root: "noctis-avatar",
|
|
9
|
+
image: "noctis-avatar-image",
|
|
10
|
+
fallback: "noctis-avatar-fallback",
|
|
11
|
+
indicator: "noctis-avatar-indicator",
|
|
12
|
+
skeleton: "noctis-avatar-skeleton",
|
|
13
|
+
group: "noctis-avatar-group"
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The `data-*` hooks `Avatar` stamps on its parts, for host-side styling and tests. Slot values mark
|
|
17
|
+
* each rendered element; the `data-size`/`data-shape` axes carry the recipe the precompiled
|
|
18
|
+
* `avatar.css` keys its box metrics off, and `data-avatar-index` selects which static fallback swatch
|
|
19
|
+
* paints. The group lays out an overlapped row (`data-spacing`); its `+N` overflow chip is a
|
|
20
|
+
* non-interactive avatar-shaped count marked with `data-avatar-overflow` (it reuses the `noctis-avatar`
|
|
21
|
+
* slot so it inherits the box/overlap/ring). Base UI's Avatar drives the
|
|
22
|
+
* image-loading status the fallback shows behind, plus the `data-starting-style` enter transition the
|
|
23
|
+
* image cross-fades on.
|
|
24
|
+
*/
|
|
25
|
+
let AvatarDataAttributes = /* @__PURE__ */ function(AvatarDataAttributes) {
|
|
26
|
+
/** The root avatar element. */
|
|
27
|
+
AvatarDataAttributes["slot"] = "data-slot";
|
|
28
|
+
/** The size scale — `2xs` | `xs` | `sm` | `md` | `lg` | `xl`; the generated layer keys the per-size internals off it. */
|
|
29
|
+
AvatarDataAttributes["size"] = "data-size";
|
|
30
|
+
/** The shape — `circle` (default, fully round) | `rounded` (rounded corners). */
|
|
31
|
+
AvatarDataAttributes["shape"] = "data-shape";
|
|
32
|
+
/** `1`–`10`, the stable hashed swatch index the fallback fill reads its `bg-avatar-N` role from. */
|
|
33
|
+
AvatarDataAttributes["avatarIndex"] = "data-avatar-index";
|
|
34
|
+
/** Present when the avatar is dimmed/inactive — gates interactive states and applies the disabled opacity. */
|
|
35
|
+
AvatarDataAttributes["disabled"] = "data-disabled";
|
|
36
|
+
/** Present when the avatar carries a hairline ring separating it from its surface. */
|
|
37
|
+
AvatarDataAttributes["ring"] = "data-ring";
|
|
38
|
+
/** The indicator preset — a presence or status value; the dot reads its fill role from it. */
|
|
39
|
+
AvatarDataAttributes["preset"] = "data-preset";
|
|
40
|
+
/** The indicator's logical corner — `top` | `bottom` (default). */
|
|
41
|
+
AvatarDataAttributes["placement"] = "data-placement";
|
|
42
|
+
/** The group's overlap tightness — `tight` | `cozy` (default). */
|
|
43
|
+
AvatarDataAttributes["spacing"] = "data-spacing";
|
|
44
|
+
/** Marks the group's `+N` overflow chip (a non-interactive avatar-shaped count). */
|
|
45
|
+
AvatarDataAttributes["overflow"] = "data-avatar-overflow";
|
|
46
|
+
return AvatarDataAttributes;
|
|
47
|
+
}({});
|
|
48
|
+
//#endregion
|
|
49
|
+
export { AVATAR_SLOTS, AvatarDataAttributes };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/components/avatar/avatar.types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The size/shape/spacing/indicator vocabulary `Avatar` paints. Authored source of truth since styling
|
|
4
|
+
* is precompiled in `avatar.css`. Types-only: no runtime code, so it never participates in the styling
|
|
5
|
+
* layer.
|
|
6
|
+
*/
|
|
7
|
+
/** An avatar's footprint scale — `2xs` (inline-with-text) … `xl`. */
|
|
8
|
+
type AvatarSize = "2xs" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
9
|
+
/** An avatar's shape — fully round, or a rounded-corner box. */
|
|
10
|
+
type AvatarShape = "circle" | "rounded";
|
|
11
|
+
/** How tightly avatars overlap inside a group. */
|
|
12
|
+
type AvatarSpacing = "tight" | "cozy";
|
|
13
|
+
/**
|
|
14
|
+
* A presence (availability) indicator preset — each maps to a `--noctis-color-presence-*` role and a
|
|
15
|
+
* default localized screen-reader label.
|
|
16
|
+
*/
|
|
17
|
+
type AvatarPresence = "online" | "busy" | "focus" | "away" | "offline";
|
|
18
|
+
/**
|
|
19
|
+
* A status (contextual) indicator preset — each maps to an existing status role (`success`/`danger`/
|
|
20
|
+
* `muted`) and a default localized screen-reader label.
|
|
21
|
+
*/
|
|
22
|
+
type AvatarStatus = "approved" | "declined" | "locked";
|
|
23
|
+
/** The flat indicator preset union — presence first, then status. The preset name implies its family. */
|
|
24
|
+
type AvatarIndicatorPreset = AvatarPresence | AvatarStatus;
|
|
25
|
+
/** Which logical corner a corner indicator sits in. */
|
|
26
|
+
type AvatarIndicatorPlacement = "top" | "bottom";
|
|
27
|
+
//#endregion
|
|
28
|
+
export { AvatarIndicatorPlacement, AvatarIndicatorPreset, AvatarShape, AvatarSize, AvatarSpacing };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { IconGlyph } from "../../icons/glyphs.js";
|
|
2
|
+
import { ButtonSize, ButtonVariant } from "./button.types.js";
|
|
3
|
+
import { ButtonProps, ButtonPropsArgs, buttonProps } from "./button.props.js";
|
|
4
|
+
import { button_d_exports } from "../../primitives/button.js";
|
|
5
|
+
import { ReactElement } from "react";
|
|
6
|
+
|
|
7
|
+
//#region src/components/button/button.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* The primary action trigger, built on Base UI's `Button`. Renders a native `<button>`; pass `render`
|
|
10
|
+
* (with `nativeButton={false}` for non-button elements) to style a link or another element as a
|
|
11
|
+
* button. Loading overlays a spinner and hides the label without changing the button's footprint.
|
|
12
|
+
* Inside a {@link ButtonGroup}, an unset `variant`/`size` is inherited from the group through context,
|
|
13
|
+
* and the button stamps the group's segment marker so the group draws its seam.
|
|
14
|
+
*
|
|
15
|
+
* Styling is precompiled in `button.css`, keyed off the stable `data-button` marker (so an element a
|
|
16
|
+
* `<Button>` can't render keeps its own `data-slot`) plus the `data-variant`/`data-size`/… recipe; for
|
|
17
|
+
* such an element, spread {@link Button.props} onto it instead. `Button` also stamps the catalog
|
|
18
|
+
* `data-slot="noctis-button"` for SLOTS.md / testing. Base UI emits `data-disabled` on the rendered
|
|
19
|
+
* element, so the disabled affordance and the hover/active gates hold across every render target.
|
|
20
|
+
*
|
|
21
|
+
* @see {@link Button.Props}
|
|
22
|
+
*/
|
|
23
|
+
declare function ButtonImpl({
|
|
24
|
+
variant: variantProp,
|
|
25
|
+
size: sizeProp,
|
|
26
|
+
iconOnly,
|
|
27
|
+
fullWidth,
|
|
28
|
+
loading,
|
|
29
|
+
startIcon,
|
|
30
|
+
endIcon,
|
|
31
|
+
disabled,
|
|
32
|
+
className,
|
|
33
|
+
children,
|
|
34
|
+
...props
|
|
35
|
+
}: Button.Props): ReactElement;
|
|
36
|
+
/**
|
|
37
|
+
* The action trigger. The component value carries the D12 `props()` escape hatch via `Object.assign`:
|
|
38
|
+
* spread `Button.props({ variant, size, iconOnly, fullWidth, loading, disabled })` onto an element a
|
|
39
|
+
* `<Button>` can't render to style it as a button. It returns a spreadable `{ "data-button": "",
|
|
40
|
+
* ...dataAttrs }` bag (the marker, never `data-slot`) the precompiled `button.css` keys off — the
|
|
41
|
+
* data-attribute-native replacement for the old `buttonVariants` class-string helper.
|
|
42
|
+
*/
|
|
43
|
+
declare const Button: typeof ButtonImpl & {
|
|
44
|
+
props: typeof buttonProps;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Per-part prop and variant types. Merges with the `Button` function above, so `Button` is the component
|
|
48
|
+
* value while `Button.Props` is its prop type and `Button.props` is the escape-hatch helper.
|
|
49
|
+
*/
|
|
50
|
+
declare namespace Button {
|
|
51
|
+
type Props = Omit<button_d_exports.Button.Props, "className"> & {
|
|
52
|
+
/**
|
|
53
|
+
* Visual emphasis. Inherited from an enclosing `ButtonGroup` when unset.
|
|
54
|
+
* @default "primary"
|
|
55
|
+
*/
|
|
56
|
+
variant?: ButtonVariant;
|
|
57
|
+
/**
|
|
58
|
+
* Size scale — height, padding, and text. Inherited from an enclosing `ButtonGroup` when unset.
|
|
59
|
+
* @default "md"
|
|
60
|
+
*/
|
|
61
|
+
size?: ButtonSize;
|
|
62
|
+
/**
|
|
63
|
+
* Square the button for a single icon. Provide an `aria-label` — there is no visible text to name it.
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
iconOnly?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Stretch the button to its container's width.
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
fullWidth?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Replace the content with a centered spinner and block interaction, keeping the button's size.
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
loading?: boolean; /** Leading glyph, before the label. */
|
|
77
|
+
startIcon?: IconGlyph; /** Trailing glyph, after the label. */
|
|
78
|
+
endIcon?: IconGlyph; /** Merged onto the rendered element's class list. */
|
|
79
|
+
className?: string;
|
|
80
|
+
};
|
|
81
|
+
/** Visual emphasis of the button. */
|
|
82
|
+
type Variant = ButtonVariant;
|
|
83
|
+
/** Height/padding/text scale. */
|
|
84
|
+
type Size = ButtonSize;
|
|
85
|
+
/** Argument to the `Button.props(...)` escape-hatch helper. */
|
|
86
|
+
type PropsArgs = ButtonPropsArgs;
|
|
87
|
+
/** The spreadable data-attribute prop bag `Button.props()` returns (D12). */
|
|
88
|
+
type PartProps = ButtonProps;
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
export { Button };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Icon } from "../../icons/icon.js";
|
|
3
|
+
import { SpinnerIcon } from "../../icons/glyphs.js";
|
|
4
|
+
import { button_exports } from "../../primitives/button.js";
|
|
5
|
+
import { useButtonGroup } from "../button-group/button-group.context.js";
|
|
6
|
+
import { buttonProps } from "./button.props.js";
|
|
7
|
+
import { BUTTON_SLOTS } from "./button.slots.js";
|
|
8
|
+
import clsx$1 from "clsx";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/button/button.tsx
|
|
11
|
+
/** The icon size that pairs with each button size. */
|
|
12
|
+
const GLYPH_SIZE = {
|
|
13
|
+
xs: "xs",
|
|
14
|
+
sm: "sm",
|
|
15
|
+
md: "md",
|
|
16
|
+
lg: "md"
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The primary action trigger, built on Base UI's `Button`. Renders a native `<button>`; pass `render`
|
|
20
|
+
* (with `nativeButton={false}` for non-button elements) to style a link or another element as a
|
|
21
|
+
* button. Loading overlays a spinner and hides the label without changing the button's footprint.
|
|
22
|
+
* Inside a {@link ButtonGroup}, an unset `variant`/`size` is inherited from the group through context,
|
|
23
|
+
* and the button stamps the group's segment marker so the group draws its seam.
|
|
24
|
+
*
|
|
25
|
+
* Styling is precompiled in `button.css`, keyed off the stable `data-button` marker (so an element a
|
|
26
|
+
* `<Button>` can't render keeps its own `data-slot`) plus the `data-variant`/`data-size`/… recipe; for
|
|
27
|
+
* such an element, spread {@link Button.props} onto it instead. `Button` also stamps the catalog
|
|
28
|
+
* `data-slot="noctis-button"` for SLOTS.md / testing. Base UI emits `data-disabled` on the rendered
|
|
29
|
+
* element, so the disabled affordance and the hover/active gates hold across every render target.
|
|
30
|
+
*
|
|
31
|
+
* @see {@link Button.Props}
|
|
32
|
+
*/
|
|
33
|
+
function ButtonImpl({ variant: variantProp, size: sizeProp, iconOnly = false, fullWidth = false, loading = false, startIcon, endIcon, disabled = false, className, children, ...props }) {
|
|
34
|
+
const group = useButtonGroup();
|
|
35
|
+
const variant = variantProp ?? group?.variant;
|
|
36
|
+
const size = sizeProp ?? group?.size ?? "md";
|
|
37
|
+
const glyphSize = GLYPH_SIZE[size];
|
|
38
|
+
const { className: _omit, "data-disabled": _disabled, ...recipe } = buttonProps({
|
|
39
|
+
variant,
|
|
40
|
+
size,
|
|
41
|
+
iconOnly,
|
|
42
|
+
fullWidth,
|
|
43
|
+
loading
|
|
44
|
+
});
|
|
45
|
+
return /* @__PURE__ */ jsxs(button_exports.Button, {
|
|
46
|
+
...recipe,
|
|
47
|
+
"data-slot": BUTTON_SLOTS.root,
|
|
48
|
+
"data-button-group-item": group ? "" : void 0,
|
|
49
|
+
disabled: disabled || loading,
|
|
50
|
+
"aria-busy": loading || void 0,
|
|
51
|
+
className: clsx$1(className),
|
|
52
|
+
...props,
|
|
53
|
+
children: [loading ? /* @__PURE__ */ jsx("span", {
|
|
54
|
+
"data-slot": BUTTON_SLOTS.spinner,
|
|
55
|
+
"aria-hidden": "true",
|
|
56
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
57
|
+
icon: SpinnerIcon,
|
|
58
|
+
size: glyphSize
|
|
59
|
+
})
|
|
60
|
+
}) : null, /* @__PURE__ */ jsxs("span", { children: [
|
|
61
|
+
startIcon ? /* @__PURE__ */ jsx(Icon, {
|
|
62
|
+
icon: startIcon,
|
|
63
|
+
size: glyphSize
|
|
64
|
+
}) : null,
|
|
65
|
+
children,
|
|
66
|
+
endIcon ? /* @__PURE__ */ jsx(Icon, {
|
|
67
|
+
icon: endIcon,
|
|
68
|
+
size: glyphSize
|
|
69
|
+
}) : null
|
|
70
|
+
] })]
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The action trigger. The component value carries the D12 `props()` escape hatch via `Object.assign`:
|
|
75
|
+
* spread `Button.props({ variant, size, iconOnly, fullWidth, loading, disabled })` onto an element a
|
|
76
|
+
* `<Button>` can't render to style it as a button. It returns a spreadable `{ "data-button": "",
|
|
77
|
+
* ...dataAttrs }` bag (the marker, never `data-slot`) the precompiled `button.css` keys off — the
|
|
78
|
+
* data-attribute-native replacement for the old `buttonVariants` class-string helper.
|
|
79
|
+
*/
|
|
80
|
+
const Button = Object.assign(ButtonImpl, { props: buttonProps });
|
|
81
|
+
//#endregion
|
|
82
|
+
export { Button };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ButtonSize, ButtonVariant } from "./button.types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/button/button.props.d.ts
|
|
4
|
+
/** A spreadable data-attribute prop bag — the shape `Button.props()` returns. Carries the marker, never `data-slot`. */
|
|
5
|
+
type ButtonProps = {
|
|
6
|
+
/** The stable styling marker `button.css` keys every rule off — present regardless of a foreign host's `data-slot`. */"data-button": ""; /** Forwarded verbatim — styling is attribute-driven, so this is an optional consumer passthrough. */
|
|
7
|
+
className?: string; /** A data-attribute present (string) or absent (`undefined`); never `false`. */
|
|
8
|
+
[attr: `data-${string}`]: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
/** Argument to `Button.props(...)` — the recipe the `button.css` rules key their look off. */
|
|
11
|
+
interface ButtonPropsArgs {
|
|
12
|
+
/**
|
|
13
|
+
* Visual emphasis.
|
|
14
|
+
* @default "primary"
|
|
15
|
+
*/
|
|
16
|
+
variant?: ButtonVariant;
|
|
17
|
+
/**
|
|
18
|
+
* Size scale — height, padding, and text.
|
|
19
|
+
* @default "md"
|
|
20
|
+
*/
|
|
21
|
+
size?: ButtonSize;
|
|
22
|
+
/** Square the button for a single icon. */
|
|
23
|
+
iconOnly?: boolean;
|
|
24
|
+
/** Stretch the button to its container's width. */
|
|
25
|
+
fullWidth?: boolean;
|
|
26
|
+
/** Replace the content with the spinner overlay and hide the label in place. */
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
/** Mark the button disabled — drives the not-allowed affordance and gates hover/active. */
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/** Forwarded verbatim onto the returned prop bag. */
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Button prop bag: the `data-button` marker plus the `data-variant`/`data-size`/`data-icon-only`/
|
|
35
|
+
* `data-full-width`/`data-loading`/`data-disabled` the `button.css` rules read. The escape hatch for an
|
|
36
|
+
* element a `<Button>` can't render — it styles the element as a button without touching its `data-slot`.
|
|
37
|
+
*/
|
|
38
|
+
declare function buttonProps({
|
|
39
|
+
variant,
|
|
40
|
+
size,
|
|
41
|
+
iconOnly,
|
|
42
|
+
fullWidth,
|
|
43
|
+
loading,
|
|
44
|
+
disabled,
|
|
45
|
+
className
|
|
46
|
+
}?: ButtonPropsArgs): ButtonProps;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { ButtonProps, ButtonPropsArgs, buttonProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/components/button/button.props.ts
|
|
2
|
+
/** Stamp a boolean axis as `"true"` when on, absent (`undefined`) when off (mirrors the `tv()` boolean variant). */
|
|
3
|
+
const boolAttr = (on) => on ? "true" : void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Button prop bag: the `data-button` marker plus the `data-variant`/`data-size`/`data-icon-only`/
|
|
6
|
+
* `data-full-width`/`data-loading`/`data-disabled` the `button.css` rules read. The escape hatch for an
|
|
7
|
+
* element a `<Button>` can't render — it styles the element as a button without touching its `data-slot`.
|
|
8
|
+
*/
|
|
9
|
+
function buttonProps({ variant = "primary", size = "md", iconOnly, fullWidth, loading, disabled, className } = {}) {
|
|
10
|
+
const bag = {
|
|
11
|
+
"data-button": "",
|
|
12
|
+
"data-variant": variant,
|
|
13
|
+
"data-size": size,
|
|
14
|
+
"data-icon-only": boolAttr(iconOnly),
|
|
15
|
+
"data-full-width": boolAttr(fullWidth),
|
|
16
|
+
"data-loading": boolAttr(loading),
|
|
17
|
+
"data-disabled": disabled ? "" : void 0
|
|
18
|
+
};
|
|
19
|
+
return className === void 0 ? bag : {
|
|
20
|
+
...bag,
|
|
21
|
+
className
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { buttonProps };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/components/button/button.slots.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The data attributes the {@link Button} (and the Base UI button it renders) expose for styling and
|
|
4
|
+
* testing. Each member's value is the attribute name and its JSDoc is the description; the docs API
|
|
5
|
+
* reference reads this enum directly, so the documented attributes can't drift from the component.
|
|
6
|
+
*
|
|
7
|
+
* Styling keys off the stable `data-button` **marker**, not `data-slot`: `Button.props()` styles a
|
|
8
|
+
* foreign element (a link, the rail's close trigger) without clobbering that element's own `data-slot`,
|
|
9
|
+
* so the marker — plus the variant/state axes below — is the precompiled `button.css` styling hook.
|
|
10
|
+
*/
|
|
11
|
+
declare enum ButtonDataAttributes {
|
|
12
|
+
/** The catalog slot that marks the rendered element as a Button for SLOTS.md and testing hooks. */
|
|
13
|
+
slot = "data-slot",
|
|
14
|
+
/** The stable styling marker every `button.css` rule keys off — always present, independent of `data-slot`. */
|
|
15
|
+
button = "data-button",
|
|
16
|
+
/** The visual emphasis — `primary` | `accent` | `secondary` | `outline` | `ghost` | `danger` | `link`. */
|
|
17
|
+
variant = "data-variant",
|
|
18
|
+
/** The size scale — `xs` | `sm` | `md` | `lg`; the generated layer keys the per-size internals off it. */
|
|
19
|
+
size = "data-size",
|
|
20
|
+
/** Present (`true`) when the button is squared for a single icon. */
|
|
21
|
+
iconOnly = "data-icon-only",
|
|
22
|
+
/** Present (`true`) when the button stretches to its container's width. */
|
|
23
|
+
fullWidth = "data-full-width",
|
|
24
|
+
/** Present (`true`) while loading — hides the content row in place behind the spinner overlay. */
|
|
25
|
+
loading = "data-loading",
|
|
26
|
+
/** Present when the button is disabled (including while `loading`). */
|
|
27
|
+
disabled = "data-disabled"
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { ButtonDataAttributes };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//#region src/components/button/button.slots.ts
|
|
2
|
+
/**
|
|
3
|
+
* The slot vocabulary every `Button` part stamps as its `data-slot`. The authored source the
|
|
4
|
+
* orchestration file reads from, kebab-cased `{component}[-{part}]` under the `noctis-` prefix; SLOTS.md
|
|
5
|
+
* still generates from the token-graph declarations.
|
|
6
|
+
*/
|
|
7
|
+
const BUTTON_SLOTS = {
|
|
8
|
+
root: "noctis-button",
|
|
9
|
+
spinner: "noctis-button-spinner"
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The data attributes the {@link Button} (and the Base UI button it renders) expose for styling and
|
|
13
|
+
* testing. Each member's value is the attribute name and its JSDoc is the description; the docs API
|
|
14
|
+
* reference reads this enum directly, so the documented attributes can't drift from the component.
|
|
15
|
+
*
|
|
16
|
+
* Styling keys off the stable `data-button` **marker**, not `data-slot`: `Button.props()` styles a
|
|
17
|
+
* foreign element (a link, the rail's close trigger) without clobbering that element's own `data-slot`,
|
|
18
|
+
* so the marker — plus the variant/state axes below — is the precompiled `button.css` styling hook.
|
|
19
|
+
*/
|
|
20
|
+
let ButtonDataAttributes = /* @__PURE__ */ function(ButtonDataAttributes) {
|
|
21
|
+
/** The catalog slot that marks the rendered element as a Button for SLOTS.md and testing hooks. */
|
|
22
|
+
ButtonDataAttributes["slot"] = "data-slot";
|
|
23
|
+
/** The stable styling marker every `button.css` rule keys off — always present, independent of `data-slot`. */
|
|
24
|
+
ButtonDataAttributes["button"] = "data-button";
|
|
25
|
+
/** The visual emphasis — `primary` | `accent` | `secondary` | `outline` | `ghost` | `danger` | `link`. */
|
|
26
|
+
ButtonDataAttributes["variant"] = "data-variant";
|
|
27
|
+
/** The size scale — `xs` | `sm` | `md` | `lg`; the generated layer keys the per-size internals off it. */
|
|
28
|
+
ButtonDataAttributes["size"] = "data-size";
|
|
29
|
+
/** Present (`true`) when the button is squared for a single icon. */
|
|
30
|
+
ButtonDataAttributes["iconOnly"] = "data-icon-only";
|
|
31
|
+
/** Present (`true`) when the button stretches to its container's width. */
|
|
32
|
+
ButtonDataAttributes["fullWidth"] = "data-full-width";
|
|
33
|
+
/** Present (`true`) while loading — hides the content row in place behind the spinner overlay. */
|
|
34
|
+
ButtonDataAttributes["loading"] = "data-loading";
|
|
35
|
+
/** Present when the button is disabled (including while `loading`). */
|
|
36
|
+
ButtonDataAttributes["disabled"] = "data-disabled";
|
|
37
|
+
return ButtonDataAttributes;
|
|
38
|
+
}({});
|
|
39
|
+
//#endregion
|
|
40
|
+
export { BUTTON_SLOTS, ButtonDataAttributes };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/components/button/button.types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The variant/size vocabulary `Button` paints — formerly derived from the `buttonVariants` `tv()`
|
|
4
|
+
* recipe, now the authored source of truth since styling moved to precompiled `button.css`. Types-only:
|
|
5
|
+
* no runtime code, so it never participates in the styling layer.
|
|
6
|
+
*/
|
|
7
|
+
/** The visual emphasis of a button. */
|
|
8
|
+
type ButtonVariant = "primary" | "accent" | "secondary" | "outline" | "ghost" | "danger" | "link";
|
|
9
|
+
/** A button's height/padding/text scale. */
|
|
10
|
+
type ButtonSize = "xs" | "sm" | "md" | "lg";
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ButtonSize, ButtonVariant };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, use } from "react";
|
|
3
|
+
//#region src/components/button-group/button-group.context.ts
|
|
4
|
+
const ButtonGroupContext = createContext(null);
|
|
5
|
+
const ButtonGroupProvider = ButtonGroupContext.Provider;
|
|
6
|
+
/**
|
|
7
|
+
* Read the enclosing `ButtonGroup`'s shared `variant`/`size`, or `null` when the button stands alone.
|
|
8
|
+
* A bare `<Button>` is valid, so this returns `null` rather than throwing — the button falls back to
|
|
9
|
+
* its own props and defaults.
|
|
10
|
+
*/
|
|
11
|
+
function useButtonGroup() {
|
|
12
|
+
return use(ButtonGroupContext);
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { ButtonGroupProvider, useButtonGroup };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ButtonSize, ButtonVariant } from "../button/button.types.js";
|
|
2
|
+
import { ButtonGroupPartProps, ButtonGroupRootPropsArgs, rootProps } from "./button-group.props.js";
|
|
3
|
+
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/button-group/button-group.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* A row of buttons welded into one control — a toolbar of icon buttons, a segmented set of actions, or
|
|
8
|
+
* a primary action paired with a `Menu.Trigger` (the split-button pattern). Wrap any number of
|
|
9
|
+
* `Button`s (icon, label, or icon-only); the group squares their touching corners and draws a clearly
|
|
10
|
+
* visible divider between each.
|
|
11
|
+
*
|
|
12
|
+
* The group owns the shared look: set `variant`/`size` on the group and every descendant `Button`
|
|
13
|
+
* inherits them through context (an explicit prop on a child still wins). Inheritance reaches a
|
|
14
|
+
* `Button` rendered through a `render` prop too, so a `Menu.Trigger` rendered as a `Button` matches the
|
|
15
|
+
* group; that grouped button stamps a `data-button-group-item` marker the group keys its seam off, so
|
|
16
|
+
* the divider lands on the real segments regardless of focus-guard siblings.
|
|
17
|
+
*
|
|
18
|
+
* Styling is precompiled in `button-group.css`, keyed off the group's `data-slot="noctis-button-group"`
|
|
19
|
+
* anchor plus the `data-button-group-item` marker its segments stamp; for an element a `<ButtonGroup>`
|
|
20
|
+
* can't render, spread {@link ButtonGroup.props} onto it instead.
|
|
21
|
+
*
|
|
22
|
+
* @see {@link ButtonGroup.Props}
|
|
23
|
+
*/
|
|
24
|
+
declare function ButtonGroupImpl({
|
|
25
|
+
variant,
|
|
26
|
+
size,
|
|
27
|
+
role,
|
|
28
|
+
className,
|
|
29
|
+
children,
|
|
30
|
+
...props
|
|
31
|
+
}: ButtonGroup.Props): ReactElement;
|
|
32
|
+
/**
|
|
33
|
+
* The welded button row. The function value carries the D12 `props()` escape hatch via `Object.assign`:
|
|
34
|
+
* spread `ButtonGroup.props()` onto an element a `<ButtonGroup>` can't render to anchor the weld/seam
|
|
35
|
+
* CSS on it. It returns a spreadable `{ "data-slot": "noctis-button-group", ...dataAttrs }` bag the
|
|
36
|
+
* precompiled `button-group.css` keys off — the data-attribute-native replacement for the old
|
|
37
|
+
* `buttonGroupRoot` class-string helper.
|
|
38
|
+
*/
|
|
39
|
+
declare const ButtonGroup: typeof ButtonGroupImpl & {
|
|
40
|
+
props: typeof rootProps;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Prop types for `ButtonGroup`. Types-only — it merges with the `ButtonGroup` function above, so
|
|
44
|
+
* `ButtonGroup` is the component value, `ButtonGroup.Props` is its prop type, and `ButtonGroup.props`
|
|
45
|
+
* is the escape-hatch helper.
|
|
46
|
+
*/
|
|
47
|
+
declare namespace ButtonGroup {
|
|
48
|
+
type Props = ComponentProps<"div"> & {
|
|
49
|
+
/** Emphasis shared with every descendant `Button` that doesn't set its own `variant`. */variant?: ButtonVariant; /** Size shared with every descendant `Button` that doesn't set its own `size`. */
|
|
50
|
+
size?: ButtonSize; /** The buttons to attach — any number; each may carry an icon, a label, or be icon-only. */
|
|
51
|
+
children?: ReactNode; /** Merged onto the group's class list. */
|
|
52
|
+
className?: string;
|
|
53
|
+
};
|
|
54
|
+
/** Argument to the `ButtonGroup.props(...)` escape-hatch helper. */
|
|
55
|
+
type PropsArgs = ButtonGroupRootPropsArgs;
|
|
56
|
+
/** The spreadable data-attribute prop bag `ButtonGroup.props()` returns (D12). */
|
|
57
|
+
type PartProps = ButtonGroupPartProps;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { ButtonGroup };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ButtonGroupProvider } from "./button-group.context.js";
|
|
3
|
+
import { rootProps } from "./button-group.props.js";
|
|
4
|
+
import clsx$1 from "clsx";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/button-group/button-group.tsx
|
|
7
|
+
/**
|
|
8
|
+
* A row of buttons welded into one control — a toolbar of icon buttons, a segmented set of actions, or
|
|
9
|
+
* a primary action paired with a `Menu.Trigger` (the split-button pattern). Wrap any number of
|
|
10
|
+
* `Button`s (icon, label, or icon-only); the group squares their touching corners and draws a clearly
|
|
11
|
+
* visible divider between each.
|
|
12
|
+
*
|
|
13
|
+
* The group owns the shared look: set `variant`/`size` on the group and every descendant `Button`
|
|
14
|
+
* inherits them through context (an explicit prop on a child still wins). Inheritance reaches a
|
|
15
|
+
* `Button` rendered through a `render` prop too, so a `Menu.Trigger` rendered as a `Button` matches the
|
|
16
|
+
* group; that grouped button stamps a `data-button-group-item` marker the group keys its seam off, so
|
|
17
|
+
* the divider lands on the real segments regardless of focus-guard siblings.
|
|
18
|
+
*
|
|
19
|
+
* Styling is precompiled in `button-group.css`, keyed off the group's `data-slot="noctis-button-group"`
|
|
20
|
+
* anchor plus the `data-button-group-item` marker its segments stamp; for an element a `<ButtonGroup>`
|
|
21
|
+
* can't render, spread {@link ButtonGroup.props} onto it instead.
|
|
22
|
+
*
|
|
23
|
+
* @see {@link ButtonGroup.Props}
|
|
24
|
+
*/
|
|
25
|
+
function ButtonGroupImpl({ variant, size, role = "group", className, children, ...props }) {
|
|
26
|
+
const { className: _omit, ...recipe } = rootProps();
|
|
27
|
+
return /* @__PURE__ */ jsx("div", {
|
|
28
|
+
role,
|
|
29
|
+
...recipe,
|
|
30
|
+
className: clsx$1(className),
|
|
31
|
+
...props,
|
|
32
|
+
children: /* @__PURE__ */ jsx(ButtonGroupProvider, {
|
|
33
|
+
value: {
|
|
34
|
+
variant,
|
|
35
|
+
size
|
|
36
|
+
},
|
|
37
|
+
children
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The welded button row. The function value carries the D12 `props()` escape hatch via `Object.assign`:
|
|
43
|
+
* spread `ButtonGroup.props()` onto an element a `<ButtonGroup>` can't render to anchor the weld/seam
|
|
44
|
+
* CSS on it. It returns a spreadable `{ "data-slot": "noctis-button-group", ...dataAttrs }` bag the
|
|
45
|
+
* precompiled `button-group.css` keys off — the data-attribute-native replacement for the old
|
|
46
|
+
* `buttonGroupRoot` class-string helper.
|
|
47
|
+
*/
|
|
48
|
+
const ButtonGroup = Object.assign(ButtonGroupImpl, { props: rootProps });
|
|
49
|
+
//#endregion
|
|
50
|
+
export { ButtonGroup };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/components/button-group/button-group.props.d.ts
|
|
2
|
+
/** A spreadable data-attribute prop bag — the shape `ButtonGroup.props()` returns. */
|
|
3
|
+
type ButtonGroupPartProps = {
|
|
4
|
+
/** The slot value the matching `button-group.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 (string) or absent (`undefined`); never `false`. */
|
|
6
|
+
[attr: `data-${string}`]: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
/** Argument to `ButtonGroup.props(...)` — the recipe the `button-group.css` rules key their look off. */
|
|
9
|
+
interface ButtonGroupRootPropsArgs {
|
|
10
|
+
/** Forwarded verbatim onto the returned prop bag. */
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Root prop bag: just `data-slot` — `button-group.css` keys its weld/seam rules off it plus the
|
|
15
|
+
* `data-button-group-item` marker its segments stamp. The escape hatch for an element a `<ButtonGroup>`
|
|
16
|
+
* can't render.
|
|
17
|
+
*/
|
|
18
|
+
declare function rootProps({
|
|
19
|
+
className
|
|
20
|
+
}?: ButtonGroupRootPropsArgs): ButtonGroupPartProps;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { ButtonGroupPartProps, ButtonGroupRootPropsArgs, rootProps };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BUTTON_GROUP_SLOTS } from "./button-group.slots.js";
|
|
2
|
+
//#region src/components/button-group/button-group.props.ts
|
|
3
|
+
/**
|
|
4
|
+
* The D12 unified part contract for ButtonGroup — the data-attribute-native replacement for the old
|
|
5
|
+
* `buttonGroupRoot` class-string helper, for an element a `<ButtonGroup>` can't render.
|
|
6
|
+
*
|
|
7
|
+
* `rootProps(...)` returns a **spreadable props object** of the form
|
|
8
|
+
* `{ "data-slot": "noctis-button-group", ...dataAttrs }`. Under the single-`data-slot` anchor model the
|
|
9
|
+
* `data-slot` is the only styling hook needed — `button-group.css` keys every rule off it (and the
|
|
10
|
+
* `data-button-group-item` marker each descendant `Button` stamps) — so spreading this onto a foreign
|
|
11
|
+
* element styles it as a button group:
|
|
12
|
+
*
|
|
13
|
+
* <div role="group" {...ButtonGroup.props()} />
|
|
14
|
+
* // → <div role="group" data-slot="noctis-button-group">
|
|
15
|
+
*
|
|
16
|
+
* The group carries no variant/size of its own on the slot: those flow to descendant `Button`s through
|
|
17
|
+
* context, not onto this element. The escape hatch carries no className (styling is attribute-driven);
|
|
18
|
+
* an optional `className` passthrough is accepted and forwarded verbatim.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Root prop bag: just `data-slot` — `button-group.css` keys its weld/seam rules off it plus the
|
|
22
|
+
* `data-button-group-item` marker its segments stamp. The escape hatch for an element a `<ButtonGroup>`
|
|
23
|
+
* can't render.
|
|
24
|
+
*/
|
|
25
|
+
function rootProps({ className } = {}) {
|
|
26
|
+
const bag = { "data-slot": BUTTON_GROUP_SLOTS.root };
|
|
27
|
+
return className === void 0 ? bag : {
|
|
28
|
+
...bag,
|
|
29
|
+
className
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { rootProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/components/button-group/button-group.slots.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The `data-*` hooks `ButtonGroup` stamps, for host-side styling and tests. The dividers between
|
|
4
|
+
* segments are drawn in CSS (a pseudo-element), not separate elements, so the group exposes a single
|
|
5
|
+
* slot; target the child buttons by their own `data-slot="noctis-button"` (or the `data-button` marker).
|
|
6
|
+
*/
|
|
7
|
+
declare enum ButtonGroupDataAttributes {
|
|
8
|
+
/** Marks the group wrapper. */
|
|
9
|
+
slot = "data-slot"
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ButtonGroupDataAttributes };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/components/button-group/button-group.slots.ts
|
|
2
|
+
/**
|
|
3
|
+
* The slot vocabulary `ButtonGroup` stamps as its `data-slot`. The authored source the orchestration
|
|
4
|
+
* file reads from; SLOTS.md still generates from the token-graph declarations.
|
|
5
|
+
*/
|
|
6
|
+
const BUTTON_GROUP_SLOTS = { root: "noctis-button-group" };
|
|
7
|
+
/**
|
|
8
|
+
* The `data-*` hooks `ButtonGroup` stamps, for host-side styling and tests. The dividers between
|
|
9
|
+
* segments are drawn in CSS (a pseudo-element), not separate elements, so the group exposes a single
|
|
10
|
+
* slot; target the child buttons by their own `data-slot="noctis-button"` (or the `data-button` marker).
|
|
11
|
+
*/
|
|
12
|
+
let ButtonGroupDataAttributes = /* @__PURE__ */ function(ButtonGroupDataAttributes) {
|
|
13
|
+
/** Marks the group wrapper. */
|
|
14
|
+
ButtonGroupDataAttributes["slot"] = "data-slot";
|
|
15
|
+
return ButtonGroupDataAttributes;
|
|
16
|
+
}({});
|
|
17
|
+
//#endregion
|
|
18
|
+
export { BUTTON_GROUP_SLOTS, ButtonGroupDataAttributes };
|