@primer/react 38.0.0-rc.1 → 38.0.0-rc.2
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 +46 -0
- package/dist/browser.esm.js +3 -3
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +3 -3
- package/dist/browser.umd.js.map +1 -1
- package/dist/components.css +660 -23
- package/generated/components.json +58 -121
- package/lib/AvatarStack/AvatarStack.d.ts +2 -3
- package/lib/AvatarStack/AvatarStack.d.ts.map +1 -1
- package/lib/AvatarStack/AvatarStack.js +1 -3
- package/lib/Banner/Banner.d.ts.map +1 -1
- package/lib/Banner/Banner.js +3 -1
- package/lib/Blankslate/Blankslate.js +38 -40
- package/lib/BranchName/BranchName.d.ts +6 -3
- package/lib/BranchName/BranchName.d.ts.map +1 -1
- package/lib/BranchName/BranchName.js +1 -3
- package/lib/Button/ButtonBase.js +2 -2
- package/lib/Checkbox/Checkbox.js +187 -56
- package/lib/CircleBadge/CircleBadge.d.ts +4 -0
- package/lib/CircleBadge/CircleBadge.d.ts.map +1 -1
- package/lib/CircleBadge/CircleBadge.js +4 -0
- package/lib/DataTable/useTable.js +63 -82
- package/lib/Details/Details.d.ts +2 -3
- package/lib/Details/Details.d.ts.map +1 -1
- package/lib/Details/Details.js +1 -3
- package/lib/FeatureFlags/FeatureFlags.js +10 -12
- package/lib/FilteredActionList/useAnnouncements.js +31 -40
- package/lib/LabelGroup/LabelGroup.d.ts +1 -2
- package/lib/LabelGroup/LabelGroup.d.ts.map +1 -1
- package/lib/LabelGroup/LabelGroup.js +13 -16
- package/lib/NavList/NavList.js +219 -53
- package/lib/PageLayout/PageLayout.js +53 -55
- package/lib/PointerBox/PointerBox.d.ts +8 -0
- package/lib/PointerBox/PointerBox.d.ts.map +1 -1
- package/lib/PointerBox/PointerBox.js +4 -0
- package/{lib-esm/ProgressBar/ProgressBar-a0957632.css → lib/ProgressBar/ProgressBar-36f689cb.css} +2 -2
- package/lib/ProgressBar/ProgressBar-36f689cb.css.map +1 -0
- package/lib/ProgressBar/ProgressBar.d.ts +3 -4
- package/lib/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/lib/ProgressBar/ProgressBar.module.css.js +1 -1
- package/lib/ProgressBar/index.d.ts +2 -2
- package/lib/ProgressBar/index.d.ts.map +1 -1
- package/lib/Select/Select.d.ts +1 -1
- package/lib/Select/Select.d.ts.map +1 -1
- package/lib/Select/Select.js +53 -65
- package/lib/SelectPanel/{SelectPanel-06900070.css → SelectPanel-e11ce210.css} +2 -2
- package/lib/SelectPanel/SelectPanel-e11ce210.css.map +1 -0
- package/lib/SelectPanel/SelectPanel.d.ts +1 -1
- package/lib/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/lib/SelectPanel/SelectPanel.js +2 -9
- package/lib/SelectPanel/SelectPanel.module.css.js +2 -2
- package/lib/SideNav.d.ts +2 -3
- package/lib/SideNav.d.ts.map +1 -1
- package/lib/SideNav.js +4 -10
- package/lib/StateLabel/StateLabel-50420ff5.css +2 -0
- package/lib/StateLabel/StateLabel-50420ff5.css.map +1 -0
- package/lib/StateLabel/StateLabel.d.ts +6 -5
- package/lib/StateLabel/StateLabel.d.ts.map +1 -1
- package/lib/StateLabel/StateLabel.js +54 -126
- package/lib/StateLabel/StateLabel.module.css.js +2 -2
- package/lib/TextInputWithTokens/TextInputWithTokens.d.ts +6 -0
- package/lib/TextInputWithTokens/TextInputWithTokens.d.ts.map +1 -1
- package/lib/TextInputWithTokens/TextInputWithTokens.js +343 -331
- package/lib/ToggleSwitch/ToggleSwitch-4b23d166.css +2 -0
- package/lib/ToggleSwitch/ToggleSwitch-4b23d166.css.map +1 -0
- package/lib/ToggleSwitch/ToggleSwitch.d.ts +1 -3
- package/lib/ToggleSwitch/ToggleSwitch.d.ts.map +1 -1
- package/lib/ToggleSwitch/ToggleSwitch.js +120 -152
- package/lib/ToggleSwitch/ToggleSwitch.module.css.js +2 -2
- package/lib/Token/IssueLabelToken-0dbbbcdf.css +2 -0
- package/lib/Token/IssueLabelToken-0dbbbcdf.css.map +1 -0
- package/lib/Token/IssueLabelToken.d.ts.map +1 -1
- package/lib/Token/IssueLabelToken.js +7 -65
- package/lib/Token/IssueLabelToken.module.css.js +1 -1
- package/lib/Token/TokenBase.js +73 -82
- package/lib/Token/_RemoveTokenButton.js +106 -26
- package/lib/Tooltip/Tooltip.js +15 -17
- package/lib/TreeView/TreeView.js +18 -20
- package/lib/deprecated/ActionList/List.d.ts.map +1 -1
- package/lib/deprecated/ActionList/List.js +115 -138
- package/lib/deprecated/ActionMenu.js +19 -21
- package/lib/deprecated/index.d.ts +2 -0
- package/lib/deprecated/index.d.ts.map +1 -1
- package/lib/deprecated/index.js +2 -0
- package/lib/hooks/useMenuKeyboardNavigation.js +23 -43
- package/lib/hooks/useMnemonics.js +37 -76
- package/lib/hooks/useOpenAndCloseFocus.js +7 -14
- package/lib/hooks/useOverflow.js +7 -11
- package/lib/hooks/useScrollFlash.js +25 -14
- package/lib/index.d.ts +4 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -10
- package/lib/internal/components/BoxWithFallback.js +40 -35
- package/lib/internal/components/Caret-e686f04c.css +2 -0
- package/lib/internal/components/Caret-e686f04c.css.map +1 -0
- package/lib/internal/components/Caret.d.ts +1 -3
- package/lib/internal/components/Caret.d.ts.map +1 -1
- package/lib/internal/components/Caret.js +14 -48
- package/lib/internal/components/Caret.module.css.js +7 -0
- package/lib/internal/components/LiveRegion.js +8 -10
- package/lib/internal/utils/getGlobalFocusStyles.js +1 -1
- package/lib-esm/AvatarStack/AvatarStack.d.ts +2 -3
- package/lib-esm/AvatarStack/AvatarStack.js +1 -3
- package/lib-esm/Banner/Banner.js +3 -1
- package/lib-esm/Blankslate/Blankslate.js +38 -40
- package/lib-esm/BranchName/BranchName.d.ts +6 -3
- package/lib-esm/BranchName/BranchName.js +1 -3
- package/lib-esm/Button/ButtonBase.js +2 -2
- package/lib-esm/Checkbox/Checkbox.js +187 -56
- package/lib-esm/CircleBadge/CircleBadge.d.ts +4 -0
- package/lib-esm/CircleBadge/CircleBadge.js +4 -0
- package/lib-esm/DataTable/useTable.js +64 -83
- package/lib-esm/Details/Details.d.ts +2 -3
- package/lib-esm/Details/Details.js +1 -3
- package/lib-esm/FeatureFlags/FeatureFlags.js +10 -12
- package/lib-esm/FilteredActionList/useAnnouncements.js +31 -40
- package/lib-esm/LabelGroup/LabelGroup.d.ts +1 -2
- package/lib-esm/LabelGroup/LabelGroup.js +13 -16
- package/lib-esm/NavList/NavList.js +219 -53
- package/lib-esm/PageLayout/PageLayout.js +53 -55
- package/lib-esm/PointerBox/PointerBox.d.ts +8 -0
- package/lib-esm/PointerBox/PointerBox.js +4 -0
- package/{lib/ProgressBar/ProgressBar-a0957632.css → lib-esm/ProgressBar/ProgressBar-36f689cb.css} +2 -2
- package/lib-esm/ProgressBar/ProgressBar-36f689cb.css.map +1 -0
- package/lib-esm/ProgressBar/ProgressBar.d.ts +3 -4
- package/lib-esm/ProgressBar/ProgressBar.module.css.js +1 -1
- package/lib-esm/ProgressBar/index.d.ts +2 -2
- package/lib-esm/Select/Select.d.ts +1 -1
- package/lib-esm/Select/Select.js +53 -65
- package/lib-esm/SelectPanel/{SelectPanel-06900070.css → SelectPanel-e11ce210.css} +2 -2
- package/lib-esm/SelectPanel/SelectPanel-e11ce210.css.map +1 -0
- package/lib-esm/SelectPanel/SelectPanel.d.ts +1 -1
- package/lib-esm/SelectPanel/SelectPanel.js +2 -9
- package/lib-esm/SelectPanel/SelectPanel.module.css.js +2 -2
- package/lib-esm/SideNav.d.ts +2 -3
- package/lib-esm/SideNav.js +4 -10
- package/lib-esm/StateLabel/StateLabel-50420ff5.css +2 -0
- package/lib-esm/StateLabel/StateLabel-50420ff5.css.map +1 -0
- package/lib-esm/StateLabel/StateLabel.d.ts +6 -5
- package/lib-esm/StateLabel/StateLabel.js +55 -123
- package/lib-esm/StateLabel/StateLabel.module.css.js +2 -2
- package/lib-esm/TextInputWithTokens/TextInputWithTokens.d.ts +6 -0
- package/lib-esm/TextInputWithTokens/TextInputWithTokens.js +343 -331
- package/lib-esm/ToggleSwitch/ToggleSwitch-4b23d166.css +2 -0
- package/lib-esm/ToggleSwitch/ToggleSwitch-4b23d166.css.map +1 -0
- package/lib-esm/ToggleSwitch/ToggleSwitch.d.ts +1 -3
- package/lib-esm/ToggleSwitch/ToggleSwitch.js +120 -151
- package/lib-esm/ToggleSwitch/ToggleSwitch.module.css.js +2 -2
- package/lib-esm/Token/IssueLabelToken-0dbbbcdf.css +2 -0
- package/lib-esm/Token/IssueLabelToken-0dbbbcdf.css.map +1 -0
- package/lib-esm/Token/IssueLabelToken.js +7 -65
- package/lib-esm/Token/IssueLabelToken.module.css.js +1 -1
- package/lib-esm/Token/TokenBase.js +73 -82
- package/lib-esm/Token/_RemoveTokenButton.js +106 -26
- package/lib-esm/Tooltip/Tooltip.js +15 -17
- package/lib-esm/TreeView/TreeView.js +18 -20
- package/lib-esm/deprecated/ActionList/List.js +116 -138
- package/lib-esm/deprecated/ActionMenu.js +19 -21
- package/lib-esm/deprecated/index.d.ts +2 -0
- package/lib-esm/deprecated/index.js +1 -0
- package/lib-esm/hooks/useMenuKeyboardNavigation.js +23 -43
- package/lib-esm/hooks/useMnemonics.js +37 -76
- package/lib-esm/hooks/useOpenAndCloseFocus.js +7 -14
- package/lib-esm/hooks/useOverflow.js +7 -11
- package/lib-esm/hooks/useScrollFlash.js +25 -14
- package/lib-esm/index.d.ts +4 -3
- package/lib-esm/index.js +1 -1
- package/lib-esm/internal/components/BoxWithFallback.js +40 -35
- package/lib-esm/internal/components/Caret-e686f04c.css +2 -0
- package/lib-esm/internal/components/Caret-e686f04c.css.map +1 -0
- package/lib-esm/internal/components/Caret.d.ts +1 -3
- package/lib-esm/internal/components/Caret.js +14 -44
- package/lib-esm/internal/components/Caret.module.css.js +5 -0
- package/lib-esm/internal/components/LiveRegion.js +8 -10
- package/lib-esm/internal/utils/getGlobalFocusStyles.js +1 -1
- package/package.json +10 -10
- package/lib/CircleOcticon/CircleOcticon.d.ts +0 -16
- package/lib/CircleOcticon/CircleOcticon.d.ts.map +0 -1
- package/lib/CircleOcticon/CircleOcticon.js +0 -99
- package/lib/CircleOcticon/index.d.ts +0 -3
- package/lib/CircleOcticon/index.d.ts.map +0 -1
- package/lib/ProgressBar/ProgressBar-a0957632.css.map +0 -1
- package/lib/SelectPanel/SelectPanel-06900070.css.map +0 -1
- package/lib/StateLabel/StateLabel-cd27f475.css +0 -2
- package/lib/StateLabel/StateLabel-cd27f475.css.map +0 -1
- package/lib/ToggleSwitch/ToggleSwitch-65936b4b.css +0 -4
- package/lib/ToggleSwitch/ToggleSwitch-65936b4b.css.map +0 -1
- package/lib/Token/IssueLabelToken-99c9b914.css +0 -2
- package/lib/Token/IssueLabelToken-99c9b914.css.map +0 -1
- package/lib-esm/CircleOcticon/CircleOcticon.d.ts +0 -16
- package/lib-esm/CircleOcticon/CircleOcticon.js +0 -97
- package/lib-esm/CircleOcticon/index.d.ts +0 -3
- package/lib-esm/ProgressBar/ProgressBar-a0957632.css.map +0 -1
- package/lib-esm/SelectPanel/SelectPanel-06900070.css.map +0 -1
- package/lib-esm/StateLabel/StateLabel-cd27f475.css +0 -2
- package/lib-esm/StateLabel/StateLabel-cd27f475.css.map +0 -1
- package/lib-esm/ToggleSwitch/ToggleSwitch-65936b4b.css +0 -4
- package/lib-esm/ToggleSwitch/ToggleSwitch-65936b4b.css.map +0 -1
- package/lib-esm/Token/IssueLabelToken-99c9b914.css +0 -2
- package/lib-esm/Token/IssueLabelToken-99c9b914.css.map +0 -1
|
@@ -24,32 +24,30 @@ function LiveRegion(t0) {
|
|
|
24
24
|
} = t0;
|
|
25
25
|
const [message, setMessage] = React__default.default.useState("");
|
|
26
26
|
let t1;
|
|
27
|
-
let t2;
|
|
28
27
|
if ($[0] !== message) {
|
|
29
|
-
|
|
28
|
+
t1 = {
|
|
30
29
|
announce: setMessage,
|
|
31
30
|
message
|
|
32
31
|
};
|
|
33
32
|
$[0] = message;
|
|
34
|
-
$[1] =
|
|
33
|
+
$[1] = t1;
|
|
35
34
|
} else {
|
|
36
|
-
|
|
35
|
+
t1 = $[1];
|
|
37
36
|
}
|
|
38
|
-
t1 = t2;
|
|
39
37
|
const value = t1;
|
|
40
|
-
let
|
|
38
|
+
let t2;
|
|
41
39
|
if ($[2] !== children || $[3] !== value) {
|
|
42
|
-
|
|
40
|
+
t2 = /*#__PURE__*/jsxRuntime.jsx(LiveRegionContext.Provider, {
|
|
43
41
|
value: value,
|
|
44
42
|
children: children
|
|
45
43
|
});
|
|
46
44
|
$[2] = children;
|
|
47
45
|
$[3] = value;
|
|
48
|
-
$[4] =
|
|
46
|
+
$[4] = t2;
|
|
49
47
|
} else {
|
|
50
|
-
|
|
48
|
+
t2 = $[4];
|
|
51
49
|
}
|
|
52
|
-
return
|
|
50
|
+
return t2;
|
|
53
51
|
}
|
|
54
52
|
function LiveRegionOutlet() {
|
|
55
53
|
const $ = reactCompilerRuntime.c(2);
|
|
@@ -4,6 +4,6 @@ var styled = require('styled-components');
|
|
|
4
4
|
var constants = require('../../constants.js');
|
|
5
5
|
|
|
6
6
|
const globalFocusStyle = styled.css(["box-shadow:none;outline:2px solid ", ";"], constants.get('colors.accent.fg'));
|
|
7
|
-
const getGlobalFocusStyles = outlineOffset => styled.css(["&:focus:not(:disabled){", ";outline-offset:", ";&:not(:focus-visible){outline:solid 1px transparent;}}&:focus-visible:not(:disabled){", ";outline-offset:", ";}"], globalFocusStyle,
|
|
7
|
+
const getGlobalFocusStyles = outlineOffset => styled.css(["&:focus:not(:disabled){", ";outline-offset:", ";&:not(:focus-visible){outline:solid 1px transparent;}}&:focus-visible:not(:disabled){", ";outline-offset:", ";}"], globalFocusStyle, outlineOffset, globalFocusStyle, outlineOffset);
|
|
8
8
|
|
|
9
9
|
module.exports = getGlobalFocusStyles;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { SxProp } from '../sx';
|
|
3
2
|
import type { ResponsiveValue } from '../hooks/useResponsiveValue';
|
|
4
3
|
export type AvatarStackProps = {
|
|
5
4
|
alignRight?: boolean;
|
|
@@ -10,7 +9,7 @@ export type AvatarStackProps = {
|
|
|
10
9
|
className?: string;
|
|
11
10
|
children: React.ReactNode;
|
|
12
11
|
style?: React.CSSProperties;
|
|
13
|
-
}
|
|
14
|
-
declare const AvatarStack: ({ children, variant, shape, alignRight, disableExpand, size, className, style,
|
|
12
|
+
};
|
|
13
|
+
declare const AvatarStack: ({ children, variant, shape, alignRight, disableExpand, size, className, style, }: AvatarStackProps) => React.JSX.Element;
|
|
15
14
|
export default AvatarStack;
|
|
16
15
|
//# sourceMappingURL=AvatarStack.d.ts.map
|
|
@@ -42,8 +42,7 @@ const AvatarStack = ({
|
|
|
42
42
|
disableExpand,
|
|
43
43
|
size,
|
|
44
44
|
className,
|
|
45
|
-
style
|
|
46
|
-
sx: sxProp
|
|
45
|
+
style
|
|
47
46
|
}) => {
|
|
48
47
|
const [hasInteractiveChildren, setHasInteractiveChildren] = useState(false);
|
|
49
48
|
const stackContainer = useRef(null);
|
|
@@ -138,7 +137,6 @@ const AvatarStack = ({
|
|
|
138
137
|
...getResponsiveAvatarSizeStyles(),
|
|
139
138
|
...style
|
|
140
139
|
},
|
|
141
|
-
sx: sxProp,
|
|
142
140
|
children: /*#__PURE__*/jsxs(AvatarStackBody, {
|
|
143
141
|
disableExpand: disableExpand,
|
|
144
142
|
hasInteractiveChildren: hasInteractiveChildren,
|
package/lib-esm/Banner/Banner.js
CHANGED
|
@@ -25,6 +25,7 @@ const labels = {
|
|
|
25
25
|
};
|
|
26
26
|
const Banner = /*#__PURE__*/React.forwardRef(function Banner({
|
|
27
27
|
'aria-label': label,
|
|
28
|
+
'aria-labelledby': labelledBy,
|
|
28
29
|
children,
|
|
29
30
|
className,
|
|
30
31
|
description,
|
|
@@ -64,7 +65,8 @@ const Banner = /*#__PURE__*/React.forwardRef(function Banner({
|
|
|
64
65
|
}
|
|
65
66
|
return /*#__PURE__*/jsxs("section", {
|
|
66
67
|
...rest,
|
|
67
|
-
"aria-
|
|
68
|
+
"aria-labelledby": labelledBy,
|
|
69
|
+
"aria-label": labelledBy ? undefined : label !== null && label !== void 0 ? label : labels[variant],
|
|
68
70
|
className: clsx(className, classes.Banner),
|
|
69
71
|
"data-dismissible": onDismiss ? '' : undefined,
|
|
70
72
|
"data-title-hidden": hideTitle ? '' : undefined,
|
|
@@ -45,75 +45,73 @@ function Blankslate(t0) {
|
|
|
45
45
|
}
|
|
46
46
|
const size = t1 === undefined ? "medium" : t1;
|
|
47
47
|
let t2;
|
|
48
|
-
let t3;
|
|
49
48
|
if ($[8] !== size) {
|
|
50
|
-
|
|
49
|
+
t2 = {
|
|
51
50
|
size
|
|
52
51
|
};
|
|
53
52
|
$[8] = size;
|
|
54
|
-
$[9] =
|
|
53
|
+
$[9] = t2;
|
|
55
54
|
} else {
|
|
56
|
-
|
|
55
|
+
t2 = $[9];
|
|
57
56
|
}
|
|
58
|
-
t2 = t3;
|
|
59
57
|
const value = t2;
|
|
60
|
-
let
|
|
58
|
+
let t3;
|
|
61
59
|
if ($[10] !== className) {
|
|
62
|
-
|
|
60
|
+
t3 = clsx(classes.Blankslate, className);
|
|
63
61
|
$[10] = className;
|
|
64
|
-
$[11] =
|
|
62
|
+
$[11] = t3;
|
|
65
63
|
} else {
|
|
66
|
-
|
|
64
|
+
t3 = $[11];
|
|
67
65
|
}
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
let
|
|
72
|
-
if ($[12] !== children || $[13] !== size || $[14] !==
|
|
73
|
-
|
|
74
|
-
className:
|
|
75
|
-
"data-border":
|
|
76
|
-
"data-narrow":
|
|
77
|
-
"data-spacious":
|
|
66
|
+
const t4 = border ? "" : undefined;
|
|
67
|
+
const t5 = narrow ? "" : undefined;
|
|
68
|
+
const t6 = spacious ? "" : undefined;
|
|
69
|
+
let t7;
|
|
70
|
+
if ($[12] !== children || $[13] !== size || $[14] !== t3 || $[15] !== t4 || $[16] !== t5 || $[17] !== t6) {
|
|
71
|
+
t7 = /*#__PURE__*/jsx("div", {
|
|
72
|
+
className: t3,
|
|
73
|
+
"data-border": t4,
|
|
74
|
+
"data-narrow": t5,
|
|
75
|
+
"data-spacious": t6,
|
|
78
76
|
"data-size": size,
|
|
79
77
|
children: children
|
|
80
78
|
});
|
|
81
79
|
$[12] = children;
|
|
82
80
|
$[13] = size;
|
|
83
|
-
$[14] =
|
|
84
|
-
$[15] =
|
|
85
|
-
$[16] =
|
|
86
|
-
$[17] =
|
|
87
|
-
$[18] =
|
|
81
|
+
$[14] = t3;
|
|
82
|
+
$[15] = t4;
|
|
83
|
+
$[16] = t5;
|
|
84
|
+
$[17] = t6;
|
|
85
|
+
$[18] = t7;
|
|
88
86
|
} else {
|
|
89
|
-
|
|
87
|
+
t7 = $[18];
|
|
90
88
|
}
|
|
91
|
-
let
|
|
92
|
-
if ($[19] !== rest || $[20] !==
|
|
93
|
-
|
|
89
|
+
let t8;
|
|
90
|
+
if ($[19] !== rest || $[20] !== t7) {
|
|
91
|
+
t8 = /*#__PURE__*/jsx("div", {
|
|
94
92
|
...rest,
|
|
95
93
|
className: classes.Container,
|
|
96
|
-
children:
|
|
94
|
+
children: t7
|
|
97
95
|
});
|
|
98
96
|
$[19] = rest;
|
|
99
|
-
$[20] =
|
|
100
|
-
$[21] =
|
|
97
|
+
$[20] = t7;
|
|
98
|
+
$[21] = t8;
|
|
101
99
|
} else {
|
|
102
|
-
|
|
100
|
+
t8 = $[21];
|
|
103
101
|
}
|
|
104
|
-
let
|
|
105
|
-
if ($[22] !==
|
|
106
|
-
|
|
102
|
+
let t9;
|
|
103
|
+
if ($[22] !== t8 || $[23] !== value) {
|
|
104
|
+
t9 = /*#__PURE__*/jsx(Provider, {
|
|
107
105
|
value: value,
|
|
108
|
-
children:
|
|
106
|
+
children: t8
|
|
109
107
|
});
|
|
110
|
-
$[22] =
|
|
108
|
+
$[22] = t8;
|
|
111
109
|
$[23] = value;
|
|
112
|
-
$[24] =
|
|
110
|
+
$[24] = t9;
|
|
113
111
|
} else {
|
|
114
|
-
|
|
112
|
+
t9 = $[24];
|
|
115
113
|
}
|
|
116
|
-
return
|
|
114
|
+
return t9;
|
|
117
115
|
}
|
|
118
116
|
function Visual(t0) {
|
|
119
117
|
const $ = c(10);
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { SxProp } from '../sx';
|
|
3
2
|
type BranchNameProps<As extends React.ElementType> = {
|
|
4
3
|
as?: As;
|
|
5
|
-
} & DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? 'a' : As>, 'as'> &
|
|
4
|
+
} & DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? 'a' : As>, 'as'> & {
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
6
7
|
type DistributiveOmit<T, TOmitted extends PropertyKey> = T extends any ? Omit<T, TOmitted> : never;
|
|
7
8
|
export type { BranchNameProps };
|
|
8
9
|
declare const _default: <As extends React.ElementType>(props: {
|
|
9
10
|
as?: As | undefined;
|
|
10
|
-
} & DistributiveOmit<React.ComponentPropsWithRef<React.ElementType<any, keyof React.JSX.IntrinsicElements> extends As ? "a" : As>, "as"> &
|
|
11
|
+
} & DistributiveOmit<React.ComponentPropsWithRef<React.ElementType<any, keyof React.JSX.IntrinsicElements> extends As ? "a" : As>, "as"> & {
|
|
12
|
+
className?: string;
|
|
13
|
+
} & React.RefAttributes<any>) => React.ReactNode;
|
|
11
14
|
export default _default;
|
|
12
15
|
//# sourceMappingURL=BranchName.d.ts.map
|
|
@@ -2,7 +2,6 @@ import { c } from 'react-compiler-runtime';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import classes from './BranchName.module.css.js';
|
|
5
|
-
import { BoxWithFallback } from '../internal/components/BoxWithFallback.js';
|
|
6
5
|
import { jsx } from 'react/jsx-runtime';
|
|
7
6
|
|
|
8
7
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -41,8 +40,7 @@ function BranchName(props, ref) {
|
|
|
41
40
|
}
|
|
42
41
|
let t2;
|
|
43
42
|
if ($[7] !== Component || $[8] !== children || $[9] !== ref || $[10] !== rest || $[11] !== t1) {
|
|
44
|
-
t2 = /*#__PURE__*/jsx(
|
|
45
|
-
as: Component,
|
|
43
|
+
t2 = /*#__PURE__*/jsx(Component, {
|
|
46
44
|
...rest,
|
|
47
45
|
ref: ref,
|
|
48
46
|
className: t1,
|
|
@@ -96,7 +96,7 @@ const ButtonBase = /*#__PURE__*/forwardRef(({
|
|
|
96
96
|
"data-has-count": count !== undefined ? true : undefined,
|
|
97
97
|
"aria-describedby": [loadingAnnouncementID, ariaDescribedBy].filter(descriptionID => Boolean(descriptionID)).join(' ')
|
|
98
98
|
// aria-labelledby is needed because the accessible name becomes unset when the button is in a loading state.
|
|
99
|
-
// We only set it when the button is in a loading state because it will
|
|
99
|
+
// We only set it when the button is in a loading state because it will supersede the aria-label when the screen
|
|
100
100
|
// reader announces the button name.
|
|
101
101
|
,
|
|
102
102
|
"aria-labelledby": loading ? [`${uuid}-label`, ariaLabelledBy].filter(labelID => Boolean(labelID)).join(' ') : ariaLabelledBy,
|
|
@@ -171,7 +171,7 @@ const ButtonBase = /*#__PURE__*/forwardRef(({
|
|
|
171
171
|
"data-has-count": count !== undefined ? true : undefined,
|
|
172
172
|
"aria-describedby": [loadingAnnouncementID, ariaDescribedBy].filter(descriptionID => Boolean(descriptionID)).join(' ')
|
|
173
173
|
// aria-labelledby is needed because the accessible name becomes unset when the button is in a loading state.
|
|
174
|
-
// We only set it when the button is in a loading state because it will
|
|
174
|
+
// We only set it when the button is in a loading state because it will supersede the aria-label when the screen
|
|
175
175
|
// reader announces the button name.
|
|
176
176
|
,
|
|
177
177
|
"aria-labelledby": loading ? [`${uuid}-label`, ariaLabelledBy].filter(labelID => Boolean(labelID)).join(' ') : ariaLabelledBy,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c } from 'react-compiler-runtime';
|
|
1
2
|
import { clsx } from 'clsx';
|
|
2
3
|
import React, { useContext, useEffect } from 'react';
|
|
3
4
|
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
@@ -11,70 +12,200 @@ import Box from '../Box/Box.js';
|
|
|
11
12
|
/**
|
|
12
13
|
* An accessible, native checkbox component
|
|
13
14
|
*/
|
|
14
|
-
const Checkbox = /*#__PURE__*/React.forwardRef(({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
disabled
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
required
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
const Checkbox = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
16
|
+
const $ = c(47);
|
|
17
|
+
let checked;
|
|
18
|
+
let className;
|
|
19
|
+
let defaultChecked;
|
|
20
|
+
let disabled;
|
|
21
|
+
let indeterminate;
|
|
22
|
+
let onChange;
|
|
23
|
+
let required;
|
|
24
|
+
let rest;
|
|
25
|
+
let sxProp;
|
|
26
|
+
let validationStatus;
|
|
27
|
+
let value;
|
|
28
|
+
if ($[0] !== t0) {
|
|
29
|
+
({
|
|
30
|
+
checked,
|
|
31
|
+
className,
|
|
32
|
+
defaultChecked,
|
|
33
|
+
indeterminate,
|
|
34
|
+
disabled,
|
|
35
|
+
onChange,
|
|
36
|
+
sx: sxProp,
|
|
37
|
+
required,
|
|
38
|
+
validationStatus,
|
|
39
|
+
value,
|
|
40
|
+
...rest
|
|
41
|
+
} = t0);
|
|
42
|
+
$[0] = t0;
|
|
43
|
+
$[1] = checked;
|
|
44
|
+
$[2] = className;
|
|
45
|
+
$[3] = defaultChecked;
|
|
46
|
+
$[4] = disabled;
|
|
47
|
+
$[5] = indeterminate;
|
|
48
|
+
$[6] = onChange;
|
|
49
|
+
$[7] = required;
|
|
50
|
+
$[8] = rest;
|
|
51
|
+
$[9] = sxProp;
|
|
52
|
+
$[10] = validationStatus;
|
|
53
|
+
$[11] = value;
|
|
54
|
+
} else {
|
|
55
|
+
checked = $[1];
|
|
56
|
+
className = $[2];
|
|
57
|
+
defaultChecked = $[3];
|
|
58
|
+
disabled = $[4];
|
|
59
|
+
indeterminate = $[5];
|
|
60
|
+
onChange = $[6];
|
|
61
|
+
required = $[7];
|
|
62
|
+
rest = $[8];
|
|
63
|
+
sxProp = $[9];
|
|
64
|
+
validationStatus = $[10];
|
|
65
|
+
value = $[11];
|
|
66
|
+
}
|
|
27
67
|
const checkboxRef = useProvidedRefOrCreate(ref);
|
|
28
68
|
const checkboxGroupContext = useContext(CheckboxGroupContext);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
checkboxRef
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
69
|
+
let t1;
|
|
70
|
+
if ($[12] !== checkboxGroupContext || $[13] !== onChange) {
|
|
71
|
+
t1 = e => {
|
|
72
|
+
checkboxGroupContext.onChange && checkboxGroupContext.onChange(e);
|
|
73
|
+
onChange && onChange(e);
|
|
74
|
+
};
|
|
75
|
+
$[12] = checkboxGroupContext;
|
|
76
|
+
$[13] = onChange;
|
|
77
|
+
$[14] = t1;
|
|
78
|
+
} else {
|
|
79
|
+
t1 = $[14];
|
|
80
|
+
}
|
|
81
|
+
const handleOnChange = t1;
|
|
82
|
+
const t2 = indeterminate ? false : checked;
|
|
83
|
+
const t3 = required ? "true" : "false";
|
|
84
|
+
const t4 = validationStatus === "error" ? "true" : "false";
|
|
85
|
+
let t5;
|
|
86
|
+
if ($[15] !== checkboxRef || $[16] !== defaultChecked || $[17] !== disabled || $[18] !== handleOnChange || $[19] !== required || $[20] !== rest || $[21] !== t2 || $[22] !== t3 || $[23] !== t4 || $[24] !== value) {
|
|
87
|
+
t5 = {
|
|
88
|
+
type: "checkbox",
|
|
89
|
+
disabled,
|
|
90
|
+
ref: checkboxRef,
|
|
91
|
+
checked: t2,
|
|
92
|
+
defaultChecked,
|
|
93
|
+
required,
|
|
94
|
+
"aria-required": t3,
|
|
95
|
+
"aria-invalid": t4,
|
|
96
|
+
onChange: handleOnChange,
|
|
97
|
+
value,
|
|
98
|
+
name: value,
|
|
99
|
+
...rest
|
|
100
|
+
};
|
|
101
|
+
$[15] = checkboxRef;
|
|
102
|
+
$[16] = defaultChecked;
|
|
103
|
+
$[17] = disabled;
|
|
104
|
+
$[18] = handleOnChange;
|
|
105
|
+
$[19] = required;
|
|
106
|
+
$[20] = rest;
|
|
107
|
+
$[21] = t2;
|
|
108
|
+
$[22] = t3;
|
|
109
|
+
$[23] = t4;
|
|
110
|
+
$[24] = value;
|
|
111
|
+
$[25] = t5;
|
|
112
|
+
} else {
|
|
113
|
+
t5 = $[25];
|
|
114
|
+
}
|
|
115
|
+
const inputProps = t5;
|
|
116
|
+
let t6;
|
|
117
|
+
if ($[26] !== checkboxRef || $[27] !== indeterminate) {
|
|
118
|
+
t6 = () => {
|
|
119
|
+
if (checkboxRef.current) {
|
|
120
|
+
checkboxRef.current.indeterminate = indeterminate || false;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
$[26] = checkboxRef;
|
|
124
|
+
$[27] = indeterminate;
|
|
125
|
+
$[28] = t6;
|
|
126
|
+
} else {
|
|
127
|
+
t6 = $[28];
|
|
128
|
+
}
|
|
129
|
+
let t7;
|
|
130
|
+
if ($[29] !== checkboxRef || $[30] !== checked || $[31] !== indeterminate) {
|
|
131
|
+
t7 = [indeterminate, checked, checkboxRef];
|
|
132
|
+
$[29] = checkboxRef;
|
|
133
|
+
$[30] = checked;
|
|
134
|
+
$[31] = indeterminate;
|
|
135
|
+
$[32] = t7;
|
|
136
|
+
} else {
|
|
137
|
+
t7 = $[32];
|
|
138
|
+
}
|
|
139
|
+
useIsomorphicLayoutEffect(t6, t7);
|
|
140
|
+
let t8;
|
|
141
|
+
if ($[33] !== checkboxRef || $[34] !== indeterminate) {
|
|
142
|
+
t8 = () => {
|
|
143
|
+
const {
|
|
144
|
+
current: checkbox
|
|
145
|
+
} = checkboxRef;
|
|
146
|
+
if (!checkbox) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
if (indeterminate) {
|
|
150
|
+
checkbox.setAttribute("aria-checked", "mixed");
|
|
151
|
+
} else {
|
|
152
|
+
checkbox.setAttribute("aria-checked", checkbox.checked ? "true" : "false");
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
$[33] = checkboxRef;
|
|
156
|
+
$[34] = indeterminate;
|
|
157
|
+
$[35] = t8;
|
|
158
|
+
} else {
|
|
159
|
+
t8 = $[35];
|
|
160
|
+
}
|
|
161
|
+
useEffect(t8);
|
|
162
|
+
if (sxProp) {
|
|
163
|
+
let t9;
|
|
164
|
+
if ($[36] !== className) {
|
|
165
|
+
t9 = clsx(className, sharedClasses.Input, classes.Checkbox);
|
|
166
|
+
$[36] = className;
|
|
167
|
+
$[37] = t9;
|
|
168
|
+
} else {
|
|
169
|
+
t9 = $[37];
|
|
59
170
|
}
|
|
60
|
-
|
|
61
|
-
|
|
171
|
+
let t10;
|
|
172
|
+
if ($[38] !== inputProps || $[39] !== sxProp || $[40] !== t9) {
|
|
173
|
+
t10 = /*#__PURE__*/jsx(Box, {
|
|
174
|
+
as: "input",
|
|
175
|
+
...inputProps,
|
|
176
|
+
className: t9,
|
|
177
|
+
sx: sxProp
|
|
178
|
+
});
|
|
179
|
+
$[38] = inputProps;
|
|
180
|
+
$[39] = sxProp;
|
|
181
|
+
$[40] = t9;
|
|
182
|
+
$[41] = t10;
|
|
62
183
|
} else {
|
|
63
|
-
|
|
184
|
+
t10 = $[41];
|
|
64
185
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
186
|
+
return t10;
|
|
187
|
+
}
|
|
188
|
+
let t9;
|
|
189
|
+
if ($[42] !== className) {
|
|
190
|
+
t9 = clsx(className, sharedClasses.Input, classes.Checkbox);
|
|
191
|
+
$[42] = className;
|
|
192
|
+
$[43] = t9;
|
|
193
|
+
} else {
|
|
194
|
+
t9 = $[43];
|
|
195
|
+
}
|
|
196
|
+
let t10;
|
|
197
|
+
if ($[44] !== inputProps || $[45] !== t9) {
|
|
198
|
+
t10 = /*#__PURE__*/jsx("input", {
|
|
69
199
|
...inputProps,
|
|
70
|
-
className:
|
|
71
|
-
sx: sxProp
|
|
200
|
+
className: t9
|
|
72
201
|
});
|
|
202
|
+
$[44] = inputProps;
|
|
203
|
+
$[45] = t9;
|
|
204
|
+
$[46] = t10;
|
|
205
|
+
} else {
|
|
206
|
+
t10 = $[46];
|
|
73
207
|
}
|
|
74
|
-
return
|
|
75
|
-
...inputProps,
|
|
76
|
-
className: clsx(className, sharedClasses.Input, classes.Checkbox)
|
|
77
|
-
});
|
|
208
|
+
return t10;
|
|
78
209
|
});
|
|
79
210
|
Checkbox.displayName = 'Checkbox';
|
|
80
211
|
|
|
@@ -17,6 +17,10 @@ declare const CircleBadgeIcon: import("styled-components").StyledComponent<impor
|
|
|
17
17
|
} & import("@primer/octicons-react").IconProps & SxProp & import("react").RefAttributes<SVGSVGElement>>, any, SxProp, never>;
|
|
18
18
|
export type CircleBadgeProps = ComponentProps<typeof CircleBadge>;
|
|
19
19
|
export type CircleBadgeIconProps = ComponentProps<typeof CircleBadgeIcon>;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated This component is deprecated.
|
|
22
|
+
* Replace component with specific icon imports from `@primer/octicons-react` and customized styling.
|
|
23
|
+
*/
|
|
20
24
|
declare const _default: string & import("styled-components").StyledComponentBase<"div", any, StyledCircleBadgeProps, never> & import("hoist-non-react-statics").NonReactStatics<never, {}> & {
|
|
21
25
|
Icon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<{
|
|
22
26
|
icon: React.ElementType;
|
|
@@ -30,6 +30,10 @@ const CircleBadgeIcon = styled(Octicon).withConfig({
|
|
|
30
30
|
componentId: "sc-nywehb-1"
|
|
31
31
|
})(["height:auto;max-width:60%;max-height:55%;"]);
|
|
32
32
|
CircleBadgeIcon.displayName = 'CircleBadge.Icon';
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated This component is deprecated.
|
|
35
|
+
* Replace component with specific icon imports from `@primer/octicons-react` and customized styling.
|
|
36
|
+
*/
|
|
33
37
|
var CircleBadge$1 = Object.assign(CircleBadge, {
|
|
34
38
|
Icon: CircleBadgeIcon
|
|
35
39
|
});
|