@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,75 @@
|
|
|
1
|
+
import { DIALOG_SLOTS } from "./dialog.slots.js";
|
|
2
|
+
//#region src/components/dialog/dialog.props.ts
|
|
3
|
+
/**
|
|
4
|
+
* The D12 unified variant contract for Dialog — each compound part exposes a `props(...)` builder
|
|
5
|
+
* returning a **spreadable data-attribute prop bag** of the form
|
|
6
|
+
* `{ "data-slot": "noctis-dialog-<part>", ...dataAttrs }`, derived from the part's variant inputs.
|
|
7
|
+
*
|
|
8
|
+
* Under the single-`data-slot` anchor model the `data-slot` (plus `data-size` on the popup) is the only
|
|
9
|
+
* styling hook needed — `dialog.css` keys every rule off it — so spreading a part's `props()` onto a
|
|
10
|
+
* *foreign* element styles it as that part:
|
|
11
|
+
*
|
|
12
|
+
* <div {...Dialog.Popup.props({ size: "lg" })} />
|
|
13
|
+
* // → <div data-slot="noctis-dialog-popup" data-size="lg">
|
|
14
|
+
*
|
|
15
|
+
* The escape hatch carries no className (styling is attribute-driven); an optional `className`
|
|
16
|
+
* passthrough is accepted and forwarded verbatim. The same variant→data-attribute→values mapping is
|
|
17
|
+
* emitted as data from the token graph (`generated/declarations.json` → `variantSchema`) so non-React /
|
|
18
|
+
* agent consumers can hand-write the markup from the docs.
|
|
19
|
+
*/
|
|
20
|
+
const withClassName = (bag, className) => className === void 0 ? bag : {
|
|
21
|
+
...bag,
|
|
22
|
+
className
|
|
23
|
+
};
|
|
24
|
+
/** Trigger prop bag: just the slot anchor. */
|
|
25
|
+
function triggerProps({ className } = {}) {
|
|
26
|
+
return withClassName({ "data-slot": DIALOG_SLOTS.trigger }, className);
|
|
27
|
+
}
|
|
28
|
+
/** Backdrop prop bag: just the slot anchor (the scrim's paint flows from `dialog.css`). */
|
|
29
|
+
function backdropProps({ className } = {}) {
|
|
30
|
+
return withClassName({ "data-slot": DIALOG_SLOTS.backdrop }, className);
|
|
31
|
+
}
|
|
32
|
+
/** Viewport prop bag: just the slot anchor (the overlay-level scroll container for `scroll="viewport"`). */
|
|
33
|
+
function viewportProps({ className } = {}) {
|
|
34
|
+
return withClassName({ "data-slot": DIALOG_SLOTS.viewport }, className);
|
|
35
|
+
}
|
|
36
|
+
/** Popup prop bag: slot anchor plus the `data-size` the popup width rule reads. */
|
|
37
|
+
function popupProps({ size = "md", className } = {}) {
|
|
38
|
+
return withClassName({
|
|
39
|
+
"data-slot": DIALOG_SLOTS.popup,
|
|
40
|
+
"data-size": size
|
|
41
|
+
}, className);
|
|
42
|
+
}
|
|
43
|
+
/** Close prop bag: just the slot anchor (it carries no paint of its own — it composes with a Button). */
|
|
44
|
+
function closeProps({ className } = {}) {
|
|
45
|
+
return withClassName({ "data-slot": DIALOG_SLOTS.close }, className);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* CloseButton prop bag: the same `noctis-dialog-close` slot the convenience corner button reuses, so a
|
|
49
|
+
* hand-built close affordance and `Dialog.CloseButton` anchor on the identical selector.
|
|
50
|
+
*/
|
|
51
|
+
function closeButtonProps({ className } = {}) {
|
|
52
|
+
return withClassName({ "data-slot": DIALOG_SLOTS.close }, className);
|
|
53
|
+
}
|
|
54
|
+
/** Header prop bag: just the slot anchor. */
|
|
55
|
+
function headerProps({ className } = {}) {
|
|
56
|
+
return withClassName({ "data-slot": DIALOG_SLOTS.header }, className);
|
|
57
|
+
}
|
|
58
|
+
/** Body prop bag: just the slot anchor. */
|
|
59
|
+
function bodyProps({ className } = {}) {
|
|
60
|
+
return withClassName({ "data-slot": DIALOG_SLOTS.body }, className);
|
|
61
|
+
}
|
|
62
|
+
/** Footer prop bag: just the slot anchor. */
|
|
63
|
+
function footerProps({ className } = {}) {
|
|
64
|
+
return withClassName({ "data-slot": DIALOG_SLOTS.footer }, className);
|
|
65
|
+
}
|
|
66
|
+
/** Title prop bag: just the slot anchor. */
|
|
67
|
+
function titleProps({ className } = {}) {
|
|
68
|
+
return withClassName({ "data-slot": DIALOG_SLOTS.title }, className);
|
|
69
|
+
}
|
|
70
|
+
/** Description prop bag: just the slot anchor. */
|
|
71
|
+
function descriptionProps({ className } = {}) {
|
|
72
|
+
return withClassName({ "data-slot": DIALOG_SLOTS.description }, className);
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { backdropProps, bodyProps, closeButtonProps, closeProps, descriptionProps, footerProps, headerProps, popupProps, titleProps, triggerProps, viewportProps };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/components/dialog/dialog.slots.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The `data-*` attributes the rendered `Dialog` parts carry, beyond `data-slot`. Each member's value is
|
|
4
|
+
* the attribute name; its JSDoc is the description docgen renders into the attributes table. The state
|
|
5
|
+
* attributes come from Base UI's Dialog parts; `data-size` is stamped by the popup.
|
|
6
|
+
*/
|
|
7
|
+
declare enum DialogDataAttributes {
|
|
8
|
+
/** The stable, prefixed styling/testing hook on every rendered part. */
|
|
9
|
+
slot = "data-slot",
|
|
10
|
+
/** Present on the popup: the cross-axis cap (`sm` / `md` / `lg` / `full`) the width rules key off. */
|
|
11
|
+
size = "data-size",
|
|
12
|
+
/** Present on the popup, backdrop, and trigger while the dialog is open. */
|
|
13
|
+
open = "data-open",
|
|
14
|
+
/** Present on the popup, backdrop, and trigger while the dialog is closed. */
|
|
15
|
+
closed = "data-closed",
|
|
16
|
+
/** Present on the popup and backdrop during the enter transition's first frame. */
|
|
17
|
+
startingStyle = "data-starting-style",
|
|
18
|
+
/** Present on the popup and backdrop during the exit transition. */
|
|
19
|
+
endingStyle = "data-ending-style",
|
|
20
|
+
/** Present on the popup when it is nested inside another dialog. */
|
|
21
|
+
nested = "data-nested",
|
|
22
|
+
/** Present on the popup when it has a nested dialog open on top of it. */
|
|
23
|
+
nestedDialogOpen = "data-nested-dialog-open"
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { DialogDataAttributes };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region src/components/dialog/dialog.slots.ts
|
|
2
|
+
/**
|
|
3
|
+
* The slot vocabulary every `Dialog` 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. `Dialog.Root` wraps Base UI's `Dialog.Root` without rendering an element of
|
|
6
|
+
* its own, and `Dialog.Content` composes the portal/backdrop/(viewport/)popup without stamping a slot —
|
|
7
|
+
* so neither appears here, keeping the const parity-true to the rendered DOM.
|
|
8
|
+
*/
|
|
9
|
+
const DIALOG_SLOTS = {
|
|
10
|
+
trigger: "noctis-dialog-trigger",
|
|
11
|
+
backdrop: "noctis-dialog-backdrop",
|
|
12
|
+
viewport: "noctis-dialog-viewport",
|
|
13
|
+
popup: "noctis-dialog-popup",
|
|
14
|
+
close: "noctis-dialog-close",
|
|
15
|
+
header: "noctis-dialog-header",
|
|
16
|
+
body: "noctis-dialog-body",
|
|
17
|
+
footer: "noctis-dialog-footer",
|
|
18
|
+
title: "noctis-dialog-title",
|
|
19
|
+
description: "noctis-dialog-description"
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The `data-*` attributes the rendered `Dialog` parts carry, beyond `data-slot`. Each member's value is
|
|
23
|
+
* the attribute name; its JSDoc is the description docgen renders into the attributes table. The state
|
|
24
|
+
* attributes come from Base UI's Dialog parts; `data-size` is stamped by the popup.
|
|
25
|
+
*/
|
|
26
|
+
let DialogDataAttributes = /* @__PURE__ */ function(DialogDataAttributes) {
|
|
27
|
+
/** The stable, prefixed styling/testing hook on every rendered part. */
|
|
28
|
+
DialogDataAttributes["slot"] = "data-slot";
|
|
29
|
+
/** Present on the popup: the cross-axis cap (`sm` / `md` / `lg` / `full`) the width rules key off. */
|
|
30
|
+
DialogDataAttributes["size"] = "data-size";
|
|
31
|
+
/** Present on the popup, backdrop, and trigger while the dialog is open. */
|
|
32
|
+
DialogDataAttributes["open"] = "data-open";
|
|
33
|
+
/** Present on the popup, backdrop, and trigger while the dialog is closed. */
|
|
34
|
+
DialogDataAttributes["closed"] = "data-closed";
|
|
35
|
+
/** Present on the popup and backdrop during the enter transition's first frame. */
|
|
36
|
+
DialogDataAttributes["startingStyle"] = "data-starting-style";
|
|
37
|
+
/** Present on the popup and backdrop during the exit transition. */
|
|
38
|
+
DialogDataAttributes["endingStyle"] = "data-ending-style";
|
|
39
|
+
/** Present on the popup when it is nested inside another dialog. */
|
|
40
|
+
DialogDataAttributes["nested"] = "data-nested";
|
|
41
|
+
/** Present on the popup when it has a nested dialog open on top of it. */
|
|
42
|
+
DialogDataAttributes["nestedDialogOpen"] = "data-nested-dialog-open";
|
|
43
|
+
return DialogDataAttributes;
|
|
44
|
+
}({});
|
|
45
|
+
//#endregion
|
|
46
|
+
export { DIALOG_SLOTS, DialogDataAttributes };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/components/dialog/dialog.types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The size and scroll vocabularies `Dialog` carries — the authored source of truth since styling lives
|
|
4
|
+
* in precompiled `dialog.css`. Types-only: no runtime code, so they never participate in the styling
|
|
5
|
+
* layer.
|
|
6
|
+
*/
|
|
7
|
+
/** The dialog's cross-axis extent — its maximum width. `full` lifts the cap for a near-fullscreen panel. */
|
|
8
|
+
type DialogSize = "sm" | "md" | "lg" | "full";
|
|
9
|
+
/**
|
|
10
|
+
* How a tall dialog scrolls. `body` (default) scrolls the inner body region so the header and footer
|
|
11
|
+
* stay pinned; `viewport` scrolls the whole panel inside an overlay-level scroll container, so the
|
|
12
|
+
* dialog stays centered when it fits and grows past the viewport without the page scrolling.
|
|
13
|
+
*/
|
|
14
|
+
type DialogScroll = "body" | "viewport";
|
|
15
|
+
//#endregion
|
|
16
|
+
export { DialogScroll, DialogSize };
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { field_d_exports } from "../../primitives/field.js";
|
|
2
|
+
import { fieldset_d_exports } from "../../primitives/fieldset.js";
|
|
3
|
+
import { form_d_exports } from "../../primitives/form.js";
|
|
4
|
+
import { FieldActionSide } from "./field.types.js";
|
|
5
|
+
import { FieldPartProps, actionProps, controlProps, countProps, descriptionProps, errorProps, fieldsetProps, formProps, labelProps, legendProps, rootProps } from "./field.props.js";
|
|
6
|
+
import { ComponentPropsWithRef, ReactElement } from "react";
|
|
7
|
+
|
|
8
|
+
//#region src/components/field/field.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Groups one field's label, control, description, and error so assistive tech reads them together.
|
|
11
|
+
* Base UI manages the `aria-labelledby`/`aria-describedby` wiring and the live validity state
|
|
12
|
+
* (`data-invalid`, `data-touched`, `data-dirty`, …) it stamps on each part. Set `name` to identify the
|
|
13
|
+
* field on submit, `validate` for custom validation, and `disabled` to opt the whole field out of
|
|
14
|
+
* interaction. Drop a styled control (`Input`, `Textarea`, …) inside it directly — they auto-wire.
|
|
15
|
+
*/
|
|
16
|
+
declare function FieldRoot({
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}: Field.Root.Props): ReactElement;
|
|
20
|
+
/**
|
|
21
|
+
* The field's label, automatically associated with its control — clicking it focuses the control. Set
|
|
22
|
+
* `nativeLabel={false}` when rendering the label onto a non-`<label>` element (e.g. labelling a button
|
|
23
|
+
* trigger) so it doesn't inherit `<label>` click/hover behaviour.
|
|
24
|
+
*/
|
|
25
|
+
declare function FieldLabel({
|
|
26
|
+
className,
|
|
27
|
+
...props
|
|
28
|
+
}: Field.Label.Props): ReactElement;
|
|
29
|
+
/**
|
|
30
|
+
* The form control to label and validate. Renders a native `<input>` by default — the no-chrome path;
|
|
31
|
+
* pass `render` to use a different element. For a styled field, omit this and place a control shell
|
|
32
|
+
* (`Input`/`Textarea`) inside `Field.Root` instead: its control auto-wires to the field.
|
|
33
|
+
*/
|
|
34
|
+
declare function FieldControl({
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}: Field.Control.Props): ReactElement;
|
|
38
|
+
/** Supporting text describing the field, wired to the control via `aria-describedby`. */
|
|
39
|
+
declare function FieldDescription({
|
|
40
|
+
className,
|
|
41
|
+
...props
|
|
42
|
+
}: Field.Description.Props): ReactElement;
|
|
43
|
+
/**
|
|
44
|
+
* The validation error message, shown only while the field is invalid. Pass `match` to tie it to a
|
|
45
|
+
* specific `ValidityState` key (e.g. `valueMissing`) so each rule gets its own message, or `match` as a
|
|
46
|
+
* boolean to let an external form library control visibility.
|
|
47
|
+
*/
|
|
48
|
+
declare function FieldError({
|
|
49
|
+
className,
|
|
50
|
+
...props
|
|
51
|
+
}: Field.Error.Props): ReactElement;
|
|
52
|
+
/**
|
|
53
|
+
* The shared interactive in-field affordance — the substrate for clear, password-reveal, and shortcut
|
|
54
|
+
* buttons across the field family (exposed as `Field.Action`, and aliased as `Input.Action`,
|
|
55
|
+
* `Textarea.Action`, …). Renders a real `<button>` with the system's ghost-control discipline: a neutral
|
|
56
|
+
* rest, a neutral `control-ghost-hover` fill (never an accent), and its own `:focus-visible` ring. It is
|
|
57
|
+
* a compact square — the host field's glyph size plus a tight inset — centred against the field. Set
|
|
58
|
+
* `side` to `end` (trailing, default) or `start`. **Icon-only actions require an `aria-label`** (or a
|
|
59
|
+
* `VisuallyHidden` child); a toggle such as password-reveal should keep a static label and flip
|
|
60
|
+
* `aria-pressed` rather than swap its name. Defaults to `type="button"`; add `data-reveal="filled"` to
|
|
61
|
+
* show it only while the host field's control holds a value (driven by the host's CSS `:has()`).
|
|
62
|
+
*/
|
|
63
|
+
declare function FieldAction({
|
|
64
|
+
side,
|
|
65
|
+
type,
|
|
66
|
+
className,
|
|
67
|
+
children,
|
|
68
|
+
...props
|
|
69
|
+
}: FieldAction.Props): ReactElement;
|
|
70
|
+
declare namespace FieldAction {
|
|
71
|
+
type Props = ComponentPropsWithRef<"button"> & {
|
|
72
|
+
/**
|
|
73
|
+
* Which edge the action sits on — leading (`start`) or trailing (`end`).
|
|
74
|
+
* @default "end"
|
|
75
|
+
*/
|
|
76
|
+
side?: FieldActionSide;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The shared quiet character-count readout for a field's trailing edge (exposed as `Field.Count`, and
|
|
81
|
+
* aliased as `Input.Count`, `Textarea.Count`, …). Pass the control's current `value` and a `max`; it
|
|
82
|
+
* shows `length / max`, escalates `muted` → `warning` → `danger` as the value nears and then passes the
|
|
83
|
+
* limit, and announces the remaining count through a polite, atomic live region (empty on first paint,
|
|
84
|
+
* and only once near the limit). Give it an `id` and point the control's `aria-describedby` at it so the
|
|
85
|
+
* count is also read as the field's description. With no `max` it simply shows the current length.
|
|
86
|
+
*/
|
|
87
|
+
declare function FieldCount({
|
|
88
|
+
value,
|
|
89
|
+
max,
|
|
90
|
+
className,
|
|
91
|
+
...props
|
|
92
|
+
}: FieldCount.Props): ReactElement;
|
|
93
|
+
declare namespace FieldCount {
|
|
94
|
+
type Props = Omit<ComponentPropsWithRef<"span">, "children"> & {
|
|
95
|
+
/**
|
|
96
|
+
* The control's current value; its length is counted against `max`.
|
|
97
|
+
* @default ""
|
|
98
|
+
*/
|
|
99
|
+
value?: string; /** The character limit. Omit it to show only the current length. */
|
|
100
|
+
max?: number;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The field layer: the wiring that ties a label, control, description, and error together for one input
|
|
105
|
+
* (with the aria wiring and validity state managed for you), plus the shared in-field affordances every
|
|
106
|
+
* control reuses. Drop a styled control (`Input`/`Textarea`) inside `Field.Root` — it auto-wires — or use
|
|
107
|
+
* the bare `Field.Control` for a no-chrome input.
|
|
108
|
+
*/
|
|
109
|
+
declare const Field: {
|
|
110
|
+
/** The field container. `Field.Root.props()` → its spreadable prop bag. */Root: typeof FieldRoot & {
|
|
111
|
+
props: typeof rootProps;
|
|
112
|
+
}; /** The associated label. `Field.Label.props()` → its spreadable prop bag. */
|
|
113
|
+
Label: typeof FieldLabel & {
|
|
114
|
+
props: typeof labelProps;
|
|
115
|
+
}; /** The form control (bare-input seam; styled controls drop in directly). `Field.Control.props()` → its prop bag. */
|
|
116
|
+
Control: typeof FieldControl & {
|
|
117
|
+
props: typeof controlProps;
|
|
118
|
+
}; /** Supporting description text. `Field.Description.props()` → its spreadable prop bag. */
|
|
119
|
+
Description: typeof FieldDescription & {
|
|
120
|
+
props: typeof descriptionProps;
|
|
121
|
+
}; /** The validation error message. `Field.Error.props()` → its spreadable prop bag. */
|
|
122
|
+
Error: typeof FieldError & {
|
|
123
|
+
props: typeof errorProps;
|
|
124
|
+
}; /** The shared in-field action button. `Field.Action.props({ side })` → its spreadable prop bag. */
|
|
125
|
+
Action: typeof FieldAction & {
|
|
126
|
+
props: typeof actionProps;
|
|
127
|
+
}; /** The shared character-count readout. `Field.Count.props()` → its spreadable prop bag. */
|
|
128
|
+
Count: typeof FieldCount & {
|
|
129
|
+
props: typeof countProps;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Per-part prop and state types, mirroring Base UI's `Component.Part.Props` convention. Types-only — it
|
|
134
|
+
* merges with the `Field` object above, so `Field.Control` is the component value while
|
|
135
|
+
* `Field.Control.Props` is its prop type.
|
|
136
|
+
*/
|
|
137
|
+
declare namespace Field {
|
|
138
|
+
/** The spreadable data-attribute prop bag every field `*.props()` returns (D12). */
|
|
139
|
+
type PartProps = FieldPartProps;
|
|
140
|
+
namespace Root {
|
|
141
|
+
type Props = field_d_exports.Field.Root.Props;
|
|
142
|
+
type State = field_d_exports.Field.Root.State;
|
|
143
|
+
type Actions = field_d_exports.Field.Root.Actions;
|
|
144
|
+
}
|
|
145
|
+
namespace Label {
|
|
146
|
+
type Props = field_d_exports.Field.Label.Props;
|
|
147
|
+
type State = field_d_exports.Field.Label.State;
|
|
148
|
+
}
|
|
149
|
+
namespace Control {
|
|
150
|
+
type Props = field_d_exports.Field.Control.Props;
|
|
151
|
+
type State = field_d_exports.Field.Control.State;
|
|
152
|
+
}
|
|
153
|
+
namespace Description {
|
|
154
|
+
type Props = field_d_exports.Field.Description.Props;
|
|
155
|
+
type State = field_d_exports.Field.Description.State;
|
|
156
|
+
}
|
|
157
|
+
namespace Error {
|
|
158
|
+
type Props = field_d_exports.Field.Error.Props;
|
|
159
|
+
type State = field_d_exports.Field.Error.State;
|
|
160
|
+
}
|
|
161
|
+
/** The shared in-field action button — see {@link FieldAction}. */
|
|
162
|
+
namespace Action {
|
|
163
|
+
type Props = FieldAction.Props;
|
|
164
|
+
}
|
|
165
|
+
/** The shared character-count readout — see {@link FieldCount}. */
|
|
166
|
+
namespace Count {
|
|
167
|
+
type Props = FieldCount.Props;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/** Groups related fields under a shared legend, so a screen reader announces the group on each control. */
|
|
171
|
+
declare function FieldsetRoot({
|
|
172
|
+
className,
|
|
173
|
+
...props
|
|
174
|
+
}: Fieldset.Root.Props): ReactElement;
|
|
175
|
+
/** The fieldset's accessible label, automatically associated with the group. */
|
|
176
|
+
declare function FieldsetLegend({
|
|
177
|
+
className,
|
|
178
|
+
...props
|
|
179
|
+
}: Fieldset.Legend.Props): ReactElement;
|
|
180
|
+
/** Groups related fields under one legend — the wiring layer's section header. */
|
|
181
|
+
declare const Fieldset: {
|
|
182
|
+
/** The fieldset container. `Fieldset.Root.props()` → its spreadable prop bag. */Root: typeof FieldsetRoot & {
|
|
183
|
+
props: typeof fieldsetProps;
|
|
184
|
+
}; /** The group legend. `Fieldset.Legend.props()` → its spreadable prop bag. */
|
|
185
|
+
Legend: typeof FieldsetLegend & {
|
|
186
|
+
props: typeof legendProps;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
/** Per-part prop and state types for `Fieldset`. Types-only; merges with the object above. */
|
|
190
|
+
declare namespace Fieldset {
|
|
191
|
+
namespace Root {
|
|
192
|
+
type Props = fieldset_d_exports.Fieldset.Root.Props;
|
|
193
|
+
type State = fieldset_d_exports.Fieldset.Root.State;
|
|
194
|
+
}
|
|
195
|
+
namespace Legend {
|
|
196
|
+
type Props = fieldset_d_exports.Fieldset.Legend.Props;
|
|
197
|
+
type State = fieldset_d_exports.Fieldset.Legend.State;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* A native `<form>` with consolidated error handling. Validates its fields together, reports external
|
|
202
|
+
* `errors` keyed by field `name`, and calls `onFormSubmit` with the collected values once valid. Stacks
|
|
203
|
+
* its fields and fieldsets with a shared vertical rhythm.
|
|
204
|
+
*/
|
|
205
|
+
declare function FormImpl({
|
|
206
|
+
className,
|
|
207
|
+
...props
|
|
208
|
+
}: Form.Props): ReactElement;
|
|
209
|
+
/** The form wrapper: a native `<form>` with consolidated validation and error reporting. */
|
|
210
|
+
declare const Form: typeof FormImpl & {
|
|
211
|
+
props: typeof formProps;
|
|
212
|
+
};
|
|
213
|
+
/** Prop and state types for `Form`. Types-only; merges with the function above. */
|
|
214
|
+
declare namespace Form {
|
|
215
|
+
type Props = form_d_exports.Form.Props;
|
|
216
|
+
type State = form_d_exports.Form.State;
|
|
217
|
+
type Actions = form_d_exports.Form.Actions;
|
|
218
|
+
type ValidationMode = form_d_exports.Form.ValidationMode;
|
|
219
|
+
}
|
|
220
|
+
//#endregion
|
|
221
|
+
export { Field, FieldAction, FieldCount, Fieldset, Form };
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useNoctisStringFormatter } from "../../core/use-injected-labels.js";
|
|
3
|
+
import { VisuallyHidden } from "../../core/visually-hidden/visually-hidden.js";
|
|
4
|
+
import { field_exports } from "../../primitives/field.js";
|
|
5
|
+
import { fieldset_exports } from "../../primitives/fieldset.js";
|
|
6
|
+
import { form_exports } from "../../primitives/form.js";
|
|
7
|
+
import { FIELD_SLOTS } from "./field.slots.js";
|
|
8
|
+
import { actionProps, controlProps, countProps, descriptionProps, errorProps, fieldsetProps, formProps, labelProps, legendProps, rootProps } from "./field.props.js";
|
|
9
|
+
import { useEffect, useRef } from "react";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
//#region src/components/field/field.tsx
|
|
12
|
+
/** How near the limit (in remaining characters) the count escalates to its warning colour and starts announcing. */
|
|
13
|
+
const COUNT_WARN_RATIO = .1;
|
|
14
|
+
/**
|
|
15
|
+
* Groups one field's label, control, description, and error so assistive tech reads them together.
|
|
16
|
+
* Base UI manages the `aria-labelledby`/`aria-describedby` wiring and the live validity state
|
|
17
|
+
* (`data-invalid`, `data-touched`, `data-dirty`, …) it stamps on each part. Set `name` to identify the
|
|
18
|
+
* field on submit, `validate` for custom validation, and `disabled` to opt the whole field out of
|
|
19
|
+
* interaction. Drop a styled control (`Input`, `Textarea`, …) inside it directly — they auto-wire.
|
|
20
|
+
*/
|
|
21
|
+
function FieldRoot({ className, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx(field_exports.Field.Root, {
|
|
23
|
+
"data-slot": FIELD_SLOTS.root,
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The field's label, automatically associated with its control — clicking it focuses the control. Set
|
|
30
|
+
* `nativeLabel={false}` when rendering the label onto a non-`<label>` element (e.g. labelling a button
|
|
31
|
+
* trigger) so it doesn't inherit `<label>` click/hover behaviour.
|
|
32
|
+
*/
|
|
33
|
+
function FieldLabel({ className, ...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsx(field_exports.Field.Label, {
|
|
35
|
+
"data-slot": FIELD_SLOTS.label,
|
|
36
|
+
className,
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The form control to label and validate. Renders a native `<input>` by default — the no-chrome path;
|
|
42
|
+
* pass `render` to use a different element. For a styled field, omit this and place a control shell
|
|
43
|
+
* (`Input`/`Textarea`) inside `Field.Root` instead: its control auto-wires to the field.
|
|
44
|
+
*/
|
|
45
|
+
function FieldControl({ className, ...props }) {
|
|
46
|
+
return /* @__PURE__ */ jsx(field_exports.Field.Control, {
|
|
47
|
+
"data-slot": FIELD_SLOTS.control,
|
|
48
|
+
className,
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/** Supporting text describing the field, wired to the control via `aria-describedby`. */
|
|
53
|
+
function FieldDescription({ className, ...props }) {
|
|
54
|
+
return /* @__PURE__ */ jsx(field_exports.Field.Description, {
|
|
55
|
+
"data-slot": FIELD_SLOTS.description,
|
|
56
|
+
className,
|
|
57
|
+
...props
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The validation error message, shown only while the field is invalid. Pass `match` to tie it to a
|
|
62
|
+
* specific `ValidityState` key (e.g. `valueMissing`) so each rule gets its own message, or `match` as a
|
|
63
|
+
* boolean to let an external form library control visibility.
|
|
64
|
+
*/
|
|
65
|
+
function FieldError({ className, ...props }) {
|
|
66
|
+
return /* @__PURE__ */ jsx(field_exports.Field.Error, {
|
|
67
|
+
"data-slot": FIELD_SLOTS.error,
|
|
68
|
+
className,
|
|
69
|
+
...props
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The shared interactive in-field affordance — the substrate for clear, password-reveal, and shortcut
|
|
74
|
+
* buttons across the field family (exposed as `Field.Action`, and aliased as `Input.Action`,
|
|
75
|
+
* `Textarea.Action`, …). Renders a real `<button>` with the system's ghost-control discipline: a neutral
|
|
76
|
+
* rest, a neutral `control-ghost-hover` fill (never an accent), and its own `:focus-visible` ring. It is
|
|
77
|
+
* a compact square — the host field's glyph size plus a tight inset — centred against the field. Set
|
|
78
|
+
* `side` to `end` (trailing, default) or `start`. **Icon-only actions require an `aria-label`** (or a
|
|
79
|
+
* `VisuallyHidden` child); a toggle such as password-reveal should keep a static label and flip
|
|
80
|
+
* `aria-pressed` rather than swap its name. Defaults to `type="button"`; add `data-reveal="filled"` to
|
|
81
|
+
* show it only while the host field's control holds a value (driven by the host's CSS `:has()`).
|
|
82
|
+
*/
|
|
83
|
+
function FieldAction({ side = "end", type, className, children, ...props }) {
|
|
84
|
+
const { className: _omit, ...recipe } = actionProps({ side });
|
|
85
|
+
return /* @__PURE__ */ jsx("button", {
|
|
86
|
+
type: type ?? "button",
|
|
87
|
+
...recipe,
|
|
88
|
+
"data-slot": FIELD_SLOTS.action,
|
|
89
|
+
className,
|
|
90
|
+
...props,
|
|
91
|
+
children
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The shared quiet character-count readout for a field's trailing edge (exposed as `Field.Count`, and
|
|
96
|
+
* aliased as `Input.Count`, `Textarea.Count`, …). Pass the control's current `value` and a `max`; it
|
|
97
|
+
* shows `length / max`, escalates `muted` → `warning` → `danger` as the value nears and then passes the
|
|
98
|
+
* limit, and announces the remaining count through a polite, atomic live region (empty on first paint,
|
|
99
|
+
* and only once near the limit). Give it an `id` and point the control's `aria-describedby` at it so the
|
|
100
|
+
* count is also read as the field's description. With no `max` it simply shows the current length.
|
|
101
|
+
*/
|
|
102
|
+
function FieldCount({ value = "", max, className, ...props }) {
|
|
103
|
+
const { className: _omit, ...recipe } = countProps();
|
|
104
|
+
const formatter = useNoctisStringFormatter();
|
|
105
|
+
const announced = useRef(false);
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
announced.current = true;
|
|
108
|
+
}, []);
|
|
109
|
+
const length = value.length;
|
|
110
|
+
const hasMax = max !== void 0;
|
|
111
|
+
const remaining = hasMax ? max - length : 0;
|
|
112
|
+
const over = hasMax && remaining < 0;
|
|
113
|
+
const near = hasMax && !over && remaining <= Math.ceil(max * COUNT_WARN_RATIO);
|
|
114
|
+
const liveText = announced.current && (near || over) ? formatter.format("field.charactersRemaining", { count: Math.max(0, remaining) }) : "";
|
|
115
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
116
|
+
...recipe,
|
|
117
|
+
"data-slot": FIELD_SLOTS.count,
|
|
118
|
+
"data-near": near ? "" : void 0,
|
|
119
|
+
"data-over": over ? "" : void 0,
|
|
120
|
+
className,
|
|
121
|
+
...props,
|
|
122
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
123
|
+
"aria-hidden": "true",
|
|
124
|
+
children: hasMax ? `${length}/${max}` : length
|
|
125
|
+
}), /* @__PURE__ */ jsx(VisuallyHidden, {
|
|
126
|
+
"aria-live": "polite",
|
|
127
|
+
"aria-atomic": "true",
|
|
128
|
+
children: liveText
|
|
129
|
+
})]
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The field layer: the wiring that ties a label, control, description, and error together for one input
|
|
134
|
+
* (with the aria wiring and validity state managed for you), plus the shared in-field affordances every
|
|
135
|
+
* control reuses. Drop a styled control (`Input`/`Textarea`) inside `Field.Root` — it auto-wires — or use
|
|
136
|
+
* the bare `Field.Control` for a no-chrome input.
|
|
137
|
+
*/
|
|
138
|
+
const Field = {
|
|
139
|
+
/** The field container. `Field.Root.props()` → its spreadable prop bag. */
|
|
140
|
+
Root: Object.assign(FieldRoot, { props: rootProps }),
|
|
141
|
+
/** The associated label. `Field.Label.props()` → its spreadable prop bag. */
|
|
142
|
+
Label: Object.assign(FieldLabel, { props: labelProps }),
|
|
143
|
+
/** The form control (bare-input seam; styled controls drop in directly). `Field.Control.props()` → its prop bag. */
|
|
144
|
+
Control: Object.assign(FieldControl, { props: controlProps }),
|
|
145
|
+
/** Supporting description text. `Field.Description.props()` → its spreadable prop bag. */
|
|
146
|
+
Description: Object.assign(FieldDescription, { props: descriptionProps }),
|
|
147
|
+
/** The validation error message. `Field.Error.props()` → its spreadable prop bag. */
|
|
148
|
+
Error: Object.assign(FieldError, { props: errorProps }),
|
|
149
|
+
/** The shared in-field action button. `Field.Action.props({ side })` → its spreadable prop bag. */
|
|
150
|
+
Action: Object.assign(FieldAction, { props: actionProps }),
|
|
151
|
+
/** The shared character-count readout. `Field.Count.props()` → its spreadable prop bag. */
|
|
152
|
+
Count: Object.assign(FieldCount, { props: countProps })
|
|
153
|
+
};
|
|
154
|
+
/** Groups related fields under a shared legend, so a screen reader announces the group on each control. */
|
|
155
|
+
function FieldsetRoot({ className, ...props }) {
|
|
156
|
+
return /* @__PURE__ */ jsx(fieldset_exports.Fieldset.Root, {
|
|
157
|
+
"data-slot": FIELD_SLOTS.fieldset,
|
|
158
|
+
className,
|
|
159
|
+
...props
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/** The fieldset's accessible label, automatically associated with the group. */
|
|
163
|
+
function FieldsetLegend({ className, ...props }) {
|
|
164
|
+
return /* @__PURE__ */ jsx(fieldset_exports.Fieldset.Legend, {
|
|
165
|
+
"data-slot": FIELD_SLOTS.fieldsetLegend,
|
|
166
|
+
className,
|
|
167
|
+
...props
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
/** Groups related fields under one legend — the wiring layer's section header. */
|
|
171
|
+
const Fieldset = {
|
|
172
|
+
/** The fieldset container. `Fieldset.Root.props()` → its spreadable prop bag. */
|
|
173
|
+
Root: Object.assign(FieldsetRoot, { props: fieldsetProps }),
|
|
174
|
+
/** The group legend. `Fieldset.Legend.props()` → its spreadable prop bag. */
|
|
175
|
+
Legend: Object.assign(FieldsetLegend, { props: legendProps })
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* A native `<form>` with consolidated error handling. Validates its fields together, reports external
|
|
179
|
+
* `errors` keyed by field `name`, and calls `onFormSubmit` with the collected values once valid. Stacks
|
|
180
|
+
* its fields and fieldsets with a shared vertical rhythm.
|
|
181
|
+
*/
|
|
182
|
+
function FormImpl({ className, ...props }) {
|
|
183
|
+
return /* @__PURE__ */ jsx(form_exports.Form, {
|
|
184
|
+
"data-slot": FIELD_SLOTS.form,
|
|
185
|
+
className,
|
|
186
|
+
...props
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/** The form wrapper: a native `<form>` with consolidated validation and error reporting. */
|
|
190
|
+
const Form = Object.assign(FormImpl, { props: formProps });
|
|
191
|
+
//#endregion
|
|
192
|
+
export { Field, FieldAction, FieldCount, Fieldset, Form };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { FieldActionSide } from "./field.types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/field/field.props.d.ts
|
|
4
|
+
/** A spreadable data-attribute prop bag — the shape every field `*.props()` returns. */
|
|
5
|
+
type FieldPartProps = {
|
|
6
|
+
/** The slot value the matching `field.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 a stateless field part's `.props(...)` — no variants/state of its own. */
|
|
16
|
+
type FieldPartPropsArgs = BasePropsArgs;
|
|
17
|
+
/** Argument to `actionProps(...)` — which edge the in-field action button sits on. */
|
|
18
|
+
interface FieldActionPropsArgs extends BasePropsArgs {
|
|
19
|
+
/** Which edge the action sits on — leading (`start`) or trailing (`end`). @default "end" */
|
|
20
|
+
side?: FieldActionSide;
|
|
21
|
+
}
|
|
22
|
+
/** Argument to `countProps(...)` — the counter carries no variants; its escalation is value-driven at runtime. */
|
|
23
|
+
type FieldCountPropsArgs = BasePropsArgs;
|
|
24
|
+
/** Root prop bag: just the slot anchor. */
|
|
25
|
+
declare function rootProps({
|
|
26
|
+
className
|
|
27
|
+
}?: FieldPartPropsArgs): FieldPartProps;
|
|
28
|
+
/** Label prop bag: just the slot anchor. */
|
|
29
|
+
declare function labelProps({
|
|
30
|
+
className
|
|
31
|
+
}?: FieldPartPropsArgs): FieldPartProps;
|
|
32
|
+
/** Control prop bag: just the slot anchor. */
|
|
33
|
+
declare function controlProps({
|
|
34
|
+
className
|
|
35
|
+
}?: FieldPartPropsArgs): FieldPartProps;
|
|
36
|
+
/** Description prop bag: just the slot anchor. */
|
|
37
|
+
declare function descriptionProps({
|
|
38
|
+
className
|
|
39
|
+
}?: FieldPartPropsArgs): FieldPartProps;
|
|
40
|
+
/** Error prop bag: just the slot anchor. */
|
|
41
|
+
declare function errorProps({
|
|
42
|
+
className
|
|
43
|
+
}?: FieldPartPropsArgs): FieldPartProps;
|
|
44
|
+
/** Fieldset prop bag: just the slot anchor. */
|
|
45
|
+
declare function fieldsetProps({
|
|
46
|
+
className
|
|
47
|
+
}?: FieldPartPropsArgs): FieldPartProps;
|
|
48
|
+
/** Fieldset legend prop bag: just the slot anchor. */
|
|
49
|
+
declare function legendProps({
|
|
50
|
+
className
|
|
51
|
+
}?: FieldPartPropsArgs): FieldPartProps;
|
|
52
|
+
/** Form prop bag: just the slot anchor. */
|
|
53
|
+
declare function formProps({
|
|
54
|
+
className
|
|
55
|
+
}?: FieldPartPropsArgs): FieldPartProps;
|
|
56
|
+
/** Action prop bag: slot anchor plus the `data-side` edge (the in-field ghost button). */
|
|
57
|
+
declare function actionProps({
|
|
58
|
+
side,
|
|
59
|
+
className
|
|
60
|
+
}?: FieldActionPropsArgs): FieldPartProps;
|
|
61
|
+
/** Count prop bag: just the slot anchor (the character-count readout; escalation is value-driven). */
|
|
62
|
+
declare function countProps({
|
|
63
|
+
className
|
|
64
|
+
}?: FieldCountPropsArgs): FieldPartProps;
|
|
65
|
+
//#endregion
|
|
66
|
+
export { FieldActionPropsArgs, FieldCountPropsArgs, FieldPartProps, actionProps, controlProps, countProps, descriptionProps, errorProps, fieldsetProps, formProps, labelProps, legendProps, rootProps };
|