@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,217 @@
|
|
|
1
|
+
import { scroll_area_d_exports } from "../../primitives/scroll-area.js";
|
|
2
|
+
import { ScrollAreaOverscroll, ScrollAreaSize, ScrollAreaType } from "./scroll-area.types.js";
|
|
3
|
+
import { ScrollAreaOrientation, ScrollAreaPartProps, contentProps, cornerProps, rootProps, scrollbarProps, thumbProps, viewportProps } from "./scroll-area.props.js";
|
|
4
|
+
import { ReactElement, ReactNode } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/scroll-area/scroll-area.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* The bounding box for a scrollable region. Holds one `ScrollArea.Viewport` (the natively scrolled
|
|
9
|
+
* container, wrapping a `ScrollArea.Content`) and a `ScrollArea.Scrollbar` per axis. Renders no
|
|
10
|
+
* scroll behaviour of its own — Base UI keeps native scrolling and only overlays the custom bars.
|
|
11
|
+
*
|
|
12
|
+
* `type` is the visibility policy and `scrollHideDelay` the rest-delay before the bar fades out;
|
|
13
|
+
* `size` scales the gutter, `overscroll` swaps the scroll-chaining rule, and `fade`/`track` opt into
|
|
14
|
+
* the edge-fade mask and the gutter track. The policy reaches the scrollbars through context (so
|
|
15
|
+
* `type="always"` defaults their `keepMounted`) and through the `data-*` attrs the CSS keys off.
|
|
16
|
+
*/
|
|
17
|
+
declare function ScrollAreaRoot({
|
|
18
|
+
className,
|
|
19
|
+
children,
|
|
20
|
+
type,
|
|
21
|
+
scrollHideDelay,
|
|
22
|
+
size,
|
|
23
|
+
overscroll,
|
|
24
|
+
fade,
|
|
25
|
+
track,
|
|
26
|
+
style,
|
|
27
|
+
...props
|
|
28
|
+
}: ScrollArea.Root.Props): ReactElement;
|
|
29
|
+
/**
|
|
30
|
+
* The natively scrolled container, and the accessible region. Base UI keeps it conditionally
|
|
31
|
+
* focusable (in the tab order only while it overflows) and natively scrollable; this gives it a role
|
|
32
|
+
* (`group` by default, `region` for a page-level area) and forwards an accessible name. Native
|
|
33
|
+
* scrolling carries the semantics, so the overlay bars are decorative — never `role="scrollbar"`.
|
|
34
|
+
*
|
|
35
|
+
* Give it a bounded size (a height, a `max-height`) so its content overflows and the bars appear, and
|
|
36
|
+
* wrap the scrolling content in a `ScrollArea.Content`. A focusable region must be named: pass
|
|
37
|
+
* `aria-label` or `aria-labelledby` (a dev-only warning fires if neither is set).
|
|
38
|
+
*/
|
|
39
|
+
declare function ScrollAreaViewport({
|
|
40
|
+
className,
|
|
41
|
+
children,
|
|
42
|
+
role,
|
|
43
|
+
"aria-label": ariaLabel,
|
|
44
|
+
"aria-labelledby": ariaLabelledby,
|
|
45
|
+
...props
|
|
46
|
+
}: ScrollArea.Viewport.Props): ReactElement;
|
|
47
|
+
/**
|
|
48
|
+
* The intrinsic-width wrapper around the scrolling content, so horizontal overflow is measured from
|
|
49
|
+
* the content's natural width rather than the viewport's.
|
|
50
|
+
*/
|
|
51
|
+
declare function ScrollAreaContent({
|
|
52
|
+
className,
|
|
53
|
+
children,
|
|
54
|
+
...props
|
|
55
|
+
}: ScrollArea.Content.Props): ReactElement;
|
|
56
|
+
/**
|
|
57
|
+
* One scrollbar — decorative paint over native scrolling, so it carries `aria-hidden`. Render a
|
|
58
|
+
* vertical one for a tall region and a horizontal one for a wide region (or both); each holds a single
|
|
59
|
+
* `ScrollArea.Thumb`. Defaults to `vertical`. The bar's visibility follows the root's `type`, and it
|
|
60
|
+
* sits on the correct inline edge under RTL. With `type="always"` it stays mounted (so a persistent
|
|
61
|
+
* bar shows even without overflow); pass `keepMounted` to override.
|
|
62
|
+
*/
|
|
63
|
+
declare function ScrollAreaScrollbar({
|
|
64
|
+
orientation,
|
|
65
|
+
keepMounted,
|
|
66
|
+
className,
|
|
67
|
+
children,
|
|
68
|
+
...props
|
|
69
|
+
}: ScrollArea.Scrollbar.Props): ReactElement;
|
|
70
|
+
/**
|
|
71
|
+
* The draggable handle inside a scrollbar — decorative, so `aria-hidden`. Base UI sizes and positions
|
|
72
|
+
* it from the scroll state (its proportional length rides an inline custom property); this renders the
|
|
73
|
+
* neutral pill with a per-axis minimum length so it stays grabbable, firming up on hover and while
|
|
74
|
+
* dragging. Defaults to the scrollbar's `vertical` orientation; pass `orientation` standalone.
|
|
75
|
+
*/
|
|
76
|
+
declare function ScrollAreaThumb({
|
|
77
|
+
orientation,
|
|
78
|
+
className,
|
|
79
|
+
...props
|
|
80
|
+
}: ScrollArea.Thumb.Props): ReactElement;
|
|
81
|
+
/**
|
|
82
|
+
* The small square where a vertical and a horizontal scrollbar meet — decorative, so `aria-hidden`.
|
|
83
|
+
* Render it only with both bars; it sizes itself from Base UI's corner vars to match the bar thickness.
|
|
84
|
+
*/
|
|
85
|
+
declare function ScrollAreaCorner({
|
|
86
|
+
className,
|
|
87
|
+
...props
|
|
88
|
+
}: ScrollArea.Corner.Props): ReactElement;
|
|
89
|
+
/**
|
|
90
|
+
* Custom thin scrollbars over a natively scrolled region. The browser still does the scrolling —
|
|
91
|
+
* Base UI only overlays slim, neutral bars over native scrolling, so the bars are decorative
|
|
92
|
+
* (`aria-hidden`) and the viewport is the accessible, keyboard-focusable region. The thumb fades in
|
|
93
|
+
* per the `type` visibility policy, firms up and widens on hover, lingers `scrollHideDelay` after
|
|
94
|
+
* scrolling stops, and an opt-in edge-fade signals there's more content. The bars use logical metrics,
|
|
95
|
+
* so the vertical bar sits on the correct inline edge under RTL by construction, and all motion
|
|
96
|
+
* respects `prefers-reduced-motion`. Drop a `ScrollArea` inside a recessed surface
|
|
97
|
+
* (`data-elevation="sunken"`) and the thumb and track re-derive to that scope.
|
|
98
|
+
*
|
|
99
|
+
* Compose from parts: `ScrollArea.Root` bounds the region and sets the policy, `ScrollArea.Viewport`
|
|
100
|
+
* (wrapping a `ScrollArea.Content`) is the scrolled, named region, and a `ScrollArea.Scrollbar` per
|
|
101
|
+
* axis carries a `ScrollArea.Thumb`. A bare `ScrollArea.Scrollbar` renders its thumb for you.
|
|
102
|
+
*
|
|
103
|
+
* The runtime compound is a plain object (kept tree-shakeable); per-part prop and state types are
|
|
104
|
+
* exposed through the matching `ScrollArea` namespace — e.g. `ScrollArea.Scrollbar.Props`.
|
|
105
|
+
*/
|
|
106
|
+
declare const ScrollArea: {
|
|
107
|
+
/** The bounding box. `ScrollArea.Root.props()` → its spreadable prop bag. */Root: typeof ScrollAreaRoot & {
|
|
108
|
+
props: typeof rootProps;
|
|
109
|
+
}; /** The natively scrolled container. `ScrollArea.Viewport.props()` → its spreadable prop bag. */
|
|
110
|
+
Viewport: typeof ScrollAreaViewport & {
|
|
111
|
+
props: typeof viewportProps;
|
|
112
|
+
}; /** The intrinsic-width content wrapper. `ScrollArea.Content.props()` → its spreadable prop bag. */
|
|
113
|
+
Content: typeof ScrollAreaContent & {
|
|
114
|
+
props: typeof contentProps;
|
|
115
|
+
}; /** One axis's scrollbar. `ScrollArea.Scrollbar.props({ orientation })` → its spreadable prop bag. */
|
|
116
|
+
Scrollbar: typeof ScrollAreaScrollbar & {
|
|
117
|
+
props: typeof scrollbarProps;
|
|
118
|
+
}; /** The draggable thumb. `ScrollArea.Thumb.props({ orientation })` → its spreadable prop bag. */
|
|
119
|
+
Thumb: typeof ScrollAreaThumb & {
|
|
120
|
+
props: typeof thumbProps;
|
|
121
|
+
}; /** The bars' meeting corner. `ScrollArea.Corner.props()` → its spreadable prop bag. */
|
|
122
|
+
Corner: typeof ScrollAreaCorner & {
|
|
123
|
+
props: typeof cornerProps;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Per-part prop and state types, mirroring Base UI's `Component.Part.Props` convention. Types-only —
|
|
128
|
+
* it emits no runtime code and merges with the `ScrollArea` object above, so `ScrollArea.Scrollbar`
|
|
129
|
+
* is the component value while `ScrollArea.Scrollbar.Props` is its prop type.
|
|
130
|
+
*/
|
|
131
|
+
declare namespace ScrollArea {
|
|
132
|
+
/** A scrollbar/thumb orientation — which axis the bar controls. */
|
|
133
|
+
type Orientation = ScrollAreaOrientation;
|
|
134
|
+
/** The visibility policy `ScrollArea.Root` applies. */
|
|
135
|
+
type Type = ScrollAreaType;
|
|
136
|
+
/** The gutter scale `ScrollArea.Root` applies. */
|
|
137
|
+
type Size = ScrollAreaSize;
|
|
138
|
+
/** The scroll-chaining behaviour `ScrollArea.Root` applies. */
|
|
139
|
+
type Overscroll = ScrollAreaOverscroll;
|
|
140
|
+
/** The spreadable data-attribute prop bag every `ScrollArea.*.props()` returns (D12). */
|
|
141
|
+
type PartProps = ScrollAreaPartProps;
|
|
142
|
+
namespace Root {
|
|
143
|
+
type Props = Omit<scroll_area_d_exports.ScrollArea.Root.Props, "className" | "children"> & {
|
|
144
|
+
/** `ScrollArea.Viewport` and the `ScrollArea.Scrollbar`s. */children?: ReactNode; /** Classes merged onto the root. */
|
|
145
|
+
className?: string;
|
|
146
|
+
/**
|
|
147
|
+
* The scrollbar visibility policy: `hover` (default), `scroll`, `auto`, or `always`.
|
|
148
|
+
* @default "hover"
|
|
149
|
+
*/
|
|
150
|
+
type?: ScrollAreaType;
|
|
151
|
+
/**
|
|
152
|
+
* Milliseconds the bar lingers after scrolling/hover stops before it fades out (the
|
|
153
|
+
* fade-in stays immediate). Zeroed under `prefers-reduced-motion`.
|
|
154
|
+
* @default 600
|
|
155
|
+
*/
|
|
156
|
+
scrollHideDelay?: number; /** The gutter scale — `md` (default) or a thinner `sm`. @default "md" */
|
|
157
|
+
size?: ScrollAreaSize;
|
|
158
|
+
/**
|
|
159
|
+
* Scroll chaining at the edge — `contain` (default; stop here) or `auto` (chain to the
|
|
160
|
+
* ancestor).
|
|
161
|
+
* @default "contain"
|
|
162
|
+
*/
|
|
163
|
+
overscroll?: ScrollAreaOverscroll;
|
|
164
|
+
/**
|
|
165
|
+
* Mask the overflowing edges with a colourless scroll-shadow fade, signalling there's more
|
|
166
|
+
* content. Off by default so it never dims content inside a bordered surface.
|
|
167
|
+
* @default false
|
|
168
|
+
*/
|
|
169
|
+
fade?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Paint a faint gutter track behind the thumb so a persistent bar reads as a channel.
|
|
172
|
+
* Implied by `type="always"`.
|
|
173
|
+
* @default false
|
|
174
|
+
*/
|
|
175
|
+
track?: boolean;
|
|
176
|
+
};
|
|
177
|
+
type State = scroll_area_d_exports.ScrollArea.Root.State;
|
|
178
|
+
}
|
|
179
|
+
namespace Viewport {
|
|
180
|
+
type Props = Omit<scroll_area_d_exports.ScrollArea.Viewport.Props, "role"> & {
|
|
181
|
+
/**
|
|
182
|
+
* The region's role. `group` (default) is quiet — announced as a labelled boundary but not
|
|
183
|
+
* a landmark; use `region` for a page-level scroll area that should appear in the landmarks
|
|
184
|
+
* rotor. Either way the region needs an accessible name (`aria-label`/`aria-labelledby`).
|
|
185
|
+
* @default "group"
|
|
186
|
+
*/
|
|
187
|
+
role?: "group" | "region";
|
|
188
|
+
};
|
|
189
|
+
type State = scroll_area_d_exports.ScrollArea.Viewport.State;
|
|
190
|
+
}
|
|
191
|
+
namespace Content {
|
|
192
|
+
type Props = scroll_area_d_exports.ScrollArea.Content.Props;
|
|
193
|
+
type State = scroll_area_d_exports.ScrollArea.Content.State;
|
|
194
|
+
}
|
|
195
|
+
namespace Scrollbar {
|
|
196
|
+
type Props = scroll_area_d_exports.ScrollArea.Scrollbar.Props;
|
|
197
|
+
type State = scroll_area_d_exports.ScrollArea.Scrollbar.State;
|
|
198
|
+
}
|
|
199
|
+
namespace Thumb {
|
|
200
|
+
type Props = scroll_area_d_exports.ScrollArea.Thumb.Props & {
|
|
201
|
+
/**
|
|
202
|
+
* Which axis the parent scrollbar controls — stamps `data-orientation` so the per-axis
|
|
203
|
+
* minimum-length rule applies. Inherited from `ScrollArea.Scrollbar`; pass it only when
|
|
204
|
+
* rendering a thumb standalone.
|
|
205
|
+
* @default "vertical"
|
|
206
|
+
*/
|
|
207
|
+
orientation?: ScrollAreaOrientation;
|
|
208
|
+
};
|
|
209
|
+
type State = scroll_area_d_exports.ScrollArea.Thumb.State;
|
|
210
|
+
}
|
|
211
|
+
namespace Corner {
|
|
212
|
+
type Props = scroll_area_d_exports.ScrollArea.Corner.Props;
|
|
213
|
+
type State = scroll_area_d_exports.ScrollArea.Corner.State;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
//#endregion
|
|
217
|
+
export { ScrollArea };
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { scroll_area_exports } from "../../primitives/scroll-area.js";
|
|
3
|
+
import { ScrollAreaProvider, useScrollAreaContext } from "./scroll-area.context.js";
|
|
4
|
+
import { SCROLL_AREA_SLOTS } from "./scroll-area.slots.js";
|
|
5
|
+
import { contentProps, cornerProps, rootProps, scrollbarProps, thumbProps, viewportProps } from "./scroll-area.props.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/scroll-area/scroll-area.tsx
|
|
8
|
+
/**
|
|
9
|
+
* The bounding box for a scrollable region. Holds one `ScrollArea.Viewport` (the natively scrolled
|
|
10
|
+
* container, wrapping a `ScrollArea.Content`) and a `ScrollArea.Scrollbar` per axis. Renders no
|
|
11
|
+
* scroll behaviour of its own — Base UI keeps native scrolling and only overlays the custom bars.
|
|
12
|
+
*
|
|
13
|
+
* `type` is the visibility policy and `scrollHideDelay` the rest-delay before the bar fades out;
|
|
14
|
+
* `size` scales the gutter, `overscroll` swaps the scroll-chaining rule, and `fade`/`track` opt into
|
|
15
|
+
* the edge-fade mask and the gutter track. The policy reaches the scrollbars through context (so
|
|
16
|
+
* `type="always"` defaults their `keepMounted`) and through the `data-*` attrs the CSS keys off.
|
|
17
|
+
*/
|
|
18
|
+
function ScrollAreaRoot({ className, children, type = "hover", scrollHideDelay = 600, size = "md", overscroll = "contain", fade = false, track = false, style, ...props }) {
|
|
19
|
+
const withDelay = (base) => ({
|
|
20
|
+
...base,
|
|
21
|
+
"--scroll-area-scrollbar-transition-delay": `${scrollHideDelay}ms`
|
|
22
|
+
});
|
|
23
|
+
return /* @__PURE__ */ jsx(scroll_area_exports.ScrollArea.Root, {
|
|
24
|
+
...rootProps({
|
|
25
|
+
type,
|
|
26
|
+
size,
|
|
27
|
+
overscroll,
|
|
28
|
+
fade,
|
|
29
|
+
track
|
|
30
|
+
}),
|
|
31
|
+
className,
|
|
32
|
+
style: typeof style === "function" ? (state) => withDelay(style(state)) : withDelay(style),
|
|
33
|
+
...props,
|
|
34
|
+
children: /* @__PURE__ */ jsx(ScrollAreaProvider, {
|
|
35
|
+
value: { type },
|
|
36
|
+
children
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The natively scrolled container, and the accessible region. Base UI keeps it conditionally
|
|
42
|
+
* focusable (in the tab order only while it overflows) and natively scrollable; this gives it a role
|
|
43
|
+
* (`group` by default, `region` for a page-level area) and forwards an accessible name. Native
|
|
44
|
+
* scrolling carries the semantics, so the overlay bars are decorative — never `role="scrollbar"`.
|
|
45
|
+
*
|
|
46
|
+
* Give it a bounded size (a height, a `max-height`) so its content overflows and the bars appear, and
|
|
47
|
+
* wrap the scrolling content in a `ScrollArea.Content`. A focusable region must be named: pass
|
|
48
|
+
* `aria-label` or `aria-labelledby` (a dev-only warning fires if neither is set).
|
|
49
|
+
*/
|
|
50
|
+
function ScrollAreaViewport({ className, children, role = "group", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...props }) {
|
|
51
|
+
if (process.env.NODE_ENV !== "production" && ariaLabel == null && ariaLabelledby == null) console.warn("ScrollArea.Viewport: a scrollable region needs an accessible name. Pass `aria-label` or `aria-labelledby` so a screen reader announces it when it takes keyboard focus.");
|
|
52
|
+
return /* @__PURE__ */ jsx(scroll_area_exports.ScrollArea.Viewport, {
|
|
53
|
+
"data-slot": SCROLL_AREA_SLOTS.viewport,
|
|
54
|
+
role,
|
|
55
|
+
"aria-label": ariaLabel,
|
|
56
|
+
"aria-labelledby": ariaLabelledby,
|
|
57
|
+
className,
|
|
58
|
+
...props,
|
|
59
|
+
children
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The intrinsic-width wrapper around the scrolling content, so horizontal overflow is measured from
|
|
64
|
+
* the content's natural width rather than the viewport's.
|
|
65
|
+
*/
|
|
66
|
+
function ScrollAreaContent({ className, children, ...props }) {
|
|
67
|
+
return /* @__PURE__ */ jsx(scroll_area_exports.ScrollArea.Content, {
|
|
68
|
+
"data-slot": SCROLL_AREA_SLOTS.content,
|
|
69
|
+
className,
|
|
70
|
+
...props,
|
|
71
|
+
children
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* One scrollbar — decorative paint over native scrolling, so it carries `aria-hidden`. Render a
|
|
76
|
+
* vertical one for a tall region and a horizontal one for a wide region (or both); each holds a single
|
|
77
|
+
* `ScrollArea.Thumb`. Defaults to `vertical`. The bar's visibility follows the root's `type`, and it
|
|
78
|
+
* sits on the correct inline edge under RTL. With `type="always"` it stays mounted (so a persistent
|
|
79
|
+
* bar shows even without overflow); pass `keepMounted` to override.
|
|
80
|
+
*/
|
|
81
|
+
function ScrollAreaScrollbar({ orientation = "vertical", keepMounted, className, children, ...props }) {
|
|
82
|
+
const context = useScrollAreaContext();
|
|
83
|
+
const resolvedKeepMounted = keepMounted ?? context?.type === "always";
|
|
84
|
+
return /* @__PURE__ */ jsx(scroll_area_exports.ScrollArea.Scrollbar, {
|
|
85
|
+
"data-slot": SCROLL_AREA_SLOTS.scrollbar,
|
|
86
|
+
orientation,
|
|
87
|
+
keepMounted: resolvedKeepMounted,
|
|
88
|
+
"aria-hidden": true,
|
|
89
|
+
className,
|
|
90
|
+
...props,
|
|
91
|
+
children: children ?? /* @__PURE__ */ jsx(ScrollAreaThumb, { orientation })
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The draggable handle inside a scrollbar — decorative, so `aria-hidden`. Base UI sizes and positions
|
|
96
|
+
* it from the scroll state (its proportional length rides an inline custom property); this renders the
|
|
97
|
+
* neutral pill with a per-axis minimum length so it stays grabbable, firming up on hover and while
|
|
98
|
+
* dragging. Defaults to the scrollbar's `vertical` orientation; pass `orientation` standalone.
|
|
99
|
+
*/
|
|
100
|
+
function ScrollAreaThumb({ orientation = "vertical", className, ...props }) {
|
|
101
|
+
return /* @__PURE__ */ jsx(scroll_area_exports.ScrollArea.Thumb, {
|
|
102
|
+
"data-slot": SCROLL_AREA_SLOTS.thumb,
|
|
103
|
+
"data-orientation": orientation,
|
|
104
|
+
"aria-hidden": true,
|
|
105
|
+
className,
|
|
106
|
+
...props
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The small square where a vertical and a horizontal scrollbar meet — decorative, so `aria-hidden`.
|
|
111
|
+
* Render it only with both bars; it sizes itself from Base UI's corner vars to match the bar thickness.
|
|
112
|
+
*/
|
|
113
|
+
function ScrollAreaCorner({ className, ...props }) {
|
|
114
|
+
return /* @__PURE__ */ jsx(scroll_area_exports.ScrollArea.Corner, {
|
|
115
|
+
"data-slot": SCROLL_AREA_SLOTS.corner,
|
|
116
|
+
"aria-hidden": true,
|
|
117
|
+
className,
|
|
118
|
+
...props
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Custom thin scrollbars over a natively scrolled region. The browser still does the scrolling —
|
|
123
|
+
* Base UI only overlays slim, neutral bars over native scrolling, so the bars are decorative
|
|
124
|
+
* (`aria-hidden`) and the viewport is the accessible, keyboard-focusable region. The thumb fades in
|
|
125
|
+
* per the `type` visibility policy, firms up and widens on hover, lingers `scrollHideDelay` after
|
|
126
|
+
* scrolling stops, and an opt-in edge-fade signals there's more content. The bars use logical metrics,
|
|
127
|
+
* so the vertical bar sits on the correct inline edge under RTL by construction, and all motion
|
|
128
|
+
* respects `prefers-reduced-motion`. Drop a `ScrollArea` inside a recessed surface
|
|
129
|
+
* (`data-elevation="sunken"`) and the thumb and track re-derive to that scope.
|
|
130
|
+
*
|
|
131
|
+
* Compose from parts: `ScrollArea.Root` bounds the region and sets the policy, `ScrollArea.Viewport`
|
|
132
|
+
* (wrapping a `ScrollArea.Content`) is the scrolled, named region, and a `ScrollArea.Scrollbar` per
|
|
133
|
+
* axis carries a `ScrollArea.Thumb`. A bare `ScrollArea.Scrollbar` renders its thumb for you.
|
|
134
|
+
*
|
|
135
|
+
* The runtime compound is a plain object (kept tree-shakeable); per-part prop and state types are
|
|
136
|
+
* exposed through the matching `ScrollArea` namespace — e.g. `ScrollArea.Scrollbar.Props`.
|
|
137
|
+
*/
|
|
138
|
+
const ScrollArea = {
|
|
139
|
+
/** The bounding box. `ScrollArea.Root.props()` → its spreadable prop bag. */
|
|
140
|
+
Root: Object.assign(ScrollAreaRoot, { props: rootProps }),
|
|
141
|
+
/** The natively scrolled container. `ScrollArea.Viewport.props()` → its spreadable prop bag. */
|
|
142
|
+
Viewport: Object.assign(ScrollAreaViewport, { props: viewportProps }),
|
|
143
|
+
/** The intrinsic-width content wrapper. `ScrollArea.Content.props()` → its spreadable prop bag. */
|
|
144
|
+
Content: Object.assign(ScrollAreaContent, { props: contentProps }),
|
|
145
|
+
/** One axis's scrollbar. `ScrollArea.Scrollbar.props({ orientation })` → its spreadable prop bag. */
|
|
146
|
+
Scrollbar: Object.assign(ScrollAreaScrollbar, { props: scrollbarProps }),
|
|
147
|
+
/** The draggable thumb. `ScrollArea.Thumb.props({ orientation })` → its spreadable prop bag. */
|
|
148
|
+
Thumb: Object.assign(ScrollAreaThumb, { props: thumbProps }),
|
|
149
|
+
/** The bars' meeting corner. `ScrollArea.Corner.props()` → its spreadable prop bag. */
|
|
150
|
+
Corner: Object.assign(ScrollAreaCorner, { props: cornerProps })
|
|
151
|
+
};
|
|
152
|
+
//#endregion
|
|
153
|
+
export { ScrollArea };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ScrollAreaOverscroll, ScrollAreaSize, ScrollAreaType } from "./scroll-area.types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/scroll-area/scroll-area.props.d.ts
|
|
4
|
+
/** A scrollbar/thumb orientation — which axis the bar controls. */
|
|
5
|
+
type ScrollAreaOrientation = "vertical" | "horizontal";
|
|
6
|
+
/** A spreadable data-attribute prop bag — the shape every `ScrollArea.*.props()` returns. */
|
|
7
|
+
type ScrollAreaPartProps = {
|
|
8
|
+
/** The slot value the matching `scroll-area.css` rules anchor on. */"data-slot": string; /** Forwarded verbatim — styling is attribute-driven, so this is an optional consumer passthrough. */
|
|
9
|
+
className?: string; /** A data-attribute present (empty string) or absent (`undefined`); never `false`. */
|
|
10
|
+
[attr: `data-${string}`]: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
/** Common shape: every part's `.props()` accepts an optional `className` passthrough. */
|
|
13
|
+
interface BasePropsArgs {
|
|
14
|
+
/** Forwarded verbatim onto the returned prop bag. */
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Argument to a stateless part's `.props(...)` — no orientation of its own. */
|
|
18
|
+
type ScrollAreaStatelessPropsArgs = BasePropsArgs;
|
|
19
|
+
/** Argument to `ScrollArea.Scrollbar.props(...)` / `ScrollArea.Thumb.props(...)` — the axis the CSS keys metrics off. */
|
|
20
|
+
interface ScrollAreaOrientedPropsArgs extends BasePropsArgs {
|
|
21
|
+
/** Which axis the bar controls — drives the width/height metrics via `data-orientation`. @default "vertical" */
|
|
22
|
+
orientation?: ScrollAreaOrientation;
|
|
23
|
+
}
|
|
24
|
+
/** Argument to `ScrollArea.Root.props(...)` — the policy/scale axes the root stamps as data-attrs. */
|
|
25
|
+
interface ScrollAreaRootPropsArgs extends BasePropsArgs {
|
|
26
|
+
/** Visibility policy → `data-type`. @default "hover" */
|
|
27
|
+
type?: ScrollAreaType;
|
|
28
|
+
/** Gutter scale → `data-size`. @default "md" */
|
|
29
|
+
size?: ScrollAreaSize;
|
|
30
|
+
/** Scroll-chaining behaviour → `data-overscroll`. @default "contain" */
|
|
31
|
+
overscroll?: ScrollAreaOverscroll;
|
|
32
|
+
/** Enable the edge-fade mask → presence `data-fade`. @default false */
|
|
33
|
+
fade?: boolean;
|
|
34
|
+
/** Paint the gutter track → presence `data-track` (also implied by `type="always"`). @default false */
|
|
35
|
+
track?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Root prop bag: the slot anchor plus the policy/scale data-attrs the CSS keys off. `type`/`size`/
|
|
39
|
+
* `overscroll` always carry their resolved value; `fade`/`track` are bare presence attrs (`""` or
|
|
40
|
+
* absent). `track` is also implied when `type="always"`.
|
|
41
|
+
*/
|
|
42
|
+
declare function rootProps({
|
|
43
|
+
type,
|
|
44
|
+
size,
|
|
45
|
+
overscroll,
|
|
46
|
+
fade,
|
|
47
|
+
track,
|
|
48
|
+
className
|
|
49
|
+
}?: ScrollAreaRootPropsArgs): ScrollAreaPartProps;
|
|
50
|
+
/** Viewport prop bag: just the slot anchor. */
|
|
51
|
+
declare function viewportProps({
|
|
52
|
+
className
|
|
53
|
+
}?: ScrollAreaStatelessPropsArgs): ScrollAreaPartProps;
|
|
54
|
+
/** Content prop bag: just the slot anchor. */
|
|
55
|
+
declare function contentProps({
|
|
56
|
+
className
|
|
57
|
+
}?: ScrollAreaStatelessPropsArgs): ScrollAreaPartProps;
|
|
58
|
+
/** Scrollbar prop bag: slot anchor plus the `data-orientation` the descendant rules read. */
|
|
59
|
+
declare function scrollbarProps({
|
|
60
|
+
orientation,
|
|
61
|
+
className
|
|
62
|
+
}?: ScrollAreaOrientedPropsArgs): ScrollAreaPartProps;
|
|
63
|
+
/** Thumb prop bag: slot anchor plus the `data-orientation` the min-size rules read. */
|
|
64
|
+
declare function thumbProps({
|
|
65
|
+
orientation,
|
|
66
|
+
className
|
|
67
|
+
}?: ScrollAreaOrientedPropsArgs): ScrollAreaPartProps;
|
|
68
|
+
/** Corner prop bag: just the slot anchor. */
|
|
69
|
+
declare function cornerProps({
|
|
70
|
+
className
|
|
71
|
+
}?: ScrollAreaStatelessPropsArgs): ScrollAreaPartProps;
|
|
72
|
+
//#endregion
|
|
73
|
+
export { ScrollAreaOrientation, ScrollAreaPartProps, contentProps, cornerProps, rootProps, scrollbarProps, thumbProps, viewportProps };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { SCROLL_AREA_SLOTS } from "./scroll-area.slots.js";
|
|
2
|
+
//#region src/components/scroll-area/scroll-area.props.ts
|
|
3
|
+
/**
|
|
4
|
+
* The D12 unified contract for ScrollArea — the data-attribute-native escape hatch for styling a
|
|
5
|
+
* *foreign* element as a scroll-area part.
|
|
6
|
+
*
|
|
7
|
+
* Each part exposes a `props(...)` builder returning a **spreadable props object** of the form
|
|
8
|
+
* `{ "data-slot": "noctis-scroll-area-<part>", ...dataAttrs }`. Under the single-`data-slot` anchor
|
|
9
|
+
* model `scroll-area.css` keys every rule off the slot, so spreading a part's `props()` onto a foreign
|
|
10
|
+
* element styles it as that part:
|
|
11
|
+
*
|
|
12
|
+
* <div {...ScrollArea.Scrollbar.props({ orientation: "horizontal" })} />
|
|
13
|
+
* // → <div data-slot="noctis-scroll-area-scrollbar" data-orientation="horizontal">
|
|
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
|
+
/**
|
|
23
|
+
* Root prop bag: the slot anchor plus the policy/scale data-attrs the CSS keys off. `type`/`size`/
|
|
24
|
+
* `overscroll` always carry their resolved value; `fade`/`track` are bare presence attrs (`""` or
|
|
25
|
+
* absent). `track` is also implied when `type="always"`.
|
|
26
|
+
*/
|
|
27
|
+
function rootProps({ type = "hover", size = "md", overscroll = "contain", fade = false, track = false, className } = {}) {
|
|
28
|
+
return withClassName({
|
|
29
|
+
"data-slot": SCROLL_AREA_SLOTS.root,
|
|
30
|
+
"data-type": type,
|
|
31
|
+
"data-size": size,
|
|
32
|
+
"data-overscroll": overscroll,
|
|
33
|
+
...fade ? { "data-fade": "" } : {},
|
|
34
|
+
...track || type === "always" ? { "data-track": "" } : {}
|
|
35
|
+
}, className);
|
|
36
|
+
}
|
|
37
|
+
/** Viewport prop bag: just the slot anchor. */
|
|
38
|
+
function viewportProps({ className } = {}) {
|
|
39
|
+
return withClassName({ "data-slot": SCROLL_AREA_SLOTS.viewport }, className);
|
|
40
|
+
}
|
|
41
|
+
/** Content prop bag: just the slot anchor. */
|
|
42
|
+
function contentProps({ className } = {}) {
|
|
43
|
+
return withClassName({ "data-slot": SCROLL_AREA_SLOTS.content }, className);
|
|
44
|
+
}
|
|
45
|
+
/** Scrollbar prop bag: slot anchor plus the `data-orientation` the descendant rules read. */
|
|
46
|
+
function scrollbarProps({ orientation = "vertical", className } = {}) {
|
|
47
|
+
return withClassName({
|
|
48
|
+
"data-slot": SCROLL_AREA_SLOTS.scrollbar,
|
|
49
|
+
"data-orientation": orientation
|
|
50
|
+
}, className);
|
|
51
|
+
}
|
|
52
|
+
/** Thumb prop bag: slot anchor plus the `data-orientation` the min-size rules read. */
|
|
53
|
+
function thumbProps({ orientation = "vertical", className } = {}) {
|
|
54
|
+
return withClassName({
|
|
55
|
+
"data-slot": SCROLL_AREA_SLOTS.thumb,
|
|
56
|
+
"data-orientation": orientation
|
|
57
|
+
}, className);
|
|
58
|
+
}
|
|
59
|
+
/** Corner prop bag: just the slot anchor. */
|
|
60
|
+
function cornerProps({ className } = {}) {
|
|
61
|
+
return withClassName({ "data-slot": SCROLL_AREA_SLOTS.corner }, className);
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { contentProps, cornerProps, rootProps, scrollbarProps, thumbProps, viewportProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//#region src/components/scroll-area/scroll-area.slots.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The `data-*` hooks `ScrollArea` stamps on its parts, for host-side styling and tests. Slot values
|
|
4
|
+
* mark each rendered element; the state attributes are emitted by Base UI's ScrollArea — pair a slot
|
|
5
|
+
* with a state to target, say, only the scrollbar while the area is being scrolled.
|
|
6
|
+
*/
|
|
7
|
+
declare enum ScrollAreaDataAttributes {
|
|
8
|
+
/** The rendered scroll-area element. */
|
|
9
|
+
slot = "data-slot",
|
|
10
|
+
/** `horizontal` | `vertical` — the orientation of a scrollbar or thumb. */
|
|
11
|
+
orientation = "data-orientation",
|
|
12
|
+
/** `hover` | `scroll` | `auto` | `always` — the visibility policy, stamped on the root. */
|
|
13
|
+
type = "data-type",
|
|
14
|
+
/** `sm` | `md` — the gutter scale, stamped on the root. */
|
|
15
|
+
size = "data-size",
|
|
16
|
+
/** `contain` | `auto` — the scroll-chaining behaviour, stamped on the root. */
|
|
17
|
+
overscroll = "data-overscroll",
|
|
18
|
+
/** Present on the root when the edge-fade mask is enabled. */
|
|
19
|
+
fade = "data-fade",
|
|
20
|
+
/** Present on the root when the gutter track is painted (set by `track`, or by `type="always"`). */
|
|
21
|
+
track = "data-track",
|
|
22
|
+
/** Present on the scrollbar while the pointer is over the scroll area (the fade-in cue). */
|
|
23
|
+
hovering = "data-hovering",
|
|
24
|
+
/** Present on the scrollbar and viewport while the user is scrolling. */
|
|
25
|
+
scrolling = "data-scrolling",
|
|
26
|
+
/** Present when the content is wider than the viewport (a horizontal scrollbar is warranted). */
|
|
27
|
+
hasOverflowX = "data-has-overflow-x",
|
|
28
|
+
/** Present when the content is taller than the viewport (a vertical scrollbar is warranted). */
|
|
29
|
+
hasOverflowY = "data-has-overflow-y",
|
|
30
|
+
/** Present on the root/viewport while content is hidden past the inline-start edge (drives the fade). */
|
|
31
|
+
overflowXStart = "data-overflow-x-start",
|
|
32
|
+
/** Present on the root/viewport while content is hidden past the inline-end edge (drives the fade). */
|
|
33
|
+
overflowXEnd = "data-overflow-x-end",
|
|
34
|
+
/** Present on the root/viewport while content is hidden past the block-start edge (drives the fade). */
|
|
35
|
+
overflowYStart = "data-overflow-y-start",
|
|
36
|
+
/** Present on the root/viewport while content is hidden past the block-end edge (drives the fade). */
|
|
37
|
+
overflowYEnd = "data-overflow-y-end"
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { ScrollAreaDataAttributes };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//#region src/components/scroll-area/scroll-area.slots.ts
|
|
2
|
+
/**
|
|
3
|
+
* The slot vocabulary every `ScrollArea` part stamps as its `data-slot`. The authored source the
|
|
4
|
+
* orchestration file reads from, kebab-cased `{component}-{part}`; SLOTS.md mirrors the same anatomy
|
|
5
|
+
* from the token-graph declaration.
|
|
6
|
+
*/
|
|
7
|
+
const SCROLL_AREA_SLOTS = {
|
|
8
|
+
root: "noctis-scroll-area",
|
|
9
|
+
viewport: "noctis-scroll-area-viewport",
|
|
10
|
+
content: "noctis-scroll-area-content",
|
|
11
|
+
scrollbar: "noctis-scroll-area-scrollbar",
|
|
12
|
+
thumb: "noctis-scroll-area-thumb",
|
|
13
|
+
corner: "noctis-scroll-area-corner"
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The `data-*` hooks `ScrollArea` stamps on its parts, for host-side styling and tests. Slot values
|
|
17
|
+
* mark each rendered element; the state attributes are emitted by Base UI's ScrollArea — pair a slot
|
|
18
|
+
* with a state to target, say, only the scrollbar while the area is being scrolled.
|
|
19
|
+
*/
|
|
20
|
+
let ScrollAreaDataAttributes = /* @__PURE__ */ function(ScrollAreaDataAttributes) {
|
|
21
|
+
/** The rendered scroll-area element. */
|
|
22
|
+
ScrollAreaDataAttributes["slot"] = "data-slot";
|
|
23
|
+
/** `horizontal` | `vertical` — the orientation of a scrollbar or thumb. */
|
|
24
|
+
ScrollAreaDataAttributes["orientation"] = "data-orientation";
|
|
25
|
+
/** `hover` | `scroll` | `auto` | `always` — the visibility policy, stamped on the root. */
|
|
26
|
+
ScrollAreaDataAttributes["type"] = "data-type";
|
|
27
|
+
/** `sm` | `md` — the gutter scale, stamped on the root. */
|
|
28
|
+
ScrollAreaDataAttributes["size"] = "data-size";
|
|
29
|
+
/** `contain` | `auto` — the scroll-chaining behaviour, stamped on the root. */
|
|
30
|
+
ScrollAreaDataAttributes["overscroll"] = "data-overscroll";
|
|
31
|
+
/** Present on the root when the edge-fade mask is enabled. */
|
|
32
|
+
ScrollAreaDataAttributes["fade"] = "data-fade";
|
|
33
|
+
/** Present on the root when the gutter track is painted (set by `track`, or by `type="always"`). */
|
|
34
|
+
ScrollAreaDataAttributes["track"] = "data-track";
|
|
35
|
+
/** Present on the scrollbar while the pointer is over the scroll area (the fade-in cue). */
|
|
36
|
+
ScrollAreaDataAttributes["hovering"] = "data-hovering";
|
|
37
|
+
/** Present on the scrollbar and viewport while the user is scrolling. */
|
|
38
|
+
ScrollAreaDataAttributes["scrolling"] = "data-scrolling";
|
|
39
|
+
/** Present when the content is wider than the viewport (a horizontal scrollbar is warranted). */
|
|
40
|
+
ScrollAreaDataAttributes["hasOverflowX"] = "data-has-overflow-x";
|
|
41
|
+
/** Present when the content is taller than the viewport (a vertical scrollbar is warranted). */
|
|
42
|
+
ScrollAreaDataAttributes["hasOverflowY"] = "data-has-overflow-y";
|
|
43
|
+
/** Present on the root/viewport while content is hidden past the inline-start edge (drives the fade). */
|
|
44
|
+
ScrollAreaDataAttributes["overflowXStart"] = "data-overflow-x-start";
|
|
45
|
+
/** Present on the root/viewport while content is hidden past the inline-end edge (drives the fade). */
|
|
46
|
+
ScrollAreaDataAttributes["overflowXEnd"] = "data-overflow-x-end";
|
|
47
|
+
/** Present on the root/viewport while content is hidden past the block-start edge (drives the fade). */
|
|
48
|
+
ScrollAreaDataAttributes["overflowYStart"] = "data-overflow-y-start";
|
|
49
|
+
/** Present on the root/viewport while content is hidden past the block-end edge (drives the fade). */
|
|
50
|
+
ScrollAreaDataAttributes["overflowYEnd"] = "data-overflow-y-end";
|
|
51
|
+
return ScrollAreaDataAttributes;
|
|
52
|
+
}({});
|
|
53
|
+
//#endregion
|
|
54
|
+
export { SCROLL_AREA_SLOTS, ScrollAreaDataAttributes };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/components/scroll-area/scroll-area.types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The shared option unions for `ScrollArea.Root` — kept in their own module so the props builder,
|
|
4
|
+
* the orchestration, and the context can all import them without a cycle.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The scrollbar visibility policy (Noctis-owned — Base UI ships no `type`). Stamped as `data-type`
|
|
8
|
+
* on the root; the CSS keys the bar's `opacity` off it.
|
|
9
|
+
* - `hover` — fade in while the pointer is over the area or the user is scrolling (the default).
|
|
10
|
+
* - `scroll` — show only while scrolling; the cleanest reading mode.
|
|
11
|
+
* - `auto` — show whenever the content overflows.
|
|
12
|
+
* - `always` — keep the bar drawn at all times (a persistent channel for code blocks, data tables).
|
|
13
|
+
*/
|
|
14
|
+
type ScrollAreaType = "hover" | "scroll" | "auto" | "always";
|
|
15
|
+
/** The gutter scale, stamped as `data-size` on the root — `md` (default) or a thinner `sm`. */
|
|
16
|
+
type ScrollAreaSize = "sm" | "md";
|
|
17
|
+
/**
|
|
18
|
+
* The scroll-chaining behaviour at the viewport edge, stamped as `data-overscroll` on the root.
|
|
19
|
+
* - `contain` — stop the scroll at this region's edge (the default; right for menus/popovers).
|
|
20
|
+
* - `auto` — let the scroll chain to the ancestor once this region bottoms out.
|
|
21
|
+
*/
|
|
22
|
+
type ScrollAreaOverscroll = "contain" | "auto";
|
|
23
|
+
//#endregion
|
|
24
|
+
export { ScrollAreaOverscroll, ScrollAreaSize, ScrollAreaType };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentProps, ReactElement } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/search-dialog/parts/input.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The header row: the search glyph, the query field, an in-flight spinner, and the `Esc` close chip.
|
|
6
|
+
* Reads the query, the in-flight state, and the key handler from context; the field auto-focuses when
|
|
7
|
+
* the dialog opens (`SearchDialog.Root` points Base UI's `initialFocus` at it). The `Esc` chip's label
|
|
8
|
+
* stays decorative — the dialog's own Escape handling closes it.
|
|
9
|
+
*
|
|
10
|
+
* Slot: `search-dialog-header` on the row, `search-dialog-input` on the field.
|
|
11
|
+
*
|
|
12
|
+
* @see {@link SearchDialog.Input.Props}
|
|
13
|
+
*/
|
|
14
|
+
declare function SearchDialogInput({
|
|
15
|
+
placeholder,
|
|
16
|
+
...props
|
|
17
|
+
}: SearchDialogInput.Props): ReactElement;
|
|
18
|
+
declare namespace SearchDialogInput {
|
|
19
|
+
type Props = Omit<ComponentProps<"input">, "value" | "onChange" | "onKeyDown" | "type" | "ref" | "aria-label" | "className"> & {
|
|
20
|
+
/** Field placeholder. */placeholder?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { SearchDialogInput };
|