@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,279 @@
|
|
|
1
|
+
import { dialog_d_exports } from "../../primitives/dialog.js";
|
|
2
|
+
import { SheetSide, SheetSize } from "./sheet.types.js";
|
|
3
|
+
import { SheetPartProps, SheetPopupPropsArgs, backdropProps, bodyProps, closeButtonProps, closeProps, descriptionProps, footerProps, headerProps, popupProps, titleProps, triggerProps, viewportProps } from "./sheet.props.js";
|
|
4
|
+
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/sheet/sheet.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Groups the parts and owns open state. Modal by default — focus is trapped, the page is scroll-locked,
|
|
9
|
+
* and the rest of the document is inert; an outside click or `Escape` closes it. Nest a `Sheet` inside
|
|
10
|
+
* another `Sheet`'s `Popup`/`Content` to stack them: Base UI manages the focus and escape ordering, and
|
|
11
|
+
* each panel behind the top one peeks out by a per-depth offset to show the stack.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link Sheet.Root.Props}
|
|
14
|
+
*/
|
|
15
|
+
declare function SheetRoot(props: Sheet.Root.Props): ReactElement;
|
|
16
|
+
/**
|
|
17
|
+
* A button that opens the sheet. Wires the accessible relationship to the panel.
|
|
18
|
+
*
|
|
19
|
+
* Slot: `noctis-sheet-trigger`.
|
|
20
|
+
* @see {@link Sheet.Trigger.Props}
|
|
21
|
+
*/
|
|
22
|
+
declare function SheetTrigger(props: Sheet.Trigger.Props): ReactElement;
|
|
23
|
+
/**
|
|
24
|
+
* Moves the panel and backdrop to a portal at the end of `<body>`.
|
|
25
|
+
*
|
|
26
|
+
* @see {@link Sheet.Portal.Props}
|
|
27
|
+
*/
|
|
28
|
+
declare function SheetPortal(props: Sheet.Portal.Props): ReactElement;
|
|
29
|
+
/**
|
|
30
|
+
* The scrim behind the panel. Fades with the sheet and dims everything beneath it. Each sheet in a
|
|
31
|
+
* stack renders its own backdrop (`forceRender`), so a stacked sheet dims — and intercepts clicks for —
|
|
32
|
+
* the sheet(s) behind it: clicking the dimmed area closes the top sheet, stepping back one level.
|
|
33
|
+
*
|
|
34
|
+
* Slot: `noctis-sheet-backdrop`.
|
|
35
|
+
* @see {@link Sheet.Backdrop.Props}
|
|
36
|
+
*/
|
|
37
|
+
declare function SheetBackdrop({
|
|
38
|
+
className,
|
|
39
|
+
forceRender,
|
|
40
|
+
...props
|
|
41
|
+
}: Sheet.Backdrop.Props): ReactElement;
|
|
42
|
+
/**
|
|
43
|
+
* A positioning container for the panel that can be made scrollable — for advanced overflow layouts.
|
|
44
|
+
*
|
|
45
|
+
* Slot: `noctis-sheet-viewport`.
|
|
46
|
+
* @see {@link Sheet.Viewport.Props}
|
|
47
|
+
*/
|
|
48
|
+
declare function SheetViewport(props: Sheet.Viewport.Props): ReactElement;
|
|
49
|
+
/**
|
|
50
|
+
* The panel surface itself. Portal it (or use {@link Sheet.Content}) and compose the slots inside.
|
|
51
|
+
*
|
|
52
|
+
* Slot: `noctis-sheet-popup` (with `data-side`/`data-size`). Styling is precompiled in `sheet.css`.
|
|
53
|
+
* @see {@link Sheet.Popup.Props}
|
|
54
|
+
*/
|
|
55
|
+
declare function SheetPopup({
|
|
56
|
+
className,
|
|
57
|
+
side,
|
|
58
|
+
size,
|
|
59
|
+
style,
|
|
60
|
+
...props
|
|
61
|
+
}: Sheet.Popup.Props): ReactElement;
|
|
62
|
+
/**
|
|
63
|
+
* The common composition: portal, backdrop, and panel in one. Drop `Sheet.Header`/`Body`/`Footer`
|
|
64
|
+
* (and a `Sheet.Close`) inside. Reach for the granular parts when you need to customize the portal or
|
|
65
|
+
* backdrop wiring.
|
|
66
|
+
*
|
|
67
|
+
* @see {@link Sheet.Content.Props}
|
|
68
|
+
*/
|
|
69
|
+
declare function SheetContent({
|
|
70
|
+
children,
|
|
71
|
+
backdropClassName,
|
|
72
|
+
...props
|
|
73
|
+
}: Sheet.Content.Props): ReactElement;
|
|
74
|
+
/**
|
|
75
|
+
* Closes the nearest sheet. Renders a bare button and carries no styling of its own, so it composes
|
|
76
|
+
* with any Noctis `Button` through `render` — a ghost icon button for the corner dismiss, or a
|
|
77
|
+
* secondary/primary `Button` for a footer action — and that Button behaves exactly as it does anywhere
|
|
78
|
+
* else. Give it an `aria-label` (or visible text) for the accessible name.
|
|
79
|
+
*
|
|
80
|
+
* Slot: `noctis-sheet-close`.
|
|
81
|
+
* @see {@link Sheet.Close.Props}
|
|
82
|
+
*/
|
|
83
|
+
declare function SheetClose({
|
|
84
|
+
className,
|
|
85
|
+
...props
|
|
86
|
+
}: Sheet.Close.Props): ReactElement;
|
|
87
|
+
/**
|
|
88
|
+
* The built-in corner close — a ghost icon `Button` with a localized `aria-label`, dropped into the
|
|
89
|
+
* header's reserved inline-end gutter (no `absolute`, so a long title never runs under it). Defaults its
|
|
90
|
+
* icon to a lucide `X` and its name to the translated "Close"; pass `children` to swap the glyph or
|
|
91
|
+
* `aria-label` to override the name.
|
|
92
|
+
*
|
|
93
|
+
* Slot: `noctis-sheet-close` (shared with `Sheet.Close`).
|
|
94
|
+
* @see {@link Sheet.CloseButton.Props}
|
|
95
|
+
*/
|
|
96
|
+
declare function SheetCloseButton({
|
|
97
|
+
children,
|
|
98
|
+
"aria-label": ariaLabel,
|
|
99
|
+
...props
|
|
100
|
+
}: Sheet.CloseButton.Props): ReactElement;
|
|
101
|
+
/**
|
|
102
|
+
* The panel's top region — title, description, and corner actions. Separated by a divider.
|
|
103
|
+
*
|
|
104
|
+
* Slot: `noctis-sheet-header`.
|
|
105
|
+
* @see {@link Sheet.Header.Props}
|
|
106
|
+
*/
|
|
107
|
+
declare function SheetHeader({
|
|
108
|
+
className,
|
|
109
|
+
...props
|
|
110
|
+
}: Sheet.Header.Props): ReactElement;
|
|
111
|
+
/**
|
|
112
|
+
* The scrollable middle region. Grows to fill and scrolls its overflow so the header/footer stay put.
|
|
113
|
+
*
|
|
114
|
+
* Slot: `noctis-sheet-body`.
|
|
115
|
+
* @see {@link Sheet.Body.Props}
|
|
116
|
+
*/
|
|
117
|
+
declare function SheetBody({
|
|
118
|
+
className,
|
|
119
|
+
...props
|
|
120
|
+
}: Sheet.Body.Props): ReactElement;
|
|
121
|
+
/**
|
|
122
|
+
* The panel's bottom region — pinned to the base, typically holding the primary/secondary actions.
|
|
123
|
+
*
|
|
124
|
+
* Slot: `noctis-sheet-footer`.
|
|
125
|
+
* @see {@link Sheet.Footer.Props}
|
|
126
|
+
*/
|
|
127
|
+
declare function SheetFooter({
|
|
128
|
+
className,
|
|
129
|
+
...props
|
|
130
|
+
}: Sheet.Footer.Props): ReactElement;
|
|
131
|
+
/**
|
|
132
|
+
* The accessible name of the sheet, linked to the panel via `aria-labelledby`. Renders an `<h2>`.
|
|
133
|
+
*
|
|
134
|
+
* Slot: `noctis-sheet-title`.
|
|
135
|
+
* @see {@link Sheet.Title.Props}
|
|
136
|
+
*/
|
|
137
|
+
declare function SheetTitle({
|
|
138
|
+
className,
|
|
139
|
+
...props
|
|
140
|
+
}: Sheet.Title.Props): ReactElement;
|
|
141
|
+
/**
|
|
142
|
+
* Supporting copy under the title, linked to the panel via `aria-describedby`.
|
|
143
|
+
*
|
|
144
|
+
* Slot: `noctis-sheet-description`.
|
|
145
|
+
* @see {@link Sheet.Description.Props}
|
|
146
|
+
*/
|
|
147
|
+
declare function SheetDescription({
|
|
148
|
+
className,
|
|
149
|
+
...props
|
|
150
|
+
}: Sheet.Description.Props): ReactElement;
|
|
151
|
+
/**
|
|
152
|
+
* A slide-in panel anchored to a screen edge, built on Base UI's Dialog for focus management,
|
|
153
|
+
* scroll-lock, and `Escape`/outside-click dismissal. Compose it from parts: `Sheet.Root` owns state,
|
|
154
|
+
* `Sheet.Trigger` opens it, and `Sheet.Content` (or `Portal` + `Backdrop` + `Popup`) renders the panel
|
|
155
|
+
* holding `Header`/`Body`/`Footer`, `Title`/`Description`, and `Close`. Nest a `Sheet` inside a panel
|
|
156
|
+
* to stack sheets — panels behind peek out by depth and Base UI keeps focus and escape ordering correct.
|
|
157
|
+
*
|
|
158
|
+
* Styling is precompiled in `sheet.css`, keyed off each part's `data-slot` (plus `data-side`/`data-size`
|
|
159
|
+
* on the popup); the popup renders through `Surface` for its elevated scope and base paint. Each part's
|
|
160
|
+
* function value carries the D12 `props()` escape hatch via `Object.assign` — spread it onto a foreign
|
|
161
|
+
* element to style it as that part.
|
|
162
|
+
*
|
|
163
|
+
* The runtime compound is a plain object (kept tree-shakeable); per-part prop and state types are
|
|
164
|
+
* exposed through the matching `Sheet` namespace below — e.g. `Sheet.Popup.Props`, `Sheet.Close.State`.
|
|
165
|
+
*/
|
|
166
|
+
declare const Sheet: {
|
|
167
|
+
Root: typeof SheetRoot;
|
|
168
|
+
Trigger: typeof SheetTrigger & {
|
|
169
|
+
props: typeof triggerProps;
|
|
170
|
+
};
|
|
171
|
+
Portal: typeof SheetPortal;
|
|
172
|
+
Backdrop: typeof SheetBackdrop & {
|
|
173
|
+
props: typeof backdropProps;
|
|
174
|
+
};
|
|
175
|
+
Viewport: typeof SheetViewport & {
|
|
176
|
+
props: typeof viewportProps;
|
|
177
|
+
};
|
|
178
|
+
Popup: typeof SheetPopup & {
|
|
179
|
+
props: typeof popupProps;
|
|
180
|
+
};
|
|
181
|
+
Content: typeof SheetContent;
|
|
182
|
+
Close: typeof SheetClose & {
|
|
183
|
+
props: typeof closeProps;
|
|
184
|
+
};
|
|
185
|
+
CloseButton: typeof SheetCloseButton & {
|
|
186
|
+
props: typeof closeButtonProps;
|
|
187
|
+
};
|
|
188
|
+
Header: typeof SheetHeader & {
|
|
189
|
+
props: typeof headerProps;
|
|
190
|
+
};
|
|
191
|
+
Body: typeof SheetBody & {
|
|
192
|
+
props: typeof bodyProps;
|
|
193
|
+
};
|
|
194
|
+
Footer: typeof SheetFooter & {
|
|
195
|
+
props: typeof footerProps;
|
|
196
|
+
};
|
|
197
|
+
Title: typeof SheetTitle & {
|
|
198
|
+
props: typeof titleProps;
|
|
199
|
+
};
|
|
200
|
+
Description: typeof SheetDescription & {
|
|
201
|
+
props: typeof descriptionProps;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* Per-part prop and state types, mirroring Base UI's `Component.Part.Props` convention. This namespace
|
|
206
|
+
* is types-only — it emits no runtime code and merges with the `Sheet` object above, so `Sheet.Popup`
|
|
207
|
+
* is the component value while `Sheet.Popup.Props` is its prop type.
|
|
208
|
+
*/
|
|
209
|
+
declare namespace Sheet {
|
|
210
|
+
/** Which edge the sheet docks to, and the direction it slides from. */
|
|
211
|
+
type Side = SheetSide;
|
|
212
|
+
/** The panel's cross-axis extent — width for side sheets, height for top/bottom sheets. */
|
|
213
|
+
type Size = SheetSize;
|
|
214
|
+
/** The spreadable data-attribute prop bag every `Sheet.*.props()` returns (D12). */
|
|
215
|
+
type PartProps = SheetPartProps;
|
|
216
|
+
namespace Root {
|
|
217
|
+
type Props = dialog_d_exports.Dialog.Root.Props;
|
|
218
|
+
type State = dialog_d_exports.Dialog.Root.State;
|
|
219
|
+
}
|
|
220
|
+
namespace Trigger {
|
|
221
|
+
type Props = dialog_d_exports.Dialog.Trigger.Props;
|
|
222
|
+
type State = dialog_d_exports.Dialog.Trigger.State;
|
|
223
|
+
}
|
|
224
|
+
namespace Portal {
|
|
225
|
+
type Props = dialog_d_exports.Dialog.Portal.Props;
|
|
226
|
+
type State = dialog_d_exports.Dialog.Portal.State;
|
|
227
|
+
}
|
|
228
|
+
namespace Backdrop {
|
|
229
|
+
type Props = dialog_d_exports.Dialog.Backdrop.Props;
|
|
230
|
+
type State = dialog_d_exports.Dialog.Backdrop.State;
|
|
231
|
+
}
|
|
232
|
+
namespace Viewport {
|
|
233
|
+
type Props = dialog_d_exports.Dialog.Viewport.Props;
|
|
234
|
+
type State = dialog_d_exports.Dialog.Viewport.State;
|
|
235
|
+
}
|
|
236
|
+
namespace Popup {
|
|
237
|
+
type Props = dialog_d_exports.Dialog.Popup.Props & {
|
|
238
|
+
/** Which edge to dock to. Defaults to `end`. */side?: SheetSide; /** Cross-axis extent — width for `start`/`end`, height for `top`/`bottom`. Defaults to `md`. */
|
|
239
|
+
size?: SheetSize;
|
|
240
|
+
};
|
|
241
|
+
type State = dialog_d_exports.Dialog.Popup.State;
|
|
242
|
+
/** Argument to the `Sheet.Popup.props(...)` escape-hatch helper. */
|
|
243
|
+
type PropsArgs = SheetPopupPropsArgs;
|
|
244
|
+
}
|
|
245
|
+
namespace Content {
|
|
246
|
+
type Props = Popup.Props & {
|
|
247
|
+
/** Classes for the backdrop scrim. */backdropClassName?: string;
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
namespace Close {
|
|
251
|
+
type Props = dialog_d_exports.Dialog.Close.Props;
|
|
252
|
+
type State = dialog_d_exports.Dialog.Close.State;
|
|
253
|
+
}
|
|
254
|
+
namespace CloseButton {
|
|
255
|
+
type Props = Omit<dialog_d_exports.Dialog.Close.Props, "render"> & {
|
|
256
|
+
/** The glyph to show; defaults to a lucide `X` Icon. */children?: ReactNode; /** Accessible name; defaults to the localized "Close". */
|
|
257
|
+
"aria-label"?: string;
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
namespace Header {
|
|
261
|
+
type Props = ComponentProps<"div">;
|
|
262
|
+
}
|
|
263
|
+
namespace Body {
|
|
264
|
+
type Props = ComponentProps<"div">;
|
|
265
|
+
}
|
|
266
|
+
namespace Footer {
|
|
267
|
+
type Props = ComponentProps<"div">;
|
|
268
|
+
}
|
|
269
|
+
namespace Title {
|
|
270
|
+
type Props = dialog_d_exports.Dialog.Title.Props;
|
|
271
|
+
type State = dialog_d_exports.Dialog.Title.State;
|
|
272
|
+
}
|
|
273
|
+
namespace Description {
|
|
274
|
+
type Props = dialog_d_exports.Dialog.Description.Props;
|
|
275
|
+
type State = dialog_d_exports.Dialog.Description.State;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
//#endregion
|
|
279
|
+
export { Sheet };
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Icon } from "../../icons/icon.js";
|
|
3
|
+
import { XIcon } from "../../icons/glyphs.js";
|
|
4
|
+
import { useInjectedLabels } from "../../core/use-injected-labels.js";
|
|
5
|
+
import { Surface } from "../surface/surface.js";
|
|
6
|
+
import { Button } from "../button/button.js";
|
|
7
|
+
import { dialog_exports } from "../../primitives/dialog.js";
|
|
8
|
+
import { SHEET_SLOTS } from "./sheet.slots.js";
|
|
9
|
+
import { backdropProps, bodyProps, closeButtonProps, closeProps, descriptionProps, footerProps, headerProps, popupProps, titleProps, triggerProps, viewportProps } from "./sheet.props.js";
|
|
10
|
+
import clsx$1 from "clsx";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
//#region src/components/sheet/sheet.tsx
|
|
13
|
+
/**
|
|
14
|
+
* How far each stacked panel peeks out per level of depth. `--nested-dialogs` is the number of sheets
|
|
15
|
+
* open on top of this one (Base UI sets it on every popup), so a sheet two layers deep peeks twice as
|
|
16
|
+
* far. The popup's `sheet.css` rules consume `--sheet-peek` as their resting translate; the per-step
|
|
17
|
+
* distance is the `--_sheet-popup-peek-offset` token, so a consumer retunes the fan-out from one property.
|
|
18
|
+
*/
|
|
19
|
+
const PEEK_STYLE = { "--sheet-peek": "calc(var(--nested-dialogs, 0) * var(--_sheet-popup-peek-offset))" };
|
|
20
|
+
/** Merge the per-depth peek offset into a consumer `style`, supporting Base UI's state-function form. */
|
|
21
|
+
function withPeek(style) {
|
|
22
|
+
if (typeof style === "function") return (state) => ({
|
|
23
|
+
...PEEK_STYLE,
|
|
24
|
+
...style(state)
|
|
25
|
+
});
|
|
26
|
+
return {
|
|
27
|
+
...PEEK_STYLE,
|
|
28
|
+
...style
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Groups the parts and owns open state. Modal by default — focus is trapped, the page is scroll-locked,
|
|
33
|
+
* and the rest of the document is inert; an outside click or `Escape` closes it. Nest a `Sheet` inside
|
|
34
|
+
* another `Sheet`'s `Popup`/`Content` to stack them: Base UI manages the focus and escape ordering, and
|
|
35
|
+
* each panel behind the top one peeks out by a per-depth offset to show the stack.
|
|
36
|
+
*
|
|
37
|
+
* @see {@link Sheet.Root.Props}
|
|
38
|
+
*/
|
|
39
|
+
function SheetRoot(props) {
|
|
40
|
+
return /* @__PURE__ */ jsx(dialog_exports.Dialog.Root, { ...props });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A button that opens the sheet. Wires the accessible relationship to the panel.
|
|
44
|
+
*
|
|
45
|
+
* Slot: `noctis-sheet-trigger`.
|
|
46
|
+
* @see {@link Sheet.Trigger.Props}
|
|
47
|
+
*/
|
|
48
|
+
function SheetTrigger(props) {
|
|
49
|
+
return /* @__PURE__ */ jsx(dialog_exports.Dialog.Trigger, {
|
|
50
|
+
"data-slot": SHEET_SLOTS.trigger,
|
|
51
|
+
...props
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Moves the panel and backdrop to a portal at the end of `<body>`.
|
|
56
|
+
*
|
|
57
|
+
* @see {@link Sheet.Portal.Props}
|
|
58
|
+
*/
|
|
59
|
+
function SheetPortal(props) {
|
|
60
|
+
return /* @__PURE__ */ jsx(dialog_exports.Dialog.Portal, { ...props });
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The scrim behind the panel. Fades with the sheet and dims everything beneath it. Each sheet in a
|
|
64
|
+
* stack renders its own backdrop (`forceRender`), so a stacked sheet dims — and intercepts clicks for —
|
|
65
|
+
* the sheet(s) behind it: clicking the dimmed area closes the top sheet, stepping back one level.
|
|
66
|
+
*
|
|
67
|
+
* Slot: `noctis-sheet-backdrop`.
|
|
68
|
+
* @see {@link Sheet.Backdrop.Props}
|
|
69
|
+
*/
|
|
70
|
+
function SheetBackdrop({ className, forceRender = true, ...props }) {
|
|
71
|
+
return /* @__PURE__ */ jsx(dialog_exports.Dialog.Backdrop, {
|
|
72
|
+
"data-slot": SHEET_SLOTS.backdrop,
|
|
73
|
+
forceRender,
|
|
74
|
+
className,
|
|
75
|
+
...props
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* A positioning container for the panel that can be made scrollable — for advanced overflow layouts.
|
|
80
|
+
*
|
|
81
|
+
* Slot: `noctis-sheet-viewport`.
|
|
82
|
+
* @see {@link Sheet.Viewport.Props}
|
|
83
|
+
*/
|
|
84
|
+
function SheetViewport(props) {
|
|
85
|
+
return /* @__PURE__ */ jsx(dialog_exports.Dialog.Viewport, {
|
|
86
|
+
"data-slot": SHEET_SLOTS.viewport,
|
|
87
|
+
...props
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The panel surface itself. Portal it (or use {@link Sheet.Content}) and compose the slots inside.
|
|
92
|
+
*
|
|
93
|
+
* Slot: `noctis-sheet-popup` (with `data-side`/`data-size`). Styling is precompiled in `sheet.css`.
|
|
94
|
+
* @see {@link Sheet.Popup.Props}
|
|
95
|
+
*/
|
|
96
|
+
function SheetPopup({ className, side = "end", size = "md", style, ...props }) {
|
|
97
|
+
return /* @__PURE__ */ jsx(Surface, {
|
|
98
|
+
elevation: "elevated",
|
|
99
|
+
"data-slot": SHEET_SLOTS.popup,
|
|
100
|
+
"data-side": side,
|
|
101
|
+
"data-size": size,
|
|
102
|
+
render: /* @__PURE__ */ jsx(dialog_exports.Dialog.Popup, {
|
|
103
|
+
className,
|
|
104
|
+
style: withPeek(style),
|
|
105
|
+
...props
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The common composition: portal, backdrop, and panel in one. Drop `Sheet.Header`/`Body`/`Footer`
|
|
111
|
+
* (and a `Sheet.Close`) inside. Reach for the granular parts when you need to customize the portal or
|
|
112
|
+
* backdrop wiring.
|
|
113
|
+
*
|
|
114
|
+
* @see {@link Sheet.Content.Props}
|
|
115
|
+
*/
|
|
116
|
+
function SheetContent({ children, backdropClassName, ...props }) {
|
|
117
|
+
return /* @__PURE__ */ jsxs(SheetPortal, { children: [/* @__PURE__ */ jsx(SheetBackdrop, { className: backdropClassName }), /* @__PURE__ */ jsx(SheetPopup, {
|
|
118
|
+
...props,
|
|
119
|
+
children
|
|
120
|
+
})] });
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Closes the nearest sheet. Renders a bare button and carries no styling of its own, so it composes
|
|
124
|
+
* with any Noctis `Button` through `render` — a ghost icon button for the corner dismiss, or a
|
|
125
|
+
* secondary/primary `Button` for a footer action — and that Button behaves exactly as it does anywhere
|
|
126
|
+
* else. Give it an `aria-label` (or visible text) for the accessible name.
|
|
127
|
+
*
|
|
128
|
+
* Slot: `noctis-sheet-close`.
|
|
129
|
+
* @see {@link Sheet.Close.Props}
|
|
130
|
+
*/
|
|
131
|
+
function SheetClose({ className, ...props }) {
|
|
132
|
+
return /* @__PURE__ */ jsx(dialog_exports.Dialog.Close, {
|
|
133
|
+
"data-slot": SHEET_SLOTS.close,
|
|
134
|
+
className,
|
|
135
|
+
...props
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/** English fallbacks and catalog keys for the corner close's accessible name (resolved per active locale). */
|
|
139
|
+
const DEFAULT_CLOSE_LABELS = { close: "Close" };
|
|
140
|
+
const CLOSE_LABEL_KEYS = { close: "sheet.closeLabel" };
|
|
141
|
+
/**
|
|
142
|
+
* The built-in corner close — a ghost icon `Button` with a localized `aria-label`, dropped into the
|
|
143
|
+
* header's reserved inline-end gutter (no `absolute`, so a long title never runs under it). Defaults its
|
|
144
|
+
* icon to a lucide `X` and its name to the translated "Close"; pass `children` to swap the glyph or
|
|
145
|
+
* `aria-label` to override the name.
|
|
146
|
+
*
|
|
147
|
+
* Slot: `noctis-sheet-close` (shared with `Sheet.Close`).
|
|
148
|
+
* @see {@link Sheet.CloseButton.Props}
|
|
149
|
+
*/
|
|
150
|
+
function SheetCloseButton({ children, "aria-label": ariaLabel, ...props }) {
|
|
151
|
+
const labels = useInjectedLabels(DEFAULT_CLOSE_LABELS, CLOSE_LABEL_KEYS, void 0);
|
|
152
|
+
return /* @__PURE__ */ jsx(dialog_exports.Dialog.Close, {
|
|
153
|
+
"data-slot": SHEET_SLOTS.close,
|
|
154
|
+
"aria-label": ariaLabel ?? labels.close,
|
|
155
|
+
...props,
|
|
156
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
157
|
+
variant: "ghost",
|
|
158
|
+
size: "sm",
|
|
159
|
+
iconOnly: true
|
|
160
|
+
}),
|
|
161
|
+
children: children ?? /* @__PURE__ */ jsx(Icon, {
|
|
162
|
+
icon: XIcon,
|
|
163
|
+
size: "sm"
|
|
164
|
+
})
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* The panel's top region — title, description, and corner actions. Separated by a divider.
|
|
169
|
+
*
|
|
170
|
+
* Slot: `noctis-sheet-header`.
|
|
171
|
+
* @see {@link Sheet.Header.Props}
|
|
172
|
+
*/
|
|
173
|
+
function SheetHeader({ className, ...props }) {
|
|
174
|
+
return /* @__PURE__ */ jsx("div", {
|
|
175
|
+
"data-slot": SHEET_SLOTS.header,
|
|
176
|
+
className: clsx$1(className),
|
|
177
|
+
...props
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* The scrollable middle region. Grows to fill and scrolls its overflow so the header/footer stay put.
|
|
182
|
+
*
|
|
183
|
+
* Slot: `noctis-sheet-body`.
|
|
184
|
+
* @see {@link Sheet.Body.Props}
|
|
185
|
+
*/
|
|
186
|
+
function SheetBody({ className, ...props }) {
|
|
187
|
+
return /* @__PURE__ */ jsx("div", {
|
|
188
|
+
"data-slot": SHEET_SLOTS.body,
|
|
189
|
+
className: clsx$1(className),
|
|
190
|
+
...props
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* The panel's bottom region — pinned to the base, typically holding the primary/secondary actions.
|
|
195
|
+
*
|
|
196
|
+
* Slot: `noctis-sheet-footer`.
|
|
197
|
+
* @see {@link Sheet.Footer.Props}
|
|
198
|
+
*/
|
|
199
|
+
function SheetFooter({ className, ...props }) {
|
|
200
|
+
return /* @__PURE__ */ jsx("div", {
|
|
201
|
+
"data-slot": SHEET_SLOTS.footer,
|
|
202
|
+
className: clsx$1(className),
|
|
203
|
+
...props
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* The accessible name of the sheet, linked to the panel via `aria-labelledby`. Renders an `<h2>`.
|
|
208
|
+
*
|
|
209
|
+
* Slot: `noctis-sheet-title`.
|
|
210
|
+
* @see {@link Sheet.Title.Props}
|
|
211
|
+
*/
|
|
212
|
+
function SheetTitle({ className, ...props }) {
|
|
213
|
+
return /* @__PURE__ */ jsx(dialog_exports.Dialog.Title, {
|
|
214
|
+
"data-slot": SHEET_SLOTS.title,
|
|
215
|
+
className,
|
|
216
|
+
...props
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Supporting copy under the title, linked to the panel via `aria-describedby`.
|
|
221
|
+
*
|
|
222
|
+
* Slot: `noctis-sheet-description`.
|
|
223
|
+
* @see {@link Sheet.Description.Props}
|
|
224
|
+
*/
|
|
225
|
+
function SheetDescription({ className, ...props }) {
|
|
226
|
+
return /* @__PURE__ */ jsx(dialog_exports.Dialog.Description, {
|
|
227
|
+
"data-slot": SHEET_SLOTS.description,
|
|
228
|
+
className,
|
|
229
|
+
...props
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* A slide-in panel anchored to a screen edge, built on Base UI's Dialog for focus management,
|
|
234
|
+
* scroll-lock, and `Escape`/outside-click dismissal. Compose it from parts: `Sheet.Root` owns state,
|
|
235
|
+
* `Sheet.Trigger` opens it, and `Sheet.Content` (or `Portal` + `Backdrop` + `Popup`) renders the panel
|
|
236
|
+
* holding `Header`/`Body`/`Footer`, `Title`/`Description`, and `Close`. Nest a `Sheet` inside a panel
|
|
237
|
+
* to stack sheets — panels behind peek out by depth and Base UI keeps focus and escape ordering correct.
|
|
238
|
+
*
|
|
239
|
+
* Styling is precompiled in `sheet.css`, keyed off each part's `data-slot` (plus `data-side`/`data-size`
|
|
240
|
+
* on the popup); the popup renders through `Surface` for its elevated scope and base paint. Each part's
|
|
241
|
+
* function value carries the D12 `props()` escape hatch via `Object.assign` — spread it onto a foreign
|
|
242
|
+
* element to style it as that part.
|
|
243
|
+
*
|
|
244
|
+
* The runtime compound is a plain object (kept tree-shakeable); per-part prop and state types are
|
|
245
|
+
* exposed through the matching `Sheet` namespace below — e.g. `Sheet.Popup.Props`, `Sheet.Close.State`.
|
|
246
|
+
*/
|
|
247
|
+
const Sheet = {
|
|
248
|
+
Root: SheetRoot,
|
|
249
|
+
Trigger: Object.assign(SheetTrigger, { props: triggerProps }),
|
|
250
|
+
Portal: SheetPortal,
|
|
251
|
+
Backdrop: Object.assign(SheetBackdrop, { props: backdropProps }),
|
|
252
|
+
Viewport: Object.assign(SheetViewport, { props: viewportProps }),
|
|
253
|
+
Popup: Object.assign(SheetPopup, { props: popupProps }),
|
|
254
|
+
Content: SheetContent,
|
|
255
|
+
Close: Object.assign(SheetClose, { props: closeProps }),
|
|
256
|
+
CloseButton: Object.assign(SheetCloseButton, { props: closeButtonProps }),
|
|
257
|
+
Header: Object.assign(SheetHeader, { props: headerProps }),
|
|
258
|
+
Body: Object.assign(SheetBody, { props: bodyProps }),
|
|
259
|
+
Footer: Object.assign(SheetFooter, { props: footerProps }),
|
|
260
|
+
Title: Object.assign(SheetTitle, { props: titleProps }),
|
|
261
|
+
Description: Object.assign(SheetDescription, { props: descriptionProps })
|
|
262
|
+
};
|
|
263
|
+
//#endregion
|
|
264
|
+
export { Sheet };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { SheetSide, SheetSize } from "./sheet.types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/sheet/sheet.props.d.ts
|
|
4
|
+
/** A spreadable data-attribute prop bag — the shape every `Sheet.*.props()` returns. */
|
|
5
|
+
type SheetPartProps = {
|
|
6
|
+
/** The slot value the matching `sheet.css` rules anchor on. */"data-slot": string; /** Forwarded verbatim — styling is attribute-driven, so this is an optional consumer passthrough. */
|
|
7
|
+
className?: string; /** A data-attribute present (a value or empty string) or absent (`undefined`); never `false`. */
|
|
8
|
+
[attr: `data-${string}`]: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
/** Common shape: every part's `.props()` accepts an optional `className` passthrough. */
|
|
11
|
+
interface BasePropsArgs {
|
|
12
|
+
/** Forwarded verbatim onto the returned prop bag. */
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Argument to `Sheet.Popup.props(...)` — the edge and cross-axis extent the popup rules key their look off. */
|
|
16
|
+
interface SheetPopupPropsArgs extends BasePropsArgs {
|
|
17
|
+
/** Which edge to dock to, and the direction it slides from. @default "end" */
|
|
18
|
+
side?: SheetSide;
|
|
19
|
+
/** Cross-axis extent — width for `start`/`end`, height for `top`/`bottom`. @default "md" */
|
|
20
|
+
size?: SheetSize;
|
|
21
|
+
}
|
|
22
|
+
/** Argument to a stateless part's `.props(...)` — no variants of its own; look flows from the popup. */
|
|
23
|
+
type SheetStatelessPropsArgs = BasePropsArgs;
|
|
24
|
+
/** Trigger prop bag: just the slot anchor. */
|
|
25
|
+
declare function triggerProps({
|
|
26
|
+
className
|
|
27
|
+
}?: SheetStatelessPropsArgs): SheetPartProps;
|
|
28
|
+
/** Backdrop prop bag: just the slot anchor (the scrim's paint flows from `sheet.css`). */
|
|
29
|
+
declare function backdropProps({
|
|
30
|
+
className
|
|
31
|
+
}?: SheetStatelessPropsArgs): SheetPartProps;
|
|
32
|
+
/** Viewport prop bag: just the slot anchor. */
|
|
33
|
+
declare function viewportProps({
|
|
34
|
+
className
|
|
35
|
+
}?: SheetStatelessPropsArgs): SheetPartProps;
|
|
36
|
+
/** Popup prop bag: slot anchor plus the `data-side`/`data-size` the popup rules read. */
|
|
37
|
+
declare function popupProps({
|
|
38
|
+
side,
|
|
39
|
+
size,
|
|
40
|
+
className
|
|
41
|
+
}?: SheetPopupPropsArgs): SheetPartProps;
|
|
42
|
+
/** Close prop bag: just the slot anchor (it carries no paint of its own — it composes with a Button). */
|
|
43
|
+
declare function closeProps({
|
|
44
|
+
className
|
|
45
|
+
}?: SheetStatelessPropsArgs): SheetPartProps;
|
|
46
|
+
/**
|
|
47
|
+
* CloseButton prop bag: the same `noctis-sheet-close` slot the convenience corner button reuses, so a
|
|
48
|
+
* hand-built close affordance and `Sheet.CloseButton` anchor on the identical selector.
|
|
49
|
+
*/
|
|
50
|
+
declare function closeButtonProps({
|
|
51
|
+
className
|
|
52
|
+
}?: SheetStatelessPropsArgs): SheetPartProps;
|
|
53
|
+
/** Header prop bag: just the slot anchor. */
|
|
54
|
+
declare function headerProps({
|
|
55
|
+
className
|
|
56
|
+
}?: SheetStatelessPropsArgs): SheetPartProps;
|
|
57
|
+
/** Body prop bag: just the slot anchor. */
|
|
58
|
+
declare function bodyProps({
|
|
59
|
+
className
|
|
60
|
+
}?: SheetStatelessPropsArgs): SheetPartProps;
|
|
61
|
+
/** Footer prop bag: just the slot anchor. */
|
|
62
|
+
declare function footerProps({
|
|
63
|
+
className
|
|
64
|
+
}?: SheetStatelessPropsArgs): SheetPartProps;
|
|
65
|
+
/** Title prop bag: just the slot anchor. */
|
|
66
|
+
declare function titleProps({
|
|
67
|
+
className
|
|
68
|
+
}?: SheetStatelessPropsArgs): SheetPartProps;
|
|
69
|
+
/** Description prop bag: just the slot anchor. */
|
|
70
|
+
declare function descriptionProps({
|
|
71
|
+
className
|
|
72
|
+
}?: SheetStatelessPropsArgs): SheetPartProps;
|
|
73
|
+
//#endregion
|
|
74
|
+
export { SheetPartProps, SheetPopupPropsArgs, backdropProps, bodyProps, closeButtonProps, closeProps, descriptionProps, footerProps, headerProps, popupProps, titleProps, triggerProps, viewportProps };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { SHEET_SLOTS } from "./sheet.slots.js";
|
|
2
|
+
//#region src/components/sheet/sheet.props.ts
|
|
3
|
+
/**
|
|
4
|
+
* The D12 unified variant contract for Sheet — the data-attribute-native generalization of the old
|
|
5
|
+
* `sheetPopup` / `sheetHeader` / … class-string helpers.
|
|
6
|
+
*
|
|
7
|
+
* Each compound part exposes a `props(...)` builder returning a **spreadable props object** of the form
|
|
8
|
+
* `{ "data-slot": "noctis-sheet-<part>", ...dataAttrs }`, derived from the part's variant inputs. Under
|
|
9
|
+
* the single-`data-slot` anchor model the `data-slot` (plus `data-side`/`data-size` on the popup) is the
|
|
10
|
+
* only styling hook needed — `sheet.css` keys every rule off it — so spreading a part's `props()` onto a
|
|
11
|
+
* *foreign* element styles it as that part:
|
|
12
|
+
*
|
|
13
|
+
* <aside {...Sheet.Popup.props({ side: "start", size: "lg" })} />
|
|
14
|
+
* // → <aside data-slot="noctis-sheet-popup" data-side="start" data-size="lg">
|
|
15
|
+
*
|
|
16
|
+
* The escape hatch carries no className (styling is attribute-driven); an optional `className`
|
|
17
|
+
* passthrough is accepted and forwarded verbatim. The same variant→data-attribute→values mapping is
|
|
18
|
+
* emitted as data from the token graph (`generated/declarations.json` → `variantSchema`) so non-React /
|
|
19
|
+
* agent consumers can hand-write the markup from the docs.
|
|
20
|
+
*/
|
|
21
|
+
const withClassName = (bag, className) => className === void 0 ? bag : {
|
|
22
|
+
...bag,
|
|
23
|
+
className
|
|
24
|
+
};
|
|
25
|
+
/** Trigger prop bag: just the slot anchor. */
|
|
26
|
+
function triggerProps({ className } = {}) {
|
|
27
|
+
return withClassName({ "data-slot": SHEET_SLOTS.trigger }, className);
|
|
28
|
+
}
|
|
29
|
+
/** Backdrop prop bag: just the slot anchor (the scrim's paint flows from `sheet.css`). */
|
|
30
|
+
function backdropProps({ className } = {}) {
|
|
31
|
+
return withClassName({ "data-slot": SHEET_SLOTS.backdrop }, className);
|
|
32
|
+
}
|
|
33
|
+
/** Viewport prop bag: just the slot anchor. */
|
|
34
|
+
function viewportProps({ className } = {}) {
|
|
35
|
+
return withClassName({ "data-slot": SHEET_SLOTS.viewport }, className);
|
|
36
|
+
}
|
|
37
|
+
/** Popup prop bag: slot anchor plus the `data-side`/`data-size` the popup rules read. */
|
|
38
|
+
function popupProps({ side = "end", size = "md", className } = {}) {
|
|
39
|
+
return withClassName({
|
|
40
|
+
"data-slot": SHEET_SLOTS.popup,
|
|
41
|
+
"data-side": side,
|
|
42
|
+
"data-size": size
|
|
43
|
+
}, className);
|
|
44
|
+
}
|
|
45
|
+
/** Close prop bag: just the slot anchor (it carries no paint of its own — it composes with a Button). */
|
|
46
|
+
function closeProps({ className } = {}) {
|
|
47
|
+
return withClassName({ "data-slot": SHEET_SLOTS.close }, className);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* CloseButton prop bag: the same `noctis-sheet-close` slot the convenience corner button reuses, so a
|
|
51
|
+
* hand-built close affordance and `Sheet.CloseButton` anchor on the identical selector.
|
|
52
|
+
*/
|
|
53
|
+
function closeButtonProps({ className } = {}) {
|
|
54
|
+
return withClassName({ "data-slot": SHEET_SLOTS.close }, className);
|
|
55
|
+
}
|
|
56
|
+
/** Header prop bag: just the slot anchor. */
|
|
57
|
+
function headerProps({ className } = {}) {
|
|
58
|
+
return withClassName({ "data-slot": SHEET_SLOTS.header }, className);
|
|
59
|
+
}
|
|
60
|
+
/** Body prop bag: just the slot anchor. */
|
|
61
|
+
function bodyProps({ className } = {}) {
|
|
62
|
+
return withClassName({ "data-slot": SHEET_SLOTS.body }, className);
|
|
63
|
+
}
|
|
64
|
+
/** Footer prop bag: just the slot anchor. */
|
|
65
|
+
function footerProps({ className } = {}) {
|
|
66
|
+
return withClassName({ "data-slot": SHEET_SLOTS.footer }, className);
|
|
67
|
+
}
|
|
68
|
+
/** Title prop bag: just the slot anchor. */
|
|
69
|
+
function titleProps({ className } = {}) {
|
|
70
|
+
return withClassName({ "data-slot": SHEET_SLOTS.title }, className);
|
|
71
|
+
}
|
|
72
|
+
/** Description prop bag: just the slot anchor. */
|
|
73
|
+
function descriptionProps({ className } = {}) {
|
|
74
|
+
return withClassName({ "data-slot": SHEET_SLOTS.description }, className);
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
export { backdropProps, bodyProps, closeButtonProps, closeProps, descriptionProps, footerProps, headerProps, popupProps, titleProps, triggerProps, viewportProps };
|