@xds/react 0.2.0 → 1.0.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.
Files changed (111) hide show
  1. package/dist/Accordion.js +3 -2
  2. package/dist/Button.js +5 -3
  3. package/dist/Card.js +1 -1
  4. package/dist/DatePicker.js +167 -170
  5. package/dist/DateRangePicker.js +91 -94
  6. package/dist/Menu.js +83 -75
  7. package/dist/SearchField.js +4 -2
  8. package/dist/Select.js +123 -98
  9. package/dist/Slider.d.ts +1 -1
  10. package/dist/Slider.js +44 -35
  11. package/dist/TextField.js +130 -107
  12. package/dist/Toast.d.ts +1 -1
  13. package/dist/Toast.js +50 -45
  14. package/dist/Tooltip.js +54 -40
  15. package/dist/base.d.ts +1 -1
  16. package/dist/base.js +1 -1
  17. package/dist/picture.js +2 -2
  18. package/dist/portal.d.ts +6 -4
  19. package/dist/portal.js +61 -9
  20. package/eject/files/Accordion.tsx +5 -2
  21. package/eject/files/Avatar.tsx +1 -1
  22. package/eject/files/AvatarStack.tsx +1 -1
  23. package/eject/files/Badge.tsx +1 -1
  24. package/eject/files/Banner.tsx +1 -1
  25. package/eject/files/Button.tsx +9 -5
  26. package/eject/files/Card.tsx +2 -2
  27. package/eject/files/Checkbox.tsx +1 -1
  28. package/eject/files/Chip.tsx +1 -1
  29. package/eject/files/ChipBar.tsx +1 -1
  30. package/eject/files/CountBadge.tsx +1 -1
  31. package/eject/files/DatePicker.tsx +32 -23
  32. package/eject/files/DateRangePicker.tsx +34 -23
  33. package/eject/files/Dialog.tsx +1 -1
  34. package/eject/files/Divider.tsx +1 -1
  35. package/eject/files/EmptyState.tsx +1 -1
  36. package/eject/files/Icon.tsx +1 -1
  37. package/eject/files/IconButton.tsx +1 -1
  38. package/eject/files/ListRow.tsx +1 -1
  39. package/eject/files/MediaCard.tsx +1 -1
  40. package/eject/files/Menu.tsx +7 -7
  41. package/eject/files/ProgressBar.tsx +1 -1
  42. package/eject/files/RadioGroup.tsx +1 -1
  43. package/eject/files/SearchField.tsx +6 -2
  44. package/eject/files/SectionHeader.tsx +1 -1
  45. package/eject/files/SegmentedControl.tsx +1 -1
  46. package/eject/files/Select.tsx +20 -22
  47. package/eject/files/Sidebar.tsx +1 -1
  48. package/eject/files/Skeleton.tsx +1 -1
  49. package/eject/files/Slider.tsx +11 -5
  50. package/eject/files/Spinner.tsx +1 -1
  51. package/eject/files/Switch.tsx +1 -1
  52. package/eject/files/Tabs.tsx +1 -1
  53. package/eject/files/Text.tsx +1 -1
  54. package/eject/files/TextField.tsx +18 -4
  55. package/eject/files/Thumbnail.tsx +1 -1
  56. package/eject/files/Toast.tsx +11 -15
  57. package/eject/files/Tooltip.tsx +9 -3
  58. package/eject/files/accordion.css +1 -1
  59. package/eject/files/accordion.ts +1 -1
  60. package/eject/files/avatar-stack.ts +1 -1
  61. package/eject/files/avatar.ts +1 -1
  62. package/eject/files/badge.ts +1 -1
  63. package/eject/files/banner.ts +1 -1
  64. package/eject/files/base.css +1 -1
  65. package/eject/files/button.css +3 -3
  66. package/eject/files/button.ts +1 -1
  67. package/eject/files/card.ts +1 -1
  68. package/eject/files/checkbox.ts +1 -1
  69. package/eject/files/chip-bar.ts +1 -1
  70. package/eject/files/chip.ts +1 -1
  71. package/eject/files/count-badge.ts +1 -1
  72. package/eject/files/date-picker.css +5 -5
  73. package/eject/files/date-picker.ts +30 -11
  74. package/eject/files/date-range-picker.ts +16 -8
  75. package/eject/files/dialog.css +6 -6
  76. package/eject/files/dialog.ts +1 -1
  77. package/eject/files/divider.ts +1 -1
  78. package/eject/files/empty-state.ts +1 -1
  79. package/eject/files/icon.ts +1 -1
  80. package/eject/files/list-row.ts +1 -1
  81. package/eject/files/media-card.ts +1 -1
  82. package/eject/files/menu.css +4 -4
  83. package/eject/files/menu.ts +1 -1
  84. package/eject/files/overlay.css +40 -0
  85. package/eject/files/parts.ts +1 -1
  86. package/eject/files/progress-bar.ts +1 -1
  87. package/eject/files/radio-group.css +1 -1
  88. package/eject/files/radio-group.ts +1 -1
  89. package/eject/files/section-header.ts +1 -1
  90. package/eject/files/segmented-control.ts +1 -1
  91. package/eject/files/select.css +17 -6
  92. package/eject/files/select.ts +1 -1
  93. package/eject/files/sidebar.ts +1 -1
  94. package/eject/files/skeleton.ts +1 -1
  95. package/eject/files/slider.css +1 -1
  96. package/eject/files/slider.ts +17 -5
  97. package/eject/files/spinner.ts +1 -1
  98. package/eject/files/switch.ts +1 -1
  99. package/eject/files/tabs.css +1 -1
  100. package/eject/files/tabs.ts +1 -1
  101. package/eject/files/text-field.css +4 -8
  102. package/eject/files/text-field.ts +1 -1
  103. package/eject/files/text.ts +1 -1
  104. package/eject/files/thumbnail.ts +1 -1
  105. package/eject/files/toast.ts +1 -1
  106. package/eject/files/tooltip.css +3 -3
  107. package/eject/files/tooltip.ts +1 -1
  108. package/eject/manifest.json +4 -2
  109. package/package.json +3 -3
  110. package/styles.css +15 -11
  111. 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(51);
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 t7 = grouped ? "xds-text-field__input" : "xds-text-field__input xds-text-field__control";
41
- const t8 = invalid || undefined;
42
- const t9 = invalid ? errorId : undefined;
43
- const t10 = invalid ? errorId : description ? descriptionId : undefined;
44
- let t11;
45
- if ($[0] !== autoComplete || $[1] !== autoFocus || $[2] !== disabled || $[3] !== id || $[4] !== inputMode || $[5] !== maxLength || $[6] !== name || $[7] !== placeholder || $[8] !== required || $[9] !== t10 || $[10] !== t7 || $[11] !== t8 || $[12] !== t9 || $[13] !== value) {
46
- t11 = {
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: t7,
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": t8,
59
- "aria-errormessage": t9,
60
- "aria-describedby": t10
79
+ "aria-invalid": t10,
80
+ "aria-errormessage": t11,
81
+ "aria-describedby": t12
61
82
  };
62
- $[0] = autoComplete;
63
- $[1] = autoFocus;
64
- $[2] = disabled;
65
- $[3] = id;
66
- $[4] = inputMode;
67
- $[5] = maxLength;
68
- $[6] = name;
69
- $[7] = placeholder;
70
- $[8] = required;
71
- $[9] = t10;
72
- $[10] = t7;
73
- $[11] = t8;
74
- $[12] = t9;
75
- $[13] = value;
76
- $[14] = t11;
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
- t11 = $[14];
99
+ t13 = $[19];
79
100
  }
