@stridge/noctis 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -0
- package/dist/_virtual/_rolldown/runtime.js +27 -0
- package/dist/components/accordion/accordion.context.js +15 -0
- package/dist/components/accordion/accordion.d.ts +136 -0
- package/dist/components/accordion/accordion.js +132 -0
- package/dist/components/accordion/accordion.props.d.ts +45 -0
- package/dist/components/accordion/accordion.props.js +53 -0
- package/dist/components/accordion/accordion.slots.d.ts +24 -0
- package/dist/components/accordion/accordion.slots.js +39 -0
- package/dist/components/accordion/accordion.types.d.ts +11 -0
- package/dist/components/accordion/index.d.ts +3 -0
- package/dist/components/alert-dialog/alert-dialog.context.js +16 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +324 -0
- package/dist/components/alert-dialog/alert-dialog.js +279 -0
- package/dist/components/alert-dialog/alert-dialog.props.d.ts +85 -0
- package/dist/components/alert-dialog/alert-dialog.props.js +84 -0
- package/dist/components/alert-dialog/alert-dialog.slots.d.ts +29 -0
- package/dist/components/alert-dialog/alert-dialog.slots.js +52 -0
- package/dist/components/alert-dialog/alert-dialog.types.d.ts +22 -0
- package/dist/components/alert-dialog/index.d.ts +3 -0
- package/dist/components/autocomplete/autocomplete.context.d.ts +5 -0
- package/dist/components/autocomplete/autocomplete.context.js +13 -0
- package/dist/components/autocomplete/autocomplete.d.ts +364 -0
- package/dist/components/autocomplete/autocomplete.js +373 -0
- package/dist/components/autocomplete/autocomplete.props.d.ts +83 -0
- package/dist/components/autocomplete/autocomplete.props.js +63 -0
- package/dist/components/autocomplete/autocomplete.slots.d.ts +32 -0
- package/dist/components/autocomplete/autocomplete.slots.js +61 -0
- package/dist/components/autocomplete/index.d.ts +3 -0
- package/dist/components/avatar/avatar.context.js +21 -0
- package/dist/components/avatar/avatar.d.ts +235 -0
- package/dist/components/avatar/avatar.js +208 -0
- package/dist/components/avatar/avatar.props.d.ts +86 -0
- package/dist/components/avatar/avatar.props.js +78 -0
- package/dist/components/avatar/avatar.slots.d.ts +35 -0
- package/dist/components/avatar/avatar.slots.js +49 -0
- package/dist/components/avatar/avatar.types.d.ts +28 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/button/button.d.ts +91 -0
- package/dist/components/button/button.js +82 -0
- package/dist/components/button/button.props.d.ts +48 -0
- package/dist/components/button/button.props.js +25 -0
- package/dist/components/button/button.slots.d.ts +30 -0
- package/dist/components/button/button.slots.js +40 -0
- package/dist/components/button/button.types.d.ts +12 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button-group/button-group.context.js +15 -0
- package/dist/components/button-group/button-group.d.ts +60 -0
- package/dist/components/button-group/button-group.js +50 -0
- package/dist/components/button-group/button-group.props.d.ts +22 -0
- package/dist/components/button-group/button-group.props.js +33 -0
- package/dist/components/button-group/button-group.slots.d.ts +12 -0
- package/dist/components/button-group/button-group.slots.js +18 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/checkbox/checkbox-group.d.ts +46 -0
- package/dist/components/checkbox/checkbox-group.js +31 -0
- package/dist/components/checkbox/checkbox.context.js +15 -0
- package/dist/components/checkbox/checkbox.d.ts +130 -0
- package/dist/components/checkbox/checkbox.js +117 -0
- package/dist/components/checkbox/checkbox.props.d.ts +84 -0
- package/dist/components/checkbox/checkbox.props.js +49 -0
- package/dist/components/checkbox/checkbox.slots.d.ts +27 -0
- package/dist/components/checkbox/checkbox.slots.js +40 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/code-block/brand-logo.d.ts +37 -0
- package/dist/components/code-block/brand-logo.js +212 -0
- package/dist/components/code-block/code-block.context.js +13 -0
- package/dist/components/code-block/code-block.d.ts +190 -0
- package/dist/components/code-block/code-block.js +267 -0
- package/dist/components/code-block/code-block.props.d.ts +42 -0
- package/dist/components/code-block/code-block.props.js +51 -0
- package/dist/components/code-block/code-block.slots.d.ts +16 -0
- package/dist/components/code-block/code-block.slots.js +31 -0
- package/dist/components/code-block/index.d.ts +3 -0
- package/dist/components/code-block/language-label.js +43 -0
- package/dist/components/collapsible/collapsible.context.js +18 -0
- package/dist/components/collapsible/collapsible.d.ts +167 -0
- package/dist/components/collapsible/collapsible.js +182 -0
- package/dist/components/collapsible/collapsible.props.d.ts +33 -0
- package/dist/components/collapsible/collapsible.props.js +44 -0
- package/dist/components/collapsible/collapsible.slots.d.ts +25 -0
- package/dist/components/collapsible/collapsible.slots.js +40 -0
- package/dist/components/collapsible/collapsible.types.d.ts +23 -0
- package/dist/components/collapsible/index.d.ts +2 -0
- package/dist/components/color-picker/area.d.ts +11 -0
- package/dist/components/color-picker/area.js +148 -0
- package/dist/components/color-picker/color-picker.d.ts +110 -0
- package/dist/components/color-picker/color-picker.js +149 -0
- package/dist/components/color-picker/color-picker.props.d.ts +69 -0
- package/dist/components/color-picker/color-picker.props.js +74 -0
- package/dist/components/color-picker/color-picker.slots.js +21 -0
- package/dist/components/color-picker/color.d.ts +18 -0
- package/dist/components/color-picker/color.js +224 -0
- package/dist/components/color-picker/context.d.ts +25 -0
- package/dist/components/color-picker/context.js +23 -0
- package/dist/components/color-picker/eyedropper.d.ts +14 -0
- package/dist/components/color-picker/eyedropper.js +50 -0
- package/dist/components/color-picker/format-tabs.d.ts +11 -0
- package/dist/components/color-picker/format-tabs.js +35 -0
- package/dist/components/color-picker/index.d.ts +3 -0
- package/dist/components/color-picker/inputs.d.ts +16 -0
- package/dist/components/color-picker/inputs.js +61 -0
- package/dist/components/color-picker/sliders.d.ts +17 -0
- package/dist/components/color-picker/sliders.js +94 -0
- package/dist/components/color-picker/store.js +48 -0
- package/dist/components/color-picker/swatch.d.ts +15 -0
- package/dist/components/color-picker/swatch.js +25 -0
- package/dist/components/color-swatch/color-swatch-picker.d.ts +87 -0
- package/dist/components/color-swatch/color-swatch-picker.js +73 -0
- package/dist/components/color-swatch/color-swatch.context.js +8 -0
- package/dist/components/color-swatch/color-swatch.d.ts +55 -0
- package/dist/components/color-swatch/color-swatch.js +48 -0
- package/dist/components/color-swatch/color-swatch.props.d.ts +54 -0
- package/dist/components/color-swatch/color-swatch.props.js +32 -0
- package/dist/components/color-swatch/color-swatch.slots.js +13 -0
- package/dist/components/color-swatch/index.d.ts +2 -0
- package/dist/components/combobox/combobox.context.js +13 -0
- package/dist/components/combobox/combobox.d.ts +328 -0
- package/dist/components/combobox/combobox.js +315 -0
- package/dist/components/combobox/combobox.props.d.ts +85 -0
- package/dist/components/combobox/combobox.props.js +79 -0
- package/dist/components/combobox/combobox.slots.d.ts +28 -0
- package/dist/components/combobox/combobox.slots.js +63 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/context-menu/context-menu.d.ts +254 -0
- package/dist/components/context-menu/context-menu.js +150 -0
- package/dist/components/context-menu/context-menu.props.d.ts +22 -0
- package/dist/components/context-menu/context-menu.props.js +32 -0
- package/dist/components/context-menu/context-menu.slots.d.ts +24 -0
- package/dist/components/context-menu/context-menu.slots.js +42 -0
- package/dist/components/context-menu/index.d.ts +2 -0
- package/dist/components/copy-button/copy-button.d.ts +56 -0
- package/dist/components/copy-button/copy-button.js +88 -0
- package/dist/components/copy-button/copy-button.props.d.ts +27 -0
- package/dist/components/copy-button/copy-button.props.js +51 -0
- package/dist/components/copy-button/copy-button.slots.d.ts +20 -0
- package/dist/components/copy-button/copy-button.slots.js +36 -0
- package/dist/components/copy-button/index.d.ts +2 -0
- package/dist/components/dialog/dialog.context.js +15 -0
- package/dist/components/dialog/dialog.d.ts +299 -0
- package/dist/components/dialog/dialog.js +263 -0
- package/dist/components/dialog/dialog.props.d.ts +71 -0
- package/dist/components/dialog/dialog.props.js +75 -0
- package/dist/components/dialog/dialog.slots.d.ts +26 -0
- package/dist/components/dialog/dialog.slots.js +46 -0
- package/dist/components/dialog/dialog.types.d.ts +16 -0
- package/dist/components/dialog/index.d.ts +3 -0
- package/dist/components/field/field.d.ts +221 -0
- package/dist/components/field/field.js +192 -0
- package/dist/components/field/field.props.d.ts +66 -0
- package/dist/components/field/field.props.js +65 -0
- package/dist/components/field/field.slots.d.ts +35 -0
- package/dist/components/field/field.slots.js +54 -0
- package/dist/components/field/field.types.d.ts +5 -0
- package/dist/components/field/index.d.ts +4 -0
- package/dist/components/inline-code/index.d.ts +1 -0
- package/dist/components/inline-code/inline-code.d.ts +46 -0
- package/dist/components/inline-code/inline-code.js +36 -0
- package/dist/components/inline-code/inline-code.props.d.ts +17 -0
- package/dist/components/inline-code/inline-code.props.js +27 -0
- package/dist/components/inline-code/inline-code.slots.js +8 -0
- package/dist/components/input/index.d.ts +3 -0
- package/dist/components/input/input.context.js +13 -0
- package/dist/components/input/input.d.ts +161 -0
- package/dist/components/input/input.js +117 -0
- package/dist/components/input/input.props.d.ts +51 -0
- package/dist/components/input/input.props.js +50 -0
- package/dist/components/input/input.slots.d.ts +35 -0
- package/dist/components/input/input.slots.js +46 -0
- package/dist/components/input/input.types.d.ts +12 -0
- package/dist/components/kbd/glyphs.js +45 -0
- package/dist/components/kbd/index.d.ts +1 -0
- package/dist/components/kbd/kbd.d.ts +61 -0
- package/dist/components/kbd/kbd.js +233 -0
- package/dist/components/kbd/kbd.props.d.ts +30 -0
- package/dist/components/kbd/kbd.props.js +39 -0
- package/dist/components/kbd/kbd.slots.js +14 -0
- package/dist/components/kbd/use-apple-platform.js +25 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/menu.d.ts +355 -0
- package/dist/components/menu/menu.js +263 -0
- package/dist/components/menu/menu.props.d.ts +92 -0
- package/dist/components/menu/menu.props.js +97 -0
- package/dist/components/menu/menu.slots.d.ts +32 -0
- package/dist/components/menu/menu.slots.js +60 -0
- package/dist/components/menubar/index.d.ts +2 -0
- package/dist/components/menubar/menubar.context.js +13 -0
- package/dist/components/menubar/menubar.d.ts +162 -0
- package/dist/components/menubar/menubar.js +122 -0
- package/dist/components/menubar/menubar.props.d.ts +41 -0
- package/dist/components/menubar/menubar.props.js +45 -0
- package/dist/components/menubar/menubar.slots.d.ts +26 -0
- package/dist/components/menubar/menubar.slots.js +40 -0
- package/dist/components/meter/index.d.ts +2 -0
- package/dist/components/meter/meter.context.d.ts +9 -0
- package/dist/components/meter/meter.context.js +13 -0
- package/dist/components/meter/meter.d.ts +163 -0
- package/dist/components/meter/meter.js +121 -0
- package/dist/components/meter/meter.props.d.ts +50 -0
- package/dist/components/meter/meter.props.js +33 -0
- package/dist/components/meter/meter.slots.d.ts +18 -0
- package/dist/components/meter/meter.slots.js +31 -0
- package/dist/components/navigation-menu/index.d.ts +2 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +328 -0
- package/dist/components/navigation-menu/navigation-menu.js +274 -0
- package/dist/components/navigation-menu/navigation-menu.props.d.ts +98 -0
- package/dist/components/navigation-menu/navigation-menu.props.js +90 -0
- package/dist/components/navigation-menu/navigation-menu.slots.d.ts +34 -0
- package/dist/components/navigation-menu/navigation-menu.slots.js +60 -0
- package/dist/components/number-field/index.d.ts +2 -0
- package/dist/components/number-field/number-field.context.d.ts +13 -0
- package/dist/components/number-field/number-field.context.js +13 -0
- package/dist/components/number-field/number-field.d.ts +197 -0
- package/dist/components/number-field/number-field.js +187 -0
- package/dist/components/number-field/number-field.props.d.ts +66 -0
- package/dist/components/number-field/number-field.props.js +50 -0
- package/dist/components/number-field/number-field.slots.d.ts +31 -0
- package/dist/components/number-field/number-field.slots.js +48 -0
- package/dist/components/otp-field/index.d.ts +3 -0
- package/dist/components/otp-field/otp-field.context.js +13 -0
- package/dist/components/otp-field/otp-field.d.ts +99 -0
- package/dist/components/otp-field/otp-field.js +76 -0
- package/dist/components/otp-field/otp-field.props.d.ts +48 -0
- package/dist/components/otp-field/otp-field.props.js +43 -0
- package/dist/components/otp-field/otp-field.slots.d.ts +28 -0
- package/dist/components/otp-field/otp-field.slots.js +39 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/popover.d.ts +192 -0
- package/dist/components/popover/popover.js +152 -0
- package/dist/components/popover/popover.props.d.ts +34 -0
- package/dist/components/popover/popover.props.js +44 -0
- package/dist/components/popover/popover.slots.d.ts +22 -0
- package/dist/components/popover/popover.slots.js +42 -0
- package/dist/components/preview-card/index.d.ts +2 -0
- package/dist/components/preview-card/preview-card.d.ts +182 -0
- package/dist/components/preview-card/preview-card.js +146 -0
- package/dist/components/preview-card/preview-card.props.d.ts +37 -0
- package/dist/components/preview-card/preview-card.props.js +48 -0
- package/dist/components/preview-card/preview-card.slots.d.ts +22 -0
- package/dist/components/preview-card/preview-card.slots.js +39 -0
- package/dist/components/progress/index.d.ts +3 -0
- package/dist/components/progress/progress.context.d.ts +9 -0
- package/dist/components/progress/progress.context.js +13 -0
- package/dist/components/progress/progress.d.ts +139 -0
- package/dist/components/progress/progress.js +92 -0
- package/dist/components/progress/progress.props.d.ts +56 -0
- package/dist/components/progress/progress.props.js +38 -0
- package/dist/components/progress/progress.slots.d.ts +24 -0
- package/dist/components/progress/progress.slots.js +37 -0
- package/dist/components/radio/index.d.ts +2 -0
- package/dist/components/radio/radio.context.js +5 -0
- package/dist/components/radio/radio.d.ts +205 -0
- package/dist/components/radio/radio.js +168 -0
- package/dist/components/radio/radio.props.d.ts +106 -0
- package/dist/components/radio/radio.props.js +65 -0
- package/dist/components/radio/radio.slots.d.ts +29 -0
- package/dist/components/radio/radio.slots.js +44 -0
- package/dist/components/rail/index.d.ts +3 -0
- package/dist/components/rail/rail.context.d.ts +17 -0
- package/dist/components/rail/rail.context.js +23 -0
- package/dist/components/rail/rail.d.ts +232 -0
- package/dist/components/rail/rail.js +254 -0
- package/dist/components/rail/rail.props.d.ts +98 -0
- package/dist/components/rail/rail.props.js +64 -0
- package/dist/components/rail/rail.slots.d.ts +20 -0
- package/dist/components/rail/rail.slots.js +40 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/scroll-area.context.js +15 -0
- package/dist/components/scroll-area/scroll-area.d.ts +217 -0
- package/dist/components/scroll-area/scroll-area.js +153 -0
- package/dist/components/scroll-area/scroll-area.props.d.ts +73 -0
- package/dist/components/scroll-area/scroll-area.props.js +64 -0
- package/dist/components/scroll-area/scroll-area.slots.d.ts +40 -0
- package/dist/components/scroll-area/scroll-area.slots.js +54 -0
- package/dist/components/scroll-area/scroll-area.types.d.ts +24 -0
- package/dist/components/search-dialog/index.d.ts +3 -0
- package/dist/components/search-dialog/parts/input.d.ts +24 -0
- package/dist/components/search-dialog/parts/input.js +53 -0
- package/dist/components/search-dialog/parts/messages.d.ts +80 -0
- package/dist/components/search-dialog/parts/messages.js +75 -0
- package/dist/components/search-dialog/parts/results.d.ts +43 -0
- package/dist/components/search-dialog/parts/results.js +63 -0
- package/dist/components/search-dialog/parts/root.d.ts +54 -0
- package/dist/components/search-dialog/parts/root.js +99 -0
- package/dist/components/search-dialog/search-dialog.context.d.ts +15 -0
- package/dist/components/search-dialog/search-dialog.context.js +20 -0
- package/dist/components/search-dialog/search-dialog.d.ts +84 -0
- package/dist/components/search-dialog/search-dialog.js +43 -0
- package/dist/components/search-dialog/search-dialog.props.d.ts +45 -0
- package/dist/components/search-dialog/search-dialog.props.js +49 -0
- package/dist/components/search-dialog/search-dialog.slots.d.ts +16 -0
- package/dist/components/search-dialog/search-dialog.slots.js +32 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/select.context.js +17 -0
- package/dist/components/select/select.d.ts +356 -0
- package/dist/components/select/select.js +314 -0
- package/dist/components/select/select.props.d.ts +110 -0
- package/dist/components/select/select.props.js +103 -0
- package/dist/components/select/select.slots.d.ts +38 -0
- package/dist/components/select/select.slots.js +67 -0
- package/dist/components/separator/index.d.ts +2 -0
- package/dist/components/separator/separator.d.ts +69 -0
- package/dist/components/separator/separator.js +44 -0
- package/dist/components/separator/separator.props.d.ts +30 -0
- package/dist/components/separator/separator.props.js +30 -0
- package/dist/components/separator/separator.slots.d.ts +22 -0
- package/dist/components/separator/separator.slots.js +21 -0
- package/dist/components/separator/separator.types.d.ts +5 -0
- package/dist/components/sheet/index.d.ts +3 -0
- package/dist/components/sheet/sheet-stack.d.ts +106 -0
- package/dist/components/sheet/sheet-stack.js +146 -0
- package/dist/components/sheet/sheet.d.ts +279 -0
- package/dist/components/sheet/sheet.js +264 -0
- package/dist/components/sheet/sheet.props.d.ts +74 -0
- package/dist/components/sheet/sheet.props.js +77 -0
- package/dist/components/sheet/sheet.slots.js +22 -0
- package/dist/components/sheet/sheet.types.d.ts +12 -0
- package/dist/components/slider/index.d.ts +3 -0
- package/dist/components/slider/slider.context.d.ts +5 -0
- package/dist/components/slider/slider.context.js +29 -0
- package/dist/components/slider/slider.d.ts +230 -0
- package/dist/components/slider/slider.js +274 -0
- package/dist/components/slider/slider.props.d.ts +72 -0
- package/dist/components/slider/slider.props.js +59 -0
- package/dist/components/slider/slider.slots.d.ts +30 -0
- package/dist/components/slider/slider.slots.js +50 -0
- package/dist/components/surface/index.d.ts +1 -0
- package/dist/components/surface/surface.d.ts +84 -0
- package/dist/components/surface/surface.js +48 -0
- package/dist/components/surface/surface.props.d.ts +35 -0
- package/dist/components/surface/surface.props.js +26 -0
- package/dist/components/surface/surface.slots.js +9 -0
- package/dist/components/surface/surface.types.d.ts +14 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/switch.context.js +14 -0
- package/dist/components/switch/switch.d.ts +110 -0
- package/dist/components/switch/switch.js +92 -0
- package/dist/components/switch/switch.props.d.ts +68 -0
- package/dist/components/switch/switch.props.js +41 -0
- package/dist/components/switch/switch.slots.d.ts +23 -0
- package/dist/components/switch/switch.slots.js +35 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/table.d.ts +104 -0
- package/dist/components/table/table.js +92 -0
- package/dist/components/table/table.props.d.ts +38 -0
- package/dist/components/table/table.props.js +49 -0
- package/dist/components/table/table.slots.js +17 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/tabs.context.d.ts +9 -0
- package/dist/components/tabs/tabs.context.js +13 -0
- package/dist/components/tabs/tabs.d.ts +139 -0
- package/dist/components/tabs/tabs.js +118 -0
- package/dist/components/tabs/tabs.props.d.ts +59 -0
- package/dist/components/tabs/tabs.props.js +39 -0
- package/dist/components/tabs/tabs.slots.d.ts +20 -0
- package/dist/components/tabs/tabs.slots.js +33 -0
- package/dist/components/textarea/index.d.ts +3 -0
- package/dist/components/textarea/textarea.context.js +13 -0
- package/dist/components/textarea/textarea.d.ts +142 -0
- package/dist/components/textarea/textarea.js +129 -0
- package/dist/components/textarea/textarea.props.d.ts +44 -0
- package/dist/components/textarea/textarea.props.js +32 -0
- package/dist/components/textarea/textarea.slots.d.ts +23 -0
- package/dist/components/textarea/textarea.slots.js +33 -0
- package/dist/components/textarea/textarea.types.d.ts +5 -0
- package/dist/components/toast/index.d.ts +4 -0
- package/dist/components/toast/toast.d.ts +241 -0
- package/dist/components/toast/toast.js +193 -0
- package/dist/components/toast/toast.manager.d.ts +76 -0
- package/dist/components/toast/toast.manager.js +71 -0
- package/dist/components/toast/toast.props.d.ts +66 -0
- package/dist/components/toast/toast.props.js +74 -0
- package/dist/components/toast/toast.slots.d.ts +30 -0
- package/dist/components/toast/toast.slots.js +49 -0
- package/dist/components/toast/toast.types.d.ts +19 -0
- package/dist/components/toggle/index.d.ts +2 -0
- package/dist/components/toggle/toggle.context.d.ts +11 -0
- package/dist/components/toggle/toggle.context.js +14 -0
- package/dist/components/toggle/toggle.d.ts +136 -0
- package/dist/components/toggle/toggle.js +101 -0
- package/dist/components/toggle/toggle.props.d.ts +51 -0
- package/dist/components/toggle/toggle.props.js +29 -0
- package/dist/components/toggle/toggle.slots.d.ts +26 -0
- package/dist/components/toggle/toggle.slots.js +36 -0
- package/dist/components/toolbar/index.d.ts +3 -0
- package/dist/components/toolbar/toolbar.context.js +23 -0
- package/dist/components/toolbar/toolbar.d.ts +218 -0
- package/dist/components/toolbar/toolbar.js +197 -0
- package/dist/components/toolbar/toolbar.props.d.ts +54 -0
- package/dist/components/toolbar/toolbar.props.js +55 -0
- package/dist/components/toolbar/toolbar.slots.d.ts +24 -0
- package/dist/components/toolbar/toolbar.slots.js +37 -0
- package/dist/components/toolbar/toolbar.types.d.ts +15 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/tooltip.d.ts +170 -0
- package/dist/components/tooltip/tooltip.js +143 -0
- package/dist/components/tooltip/tooltip.props.d.ts +36 -0
- package/dist/components/tooltip/tooltip.props.js +42 -0
- package/dist/components/tooltip/tooltip.slots.d.ts +26 -0
- package/dist/components/tooltip/tooltip.slots.js +42 -0
- package/dist/core/derive-threshold-tone.js +35 -0
- package/dist/core/merge-class-name.d.ts +17 -0
- package/dist/core/merge-class-name.js +16 -0
- package/dist/core/noctis-provider.d.ts +38 -0
- package/dist/core/noctis-provider.js +44 -0
- package/dist/core/primitive/index.d.ts +1 -0
- package/dist/core/primitive/primitive.d.ts +44 -0
- package/dist/core/primitive/primitive.js +27 -0
- package/dist/core/radius-scope/index.d.ts +2 -0
- package/dist/core/radius-scope/radius-scope.d.ts +43 -0
- package/dist/core/radius-scope/radius-scope.js +36 -0
- package/dist/core/radius-scope/radius-scope.styles.d.ts +13 -0
- package/dist/core/radius-scope/radius-scope.styles.js +11 -0
- package/dist/core/render.d.ts +24 -0
- package/dist/core/render.js +12 -0
- package/dist/core/use-copy.d.ts +13 -0
- package/dist/core/use-copy.js +30 -0
- package/dist/core/use-injected-labels.js +55 -0
- package/dist/core/use-reduced-motion.d.ts +9 -0
- package/dist/core/use-reduced-motion.js +26 -0
- package/dist/core/visually-hidden/index.d.ts +1 -0
- package/dist/core/visually-hidden/visually-hidden.d.ts +24 -0
- package/dist/core/visually-hidden/visually-hidden.js +19 -0
- package/dist/i18n/default-messages.d.ts +12 -0
- package/dist/i18n/default-messages.js +10 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.js +2 -0
- package/dist/i18n/messages/index.d.ts +2 -0
- package/dist/i18n/messages/index.js +2 -0
- package/dist/icons/glyphs.d.ts +2 -0
- package/dist/icons/glyphs.js +2 -0
- package/dist/icons/icon.d.ts +40 -0
- package/dist/icons/icon.js +26 -0
- package/dist/icons/icon.styles.d.ts +9 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/index.d.ts +126 -0
- package/dist/index.js +112 -0
- package/dist/primitives/accordion.d.ts +7 -0
- package/dist/primitives/accordion.js +8 -0
- package/dist/primitives/alert-dialog.d.ts +7 -0
- package/dist/primitives/alert-dialog.js +8 -0
- package/dist/primitives/autocomplete/autocomplete.d.ts +58 -0
- package/dist/primitives/autocomplete/autocomplete.js +58 -0
- package/dist/primitives/autocomplete/index.d.ts +1 -0
- package/dist/primitives/autocomplete.d.ts +2 -0
- package/dist/primitives/autocomplete.js +2 -0
- package/dist/primitives/avatar.d.ts +7 -0
- package/dist/primitives/avatar.js +8 -0
- package/dist/primitives/button.d.ts +7 -0
- package/dist/primitives/button.js +8 -0
- package/dist/primitives/checkbox-group.d.ts +7 -0
- package/dist/primitives/checkbox-group.js +8 -0
- package/dist/primitives/checkbox.d.ts +7 -0
- package/dist/primitives/checkbox.js +8 -0
- package/dist/primitives/collapsible.d.ts +7 -0
- package/dist/primitives/collapsible.js +8 -0
- package/dist/primitives/combobox/combobox.d.ts +71 -0
- package/dist/primitives/combobox/combobox.js +66 -0
- package/dist/primitives/combobox/index.d.ts +1 -0
- package/dist/primitives/combobox.d.ts +2 -0
- package/dist/primitives/combobox.js +2 -0
- package/dist/primitives/context-menu.d.ts +7 -0
- package/dist/primitives/context-menu.js +8 -0
- package/dist/primitives/csp-provider.d.ts +1 -0
- package/dist/primitives/csp-provider.js +2 -0
- package/dist/primitives/dialog.d.ts +7 -0
- package/dist/primitives/dialog.js +8 -0
- package/dist/primitives/direction-provider.d.ts +1 -0
- package/dist/primitives/direction-provider.js +8 -0
- package/dist/primitives/drawer.d.ts +1 -0
- package/dist/primitives/drawer.js +2 -0
- package/dist/primitives/field.d.ts +7 -0
- package/dist/primitives/field.js +8 -0
- package/dist/primitives/fieldset.d.ts +7 -0
- package/dist/primitives/fieldset.js +8 -0
- package/dist/primitives/form.d.ts +7 -0
- package/dist/primitives/form.js +8 -0
- package/dist/primitives/index.d.ts +79 -0
- package/dist/primitives/index.js +113 -0
- package/dist/primitives/input.d.ts +7 -0
- package/dist/primitives/input.js +8 -0
- package/dist/primitives/menu.d.ts +7 -0
- package/dist/primitives/menu.js +8 -0
- package/dist/primitives/menubar.d.ts +7 -0
- package/dist/primitives/menubar.js +8 -0
- package/dist/primitives/meter/index.d.ts +1 -0
- package/dist/primitives/meter/meter.d.ts +56 -0
- package/dist/primitives/meter/meter.js +59 -0
- package/dist/primitives/meter.d.ts +2 -0
- package/dist/primitives/meter.js +2 -0
- package/dist/primitives/navigation-menu.d.ts +7 -0
- package/dist/primitives/navigation-menu.js +8 -0
- package/dist/primitives/number-field/context.d.ts +13 -0
- package/dist/primitives/number-field/context.js +36 -0
- package/dist/primitives/number-field/index.d.ts +2 -0
- package/dist/primitives/number-field/number-field.d.ts +90 -0
- package/dist/primitives/number-field/number-field.js +107 -0
- package/dist/primitives/number-field.d.ts +3 -0
- package/dist/primitives/number-field.js +2 -0
- package/dist/primitives/otp-field.d.ts +7 -0
- package/dist/primitives/otp-field.js +8 -0
- package/dist/primitives/popover.d.ts +7 -0
- package/dist/primitives/popover.js +8 -0
- package/dist/primitives/preview-card.d.ts +7 -0
- package/dist/primitives/preview-card.js +8 -0
- package/dist/primitives/progress/index.d.ts +1 -0
- package/dist/primitives/progress/progress.d.ts +56 -0
- package/dist/primitives/progress/progress.js +59 -0
- package/dist/primitives/progress.d.ts +2 -0
- package/dist/primitives/progress.js +2 -0
- package/dist/primitives/radio-group.d.ts +7 -0
- package/dist/primitives/radio-group.js +8 -0
- package/dist/primitives/radio.d.ts +7 -0
- package/dist/primitives/radio.js +8 -0
- package/dist/primitives/scroll-area.d.ts +7 -0
- package/dist/primitives/scroll-area.js +8 -0
- package/dist/primitives/select.d.ts +7 -0
- package/dist/primitives/select.js +8 -0
- package/dist/primitives/separator.d.ts +7 -0
- package/dist/primitives/separator.js +8 -0
- package/dist/primitives/slider/context.d.ts +12 -0
- package/dist/primitives/slider/context.js +18 -0
- package/dist/primitives/slider/index.d.ts +2 -0
- package/dist/primitives/slider/slider.d.ts +83 -0
- package/dist/primitives/slider/slider.js +99 -0
- package/dist/primitives/slider.d.ts +3 -0
- package/dist/primitives/slider.js +2 -0
- package/dist/primitives/switch.d.ts +1 -0
- package/dist/primitives/switch.js +2 -0
- package/dist/primitives/tabs.d.ts +7 -0
- package/dist/primitives/tabs.js +8 -0
- package/dist/primitives/toast/context.d.ts +11 -0
- package/dist/primitives/toast/context.js +18 -0
- package/dist/primitives/toast/index.d.ts +2 -0
- package/dist/primitives/toast/toast.d.ts +122 -0
- package/dist/primitives/toast/toast.js +133 -0
- package/dist/primitives/toast.d.ts +3 -0
- package/dist/primitives/toast.js +2 -0
- package/dist/primitives/toggle-group.d.ts +7 -0
- package/dist/primitives/toggle-group.js +8 -0
- package/dist/primitives/toggle.d.ts +7 -0
- package/dist/primitives/toggle.js +8 -0
- package/dist/primitives/toolbar.d.ts +7 -0
- package/dist/primitives/toolbar.js +8 -0
- package/dist/primitives/tooltip.d.ts +7 -0
- package/dist/primitives/tooltip.js +8 -0
- package/dist/props.d.ts +46 -0
- package/dist/props.js +46 -0
- package/dist/styles.css +11513 -0
- package/dist/tailwind/cn.d.ts +33 -0
- package/dist/tailwind/cn.js +42 -0
- package/dist/tailwind/index.d.ts +3 -0
- package/dist/tailwind/index.js +3 -0
- package/dist/tailwind/tv.d.ts +20 -0
- package/dist/tailwind/tv.js +11 -0
- package/dist/tailwind.css +485 -0
- package/dist/theme/react.d.ts +1 -0
- package/dist/theme/react.js +1 -0
- package/dist/theme.d.ts +1 -0
- package/dist/theme.js +1 -0
- package/dist/tokens/react.d.ts +1 -0
- package/dist/tokens/react.js +1 -0
- package/dist/tokens.d.ts +1 -0
- package/dist/tokens.js +1 -0
- package/package.json +121 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Progress as Progress$1 } from "../../primitives/progress/progress.js";
|
|
3
|
+
import { ProgressProvider, useProgressContext } from "./progress.context.js";
|
|
4
|
+
import { indicatorProps, labelProps, rootProps, trackProps, valueProps } from "./progress.props.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/progress/progress.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Owns the value and shares the resolved `tone`/`size`/`labels` with its parts. Determinate when `value`
|
|
9
|
+
* is a number (`0`–`max`, `max` defaulting to `100`); indeterminate when `value` is `null`. Pass `tone`
|
|
10
|
+
* to tint the fill to a task outcome — `danger` for a failed upload, `warning` for at-risk, `success`
|
|
11
|
+
* for done; `neutral` (the default) keeps the active accent. The noctis primitive injects the active
|
|
12
|
+
* locale so the formatted value reads in the reader's language.
|
|
13
|
+
*/
|
|
14
|
+
function ProgressRoot({ tone = "neutral", size = "md", labels = "top", thickness, className, style, children, ...props }) {
|
|
15
|
+
const rootStyle = {
|
|
16
|
+
...thickness !== void 0 && { "--noctis-progress-track-block-size": typeof thickness === "number" ? `${thickness}px` : thickness },
|
|
17
|
+
...style
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ jsx(Progress$1.Root, {
|
|
20
|
+
"data-tone": tone,
|
|
21
|
+
"data-size": size,
|
|
22
|
+
"data-labels": labels,
|
|
23
|
+
className,
|
|
24
|
+
style: rootStyle,
|
|
25
|
+
...props,
|
|
26
|
+
children: /* @__PURE__ */ jsx(ProgressProvider, {
|
|
27
|
+
value: {
|
|
28
|
+
tone,
|
|
29
|
+
size,
|
|
30
|
+
labels
|
|
31
|
+
},
|
|
32
|
+
children
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/** The recessed rail the indicator fills. Holds a single `Progress.Indicator`. */
|
|
37
|
+
function ProgressTrack({ className, ...props }) {
|
|
38
|
+
useProgressContext("Track");
|
|
39
|
+
return /* @__PURE__ */ jsx(Progress$1.Track, {
|
|
40
|
+
className,
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/** The accent fill. Base UI sizes its inline width to the value; an empty value sweeps it indeterminately. */
|
|
45
|
+
function ProgressIndicator({ className, ...props }) {
|
|
46
|
+
return /* @__PURE__ */ jsx(Progress$1.Indicator, {
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/** The progress bar's accessible label. Place it in a header row beside `Progress.Value`. */
|
|
52
|
+
function ProgressLabel({ className, ...props }) {
|
|
53
|
+
return /* @__PURE__ */ jsx(Progress$1.Label, {
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/** The formatted completion text, localized via the injected locale. Pass a child function to format it. */
|
|
59
|
+
function ProgressValue({ className, ...props }) {
|
|
60
|
+
return /* @__PURE__ */ jsx(Progress$1.Value, {
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A progress bar for a task's completion: an accent fill over a recessed track, in two thicknesses. It is
|
|
67
|
+
* determinate when given a `value` (`0`–`max`) and indeterminate when `value` is `null`, in which case a
|
|
68
|
+
* sliver sweeps the track. Built on Base UI's Progress, so the root carries the correct `progressbar`
|
|
69
|
+
* role and ARIA value semantics, the value formats for the reader's locale, and the indeterminate sweep
|
|
70
|
+
* respects `prefers-reduced-motion`.
|
|
71
|
+
*
|
|
72
|
+
* Compose from parts: `Progress.Root` owns the value and the shared `tone`/`size`/`labels`,
|
|
73
|
+
* `Progress.Track` holds one `Progress.Indicator`, and an optional `Progress.Label` + `Progress.Value`
|
|
74
|
+
* caption the bar — the root lays them out above (`labels="top"`) or beside (`labels="side"`) the track.
|
|
75
|
+
*
|
|
76
|
+
* The runtime compound is a plain object (kept tree-shakeable); per-part prop and state types are exposed
|
|
77
|
+
* through the matching `Progress` namespace — e.g. `Progress.Value.Props`.
|
|
78
|
+
*/
|
|
79
|
+
const Progress = {
|
|
80
|
+
/** Owns the value and the shared tone/size/labels. `Progress.Root.props({ tone, size, labels })` → its spreadable prop bag. */
|
|
81
|
+
Root: Object.assign(ProgressRoot, { props: rootProps }),
|
|
82
|
+
/** The recessed rail. `Progress.Track.props()` → its spreadable prop bag. */
|
|
83
|
+
Track: Object.assign(ProgressTrack, { props: trackProps }),
|
|
84
|
+
/** The accent fill. `Progress.Indicator.props({ indeterminate })` → its spreadable prop bag for a foreign element. */
|
|
85
|
+
Indicator: Object.assign(ProgressIndicator, { props: indicatorProps }),
|
|
86
|
+
/** The accessible label. `Progress.Label.props()` → its spreadable prop bag. */
|
|
87
|
+
Label: Object.assign(ProgressLabel, { props: labelProps }),
|
|
88
|
+
/** The formatted value text. `Progress.Value.props()` → its spreadable prop bag. */
|
|
89
|
+
Value: Object.assign(ProgressValue, { props: valueProps })
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
92
|
+
export { Progress };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ProgressLabels, ProgressSize, ProgressTone } from "./progress.context.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/progress/progress.props.d.ts
|
|
4
|
+
/** A spreadable data-attribute prop bag — the shape every `Progress.*.props()` returns. */
|
|
5
|
+
type ProgressPartProps = {
|
|
6
|
+
/** The slot value the matching `progress.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 (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 `Progress.Root.props(...)` — the tone, track size, and caption placement stamped on the root. */
|
|
16
|
+
interface ProgressRootPropsArgs extends BasePropsArgs {
|
|
17
|
+
/** Status tint of the task outcome. @default "neutral" */
|
|
18
|
+
tone?: ProgressTone;
|
|
19
|
+
/** Track thickness — `sm` or `md`. @default "md" */
|
|
20
|
+
size?: ProgressSize;
|
|
21
|
+
/** Caption placement — `top` or `side`. @default "top" */
|
|
22
|
+
labels?: ProgressLabels;
|
|
23
|
+
}
|
|
24
|
+
/** Argument to `Progress.Indicator.props(...)` — the status the CSS keys the indeterminate sweep off. */
|
|
25
|
+
interface ProgressIndicatorPropsArgs extends BasePropsArgs {
|
|
26
|
+
/** Whether the value is unknown (drives the sweeping animation via `data-indeterminate`). */
|
|
27
|
+
indeterminate?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/** Argument to a stateless part's `.props(...)` — no variants/status of its own; look flows from the root. */
|
|
30
|
+
type ProgressStatelessPropsArgs = BasePropsArgs;
|
|
31
|
+
/** Root prop bag: `data-slot` plus the `data-tone`/`data-size`/`data-labels` the descendant rules read. */
|
|
32
|
+
declare function rootProps({
|
|
33
|
+
tone,
|
|
34
|
+
size,
|
|
35
|
+
labels,
|
|
36
|
+
className
|
|
37
|
+
}?: ProgressRootPropsArgs): ProgressPartProps;
|
|
38
|
+
/** Track prop bag: just the slot anchor. */
|
|
39
|
+
declare function trackProps({
|
|
40
|
+
className
|
|
41
|
+
}?: ProgressStatelessPropsArgs): ProgressPartProps;
|
|
42
|
+
/** Indicator prop bag: slot anchor plus the `data-indeterminate` status. */
|
|
43
|
+
declare function indicatorProps({
|
|
44
|
+
indeterminate,
|
|
45
|
+
className
|
|
46
|
+
}?: ProgressIndicatorPropsArgs): ProgressPartProps;
|
|
47
|
+
/** Label prop bag: just the slot anchor. */
|
|
48
|
+
declare function labelProps({
|
|
49
|
+
className
|
|
50
|
+
}?: ProgressStatelessPropsArgs): ProgressPartProps;
|
|
51
|
+
/** Value prop bag: just the slot anchor. */
|
|
52
|
+
declare function valueProps({
|
|
53
|
+
className
|
|
54
|
+
}?: ProgressStatelessPropsArgs): ProgressPartProps;
|
|
55
|
+
//#endregion
|
|
56
|
+
export { ProgressIndicatorPropsArgs, ProgressPartProps, ProgressRootPropsArgs, indicatorProps, labelProps, rootProps, trackProps, valueProps };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PROGRESS_SLOTS } from "./progress.slots.js";
|
|
2
|
+
//#region src/components/progress/progress.props.ts
|
|
3
|
+
/** Stamp a boolean status as a bare data-attribute: present (`""`) when on, absent (`undefined`) when off. */
|
|
4
|
+
const flag = (on) => on ? "" : void 0;
|
|
5
|
+
const withClassName = (bag, className) => className === void 0 ? bag : {
|
|
6
|
+
...bag,
|
|
7
|
+
className
|
|
8
|
+
};
|
|
9
|
+
/** Root prop bag: `data-slot` plus the `data-tone`/`data-size`/`data-labels` the descendant rules read. */
|
|
10
|
+
function rootProps({ tone = "neutral", size = "md", labels = "top", className } = {}) {
|
|
11
|
+
return withClassName({
|
|
12
|
+
"data-slot": PROGRESS_SLOTS.root,
|
|
13
|
+
"data-tone": tone,
|
|
14
|
+
"data-size": size,
|
|
15
|
+
"data-labels": labels
|
|
16
|
+
}, className);
|
|
17
|
+
}
|
|
18
|
+
/** Track prop bag: just the slot anchor. */
|
|
19
|
+
function trackProps({ className } = {}) {
|
|
20
|
+
return withClassName({ "data-slot": PROGRESS_SLOTS.track }, className);
|
|
21
|
+
}
|
|
22
|
+
/** Indicator prop bag: slot anchor plus the `data-indeterminate` status. */
|
|
23
|
+
function indicatorProps({ indeterminate, className } = {}) {
|
|
24
|
+
return withClassName({
|
|
25
|
+
"data-slot": PROGRESS_SLOTS.indicator,
|
|
26
|
+
"data-indeterminate": flag(indeterminate)
|
|
27
|
+
}, className);
|
|
28
|
+
}
|
|
29
|
+
/** Label prop bag: just the slot anchor. */
|
|
30
|
+
function labelProps({ className } = {}) {
|
|
31
|
+
return withClassName({ "data-slot": PROGRESS_SLOTS.label }, className);
|
|
32
|
+
}
|
|
33
|
+
/** Value prop bag: just the slot anchor. */
|
|
34
|
+
function valueProps({ className } = {}) {
|
|
35
|
+
return withClassName({ "data-slot": PROGRESS_SLOTS.value }, className);
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { indicatorProps, labelProps, rootProps, trackProps, valueProps };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/components/progress/progress.slots.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The `data-*` hooks `Progress` stamps on its parts, for host-side styling and tests. Slot values mark
|
|
4
|
+
* each rendered element; the status attributes are emitted by Base UI's Progress on every part — pair a
|
|
5
|
+
* slot with a status to target, say, only the indeterminate indicator.
|
|
6
|
+
*/
|
|
7
|
+
declare enum ProgressDataAttributes {
|
|
8
|
+
/** The root progress element. */
|
|
9
|
+
slot = "data-slot",
|
|
10
|
+
/** `neutral` | `success` | `warning` | `danger` — the task-outcome tint, stamped on the root. */
|
|
11
|
+
tone = "data-tone",
|
|
12
|
+
/** `sm` | `md` — the track thickness, stamped on the root. */
|
|
13
|
+
size = "data-size",
|
|
14
|
+
/** `top` | `side` — the caption placement relative to the track, stamped on the root. */
|
|
15
|
+
labels = "data-labels",
|
|
16
|
+
/** Present on every part while the value is `null` (no measurable progress). */
|
|
17
|
+
indeterminate = "data-indeterminate",
|
|
18
|
+
/** Present on every part while the value is between its min and max. */
|
|
19
|
+
progressing = "data-progressing",
|
|
20
|
+
/** Present on every part once the value reaches its max. */
|
|
21
|
+
complete = "data-complete"
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { ProgressDataAttributes };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region src/components/progress/progress.slots.ts
|
|
2
|
+
/**
|
|
3
|
+
* The slot vocabulary every `Progress` part stamps as its `data-slot`. The authored source the
|
|
4
|
+
* orchestration file reads from, kebab-cased `{component}-{part}`; SLOTS.md still generates from the
|
|
5
|
+
* token-graph declarations.
|
|
6
|
+
*/
|
|
7
|
+
const PROGRESS_SLOTS = {
|
|
8
|
+
root: "noctis-progress",
|
|
9
|
+
track: "noctis-progress-track",
|
|
10
|
+
indicator: "noctis-progress-indicator",
|
|
11
|
+
label: "noctis-progress-label",
|
|
12
|
+
value: "noctis-progress-value"
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The `data-*` hooks `Progress` stamps on its parts, for host-side styling and tests. Slot values mark
|
|
16
|
+
* each rendered element; the status attributes are emitted by Base UI's Progress on every part — pair a
|
|
17
|
+
* slot with a status to target, say, only the indeterminate indicator.
|
|
18
|
+
*/
|
|
19
|
+
let ProgressDataAttributes = /* @__PURE__ */ function(ProgressDataAttributes) {
|
|
20
|
+
/** The root progress element. */
|
|
21
|
+
ProgressDataAttributes["slot"] = "data-slot";
|
|
22
|
+
/** `neutral` | `success` | `warning` | `danger` — the task-outcome tint, stamped on the root. */
|
|
23
|
+
ProgressDataAttributes["tone"] = "data-tone";
|
|
24
|
+
/** `sm` | `md` — the track thickness, stamped on the root. */
|
|
25
|
+
ProgressDataAttributes["size"] = "data-size";
|
|
26
|
+
/** `top` | `side` — the caption placement relative to the track, stamped on the root. */
|
|
27
|
+
ProgressDataAttributes["labels"] = "data-labels";
|
|
28
|
+
/** Present on every part while the value is `null` (no measurable progress). */
|
|
29
|
+
ProgressDataAttributes["indeterminate"] = "data-indeterminate";
|
|
30
|
+
/** Present on every part while the value is between its min and max. */
|
|
31
|
+
ProgressDataAttributes["progressing"] = "data-progressing";
|
|
32
|
+
/** Present on every part once the value reaches its max. */
|
|
33
|
+
ProgressDataAttributes["complete"] = "data-complete";
|
|
34
|
+
return ProgressDataAttributes;
|
|
35
|
+
}({});
|
|
36
|
+
//#endregion
|
|
37
|
+
export { PROGRESS_SLOTS, ProgressDataAttributes };
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { field_d_exports } from "../../primitives/field.js";
|
|
2
|
+
import { radio_d_exports } from "../../primitives/radio.js";
|
|
3
|
+
import { radio_group_d_exports } from "../../primitives/radio-group.js";
|
|
4
|
+
import { cardProps, descriptionProps, fieldProps, groupProps, indicatorProps, labelProps, radioProps } from "./radio.props.js";
|
|
5
|
+
import { ComponentPropsWithoutRef, ReactElement, ReactNode } from "react";
|
|
6
|
+
|
|
7
|
+
//#region src/components/radio/radio.d.ts
|
|
8
|
+
/** The box size a radio (and its group) accepts, stamped as `data-size`. */
|
|
9
|
+
declare const SIZES: readonly ["sm", "md", "lg"];
|
|
10
|
+
/**
|
|
11
|
+
* Owns the single selection for a set of radios. Built on Base UI's `RadioGroup`, so the contained
|
|
12
|
+
* radios share roving focus and arrow-key navigation, and exactly one is selected at a time. Spreads the
|
|
13
|
+
* Base UI surface through — `name` / `form` / `readOnly` / `required` / `onValueChange` all forward — so
|
|
14
|
+
* a group is a real form control. `orientation` lays the children out (vertical by default; `horizontal`
|
|
15
|
+
* is a row that mirrors under RTL); `invalid` flags the group's value as in error, cascading the danger
|
|
16
|
+
* border to every radio and announcing it via `aria-invalid`. Sets the shared box `size` once.
|
|
17
|
+
*/
|
|
18
|
+
declare function RadioGroupRoot({
|
|
19
|
+
size,
|
|
20
|
+
orientation,
|
|
21
|
+
invalid,
|
|
22
|
+
className,
|
|
23
|
+
children,
|
|
24
|
+
...props
|
|
25
|
+
}: Radio.Group.Props): ReactElement;
|
|
26
|
+
/**
|
|
27
|
+
* One selectable radio — a circular box that takes the accent border and fills with the accent dot when
|
|
28
|
+
* checked. Built on Base UI's `Radio.Root`, so it is keyboard-reachable, single-select, and announces
|
|
29
|
+
* its state. Base UI stamps the live `data-checked`/`data-unchecked`/`data-disabled`/`data-readonly` the
|
|
30
|
+
* CSS keys off; the render contributes the slot anchor and the `data-size` axis (inherited from the
|
|
31
|
+
* enclosing field/group), and nests the indicator dot. `readOnly` / `required` forward to Base UI. For
|
|
32
|
+
* a labelled control, compose `Radio.Field` + `Radio.Label` (the row wires the label to the box and
|
|
33
|
+
* holds the box↔label gap), mirroring `Checkbox.Field`.
|
|
34
|
+
*/
|
|
35
|
+
declare function RadioRoot({
|
|
36
|
+
className,
|
|
37
|
+
children,
|
|
38
|
+
...props
|
|
39
|
+
}: Radio.Root.Props): ReactElement;
|
|
40
|
+
/**
|
|
41
|
+
* The accent dot shown inside a checked radio. Built on Base UI's `Radio.Indicator` with `keepMounted`,
|
|
42
|
+
* so it stays in the DOM and the CSS can scale / fade it in on select (and out on de-select) off the
|
|
43
|
+
* `data-starting-style`/`data-ending-style` hooks. `Radio.Root` renders it automatically.
|
|
44
|
+
*/
|
|
45
|
+
declare function RadioIndicator({
|
|
46
|
+
className
|
|
47
|
+
}?: Radio.Indicator.Props): ReactElement;
|
|
48
|
+
/**
|
|
49
|
+
* The labelled row — pairs a `Radio.Label` with a `Radio.Root` so the pairing reads as one control,
|
|
50
|
+
* mirroring `Checkbox.Field`. Renders Base UI's `Field.Root`, which links the label to the box (clicking
|
|
51
|
+
* the label selects it, the label becomes the accessible name). Lay the label and box in either DOM
|
|
52
|
+
* order; the row mirrors under RTL by construction and holds the box↔label gap seam. Size flows from an
|
|
53
|
+
* enclosing `Radio.Group` unless this field sets its own, and cascades to the box through context.
|
|
54
|
+
*
|
|
55
|
+
* <Radio.Field>
|
|
56
|
+
* <Radio.Root value="comfortable" />
|
|
57
|
+
* <Radio.Label>Comfortable</Radio.Label>
|
|
58
|
+
* </Radio.Field>
|
|
59
|
+
*/
|
|
60
|
+
declare function RadioField({
|
|
61
|
+
size,
|
|
62
|
+
className,
|
|
63
|
+
children,
|
|
64
|
+
...props
|
|
65
|
+
}: Radio.Field.Props): ReactElement;
|
|
66
|
+
/**
|
|
67
|
+
* The visible label that names a radio inside a `Radio.Field`. Renders Base UI's `Field.Label`, so
|
|
68
|
+
* clicking it selects the box and its text supplies the accessible name (no `aria-label` needed). It
|
|
69
|
+
* mirrors the field's disabled and invalid state through `data-disabled`/`data-invalid`.
|
|
70
|
+
*/
|
|
71
|
+
declare function RadioLabel({
|
|
72
|
+
className,
|
|
73
|
+
children,
|
|
74
|
+
...props
|
|
75
|
+
}: Radio.Label.Props): ReactElement;
|
|
76
|
+
/**
|
|
77
|
+
* Helper text for a radio, wired to it via `aria-describedby` (the consumer sets a matching `id`). Muted,
|
|
78
|
+
* small text offset below the label by the description gap — turns a bare dot + label into a real field
|
|
79
|
+
* row without forcing a card.
|
|
80
|
+
*/
|
|
81
|
+
declare function RadioDescription({
|
|
82
|
+
className,
|
|
83
|
+
children,
|
|
84
|
+
...props
|
|
85
|
+
}: Radio.Description.Props): ReactElement;
|
|
86
|
+
/**
|
|
87
|
+
* A selectable card: a sharp bordered target wrapping a `Radio.Root` (in a `<label>`, so the whole card
|
|
88
|
+
* toggles) plus its label and optional `Radio.Description`. Selecting it tints the card edge to the
|
|
89
|
+
* accent (signal); hover is a neutral surface shift and the focus ring moves to the card. The control
|
|
90
|
+
* sits at the leading edge by default, or the trailing edge via `controlPosition`. The dot stays a true
|
|
91
|
+
* circle. Set `hideControl` to drop the visible dot entirely — the card's accent edge becomes the sole
|
|
92
|
+
* selection signal (the radio input stays for keyboard + forms), for a clean Radix-style card picker. A
|
|
93
|
+
* composition, not a new engine primitive — it reuses the surface roles.
|
|
94
|
+
*/
|
|
95
|
+
declare function RadioCard({
|
|
96
|
+
value,
|
|
97
|
+
disabled,
|
|
98
|
+
readOnly,
|
|
99
|
+
required,
|
|
100
|
+
controlPosition,
|
|
101
|
+
hideControl,
|
|
102
|
+
className,
|
|
103
|
+
children,
|
|
104
|
+
...props
|
|
105
|
+
}: Radio.Card.Props): ReactElement;
|
|
106
|
+
/**
|
|
107
|
+
* A single-select set of radios. Compose `Radio.Group` (owns the value) with `Radio.Root`s. Built on
|
|
108
|
+
* Base UI's `RadioGroup`/`Radio` for selection, roving focus, and a11y. Pair each radio with a label
|
|
109
|
+
* (a `<label>` wrapper or an `id`/`aria-labelledby` link), add a `Radio.Description` for helper text, or
|
|
110
|
+
* reach for `Radio.Card` for a selectable card target.
|
|
111
|
+
*
|
|
112
|
+
* Per-part `props(...)` builders expose the same slot/data-attribute mapping as spreadable statics for
|
|
113
|
+
* the escape-hatch path (D12).
|
|
114
|
+
*/
|
|
115
|
+
declare const Radio: {
|
|
116
|
+
/** The group that owns the selection. `Radio.Group.props({ orientation, invalid, disabled })` → its spreadable prop bag. */Group: typeof RadioGroupRoot & {
|
|
117
|
+
props: typeof groupProps;
|
|
118
|
+
}; /** One selectable radio box. `Radio.Root.props({ size, checked, disabled, readonly, invalid })` → its spreadable prop bag. */
|
|
119
|
+
Root: typeof RadioRoot & {
|
|
120
|
+
props: typeof radioProps;
|
|
121
|
+
}; /** The accent dot. `Radio.Indicator.props({ checked })` → its spreadable prop bag. */
|
|
122
|
+
Indicator: typeof RadioIndicator & {
|
|
123
|
+
props: typeof indicatorProps;
|
|
124
|
+
}; /** The labelled row pairing a radio with its label. `Radio.Field.props({ size })` → its spreadable prop bag. */
|
|
125
|
+
Field: typeof RadioField & {
|
|
126
|
+
props: typeof fieldProps;
|
|
127
|
+
}; /** The radio's visible accessible name. `Radio.Label.props({ disabled, invalid })` → its spreadable prop bag. */
|
|
128
|
+
Label: typeof RadioLabel & {
|
|
129
|
+
props: typeof labelProps;
|
|
130
|
+
}; /** Helper text wired to a radio via `aria-describedby`. `Radio.Description.props()` → its spreadable prop bag. */
|
|
131
|
+
Description: typeof RadioDescription & {
|
|
132
|
+
props: typeof descriptionProps;
|
|
133
|
+
}; /** A selectable card target. `Radio.Card.props({ controlPosition })` → its spreadable prop bag. */
|
|
134
|
+
Card: typeof RadioCard & {
|
|
135
|
+
props: typeof cardProps;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
declare namespace Radio {
|
|
139
|
+
/** Box size — re-points the box and dot edges. */
|
|
140
|
+
type Size = (typeof SIZES)[number];
|
|
141
|
+
/** Layout axis of a group — `vertical` stacks the radios, `horizontal` lays them in a row. */
|
|
142
|
+
type Orientation = "vertical" | "horizontal";
|
|
143
|
+
/** Where the radio sits in a `Radio.Card` relative to its content. */
|
|
144
|
+
type ControlPosition = "leading" | "trailing";
|
|
145
|
+
namespace Group {
|
|
146
|
+
/** Props for {@link Radio.Group} — Base UI's `RadioGroup` (string-valued) plus the Noctis axes. */
|
|
147
|
+
type Props = Omit<radio_group_d_exports.RadioGroup.Props<string>, "className"> & {
|
|
148
|
+
/** Box size of every radio. Defaults to `md`. */size?: Size; /** Layout axis — `horizontal` lays the radios in a row. Stamped as `data-orientation`. @default "vertical" */
|
|
149
|
+
orientation?: Orientation; /** Flag the group's value as invalid — cascades the danger border and sets `aria-invalid`. */
|
|
150
|
+
invalid?: boolean; /** Classes merged onto the group. */
|
|
151
|
+
className?: string;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
namespace Root {
|
|
155
|
+
/** Props for {@link Radio.Root} (the radio box) — Base UI's `Radio.Root` (string-valued). */
|
|
156
|
+
type Props = Omit<radio_d_exports.Radio.Root.Props<string>, "className"> & {
|
|
157
|
+
/** Classes merged onto the box. */className?: string;
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
namespace Indicator {
|
|
161
|
+
/** Props for {@link Radio.Indicator}. */
|
|
162
|
+
interface Props {
|
|
163
|
+
className?: string;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
namespace Field {
|
|
167
|
+
/** Props for {@link Radio.Field} — Base UI's `Field.Root` plus the Noctis `size` axis. */
|
|
168
|
+
interface Props extends field_d_exports.Field.Root.Props {
|
|
169
|
+
/** Row size — scales the label text and cascades to the box inside. Inherits the group's size when unset. */
|
|
170
|
+
size?: Size;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
namespace Label {
|
|
174
|
+
/** Props for {@link Radio.Label} — Base UI's `Field.Label`, the radio's visible accessible name. */
|
|
175
|
+
type Props = field_d_exports.Field.Label.Props;
|
|
176
|
+
}
|
|
177
|
+
namespace Description {
|
|
178
|
+
/** Props for {@link Radio.Description} — passthrough `span` props (set `id` to wire `aria-describedby`). */
|
|
179
|
+
type Props = ComponentPropsWithoutRef<"span">;
|
|
180
|
+
}
|
|
181
|
+
namespace Card {
|
|
182
|
+
/** Props for {@link Radio.Card} — a selectable card wrapping a `Radio.Root`. */
|
|
183
|
+
interface Props extends Omit<ComponentPropsWithoutRef<"label">, "children"> {
|
|
184
|
+
/** The value selected when this card is chosen. */
|
|
185
|
+
value: string;
|
|
186
|
+
/** Disable this card and its radio. */
|
|
187
|
+
disabled?: boolean;
|
|
188
|
+
/** Make this card's radio read-only. */
|
|
189
|
+
readOnly?: boolean;
|
|
190
|
+
/** Mark this card's radio as required. */
|
|
191
|
+
required?: boolean;
|
|
192
|
+
/** Where the radio sits relative to the content. @default "leading" */
|
|
193
|
+
controlPosition?: ControlPosition;
|
|
194
|
+
/**
|
|
195
|
+
* Hide the visible radio dot — the card's accent edge becomes the only selection signal (the
|
|
196
|
+
* input stays for keyboard/forms), for a Radix-style border-only card picker. @default false
|
|
197
|
+
*/
|
|
198
|
+
hideControl?: boolean;
|
|
199
|
+
/** The card's label and optional `Radio.Description`. */
|
|
200
|
+
children?: ReactNode;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
205
|
+
export { Radio };
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { radio_exports } from "../../primitives/radio.js";
|
|
3
|
+
import { radio_group_exports } from "../../primitives/radio-group.js";
|
|
4
|
+
import { field_exports } from "../../primitives/field.js";
|
|
5
|
+
import { RadioShapeContext } from "./radio.context.js";
|
|
6
|
+
import { RADIO_SLOTS } from "./radio.slots.js";
|
|
7
|
+
import { cardProps, descriptionProps, fieldProps, groupProps, indicatorProps, labelProps, radioProps } from "./radio.props.js";
|
|
8
|
+
import { use } from "react";
|
|
9
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/radio/radio.tsx
|
|
11
|
+
/**
|
|
12
|
+
* Owns the single selection for a set of radios. Built on Base UI's `RadioGroup`, so the contained
|
|
13
|
+
* radios share roving focus and arrow-key navigation, and exactly one is selected at a time. Spreads the
|
|
14
|
+
* Base UI surface through — `name` / `form` / `readOnly` / `required` / `onValueChange` all forward — so
|
|
15
|
+
* a group is a real form control. `orientation` lays the children out (vertical by default; `horizontal`
|
|
16
|
+
* is a row that mirrors under RTL); `invalid` flags the group's value as in error, cascading the danger
|
|
17
|
+
* border to every radio and announcing it via `aria-invalid`. Sets the shared box `size` once.
|
|
18
|
+
*/
|
|
19
|
+
function RadioGroupRoot({ size = "md", orientation = "vertical", invalid, className, children, ...props }) {
|
|
20
|
+
return /* @__PURE__ */ jsx(radio_group_exports.RadioGroup, {
|
|
21
|
+
"data-slot": RADIO_SLOTS.group,
|
|
22
|
+
"data-orientation": orientation,
|
|
23
|
+
"data-invalid": invalid ? "" : void 0,
|
|
24
|
+
"aria-orientation": orientation,
|
|
25
|
+
"aria-invalid": invalid || void 0,
|
|
26
|
+
className,
|
|
27
|
+
...props,
|
|
28
|
+
children: /* @__PURE__ */ jsx(RadioShapeContext, {
|
|
29
|
+
value: { size },
|
|
30
|
+
children
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* One selectable radio — a circular box that takes the accent border and fills with the accent dot when
|
|
36
|
+
* checked. Built on Base UI's `Radio.Root`, so it is keyboard-reachable, single-select, and announces
|
|
37
|
+
* its state. Base UI stamps the live `data-checked`/`data-unchecked`/`data-disabled`/`data-readonly` the
|
|
38
|
+
* CSS keys off; the render contributes the slot anchor and the `data-size` axis (inherited from the
|
|
39
|
+
* enclosing field/group), and nests the indicator dot. `readOnly` / `required` forward to Base UI. For
|
|
40
|
+
* a labelled control, compose `Radio.Field` + `Radio.Label` (the row wires the label to the box and
|
|
41
|
+
* holds the box↔label gap), mirroring `Checkbox.Field`.
|
|
42
|
+
*/
|
|
43
|
+
function RadioRoot({ className, children, ...props }) {
|
|
44
|
+
const { size } = use(RadioShapeContext);
|
|
45
|
+
return /* @__PURE__ */ jsxs(radio_exports.Radio.Root, {
|
|
46
|
+
"data-slot": RADIO_SLOTS.radio,
|
|
47
|
+
"data-size": size,
|
|
48
|
+
className,
|
|
49
|
+
...props,
|
|
50
|
+
children: [/* @__PURE__ */ jsx(RadioIndicator, {}), children]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The accent dot shown inside a checked radio. Built on Base UI's `Radio.Indicator` with `keepMounted`,
|
|
55
|
+
* so it stays in the DOM and the CSS can scale / fade it in on select (and out on de-select) off the
|
|
56
|
+
* `data-starting-style`/`data-ending-style` hooks. `Radio.Root` renders it automatically.
|
|
57
|
+
*/
|
|
58
|
+
function RadioIndicator({ className } = {}) {
|
|
59
|
+
return /* @__PURE__ */ jsx(radio_exports.Radio.Indicator, {
|
|
60
|
+
"data-slot": RADIO_SLOTS.indicator,
|
|
61
|
+
keepMounted: true,
|
|
62
|
+
className
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The labelled row — pairs a `Radio.Label` with a `Radio.Root` so the pairing reads as one control,
|
|
67
|
+
* mirroring `Checkbox.Field`. Renders Base UI's `Field.Root`, which links the label to the box (clicking
|
|
68
|
+
* the label selects it, the label becomes the accessible name). Lay the label and box in either DOM
|
|
69
|
+
* order; the row mirrors under RTL by construction and holds the box↔label gap seam. Size flows from an
|
|
70
|
+
* enclosing `Radio.Group` unless this field sets its own, and cascades to the box through context.
|
|
71
|
+
*
|
|
72
|
+
* <Radio.Field>
|
|
73
|
+
* <Radio.Root value="comfortable" />
|
|
74
|
+
* <Radio.Label>Comfortable</Radio.Label>
|
|
75
|
+
* </Radio.Field>
|
|
76
|
+
*/
|
|
77
|
+
function RadioField({ size, className, children, ...props }) {
|
|
78
|
+
const inherited = use(RadioShapeContext);
|
|
79
|
+
const resolvedSize = size ?? inherited.size;
|
|
80
|
+
return /* @__PURE__ */ jsx(RadioShapeContext, {
|
|
81
|
+
value: { size: resolvedSize },
|
|
82
|
+
children: /* @__PURE__ */ jsx(field_exports.Field.Root, {
|
|
83
|
+
"data-slot": RADIO_SLOTS.field,
|
|
84
|
+
"data-size": resolvedSize,
|
|
85
|
+
className,
|
|
86
|
+
...props,
|
|
87
|
+
children
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The visible label that names a radio inside a `Radio.Field`. Renders Base UI's `Field.Label`, so
|
|
93
|
+
* clicking it selects the box and its text supplies the accessible name (no `aria-label` needed). It
|
|
94
|
+
* mirrors the field's disabled and invalid state through `data-disabled`/`data-invalid`.
|
|
95
|
+
*/
|
|
96
|
+
function RadioLabel({ className, children, ...props }) {
|
|
97
|
+
return /* @__PURE__ */ jsx(field_exports.Field.Label, {
|
|
98
|
+
"data-slot": RADIO_SLOTS.label,
|
|
99
|
+
className,
|
|
100
|
+
...props,
|
|
101
|
+
children
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Helper text for a radio, wired to it via `aria-describedby` (the consumer sets a matching `id`). Muted,
|
|
106
|
+
* small text offset below the label by the description gap — turns a bare dot + label into a real field
|
|
107
|
+
* row without forcing a card.
|
|
108
|
+
*/
|
|
109
|
+
function RadioDescription({ className, children, ...props }) {
|
|
110
|
+
return /* @__PURE__ */ jsx("span", {
|
|
111
|
+
"data-slot": RADIO_SLOTS.description,
|
|
112
|
+
className,
|
|
113
|
+
...props,
|
|
114
|
+
children
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A selectable card: a sharp bordered target wrapping a `Radio.Root` (in a `<label>`, so the whole card
|
|
119
|
+
* toggles) plus its label and optional `Radio.Description`. Selecting it tints the card edge to the
|
|
120
|
+
* accent (signal); hover is a neutral surface shift and the focus ring moves to the card. The control
|
|
121
|
+
* sits at the leading edge by default, or the trailing edge via `controlPosition`. The dot stays a true
|
|
122
|
+
* circle. Set `hideControl` to drop the visible dot entirely — the card's accent edge becomes the sole
|
|
123
|
+
* selection signal (the radio input stays for keyboard + forms), for a clean Radix-style card picker. A
|
|
124
|
+
* composition, not a new engine primitive — it reuses the surface roles.
|
|
125
|
+
*/
|
|
126
|
+
function RadioCard({ value, disabled, readOnly, required, controlPosition = "leading", hideControl = false, className, children, ...props }) {
|
|
127
|
+
const radio = /* @__PURE__ */ jsx(RadioRoot, {
|
|
128
|
+
value,
|
|
129
|
+
disabled,
|
|
130
|
+
readOnly,
|
|
131
|
+
required
|
|
132
|
+
});
|
|
133
|
+
return /* @__PURE__ */ jsx("label", {
|
|
134
|
+
"data-slot": RADIO_SLOTS.card,
|
|
135
|
+
"data-control": controlPosition,
|
|
136
|
+
"data-control-hidden": hideControl ? "" : void 0,
|
|
137
|
+
className,
|
|
138
|
+
...props,
|
|
139
|
+
children: controlPosition === "leading" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [radio, children] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [children, radio] })
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* A single-select set of radios. Compose `Radio.Group` (owns the value) with `Radio.Root`s. Built on
|
|
144
|
+
* Base UI's `RadioGroup`/`Radio` for selection, roving focus, and a11y. Pair each radio with a label
|
|
145
|
+
* (a `<label>` wrapper or an `id`/`aria-labelledby` link), add a `Radio.Description` for helper text, or
|
|
146
|
+
* reach for `Radio.Card` for a selectable card target.
|
|
147
|
+
*
|
|
148
|
+
* Per-part `props(...)` builders expose the same slot/data-attribute mapping as spreadable statics for
|
|
149
|
+
* the escape-hatch path (D12).
|
|
150
|
+
*/
|
|
151
|
+
const Radio = {
|
|
152
|
+
/** The group that owns the selection. `Radio.Group.props({ orientation, invalid, disabled })` → its spreadable prop bag. */
|
|
153
|
+
Group: Object.assign(RadioGroupRoot, { props: groupProps }),
|
|
154
|
+
/** One selectable radio box. `Radio.Root.props({ size, checked, disabled, readonly, invalid })` → its spreadable prop bag. */
|
|
155
|
+
Root: Object.assign(RadioRoot, { props: radioProps }),
|
|
156
|
+
/** The accent dot. `Radio.Indicator.props({ checked })` → its spreadable prop bag. */
|
|
157
|
+
Indicator: Object.assign(RadioIndicator, { props: indicatorProps }),
|
|
158
|
+
/** The labelled row pairing a radio with its label. `Radio.Field.props({ size })` → its spreadable prop bag. */
|
|
159
|
+
Field: Object.assign(RadioField, { props: fieldProps }),
|
|
160
|
+
/** The radio's visible accessible name. `Radio.Label.props({ disabled, invalid })` → its spreadable prop bag. */
|
|
161
|
+
Label: Object.assign(RadioLabel, { props: labelProps }),
|
|
162
|
+
/** Helper text wired to a radio via `aria-describedby`. `Radio.Description.props()` → its spreadable prop bag. */
|
|
163
|
+
Description: Object.assign(RadioDescription, { props: descriptionProps }),
|
|
164
|
+
/** A selectable card target. `Radio.Card.props({ controlPosition })` → its spreadable prop bag. */
|
|
165
|
+
Card: Object.assign(RadioCard, { props: cardProps })
|
|
166
|
+
};
|
|
167
|
+
//#endregion
|
|
168
|
+
export { Radio };
|