@primer/react 38.4.0-rc.fc59a24d1 → 38.4.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 CHANGED
@@ -8,11 +8,19 @@
8
8
 
9
9
  - [#7250](https://github.com/primer/react/pull/7250) [`a193d30`](https://github.com/primer/react/commit/a193d30cad6e308e2f0cc29ebdcc926ee057f0fb) Thanks [@siddharthkp](https://github.com/siddharthkp)! - Banner: Add `flush` prop for use within confined spaces, such as dialogs, tables, cards, or boxes where available space is limited.
10
10
 
11
+ - [#7247](https://github.com/primer/react/pull/7247) [`e1021e7`](https://github.com/primer/react/commit/e1021e7a5b65c605d98f025a30ef4fb5cce91024) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - Add leadingVisual to InlineMessage component.
12
+
11
13
  - [#7047](https://github.com/primer/react/pull/7047) [`c07dd71`](https://github.com/primer/react/commit/c07dd71e990323a1c73ec99c44752df43d153090) Thanks [@TylerJDev](https://github.com/TylerJDev)! - Remove the feature flag for `primer_react_segmented_control_tooltip` and GA tooltip by default behavior.
12
14
  - Ensure that when `disabled` is applied, the tooltip is still triggered.
13
15
 
14
16
  ### Patch Changes
15
17
 
18
+ - [#7244](https://github.com/primer/react/pull/7244) [`d973c5a`](https://github.com/primer/react/commit/d973c5ad5aa59c66e1f609558b33a6b63880234a) Thanks [@lukasoppermann](https://github.com/lukasoppermann)! - "Update logic for how hex codes are applied"
19
+
20
+ - [#7230](https://github.com/primer/react/pull/7230) [`534ca11`](https://github.com/primer/react/commit/534ca119a2552bb71684c64d2e7481cf426023b6) Thanks [@mperrotti](https://github.com/mperrotti)! - Replaces 'aria-live' usage and removes internal LiveRegion component
21
+
22
+ - [#7267](https://github.com/primer/react/pull/7267) [`1d8759a`](https://github.com/primer/react/commit/1d8759aae8a3bdd1dc2b8bc8785867ca467b72b5) Thanks [@lukasoppermann](https://github.com/lukasoppermann)! - Used correct tokens for disabled radio control
23
+
16
24
  - [#7241](https://github.com/primer/react/pull/7241) [`181f12e`](https://github.com/primer/react/commit/181f12e1244ea1f33559976ff16e32a1777e877d) Thanks [@francinelucca](https://github.com/francinelucca)! - fix(LabelGroup): add role and aria-label to hidden items overlay
17
25
 
18
26
  ## 38.3.0
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/DataTable/Pagination.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAMhE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACtF;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;IAE3C;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;IAE9C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAMD,wBAAgB,UAAU,CAAC,EACzB,YAAY,EAAE,KAAK,EACnB,gBAAgB,EAChB,EAAE,EACF,QAAQ,EACR,QAAa,EACb,SAA4B,EAC5B,UAAU,GACX,EAAE,eAAe,qBAwGjB;AAwDD,KAAK,eAAe,GAAG;IACrB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA"}
1
+ {"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/DataTable/Pagination.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAMhE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACtF;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;IAE3C;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;IAE9C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAMD,wBAAgB,UAAU,CAAC,EACzB,YAAY,EAAE,KAAK,EACnB,gBAAgB,EAChB,EAAE,EACF,QAAQ,EACR,QAAa,EACb,SAA4B,EAC5B,UAAU,GACX,EAAE,eAAe,qBAqGjB;AA4DD,KAAK,eAAe,GAAG;IACrB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA"}
@@ -2,7 +2,6 @@ import { c } from 'react-compiler-runtime';
2
2
  import { ChevronLeftIcon, ChevronRightIcon } from '@primer/octicons-react';
3
3
  import { useState } from 'react';
4
4
  import { Button } from '../internal/components/ButtonReset.js';
5
- import { LiveRegionOutlet, LiveRegion, Message } from '../internal/components/LiveRegion.js';
6
5
  import { warning } from '../utils/warning.js';
7
6
  import { viewportRanges } from '../hooks/useResponsiveValue.js';
8
7
  import { buildPaginationModel } from '../Pagination/model.js';
@@ -10,12 +9,13 @@ import classes from './Pagination.module.css.js';
10
9
  import { clsx } from 'clsx';
11
10
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
12
11
  import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.js';
12
+ import { AriaStatus } from '../live-region/AriaStatus.js';
13
13
 
14
14
  const defaultShowPages = {
15
15
  narrow: false
16
16
  };
17
17
  function Pagination(t0) {
18
- const $ = c(61);
18
+ const $ = c(60);
19
19
  const {
20
20
  "aria-label": label,
21
21
  defaultPageIndex,
@@ -87,119 +87,112 @@ function Pagination(t0) {
87
87
  const model = t7;
88
88
  let t8;
89
89
  if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
90
- t8 = /*#__PURE__*/jsx(LiveRegionOutlet, {});
90
+ t8 = clsx("TablePagination", classes.TablePagination);
91
91
  $[11] = t8;
92
92
  } else {
93
93
  t8 = $[11];
94
94
  }
95
95
  let t9;
96
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
97
- t9 = clsx("TablePagination", classes.TablePagination);
98
- $[12] = t9;
99
- } else {
100
- t9 = $[12];
101
- }
102
- let t10;
103
- if ($[13] !== pageEnd || $[14] !== pageStart || $[15] !== totalCount) {
104
- t10 = /*#__PURE__*/jsx(Range, {
96
+ if ($[12] !== pageEnd || $[13] !== pageStart || $[14] !== totalCount) {
97
+ t9 = /*#__PURE__*/jsx(Range, {
105
98
  pageStart: pageStart,
106
99
  pageEnd: pageEnd,
107
100
  totalCount: totalCount
108
101
  });
109
- $[13] = pageEnd;
110
- $[14] = pageStart;
111
- $[15] = totalCount;
102
+ $[12] = pageEnd;
103
+ $[13] = pageStart;
104
+ $[14] = totalCount;
105
+ $[15] = t9;
106
+ } else {
107
+ t9 = $[15];
108
+ }
109
+ let t10;
110
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
111
+ t10 = clsx("TablePaginationSteps", classes.TablePaginationSteps);
112
112
  $[16] = t10;
113
113
  } else {
114
114
  t10 = $[16];
115
115
  }
116
116
  let t11;
117
- if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
118
- t11 = clsx("TablePaginationSteps", classes.TablePaginationSteps);
119
- $[17] = t11;
120
- } else {
121
- t11 = $[17];
122
- }
123
- let t12;
124
- if ($[18] !== getViewportRangesToHidePages) {
125
- t12 = getViewportRangesToHidePages();
126
- $[18] = getViewportRangesToHidePages;
127
- $[19] = t12;
128
- } else {
129
- t12 = $[19];
130
- }
131
- const t13 = t12.join(" ");
132
- let t14;
133
- if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
134
- t14 = clsx("TablePaginationAction", classes.TablePaginationAction);
135
- $[20] = t14;
136
- } else {
137
- t14 = $[20];
138
- }
139
- const t15 = hasPreviousPage ? true : undefined;
140
- const t16 = !hasPreviousPage ? true : undefined;
141
- let t17;
142
- if ($[21] !== hasPreviousPage || $[22] !== selectPreviousPage) {
143
- t17 = () => {
117
+ if ($[17] !== getViewportRangesToHidePages) {
118
+ t11 = getViewportRangesToHidePages();
119
+ $[17] = getViewportRangesToHidePages;
120
+ $[18] = t11;
121
+ } else {
122
+ t11 = $[18];
123
+ }
124
+ const t12 = t11.join(" ");
125
+ let t13;
126
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
127
+ t13 = clsx("TablePaginationAction", classes.TablePaginationAction);
128
+ $[19] = t13;
129
+ } else {
130
+ t13 = $[19];
131
+ }
132
+ const t14 = hasPreviousPage ? true : undefined;
133
+ const t15 = !hasPreviousPage ? true : undefined;
134
+ let t16;
135
+ if ($[20] !== hasPreviousPage || $[21] !== selectPreviousPage) {
136
+ t16 = () => {
144
137
  if (!hasPreviousPage) {
145
138
  return;
146
139
  }
147
140
  selectPreviousPage();
148
141
  };
149
- $[21] = hasPreviousPage;
150
- $[22] = selectPreviousPage;
151
- $[23] = t17;
142
+ $[20] = hasPreviousPage;
143
+ $[21] = selectPreviousPage;
144
+ $[22] = t16;
152
145
  } else {
153
- t17 = $[23];
146
+ t16 = $[22];
154
147
  }
155
- let t18;
156
- if ($[24] !== hasPreviousPage) {
157
- t18 = hasPreviousPage ? /*#__PURE__*/jsx(ChevronLeftIcon, {}) : null;
158
- $[24] = hasPreviousPage;
159
- $[25] = t18;
148
+ let t17;
149
+ if ($[23] !== hasPreviousPage) {
150
+ t17 = hasPreviousPage ? /*#__PURE__*/jsx(ChevronLeftIcon, {}) : null;
151
+ $[23] = hasPreviousPage;
152
+ $[24] = t17;
160
153
  } else {
161
- t18 = $[25];
154
+ t17 = $[24];
162
155
  }
156
+ let t18;
163
157
  let t19;
164
- let t20;
165
- if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
166
- t19 = /*#__PURE__*/jsx("span", {
158
+ if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
159
+ t18 = /*#__PURE__*/jsx("span", {
167
160
  children: "Previous"
168
161
  });
169
- t20 = /*#__PURE__*/jsx(VisuallyHidden, {
162
+ t19 = /*#__PURE__*/jsx(VisuallyHidden, {
170
163
  children: "\xA0page"
171
164
  });
165
+ $[25] = t18;
172
166
  $[26] = t19;
173
- $[27] = t20;
174
167
  } else {
168
+ t18 = $[25];
175
169
  t19 = $[26];
176
- t20 = $[27];
177
170
  }
178
- let t21;
179
- if ($[28] !== t15 || $[29] !== t16 || $[30] !== t17 || $[31] !== t18) {
180
- t21 = /*#__PURE__*/jsx(Step, {
171
+ let t20;
172
+ if ($[27] !== t14 || $[28] !== t15 || $[29] !== t16 || $[30] !== t17) {
173
+ t20 = /*#__PURE__*/jsx(Step, {
181
174
  children: /*#__PURE__*/jsxs(Button, {
182
- className: t14,
175
+ className: t13,
183
176
  type: "button",
184
- "data-has-page": t15,
185
- "aria-disabled": t16,
186
- onClick: t17,
187
- children: [t18, t19, t20]
177
+ "data-has-page": t14,
178
+ "aria-disabled": t15,
179
+ onClick: t16,
180
+ children: [t17, t18, t19]
188
181
  })
189
182
  });
183
+ $[27] = t14;
190
184
  $[28] = t15;
191
185
  $[29] = t16;
192
186
  $[30] = t17;
193
- $[31] = t18;
194
- $[32] = t21;
187
+ $[31] = t20;
195
188
  } else {
196
- t21 = $[32];
189
+ t20 = $[31];
197
190
  }
198
- let t22;
199
- if ($[33] !== model || $[34] !== selectPage) {
200
- let t23;
201
- if ($[36] !== selectPage) {
202
- t23 = (page, i) => {
191
+ let t21;
192
+ if ($[32] !== model || $[33] !== selectPage) {
193
+ let t22;
194
+ if ($[35] !== selectPage) {
195
+ t22 = (page, i) => {
203
196
  if (page.type === "BREAK") {
204
197
  return /*#__PURE__*/jsx(TruncationStep, {}, `truncation-${i}`);
205
198
  } else {
@@ -218,121 +211,119 @@ function Pagination(t0) {
218
211
  }
219
212
  }
220
213
  };
221
- $[36] = selectPage;
222
- $[37] = t23;
214
+ $[35] = selectPage;
215
+ $[36] = t22;
223
216
  } else {
224
- t23 = $[37];
217
+ t22 = $[36];
225
218
  }
226
- t22 = model.map(t23);
227
- $[33] = model;
228
- $[34] = selectPage;
229
- $[35] = t22;
219
+ t21 = model.map(t22);
220
+ $[32] = model;
221
+ $[33] = selectPage;
222
+ $[34] = t21;
230
223
  } else {
231
- t22 = $[35];
224
+ t21 = $[34];
232
225
  }
233
- let t23;
234
- if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
235
- t23 = clsx("TablePaginationAction", classes.TablePaginationAction);
236
- $[38] = t23;
226
+ let t22;
227
+ if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
228
+ t22 = clsx("TablePaginationAction", classes.TablePaginationAction);
229
+ $[37] = t22;
237
230
  } else {
238
- t23 = $[38];
231
+ t22 = $[37];
239
232
  }
240
- const t24 = hasNextPage ? true : undefined;
241
- const t25 = !hasNextPage ? true : undefined;
242
- let t26;
243
- if ($[39] !== hasNextPage || $[40] !== selectNextPage) {
244
- t26 = () => {
233
+ const t23 = hasNextPage ? true : undefined;
234
+ const t24 = !hasNextPage ? true : undefined;
235
+ let t25;
236
+ if ($[38] !== hasNextPage || $[39] !== selectNextPage) {
237
+ t25 = () => {
245
238
  if (!hasNextPage) {
246
239
  return;
247
240
  }
248
241
  selectNextPage();
249
242
  };
250
- $[39] = hasNextPage;
251
- $[40] = selectNextPage;
252
- $[41] = t26;
243
+ $[38] = hasNextPage;
244
+ $[39] = selectNextPage;
245
+ $[40] = t25;
253
246
  } else {
254
- t26 = $[41];
247
+ t25 = $[40];
255
248
  }
249
+ let t26;
256
250
  let t27;
257
- let t28;
258
- if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
259
- t27 = /*#__PURE__*/jsx("span", {
251
+ if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
252
+ t26 = /*#__PURE__*/jsx("span", {
260
253
  children: "Next"
261
254
  });
262
- t28 = /*#__PURE__*/jsx(VisuallyHidden, {
255
+ t27 = /*#__PURE__*/jsx(VisuallyHidden, {
263
256
  children: "\xA0page"
264
257
  });
258
+ $[41] = t26;
265
259
  $[42] = t27;
266
- $[43] = t28;
267
260
  } else {
261
+ t26 = $[41];
268
262
  t27 = $[42];
269
- t28 = $[43];
270
263
  }
271
- let t29;
272
- if ($[44] !== hasNextPage) {
273
- t29 = hasNextPage ? /*#__PURE__*/jsx(ChevronRightIcon, {}) : null;
274
- $[44] = hasNextPage;
275
- $[45] = t29;
264
+ let t28;
265
+ if ($[43] !== hasNextPage) {
266
+ t28 = hasNextPage ? /*#__PURE__*/jsx(ChevronRightIcon, {}) : null;
267
+ $[43] = hasNextPage;
268
+ $[44] = t28;
276
269
  } else {
277
- t29 = $[45];
270
+ t28 = $[44];
278
271
  }
279
- let t30;
280
- if ($[46] !== t24 || $[47] !== t25 || $[48] !== t26 || $[49] !== t29) {
281
- t30 = /*#__PURE__*/jsx(Step, {
272
+ let t29;
273
+ if ($[45] !== t23 || $[46] !== t24 || $[47] !== t25 || $[48] !== t28) {
274
+ t29 = /*#__PURE__*/jsx(Step, {
282
275
  children: /*#__PURE__*/jsxs(Button, {
283
- className: t23,
276
+ className: t22,
284
277
  type: "button",
285
- "data-has-page": t24,
286
- "aria-disabled": t25,
287
- onClick: t26,
288
- children: [t27, t28, t29]
278
+ "data-has-page": t23,
279
+ "aria-disabled": t24,
280
+ onClick: t25,
281
+ children: [t26, t27, t28]
289
282
  })
290
283
  });
284
+ $[45] = t23;
291
285
  $[46] = t24;
292
286
  $[47] = t25;
293
- $[48] = t26;
287
+ $[48] = t28;
294
288
  $[49] = t29;
295
- $[50] = t30;
296
289
  } else {
297
- t30 = $[50];
290
+ t29 = $[49];
298
291
  }
299
- let t31;
300
- if ($[51] !== t13 || $[52] !== t21 || $[53] !== t22 || $[54] !== t30) {
301
- t31 = /*#__PURE__*/jsxs("ol", {
302
- className: t11,
303
- "data-hidden-viewport-ranges": t13,
304
- children: [t21, t22, t30]
292
+ let t30;
293
+ if ($[50] !== t12 || $[51] !== t20 || $[52] !== t21 || $[53] !== t29) {
294
+ t30 = /*#__PURE__*/jsxs("ol", {
295
+ className: t10,
296
+ "data-hidden-viewport-ranges": t12,
297
+ children: [t20, t21, t29]
305
298
  });
306
- $[51] = t13;
299
+ $[50] = t12;
300
+ $[51] = t20;
307
301
  $[52] = t21;
308
- $[53] = t22;
302
+ $[53] = t29;
309
303
  $[54] = t30;
310
- $[55] = t31;
311
- } else {
312
- t31 = $[55];
313
- }
314
- let t32;
315
- if ($[56] !== id || $[57] !== label || $[58] !== t10 || $[59] !== t31) {
316
- t32 = /*#__PURE__*/jsxs(LiveRegion, {
317
- children: [t8, /*#__PURE__*/jsxs("nav", {
318
- "aria-label": label,
319
- className: t9,
320
- id: id,
321
- children: [t10, t31]
322
- })]
304
+ } else {
305
+ t30 = $[54];
306
+ }
307
+ let t31;
308
+ if ($[55] !== id || $[56] !== label || $[57] !== t30 || $[58] !== t9) {
309
+ t31 = /*#__PURE__*/jsxs("nav", {
310
+ "aria-label": label,
311
+ className: t8,
312
+ id: id,
313
+ children: [t9, t30]
323
314
  });
324
- $[56] = id;
325
- $[57] = label;
326
- $[58] = t10;
315
+ $[55] = id;
316
+ $[56] = label;
317
+ $[57] = t30;
318
+ $[58] = t9;
327
319
  $[59] = t31;
328
- $[60] = t32;
329
320
  } else {
330
- t32 = $[60];
321
+ t31 = $[59];
331
322
  }
332
- return t32;
323
+ return t31;
333
324
  }
334
325
  function Range(t0) {
335
- const $ = c(12);
326
+ const $ = c(14);
336
327
  const {
337
328
  pageStart,
338
329
  pageEnd,
@@ -340,65 +331,68 @@ function Range(t0) {
340
331
  } = t0;
341
332
  const start = pageStart + 1;
342
333
  const end = pageEnd;
343
- const t1 = `Showing ${start} through ${end} of ${totalCount}`;
344
- let t2;
345
- if ($[0] !== t1) {
346
- t2 = /*#__PURE__*/jsx(Message, {
347
- value: t1
334
+ let t1;
335
+ if ($[0] !== end || $[1] !== start || $[2] !== totalCount) {
336
+ t1 = /*#__PURE__*/jsx(VisuallyHidden, {
337
+ children: /*#__PURE__*/jsxs(AriaStatus, {
338
+ children: ["Showing ", start, " through ", end, " of ", totalCount]
339
+ })
348
340
  });
349
- $[0] = t1;
350
- $[1] = t2;
341
+ $[0] = end;
342
+ $[1] = start;
343
+ $[2] = totalCount;
344
+ $[3] = t1;
351
345
  } else {
352
- t2 = $[1];
346
+ t1 = $[3];
353
347
  }
354
- let t3;
355
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
356
- t3 = clsx("TablePaginationRange", classes.TablePaginationRange);
357
- $[2] = t3;
348
+ let t2;
349
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
350
+ t2 = clsx("TablePaginationRange", classes.TablePaginationRange);
351
+ $[4] = t2;
358
352
  } else {
359
- t3 = $[2];
353
+ t2 = $[4];
360
354
  }
355
+ let t3;
361
356
  let t4;
362
- let t5;
363
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
364
- t4 = /*#__PURE__*/jsx(VisuallyHidden, {
357
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
358
+ t3 = /*#__PURE__*/jsx(VisuallyHidden, {
365
359
  children: "\xA0through\xA0"
366
360
  });
367
- t5 = /*#__PURE__*/jsx("span", {
361
+ t4 = /*#__PURE__*/jsx("span", {
368
362
  "aria-hidden": "true",
369
363
  children: "\u2012"
370
364
  });
371
- $[3] = t4;
372
- $[4] = t5;
365
+ $[5] = t3;
366
+ $[6] = t4;
373
367
  } else {
374
- t4 = $[3];
375
- t5 = $[4];
368
+ t3 = $[5];
369
+ t4 = $[6];
376
370
  }
377
- let t6;
378
- if ($[5] !== end || $[6] !== start || $[7] !== totalCount) {
379
- t6 = /*#__PURE__*/jsxs("p", {
380
- className: t3,
381
- children: [start, t4, t5, end, " of ", totalCount]
371
+ let t5;
372
+ if ($[7] !== end || $[8] !== start || $[9] !== totalCount) {
373
+ t5 = /*#__PURE__*/jsxs("p", {
374
+ className: t2,
375
+ children: [start, t3, t4, end, " of ", totalCount]
382
376
  });
383
- $[5] = end;
384
- $[6] = start;
385
- $[7] = totalCount;
386
- $[8] = t6;
377
+ $[7] = end;
378
+ $[8] = start;
379
+ $[9] = totalCount;
380
+ $[10] = t5;
387
381
  } else {
388
- t6 = $[8];
382
+ t5 = $[10];
389
383
  }
390
- let t7;
391
- if ($[9] !== t2 || $[10] !== t6) {
392
- t7 = /*#__PURE__*/jsxs(Fragment, {
393
- children: [t2, t6]
384
+ let t6;
385
+ if ($[11] !== t1 || $[12] !== t5) {
386
+ t6 = /*#__PURE__*/jsxs(Fragment, {
387
+ children: [t1, t5]
394
388
  });
395
- $[9] = t2;
396
- $[10] = t6;
397
- $[11] = t7;
389
+ $[11] = t1;
390
+ $[12] = t5;
391
+ $[13] = t6;
398
392
  } else {
399
- t7 = $[11];
393
+ t6 = $[13];
400
394
  }
401
- return t7;
395
+ return t6;
402
396
  }
403
397
  function TruncationStep() {
404
398
  const $ = c(1);
@@ -9,7 +9,11 @@ export type InlineMessageProps = React.ComponentPropsWithoutRef<'div'> & {
9
9
  * Specify the type of the InlineMessage
10
10
  */
11
11
  variant: MessageVariant;
12
+ /**
13
+ * A custom leading visual (icon or other element) to display instead of the default variant icon.
14
+ */
15
+ leadingVisual?: React.ElementType | React.ReactNode;
12
16
  };
13
- export declare function InlineMessage({ children, className, size, variant, ...rest }: InlineMessageProps): React.JSX.Element;
17
+ export declare function InlineMessage({ children, className, size, variant, leadingVisual: LeadingVisual, ...rest }: InlineMessageProps): React.JSX.Element;
14
18
  export {};
15
19
  //# sourceMappingURL=InlineMessage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InlineMessage.d.ts","sourceRoot":"","sources":["../../src/InlineMessage/InlineMessage.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,KAAK,cAAc,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAA;AAExE,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,GAAG;IACvE;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IAEzB;;OAEG;IACH,OAAO,EAAE,cAAc,CAAA;CACxB,CAAA;AAgBD,wBAAgB,aAAa,CAAC,EAAC,QAAQ,EAAE,SAAS,EAAE,IAAe,EAAE,OAAO,EAAE,GAAG,IAAI,EAAC,EAAE,kBAAkB,qBASzG"}
1
+ {"version":3,"file":"InlineMessage.d.ts","sourceRoot":"","sources":["../../src/InlineMessage/InlineMessage.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,KAAK,cAAc,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAA;AAExE,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,GAAG;IACvE;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IAEzB;;OAEG;IACH,OAAO,EAAE,cAAc,CAAA;IAEvB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAA;CACpD,CAAA;AAgBD,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,IAAe,EACf,OAAO,EACP,aAAa,EAAE,aAAa,EAC5B,GAAG,IAAI,EACR,EAAE,kBAAkB,qBAoBpB"}
@@ -1,6 +1,7 @@
1
1
  import { c } from 'react-compiler-runtime';
2
2
  import { AlertFillIcon, CheckCircleFillIcon, AlertIcon, CheckCircleIcon } from '@primer/octicons-react';
3
3
  import { clsx } from 'clsx';
4
+ import { isValidElementType } from 'react-is';
4
5
  import classes from './InlineMessage.module.css.js';
5
6
  import { jsxs, jsx } from 'react/jsx-runtime';
6
7
 
@@ -37,7 +38,8 @@ const smallIcons = {
37
38
  })
38
39
  };
39
40
  function InlineMessage(t0) {
40
- const $ = c(15);
41
+ const $ = c(18);
42
+ let LeadingVisual;
41
43
  let children;
42
44
  let className;
43
45
  let rest;
@@ -49,33 +51,55 @@ function InlineMessage(t0) {
49
51
  className,
50
52
  size: t1,
51
53
  variant,
54
+ leadingVisual: LeadingVisual,
52
55
  ...rest
53
56
  } = t0);
54
57
  $[0] = t0;
55
- $[1] = children;
56
- $[2] = className;
57
- $[3] = rest;
58
- $[4] = t1;
59
- $[5] = variant;
58
+ $[1] = LeadingVisual;
59
+ $[2] = children;
60
+ $[3] = className;
61
+ $[4] = rest;
62
+ $[5] = t1;
63
+ $[6] = variant;
60
64
  } else {
61
- children = $[1];
62
- className = $[2];
63
- rest = $[3];
64
- t1 = $[4];
65
- variant = $[5];
65
+ LeadingVisual = $[1];
66
+ children = $[2];
67
+ className = $[3];
68
+ rest = $[4];
69
+ t1 = $[5];
70
+ variant = $[6];
66
71
  }
67
72
  const size = t1 === undefined ? "medium" : t1;
68
- const icon = size === "small" ? smallIcons[variant] : icons[variant];
73
+ let icon;
74
+ if (LeadingVisual !== undefined) {
75
+ if (typeof LeadingVisual !== "string" && isValidElementType(LeadingVisual)) {
76
+ let t2;
77
+ if ($[7] !== LeadingVisual) {
78
+ t2 = /*#__PURE__*/jsx(LeadingVisual, {
79
+ className: classes.InlineMessageIcon
80
+ });
81
+ $[7] = LeadingVisual;
82
+ $[8] = t2;
83
+ } else {
84
+ t2 = $[8];
85
+ }
86
+ icon = t2;
87
+ } else {
88
+ icon = LeadingVisual;
89
+ }
90
+ } else {
91
+ icon = size === "small" ? smallIcons[variant] : icons[variant];
92
+ }
69
93
  let t2;
70
- if ($[6] !== className) {
94
+ if ($[9] !== className) {
71
95
  t2 = clsx(className, classes.InlineMessage);
72
- $[6] = className;
73
- $[7] = t2;
96
+ $[9] = className;
97
+ $[10] = t2;
74
98
  } else {
75
- t2 = $[7];
99
+ t2 = $[10];
76
100
  }
77
101
  let t3;
78
- if ($[8] !== children || $[9] !== icon || $[10] !== rest || $[11] !== size || $[12] !== t2 || $[13] !== variant) {
102
+ if ($[11] !== children || $[12] !== icon || $[13] !== rest || $[14] !== size || $[15] !== t2 || $[16] !== variant) {
79
103
  t3 = /*#__PURE__*/jsxs("div", {
80
104
  ...rest,
81
105
  className: t2,
@@ -83,15 +107,15 @@ function InlineMessage(t0) {
83
107
  "data-variant": variant,
84
108
  children: [icon, children]
85
109
  });
86
- $[8] = children;
87
- $[9] = icon;
88
- $[10] = rest;
89
- $[11] = size;
90
- $[12] = t2;
91
- $[13] = variant;
92
- $[14] = t3;
110
+ $[11] = children;
111
+ $[12] = icon;
112
+ $[13] = rest;
113
+ $[14] = size;
114
+ $[15] = t2;
115
+ $[16] = variant;
116
+ $[17] = t3;
93
117
  } else {
94
- t3 = $[14];
118
+ t3 = $[17];
95
119
  }
96
120
  return t3;
97
121
  }
@@ -0,0 +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(--control-checked-fgColor-disabled,var(--color-switch-track-checked-disabled-fg));border-color:var(--control-checked-bgColor-disabled,var(--color-switch-track-disabled-bg));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-4319e717.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,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"]}
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,sGAAyD,CAEzD,0FAAqD,CAJrD,kBAKF,CAGF,qCCrBA,eAAgB,CAFhB,kEAAgC,CAChC,kBDwBA,CAEA,8BA5BF,uBA6BI,2BAA4B,CAC5B,uBAEJ,CADE","file":"Radio-4319e717.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(--control-checked-fgColor-disabled);\n /* stylelint-disable-next-line primer/colors */\n border-color: var(--control-checked-bgColor-disabled);\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"]}
@@ -1,4 +1,4 @@
1
- import './Radio-df9a5c02.css';
1
+ import './Radio-4319e717.css';
2
2
 
3
3
  var classes = {"Radio":"prc-Radio-Radio-Ly4MR"};
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"TreeView.d.ts","sourceRoot":"","sources":["../../src/TreeView/TreeView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,IAAI,EACV,MAAM,wBAAwB,CAAA;AAE/B,OAAO,KAA+B,MAAM,OAAO,CAAA;AAsBnD,OAAO,KAAK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;;CAQnB,CAAA"}
@@ -19,6 +19,7 @@ import { ActionList } from '../ActionList/index.js';
19
19
  import { isSlot } from '../utils/is-slot.js';
20
20
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
21
21
  import { useIsMacOS } from '../hooks/useIsMacOS.js';
22
+ import { AriaStatus } from '../live-region/AriaStatus.js';
22
23
  import Spinner from '../Spinner/Spinner.js';
23
24
  import { Tooltip } from '../TooltipV2/Tooltip.js';
24
25
  import Text from '../Text/Text.js';
@@ -26,9 +27,6 @@ import { SkeletonAvatar } from '../SkeletonAvatar/SkeletonAvatar.js';
26
27
  import { SkeletonText } from '../SkeletonText/SkeletonText.js';
27
28
  import { getAccessibleKeybindingHintString } from '../KeybindingHint/KeybindingHint.js';
28
29
 
29
- // ----------------------------------------------------------------------------
30
- // Context
31
-
32
30
  const RootContext = /*#__PURE__*/React.createContext({
33
31
  announceUpdate: () => {},
34
32
  expandedStateCache: {
@@ -153,10 +151,10 @@ const Root = t0 => {
153
151
  let t9;
154
152
  if ($[8] !== ariaLiveMessage) {
155
153
  t9 = /*#__PURE__*/jsx(VisuallyHidden, {
156
- role: "status",
157
- "aria-live": "polite",
158
- "aria-atomic": "true",
159
- children: ariaLiveMessage
154
+ children: /*#__PURE__*/jsx(AriaStatus, {
155
+ announceOnShow: true,
156
+ children: ariaLiveMessage
157
+ })
160
158
  });
161
159
  $[8] = ariaLiveMessage;
162
160
  $[9] = t9;
@@ -1 +1 @@
1
- {"version":3,"file":"IssueLabel.d.ts","sourceRoot":"","sources":["../../../src/experimental/IssueLabel/IssueLabel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,KAAK,GAAG,GAAG,IAAI,MAAM,EAAE,CAAA;AAEvB,KAAK,iBAAiB,GAClB,QAAQ,GACR,MAAM,GACN,OAAO,GACP,OAAO,GACP,MAAM,GACN,MAAM,GACN,OAAO,GACP,QAAQ,GACR,OAAO,GACP,MAAM,GACN,OAAO,GACP,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,EAAE,MAAM,CAAA;CACb,CAAA;AAEH,KAAK,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,GACtE,SAAS,GAAG;IACV,EAAE,CAAC,EAAE,KAAK,CAAA;IACV,OAAO,CAAC,EAAE,KAAK,CAAA;IACf,IAAI,CAAC,EAAE,KAAK,CAAA;CACb,CAAA;AAEH,KAAK,iBAAiB,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,IAAI;IACrD,EAAE,EAAE,EAAE,CAAA;CACP,GAAG,SAAS,GACX,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,EAAE,CAAC,EAAE,MAAM,SAAS,CAAC,CAAA;AAE3D,KAAK,eAAe,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,IAAI,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAA;AAEhH,iBAAS,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,KAAK,CAAC,SAAS,CAAA;AACtD,iBAAS,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,KAAK,CAAC,SAAS,CAAA;AACtD,iBAAS,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,KAAK,CAAC,SAAS,CAAA;AACxD,iBAAS,UAAU,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,iBAAiB,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,SAAS,CAAA;AAqDhG,OAAO,EAAC,UAAU,EAAC,CAAA;AACnB,YAAY,EAAC,eAAe,EAAE,GAAG,EAAC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { c } from 'react-compiler-runtime';
2
2
  import { clsx } from 'clsx';
3
- import { getColorsFromHex } from './getColorFromHex.js';
4
3
  import classes from './IssueLabel.module.css.js';
4
+ import { readableColor } from 'color2k';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
 
7
7
  function IssueLabel(t0) {
@@ -50,7 +50,8 @@ function IssueLabel(t0) {
50
50
  if ($[9] !== fillColor || $[10] !== style) {
51
51
  t4 = fillColor ? {
52
52
  ...style,
53
- ...getColorsFromHex(fillColor)
53
+ backgroundColor: fillColor,
54
+ color: readableColor(fillColor)
54
55
  } : style;
55
56
  $[9] = fillColor;
56
57
  $[10] = style;
@@ -1 +1 @@
1
- {"version":3,"file":"SelectPanel.d.ts","sourceRoot":"","sources":["../../../src/experimental/SelectPanel2/SelectPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AAGvE,OAAO,KAAK,EAAC,WAAW,EAAE,cAAc,EAAmB,SAAS,EAAE,aAAa,EAAC,MAAM,aAAa,CAAA;AAevG,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAA;AAMvD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAA;AAInE,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAC,gBAAgB,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAA;AA2BvE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,eAAe,CAAC,UAAU,GAAG,OAAO,EAAE,aAAa,GAAG,cAAc,CAAC,CAAA;IACtG,gBAAgB,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAA;IACpD,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IACrD,wBAAwB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAEpD,Q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K,CAAC,iBAAiB;;;CAiEnF,CAAA"}
@@ -14,6 +14,7 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
14
14
  import { useProvidedRefOrCreate } from '../../hooks/useProvidedRefOrCreate.js';
15
15
  import { useId } from '../../hooks/useId.js';
16
16
  import { useAnchoredPosition } from '../../hooks/useAnchoredPosition.js';
17
+ import { AriaStatus } from '../../live-region/AriaStatus.js';
17
18
  import Octicon from '../../Octicon/Octicon.js';
18
19
  import TextInput from '../../TextInput/TextInput.js';
19
20
  import { useFormControlForwardedProps } from '../../FormControl/_FormControlContext.js';
@@ -23,7 +24,6 @@ import Checkbox from '../../Checkbox/Checkbox.js';
23
24
  import { IconButton } from '../../Button/IconButton.js';
24
25
  import Heading from '../../Heading/Heading.js';
25
26
  import Spinner from '../../Spinner/Spinner.js';
26
- import { AriaStatus } from '../../live-region/AriaStatus.js';
27
27
 
28
28
  const SelectPanelContext = /*#__PURE__*/React.createContext({
29
29
  title: '',
@@ -932,9 +932,9 @@ const SelectPanelMessage = ({
932
932
  title,
933
933
  children
934
934
  }) => {
935
+ const MessageWrapper = variant === 'empty' ? 'div' : AriaStatus;
935
936
  if (size === 'full') {
936
- return /*#__PURE__*/jsxs("div", {
937
- "aria-live": variant === 'empty' ? undefined : 'polite',
937
+ return /*#__PURE__*/jsxs(MessageWrapper, {
938
938
  className: classes.MessageFull,
939
939
  children: [variant !== 'empty' ? /*#__PURE__*/jsx(Octicon, {
940
940
  icon: AlertIcon,
@@ -948,8 +948,7 @@ const SelectPanelMessage = ({
948
948
  })]
949
949
  });
950
950
  } else {
951
- return /*#__PURE__*/jsxs("div", {
952
- "aria-live": variant === 'empty' ? undefined : 'polite',
951
+ return /*#__PURE__*/jsxs(MessageWrapper, {
953
952
  className: classes.MessageInline,
954
953
  "data-variant": variant,
955
954
  children: [/*#__PURE__*/jsx(AlertIcon, {
@@ -3616,6 +3616,12 @@
3616
3616
  "description": "Specify the type of the inline message",
3617
3617
  "type": "'critical' | 'success' | 'unvailable' | 'warning'",
3618
3618
  "required": true
3619
+ },
3620
+ {
3621
+ "name": "leadingVisual",
3622
+ "description": "A custom leading visual to display instead of the default variant icon.",
3623
+ "type": "React.ElementType | React.ReactNode",
3624
+ "required": false
3619
3625
  }
3620
3626
  ]
3621
3627
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@primer/react",
3
3
  "type": "module",
4
- "version": "38.4.0-rc.fc59a24d1",
4
+ "version": "38.4.0",
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",
@@ -116,11 +116,11 @@
116
116
  "@rollup/plugin-terser": "0.4.4",
117
117
  "@rollup/plugin-typescript": "12.3.0",
118
118
  "@rollup/plugin-virtual": "3.0.2",
119
- "@storybook/addon-a11y": "^9.1.10",
120
- "@storybook/addon-docs": "^9.1.10",
121
- "@storybook/addon-links": "^9.1.10",
122
- "@storybook/icons": "^1.6.0",
123
- "@storybook/react-vite": "^9.1.10",
119
+ "@storybook/addon-a11y": "^10.1.2",
120
+ "@storybook/addon-docs": "^10.1.2",
121
+ "@storybook/addon-links": "^10.1.2",
122
+ "@storybook/icons": "^2.0.1",
123
+ "@storybook/react-vite": "^10.1.2",
124
124
  "@testing-library/dom": "^10.4.0",
125
125
  "@testing-library/jest-dom": "^6.4.5",
126
126
  "@testing-library/react": "^16.3.0",
@@ -172,11 +172,11 @@
172
172
  "react-is": "18.3.1",
173
173
  "recast": "0.23.7",
174
174
  "rimraf": "5.0.5",
175
- "rollup": "4.53.1",
175
+ "rollup": "4.53.3",
176
176
  "rollup-plugin-import-css": "^0.0.0",
177
177
  "rollup-plugin-postcss": "4.0.2",
178
178
  "rollup-plugin-visualizer": "6.0.5",
179
- "storybook": "^9.1.10",
179
+ "storybook": "^10.1.2",
180
180
  "terser": "5.36.0",
181
181
  "ts-toolbelt": "9.6.0",
182
182
  "tsx": "4.20.3",
@@ -1,2 +0,0 @@
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,8 +0,0 @@
1
- import type { Hex } from './IssueLabel';
2
- /**
3
- * transforms a hex color provided by the user into a color object with background and text colors
4
- * @param colorHex — the hex color provided by the user
5
- * @returns
6
- */
7
- export declare const getColorsFromHex: (colorHex: Hex) => React.CSSProperties | undefined;
8
- //# sourceMappingURL=getColorFromHex.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getColorFromHex.d.ts","sourceRoot":"","sources":["../../../src/experimental/IssueLabel/getColorFromHex.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,cAAc,CAAA;AAErC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAU,GAAG,KAAG,KAAK,CAAC,aAAa,GAAG,SA+EtE,CAAA"}
@@ -1,185 +0,0 @@
1
- import { getContrast } from 'color2k';
2
- import { Hsluv } from 'hsluv';
3
-
4
- /**
5
- * transforms a hex color provided by the user into a color object with background and text colors
6
- * @param colorHex — the hex color provided by the user
7
- * @returns
8
- */
9
- const getColorsFromHex = colorHex => {
10
- // start values for light mode
11
- const lightBgLightness = 96;
12
- const lightLightnessIncrement = -1;
13
- const lightRatio = 4.5;
14
- const darkBgLightness = 16;
15
- const darkLightnessIncrement = 1;
16
- const darkRatio = 5.5;
17
-
18
- // get hue and saturation value from hex color
19
- // eslint-disable-next-line prefer-const
20
- let {
21
- h,
22
- s
23
- } = hexToHsluv(colorHex);
24
-
25
- // avoid intense bright colors
26
- // Hue range: 58 - 198
27
- // 58 marks the transition from yellow to yellow-green
28
- // 198 makes the tranisiton from cyan to blue
29
- // yellow, yellow-green, green, cyan, blue tend to be bright and intense
30
- // Setting the hue range of 58 and 198 helps avoid bright colors
31
- // saturation: represents the intensity of a color, measured as a percentage from 0 to 100. Capping at 70% to avoid intense bright colors
32
- if (h >= 58 && h <= 198 && s > 70) {
33
- s = 70;
34
- }
35
- /**
36
- * creating a background color from the provided hex color
37
- */
38
- const {
39
- colorHex: darkBackgroundColor,
40
- lightness: darkCurrentBgLightness
41
- } = getColorWithContrast(hsluvToHex({
42
- h,
43
- s,
44
- l: darkBgLightness
45
- }), '#0d1117',
46
- // dark mode background color
47
- 1.2, darkLightnessIncrement);
48
-
49
- /**
50
- * creating a background color from the provided hex color
51
- */
52
- const {
53
- colorHex: lightBackgroundColor,
54
- lightness: lightCurrentBgLightness
55
- } = getColorWithContrast(hsluvToHex({
56
- h,
57
- s,
58
- l: lightBgLightness
59
- }), '#ffffff',
60
- // light mode background color
61
- 1.2, lightLightnessIncrement);
62
-
63
- // avoid intense bright colors
64
- if (h >= 58 && h <= 316 && s > 80) {
65
- s = 80;
66
- }
67
- /**
68
- * creating a text color from with a contrast ratio of at least 4.5 to the generated background color
69
- */
70
- const {
71
- colorHex: darkTextColor
72
- } = getColorWithContrast(hsluvToHex({
73
- h,
74
- s,
75
- l: 50
76
- }), darkBackgroundColor, darkRatio, darkLightnessIncrement);
77
- const {
78
- colorHex: lightTextColor
79
- } = getColorWithContrast(hsluvToHex({
80
- h,
81
- s,
82
- l: 50
83
- }), lightBackgroundColor, lightRatio, lightLightnessIncrement);
84
- return {
85
- '--label-bgColor-light-rest': lightBackgroundColor,
86
- '--label-bgColor-light-hover': hsluvToHex({
87
- h,
88
- s,
89
- l: lightCurrentBgLightness + 4 * lightLightnessIncrement
90
- }),
91
- '--label-bgColor-light-active': hsluvToHex({
92
- h,
93
- s,
94
- l: lightCurrentBgLightness + 8 * lightLightnessIncrement
95
- }),
96
- '--label-fgColor-light': lightTextColor,
97
- '--label-fgColor-light-hover': lightTextColor,
98
- '--label-fgColor-light-active': lightTextColor,
99
- '--label-bgColor-dark-rest': darkBackgroundColor,
100
- '--label-bgColor-dark-hover': hsluvToHex({
101
- h,
102
- s,
103
- l: darkCurrentBgLightness + 4 * darkLightnessIncrement
104
- }),
105
- '--label-bgColor-dark-active': hsluvToHex({
106
- h,
107
- s,
108
- l: darkCurrentBgLightness + 8 * darkLightnessIncrement
109
- }),
110
- '--label-fgColor-dark': darkTextColor,
111
- '--label-fgColor-dark-hover': darkTextColor,
112
- '--label-fgColor-dark-active': darkTextColor
113
- };
114
- };
115
- /**
116
- * Changes the lightness of a hex color until the contrast ratio is reached and returns the new hex color
117
- * @param colorHex — initial hex color
118
- * @param bgHex — color to check the contrast against
119
- * @param contrastRatio — the contrast ratio to reach
120
- * @param increment — the direction to change the lightness depending on the color scheme
121
- * @returns the new hex color
122
- */
123
- const getColorWithContrast = (fgColor, bgColor, contrastRatio, increment) => {
124
- const hsluv = hexToHsluv(fgColor);
125
- let color = fgColor;
126
-
127
- // change lightness until contrast is reached
128
- while (getContrast(color, bgColor) < contrastRatio && hsluv.l > 0 && hsluv.l < 100) {
129
- hsluv.l += increment;
130
- color = hsluvToHex(hsluv);
131
- }
132
- return {
133
- colorHex: color,
134
- lightness: hsluv.l
135
- };
136
- };
137
-
138
- /**
139
- * Takes a hex value and returns the hue, saturation and lightness for HSLuv as an object
140
- * @param hex user provided hex string
141
- * @returns an object with the hue, saturation and lightness values
142
- */
143
- const hexToHsluv = hex => {
144
- // convert hex to hsluv
145
- const color = new Hsluv();
146
- color.hex = hex;
147
- color.hexToHsluv();
148
- // extract h, s and l values
149
- const {
150
- hsluv_h: h,
151
- hsluv_s: s,
152
- hsluv_l: l
153
- } = color;
154
- // return h, s, l as an object
155
- return {
156
- h,
157
- s,
158
- l
159
- };
160
- };
161
- /**
162
- * Takes an object with hue, saturation and lightness values and returns a hex string
163
- * @param hex user provided hex string
164
- * @returns an object with the hue, saturation and lightness values
165
- */
166
- const hsluvToHex = ({
167
- h,
168
- s,
169
- l
170
- }) => {
171
- // create a new HSLuv color object and assign values
172
- const color = new Hsluv();
173
- // eslint-disable-next-line camelcase
174
- color.hsluv_h = h;
175
- // eslint-disable-next-line camelcase
176
- color.hsluv_s = s;
177
- // eslint-disable-next-line camelcase
178
- color.hsluv_l = l;
179
- // convert hsluv to hex
180
- color.hsluvToHex();
181
- // return hex string
182
- return color.hex;
183
- };
184
-
185
- export { getColorsFromHex };
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- type LiveRegionContext = {
3
- announce: (message: string) => void;
4
- message: string;
5
- };
6
- declare const LiveRegionContext: React.Context<LiveRegionContext | null>;
7
- declare function useLiveRegion(): LiveRegionContext;
8
- declare function LiveRegion({ children }: React.PropsWithChildren): React.JSX.Element;
9
- declare function LiveRegionOutlet(): React.JSX.Element;
10
- declare function Message({ value }: {
11
- value: string;
12
- }): null;
13
- export { LiveRegion, LiveRegionOutlet, Message, useLiveRegion };
14
- //# sourceMappingURL=LiveRegion.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LiveRegion.d.ts","sourceRoot":"","sources":["../../../src/internal/components/LiveRegion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,QAAA,MAAM,iBAAiB,yCAAsD,CAAA;AAE7E,iBAAS,aAAa,sBAMrB;AAED,iBAAS,UAAU,CAAC,EAAC,QAAQ,EAAC,EAAE,KAAK,CAAC,iBAAiB,qBAUtD;AAED,iBAAS,gBAAgB,sBAOxB;AAED,iBAAS,OAAO,CAAC,EAAC,KAAK,EAAC,EAAE;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,QA6BxC;AAED,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAE,OAAO,EAAE,aAAa,EAAC,CAAA"}
@@ -1,130 +0,0 @@
1
- import { c } from 'react-compiler-runtime';
2
- import React from 'react';
3
- import { jsx } from 'react/jsx-runtime';
4
- import { VisuallyHidden } from '../../VisuallyHidden/VisuallyHidden.js';
5
-
6
- const LiveRegionContext = /*#__PURE__*/React.createContext(null);
7
- function useLiveRegion() {
8
- const context = React.useContext(LiveRegionContext);
9
- if (!context) {
10
- throw new Error("useLiveRegion() must be used within a <LiveRegion>");
11
- }
12
- return context;
13
- }
14
- function LiveRegion(t0) {
15
- const $ = c(5);
16
- const {
17
- children
18
- } = t0;
19
- const [message, setMessage] = React.useState("");
20
- let t1;
21
- if ($[0] !== message) {
22
- t1 = {
23
- announce: setMessage,
24
- message
25
- };
26
- $[0] = message;
27
- $[1] = t1;
28
- } else {
29
- t1 = $[1];
30
- }
31
- const value = t1;
32
- let t2;
33
- if ($[2] !== children || $[3] !== value) {
34
- t2 = /*#__PURE__*/jsx(LiveRegionContext.Provider, {
35
- value: value,
36
- children: children
37
- });
38
- $[2] = children;
39
- $[3] = value;
40
- $[4] = t2;
41
- } else {
42
- t2 = $[4];
43
- }
44
- return t2;
45
- }
46
- function LiveRegionOutlet() {
47
- const $ = c(2);
48
- const liveRegion = useLiveRegion();
49
- let t0;
50
- if ($[0] !== liveRegion.message) {
51
- t0 = /*#__PURE__*/jsx(VisuallyHidden, {
52
- role: "status",
53
- "aria-live": "polite",
54
- "aria-atomic": true,
55
- children: liveRegion.message
56
- });
57
- $[0] = liveRegion.message;
58
- $[1] = t0;
59
- } else {
60
- t0 = $[1];
61
- }
62
- return t0;
63
- }
64
- function Message(t0) {
65
- const $ = c(8);
66
- const {
67
- value
68
- } = t0;
69
- const liveRegion = useLiveRegion();
70
- const savedLiveRegion = React.useRef(liveRegion);
71
- const committedRef = React.useRef(false);
72
- let t1;
73
- let t2;
74
- if ($[0] !== liveRegion) {
75
- t1 = () => {
76
- savedLiveRegion.current = liveRegion;
77
- };
78
- t2 = [liveRegion];
79
- $[0] = liveRegion;
80
- $[1] = t1;
81
- $[2] = t2;
82
- } else {
83
- t1 = $[1];
84
- t2 = $[2];
85
- }
86
- React.useEffect(t1, t2);
87
- let t3;
88
- let t4;
89
- if ($[3] !== value) {
90
- t3 = () => {
91
- if (committedRef.current !== true) {
92
- return;
93
- }
94
- const timeoutId = setTimeout(() => {
95
- savedLiveRegion.current.announce(value);
96
- }, 750);
97
- return () => {
98
- clearTimeout(timeoutId);
99
- };
100
- };
101
- t4 = [value];
102
- $[3] = value;
103
- $[4] = t3;
104
- $[5] = t4;
105
- } else {
106
- t3 = $[4];
107
- t4 = $[5];
108
- }
109
- React.useEffect(t3, t4);
110
- let t5;
111
- let t6;
112
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
113
- t5 = () => {
114
- committedRef.current = true;
115
- return () => {
116
- committedRef.current = false;
117
- };
118
- };
119
- t6 = [];
120
- $[6] = t5;
121
- $[7] = t6;
122
- } else {
123
- t5 = $[6];
124
- t6 = $[7];
125
- }
126
- React.useEffect(t5, t6);
127
- return null;
128
- }
129
-
130
- export { LiveRegion, LiveRegionOutlet, Message, useLiveRegion };
@@ -1,7 +0,0 @@
1
- export declare function polyfill(): void;
2
- declare global {
3
- interface AddEventListenerOptions {
4
- signal?: AbortSignal;
5
- }
6
- }
7
- //# sourceMappingURL=eventListenerSignal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eventListenerSignal.d.ts","sourceRoot":"","sources":["../../src/polyfills/eventListenerSignal.ts"],"names":[],"mappings":"AAqDA,wBAAgB,QAAQ,IAAI,IAAI,CAK/B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,uBAAuB;QAC/B,MAAM,CAAC,EAAE,WAAW,CAAA;KACrB;CACF"}