@primer/react 38.42.0-rc.68e6f6ecb → 38.42.0-rc.7ee8d8fea
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 +8 -0
- package/dist/ActionBar/ActionBar.js +9 -7
- 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/Details/Details.js +2 -4
- package/dist/FeatureFlags/FeatureFlagScope.js +1 -0
- package/dist/FilteredActionList/constants.js +2 -0
- 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/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/Textarea/Textarea.d.ts +2 -2
- package/dist/ToggleSwitch/ToggleSwitch.js +2 -3
- package/dist/TopicTag/TopicTag.js +1 -2
- 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/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 +22 -20
- package/package.json +11 -12
package/CHANGELOG.md
CHANGED
|
@@ -6,8 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
- [#8513](https://github.com/primer/react/pull/8513) [`1bab81a`](https://github.com/primer/react/commit/1bab81a0eb3f613c8d6b4abd36bd92d0ac6cedc4) Thanks [@tay1orjones](https://github.com/tay1orjones)! - ActionMenu, Overlay: Add `preventFocusOnClose` to let consumers manage focus when an overlay closes.
|
|
8
8
|
|
|
9
|
+
- [#8525](https://github.com/primer/react/pull/8525) [`013ab30`](https://github.com/primer/react/commit/013ab3078785ee90afe8a7562576fe0a26001b96) Thanks [@tay1orjones](https://github.com/tay1orjones)! - TextInput and Textarea: Deprecate the `contrast` prop. Omit it to use the default background.
|
|
10
|
+
|
|
11
|
+
- [#8450](https://github.com/primer/react/pull/8450) [`1528a48`](https://github.com/primer/react/commit/1528a483f9efa41fdb4bea7793c49bcde6fb4220) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - IconButton, ActionBar: Accept React nodes and icon components
|
|
12
|
+
|
|
9
13
|
- [#8415](https://github.com/primer/react/pull/8415) [`66a9f31`](https://github.com/primer/react/commit/66a9f31611c642209f66ed68b7d43712b09dbd88) Thanks [@rickyzhangca](https://github.com/rickyzhangca)! - DataTable: Add controlled and uncontrolled row selection.
|
|
10
14
|
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#8508](https://github.com/primer/react/pull/8508) [`f71dce4`](https://github.com/primer/react/commit/f71dce4869dedf4cb8460ed2fa8e18edc0604198) Thanks [@namangoyal176-10](https://github.com/namangoyal176-10)! - FormControl: Prevent duplicate input rendering when layout is horizontal with non-choice inputs
|
|
18
|
+
|
|
11
19
|
## 38.41.0
|
|
12
20
|
|
|
13
21
|
### Minor Changes
|
|
@@ -11,8 +11,10 @@ import ActionBar_module_css_default from "./ActionBar.module.css.js";
|
|
|
11
11
|
import React, { forwardRef, useCallback, useContext, useMemo, useRef, useState } from "react";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { clsx } from "clsx";
|
|
14
|
+
import { isValidElementType } from "react-is";
|
|
14
15
|
import { KebabHorizontalIcon } from "@primer/octicons-react";
|
|
15
16
|
//#region src/ActionBar/ActionBar.tsx
|
|
17
|
+
const renderIcon = (icon) => isValidElementType(icon) && typeof icon !== "string" ? /*#__PURE__*/ React.createElement(icon) : icon;
|
|
16
18
|
const ActionBarContext = /*#__PURE__*/ React.createContext({ size: "medium" });
|
|
17
19
|
const ActionBarItemsRegistry = createDescendantRegistry();
|
|
18
20
|
const FOCUSABLE_ITEM_SELECTOR = ":is(button, a, input, [tabindex]):not(:disabled):not([data-overflowing]):not([data-more-button-inactive])";
|
|
@@ -23,9 +25,9 @@ const renderMenuItem = (item, index) => {
|
|
|
23
25
|
disabled,
|
|
24
26
|
variant,
|
|
25
27
|
children: [
|
|
26
|
-
LeadingIcon ? /* @__PURE__ */ jsx(ActionList.LeadingVisual, { children:
|
|
28
|
+
LeadingIcon !== void 0 && LeadingIcon !== null ? /* @__PURE__ */ jsx(ActionList.LeadingVisual, { children: renderIcon(LeadingIcon) }) : null,
|
|
27
29
|
label,
|
|
28
|
-
TrailingIcon ? /* @__PURE__ */ jsx(ActionList.TrailingVisual, { children: typeof TrailingIcon === "string" ? /* @__PURE__ */ jsx("span", { children: TrailingIcon }) :
|
|
30
|
+
TrailingIcon !== void 0 && TrailingIcon !== null ? /* @__PURE__ */ jsx(ActionList.TrailingVisual, { children: typeof TrailingIcon === "string" ? /* @__PURE__ */ jsx("span", { children: TrailingIcon }) : renderIcon(TrailingIcon) }) : null
|
|
29
31
|
]
|
|
30
32
|
}) }), /* @__PURE__ */ jsx(ActionMenu.Overlay, { children: /* @__PURE__ */ jsx(ActionList, { children: items.map((subItem, subIndex) => renderMenuItem(subItem, subIndex)) }) })] }, label);
|
|
31
33
|
return /* @__PURE__ */ jsxs(ActionList.Item, {
|
|
@@ -33,9 +35,9 @@ const renderMenuItem = (item, index) => {
|
|
|
33
35
|
disabled,
|
|
34
36
|
variant,
|
|
35
37
|
children: [
|
|
36
|
-
LeadingIcon ? /* @__PURE__ */ jsx(ActionList.LeadingVisual, { children:
|
|
38
|
+
LeadingIcon !== void 0 && LeadingIcon !== null ? /* @__PURE__ */ jsx(ActionList.LeadingVisual, { children: renderIcon(LeadingIcon) }) : null,
|
|
37
39
|
label,
|
|
38
|
-
TrailingIcon ? /* @__PURE__ */ jsx(ActionList.TrailingVisual, { children: typeof TrailingIcon === "string" ? /* @__PURE__ */ jsx("span", { children: TrailingIcon }) :
|
|
40
|
+
TrailingIcon !== void 0 && TrailingIcon !== null ? /* @__PURE__ */ jsx(ActionList.TrailingVisual, { children: typeof TrailingIcon === "string" ? /* @__PURE__ */ jsx("span", { children: TrailingIcon }) : renderIcon(TrailingIcon) }) : null
|
|
39
41
|
]
|
|
40
42
|
}, label);
|
|
41
43
|
};
|
|
@@ -87,13 +89,13 @@ const ActionBar = ({ size = "medium", children, "aria-label": ariaLabel, "aria-l
|
|
|
87
89
|
typeof onClick === "function" && onClick(event);
|
|
88
90
|
},
|
|
89
91
|
disabled,
|
|
90
|
-
children: [Icon ? /* @__PURE__ */ jsx(ActionList.LeadingVisual, { children:
|
|
92
|
+
children: [Icon !== void 0 && Icon !== null ? /* @__PURE__ */ jsx(ActionList.LeadingVisual, { children: renderIcon(Icon) }) : null, label]
|
|
91
93
|
}, id);
|
|
92
94
|
}
|
|
93
95
|
if (menuItem.type === "menu") {
|
|
94
96
|
const menuItems = menuItem.items;
|
|
95
97
|
const { icon: Icon, label, returnFocusRef } = menuItem;
|
|
96
|
-
return /* @__PURE__ */ jsxs(ActionMenu, { children: [/* @__PURE__ */ jsx(ActionMenu.Anchor, { children: /* @__PURE__ */ jsxs(ActionList.Item, { children: [Icon !== "none" ? /* @__PURE__ */ jsx(ActionList.LeadingVisual, { children:
|
|
98
|
+
return /* @__PURE__ */ jsxs(ActionMenu, { children: [/* @__PURE__ */ jsx(ActionMenu.Anchor, { children: /* @__PURE__ */ jsxs(ActionList.Item, { children: [Icon !== "none" ? /* @__PURE__ */ jsx(ActionList.LeadingVisual, { children: renderIcon(Icon) }) : null, label] }) }), /* @__PURE__ */ jsx(ActionMenu.Overlay, {
|
|
97
99
|
...returnFocusRef && { returnFocusRef },
|
|
98
100
|
children: /* @__PURE__ */ jsx(ActionList, { children: menuItems.map((item, index) => renderMenuItem(item, index)) })
|
|
99
101
|
})] }, id);
|
|
@@ -199,7 +201,7 @@ const ActionBarMenu = /*#__PURE__*/ forwardRef(({ "aria-label": ariaLabel, icon,
|
|
|
199
201
|
const { dataOverflowingAttr } = useActionBarItem(ref, useMemo(() => ({
|
|
200
202
|
type: "menu",
|
|
201
203
|
label: ariaLabel,
|
|
202
|
-
icon: overflowIcon ? overflowIcon : icon,
|
|
204
|
+
icon: overflowIcon !== void 0 ? overflowIcon : icon,
|
|
203
205
|
returnFocusRef,
|
|
204
206
|
items
|
|
205
207
|
}), [
|
|
@@ -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);
|
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);
|
|
@@ -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;
|
|
@@ -285,14 +285,14 @@ function usePaneWidth(t0) {
|
|
|
285
285
|
if (isResizing) return;
|
|
286
286
|
isResizing = true;
|
|
287
287
|
(_paneRef$current4 = paneRef.current) === null || _paneRef$current4 === void 0 || _paneRef$current4.setAttribute("data-dragging", "true");
|
|
288
|
-
contentWrapperRef === null || contentWrapperRef === void 0 || (_contentWrapperRef$cu = contentWrapperRef.current)
|
|
288
|
+
contentWrapperRef === null || contentWrapperRef === void 0 || (_contentWrapperRef$cu = contentWrapperRef.current) === null || _contentWrapperRef$cu === void 0 || _contentWrapperRef$cu.setAttribute("data-dragging", "true");
|
|
289
289
|
};
|
|
290
290
|
const endResizeOptimizations = () => {
|
|
291
291
|
var _paneRef$current5, _contentWrapperRef$cu2;
|
|
292
292
|
if (!isResizing) return;
|
|
293
293
|
isResizing = false;
|
|
294
294
|
(_paneRef$current5 = paneRef.current) === null || _paneRef$current5 === void 0 || _paneRef$current5.removeAttribute("data-dragging");
|
|
295
|
-
contentWrapperRef === null || contentWrapperRef === void 0 || (_contentWrapperRef$cu2 = contentWrapperRef.current)
|
|
295
|
+
contentWrapperRef === null || contentWrapperRef === void 0 || (_contentWrapperRef$cu2 = contentWrapperRef.current) === null || _contentWrapperRef$cu2 === void 0 || _contentWrapperRef$cu2.removeAttribute("data-dragging");
|
|
296
296
|
};
|
|
297
297
|
const handleResize = () => {
|
|
298
298
|
startResizeOptimizations();
|
package/dist/Popover/Popover.js
CHANGED
|
@@ -9,7 +9,6 @@ import { clsx } from "clsx";
|
|
|
9
9
|
const EMPTY_IGNORE_CLICK_REFS = [];
|
|
10
10
|
const PopoverContext = /*#__PURE__*/ React.createContext(false);
|
|
11
11
|
const Popover = /*#__PURE__*/ React.forwardRef(function Popover(t0, forwardRef) {
|
|
12
|
-
var _open;
|
|
13
12
|
const $ = c(18);
|
|
14
13
|
let className;
|
|
15
14
|
let open;
|
|
@@ -32,7 +31,7 @@ const Popover = /*#__PURE__*/ React.forwardRef(function Popover(t0, forwardRef)
|
|
|
32
31
|
t1 = $[5];
|
|
33
32
|
}
|
|
34
33
|
const caret = t1 === void 0 ? "top" : t1;
|
|
35
|
-
const t2 =
|
|
34
|
+
const t2 = open !== null && open !== void 0 ? open : false;
|
|
36
35
|
const t3 = open ? "" : void 0;
|
|
37
36
|
const t4 = relative ? "" : void 0;
|
|
38
37
|
let t5;
|
|
@@ -74,7 +73,6 @@ const Popover = /*#__PURE__*/ React.forwardRef(function Popover(t0, forwardRef)
|
|
|
74
73
|
});
|
|
75
74
|
Popover.displayName = "Popover";
|
|
76
75
|
const PopoverContent = (t0) => {
|
|
77
|
-
var _onClickOutside, _ignoreClickRefs;
|
|
78
76
|
const $ = c(22);
|
|
79
77
|
let className;
|
|
80
78
|
let ignoreClickRefs;
|
|
@@ -106,8 +104,8 @@ const PopoverContent = (t0) => {
|
|
|
106
104
|
const height = t2 === void 0 ? "fit-content" : t2;
|
|
107
105
|
const divRef = useRef(null);
|
|
108
106
|
const open = React.useContext(PopoverContext);
|
|
109
|
-
const outsideClickHandler =
|
|
110
|
-
const t3 =
|
|
107
|
+
const outsideClickHandler = onClickOutside !== null && onClickOutside !== void 0 ? onClickOutside : _temp;
|
|
108
|
+
const t3 = ignoreClickRefs !== null && ignoreClickRefs !== void 0 ? ignoreClickRefs : EMPTY_IGNORE_CLICK_REFS;
|
|
111
109
|
let t4;
|
|
112
110
|
if ($[8] !== outsideClickHandler || $[9] !== t3) {
|
|
113
111
|
t4 = {
|
|
@@ -38,8 +38,7 @@ const Item = /*#__PURE__*/ forwardRef((t0, forwardRef) => {
|
|
|
38
38
|
const progressAsNumber = typeof progress === "string" ? parseInt(progress, 10) : progress;
|
|
39
39
|
let t1;
|
|
40
40
|
if ($[9] !== ariaValueNow || $[10] !== progressAsNumber) {
|
|
41
|
-
|
|
42
|
-
t1 = (_ariaValueNow = ariaValueNow) !== null && _ariaValueNow !== void 0 ? _ariaValueNow : progressAsNumber !== void 0 && progressAsNumber >= 0 ? Math.round(progressAsNumber) : 0;
|
|
41
|
+
t1 = ariaValueNow !== null && ariaValueNow !== void 0 ? ariaValueNow : progressAsNumber !== void 0 && progressAsNumber >= 0 ? Math.round(progressAsNumber) : 0;
|
|
43
42
|
$[9] = ariaValueNow;
|
|
44
43
|
$[10] = progressAsNumber;
|
|
45
44
|
$[11] = t1;
|
|
@@ -6,7 +6,6 @@ import { clsx } from "clsx";
|
|
|
6
6
|
import { isElement } from "react-is";
|
|
7
7
|
//#region src/SegmentedControl/SegmentedControlButton.tsx
|
|
8
8
|
const SegmentedControlButton = (t0) => {
|
|
9
|
-
var _leadingVisual;
|
|
10
9
|
const $ = c(36);
|
|
11
10
|
let children;
|
|
12
11
|
let className;
|
|
@@ -56,7 +55,7 @@ const SegmentedControlButton = (t0) => {
|
|
|
56
55
|
ariaDisabled = $[10];
|
|
57
56
|
rest = $[11];
|
|
58
57
|
}
|
|
59
|
-
const LeadingVisual =
|
|
58
|
+
const LeadingVisual = leadingVisual !== null && leadingVisual !== void 0 ? leadingVisual : leadingIcon;
|
|
60
59
|
let t1;
|
|
61
60
|
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
62
61
|
t1 = clsx(SegmentedControl_module_css_default.Item);
|
package/dist/Select/Select.js
CHANGED
|
@@ -47,7 +47,7 @@ const ArrowIndicator = (t0) => {
|
|
|
47
47
|
return t2;
|
|
48
48
|
};
|
|
49
49
|
const Select = /*#__PURE__*/ React.forwardRef((t0, ref) => {
|
|
50
|
-
var _ref
|
|
50
|
+
var _ref;
|
|
51
51
|
const $ = c(37);
|
|
52
52
|
let block;
|
|
53
53
|
let children;
|
|
@@ -99,7 +99,7 @@ const Select = /*#__PURE__*/ React.forwardRef((t0, ref) => {
|
|
|
99
99
|
$[14] = t4;
|
|
100
100
|
} else t4 = $[14];
|
|
101
101
|
const t5 = Boolean(placeholder);
|
|
102
|
-
const t6 = (_ref =
|
|
102
|
+
const t6 = (_ref = defaultValue !== null && defaultValue !== void 0 ? defaultValue : placeholder) !== null && _ref !== void 0 ? _ref : void 0;
|
|
103
103
|
let t7;
|
|
104
104
|
if ($[15] !== placeholder || $[16] !== required) {
|
|
105
105
|
t7 = placeholder && /* @__PURE__ */ jsx("option", {
|
|
@@ -112,7 +112,7 @@ declare const SelectPanel: typeof Panel & {
|
|
|
112
112
|
SecondaryActionButton: React.FC<ButtonProps>;
|
|
113
113
|
SecondaryActionLink: React.FC<LinkButtonProps & {
|
|
114
114
|
alignContent?: AlignContent;
|
|
115
|
-
icon?: React.
|
|
115
|
+
icon?: React.ReactNode | React.ComponentType<IconProps> | React.ExoticComponent<IconProps>;
|
|
116
116
|
leadingVisual?: React.ElementType | React.ReactElement<any> | null;
|
|
117
117
|
trailingVisual?: React.ElementType | React.ReactElement<any> | null;
|
|
118
118
|
trailingAction?: React.ElementType | null;
|
|
@@ -427,7 +427,7 @@ function Panel({ open, onOpenChange, renderAnchor = defaultRenderAnchor, anchorR
|
|
|
427
427
|
} : void 0, "anchored");
|
|
428
428
|
const preventBubbling = useCallback((event) => {
|
|
429
429
|
var _overlayProps$onKeyDo;
|
|
430
|
-
overlayProps === null || overlayProps === void 0 || (_overlayProps$onKeyDo = overlayProps.onKeyDown)
|
|
430
|
+
overlayProps === null || overlayProps === void 0 || (_overlayProps$onKeyDo = overlayProps.onKeyDown) === null || _overlayProps$onKeyDo === void 0 || _overlayProps$onKeyDo.call(overlayProps, event);
|
|
431
431
|
const activeElement = document.activeElement;
|
|
432
432
|
if (activeElement.tagName === "INPUT" || activeElement.tagName === "TEXTAREA") return;
|
|
433
433
|
if (event.ctrlKey || event.altKey || event.metaKey) return;
|
package/dist/Spinner/Spinner.js
CHANGED
|
@@ -14,7 +14,6 @@ const sizeMap = {
|
|
|
14
14
|
large: "64px"
|
|
15
15
|
};
|
|
16
16
|
function Spinner(t0) {
|
|
17
|
-
var _ariaLabel;
|
|
18
17
|
const $ = c(35);
|
|
19
18
|
let ariaLabel;
|
|
20
19
|
let className;
|
|
@@ -96,7 +95,7 @@ function Spinner(t0) {
|
|
|
96
95
|
$[16] = t8;
|
|
97
96
|
} else t8 = $[16];
|
|
98
97
|
const mergedStyle = t8;
|
|
99
|
-
const t9 =
|
|
98
|
+
const t9 = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : void 0;
|
|
100
99
|
const t10 = hasHiddenLabel ? labelId : void 0;
|
|
101
100
|
let t11;
|
|
102
101
|
if ($[17] !== className) {
|
|
@@ -25,7 +25,7 @@ type TextareaProps = {
|
|
|
25
25
|
*/
|
|
26
26
|
autoSize?: boolean;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* @deprecated Omit this prop to use the default background.
|
|
29
29
|
*/
|
|
30
30
|
contrast?: boolean;
|
|
31
31
|
/**
|
|
@@ -76,7 +76,7 @@ declare const Textarea: React.ForwardRefExoticComponent<{
|
|
|
76
76
|
*/
|
|
77
77
|
autoSize?: boolean;
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* @deprecated Omit this prop to use the default background.
|
|
80
80
|
*/
|
|
81
81
|
contrast?: boolean;
|
|
82
82
|
/**
|
|
@@ -71,7 +71,6 @@ const LineIcon = (t0) => {
|
|
|
71
71
|
return t4;
|
|
72
72
|
};
|
|
73
73
|
const ToggleSwitch = /*#__PURE__*/ React.forwardRef(function ToggleSwitch(props, ref) {
|
|
74
|
-
var _buttonLabelOn, _buttonLabelOff;
|
|
75
74
|
const $ = c(90);
|
|
76
75
|
let ariaDescribedby;
|
|
77
76
|
let ariaLabelledby;
|
|
@@ -222,7 +221,7 @@ const ToggleSwitch = /*#__PURE__*/ React.forwardRef(function ToggleSwitch(props,
|
|
|
222
221
|
} else t11 = $[39];
|
|
223
222
|
const t12 = !acceptsInteraction;
|
|
224
223
|
const t13 = !isOn;
|
|
225
|
-
const t14 =
|
|
224
|
+
const t14 = buttonLabelOn !== null && buttonLabelOn !== void 0 ? buttonLabelOn : "On";
|
|
226
225
|
let t15;
|
|
227
226
|
if ($[40] !== t13 || $[41] !== t14) {
|
|
228
227
|
t15 = /* @__PURE__ */ jsx("span", {
|
|
@@ -234,7 +233,7 @@ const ToggleSwitch = /*#__PURE__*/ React.forwardRef(function ToggleSwitch(props,
|
|
|
234
233
|
$[41] = t14;
|
|
235
234
|
$[42] = t15;
|
|
236
235
|
} else t15 = $[42];
|
|
237
|
-
const t16 =
|
|
236
|
+
const t16 = buttonLabelOff !== null && buttonLabelOff !== void 0 ? buttonLabelOff : "Off";
|
|
238
237
|
let t17;
|
|
239
238
|
if ($[43] !== isOn || $[44] !== t16) {
|
|
240
239
|
t17 = /* @__PURE__ */ jsx("span", {
|
|
@@ -4,7 +4,6 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
import { clsx } from "clsx";
|
|
5
5
|
//#region src/TopicTag/TopicTag.tsx
|
|
6
6
|
function TopicTag(t0) {
|
|
7
|
-
var _as;
|
|
8
7
|
const $ = c(12);
|
|
9
8
|
let as;
|
|
10
9
|
let children;
|
|
@@ -23,7 +22,7 @@ function TopicTag(t0) {
|
|
|
23
22
|
className = $[3];
|
|
24
23
|
rest = $[4];
|
|
25
24
|
}
|
|
26
|
-
const BaseComponent =
|
|
25
|
+
const BaseComponent = as !== null && as !== void 0 ? as : "a";
|
|
27
26
|
let t1;
|
|
28
27
|
if ($[5] !== className) {
|
|
29
28
|
t1 = clsx(className, TopicTag_module_css_default.TopicTag);
|
|
@@ -8,7 +8,6 @@ import { forwardRef, useContext, useRef } from "react";
|
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
//#region src/UnderlineNav/UnderlineNavItem.tsx
|
|
10
10
|
const UnderlineNavItem = /*#__PURE__*/ forwardRef((allProps, forwardedRef) => {
|
|
11
|
-
var _leadingVisual;
|
|
12
11
|
const $ = c(33);
|
|
13
12
|
let Icon;
|
|
14
13
|
let ariaCurrent;
|
|
@@ -45,8 +44,7 @@ const UnderlineNavItem = /*#__PURE__*/ forwardRef((allProps, forwardedRef) => {
|
|
|
45
44
|
const Component = t0 === void 0 ? "a" : t0;
|
|
46
45
|
let t1;
|
|
47
46
|
if ($[10] !== Component || $[11] !== href) {
|
|
48
|
-
|
|
49
|
-
t1 = Component === "a" ? { href: (_href = href) !== null && _href !== void 0 ? _href : "#" } : href === void 0 ? {} : { href };
|
|
47
|
+
t1 = Component === "a" ? { href: href !== null && href !== void 0 ? href : "#" } : href === void 0 ? {} : { href };
|
|
50
48
|
$[10] = Component;
|
|
51
49
|
$[11] = href;
|
|
52
50
|
$[12] = t1;
|
|
@@ -75,7 +73,7 @@ const UnderlineNavItem = /*#__PURE__*/ forwardRef((allProps, forwardedRef) => {
|
|
|
75
73
|
} else t3 = $[16];
|
|
76
74
|
const clickHandler = t3;
|
|
77
75
|
const t4 = isOverflowing ? true : allProps["aria-hidden"];
|
|
78
|
-
const t5 =
|
|
76
|
+
const t5 = leadingVisual !== null && leadingVisual !== void 0 ? leadingVisual : Icon;
|
|
79
77
|
const t6 = isOverflowing ? -1 : allProps.tabIndex;
|
|
80
78
|
let t7;
|
|
81
79
|
if ($[17] !== Component || $[18] !== ariaCurrent || $[19] !== children || $[20] !== clickHandler || $[21] !== counter || $[22] !== forwardedRef || $[23] !== hrefProps || $[24] !== keyDownHandler || $[25] !== loadingCounters || $[26] !== props || $[27] !== t5 || $[28] !== t6) {
|
|
@@ -86,7 +86,7 @@ const List = /*#__PURE__*/ React.forwardRef((props, forwardedRef) => {
|
|
|
86
86
|
for (const itemProps_0 of restProps.items) {
|
|
87
87
|
var _group$items$length, _group$items, _group$items2;
|
|
88
88
|
const group = groupMap.get(itemProps_0.groupId);
|
|
89
|
-
const itemIndex_0 = (_group$items$length = group === null || group === void 0
|
|
89
|
+
const itemIndex_0 = (_group$items$length = group === null || group === void 0 || (_group$items = group.items) === null || _group$items === void 0 ? void 0 : _group$items.length) !== null && _group$items$length !== void 0 ? _group$items$length : 0;
|
|
90
90
|
groupMap.set(itemProps_0.groupId, {
|
|
91
91
|
...group,
|
|
92
92
|
items: [...(_group$items2 = group === null || group === void 0 ? void 0 : group.items) !== null && _group$items2 !== void 0 ? _group$items2 : [], renderItem({
|
|
@@ -52,7 +52,7 @@ type SelectPanelMessageProps = {
|
|
|
52
52
|
declare const SelectPanel: React.FC<SelectPanelProps> & {
|
|
53
53
|
Button: WithSlotMarker<React.ForwardRefExoticComponent<{
|
|
54
54
|
alignContent?: AlignContent;
|
|
55
|
-
icon?: React.
|
|
55
|
+
icon?: React.ReactNode | React.ComponentType<import("@primer/octicons-react").IconProps> | React.ExoticComponent<import("@primer/octicons-react").IconProps>;
|
|
56
56
|
leadingVisual?: React.ElementType | React.ReactElement<any> | null;
|
|
57
57
|
trailingVisual?: React.ElementType | React.ReactElement<any> | null;
|
|
58
58
|
trailingAction?: React.ElementType | null;
|
|
@@ -54,12 +54,11 @@ function InputLabel(t0) {
|
|
|
54
54
|
} else t4 = $[13];
|
|
55
55
|
let t5;
|
|
56
56
|
if ($[14] !== children || $[15] !== required || $[16] !== requiredIndicator || $[17] !== requiredText) {
|
|
57
|
-
var _requiredText;
|
|
58
57
|
t5 = required || requiredText ? /* @__PURE__ */ jsxs("span", {
|
|
59
58
|
className: InputLabel_module_css_default.RequiredText,
|
|
60
59
|
children: [/* @__PURE__ */ jsx("span", { children }), /* @__PURE__ */ jsx("span", {
|
|
61
60
|
"aria-hidden": requiredIndicator ? void 0 : true,
|
|
62
|
-
children:
|
|
61
|
+
children: requiredText !== null && requiredText !== void 0 ? requiredText : "*"
|
|
63
62
|
})]
|
|
64
63
|
}) : children;
|
|
65
64
|
$[14] = children;
|
|
@@ -94,13 +94,12 @@ const TextInputAction = /*#__PURE__*/ forwardRef((t0, forwardedRef) => {
|
|
|
94
94
|
} else t6 = $[17];
|
|
95
95
|
let t7;
|
|
96
96
|
if ($[18] !== accessibleLabel || $[19] !== ariaLabel || $[20] !== children || $[21] !== forwardedRef || $[22] !== icon || $[23] !== rest || $[24] !== styleProps || $[25] !== tooltipDirection || $[26] !== variant) {
|
|
97
|
-
var _tooltipDirection;
|
|
98
97
|
t7 = /* @__PURE__ */ jsx("span", {
|
|
99
98
|
className: t6,
|
|
100
99
|
"data-component": "TextInput.Action",
|
|
101
100
|
children: icon && !children && ariaLabel ? /* @__PURE__ */ jsx(IconButton, {
|
|
102
101
|
...accessibleLabel,
|
|
103
|
-
tooltipDirection:
|
|
102
|
+
tooltipDirection: tooltipDirection !== null && tooltipDirection !== void 0 ? tooltipDirection : "s",
|
|
104
103
|
variant,
|
|
105
104
|
type: "button",
|
|
106
105
|
icon,
|
|
@@ -5,6 +5,9 @@ import React, { ComponentProps } from "react";
|
|
|
5
5
|
type TextInputSizes = 'small' | 'medium' | 'large';
|
|
6
6
|
type StyledTextInputBaseWrapperProps = {
|
|
7
7
|
block?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Omit this prop to use the default background.
|
|
10
|
+
*/
|
|
8
11
|
contrast?: boolean;
|
|
9
12
|
disabled?: boolean;
|
|
10
13
|
hasTrailingAction?: boolean;
|
|
@@ -53,7 +53,7 @@ function useThemeProvider(props) {
|
|
|
53
53
|
}
|
|
54
54
|
function subscribeToSystemColorMode(callback) {
|
|
55
55
|
var _window, _window$matchMedia;
|
|
56
|
-
const media = (_window = window) === null || _window === void 0
|
|
56
|
+
const media = (_window = window) === null || _window === void 0 || (_window$matchMedia = _window.matchMedia) === null || _window$matchMedia === void 0 ? void 0 : _window$matchMedia.call(_window, "(prefers-color-scheme: dark)");
|
|
57
57
|
media === null || media === void 0 || media.addEventListener("change", callback);
|
|
58
58
|
return () => media === null || media === void 0 ? void 0 : media.removeEventListener("change", callback);
|
|
59
59
|
}
|
|
@@ -64,8 +64,8 @@ function _temp() {
|
|
|
64
64
|
return "day";
|
|
65
65
|
}
|
|
66
66
|
function getSystemColorMode() {
|
|
67
|
-
var _window2, _window2$matchMedia
|
|
68
|
-
return (_window2 = window) !== null && _window2 !== void 0 && (_window2$matchMedia = _window2.matchMedia) !== null && _window2$matchMedia !== void 0 && (_window2$matchMedia
|
|
67
|
+
var _window2, _window2$matchMedia;
|
|
68
|
+
return (_window2 = window) !== null && _window2 !== void 0 && (_window2$matchMedia = _window2.matchMedia) !== null && _window2$matchMedia !== void 0 && (_window2$matchMedia = _window2$matchMedia.call(_window2, "(prefers-color-scheme: dark)")) !== null && _window2$matchMedia !== void 0 && _window2$matchMedia.matches ? "night" : "day";
|
|
69
69
|
}
|
|
70
70
|
//#endregion
|
|
71
71
|
export { useThemeProvider };
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"stories": [
|
|
11
11
|
{
|
|
12
12
|
"id": "experimental-components-actionbar--default",
|
|
13
|
-
"code": "() => (\n <ActionBar aria-label=\"Toolbar\">\n <ActionBar.IconButton\n icon={BoldIcon}\n aria-label=\"Bold\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={ItalicIcon}\n aria-label=\"Italic\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={CodeIcon}\n aria-label=\"Code\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={LinkIcon}\n aria-label=\"Link\"\n ></ActionBar.IconButton>\n <ActionBar.Divider />\n <ActionBar.IconButton\n icon={FileAddedIcon}\n aria-label=\"File Added\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={SearchIcon}\n aria-label=\"Search\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={QuoteIcon}\n aria-label=\"Insert Quote\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={ListUnorderedIcon}\n aria-label=\"Unordered List\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={ListOrderedIcon}\n aria-label=\"Ordered List\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={TasklistIcon}\n aria-label=\"Task List\"\n onClick={() => alert('Task List clicked')}\n ></ActionBar.IconButton>\n </ActionBar>\n)"
|
|
13
|
+
"code": "() => (\n <ActionBar aria-label=\"Toolbar\">\n <ActionBar.IconButton\n icon={<BoldIcon />}\n aria-label=\"Bold\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={<ItalicIcon />}\n aria-label=\"Italic\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={<CodeIcon />}\n aria-label=\"Code\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={<LinkIcon />}\n aria-label=\"Link\"\n ></ActionBar.IconButton>\n <ActionBar.Divider />\n <ActionBar.IconButton\n icon={<FileAddedIcon />}\n aria-label=\"File Added\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={<SearchIcon />}\n aria-label=\"Search\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={<QuoteIcon />}\n aria-label=\"Insert Quote\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={<ListUnorderedIcon />}\n aria-label=\"Unordered List\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={<ListOrderedIcon />}\n aria-label=\"Ordered List\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={<TasklistIcon />}\n aria-label=\"Task List\"\n onClick={() => alert('Task List clicked')}\n ></ActionBar.IconButton>\n </ActionBar>\n)"
|
|
14
14
|
}
|
|
15
15
|
],
|
|
16
16
|
"importPath": "@primer/react",
|
|
@@ -2003,63 +2003,63 @@
|
|
|
2003
2003
|
"stories": [
|
|
2004
2004
|
{
|
|
2005
2005
|
"id": "components-iconbutton--default",
|
|
2006
|
-
"code": "() => <IconButton icon={HeartIcon} aria-label=\"Favorite\" />"
|
|
2006
|
+
"code": "() => <IconButton icon={<HeartIcon />} aria-label=\"Favorite\" />"
|
|
2007
2007
|
},
|
|
2008
2008
|
{
|
|
2009
2009
|
"id": "components-iconbutton-features--primary",
|
|
2010
|
-
"code": "() => <IconButton icon={HeartIcon} variant=\"primary\" aria-label=\"Favorite\"
|
|
2010
|
+
"code": "() => (\n <IconButton icon={<HeartIcon />} variant=\"primary\" aria-label=\"Favorite\" />\n)"
|
|
2011
2011
|
},
|
|
2012
2012
|
{
|
|
2013
2013
|
"id": "components-iconbutton-features--danger",
|
|
2014
|
-
"code": "() => <IconButton icon={HeartIcon} variant=\"danger\" aria-label=\"Favorite\"
|
|
2014
|
+
"code": "() => (\n <IconButton icon={<HeartIcon />} variant=\"danger\" aria-label=\"Favorite\" />\n)"
|
|
2015
2015
|
},
|
|
2016
2016
|
{
|
|
2017
2017
|
"id": "components-iconbutton-features--invisible",
|
|
2018
|
-
"code": "() => <IconButton icon={HeartIcon} variant=\"invisible\" aria-label=\"Favorite\"
|
|
2018
|
+
"code": "() => (\n <IconButton icon={<HeartIcon />} variant=\"invisible\" aria-label=\"Favorite\" />\n)"
|
|
2019
2019
|
},
|
|
2020
2020
|
{
|
|
2021
2021
|
"id": "components-iconbutton-features--disabled",
|
|
2022
|
-
"code": "() => <IconButton disabled icon={HeartIcon} aria-label=\"Favorite\" />"
|
|
2022
|
+
"code": "() => <IconButton disabled icon={<HeartIcon />} aria-label=\"Favorite\" />"
|
|
2023
2023
|
},
|
|
2024
2024
|
{
|
|
2025
2025
|
"id": "components-iconbutton-features--small",
|
|
2026
|
-
"code": "() => <IconButton size=\"small\" icon={HeartIcon} aria-label=\"Favorite\" />"
|
|
2026
|
+
"code": "() => <IconButton size=\"small\" icon={<HeartIcon />} aria-label=\"Favorite\" />"
|
|
2027
2027
|
},
|
|
2028
2028
|
{
|
|
2029
2029
|
"id": "components-iconbutton-features--medium",
|
|
2030
|
-
"code": "() => <IconButton size=\"medium\" icon={HeartIcon} aria-label=\"Favorite\" />"
|
|
2030
|
+
"code": "() => <IconButton size=\"medium\" icon={<HeartIcon />} aria-label=\"Favorite\" />"
|
|
2031
2031
|
},
|
|
2032
2032
|
{
|
|
2033
2033
|
"id": "components-iconbutton-features--large",
|
|
2034
|
-
"code": "() => <IconButton size=\"large\" icon={HeartIcon} aria-label=\"Favorite\" />"
|
|
2034
|
+
"code": "() => <IconButton size=\"large\" icon={<HeartIcon />} aria-label=\"Favorite\" />"
|
|
2035
2035
|
},
|
|
2036
2036
|
{
|
|
2037
2037
|
"id": "components-iconbutton-features--with-description",
|
|
2038
|
-
"code": "() => (\n <IconButton\n icon={InboxIcon}\n aria-label=\"Notifications\"\n description=\"You have no unread notifications.\"\n />\n)"
|
|
2038
|
+
"code": "() => (\n <IconButton\n icon={<InboxIcon />}\n aria-label=\"Notifications\"\n description=\"You have no unread notifications.\"\n />\n)"
|
|
2039
2039
|
},
|
|
2040
2040
|
{
|
|
2041
2041
|
"id": "components-iconbutton-features--external-tooltip",
|
|
2042
|
-
"code": "() => (\n <Tooltip\n text=\"this is a supportive description for icon button\"\n direction=\"se\"\n >\n <IconButton icon={HeartIcon} aria-label=\"HeartIcon\" />\n </Tooltip>\n)"
|
|
2042
|
+
"code": "() => (\n <Tooltip\n text=\"this is a supportive description for icon button\"\n direction=\"se\"\n >\n <IconButton icon={<HeartIcon />} aria-label=\"HeartIcon\" />\n </Tooltip>\n)"
|
|
2043
2043
|
},
|
|
2044
2044
|
{
|
|
2045
2045
|
"id": "components-iconbutton-features--as-a-menu-anchor",
|
|
2046
|
-
"code": "() => (\n <ActionMenu>\n <ActionMenu.Anchor>\n <IconButton icon={ChevronDownIcon} aria-label=\"Something\" />\n </ActionMenu.Anchor>\n\n <ActionMenu.Overlay width=\"medium\">\n <ActionList>\n <ActionList.Item onSelect={() => alert('Copy link clicked')}>\n Copy link\n <ActionList.TrailingVisual>⌘C</ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Item onSelect={() => alert('Quote reply clicked')}>\n Quote reply\n <ActionList.TrailingVisual>⌘Q</ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Item onSelect={() => alert('Edit comment clicked')}>\n Edit comment\n <ActionList.TrailingVisual>⌘E</ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Divider />\n <ActionList.Item\n variant=\"danger\"\n onSelect={() => alert('Delete file clicked')}\n >\n Delete file\n <ActionList.TrailingVisual>⌘D</ActionList.TrailingVisual>\n </ActionList.Item>\n </ActionList>\n </ActionMenu.Overlay>\n </ActionMenu>\n)"
|
|
2046
|
+
"code": "() => (\n <ActionMenu>\n <ActionMenu.Anchor>\n <IconButton icon={<ChevronDownIcon />} aria-label=\"Something\" />\n </ActionMenu.Anchor>\n\n <ActionMenu.Overlay width=\"medium\">\n <ActionList>\n <ActionList.Item onSelect={() => alert('Copy link clicked')}>\n Copy link\n <ActionList.TrailingVisual>⌘C</ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Item onSelect={() => alert('Quote reply clicked')}>\n Quote reply\n <ActionList.TrailingVisual>⌘Q</ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Item onSelect={() => alert('Edit comment clicked')}>\n Edit comment\n <ActionList.TrailingVisual>⌘E</ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Divider />\n <ActionList.Item\n variant=\"danger\"\n onSelect={() => alert('Delete file clicked')}\n >\n Delete file\n <ActionList.TrailingVisual>⌘D</ActionList.TrailingVisual>\n </ActionList.Item>\n </ActionList>\n </ActionMenu.Overlay>\n </ActionMenu>\n)"
|
|
2047
2047
|
},
|
|
2048
2048
|
{
|
|
2049
2049
|
"id": "components-iconbutton-features--loading",
|
|
2050
|
-
"code": "() => (\n <IconButton
|
|
2050
|
+
"code": "() => (\n <IconButton\n loading\n icon={<HeartIcon />}\n variant=\"primary\"\n aria-label=\"Primary\"\n />\n)"
|
|
2051
2051
|
},
|
|
2052
2052
|
{
|
|
2053
2053
|
"id": "components-iconbutton-features--loading-trigger",
|
|
2054
|
-
"code": "() => {\n const [isLoading, setIsLoading] = useState(false)\n const handleClick = () => {\n setIsLoading(true)\n setTimeout(() => {\n setIsLoading(false)\n }, 3000)\n }\n return (\n <IconButton\n loading={isLoading}\n onClick={handleClick}\n icon={DownloadIcon}\n aria-label=\"Download\"\n />\n )\n}"
|
|
2054
|
+
"code": "() => {\n const [isLoading, setIsLoading] = useState(false)\n const handleClick = () => {\n setIsLoading(true)\n setTimeout(() => {\n setIsLoading(false)\n }, 3000)\n }\n return (\n <IconButton\n loading={isLoading}\n onClick={handleClick}\n icon={<DownloadIcon />}\n aria-label=\"Download\"\n />\n )\n}"
|
|
2055
2055
|
},
|
|
2056
2056
|
{
|
|
2057
2057
|
"id": "components-iconbutton-features--keybinding-hint-on-description",
|
|
2058
|
-
"code": "() => (\n <IconButton\n icon={InboxIcon}\n aria-label=\"Notifications\"\n description=\"You have unread notifications\"\n keybindingHint=\"G+N\"\n />\n)"
|
|
2058
|
+
"code": "() => (\n <IconButton\n icon={<InboxIcon />}\n aria-label=\"Notifications\"\n description=\"You have unread notifications\"\n keybindingHint=\"G+N\"\n />\n)"
|
|
2059
2059
|
},
|
|
2060
2060
|
{
|
|
2061
2061
|
"id": "components-iconbutton-features--keybinding-hint",
|
|
2062
|
-
"code": "() => <IconButton icon={BoldIcon} aria-label=\"Bold\" keybindingHint=\"Mod+B\"
|
|
2062
|
+
"code": "() => (\n <IconButton icon={<BoldIcon />} aria-label=\"Bold\" keybindingHint=\"Mod+B\" />\n)"
|
|
2063
2063
|
}
|
|
2064
2064
|
],
|
|
2065
2065
|
"importPath": "@primer/react",
|
|
@@ -2100,9 +2100,9 @@
|
|
|
2100
2100
|
},
|
|
2101
2101
|
{
|
|
2102
2102
|
"name": "icon",
|
|
2103
|
-
"type": "
|
|
2103
|
+
"type": "React.ReactNode | React.ComponentType<IconProps> | React.ExoticComponent<IconProps>",
|
|
2104
2104
|
"defaultValue": "",
|
|
2105
|
-
"description": "
|
|
2105
|
+
"description": "Provide an icon component or React node. It will be placed in the center of the button. Use a React element when passing an icon from a Server Component."
|
|
2106
2106
|
},
|
|
2107
2107
|
{
|
|
2108
2108
|
"name": "aria-label",
|
|
@@ -8048,7 +8048,8 @@
|
|
|
8048
8048
|
"name": "contrast",
|
|
8049
8049
|
"type": "boolean",
|
|
8050
8050
|
"defaultValue": "false",
|
|
8051
|
-
"
|
|
8051
|
+
"deprecated": true,
|
|
8052
|
+
"description": "Deprecated. Omit this prop to use the default background."
|
|
8052
8053
|
},
|
|
8053
8054
|
{
|
|
8054
8055
|
"name": "size",
|
|
@@ -8398,7 +8399,8 @@
|
|
|
8398
8399
|
"name": "contrast",
|
|
8399
8400
|
"type": "boolean",
|
|
8400
8401
|
"defaultValue": "false",
|
|
8401
|
-
"
|
|
8402
|
+
"deprecated": true,
|
|
8403
|
+
"description": "Deprecated. Omit this prop to use the default background."
|
|
8402
8404
|
},
|
|
8403
8405
|
{
|
|
8404
8406
|
"name": "validationStatus",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "38.42.0-rc.
|
|
4
|
+
"version": "38.42.0-rc.7ee8d8fea",
|
|
5
5
|
"description": "An implementation of GitHub's Primer Design System using React",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -94,14 +94,16 @@
|
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
96
|
"@actions/core": "1.11.1",
|
|
97
|
-
"@babel/cli": "
|
|
98
|
-
"@babel/core": "
|
|
99
|
-
"@babel/
|
|
100
|
-
"@babel/
|
|
101
|
-
"@babel/plugin-
|
|
102
|
-
"@babel/plugin-transform-
|
|
103
|
-
"@babel/
|
|
104
|
-
"@babel/preset-
|
|
97
|
+
"@babel/cli": "8.0.6",
|
|
98
|
+
"@babel/core": "8.0.6",
|
|
99
|
+
"@babel/generator": "8.0.6",
|
|
100
|
+
"@babel/parser": "8.0.6",
|
|
101
|
+
"@babel/plugin-transform-nullish-coalescing-operator": "8.0.1",
|
|
102
|
+
"@babel/plugin-transform-optional-chaining": "8.0.5",
|
|
103
|
+
"@babel/plugin-transform-modules-commonjs": "8.0.1",
|
|
104
|
+
"@babel/preset-react": "8.0.1",
|
|
105
|
+
"@babel/preset-typescript": "8.0.1",
|
|
106
|
+
"@babel/types": "8.0.6",
|
|
105
107
|
"@figma/code-connect": "1.3.2",
|
|
106
108
|
"@primer/css": "^21.5.1",
|
|
107
109
|
"@primer/doc-gen": "^0.0.1",
|
|
@@ -118,7 +120,6 @@
|
|
|
118
120
|
"@testing-library/react": "^16.3.0",
|
|
119
121
|
"@testing-library/react-hooks": "^8.0.1",
|
|
120
122
|
"@testing-library/user-event": "^14.5.2",
|
|
121
|
-
"@types/babel__core": "^7.20.5",
|
|
122
123
|
"@types/lodash.groupby": "4.6.9",
|
|
123
124
|
"@types/lodash.isempty": "4.4.9",
|
|
124
125
|
"@types/lodash.isobject": "3.0.9",
|
|
@@ -131,13 +132,11 @@
|
|
|
131
132
|
"afterframe": "^1.0.2",
|
|
132
133
|
"ajv": "8.18.0",
|
|
133
134
|
"axe-core": "4.9.1",
|
|
134
|
-
"babel-core": "7.0.0-bridge.0",
|
|
135
135
|
"babel-plugin-add-react-displayname": "0.0.5",
|
|
136
136
|
"babel-plugin-dev-expression": "0.2.3",
|
|
137
137
|
"babel-plugin-macros": "3.1.0",
|
|
138
138
|
"babel-plugin-open-source": "1.3.4",
|
|
139
139
|
"babel-plugin-transform-replace-expressions": "0.2.0",
|
|
140
|
-
"babel-polyfill": "6.26.0",
|
|
141
140
|
"chalk": "^5.4.1",
|
|
142
141
|
"change-case": "5.4.4",
|
|
143
142
|
"concurrently": "9.1.2",
|