@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
|
@@ -8,7 +8,7 @@ declare const ActionBar: import("react").FC<import("react").PropsWithChildren<Ac
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
} & {
|
|
10
10
|
alignContent?: AlignContent;
|
|
11
|
-
icon?: React.
|
|
11
|
+
icon?: React.ReactNode | React.ComponentType<import("@primer/octicons-react").IconProps> | React.ExoticComponent<import("@primer/octicons-react").IconProps>;
|
|
12
12
|
leadingVisual?: React.ElementType | React.ReactElement<any> | null;
|
|
13
13
|
trailingVisual?: React.ElementType | React.ReactElement<any> | null;
|
|
14
14
|
trailingAction?: React.ElementType | null;
|
|
@@ -39,7 +39,7 @@ declare const ActionBar: import("react").FC<import("react").PropsWithChildren<Ac
|
|
|
39
39
|
'aria-label': string;
|
|
40
40
|
'aria-labelledby'?: undefined;
|
|
41
41
|
} & {
|
|
42
|
-
icon: React.
|
|
42
|
+
icon: React.ReactNode | React.ComponentType<import("@primer/octicons-react").IconProps> | React.ExoticComponent<import("@primer/octicons-react").IconProps>;
|
|
43
43
|
notificationIndicator?: "button" | "icon";
|
|
44
44
|
unsafeDisableTooltip?: boolean;
|
|
45
45
|
description?: string;
|
package/dist/ActionList/Group.js
CHANGED
|
@@ -60,7 +60,7 @@ const HeadingWrap = ({ as = "div", children, className, ...rest }) => {
|
|
|
60
60
|
}, children);
|
|
61
61
|
};
|
|
62
62
|
const Group = (t0) => {
|
|
63
|
-
var
|
|
63
|
+
var _slots$groupHeading;
|
|
64
64
|
const $ = c(38);
|
|
65
65
|
let ariaLabel;
|
|
66
66
|
let auxiliaryText;
|
|
@@ -144,7 +144,7 @@ const Group = (t0) => {
|
|
|
144
144
|
$[22] = t7;
|
|
145
145
|
} else t7 = $[22];
|
|
146
146
|
const t8 = listRole ? void 0 : groupHeadingId;
|
|
147
|
-
const t9 =
|
|
147
|
+
const t9 = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : listRole ? title !== null && title !== void 0 ? title : (_slots$groupHeading = slots.groupHeading) === null || _slots$groupHeading === void 0 ? void 0 : _slots$groupHeading.props.children : void 0;
|
|
148
148
|
const t10 = role || listRole && "group";
|
|
149
149
|
const t11 = slots.groupHeading ? childrenWithoutSlots : props.children;
|
|
150
150
|
let t12;
|
|
@@ -254,7 +254,6 @@ const GroupHeadingImpl = (t0) => {
|
|
|
254
254
|
unnecessaryAsForListboxOrMenu && invariant(false, `Looks like you are trying to set a heading level to a ${listRole} role. Group headings for ${listRole} type action lists are for representational purposes, and rendered as divs. Therefore they don't need a heading level.`);
|
|
255
255
|
let t4;
|
|
256
256
|
if ($[10] !== _internalBackwardCompatibleTitle || $[11] !== as || $[12] !== auxiliaryText || $[13] !== className || $[14] !== groupHeadingId || $[15] !== headingChildren || $[16] !== headingWrapElement || $[17] !== listRole || $[18] !== props || $[19] !== trailingAction || $[20] !== variant) {
|
|
257
|
-
var _internalBackwardComp, _internalBackwardComp2;
|
|
258
257
|
t4 = /* @__PURE__ */ jsx(Fragment$1, { children: listRole && listRole !== "list" ? /* @__PURE__ */ jsxs(HeadingWrap, {
|
|
259
258
|
role: "presentation",
|
|
260
259
|
className: Group_module_css_default.GroupHeadingWrap,
|
|
@@ -266,7 +265,7 @@ const GroupHeadingImpl = (t0) => {
|
|
|
266
265
|
children: [/* @__PURE__ */ jsx("span", {
|
|
267
266
|
className: clsx(className, Group_module_css_default.GroupHeading),
|
|
268
267
|
id: groupHeadingId,
|
|
269
|
-
children:
|
|
268
|
+
children: _internalBackwardCompatibleTitle !== null && _internalBackwardCompatibleTitle !== void 0 ? _internalBackwardCompatibleTitle : headingChildren
|
|
270
269
|
}), auxiliaryText && /* @__PURE__ */ jsx("div", {
|
|
271
270
|
className: ActionList_module_css_default.Description,
|
|
272
271
|
children: auxiliaryText
|
|
@@ -283,7 +282,7 @@ const GroupHeadingImpl = (t0) => {
|
|
|
283
282
|
as: as || "h3",
|
|
284
283
|
id: groupHeadingId,
|
|
285
284
|
...props,
|
|
286
|
-
children:
|
|
285
|
+
children: _internalBackwardCompatibleTitle !== null && _internalBackwardCompatibleTitle !== void 0 ? _internalBackwardCompatibleTitle : headingChildren
|
|
287
286
|
}),
|
|
288
287
|
auxiliaryText && /* @__PURE__ */ jsx("div", {
|
|
289
288
|
className: ActionList_module_css_default.Description,
|
package/dist/ActionList/Item.js
CHANGED
|
@@ -138,7 +138,7 @@ const listRoleTypes = [
|
|
|
138
138
|
"tree"
|
|
139
139
|
];
|
|
140
140
|
const UnwrappedItem = (t0, forwardedRef) => {
|
|
141
|
-
var _slots$trailingVisual, _slots$description$pr, _slots$description, _slots$trailingAction
|
|
141
|
+
var _slots$trailingVisual, _slots$description$pr, _slots$description, _slots$trailingAction;
|
|
142
142
|
const $ = c(162);
|
|
143
143
|
let _PrivateItemWrapper;
|
|
144
144
|
let _PrivateTooltipText;
|
|
@@ -470,7 +470,7 @@ const UnwrappedItem = (t0, forwardedRef) => {
|
|
|
470
470
|
$[91] = className;
|
|
471
471
|
$[92] = t35;
|
|
472
472
|
} else t35 = $[92];
|
|
473
|
-
const t36 =
|
|
473
|
+
const t36 = _PrivateTooltipText !== null && _PrivateTooltipText !== void 0 ? _PrivateTooltipText : truncatedText;
|
|
474
474
|
const t37 = listSemantics ? null : forwardedRef;
|
|
475
475
|
let t38;
|
|
476
476
|
let t39;
|
package/dist/Banner/Banner.js
CHANGED
|
@@ -20,7 +20,6 @@ const iconForVariant = {
|
|
|
20
20
|
warning: /* @__PURE__ */ jsx(AlertIcon, {})
|
|
21
21
|
};
|
|
22
22
|
const Banner = /*#__PURE__*/ React.forwardRef(function Banner(t0, forwardRef) {
|
|
23
|
-
var _leadingVisual, _labelledBy;
|
|
24
23
|
const $ = c(64);
|
|
25
24
|
let children;
|
|
26
25
|
let className;
|
|
@@ -84,7 +83,7 @@ const Banner = /*#__PURE__*/ React.forwardRef(function Banner(t0, forwardRef) {
|
|
|
84
83
|
const ref = useMergedRefs(forwardRef, bannerRef);
|
|
85
84
|
const supportsCustomIcon = variant === "info" || variant === "upsell";
|
|
86
85
|
const titleId = useId$1();
|
|
87
|
-
const visual =
|
|
86
|
+
const visual = leadingVisual !== null && leadingVisual !== void 0 ? leadingVisual : icon;
|
|
88
87
|
let t4;
|
|
89
88
|
let t5;
|
|
90
89
|
if ($[17] !== title) {
|
|
@@ -109,7 +108,7 @@ const Banner = /*#__PURE__*/ React.forwardRef(function Banner(t0, forwardRef) {
|
|
|
109
108
|
$[20] = titleId;
|
|
110
109
|
$[21] = t6;
|
|
111
110
|
} else t6 = $[21];
|
|
112
|
-
const t7 =
|
|
111
|
+
const t7 = labelledBy !== null && labelledBy !== void 0 ? labelledBy : label ? void 0 : titleId;
|
|
113
112
|
const t8 = labelledBy ? void 0 : label;
|
|
114
113
|
let t9;
|
|
115
114
|
if ($[22] !== className) {
|
|
@@ -249,7 +248,6 @@ const Banner = /*#__PURE__*/ React.forwardRef(function Banner(t0, forwardRef) {
|
|
|
249
248
|
return t24;
|
|
250
249
|
});
|
|
251
250
|
function BannerTitle(props) {
|
|
252
|
-
var _id;
|
|
253
251
|
const $ = c(14);
|
|
254
252
|
let children;
|
|
255
253
|
let className;
|
|
@@ -273,7 +271,7 @@ function BannerTitle(props) {
|
|
|
273
271
|
}
|
|
274
272
|
const Heading = t0 === void 0 ? "h2" : t0;
|
|
275
273
|
const context = React.useContext(BannerContext);
|
|
276
|
-
const titleId =
|
|
274
|
+
const titleId = id !== null && id !== void 0 ? id : context === null || context === void 0 ? void 0 : context.titleId;
|
|
277
275
|
let t1;
|
|
278
276
|
if ($[6] !== className) {
|
|
279
277
|
t1 = clsx(className, Banner_module_css_default.BannerTitle);
|
|
@@ -10,7 +10,7 @@ import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
|
10
10
|
import React, { forwardRef } from "react";
|
|
11
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { clsx } from "clsx";
|
|
13
|
-
import { isElement } from "react-is";
|
|
13
|
+
import { isElement, isValidElementType } from "react-is";
|
|
14
14
|
//#region src/Button/ButtonBase.tsx
|
|
15
15
|
const BUTTON_LOADING_DISABLED_STYLES_FEATURE_FLAG = "primer_react_button_loading_disabled_styles";
|
|
16
16
|
const renderModuleVisual = (Visual, loading, visualName, counterLabel) => /* @__PURE__ */ jsx("span", {
|
|
@@ -18,6 +18,7 @@ const renderModuleVisual = (Visual, loading, visualName, counterLabel) => /* @__
|
|
|
18
18
|
className: clsx(!counterLabel && ButtonBase_module_css_default.Visual, visualName === "leadingVisual" && ButtonBase_module_css_default.LeadingVisual, loading ? ButtonBase_module_css_default.LoadingSpinner : ButtonBase_module_css_default.VisualWrap),
|
|
19
19
|
children: loading ? /* @__PURE__ */ jsx(Spinner, { size: "small" }) : isElement(Visual) ? Visual : /* @__PURE__ */ jsx(Visual, {})
|
|
20
20
|
});
|
|
21
|
+
const renderIcon = (icon) => isValidElementType(icon) && typeof icon !== "string" ? /*#__PURE__*/ React.createElement(icon) : icon;
|
|
21
22
|
const ButtonBase = /*#__PURE__*/ forwardRef(({ children, as: Component = "button", ...props }, forwardedRef) => {
|
|
22
23
|
const { leadingVisual: LeadingVisual, trailingVisual: TrailingVisual, trailingAction: TrailingAction, ["aria-describedby"]: ariaDescribedBy, ["aria-labelledby"]: ariaLabelledBy, count, icon: Icon, id, variant = "default", size = "medium", alignContent = "center", block = false, loading, loadingAnnouncement = "Loading", inactive, onClick, labelWrap, notificationIndicator, className, ...rest } = props;
|
|
23
24
|
const innerRef = React.useRef(null);
|
|
@@ -56,7 +57,7 @@ const ButtonBase = /*#__PURE__*/ forwardRef(({ children, as: Component = "button
|
|
|
56
57
|
"aria-labelledby": loading ? [`${uuid}-label`, ariaLabelledBy].filter((labelID) => Boolean(labelID)).join(" ") : ariaLabelledBy,
|
|
57
58
|
id,
|
|
58
59
|
onClick: loading ? void 0 : onClick,
|
|
59
|
-
children: Icon ? loading ? /* @__PURE__ */ jsx(Spinner, { size: "small" }) :
|
|
60
|
+
children: Icon !== void 0 && Icon !== null ? loading ? /* @__PURE__ */ jsx(Spinner, { size: "small" }) : renderIcon(Icon) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("span", {
|
|
60
61
|
"data-component": "buttonContent",
|
|
61
62
|
"data-align": alignContent,
|
|
62
63
|
className: ButtonBase_module_css_default.ButtonContent,
|
|
@@ -80,17 +80,16 @@ const IconButton = /*#__PURE__*/ forwardRef((t0, forwardedRef) => {
|
|
|
80
80
|
} else t3 = $[19];
|
|
81
81
|
return t3;
|
|
82
82
|
} else {
|
|
83
|
-
|
|
84
|
-
const tooltipText = (_description = description) !== null && _description !== void 0 ? _description : ariaLabel;
|
|
83
|
+
const tooltipText = description !== null && description !== void 0 ? description : ariaLabel;
|
|
85
84
|
const t2 = description ? void 0 : "label";
|
|
86
|
-
const t3 =
|
|
85
|
+
const t3 = keybindingHint !== null && keybindingHint !== void 0 ? keybindingHint : keyshortcuts;
|
|
87
86
|
let t4;
|
|
88
87
|
if ($[20] !== className) {
|
|
89
88
|
t4 = clsx(className, ButtonBase_module_css_default.IconButton);
|
|
90
89
|
$[20] = className;
|
|
91
90
|
$[21] = t4;
|
|
92
91
|
} else t4 = $[21];
|
|
93
|
-
const t5 =
|
|
92
|
+
const t5 = keyshortcuts !== null && keyshortcuts !== void 0 ? keyshortcuts : void 0;
|
|
94
93
|
const t6 = description ? ariaLabel : void 0;
|
|
95
94
|
let t7;
|
|
96
95
|
if ($[22] !== Icon || $[23] !== props || $[24] !== t4 || $[25] !== t5 || $[26] !== t6) {
|
package/dist/Button/types.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ type ButtonProps = {
|
|
|
56
56
|
/**
|
|
57
57
|
* The icon for the IconButton
|
|
58
58
|
*/
|
|
59
|
-
icon?: React.
|
|
59
|
+
icon?: React.ReactNode | React.ComponentType<IconProps> | React.ExoticComponent<IconProps>;
|
|
60
60
|
/**
|
|
61
61
|
* The leading visual which comes before the button content
|
|
62
62
|
*/
|
|
@@ -80,7 +80,7 @@ type ButtonProps = {
|
|
|
80
80
|
notificationIndicator?: ButtonNotificationIndicatorPlacement;
|
|
81
81
|
} & ButtonBaseProps;
|
|
82
82
|
type IconButtonProps = ButtonA11yProps & {
|
|
83
|
-
icon: React.
|
|
83
|
+
icon: React.ReactNode | React.ComponentType<IconProps> | React.ExoticComponent<IconProps>;
|
|
84
84
|
/**
|
|
85
85
|
* Displays a visual indicator for new activity on the button boundary or icon. Consumers are
|
|
86
86
|
* responsible for communicating the indicator's meaning through an accessible label or description.
|
package/dist/Card/Card.js
CHANGED
|
@@ -343,7 +343,6 @@ CardImage.displayName = "Card.Image";
|
|
|
343
343
|
* automatically wired to the section's `aria-labelledby`.
|
|
344
344
|
*/
|
|
345
345
|
const CardHeading = /*#__PURE__*/ forwardRef(function CardHeading(t0, ref) {
|
|
346
|
-
var _id;
|
|
347
346
|
const $ = c(15);
|
|
348
347
|
let children;
|
|
349
348
|
let className;
|
|
@@ -367,7 +366,7 @@ const CardHeading = /*#__PURE__*/ forwardRef(function CardHeading(t0, ref) {
|
|
|
367
366
|
}
|
|
368
367
|
const Component = t1 === void 0 ? "h3" : t1;
|
|
369
368
|
const { titleId } = useContext(CardContext);
|
|
370
|
-
const t2 =
|
|
369
|
+
const t2 = id !== null && id !== void 0 ? id : titleId;
|
|
371
370
|
let t3;
|
|
372
371
|
if ($[6] !== className) {
|
|
373
372
|
t3 = clsx(Card_module_css_default.CardHeading, className);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
1
2
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
2
3
|
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
3
4
|
import useIsomorphicLayoutEffect from "../utils/useIsomorphicLayoutEffect.js";
|
|
@@ -12,7 +13,46 @@ import { clsx } from "clsx";
|
|
|
12
13
|
/**
|
|
13
14
|
* An accessible, native checkbox component
|
|
14
15
|
*/
|
|
15
|
-
const Checkbox = /*#__PURE__*/ React.forwardRef((
|
|
16
|
+
const Checkbox = /*#__PURE__*/ React.forwardRef((t0, ref) => {
|
|
17
|
+
const $ = c(44);
|
|
18
|
+
let checked;
|
|
19
|
+
let className;
|
|
20
|
+
let dataComponent;
|
|
21
|
+
let defaultChecked;
|
|
22
|
+
let disabled;
|
|
23
|
+
let indeterminate;
|
|
24
|
+
let onChange;
|
|
25
|
+
let required;
|
|
26
|
+
let rest;
|
|
27
|
+
let validationStatus;
|
|
28
|
+
let value;
|
|
29
|
+
if ($[0] !== t0) {
|
|
30
|
+
({checked, className, defaultChecked, indeterminate, disabled, onChange, required, validationStatus, value, "data-component": dataComponent, ...rest} = t0);
|
|
31
|
+
$[0] = t0;
|
|
32
|
+
$[1] = checked;
|
|
33
|
+
$[2] = className;
|
|
34
|
+
$[3] = dataComponent;
|
|
35
|
+
$[4] = defaultChecked;
|
|
36
|
+
$[5] = disabled;
|
|
37
|
+
$[6] = indeterminate;
|
|
38
|
+
$[7] = onChange;
|
|
39
|
+
$[8] = required;
|
|
40
|
+
$[9] = rest;
|
|
41
|
+
$[10] = validationStatus;
|
|
42
|
+
$[11] = value;
|
|
43
|
+
} else {
|
|
44
|
+
checked = $[1];
|
|
45
|
+
className = $[2];
|
|
46
|
+
dataComponent = $[3];
|
|
47
|
+
defaultChecked = $[4];
|
|
48
|
+
disabled = $[5];
|
|
49
|
+
indeterminate = $[6];
|
|
50
|
+
onChange = $[7];
|
|
51
|
+
required = $[8];
|
|
52
|
+
rest = $[9];
|
|
53
|
+
validationStatus = $[10];
|
|
54
|
+
value = $[11];
|
|
55
|
+
}
|
|
16
56
|
const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
|
|
17
57
|
const checkboxRef = useRef(null);
|
|
18
58
|
const mergedRef = useMergedRefs(checkboxRef, ref);
|
|
@@ -20,46 +60,110 @@ const Checkbox = /*#__PURE__*/ React.forwardRef(({ checked, className, defaultCh
|
|
|
20
60
|
const readRef = mergedRefEnabled ? checkboxRef : providedOrCreatedRef;
|
|
21
61
|
const appliedRef = mergedRefEnabled ? mergedRef : providedOrCreatedRef;
|
|
22
62
|
const checkboxGroupContext = useContext(CheckboxGroupContext);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
readRef.current
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
let t1;
|
|
64
|
+
if ($[12] !== checkboxGroupContext || $[13] !== indeterminate || $[14] !== onChange || $[15] !== readRef.current) {
|
|
65
|
+
t1 = (e) => {
|
|
66
|
+
checkboxGroupContext.onChange && checkboxGroupContext.onChange(e);
|
|
67
|
+
onChange && onChange(e);
|
|
68
|
+
if (indeterminate && readRef.current) {
|
|
69
|
+
readRef.current.indeterminate = true;
|
|
70
|
+
readRef.current.setAttribute("aria-checked", "mixed");
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
$[12] = checkboxGroupContext;
|
|
74
|
+
$[13] = indeterminate;
|
|
75
|
+
$[14] = onChange;
|
|
76
|
+
$[15] = readRef.current;
|
|
77
|
+
$[16] = t1;
|
|
78
|
+
} else t1 = $[16];
|
|
79
|
+
const handleOnChange = t1;
|
|
80
|
+
const t2 = indeterminate ? false : checked;
|
|
81
|
+
const t3 = required ? "true" : "false";
|
|
82
|
+
const t4 = validationStatus === "error" ? "true" : "false";
|
|
83
|
+
let t5;
|
|
84
|
+
if ($[17] !== appliedRef || $[18] !== defaultChecked || $[19] !== disabled || $[20] !== handleOnChange || $[21] !== required || $[22] !== rest || $[23] !== t2 || $[24] !== t3 || $[25] !== t4 || $[26] !== value) {
|
|
85
|
+
t5 = {
|
|
86
|
+
type: "checkbox",
|
|
87
|
+
disabled,
|
|
88
|
+
ref: appliedRef,
|
|
89
|
+
checked: t2,
|
|
90
|
+
defaultChecked,
|
|
91
|
+
required,
|
|
92
|
+
"aria-required": t3,
|
|
93
|
+
"aria-invalid": t4,
|
|
94
|
+
onChange: handleOnChange,
|
|
95
|
+
value,
|
|
96
|
+
name: value,
|
|
97
|
+
...rest
|
|
98
|
+
};
|
|
99
|
+
$[17] = appliedRef;
|
|
100
|
+
$[18] = defaultChecked;
|
|
101
|
+
$[19] = disabled;
|
|
102
|
+
$[20] = handleOnChange;
|
|
103
|
+
$[21] = required;
|
|
104
|
+
$[22] = rest;
|
|
105
|
+
$[23] = t2;
|
|
106
|
+
$[24] = t3;
|
|
107
|
+
$[25] = t4;
|
|
108
|
+
$[26] = value;
|
|
109
|
+
$[27] = t5;
|
|
110
|
+
} else t5 = $[27];
|
|
111
|
+
const inputProps = t5;
|
|
112
|
+
let t6;
|
|
113
|
+
if ($[28] !== indeterminate || $[29] !== readRef.current) {
|
|
114
|
+
t6 = () => {
|
|
115
|
+
if (readRef.current) readRef.current.indeterminate = indeterminate || false;
|
|
116
|
+
};
|
|
117
|
+
$[28] = indeterminate;
|
|
118
|
+
$[29] = readRef.current;
|
|
119
|
+
$[30] = t6;
|
|
120
|
+
} else t6 = $[30];
|
|
121
|
+
let t7;
|
|
122
|
+
if ($[31] !== checked || $[32] !== indeterminate || $[33] !== readRef) {
|
|
123
|
+
t7 = [
|
|
124
|
+
indeterminate,
|
|
125
|
+
checked,
|
|
126
|
+
readRef
|
|
127
|
+
];
|
|
128
|
+
$[31] = checked;
|
|
129
|
+
$[32] = indeterminate;
|
|
130
|
+
$[33] = readRef;
|
|
131
|
+
$[34] = t7;
|
|
132
|
+
} else t7 = $[34];
|
|
133
|
+
useIsomorphicLayoutEffect(t6, t7);
|
|
134
|
+
let t8;
|
|
135
|
+
if ($[35] !== indeterminate || $[36] !== readRef) {
|
|
136
|
+
t8 = () => {
|
|
137
|
+
const { current: checkbox } = readRef;
|
|
138
|
+
if (!checkbox) return;
|
|
139
|
+
if (indeterminate) checkbox.setAttribute("aria-checked", "mixed");
|
|
140
|
+
else checkbox.setAttribute("aria-checked", checkbox.checked ? "true" : "false");
|
|
141
|
+
};
|
|
142
|
+
$[35] = indeterminate;
|
|
143
|
+
$[36] = readRef;
|
|
144
|
+
$[37] = t8;
|
|
145
|
+
} else t8 = $[37];
|
|
146
|
+
useEffect(t8);
|
|
147
|
+
const t9 = dataComponent !== null && dataComponent !== void 0 ? dataComponent : "Checkbox";
|
|
148
|
+
let t10;
|
|
149
|
+
if ($[38] !== className) {
|
|
150
|
+
t10 = clsx(className, shared_module_css_default.Input, Checkbox_module_css_default.Checkbox);
|
|
151
|
+
$[38] = className;
|
|
152
|
+
$[39] = t10;
|
|
153
|
+
} else t10 = $[39];
|
|
154
|
+
let t11;
|
|
155
|
+
if ($[40] !== inputProps || $[41] !== t10 || $[42] !== t9) {
|
|
156
|
+
t11 = /* @__PURE__ */ jsx("input", {
|
|
157
|
+
...inputProps,
|
|
158
|
+
"data-component": t9,
|
|
159
|
+
className: t10
|
|
160
|
+
});
|
|
161
|
+
$[40] = inputProps;
|
|
162
|
+
$[41] = t10;
|
|
163
|
+
$[42] = t9;
|
|
164
|
+
$[43] = t11;
|
|
165
|
+
} else t11 = $[43];
|
|
166
|
+
return t11;
|
|
63
167
|
});
|
|
64
168
|
Checkbox.displayName = "Checkbox";
|
|
65
169
|
Checkbox.__SLOT__ = Symbol("Checkbox");
|
|
@@ -1,28 +1,90 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
1
2
|
import { VisuallyHidden } from "../VisuallyHidden/VisuallyHidden.js";
|
|
2
3
|
import CounterLabel_module_css_default from "./CounterLabel.module.css.js";
|
|
3
4
|
import { forwardRef } from "react";
|
|
4
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { clsx } from "clsx";
|
|
6
7
|
//#region src/CounterLabel/CounterLabel.tsx
|
|
7
|
-
const CounterLabel = /*#__PURE__*/ forwardRef((
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const CounterLabel = /*#__PURE__*/ forwardRef((t0, forwardedRef) => {
|
|
9
|
+
const $ = c(23);
|
|
10
|
+
let children;
|
|
11
|
+
let className;
|
|
12
|
+
let dataComponent;
|
|
13
|
+
let rest;
|
|
14
|
+
let scheme;
|
|
15
|
+
let variant;
|
|
16
|
+
if ($[0] !== t0) {
|
|
17
|
+
({variant, scheme, className, children, "data-component": dataComponent, ...rest} = t0);
|
|
18
|
+
$[0] = t0;
|
|
19
|
+
$[1] = children;
|
|
20
|
+
$[2] = className;
|
|
21
|
+
$[3] = dataComponent;
|
|
22
|
+
$[4] = rest;
|
|
23
|
+
$[5] = scheme;
|
|
24
|
+
$[6] = variant;
|
|
25
|
+
} else {
|
|
26
|
+
children = $[1];
|
|
27
|
+
className = $[2];
|
|
28
|
+
dataComponent = $[3];
|
|
29
|
+
rest = $[4];
|
|
30
|
+
scheme = $[5];
|
|
31
|
+
variant = $[6];
|
|
32
|
+
}
|
|
33
|
+
let t1;
|
|
34
|
+
if ($[7] !== children) {
|
|
35
|
+
t1 = /* @__PURE__ */ jsxs(VisuallyHidden, { children: [
|
|
36
|
+
"\xA0(",
|
|
37
|
+
children,
|
|
38
|
+
")"
|
|
39
|
+
] });
|
|
40
|
+
$[7] = children;
|
|
41
|
+
$[8] = t1;
|
|
42
|
+
} else t1 = $[8];
|
|
43
|
+
const label = t1;
|
|
13
44
|
const inferredVariant = variant || scheme || "secondary";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
45
|
+
let t2;
|
|
46
|
+
if ($[9] !== forwardedRef || $[10] !== inferredVariant || $[11] !== rest) {
|
|
47
|
+
t2 = {
|
|
48
|
+
ref: forwardedRef,
|
|
49
|
+
"aria-hidden": "true",
|
|
50
|
+
"data-variant": inferredVariant,
|
|
51
|
+
...rest
|
|
52
|
+
};
|
|
53
|
+
$[9] = forwardedRef;
|
|
54
|
+
$[10] = inferredVariant;
|
|
55
|
+
$[11] = rest;
|
|
56
|
+
$[12] = t2;
|
|
57
|
+
} else t2 = $[12];
|
|
58
|
+
const counterProps = t2;
|
|
59
|
+
const t3 = dataComponent !== null && dataComponent !== void 0 ? dataComponent : "CounterLabel";
|
|
60
|
+
let t4;
|
|
61
|
+
if ($[13] !== className) {
|
|
62
|
+
t4 = clsx(className, CounterLabel_module_css_default.CounterLabel);
|
|
63
|
+
$[13] = className;
|
|
64
|
+
$[14] = t4;
|
|
65
|
+
} else t4 = $[14];
|
|
66
|
+
let t5;
|
|
67
|
+
if ($[15] !== children || $[16] !== counterProps || $[17] !== t3 || $[18] !== t4) {
|
|
68
|
+
t5 = /* @__PURE__ */ jsx("span", {
|
|
69
|
+
...counterProps,
|
|
70
|
+
"data-component": t3,
|
|
71
|
+
className: t4,
|
|
72
|
+
children
|
|
73
|
+
});
|
|
74
|
+
$[15] = children;
|
|
75
|
+
$[16] = counterProps;
|
|
76
|
+
$[17] = t3;
|
|
77
|
+
$[18] = t4;
|
|
78
|
+
$[19] = t5;
|
|
79
|
+
} else t5 = $[19];
|
|
80
|
+
let t6;
|
|
81
|
+
if ($[20] !== label || $[21] !== t5) {
|
|
82
|
+
t6 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t5, label] });
|
|
83
|
+
$[20] = label;
|
|
84
|
+
$[21] = t5;
|
|
85
|
+
$[22] = t6;
|
|
86
|
+
} else t6 = $[22];
|
|
87
|
+
return t6;
|
|
26
88
|
});
|
|
27
89
|
CounterLabel.displayName = "CounterLabel";
|
|
28
90
|
//#endregion
|
package/dist/Details/Details.js
CHANGED
|
@@ -7,7 +7,6 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import { clsx } from "clsx";
|
|
8
8
|
//#region src/Details/Details.tsx
|
|
9
9
|
const Root = /*#__PURE__*/ React.forwardRef((t0, forwardRef) => {
|
|
10
|
-
var _dataComponent;
|
|
11
10
|
const $ = c(15);
|
|
12
11
|
let children;
|
|
13
12
|
let className;
|
|
@@ -51,7 +50,7 @@ const Root = /*#__PURE__*/ React.forwardRef((t0, forwardRef) => {
|
|
|
51
50
|
$[7] = className;
|
|
52
51
|
$[8] = t3;
|
|
53
52
|
} else t3 = $[8];
|
|
54
|
-
const t4 =
|
|
53
|
+
const t4 = dataComponent !== null && dataComponent !== void 0 ? dataComponent : "Details";
|
|
55
54
|
let t5;
|
|
56
55
|
if ($[9] !== children || $[10] !== ref || $[11] !== rest || $[12] !== t3 || $[13] !== t4) {
|
|
57
56
|
t5 = /* @__PURE__ */ jsx("details", {
|
|
@@ -72,7 +71,6 @@ const Root = /*#__PURE__*/ React.forwardRef((t0, forwardRef) => {
|
|
|
72
71
|
});
|
|
73
72
|
Root.displayName = "Details";
|
|
74
73
|
function Summary(t0) {
|
|
75
|
-
var _as;
|
|
76
74
|
const $ = c(9);
|
|
77
75
|
let as;
|
|
78
76
|
let children;
|
|
@@ -88,7 +86,7 @@ function Summary(t0) {
|
|
|
88
86
|
children = $[2];
|
|
89
87
|
props = $[3];
|
|
90
88
|
}
|
|
91
|
-
const Component =
|
|
89
|
+
const Component = as !== null && as !== void 0 ? as : "summary";
|
|
92
90
|
const t1 = Component === "summary" ? null : "summary";
|
|
93
91
|
let t2;
|
|
94
92
|
if ($[4] !== Component || $[5] !== children || $[6] !== props || $[7] !== t1) {
|
|
@@ -9,6 +9,7 @@ var FeatureFlagScope = class FeatureFlagScope {
|
|
|
9
9
|
for (const [key, value] of b.flags) merged.flags.set(key, value);
|
|
10
10
|
return merged;
|
|
11
11
|
}
|
|
12
|
+
flags;
|
|
12
13
|
constructor(flags = {}) {
|
|
13
14
|
this.flags = /* @__PURE__ */ new Map();
|
|
14
15
|
for (const [key, value] of Object.entries(flags)) this.flags.set(key, value !== null && value !== void 0 ? value : false);
|