80
- const shared = t11;
81
- let t12;
82
- if ($[15] !== multiline || $[16] !== onChange || $[17] !== rows || $[18] !== shared || $[19] !== type) {
83
- t12 = multiline ? /*#__PURE__*/_jsx("textarea", {
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
- $[15] = multiline;
93
- $[16] = onChange;
94
- $[17] = rows;
95
- $[18] = shared;
96
- $[19] = type;
97
- $[20] = t12;
115
+ $[20] = multiline;
116
+ $[21] = onChange;
117
+ $[22] = rows;
118
+ $[23] = shared;
119
+ $[24] = type;
120
+ $[25] = t14;
98
121
  } else {
99
- t12 = $[20];
122
+ t14 = $[25];
100
123
  }
101
- const field = t12;
102
- let t13;
103
- if ($[21] !== className) {
104
- t13 = classes("xds-text-field", className);
105
- $[21] = className;
106
- $[22] = t13;
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
- t13 = $[22];
131
+ t15 = $[27];
109
132
  }
110
- let t14;
111
- if ($[23] !== id || $[24] !== label) {
112
- t14 = /*#__PURE__*/_jsx("label", {
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
- $[23] = id;
118
- $[24] = label;
119
- $[25] = t14;
140
+ $[28] = id;
141
+ $[29] = label;
142
+ $[30] = t16;
120
143
  } else {
121
- t14 = $[25];
144
+ t16 = $[30];
122
145
  }
123
- let t15;
124
- if ($[26] !== field || $[27] !== grouped || $[28] !== leading || $[29] !== trailing) {
125
- t15 = grouped ? /*#__PURE__*/_jsxs("div", {
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
- $[26] = field;
136
- $[27] = grouped;
137
- $[28] = leading;
138
- $[29] = trailing;
139
- $[30] = t15;
158
+ $[31] = field;
159
+ $[32] = grouped;
160
+ $[33] = leading;
161
+ $[34] = trailing;
162
+ $[35] = t17;
140
163
  } else {
141
- t15 = $[30];
164
+ t17 = $[35];
142
165
  }
143
- let t16;
144
- if ($[31] !== description || $[32] !== descriptionId || $[33] !== invalid) {
145
- t16 = !invalid && description && /*#__PURE__*/_jsx("span", {
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
- $[31] = description;
151
- $[32] = descriptionId;
152
- $[33] = invalid;
153
- $[34] = t16;
173
+ $[36] = description;
174
+ $[37] = descriptionId;
175
+ $[38] = invalid;
176
+ $[39] = t18;
154
177
  } else {
155
- t16 = $[34];
178
+ t18 = $[39];
156
179
  }
157
- let t17;
158
- if ($[35] !== error || $[36] !== errorId) {
159
- t17 = /*#__PURE__*/_jsx("span", {
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
- $[35] = error;
166
- $[36] = errorId;
167
- $[37] = t17;
188
+ $[40] = error;
189
+ $[41] = errorId;
190
+ $[42] = t19;
168
191
  } else {
169
- t17 = $[37];
192
+ t19 = $[42];
170
193
  }
171
- let t18;
172
- if ($[38] !== maxLength || $[39] !== value) {
173
- t18 = maxLength !== undefined && /*#__PURE__*/_jsxs("span", {
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
- $[38] = maxLength;
178
- $[39] = value;
179
- $[40] = t18;
200
+ $[43] = maxLength;
201
+ $[44] = value;
202
+ $[45] = t20;
180
203
  } else {
181
- t18 = $[40];
204
+ t20 = $[45];
182
205
  }
183
- let t19;
184
- if ($[41] !== t16 || $[42] !== t17 || $[43] !== t18) {
185
- t19 = /*#__PURE__*/_jsxs("div", {
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: [t16, t17, t18]
210
+ children: [t18, t19, t20]
188
211
  });
189
- $[41] = t16;
190
- $[42] = t17;
191
- $[43] = t18;
192
- $[44] = t19;
212
+ $[46] = t18;
213
+ $[47] = t19;
214
+ $[48] = t20;
215
+ $[49] = t21;
193
216
  } else {
194
- t19 = $[44];
217
+ t21 = $[49];
195
218
  }
196
- let t20;
197
- if ($[45] !== style || $[46] !== t13 || $[47] !== t14 || $[48] !== t15 || $[49] !== t19) {
198
- t20 = /*#__PURE__*/_jsxs("div", {
199
- className: t13,
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: [t14, t15, t19]
224
+ children: [t16, t17, t21]
202
225
  });
203
- $[45] = style;
204
- $[46] = t13;
205
- $[47] = t14;
206
- $[48] = t15;
207
- $[49] = t19;
208
- $[50] = t20;
226
+ $[50] = style;
227
+ $[51] = t15;
228
+ $[52] = t16;
229
+ $[53] = t17;
230
+ $[54] = t21;
231
+ $[55] = t22;
209
232
  } else {
210
- t20 = $[50];
233
+ t22 = $[55];
211
234
  }
212
- return t20;
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, }: ToastProps): import("react").JSX.Element;
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(20);
7
+ const $ = _c(21);
8
8
  const {
9
9
  open,
10
10
  onClose,
11
11
  message,
12
12
  action,
13
- duration: t1,
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
- t2 = () => {
25
+ t1 = () => {
27
26
  const element = region.current;
28
27
  if (!element?.showPopover) {
29
28
  return;
30
29
  }
31
30
  element.showPopover();
32
- return () => element.hidePopover();
31
+ return () => {
32
+ if (element.isConnected && element.matches(":popover-open")) {
33
+ element.hidePopover();
34
+ }
35
+ };
33
36
  };
34
- t3 = [];
35
- $[0] = t2;
36
- $[1] = t3;
37
+ t2 = [];
38
+ $[0] = t1;
39
+ $[1] = t2;
37
40
  } else {
38
- t2 = $[0];
39
- t3 = $[1];
41
+ t1 = $[0];
42
+ t2 = $[1];
40
43
  }
41
- useEffect(t2, t3);
42
- let t4;
44
+ useEffect(t1, t2);
45
+ let t3;
43
46
  if ($[2] !== close || $[3] !== duration || $[4] !== held || $[5] !== open) {
44
- t4 = () => {
47
+ t3 = () => {
45
48
  if (!open) {
46
49
  setHovered(false);
47
50
  setFocused(false);
48
51
  }
49
- if (!open || held || duration <= 0) {
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(), duration);
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] = t4;
63
+ $[6] = t3;
60
64
  } else {
61
- t4 = $[6];
65
+ t3 = $[6];
62
66
  }
63
- let t5;
64
- if ($[7] !== duration || $[8] !== held || $[9] !== open) {
65
- t5 = [open, held, duration];
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] = open;
69
- $[10] = t5;
72
+ $[9] = message;
73
+ $[10] = open;
74
+ $[11] = t4;
70
75
  } else {
71
- t5 = $[10];
76
+ t4 = $[11];
72
77
  }
73
- useEffect(t4, t5);
74
- let t6;
75
- if ($[11] !== action || $[12] !== className || $[13] !== message || $[14] !== onClose || $[15] !== open || $[16] !== style) {
76
- t6 = open && /*#__PURE__*/_jsxs("div", {
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
- $[11] = action;
97
- $[12] = className;
98
- $[13] = message;
99
- $[14] = onClose;
100
- $[15] = open;
101
- $[16] = style;
102
- $[17] = t6;
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
- t6 = $[17];
109
+ t5 = $[18];
105
110
  }
106
- let t7;
107
- if ($[18] !== t6) {
108
- t7 = /*#__PURE__*/_jsx("div", {
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: t6
118
+ children: t5
114
119
  });
115
- $[18] = t6;
116
- $[19] = t7;
120
+ $[19] = t5;
121
+ $[20] = t6;
117
122
  } else {
118
- t7 = $[19];
123
+ t6 = $[20];
119
124
  }
120
- return t7;
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(12);
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] !== placement) {
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: space[1]
101
+ gutter: t3
88
102
  };
89
- $[0] = placement;
90
- $[1] = t2;
103
+ $[2] = placement;
104
+ $[3] = t4;
91
105
  } else {
92
- t2 = $[1];
106
+ t4 = $[3];
93
107
  }
94
- let t3;
95
- if ($[2] !== t1 || $[3] !== t2) {
96
- t3 = {
108
+ let t5;
109
+ if ($[4] !== t1 || $[5] !== t4) {
110
+ t5 = {
97
111
  id: t1,
98
- openDelay: motion.duration.tooltipDelay,
112
+ openDelay: t2,
99
113
  closeDelay: 0,
100
114
  closeOnScroll: false,
101
- positioning: t2
115
+ positioning: t4
102
116
  };
103
- $[2] = t1;
104
- $[3] = t2;
105
- $[4] = t3;
117
+ $[4] = t1;
118
+ $[5] = t4;
119
+ $[6] = t5;
106
120
  } else {
107
- t3 = $[4];
121
+ t5 = $[6];
108
122
  }
109
- const service = useMachine(tooltip.machine, t3);
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 t4;
114
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
115
- t4 = () => [content.current];
116
- $[5] = t4;
127
+ let t6;
128
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
129
+ t6 = () => [content.current];
130
+ $[7] = t6;
117
131
  } else {
118
- t4 = $[5];
132
+ t6 = $[7];
119
133
  }
120
- const present = usePresence(api.open, t4);
121
- let t5;
122
- if ($[6] !== children || $[7] !== trigger) {
123
- t5 = /*#__PURE__*/_jsx(TriggerContext, {
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
- $[6] = children;
128
- $[7] = trigger;
129
- $[8] = t5;
141
+ $[8] = children;
142
+ $[9] = trigger;
143
+ $[10] = t7;
130
144
  } else {
131
- t5 = $[8];
145
+ t7 = $[10];
132
146
  }
133
- const t6 = present && /*#__PURE__*/_jsx(Portal, {
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 t7;
155
- if ($[9] !== t5 || $[10] !== t6) {
156
- t7 = /*#__PURE__*/_jsxs(_Fragment, {
157
- children: [t5, t6]
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
- t7 = $[11];
177
+ t9 = $[13];
164
178
  }
165
- return t7;
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 && image.naturalWidth > 0 && loaded === undefined) {
10
+ if (src && image?.complete && loaded === undefined) {
11
11
  setPicture({
12
12
  src,
13
- loaded: true
13
+ loaded: image.naturalWidth > 0
14
14
  });
15
15
  }
16
16
  };