@primer/react 38.42.0-rc.fcbfbaea1 → 38.42.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/CHANGELOG.md +16 -0
- package/dist/ActionBar/ActionBar.js +498 -162
- package/dist/ActionBar/index.d.ts +2 -2
- package/dist/ActionList/Group.js +4 -5
- package/dist/ActionList/Item.js +2 -2
- package/dist/Banner/Banner.js +3 -5
- package/dist/Button/ButtonBase.js +3 -2
- package/dist/Button/IconButton.js +3 -4
- package/dist/Button/types.d.ts +2 -2
- package/dist/Card/Card.js +1 -2
- package/dist/Checkbox/Checkbox.js +145 -41
- package/dist/CounterLabel/CounterLabel.js +80 -18
- package/dist/Details/Details.js +2 -4
- package/dist/FeatureFlags/FeatureFlagScope.js +1 -0
- package/dist/FilteredActionList/constants.js +2 -0
- package/dist/FilteredActionList/useAnnouncements.js +148 -81
- package/dist/FormControl/FormControl.js +55 -80
- package/dist/FormControl/FormControlLabel.js +1 -2
- package/dist/InlineMessage/InlineMessage.js +1 -2
- package/dist/NavList/NavList.js +3 -4
- package/dist/Overlay/Overlay.d.ts +2 -0
- package/dist/Overlay/Overlay.js +300 -63
- package/dist/PageLayout/usePaneWidth.js +2 -2
- package/dist/Popover/Popover.js +3 -5
- package/dist/ProgressBar/ProgressBar.js +1 -2
- package/dist/SegmentedControl/SegmentedControlButton.js +1 -2
- package/dist/Select/Select.js +2 -2
- package/dist/SelectPanel/SelectPanel.d.ts +1 -1
- package/dist/SelectPanel/SelectPanel.js +1 -1
- package/dist/Spinner/Spinner.js +1 -2
- package/dist/TextInput/TextInput.js +242 -87
- package/dist/Textarea/Textarea.d.ts +2 -2
- package/dist/ToggleSwitch/ToggleSwitch.js +2 -3
- package/dist/Tooltip/Tooltip.js +98 -17
- package/dist/TooltipV2/Tooltip.js +295 -138
- package/dist/TopicTag/TopicTag.js +1 -2
- package/dist/Truncate/Truncate.js +87 -14
- package/dist/UnderlineNav/UnderlineNavItem.js +2 -4
- package/dist/deprecated/ActionList/List.js +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel.d.ts +1 -1
- package/dist/hooks/useOpenAndCloseFocus.d.ts +3 -1
- package/dist/hooks/useOpenAndCloseFocus.js +28 -16
- package/dist/hooks/useOverlay.d.ts +3 -1
- package/dist/hooks/useOverlay.js +24 -22
- package/dist/internal/components/InputLabel.js +1 -2
- package/dist/internal/components/TextInputInnerAction.js +1 -2
- package/dist/internal/components/TextInputWrapper.d.ts +3 -0
- package/dist/internal/hooks/useThemeProvider.js +3 -3
- package/generated/components.json +34 -20
- package/generated/hooks.json +12 -0
- package/package.json +12 -13
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
2
3
|
import { announce } from "@primer/live-region-element";
|
|
3
4
|
//#region src/FilteredActionList/useAnnouncements.tsx
|
|
4
5
|
const delayMs = 500;
|
|
@@ -43,91 +44,157 @@ const getAnnouncementState = (items, loading, message, filterValue) => JSON.stri
|
|
|
43
44
|
message,
|
|
44
45
|
filterValue
|
|
45
46
|
});
|
|
46
|
-
const useAnnouncements = (items, listContainerRef, inputRef,
|
|
47
|
+
const useAnnouncements = (items, listContainerRef, inputRef, t0, t1, message, focusManagement, filterValue) => {
|
|
48
|
+
const $ = c(37);
|
|
49
|
+
const enabled = t0 === void 0 ? true : t0;
|
|
50
|
+
const loading = t1 === void 0 ? false : t1;
|
|
47
51
|
const usingRovingTabindex = focusManagement === "roving-tabindex";
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
let t2;
|
|
53
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
54
|
+
t2 = document.querySelector("live-region");
|
|
55
|
+
$[0] = t2;
|
|
56
|
+
} else t2 = $[0];
|
|
57
|
+
const liveRegion = t2;
|
|
58
|
+
let t3;
|
|
59
|
+
if ($[1] !== items) {
|
|
60
|
+
t3 = items.filter(_temp);
|
|
61
|
+
$[1] = items;
|
|
62
|
+
$[2] = t3;
|
|
63
|
+
} else t3 = $[2];
|
|
64
|
+
const selectedItems = t3.length;
|
|
65
|
+
let t4;
|
|
66
|
+
if ($[3] !== enabled) {
|
|
67
|
+
t4 = (...t5) => {
|
|
68
|
+
const args = t5;
|
|
69
|
+
if (enabled) return announce(...args);
|
|
70
|
+
};
|
|
71
|
+
$[3] = enabled;
|
|
72
|
+
$[4] = t4;
|
|
73
|
+
} else t4 = $[4];
|
|
74
|
+
const announce$1 = t4;
|
|
75
|
+
let t5;
|
|
76
|
+
if ($[5] !== announce$1 || $[6] !== inputRef || $[7] !== items || $[8] !== listContainerRef || $[9] !== selectedItems || $[10] !== usingRovingTabindex) {
|
|
77
|
+
t5 = () => {
|
|
78
|
+
if (usingRovingTabindex) {
|
|
79
|
+
const announcementText = `${items.length} item${items.length > 1 ? "s" : ""} available, ${selectedItems} selected.`;
|
|
80
|
+
announce$1(announcementText, {
|
|
81
|
+
delayMs,
|
|
82
|
+
from: liveRegion ? liveRegion : void 0
|
|
83
|
+
});
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
window.setTimeout(() => {
|
|
87
|
+
const activeItem = getItemWithActiveDescendant(listContainerRef, items);
|
|
88
|
+
if (!activeItem) return;
|
|
89
|
+
const { index, text, selected } = activeItem;
|
|
90
|
+
const inputLabel = getInputLabel(inputRef.current);
|
|
91
|
+
const announcementText_0 = [
|
|
92
|
+
inputLabel ? `${inputLabel}, filter text box and list of items` : "Focus on filter text box and list of items",
|
|
93
|
+
`Focused item: ${text}`,
|
|
94
|
+
`${selected ? "selected" : "not selected"}`,
|
|
95
|
+
`${index + 1} of ${items.length}`
|
|
96
|
+
].join(", ");
|
|
97
|
+
announce$1(announcementText_0, {
|
|
98
|
+
delayMs,
|
|
99
|
+
from: liveRegion ? liveRegion : void 0
|
|
100
|
+
});
|
|
59
101
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
inputRef,
|
|
81
|
-
items,
|
|
82
|
-
listContainerRef,
|
|
83
|
-
liveRegion,
|
|
84
|
-
selectedItems,
|
|
85
|
-
usingRovingTabindex
|
|
86
|
-
]);
|
|
87
|
-
const announcementState = getAnnouncementState(items, loading, message, filterValue);
|
|
102
|
+
};
|
|
103
|
+
$[5] = announce$1;
|
|
104
|
+
$[6] = inputRef;
|
|
105
|
+
$[7] = items;
|
|
106
|
+
$[8] = listContainerRef;
|
|
107
|
+
$[9] = selectedItems;
|
|
108
|
+
$[10] = usingRovingTabindex;
|
|
109
|
+
$[11] = t5;
|
|
110
|
+
} else t5 = $[11];
|
|
111
|
+
const onInputFocus = t5;
|
|
112
|
+
let t6;
|
|
113
|
+
if ($[12] !== filterValue || $[13] !== items || $[14] !== loading || $[15] !== message) {
|
|
114
|
+
t6 = getAnnouncementState(items, loading, message, filterValue);
|
|
115
|
+
$[12] = filterValue;
|
|
116
|
+
$[13] = items;
|
|
117
|
+
$[14] = loading;
|
|
118
|
+
$[15] = message;
|
|
119
|
+
$[16] = t6;
|
|
120
|
+
} else t6 = $[16];
|
|
121
|
+
const announcementState = t6;
|
|
88
122
|
const previousAnnouncementState = useRef(announcementState);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
123
|
+
let t7;
|
|
124
|
+
if ($[17] !== announce$1 || $[18] !== announcementState || $[19] !== items || $[20] !== listContainerRef || $[21] !== loading || $[22] !== (message === null || message === void 0 ? void 0 : message.description) || $[23] !== (message === null || message === void 0 ? void 0 : message.title) || $[24] !== selectedItems || $[25] !== usingRovingTabindex) {
|
|
125
|
+
t7 = function announceListUpdates() {
|
|
126
|
+
if (previousAnnouncementState.current === announcementState) return;
|
|
127
|
+
previousAnnouncementState.current = announcementState;
|
|
128
|
+
liveRegion === null || liveRegion === void 0 || liveRegion.clear();
|
|
129
|
+
if (items.length === 0 && !loading) {
|
|
130
|
+
announce$1(`${message === null || message === void 0 ? void 0 : message.title}. ${message === null || message === void 0 ? void 0 : message.description}`, { delayMs });
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (usingRovingTabindex) {
|
|
134
|
+
const announcementText_1 = `${items.length} item${items.length > 1 ? "s" : ""} available, ${selectedItems} selected.`;
|
|
135
|
+
announce$1(announcementText_1, {
|
|
136
|
+
delayMs,
|
|
137
|
+
from: liveRegion ? liveRegion : void 0
|
|
138
|
+
});
|
|
139
|
+
} else window.requestAnimationFrame(() => {
|
|
140
|
+
const activeItem_0 = getItemWithActiveDescendant(listContainerRef, items);
|
|
141
|
+
if (!activeItem_0) return;
|
|
142
|
+
const { index: index_0, text: text_0, selected: selected_0 } = activeItem_0;
|
|
143
|
+
const announcementText_2 = [
|
|
144
|
+
"List updated",
|
|
145
|
+
`Focused item: ${text_0}`,
|
|
146
|
+
`${selected_0 ? "selected" : "not selected"}`,
|
|
147
|
+
`${index_0 + 1} of ${items.length}`
|
|
148
|
+
].join(", ");
|
|
149
|
+
announce$1(announcementText_2, {
|
|
150
|
+
delayMs,
|
|
151
|
+
from: liveRegion ? liveRegion : void 0
|
|
152
|
+
});
|
|
116
153
|
});
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
154
|
+
};
|
|
155
|
+
$[17] = announce$1;
|
|
156
|
+
$[18] = announcementState;
|
|
157
|
+
$[19] = items;
|
|
158
|
+
$[20] = listContainerRef;
|
|
159
|
+
$[21] = loading;
|
|
160
|
+
$[22] = message === null || message === void 0 ? void 0 : message.description;
|
|
161
|
+
$[23] = message === null || message === void 0 ? void 0 : message.title;
|
|
162
|
+
$[24] = selectedItems;
|
|
163
|
+
$[25] = usingRovingTabindex;
|
|
164
|
+
$[26] = t7;
|
|
165
|
+
} else t7 = $[26];
|
|
166
|
+
const t8 = message === null || message === void 0 ? void 0 : message.title;
|
|
167
|
+
const t9 = message === null || message === void 0 ? void 0 : message.description;
|
|
168
|
+
let t10;
|
|
169
|
+
if ($[27] !== announce$1 || $[28] !== announcementState || $[29] !== items || $[30] !== listContainerRef || $[31] !== loading || $[32] !== selectedItems || $[33] !== t8 || $[34] !== t9 || $[35] !== usingRovingTabindex) {
|
|
170
|
+
t10 = [
|
|
171
|
+
announce$1,
|
|
172
|
+
announcementState,
|
|
173
|
+
items,
|
|
174
|
+
listContainerRef,
|
|
175
|
+
liveRegion,
|
|
176
|
+
usingRovingTabindex,
|
|
177
|
+
t8,
|
|
178
|
+
t9,
|
|
179
|
+
loading,
|
|
180
|
+
selectedItems
|
|
181
|
+
];
|
|
182
|
+
$[27] = announce$1;
|
|
183
|
+
$[28] = announcementState;
|
|
184
|
+
$[29] = items;
|
|
185
|
+
$[30] = listContainerRef;
|
|
186
|
+
$[31] = loading;
|
|
187
|
+
$[32] = selectedItems;
|
|
188
|
+
$[33] = t8;
|
|
189
|
+
$[34] = t9;
|
|
190
|
+
$[35] = usingRovingTabindex;
|
|
191
|
+
$[36] = t10;
|
|
192
|
+
} else t10 = $[36];
|
|
193
|
+
useEffect(t7, t10);
|
|
130
194
|
return onInputFocus;
|
|
131
195
|
};
|
|
196
|
+
function _temp(item) {
|
|
197
|
+
return item.selected;
|
|
198
|
+
}
|
|
132
199
|
//#endregion
|
|
133
200
|
export { useAnnouncements };
|
|
@@ -24,7 +24,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
|
24
24
|
import { clsx } from "clsx";
|
|
25
25
|
var FormControl_default = Object.assign(/* @__PURE__ */ React.forwardRef((t0, ref) => {
|
|
26
26
|
var _slots$validation, _slots$label;
|
|
27
|
-
const $ = c(
|
|
27
|
+
const $ = c(23);
|
|
28
28
|
const { children, disabled: disabledProp, layout: t1, id: idProp, required, className, style } = t0;
|
|
29
29
|
const layout = t1 === void 0 ? "vertical" : t1;
|
|
30
30
|
let t2;
|
|
@@ -78,87 +78,65 @@ var FormControl_default = Object.assign(/* @__PURE__ */ React.forwardRef((t0, re
|
|
|
78
78
|
warning(isRadioInput && childrenWithoutSlots.find(_temp), "An individual radio cannot be a required field.");
|
|
79
79
|
} else warning(!!slots.leadingVisual, "A leading visual is only rendered for a checkbox or radio form control. If you want to render a leading visual inside of your input, check if your input supports a leading visual.");
|
|
80
80
|
const isLabelHidden = (_slots$label = slots.label) === null || _slots$label === void 0 ? void 0 : _slots$label.props.visuallyHidden;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
required: required && !isRadioInput,
|
|
85
|
-
"aria-describedby": captionId
|
|
86
|
-
}) : null;
|
|
87
|
-
let t5;
|
|
88
|
-
if ($[4] !== childrenWithoutSlots) {
|
|
89
|
-
t5 = childrenWithoutSlots.filter(_temp2);
|
|
90
|
-
$[4] = childrenWithoutSlots;
|
|
91
|
-
$[5] = t5;
|
|
92
|
-
} else t5 = $[5];
|
|
93
|
-
let t6;
|
|
94
|
-
if ($[6] !== t4 || $[7] !== t5) {
|
|
95
|
-
t6 = /* @__PURE__ */ jsxs("div", {
|
|
96
|
-
className: FormControl_module_css_default.ControlChoiceInputs,
|
|
97
|
-
children: [t4, t5]
|
|
98
|
-
});
|
|
99
|
-
$[6] = t4;
|
|
100
|
-
$[7] = t5;
|
|
101
|
-
$[8] = t6;
|
|
102
|
-
} else t6 = $[8];
|
|
103
|
-
let t7;
|
|
104
|
-
if ($[9] !== disabled || $[10] !== slots.caption || $[11] !== slots.leadingVisual) {
|
|
105
|
-
t7 = slots.leadingVisual ? /* @__PURE__ */ jsx("div", {
|
|
81
|
+
let t4;
|
|
82
|
+
if ($[4] !== disabled || $[5] !== slots.caption || $[6] !== slots.leadingVisual) {
|
|
83
|
+
t4 = slots.leadingVisual ? /* @__PURE__ */ jsx("div", {
|
|
106
84
|
className: FormControl_module_css_default.LeadingVisual,
|
|
107
85
|
"data-disabled": disabled ? "" : void 0,
|
|
108
86
|
"data-has-caption": slots.caption ? "" : void 0,
|
|
109
87
|
children: slots.leadingVisual
|
|
110
88
|
}) : null;
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
} else
|
|
116
|
-
let
|
|
117
|
-
if ($[
|
|
118
|
-
|
|
89
|
+
$[4] = disabled;
|
|
90
|
+
$[5] = slots.caption;
|
|
91
|
+
$[6] = slots.leadingVisual;
|
|
92
|
+
$[7] = t4;
|
|
93
|
+
} else t4 = $[7];
|
|
94
|
+
let t5;
|
|
95
|
+
if ($[8] !== slots.caption || $[9] !== slots.label) {
|
|
96
|
+
t5 = /* @__PURE__ */ jsxs("div", {
|
|
119
97
|
className: FormControl_module_css_default.LabelContainer,
|
|
120
98
|
children: [slots.label, slots.caption]
|
|
121
99
|
});
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
} else
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
100
|
+
$[8] = slots.caption;
|
|
101
|
+
$[9] = slots.label;
|
|
102
|
+
$[10] = t5;
|
|
103
|
+
} else t5 = $[10];
|
|
104
|
+
const InputChildren = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
105
|
+
/* @__PURE__ */ jsxs("div", {
|
|
106
|
+
className: FormControl_module_css_default.ControlChoiceInputs,
|
|
107
|
+
children: [/*#__PURE__*/ React.isValidElement(InputComponent) ? /*#__PURE__*/ React.cloneElement(InputComponent, {
|
|
108
|
+
id,
|
|
109
|
+
disabled,
|
|
110
|
+
required: required && !isRadioInput,
|
|
111
|
+
"aria-describedby": captionId
|
|
112
|
+
}) : null, childrenWithoutSlots.filter((child_1) => /*#__PURE__*/ React.isValidElement(child_1) && !expectedInputComponents.some((inputComponent_0) => child_1.type === inputComponent_0 || isSlot(child_1, inputComponent_0)))]
|
|
113
|
+
}),
|
|
114
|
+
t4,
|
|
115
|
+
t5
|
|
116
|
+
] });
|
|
139
117
|
const T0 = FormControlContextProvider;
|
|
140
|
-
const
|
|
141
|
-
let
|
|
142
|
-
if ($[
|
|
143
|
-
|
|
118
|
+
const t6 = !isSelectPanelInput;
|
|
119
|
+
let t7;
|
|
120
|
+
if ($[11] !== captionId || $[12] !== disabled || $[13] !== id || $[14] !== labelId || $[15] !== required || $[16] !== t6 || $[17] !== validationMessageId) {
|
|
121
|
+
t7 = {
|
|
144
122
|
captionId,
|
|
145
123
|
disabled,
|
|
146
124
|
id,
|
|
147
125
|
required,
|
|
148
126
|
validationMessageId,
|
|
149
|
-
isReferenced:
|
|
127
|
+
isReferenced: t6,
|
|
150
128
|
labelId
|
|
151
129
|
};
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
} else
|
|
161
|
-
const
|
|
130
|
+
$[11] = captionId;
|
|
131
|
+
$[12] = disabled;
|
|
132
|
+
$[13] = id;
|
|
133
|
+
$[14] = labelId;
|
|
134
|
+
$[15] = required;
|
|
135
|
+
$[16] = t6;
|
|
136
|
+
$[17] = validationMessageId;
|
|
137
|
+
$[18] = t7;
|
|
138
|
+
} else t7 = $[18];
|
|
139
|
+
const t8 = isChoiceInput || layout === "horizontal" ? /* @__PURE__ */ jsx("div", {
|
|
162
140
|
ref,
|
|
163
141
|
"data-has-leading-visual": slots.leadingVisual ? "" : void 0,
|
|
164
142
|
className: clsx(className, FormControl_module_css_default.ControlHorizontalLayout),
|
|
@@ -188,18 +166,18 @@ var FormControl_default = Object.assign(/* @__PURE__ */ React.forwardRef((t0, re
|
|
|
188
166
|
slots.caption
|
|
189
167
|
]
|
|
190
168
|
});
|
|
191
|
-
let
|
|
192
|
-
if ($[
|
|
193
|
-
|
|
194
|
-
value:
|
|
195
|
-
children:
|
|
169
|
+
let t9;
|
|
170
|
+
if ($[19] !== T0 || $[20] !== t7 || $[21] !== t8) {
|
|
171
|
+
t9 = /* @__PURE__ */ jsx(T0, {
|
|
172
|
+
value: t7,
|
|
173
|
+
children: t8
|
|
196
174
|
});
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
} else
|
|
202
|
-
return
|
|
175
|
+
$[19] = T0;
|
|
176
|
+
$[20] = t7;
|
|
177
|
+
$[21] = t8;
|
|
178
|
+
$[22] = t9;
|
|
179
|
+
} else t9 = $[22];
|
|
180
|
+
return t9;
|
|
203
181
|
}), {
|
|
204
182
|
__SLOT__: Symbol("FormControl"),
|
|
205
183
|
Caption: FormControlCaption,
|
|
@@ -211,8 +189,5 @@ function _temp(child_0) {
|
|
|
211
189
|
var _child_0$props;
|
|
212
190
|
return /*#__PURE__*/ React.isValidElement(child_0) && ((_child_0$props = child_0.props) === null || _child_0$props === void 0 ? void 0 : _child_0$props.required);
|
|
213
191
|
}
|
|
214
|
-
function _temp2(child_1) {
|
|
215
|
-
return /*#__PURE__*/ React.isValidElement(child_1) && ![Checkbox, Radio].some((inputComponent_0) => child_1.type === inputComponent_0 || isSlot(child_1, inputComponent_0));
|
|
216
|
-
}
|
|
217
192
|
//#endregion
|
|
218
193
|
export { FormControl_default as default };
|
|
@@ -4,7 +4,6 @@ import { InputLabel } from "../internal/components/InputLabel.js";
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/FormControl/FormControlLabel.tsx
|
|
6
6
|
const FormControlLabel = (t0) => {
|
|
7
|
-
var _id;
|
|
8
7
|
const $ = c(26);
|
|
9
8
|
let as;
|
|
10
9
|
let children;
|
|
@@ -40,7 +39,7 @@ const FormControlLabel = (t0) => {
|
|
|
40
39
|
}
|
|
41
40
|
const requiredIndicator = t1 === void 0 ? true : t1;
|
|
42
41
|
const { disabled, id: formControlId, required, isReferenced, labelId } = useFormControlContext();
|
|
43
|
-
const resolvedId =
|
|
42
|
+
const resolvedId = id !== null && id !== void 0 ? id : labelId;
|
|
44
43
|
let t2;
|
|
45
44
|
if ($[10] !== as || $[11] !== className || $[12] !== disabled || $[13] !== formControlId || $[14] !== htmlFor || $[15] !== isReferenced || $[16] !== props || $[17] !== required || $[18] !== requiredIndicator || $[19] !== requiredText || $[20] !== resolvedId || $[21] !== visuallyHidden) {
|
|
46
45
|
t2 = as === "legend" || as === "span" ? {
|
|
@@ -30,7 +30,6 @@ const smallIcons = {
|
|
|
30
30
|
})
|
|
31
31
|
};
|
|
32
32
|
function InlineMessage(t0) {
|
|
33
|
-
var _variant;
|
|
34
33
|
const $ = c(19);
|
|
35
34
|
let LeadingVisual;
|
|
36
35
|
let children;
|
|
@@ -82,7 +81,7 @@ function InlineMessage(t0) {
|
|
|
82
81
|
$[10] = className;
|
|
83
82
|
$[11] = t2;
|
|
84
83
|
} else t2 = $[11];
|
|
85
|
-
const t3 =
|
|
84
|
+
const t3 = variant !== null && variant !== void 0 ? variant : void 0;
|
|
86
85
|
let t4;
|
|
87
86
|
if ($[12] !== children || $[13] !== icon || $[14] !== rest || $[15] !== size || $[16] !== t2 || $[17] !== t3) {
|
|
88
87
|
t4 = /* @__PURE__ */ jsxs("div", {
|
package/dist/NavList/NavList.js
CHANGED
|
@@ -25,7 +25,7 @@ function levelToHeadingTag(level) {
|
|
|
25
25
|
return `h${Math.min(Math.max(level, 1), 4)}`;
|
|
26
26
|
}
|
|
27
27
|
const Root = /*#__PURE__*/ React.forwardRef((t0, ref) => {
|
|
28
|
-
var _heading$props$id
|
|
28
|
+
var _heading$props$id;
|
|
29
29
|
const $ = c(26);
|
|
30
30
|
let ariaLabel;
|
|
31
31
|
let ariaLabelledby;
|
|
@@ -64,7 +64,7 @@ const Root = /*#__PURE__*/ React.forwardRef((t0, ref) => {
|
|
|
64
64
|
$[8] = t2;
|
|
65
65
|
} else t2 = $[8];
|
|
66
66
|
const headingLevel = t2;
|
|
67
|
-
const navLabelledby =
|
|
67
|
+
const navLabelledby = ariaLabelledby !== null && ariaLabelledby !== void 0 ? ariaLabelledby : ariaLabel ? void 0 : headingId;
|
|
68
68
|
let t3;
|
|
69
69
|
if ($[9] !== heading || $[10] !== headingId) {
|
|
70
70
|
t3 = heading ? /*#__PURE__*/ React.cloneElement(heading, { id: headingId }) : null;
|
|
@@ -601,8 +601,7 @@ const GroupHeadingImpl = (t0) => {
|
|
|
601
601
|
const headingLevel = React.useContext(NavListHeadingLevelContext);
|
|
602
602
|
let t1;
|
|
603
603
|
if ($[4] !== as || $[5] !== headingLevel) {
|
|
604
|
-
|
|
605
|
-
t1 = (_as = as) !== null && _as !== void 0 ? _as : headingLevel ? levelToHeadingTag(headingLevel + 1) : "h3";
|
|
604
|
+
t1 = as !== null && as !== void 0 ? as : headingLevel ? levelToHeadingTag(headingLevel + 1) : "h3";
|
|
606
605
|
$[4] = as;
|
|
607
606
|
$[5] = headingLevel;
|
|
608
607
|
$[6] = t1;
|
|
@@ -54,6 +54,7 @@ type ContainerProps = {
|
|
|
54
54
|
portalContainerName?: string;
|
|
55
55
|
preventOverflow?: boolean;
|
|
56
56
|
preventFocusOnOpen?: boolean;
|
|
57
|
+
preventFocusOnClose?: boolean;
|
|
57
58
|
returnFocusRef: React.RefObject<HTMLElement | null>;
|
|
58
59
|
};
|
|
59
60
|
type internalOverlayProps = Merge<OwnOverlayProps, ContainerProps>;
|
|
@@ -68,6 +69,7 @@ type internalOverlayProps = Merge<OwnOverlayProps, ContainerProps>;
|
|
|
68
69
|
* @param portalContainerName Optional. The name of the portal container to render the Overlay into.
|
|
69
70
|
* @param preventOverflow Optional. The Overlay width will be adjusted responsively if there is not enough space to display the Overlay. If `preventOverflow` is `true`, the width of the `Overlay` will not be adjusted.
|
|
70
71
|
* @param preventFocusOnOpen Optional. If 'true', focus will not be applied when the component is first mounted, even if initialFocusRef prop is given.
|
|
72
|
+
* @param preventFocusOnClose Optional. If true, focus will not be returned when the component is unmounted. Consumers must manage focus themselves.
|
|
71
73
|
* @param returnFocusRef Required. Ref for the element to focus when the `Overlay` is closed.
|
|
72
74
|
* @param right Optional. Horizontal right position of the overlay, relative to its closest positioned ancestor (often its `Portal`).
|
|
73
75
|
* @param width Sets the width of the `Overlay`, pick from our set list of widths, or pass `auto` to automatically set the width based on the content of the `Overlay`. `small` corresponds to `256px`, `medium` corresponds to `320px`, `large` corresponds to `480px`, `xlarge` corresponds to `640px`, `xxlarge` corresponds to `960px`.
|