@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,45 @@
|
|
|
1
|
+
import { MENUBAR_SLOTS } from "./menubar.slots.js";
|
|
2
|
+
//#region src/components/menubar/menubar.props.ts
|
|
3
|
+
/**
|
|
4
|
+
* The D12 unified variant contract for Menubar — a per-part set of `props(...)` builders that each
|
|
5
|
+
* return a **spreadable props object** of the form `{ "data-slot": "noctis-menubar-<part>", ...dataAttrs }`,
|
|
6
|
+
* derived from the part's variant/state inputs.
|
|
7
|
+
*
|
|
8
|
+
* Under the single-`data-slot` anchor model the `data-slot` is the only styling hook needed —
|
|
9
|
+
* `menubar.css` keys every rule off it — so spreading a part's `props()` onto a *foreign* element
|
|
10
|
+
* styles it as that part:
|
|
11
|
+
*
|
|
12
|
+
* <div {...Menubar.Root.props({ size: "md" })}>…</div>
|
|
13
|
+
* // → <div data-slot="noctis-menubar" data-size="md">
|
|
14
|
+
* <button {...Menubar.Trigger.props({ open: true })}>File</button>
|
|
15
|
+
* // → <button data-slot="noctis-menubar-trigger" data-popup-open="">
|
|
16
|
+
*
|
|
17
|
+
* The escape hatch carries no className (styling is attribute-driven); an optional `className`
|
|
18
|
+
* passthrough is accepted and forwarded verbatim. The same variant→data-attribute→values mapping is
|
|
19
|
+
* emitted as data from the token graph (`generated/declarations.json` → `variantSchema`) so non-React /
|
|
20
|
+
* agent consumers can hand-write the markup from the docs.
|
|
21
|
+
*/
|
|
22
|
+
/** Stamp a boolean state as a bare data-attribute: present (`""`) when on, absent (`undefined`) when off. */
|
|
23
|
+
const flag = (on) => on ? "" : void 0;
|
|
24
|
+
const withClassName = (bag, className) => className === void 0 ? bag : {
|
|
25
|
+
...bag,
|
|
26
|
+
className
|
|
27
|
+
};
|
|
28
|
+
/** Root (bar) prop bag: the slot anchor plus the `data-size` axis the trigger metrics re-point off. */
|
|
29
|
+
function rootProps({ size = "md", className } = {}) {
|
|
30
|
+
return withClassName({
|
|
31
|
+
"data-slot": MENUBAR_SLOTS.root,
|
|
32
|
+
"data-size": size
|
|
33
|
+
}, className);
|
|
34
|
+
}
|
|
35
|
+
/** Trigger prop bag: the slot anchor plus the `data-popup-open`/`data-highlighted`/`data-disabled` state. */
|
|
36
|
+
function triggerProps({ open, highlighted, disabled, className } = {}) {
|
|
37
|
+
return withClassName({
|
|
38
|
+
"data-slot": MENUBAR_SLOTS.trigger,
|
|
39
|
+
"data-popup-open": flag(open),
|
|
40
|
+
"data-highlighted": flag(highlighted),
|
|
41
|
+
"data-disabled": flag(disabled)
|
|
42
|
+
}, className);
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { rootProps, triggerProps };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/components/menubar/menubar.slots.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The `data-*` hooks `Menubar` stamps on its parts, for host-side styling and tests. Slot values mark
|
|
4
|
+
* each rendered element; the state attributes are emitted by Base UI's Menubar/Menu — pair a slot with
|
|
5
|
+
* a state to target, say, the trigger only while its menu is open.
|
|
6
|
+
*/
|
|
7
|
+
declare enum MenubarDataAttributes {
|
|
8
|
+
/** The bar element (and, with `data-slot=noctis-menubar-trigger`, each top-level trigger). */
|
|
9
|
+
slot = "data-slot",
|
|
10
|
+
/** The bar's layout axis (`horizontal`/`vertical`), mirroring the root's `orientation` prop. */
|
|
11
|
+
orientation = "data-orientation",
|
|
12
|
+
/** The bar's size step (`sm`/`md`/`lg`), driving the trigger metrics re-point. */
|
|
13
|
+
size = "data-size",
|
|
14
|
+
/** Present on the bar while any of its menus is open. */
|
|
15
|
+
hasSubmenuOpen = "data-has-submenu-open",
|
|
16
|
+
/** Present on a top-level trigger whose menu is open. */
|
|
17
|
+
popupOpen = "data-popup-open",
|
|
18
|
+
/** Present on the top-level trigger the pointer or keyboard is currently over. */
|
|
19
|
+
highlighted = "data-highlighted",
|
|
20
|
+
/** Present on a disabled top-level trigger. */
|
|
21
|
+
disabled = "data-disabled",
|
|
22
|
+
/** Present on the icon-only overflow trigger (`Menubar.Overflow`); squares it off for the lone glyph. */
|
|
23
|
+
overflow = "data-overflow"
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { MenubarDataAttributes };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//#region src/components/menubar/menubar.slots.ts
|
|
2
|
+
/**
|
|
3
|
+
* The slot vocabulary every `Menubar` part stamps as its `data-slot`. The authored source the
|
|
4
|
+
* orchestration file reads from, prefixed `noctis-{component}-{part}` (the precompiled `menubar.css`
|
|
5
|
+
* keys every rule off these anchors); SLOTS.md still generates from the token-graph declarations.
|
|
6
|
+
*
|
|
7
|
+
* The menus that drop from each trigger are the on-main `Menu` component's parts — Menubar owns only
|
|
8
|
+
* the bar (`root`) and its top-level `trigger`s; the popup content, items, groups, separators, and
|
|
9
|
+
* shortcuts are stamped and styled by `Menu`/`menu.css` (one visual language).
|
|
10
|
+
*/
|
|
11
|
+
const MENUBAR_SLOTS = {
|
|
12
|
+
root: "noctis-menubar",
|
|
13
|
+
trigger: "noctis-menubar-trigger"
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The `data-*` hooks `Menubar` stamps on its parts, for host-side styling and tests. Slot values mark
|
|
17
|
+
* each rendered element; the state attributes are emitted by Base UI's Menubar/Menu — pair a slot with
|
|
18
|
+
* a state to target, say, the trigger only while its menu is open.
|
|
19
|
+
*/
|
|
20
|
+
let MenubarDataAttributes = /* @__PURE__ */ function(MenubarDataAttributes) {
|
|
21
|
+
/** The bar element (and, with `data-slot=noctis-menubar-trigger`, each top-level trigger). */
|
|
22
|
+
MenubarDataAttributes["slot"] = "data-slot";
|
|
23
|
+
/** The bar's layout axis (`horizontal`/`vertical`), mirroring the root's `orientation` prop. */
|
|
24
|
+
MenubarDataAttributes["orientation"] = "data-orientation";
|
|
25
|
+
/** The bar's size step (`sm`/`md`/`lg`), driving the trigger metrics re-point. */
|
|
26
|
+
MenubarDataAttributes["size"] = "data-size";
|
|
27
|
+
/** Present on the bar while any of its menus is open. */
|
|
28
|
+
MenubarDataAttributes["hasSubmenuOpen"] = "data-has-submenu-open";
|
|
29
|
+
/** Present on a top-level trigger whose menu is open. */
|
|
30
|
+
MenubarDataAttributes["popupOpen"] = "data-popup-open";
|
|
31
|
+
/** Present on the top-level trigger the pointer or keyboard is currently over. */
|
|
32
|
+
MenubarDataAttributes["highlighted"] = "data-highlighted";
|
|
33
|
+
/** Present on a disabled top-level trigger. */
|
|
34
|
+
MenubarDataAttributes["disabled"] = "data-disabled";
|
|
35
|
+
/** Present on the icon-only overflow trigger (`Menubar.Overflow`); squares it off for the lone glyph. */
|
|
36
|
+
MenubarDataAttributes["overflow"] = "data-overflow";
|
|
37
|
+
return MenubarDataAttributes;
|
|
38
|
+
}({});
|
|
39
|
+
//#endregion
|
|
40
|
+
export { MENUBAR_SLOTS, MenubarDataAttributes };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/components/meter/meter.context.d.ts
|
|
2
|
+
/** Status tint of the reading — `neutral` by default; the others tint the indicator to a status role. */
|
|
3
|
+
type MeterTone = "neutral" | "success" | "warning" | "danger";
|
|
4
|
+
/** Track thickness — `sm` or `md`. */
|
|
5
|
+
type MeterSize = "sm" | "md";
|
|
6
|
+
/** Caption placement — `top` (header row above the track) or `side` (inline beside it). */
|
|
7
|
+
type MeterLabels = "top" | "side";
|
|
8
|
+
//#endregion
|
|
9
|
+
export { MeterLabels, MeterSize, MeterTone };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, use } from "react";
|
|
3
|
+
//#region src/components/meter/meter.context.ts
|
|
4
|
+
const MeterContext = createContext(null);
|
|
5
|
+
const MeterProvider = MeterContext.Provider;
|
|
6
|
+
/** Read the meter context, throwing a named error when a part renders outside `Meter.Root`. */
|
|
7
|
+
function useMeterContext(part) {
|
|
8
|
+
const context = use(MeterContext);
|
|
9
|
+
if (context === null) throw new Error(`Meter.${part} must be rendered inside <Meter.Root>.`);
|
|
10
|
+
return context;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { MeterProvider, useMeterContext };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { Meter as Meter$1 } from "../../primitives/meter/meter.js";
|
|
2
|
+
import { MeterLabels, MeterSize, MeterTone } from "./meter.context.js";
|
|
3
|
+
import { MeterPartProps, MeterRootPropsArgs, indicatorProps, labelProps, rootProps, trackProps, valueProps } from "./meter.props.js";
|
|
4
|
+
import { ReactElement, ReactNode } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/meter/meter.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Owns the measured value and shares the resolved `tone`/`size`/`labels` with the bar. Pass `value`
|
|
9
|
+
* (and optionally `min`/`max`, default `0`–`100`) for the reading. Tone is resolved in this order:
|
|
10
|
+
* an explicit `tone` wins; otherwise, when `optimum` is set, it is derived from the HTML `<meter>`
|
|
11
|
+
* threshold zones (`low`/`high`/`optimum`); otherwise it stays `neutral`. Compose `Meter.Track`
|
|
12
|
+
* (holding a `Meter.Indicator`) with optional `Meter.Label` + `Meter.Value`.
|
|
13
|
+
*/
|
|
14
|
+
declare function MeterRoot({
|
|
15
|
+
tone,
|
|
16
|
+
size,
|
|
17
|
+
labels,
|
|
18
|
+
low,
|
|
19
|
+
high,
|
|
20
|
+
optimum,
|
|
21
|
+
thickness,
|
|
22
|
+
value,
|
|
23
|
+
min,
|
|
24
|
+
max,
|
|
25
|
+
getAriaValueText,
|
|
26
|
+
"aria-valuetext": ariaValueText,
|
|
27
|
+
className,
|
|
28
|
+
style,
|
|
29
|
+
children,
|
|
30
|
+
...props
|
|
31
|
+
}: Meter.Root.Props): ReactElement;
|
|
32
|
+
/** The groove the indicator fills against. Holds a single `Meter.Indicator`. */
|
|
33
|
+
declare function MeterTrack({
|
|
34
|
+
className,
|
|
35
|
+
...props
|
|
36
|
+
}: Meter.Track.Props): ReactElement;
|
|
37
|
+
/** The filled portion, sized to the value by Base UI; its fill colour follows the root's `tone`. */
|
|
38
|
+
declare function MeterIndicator({
|
|
39
|
+
className,
|
|
40
|
+
...props
|
|
41
|
+
}: Meter.Indicator.Props): ReactElement;
|
|
42
|
+
/** The meter's visible caption. Pair it with a `Meter.Value` in a row for a labelled reading. */
|
|
43
|
+
declare function MeterLabel({
|
|
44
|
+
className,
|
|
45
|
+
...props
|
|
46
|
+
}: Meter.Label.Props): ReactElement;
|
|
47
|
+
/** The formatted value text, localized via the injected locale. Pass `format` on the root to style it. */
|
|
48
|
+
declare function MeterValue({
|
|
49
|
+
className,
|
|
50
|
+
...props
|
|
51
|
+
}: Meter.Value.Props): ReactElement;
|
|
52
|
+
/**
|
|
53
|
+
* A meter: a static measurement shown as a filled bar within a known range — disk usage, battery,
|
|
54
|
+
* a score, remaining quota. Unlike a progress bar it reports a settled reading, not an ongoing task.
|
|
55
|
+
* Declare `low`/`high`/`optimum` and the fill tone is *derived* from the HTML `<meter>` zone model
|
|
56
|
+
* (`success`/`warning`/`danger`), so consumers stop hand-writing traffic-light logic; an explicit
|
|
57
|
+
* `tone` still overrides. Built on Base UI's Meter, so the value carries the correct `meter` role and
|
|
58
|
+
* `aria-valuenow` for assistive tech, the readout formats for the reader's locale, and the fill is
|
|
59
|
+
* RTL-aware; when a status tone is in play it also defaults a localized `aria-valuetext` so the status
|
|
60
|
+
* is announced, not just shown.
|
|
61
|
+
*
|
|
62
|
+
* Compose from parts: `Meter.Root` owns the value and the shared `tone`/`size`/`labels`, `Meter.Track`
|
|
63
|
+
* holds a single `Meter.Indicator`, and optional `Meter.Label` + `Meter.Value` caption the reading —
|
|
64
|
+
* the root lays them out above (`labels="top"`) or beside (`labels="side"`) the track.
|
|
65
|
+
*
|
|
66
|
+
* The runtime compound is a plain object (kept tree-shakeable); per-part prop and state types are
|
|
67
|
+
* exposed through the matching `Meter` namespace — e.g. `Meter.Value.Props`.
|
|
68
|
+
*/
|
|
69
|
+
declare const Meter: {
|
|
70
|
+
/** Owns the value and the shared tone/size/labels. `Meter.Root.props({ tone, size, labels })` → its spreadable prop bag. */Root: typeof MeterRoot & {
|
|
71
|
+
props: typeof rootProps;
|
|
72
|
+
}; /** The bar groove. `Meter.Track.props()` → its spreadable prop bag. */
|
|
73
|
+
Track: typeof MeterTrack & {
|
|
74
|
+
props: typeof trackProps;
|
|
75
|
+
}; /** The filled portion. `Meter.Indicator.props()` → its spreadable prop bag. */
|
|
76
|
+
Indicator: typeof MeterIndicator & {
|
|
77
|
+
props: typeof indicatorProps;
|
|
78
|
+
}; /** The caption label. `Meter.Label.props()` → its spreadable prop bag. */
|
|
79
|
+
Label: typeof MeterLabel & {
|
|
80
|
+
props: typeof labelProps;
|
|
81
|
+
}; /** The formatted value text. `Meter.Value.props()` → its spreadable prop bag. */
|
|
82
|
+
Value: typeof MeterValue & {
|
|
83
|
+
props: typeof valueProps;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Per-part prop and state types, mirroring Base UI's `Component.Part.Props` convention. Types-only —
|
|
88
|
+
* it emits no runtime code and merges with the `Meter` object above, so `Meter.Value` is the component
|
|
89
|
+
* value while `Meter.Value.Props` is its prop type.
|
|
90
|
+
*/
|
|
91
|
+
declare namespace Meter {
|
|
92
|
+
/** Status tint of the reading — `neutral`, `success`, `warning`, or `danger`. */
|
|
93
|
+
type Tone = MeterTone;
|
|
94
|
+
/** Track thickness — `sm` or `md`. */
|
|
95
|
+
type Size = MeterSize;
|
|
96
|
+
/** Caption placement — `top` or `side`. */
|
|
97
|
+
type Labels = MeterLabels;
|
|
98
|
+
/** The spreadable data-attribute prop bag every `Meter.*.props()` returns (D12). */
|
|
99
|
+
type PartProps = MeterPartProps;
|
|
100
|
+
namespace Root {
|
|
101
|
+
type Props = Omit<Meter$1.Root.Props, "className" | "children"> & {
|
|
102
|
+
/**
|
|
103
|
+
* Status tint of the reading. Wins over any threshold-derived tone; omit it to derive the
|
|
104
|
+
* tone from `optimum` (or to stay `neutral` when no thresholds are set).
|
|
105
|
+
*/
|
|
106
|
+
tone?: MeterTone;
|
|
107
|
+
/**
|
|
108
|
+
* Track thickness preset.
|
|
109
|
+
* @default "md"
|
|
110
|
+
*/
|
|
111
|
+
size?: MeterSize;
|
|
112
|
+
/**
|
|
113
|
+
* Caption placement — a header row above the track (`top`) or inline beside it (`side`).
|
|
114
|
+
* @default "top"
|
|
115
|
+
*/
|
|
116
|
+
labels?: MeterLabels;
|
|
117
|
+
/**
|
|
118
|
+
* The low boundary of the threshold model (HTML `<meter>` parity).
|
|
119
|
+
* @default min
|
|
120
|
+
*/
|
|
121
|
+
low?: number;
|
|
122
|
+
/**
|
|
123
|
+
* The high boundary of the threshold model; also where the optional marker is drawn.
|
|
124
|
+
* @default max
|
|
125
|
+
*/
|
|
126
|
+
high?: number;
|
|
127
|
+
/**
|
|
128
|
+
* The ideal point. Setting it turns on tone derivation: its position relative to
|
|
129
|
+
* `low`/`high` decides which region is healthy, so the fill turns `success`/`warning`/
|
|
130
|
+
* `danger` automatically. An explicit `tone` overrides the derived one.
|
|
131
|
+
*/
|
|
132
|
+
optimum?: number;
|
|
133
|
+
/**
|
|
134
|
+
* An explicit track thickness, overriding the `size` preset (and the radius-aware default).
|
|
135
|
+
* A number is treated as `px`; a string is any CSS length. Writes the public track
|
|
136
|
+
* block-size override var.
|
|
137
|
+
*/
|
|
138
|
+
thickness?: number | string; /** `Meter.Label`, `Meter.Value`, and the `Meter.Track`. */
|
|
139
|
+
children?: ReactNode; /** Classes merged onto the root. */
|
|
140
|
+
className?: string;
|
|
141
|
+
};
|
|
142
|
+
/** Argument to the `Meter.Root.props(...)` escape-hatch helper. */
|
|
143
|
+
type PropsArgs = MeterRootPropsArgs;
|
|
144
|
+
}
|
|
145
|
+
namespace Track {
|
|
146
|
+
type Props = Meter$1.Track.Props;
|
|
147
|
+
type State = Meter$1.Track.State;
|
|
148
|
+
}
|
|
149
|
+
namespace Indicator {
|
|
150
|
+
type Props = Meter$1.Indicator.Props;
|
|
151
|
+
type State = Meter$1.Indicator.State;
|
|
152
|
+
}
|
|
153
|
+
namespace Label {
|
|
154
|
+
type Props = Meter$1.Label.Props;
|
|
155
|
+
type State = Meter$1.Label.State;
|
|
156
|
+
}
|
|
157
|
+
namespace Value {
|
|
158
|
+
type Props = Meter$1.Value.Props;
|
|
159
|
+
type State = Meter$1.Value.State;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
163
|
+
export { Meter };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useNoctisStringFormatter } from "../../core/use-injected-labels.js";
|
|
3
|
+
import { deriveThresholdTone } from "../../core/derive-threshold-tone.js";
|
|
4
|
+
import { Meter as Meter$1 } from "../../primitives/meter/meter.js";
|
|
5
|
+
import { MeterProvider, useMeterContext } from "./meter.context.js";
|
|
6
|
+
import { indicatorProps, labelProps, rootProps, trackProps, valueProps } from "./meter.props.js";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/meter/meter.tsx
|
|
9
|
+
/**
|
|
10
|
+
* Owns the measured value and shares the resolved `tone`/`size`/`labels` with the bar. Pass `value`
|
|
11
|
+
* (and optionally `min`/`max`, default `0`–`100`) for the reading. Tone is resolved in this order:
|
|
12
|
+
* an explicit `tone` wins; otherwise, when `optimum` is set, it is derived from the HTML `<meter>`
|
|
13
|
+
* threshold zones (`low`/`high`/`optimum`); otherwise it stays `neutral`. Compose `Meter.Track`
|
|
14
|
+
* (holding a `Meter.Indicator`) with optional `Meter.Label` + `Meter.Value`.
|
|
15
|
+
*/
|
|
16
|
+
function MeterRoot({ tone, size = "md", labels = "top", low, high, optimum, thickness, value, min = 0, max = 100, getAriaValueText, "aria-valuetext": ariaValueText, className, style, children, ...props }) {
|
|
17
|
+
const formatter = useNoctisStringFormatter();
|
|
18
|
+
const resolvedTone = tone ?? (optimum !== void 0 && typeof value === "number" ? deriveThresholdTone({
|
|
19
|
+
value,
|
|
20
|
+
min,
|
|
21
|
+
max,
|
|
22
|
+
low,
|
|
23
|
+
high,
|
|
24
|
+
optimum
|
|
25
|
+
}) : "neutral");
|
|
26
|
+
const autoValueText = resolvedTone !== "neutral" && ariaValueText === void 0 && getAriaValueText === void 0 ? (formattedValue) => formatter.format("meter.valueText", {
|
|
27
|
+
value: formattedValue,
|
|
28
|
+
status: resolvedTone
|
|
29
|
+
}) : void 0;
|
|
30
|
+
const showMarker = optimum !== void 0 && high !== void 0 && high > min && high < max;
|
|
31
|
+
const rootStyle = {
|
|
32
|
+
...thickness !== void 0 && { "--noctis-meter-track-block-size": typeof thickness === "number" ? `${thickness}px` : thickness },
|
|
33
|
+
...showMarker && { "--meter-threshold": `${(high - min) / (max - min) * 100}%` },
|
|
34
|
+
...style
|
|
35
|
+
};
|
|
36
|
+
const valueTextProps = ariaValueText !== void 0 ? { "aria-valuetext": ariaValueText } : getAriaValueText ? { getAriaValueText } : autoValueText ? { getAriaValueText: autoValueText } : {};
|
|
37
|
+
return /* @__PURE__ */ jsx(Meter$1.Root, {
|
|
38
|
+
"data-tone": resolvedTone,
|
|
39
|
+
"data-size": size,
|
|
40
|
+
"data-labels": labels,
|
|
41
|
+
"data-threshold-marker": showMarker ? "" : void 0,
|
|
42
|
+
value,
|
|
43
|
+
min,
|
|
44
|
+
max,
|
|
45
|
+
className,
|
|
46
|
+
style: rootStyle,
|
|
47
|
+
...valueTextProps,
|
|
48
|
+
...props,
|
|
49
|
+
children: /* @__PURE__ */ jsx(MeterProvider, {
|
|
50
|
+
value: {
|
|
51
|
+
tone: resolvedTone,
|
|
52
|
+
size,
|
|
53
|
+
labels
|
|
54
|
+
},
|
|
55
|
+
children
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/** The groove the indicator fills against. Holds a single `Meter.Indicator`. */
|
|
60
|
+
function MeterTrack({ className, ...props }) {
|
|
61
|
+
useMeterContext("Track");
|
|
62
|
+
return /* @__PURE__ */ jsx(Meter$1.Track, {
|
|
63
|
+
className,
|
|
64
|
+
...props
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/** The filled portion, sized to the value by Base UI; its fill colour follows the root's `tone`. */
|
|
68
|
+
function MeterIndicator({ className, ...props }) {
|
|
69
|
+
useMeterContext("Indicator");
|
|
70
|
+
return /* @__PURE__ */ jsx(Meter$1.Indicator, {
|
|
71
|
+
className,
|
|
72
|
+
...props
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/** The meter's visible caption. Pair it with a `Meter.Value` in a row for a labelled reading. */
|
|
76
|
+
function MeterLabel({ className, ...props }) {
|
|
77
|
+
useMeterContext("Label");
|
|
78
|
+
return /* @__PURE__ */ jsx(Meter$1.Label, {
|
|
79
|
+
className,
|
|
80
|
+
...props
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/** The formatted value text, localized via the injected locale. Pass `format` on the root to style it. */
|
|
84
|
+
function MeterValue({ className, ...props }) {
|
|
85
|
+
useMeterContext("Value");
|
|
86
|
+
return /* @__PURE__ */ jsx(Meter$1.Value, {
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A meter: a static measurement shown as a filled bar within a known range — disk usage, battery,
|
|
93
|
+
* a score, remaining quota. Unlike a progress bar it reports a settled reading, not an ongoing task.
|
|
94
|
+
* Declare `low`/`high`/`optimum` and the fill tone is *derived* from the HTML `<meter>` zone model
|
|
95
|
+
* (`success`/`warning`/`danger`), so consumers stop hand-writing traffic-light logic; an explicit
|
|
96
|
+
* `tone` still overrides. Built on Base UI's Meter, so the value carries the correct `meter` role and
|
|
97
|
+
* `aria-valuenow` for assistive tech, the readout formats for the reader's locale, and the fill is
|
|
98
|
+
* RTL-aware; when a status tone is in play it also defaults a localized `aria-valuetext` so the status
|
|
99
|
+
* is announced, not just shown.
|
|
100
|
+
*
|
|
101
|
+
* Compose from parts: `Meter.Root` owns the value and the shared `tone`/`size`/`labels`, `Meter.Track`
|
|
102
|
+
* holds a single `Meter.Indicator`, and optional `Meter.Label` + `Meter.Value` caption the reading —
|
|
103
|
+
* the root lays them out above (`labels="top"`) or beside (`labels="side"`) the track.
|
|
104
|
+
*
|
|
105
|
+
* The runtime compound is a plain object (kept tree-shakeable); per-part prop and state types are
|
|
106
|
+
* exposed through the matching `Meter` namespace — e.g. `Meter.Value.Props`.
|
|
107
|
+
*/
|
|
108
|
+
const Meter = {
|
|
109
|
+
/** Owns the value and the shared tone/size/labels. `Meter.Root.props({ tone, size, labels })` → its spreadable prop bag. */
|
|
110
|
+
Root: Object.assign(MeterRoot, { props: rootProps }),
|
|
111
|
+
/** The bar groove. `Meter.Track.props()` → its spreadable prop bag. */
|
|
112
|
+
Track: Object.assign(MeterTrack, { props: trackProps }),
|
|
113
|
+
/** The filled portion. `Meter.Indicator.props()` → its spreadable prop bag. */
|
|
114
|
+
Indicator: Object.assign(MeterIndicator, { props: indicatorProps }),
|
|
115
|
+
/** The caption label. `Meter.Label.props()` → its spreadable prop bag. */
|
|
116
|
+
Label: Object.assign(MeterLabel, { props: labelProps }),
|
|
117
|
+
/** The formatted value text. `Meter.Value.props()` → its spreadable prop bag. */
|
|
118
|
+
Value: Object.assign(MeterValue, { props: valueProps })
|
|
119
|
+
};
|
|
120
|
+
//#endregion
|
|
121
|
+
export { Meter };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { MeterLabels, MeterSize, MeterTone } from "./meter.context.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/meter/meter.props.d.ts
|
|
4
|
+
/** A spreadable data-attribute prop bag — the shape every `Meter.*.props()` returns. */
|
|
5
|
+
type MeterPartProps = {
|
|
6
|
+
/** The slot value the matching `meter.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 carrying a value, or absent (`undefined`) when it does not apply. */
|
|
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 `Meter.Root.props(...)` — the reading's tone, track size, and caption placement, stamped on the root. */
|
|
16
|
+
interface MeterRootPropsArgs extends BasePropsArgs {
|
|
17
|
+
/** Status tint of the reading (the resolved tone, after any threshold derivation). @default "neutral" */
|
|
18
|
+
tone?: MeterTone;
|
|
19
|
+
/** Track thickness — `sm` or `md`. @default "md" */
|
|
20
|
+
size?: MeterSize;
|
|
21
|
+
/** Caption placement — `top` or `side`. @default "top" */
|
|
22
|
+
labels?: MeterLabels;
|
|
23
|
+
}
|
|
24
|
+
/** Argument to a stateless part's `.props(...)` — no axes of its own; look flows from the root. */
|
|
25
|
+
type MeterStatelessPropsArgs = BasePropsArgs;
|
|
26
|
+
/** Root prop bag: `data-slot` plus the `data-tone`/`data-size`/`data-labels` the descendant rules read. */
|
|
27
|
+
declare function rootProps({
|
|
28
|
+
tone,
|
|
29
|
+
size,
|
|
30
|
+
labels,
|
|
31
|
+
className
|
|
32
|
+
}?: MeterRootPropsArgs): MeterPartProps;
|
|
33
|
+
/** Track prop bag: just the slot anchor (its fill/thickness flow from the root). */
|
|
34
|
+
declare function trackProps({
|
|
35
|
+
className
|
|
36
|
+
}?: MeterStatelessPropsArgs): MeterPartProps;
|
|
37
|
+
/** Indicator prop bag: just the slot anchor (its fill colour flows from the root tone). */
|
|
38
|
+
declare function indicatorProps({
|
|
39
|
+
className
|
|
40
|
+
}?: MeterStatelessPropsArgs): MeterPartProps;
|
|
41
|
+
/** Label prop bag: just the slot anchor. */
|
|
42
|
+
declare function labelProps({
|
|
43
|
+
className
|
|
44
|
+
}?: MeterStatelessPropsArgs): MeterPartProps;
|
|
45
|
+
/** Value prop bag: just the slot anchor. */
|
|
46
|
+
declare function valueProps({
|
|
47
|
+
className
|
|
48
|
+
}?: MeterStatelessPropsArgs): MeterPartProps;
|
|
49
|
+
//#endregion
|
|
50
|
+
export { MeterPartProps, MeterRootPropsArgs, indicatorProps, labelProps, rootProps, trackProps, valueProps };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { METER_SLOTS } from "./meter.slots.js";
|
|
2
|
+
//#region src/components/meter/meter.props.ts
|
|
3
|
+
const withClassName = (bag, className) => className === void 0 ? bag : {
|
|
4
|
+
...bag,
|
|
5
|
+
className
|
|
6
|
+
};
|
|
7
|
+
/** Root prop bag: `data-slot` plus the `data-tone`/`data-size`/`data-labels` the descendant rules read. */
|
|
8
|
+
function rootProps({ tone = "neutral", size = "md", labels = "top", className } = {}) {
|
|
9
|
+
return withClassName({
|
|
10
|
+
"data-slot": METER_SLOTS.root,
|
|
11
|
+
"data-tone": tone,
|
|
12
|
+
"data-size": size,
|
|
13
|
+
"data-labels": labels
|
|
14
|
+
}, className);
|
|
15
|
+
}
|
|
16
|
+
/** Track prop bag: just the slot anchor (its fill/thickness flow from the root). */
|
|
17
|
+
function trackProps({ className } = {}) {
|
|
18
|
+
return withClassName({ "data-slot": METER_SLOTS.track }, className);
|
|
19
|
+
}
|
|
20
|
+
/** Indicator prop bag: just the slot anchor (its fill colour flows from the root tone). */
|
|
21
|
+
function indicatorProps({ className } = {}) {
|
|
22
|
+
return withClassName({ "data-slot": METER_SLOTS.indicator }, className);
|
|
23
|
+
}
|
|
24
|
+
/** Label prop bag: just the slot anchor. */
|
|
25
|
+
function labelProps({ className } = {}) {
|
|
26
|
+
return withClassName({ "data-slot": METER_SLOTS.label }, className);
|
|
27
|
+
}
|
|
28
|
+
/** Value prop bag: just the slot anchor. */
|
|
29
|
+
function valueProps({ className } = {}) {
|
|
30
|
+
return withClassName({ "data-slot": METER_SLOTS.value }, className);
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { indicatorProps, labelProps, rootProps, trackProps, valueProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/components/meter/meter.slots.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The `data-*` hooks `Meter` stamps on its parts, for host-side styling and tests. The slot value
|
|
4
|
+
* marks each rendered element; the root also carries the `tone` and `size` axes the track and
|
|
5
|
+
* indicator rules key off — pair a slot with an axis to target, say, only a warning indicator.
|
|
6
|
+
*/
|
|
7
|
+
declare enum MeterDataAttributes {
|
|
8
|
+
/** The root meter element. */
|
|
9
|
+
slot = "data-slot",
|
|
10
|
+
/** `neutral` | `success` | `warning` | `danger` — the reading's status 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
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { MeterDataAttributes };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/components/meter/meter.slots.ts
|
|
2
|
+
/**
|
|
3
|
+
* The slot vocabulary every `Meter` 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 METER_SLOTS = {
|
|
8
|
+
root: "noctis-meter",
|
|
9
|
+
track: "noctis-meter-track",
|
|
10
|
+
indicator: "noctis-meter-indicator",
|
|
11
|
+
label: "noctis-meter-label",
|
|
12
|
+
value: "noctis-meter-value"
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The `data-*` hooks `Meter` stamps on its parts, for host-side styling and tests. The slot value
|
|
16
|
+
* marks each rendered element; the root also carries the `tone` and `size` axes the track and
|
|
17
|
+
* indicator rules key off — pair a slot with an axis to target, say, only a warning indicator.
|
|
18
|
+
*/
|
|
19
|
+
let MeterDataAttributes = /* @__PURE__ */ function(MeterDataAttributes) {
|
|
20
|
+
/** The root meter element. */
|
|
21
|
+
MeterDataAttributes["slot"] = "data-slot";
|
|
22
|
+
/** `neutral` | `success` | `warning` | `danger` — the reading's status tint, stamped on the root. */
|
|
23
|
+
MeterDataAttributes["tone"] = "data-tone";
|
|
24
|
+
/** `sm` | `md` — the track thickness, stamped on the root. */
|
|
25
|
+
MeterDataAttributes["size"] = "data-size";
|
|
26
|
+
/** `top` | `side` — the caption placement relative to the track, stamped on the root. */
|
|
27
|
+
MeterDataAttributes["labels"] = "data-labels";
|
|
28
|
+
return MeterDataAttributes;
|
|
29
|
+
}({});
|
|
30
|
+
//#endregion
|
|
31
|
+
export { METER_SLOTS, MeterDataAttributes };
|