@xds/react 1.0.0-rc.1 → 1.0.1
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/Accordion.js +3 -2
- package/dist/Button.js +5 -3
- package/dist/Card.js +1 -1
- package/dist/DatePicker.js +167 -170
- package/dist/DateRangePicker.js +91 -94
- package/dist/Menu.js +83 -75
- package/dist/SearchField.js +4 -2
- package/dist/Select.js +123 -98
- package/dist/Slider.d.ts +1 -1
- package/dist/Slider.js +44 -35
- package/dist/TextField.js +130 -107
- package/dist/Toast.d.ts +1 -1
- package/dist/Toast.js +50 -45
- package/dist/Tooltip.js +54 -40
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -1
- package/dist/picture.js +2 -2
- package/dist/portal.d.ts +6 -4
- package/dist/portal.js +61 -9
- package/eject/files/Accordion.tsx +5 -2
- package/eject/files/Avatar.tsx +1 -1
- package/eject/files/AvatarStack.tsx +1 -1
- package/eject/files/Badge.tsx +1 -1
- package/eject/files/Banner.tsx +1 -1
- package/eject/files/Button.tsx +9 -5
- package/eject/files/Card.tsx +2 -2
- package/eject/files/Checkbox.tsx +1 -1
- package/eject/files/Chip.tsx +1 -1
- package/eject/files/ChipBar.tsx +1 -1
- package/eject/files/CountBadge.tsx +1 -1
- package/eject/files/DatePicker.tsx +32 -23
- package/eject/files/DateRangePicker.tsx +34 -23
- package/eject/files/Dialog.tsx +1 -1
- package/eject/files/Divider.tsx +1 -1
- package/eject/files/EmptyState.tsx +1 -1
- package/eject/files/Icon.tsx +1 -1
- package/eject/files/IconButton.tsx +1 -1
- package/eject/files/ListRow.tsx +1 -1
- package/eject/files/MediaCard.tsx +1 -1
- package/eject/files/Menu.tsx +7 -7
- package/eject/files/ProgressBar.tsx +1 -1
- package/eject/files/RadioGroup.tsx +1 -1
- package/eject/files/SearchField.tsx +6 -2
- package/eject/files/SectionHeader.tsx +1 -1
- package/eject/files/SegmentedControl.tsx +1 -1
- package/eject/files/Select.tsx +20 -22
- package/eject/files/Sidebar.tsx +1 -1
- package/eject/files/Skeleton.tsx +1 -1
- package/eject/files/Slider.tsx +11 -5
- package/eject/files/Spinner.tsx +1 -1
- package/eject/files/Switch.tsx +1 -1
- package/eject/files/Tabs.tsx +1 -1
- package/eject/files/Text.tsx +1 -1
- package/eject/files/TextField.tsx +18 -4
- package/eject/files/Thumbnail.tsx +1 -1
- package/eject/files/Toast.tsx +11 -15
- package/eject/files/Tooltip.tsx +9 -3
- package/eject/files/accordion.css +1 -1
- package/eject/files/accordion.ts +1 -1
- package/eject/files/avatar-stack.ts +1 -1
- package/eject/files/avatar.ts +1 -1
- package/eject/files/badge.ts +1 -1
- package/eject/files/banner.ts +1 -1
- package/eject/files/base.css +1 -1
- package/eject/files/button.css +3 -3
- package/eject/files/button.ts +1 -1
- package/eject/files/card.ts +1 -1
- package/eject/files/checkbox.ts +1 -1
- package/eject/files/chip-bar.ts +1 -1
- package/eject/files/chip.ts +1 -1
- package/eject/files/count-badge.ts +1 -1
- package/eject/files/date-picker.css +5 -5
- package/eject/files/date-picker.ts +30 -11
- package/eject/files/date-range-picker.ts +16 -8
- package/eject/files/dialog.css +6 -6
- package/eject/files/dialog.ts +1 -1
- package/eject/files/divider.ts +1 -1
- package/eject/files/empty-state.ts +1 -1
- package/eject/files/icon.ts +1 -1
- package/eject/files/list-row.ts +1 -1
- package/eject/files/media-card.ts +1 -1
- package/eject/files/menu.css +4 -4
- package/eject/files/menu.ts +1 -1
- package/eject/files/overlay.css +40 -0
- package/eject/files/parts.ts +1 -1
- package/eject/files/progress-bar.ts +1 -1
- package/eject/files/radio-group.css +1 -1
- package/eject/files/radio-group.ts +1 -1
- package/eject/files/section-header.ts +1 -1
- package/eject/files/segmented-control.ts +1 -1
- package/eject/files/select.css +17 -6
- package/eject/files/select.ts +1 -1
- package/eject/files/sidebar.ts +1 -1
- package/eject/files/skeleton.ts +1 -1
- package/eject/files/slider.css +1 -1
- package/eject/files/slider.ts +17 -5
- package/eject/files/spinner.ts +1 -1
- package/eject/files/switch.ts +1 -1
- package/eject/files/tabs.css +1 -1
- package/eject/files/tabs.ts +1 -1
- package/eject/files/text-field.css +4 -8
- package/eject/files/text-field.ts +1 -1
- package/eject/files/text.ts +1 -1
- package/eject/files/thumbnail.ts +1 -1
- package/eject/files/toast.ts +1 -1
- package/eject/files/tooltip.css +3 -3
- package/eject/files/tooltip.ts +1 -1
- package/eject/manifest.json +4 -2
- package/package.json +3 -3
- package/styles.css +15 -11
- package/tailwind.css +21 -14
package/dist/TextField.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { classes } from "@xds/core";
|
|
3
|
-
import { useId } from "react";
|
|
3
|
+
import { useEffect, useId, useRef } from "react";
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
export function TextField(t0) {
|
|
6
|
-
const $ = _c(
|
|
6
|
+
const $ = _c(56);
|
|
7
7
|
const {
|
|
8
8
|
label,
|
|
9
9
|
value,
|
|
@@ -33,19 +33,40 @@ export function TextField(t0) {
|
|
|
33
33
|
const required = t5 === undefined ? false : t5;
|
|
34
34
|
const disabled = t6 === undefined ? false : t6;
|
|
35
35
|
const id = useId();
|
|
36
|
+
const inputRef = useRef(null);
|
|
36
37
|
const descriptionId = `${id}-description`;
|
|
37
38
|
const errorId = `${id}-error`;
|
|
38
39
|
const invalid = error !== undefined;
|
|
40
|
+
let t7;
|
|
41
|
+
if ($[0] !== error) {
|
|
42
|
+
t7 = () => {
|
|
43
|
+
inputRef.current?.setCustomValidity(error ?? "");
|
|
44
|
+
};
|
|
45
|
+
$[0] = error;
|
|
46
|
+
$[1] = t7;
|
|
47
|
+
} else {
|
|
48
|
+
t7 = $[1];
|
|
49
|
+
}
|
|
50
|
+
let t8;
|
|
51
|
+
if ($[2] !== error || $[3] !== multiline) {
|
|
52
|
+
t8 = [error, multiline];
|
|
53
|
+
$[2] = error;
|
|
54
|
+
$[3] = multiline;
|
|
55
|
+
$[4] = t8;
|
|
56
|
+
} else {
|
|
57
|
+
t8 = $[4];
|
|
58
|
+
}
|
|
59
|
+
useEffect(t7, t8);
|
|
39
60
|
const grouped = leading != null || trailing != null;
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
let
|
|
45
|
-
if ($[
|
|
46
|
-
|
|
61
|
+
const t9 = grouped ? "xds-text-field__input" : "xds-text-field__input xds-text-field__control";
|
|
62
|
+
const t10 = invalid || undefined;
|
|
63
|
+
const t11 = invalid ? errorId : undefined;
|
|
64
|
+
const t12 = invalid ? errorId : description ? descriptionId : undefined;
|
|
65
|
+
let t13;
|
|
66
|
+
if ($[5] !== autoComplete || $[6] !== autoFocus || $[7] !== disabled || $[8] !== id || $[9] !== inputMode || $[10] !== maxLength || $[11] !== name || $[12] !== placeholder || $[13] !== required || $[14] !== t10 || $[15] !== t11 || $[16] !== t12 || $[17] !== t9 || $[18] !== value) {
|
|
67
|
+
t13 = {
|
|
47
68
|
id,
|
|
48
|
-
className:
|
|
69
|
+
className: t9,
|
|
49
70
|
value,
|
|
50
71
|
placeholder,
|
|
51
72
|
name,
|
|
@@ -55,74 +76,76 @@ export function TextField(t0) {
|
|
|
55
76
|
autoFocus,
|
|
56
77
|
required,
|
|
57
78
|
disabled,
|
|
58
|
-
"aria-invalid":
|
|
59
|
-
"aria-errormessage":
|
|
60
|
-
"aria-describedby":
|
|
79
|
+
"aria-invalid": t10,
|
|
80
|
+
"aria-errormessage": t11,
|
|
81
|
+
"aria-describedby": t12
|
|
61
82
|
};
|
|
62
|
-
$[
|
|
63
|
-
$[
|
|
64
|
-
$[
|
|
65
|
-
$[
|
|
66
|
-
$[
|
|
67
|
-
$[
|
|
68
|
-
$[
|
|
69
|
-
$[
|
|
70
|
-
$[
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
76
|
-
$[
|
|
83
|
+
$[5] = autoComplete;
|
|
84
|
+
$[6] = autoFocus;
|
|
85
|
+
$[7] = disabled;
|
|
86
|
+
$[8] = id;
|
|
87
|
+
$[9] = inputMode;
|
|
88
|
+
$[10] = maxLength;
|
|
89
|
+
$[11] = name;
|
|
90
|
+
$[12] = placeholder;
|
|
91
|
+
$[13] = required;
|
|
92
|
+
$[14] = t10;
|
|
93
|
+
$[15] = t11;
|
|
94
|
+
$[16] = t12;
|
|
95
|
+
$[17] = t9;
|
|
96
|
+
$[18] = value;
|
|
97
|
+
$[19] = t13;
|
|
77
98
|
} else {
|
|
78
|
-
|
|
99
|
+
t13 = $[19];
|
|
79
100
|
}
|
|
80
|
-
const shared =
|
|
81
|
-
let
|
|
82
|
-
if ($[
|
|
83
|
-
|
|
101
|
+
const shared = t13;
|
|
102
|
+
let t14;
|
|
103
|
+
if ($[20] !== multiline || $[21] !== onChange || $[22] !== rows || $[23] !== shared || $[24] !== type) {
|
|
104
|
+
t14 = multiline ? /*#__PURE__*/_jsx("textarea", {
|
|
84
105
|
...shared,
|
|
106
|
+
ref: inputRef,
|
|
85
107
|
rows: rows,
|
|
86
108
|
onChange: event => onChange(event.currentTarget.value)
|
|
87
109
|
}) : /*#__PURE__*/_jsx("input", {
|
|
88
110
|
...shared,
|
|
111
|
+
ref: inputRef,
|
|
89
112
|
type: type,
|
|
90
113
|
onChange: event_0 => onChange(event_0.currentTarget.value)
|
|
91
114
|
});
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
115
|
+
$[20] = multiline;
|
|
116
|
+
$[21] = onChange;
|
|
117
|
+
$[22] = rows;
|
|
118
|
+
$[23] = shared;
|
|
119
|
+
$[24] = type;
|
|
120
|
+
$[25] = t14;
|
|
98
121
|
} else {
|
|
99
|
-
|
|
122
|
+
t14 = $[25];
|
|
100
123
|
}
|
|
101
|
-
const field =
|
|
102
|
-
let
|
|
103
|
-
if ($[
|
|
104
|
-
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
124
|
+
const field = t14;
|
|
125
|
+
let t15;
|
|
126
|
+
if ($[26] !== className) {
|
|
127
|
+
t15 = classes("xds-text-field", className);
|
|
128
|
+
$[26] = className;
|
|
129
|
+
$[27] = t15;
|
|
107
130
|
} else {
|
|
108
|
-
|
|
131
|
+
t15 = $[27];
|
|
109
132
|
}
|
|
110
|
-
let
|
|
111
|
-
if ($[
|
|
112
|
-
|
|
133
|
+
let t16;
|
|
134
|
+
if ($[28] !== id || $[29] !== label) {
|
|
135
|
+
t16 = /*#__PURE__*/_jsx("label", {
|
|
113
136
|
htmlFor: id,
|
|
114
137
|
className: "xds-text-field__label",
|
|
115
138
|
children: label
|
|
116
139
|
});
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
140
|
+
$[28] = id;
|
|
141
|
+
$[29] = label;
|
|
142
|
+
$[30] = t16;
|
|
120
143
|
} else {
|
|
121
|
-
|
|
144
|
+
t16 = $[30];
|
|
122
145
|
}
|
|
123
|
-
let
|
|
124
|
-
if ($[
|
|
125
|
-
|
|
146
|
+
let t17;
|
|
147
|
+
if ($[31] !== field || $[32] !== grouped || $[33] !== leading || $[34] !== trailing) {
|
|
148
|
+
t17 = grouped ? /*#__PURE__*/_jsxs("div", {
|
|
126
149
|
className: "xds-text-field__control xds-text-field__group",
|
|
127
150
|
children: [leading != null && /*#__PURE__*/_jsx("span", {
|
|
128
151
|
className: "xds-text-field__slot xds-text-field__slot--leading",
|
|
@@ -132,82 +155,82 @@ export function TextField(t0) {
|
|
|
132
155
|
children: trailing
|
|
133
156
|
})]
|
|
134
157
|
}) : field;
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
158
|
+
$[31] = field;
|
|
159
|
+
$[32] = grouped;
|
|
160
|
+
$[33] = leading;
|
|
161
|
+
$[34] = trailing;
|
|
162
|
+
$[35] = t17;
|
|
140
163
|
} else {
|
|
141
|
-
|
|
164
|
+
t17 = $[35];
|
|
142
165
|
}
|
|
143
|
-
let
|
|
144
|
-
if ($[
|
|
145
|
-
|
|
166
|
+
let t18;
|
|
167
|
+
if ($[36] !== description || $[37] !== descriptionId || $[38] !== invalid) {
|
|
168
|
+
t18 = !invalid && description && /*#__PURE__*/_jsx("span", {
|
|
146
169
|
id: descriptionId,
|
|
147
170
|
className: "xds-text-field__description",
|
|
148
171
|
children: description
|
|
149
172
|
});
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
173
|
+
$[36] = description;
|
|
174
|
+
$[37] = descriptionId;
|
|
175
|
+
$[38] = invalid;
|
|
176
|
+
$[39] = t18;
|
|
154
177
|
} else {
|
|
155
|
-
|
|
178
|
+
t18 = $[39];
|
|
156
179
|
}
|
|
157
|
-
let
|
|
158
|
-
if ($[
|
|
159
|
-
|
|
180
|
+
let t19;
|
|
181
|
+
if ($[40] !== error || $[41] !== errorId) {
|
|
182
|
+
t19 = /*#__PURE__*/_jsx("span", {
|
|
160
183
|
id: errorId,
|
|
161
184
|
className: "xds-text-field__error",
|
|
162
185
|
"aria-live": "polite",
|
|
163
186
|
children: error
|
|
164
187
|
});
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
188
|
+
$[40] = error;
|
|
189
|
+
$[41] = errorId;
|
|
190
|
+
$[42] = t19;
|
|
168
191
|
} else {
|
|
169
|
-
|
|
192
|
+
t19 = $[42];
|
|
170
193
|
}
|
|
171
|
-
let
|
|
172
|
-
if ($[
|
|
173
|
-
|
|
194
|
+
let t20;
|
|
195
|
+
if ($[43] !== maxLength || $[44] !== value) {
|
|
196
|
+
t20 = maxLength !== undefined && /*#__PURE__*/_jsxs("span", {
|
|
174
197
|
className: "ms-auto shrink-0 text-xds-footnote text-xds-text-secondary tabular-nums",
|
|
175
198
|
children: [value.length, "/", maxLength]
|
|
176
199
|
});
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
200
|
+
$[43] = maxLength;
|
|
201
|
+
$[44] = value;
|
|
202
|
+
$[45] = t20;
|
|
180
203
|
} else {
|
|
181
|
-
|
|
204
|
+
t20 = $[45];
|
|
182
205
|
}
|
|
183
|
-
let
|
|
184
|
-
if ($[
|
|
185
|
-
|
|
206
|
+
let t21;
|
|
207
|
+
if ($[46] !== t18 || $[47] !== t19 || $[48] !== t20) {
|
|
208
|
+
t21 = /*#__PURE__*/_jsxs("div", {
|
|
186
209
|
className: "xds-text-field__footer",
|
|
187
|
-
children: [
|
|
210
|
+
children: [t18, t19, t20]
|
|
188
211
|
});
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
212
|
+
$[46] = t18;
|
|
213
|
+
$[47] = t19;
|
|
214
|
+
$[48] = t20;
|
|
215
|
+
$[49] = t21;
|
|
193
216
|
} else {
|
|
194
|
-
|
|
217
|
+
t21 = $[49];
|
|
195
218
|
}
|
|
196
|
-
let
|
|
197
|
-
if ($[
|
|
198
|
-
|
|
199
|
-
className:
|
|
219
|
+
let t22;
|
|
220
|
+
if ($[50] !== style || $[51] !== t15 || $[52] !== t16 || $[53] !== t17 || $[54] !== t21) {
|
|
221
|
+
t22 = /*#__PURE__*/_jsxs("div", {
|
|
222
|
+
className: t15,
|
|
200
223
|
style: style,
|
|
201
|
-
children: [
|
|
224
|
+
children: [t16, t17, t21]
|
|
202
225
|
});
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
226
|
+
$[50] = style;
|
|
227
|
+
$[51] = t15;
|
|
228
|
+
$[52] = t16;
|
|
229
|
+
$[53] = t17;
|
|
230
|
+
$[54] = t21;
|
|
231
|
+
$[55] = t22;
|
|
209
232
|
} else {
|
|
210
|
-
|
|
233
|
+
t22 = $[55];
|
|
211
234
|
}
|
|
212
|
-
return
|
|
235
|
+
return t22;
|
|
213
236
|
}
|
package/dist/Toast.d.ts
CHANGED
|
@@ -11,4 +11,4 @@ export type ToastProps = ToastBaseProps & RootProps & {
|
|
|
11
11
|
*
|
|
12
12
|
* Do not put the only way to do something in a toast: it is gone in a few seconds.
|
|
13
13
|
*/
|
|
14
|
-
export declare function Toast({ open, onClose, message, action, duration, className, style
|
|
14
|
+
export declare function Toast({ open, onClose, message, action, duration, className, style }: ToastProps): import("react").JSX.Element;
|
package/dist/Toast.js
CHANGED
|
@@ -1,79 +1,84 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { motion } from "@xds/tokens";
|
|
3
|
-
import { classes, rootPart, TOAST_PARTS } from "@xds/core";
|
|
3
|
+
import { classes, readCssMs, rootPart, TOAST_PARTS } from "@xds/core";
|
|
4
4
|
import { useEffect, useEffectEvent, useRef, useState } from "react";
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
6
|
export function Toast(t0) {
|
|
7
|
-
const $ = _c(
|
|
7
|
+
const $ = _c(21);
|
|
8
8
|
const {
|
|
9
9
|
open,
|
|
10
10
|
onClose,
|
|
11
11
|
message,
|
|
12
12
|
action,
|
|
13
|
-
duration
|
|
13
|
+
duration,
|
|
14
14
|
className,
|
|
15
15
|
style
|
|
16
16
|
} = t0;
|
|
17
|
-
const duration = t1 === undefined ? motion.duration.toast : t1;
|
|
18
17
|
const region = useRef(null);
|
|
19
18
|
const [hovered, setHovered] = useState(false);
|
|
20
19
|
const [focused, setFocused] = useState(false);
|
|
21
20
|
const held = hovered || focused;
|
|
22
21
|
const close = useEffectEvent(onClose);
|
|
22
|
+
let t1;
|
|
23
23
|
let t2;
|
|
24
|
-
let t3;
|
|
25
24
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
26
|
-
|
|
25
|
+
t1 = () => {
|
|
27
26
|
const element = region.current;
|
|
28
27
|
if (!element?.showPopover) {
|
|
29
28
|
return;
|
|
30
29
|
}
|
|
31
30
|
element.showPopover();
|
|
32
|
-
return () =>
|
|
31
|
+
return () => {
|
|
32
|
+
if (element.isConnected && element.matches(":popover-open")) {
|
|
33
|
+
element.hidePopover();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
33
36
|
};
|
|
34
|
-
|
|
35
|
-
$[0] =
|
|
36
|
-
$[1] =
|
|
37
|
+
t2 = [];
|
|
38
|
+
$[0] = t1;
|
|
39
|
+
$[1] = t2;
|
|
37
40
|
} else {
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
t1 = $[0];
|
|
42
|
+
t2 = $[1];
|
|
40
43
|
}
|
|
41
|
-
useEffect(
|
|
42
|
-
let
|
|
44
|
+
useEffect(t1, t2);
|
|
45
|
+
let t3;
|
|
43
46
|
if ($[2] !== close || $[3] !== duration || $[4] !== held || $[5] !== open) {
|
|
44
|
-
|
|
47
|
+
t3 = () => {
|
|
45
48
|
if (!open) {
|
|
46
49
|
setHovered(false);
|
|
47
50
|
setFocused(false);
|
|
48
51
|
}
|
|
49
|
-
|
|
52
|
+
const ms = duration ?? readCssMs(region.current, "--xds-motion-duration-toast", motion.duration.toast);
|
|
53
|
+
if (!open || held || ms <= 0) {
|
|
50
54
|
return;
|
|
51
55
|
}
|
|
52
|
-
const timer = setTimeout(() => close(),
|
|
56
|
+
const timer = setTimeout(() => close(), ms);
|
|
53
57
|
return () => clearTimeout(timer);
|
|
54
58
|
};
|
|
55
59
|
$[2] = close;
|
|
56
60
|
$[3] = duration;
|
|
57
61
|
$[4] = held;
|
|
58
62
|
$[5] = open;
|
|
59
|
-
$[6] =
|
|
63
|
+
$[6] = t3;
|
|
60
64
|
} else {
|
|
61
|
-
|
|
65
|
+
t3 = $[6];
|
|
62
66
|
}
|
|
63
|
-
let
|
|
64
|
-
if ($[7] !== duration || $[8] !== held || $[9] !== open) {
|
|
65
|
-
|
|
67
|
+
let t4;
|
|
68
|
+
if ($[7] !== duration || $[8] !== held || $[9] !== message || $[10] !== open) {
|
|
69
|
+
t4 = [open, held, duration, message];
|
|
66
70
|
$[7] = duration;
|
|
67
71
|
$[8] = held;
|
|
68
|
-
$[9] =
|
|
69
|
-
$[10] =
|
|
72
|
+
$[9] = message;
|
|
73
|
+
$[10] = open;
|
|
74
|
+
$[11] = t4;
|
|
70
75
|
} else {
|
|
71
|
-
|
|
76
|
+
t4 = $[11];
|
|
72
77
|
}
|
|
73
|
-
useEffect(
|
|
74
|
-
let
|
|
75
|
-
if ($[
|
|
76
|
-
|
|
78
|
+
useEffect(t3, t4);
|
|
79
|
+
let t5;
|
|
80
|
+
if ($[12] !== action || $[13] !== className || $[14] !== message || $[15] !== onClose || $[16] !== open || $[17] !== style) {
|
|
81
|
+
t5 = open && /*#__PURE__*/_jsxs("div", {
|
|
77
82
|
onPointerEnter: () => setHovered(true),
|
|
78
83
|
onPointerLeave: () => setHovered(false),
|
|
79
84
|
onFocus: () => setFocused(true),
|
|
@@ -93,29 +98,29 @@ export function Toast(t0) {
|
|
|
93
98
|
children: action.label
|
|
94
99
|
})]
|
|
95
100
|
});
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
$[
|
|
102
|
-
$[
|
|
101
|
+
$[12] = action;
|
|
102
|
+
$[13] = className;
|
|
103
|
+
$[14] = message;
|
|
104
|
+
$[15] = onClose;
|
|
105
|
+
$[16] = open;
|
|
106
|
+
$[17] = style;
|
|
107
|
+
$[18] = t5;
|
|
103
108
|
} else {
|
|
104
|
-
|
|
109
|
+
t5 = $[18];
|
|
105
110
|
}
|
|
106
|
-
let
|
|
107
|
-
if ($[
|
|
108
|
-
|
|
111
|
+
let t6;
|
|
112
|
+
if ($[19] !== t5) {
|
|
113
|
+
t6 = /*#__PURE__*/_jsx("div", {
|
|
109
114
|
ref: region,
|
|
110
115
|
role: "status",
|
|
111
116
|
popover: "manual",
|
|
112
117
|
className: TOAST_PARTS.region,
|
|
113
|
-
children:
|
|
118
|
+
children: t5
|
|
114
119
|
});
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
120
|
+
$[19] = t5;
|
|
121
|
+
$[20] = t6;
|
|
117
122
|
} else {
|
|
118
|
-
|
|
123
|
+
t6 = $[20];
|
|
119
124
|
}
|
|
120
|
-
return
|
|
125
|
+
return t6;
|
|
121
126
|
}
|
package/dist/Tooltip.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { motion, space } from "@xds/tokens";
|
|
3
|
-
import { classes, tooltipEndSide } from "@xds/core";
|
|
3
|
+
import { classes, readCssMs, readCssPx, tooltipEndSide } from "@xds/core";
|
|
4
4
|
import { mergeProps, normalizeProps, useMachine } from "@zag-js/react";
|
|
5
5
|
import * as tooltip from "@zag-js/tooltip";
|
|
6
6
|
import { useId, useRef } from "react";
|
|
@@ -70,7 +70,7 @@ export function TooltipBeside(t0) {
|
|
|
70
70
|
return t2;
|
|
71
71
|
}
|
|
72
72
|
function Overlay(t0) {
|
|
73
|
-
const $ = _c(
|
|
73
|
+
const $ = _c(14);
|
|
74
74
|
const {
|
|
75
75
|
label,
|
|
76
76
|
shortcut,
|
|
@@ -81,56 +81,70 @@ function Overlay(t0) {
|
|
|
81
81
|
} = t0;
|
|
82
82
|
const t1 = useId();
|
|
83
83
|
let t2;
|
|
84
|
-
if ($[0]
|
|
85
|
-
t2 =
|
|
84
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
85
|
+
t2 = readCssMs(null, "--xds-motion-duration-tooltip-delay", motion.duration.tooltipDelay);
|
|
86
|
+
$[0] = t2;
|
|
87
|
+
} else {
|
|
88
|
+
t2 = $[0];
|
|
89
|
+
}
|
|
90
|
+
let t3;
|
|
91
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
92
|
+
t3 = readCssPx(null, "--xds-space-1", space[1]);
|
|
93
|
+
$[1] = t3;
|
|
94
|
+
} else {
|
|
95
|
+
t3 = $[1];
|
|
96
|
+
}
|
|
97
|
+
let t4;
|
|
98
|
+
if ($[2] !== placement) {
|
|
99
|
+
t4 = {
|
|
86
100
|
placement,
|
|
87
|
-
gutter:
|
|
101
|
+
gutter: t3
|
|
88
102
|
};
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
103
|
+
$[2] = placement;
|
|
104
|
+
$[3] = t4;
|
|
91
105
|
} else {
|
|
92
|
-
|
|
106
|
+
t4 = $[3];
|
|
93
107
|
}
|
|
94
|
-
let
|
|
95
|
-
if ($[
|
|
96
|
-
|
|
108
|
+
let t5;
|
|
109
|
+
if ($[4] !== t1 || $[5] !== t4) {
|
|
110
|
+
t5 = {
|
|
97
111
|
id: t1,
|
|
98
|
-
openDelay:
|
|
112
|
+
openDelay: t2,
|
|
99
113
|
closeDelay: 0,
|
|
100
114
|
closeOnScroll: false,
|
|
101
|
-
positioning:
|
|
115
|
+
positioning: t4
|
|
102
116
|
};
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
105
|
-
$[
|
|
117
|
+
$[4] = t1;
|
|
118
|
+
$[5] = t4;
|
|
119
|
+
$[6] = t5;
|
|
106
120
|
} else {
|
|
107
|
-
|
|
121
|
+
t5 = $[6];
|
|
108
122
|
}
|
|
109
|
-
const service = useMachine(tooltip.machine,
|
|
123
|
+
const service = useMachine(tooltip.machine, t5);
|
|
110
124
|
const api = tooltip.connect(service, normalizeProps);
|
|
111
125
|
const trigger = useProvideTrigger(api.getTriggerProps());
|
|
112
126
|
const content = useRef(null);
|
|
113
|
-
let
|
|
114
|
-
if ($[
|
|
115
|
-
|
|
116
|
-
$[
|
|
127
|
+
let t6;
|
|
128
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
129
|
+
t6 = () => [content.current];
|
|
130
|
+
$[7] = t6;
|
|
117
131
|
} else {
|
|
118
|
-
|
|
132
|
+
t6 = $[7];
|
|
119
133
|
}
|
|
120
|
-
const present = usePresence(api.open,
|
|
121
|
-
let
|
|
122
|
-
if ($[
|
|
123
|
-
|
|
134
|
+
const present = usePresence(api.open, t6);
|
|
135
|
+
let t7;
|
|
136
|
+
if ($[8] !== children || $[9] !== trigger) {
|
|
137
|
+
t7 = /*#__PURE__*/_jsx(TriggerContext, {
|
|
124
138
|
value: trigger,
|
|
125
139
|
children: children
|
|
126
140
|
});
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
141
|
+
$[8] = children;
|
|
142
|
+
$[9] = trigger;
|
|
143
|
+
$[10] = t7;
|
|
130
144
|
} else {
|
|
131
|
-
|
|
145
|
+
t7 = $[10];
|
|
132
146
|
}
|
|
133
|
-
const
|
|
147
|
+
const t8 = present && /*#__PURE__*/_jsx(Portal, {
|
|
134
148
|
children: /*#__PURE__*/_jsx(TriggerContext, {
|
|
135
149
|
value: null,
|
|
136
150
|
children: /*#__PURE__*/_jsx("div", {
|
|
@@ -151,16 +165,16 @@ function Overlay(t0) {
|
|
|
151
165
|
})
|
|
152
166
|
})
|
|
153
167
|
});
|
|
154
|
-
let
|
|
155
|
-
if ($[
|
|
156
|
-
|
|
157
|
-
children: [
|
|
168
|
+
let t9;
|
|
169
|
+
if ($[11] !== t7 || $[12] !== t8) {
|
|
170
|
+
t9 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
171
|
+
children: [t7, t8]
|
|
158
172
|
});
|
|
159
|
-
$[9] = t5;
|
|
160
|
-
$[10] = t6;
|
|
161
173
|
$[11] = t7;
|
|
174
|
+
$[12] = t8;
|
|
175
|
+
$[13] = t9;
|
|
162
176
|
} else {
|
|
163
|
-
|
|
177
|
+
t9 = $[13];
|
|
164
178
|
}
|
|
165
|
-
return
|
|
179
|
+
return t9;
|
|
166
180
|
}
|
package/dist/base.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { type IconName, icons, motion, space } from "@xds/tokens";
|
|
2
|
-
export { AVATAR_SIZE, type AvatarSize, afterAnimations, buttonClass, focusWithoutRing, type IconSize, initials, keepListKeys, leaveEscapeToFields, PEER_FOCUS, PRESSABLE_ROW, pictureClass, switchClass, switchLabelClass, type ThumbnailRatio, } from "@xds/core";
|
|
2
|
+
export { AVATAR_SIZE, type AvatarSize, afterAnimations, buttonClass, focusWithoutRing, type IconSize, initials, keepListKeys, leaveEscapeToFields, PEER_FOCUS, PRESSABLE_ROW, pictureClass, readCssMs, readCssPx, switchClass, switchLabelClass, type ThumbnailRatio, underlayLayerStyle, } from "@xds/core";
|
|
3
3
|
export { useDefaults } from "./Defaults.tsx";
|
|
4
4
|
export { PlaceRow } from "./ListRow.tsx";
|
|
5
5
|
export { useModalPopover } from "./modal-popover.ts";
|
package/dist/base.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { icons, motion, space } from "@xds/tokens";
|
|
2
|
-
export { AVATAR_SIZE, afterAnimations, buttonClass, focusWithoutRing, initials, keepListKeys, leaveEscapeToFields, PEER_FOCUS, PRESSABLE_ROW, pictureClass, switchClass, switchLabelClass } from "@xds/core";
|
|
2
|
+
export { AVATAR_SIZE, afterAnimations, buttonClass, focusWithoutRing, initials, keepListKeys, leaveEscapeToFields, PEER_FOCUS, PRESSABLE_ROW, pictureClass, readCssMs, readCssPx, switchClass, switchLabelClass, underlayLayerStyle } from "@xds/core";
|
|
3
3
|
export { useDefaults } from "./Defaults.js";
|
|
4
4
|
export { PlaceRow } from "./ListRow.js";
|
|
5
5
|
export { useModalPopover } from "./modal-popover.js";
|
package/dist/picture.js
CHANGED
|
@@ -7,10 +7,10 @@ export function usePicture(src) {
|
|
|
7
7
|
let t0;
|
|
8
8
|
if ($[0] !== loaded || $[1] !== src) {
|
|
9
9
|
t0 = image => {
|
|
10
|
-
if (src && image?.complete &&
|
|
10
|
+
if (src && image?.complete && loaded === undefined) {
|
|
11
11
|
setPicture({
|
|
12
12
|
src,
|
|
13
|
-
loaded:
|
|
13
|
+
loaded: image.naturalWidth > 0
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
};
|