@xds/react 1.0.0-rc.1 → 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.
- 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/DateRangePicker.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { space } from "@xds/tokens";
|
|
3
|
+
import { classes, DATE_PICKER_NAV_CLASS, dateRangeMachineProps, datePickerContentAttrs, datePickerIds, datePickerLocale, datePickerTriggerAttrs, endRangeChoiceOnClose, focusOpeningDay, formatRange, keepCalendarFocus, keepDayFocused, keepRangePreview, rangeDayClick, rangeGridKeyDown, rangeMonths, rangeMonthViews, rangeSummary, readCssPx, shownRange, underlayLayerStyle } from "@xds/core";
|
|
3
4
|
import * as datePicker from "@zag-js/date-picker";
|
|
4
5
|
import { mergeProps, normalizeProps, useMachine } from "@zag-js/react";
|
|
5
6
|
import { useEffect, useId, useRef, useState } from "react";
|
|
@@ -9,7 +10,7 @@ import { Portal } from "./portal.js";
|
|
|
9
10
|
import { usePresence } from "./presence.js";
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
export function DateRangePicker(t0) {
|
|
12
|
-
const $ = _c(
|
|
13
|
+
const $ = _c(37);
|
|
13
14
|
const {
|
|
14
15
|
onChange,
|
|
15
16
|
className,
|
|
@@ -27,7 +28,7 @@ export function DateRangePicker(t0) {
|
|
|
27
28
|
} = props;
|
|
28
29
|
const id = useId();
|
|
29
30
|
const ids = datePickerIds(id);
|
|
30
|
-
const locale = datePickerLocale();
|
|
31
|
+
const locale = datePickerLocale(props.locale);
|
|
31
32
|
const [draft, setDraft] = useState(null);
|
|
32
33
|
const [months, setMonths] = useState(1);
|
|
33
34
|
const shown = shownRange(value, draft);
|
|
@@ -36,7 +37,8 @@ export function DateRangePicker(t0) {
|
|
|
36
37
|
locale,
|
|
37
38
|
months,
|
|
38
39
|
onDraft: setDraft,
|
|
39
|
-
onChange
|
|
40
|
+
onChange,
|
|
41
|
+
gutter: readCssPx(null, "--xds-space-1", space[1])
|
|
40
42
|
}));
|
|
41
43
|
const api = datePicker.connect(service, normalizeProps);
|
|
42
44
|
const trigger = api.getTriggerProps();
|
|
@@ -73,6 +75,7 @@ export function DateRangePicker(t0) {
|
|
|
73
75
|
useEffect(() => keepRangePreview(service, shown, api.open), [focused]);
|
|
74
76
|
const summary = rangeSummary(shown, props, locale);
|
|
75
77
|
const invalid = error !== undefined;
|
|
78
|
+
const positionerProps = api.getPositionerProps();
|
|
76
79
|
const t4 = mergeProps(api.getRootProps(), {
|
|
77
80
|
className: classes("xds-date-picker xds-date-range-picker", className),
|
|
78
81
|
style
|
|
@@ -99,70 +102,63 @@ export function DateRangePicker(t0) {
|
|
|
99
102
|
const T0 = Portal;
|
|
100
103
|
const t7 = api.open && /*#__PURE__*/_jsx("div", {
|
|
101
104
|
className: "xds-date-picker__underlay",
|
|
105
|
+
style: underlayLayerStyle(positionerProps.style),
|
|
102
106
|
onMouseDown: _temp
|
|
103
107
|
});
|
|
104
|
-
|
|
108
|
+
const t8 = "xds-date-picker__positioner";
|
|
109
|
+
let t9;
|
|
105
110
|
if ($[7] !== api) {
|
|
106
|
-
|
|
111
|
+
t9 = api.getContentProps();
|
|
107
112
|
$[7] = api;
|
|
108
|
-
$[8] =
|
|
113
|
+
$[8] = t9;
|
|
109
114
|
} else {
|
|
110
|
-
|
|
115
|
+
t9 = $[8];
|
|
111
116
|
}
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
$[
|
|
117
|
+
const t10 = datePickerContentAttrs(ids);
|
|
118
|
+
const t11 = !present;
|
|
119
|
+
let t12;
|
|
120
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
121
|
+
t12 = event_1 => keepCalendarFocus(event_1, surface.current);
|
|
122
|
+
$[9] = t12;
|
|
118
123
|
} else {
|
|
119
|
-
|
|
124
|
+
t12 = $[9];
|
|
120
125
|
}
|
|
121
|
-
const t11 = datePickerContentAttrs(ids);
|
|
122
|
-
const t12 = !present;
|
|
123
126
|
let t13;
|
|
124
|
-
if ($[
|
|
125
|
-
t13 =
|
|
127
|
+
if ($[10] !== summary.start) {
|
|
128
|
+
t13 = /*#__PURE__*/_jsx("span", {
|
|
129
|
+
children: summary.start
|
|
130
|
+
});
|
|
131
|
+
$[10] = summary.start;
|
|
126
132
|
$[11] = t13;
|
|
127
133
|
} else {
|
|
128
134
|
t13 = $[11];
|
|
129
135
|
}
|
|
130
136
|
let t14;
|
|
131
|
-
if ($[12] !== summary.
|
|
137
|
+
if ($[12] !== summary.end) {
|
|
132
138
|
t14 = /*#__PURE__*/_jsx("span", {
|
|
133
|
-
children: summary.
|
|
139
|
+
children: summary.end
|
|
134
140
|
});
|
|
135
|
-
$[12] = summary.
|
|
141
|
+
$[12] = summary.end;
|
|
136
142
|
$[13] = t14;
|
|
137
143
|
} else {
|
|
138
144
|
t14 = $[13];
|
|
139
145
|
}
|
|
140
146
|
let t15;
|
|
141
|
-
if ($[14] !==
|
|
142
|
-
t15 = /*#__PURE__*/
|
|
143
|
-
children: summary.end
|
|
144
|
-
});
|
|
145
|
-
$[14] = summary.end;
|
|
146
|
-
$[15] = t15;
|
|
147
|
-
} else {
|
|
148
|
-
t15 = $[15];
|
|
149
|
-
}
|
|
150
|
-
let t16;
|
|
151
|
-
if ($[16] !== t14 || $[17] !== t15) {
|
|
152
|
-
t16 = /*#__PURE__*/_jsxs("div", {
|
|
147
|
+
if ($[14] !== t13 || $[15] !== t14) {
|
|
148
|
+
t15 = /*#__PURE__*/_jsxs("div", {
|
|
153
149
|
className: "xds-date-range-picker__summary",
|
|
154
150
|
"aria-live": "polite",
|
|
155
|
-
children: [
|
|
151
|
+
children: [t13, t14]
|
|
156
152
|
});
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
153
|
+
$[14] = t13;
|
|
154
|
+
$[15] = t14;
|
|
155
|
+
$[16] = t15;
|
|
160
156
|
} else {
|
|
161
|
-
|
|
157
|
+
t15 = $[16];
|
|
162
158
|
}
|
|
163
|
-
let
|
|
164
|
-
if ($[
|
|
165
|
-
|
|
159
|
+
let t16;
|
|
160
|
+
if ($[17] !== api || $[18] !== months || $[19] !== props || $[20] !== shown) {
|
|
161
|
+
t16 = rangeMonthViews(api, months).map(view => {
|
|
166
162
|
const table = api.getTableProps({
|
|
167
163
|
view: "day",
|
|
168
164
|
id: view.table.id
|
|
@@ -241,70 +237,70 @@ export function DateRangePicker(t0) {
|
|
|
241
237
|
})]
|
|
242
238
|
}, view.index);
|
|
243
239
|
});
|
|
244
|
-
$[
|
|
245
|
-
$[
|
|
246
|
-
$[
|
|
247
|
-
$[
|
|
248
|
-
$[
|
|
240
|
+
$[17] = api;
|
|
241
|
+
$[18] = months;
|
|
242
|
+
$[19] = props;
|
|
243
|
+
$[20] = shown;
|
|
244
|
+
$[21] = t16;
|
|
249
245
|
} else {
|
|
250
|
-
|
|
246
|
+
t16 = $[21];
|
|
251
247
|
}
|
|
252
|
-
let
|
|
253
|
-
if ($[
|
|
254
|
-
|
|
248
|
+
let t17;
|
|
249
|
+
if ($[22] !== t16) {
|
|
250
|
+
t17 = /*#__PURE__*/_jsx("div", {
|
|
255
251
|
className: "xds-date-range-picker__months",
|
|
256
|
-
children:
|
|
252
|
+
children: t16
|
|
257
253
|
});
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
254
|
+
$[22] = t16;
|
|
255
|
+
$[23] = t17;
|
|
260
256
|
} else {
|
|
261
|
-
|
|
257
|
+
t17 = $[23];
|
|
262
258
|
}
|
|
263
|
-
let
|
|
264
|
-
if ($[
|
|
265
|
-
|
|
259
|
+
let t18;
|
|
260
|
+
if ($[24] !== t10 || $[25] !== t11 || $[26] !== t15 || $[27] !== t17 || $[28] !== t9) {
|
|
261
|
+
t18 = /*#__PURE__*/_jsxs("div", {
|
|
262
|
+
...t9,
|
|
266
263
|
...t10,
|
|
267
|
-
...t11,
|
|
268
264
|
ref: surface,
|
|
269
|
-
hidden:
|
|
270
|
-
onKeyDown:
|
|
265
|
+
hidden: t11,
|
|
266
|
+
onKeyDown: t12,
|
|
271
267
|
className: "xds-date-picker__content xds-date-range-picker__content",
|
|
272
|
-
children: [
|
|
268
|
+
children: [t15, t17]
|
|
273
269
|
});
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
$[
|
|
270
|
+
$[24] = t10;
|
|
271
|
+
$[25] = t11;
|
|
272
|
+
$[26] = t15;
|
|
273
|
+
$[27] = t17;
|
|
274
|
+
$[28] = t9;
|
|
275
|
+
$[29] = t18;
|
|
280
276
|
} else {
|
|
281
|
-
|
|
277
|
+
t18 = $[29];
|
|
282
278
|
}
|
|
283
|
-
let
|
|
284
|
-
if ($[
|
|
285
|
-
|
|
286
|
-
...
|
|
279
|
+
let t19;
|
|
280
|
+
if ($[30] !== positionerProps || $[31] !== t18) {
|
|
281
|
+
t19 = /*#__PURE__*/_jsx("div", {
|
|
282
|
+
...positionerProps,
|
|
287
283
|
ref: positioner,
|
|
288
|
-
className:
|
|
289
|
-
children:
|
|
284
|
+
className: t8,
|
|
285
|
+
children: t18
|
|
290
286
|
});
|
|
287
|
+
$[30] = positionerProps;
|
|
288
|
+
$[31] = t18;
|
|
291
289
|
$[32] = t19;
|
|
292
|
-
$[33] = t8;
|
|
293
|
-
$[34] = t20;
|
|
294
290
|
} else {
|
|
295
|
-
|
|
291
|
+
t19 = $[32];
|
|
296
292
|
}
|
|
297
|
-
let
|
|
298
|
-
if ($[
|
|
299
|
-
|
|
300
|
-
children: [t7,
|
|
293
|
+
let t20;
|
|
294
|
+
if ($[33] !== T0 || $[34] !== t19 || $[35] !== t7) {
|
|
295
|
+
t20 = /*#__PURE__*/_jsxs(T0, {
|
|
296
|
+
children: [t7, t19]
|
|
301
297
|
});
|
|
302
|
-
$[
|
|
298
|
+
$[33] = T0;
|
|
299
|
+
$[34] = t19;
|
|
300
|
+
$[35] = t7;
|
|
303
301
|
$[36] = t20;
|
|
304
|
-
$[37] = t7;
|
|
305
|
-
$[38] = t21;
|
|
306
302
|
} else {
|
|
307
|
-
|
|
303
|
+
t20 = $[36];
|
|
308
304
|
}
|
|
309
305
|
return /*#__PURE__*/_jsxs("div", {
|
|
310
306
|
...t4,
|
|
@@ -336,17 +332,18 @@ export function DateRangePicker(t0) {
|
|
|
336
332
|
children: value === undefined ? placeholder : formatRange(value, locale)
|
|
337
333
|
}), t6]
|
|
338
334
|
})
|
|
339
|
-
}),
|
|
335
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
340
336
|
className: "xds-date-picker__footer",
|
|
341
|
-
children: invalid
|
|
342
|
-
id: ids.error,
|
|
343
|
-
className: "xds-date-picker__error",
|
|
344
|
-
children: error
|
|
345
|
-
}) : /*#__PURE__*/_jsx("span", {
|
|
337
|
+
children: [!invalid && description && /*#__PURE__*/_jsx("span", {
|
|
346
338
|
id: ids.description,
|
|
347
339
|
className: "xds-date-picker__description",
|
|
348
340
|
children: description
|
|
349
|
-
})
|
|
341
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
342
|
+
id: ids.error,
|
|
343
|
+
className: "xds-date-picker__error",
|
|
344
|
+
"aria-live": "polite",
|
|
345
|
+
children: error
|
|
346
|
+
})]
|
|
350
347
|
}), startName !== undefined && /*#__PURE__*/_jsx("input", {
|
|
351
348
|
type: "hidden",
|
|
352
349
|
name: startName,
|
|
@@ -355,7 +352,7 @@ export function DateRangePicker(t0) {
|
|
|
355
352
|
type: "hidden",
|
|
356
353
|
name: endName,
|
|
357
354
|
value: value?.end ?? ""
|
|
358
|
-
}),
|
|
355
|
+
}), t20]
|
|
359
356
|
});
|
|
360
357
|
}
|
|
361
358
|
function _temp2(weekDay) {
|
package/dist/Menu.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { space } from "@xds/tokens";
|
|
3
|
-
import { classes, firstMenuValue, keepListKeys, layoutRect, leaveEscapeToFields, menuItemClass, opensOnPress } from "@xds/core";
|
|
3
|
+
import { classes, firstMenuValue, keepListKeys, layoutRect, leaveEscapeToFields, menuItemClass, opensOnPress, readCssPx, underlayLayerStyle } from "@xds/core";
|
|
4
4
|
import * as menu from "@zag-js/menu";
|
|
5
5
|
import { normalizeProps, useMachine } from "@zag-js/react";
|
|
6
6
|
import { useId, useRef } from "react";
|
|
@@ -11,7 +11,7 @@ import { usePresence } from "./presence.js";
|
|
|
11
11
|
import { TriggerContext, useMergedProps, useProvideTrigger } from "./trigger.js";
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
export function Menu(t0) {
|
|
14
|
-
const $ = _c(
|
|
14
|
+
const $ = _c(32);
|
|
15
15
|
const {
|
|
16
16
|
trigger,
|
|
17
17
|
label,
|
|
@@ -24,49 +24,56 @@ export function Menu(t0) {
|
|
|
24
24
|
const t2 = useId();
|
|
25
25
|
const t3 = `bottom-${align}`;
|
|
26
26
|
let t4;
|
|
27
|
-
if ($[0]
|
|
28
|
-
t4 =
|
|
27
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
28
|
+
t4 = readCssPx(null, "--xds-space-1", space[1]);
|
|
29
|
+
$[0] = t4;
|
|
30
|
+
} else {
|
|
31
|
+
t4 = $[0];
|
|
32
|
+
}
|
|
33
|
+
let t5;
|
|
34
|
+
if ($[1] !== t3) {
|
|
35
|
+
t5 = {
|
|
29
36
|
placement: t3,
|
|
30
|
-
gutter:
|
|
37
|
+
gutter: t4,
|
|
31
38
|
getAnchorRect: _temp
|
|
32
39
|
};
|
|
33
|
-
$[
|
|
34
|
-
$[
|
|
40
|
+
$[1] = t3;
|
|
41
|
+
$[2] = t5;
|
|
35
42
|
} else {
|
|
36
|
-
|
|
43
|
+
t5 = $[2];
|
|
37
44
|
}
|
|
38
|
-
let
|
|
39
|
-
if ($[
|
|
40
|
-
|
|
45
|
+
let t6;
|
|
46
|
+
if ($[3] !== items) {
|
|
47
|
+
t6 = details => {
|
|
41
48
|
const item = items[Number(details.value)];
|
|
42
49
|
if (item && item !== "separator") {
|
|
43
50
|
item.onSelect();
|
|
44
51
|
}
|
|
45
52
|
};
|
|
46
|
-
$[
|
|
47
|
-
$[
|
|
53
|
+
$[3] = items;
|
|
54
|
+
$[4] = t6;
|
|
48
55
|
} else {
|
|
49
|
-
|
|
56
|
+
t6 = $[4];
|
|
50
57
|
}
|
|
51
|
-
let
|
|
52
|
-
if ($[
|
|
53
|
-
|
|
58
|
+
let t7;
|
|
59
|
+
if ($[5] !== label || $[6] !== t2 || $[7] !== t5 || $[8] !== t6) {
|
|
60
|
+
t7 = {
|
|
54
61
|
id: t2,
|
|
55
62
|
"aria-label": label,
|
|
56
|
-
positioning:
|
|
57
|
-
onSelect:
|
|
63
|
+
positioning: t5,
|
|
64
|
+
onSelect: t6,
|
|
58
65
|
onEscapeKeyDown: leaveEscapeToFields,
|
|
59
66
|
loopFocus: true
|
|
60
67
|
};
|
|
61
|
-
$[
|
|
62
|
-
$[
|
|
63
|
-
$[6] = t4;
|
|
68
|
+
$[5] = label;
|
|
69
|
+
$[6] = t2;
|
|
64
70
|
$[7] = t5;
|
|
65
71
|
$[8] = t6;
|
|
72
|
+
$[9] = t7;
|
|
66
73
|
} else {
|
|
67
|
-
|
|
74
|
+
t7 = $[9];
|
|
68
75
|
}
|
|
69
|
-
const service = useMachine(menu.machine,
|
|
76
|
+
const service = useMachine(menu.machine, t7);
|
|
70
77
|
const api = menu.connect(service, normalizeProps);
|
|
71
78
|
const {
|
|
72
79
|
onPointerDown: _onPointerDown,
|
|
@@ -105,47 +112,48 @@ export function Menu(t0) {
|
|
|
105
112
|
}));
|
|
106
113
|
const positioner = useRef(null);
|
|
107
114
|
const surface = useRef(null);
|
|
108
|
-
let t7;
|
|
109
|
-
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
110
|
-
t7 = () => positioner.current;
|
|
111
|
-
$[9] = t7;
|
|
112
|
-
} else {
|
|
113
|
-
t7 = $[9];
|
|
114
|
-
}
|
|
115
|
-
useModalPopover(api.open, t7);
|
|
116
115
|
let t8;
|
|
117
116
|
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
118
|
-
t8 = () =>
|
|
117
|
+
t8 = () => positioner.current;
|
|
119
118
|
$[10] = t8;
|
|
120
119
|
} else {
|
|
121
120
|
t8 = $[10];
|
|
122
121
|
}
|
|
123
|
-
|
|
122
|
+
useModalPopover(api.open, t8);
|
|
123
|
+
let t9;
|
|
124
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
125
|
+
t9 = () => [surface.current];
|
|
126
|
+
$[11] = t9;
|
|
127
|
+
} else {
|
|
128
|
+
t9 = $[11];
|
|
129
|
+
}
|
|
130
|
+
const present = usePresence(api.open, t9);
|
|
124
131
|
const content = useMergedProps(api.getContentProps(), {
|
|
125
132
|
className: classes("xds-menu", className),
|
|
126
133
|
style,
|
|
127
134
|
onKeyDown: event_1 => keepListKeys(event_1, surface.current, ".xds-menu__item:not([data-disabled])", value => api.setHighlightedValue(value))
|
|
128
135
|
});
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
136
|
+
const positionerProps = api.getPositionerProps();
|
|
137
|
+
let t10;
|
|
138
|
+
if ($[12] !== provided || $[13] !== trigger) {
|
|
139
|
+
t10 = /*#__PURE__*/_jsx(TriggerContext, {
|
|
132
140
|
value: provided,
|
|
133
141
|
children: trigger
|
|
134
142
|
});
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
143
|
+
$[12] = provided;
|
|
144
|
+
$[13] = trigger;
|
|
145
|
+
$[14] = t10;
|
|
138
146
|
} else {
|
|
139
|
-
|
|
147
|
+
t10 = $[14];
|
|
140
148
|
}
|
|
141
149
|
const T0 = Portal;
|
|
142
150
|
const T1 = TriggerContext;
|
|
143
|
-
const
|
|
144
|
-
const
|
|
151
|
+
const t11 = null;
|
|
152
|
+
const t12 = api.open && /*#__PURE__*/_jsx("div", {
|
|
145
153
|
className: "xds-menu__underlay",
|
|
154
|
+
style: underlayLayerStyle(positionerProps.style),
|
|
146
155
|
onMouseDown: _temp2
|
|
147
156
|
});
|
|
148
|
-
const t12 = api.getPositionerProps();
|
|
149
157
|
const t13 = "xds-menu__positioner";
|
|
150
158
|
const t14 = !present;
|
|
151
159
|
const t15 = items.map((item_0, index) => item_0 === "separator" ? /*#__PURE__*/_jsx("div", {
|
|
@@ -171,68 +179,68 @@ export function Menu(t0) {
|
|
|
171
179
|
})]
|
|
172
180
|
}, index));
|
|
173
181
|
let t16;
|
|
174
|
-
if ($[
|
|
182
|
+
if ($[15] !== content || $[16] !== t14 || $[17] !== t15) {
|
|
175
183
|
t16 = /*#__PURE__*/_jsx("div", {
|
|
176
184
|
...content,
|
|
177
185
|
ref: surface,
|
|
178
186
|
hidden: t14,
|
|
179
187
|
children: t15
|
|
180
188
|
});
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
$[
|
|
189
|
+
$[15] = content;
|
|
190
|
+
$[16] = t14;
|
|
191
|
+
$[17] = t15;
|
|
192
|
+
$[18] = t16;
|
|
185
193
|
} else {
|
|
186
|
-
t16 = $[
|
|
194
|
+
t16 = $[18];
|
|
187
195
|
}
|
|
188
196
|
let t17;
|
|
189
|
-
if ($[
|
|
197
|
+
if ($[19] !== positionerProps || $[20] !== t16) {
|
|
190
198
|
t17 = /*#__PURE__*/_jsx("div", {
|
|
191
|
-
...
|
|
199
|
+
...positionerProps,
|
|
192
200
|
ref: positioner,
|
|
193
201
|
className: t13,
|
|
194
202
|
children: t16
|
|
195
203
|
});
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
204
|
+
$[19] = positionerProps;
|
|
205
|
+
$[20] = t16;
|
|
206
|
+
$[21] = t17;
|
|
199
207
|
} else {
|
|
200
|
-
t17 = $[
|
|
208
|
+
t17 = $[21];
|
|
201
209
|
}
|
|
202
210
|
let t18;
|
|
203
|
-
if ($[
|
|
211
|
+
if ($[22] !== T1 || $[23] !== t12 || $[24] !== t17) {
|
|
204
212
|
t18 = /*#__PURE__*/_jsxs(T1, {
|
|
205
|
-
value:
|
|
206
|
-
children: [
|
|
213
|
+
value: t11,
|
|
214
|
+
children: [t12, t17]
|
|
207
215
|
});
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
216
|
+
$[22] = T1;
|
|
217
|
+
$[23] = t12;
|
|
218
|
+
$[24] = t17;
|
|
219
|
+
$[25] = t18;
|
|
212
220
|
} else {
|
|
213
|
-
t18 = $[
|
|
221
|
+
t18 = $[25];
|
|
214
222
|
}
|
|
215
223
|
let t19;
|
|
216
|
-
if ($[
|
|
224
|
+
if ($[26] !== T0 || $[27] !== t18) {
|
|
217
225
|
t19 = /*#__PURE__*/_jsx(T0, {
|
|
218
226
|
children: t18
|
|
219
227
|
});
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
228
|
+
$[26] = T0;
|
|
229
|
+
$[27] = t18;
|
|
230
|
+
$[28] = t19;
|
|
223
231
|
} else {
|
|
224
|
-
t19 = $[
|
|
232
|
+
t19 = $[28];
|
|
225
233
|
}
|
|
226
234
|
let t20;
|
|
227
|
-
if ($[
|
|
235
|
+
if ($[29] !== t10 || $[30] !== t19) {
|
|
228
236
|
t20 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
229
|
-
children: [
|
|
237
|
+
children: [t10, t19]
|
|
230
238
|
});
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
239
|
+
$[29] = t10;
|
|
240
|
+
$[30] = t19;
|
|
241
|
+
$[31] = t20;
|
|
234
242
|
} else {
|
|
235
|
-
t20 = $[
|
|
243
|
+
t20 = $[31];
|
|
236
244
|
}
|
|
237
245
|
return t20;
|
|
238
246
|
}
|
package/dist/SearchField.js
CHANGED
|
@@ -55,8 +55,9 @@ export function SearchField(t0) {
|
|
|
55
55
|
if (event_0.nativeEvent.isComposing) {
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
|
-
if (event_0.key === "Enter") {
|
|
59
|
-
|
|
58
|
+
if (event_0.key === "Enter" && onSubmit) {
|
|
59
|
+
event_0.preventDefault();
|
|
60
|
+
onSubmit(value);
|
|
60
61
|
}
|
|
61
62
|
if (event_0.key === "Escape" && value !== "") {
|
|
62
63
|
event_0.stopPropagation();
|
|
@@ -75,6 +76,7 @@ export function SearchField(t0) {
|
|
|
75
76
|
t8 = /*#__PURE__*/_jsx("input", {
|
|
76
77
|
ref: input,
|
|
77
78
|
type: "text",
|
|
79
|
+
role: "searchbox",
|
|
78
80
|
className: "xds-text-field__input",
|
|
79
81
|
"aria-label": label,
|
|
80
82
|
enterKeyHint: "search",
|