@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,42 @@
|
|
|
1
|
+
//#region src/components/code-block/code-block.props.d.ts
|
|
2
|
+
/** A spreadable data-attribute prop bag — the shape every `CodeBlock.*.props()` returns. */
|
|
3
|
+
type CodeBlockPartProps = {
|
|
4
|
+
/** The slot value (or non-slot hook) the matching `code-block.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
|
+
/** Frame prop bag: the `code-block` slot anchor the frame radius + scrollable body rules key off. */
|
|
14
|
+
declare function frameProps({
|
|
15
|
+
className
|
|
16
|
+
}?: BasePropsArgs): CodeBlockPartProps;
|
|
17
|
+
/** Header prop bag: the `code-block-header` slot anchor the band metrics key off. */
|
|
18
|
+
declare function headerProps({
|
|
19
|
+
className
|
|
20
|
+
}?: BasePropsArgs): CodeBlockPartProps;
|
|
21
|
+
/** Title prop bag: the non-slot `data-code-block-title` hook the header's caption rule reads. */
|
|
22
|
+
declare function titleProps({
|
|
23
|
+
className
|
|
24
|
+
}?: BasePropsArgs): CodeBlockPartProps;
|
|
25
|
+
/** Logo prop bag: the non-slot `data-code-block-logo` hook the header's logo rule reads. */
|
|
26
|
+
declare function logoProps({
|
|
27
|
+
className
|
|
28
|
+
}?: BasePropsArgs): CodeBlockPartProps;
|
|
29
|
+
/** Body prop bag: the non-slot `data-code-block-body` hook the scrollable-body rule reads. */
|
|
30
|
+
declare function bodyProps({
|
|
31
|
+
className
|
|
32
|
+
}?: BasePropsArgs): CodeBlockPartProps;
|
|
33
|
+
/** Floating-copy prop bag: the non-slot `data-code-block-floating` hook the reveal-on-hover rule reads. */
|
|
34
|
+
declare function floatingCopyProps({
|
|
35
|
+
className
|
|
36
|
+
}?: BasePropsArgs): CodeBlockPartProps;
|
|
37
|
+
/** Manager-glyph prop bag: the `code-block-manager-glyph` slot anchor the 1em square paint keys off. */
|
|
38
|
+
declare function managerGlyphProps({
|
|
39
|
+
className
|
|
40
|
+
}?: BasePropsArgs): CodeBlockPartProps;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { bodyProps, floatingCopyProps, frameProps, headerProps, logoProps, managerGlyphProps, titleProps };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CODE_BLOCK_SLOTS } from "./code-block.slots.js";
|
|
2
|
+
//#region src/components/code-block/code-block.props.ts
|
|
3
|
+
/**
|
|
4
|
+
* The D12 unified variant contract for CodeBlock — the data-attribute-native generalization of the old
|
|
5
|
+
* class-string recipes (`codeBlockFrame`, `codeBlockHeader`, …) that lived in `code-block.styles.ts`.
|
|
6
|
+
*
|
|
7
|
+
* Each compound part exposes a `props(...)` builder returning a **spreadable props object** of the form
|
|
8
|
+
* `{ "data-slot": "noctis-code-block-<part>", ...dataAttrs }`. Under the single-`data-slot` anchor model
|
|
9
|
+
* the `data-slot` is the only styling hook `code-block.css` keys off, so spreading a part's `props()`
|
|
10
|
+
* onto a *foreign* element styles it as that part. CodeBlock has no per-part variant axes (its look is
|
|
11
|
+
* fixed; the shade/border come from the composed `Surface`), so the helpers carry only the slot anchor —
|
|
12
|
+
* plus, for the non-slot inner parts (title, logo, body, floating copy), the stable `data-code-block-*`
|
|
13
|
+
* hook the descendant CSS rules read.
|
|
14
|
+
*
|
|
15
|
+
* The escape hatch carries no className (styling is attribute-driven); an optional `className`
|
|
16
|
+
* passthrough is accepted and forwarded verbatim.
|
|
17
|
+
*/
|
|
18
|
+
const withClassName = (bag, className) => className === void 0 ? bag : {
|
|
19
|
+
...bag,
|
|
20
|
+
className
|
|
21
|
+
};
|
|
22
|
+
/** Frame prop bag: the `code-block` slot anchor the frame radius + scrollable body rules key off. */
|
|
23
|
+
function frameProps({ className } = {}) {
|
|
24
|
+
return withClassName({ "data-slot": CODE_BLOCK_SLOTS.root }, className);
|
|
25
|
+
}
|
|
26
|
+
/** Header prop bag: the `code-block-header` slot anchor the band metrics key off. */
|
|
27
|
+
function headerProps({ className } = {}) {
|
|
28
|
+
return withClassName({ "data-slot": CODE_BLOCK_SLOTS.header }, className);
|
|
29
|
+
}
|
|
30
|
+
/** Title prop bag: the non-slot `data-code-block-title` hook the header's caption rule reads. */
|
|
31
|
+
function titleProps({ className } = {}) {
|
|
32
|
+
return withClassName({ "data-code-block-title": "" }, className);
|
|
33
|
+
}
|
|
34
|
+
/** Logo prop bag: the non-slot `data-code-block-logo` hook the header's logo rule reads. */
|
|
35
|
+
function logoProps({ className } = {}) {
|
|
36
|
+
return withClassName({ "data-code-block-logo": "" }, className);
|
|
37
|
+
}
|
|
38
|
+
/** Body prop bag: the non-slot `data-code-block-body` hook the scrollable-body rule reads. */
|
|
39
|
+
function bodyProps({ className } = {}) {
|
|
40
|
+
return withClassName({ "data-code-block-body": "" }, className);
|
|
41
|
+
}
|
|
42
|
+
/** Floating-copy prop bag: the non-slot `data-code-block-floating` hook the reveal-on-hover rule reads. */
|
|
43
|
+
function floatingCopyProps({ className } = {}) {
|
|
44
|
+
return withClassName({ "data-code-block-floating": "" }, className);
|
|
45
|
+
}
|
|
46
|
+
/** Manager-glyph prop bag: the `code-block-manager-glyph` slot anchor the 1em square paint keys off. */
|
|
47
|
+
function managerGlyphProps({ className } = {}) {
|
|
48
|
+
return withClassName({ "data-slot": CODE_BLOCK_SLOTS.managerGlyph }, className);
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { bodyProps, floatingCopyProps, frameProps, headerProps, logoProps, managerGlyphProps, titleProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/components/code-block/code-block.slots.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The data attributes the `CodeBlock` compound (and the Base UI tabs its `Tabs`/`Tab`/`Panel` parts
|
|
4
|
+
* render) expose for styling and testing. Each member's value is the attribute name and its JSDoc is
|
|
5
|
+
* the description; the docs API reference reads this enum directly.
|
|
6
|
+
*/
|
|
7
|
+
declare enum CodeBlockDataAttributes {
|
|
8
|
+
/** Marks each rendered element with its slot for styling and testing hooks. */
|
|
9
|
+
slot = "data-slot",
|
|
10
|
+
/** Hook the app stylesheet reads to attach the line-number gutter to the highlighted lines. */
|
|
11
|
+
codeblock = "data-codeblock",
|
|
12
|
+
/** Present on the active tab and its panel. */
|
|
13
|
+
active = "data-active"
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { CodeBlockDataAttributes };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/components/code-block/code-block.slots.ts
|
|
2
|
+
/**
|
|
3
|
+
* The slot vocabulary the `CodeBlock` compound stamps as `data-slot`. The authored source the
|
|
4
|
+
* orchestration file reads from; SLOTS.md still generates from the token-graph declarations, so this
|
|
5
|
+
* mirrors the declared code-family anatomy exactly — the single block (`code-block`, `code-block-header`)
|
|
6
|
+
* and the tab strip (`code-tabs`, `code-tabs-panel`) the `Tabs`/`Panel` parts fold in. Parts without a
|
|
7
|
+
* declared slot (Title, Body, Tab) render as plain elements with no `data-slot`.
|
|
8
|
+
*/
|
|
9
|
+
const CODE_BLOCK_SLOTS = {
|
|
10
|
+
root: "noctis-code-block",
|
|
11
|
+
header: "noctis-code-block-header",
|
|
12
|
+
managerGlyph: "noctis-code-block-manager-glyph",
|
|
13
|
+
tabs: "noctis-code-tabs",
|
|
14
|
+
panel: "noctis-code-tabs-panel"
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The data attributes the `CodeBlock` compound (and the Base UI tabs its `Tabs`/`Tab`/`Panel` parts
|
|
18
|
+
* render) expose for styling and testing. Each member's value is the attribute name and its JSDoc is
|
|
19
|
+
* the description; the docs API reference reads this enum directly.
|
|
20
|
+
*/
|
|
21
|
+
let CodeBlockDataAttributes = /* @__PURE__ */ function(CodeBlockDataAttributes) {
|
|
22
|
+
/** Marks each rendered element with its slot for styling and testing hooks. */
|
|
23
|
+
CodeBlockDataAttributes["slot"] = "data-slot";
|
|
24
|
+
/** Hook the app stylesheet reads to attach the line-number gutter to the highlighted lines. */
|
|
25
|
+
CodeBlockDataAttributes["codeblock"] = "data-codeblock";
|
|
26
|
+
/** Present on the active tab and its panel. */
|
|
27
|
+
CodeBlockDataAttributes["active"] = "data-active";
|
|
28
|
+
return CodeBlockDataAttributes;
|
|
29
|
+
}({});
|
|
30
|
+
//#endregion
|
|
31
|
+
export { CODE_BLOCK_SLOTS, CodeBlockDataAttributes };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//#region src/components/code-block/language-label.ts
|
|
2
|
+
/** Human display names for common Shiki language ids, so an unlabelled block/tab still reads well. */
|
|
3
|
+
const LANGUAGE_LABEL = {
|
|
4
|
+
bash: "Bash",
|
|
5
|
+
sh: "Shell",
|
|
6
|
+
shell: "Shell",
|
|
7
|
+
zsh: "Zsh",
|
|
8
|
+
js: "JavaScript",
|
|
9
|
+
javascript: "JavaScript",
|
|
10
|
+
ts: "TypeScript",
|
|
11
|
+
typescript: "TypeScript",
|
|
12
|
+
tsx: "TSX",
|
|
13
|
+
jsx: "JSX",
|
|
14
|
+
json: "JSON",
|
|
15
|
+
jsonc: "JSON",
|
|
16
|
+
py: "Python",
|
|
17
|
+
python: "Python",
|
|
18
|
+
go: "Go",
|
|
19
|
+
rs: "Rust",
|
|
20
|
+
rust: "Rust",
|
|
21
|
+
java: "Java",
|
|
22
|
+
rb: "Ruby",
|
|
23
|
+
ruby: "Ruby",
|
|
24
|
+
php: "PHP",
|
|
25
|
+
swift: "Swift",
|
|
26
|
+
kotlin: "Kotlin",
|
|
27
|
+
css: "CSS",
|
|
28
|
+
html: "HTML",
|
|
29
|
+
yaml: "YAML",
|
|
30
|
+
yml: "YAML",
|
|
31
|
+
toml: "TOML",
|
|
32
|
+
sql: "SQL",
|
|
33
|
+
graphql: "GraphQL",
|
|
34
|
+
md: "Markdown",
|
|
35
|
+
mdx: "MDX"
|
|
36
|
+
};
|
|
37
|
+
/** Pretty display name for a language id, falling back to the raw id (or a provided fallback). */
|
|
38
|
+
function prettyLanguage(language, fallback = "") {
|
|
39
|
+
if (!language) return fallback;
|
|
40
|
+
return LANGUAGE_LABEL[language.toLowerCase()] ?? language;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { prettyLanguage };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, use } from "react";
|
|
3
|
+
//#region src/components/collapsible/collapsible.context.ts
|
|
4
|
+
/**
|
|
5
|
+
* The shared label id minted once by `Collapsible.Root`. The `Trigger` adopts it as its own `id`, and
|
|
6
|
+
* the `Panel` points its `aria-labelledby` at it — so the disclosed region is named by the control that
|
|
7
|
+
* toggles it (mirrors `rail.context.ts`'s `RailTitleProvider`). It never throws: a `Trigger` or `Panel`
|
|
8
|
+
* rendered outside a `Root` reads `null` and simply falls back to Base UI's own wiring.
|
|
9
|
+
*/
|
|
10
|
+
const CollapsibleIdContext = createContext(null);
|
|
11
|
+
/** Provided by `Collapsible.Root`; carries the generated label id to the trigger and panel. */
|
|
12
|
+
const CollapsibleIdProvider = CollapsibleIdContext.Provider;
|
|
13
|
+
/** Read the disclosure's shared label id, or `null` for a part rendered outside a `Collapsible.Root`. */
|
|
14
|
+
function useCollapsibleId() {
|
|
15
|
+
return use(CollapsibleIdContext);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { CollapsibleIdProvider, useCollapsibleId };
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { useRender } from "../../core/render.js";
|
|
2
|
+
import { collapsible_d_exports } from "../../primitives/collapsible.js";
|
|
3
|
+
import { groupProps, headingProps, panelProps, rootProps, triggerProps } from "./collapsible.props.js";
|
|
4
|
+
import { CollapsibleHeadingLevel, CollapsibleIndicator, CollapsiblePanelRole } from "./collapsible.types.js";
|
|
5
|
+
import { JSX, ReactElement } from "react";
|
|
6
|
+
|
|
7
|
+
//#region src/components/collapsible/collapsible.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Groups the parts and owns open state — controlled via `open`/`onOpenChange`, or uncontrolled via
|
|
10
|
+
* `defaultOpen` — on Base UI's Collapsible. A non-modal disclosure: no backdrop, no focus trap. It
|
|
11
|
+
* renders a plain block; place a `Collapsible.Trigger` and a `Collapsible.Panel` inside. By default a
|
|
12
|
+
* `Collapsible` does one thing — show and hide its panel with a height animation — and nothing else;
|
|
13
|
+
* the heading, group, and twisty affordances below are all opt-in.
|
|
14
|
+
*
|
|
15
|
+
* Mints one label id and shares it with the trigger and panel so the disclosed region is named by the
|
|
16
|
+
* control that toggles it (`aria-labelledby`), without the consumer wiring an id by hand.
|
|
17
|
+
*
|
|
18
|
+
* Slot: `noctis-collapsible`.
|
|
19
|
+
* @see {@link Collapsible.Root.Props}
|
|
20
|
+
*/
|
|
21
|
+
declare function CollapsibleRoot({
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}: Collapsible.Root.Props): ReactElement;
|
|
25
|
+
/**
|
|
26
|
+
* The button that toggles the panel — composed from the ghost `Button` so its hover, focus-visible,
|
|
27
|
+
* pressed, and disabled states are the family's single source of truth (it gains the press affordance
|
|
28
|
+
* for free); Collapsible only re-owns the full-width row layout. Base UI wires `aria-expanded` and
|
|
29
|
+
* `aria-controls` and stamps `data-panel-open` while open. A disclosure chevron is rendered by default
|
|
30
|
+
* — `indicator` controls it: `true`/`"chevron-end"` trails the label and rotates down→up; `"chevron-
|
|
31
|
+
* start"` leads it as a right→down twisty (file-tree rows); `false` omits it. Place the label as children.
|
|
32
|
+
*
|
|
33
|
+
* Slot: `noctis-collapsible-trigger`.
|
|
34
|
+
* @see {@link Collapsible.Trigger.Props}
|
|
35
|
+
*/
|
|
36
|
+
declare function CollapsibleTrigger({
|
|
37
|
+
indicator,
|
|
38
|
+
className,
|
|
39
|
+
children,
|
|
40
|
+
...props
|
|
41
|
+
}: Collapsible.Trigger.Props): ReactElement;
|
|
42
|
+
/**
|
|
43
|
+
* The collapsible region holding the disclosed content. Base UI animates its height between zero and the
|
|
44
|
+
* measured content height. Rendered as a labelled `<section>`: `role="group"` by default (set
|
|
45
|
+
* `panelRole="region"` to promote it to a landmark), named via `aria-labelledby` by the trigger that
|
|
46
|
+
* toggles it. Kept in the DOM while closed and findable by the browser's find-in-page
|
|
47
|
+
* (`hiddenUntilFound` defaults to `true`, which auto-expands the panel on a match); set
|
|
48
|
+
* `hiddenUntilFound={false}` to opt out, or `keepMounted={false}` to unmount closed content entirely.
|
|
49
|
+
*
|
|
50
|
+
* Slot: `noctis-collapsible-panel`.
|
|
51
|
+
* @see {@link Collapsible.Panel.Props}
|
|
52
|
+
*/
|
|
53
|
+
declare function CollapsiblePanel({
|
|
54
|
+
panelRole,
|
|
55
|
+
hiddenUntilFound,
|
|
56
|
+
keepMounted,
|
|
57
|
+
className,
|
|
58
|
+
children,
|
|
59
|
+
"aria-label": ariaLabel,
|
|
60
|
+
"aria-labelledby": ariaLabelledby,
|
|
61
|
+
...props
|
|
62
|
+
}: Collapsible.Panel.Props): ReactElement;
|
|
63
|
+
/**
|
|
64
|
+
* An optional heading that wraps the `Collapsible.Trigger` so a content disclosure (an FAQ entry, a
|
|
65
|
+
* "show more" section) appears in the document outline and the screen-reader rotor — the recommended
|
|
66
|
+
* shape for content. Renders an `<h3>` by default; set `level` for another rank, or `render` to compose
|
|
67
|
+
* a custom element. Omit it for sidebar / file-tree rows, where a heading would be wrong.
|
|
68
|
+
*
|
|
69
|
+
* Slot: `noctis-collapsible-heading`.
|
|
70
|
+
* @see {@link Collapsible.Heading.Props}
|
|
71
|
+
*/
|
|
72
|
+
declare function CollapsibleHeading({
|
|
73
|
+
level,
|
|
74
|
+
render,
|
|
75
|
+
className,
|
|
76
|
+
...props
|
|
77
|
+
}: Collapsible.Heading.Props): ReactElement;
|
|
78
|
+
/**
|
|
79
|
+
* A presentational container that stacks several `Collapsible`s into one bordered card — a hairline rule
|
|
80
|
+
* between siblings and under each open trigger, with a shared outer radius. It carries no open-state
|
|
81
|
+
* coordination: each disclosure opens and closes independently (reach for the `Accordion` primitive when
|
|
82
|
+
* only one should be open at a time).
|
|
83
|
+
*
|
|
84
|
+
* Slot: `noctis-collapsible-group`.
|
|
85
|
+
* @see {@link Collapsible.Group.Props}
|
|
86
|
+
*/
|
|
87
|
+
declare function CollapsibleGroup({
|
|
88
|
+
className,
|
|
89
|
+
children,
|
|
90
|
+
...props
|
|
91
|
+
}: Collapsible.Group.Props): ReactElement;
|
|
92
|
+
/**
|
|
93
|
+
* A single disclosure — a trigger that expands and collapses a panel of content in place, with a
|
|
94
|
+
* height animation that's reduced-motion safe.
|
|
95
|
+
*
|
|
96
|
+
* **Collapsible vs. Rail vs. Sheet.** Reach for a `Collapsible` to show and hide a region of content
|
|
97
|
+
* *in the flow* of the page (a "show more" section, an expandable card, an FAQ answer). Reach for a
|
|
98
|
+
* `Rail` for a persistent companion panel docked beside the content, and a `Sheet` for a modal task
|
|
99
|
+
* panel that overlays the page. The collapsible is the simplest of the three: no docking, no overlay.
|
|
100
|
+
*
|
|
101
|
+
* Compose it from parts: `Collapsible.Root` owns open state, `Collapsible.Trigger` toggles it, and
|
|
102
|
+
* `Collapsible.Panel` holds the content that animates open and closed. Opt into `Collapsible.Heading`
|
|
103
|
+
* for content-outline semantics and `Collapsible.Group` for the stacked, bordered card look.
|
|
104
|
+
*
|
|
105
|
+
* Built on Base UI's Collapsible for the open/close behavior, measured-height animation, and a11y; the
|
|
106
|
+
* runtime compound is a plain object (kept tree-shakeable), with per-part prop types exposed through
|
|
107
|
+
* the matching `Collapsible` namespace below — e.g. `Collapsible.Panel.Props`.
|
|
108
|
+
*/
|
|
109
|
+
declare const Collapsible: {
|
|
110
|
+
/** Groups the parts and owns open state. `Collapsible.Root.props()` → its spreadable prop bag. */Root: typeof CollapsibleRoot & {
|
|
111
|
+
props: typeof rootProps;
|
|
112
|
+
}; /** Toggles the panel. `Collapsible.Trigger.props()` → its spreadable prop bag. */
|
|
113
|
+
Trigger: typeof CollapsibleTrigger & {
|
|
114
|
+
props: typeof triggerProps;
|
|
115
|
+
}; /** The animated content region. `Collapsible.Panel.props()` → its spreadable prop bag. */
|
|
116
|
+
Panel: typeof CollapsiblePanel & {
|
|
117
|
+
props: typeof panelProps;
|
|
118
|
+
}; /** Optional heading wrapping the trigger. `Collapsible.Heading.props()` → its spreadable prop bag. */
|
|
119
|
+
Heading: typeof CollapsibleHeading & {
|
|
120
|
+
props: typeof headingProps;
|
|
121
|
+
}; /** Presentational stacked container. `Collapsible.Group.props()` → its spreadable prop bag. */
|
|
122
|
+
Group: typeof CollapsibleGroup & {
|
|
123
|
+
props: typeof groupProps;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Per-part prop and state types, mirroring Base UI's `Component.Part.Props` convention. This namespace
|
|
128
|
+
* is types-only — it emits no runtime code and merges with the `Collapsible` object above, so
|
|
129
|
+
* `Collapsible.Panel` is the component value while `Collapsible.Panel.Props` is its prop type.
|
|
130
|
+
*/
|
|
131
|
+
declare namespace Collapsible {
|
|
132
|
+
namespace Root {
|
|
133
|
+
type Props = collapsible_d_exports.Collapsible.Root.Props;
|
|
134
|
+
type State = collapsible_d_exports.Collapsible.Root.State;
|
|
135
|
+
}
|
|
136
|
+
namespace Trigger {
|
|
137
|
+
type Props = collapsible_d_exports.Collapsible.Trigger.Props & {
|
|
138
|
+
/**
|
|
139
|
+
* The built-in disclosure chevron. `true` (default) / `"chevron-end"` trails the label and
|
|
140
|
+
* rotates down→up; `"chevron-start"` leads it as a right→down twisty; `false` omits it.
|
|
141
|
+
*/
|
|
142
|
+
indicator?: CollapsibleIndicator;
|
|
143
|
+
};
|
|
144
|
+
type State = collapsible_d_exports.Collapsible.Trigger.State;
|
|
145
|
+
}
|
|
146
|
+
namespace Panel {
|
|
147
|
+
type Props = collapsible_d_exports.Collapsible.Panel.Props & {
|
|
148
|
+
/** The open panel's ARIA role. Defaults to `"group"`; `"region"` promotes it to a landmark. */panelRole?: CollapsiblePanelRole;
|
|
149
|
+
};
|
|
150
|
+
type State = collapsible_d_exports.Collapsible.Panel.State;
|
|
151
|
+
}
|
|
152
|
+
namespace Heading {
|
|
153
|
+
/** Props for the optional heading wrapping the trigger — an `<hN>` (default `<h3>`) or a `render`. */
|
|
154
|
+
interface Props extends Omit<JSX.IntrinsicElements["h3"], "color"> {
|
|
155
|
+
/** The heading rank to render. Defaults to `3`. */
|
|
156
|
+
level?: CollapsibleHeadingLevel;
|
|
157
|
+
/** A Base UI render prop — an element or function — to replace the rendered heading entirely. */
|
|
158
|
+
render?: useRender.RenderProp;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
namespace Group {
|
|
162
|
+
/** Props for the presentational stacked container — a plain block element. */
|
|
163
|
+
type Props = JSX.IntrinsicElements["div"];
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
//#endregion
|
|
167
|
+
export { Collapsible };
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Icon } from "../../icons/icon.js";
|
|
3
|
+
import { ChevronDownIcon, ChevronRightIcon } from "../../icons/glyphs.js";
|
|
4
|
+
import { useRender } from "../../core/render.js";
|
|
5
|
+
import { Button } from "../button/button.js";
|
|
6
|
+
import { collapsible_exports } from "../../primitives/collapsible.js";
|
|
7
|
+
import { CollapsibleIdProvider, useCollapsibleId } from "./collapsible.context.js";
|
|
8
|
+
import { COLLAPSIBLE_SLOTS } from "./collapsible.slots.js";
|
|
9
|
+
import { groupProps, headingProps, panelProps, rootProps, triggerProps } from "./collapsible.props.js";
|
|
10
|
+
import { useId } from "react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
//#region src/components/collapsible/collapsible.tsx
|
|
13
|
+
/** Resolve the `indicator` prop to a placement, or `undefined` when the built-in chevron is omitted. */
|
|
14
|
+
function resolveIndicator(indicator) {
|
|
15
|
+
if (indicator === true) return "chevron-end";
|
|
16
|
+
if (indicator === false) return void 0;
|
|
17
|
+
return indicator;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Groups the parts and owns open state — controlled via `open`/`onOpenChange`, or uncontrolled via
|
|
21
|
+
* `defaultOpen` — on Base UI's Collapsible. A non-modal disclosure: no backdrop, no focus trap. It
|
|
22
|
+
* renders a plain block; place a `Collapsible.Trigger` and a `Collapsible.Panel` inside. By default a
|
|
23
|
+
* `Collapsible` does one thing — show and hide its panel with a height animation — and nothing else;
|
|
24
|
+
* the heading, group, and twisty affordances below are all opt-in.
|
|
25
|
+
*
|
|
26
|
+
* Mints one label id and shares it with the trigger and panel so the disclosed region is named by the
|
|
27
|
+
* control that toggles it (`aria-labelledby`), without the consumer wiring an id by hand.
|
|
28
|
+
*
|
|
29
|
+
* Slot: `noctis-collapsible`.
|
|
30
|
+
* @see {@link Collapsible.Root.Props}
|
|
31
|
+
*/
|
|
32
|
+
function CollapsibleRoot({ className, ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsx(CollapsibleIdProvider, {
|
|
34
|
+
value: useId(),
|
|
35
|
+
children: /* @__PURE__ */ jsx(collapsible_exports.Collapsible.Root, {
|
|
36
|
+
"data-slot": COLLAPSIBLE_SLOTS.root,
|
|
37
|
+
className,
|
|
38
|
+
...props
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The button that toggles the panel — composed from the ghost `Button` so its hover, focus-visible,
|
|
44
|
+
* pressed, and disabled states are the family's single source of truth (it gains the press affordance
|
|
45
|
+
* for free); Collapsible only re-owns the full-width row layout. Base UI wires `aria-expanded` and
|
|
46
|
+
* `aria-controls` and stamps `data-panel-open` while open. A disclosure chevron is rendered by default
|
|
47
|
+
* — `indicator` controls it: `true`/`"chevron-end"` trails the label and rotates down→up; `"chevron-
|
|
48
|
+
* start"` leads it as a right→down twisty (file-tree rows); `false` omits it. Place the label as children.
|
|
49
|
+
*
|
|
50
|
+
* Slot: `noctis-collapsible-trigger`.
|
|
51
|
+
* @see {@link Collapsible.Trigger.Props}
|
|
52
|
+
*/
|
|
53
|
+
function CollapsibleTrigger({ indicator = true, className, children, ...props }) {
|
|
54
|
+
const labelId = useCollapsibleId();
|
|
55
|
+
const side = resolveIndicator(indicator);
|
|
56
|
+
const { "data-disabled": _ghostDisabled, ...ghostButton } = Button.props({
|
|
57
|
+
variant: "ghost",
|
|
58
|
+
fullWidth: true
|
|
59
|
+
});
|
|
60
|
+
const chevron = side ? /* @__PURE__ */ jsx("span", {
|
|
61
|
+
"data-collapsible-indicator": "",
|
|
62
|
+
"aria-hidden": true,
|
|
63
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
64
|
+
icon: side === "chevron-start" ? ChevronRightIcon : ChevronDownIcon,
|
|
65
|
+
size: "sm",
|
|
66
|
+
directional: true
|
|
67
|
+
})
|
|
68
|
+
}) : null;
|
|
69
|
+
return /* @__PURE__ */ jsxs(collapsible_exports.Collapsible.Trigger, {
|
|
70
|
+
...ghostButton,
|
|
71
|
+
"data-slot": COLLAPSIBLE_SLOTS.trigger,
|
|
72
|
+
"data-indicator": side,
|
|
73
|
+
className,
|
|
74
|
+
...props,
|
|
75
|
+
children: [
|
|
76
|
+
side === "chevron-start" ? chevron : null,
|
|
77
|
+
/* @__PURE__ */ jsx("span", {
|
|
78
|
+
"data-collapsible-label": "",
|
|
79
|
+
id: labelId ?? void 0,
|
|
80
|
+
children
|
|
81
|
+
}),
|
|
82
|
+
side === "chevron-end" ? chevron : null
|
|
83
|
+
]
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The collapsible region holding the disclosed content. Base UI animates its height between zero and the
|
|
88
|
+
* measured content height. Rendered as a labelled `<section>`: `role="group"` by default (set
|
|
89
|
+
* `panelRole="region"` to promote it to a landmark), named via `aria-labelledby` by the trigger that
|
|
90
|
+
* toggles it. Kept in the DOM while closed and findable by the browser's find-in-page
|
|
91
|
+
* (`hiddenUntilFound` defaults to `true`, which auto-expands the panel on a match); set
|
|
92
|
+
* `hiddenUntilFound={false}` to opt out, or `keepMounted={false}` to unmount closed content entirely.
|
|
93
|
+
*
|
|
94
|
+
* Slot: `noctis-collapsible-panel`.
|
|
95
|
+
* @see {@link Collapsible.Panel.Props}
|
|
96
|
+
*/
|
|
97
|
+
function CollapsiblePanel({ panelRole = "group", hiddenUntilFound = true, keepMounted = true, className, children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...props }) {
|
|
98
|
+
const labelId = useCollapsibleId();
|
|
99
|
+
return /* @__PURE__ */ jsx(collapsible_exports.Collapsible.Panel, {
|
|
100
|
+
"data-slot": COLLAPSIBLE_SLOTS.panel,
|
|
101
|
+
role: panelRole,
|
|
102
|
+
hiddenUntilFound,
|
|
103
|
+
keepMounted,
|
|
104
|
+
"aria-label": ariaLabel,
|
|
105
|
+
"aria-labelledby": ariaLabelledby ?? (ariaLabel ? void 0 : labelId ?? void 0),
|
|
106
|
+
render: /* @__PURE__ */ jsx("section", {}),
|
|
107
|
+
className,
|
|
108
|
+
...props,
|
|
109
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
110
|
+
"data-collapsible-content": "",
|
|
111
|
+
children
|
|
112
|
+
})
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* An optional heading that wraps the `Collapsible.Trigger` so a content disclosure (an FAQ entry, a
|
|
117
|
+
* "show more" section) appears in the document outline and the screen-reader rotor — the recommended
|
|
118
|
+
* shape for content. Renders an `<h3>` by default; set `level` for another rank, or `render` to compose
|
|
119
|
+
* a custom element. Omit it for sidebar / file-tree rows, where a heading would be wrong.
|
|
120
|
+
*
|
|
121
|
+
* Slot: `noctis-collapsible-heading`.
|
|
122
|
+
* @see {@link Collapsible.Heading.Props}
|
|
123
|
+
*/
|
|
124
|
+
function CollapsibleHeading({ level = 3, render, className, ...props }) {
|
|
125
|
+
return useRender({
|
|
126
|
+
defaultTagName: `h${level}`,
|
|
127
|
+
render,
|
|
128
|
+
props: {
|
|
129
|
+
"data-slot": COLLAPSIBLE_SLOTS.heading,
|
|
130
|
+
className,
|
|
131
|
+
...props
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* A presentational container that stacks several `Collapsible`s into one bordered card — a hairline rule
|
|
137
|
+
* between siblings and under each open trigger, with a shared outer radius. It carries no open-state
|
|
138
|
+
* coordination: each disclosure opens and closes independently (reach for the `Accordion` primitive when
|
|
139
|
+
* only one should be open at a time).
|
|
140
|
+
*
|
|
141
|
+
* Slot: `noctis-collapsible-group`.
|
|
142
|
+
* @see {@link Collapsible.Group.Props}
|
|
143
|
+
*/
|
|
144
|
+
function CollapsibleGroup({ className, children, ...props }) {
|
|
145
|
+
return /* @__PURE__ */ jsx("div", {
|
|
146
|
+
"data-slot": COLLAPSIBLE_SLOTS.group,
|
|
147
|
+
className,
|
|
148
|
+
...props,
|
|
149
|
+
children
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* A single disclosure — a trigger that expands and collapses a panel of content in place, with a
|
|
154
|
+
* height animation that's reduced-motion safe.
|
|
155
|
+
*
|
|
156
|
+
* **Collapsible vs. Rail vs. Sheet.** Reach for a `Collapsible` to show and hide a region of content
|
|
157
|
+
* *in the flow* of the page (a "show more" section, an expandable card, an FAQ answer). Reach for a
|
|
158
|
+
* `Rail` for a persistent companion panel docked beside the content, and a `Sheet` for a modal task
|
|
159
|
+
* panel that overlays the page. The collapsible is the simplest of the three: no docking, no overlay.
|
|
160
|
+
*
|
|
161
|
+
* Compose it from parts: `Collapsible.Root` owns open state, `Collapsible.Trigger` toggles it, and
|
|
162
|
+
* `Collapsible.Panel` holds the content that animates open and closed. Opt into `Collapsible.Heading`
|
|
163
|
+
* for content-outline semantics and `Collapsible.Group` for the stacked, bordered card look.
|
|
164
|
+
*
|
|
165
|
+
* Built on Base UI's Collapsible for the open/close behavior, measured-height animation, and a11y; the
|
|
166
|
+
* runtime compound is a plain object (kept tree-shakeable), with per-part prop types exposed through
|
|
167
|
+
* the matching `Collapsible` namespace below — e.g. `Collapsible.Panel.Props`.
|
|
168
|
+
*/
|
|
169
|
+
const Collapsible = {
|
|
170
|
+
/** Groups the parts and owns open state. `Collapsible.Root.props()` → its spreadable prop bag. */
|
|
171
|
+
Root: Object.assign(CollapsibleRoot, { props: rootProps }),
|
|
172
|
+
/** Toggles the panel. `Collapsible.Trigger.props()` → its spreadable prop bag. */
|
|
173
|
+
Trigger: Object.assign(CollapsibleTrigger, { props: triggerProps }),
|
|
174
|
+
/** The animated content region. `Collapsible.Panel.props()` → its spreadable prop bag. */
|
|
175
|
+
Panel: Object.assign(CollapsiblePanel, { props: panelProps }),
|
|
176
|
+
/** Optional heading wrapping the trigger. `Collapsible.Heading.props()` → its spreadable prop bag. */
|
|
177
|
+
Heading: Object.assign(CollapsibleHeading, { props: headingProps }),
|
|
178
|
+
/** Presentational stacked container. `Collapsible.Group.props()` → its spreadable prop bag. */
|
|
179
|
+
Group: Object.assign(CollapsibleGroup, { props: groupProps })
|
|
180
|
+
};
|
|
181
|
+
//#endregion
|
|
182
|
+
export { Collapsible };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/components/collapsible/collapsible.props.d.ts
|
|
2
|
+
/** A spreadable data-attribute prop bag — the shape every `Collapsible.*.props()` returns. */
|
|
3
|
+
type CollapsiblePartProps = {
|
|
4
|
+
/** The slot value the matching `collapsible.css` rules anchor on. */"data-slot": string; /** Forwarded verbatim — styling is attribute-driven, so this is an optional consumer passthrough. */
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
/** Common shape: every part's `.props()` accepts an optional `className` passthrough. */
|
|
8
|
+
interface CollapsiblePropsArgs {
|
|
9
|
+
/** Forwarded verbatim onto the returned prop bag. */
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Root prop bag: the disclosure-group slot anchor. */
|
|
13
|
+
declare function rootProps({
|
|
14
|
+
className
|
|
15
|
+
}?: CollapsiblePropsArgs): CollapsiblePartProps;
|
|
16
|
+
/** Trigger prop bag: the slot anchor the trigger-row styling keys off. */
|
|
17
|
+
declare function triggerProps({
|
|
18
|
+
className
|
|
19
|
+
}?: CollapsiblePropsArgs): CollapsiblePartProps;
|
|
20
|
+
/** Panel prop bag: the slot anchor the height-collapse animation keys off. */
|
|
21
|
+
declare function panelProps({
|
|
22
|
+
className
|
|
23
|
+
}?: CollapsiblePropsArgs): CollapsiblePartProps;
|
|
24
|
+
/** Heading prop bag: the slot anchor for the optional heading wrapping the trigger. */
|
|
25
|
+
declare function headingProps({
|
|
26
|
+
className
|
|
27
|
+
}?: CollapsiblePropsArgs): CollapsiblePartProps;
|
|
28
|
+
/** Group prop bag: the slot anchor the stacked-container divider rules key off. */
|
|
29
|
+
declare function groupProps({
|
|
30
|
+
className
|
|
31
|
+
}?: CollapsiblePropsArgs): CollapsiblePartProps;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { groupProps, headingProps, panelProps, rootProps, triggerProps };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { COLLAPSIBLE_SLOTS } from "./collapsible.slots.js";
|
|
2
|
+
//#region src/components/collapsible/collapsible.props.ts
|
|
3
|
+
/**
|
|
4
|
+
* The D12 unified variant contract for Collapsible — the data-attribute-native escape hatch, for
|
|
5
|
+
* elements a `<Collapsible.*>` can't render.
|
|
6
|
+
*
|
|
7
|
+
* Each compound part exposes a `props(...)` builder returning a **spreadable props object** of the form
|
|
8
|
+
* `{ "data-slot": "noctis-collapsible-<part>" }`. Under the single-`data-slot` anchor model the
|
|
9
|
+
* `data-slot` is the only styling hook needed — `collapsible.css` keys every rule off it plus the live
|
|
10
|
+
* `data-*` state Base UI stamps — so spreading a part's `props()` onto a foreign element styles it as
|
|
11
|
+
* that part:
|
|
12
|
+
*
|
|
13
|
+
* <button {...collapsibleTriggerProps()}>Details</button>
|
|
14
|
+
* // → <button data-slot="noctis-collapsible-trigger">
|
|
15
|
+
*
|
|
16
|
+
* The escape hatch carries no className (styling is attribute-driven); an optional `className`
|
|
17
|
+
* passthrough is accepted and forwarded verbatim.
|
|
18
|
+
*/
|
|
19
|
+
const withClassName = (bag, className) => className === void 0 ? bag : {
|
|
20
|
+
...bag,
|
|
21
|
+
className
|
|
22
|
+
};
|
|
23
|
+
/** Root prop bag: the disclosure-group slot anchor. */
|
|
24
|
+
function rootProps({ className } = {}) {
|
|
25
|
+
return withClassName({ "data-slot": COLLAPSIBLE_SLOTS.root }, className);
|
|
26
|
+
}
|
|
27
|
+
/** Trigger prop bag: the slot anchor the trigger-row styling keys off. */
|
|
28
|
+
function triggerProps({ className } = {}) {
|
|
29
|
+
return withClassName({ "data-slot": COLLAPSIBLE_SLOTS.trigger }, className);
|
|
30
|
+
}
|
|
31
|
+
/** Panel prop bag: the slot anchor the height-collapse animation keys off. */
|
|
32
|
+
function panelProps({ className } = {}) {
|
|
33
|
+
return withClassName({ "data-slot": COLLAPSIBLE_SLOTS.panel }, className);
|
|
34
|
+
}
|
|
35
|
+
/** Heading prop bag: the slot anchor for the optional heading wrapping the trigger. */
|
|
36
|
+
function headingProps({ className } = {}) {
|
|
37
|
+
return withClassName({ "data-slot": COLLAPSIBLE_SLOTS.heading }, className);
|
|
38
|
+
}
|
|
39
|
+
/** Group prop bag: the slot anchor the stacked-container divider rules key off. */
|
|
40
|
+
function groupProps({ className } = {}) {
|
|
41
|
+
return withClassName({ "data-slot": COLLAPSIBLE_SLOTS.group }, className);
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { groupProps, headingProps, panelProps, rootProps, triggerProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/components/collapsible/collapsible.slots.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The data attributes `Collapsible`'s parts expose for styling and testing. Each member's value is the
|
|
4
|
+
* attribute name and its JSDoc is the description; the docs API reference reads this enum directly, so
|
|
5
|
+
* the documented attributes can't drift from the precompiled `collapsible.css` rules that key off them.
|
|
6
|
+
* The state attributes are stamped at runtime by Base UI off the live open state.
|
|
7
|
+
*/
|
|
8
|
+
declare enum CollapsibleDataAttributes {
|
|
9
|
+
/** The catalog slot that anchors every `collapsible.css` rule and marks the part for SLOTS.md/testing. */
|
|
10
|
+
slot = "data-slot",
|
|
11
|
+
/** Present on the panel while the disclosure is open. */
|
|
12
|
+
open = "data-open",
|
|
13
|
+
/** Present on the panel while the disclosure is closed. */
|
|
14
|
+
closed = "data-closed",
|
|
15
|
+
/** Present on the trigger while its panel is open — the hook the disclosure chevron rotates off. */
|
|
16
|
+
panelOpen = "data-panel-open",
|
|
17
|
+
/** Present on the panel for the first animation frame as it opens — the from-zero-height keyframe edge. */
|
|
18
|
+
startingStyle = "data-starting-style",
|
|
19
|
+
/** Present on the panel for the final animation frame as it closes — the to-zero-height keyframe edge. */
|
|
20
|
+
endingStyle = "data-ending-style",
|
|
21
|
+
/** Present on the trigger and panel when the collapsible is disabled. */
|
|
22
|
+
disabled = "data-disabled"
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { CollapsibleDataAttributes };
|