@wix/site-ui 1.347.0 → 1.349.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/{6706.js → 1093.js} +3 -3
- package/dist/{8724.js → 1219.js} +2 -2
- package/dist/{7373.js → 1288.js} +8 -2
- package/dist/{5299.js → 1381.js} +98 -127
- package/dist/{3056.js → 1607.js} +32 -34
- package/dist/1629.js +2 -0
- package/dist/1669.js +75 -0
- package/dist/1718.js +26 -0
- package/dist/{1477.js → 201.js} +17 -26
- package/dist/2221.js +9 -0
- package/dist/{2445.js → 226.js} +12 -48
- package/dist/2387.js +7 -0
- package/dist/2580.js +6 -0
- package/dist/{1500.js → 2859.js} +10 -34
- package/dist/3014.js +178 -0
- package/dist/{6247.js → 3054.js} +3 -3
- package/dist/{7642.js → 3093.js} +1 -1
- package/dist/3189.js +5 -0
- package/dist/{7564.js → 331.js} +2 -2
- package/dist/3357.js +7 -0
- package/dist/{487.js → 3398.js} +38 -39
- package/dist/3502.js +224 -0
- package/dist/3695.js +50 -0
- package/dist/3829.js +1 -1
- package/dist/{6588.js → 3859.js} +115 -92
- package/dist/{3670.js → 3910.js} +28 -21
- package/dist/392.js +7 -0
- package/dist/{4549.js → 4155.js} +11 -3
- package/dist/4226.js +7 -0
- package/dist/{6329.js → 4229.js} +1 -1
- package/dist/4293.js +3 -0
- package/dist/4346.js +853 -2
- package/dist/{285.js → 4472.js} +3 -3
- package/dist/4605.js +207 -0
- package/dist/{7366.js → 488.js} +60 -7
- package/dist/{8750.js → 497.js} +190 -375
- package/dist/4989.js +35 -0
- package/dist/{6270.js → 510.js} +157 -196
- package/dist/5258.js +26 -0
- package/dist/{5036.js → 5275.js} +0 -3
- package/dist/{8171.js → 5298.js} +90 -102
- package/dist/5473.js +11 -0
- package/dist/{4745.js → 5490.js} +3 -1
- package/dist/{6089.js → 5561.js} +869 -786
- package/dist/{8996.js → 5595.js} +4 -3
- package/dist/5890.js +25 -0
- package/dist/{6046.js → 5969.js} +1 -1
- package/dist/5984.js +38 -0
- package/dist/{8527.js → 6006.js} +3 -3
- package/dist/6040.js +97 -0
- package/dist/{8758.js → 6137.js} +10 -8
- package/dist/{4281.js → 6140.js} +18 -10
- package/dist/{8960.js → 6191.js} +2 -2
- package/dist/6240.js +121 -0
- package/dist/{4490.js → 6373.js} +7 -5
- package/dist/{904.js → 6487.js} +19 -17
- package/dist/{9635.js → 6498.js} +1 -1
- package/dist/6499.js +4 -7
- package/dist/6508.js +7 -0
- package/dist/{8225.js → 6540.js} +1 -0
- package/dist/6551.js +46 -0
- package/dist/{9369.js → 6620.js} +35 -34
- package/dist/{4143.js → 6838.js} +19 -10
- package/dist/6902.js +48 -0
- package/dist/6904.js +51 -0
- package/dist/70.js +24 -0
- package/dist/7024.js +39 -0
- package/dist/{6882.js → 721.js} +737 -362
- package/dist/{951.js → 7270.js} +4 -4
- package/dist/{3485.js → 7323.js} +143 -111
- package/dist/{7541.js → 7488.js} +2 -2
- package/dist/{4863.js → 7542.js} +7 -6
- package/dist/7551.js +28 -0
- package/dist/{7021.js → 7640.js} +1 -1
- package/dist/{353.js → 7692.js} +3 -7
- package/dist/{4707.js → 7930.js} +2 -2
- package/dist/{8052.js → 8.js} +80 -64
- package/dist/{6914.js → 8129.js} +3 -15
- package/dist/{3319.js → 8358.js} +62 -63
- package/dist/{5864.js → 8407.js} +13 -13
- package/dist/8488.js +15 -0
- package/dist/{4768.js → 8495.js} +1 -1
- package/dist/8734.js +171 -0
- package/dist/{1763.js → 9018.js} +205 -331
- package/dist/9053.js +29 -0
- package/dist/9067.js +41 -0
- package/dist/{2861.js → 9120.js} +2 -2
- package/dist/{42.js → 9197.js} +2 -2
- package/dist/{9189.js → 9248.js} +36 -17
- package/dist/{2801.js → 9252.js} +4 -9
- package/dist/9295.js +7 -0
- package/dist/9303.js +8 -0
- package/dist/{167.js → 9374.js} +1 -1
- package/dist/{9352.js → 9540.js} +17 -47
- package/dist/9576.js +51 -0
- package/dist/{8272.js → 9591.js} +36 -46
- package/dist/{6107.js → 9770.js} +2 -2
- package/dist/{5085.js → 9880.js} +6 -3
- package/dist/Accordion/index.d.ts +207 -41
- package/dist/Accordion/index.js +75 -177
- package/dist/AlertDialog/index.d.ts +440 -140
- package/dist/AlertDialog/index.js +3 -13
- package/dist/Autocomplete/index.d.ts +722 -150
- package/dist/Autocomplete/index.js +16 -29
- package/dist/Avatar/index.d.ts +38 -3
- package/dist/Avatar/index.js +82 -28
- package/dist/Breadcrumbs/index.d.ts +63 -91
- package/dist/Breadcrumbs/index.js +1 -1
- package/dist/Button/index.d.ts +11 -0
- package/dist/Button/index.js +2 -2
- package/dist/Checkbox/index.d.ts +206 -36
- package/dist/Checkbox/index.js +293 -8
- package/dist/CheckboxField/index.css +1 -1
- package/dist/CheckboxField/index.d.ts +40 -36
- package/dist/CheckboxGroup/index.d.ts +50 -36
- package/dist/CheckboxGroup/index.js +87 -58
- package/dist/CheckboxGroupField/index.css +1 -1
- package/dist/Collapsible/index.d.ts +128 -36
- package/dist/Collapsible/index.js +21 -25
- package/dist/Combobox/index.d.ts +801 -158
- package/dist/Combobox/index.js +70 -114
- package/dist/ContextMenu/index.d.ts +1162 -195
- package/dist/ContextMenu/index.js +46 -36
- package/dist/Dialog/index.d.ts +425 -133
- package/dist/Dialog/index.js +8 -4
- package/dist/Drawer/index.d.ts +589 -144
- package/dist/Drawer/index.js +482 -562
- package/dist/Field/index.css +1 -1
- package/dist/Field/index.d.ts +341 -42
- package/dist/Field/index.js +123 -273
- package/dist/Fieldset/index.d.ts +11 -0
- package/dist/Fieldset/index.js +10 -17
- package/dist/Form/index.d.ts +43 -39
- package/dist/Form/index.js +58 -50
- package/dist/Input/index.css +1 -1
- package/dist/Input/index.d.ts +94 -42
- package/dist/Input/index.js +1 -1
- package/dist/Menu/index.d.ts +1140 -175
- package/dist/Menu/index.js +51 -67
- package/dist/Menubar/index.d.ts +651 -173
- package/dist/Menubar/index.js +12 -16
- package/dist/Meter/index.js +21 -18
- package/dist/NavigationMenu/index.d.ts +370 -86
- package/dist/NavigationMenu/index.js +144 -178
- package/dist/NumberField/index.css +1 -1
- package/dist/NumberField/index.d.ts +507 -47
- package/dist/NumberField/index.js +434 -718
- package/dist/Popover/index.d.ts +561 -142
- package/dist/Popover/index.js +181 -252
- package/dist/PreviewCard/index.d.ts +507 -143
- package/dist/PreviewCard/index.js +97 -151
- package/dist/Progress/index.d.ts +117 -3
- package/dist/Progress/index.js +37 -36
- package/dist/Radio/index.d.ts +177 -7
- package/dist/Radio/index.js +54 -70
- package/dist/RadioField/index.css +1 -1
- package/dist/RadioField/index.d.ts +23 -7
- package/dist/RadioGroup/index.d.ts +51 -37
- package/dist/RadioGroup/index.js +60 -51
- package/dist/RadioGroupField/index.css +1 -1
- package/dist/RadioGroupField/index.d.ts +40 -37
- package/dist/ScrollArea/index.d.ts +295 -1
- package/dist/ScrollArea/index.js +256 -324
- package/dist/Select/index.d.ts +516 -123
- package/dist/Select/index.js +513 -635
- package/dist/SelectField/index.css +1 -1
- package/dist/SelectField/index.d.ts +109 -134
- package/dist/SelectField/index.js +5 -1
- package/dist/Separator/index.d.ts +12 -0
- package/dist/Separator/index.js +1 -1
- package/dist/Slider/index.d.ts +383 -64
- package/dist/Slider/index.js +298 -374
- package/dist/Switch/index.d.ts +184 -37
- package/dist/Switch/index.js +44 -58
- package/dist/Tabs/index.d.ts +220 -35
- package/dist/Tabs/index.js +199 -193
- package/dist/Toast/index.d.ts +280 -64
- package/dist/Toast/index.js +299 -374
- package/dist/Toggle/index.d.ts +55 -35
- package/dist/Toggle/index.js +19 -13
- package/dist/ToggleGroup/index.d.ts +62 -35
- package/dist/ToggleGroup/index.js +13 -31
- package/dist/Toolbar/index.d.ts +117 -2
- package/dist/Toolbar/index.js +31 -43
- package/dist/Tooltip/index.d.ts +507 -150
- package/dist/Tooltip/index.js +163 -213
- package/dist/index.d.ts +12912 -5382
- package/package.json +3 -3
- package/dist/2205.js +0 -26
- package/dist/2274.js +0 -34
- package/dist/2287.js +0 -17
- package/dist/3020.js +0 -7
- package/dist/3021.js +0 -72
- package/dist/3140.js +0 -4
- package/dist/3248.js +0 -307
- package/dist/4026.js +0 -12
- package/dist/4922.js +0 -15
- package/dist/5659.js +0 -4
- package/dist/5992.js +0 -447
- package/dist/6330.js +0 -30
- package/dist/6535.js +0 -72
- package/dist/6917.js +0 -55
- package/dist/7725.js +0 -10
- package/dist/7871.js +0 -38
- package/dist/8106.js +0 -239
- package/dist/8685.js +0 -102
- package/dist/8935.js +0 -8
- package/dist/8971.js +0 -40
- package/dist/8979.js +0 -10
- package/dist/9048.js +0 -52
- package/dist/9087.js +0 -256
- package/dist/9255.js +0 -136
- /package/dist/{1457.js → 1068.js} +0 -0
- /package/dist/{6003.js → 1234.js} +0 -0
- /package/dist/{4723.js → 1282.js} +0 -0
- /package/dist/{6825.js → 1876.js} +0 -0
- /package/dist/{5778.js → 1885.js} +0 -0
- /package/dist/{2445.js.LICENSE.txt → 226.js.LICENSE.txt} +0 -0
- /package/dist/{1279.js → 3278.js} +0 -0
- /package/dist/{3296.js → 5568.js} +0 -0
- /package/dist/{8685.css → 6240.css} +0 -0
- /package/dist/{9829.js → 6488.js} +0 -0
- /package/dist/{9863.js → 6534.js} +0 -0
- /package/dist/{4495.js → 7718.js} +0 -0
- /package/dist/{3395.js → 8866.js} +0 -0
- /package/dist/{2418.js → 9837.js} +0 -0
package/dist/Toggle/index.d.ts
CHANGED
|
@@ -65,15 +65,15 @@ declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E &
|
|
|
65
65
|
readonly baseUIHandlerPrevented?: boolean | undefined;
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
declare const cancelOpen:
|
|
68
|
+
declare const cancelOpen: 'cancel-open';
|
|
69
69
|
|
|
70
|
-
declare const chipRemovePress:
|
|
70
|
+
declare const chipRemovePress: 'chip-remove-press';
|
|
71
71
|
|
|
72
|
-
declare const clearPress:
|
|
72
|
+
declare const clearPress: 'clear-press';
|
|
73
73
|
|
|
74
|
-
declare const closePress:
|
|
74
|
+
declare const closePress: 'close-press';
|
|
75
75
|
|
|
76
|
-
declare const closeWatcher:
|
|
76
|
+
declare const closeWatcher: 'close-watcher';
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* 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.
|
|
@@ -83,45 +83,50 @@ declare const closeWatcher: "close-watcher";
|
|
|
83
83
|
*/
|
|
84
84
|
declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
|
|
85
85
|
|
|
86
|
-
declare const decrementPress:
|
|
86
|
+
declare const decrementPress: 'decrement-press';
|
|
87
87
|
|
|
88
|
-
declare const disabled:
|
|
88
|
+
declare const disabled: 'disabled';
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Present when the toggle button is disabled.
|
|
92
|
+
*/
|
|
93
|
+
declare const disabled_2 = "data-disabled";
|
|
94
|
+
|
|
95
|
+
declare const drag: 'drag';
|
|
91
96
|
|
|
92
|
-
declare const escapeKey:
|
|
97
|
+
declare const escapeKey: 'escape-key';
|
|
93
98
|
|
|
94
|
-
declare const focusOut:
|
|
99
|
+
declare const focusOut: 'focus-out';
|
|
95
100
|
|
|
96
101
|
declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
|
|
97
102
|
ref?: React_2.Ref<T> | undefined;
|
|
98
103
|
};
|
|
99
104
|
|
|
100
|
-
declare const imperativeAction:
|
|
105
|
+
declare const imperativeAction: 'imperative-action';
|
|
101
106
|
|
|
102
|
-
declare const incrementPress:
|
|
107
|
+
declare const incrementPress: 'increment-press';
|
|
103
108
|
|
|
104
|
-
declare const initial:
|
|
109
|
+
declare const initial: 'initial';
|
|
105
110
|
|
|
106
|
-
declare const inputBlur:
|
|
111
|
+
declare const inputBlur: 'input-blur';
|
|
107
112
|
|
|
108
|
-
declare const inputChange:
|
|
113
|
+
declare const inputChange: 'input-change';
|
|
109
114
|
|
|
110
|
-
declare const inputClear:
|
|
115
|
+
declare const inputClear: 'input-clear';
|
|
111
116
|
|
|
112
|
-
declare const inputPaste:
|
|
117
|
+
declare const inputPaste: 'input-paste';
|
|
113
118
|
|
|
114
|
-
declare const inputPress:
|
|
119
|
+
declare const inputPress: 'input-press';
|
|
115
120
|
|
|
116
|
-
declare const itemPress:
|
|
121
|
+
declare const itemPress: 'item-press';
|
|
117
122
|
|
|
118
|
-
declare const keyboard:
|
|
123
|
+
declare const keyboard: 'keyboard';
|
|
119
124
|
|
|
120
|
-
declare const linkPress:
|
|
125
|
+
declare const linkPress: 'link-press';
|
|
121
126
|
|
|
122
|
-
declare const listNavigation:
|
|
127
|
+
declare const listNavigation: 'list-navigation';
|
|
123
128
|
|
|
124
|
-
declare const missing:
|
|
129
|
+
declare const missing: 'missing';
|
|
125
130
|
|
|
126
131
|
declare interface NativeButtonProps {
|
|
127
132
|
/**
|
|
@@ -133,11 +138,18 @@ declare interface NativeButtonProps {
|
|
|
133
138
|
nativeButton?: boolean | undefined;
|
|
134
139
|
}
|
|
135
140
|
|
|
136
|
-
declare const none:
|
|
141
|
+
declare const none: 'none';
|
|
137
142
|
|
|
138
|
-
declare const outsidePress:
|
|
143
|
+
declare const outsidePress: 'outside-press';
|
|
139
144
|
|
|
140
|
-
declare const pointer:
|
|
145
|
+
declare const pointer: 'pointer';
|
|
146
|
+
|
|
147
|
+
declare const popupClose: 'popup-close';
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Present when the toggle button is pressed.
|
|
151
|
+
*/
|
|
152
|
+
declare const pressed = "data-pressed";
|
|
141
153
|
|
|
142
154
|
declare namespace REASONS {
|
|
143
155
|
export {
|
|
@@ -168,6 +180,7 @@ declare namespace REASONS {
|
|
|
168
180
|
drag,
|
|
169
181
|
wheel,
|
|
170
182
|
scrub,
|
|
183
|
+
popupClose,
|
|
171
184
|
cancelOpen,
|
|
172
185
|
siblingOpen,
|
|
173
186
|
disabled,
|
|
@@ -222,11 +235,11 @@ declare interface ReasonToEventMap {
|
|
|
222
235
|
[REASONS.windowResize]: UIEvent;
|
|
223
236
|
}
|
|
224
237
|
|
|
225
|
-
declare const scrub:
|
|
238
|
+
declare const scrub: 'scrub';
|
|
226
239
|
|
|
227
|
-
declare const siblingOpen:
|
|
240
|
+
declare const siblingOpen: 'sibling-open';
|
|
228
241
|
|
|
229
|
-
declare const swipe:
|
|
242
|
+
declare const swipe: 'swipe';
|
|
230
243
|
|
|
231
244
|
export declare const Toggle: React_2.ForwardRefExoticComponent<Omit<Omit<Toggle_2.Props<string> & React_2.RefAttributes<HTMLButtonElement>, "ref">, "className"> & {
|
|
232
245
|
className?: string;
|
|
@@ -253,6 +266,13 @@ export declare type ToggleChangeEventDetails = BaseUIChangeEventDetails<Toggle_2
|
|
|
253
266
|
|
|
254
267
|
export declare type ToggleChangeEventReason = typeof REASONS.none;
|
|
255
268
|
|
|
269
|
+
export declare namespace ToggleDataAttributes {
|
|
270
|
+
export {
|
|
271
|
+
pressed,
|
|
272
|
+
disabled_2 as disabled
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
256
276
|
export declare interface ToggleProps<Value extends string> extends NativeButtonProps, BaseUIComponentProps<'button', ToggleState> {
|
|
257
277
|
/**
|
|
258
278
|
* Whether the toggle button is currently pressed.
|
|
@@ -292,17 +312,17 @@ export declare interface ToggleState {
|
|
|
292
312
|
disabled: boolean;
|
|
293
313
|
}
|
|
294
314
|
|
|
295
|
-
declare const trackPress:
|
|
315
|
+
declare const trackPress: 'track-press';
|
|
296
316
|
|
|
297
|
-
declare const triggerFocus:
|
|
317
|
+
declare const triggerFocus: 'trigger-focus';
|
|
298
318
|
|
|
299
|
-
declare const triggerHover:
|
|
319
|
+
declare const triggerHover: 'trigger-hover';
|
|
300
320
|
|
|
301
|
-
declare const triggerPress:
|
|
321
|
+
declare const triggerPress: 'trigger-press';
|
|
302
322
|
|
|
303
|
-
declare const wheel:
|
|
323
|
+
declare const wheel: 'wheel';
|
|
304
324
|
|
|
305
|
-
declare const windowResize:
|
|
325
|
+
declare const windowResize: 'window-resize';
|
|
306
326
|
|
|
307
327
|
/**
|
|
308
328
|
* Adds a `preventBaseUIHandler` method to all event handlers.
|
package/dist/Toggle/index.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import { useBaseUiId } from "../
|
|
4
|
-
import { useToggleGroupContext } from "../
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { CompositeItem } from "../951.js";
|
|
3
|
+
import { useBaseUiId } from "../5969.js";
|
|
4
|
+
import { useToggleGroupContext } from "../392.js";
|
|
5
|
+
import { error } from "../4293.js";
|
|
6
|
+
import { useControlled } from "../6006.js";
|
|
7
|
+
import { useButton } from "../9248.js";
|
|
8
|
+
import { createChangeEventDetails } from "../8495.js";
|
|
9
|
+
import { useRenderElement } from "../9591.js";
|
|
10
|
+
import { CompositeItem } from "../7270.js";
|
|
12
11
|
import * as __rspack_external_react from "react";
|
|
13
12
|
const Toggle_Toggle = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
14
|
-
const { className, defaultPressed
|
|
13
|
+
const { className, defaultPressed = false, disabled: disabledProp = false, form, onPressedChange, pressed: pressedProp, render, type, value: valueProp, nativeButton = true, style, ...elementProps } = componentProps;
|
|
15
14
|
const value = useBaseUiId(valueProp || void 0);
|
|
16
15
|
const groupContext = useToggleGroupContext();
|
|
17
16
|
const groupValue = groupContext?.value ?? [];
|
|
18
|
-
const defaultPressed = groupContext ? void 0 : defaultPressedProp;
|
|
19
17
|
const disabled = (disabledProp || groupContext?.disabled) ?? false;
|
|
20
|
-
if ('production' !== process.env.NODE_ENV)
|
|
18
|
+
if ('production' !== process.env.NODE_ENV) __rspack_external_react.useEffect(()=>{
|
|
21
19
|
if (groupContext && void 0 === valueProp && groupContext.isValueInitialized) error('A `<Toggle>` component rendered in a `<ToggleGroup>` has no explicit `value` prop.', 'This will cause issues between the Toggle Group and Toggle values.', 'Provide the `<Toggle>` with a `value` prop matching the `<ToggleGroup>` values prop type.');
|
|
22
20
|
}, [
|
|
23
21
|
groupContext,
|
|
@@ -48,9 +46,10 @@ const Toggle_Toggle = /*#__PURE__*/ __rspack_external_react.forwardRef(function(
|
|
|
48
46
|
onClick (event) {
|
|
49
47
|
const nextPressed = !pressed;
|
|
50
48
|
const details = createChangeEventDetails("none", event.nativeEvent);
|
|
51
|
-
if (value) groupContext?.setGroupValue?.(value, nextPressed, details);
|
|
52
49
|
onPressedChange?.(nextPressed, details);
|
|
53
50
|
if (details.isCanceled) return;
|
|
51
|
+
if (value) groupContext?.setGroupValue?.(value, nextPressed, details);
|
|
52
|
+
if (details.isCanceled) return;
|
|
54
53
|
setPressedState(nextPressed);
|
|
55
54
|
}
|
|
56
55
|
},
|
|
@@ -63,11 +62,18 @@ const Toggle_Toggle = /*#__PURE__*/ __rspack_external_react.forwardRef(function(
|
|
|
63
62
|
ref: refs,
|
|
64
63
|
props
|
|
65
64
|
});
|
|
65
|
+
const itemMetadata = __rspack_external_react.useMemo(()=>({
|
|
66
|
+
disabled,
|
|
67
|
+
focusableWhenDisabled: false
|
|
68
|
+
}), [
|
|
69
|
+
disabled
|
|
70
|
+
]);
|
|
66
71
|
if (groupContext) return /*#__PURE__*/ jsx(CompositeItem, {
|
|
67
72
|
tag: "button",
|
|
68
73
|
render: render,
|
|
69
74
|
className: className,
|
|
70
75
|
style: style,
|
|
76
|
+
metadata: itemMetadata,
|
|
71
77
|
state: state,
|
|
72
78
|
refs: refs,
|
|
73
79
|
props: props
|
|
@@ -65,15 +65,15 @@ declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E &
|
|
|
65
65
|
readonly baseUIHandlerPrevented?: boolean | undefined;
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
declare const cancelOpen:
|
|
68
|
+
declare const cancelOpen: 'cancel-open';
|
|
69
69
|
|
|
70
|
-
declare const chipRemovePress:
|
|
70
|
+
declare const chipRemovePress: 'chip-remove-press';
|
|
71
71
|
|
|
72
|
-
declare const clearPress:
|
|
72
|
+
declare const clearPress: 'clear-press';
|
|
73
73
|
|
|
74
|
-
declare const closePress:
|
|
74
|
+
declare const closePress: 'close-press';
|
|
75
75
|
|
|
76
|
-
declare const closeWatcher:
|
|
76
|
+
declare const closeWatcher: 'close-watcher';
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* 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.
|
|
@@ -83,53 +83,71 @@ declare const closeWatcher: "close-watcher";
|
|
|
83
83
|
*/
|
|
84
84
|
declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
|
|
85
85
|
|
|
86
|
-
declare const decrementPress:
|
|
86
|
+
declare const decrementPress: 'decrement-press';
|
|
87
87
|
|
|
88
|
-
declare const disabled:
|
|
88
|
+
declare const disabled: 'disabled';
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Present when the toggle group is disabled.
|
|
92
|
+
*/
|
|
93
|
+
declare const disabled_2 = "data-disabled";
|
|
91
94
|
|
|
92
|
-
declare const
|
|
95
|
+
declare const drag: 'drag';
|
|
93
96
|
|
|
94
|
-
declare const
|
|
97
|
+
declare const escapeKey: 'escape-key';
|
|
98
|
+
|
|
99
|
+
declare const focusOut: 'focus-out';
|
|
95
100
|
|
|
96
101
|
declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
|
|
97
102
|
ref?: React_2.Ref<T> | undefined;
|
|
98
103
|
};
|
|
99
104
|
|
|
100
|
-
declare const imperativeAction:
|
|
105
|
+
declare const imperativeAction: 'imperative-action';
|
|
101
106
|
|
|
102
|
-
declare const incrementPress:
|
|
107
|
+
declare const incrementPress: 'increment-press';
|
|
103
108
|
|
|
104
|
-
declare const initial:
|
|
109
|
+
declare const initial: 'initial';
|
|
105
110
|
|
|
106
|
-
declare const inputBlur:
|
|
111
|
+
declare const inputBlur: 'input-blur';
|
|
107
112
|
|
|
108
|
-
declare const inputChange:
|
|
113
|
+
declare const inputChange: 'input-change';
|
|
109
114
|
|
|
110
|
-
declare const inputClear:
|
|
115
|
+
declare const inputClear: 'input-clear';
|
|
111
116
|
|
|
112
|
-
declare const inputPaste:
|
|
117
|
+
declare const inputPaste: 'input-paste';
|
|
113
118
|
|
|
114
|
-
declare const inputPress:
|
|
119
|
+
declare const inputPress: 'input-press';
|
|
115
120
|
|
|
116
|
-
declare const itemPress:
|
|
121
|
+
declare const itemPress: 'item-press';
|
|
117
122
|
|
|
118
|
-
declare const keyboard:
|
|
123
|
+
declare const keyboard: 'keyboard';
|
|
119
124
|
|
|
120
|
-
declare const linkPress:
|
|
125
|
+
declare const linkPress: 'link-press';
|
|
121
126
|
|
|
122
|
-
declare const listNavigation:
|
|
127
|
+
declare const listNavigation: 'list-navigation';
|
|
123
128
|
|
|
124
|
-
declare const missing:
|
|
129
|
+
declare const missing: 'missing';
|
|
125
130
|
|
|
126
|
-
|
|
131
|
+
/**
|
|
132
|
+
* Present when the toggle group allows multiple buttons to be in the pressed state at the same time.
|
|
133
|
+
*/
|
|
134
|
+
declare const multiple = "data-multiple";
|
|
135
|
+
|
|
136
|
+
declare const none: 'none';
|
|
127
137
|
|
|
128
138
|
declare type Orientation = 'horizontal' | 'vertical';
|
|
129
139
|
|
|
130
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Indicates the orientation of the toggle group.
|
|
142
|
+
* @type {'horizontal' | 'vertical'}
|
|
143
|
+
*/
|
|
144
|
+
declare const orientation_2 = "data-orientation";
|
|
145
|
+
|
|
146
|
+
declare const outsidePress: 'outside-press';
|
|
131
147
|
|
|
132
|
-
declare const pointer:
|
|
148
|
+
declare const pointer: 'pointer';
|
|
149
|
+
|
|
150
|
+
declare const popupClose: 'popup-close';
|
|
133
151
|
|
|
134
152
|
declare namespace REASONS {
|
|
135
153
|
export {
|
|
@@ -160,6 +178,7 @@ declare namespace REASONS {
|
|
|
160
178
|
drag,
|
|
161
179
|
wheel,
|
|
162
180
|
scrub,
|
|
181
|
+
popupClose,
|
|
163
182
|
cancelOpen,
|
|
164
183
|
siblingOpen,
|
|
165
184
|
disabled,
|
|
@@ -214,11 +233,11 @@ declare interface ReasonToEventMap {
|
|
|
214
233
|
[REASONS.windowResize]: UIEvent;
|
|
215
234
|
}
|
|
216
235
|
|
|
217
|
-
declare const scrub:
|
|
236
|
+
declare const scrub: 'scrub';
|
|
218
237
|
|
|
219
|
-
declare const siblingOpen:
|
|
238
|
+
declare const siblingOpen: 'sibling-open';
|
|
220
239
|
|
|
221
|
-
declare const swipe:
|
|
240
|
+
declare const swipe: 'swipe';
|
|
222
241
|
|
|
223
242
|
export declare const ToggleGroup: React_2.ForwardRefExoticComponent<Omit<Omit<ToggleGroup_2.Props<string> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
224
243
|
className?: string;
|
|
@@ -244,6 +263,14 @@ export declare type ToggleGroupChangeEventDetails = BaseUIChangeEventDetails<Tog
|
|
|
244
263
|
|
|
245
264
|
export declare type ToggleGroupChangeEventReason = typeof REASONS.none;
|
|
246
265
|
|
|
266
|
+
export declare namespace ToggleGroupDataAttributes {
|
|
267
|
+
export {
|
|
268
|
+
disabled_2 as disabled,
|
|
269
|
+
orientation_2 as orientation,
|
|
270
|
+
multiple
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
247
274
|
export declare interface ToggleGroupProps<Value extends string> extends BaseUIComponentProps<'div', ToggleGroupState> {
|
|
248
275
|
/**
|
|
249
276
|
* The pressed state of the toggle group represented by an array of
|
|
@@ -303,17 +330,17 @@ export declare interface ToggleGroupState {
|
|
|
303
330
|
orientation: Orientation;
|
|
304
331
|
}
|
|
305
332
|
|
|
306
|
-
declare const trackPress:
|
|
333
|
+
declare const trackPress: 'track-press';
|
|
307
334
|
|
|
308
|
-
declare const triggerFocus:
|
|
335
|
+
declare const triggerFocus: 'trigger-focus';
|
|
309
336
|
|
|
310
|
-
declare const triggerHover:
|
|
337
|
+
declare const triggerHover: 'trigger-hover';
|
|
311
338
|
|
|
312
|
-
declare const triggerPress:
|
|
339
|
+
declare const triggerPress: 'trigger-press';
|
|
313
340
|
|
|
314
|
-
declare const wheel:
|
|
341
|
+
declare const wheel: 'wheel';
|
|
315
342
|
|
|
316
|
-
declare const windowResize:
|
|
343
|
+
declare const windowResize: 'window-resize';
|
|
317
344
|
|
|
318
345
|
/**
|
|
319
346
|
* Adds a `preventBaseUIHandler` method to all event handlers.
|
|
@@ -1,37 +1,23 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import { useToolbarRootContext } from "../
|
|
4
|
-
import {
|
|
5
|
-
import { EMPTY_ARRAY, useRenderElement } from "../
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { useToolbarRootContext } from "../9770.js";
|
|
4
|
+
import { useToolbarGroupContext } from "../6508.js";
|
|
5
|
+
import { EMPTY_ARRAY, useRenderElement } from "../9591.js";
|
|
6
|
+
import { useControlled } from "../6006.js";
|
|
7
|
+
import { useStableCallback } from "../7488.js";
|
|
8
|
+
import { ToggleGroupContext } from "../392.js";
|
|
9
|
+
import { CompositeRoot } from "../3502.js";
|
|
9
10
|
import * as __rspack_external_react from "react";
|
|
10
|
-
let ToggleGroupDataAttributes_ToggleGroupDataAttributes = /*#__PURE__*/ function(ToggleGroupDataAttributes) {
|
|
11
|
-
ToggleGroupDataAttributes["disabled"] = "data-disabled";
|
|
12
|
-
ToggleGroupDataAttributes["orientation"] = "data-orientation";
|
|
13
|
-
ToggleGroupDataAttributes["multiple"] = "data-multiple";
|
|
14
|
-
return ToggleGroupDataAttributes;
|
|
15
|
-
}({});
|
|
16
|
-
const stateAttributesMapping = {
|
|
17
|
-
multiple (value) {
|
|
18
|
-
if (value) return {
|
|
19
|
-
[ToggleGroupDataAttributes_ToggleGroupDataAttributes.multiple]: ''
|
|
20
|
-
};
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
11
|
const ToggleGroup_ToggleGroup = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
25
12
|
const { defaultValue: defaultValueProp, disabled: disabledProp = false, loopFocus = true, onValueChange, orientation = 'horizontal', multiple = false, value: valueProp, className, render, style, ...elementProps } = componentProps;
|
|
26
13
|
const toolbarContext = useToolbarRootContext(true);
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const disabled = (toolbarContext?.disabled ?? false) || disabledProp;
|
|
14
|
+
const toolbarGroupContext = useToolbarGroupContext();
|
|
15
|
+
const defaultValue = defaultValueProp ?? EMPTY_ARRAY;
|
|
16
|
+
const isValueInitialized = void 0 !== valueProp || void 0 !== defaultValueProp;
|
|
17
|
+
const disabled = (toolbarContext?.disabled ?? false) || (toolbarGroupContext?.disabled ?? false) || disabledProp;
|
|
32
18
|
const [groupValue, setValueState] = useControlled({
|
|
33
19
|
controlled: valueProp,
|
|
34
|
-
default:
|
|
20
|
+
default: defaultValue,
|
|
35
21
|
name: 'ToggleGroup',
|
|
36
22
|
state: 'value'
|
|
37
23
|
});
|
|
@@ -55,13 +41,11 @@ const ToggleGroup_ToggleGroup = /*#__PURE__*/ __rspack_external_react.forwardRef
|
|
|
55
41
|
};
|
|
56
42
|
const contextValue = __rspack_external_react.useMemo(()=>({
|
|
57
43
|
disabled,
|
|
58
|
-
orientation,
|
|
59
44
|
setGroupValue,
|
|
60
45
|
value: groupValue,
|
|
61
46
|
isValueInitialized
|
|
62
47
|
}), [
|
|
63
48
|
disabled,
|
|
64
|
-
orientation,
|
|
65
49
|
setGroupValue,
|
|
66
50
|
groupValue,
|
|
67
51
|
isValueInitialized
|
|
@@ -76,8 +60,7 @@ const ToggleGroup_ToggleGroup = /*#__PURE__*/ __rspack_external_react.forwardRef
|
|
|
76
60
|
props: [
|
|
77
61
|
defaultProps,
|
|
78
62
|
elementProps
|
|
79
|
-
]
|
|
80
|
-
stateAttributesMapping: stateAttributesMapping
|
|
63
|
+
]
|
|
81
64
|
});
|
|
82
65
|
return /*#__PURE__*/ jsx(ToggleGroupContext.Provider, {
|
|
83
66
|
value: contextValue,
|
|
@@ -93,7 +76,6 @@ const ToggleGroup_ToggleGroup = /*#__PURE__*/ __rspack_external_react.forwardRef
|
|
|
93
76
|
defaultProps,
|
|
94
77
|
elementProps
|
|
95
78
|
],
|
|
96
|
-
stateAttributesMapping: stateAttributesMapping,
|
|
97
79
|
loopFocus: loopFocus,
|
|
98
80
|
enableHomeAndEndKeys: true,
|
|
99
81
|
orientation: orientation
|
package/dist/Toolbar/index.d.ts
CHANGED
|
@@ -43,6 +43,36 @@ declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E &
|
|
|
43
43
|
*/
|
|
44
44
|
declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Present when the toolbar is disabled.
|
|
48
|
+
*/
|
|
49
|
+
declare const disabled = "data-disabled";
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Present when the group is disabled.
|
|
53
|
+
*/
|
|
54
|
+
declare const disabled_2 = "data-disabled";
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Present when the button is disabled.
|
|
58
|
+
*/
|
|
59
|
+
declare const disabled_3 = "data-disabled";
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Present when the input is disabled.
|
|
63
|
+
*/
|
|
64
|
+
declare const disabled_4 = "data-disabled";
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Present when the button remains focusable when disabled.
|
|
68
|
+
*/
|
|
69
|
+
declare const focusable = "data-focusable";
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Present when the input remains focusable when disabled.
|
|
73
|
+
*/
|
|
74
|
+
declare const focusable_2 = "data-focusable";
|
|
75
|
+
|
|
46
76
|
declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
|
|
47
77
|
ref?: React_2.Ref<T> | undefined;
|
|
48
78
|
};
|
|
@@ -59,6 +89,42 @@ declare interface NativeButtonProps {
|
|
|
59
89
|
|
|
60
90
|
export declare type Orientation = 'horizontal' | 'vertical';
|
|
61
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Indicates the orientation of the separator, which is perpendicular to the toolbar.
|
|
94
|
+
* @type {'horizontal' | 'vertical'}
|
|
95
|
+
*/
|
|
96
|
+
declare const orientation_2 = "data-orientation";
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Indicates the orientation of the toolbar.
|
|
100
|
+
* @type {'horizontal' | 'vertical'}
|
|
101
|
+
*/
|
|
102
|
+
declare const orientation_3 = "data-orientation";
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Indicates the orientation of the toolbar.
|
|
106
|
+
* @type {'horizontal' | 'vertical'}
|
|
107
|
+
*/
|
|
108
|
+
declare const orientation_4 = "data-orientation";
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Indicates the orientation of the toolbar.
|
|
112
|
+
* @type {'horizontal' | 'vertical'}
|
|
113
|
+
*/
|
|
114
|
+
declare const orientation_5 = "data-orientation";
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Indicates the orientation of the toolbar.
|
|
118
|
+
* @type {'horizontal' | 'vertical'}
|
|
119
|
+
*/
|
|
120
|
+
declare const orientation_6 = "data-orientation";
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Indicates the orientation of the toolbar.
|
|
124
|
+
* @type {'horizontal' | 'vertical'}
|
|
125
|
+
*/
|
|
126
|
+
declare const orientation_7 = "data-orientation";
|
|
127
|
+
|
|
62
128
|
/**
|
|
63
129
|
* A separator element accessible to screen readers.
|
|
64
130
|
* Renders a `<div>` element.
|
|
@@ -121,6 +187,14 @@ export declare namespace ToolbarButton {
|
|
|
121
187
|
export type Props = ToolbarButtonProps;
|
|
122
188
|
}
|
|
123
189
|
|
|
190
|
+
export declare namespace ToolbarButtonDataAttributes {
|
|
191
|
+
export {
|
|
192
|
+
disabled_3 as disabled,
|
|
193
|
+
orientation_5 as orientation,
|
|
194
|
+
focusable
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
124
198
|
export declare interface ToolbarButtonProps extends NativeButtonProps, BaseUIComponentProps<'button', ToolbarButtonState> {
|
|
125
199
|
/**
|
|
126
200
|
* When `true` the item is disabled.
|
|
@@ -158,6 +232,13 @@ export declare namespace ToolbarGroup {
|
|
|
158
232
|
export type Props = ToolbarGroupProps;
|
|
159
233
|
}
|
|
160
234
|
|
|
235
|
+
export declare namespace ToolbarGroupDataAttributes {
|
|
236
|
+
export {
|
|
237
|
+
disabled_2 as disabled,
|
|
238
|
+
orientation_4 as orientation
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
161
242
|
export declare interface ToolbarGroupProps extends BaseUIComponentProps<'div', ToolbarGroupState> {
|
|
162
243
|
/**
|
|
163
244
|
* When `true` all toolbar items in the group are disabled.
|
|
@@ -181,6 +262,14 @@ export declare namespace ToolbarInput {
|
|
|
181
262
|
export type Props = ToolbarInputProps;
|
|
182
263
|
}
|
|
183
264
|
|
|
265
|
+
export declare namespace ToolbarInputDataAttributes {
|
|
266
|
+
export {
|
|
267
|
+
disabled_4 as disabled,
|
|
268
|
+
orientation_7 as orientation,
|
|
269
|
+
focusable_2 as focusable
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
184
273
|
export declare interface ToolbarInputProps extends BaseUIComponentProps<'input', ToolbarInputState> {
|
|
185
274
|
/**
|
|
186
275
|
* When `true` the item is disabled.
|
|
@@ -219,7 +308,13 @@ export declare namespace ToolbarLink {
|
|
|
219
308
|
export type Props = ToolbarLinkProps;
|
|
220
309
|
}
|
|
221
310
|
|
|
222
|
-
export declare
|
|
311
|
+
export declare namespace ToolbarLinkDataAttributes {
|
|
312
|
+
export {
|
|
313
|
+
orientation_6 as orientation
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export declare interface ToolbarLinkProps extends BaseUIComponentProps<'a', ToolbarLinkState, React_2.ComponentPropsWithRef<'a'>> {}
|
|
223
318
|
|
|
224
319
|
export declare interface ToolbarLinkState {
|
|
225
320
|
/**
|
|
@@ -243,7 +338,15 @@ export declare namespace ToolbarRoot {
|
|
|
243
338
|
export type Props = ToolbarRootProps;
|
|
244
339
|
}
|
|
245
340
|
|
|
341
|
+
export declare namespace ToolbarRootDataAttributes {
|
|
342
|
+
export {
|
|
343
|
+
disabled,
|
|
344
|
+
orientation_3 as orientation
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
246
348
|
export declare interface ToolbarRootItemMetadata {
|
|
349
|
+
disabled: boolean;
|
|
247
350
|
focusableWhenDisabled: boolean;
|
|
248
351
|
}
|
|
249
352
|
|
|
@@ -288,7 +391,19 @@ export declare namespace ToolbarSeparator {
|
|
|
288
391
|
export type Props = ToolbarSeparatorProps;
|
|
289
392
|
}
|
|
290
393
|
|
|
291
|
-
export declare
|
|
394
|
+
export declare namespace ToolbarSeparatorDataAttributes {
|
|
395
|
+
export {
|
|
396
|
+
orientation_2 as orientation
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export declare interface ToolbarSeparatorProps extends Separator.Props {
|
|
401
|
+
/**
|
|
402
|
+
* The orientation of the separator. Defaults to the opposite of the toolbar's
|
|
403
|
+
* orientation, so a horizontal toolbar renders vertical separators.
|
|
404
|
+
*/
|
|
405
|
+
orientation?: Orientation | undefined;
|
|
406
|
+
}
|
|
292
407
|
|
|
293
408
|
export declare interface ToolbarSeparatorState extends SeparatorState {}
|
|
294
409
|
|