@central-ui/react 0.1.1 → 0.2.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/LICENSE +49 -0
- package/README.md +1 -1
- package/dist/components/accordion/index.d.ts +7 -6
- package/dist/components/accordion/index.js +13 -10
- package/dist/components/autocomplete/index.d.ts +22 -33
- package/dist/components/autocomplete/index.js +90 -73
- package/dist/components/avatar/index.d.ts +1 -2
- package/dist/components/avatar/index.js +6 -6
- package/dist/components/badge/index.d.ts +0 -1
- package/dist/components/badge/index.js +2 -2
- package/dist/components/banner/index.d.ts +1 -1
- package/dist/components/banner/index.js +24 -26
- package/dist/components/barchart/index.d.ts +106 -0
- package/dist/components/barchart/index.js +122 -0
- package/dist/components/breadcrumb/index.d.ts +0 -1
- package/dist/components/breadcrumb/index.js +6 -7
- package/dist/components/button/index.d.ts +3 -4
- package/dist/components/button/index.js +11 -12
- package/dist/components/card/index.d.ts +0 -1
- package/dist/components/card/index.js +0 -1
- package/dist/components/checkbox/index.d.ts +13 -11
- package/dist/components/checkbox/index.js +59 -39
- package/dist/components/chip/index.d.ts +1 -1
- package/dist/components/chip/index.js +2 -3
- package/dist/components/combobox/index.d.ts +32 -44
- package/dist/components/combobox/index.js +112 -88
- package/dist/components/datepicker/index.d.ts +54 -55
- package/dist/components/datepicker/index.js +105 -100
- package/dist/components/dialog/index.d.ts +17 -30
- package/dist/components/dialog/index.js +25 -26
- package/dist/components/divider/index.d.ts +0 -1
- package/dist/components/divider/index.js +0 -1
- package/dist/components/donutchart/index.d.ts +100 -0
- package/dist/components/donutchart/index.js +178 -0
- package/dist/components/drawer/index.d.ts +15 -24
- package/dist/components/drawer/index.js +45 -47
- package/dist/components/empty/index.d.ts +1 -2
- package/dist/components/empty/index.js +2 -4
- package/dist/components/fileupload/index.d.ts +4 -9
- package/dist/components/fileupload/index.js +27 -39
- package/dist/components/form/index.d.ts +0 -1
- package/dist/components/form/index.js +0 -1
- package/dist/components/horizontalbarchart/index.d.ts +120 -0
- package/dist/components/horizontalbarchart/index.js +193 -0
- package/dist/components/input/index.d.ts +23 -23
- package/dist/components/input/index.js +86 -115
- package/dist/components/linechart/index.d.ts +114 -0
- package/dist/components/linechart/index.js +139 -0
- package/dist/components/menu/index.d.ts +14 -16
- package/dist/components/menu/index.js +56 -53
- package/dist/components/metric/index.d.ts +0 -1
- package/dist/components/metric/index.js +0 -1
- package/dist/components/numberinput/index.d.ts +16 -23
- package/dist/components/numberinput/index.js +55 -68
- package/dist/components/otpinput/index.d.ts +14 -9
- package/dist/components/otpinput/index.js +32 -25
- package/dist/components/page/index.d.ts +0 -1
- package/dist/components/page/index.js +2 -4
- package/dist/components/passwordinput/index.d.ts +16 -13
- package/dist/components/passwordinput/index.js +47 -56
- package/dist/components/popover/index.d.ts +21 -19
- package/dist/components/popover/index.js +40 -21
- package/dist/components/radio/index.d.ts +13 -9
- package/dist/components/radio/index.js +80 -71
- package/dist/components/ratinginput/index.d.ts +15 -10
- package/dist/components/ratinginput/index.js +38 -18
- package/dist/components/select/index.d.ts +29 -32
- package/dist/components/select/index.js +79 -50
- package/dist/components/skeleton/index.d.ts +0 -1
- package/dist/components/skeleton/index.js +0 -1
- package/dist/components/slider/index.d.ts +14 -9
- package/dist/components/slider/index.js +75 -74
- package/dist/components/spinner/index.d.ts +2 -3
- package/dist/components/spinner/index.js +2 -3
- package/dist/components/splitter/index.d.ts +1 -2
- package/dist/components/splitter/index.js +6 -7
- package/dist/components/stepper/index.d.ts +8 -20
- package/dist/components/stepper/index.js +15 -16
- package/dist/components/switch/index.d.ts +12 -10
- package/dist/components/switch/index.js +52 -36
- package/dist/components/table/index.d.ts +3 -3
- package/dist/components/table/index.js +17 -16
- package/dist/components/tabs/index.d.ts +3 -4
- package/dist/components/tabs/index.js +6 -7
- package/dist/components/textarea/index.d.ts +16 -13
- package/dist/components/textarea/index.js +46 -55
- package/dist/components/textlink/index.d.ts +3 -1
- package/dist/components/textlink/index.js +4 -1
- package/dist/components/toast/index.d.ts +8 -14
- package/dist/components/toast/index.js +54 -54
- package/dist/components/toggle/index.d.ts +5 -6
- package/dist/components/toggle/index.js +19 -26
- package/dist/components/tooltip/index.d.ts +11 -13
- package/dist/components/tooltip/index.js +14 -11
- package/dist/components/tour/index.d.ts +154 -0
- package/dist/components/tour/index.js +280 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +5 -1
- package/dist/types/Icon.d.ts +10 -0
- package/dist/types/Icon.js +1 -0
- package/dist/types/Style.d.ts +0 -1
- package/dist/types/Style.js +0 -1
- package/dist/types/Tone.d.ts +0 -1
- package/dist/types/Tone.js +0 -1
- package/dist/types/Validation.d.ts +12 -0
- package/dist/types/Validation.js +1 -0
- package/dist/utils/ArkStateToDataAttributes.d.ts +0 -1
- package/dist/utils/ArkStateToDataAttributes.js +3 -2
- package/dist/utils/Tone.d.ts +0 -1
- package/dist/utils/Tone.js +1 -2
- package/dist/utils/Validation.d.ts +14 -0
- package/dist/utils/Validation.js +23 -0
- package/dist/utils/asChild.d.ts +41 -0
- package/dist/utils/asChild.js +15 -0
- package/dist/utils/icons.d.ts +24 -0
- package/dist/utils/icons.js +160 -0
- package/dist/utils/useForwardClickToInput.d.ts +0 -1
- package/dist/utils/useForwardClickToInput.js +4 -3
- package/dist/utils/virtualization/useVirtualizedAutocomplete.d.ts +0 -1
- package/dist/utils/virtualization/useVirtualizedAutocomplete.js +0 -1
- package/dist/utils/virtualization/useVirtualizedCombobox.d.ts +0 -1
- package/dist/utils/virtualization/useVirtualizedCombobox.js +0 -1
- package/dist/utils/virtualization/useVirtualizedTable.d.ts +0 -1
- package/dist/utils/virtualization/useVirtualizedTable.js +0 -1
- package/package.json +12 -11
- package/src/presets/shopify-polaris/shopify-polaris-autocomplete.css +15 -6
- package/src/presets/shopify-polaris/shopify-polaris-badge.css +1 -1
- package/src/presets/shopify-polaris/shopify-polaris-barchart.css +64 -0
- package/src/presets/shopify-polaris/shopify-polaris-checkbox.css +2 -2
- package/src/presets/shopify-polaris/shopify-polaris-chip.css +3 -3
- package/src/presets/shopify-polaris/shopify-polaris-combobox.css +19 -10
- package/src/presets/shopify-polaris/shopify-polaris-datepicker.css +20 -11
- package/src/presets/shopify-polaris/shopify-polaris-dialog.css +16 -0
- package/src/presets/shopify-polaris/shopify-polaris-donutchart.css +172 -0
- package/src/presets/shopify-polaris/shopify-polaris-drawer.css +16 -0
- package/src/presets/shopify-polaris/shopify-polaris-fileupload.css +1 -1
- package/src/presets/shopify-polaris/shopify-polaris-horizontalbarchart.css +60 -0
- package/src/presets/shopify-polaris/shopify-polaris-input.css +14 -5
- package/src/presets/shopify-polaris/shopify-polaris-linechart.css +68 -0
- package/src/presets/shopify-polaris/shopify-polaris-menu.css +47 -6
- package/src/presets/shopify-polaris/shopify-polaris-numberinput.css +16 -7
- package/src/presets/shopify-polaris/shopify-polaris-otpinput.css +3 -3
- package/src/presets/shopify-polaris/shopify-polaris-passwordinput.css +14 -5
- package/src/presets/shopify-polaris/shopify-polaris-popover.css +29 -0
- package/src/presets/shopify-polaris/shopify-polaris-radio.css +2 -2
- package/src/presets/shopify-polaris/shopify-polaris-ratinginput.css +2 -2
- package/src/presets/shopify-polaris/shopify-polaris-select.css +15 -6
- package/src/presets/shopify-polaris/shopify-polaris-slider.css +2 -2
- package/src/presets/shopify-polaris/shopify-polaris-stepper.css +16 -0
- package/src/presets/shopify-polaris/shopify-polaris-switch.css +2 -2
- package/src/presets/shopify-polaris/shopify-polaris-textarea.css +13 -4
- package/src/presets/shopify-polaris/shopify-polaris-toast.css +43 -0
- package/src/presets/shopify-polaris/shopify-polaris-tooltip.css +16 -0
- package/src/presets/shopify-polaris/shopify-polaris.css +5 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-autocomplete.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-barchart.css +64 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-checkbox.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-combobox.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-datepicker.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-dialog.css +9 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-donutchart.css +172 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-drawer.css +9 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-fileupload.css +1 -1
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-horizontalbarchart.css +60 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-input.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-linechart.css +68 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-menu.css +9 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-numberinput.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-otpinput.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-passwordinput.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-popover.css +22 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-radio.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-ratinginput.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-slider.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-stepper.css +9 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-switch.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-textarea.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-tooltip.css +9 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy.css +4 -0
- package/dist/components/accordion/index.d.ts.map +0 -1
- package/dist/components/accordion/index.js.map +0 -1
- package/dist/components/autocomplete/index.d.ts.map +0 -1
- package/dist/components/autocomplete/index.js.map +0 -1
- package/dist/components/avatar/index.d.ts.map +0 -1
- package/dist/components/avatar/index.js.map +0 -1
- package/dist/components/badge/index.d.ts.map +0 -1
- package/dist/components/badge/index.js.map +0 -1
- package/dist/components/banner/index.d.ts.map +0 -1
- package/dist/components/banner/index.js.map +0 -1
- package/dist/components/breadcrumb/index.d.ts.map +0 -1
- package/dist/components/breadcrumb/index.js.map +0 -1
- package/dist/components/button/index.d.ts.map +0 -1
- package/dist/components/button/index.js.map +0 -1
- package/dist/components/card/index.d.ts.map +0 -1
- package/dist/components/card/index.js.map +0 -1
- package/dist/components/checkbox/index.d.ts.map +0 -1
- package/dist/components/checkbox/index.js.map +0 -1
- package/dist/components/chip/index.d.ts.map +0 -1
- package/dist/components/chip/index.js.map +0 -1
- package/dist/components/combobox/index.d.ts.map +0 -1
- package/dist/components/combobox/index.js.map +0 -1
- package/dist/components/datepicker/index.d.ts.map +0 -1
- package/dist/components/datepicker/index.js.map +0 -1
- package/dist/components/dialog/index.d.ts.map +0 -1
- package/dist/components/dialog/index.js.map +0 -1
- package/dist/components/divider/index.d.ts.map +0 -1
- package/dist/components/divider/index.js.map +0 -1
- package/dist/components/drawer/index.d.ts.map +0 -1
- package/dist/components/drawer/index.js.map +0 -1
- package/dist/components/empty/index.d.ts.map +0 -1
- package/dist/components/empty/index.js.map +0 -1
- package/dist/components/fileupload/index.d.ts.map +0 -1
- package/dist/components/fileupload/index.js.map +0 -1
- package/dist/components/form/index.d.ts.map +0 -1
- package/dist/components/form/index.js.map +0 -1
- package/dist/components/input/index.d.ts.map +0 -1
- package/dist/components/input/index.js.map +0 -1
- package/dist/components/menu/index.d.ts.map +0 -1
- package/dist/components/menu/index.js.map +0 -1
- package/dist/components/metric/index.d.ts.map +0 -1
- package/dist/components/metric/index.js.map +0 -1
- package/dist/components/numberinput/index.d.ts.map +0 -1
- package/dist/components/numberinput/index.js.map +0 -1
- package/dist/components/otpinput/index.d.ts.map +0 -1
- package/dist/components/otpinput/index.js.map +0 -1
- package/dist/components/page/index.d.ts.map +0 -1
- package/dist/components/page/index.js.map +0 -1
- package/dist/components/passwordinput/index.d.ts.map +0 -1
- package/dist/components/passwordinput/index.js.map +0 -1
- package/dist/components/popover/index.d.ts.map +0 -1
- package/dist/components/popover/index.js.map +0 -1
- package/dist/components/radio/index.d.ts.map +0 -1
- package/dist/components/radio/index.js.map +0 -1
- package/dist/components/ratinginput/index.d.ts.map +0 -1
- package/dist/components/ratinginput/index.js.map +0 -1
- package/dist/components/select/index.d.ts.map +0 -1
- package/dist/components/select/index.js.map +0 -1
- package/dist/components/skeleton/index.d.ts.map +0 -1
- package/dist/components/skeleton/index.js.map +0 -1
- package/dist/components/slider/index.d.ts.map +0 -1
- package/dist/components/slider/index.js.map +0 -1
- package/dist/components/spinner/index.d.ts.map +0 -1
- package/dist/components/spinner/index.js.map +0 -1
- package/dist/components/splitter/index.d.ts.map +0 -1
- package/dist/components/splitter/index.js.map +0 -1
- package/dist/components/stepper/index.d.ts.map +0 -1
- package/dist/components/stepper/index.js.map +0 -1
- package/dist/components/switch/index.d.ts.map +0 -1
- package/dist/components/switch/index.js.map +0 -1
- package/dist/components/table/index.d.ts.map +0 -1
- package/dist/components/table/index.js.map +0 -1
- package/dist/components/tabs/index.d.ts.map +0 -1
- package/dist/components/tabs/index.js.map +0 -1
- package/dist/components/textarea/index.d.ts.map +0 -1
- package/dist/components/textarea/index.js.map +0 -1
- package/dist/components/textlink/index.d.ts.map +0 -1
- package/dist/components/textlink/index.js.map +0 -1
- package/dist/components/toast/index.d.ts.map +0 -1
- package/dist/components/toast/index.js.map +0 -1
- package/dist/components/toggle/index.d.ts.map +0 -1
- package/dist/components/toggle/index.js.map +0 -1
- package/dist/components/tooltip/index.d.ts.map +0 -1
- package/dist/components/tooltip/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types/Style.d.ts.map +0 -1
- package/dist/types/Style.js.map +0 -1
- package/dist/types/Tone.d.ts.map +0 -1
- package/dist/types/Tone.js.map +0 -1
- package/dist/utils/ArkStateToDataAttributes.d.ts.map +0 -1
- package/dist/utils/ArkStateToDataAttributes.js.map +0 -1
- package/dist/utils/Tone.d.ts.map +0 -1
- package/dist/utils/Tone.js.map +0 -1
- package/dist/utils/useForwardClickToInput.d.ts.map +0 -1
- package/dist/utils/useForwardClickToInput.js.map +0 -1
- package/dist/utils/virtualization/useVirtualizedAutocomplete.d.ts.map +0 -1
- package/dist/utils/virtualization/useVirtualizedAutocomplete.js.map +0 -1
- package/dist/utils/virtualization/useVirtualizedCombobox.d.ts.map +0 -1
- package/dist/utils/virtualization/useVirtualizedCombobox.js.map +0 -1
- package/dist/utils/virtualization/useVirtualizedTable.d.ts.map +0 -1
- package/dist/utils/virtualization/useVirtualizedTable.js.map +0 -1
|
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox';
|
|
3
3
|
import { CheckboxGroup as BaseCheckboxGroup } from '@base-ui/react/checkbox-group';
|
|
4
4
|
import { createContext, forwardRef, useContext, useEffect, useId, useState, } from 'react';
|
|
5
|
-
import { Check, Minus } from
|
|
6
|
-
import {
|
|
5
|
+
import { Check, Minus } from "../../utils/icons.js";
|
|
6
|
+
import { readValidation, validationAttributes, validationMessageContent } from "../../utils/Validation.js";
|
|
7
7
|
/**
|
|
8
8
|
* Keep Button and Indicator inside the same Root as Label. Indicator tracks checked and indeterminate state automatically; no conditional checkmark needed. Use CheckboxGroup only when coordinating several checkbox roots.
|
|
9
9
|
*
|
|
@@ -39,9 +39,10 @@ import { ToneProvider, useToneContext } from "../../utils/Tone.js";
|
|
|
39
39
|
* )
|
|
40
40
|
* }
|
|
41
41
|
*/
|
|
42
|
-
export function Root({ children, id,
|
|
43
|
-
|
|
42
|
+
export function Root({ children, id, validation, ...coreProps }) {
|
|
43
|
+
//1. Holding the ids of Description, Error and Success, so Button announces them to screen readers through aria-describedby
|
|
44
44
|
const [messageIds, setMessageIds] = useState([]);
|
|
45
|
+
//2. Mirroring Base UI's live state, so parts outside Button (Label, Description…) can carry its data attributes
|
|
45
46
|
const [state, setState] = useState({
|
|
46
47
|
checked: coreProps.checked ?? coreProps.defaultChecked ?? false,
|
|
47
48
|
indeterminate: coreProps.indeterminate ?? false,
|
|
@@ -49,52 +50,71 @@ export function Root({ children, id, tone = 'neutral', ...coreProps }) {
|
|
|
49
50
|
readOnly: coreProps.readOnly ?? false,
|
|
50
51
|
required: coreProps.required ?? false,
|
|
51
52
|
});
|
|
53
|
+
//3. Sharing everything with the parts
|
|
54
|
+
const generatedId = useId();
|
|
52
55
|
return (_jsx(CheckboxContext.Provider, { value: {
|
|
53
56
|
coreProps: { ...coreProps, id: id ?? generatedId },
|
|
54
57
|
state,
|
|
55
58
|
setState,
|
|
56
59
|
messageIds,
|
|
57
60
|
setMessageIds,
|
|
58
|
-
|
|
61
|
+
validation: readValidation(validation),
|
|
62
|
+
}, children: children }));
|
|
59
63
|
}
|
|
60
64
|
/** Optional: controls multiple checkboxes as a native array of checked values. Put individual Roots inside and give each child a value. For a select-all checkbox, use parent on its Root and provide allValues on this controlled group; Base UI derives checked and indeterminate automatically. */
|
|
61
|
-
export const CheckboxGroup = forwardRef(function CheckboxGroup({ disableStyle, className, ...props }, ref) {
|
|
65
|
+
export const CheckboxGroup = /* @__PURE__ */ forwardRef(function CheckboxGroup({ disableStyle, className, ...props }, ref) {
|
|
62
66
|
return (_jsx(BaseCheckboxGroup, { ...props, ref: ref, "data-component": "checkbox-checkboxgroup", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
63
67
|
});
|
|
64
|
-
export const Container = forwardRef(function Container({ disableStyle, className, ...props }, ref) {
|
|
68
|
+
export const Container = /* @__PURE__ */ forwardRef(function Container({ disableStyle, className, ...props }, ref) {
|
|
65
69
|
return (_jsx("div", { ...props, ref: ref, "data-component": "checkbox-container", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
66
70
|
});
|
|
67
|
-
export const Button = forwardRef(function Button({ disableStyle, className, ...props }, ref) {
|
|
71
|
+
export const Button = /* @__PURE__ */ forwardRef(function Button({ disableStyle, className, ...props }, ref) {
|
|
68
72
|
const context = useCheckboxContext();
|
|
69
|
-
|
|
70
|
-
return (_jsx(BaseCheckbox.Root, { ...props, ...context.coreProps, ref: ref, "data-tone": tone, "aria-invalid": tone === 'invalid' || props['aria-invalid'] || undefined, "aria-describedby": [props['aria-describedby'], ...context.messageIds]
|
|
73
|
+
return (_jsx(BaseCheckbox.Root, { ...props, ...context.coreProps, ref: ref, ...validationAttributes(context.validation), "aria-invalid": context.validation.state === 'error' || props['aria-invalid'] || undefined, "aria-describedby": [props['aria-describedby'], ...context.messageIds]
|
|
71
74
|
.filter(Boolean)
|
|
72
75
|
.join(' ') || undefined, "data-component": "checkbox-button", "data-style-disabled": disableStyle ? '' : undefined, className: className, render: (buttonProps, state) => (_jsx(CheckboxButtonSurface, { ...buttonProps, state: state })) }));
|
|
73
76
|
});
|
|
74
77
|
/** Tracks the surrounding item state automatically. Keep it mounted; do not add your own visibility condition. Use the supplied default visual unless customization is needed. */
|
|
75
|
-
export const Indicator = forwardRef(function Indicator({ disableStyle, className, ...props }, ref) {
|
|
76
|
-
return (_jsx(BaseCheckbox.Indicator, { ...props, ref: ref, "data-component": "checkbox-indicator", "data-style-disabled": disableStyle ? '' : undefined, className: className, render: (indicatorProps, state) => (_jsx("span", { ...indicatorProps, children:
|
|
78
|
+
export const Indicator = /* @__PURE__ */ forwardRef(function Indicator({ disableStyle, className, ...props }, ref) {
|
|
79
|
+
return (_jsx(BaseCheckbox.Indicator, { ...props, ref: ref, "data-component": "checkbox-indicator", "data-style-disabled": disableStyle ? '' : undefined, className: className, render: (indicatorProps, state) => (_jsx("span", { ...indicatorProps, children: (() => {
|
|
80
|
+
if (state.indeterminate)
|
|
81
|
+
return _jsx(Minus, { "aria-hidden": true, strokeWidth: 3.5, "data-component": "checkbox-indicator-1" });
|
|
82
|
+
if (state.checked)
|
|
83
|
+
return _jsx(Check, { "aria-hidden": true, strokeWidth: 3.5, "data-component": "checkbox-indicator-2" });
|
|
84
|
+
return null;
|
|
85
|
+
})() })) }));
|
|
77
86
|
});
|
|
78
87
|
/** Labels the associated control automatically. Supply the visible text; do not wire a second label association. */
|
|
79
|
-
export const Label = forwardRef(function Label({ disableStyle, className, ...props }, ref) {
|
|
88
|
+
export const Label = /* @__PURE__ */ forwardRef(function Label({ disableStyle, className, ...props }, ref) {
|
|
80
89
|
const context = useCheckboxContext();
|
|
81
90
|
return (_jsx("label", { ...usePartAttributes(), ...props, ref: ref, htmlFor: context.coreProps.id, "data-component": "checkbox-label", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
82
91
|
});
|
|
83
|
-
export const Description = forwardRef(function Description({ disableStyle, className, id, ...props }, ref) {
|
|
92
|
+
export const Description = /* @__PURE__ */ forwardRef(function Description({ disableStyle, className, id, ...props }, ref) {
|
|
84
93
|
const messageId = useMessageId(id);
|
|
85
94
|
return (_jsx("span", { ...usePartAttributes(), ...props, ref: ref, id: messageId, "data-component": "checkbox-description", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
86
95
|
});
|
|
87
|
-
/**
|
|
88
|
-
export const Error = forwardRef(function Error({
|
|
89
|
-
const
|
|
90
|
-
|
|
96
|
+
/** Shows itself only while Root's validation is `'error'`: with no children it shows the message from `['error', message]`, a function children formats that message, and other children replace it. */
|
|
97
|
+
export const Error = /* @__PURE__ */ forwardRef(function Error({ children, ...props }, ref) {
|
|
98
|
+
const context = useCheckboxContext();
|
|
99
|
+
const content = validationMessageContent(context.validation, 'error', children);
|
|
100
|
+
if (content === undefined)
|
|
101
|
+
return null;
|
|
102
|
+
return _jsx(Message, { ...props, ref: ref, role: "alert", component: "checkbox-error", children: content });
|
|
91
103
|
});
|
|
92
|
-
/**
|
|
93
|
-
export const Success = forwardRef(function Success({
|
|
104
|
+
/** Shows itself only while Root's validation is `'success'`: with no children it shows the message from `['success', message]`, a function children formats that message, and other children replace it. */
|
|
105
|
+
export const Success = /* @__PURE__ */ forwardRef(function Success({ children, ...props }, ref) {
|
|
106
|
+
const context = useCheckboxContext();
|
|
107
|
+
const content = validationMessageContent(context.validation, 'success', children);
|
|
108
|
+
if (content === undefined)
|
|
109
|
+
return null;
|
|
110
|
+
return _jsx(Message, { ...props, ref: ref, role: "status", component: "checkbox-success", children: content });
|
|
111
|
+
});
|
|
112
|
+
// The shared body of Error and Success, mounted only while they show, so only visible messages describe the checkbox
|
|
113
|
+
const Message = /* @__PURE__ */ forwardRef(function Message({ disableStyle, className, id, component, ...props }, ref) {
|
|
94
114
|
const messageId = useMessageId(id);
|
|
95
|
-
return
|
|
115
|
+
return _jsx("span", { "aria-atomic": "true", ...usePartAttributes(), ...props, ref: ref, id: messageId, "data-component": component, "data-style-disabled": disableStyle ? '' : undefined, className: className });
|
|
96
116
|
});
|
|
97
|
-
const CheckboxContext = createContext(null);
|
|
117
|
+
const CheckboxContext = /* @__PURE__ */ createContext(null);
|
|
98
118
|
function useCheckboxContext() {
|
|
99
119
|
const context = useContext(CheckboxContext);
|
|
100
120
|
if (!context)
|
|
@@ -102,21 +122,21 @@ function useCheckboxContext() {
|
|
|
102
122
|
return context;
|
|
103
123
|
}
|
|
104
124
|
function usePartAttributes() {
|
|
105
|
-
const
|
|
106
|
-
const tone = useToneContext();
|
|
125
|
+
const context = useCheckboxContext();
|
|
107
126
|
return {
|
|
108
|
-
'data-checked': state.checked ? '' : undefined,
|
|
109
|
-
'data-indeterminate': state.indeterminate ? '' : undefined,
|
|
110
|
-
'data-disabled': state.disabled ? '' : undefined,
|
|
111
|
-
'data-readonly': state.readOnly ? '' : undefined,
|
|
112
|
-
'data-required': state.required ? '' : undefined,
|
|
113
|
-
|
|
127
|
+
'data-checked': context.state.checked ? '' : undefined,
|
|
128
|
+
'data-indeterminate': context.state.indeterminate ? '' : undefined,
|
|
129
|
+
'data-disabled': context.state.disabled ? '' : undefined,
|
|
130
|
+
'data-readonly': context.state.readOnly ? '' : undefined,
|
|
131
|
+
'data-required': context.state.required ? '' : undefined,
|
|
132
|
+
...validationAttributes(context.validation),
|
|
114
133
|
};
|
|
115
134
|
}
|
|
116
|
-
|
|
117
|
-
|
|
135
|
+
// Rendered by Base UI as the checkbox element, it reports Base UI's live state back to Root's mirror
|
|
136
|
+
const CheckboxButtonSurface = /* @__PURE__ */ forwardRef(function CheckboxButtonSurface({ state, ...props }, ref) {
|
|
137
|
+
const context = useCheckboxContext();
|
|
118
138
|
useEffect(() => {
|
|
119
|
-
setState({
|
|
139
|
+
context.setState({
|
|
120
140
|
checked: state.checked,
|
|
121
141
|
indeterminate: state.indeterminate,
|
|
122
142
|
disabled: state.disabled,
|
|
@@ -129,18 +149,18 @@ const CheckboxButtonSurface = forwardRef(function CheckboxButtonSurface({ state,
|
|
|
129
149
|
state.disabled,
|
|
130
150
|
state.readOnly,
|
|
131
151
|
state.required,
|
|
132
|
-
setState,
|
|
152
|
+
context.setState,
|
|
133
153
|
]);
|
|
134
154
|
return _jsx("span", { ...props, ref: ref });
|
|
135
155
|
});
|
|
156
|
+
// Registering a message part's id in Button's aria-describedby while the part is mounted
|
|
136
157
|
function useMessageId(id) {
|
|
137
158
|
const generatedId = useId();
|
|
138
159
|
const messageId = id ?? generatedId;
|
|
139
|
-
const
|
|
160
|
+
const context = useCheckboxContext();
|
|
140
161
|
useEffect(() => {
|
|
141
|
-
setMessageIds((current) => [...current, messageId]);
|
|
142
|
-
return () => setMessageIds((current) => current.filter((value) => value !== messageId));
|
|
143
|
-
}, [messageId, setMessageIds]);
|
|
162
|
+
context.setMessageIds((current) => [...current, messageId]);
|
|
163
|
+
return () => context.setMessageIds((current) => current.filter((value) => value !== messageId));
|
|
164
|
+
}, [messageId, context.setMessageIds]);
|
|
144
165
|
return messageId;
|
|
145
166
|
}
|
|
146
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -17,10 +17,10 @@ import type { ComponentProps, ReactElement } from 'react';
|
|
|
17
17
|
* }
|
|
18
18
|
*/
|
|
19
19
|
export declare function Chip({ disableStyle, className, ...props }: ComponentProps<'div'> & StyleProps): import("react").JSX.Element;
|
|
20
|
+
/** Icon-only: put just a CloseButtonIcon inside, never text like "Remove". Name it for screen readers with aria-label instead, e.g. aria-label="Remove tag". */
|
|
20
21
|
export declare function CloseButton({ disableStyle, type, className, ...props }: ComponentProps<'button'> & StyleProps): import("react").JSX.Element;
|
|
21
22
|
/** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
|
|
22
23
|
export declare function CloseButtonIcon({ disableStyle, children, className, ...props }: (Omit<ComponentProps<'svg'>, 'children'> & {
|
|
23
24
|
/** Omit for the supplied default icon; pass a child only to replace it. */
|
|
24
25
|
children?: ReactElement<ComponentProps<'svg'>>;
|
|
25
26
|
}) & StyleProps): ReactElement<import("react").SVGProps<SVGSVGElement>, string | import("react").JSXElementConstructor<any>>;
|
|
26
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { X } from
|
|
2
|
+
import { X } from "../../utils/icons.js";
|
|
3
3
|
import { cloneElement } from 'react';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
/**
|
|
@@ -21,13 +21,13 @@ import { twMerge } from 'tailwind-merge';
|
|
|
21
21
|
export function Chip({ disableStyle, className, ...props }) {
|
|
22
22
|
return (_jsx("div", { ...props, "data-component": "chip-chip", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
23
23
|
}
|
|
24
|
+
/** Icon-only: put just a CloseButtonIcon inside, never text like "Remove". Name it for screen readers with aria-label instead, e.g. aria-label="Remove tag". */
|
|
24
25
|
export function CloseButton({ disableStyle, type = 'button', className, ...props }) {
|
|
25
26
|
return (_jsx("button", { ...props, type: type, "data-component": "chip-closebutton", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
26
27
|
}
|
|
27
28
|
/** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
|
|
28
29
|
export function CloseButtonIcon({ disableStyle, children = _jsx(X, {}), className, ...props }) {
|
|
29
30
|
return cloneElement(children, {
|
|
30
|
-
...children.props,
|
|
31
31
|
...props,
|
|
32
32
|
...{
|
|
33
33
|
'data-component': 'chip-closebuttonicon',
|
|
@@ -37,4 +37,3 @@ export function CloseButtonIcon({ disableStyle, children = _jsx(X, {}), classNam
|
|
|
37
37
|
strokeWidth: props.strokeWidth ?? children.props.strokeWidth ?? 1.5,
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { SVGIconProps } from '../../types/Icon.ts';
|
|
1
2
|
import { Combobox as BaseCombobox } from '@base-ui/react/combobox';
|
|
2
|
-
import type {
|
|
3
|
+
import type { ValidationProps } from '../../types/Validation.ts';
|
|
3
4
|
import type { ComponentProps, ComponentPropsWithRef, ReactElement, ReactNode } from 'react';
|
|
5
|
+
import type { ValidationMessageChildren } from '../../utils/Validation.ts';
|
|
4
6
|
type StyleProps = {
|
|
5
7
|
/**
|
|
6
8
|
* Disables preset styling for this element.
|
|
@@ -34,7 +36,7 @@ export type GroupType<T extends readonly GroupShape[]> = T[number];
|
|
|
34
36
|
export type ItemType<T extends readonly GroupShape[]> = GroupType<T>['items'][number];
|
|
35
37
|
/** Manually type a ChipsList callback argument with ChipsType<typeof rootItems>, using the exact items variable passed to Root. Also useful for multiple-selection state. */
|
|
36
38
|
export type ChipsType<T extends readonly GroupShape[]> = ItemType<T>[];
|
|
37
|
-
export type RootProps<T extends readonly GroupShape[], Multiple extends boolean | undefined = false> = Omit<BaseCombobox.Root.Props<ItemType<T>, Multiple>, 'items' | 'filteredItems' | 'itemToStringLabel' | 'itemToStringValue' | 'isItemEqualToValue' | 'id'> & {
|
|
39
|
+
export type RootProps<T extends readonly GroupShape[], Multiple extends boolean | undefined = false> = Omit<BaseCombobox.Root.Props<ItemType<T>, Multiple>, 'items' | 'filteredItems' | 'itemToStringLabel' | 'itemToStringValue' | 'isItemEqualToValue' | 'id'> & ValidationProps & {
|
|
38
40
|
/** Input id, also used automatically by Label. Omit to generate a stable id. */
|
|
39
41
|
id?: BaseCombobox.Root.Props<ItemType<T>, Multiple>['id'];
|
|
40
42
|
/**
|
|
@@ -50,8 +52,6 @@ export type RootProps<T extends readonly GroupShape[], Multiple extends boolean
|
|
|
50
52
|
* performs filtering itself, such as filtering results on a server.
|
|
51
53
|
*/
|
|
52
54
|
filteredItems?: readonly GroupType<T>[];
|
|
53
|
-
/** Visual validation tone only; does not validate or change selection. @default 'neutral' */
|
|
54
|
-
tone?: 'neutral' | 'valid' | 'invalid';
|
|
55
55
|
};
|
|
56
56
|
/**
|
|
57
57
|
* Searchable selection using Base UI's built-in filtering and keyboard handling.
|
|
@@ -206,7 +206,7 @@ export type RootProps<T extends readonly GroupShape[], Multiple extends boolean
|
|
|
206
206
|
* <Combobox.AddonOpenButtonIcon />
|
|
207
207
|
* </Combobox.AddonOpenButton>
|
|
208
208
|
*/
|
|
209
|
-
export declare function Root<T extends readonly GroupShape[], Multiple extends boolean | undefined = false>({ children, id,
|
|
209
|
+
export declare function Root<T extends readonly GroupShape[], Multiple extends boolean | undefined = false>({ children, id, validation, defaultOpen, onOpenChange, ...props }: RootProps<T, Multiple>): import("react").JSX.Element;
|
|
210
210
|
/** Use for the standard stacked layout, or omit when supplying your own layout. */
|
|
211
211
|
export declare const Container: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
212
212
|
/** Labels the input automatically using Root's id. Supply the visible label as children; no htmlFor needed. */
|
|
@@ -271,7 +271,7 @@ export type GroupsListProps<Group extends GroupShape = GroupShape> = Omit<Compon
|
|
|
271
271
|
children: ReactNode | ((group: Group, index: number) => ReactNode);
|
|
272
272
|
} & StyleProps;
|
|
273
273
|
/** Required groups container inside ScrollArea. A children callback receives each automatically filtered group; do not filter or map the original groups again. Manually annotate group with Combobox.GroupType<typeof rootItems>, using the exact items variable passed to Root. */
|
|
274
|
-
export declare function GroupsList<Group extends GroupShape = GroupShape>({ disableStyle, children, className,
|
|
274
|
+
export declare function GroupsList<Group extends GroupShape = GroupShape>({ disableStyle, children, className, ...props }: GroupsListProps<Group>): import("react").JSX.Element;
|
|
275
275
|
export type ItemsListProps<Item extends ItemShape = ItemShape> = Omit<ComponentPropsWithRef<'div'>, 'children' | 'className'> & {
|
|
276
276
|
className?: string;
|
|
277
277
|
/**
|
|
@@ -283,21 +283,21 @@ export type ItemsListProps<Item extends ItemShape = ItemShape> = Omit<ComponentP
|
|
|
283
283
|
children?: ReactNode | ((item: Item, index: number) => ReactNode);
|
|
284
284
|
} & StyleProps;
|
|
285
285
|
/** Required items container inside Group. A children callback receives the filtered items belonging to that Group; do not repeat filtering yourself. Manually annotate item with Combobox.ItemType<typeof rootItems>, using the exact items variable passed to Root. */
|
|
286
|
-
export declare function ItemsList<Item extends ItemShape = ItemShape>({ disableStyle, children, className,
|
|
286
|
+
export declare function ItemsList<Item extends ItemShape = ItemShape>({ disableStyle, children, className, ...props }: ItemsListProps<Item>): import("react").JSX.Element;
|
|
287
287
|
export type GroupProps<Item extends ItemShape = ItemShape> = Omit<ComponentPropsWithRef<typeof BaseCombobox.Group>, 'items' | 'className'> & {
|
|
288
288
|
className?: string;
|
|
289
289
|
/** Items for this group; pass group.items from GroupsList. Required even for a flat list. */
|
|
290
290
|
items: readonly Item[];
|
|
291
291
|
} & StyleProps;
|
|
292
292
|
/** Required wrapper around ItemsList, even for a visually flat list. Pass group.items. A GroupLabel is optional; omit it when the group has an empty label. */
|
|
293
|
-
export declare function Group<Item extends ItemShape = ItemShape>({ disableStyle, className,
|
|
293
|
+
export declare function Group<Item extends ItemShape = ItemShape>({ disableStyle, className, ...props }: GroupProps<Item>): import("react").JSX.Element;
|
|
294
294
|
export type ItemProps<Item extends ItemShape = ItemShape> = Omit<ComponentPropsWithRef<typeof BaseCombobox.Item>, 'value' | 'className'> & {
|
|
295
295
|
className?: string;
|
|
296
296
|
/** Pass the item supplied by ItemsList so selection can match it by item.value. */
|
|
297
297
|
value: Item;
|
|
298
298
|
} & StyleProps;
|
|
299
299
|
/** Required selectable row inside ItemsList. Pass the complete item object as value, with ItemText and ItemIndicator inside. Selection, highlighting, and keyboard behavior are built in. */
|
|
300
|
-
export declare function Item<Item extends ItemShape = ItemShape>({ disableStyle, className,
|
|
300
|
+
export declare function Item<Item extends ItemShape = ItemShape>({ disableStyle, className, ...props }: ItemProps<Item>): import("react").JSX.Element;
|
|
301
301
|
export type PopupProps = Omit<ComponentPropsWithRef<typeof BaseCombobox.Popup>, 'className'> & {
|
|
302
302
|
className?: string;
|
|
303
303
|
} & Pick<BaseCombobox.Portal.Props, 'container' | 'keepMounted'> & Pick<BaseCombobox.Positioner.Props, 'anchor' | 'positionMethod' | 'alignOffset' | 'collisionBoundary' | 'collisionPadding' | 'sticky' | 'arrowPadding' | 'disableAnchorTracking' | 'collisionAvoidance'> & {
|
|
@@ -312,32 +312,18 @@ export type PopupProps = Omit<ComponentPropsWithRef<typeof BaseCombobox.Popup>,
|
|
|
312
312
|
export declare function Popup({ disableStyle, container, keepMounted, anchor, positionMethod, side, sideOffset, align, alignOffset, collisionBoundary, collisionPadding, sticky, arrowPadding, disableAnchorTracking, collisionAvoidance, className, style, ...props }: PopupProps): import("react").JSX.Element;
|
|
313
313
|
/** Optional decorative popup arrow. Place inside Popup; the SVG and direction handling are supplied. No children needed. */
|
|
314
314
|
export declare const Arrow: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").SVGProps<SVGSVGElement>, "children" | "dangerouslySetInnerHTML"> & StyleProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
315
|
-
/** Behavior only: turns its single child element into the popup trigger. Adds no preset styling and has no disableStyle prop. Use an accessible button child; pass className to the child for its appearance. */
|
|
316
|
-
export declare const PopupOpenHandler: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ComboboxTriggerProps, "children" | "className" | "render"> & {
|
|
317
|
-
/** Additional classes forwarded to the trigger element. This handler has no preset styles. */
|
|
318
|
-
className?: string;
|
|
319
|
-
/** Single element to receive the behavior. Use a button with an accessible name. */
|
|
320
|
-
children: ReactElement;
|
|
321
|
-
}, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
322
|
-
/** Behavior only: turns its single child element into a removal control for the surrounding Chip. Adds no preset styling and has no disableStyle prop. Use an accessible button child. */
|
|
323
|
-
export declare const ChipRemoveHandler: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ComboboxChipRemoveProps, "children" | "className" | "render"> & {
|
|
324
|
-
/** Additional classes forwarded to the removal element. This handler has no preset styles. */
|
|
325
|
-
className?: string;
|
|
326
|
-
/** Single element to receive the behavior. Use a button with an accessible name. */
|
|
327
|
-
children: ReactElement;
|
|
328
|
-
}, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
329
315
|
/** Optional input adornment container inside InputGroup. Wraps icons, text, or buttons without adding trigger behavior. */
|
|
330
316
|
export declare const Addon: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
331
317
|
/** Preset adornment appearance. Does not add button behavior. @default 'normal' */
|
|
332
318
|
variant?: "normal" | "emphasized";
|
|
333
319
|
} & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
334
320
|
/** Clones one supplied icon element, forwarding its ref and preserving its classes. Decorative only; does not open the popup or perform an action. */
|
|
335
|
-
export declare const AddonIcon: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
321
|
+
export declare const AddonIcon: import("react").ForwardRefExoticComponent<Omit<Omit<SVGIconProps, "strokeWidth"> & {
|
|
336
322
|
/** @default 1.5 */
|
|
337
|
-
strokeWidth?:
|
|
323
|
+
strokeWidth?: SVGIconProps["strokeWidth"];
|
|
338
324
|
} & {
|
|
339
325
|
/** One icon element to clone. Its own className is preserved. */
|
|
340
|
-
children: ReactElement<
|
|
326
|
+
children: ReactElement<SVGIconProps>;
|
|
341
327
|
} & StyleProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
342
328
|
/** Optional general-purpose button inside Addon. Supply its action yourself. Automatically disabled when Root is disabled or readOnly; defaults to type="button". */
|
|
343
329
|
export declare const AddonButton: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "type" | "disabled"> & {
|
|
@@ -346,7 +332,7 @@ export declare const AddonButton: import("react").ForwardRefExoticComponent<Omit
|
|
|
346
332
|
/** Disables this button. Root disabled or readOnly also disables it automatically. */
|
|
347
333
|
disabled?: ComponentProps<"button">["disabled"];
|
|
348
334
|
} & StyleProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
349
|
-
/** Input control wrapper. Place Input (or ChipsList containing Input) and optional Addon controls inside. Root
|
|
335
|
+
/** Input control wrapper. Place Input (or ChipsList containing Input) and optional Addon controls inside. Root validation controls its preset validation border. */
|
|
350
336
|
export declare const InputGroup: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ComboboxInputGroupProps, "className"> & {
|
|
351
337
|
className?: string;
|
|
352
338
|
} & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -384,36 +370,39 @@ export declare const ItemText: import("react").ForwardRefExoticComponent<Omit<im
|
|
|
384
370
|
export declare const AddonText: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
385
371
|
/** Text content inside Empty. Supply your empty-result message; Empty handles its visibility automatically. */
|
|
386
372
|
export declare const EmptyText: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
387
|
-
/** Optional supporting text. Supply its content; it
|
|
373
|
+
/** Optional supporting text. Supply its content; it describes the input to screen readers automatically. */
|
|
388
374
|
export declare const Description: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
375
|
+
type MessageProps = Omit<ComponentProps<'div'>, 'children'> & StyleProps & {
|
|
376
|
+
children?: ValidationMessageChildren;
|
|
377
|
+
};
|
|
378
|
+
/** Shows itself only while Root's validation is `'error'`: with no children it shows the message from `['error', message]`, a function children formats that message, and other children replace it. */
|
|
379
|
+
export declare const Error: import("react").ForwardRefExoticComponent<Omit<MessageProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
380
|
+
/** Shows itself only while Root's validation is `'success'`: with no children it shows the message from `['success', message]`, a function children formats that message, and other children replace it. */
|
|
381
|
+
export declare const Success: import("react").ForwardRefExoticComponent<Omit<MessageProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
393
382
|
/** Built-in decorative open-button icon. Place inside AddonOpenButton; no children needed. Defaults to strokeWidth 1.5. */
|
|
394
|
-
export declare const AddonOpenButtonIcon: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
383
|
+
export declare const AddonOpenButtonIcon: import("react").ForwardRefExoticComponent<Omit<Omit<SVGIconProps, "strokeWidth"> & {
|
|
395
384
|
/** @default 1.5 */
|
|
396
|
-
strokeWidth?:
|
|
385
|
+
strokeWidth?: SVGIconProps["strokeWidth"];
|
|
397
386
|
} & StyleProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
398
387
|
/** Built-in decorative clear icon. Place inside AddonClearButton; no children needed. Defaults to strokeWidth 1.5. */
|
|
399
|
-
export declare const AddonClearButtonIcon: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
388
|
+
export declare const AddonClearButtonIcon: import("react").ForwardRefExoticComponent<Omit<Omit<SVGIconProps, "strokeWidth"> & {
|
|
400
389
|
/** @default 1.5 */
|
|
401
|
-
strokeWidth?:
|
|
390
|
+
strokeWidth?: SVGIconProps["strokeWidth"];
|
|
402
391
|
} & StyleProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
403
392
|
/** Built-in decorative removal icon. Place inside ChipRemoveButton; no children needed. Defaults to strokeWidth 1.5. */
|
|
404
|
-
export declare const ChipRemoveButtonIcon: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
393
|
+
export declare const ChipRemoveButtonIcon: import("react").ForwardRefExoticComponent<Omit<Omit<SVGIconProps, "strokeWidth"> & {
|
|
405
394
|
/** @default 1.5 */
|
|
406
|
-
strokeWidth?:
|
|
395
|
+
strokeWidth?: SVGIconProps["strokeWidth"];
|
|
407
396
|
} & StyleProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
408
397
|
/** Optional spinner inside Addon. Does not detect requests: you decide when to render it. Defaults to strokeWidth 1.5. */
|
|
409
|
-
export declare const AddonLoadingIcon: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
398
|
+
export declare const AddonLoadingIcon: import("react").ForwardRefExoticComponent<Omit<Omit<SVGIconProps, "strokeWidth"> & {
|
|
410
399
|
/** @default 1.5 */
|
|
411
|
-
strokeWidth?:
|
|
400
|
+
strokeWidth?: SVGIconProps["strokeWidth"];
|
|
412
401
|
} & StyleProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
413
402
|
/** Required selection indicator inside Item. Visibility is automatic and a checkmark is supplied: no children or selection condition needed. Pass children only to replace the built-in checkmark. */
|
|
414
|
-
export declare const ItemIndicator: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
403
|
+
export declare const ItemIndicator: import("react").ForwardRefExoticComponent<Omit<Omit<SVGIconProps, "children"> & Pick<import("@base-ui/react").ComboboxItemIndicatorProps, "keepMounted"> & {
|
|
415
404
|
/** Optional replacement SVG icon. It receives this indicator's props and ref. */
|
|
416
|
-
children?: ReactElement<
|
|
405
|
+
children?: ReactElement<SVGIconProps>;
|
|
417
406
|
} & StyleProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
418
407
|
/** Optional async status inside Popup, below Empty and above ScrollArea. Omit entirely for synchronous items. For async items, keep Loading mounted and conditionally render only LoadingIcon and LoadingText from your request state. Does not detect requests or manage visibility. */
|
|
419
408
|
export declare const Loading: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteStatusProps, "className"> & {
|
|
@@ -422,6 +411,5 @@ export declare const Loading: import("react").ForwardRefExoticComponent<Omit<Omi
|
|
|
422
411
|
/** Text inside Loading. Supply the message only while your request is loading; this part does not detect request state. */
|
|
423
412
|
export declare const LoadingText: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
424
413
|
/** Built-in decorative spinner for Loading. No children needed; you control when it is rendered. */
|
|
425
|
-
export declare const LoadingIcon: import("react").ForwardRefExoticComponent<Omit<
|
|
414
|
+
export declare const LoadingIcon: import("react").ForwardRefExoticComponent<Omit<SVGIconProps & StyleProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
426
415
|
export {};
|
|
427
|
-
//# sourceMappingURL=index.d.ts.map
|