@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,373 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Icon } from "../../icons/icon.js";
|
|
3
|
+
import { PlusIcon, SearchIcon, SpinnerIcon, XIcon } from "../../icons/glyphs.js";
|
|
4
|
+
import { useInjectedLabels } from "../../core/use-injected-labels.js";
|
|
5
|
+
import { VisuallyHidden } from "../../core/visually-hidden/visually-hidden.js";
|
|
6
|
+
import { Autocomplete as Autocomplete$2 } from "../../primitives/autocomplete/autocomplete.js";
|
|
7
|
+
import { Surface } from "../surface/surface.js";
|
|
8
|
+
import { AutocompleteProvider, useAutocompleteContext } from "./autocomplete.context.js";
|
|
9
|
+
import { AUTOCOMPLETE_SLOTS } from "./autocomplete.slots.js";
|
|
10
|
+
import { contentProps, emptyProps, groupLabelProps, groupProps, iconProps, inputProps, itemProps, listProps, loadingProps, separatorProps, statusProps } from "./autocomplete.props.js";
|
|
11
|
+
import { useCallback, useMemo, useState } from "react";
|
|
12
|
+
import clsx$1 from "clsx";
|
|
13
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { Autocomplete } from "@base-ui/react/autocomplete";
|
|
15
|
+
//#region src/components/autocomplete/autocomplete.tsx
|
|
16
|
+
const CLEAR_LABEL_DEFAULTS = { clear: "Clear" };
|
|
17
|
+
const CLEAR_LABEL_KEYS = { clear: "autocomplete.clear" };
|
|
18
|
+
const LOADING_LABEL_DEFAULTS = { loading: "Loading…" };
|
|
19
|
+
const LOADING_LABEL_KEYS = { loading: "autocomplete.loading" };
|
|
20
|
+
/**
|
|
21
|
+
* Owns the autocomplete state, the suggestion list (`items`), and filtering. Shares the control `size`
|
|
22
|
+
* and the `loading` flag with the field and rows through context. The committed value is the free text
|
|
23
|
+
* the user types — pass a `filter` (or the `useFilter` collator) to control how `items` are matched.
|
|
24
|
+
* Set `mode` for inline completion, `autoHighlight` to commit the top match on `Enter`, and
|
|
25
|
+
* `openOnFocus` to surface recent suggestions the moment the field is focused. Renders no DOM element.
|
|
26
|
+
*/
|
|
27
|
+
function AutocompleteRoot({ size = "md", loading = false, openOnFocus = false, open: openProp, defaultOpen, onOpenChange, onValueChange, children, ...props }) {
|
|
28
|
+
const [internalOpen, setInternalOpen] = useState(defaultOpen ?? false);
|
|
29
|
+
const [instantClose, setInstantClose] = useState(false);
|
|
30
|
+
const isControlled = openProp !== void 0;
|
|
31
|
+
const open = isControlled ? openProp : internalOpen;
|
|
32
|
+
const handleOpenChange = useCallback((next, details) => {
|
|
33
|
+
if (next) setInstantClose(false);
|
|
34
|
+
if (!isControlled) setInternalOpen(next);
|
|
35
|
+
onOpenChange?.(next, details);
|
|
36
|
+
}, [isControlled, onOpenChange]);
|
|
37
|
+
const handleValueChange = useCallback((value, details) => {
|
|
38
|
+
if (!isControlled && !openOnFocus && value.trim() === "") {
|
|
39
|
+
setInstantClose(true);
|
|
40
|
+
setInternalOpen(false);
|
|
41
|
+
}
|
|
42
|
+
onValueChange?.(value, details);
|
|
43
|
+
}, [
|
|
44
|
+
isControlled,
|
|
45
|
+
openOnFocus,
|
|
46
|
+
onValueChange
|
|
47
|
+
]);
|
|
48
|
+
const onInputFocus = useCallback(() => {
|
|
49
|
+
if (!isControlled) {
|
|
50
|
+
setInstantClose(false);
|
|
51
|
+
setInternalOpen(true);
|
|
52
|
+
}
|
|
53
|
+
}, [isControlled]);
|
|
54
|
+
return /* @__PURE__ */ jsx(AutocompleteProvider, {
|
|
55
|
+
value: useMemo(() => ({
|
|
56
|
+
size,
|
|
57
|
+
loading,
|
|
58
|
+
onInputFocus: openOnFocus ? onInputFocus : void 0,
|
|
59
|
+
instantClose
|
|
60
|
+
}), [
|
|
61
|
+
size,
|
|
62
|
+
loading,
|
|
63
|
+
openOnFocus,
|
|
64
|
+
onInputFocus,
|
|
65
|
+
instantClose
|
|
66
|
+
]),
|
|
67
|
+
children: /* @__PURE__ */ jsx(Autocomplete$2.Root, {
|
|
68
|
+
open,
|
|
69
|
+
onOpenChange: handleOpenChange,
|
|
70
|
+
onValueChange: handleValueChange,
|
|
71
|
+
...props,
|
|
72
|
+
children
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The text field the user types into — opens the suggestions popup as they type and filters the list.
|
|
78
|
+
* Follows the field family look (filled surface, field border, a calm ring-less focus that shifts only
|
|
79
|
+
* the border) and reads the control `size` from the root unless overridden. Pass `invalid` for the
|
|
80
|
+
* danger border. Give it an `aria-label` (or wire a visible `Field.Label`) so it is named for AT.
|
|
81
|
+
*/
|
|
82
|
+
function AutocompleteInput({ size, invalid, onFocus, className, ...props }) {
|
|
83
|
+
const ctx = useAutocompleteContext("Input");
|
|
84
|
+
return /* @__PURE__ */ jsx(Autocomplete$2.Input, {
|
|
85
|
+
...inputProps({
|
|
86
|
+
size: size ?? ctx.size,
|
|
87
|
+
invalid
|
|
88
|
+
}),
|
|
89
|
+
"aria-busy": ctx.loading || void 0,
|
|
90
|
+
onFocus: (event) => {
|
|
91
|
+
ctx.onInputFocus?.();
|
|
92
|
+
onFocus?.(event);
|
|
93
|
+
},
|
|
94
|
+
className: clsx$1(className),
|
|
95
|
+
...props
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The field shell that lays out the `Input` beside its leading `Icon` and trailing `Clear`/`Loading`
|
|
100
|
+
* affordances. Wrap the input and the affordances in it so they pin inside the field's edges without
|
|
101
|
+
* sitting over the typed text. Mirrors to the inline-start/-end under RTL.
|
|
102
|
+
*/
|
|
103
|
+
function AutocompleteInputGroup({ className, ...props }) {
|
|
104
|
+
return /* @__PURE__ */ jsx(Autocomplete$2.InputGroup, {
|
|
105
|
+
"data-slot": AUTOCOMPLETE_SLOTS.inputGroup,
|
|
106
|
+
className: clsx$1(className),
|
|
107
|
+
...props
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* A leading decorative icon in the field (a search magnifier by default), reserving a leading column.
|
|
112
|
+
* Muted and signal-free; Base UI marks it `aria-hidden`. Render it as the first child of the
|
|
113
|
+
* `InputGroup`, before the `Input`.
|
|
114
|
+
*/
|
|
115
|
+
function AutocompleteIcon({ className, children, ...props }) {
|
|
116
|
+
return /* @__PURE__ */ jsx(Autocomplete$2.Icon, {
|
|
117
|
+
...iconProps(),
|
|
118
|
+
className: clsx$1(className),
|
|
119
|
+
...props,
|
|
120
|
+
children: children ?? /* @__PURE__ */ jsx(Icon, {
|
|
121
|
+
icon: SearchIcon,
|
|
122
|
+
size: "sm",
|
|
123
|
+
"aria-hidden": true
|
|
124
|
+
})
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* The button that clears the current value, shown only while the field holds one. Carries a localized
|
|
129
|
+
* `aria-label` (override it with your own `aria-label`); it renders a small dismiss glyph by default and
|
|
130
|
+
* refocuses the input after clearing.
|
|
131
|
+
*/
|
|
132
|
+
function AutocompleteClear({ "aria-label": ariaLabel, className, children, ...props }) {
|
|
133
|
+
const labels = useInjectedLabels(CLEAR_LABEL_DEFAULTS, CLEAR_LABEL_KEYS, void 0);
|
|
134
|
+
return /* @__PURE__ */ jsx(Autocomplete$2.Clear, {
|
|
135
|
+
"data-slot": AUTOCOMPLETE_SLOTS.clear,
|
|
136
|
+
"aria-label": ariaLabel ?? labels.clear,
|
|
137
|
+
className: clsx$1(className),
|
|
138
|
+
...props,
|
|
139
|
+
children: children ?? /* @__PURE__ */ jsx(Icon, {
|
|
140
|
+
icon: XIcon,
|
|
141
|
+
size: "sm",
|
|
142
|
+
"aria-hidden": true
|
|
143
|
+
})
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* The trailing async busy indicator — a spinner that appears while the root is `loading`, naming itself
|
|
148
|
+
* for assistive tech with a localized hidden "Loading" label (defense in depth alongside a composed
|
|
149
|
+
* `Status` live region). Renders nothing while not loading. Place it inside the `InputGroup`.
|
|
150
|
+
*/
|
|
151
|
+
function AutocompleteLoading({ className, children, ...props }) {
|
|
152
|
+
const { loading } = useAutocompleteContext("Loading");
|
|
153
|
+
const labels = useInjectedLabels(LOADING_LABEL_DEFAULTS, LOADING_LABEL_KEYS, void 0);
|
|
154
|
+
if (!loading) return null;
|
|
155
|
+
return /* @__PURE__ */ jsx("span", {
|
|
156
|
+
...loadingProps(),
|
|
157
|
+
className: clsx$1(className),
|
|
158
|
+
...props,
|
|
159
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
160
|
+
icon: SpinnerIcon,
|
|
161
|
+
size: "sm",
|
|
162
|
+
"aria-hidden": true
|
|
163
|
+
}), /* @__PURE__ */ jsx(VisuallyHidden, { children: labels.loading })] })
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* The floating suggestions surface — portaled, elevated, and animated — holding the `List` of `Item`s
|
|
168
|
+
* and the `Empty` message. Opens below the field aligned to its start, flipping above at the viewport
|
|
169
|
+
* edge, and caps at the available viewport height, scrolling its list and keeping the keyboard
|
|
170
|
+
* highlight in view. Mirrors the root `size` as `data-size` so the rows take the matching density.
|
|
171
|
+
*/
|
|
172
|
+
function AutocompleteContent({ side = "bottom", align = "start", sideOffset = 6, collisionPadding = 8, className, style, children, ...props }) {
|
|
173
|
+
const { size, instantClose } = useAutocompleteContext("Content");
|
|
174
|
+
return /* @__PURE__ */ jsx(Autocomplete$2.Portal, { children: /* @__PURE__ */ jsx(Autocomplete$2.Positioner, {
|
|
175
|
+
side,
|
|
176
|
+
align,
|
|
177
|
+
sideOffset,
|
|
178
|
+
collisionPadding,
|
|
179
|
+
"data-slot": AUTOCOMPLETE_SLOTS.positioner,
|
|
180
|
+
children: /* @__PURE__ */ jsx(Autocomplete$2.Popup, {
|
|
181
|
+
"data-slot": AUTOCOMPLETE_SLOTS.content,
|
|
182
|
+
"data-size": size,
|
|
183
|
+
"data-instant": instantClose ? "" : void 0,
|
|
184
|
+
render: /* @__PURE__ */ jsx(Surface, {
|
|
185
|
+
elevation: "menu",
|
|
186
|
+
bordered: true,
|
|
187
|
+
shadow: "popover"
|
|
188
|
+
}),
|
|
189
|
+
style: {
|
|
190
|
+
transformOrigin: "var(--transform-origin)",
|
|
191
|
+
maxHeight: "var(--available-height)",
|
|
192
|
+
minInlineSize: "var(--anchor-width)",
|
|
193
|
+
...style
|
|
194
|
+
},
|
|
195
|
+
className: clsx$1(className),
|
|
196
|
+
...props,
|
|
197
|
+
children
|
|
198
|
+
})
|
|
199
|
+
}) });
|
|
200
|
+
}
|
|
201
|
+
/** The scrollable list rendering the filtered suggestions. Pass a render function to map each item. */
|
|
202
|
+
function AutocompleteList({ className, ...props }) {
|
|
203
|
+
return /* @__PURE__ */ jsx(Autocomplete$2.List, {
|
|
204
|
+
...listProps(),
|
|
205
|
+
"data-custom-scrollbar": true,
|
|
206
|
+
className: clsx$1(className),
|
|
207
|
+
...props
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* One suggestion row. Optional leading `icon`; the row lights up with a neutral highlight on hover or
|
|
212
|
+
* keyboard focus (the accent stays a signal, never a hover). Give it a `value` so selecting it commits
|
|
213
|
+
* that text to the input.
|
|
214
|
+
*/
|
|
215
|
+
function AutocompleteItem({ icon, className, children, ...props }) {
|
|
216
|
+
return /* @__PURE__ */ jsxs(Autocomplete$2.Item, {
|
|
217
|
+
"data-slot": AUTOCOMPLETE_SLOTS.item,
|
|
218
|
+
className: clsx$1(className),
|
|
219
|
+
...props,
|
|
220
|
+
children: [icon ? /* @__PURE__ */ jsx(Icon, {
|
|
221
|
+
icon,
|
|
222
|
+
size: "sm"
|
|
223
|
+
}) : null, children]
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* The free-text "Create" row — a conditional "Use «query»" option you render inside the list when the
|
|
228
|
+
* typed query has no exact match, so committing it accepts the typed value. Marked `data-create` for
|
|
229
|
+
* its slightly emphasized styling and a leading "+" glyph; this is the differentiator vs Combobox's
|
|
230
|
+
* constrained selection. Give it the typed query as its `value`.
|
|
231
|
+
*/
|
|
232
|
+
function AutocompleteCreate({ className, children, ...props }) {
|
|
233
|
+
return /* @__PURE__ */ jsxs(Autocomplete$2.Item, {
|
|
234
|
+
"data-slot": AUTOCOMPLETE_SLOTS.item,
|
|
235
|
+
"data-create": "",
|
|
236
|
+
className: clsx$1(className),
|
|
237
|
+
...props,
|
|
238
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
239
|
+
icon: PlusIcon,
|
|
240
|
+
size: "sm"
|
|
241
|
+
}), /* @__PURE__ */ jsx("span", { children })]
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Bolds the part of a suggestion that matches the typed query — the signature autocomplete affordance.
|
|
246
|
+
* Wraps the matched substring in a `<mark>` styled with weight and foreground only (no fill, never the
|
|
247
|
+
* accent), so the match reads clearly while the row stays quiet. Pass the row's `text` and the current
|
|
248
|
+
* `query`; renders the text unchanged when the query is empty or absent from it.
|
|
249
|
+
*
|
|
250
|
+
* The label is wrapped in a single inline `<span>` so the row's flex `gap` (which spaces the leading
|
|
251
|
+
* glyph from the label) never falls *between* the matched and unmatched text runs — without the wrapper
|
|
252
|
+
* each run would become its own flex item and the gap would tear the word apart.
|
|
253
|
+
*/
|
|
254
|
+
function AutocompleteHighlight({ text, query, className, ...props }) {
|
|
255
|
+
const q = query.trim();
|
|
256
|
+
const index = q ? text.toLowerCase().indexOf(q.toLowerCase()) : -1;
|
|
257
|
+
if (index === -1) return /* @__PURE__ */ jsx("span", {
|
|
258
|
+
className: clsx$1(className),
|
|
259
|
+
...props,
|
|
260
|
+
children: text
|
|
261
|
+
});
|
|
262
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
263
|
+
className: clsx$1(className),
|
|
264
|
+
...props,
|
|
265
|
+
children: [
|
|
266
|
+
text.slice(0, index),
|
|
267
|
+
/* @__PURE__ */ jsx("mark", {
|
|
268
|
+
"data-slot": AUTOCOMPLETE_SLOTS.mark,
|
|
269
|
+
children: text.slice(index, index + q.length)
|
|
270
|
+
}),
|
|
271
|
+
text.slice(index + q.length)
|
|
272
|
+
]
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* The message shown inside the popup while the filtered list is empty — a "no matches" line. Kept
|
|
277
|
+
* mounted and announced politely to screen readers, so update or conditionally render its *children*
|
|
278
|
+
* rather than the part itself.
|
|
279
|
+
*/
|
|
280
|
+
function AutocompleteEmpty({ className, ...props }) {
|
|
281
|
+
return /* @__PURE__ */ jsx(Autocomplete$2.Empty, {
|
|
282
|
+
...emptyProps(),
|
|
283
|
+
className: clsx$1(className),
|
|
284
|
+
...props
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* A polite status line for an asynchronously loaded list (a "Searching…" / result-count message). Kept
|
|
289
|
+
* mounted and announced to screen readers, so update or conditionally render its *children* rather than
|
|
290
|
+
* the part itself.
|
|
291
|
+
*/
|
|
292
|
+
function AutocompleteStatus({ className, ...props }) {
|
|
293
|
+
return /* @__PURE__ */ jsx(Autocomplete$2.Status, {
|
|
294
|
+
...statusProps(),
|
|
295
|
+
className: clsx$1(className),
|
|
296
|
+
...props
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
/** A labelled section of related suggestions. Put a `GroupLabel` inside to name it for screen readers. */
|
|
300
|
+
function AutocompleteGroup({ className, ...props }) {
|
|
301
|
+
return /* @__PURE__ */ jsx(Autocomplete$2.Group, {
|
|
302
|
+
...groupProps(),
|
|
303
|
+
className: clsx$1(className),
|
|
304
|
+
...props
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
/** Maps a group's filtered items to rows via a render-prop child. Renders no element of its own. */
|
|
308
|
+
function AutocompleteCollection(props) {
|
|
309
|
+
return /* @__PURE__ */ jsx(Autocomplete$2.Collection, { ...props });
|
|
310
|
+
}
|
|
311
|
+
/** The group's muted, non-interactive heading — announced as the group's accessible name. */
|
|
312
|
+
function AutocompleteGroupLabel({ className, ...props }) {
|
|
313
|
+
return /* @__PURE__ */ jsx(Autocomplete$2.GroupLabel, {
|
|
314
|
+
...groupLabelProps(),
|
|
315
|
+
className: clsx$1(className),
|
|
316
|
+
...props
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
/** A hairline between groups of suggestions. */
|
|
320
|
+
function AutocompleteSeparator({ className, ...props }) {
|
|
321
|
+
return /* @__PURE__ */ jsx(Autocomplete.Separator, {
|
|
322
|
+
...separatorProps(),
|
|
323
|
+
className: clsx$1(className),
|
|
324
|
+
...props
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* A free-text input with a suggestion list: as the user types, `Autocomplete.Content` floats a filtered
|
|
329
|
+
* list of `Item`s beneath the field. Unlike `Combobox`, the committed value is the typed text — the
|
|
330
|
+
* suggestions complete and accelerate free entry rather than constraining it to a fixed option set.
|
|
331
|
+
*
|
|
332
|
+
* Built on Base UI's Autocomplete for keyboard navigation (arrows, Home/End, typeahead, `Alt`+arrow to
|
|
333
|
+
* open without moving the highlight), focus management, and `Escape`/outside-click dismissal; the
|
|
334
|
+
* noctis wrapper injects the active locale so the filter collator matches the reader.
|
|
335
|
+
*
|
|
336
|
+
* Compose from parts: `Autocomplete.Root` owns the state and the `items`, `Autocomplete.Input` is the
|
|
337
|
+
* field (with optional leading `Icon`, `Clear`, and `Loading` affordances inside an `InputGroup`), and
|
|
338
|
+
* `Autocomplete.Content` holds the popup — an `Autocomplete.List` of `Item`s (use `Autocomplete.Highlight`
|
|
339
|
+
* to bold the match and `Autocomplete.Create` for the free-text "Use «query»" row), an
|
|
340
|
+
* `Autocomplete.Empty` no-matches line, an optional `Autocomplete.Status` for async loading, and
|
|
341
|
+
* `Group`/`GroupLabel`/`Separator` for sectioned suggestions.
|
|
342
|
+
*
|
|
343
|
+
* Styling is precompiled in `autocomplete.css`, keyed off each part's prefixed `data-slot`. Each part
|
|
344
|
+
* also carries the D12 `props()` escape hatch via `Object.assign` (e.g. `Autocomplete.Item.props({
|
|
345
|
+
* highlighted })`), returning a spreadable `{ "data-slot": "noctis-autocomplete-<part>", ...dataAttrs }`
|
|
346
|
+
* bag for a foreign element an `<Autocomplete.*>` can't wrap.
|
|
347
|
+
*
|
|
348
|
+
* The runtime compound is a plain object (kept tree-shakeable); per-part prop and state types are
|
|
349
|
+
* exposed through the matching `Autocomplete` namespace — e.g. `Autocomplete.Item.Props`.
|
|
350
|
+
*/
|
|
351
|
+
const Autocomplete$1 = {
|
|
352
|
+
Root: AutocompleteRoot,
|
|
353
|
+
Input: Object.assign(AutocompleteInput, { props: inputProps }),
|
|
354
|
+
InputGroup: AutocompleteInputGroup,
|
|
355
|
+
Icon: Object.assign(AutocompleteIcon, { props: iconProps }),
|
|
356
|
+
Clear: AutocompleteClear,
|
|
357
|
+
Loading: Object.assign(AutocompleteLoading, { props: loadingProps }),
|
|
358
|
+
Content: Object.assign(AutocompleteContent, { props: contentProps }),
|
|
359
|
+
List: Object.assign(AutocompleteList, { props: listProps }),
|
|
360
|
+
Item: Object.assign(AutocompleteItem, { props: itemProps }),
|
|
361
|
+
Create: AutocompleteCreate,
|
|
362
|
+
Highlight: AutocompleteHighlight,
|
|
363
|
+
Empty: Object.assign(AutocompleteEmpty, { props: emptyProps }),
|
|
364
|
+
Status: Object.assign(AutocompleteStatus, { props: statusProps }),
|
|
365
|
+
Group: Object.assign(AutocompleteGroup, { props: groupProps }),
|
|
366
|
+
GroupLabel: Object.assign(AutocompleteGroupLabel, { props: groupLabelProps }),
|
|
367
|
+
Collection: AutocompleteCollection,
|
|
368
|
+
Separator: Object.assign(AutocompleteSeparator, { props: separatorProps }),
|
|
369
|
+
/** Base UI's locale-aware filter collator hook, for custom `filter` logic on the root. */
|
|
370
|
+
useFilter: Autocomplete$2.useFilter
|
|
371
|
+
};
|
|
372
|
+
//#endregion
|
|
373
|
+
export { Autocomplete$1 as Autocomplete };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { AutocompleteSize } from "./autocomplete.context.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/autocomplete/autocomplete.props.d.ts
|
|
4
|
+
/** A spreadable data-attribute prop bag — the shape every `Autocomplete.*.props()` returns. */
|
|
5
|
+
type AutocompletePartProps = {
|
|
6
|
+
/** The slot value the matching `autocomplete.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 `Autocomplete.Input.props(...)` — the control size the field keys its height off, plus invalid. */
|
|
16
|
+
interface AutocompleteInputPropsArgs extends BasePropsArgs {
|
|
17
|
+
/** Control size, mirrored as `data-size`. @default "md" */
|
|
18
|
+
size?: AutocompleteSize;
|
|
19
|
+
/** Whether the field is invalid (drives the danger border via `data-invalid`). */
|
|
20
|
+
invalid?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Argument to `Autocomplete.Item.props(...)` — the per-row state the CSS keys its highlight/affordance off. */
|
|
23
|
+
interface AutocompleteItemPropsArgs extends BasePropsArgs {
|
|
24
|
+
/** Whether the pointer/keyboard is over this row (drives the highlight via `data-highlighted`). */
|
|
25
|
+
highlighted?: boolean;
|
|
26
|
+
/** Whether this row is disabled (drives the not-allowed affordance via `data-disabled`). */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** Whether this is the free-text `Create` row (drives the emphasized styling via `data-create`). */
|
|
29
|
+
create?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/** Argument to a stateless part's `.props(...)` — no variants/state of its own. */
|
|
32
|
+
type AutocompleteStatelessPropsArgs = BasePropsArgs;
|
|
33
|
+
/** Input prop bag: the slot anchor plus the `data-size` control size and the invalid state. */
|
|
34
|
+
declare function inputProps({
|
|
35
|
+
size,
|
|
36
|
+
invalid,
|
|
37
|
+
className
|
|
38
|
+
}?: AutocompleteInputPropsArgs): AutocompletePartProps;
|
|
39
|
+
/** Icon prop bag: just the slot anchor (the leading decorative field glyph). */
|
|
40
|
+
declare function iconProps({
|
|
41
|
+
className
|
|
42
|
+
}?: AutocompleteStatelessPropsArgs): AutocompletePartProps;
|
|
43
|
+
/** Loading prop bag: just the slot anchor (the trailing async spinner affordance). */
|
|
44
|
+
declare function loadingProps({
|
|
45
|
+
className
|
|
46
|
+
}?: AutocompleteStatelessPropsArgs): AutocompletePartProps;
|
|
47
|
+
/** Content prop bag: just the slot anchor (the popup surface paint is owned by the composed Surface). */
|
|
48
|
+
declare function contentProps({
|
|
49
|
+
className
|
|
50
|
+
}?: AutocompleteStatelessPropsArgs): AutocompletePartProps;
|
|
51
|
+
/** List prop bag: just the slot anchor. */
|
|
52
|
+
declare function listProps({
|
|
53
|
+
className
|
|
54
|
+
}?: AutocompleteStatelessPropsArgs): AutocompletePartProps;
|
|
55
|
+
/** Item prop bag: slot anchor plus the `data-highlighted`/`data-disabled`/`data-create` state. */
|
|
56
|
+
declare function itemProps({
|
|
57
|
+
highlighted,
|
|
58
|
+
disabled,
|
|
59
|
+
create,
|
|
60
|
+
className
|
|
61
|
+
}?: AutocompleteItemPropsArgs): AutocompletePartProps;
|
|
62
|
+
/** Empty prop bag: just the slot anchor. */
|
|
63
|
+
declare function emptyProps({
|
|
64
|
+
className
|
|
65
|
+
}?: AutocompleteStatelessPropsArgs): AutocompletePartProps;
|
|
66
|
+
/** Status prop bag: just the slot anchor. */
|
|
67
|
+
declare function statusProps({
|
|
68
|
+
className
|
|
69
|
+
}?: AutocompleteStatelessPropsArgs): AutocompletePartProps;
|
|
70
|
+
/** Group prop bag: just the slot anchor. */
|
|
71
|
+
declare function groupProps({
|
|
72
|
+
className
|
|
73
|
+
}?: AutocompleteStatelessPropsArgs): AutocompletePartProps;
|
|
74
|
+
/** Group-label prop bag: just the slot anchor. */
|
|
75
|
+
declare function groupLabelProps({
|
|
76
|
+
className
|
|
77
|
+
}?: AutocompleteStatelessPropsArgs): AutocompletePartProps;
|
|
78
|
+
/** Separator prop bag: just the slot anchor. */
|
|
79
|
+
declare function separatorProps({
|
|
80
|
+
className
|
|
81
|
+
}?: AutocompleteStatelessPropsArgs): AutocompletePartProps;
|
|
82
|
+
//#endregion
|
|
83
|
+
export { AutocompleteInputPropsArgs, AutocompleteItemPropsArgs, AutocompletePartProps, contentProps, emptyProps, groupLabelProps, groupProps, iconProps, inputProps, itemProps, listProps, loadingProps, separatorProps, statusProps };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { AUTOCOMPLETE_SLOTS } from "./autocomplete.slots.js";
|
|
2
|
+
//#region src/components/autocomplete/autocomplete.props.ts
|
|
3
|
+
/** Stamp a boolean state as a bare data-attribute: present (`""`) when on, absent (`undefined`) when off. */
|
|
4
|
+
const flag = (on) => on ? "" : void 0;
|
|
5
|
+
const withClassName = (bag, className) => className === void 0 ? bag : {
|
|
6
|
+
...bag,
|
|
7
|
+
className
|
|
8
|
+
};
|
|
9
|
+
/** Input prop bag: the slot anchor plus the `data-size` control size and the invalid state. */
|
|
10
|
+
function inputProps({ size = "md", invalid, className } = {}) {
|
|
11
|
+
return withClassName({
|
|
12
|
+
"data-slot": AUTOCOMPLETE_SLOTS.input,
|
|
13
|
+
"data-size": size,
|
|
14
|
+
"data-invalid": flag(invalid)
|
|
15
|
+
}, className);
|
|
16
|
+
}
|
|
17
|
+
/** Icon prop bag: just the slot anchor (the leading decorative field glyph). */
|
|
18
|
+
function iconProps({ className } = {}) {
|
|
19
|
+
return withClassName({ "data-slot": AUTOCOMPLETE_SLOTS.icon }, className);
|
|
20
|
+
}
|
|
21
|
+
/** Loading prop bag: just the slot anchor (the trailing async spinner affordance). */
|
|
22
|
+
function loadingProps({ className } = {}) {
|
|
23
|
+
return withClassName({ "data-slot": AUTOCOMPLETE_SLOTS.loading }, className);
|
|
24
|
+
}
|
|
25
|
+
/** Content prop bag: just the slot anchor (the popup surface paint is owned by the composed Surface). */
|
|
26
|
+
function contentProps({ className } = {}) {
|
|
27
|
+
return withClassName({ "data-slot": AUTOCOMPLETE_SLOTS.content }, className);
|
|
28
|
+
}
|
|
29
|
+
/** List prop bag: just the slot anchor. */
|
|
30
|
+
function listProps({ className } = {}) {
|
|
31
|
+
return withClassName({ "data-slot": AUTOCOMPLETE_SLOTS.list }, className);
|
|
32
|
+
}
|
|
33
|
+
/** Item prop bag: slot anchor plus the `data-highlighted`/`data-disabled`/`data-create` state. */
|
|
34
|
+
function itemProps({ highlighted, disabled, create, className } = {}) {
|
|
35
|
+
return withClassName({
|
|
36
|
+
"data-slot": AUTOCOMPLETE_SLOTS.item,
|
|
37
|
+
"data-highlighted": flag(highlighted),
|
|
38
|
+
"data-disabled": flag(disabled),
|
|
39
|
+
"data-create": flag(create)
|
|
40
|
+
}, className);
|
|
41
|
+
}
|
|
42
|
+
/** Empty prop bag: just the slot anchor. */
|
|
43
|
+
function emptyProps({ className } = {}) {
|
|
44
|
+
return withClassName({ "data-slot": AUTOCOMPLETE_SLOTS.empty }, className);
|
|
45
|
+
}
|
|
46
|
+
/** Status prop bag: just the slot anchor. */
|
|
47
|
+
function statusProps({ className } = {}) {
|
|
48
|
+
return withClassName({ "data-slot": AUTOCOMPLETE_SLOTS.status }, className);
|
|
49
|
+
}
|
|
50
|
+
/** Group prop bag: just the slot anchor. */
|
|
51
|
+
function groupProps({ className } = {}) {
|
|
52
|
+
return withClassName({ "data-slot": AUTOCOMPLETE_SLOTS.group }, className);
|
|
53
|
+
}
|
|
54
|
+
/** Group-label prop bag: just the slot anchor. */
|
|
55
|
+
function groupLabelProps({ className } = {}) {
|
|
56
|
+
return withClassName({ "data-slot": AUTOCOMPLETE_SLOTS.groupLabel }, className);
|
|
57
|
+
}
|
|
58
|
+
/** Separator prop bag: just the slot anchor. */
|
|
59
|
+
function separatorProps({ className } = {}) {
|
|
60
|
+
return withClassName({ "data-slot": AUTOCOMPLETE_SLOTS.separator }, className);
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { contentProps, emptyProps, groupLabelProps, groupProps, iconProps, inputProps, itemProps, listProps, loadingProps, separatorProps, statusProps };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region src/components/autocomplete/autocomplete.slots.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The `data-*` hooks `Autocomplete` stamps on its parts, for host-side styling and tests. Slot values
|
|
4
|
+
* mark each rendered element; the state attributes are emitted by Base UI's Autocomplete — pair a slot
|
|
5
|
+
* with a state to target, say, the highlighted suggestion or the field while its popup is open.
|
|
6
|
+
*/
|
|
7
|
+
declare enum AutocompleteDataAttributes {
|
|
8
|
+
/** Marks each rendered part. */
|
|
9
|
+
slot = "data-slot",
|
|
10
|
+
/** The control size mirrored from the root's `size` (`md`/`lg`); the field height and popup density key off it. */
|
|
11
|
+
size = "data-size",
|
|
12
|
+
/** Present on the input while its suggestions popup is open. */
|
|
13
|
+
popupOpen = "data-popup-open",
|
|
14
|
+
/** Present on the suggestion row the pointer or keyboard is currently over. */
|
|
15
|
+
highlighted = "data-highlighted",
|
|
16
|
+
/** Present on a disabled suggestion row or input. */
|
|
17
|
+
disabled = "data-disabled",
|
|
18
|
+
/** Present on the input/field when the field is invalid (set explicitly or by a `Field`). */
|
|
19
|
+
invalid = "data-invalid",
|
|
20
|
+
/** Present on the `Create` row, for its slightly emphasized free-text-entry styling. */
|
|
21
|
+
create = "data-create",
|
|
22
|
+
/** The side of the anchor the popup actually rendered on (`bottom`, `top`, …). */
|
|
23
|
+
side = "data-side",
|
|
24
|
+
/** Present on the popup while its suggestions list is empty. */
|
|
25
|
+
empty = "data-empty",
|
|
26
|
+
/** Present on the popup for the first frame after mount — the transition's start state. */
|
|
27
|
+
startingStyle = "data-starting-style",
|
|
28
|
+
/** Present on the popup while it transitions out before unmounting. */
|
|
29
|
+
endingStyle = "data-ending-style"
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { AutocompleteDataAttributes };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
//#region src/components/autocomplete/autocomplete.slots.ts
|
|
2
|
+
/**
|
|
3
|
+
* The slot vocabulary every `Autocomplete` part stamps as its `data-slot`. The authored source the
|
|
4
|
+
* orchestration file reads from, prefixed `noctis-autocomplete-{part}` (the precompiled
|
|
5
|
+
* `autocomplete.css` keys every rule off these anchors); SLOTS.md still generates from the token-graph
|
|
6
|
+
* declarations.
|
|
7
|
+
*
|
|
8
|
+
* `input-group`, `icon`, `clear`, `loading`, `mark`, `positioner`, `group`, and `separator` are
|
|
9
|
+
* styling-only anchors (the field shell, the leading glyph, the clear/loading affordances, the match
|
|
10
|
+
* highlight, the z-index wrapper, the group wrapper, and the hairline) — they carry no token mints, so
|
|
11
|
+
* they live here but not in the token-graph anatomy.
|
|
12
|
+
*/
|
|
13
|
+
const AUTOCOMPLETE_SLOTS = {
|
|
14
|
+
input: "noctis-autocomplete-input",
|
|
15
|
+
inputGroup: "noctis-autocomplete-input-group",
|
|
16
|
+
icon: "noctis-autocomplete-icon",
|
|
17
|
+
clear: "noctis-autocomplete-clear",
|
|
18
|
+
loading: "noctis-autocomplete-loading",
|
|
19
|
+
positioner: "noctis-autocomplete-positioner",
|
|
20
|
+
content: "noctis-autocomplete-content",
|
|
21
|
+
list: "noctis-autocomplete-list",
|
|
22
|
+
item: "noctis-autocomplete-item",
|
|
23
|
+
mark: "noctis-autocomplete-mark",
|
|
24
|
+
empty: "noctis-autocomplete-empty",
|
|
25
|
+
status: "noctis-autocomplete-status",
|
|
26
|
+
group: "noctis-autocomplete-group",
|
|
27
|
+
groupLabel: "noctis-autocomplete-group-label",
|
|
28
|
+
separator: "noctis-autocomplete-separator"
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* The `data-*` hooks `Autocomplete` stamps on its parts, for host-side styling and tests. Slot values
|
|
32
|
+
* mark each rendered element; the state attributes are emitted by Base UI's Autocomplete — pair a slot
|
|
33
|
+
* with a state to target, say, the highlighted suggestion or the field while its popup is open.
|
|
34
|
+
*/
|
|
35
|
+
let AutocompleteDataAttributes = /* @__PURE__ */ function(AutocompleteDataAttributes) {
|
|
36
|
+
/** Marks each rendered part. */
|
|
37
|
+
AutocompleteDataAttributes["slot"] = "data-slot";
|
|
38
|
+
/** The control size mirrored from the root's `size` (`md`/`lg`); the field height and popup density key off it. */
|
|
39
|
+
AutocompleteDataAttributes["size"] = "data-size";
|
|
40
|
+
/** Present on the input while its suggestions popup is open. */
|
|
41
|
+
AutocompleteDataAttributes["popupOpen"] = "data-popup-open";
|
|
42
|
+
/** Present on the suggestion row the pointer or keyboard is currently over. */
|
|
43
|
+
AutocompleteDataAttributes["highlighted"] = "data-highlighted";
|
|
44
|
+
/** Present on a disabled suggestion row or input. */
|
|
45
|
+
AutocompleteDataAttributes["disabled"] = "data-disabled";
|
|
46
|
+
/** Present on the input/field when the field is invalid (set explicitly or by a `Field`). */
|
|
47
|
+
AutocompleteDataAttributes["invalid"] = "data-invalid";
|
|
48
|
+
/** Present on the `Create` row, for its slightly emphasized free-text-entry styling. */
|
|
49
|
+
AutocompleteDataAttributes["create"] = "data-create";
|
|
50
|
+
/** The side of the anchor the popup actually rendered on (`bottom`, `top`, …). */
|
|
51
|
+
AutocompleteDataAttributes["side"] = "data-side";
|
|
52
|
+
/** Present on the popup while its suggestions list is empty. */
|
|
53
|
+
AutocompleteDataAttributes["empty"] = "data-empty";
|
|
54
|
+
/** Present on the popup for the first frame after mount — the transition's start state. */
|
|
55
|
+
AutocompleteDataAttributes["startingStyle"] = "data-starting-style";
|
|
56
|
+
/** Present on the popup while it transitions out before unmounting. */
|
|
57
|
+
AutocompleteDataAttributes["endingStyle"] = "data-ending-style";
|
|
58
|
+
return AutocompleteDataAttributes;
|
|
59
|
+
}({});
|
|
60
|
+
//#endregion
|
|
61
|
+
export { AUTOCOMPLETE_SLOTS, AutocompleteDataAttributes };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, use } from "react";
|
|
3
|
+
//#region src/components/avatar/avatar.context.ts
|
|
4
|
+
const AvatarImageStatusContext = createContext(null);
|
|
5
|
+
const AvatarImageStatusProvider = AvatarImageStatusContext.Provider;
|
|
6
|
+
/** Read the avatar's image-loading status, or `null` outside an `Avatar.Root`. */
|
|
7
|
+
function useAvatarImageStatus() {
|
|
8
|
+
return use(AvatarImageStatusContext);
|
|
9
|
+
}
|
|
10
|
+
const AvatarGroupContext = createContext(null);
|
|
11
|
+
const AvatarGroupProvider = AvatarGroupContext.Provider;
|
|
12
|
+
/**
|
|
13
|
+
* Read the enclosing `Avatar.Group`'s shared `size`/`shape`, or `null` when the avatar stands alone.
|
|
14
|
+
* A bare `<Avatar.Root>` is valid, so this returns `null` rather than throwing — the avatar falls back
|
|
15
|
+
* to its own props and defaults.
|
|
16
|
+
*/
|
|
17
|
+
function useAvatarGroup() {
|
|
18
|
+
return use(AvatarGroupContext);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { AvatarGroupProvider, AvatarImageStatusProvider, useAvatarGroup, useAvatarImageStatus };
|