@wix/site-ui 1.29.0 → 1.31.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/dist/1268.js +99 -0
- package/dist/1279.js +7 -0
- package/dist/1457.js +10 -0
- package/dist/1477.js +106 -0
- package/dist/1500.js +111 -0
- package/dist/167.js +6 -0
- package/dist/2274.js +34 -0
- package/dist/2287.js +17 -0
- package/dist/2418.js +31 -0
- package/dist/2801.js +20 -0
- package/dist/285.js +86 -0
- package/dist/2861.js +6 -0
- package/dist/3020.js +7 -0
- package/dist/3021.js +72 -0
- package/dist/3056.js +229 -0
- package/dist/3140.js +4 -0
- package/dist/3248.js +307 -0
- package/dist/3296.js +4 -0
- package/dist/3319.js +400 -0
- package/dist/3395.js +4 -0
- package/dist/3485.js +854 -0
- package/dist/353.js +14 -0
- package/dist/3670.js +418 -0
- package/dist/3829.js +113 -0
- package/dist/4026.js +12 -0
- package/dist/4143.js +46 -0
- package/dist/42.js +32 -0
- package/dist/4281.js +30 -0
- package/dist/4346.js +2 -0
- package/dist/4388.js +418 -0
- package/dist/4490.js +32 -0
- package/dist/4495.js +9 -0
- package/dist/4549.js +24 -0
- package/dist/4586.js +41 -0
- package/dist/4586.js.LICENSE.txt +19 -0
- package/dist/4707.js +19 -0
- package/dist/4723.js +7 -0
- package/dist/4745.js +7 -0
- package/dist/4768.js +35 -0
- package/dist/4922.js +15 -0
- package/dist/5036.js +17 -0
- package/dist/5085.js +20 -0
- package/dist/5299.js +597 -0
- package/dist/5659.js +4 -0
- package/dist/5778.js +10 -0
- package/dist/5864.js +86 -0
- package/dist/5992.js +913 -0
- package/dist/5992.js.LICENSE.txt +19 -0
- package/dist/6003.js +10 -0
- package/dist/6046.js +29 -0
- package/dist/6089.js +2355 -0
- package/dist/6107.js +10 -0
- package/dist/6247.js +20 -0
- package/dist/6270.js +487 -0
- package/dist/6329.js +32 -0
- package/dist/6330.js +30 -0
- package/dist/6499.js +7 -0
- package/dist/6535.js +71 -0
- package/dist/6588.js +382 -0
- package/dist/6706.js +16 -0
- package/dist/6825.js +7 -0
- package/dist/6882.js +1562 -0
- package/dist/6914.js +30 -0
- package/dist/7021.js +13 -0
- package/dist/7366.js +83 -0
- package/dist/7373.js +25 -0
- package/dist/7541.js +25 -0
- package/dist/7564.js +10 -0
- package/dist/7642.js +20 -0
- package/dist/7725.js +10 -0
- package/dist/7871.js +38 -0
- package/dist/8052.js +352 -0
- package/dist/8106.js +238 -0
- package/dist/8171.js +346 -0
- package/dist/8225.js +21 -0
- package/dist/8272.js +333 -0
- package/dist/8527.js +58 -0
- package/dist/8724.js +10 -0
- package/dist/8750.js +1920 -0
- package/dist/8758.js +43 -0
- package/dist/880.js +149 -0
- package/dist/8935.js +8 -0
- package/dist/8960.js +22 -0
- package/dist/8971.js +40 -0
- package/dist/8979.js +10 -0
- package/dist/8996.js +71 -0
- package/dist/904.js +121 -0
- package/dist/9048.js +52 -0
- package/dist/9087.js +256 -0
- package/dist/9189.js +158 -0
- package/dist/9255.js +136 -0
- package/dist/9352.js +148 -0
- package/dist/951.js +22 -0
- package/dist/9635.js +22 -0
- package/dist/9829.js +4 -0
- package/dist/9863.js +8 -0
- package/dist/Accordion/index.d.ts +569 -12
- package/dist/Accordion/index.js +423 -8
- package/dist/AlertDialog/index.d.ts +1417 -18
- package/dist/AlertDialog/index.js +34 -14
- package/dist/Autocomplete/index.d.ts +1861 -38
- package/dist/Autocomplete/index.js +98 -24
- package/dist/Avatar/index.d.ts +129 -7
- package/dist/Avatar/index.js +149 -6
- package/dist/Badge/index.css +44 -0
- package/dist/Badge/index.d.ts +22 -0
- package/dist/Badge/index.js +23 -0
- package/dist/Breadcrumbs/index.d.ts +960 -7
- package/dist/Breadcrumbs/index.js +5 -5
- package/dist/Button/index.d.ts +88 -6
- package/dist/Button/index.js +27 -3
- package/dist/Checkbox/index.d.ts +425 -5
- package/dist/Checkbox/index.js +45 -5
- package/dist/CheckboxGroup/index.d.ts +318 -3
- package/dist/CheckboxGroup/index.js +166 -3
- package/dist/Collapsible/index.d.ts +377 -7
- package/dist/Collapsible/index.js +160 -6
- package/dist/Combobox/index.d.ts +1984 -48
- package/dist/Combobox/index.js +352 -29
- package/dist/ContextMenu/index.d.ts +2340 -36
- package/dist/ContextMenu/index.js +197 -22
- package/dist/Dialog/index.d.ts +1355 -18
- package/dist/Dialog/index.js +16 -14
- package/dist/Drawer/index.d.ts +1653 -18
- package/dist/Drawer/index.js +2797 -20
- package/dist/Field/index.d.ts +655 -15
- package/dist/Field/index.js +677 -10
- package/dist/Fieldset/index.d.ts +94 -5
- package/dist/Fieldset/index.js +68 -5
- package/dist/Form/index.d.ts +331 -2
- package/dist/Form/index.js +106 -3
- package/dist/Input/index.d.ts +692 -3
- package/dist/Input/index.js +10 -3
- package/dist/Menu/index.d.ts +2301 -36
- package/dist/Menu/index.js +365 -26
- package/dist/Menubar/index.d.ts +2301 -3
- package/dist/Menubar/index.js +105 -3
- package/dist/Meter/index.d.ts +175 -11
- package/dist/Meter/index.js +129 -9
- package/dist/NavigationMenu/index.d.ts +978 -28
- package/dist/NavigationMenu/index.js +1034 -17
- package/dist/NumberField/index.d.ts +612 -15
- package/dist/NumberField/index.js +1409 -11
- package/dist/Popover/index.d.ts +1655 -20
- package/dist/Popover/index.js +792 -17
- package/dist/PreviewCard/index.d.ts +1523 -14
- package/dist/PreviewCard/index.js +679 -14
- package/dist/Progress/index.d.ts +183 -11
- package/dist/Progress/index.js +181 -9
- package/dist/Radio/index.d.ts +185 -6
- package/dist/Radio/index.js +253 -6
- package/dist/RadioGroup/index.d.ts +341 -2
- package/dist/RadioGroup/index.js +154 -3
- package/dist/ScrollArea/index.d.ts +265 -13
- package/dist/ScrollArea/index.js +892 -10
- package/dist/Select/index.d.ts +1493 -38
- package/dist/Select/index.js +1824 -23
- package/dist/Separator/index.d.ts +80 -6
- package/dist/Separator/index.js +3 -3
- package/dist/Slider/index.d.ts +678 -16
- package/dist/Slider/index.js +1199 -11
- package/dist/Switch/index.d.ts +393 -5
- package/dist/Switch/index.js +208 -6
- package/dist/Tabs/index.d.ts +523 -12
- package/dist/Tabs/index.js +685 -9
- package/dist/Toggle/index.d.ts +305 -2
- package/dist/Toggle/index.js +76 -3
- package/dist/ToggleGroup/index.d.ts +316 -2
- package/dist/ToggleGroup/index.js +102 -3
- package/dist/Toolbar/index.d.ts +282 -13
- package/dist/Toolbar/index.js +230 -9
- package/dist/Tooltip/index.d.ts +1572 -14
- package/dist/Tooltip/index.js +965 -14
- package/dist/index.d.ts +12758 -646
- package/dist/index.js +1 -0
- package/dist/rslib-runtime.js +18 -0
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { NavigationMenu } from "@base-ui/react/navigation-menu";
|
|
3
2
|
import { ChevronLeft, ChevronRight } from "@wix/wix-ui-icons-common";
|
|
4
3
|
import clsx from "clsx";
|
|
4
|
+
import { NavigationMenuLink_NavigationMenuLink, NavigationMenuItem_NavigationMenuItem, NavigationMenuList_NavigationMenuList, NavigationMenuRoot_NavigationMenuRoot } from "../6588.js";
|
|
5
5
|
import * as __rspack_external_react from "react";
|
|
6
6
|
const Breadcrumbs_module = {
|
|
7
7
|
root: "root-uwc56U",
|
|
@@ -20,7 +20,7 @@ const BreadcrumbsContext = /*#__PURE__*/ __rspack_external_react.createContext({
|
|
|
20
20
|
const List = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, children, ...props }, ref)=>{
|
|
21
21
|
const { separator } = __rspack_external_react.useContext(BreadcrumbsContext);
|
|
22
22
|
const childArray = __rspack_external_react.Children.toArray(children);
|
|
23
|
-
return /*#__PURE__*/ jsx(
|
|
23
|
+
return /*#__PURE__*/ jsx(NavigationMenuList_NavigationMenuList, {
|
|
24
24
|
ref: ref,
|
|
25
25
|
className: clsx(Breadcrumbs_module.list, className),
|
|
26
26
|
...props,
|
|
@@ -37,12 +37,12 @@ const List = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, chil
|
|
|
37
37
|
])
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
|
-
const Item = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(
|
|
40
|
+
const Item = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(NavigationMenuItem_NavigationMenuItem, {
|
|
41
41
|
ref: ref,
|
|
42
42
|
className: clsx(Breadcrumbs_module.item, className),
|
|
43
43
|
...props
|
|
44
44
|
}));
|
|
45
|
-
const Link = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(
|
|
45
|
+
const Link = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(NavigationMenuLink_NavigationMenuLink, {
|
|
46
46
|
ref: ref,
|
|
47
47
|
className: clsx(Breadcrumbs_module.link, className),
|
|
48
48
|
...props
|
|
@@ -63,7 +63,7 @@ function Root({ className, dir, separator, 'aria-label': ariaLabel = 'Breadcrumb
|
|
|
63
63
|
value: {
|
|
64
64
|
separator: separator ?? defaultSeparator
|
|
65
65
|
},
|
|
66
|
-
children: /*#__PURE__*/ jsx(
|
|
66
|
+
children: /*#__PURE__*/ jsx(NavigationMenuRoot_NavigationMenuRoot, {
|
|
67
67
|
"aria-label": ariaLabel,
|
|
68
68
|
dir: dir,
|
|
69
69
|
...props,
|
package/dist/Button/index.d.ts
CHANGED
|
@@ -1,21 +1,103 @@
|
|
|
1
|
-
import { Button as Button_2 } from '@base-ui/react/button';
|
|
2
1
|
import * as React_2 from 'react';
|
|
3
2
|
|
|
4
3
|
declare type BaseProps = WithStringClassName<React_2.ComponentPropsWithoutRef<typeof Button_2>>;
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Props shared by all Base UI components.
|
|
7
|
+
* Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
|
|
8
|
+
*/
|
|
9
|
+
declare type BaseUIComponentProps<ElementType extends React_2.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React_2.ComponentPropsWithRef<ElementType>>, 'className' | 'color' | 'defaultValue' | 'defaultChecked' | 'style'> & {
|
|
10
|
+
/**
|
|
11
|
+
* CSS class applied to the element, or a function that
|
|
12
|
+
* returns a class based on the component's state.
|
|
13
|
+
*/
|
|
14
|
+
className?: string | ((state: State) => string | undefined) | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Allows you to replace the component's HTML element
|
|
17
|
+
* with a different tag, or compose it with another component.
|
|
18
|
+
*
|
|
19
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
20
|
+
*/
|
|
21
|
+
render?: React_2.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Style applied to the element, or a function that
|
|
24
|
+
* returns a style object based on the component's state.
|
|
25
|
+
*/
|
|
26
|
+
style?: React_2.CSSProperties | ((state: State) => React_2.CSSProperties | undefined) | undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E & {
|
|
30
|
+
preventBaseUIHandler: () => void;
|
|
31
|
+
readonly baseUIHandlerPrevented?: boolean | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export declare const Button: React_2.ForwardRefExoticComponent<ButtonProps_2 & React_2.RefAttributes<HTMLElement>>;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A button component that can be used to trigger actions.
|
|
38
|
+
* Renders a `<button>` element.
|
|
39
|
+
*
|
|
40
|
+
* Documentation: [Base UI Button](https://base-ui.com/react/components/button)
|
|
41
|
+
*/
|
|
42
|
+
declare const Button_2: React_2.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React_2.RefAttributes<HTMLElement>>;
|
|
7
43
|
|
|
8
|
-
declare
|
|
44
|
+
declare namespace Button_2 {
|
|
45
|
+
type State = ButtonState;
|
|
46
|
+
type Props = ButtonProps;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export declare interface ButtonProps extends NativeButtonProps, BaseUIComponentProps<'button', ButtonState> {
|
|
50
|
+
/**
|
|
51
|
+
* Whether the button should be focusable when disabled.
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
focusableWhenDisabled?: boolean | undefined;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare interface ButtonProps_2 extends BaseProps {
|
|
9
58
|
variant?: ButtonVariant;
|
|
10
59
|
}
|
|
11
60
|
|
|
61
|
+
export declare interface ButtonState {
|
|
62
|
+
/**
|
|
63
|
+
* Whether the button should ignore user interaction.
|
|
64
|
+
*/
|
|
65
|
+
disabled: boolean;
|
|
66
|
+
}
|
|
67
|
+
|
|
12
68
|
declare type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
|
|
13
69
|
|
|
14
|
-
|
|
15
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Shape of the render prop: a function that takes props to be spread on the element and component's state and returns a React element.
|
|
72
|
+
*
|
|
73
|
+
* @template Props Props to be spread on the rendered element.
|
|
74
|
+
* @template State Component's internal state.
|
|
75
|
+
*/
|
|
76
|
+
declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
|
|
77
|
+
|
|
78
|
+
declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
|
|
79
|
+
ref?: React_2.Ref<T> | undefined;
|
|
16
80
|
};
|
|
17
81
|
|
|
82
|
+
declare interface NativeButtonProps {
|
|
83
|
+
/**
|
|
84
|
+
* Whether the component renders a native `<button>` element when replacing it
|
|
85
|
+
* via the `render` prop.
|
|
86
|
+
* Set to `false` if the rendered element is not a button (for example, `<div>`).
|
|
87
|
+
* @default true
|
|
88
|
+
*/
|
|
89
|
+
nativeButton?: boolean | undefined;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Adds a `preventBaseUIHandler` method to all event handlers.
|
|
94
|
+
*/
|
|
95
|
+
declare type WithBaseUIEvent<T> = { [K in keyof T]: WithPreventBaseUIHandler<T[K]> };
|
|
96
|
+
|
|
97
|
+
declare type WithPreventBaseUIHandler<T> = T extends ((event: infer E) => any) ? E extends React_2.SyntheticEvent<Element, Event> ? (event: BaseUIEvent<E>) => ReturnType<T> : T : T extends undefined ? undefined : T;
|
|
18
98
|
|
|
19
|
-
|
|
99
|
+
declare type WithStringClassName<P> = Omit<P, 'className'> & {
|
|
100
|
+
className?: string;
|
|
101
|
+
};
|
|
20
102
|
|
|
21
103
|
export { }
|
package/dist/Button/index.js
CHANGED
|
@@ -1,16 +1,40 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from "@base-ui/react/button";
|
|
3
2
|
import clsx from "clsx";
|
|
3
|
+
import { useButton } from "../9189.js";
|
|
4
|
+
import { useRenderElement } from "../8272.js";
|
|
4
5
|
import * as __rspack_external_react from "react";
|
|
6
|
+
const Button_Button = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
7
|
+
const { render, className, disabled = false, focusableWhenDisabled = false, nativeButton = true, style, ...elementProps } = componentProps;
|
|
8
|
+
const { getButtonProps, buttonRef } = useButton({
|
|
9
|
+
disabled,
|
|
10
|
+
focusableWhenDisabled,
|
|
11
|
+
native: nativeButton
|
|
12
|
+
});
|
|
13
|
+
const state = {
|
|
14
|
+
disabled
|
|
15
|
+
};
|
|
16
|
+
return useRenderElement('button', componentProps, {
|
|
17
|
+
state,
|
|
18
|
+
ref: [
|
|
19
|
+
forwardedRef,
|
|
20
|
+
buttonRef
|
|
21
|
+
],
|
|
22
|
+
props: [
|
|
23
|
+
elementProps,
|
|
24
|
+
getButtonProps
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
if ("production" !== process.env.NODE_ENV) Button_Button.displayName = "Button";
|
|
5
29
|
const Button_module = {
|
|
6
30
|
root: "root-kIffNe",
|
|
7
31
|
primary: "primary-BOdHls",
|
|
8
32
|
secondary: "secondary-O9td6z",
|
|
9
33
|
tertiary: "tertiary-QWTRNC"
|
|
10
34
|
};
|
|
11
|
-
const
|
|
35
|
+
const Button_Button_Button = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, variant = 'primary', ...props }, ref)=>/*#__PURE__*/ jsx(Button_Button, {
|
|
12
36
|
ref: ref,
|
|
13
37
|
className: clsx(Button_module.root, Button_module[variant], className),
|
|
14
38
|
...props
|
|
15
39
|
}));
|
|
16
|
-
export {
|
|
40
|
+
export { Button_Button_Button as Button };
|
package/dist/Checkbox/index.d.ts
CHANGED
|
@@ -1,25 +1,445 @@
|
|
|
1
|
-
import { CheckboxIndicatorProps } from '@base-ui/react/checkbox';
|
|
2
|
-
import { CheckboxRootProps } from '@base-ui/react/checkbox';
|
|
1
|
+
import { CheckboxIndicatorProps as CheckboxIndicatorProps_2 } from '@base-ui/react/checkbox';
|
|
2
|
+
import { CheckboxRootProps as CheckboxRootProps_2 } from '@base-ui/react/checkbox';
|
|
3
3
|
import * as React_2 from 'react';
|
|
4
4
|
|
|
5
|
+
declare type BaseUIChangeEventDetail<Reason extends string, CustomProperties extends object> = {
|
|
6
|
+
/**
|
|
7
|
+
* The reason for the event.
|
|
8
|
+
*/
|
|
9
|
+
reason: Reason;
|
|
10
|
+
/**
|
|
11
|
+
* The native event associated with the custom event.
|
|
12
|
+
*/
|
|
13
|
+
event: ReasonToEvent<Reason>;
|
|
14
|
+
/**
|
|
15
|
+
* Cancels Base UI from handling the event.
|
|
16
|
+
*/
|
|
17
|
+
cancel: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Allows the event to propagate in cases where Base UI will stop the propagation.
|
|
20
|
+
*/
|
|
21
|
+
allowPropagation: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Indicates whether the event has been canceled.
|
|
24
|
+
*/
|
|
25
|
+
isCanceled: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Indicates whether the event is allowed to propagate.
|
|
28
|
+
*/
|
|
29
|
+
isPropagationAllowed: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The element that triggered the event, if applicable.
|
|
32
|
+
*/
|
|
33
|
+
trigger: Element | undefined;
|
|
34
|
+
} & CustomProperties;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Details of custom change events emitted by Base UI components.
|
|
38
|
+
*/
|
|
39
|
+
declare type BaseUIChangeEventDetails<Reason extends string, CustomProperties extends object = {}> = Reason extends string ? BaseUIChangeEventDetail<Reason, CustomProperties> & {} : never;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Props shared by all Base UI components.
|
|
43
|
+
* Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
|
|
44
|
+
*/
|
|
45
|
+
declare type BaseUIComponentProps<ElementType extends React_2.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React_2.ComponentPropsWithRef<ElementType>>, 'className' | 'color' | 'defaultValue' | 'defaultChecked' | 'style'> & {
|
|
46
|
+
/**
|
|
47
|
+
* CSS class applied to the element, or a function that
|
|
48
|
+
* returns a class based on the component's state.
|
|
49
|
+
*/
|
|
50
|
+
className?: string | ((state: State) => string | undefined) | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Allows you to replace the component's HTML element
|
|
53
|
+
* with a different tag, or compose it with another component.
|
|
54
|
+
*
|
|
55
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
56
|
+
*/
|
|
57
|
+
render?: React_2.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Style applied to the element, or a function that
|
|
60
|
+
* returns a style object based on the component's state.
|
|
61
|
+
*/
|
|
62
|
+
style?: React_2.CSSProperties | ((state: State) => React_2.CSSProperties | undefined) | undefined;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E & {
|
|
66
|
+
preventBaseUIHandler: () => void;
|
|
67
|
+
readonly baseUIHandlerPrevented?: boolean | undefined;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
declare const cancelOpen: "cancel-open";
|
|
71
|
+
|
|
5
72
|
export declare const Checkbox: {
|
|
6
|
-
Root: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
73
|
+
Root: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<CheckboxRootProps_2, "ref"> & React_2.RefAttributes<HTMLElement>, "ref">, "className"> & {
|
|
7
74
|
className?: string | undefined;
|
|
8
75
|
} & {
|
|
9
76
|
size?: number | undefined;
|
|
10
77
|
} & React_2.RefAttributes<HTMLElement>>;
|
|
11
|
-
Indicator: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
78
|
+
Indicator: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<CheckboxIndicatorProps_2, "ref"> & React_2.RefAttributes<HTMLSpanElement>, "ref">, "className"> & {
|
|
12
79
|
className?: string | undefined;
|
|
13
80
|
} & React_2.RefAttributes<HTMLSpanElement>>;
|
|
14
81
|
};
|
|
15
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Indicates whether the checkbox is ticked.
|
|
85
|
+
* Renders a `<span>` element.
|
|
86
|
+
*
|
|
87
|
+
* Documentation: [Base UI Checkbox](https://base-ui.com/react/components/checkbox)
|
|
88
|
+
*/
|
|
89
|
+
export declare const CheckboxIndicator: React_2.ForwardRefExoticComponent<Omit<CheckboxIndicatorProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
|
|
90
|
+
|
|
91
|
+
export declare namespace CheckboxIndicator {
|
|
92
|
+
export type State = CheckboxIndicatorState;
|
|
93
|
+
export type Props = CheckboxIndicatorProps;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export declare interface CheckboxIndicatorProps extends BaseUIComponentProps<'span', CheckboxIndicatorState> {
|
|
97
|
+
/**
|
|
98
|
+
* Whether to keep the element in the DOM when the checkbox is not checked.
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
101
|
+
keepMounted?: boolean | undefined;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export declare interface CheckboxIndicatorState extends CheckboxRootState {
|
|
105
|
+
/**
|
|
106
|
+
* The transition status of the component.
|
|
107
|
+
*/
|
|
108
|
+
transitionStatus: TransitionStatus;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Represents the checkbox itself.
|
|
113
|
+
* Renders a `<span>` element and a hidden `<input>` beside.
|
|
114
|
+
*
|
|
115
|
+
* Documentation: [Base UI Checkbox](https://base-ui.com/react/components/checkbox)
|
|
116
|
+
*/
|
|
117
|
+
export declare const CheckboxRoot: React_2.ForwardRefExoticComponent<Omit<CheckboxRootProps, "ref"> & React_2.RefAttributes<HTMLElement>>;
|
|
118
|
+
|
|
119
|
+
export declare namespace CheckboxRoot {
|
|
120
|
+
export type State = CheckboxRootState;
|
|
121
|
+
export type Props = CheckboxRootProps;
|
|
122
|
+
export type ChangeEventReason = CheckboxRootChangeEventReason;
|
|
123
|
+
export type ChangeEventDetails = CheckboxRootChangeEventDetails;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export declare type CheckboxRootChangeEventDetails = BaseUIChangeEventDetails<CheckboxRoot.ChangeEventReason>;
|
|
127
|
+
|
|
128
|
+
export declare type CheckboxRootChangeEventReason = typeof REASONS.none;
|
|
129
|
+
|
|
130
|
+
export declare interface CheckboxRootProps extends NonNativeButtonProps, Omit<BaseUIComponentProps<'span', CheckboxRootState>, 'onChange' | 'value'> {
|
|
131
|
+
/**
|
|
132
|
+
* The id of the input element.
|
|
133
|
+
*/
|
|
134
|
+
id?: string | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* Identifies the field when a form is submitted.
|
|
137
|
+
* @default undefined
|
|
138
|
+
*/
|
|
139
|
+
name?: string | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* Identifies the form that owns the hidden input.
|
|
142
|
+
* Useful when the checkbox is rendered outside the form.
|
|
143
|
+
*/
|
|
144
|
+
form?: string | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* Whether the checkbox is currently ticked.
|
|
147
|
+
*
|
|
148
|
+
* To render an uncontrolled checkbox, use the `defaultChecked` prop instead.
|
|
149
|
+
* @default undefined
|
|
150
|
+
*/
|
|
151
|
+
checked?: boolean | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* Whether the checkbox is initially ticked.
|
|
154
|
+
*
|
|
155
|
+
* To render a controlled checkbox, use the `checked` prop instead.
|
|
156
|
+
* @default false
|
|
157
|
+
*/
|
|
158
|
+
defaultChecked?: boolean | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Whether the component should ignore user interaction.
|
|
161
|
+
* @default false
|
|
162
|
+
*/
|
|
163
|
+
disabled?: boolean | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* Event handler called when the checkbox is ticked or unticked.
|
|
166
|
+
*/
|
|
167
|
+
onCheckedChange?: ((checked: boolean, eventDetails: CheckboxRootChangeEventDetails) => void) | undefined;
|
|
168
|
+
/**
|
|
169
|
+
* Whether the user should be unable to tick or untick the checkbox.
|
|
170
|
+
* @default false
|
|
171
|
+
*/
|
|
172
|
+
readOnly?: boolean | undefined;
|
|
173
|
+
/**
|
|
174
|
+
* Whether the user must tick the checkbox before submitting a form.
|
|
175
|
+
* @default false
|
|
176
|
+
*/
|
|
177
|
+
required?: boolean | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* Whether the checkbox is in a mixed state: neither ticked, nor unticked.
|
|
180
|
+
* @default false
|
|
181
|
+
*/
|
|
182
|
+
indeterminate?: boolean | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* A ref to access the hidden `<input>` element.
|
|
185
|
+
*/
|
|
186
|
+
inputRef?: React_2.Ref<HTMLInputElement> | undefined;
|
|
187
|
+
/**
|
|
188
|
+
* Whether the checkbox controls a group of child checkboxes.
|
|
189
|
+
*
|
|
190
|
+
* Must be used in a [Checkbox Group](https://base-ui.com/react/components/checkbox-group).
|
|
191
|
+
* @default false
|
|
192
|
+
*/
|
|
193
|
+
parent?: boolean | undefined;
|
|
194
|
+
/**
|
|
195
|
+
* The value submitted with the form when the checkbox is unchecked.
|
|
196
|
+
* By default, unchecked checkboxes do not submit any value, matching native checkbox behavior.
|
|
197
|
+
*/
|
|
198
|
+
uncheckedValue?: string | undefined;
|
|
199
|
+
/**
|
|
200
|
+
* The value of the selected checkbox.
|
|
201
|
+
*/
|
|
202
|
+
value?: string | undefined;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export declare interface CheckboxRootState extends FieldRootState {
|
|
206
|
+
/**
|
|
207
|
+
* Whether the checkbox is currently ticked.
|
|
208
|
+
*/
|
|
209
|
+
checked: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* Whether the component should ignore user interaction.
|
|
212
|
+
*/
|
|
213
|
+
disabled: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* Whether the user should be unable to tick or untick the checkbox.
|
|
216
|
+
*/
|
|
217
|
+
readOnly: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Whether the user must tick the checkbox before submitting a form.
|
|
220
|
+
*/
|
|
221
|
+
required: boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Whether the checkbox is in a mixed state: neither ticked, nor unticked.
|
|
224
|
+
*/
|
|
225
|
+
indeterminate: boolean;
|
|
226
|
+
}
|
|
227
|
+
|
|
16
228
|
export declare const CheckboxSize: {
|
|
17
229
|
readonly small: 12;
|
|
18
230
|
readonly medium: 16;
|
|
19
231
|
readonly large: 20;
|
|
20
232
|
};
|
|
21
233
|
|
|
234
|
+
declare const chipRemovePress: "chip-remove-press";
|
|
235
|
+
|
|
236
|
+
declare const clearPress: "clear-press";
|
|
237
|
+
|
|
238
|
+
declare const closePress: "close-press";
|
|
239
|
+
|
|
240
|
+
declare const closeWatcher: "close-watcher";
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Shape of the render prop: a function that takes props to be spread on the element and component's state and returns a React element.
|
|
244
|
+
*
|
|
245
|
+
* @template Props Props to be spread on the rendered element.
|
|
246
|
+
* @template State Component's internal state.
|
|
247
|
+
*/
|
|
248
|
+
declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
|
|
249
|
+
|
|
250
|
+
declare const decrementPress: "decrement-press";
|
|
251
|
+
|
|
252
|
+
declare const disabled: "disabled";
|
|
253
|
+
|
|
254
|
+
declare const drag: "drag";
|
|
255
|
+
|
|
256
|
+
declare const escapeKey: "escape-key";
|
|
257
|
+
|
|
258
|
+
declare interface FieldRootState {
|
|
259
|
+
/**
|
|
260
|
+
* Whether the component should ignore user interaction.
|
|
261
|
+
*/
|
|
262
|
+
disabled: boolean;
|
|
263
|
+
/**
|
|
264
|
+
* Whether the field has been touched.
|
|
265
|
+
*/
|
|
266
|
+
touched: boolean;
|
|
267
|
+
/**
|
|
268
|
+
* Whether the field value has changed from its initial value.
|
|
269
|
+
*/
|
|
270
|
+
dirty: boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Whether the field is valid.
|
|
273
|
+
*/
|
|
274
|
+
valid: boolean | null;
|
|
275
|
+
/**
|
|
276
|
+
* Whether the field has a value.
|
|
277
|
+
*/
|
|
278
|
+
filled: boolean;
|
|
279
|
+
/**
|
|
280
|
+
* Whether the field is focused.
|
|
281
|
+
*/
|
|
282
|
+
focused: boolean;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
declare const focusOut: "focus-out";
|
|
286
|
+
|
|
287
|
+
declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
|
|
288
|
+
ref?: React_2.Ref<T> | undefined;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
declare const imperativeAction: "imperative-action";
|
|
292
|
+
|
|
293
|
+
declare const incrementPress: "increment-press";
|
|
294
|
+
|
|
295
|
+
declare const initial: "initial";
|
|
296
|
+
|
|
297
|
+
declare const inputBlur: "input-blur";
|
|
298
|
+
|
|
299
|
+
declare const inputChange: "input-change";
|
|
300
|
+
|
|
301
|
+
declare const inputClear: "input-clear";
|
|
302
|
+
|
|
303
|
+
declare const inputPaste: "input-paste";
|
|
304
|
+
|
|
305
|
+
declare const inputPress: "input-press";
|
|
306
|
+
|
|
307
|
+
declare const itemPress: "item-press";
|
|
308
|
+
|
|
309
|
+
declare const keyboard: "keyboard";
|
|
310
|
+
|
|
311
|
+
declare const linkPress: "link-press";
|
|
312
|
+
|
|
313
|
+
declare const listNavigation: "list-navigation";
|
|
314
|
+
|
|
315
|
+
declare const missing: "missing";
|
|
316
|
+
|
|
317
|
+
declare const none: "none";
|
|
318
|
+
|
|
319
|
+
declare interface NonNativeButtonProps {
|
|
320
|
+
/**
|
|
321
|
+
* Whether the component renders a native `<button>` element when replacing it
|
|
322
|
+
* via the `render` prop.
|
|
323
|
+
* Set to `true` if the rendered element is a native button.
|
|
324
|
+
* @default false
|
|
325
|
+
*/
|
|
326
|
+
nativeButton?: boolean | undefined;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
declare const outsidePress: "outside-press";
|
|
330
|
+
|
|
331
|
+
export declare const PARENT_CHECKBOX = "data-parent";
|
|
332
|
+
|
|
333
|
+
declare const pointer: "pointer";
|
|
334
|
+
|
|
335
|
+
declare namespace REASONS {
|
|
336
|
+
export {
|
|
337
|
+
none,
|
|
338
|
+
triggerPress,
|
|
339
|
+
triggerHover,
|
|
340
|
+
triggerFocus,
|
|
341
|
+
outsidePress,
|
|
342
|
+
itemPress,
|
|
343
|
+
closePress,
|
|
344
|
+
linkPress,
|
|
345
|
+
clearPress,
|
|
346
|
+
chipRemovePress,
|
|
347
|
+
trackPress,
|
|
348
|
+
incrementPress,
|
|
349
|
+
decrementPress,
|
|
350
|
+
inputChange,
|
|
351
|
+
inputClear,
|
|
352
|
+
inputBlur,
|
|
353
|
+
inputPaste,
|
|
354
|
+
inputPress,
|
|
355
|
+
focusOut,
|
|
356
|
+
escapeKey,
|
|
357
|
+
closeWatcher,
|
|
358
|
+
listNavigation,
|
|
359
|
+
keyboard,
|
|
360
|
+
pointer,
|
|
361
|
+
drag,
|
|
362
|
+
wheel,
|
|
363
|
+
scrub,
|
|
364
|
+
cancelOpen,
|
|
365
|
+
siblingOpen,
|
|
366
|
+
disabled,
|
|
367
|
+
missing,
|
|
368
|
+
initial,
|
|
369
|
+
imperativeAction,
|
|
370
|
+
swipe,
|
|
371
|
+
windowResize
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Maps a change `reason` string to the corresponding native event type.
|
|
377
|
+
*/
|
|
378
|
+
declare type ReasonToEvent<Reason extends string> = Reason extends keyof ReasonToEventMap ? ReasonToEventMap[Reason] : Event;
|
|
379
|
+
|
|
380
|
+
declare interface ReasonToEventMap {
|
|
381
|
+
[REASONS.none]: Event;
|
|
382
|
+
[REASONS.triggerPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
|
|
383
|
+
[REASONS.triggerHover]: MouseEvent;
|
|
384
|
+
[REASONS.triggerFocus]: FocusEvent;
|
|
385
|
+
[REASONS.outsidePress]: MouseEvent | PointerEvent | TouchEvent;
|
|
386
|
+
[REASONS.itemPress]: MouseEvent | KeyboardEvent | PointerEvent;
|
|
387
|
+
[REASONS.closePress]: MouseEvent | KeyboardEvent | PointerEvent;
|
|
388
|
+
[REASONS.linkPress]: MouseEvent | PointerEvent;
|
|
389
|
+
[REASONS.clearPress]: PointerEvent | MouseEvent | KeyboardEvent;
|
|
390
|
+
[REASONS.chipRemovePress]: PointerEvent | MouseEvent | KeyboardEvent;
|
|
391
|
+
[REASONS.trackPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
392
|
+
[REASONS.incrementPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
393
|
+
[REASONS.decrementPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
394
|
+
[REASONS.inputChange]: InputEvent | Event;
|
|
395
|
+
[REASONS.inputClear]: InputEvent | FocusEvent | Event;
|
|
396
|
+
[REASONS.inputBlur]: FocusEvent;
|
|
397
|
+
[REASONS.inputPaste]: ClipboardEvent;
|
|
398
|
+
[REASONS.inputPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
|
|
399
|
+
[REASONS.focusOut]: FocusEvent | KeyboardEvent;
|
|
400
|
+
[REASONS.escapeKey]: KeyboardEvent;
|
|
401
|
+
[REASONS.closeWatcher]: Event;
|
|
402
|
+
[REASONS.listNavigation]: KeyboardEvent;
|
|
403
|
+
[REASONS.keyboard]: KeyboardEvent;
|
|
404
|
+
[REASONS.pointer]: PointerEvent;
|
|
405
|
+
[REASONS.drag]: PointerEvent | TouchEvent;
|
|
406
|
+
[REASONS.swipe]: PointerEvent | TouchEvent;
|
|
407
|
+
[REASONS.wheel]: WheelEvent;
|
|
408
|
+
[REASONS.scrub]: PointerEvent;
|
|
409
|
+
[REASONS.cancelOpen]: MouseEvent;
|
|
410
|
+
[REASONS.siblingOpen]: Event;
|
|
411
|
+
[REASONS.disabled]: Event;
|
|
412
|
+
[REASONS.missing]: Event;
|
|
413
|
+
[REASONS.initial]: Event;
|
|
414
|
+
[REASONS.imperativeAction]: Event;
|
|
415
|
+
[REASONS.windowResize]: UIEvent;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
declare const scrub: "scrub";
|
|
419
|
+
|
|
420
|
+
declare const siblingOpen: "sibling-open";
|
|
421
|
+
|
|
422
|
+
declare const swipe: "swipe";
|
|
423
|
+
|
|
424
|
+
declare const trackPress: "track-press";
|
|
425
|
+
|
|
426
|
+
declare type TransitionStatus = 'starting' | 'ending' | 'idle' | undefined;
|
|
427
|
+
|
|
428
|
+
declare const triggerFocus: "trigger-focus";
|
|
429
|
+
|
|
430
|
+
declare const triggerHover: "trigger-hover";
|
|
431
|
+
|
|
432
|
+
declare const triggerPress: "trigger-press";
|
|
433
|
+
|
|
434
|
+
declare const wheel: "wheel";
|
|
435
|
+
|
|
436
|
+
declare const windowResize: "window-resize";
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Adds a `preventBaseUIHandler` method to all event handlers.
|
|
440
|
+
*/
|
|
441
|
+
declare type WithBaseUIEvent<T> = { [K in keyof T]: WithPreventBaseUIHandler<T[K]> };
|
|
22
442
|
|
|
23
|
-
|
|
443
|
+
declare type WithPreventBaseUIHandler<T> = T extends ((event: infer E) => any) ? E extends React_2.SyntheticEvent<Element, Event> ? (event: BaseUIEvent<E>) => ReturnType<T> : T : T extends undefined ? undefined : T;
|
|
24
444
|
|
|
25
445
|
export { }
|