@primer/react 37.32.0-rc.f8e94f384 → 38.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -1
- package/dist/browser.esm.js +2 -2
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +2 -2
- package/dist/browser.umd.js.map +1 -1
- package/dist/components.css +4 -3
- package/generated/components.json +82 -78
- package/lib/Autocomplete/AutocompleteMenu.js +7 -7
- package/lib/CircleOcticon/CircleOcticon.d.ts +3 -0
- package/lib/CircleOcticon/CircleOcticon.d.ts.map +1 -1
- package/lib/CircleOcticon/CircleOcticon.js +3 -0
- package/lib/ConfirmationDialog/ConfirmationDialog.d.ts +8 -0
- package/lib/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -1
- package/lib/ConfirmationDialog/ConfirmationDialog.js +6 -2
- package/lib/ProgressBar/ProgressBar-a0957632.css +2 -0
- package/lib/ProgressBar/ProgressBar-a0957632.css.map +1 -0
- package/lib/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/lib/ProgressBar/ProgressBar.js +53 -49
- package/lib/ProgressBar/ProgressBar.module.css.js +1 -1
- package/{lib-esm/Radio/Radio-b2a92b7d.css → lib/Radio/Radio-df9a5c02.css} +2 -2
- package/{lib-esm/Radio/Radio-b2a92b7d.css.map → lib/Radio/Radio-df9a5c02.css.map} +1 -1
- package/lib/Radio/Radio.module.css.js +1 -1
- package/lib/Select/Select.js +61 -53
- package/lib/SelectPanel/SelectPanel.js +2 -2
- package/lib/SubNav/SubNav.d.ts +8 -16
- package/lib/SubNav/SubNav.d.ts.map +1 -1
- package/lib/SubNav/SubNav.js +3 -6
- package/lib-esm/Autocomplete/AutocompleteMenu.js +1 -1
- package/lib-esm/CircleOcticon/CircleOcticon.d.ts +3 -0
- package/lib-esm/CircleOcticon/CircleOcticon.js +3 -0
- package/lib-esm/ConfirmationDialog/ConfirmationDialog.d.ts +8 -0
- package/lib-esm/ConfirmationDialog/ConfirmationDialog.js +6 -2
- package/lib-esm/ProgressBar/ProgressBar-a0957632.css +2 -0
- package/lib-esm/ProgressBar/ProgressBar-a0957632.css.map +1 -0
- package/lib-esm/ProgressBar/ProgressBar.js +53 -49
- package/lib-esm/ProgressBar/ProgressBar.module.css.js +1 -1
- package/{lib/Radio/Radio-b2a92b7d.css → lib-esm/Radio/Radio-df9a5c02.css} +2 -2
- package/{lib/Radio/Radio-b2a92b7d.css.map → lib-esm/Radio/Radio-df9a5c02.css.map} +1 -1
- package/lib-esm/Radio/Radio.module.css.js +1 -1
- package/lib-esm/Select/Select.js +61 -53
- package/lib-esm/SelectPanel/SelectPanel.js +1 -1
- package/lib-esm/SubNav/SubNav.d.ts +8 -16
- package/lib-esm/SubNav/SubNav.js +3 -6
- package/package.json +3 -4
- package/lib/ProgressBar/ProgressBar-430cdef7.css +0 -2
- package/lib/ProgressBar/ProgressBar-430cdef7.css.map +0 -1
- package/lib/node_modules/@github/mini-throttle/dist/index.js +0 -43
- package/lib-esm/ProgressBar/ProgressBar-430cdef7.css +0 -2
- package/lib-esm/ProgressBar/ProgressBar-430cdef7.css.map +0 -1
- package/lib-esm/node_modules/@github/mini-throttle/dist/index.js +0 -40
|
@@ -8,6 +8,9 @@ export type CircleOcticonProps = {
|
|
|
8
8
|
size?: IconProps['size'];
|
|
9
9
|
}>>;
|
|
10
10
|
} & BoxProps;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated This component is deprecated. Replace component with specific icon imports from `@primer/octicons-react` and customized styling.)
|
|
13
|
+
*/
|
|
11
14
|
declare function CircleOcticon(props: CircleOcticonProps): React.JSX.Element;
|
|
12
15
|
export default CircleOcticon;
|
|
13
16
|
//# sourceMappingURL=CircleOcticon.d.ts.map
|
|
@@ -2,6 +2,9 @@ import { c } from 'react-compiler-runtime';
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import Box from '../Box/Box.js';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated This component is deprecated. Replace component with specific icon imports from `@primer/octicons-react` and customized styling.)
|
|
7
|
+
*/
|
|
5
8
|
function CircleOcticon(props) {
|
|
6
9
|
const $ = c(21);
|
|
7
10
|
let IconComponent;
|
|
@@ -26,6 +26,14 @@ export interface ConfirmationDialogProps {
|
|
|
26
26
|
* The type of button to use for the confirm button. Default: Button.
|
|
27
27
|
*/
|
|
28
28
|
confirmButtonType?: 'normal' | 'primary' | 'danger';
|
|
29
|
+
/**
|
|
30
|
+
* Whether the cancel button is in a loading state. Default: false.
|
|
31
|
+
*/
|
|
32
|
+
cancelButtonLoading?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the confirm button is in a loading state. Default: false.
|
|
35
|
+
*/
|
|
36
|
+
confirmButtonLoading?: boolean;
|
|
29
37
|
/**
|
|
30
38
|
* Additional class names to apply to the dialog
|
|
31
39
|
*/
|
|
@@ -69,6 +69,8 @@ const ConfirmationDialog = props => {
|
|
|
69
69
|
cancelButtonContent = 'Cancel',
|
|
70
70
|
confirmButtonContent = 'OK',
|
|
71
71
|
confirmButtonType = 'normal',
|
|
72
|
+
cancelButtonLoading = false,
|
|
73
|
+
confirmButtonLoading = false,
|
|
72
74
|
children,
|
|
73
75
|
className,
|
|
74
76
|
width = 'medium',
|
|
@@ -84,13 +86,15 @@ const ConfirmationDialog = props => {
|
|
|
84
86
|
const cancelButton = {
|
|
85
87
|
content: cancelButtonContent,
|
|
86
88
|
onClick: onCancelButtonClick,
|
|
87
|
-
autoFocus: isConfirmationDangerous
|
|
89
|
+
autoFocus: isConfirmationDangerous,
|
|
90
|
+
loading: cancelButtonLoading
|
|
88
91
|
};
|
|
89
92
|
const confirmButton = {
|
|
90
93
|
content: confirmButtonContent,
|
|
91
94
|
buttonType: confirmButtonType,
|
|
92
95
|
onClick: onConfirmButtonClick,
|
|
93
|
-
autoFocus: !isConfirmationDangerous
|
|
96
|
+
autoFocus: !isConfirmationDangerous,
|
|
97
|
+
loading: confirmButtonLoading
|
|
94
98
|
};
|
|
95
99
|
const footerButtons = [cancelButton, confirmButton];
|
|
96
100
|
return /*#__PURE__*/jsx(Dialog, {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
@keyframes prc-ProgressBar-shimmer-i1RxN{0%{mask-position:200%}to{mask-position:0}}.prc-ProgressBar-ProgressBarItem-stL6O{background-color:var(--progress-bg);width:var(--progress-width)}@media (prefers-reduced-motion:no-preference){.prc-ProgressBar-ProgressBarItem-stL6O[data-animated=true]{animation-duration:1s;animation-iteration-count:infinite;animation-name:prc-ProgressBar-shimmer-i1RxN;mask-image:linear-gradient(75deg,#000 30%,rgba(0,0,0,.65) 80%);mask-size:200%}}.prc-ProgressBar-ProgressBarContainer-E-z8S{background-color:var(--progressBar-track-bgColor);border-radius:var(--borderRadius-small,.1875rem);display:flex;gap:2px;outline:solid 1px var(--progressBar-track-borderColor);outline-offset:-1px;overflow:hidden}.prc-ProgressBar-ProgressBarContainer-E-z8S:where([data-progress-display=inline]){display:inline-flex}.prc-ProgressBar-ProgressBarContainer-E-z8S:where([data-progress-bar-size=default]){height:8px}.prc-ProgressBar-ProgressBarContainer-E-z8S:where([data-progress-bar-size=small]){height:5px}.prc-ProgressBar-ProgressBarContainer-E-z8S:where([data-progress-bar-size=large]){height:10px}
|
|
2
|
+
/*# sourceMappingURL=ProgressBar-a0957632.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ProgressBar/ProgressBar.module.css"],"names":[],"mappings":"AAAA,yCACE,GACE,kBACF,CAEA,GACE,eACF,CACF,CAEA,uCAGE,mCAAoC,CAFpC,2BAaF,CATE,8CACE,2DAIE,qBAAsB,CACtB,kCAAmC,CAFnC,4CAAuB,CAFvB,8DAAqE,CACrE,cAIF,CACF,CAGF,4CAIE,iDAAkD,CAClD,gDAAwC,CAJxC,YAAa,CAKb,OAAQ,CACR,sDAAuD,CACvD,mBAAoB,CANpB,eAuBF,CAfE,kFACE,mBACF,CAEA,oFACE,UACF,CAEA,kFACE,UACF,CAEA,kFACE,WACF","file":"ProgressBar-a0957632.css","sourcesContent":["@keyframes shimmer {\n from {\n mask-position: 200%;\n }\n\n to {\n mask-position: 0%;\n }\n}\n\n.ProgressBarItem {\n width: var(--progress-width);\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--progress-bg);\n\n @media (prefers-reduced-motion: no-preference) {\n &[data-animated='true'] {\n mask-image: linear-gradient(75deg, #000 30%, rgba(0, 0, 0, 0.65) 80%);\n mask-size: 200%;\n animation-name: shimmer;\n animation-duration: 1s;\n animation-iteration-count: infinite;\n }\n }\n}\n\n.ProgressBarContainer {\n display: flex;\n overflow: hidden;\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--progressBar-track-bgColor);\n border-radius: var(--borderRadius-small);\n gap: 2px;\n outline: solid 1px var(--progressBar-track-borderColor);\n outline-offset: -1px;\n\n &:where([data-progress-display='inline']) {\n display: inline-flex;\n }\n\n &:where([data-progress-bar-size='default']) {\n height: 8px;\n }\n\n &:where([data-progress-bar-size='small']) {\n height: 5px;\n }\n\n &:where([data-progress-bar-size='large']) {\n height: 10px;\n }\n}\n"]}
|
|
@@ -6,10 +6,11 @@ import { BoxWithFallback } from '../internal/components/BoxWithFallback.js';
|
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
const Item = /*#__PURE__*/forwardRef((t0, forwardRef) => {
|
|
9
|
-
const $ = c(
|
|
9
|
+
const $ = c(33);
|
|
10
10
|
let ariaLabel;
|
|
11
11
|
let ariaValueNow;
|
|
12
12
|
let ariaValueText;
|
|
13
|
+
let bg;
|
|
13
14
|
let className;
|
|
14
15
|
let progress;
|
|
15
16
|
let rest;
|
|
@@ -22,93 +23,96 @@ const Item = /*#__PURE__*/forwardRef((t0, forwardRef) => {
|
|
|
22
23
|
"aria-valuetext": ariaValueText,
|
|
23
24
|
className,
|
|
24
25
|
style,
|
|
26
|
+
bg,
|
|
25
27
|
...rest
|
|
26
28
|
} = t0);
|
|
27
29
|
$[0] = t0;
|
|
28
30
|
$[1] = ariaLabel;
|
|
29
31
|
$[2] = ariaValueNow;
|
|
30
32
|
$[3] = ariaValueText;
|
|
31
|
-
$[4] =
|
|
32
|
-
$[5] =
|
|
33
|
-
$[6] =
|
|
34
|
-
$[7] =
|
|
33
|
+
$[4] = bg;
|
|
34
|
+
$[5] = className;
|
|
35
|
+
$[6] = progress;
|
|
36
|
+
$[7] = rest;
|
|
37
|
+
$[8] = style;
|
|
35
38
|
} else {
|
|
36
39
|
ariaLabel = $[1];
|
|
37
40
|
ariaValueNow = $[2];
|
|
38
41
|
ariaValueText = $[3];
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
bg = $[4];
|
|
43
|
+
className = $[5];
|
|
44
|
+
progress = $[6];
|
|
45
|
+
rest = $[7];
|
|
46
|
+
style = $[8];
|
|
43
47
|
}
|
|
44
48
|
const progressAsNumber = typeof progress === "string" ? parseInt(progress, 10) : progress;
|
|
45
49
|
let t1;
|
|
46
|
-
if ($[
|
|
50
|
+
if ($[9] !== ariaValueNow || $[10] !== progressAsNumber) {
|
|
47
51
|
var _ariaValueNow;
|
|
48
52
|
t1 = (_ariaValueNow = ariaValueNow) !== null && _ariaValueNow !== void 0 ? _ariaValueNow : progressAsNumber !== undefined && progressAsNumber >= 0 ? Math.round(progressAsNumber) : 0;
|
|
49
|
-
$[
|
|
50
|
-
$[
|
|
51
|
-
$[
|
|
53
|
+
$[9] = ariaValueNow;
|
|
54
|
+
$[10] = progressAsNumber;
|
|
55
|
+
$[11] = t1;
|
|
52
56
|
} else {
|
|
53
|
-
t1 = $[
|
|
57
|
+
t1 = $[11];
|
|
54
58
|
}
|
|
55
59
|
let t2;
|
|
56
|
-
if ($[
|
|
60
|
+
if ($[12] !== ariaValueText || $[13] !== t1) {
|
|
57
61
|
t2 = {
|
|
58
62
|
"aria-valuenow": t1,
|
|
59
63
|
"aria-valuemin": 0,
|
|
60
64
|
"aria-valuemax": 100,
|
|
61
65
|
"aria-valuetext": ariaValueText
|
|
62
66
|
};
|
|
63
|
-
$[
|
|
64
|
-
$[
|
|
65
|
-
$[
|
|
67
|
+
$[12] = ariaValueText;
|
|
68
|
+
$[13] = t1;
|
|
69
|
+
$[14] = t2;
|
|
66
70
|
} else {
|
|
67
|
-
t2 = $[
|
|
71
|
+
t2 = $[14];
|
|
68
72
|
}
|
|
69
73
|
const ariaAttributes = t2;
|
|
70
74
|
let styles;
|
|
71
|
-
if ($[
|
|
75
|
+
if ($[15] !== bg || $[16] !== progress) {
|
|
72
76
|
styles = {};
|
|
73
77
|
let t3;
|
|
74
|
-
if ($[
|
|
75
|
-
t3 =
|
|
76
|
-
$[
|
|
77
|
-
$[
|
|
78
|
+
if ($[18] !== bg) {
|
|
79
|
+
t3 = bg && bg.split(".");
|
|
80
|
+
$[18] = bg;
|
|
81
|
+
$[19] = t3;
|
|
78
82
|
} else {
|
|
79
|
-
t3 = $[
|
|
83
|
+
t3 = $[19];
|
|
80
84
|
}
|
|
81
85
|
const bgType = t3;
|
|
82
86
|
styles["--progress-width"] = progress ? `${progress}%` : "0%";
|
|
83
|
-
styles["--progress-bg"] = bgType && `var(--bgColor-${bgType[0]}-${bgType[1]})` || "var(--bgColor-success-emphasis)";
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
+
styles["--progress-bg"] = bgType && `var(--bgColor-${bgType[0]}-${bgType[1] || "emphasis"})` || "var(--bgColor-success-emphasis)";
|
|
88
|
+
$[15] = bg;
|
|
89
|
+
$[16] = progress;
|
|
90
|
+
$[17] = styles;
|
|
87
91
|
} else {
|
|
88
|
-
styles = $[
|
|
92
|
+
styles = $[17];
|
|
89
93
|
}
|
|
90
94
|
let t3;
|
|
91
|
-
if ($[
|
|
95
|
+
if ($[20] !== className) {
|
|
92
96
|
t3 = clsx(className, classes.ProgressBarItem);
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
97
|
+
$[20] = className;
|
|
98
|
+
$[21] = t3;
|
|
95
99
|
} else {
|
|
96
|
-
t3 = $[
|
|
100
|
+
t3 = $[21];
|
|
97
101
|
}
|
|
98
102
|
let t4;
|
|
99
|
-
if ($[
|
|
103
|
+
if ($[22] !== style || $[23] !== styles) {
|
|
100
104
|
t4 = {
|
|
101
105
|
...styles,
|
|
102
106
|
...style
|
|
103
107
|
};
|
|
104
|
-
$[
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
108
|
+
$[22] = style;
|
|
109
|
+
$[23] = styles;
|
|
110
|
+
$[24] = t4;
|
|
107
111
|
} else {
|
|
108
|
-
t4 = $[
|
|
112
|
+
t4 = $[24];
|
|
109
113
|
}
|
|
110
114
|
let t5;
|
|
111
|
-
if ($[
|
|
115
|
+
if ($[25] !== ariaAttributes || $[26] !== ariaLabel || $[27] !== forwardRef || $[28] !== progress || $[29] !== rest || $[30] !== t3 || $[31] !== t4) {
|
|
112
116
|
t5 = /*#__PURE__*/jsx(BoxWithFallback, {
|
|
113
117
|
as: "span",
|
|
114
118
|
className: t3,
|
|
@@ -120,16 +124,16 @@ const Item = /*#__PURE__*/forwardRef((t0, forwardRef) => {
|
|
|
120
124
|
style: t4,
|
|
121
125
|
...ariaAttributes
|
|
122
126
|
});
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
127
|
+
$[25] = ariaAttributes;
|
|
128
|
+
$[26] = ariaLabel;
|
|
129
|
+
$[27] = forwardRef;
|
|
130
|
+
$[28] = progress;
|
|
131
|
+
$[29] = rest;
|
|
132
|
+
$[30] = t3;
|
|
133
|
+
$[31] = t4;
|
|
134
|
+
$[32] = t5;
|
|
131
135
|
} else {
|
|
132
|
-
t5 = $[
|
|
136
|
+
t5 = $[32];
|
|
133
137
|
}
|
|
134
138
|
return t5;
|
|
135
139
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.prc-Radio-Radio-Ly4MR{border-radius:var(--borderRadius-full,100vh);transition:background-color,border-color 80ms cubic-bezier(.33,1,.68,1)}.prc-Radio-Radio-Ly4MR:where(:checked){background-color:var(--control-checked-fgColor-rest,var(--color-switch-track-checked-fg));border-color:var(--control-checked-bgColor-rest,var(--color-switch-track-checked-bg));border-width:var(--borderWidth-thicker,.25rem)}.prc-Radio-Radio-Ly4MR:where(:checked):disabled{background-color:var(--fgColor-muted,var(--color-fg-muted));border-color:var(--fgColor-muted,var(--color-fg-muted));cursor:not-allowed}.prc-Radio-Radio-Ly4MR:focus
|
|
2
|
-
/*# sourceMappingURL=Radio-
|
|
1
|
+
.prc-Radio-Radio-Ly4MR{border-radius:var(--borderRadius-full,100vh);transition:background-color,border-color 80ms cubic-bezier(.33,1,.68,1)}.prc-Radio-Radio-Ly4MR:where(:checked){background-color:var(--control-checked-fgColor-rest,var(--color-switch-track-checked-fg));border-color:var(--control-checked-bgColor-rest,var(--color-switch-track-checked-bg));border-width:var(--borderWidth-thicker,.25rem)}.prc-Radio-Radio-Ly4MR:where(:checked):disabled{background-color:var(--fgColor-muted,var(--color-fg-muted));border-color:var(--fgColor-muted,var(--color-fg-muted));cursor:not-allowed}.prc-Radio-Radio-Ly4MR:focus-visible{box-shadow:none;outline:2px solid var(--focus-outlineColor,var(--color-accent-fg));outline-offset:2px}@media (forced-colors:active){.prc-Radio-Radio-Ly4MR{background-color:canvastext;border-color:canvastext}}
|
|
2
|
+
/*# sourceMappingURL=Radio-df9a5c02.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Radio/Radio.module.css","../../postcss-preset-primer/src/mixins/focusOutline.css"],"names":[],"mappings":"AAAA,uBACE,4CAA8C,CAC9C,
|
|
1
|
+
{"version":3,"sources":["../src/Radio/Radio.module.css","../../postcss-preset-primer/src/mixins/focusOutline.css"],"names":[],"mappings":"AAAA,uBACE,4CAA8C,CAC9C,uEA8BF,CA1BE,uCAEE,yFAAqD,CAIrD,qFAAiD,CACjD,8CASF,CAPE,gDAGE,2DAAsC,CAEtC,uDAAkC,CAJlC,kBAKF,CAGF,qCCrBA,eAAgB,CAFhB,kEAAgC,CAChC,kBDwBA,CAEA,8BA5BF,uBA6BI,2BAA4B,CAC5B,uBAEJ,CADE","file":"Radio-df9a5c02.css","sourcesContent":[".Radio {\n border-radius: var(--borderRadius-full, 100vh);\n transition:\n background-color,\n border-color 80ms cubic-bezier(0.33, 1, 0.68, 1); /* checked -> unchecked - add 120ms delay to fully see animation-out */\n\n &:where(:checked) {\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--control-checked-fgColor-rest);\n\n /* using bgColor here to avoid a border change in dark high contrast */\n /* stylelint-disable-next-line primer/colors */\n border-color: var(--control-checked-bgColor-rest);\n border-width: var(--borderWidth-thicker);\n\n &:disabled {\n cursor: not-allowed;\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--fgColor-muted);\n /* stylelint-disable-next-line primer/colors */\n border-color: var(--fgColor-muted);\n }\n }\n\n &:focus-visible {\n @mixin focusOutline 2px;\n }\n\n @media (forced-colors: active) {\n background-color: canvastext;\n border-color: canvastext;\n }\n}\n","@define-mixin focusOutline $outlineOffset: -2px, $outlineColor: var(--focus-outlineColor) {\n outline: 2px solid $outlineColor;\n outline-offset: $outlineOffset;\n box-shadow: none;\n}\n"]}
|
package/lib-esm/Select/Select.js
CHANGED
|
@@ -64,7 +64,7 @@ const ArrowIndicator = t0 => {
|
|
|
64
64
|
};
|
|
65
65
|
const Select = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
66
66
|
var _ref, _defaultValue;
|
|
67
|
-
const $ = c(
|
|
67
|
+
const $ = c(41);
|
|
68
68
|
let block;
|
|
69
69
|
let children;
|
|
70
70
|
let className;
|
|
@@ -119,93 +119,101 @@ const Select = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
119
119
|
sx = $[11];
|
|
120
120
|
validationStatus = $[12];
|
|
121
121
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if ($[13] !== className || $[14] !== t2) {
|
|
126
|
-
t3 = clsx(className, classes.Select, t2);
|
|
122
|
+
let t1;
|
|
123
|
+
if ($[13] !== className) {
|
|
124
|
+
t1 = clsx(classes.TextInputWrapper, className);
|
|
127
125
|
$[13] = className;
|
|
128
|
-
$[14] =
|
|
126
|
+
$[14] = t1;
|
|
127
|
+
} else {
|
|
128
|
+
t1 = $[14];
|
|
129
|
+
}
|
|
130
|
+
const t2 = validationStatus === "error" ? "true" : "false";
|
|
131
|
+
const t3 = disabled && classes.Disabled;
|
|
132
|
+
let t4;
|
|
133
|
+
if ($[15] !== t3) {
|
|
134
|
+
t4 = clsx(classes.Select, t3);
|
|
129
135
|
$[15] = t3;
|
|
136
|
+
$[16] = t4;
|
|
130
137
|
} else {
|
|
131
|
-
|
|
138
|
+
t4 = $[16];
|
|
132
139
|
}
|
|
133
|
-
const
|
|
134
|
-
const
|
|
135
|
-
let
|
|
136
|
-
if ($[
|
|
137
|
-
|
|
140
|
+
const t5 = Boolean(placeholder);
|
|
141
|
+
const t6 = (_ref = (_defaultValue = defaultValue) !== null && _defaultValue !== void 0 ? _defaultValue : placeholder) !== null && _ref !== void 0 ? _ref : undefined;
|
|
142
|
+
let t7;
|
|
143
|
+
if ($[17] !== placeholder || $[18] !== required) {
|
|
144
|
+
t7 = placeholder && /*#__PURE__*/jsx("option", {
|
|
138
145
|
value: "",
|
|
139
146
|
disabled: required,
|
|
140
147
|
hidden: required,
|
|
141
148
|
children: placeholder
|
|
142
149
|
});
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
150
|
+
$[17] = placeholder;
|
|
151
|
+
$[18] = required;
|
|
152
|
+
$[19] = t7;
|
|
146
153
|
} else {
|
|
147
|
-
|
|
154
|
+
t7 = $[19];
|
|
148
155
|
}
|
|
149
|
-
let
|
|
150
|
-
if ($[
|
|
151
|
-
|
|
156
|
+
let t8;
|
|
157
|
+
if ($[20] !== children || $[21] !== disabled || $[22] !== ref || $[23] !== required || $[24] !== rest || $[25] !== t2 || $[26] !== t4 || $[27] !== t5 || $[28] !== t6 || $[29] !== t7) {
|
|
158
|
+
t8 = /*#__PURE__*/jsxs("select", {
|
|
152
159
|
...rest,
|
|
153
160
|
ref: ref,
|
|
154
161
|
required: required,
|
|
155
162
|
disabled: disabled,
|
|
156
|
-
"aria-invalid":
|
|
157
|
-
className:
|
|
158
|
-
"data-hasplaceholder":
|
|
159
|
-
defaultValue:
|
|
160
|
-
children: [
|
|
163
|
+
"aria-invalid": t2,
|
|
164
|
+
className: t4,
|
|
165
|
+
"data-hasplaceholder": t5,
|
|
166
|
+
defaultValue: t6,
|
|
167
|
+
children: [t7, children]
|
|
161
168
|
});
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
$[25] = t3;
|
|
169
|
+
$[20] = children;
|
|
170
|
+
$[21] = disabled;
|
|
171
|
+
$[22] = ref;
|
|
172
|
+
$[23] = required;
|
|
173
|
+
$[24] = rest;
|
|
174
|
+
$[25] = t2;
|
|
169
175
|
$[26] = t4;
|
|
170
176
|
$[27] = t5;
|
|
171
177
|
$[28] = t6;
|
|
172
178
|
$[29] = t7;
|
|
179
|
+
$[30] = t8;
|
|
173
180
|
} else {
|
|
174
|
-
|
|
181
|
+
t8 = $[30];
|
|
175
182
|
}
|
|
176
|
-
let
|
|
177
|
-
if ($[
|
|
178
|
-
|
|
183
|
+
let t9;
|
|
184
|
+
if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
|
|
185
|
+
t9 = /*#__PURE__*/jsx(ArrowIndicator, {
|
|
179
186
|
className: classes.ArrowIndicator
|
|
180
187
|
});
|
|
181
|
-
$[
|
|
188
|
+
$[31] = t9;
|
|
182
189
|
} else {
|
|
183
|
-
|
|
190
|
+
t9 = $[31];
|
|
184
191
|
}
|
|
185
|
-
let
|
|
186
|
-
if ($[
|
|
187
|
-
|
|
192
|
+
let t10;
|
|
193
|
+
if ($[32] !== block || $[33] !== contrast || $[34] !== disabled || $[35] !== size || $[36] !== sx || $[37] !== t1 || $[38] !== t8 || $[39] !== validationStatus) {
|
|
194
|
+
t10 = /*#__PURE__*/jsxs(TextInputWrapper, {
|
|
188
195
|
block: block,
|
|
189
196
|
contrast: contrast,
|
|
190
197
|
disabled: disabled,
|
|
191
198
|
size: size,
|
|
192
199
|
validationStatus: validationStatus,
|
|
193
|
-
className:
|
|
200
|
+
className: t1,
|
|
194
201
|
sx: sx,
|
|
195
|
-
children: [
|
|
202
|
+
children: [t8, t9]
|
|
196
203
|
});
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
204
|
+
$[32] = block;
|
|
205
|
+
$[33] = contrast;
|
|
206
|
+
$[34] = disabled;
|
|
207
|
+
$[35] = size;
|
|
208
|
+
$[36] = sx;
|
|
209
|
+
$[37] = t1;
|
|
210
|
+
$[38] = t8;
|
|
211
|
+
$[39] = validationStatus;
|
|
212
|
+
$[40] = t10;
|
|
205
213
|
} else {
|
|
206
|
-
|
|
214
|
+
t10 = $[40];
|
|
207
215
|
}
|
|
208
|
-
return
|
|
216
|
+
return t10;
|
|
209
217
|
});
|
|
210
218
|
const Option = props => {
|
|
211
219
|
const $ = c(2);
|
|
@@ -11,7 +11,7 @@ import { FilteredActionListLoadingTypes } from '../FilteredActionList/FilteredAc
|
|
|
11
11
|
import { announceFromElement, announce } from '@primer/live-region-element';
|
|
12
12
|
import classes from './SelectPanel.module.css.js';
|
|
13
13
|
import { clsx } from 'clsx';
|
|
14
|
-
import { debounce } from '
|
|
14
|
+
import { debounce } from '@github/mini-throttle';
|
|
15
15
|
import { useResponsiveValue } from '../hooks/useResponsiveValue.js';
|
|
16
16
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
17
17
|
import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
import type { To } from 'history';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
4
|
-
import type { SxProp } from '../sx';
|
|
5
|
-
type StyledSubNavProps = React.ComponentProps<'nav'> & {
|
|
3
|
+
export type SubNavProps = React.ComponentProps<'nav'> & {
|
|
6
4
|
actions?: React.ReactNode;
|
|
7
5
|
align?: 'right';
|
|
8
6
|
full?: boolean;
|
|
9
7
|
label?: string;
|
|
10
|
-
}
|
|
11
|
-
type
|
|
12
|
-
type
|
|
8
|
+
};
|
|
9
|
+
export type SubNavLinksProps = React.ComponentProps<'div'>;
|
|
10
|
+
export type SubNavLinkProps = React.ComponentProps<'a'> & {
|
|
13
11
|
to?: To;
|
|
14
12
|
selected?: boolean;
|
|
15
|
-
}
|
|
16
|
-
declare const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export type SubNavProps = ComponentProps<typeof SubNav>;
|
|
20
|
-
export type SubNavLinksProps = ComponentProps<typeof SubNavLinks>;
|
|
21
|
-
export type SubNavLinkProps = ComponentProps<typeof SubNavLink>;
|
|
22
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<StyledSubNavProps, "ref"> & React.RefAttributes<HTMLElement>> & {
|
|
23
|
-
Link: React.ForwardRefExoticComponent<Omit<StyledSubNavLinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
24
|
-
Links: React.ForwardRefExoticComponent<Omit<StyledSubNavLinksProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<SubNavProps, "ref"> & React.RefAttributes<HTMLElement>> & {
|
|
15
|
+
Link: React.ForwardRefExoticComponent<Omit<SubNavLinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
16
|
+
Links: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
17
|
};
|
|
26
18
|
export default _default;
|
|
27
19
|
//# sourceMappingURL=SubNav.d.ts.map
|
package/lib-esm/SubNav/SubNav.js
CHANGED
|
@@ -2,7 +2,6 @@ import { c } from 'react-compiler-runtime';
|
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import styles from './SubNav.module.css.js';
|
|
5
|
-
import { BoxWithFallback } from '../internal/components/BoxWithFallback.js';
|
|
6
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
6
|
|
|
8
7
|
const SubNav = /*#__PURE__*/React.forwardRef(function SubNav(t0, forwardRef) {
|
|
@@ -72,8 +71,7 @@ const SubNav = /*#__PURE__*/React.forwardRef(function SubNav(t0, forwardRef) {
|
|
|
72
71
|
}
|
|
73
72
|
let t5;
|
|
74
73
|
if ($[13] !== forwardRef || $[14] !== label || $[15] !== rest || $[16] !== t1 || $[17] !== t3 || $[18] !== t4) {
|
|
75
|
-
t5 = /*#__PURE__*/jsxs(
|
|
76
|
-
as: "nav",
|
|
74
|
+
t5 = /*#__PURE__*/jsxs("nav", {
|
|
77
75
|
ref: forwardRef,
|
|
78
76
|
className: t1,
|
|
79
77
|
"aria-label": label,
|
|
@@ -126,7 +124,7 @@ const SubNavLinks = /*#__PURE__*/React.forwardRef((t0, forwardRef) => {
|
|
|
126
124
|
}
|
|
127
125
|
let t2;
|
|
128
126
|
if ($[6] !== children || $[7] !== forwardRef || $[8] !== rest || $[9] !== t1) {
|
|
129
|
-
t2 = /*#__PURE__*/jsx(
|
|
127
|
+
t2 = /*#__PURE__*/jsx("div", {
|
|
130
128
|
ref: forwardRef,
|
|
131
129
|
className: t1,
|
|
132
130
|
...rest,
|
|
@@ -176,8 +174,7 @@ const SubNavLink = /*#__PURE__*/React.forwardRef((t0, forwardRef) => {
|
|
|
176
174
|
}
|
|
177
175
|
let t2;
|
|
178
176
|
if ($[6] !== children || $[7] !== forwardRef || $[8] !== rest || $[9] !== t1) {
|
|
179
|
-
t2 = /*#__PURE__*/jsx(
|
|
180
|
-
as: "a",
|
|
177
|
+
t2 = /*#__PURE__*/jsx("a", {
|
|
181
178
|
ref: forwardRef,
|
|
182
179
|
className: t1,
|
|
183
180
|
"data-selected": rest.selected,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "38.0.0-rc.0",
|
|
4
4
|
"description": "An implementation of GitHub's Primer Design System using React",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -82,8 +82,9 @@
|
|
|
82
82
|
"npm": ">=7"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
+
"@github/mini-throttle": "^2.1.1",
|
|
85
86
|
"@github/relative-time-element": "^4.4.5",
|
|
86
|
-
"@github/tab-container-element": "4.8.2",
|
|
87
|
+
"@github/tab-container-element": "^4.8.2",
|
|
87
88
|
"@lit-labs/react": "1.2.1",
|
|
88
89
|
"@oddbird/popover-polyfill": "^0.5.2",
|
|
89
90
|
"@primer/behaviors": "^1.8.0",
|
|
@@ -147,7 +148,6 @@
|
|
|
147
148
|
"@types/react-dom": "18.3.1",
|
|
148
149
|
"@types/react-is": "18.3.1",
|
|
149
150
|
"@types/react-test-renderer": "18.3.1",
|
|
150
|
-
"@types/semver": "7.7.0",
|
|
151
151
|
"@types/styled-components": "^5.1.26",
|
|
152
152
|
"@vitejs/plugin-react": "^4.3.3",
|
|
153
153
|
"afterframe": "^1.0.2",
|
|
@@ -192,7 +192,6 @@
|
|
|
192
192
|
"rollup-plugin-import-css": "^0.0.0",
|
|
193
193
|
"rollup-plugin-postcss": "4.0.2",
|
|
194
194
|
"rollup-plugin-visualizer": "6.0.3",
|
|
195
|
-
"semver": "7.7.1",
|
|
196
195
|
"storybook": "^9.1.0",
|
|
197
196
|
"styled-components": "5.3.11",
|
|
198
197
|
"terser": "5.36.0",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
@keyframes prc-ProgressBar-shimmer-i1RxN{0%{mask-position:200%}to{mask-position:0}}.prc-ProgressBar-ProgressBarItem-stL6O{background-color:var(--progress-bg);width:var(--progress-width)}@media (prefers-reduced-motion:no-preference){.prc-ProgressBar-ProgressBarItem-stL6O[data-animated=true]{animation-duration:1s;animation-iteration-count:infinite;animation-name:prc-ProgressBar-shimmer-i1RxN;mask-image:linear-gradient(75deg,#000 30%,rgba(0,0,0,.65) 80%);mask-size:200%}}.prc-ProgressBar-ProgressBarContainer-E-z8S{background-color:var(--borderColor-default,var(--color-border-default));border-radius:var(--borderRadius-small,.1875rem);display:flex;gap:2px;overflow:hidden}.prc-ProgressBar-ProgressBarContainer-E-z8S:where([data-progress-display=inline]){display:inline-flex}.prc-ProgressBar-ProgressBarContainer-E-z8S:where([data-progress-bar-size=default]){height:8px}.prc-ProgressBar-ProgressBarContainer-E-z8S:where([data-progress-bar-size=small]){height:5px}.prc-ProgressBar-ProgressBarContainer-E-z8S:where([data-progress-bar-size=large]){height:10px}
|
|
2
|
-
/*# sourceMappingURL=ProgressBar-430cdef7.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ProgressBar/ProgressBar.module.css"],"names":[],"mappings":"AAAA,yCACE,GACE,kBACF,CAEA,GACE,eACF,CACF,CAEA,uCAGE,mCAAoC,CAFpC,2BAaF,CATE,8CACE,2DAIE,qBAAsB,CACtB,kCAAmC,CAFnC,4CAAuB,CAFvB,8DAAqE,CACrE,cAIF,CACF,CAGF,4CAIE,uEAA4C,CAC5C,gDAAwC,CAJxC,YAAa,CAKb,OAAQ,CAJR,eAqBF,CAfE,kFACE,mBACF,CAEA,oFACE,UACF,CAEA,kFACE,UACF,CAEA,kFACE,WACF","file":"ProgressBar-430cdef7.css","sourcesContent":["@keyframes shimmer {\n from {\n mask-position: 200%;\n }\n\n to {\n mask-position: 0%;\n }\n}\n\n.ProgressBarItem {\n width: var(--progress-width);\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--progress-bg);\n\n @media (prefers-reduced-motion: no-preference) {\n &[data-animated='true'] {\n mask-image: linear-gradient(75deg, #000 30%, rgba(0, 0, 0, 0.65) 80%);\n mask-size: 200%;\n animation-name: shimmer;\n animation-duration: 1s;\n animation-iteration-count: infinite;\n }\n }\n}\n\n.ProgressBarContainer {\n display: flex;\n overflow: hidden;\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--borderColor-default);\n border-radius: var(--borderRadius-small);\n gap: 2px;\n\n &:where([data-progress-display='inline']) {\n display: inline-flex;\n }\n\n &:where([data-progress-bar-size='default']) {\n height: 8px;\n }\n\n &:where([data-progress-bar-size='small']) {\n height: 5px;\n }\n\n &:where([data-progress-bar-size='large']) {\n height: 10px;\n }\n}\n"]}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function throttle(callback, wait = 0, { start = true, middle = true, once = false } = {}) {
|
|
4
|
-
let innerStart = start;
|
|
5
|
-
let last = 0;
|
|
6
|
-
let timer;
|
|
7
|
-
let cancelled = false;
|
|
8
|
-
function fn(...args) {
|
|
9
|
-
if (cancelled)
|
|
10
|
-
return;
|
|
11
|
-
const delta = Date.now() - last;
|
|
12
|
-
last = Date.now();
|
|
13
|
-
if (start && middle && delta >= wait) {
|
|
14
|
-
innerStart = true;
|
|
15
|
-
}
|
|
16
|
-
if (innerStart) {
|
|
17
|
-
innerStart = false;
|
|
18
|
-
callback.apply(this, args);
|
|
19
|
-
if (once)
|
|
20
|
-
fn.cancel();
|
|
21
|
-
}
|
|
22
|
-
else if ((middle && delta < wait) || !middle) {
|
|
23
|
-
clearTimeout(timer);
|
|
24
|
-
timer = setTimeout(() => {
|
|
25
|
-
last = Date.now();
|
|
26
|
-
callback.apply(this, args);
|
|
27
|
-
if (once)
|
|
28
|
-
fn.cancel();
|
|
29
|
-
}, !middle ? wait : wait - delta);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
fn.cancel = () => {
|
|
33
|
-
clearTimeout(timer);
|
|
34
|
-
cancelled = true;
|
|
35
|
-
};
|
|
36
|
-
return fn;
|
|
37
|
-
}
|
|
38
|
-
function debounce(callback, wait = 0, { start = false, middle = false, once = false } = {}) {
|
|
39
|
-
return throttle(callback, wait, { start, middle, once });
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
exports.debounce = debounce;
|
|
43
|
-
exports.throttle = throttle;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
@keyframes prc-ProgressBar-shimmer-i1RxN{0%{mask-position:200%}to{mask-position:0}}.prc-ProgressBar-ProgressBarItem-stL6O{background-color:var(--progress-bg);width:var(--progress-width)}@media (prefers-reduced-motion:no-preference){.prc-ProgressBar-ProgressBarItem-stL6O[data-animated=true]{animation-duration:1s;animation-iteration-count:infinite;animation-name:prc-ProgressBar-shimmer-i1RxN;mask-image:linear-gradient(75deg,#000 30%,rgba(0,0,0,.65) 80%);mask-size:200%}}.prc-ProgressBar-ProgressBarContainer-E-z8S{background-color:var(--borderColor-default,var(--color-border-default));border-radius:var(--borderRadius-small,.1875rem);display:flex;gap:2px;overflow:hidden}.prc-ProgressBar-ProgressBarContainer-E-z8S:where([data-progress-display=inline]){display:inline-flex}.prc-ProgressBar-ProgressBarContainer-E-z8S:where([data-progress-bar-size=default]){height:8px}.prc-ProgressBar-ProgressBarContainer-E-z8S:where([data-progress-bar-size=small]){height:5px}.prc-ProgressBar-ProgressBarContainer-E-z8S:where([data-progress-bar-size=large]){height:10px}
|
|
2
|
-
/*# sourceMappingURL=ProgressBar-430cdef7.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ProgressBar/ProgressBar.module.css"],"names":[],"mappings":"AAAA,yCACE,GACE,kBACF,CAEA,GACE,eACF,CACF,CAEA,uCAGE,mCAAoC,CAFpC,2BAaF,CATE,8CACE,2DAIE,qBAAsB,CACtB,kCAAmC,CAFnC,4CAAuB,CAFvB,8DAAqE,CACrE,cAIF,CACF,CAGF,4CAIE,uEAA4C,CAC5C,gDAAwC,CAJxC,YAAa,CAKb,OAAQ,CAJR,eAqBF,CAfE,kFACE,mBACF,CAEA,oFACE,UACF,CAEA,kFACE,UACF,CAEA,kFACE,WACF","file":"ProgressBar-430cdef7.css","sourcesContent":["@keyframes shimmer {\n from {\n mask-position: 200%;\n }\n\n to {\n mask-position: 0%;\n }\n}\n\n.ProgressBarItem {\n width: var(--progress-width);\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--progress-bg);\n\n @media (prefers-reduced-motion: no-preference) {\n &[data-animated='true'] {\n mask-image: linear-gradient(75deg, #000 30%, rgba(0, 0, 0, 0.65) 80%);\n mask-size: 200%;\n animation-name: shimmer;\n animation-duration: 1s;\n animation-iteration-count: infinite;\n }\n }\n}\n\n.ProgressBarContainer {\n display: flex;\n overflow: hidden;\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--borderColor-default);\n border-radius: var(--borderRadius-small);\n gap: 2px;\n\n &:where([data-progress-display='inline']) {\n display: inline-flex;\n }\n\n &:where([data-progress-bar-size='default']) {\n height: 8px;\n }\n\n &:where([data-progress-bar-size='small']) {\n height: 5px;\n }\n\n &:where([data-progress-bar-size='large']) {\n height: 10px;\n }\n}\n"]}
|