@primer/react 38.45.0-rc.3d36dffa3 → 38.45.0-rc.cac8791d9
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 +4 -0
- package/dist/DataTable/DataTable.js +5 -0
- package/dist/DataTable/{Table-7f0e985b.css → Table-3916da1f.css} +2 -2
- package/dist/DataTable/Table-3916da1f.css.map +1 -0
- package/dist/DataTable/Table.module.css.js +3 -1
- package/dist/DataTable/TableGroup.d.ts +7 -1
- package/dist/DataTable/TableGroup.js +153 -120
- package/dist/DataTable/useTable.js +111 -83
- package/dist/SegmentedControl/SegmentedControl-3dc28307.css +2 -0
- package/dist/SegmentedControl/SegmentedControl-3dc28307.css.map +1 -0
- package/dist/SegmentedControl/SegmentedControl.module.css.js +1 -1
- package/dist/SegmentedControl/SegmentedControlButton.js +119 -76
- package/dist/TooltipV2/Tooltip.d.ts +1 -1
- package/dist/TooltipV2/Tooltip.js +128 -101
- package/generated/components.json +17 -2
- package/package.json +1 -1
- package/dist/DataTable/Table-7f0e985b.css.map +0 -1
- package/dist/SegmentedControl/SegmentedControl-99b8e34e.css +0 -2
- package/dist/SegmentedControl/SegmentedControl-99b8e34e.css.map +0 -1
|
@@ -4,7 +4,7 @@ import { DEFAULT_SORT_DIRECTION, SortDirection, strategies, transition } from ".
|
|
|
4
4
|
import { useId, useState } from "react";
|
|
5
5
|
//#region src/DataTable/useTable.ts
|
|
6
6
|
function useTable(t0) {
|
|
7
|
-
const $ = c(
|
|
7
|
+
const $ = c(82);
|
|
8
8
|
const { columns, data, initialSortColumn, initialSortDirection, externalSorting, getRowId, rowSelection: t1, selectedRows: controlledSelectedRows, defaultSelectedRows, onSelectionChange, isRowSelectable, collapsibleGroups: t2, expandedGroups: controlledExpandedGroups, defaultExpandedGroups, onExpandedGroupsChange } = t0;
|
|
9
9
|
const rowSelection = t1 === void 0 ? false : t1;
|
|
10
10
|
const collapsibleGroups = t2 === void 0 ? false : t2;
|
|
@@ -232,13 +232,17 @@ function useTable(t0) {
|
|
|
232
232
|
for (const item_0 of rowOrder) if (isDataTableRowGroup(item_0)) {
|
|
233
233
|
if (body.rows.length > 0) bodies.push(body);
|
|
234
234
|
const groupStartIndex = rowIndex_0;
|
|
235
|
+
const rows_1 = item_0.rows.map((row_1, index_2) => createRow(row_1, groupStartIndex + index_2));
|
|
236
|
+
const selectableRows = rows_1.filter(_temp2);
|
|
235
237
|
bodies.push({
|
|
236
238
|
type: "row-group",
|
|
237
239
|
key: `group:${typeof item_0.groupId}:${item_0.groupId}`,
|
|
238
240
|
id: item_0.groupId,
|
|
239
241
|
label: item_0.label,
|
|
240
|
-
rows:
|
|
242
|
+
rows: rows_1,
|
|
241
243
|
expanded: !collapsibleGroups || expandedGroups.has(item_0.groupId),
|
|
244
|
+
selection: selectableRows.length > 0 && selectableRows.every(_temp3) ? "all" : selectableRows.some(_temp4) ? "some" : "none",
|
|
245
|
+
selectable: selectableRows.length > 0,
|
|
242
246
|
"aria-label": item_0["aria-label"]
|
|
243
247
|
});
|
|
244
248
|
rowIndex_0 = rowIndex_0 + item_0.rows.length;
|
|
@@ -252,7 +256,7 @@ function useTable(t0) {
|
|
|
252
256
|
rowIndex_0 = rowIndex_0 + 1;
|
|
253
257
|
}
|
|
254
258
|
if (body.rows.length > 0 || bodies.length === 0) bodies.push(body);
|
|
255
|
-
t11 = bodies.flatMap(
|
|
259
|
+
t11 = bodies.flatMap(_temp5).filter(_temp6);
|
|
256
260
|
$[23] = collapsibleGroups;
|
|
257
261
|
$[24] = columns;
|
|
258
262
|
$[25] = data;
|
|
@@ -277,25 +281,25 @@ function useTable(t0) {
|
|
|
277
281
|
sortBy = $[39];
|
|
278
282
|
t11 = $[40];
|
|
279
283
|
}
|
|
280
|
-
const
|
|
284
|
+
const selectableRows_0 = t11;
|
|
281
285
|
let t12;
|
|
282
|
-
if ($[45] !==
|
|
283
|
-
t12 = new Set(
|
|
284
|
-
$[45] =
|
|
286
|
+
if ($[45] !== selectableRows_0) {
|
|
287
|
+
t12 = new Set(selectableRows_0.filter(_temp7).map(_temp8));
|
|
288
|
+
$[45] = selectableRows_0;
|
|
285
289
|
$[46] = t12;
|
|
286
290
|
} else t12 = $[46];
|
|
287
291
|
const effectiveSelectedRows = t12;
|
|
288
292
|
const selectedCount = effectiveSelectedRows.size;
|
|
289
|
-
const selectableCount =
|
|
293
|
+
const selectableCount = selectableRows_0.length;
|
|
290
294
|
const allSelected = selectableCount > 0 && selectedCount === selectableCount;
|
|
291
295
|
const someSelected = selectedCount > 0 && !allSelected;
|
|
292
296
|
let t13;
|
|
293
297
|
if ($[47] !== selectedRows || $[48] !== setSelectedRows) {
|
|
294
|
-
t13 = function toggleRowSelection(
|
|
295
|
-
if (!
|
|
298
|
+
t13 = function toggleRowSelection(row_8) {
|
|
299
|
+
if (!row_8.selectable) return;
|
|
296
300
|
const nextSelectedRows_0 = new Set(selectedRows);
|
|
297
|
-
if (nextSelectedRows_0.has(
|
|
298
|
-
else nextSelectedRows_0.add(
|
|
301
|
+
if (nextSelectedRows_0.has(row_8.selectionId)) nextSelectedRows_0.delete(row_8.selectionId);
|
|
302
|
+
else nextSelectedRows_0.add(row_8.selectionId);
|
|
299
303
|
setSelectedRows(nextSelectedRows_0);
|
|
300
304
|
};
|
|
301
305
|
$[47] = selectedRows;
|
|
@@ -303,109 +307,133 @@ function useTable(t0) {
|
|
|
303
307
|
$[49] = t13;
|
|
304
308
|
} else t13 = $[49];
|
|
305
309
|
const toggleRowSelection = t13;
|
|
306
|
-
let
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
+
let toggleAllRows;
|
|
311
|
+
let toggleGroupSelection;
|
|
312
|
+
if ($[50] !== allSelected || $[51] !== selectableRows_0 || $[52] !== selectedRows || $[53] !== setSelectedRows) {
|
|
313
|
+
toggleAllRows = function toggleAllRows() {
|
|
314
|
+
toggleRowsSelection(selectableRows_0, allSelected);
|
|
315
|
+
};
|
|
316
|
+
toggleGroupSelection = function toggleGroupSelection(group_0) {
|
|
317
|
+
toggleRowsSelection(group_0.rows.filter(_temp9), group_0.selection === "all");
|
|
318
|
+
};
|
|
319
|
+
function toggleRowsSelection(rows_2, allSelected_0) {
|
|
320
|
+
if (rows_2.length === 0) return;
|
|
310
321
|
const nextSelectedRows_1 = new Set(selectedRows);
|
|
311
|
-
for (const
|
|
312
|
-
else nextSelectedRows_1.add(
|
|
322
|
+
for (const row_10 of rows_2) if (allSelected_0) nextSelectedRows_1.delete(row_10.selectionId);
|
|
323
|
+
else nextSelectedRows_1.add(row_10.selectionId);
|
|
313
324
|
setSelectedRows(nextSelectedRows_1);
|
|
314
|
-
}
|
|
325
|
+
}
|
|
315
326
|
$[50] = allSelected;
|
|
316
|
-
$[51] =
|
|
327
|
+
$[51] = selectableRows_0;
|
|
317
328
|
$[52] = selectedRows;
|
|
318
329
|
$[53] = setSelectedRows;
|
|
319
|
-
$[54] =
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
330
|
+
$[54] = toggleAllRows;
|
|
331
|
+
$[55] = toggleGroupSelection;
|
|
332
|
+
} else {
|
|
333
|
+
toggleAllRows = $[54];
|
|
334
|
+
toggleGroupSelection = $[55];
|
|
335
|
+
}
|
|
336
|
+
let t14;
|
|
337
|
+
if ($[56] !== collapsibleGroups || $[57] !== expandedGroups || $[58] !== setExpandedGroups) {
|
|
338
|
+
t14 = function toggleGroupExpansion(group_1) {
|
|
325
339
|
if (!collapsibleGroups) return;
|
|
326
340
|
const nextExpandedGroups_0 = new Set(expandedGroups);
|
|
327
|
-
if (nextExpandedGroups_0.has(
|
|
328
|
-
else nextExpandedGroups_0.add(
|
|
341
|
+
if (nextExpandedGroups_0.has(group_1.id)) nextExpandedGroups_0.delete(group_1.id);
|
|
342
|
+
else nextExpandedGroups_0.add(group_1.id);
|
|
329
343
|
setExpandedGroups(nextExpandedGroups_0);
|
|
330
344
|
};
|
|
331
|
-
$[
|
|
332
|
-
$[
|
|
333
|
-
$[
|
|
334
|
-
$[
|
|
335
|
-
} else
|
|
336
|
-
const toggleGroupExpansion =
|
|
337
|
-
let
|
|
338
|
-
if ($[
|
|
339
|
-
|
|
345
|
+
$[56] = collapsibleGroups;
|
|
346
|
+
$[57] = expandedGroups;
|
|
347
|
+
$[58] = setExpandedGroups;
|
|
348
|
+
$[59] = t14;
|
|
349
|
+
} else t14 = $[59];
|
|
350
|
+
const toggleGroupExpansion = t14;
|
|
351
|
+
let t15;
|
|
352
|
+
if ($[60] !== setSelectedRows) {
|
|
353
|
+
t15 = () => {
|
|
340
354
|
setSelectedRows(/* @__PURE__ */ new Set());
|
|
341
355
|
};
|
|
342
|
-
$[
|
|
343
|
-
$[
|
|
344
|
-
} else
|
|
345
|
-
let
|
|
346
|
-
if ($[
|
|
347
|
-
|
|
356
|
+
$[60] = setSelectedRows;
|
|
357
|
+
$[61] = t15;
|
|
358
|
+
} else t15 = $[61];
|
|
359
|
+
let t16;
|
|
360
|
+
if ($[62] !== sortBy || $[63] !== t15 || $[64] !== toggleAllRows || $[65] !== toggleGroupExpansion || $[66] !== toggleGroupSelection || $[67] !== toggleRowSelection) {
|
|
361
|
+
t16 = {
|
|
348
362
|
sortBy,
|
|
349
363
|
toggleRowSelection,
|
|
350
364
|
toggleAllRows,
|
|
365
|
+
toggleGroupSelection,
|
|
351
366
|
toggleGroupExpansion,
|
|
352
|
-
clearSelection:
|
|
367
|
+
clearSelection: t15
|
|
353
368
|
};
|
|
354
|
-
$[
|
|
355
|
-
$[
|
|
356
|
-
$[
|
|
357
|
-
$[
|
|
358
|
-
$[
|
|
359
|
-
$[
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
369
|
+
$[62] = sortBy;
|
|
370
|
+
$[63] = t15;
|
|
371
|
+
$[64] = toggleAllRows;
|
|
372
|
+
$[65] = toggleGroupExpansion;
|
|
373
|
+
$[66] = toggleGroupSelection;
|
|
374
|
+
$[67] = toggleRowSelection;
|
|
375
|
+
$[68] = t16;
|
|
376
|
+
} else t16 = $[68];
|
|
377
|
+
const t17 = `${tableId}-selection-column`;
|
|
378
|
+
let t18;
|
|
379
|
+
if ($[69] !== allSelected || $[70] !== effectiveSelectedRows || $[71] !== selectableCount || $[72] !== selectedCount || $[73] !== someSelected || $[74] !== t17) {
|
|
380
|
+
t18 = {
|
|
381
|
+
headerId: t17,
|
|
366
382
|
selectedRows: effectiveSelectedRows,
|
|
367
383
|
allSelected,
|
|
368
384
|
someSelected,
|
|
369
385
|
selectableCount,
|
|
370
386
|
selectedCount
|
|
371
387
|
};
|
|
372
|
-
$[
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
379
|
-
} else
|
|
380
|
-
let
|
|
381
|
-
if ($[
|
|
382
|
-
|
|
388
|
+
$[69] = allSelected;
|
|
389
|
+
$[70] = effectiveSelectedRows;
|
|
390
|
+
$[71] = selectableCount;
|
|
391
|
+
$[72] = selectedCount;
|
|
392
|
+
$[73] = someSelected;
|
|
393
|
+
$[74] = t17;
|
|
394
|
+
$[75] = t18;
|
|
395
|
+
} else t18 = $[75];
|
|
396
|
+
let t19;
|
|
397
|
+
if ($[76] !== bodies || $[77] !== gridTemplateColumns || $[78] !== headers || $[79] !== t16 || $[80] !== t18) {
|
|
398
|
+
t19 = {
|
|
383
399
|
headers,
|
|
384
|
-
actions:
|
|
385
|
-
selection:
|
|
400
|
+
actions: t16,
|
|
401
|
+
selection: t18,
|
|
386
402
|
gridTemplateColumns,
|
|
387
403
|
bodies
|
|
388
404
|
};
|
|
389
|
-
$[
|
|
390
|
-
$[
|
|
391
|
-
$[
|
|
392
|
-
$[
|
|
393
|
-
$[
|
|
394
|
-
$[
|
|
395
|
-
} else
|
|
396
|
-
return
|
|
405
|
+
$[76] = bodies;
|
|
406
|
+
$[77] = gridTemplateColumns;
|
|
407
|
+
$[78] = headers;
|
|
408
|
+
$[79] = t16;
|
|
409
|
+
$[80] = t18;
|
|
410
|
+
$[81] = t19;
|
|
411
|
+
} else t19 = $[81];
|
|
412
|
+
return t19;
|
|
413
|
+
}
|
|
414
|
+
function _temp9(row_9) {
|
|
415
|
+
return row_9.selectable;
|
|
416
|
+
}
|
|
417
|
+
function _temp8(row_7) {
|
|
418
|
+
return row_7.selectionId;
|
|
397
419
|
}
|
|
398
|
-
function
|
|
399
|
-
return
|
|
420
|
+
function _temp7(row_6) {
|
|
421
|
+
return row_6.selected;
|
|
422
|
+
}
|
|
423
|
+
function _temp6(row_5) {
|
|
424
|
+
return row_5.selectable;
|
|
425
|
+
}
|
|
426
|
+
function _temp5(body_0) {
|
|
427
|
+
return body_0.rows;
|
|
400
428
|
}
|
|
401
429
|
function _temp4(row_3) {
|
|
402
430
|
return row_3.selected;
|
|
403
431
|
}
|
|
404
|
-
function _temp3(
|
|
405
|
-
return
|
|
432
|
+
function _temp3(row_4) {
|
|
433
|
+
return row_4.selected;
|
|
406
434
|
}
|
|
407
|
-
function _temp2(
|
|
408
|
-
return
|
|
435
|
+
function _temp2(row_2) {
|
|
436
|
+
return row_2.selectable;
|
|
409
437
|
}
|
|
410
438
|
function _temp(group) {
|
|
411
439
|
return group.groupId;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-SegmentedControl-SegmentedControl-lqIXp{--segmented-control-icon-width:32px;--segmented-control-outer-radius:var(--borderRadius-medium,0.375rem);background-color:var(--controlTrack-bgColor-rest,#e6eaef);border:var(--borderWidth-thin,.0625rem) solid var(--controlTrack-borderColor-rest,transparent);border-radius:var(--borderRadius-medium,.375rem);display:inline-flex;font-size:var(--text-body-size-medium,.875rem);height:32px;margin:0;max-width:100%;padding:0;position:relative}@supports (anchor-name:--value){.prc-SegmentedControl-SegmentedControl-lqIXp:before{position-anchor:--segmented-control-current-item;background-color:var(--controlKnob-bgColor-rest,#fff);border:var(--borderWidth-thin,.0625rem) solid var(--controlKnob-borderColor-rest,#d1d9e0);border-radius:var(--segmented-control-outer-radius);content:"";inset:anchor(top) anchor(right) anchor(bottom) anchor(left);position:absolute}@media (prefers-reduced-motion:no-preference){.prc-SegmentedControl-SegmentedControl-lqIXp:before{transition:inset var(--base-duration-200,[ object Object ]) var(--base-easing-easeInOut,.6,0,.2,1)}}.prc-SegmentedControl-SegmentedControl-lqIXp[data-disable-knob-transition]:before{transition:none}}.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width=true]{display:flex;width:100%;--segmented-control-icon-width:100%}.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width=false]{display:inline-flex;width:auto;--segmented-control-icon-width:32px}.prc-SegmentedControl-SegmentedControl-lqIXp>[data-component="SegmentedControl.Divider"]{align-self:stretch;background-color:var(--borderColor-default,#d1d9e0);display:none;list-style:none;margin-block:var(--base-size-8,.5rem);margin-inline-end:calc(var(--base-size-8,.5rem) - 1px);margin-inline-start:var(--base-size-8,.5rem);width:1px}@media (max-width:calc(48rem - 0.02px)){.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width-narrow=true]{display:flex;width:100%;--segmented-control-icon-width:100%}.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width-narrow=false]{display:inline-flex;width:auto;--segmented-control-icon-width:32px}}@media (min-width:48rem){.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width-regular=true]{display:flex;width:100%;--segmented-control-icon-width:100%}.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width-regular=false]{display:inline-flex;width:auto;--segmented-control-icon-width:32px}}@media (min-width:87.5rem){.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width-wide=true]{display:flex;width:100%;--segmented-control-icon-width:100%}.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width-regular=true]:not([data-full-width-wide=true]),.prc-SegmentedControl-SegmentedControl-lqIXp[data-full-width-wide=false]{display:inline-flex;width:auto;--segmented-control-icon-width:32px}}.prc-SegmentedControl-SegmentedControl-lqIXp[data-variant=dropdown]{display:none}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant=subtle]){--segmented-control-outer-radius:var(--borderRadius-large,0.75rem);--segmented-control-button-bg-inset:0px;--segmented-control-button-bgColor-hover:var(--button-invisible-bgColor-hover,#818b981a);background-color:transparent;border:0}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant=subtle]):before{display:none}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant=subtle]) .prc-SegmentedControl-Item-tSCQh:not(:last-child):after{background-color:transparent}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant=subtle])>[data-component="SegmentedControl.Divider"]{display:block}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant=subtle]) .prc-SegmentedControl-Button-E48xz{border:0;border-radius:var(--borderRadius-large,.75rem);color:var(--fgColor-muted,#59636e);padding:0}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant=subtle]) .prc-SegmentedControl-Button-E48xz .prc-SegmentedControl-Content-1COlk{border:0;padding-inline:var(--base-size-12,.75rem)}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant=subtle]) .prc-SegmentedControl-Button-E48xz[aria-pressed=true]{color:var(--fgColor-default,#1f2328)}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant=subtle]) .prc-SegmentedControl-Button-E48xz[aria-pressed=true] .prc-SegmentedControl-Content-1COlk{background-color:var(--bgColor-muted,#f6f8fa)}.prc-SegmentedControl-SegmentedControl-lqIXp[data-variant=hideLabels] .prc-SegmentedControl-Text-7S2y2{display:none}@media (max-width:calc(48rem - 0.02px)){.prc-SegmentedControl-SegmentedControl-lqIXp[data-variant-narrow=dropdown],.prc-SegmentedControl-SegmentedControl-lqIXp[data-variant-narrow=hideLabels] .prc-SegmentedControl-Text-7S2y2{display:none}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-narrow=subtle]){--segmented-control-outer-radius:var(--borderRadius-large,0.75rem);--segmented-control-button-bg-inset:0px;--segmented-control-button-bgColor-hover:var(--button-invisible-bgColor-hover,#818b981a);background-color:transparent;border:0}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-narrow=subtle]):before{display:none}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-narrow=subtle]) .prc-SegmentedControl-Item-tSCQh:not(:last-child):after{background-color:transparent}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-narrow=subtle])>[data-component="SegmentedControl.Divider"]{display:block}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-narrow=subtle]) .prc-SegmentedControl-Button-E48xz{border:0;border-radius:var(--borderRadius-large,.75rem);color:var(--fgColor-muted,#59636e);padding:0}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-narrow=subtle]) .prc-SegmentedControl-Button-E48xz .prc-SegmentedControl-Content-1COlk{border:0;padding-inline:var(--base-size-12,.75rem)}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-narrow=subtle]) .prc-SegmentedControl-Button-E48xz[aria-pressed=true]{color:var(--fgColor-default,#1f2328)}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-narrow=subtle]) .prc-SegmentedControl-Button-E48xz[aria-pressed=true] .prc-SegmentedControl-Content-1COlk{background-color:var(--bgColor-muted,#f6f8fa)}}@media (min-width:48rem){.prc-SegmentedControl-SegmentedControl-lqIXp[data-variant-regular=dropdown],.prc-SegmentedControl-SegmentedControl-lqIXp[data-variant-regular=hideLabels] .prc-SegmentedControl-Text-7S2y2{display:none}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-regular=subtle]){--segmented-control-outer-radius:var(--borderRadius-large,0.75rem);--segmented-control-button-bg-inset:0px;--segmented-control-button-bgColor-hover:var(--button-invisible-bgColor-hover,#818b981a);background-color:transparent;border:0}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-regular=subtle]):before{display:none}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-regular=subtle]) .prc-SegmentedControl-Item-tSCQh:not(:last-child):after{background-color:transparent}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-regular=subtle])>[data-component="SegmentedControl.Divider"]{display:block}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-regular=subtle]) .prc-SegmentedControl-Button-E48xz{border:0;border-radius:var(--borderRadius-large,.75rem);color:var(--fgColor-muted,#59636e);padding:0}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-regular=subtle]) .prc-SegmentedControl-Button-E48xz .prc-SegmentedControl-Content-1COlk{border:0;padding-inline:var(--base-size-12,.75rem)}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-regular=subtle]) .prc-SegmentedControl-Button-E48xz[aria-pressed=true]{color:var(--fgColor-default,#1f2328)}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-regular=subtle]) .prc-SegmentedControl-Button-E48xz[aria-pressed=true] .prc-SegmentedControl-Content-1COlk{background-color:var(--bgColor-muted,#f6f8fa)}}@media (min-width:87.5rem){.prc-SegmentedControl-SegmentedControl-lqIXp[data-variant-wide=dropdown],.prc-SegmentedControl-SegmentedControl-lqIXp[data-variant-wide=hideLabels] .prc-SegmentedControl-Text-7S2y2{display:none}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-wide=subtle]){--segmented-control-outer-radius:var(--borderRadius-large,0.75rem);--segmented-control-button-bg-inset:0px;--segmented-control-button-bgColor-hover:var(--button-invisible-bgColor-hover,#818b981a);background-color:transparent;border:0}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-wide=subtle]):before{display:none}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-wide=subtle]) .prc-SegmentedControl-Item-tSCQh:not(:last-child):after{background-color:transparent}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-wide=subtle])>[data-component="SegmentedControl.Divider"]{display:block}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-wide=subtle]) .prc-SegmentedControl-Button-E48xz{border:0;border-radius:var(--borderRadius-large,.75rem);color:var(--fgColor-muted,#59636e);padding:0}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-wide=subtle]) .prc-SegmentedControl-Button-E48xz .prc-SegmentedControl-Content-1COlk{border:0;padding-inline:var(--base-size-12,.75rem)}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-wide=subtle]) .prc-SegmentedControl-Button-E48xz[aria-pressed=true]{color:var(--fgColor-default,#1f2328)}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-wide=subtle]) .prc-SegmentedControl-Button-E48xz[aria-pressed=true] .prc-SegmentedControl-Content-1COlk{background-color:var(--bgColor-muted,#f6f8fa)}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-regular=subtle]):not([data-variant-wide=subtle]){--segmented-control-outer-radius:var(--borderRadius-medium,0.375rem);--segmented-control-button-bg-inset:4px;--segmented-control-button-bgColor-hover:var(--controlTrack-bgColor-hover,#e0e6eb);background-color:var(--controlTrack-bgColor-rest,#e6eaef);border:var(--borderWidth-thin,.0625rem) solid var(--controlTrack-borderColor-rest,transparent)}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-regular=subtle]):not([data-variant-wide=subtle]):before{display:block}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-regular=subtle]):not([data-variant-wide=subtle]) .prc-SegmentedControl-Item-tSCQh:not(:last-child):after{background-color:var(--borderColor-default,#d1d9e0)}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-regular=subtle]):not([data-variant-wide=subtle])>[data-component="SegmentedControl.Divider"]{display:none}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-regular=subtle]):not([data-variant-wide=subtle]) .prc-SegmentedControl-Button-E48xz{border-radius:var(--segmented-control-outer-radius);color:currentColor;padding:var(--segmented-control-button-bg-inset)}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-regular=subtle]):not([data-variant-wide=subtle]) .prc-SegmentedControl-Button-E48xz .prc-SegmentedControl-Content-1COlk{border:var(--borderWidth-thin,.0625rem) solid transparent;padding-inline:calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset))}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-regular=subtle]):not([data-variant-wide=subtle]) .prc-SegmentedControl-Button-E48xz[aria-pressed=true]{color:currentColor;padding:0}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-variant-regular=subtle]):not([data-variant-wide=subtle]) .prc-SegmentedControl-Button-E48xz[aria-pressed=true] .prc-SegmentedControl-Content-1COlk{background-color:transparent;padding-inline:var(--segmented-control-button-inner-padding)}}.prc-SegmentedControl-SegmentedControl-lqIXp:where([data-size=small]){font-size:var(--text-body-size-small,.75rem);height:28px}.prc-SegmentedControl-DropdownGroup-9SmpX{--segmented-control-action-size:32px;--segmented-control-list-flex:0 1 auto;align-items:center;display:inline-flex;gap:var(--base-size-4,.25rem)}.prc-SegmentedControl-DropdownGroup-9SmpX[data-full-width=true]{width:100%;--segmented-control-list-flex:1 1 auto}.prc-SegmentedControl-DropdownGroup-9SmpX[data-full-width=false]{width:auto}@media (max-width:calc(48rem - 0.02px)){.prc-SegmentedControl-DropdownGroup-9SmpX[data-full-width-narrow=true]{width:100%;--segmented-control-list-flex:1 1 auto}.prc-SegmentedControl-DropdownGroup-9SmpX[data-full-width-narrow=false]{width:auto}}@media (min-width:48rem){.prc-SegmentedControl-DropdownGroup-9SmpX[data-full-width-regular=true]{width:100%;--segmented-control-list-flex:1 1 auto}.prc-SegmentedControl-DropdownGroup-9SmpX[data-full-width-regular=false]{width:auto}}@media (min-width:87.5rem){.prc-SegmentedControl-DropdownGroup-9SmpX[data-full-width-wide=true]{width:100%;--segmented-control-list-flex:1 1 auto}.prc-SegmentedControl-DropdownGroup-9SmpX[data-full-width-wide=false]{width:auto}.prc-SegmentedControl-DropdownGroup-9SmpX[data-full-width-regular=true]:not([data-full-width-wide=true]){width:auto;--segmented-control-list-flex:0 1 auto}}.prc-SegmentedControl-DropdownGroup-9SmpX[data-size=small]{--segmented-control-action-size:28px}.prc-SegmentedControl-DropdownGroup-9SmpX>.prc-SegmentedControl-SegmentedControl-lqIXp{flex:var(--segmented-control-list-flex);min-width:0}.prc-SegmentedControl-InlineAction-4qmw0{display:flex}.prc-SegmentedControl-InlineAction-4qmw0[data-variant=dropdown]{display:none}@media (max-width:calc(48rem - 0.02px)){.prc-SegmentedControl-InlineAction-4qmw0[data-variant-narrow=dropdown]{display:none}}@media (min-width:48rem){.prc-SegmentedControl-InlineAction-4qmw0[data-variant-regular=dropdown]{display:none}}@media (min-width:87.5rem){.prc-SegmentedControl-InlineAction-4qmw0[data-variant-wide=dropdown]{display:none}}.prc-SegmentedControl-DropdownContainer-ZaPMn{display:none}.prc-SegmentedControl-DropdownContainer-ZaPMn[data-variant=dropdown]{display:block}@media (max-width:calc(48rem - 0.02px)){.prc-SegmentedControl-DropdownContainer-ZaPMn[data-variant-narrow=dropdown]{display:block}}@media (min-width:48rem){.prc-SegmentedControl-DropdownContainer-ZaPMn[data-variant-regular=dropdown]{display:block}}@media (min-width:87.5rem){.prc-SegmentedControl-DropdownContainer-ZaPMn[data-variant-wide=dropdown]{display:block}}.prc-SegmentedControl-Item-tSCQh{display:block;flex-grow:1;margin-bottom:-1px;margin-top:-1px;position:relative}.prc-SegmentedControl-Item-tSCQh:not(:last-child){margin-right:1px}.prc-SegmentedControl-Item-tSCQh:not(:last-child):after{background-color:var(--borderColor-default,#d1d9e0);bottom:var(--base-size-8,.5rem);content:"";position:absolute;right:calc(var(--base-size-2,.125rem)*-1);top:var(--base-size-8,.5rem);width:1px}.prc-SegmentedControl-Item-tSCQh:not(:last-child):has(+:where([data-component="SegmentedControl.Divider"])+:where([data-selected])):after,.prc-SegmentedControl-Item-tSCQh:not(:last-child):has(+[data-selected]):after,.prc-SegmentedControl-Item-tSCQh:not(:last-child):where([data-selected]):after{background-color:transparent}.prc-SegmentedControl-Item-tSCQh:first-child{margin-left:-1px}.prc-SegmentedControl-Item-tSCQh:last-child{margin-right:-1px}.prc-SegmentedControl-Item-tSCQh .prc-SegmentedControl-Counter-GmZOI{grid-column:3;margin-inline-start:var(--base-size-8,.5rem)}.prc-SegmentedControl-ActionItem-2V1ou,.prc-SegmentedControl-Item-tSCQh .prc-SegmentedControl-Counter-GmZOI{align-items:center;display:flex}.prc-SegmentedControl-ActionItem-2V1ou{margin-inline-start:0}.prc-SegmentedControl-ActionButton-Q5fnw{height:var(--segmented-control-action-size);padding:0;width:var(--segmented-control-action-size)}.prc-SegmentedControl-Button-E48xz{--segmented-control-button-inner-padding:12px;--segmented-control-button-bg-inset:4px;background-color:transparent;border-color:transparent;border-radius:var(--segmented-control-outer-radius);border-width:0;color:currentColor;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:var(--base-text-weight-normal,400);height:100%;padding:var(--segmented-control-button-bg-inset);width:100%}.prc-SegmentedControl-Button-E48xz svg{fill:var(--fgColor-muted,#59636e);color:var(--fgColor-muted,#59636e)}.prc-SegmentedControl-Button-E48xz:focus:not(:disabled){box-shadow:none;outline:var(--base-size-2,.125rem) solid var(--fgColor-accent,#0969da);outline-offset:-1px}.prc-SegmentedControl-Button-E48xz:focus:not(:disabled):not(:focus-visible){outline:1px solid transparent}.prc-SegmentedControl-Button-E48xz:focus-visible:not(:disabled){box-shadow:none;outline:var(--base-size-2,.125rem) solid var(--fgColor-accent,#0969da);outline-offset:-1px}.prc-SegmentedControl-Button-E48xz:focus:focus-visible:not(:last-child):after{width:0}.prc-SegmentedControl-Button-E48xz[aria-disabled=true]:not([aria-pressed=true]){background-color:transparent;color:var(--fgColor-disabled,#818b98);cursor:not-allowed}.prc-SegmentedControl-Button-E48xz[aria-disabled=true]:not([aria-pressed=true]) svg{fill:var(--fgColor-disabled,#818b98);color:var(--fgColor-disabled,#818b98)}@media (pointer:coarse){.prc-SegmentedControl-Button-E48xz:before{content:"";left:0;min-height:44px;position:absolute;right:0;top:50%;transform:translateY(-50%)}}.prc-SegmentedControl-IconButton-tlzDE{width:var(--segmented-control-icon-width,32px)}.prc-SegmentedControl-Content-1COlk{align-items:center;background-color:transparent;border-color:transparent;border-radius:calc(var(--segmented-control-outer-radius) - var(--segmented-control-button-bg-inset)/2);border-style:solid;border-width:var(--borderWidth-thin,.0625rem);display:grid;grid-template-columns:auto minmax(0,max-content) auto;height:100%;justify-content:center;padding-left:calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset));padding-right:calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset));transition:background-color var(--base-duration-200,[ object Object ]) var(--base-easing-easeInOut,.6,0,.2,1)}.prc-SegmentedControl-Button-E48xz[aria-pressed=true]{font-weight:var(--base-text-weight-semibold,600);padding:0}.prc-SegmentedControl-Button-E48xz[aria-pressed=true] .prc-SegmentedControl-Content-1COlk{padding-left:var(--segmented-control-button-inner-padding);padding-right:var(--segmented-control-button-inner-padding);anchor-name:--segmented-control-current-item}@supports not (anchor-name:--value){.prc-SegmentedControl-Button-E48xz[aria-pressed=true] .prc-SegmentedControl-Content-1COlk{background-color:var(--controlKnob-bgColor-rest,#fff);border-color:var(--controlKnob-borderColor-rest,#d1d9e0);border-radius:var(--segmented-control-outer-radius)}}.prc-SegmentedControl-Button-E48xz:not([aria-pressed=true],[aria-disabled=true]):hover .prc-SegmentedControl-Content-1COlk{background-color:var(--segmented-control-button-bgColor-hover,var(--controlTrack-bgColor-hover,#e0e6eb))}.prc-SegmentedControl-Button-E48xz:not([aria-pressed=true],[aria-disabled=true]):active .prc-SegmentedControl-Content-1COlk{background-color:var(--controlTrack-bgColor-active,#dae0e7)}.prc-SegmentedControl-Text-7S2y2{grid-column:2;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.prc-SegmentedControl-Text-7S2y2:after{content:attr(data-text);display:block;font-weight:var(--base-text-weight-semibold,600);height:0;overflow:hidden;pointer-events:none;-webkit-user-select:none;user-select:none;visibility:hidden}.prc-SegmentedControl-LeadingIcon-74n5s{grid-column:1;margin-right:var(--base-size-4,.25rem)}
|
|
2
|
+
/*# sourceMappingURL=SegmentedControl-3dc28307.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SegmentedControl/SegmentedControl.module.css.js"],"names":[],"mappings":"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","file":"SegmentedControl-3dc28307.css","sourcesContent":["@define-mixin subtleVariant {\n --segmented-control-outer-radius: var(--borderRadius-large);\n --segmented-control-button-bg-inset: 0px;\n --segmented-control-button-bgColor-hover: var(--button-invisible-bgColor-hover);\n\n background-color: transparent;\n border: 0;\n\n /* stylelint-disable-next-line nesting-selector-no-missing-scoping-root */\n &::before {\n display: none;\n }\n\n .Item:not(:last-child)::after {\n background-color: transparent;\n }\n\n > [data-component='SegmentedControl.Divider'] {\n display: block;\n }\n\n .Button {\n padding: 0;\n color: var(--fgColor-muted);\n border: 0;\n border-radius: var(--borderRadius-large);\n\n .Content {\n padding-inline: var(--base-size-12);\n border: 0;\n }\n }\n\n .Button[aria-pressed='true'] {\n color: var(--fgColor-default);\n\n .Content {\n background-color: var(--bgColor-muted);\n }\n }\n}\n\n@define-mixin defaultVariant {\n --segmented-control-outer-radius: var(--borderRadius-medium);\n --segmented-control-button-bg-inset: 4px;\n --segmented-control-button-bgColor-hover: var(--controlTrack-bgColor-hover);\n\n background-color: var(--controlTrack-bgColor-rest);\n border: var(--borderWidth-thin) solid var(--controlTrack-borderColor-rest, transparent);\n\n /* stylelint-disable-next-line nesting-selector-no-missing-scoping-root */\n &::before {\n display: block;\n }\n\n .Item:not(:last-child)::after {\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--borderColor-default);\n }\n\n > [data-component='SegmentedControl.Divider'] {\n display: none;\n }\n\n .Button {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--segmented-control-button-bg-inset);\n color: currentColor;\n /* stylelint-disable-next-line primer/borders */\n border-radius: var(--segmented-control-outer-radius);\n\n .Content {\n /* stylelint-disable-next-line primer/spacing */\n padding-inline: calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset));\n border: var(--borderWidth-thin) solid transparent;\n }\n }\n\n .Button[aria-pressed='true'] {\n padding: 0;\n color: currentColor;\n\n .Content {\n /* stylelint-disable-next-line primer/spacing */\n padding-inline: var(--segmented-control-button-inner-padding);\n background-color: transparent;\n }\n }\n}\n\n.SegmentedControl {\n /* TODO: use primitive `control.medium.size` when it is available instead of '32px' */\n --segmented-control-icon-width: 32px;\n --segmented-control-outer-radius: var(--borderRadius-medium);\n\n display: inline-flex;\n max-width: 100%;\n\n /* TODO: use primitive `control.{small|medium}.size` when it is available */\n height: 32px;\n padding: 0;\n margin: 0;\n font-size: var(--text-body-size-medium);\n background-color: var(--controlTrack-bgColor-rest);\n border: var(--borderWidth-thin) solid var(--controlTrack-borderColor-rest, transparent);\n border-radius: var(--borderRadius-medium);\n position: relative;\n\n @supports (anchor-name: --value) {\n &::before {\n position-anchor: --segmented-control-current-item;\n content: '';\n position: absolute;\n inset: anchor(top) anchor(right) anchor(bottom) anchor(left);\n background-color: var(--controlKnob-bgColor-rest);\n border: var(--borderWidth-thin) solid var(--controlKnob-borderColor-rest);\n /* stylelint-disable-next-line primer/borders */\n border-radius: var(--segmented-control-outer-radius);\n\n @media (prefers-reduced-motion: no-preference) {\n transition: inset var(--base-duration-200) var(--base-easing-easeInOut);\n }\n }\n\n &[data-disable-knob-transition]::before {\n transition: none;\n }\n }\n\n /* Responsive full-width */\n &[data-full-width='true'] {\n display: flex;\n width: 100%;\n\n --segmented-control-icon-width: 100%;\n }\n\n &[data-full-width='false'] {\n display: inline-flex;\n width: auto;\n\n --segmented-control-icon-width: 32px;\n }\n\n > [data-component='SegmentedControl.Divider'] {\n display: none;\n align-self: stretch;\n width: 1px;\n margin-block: var(--base-size-8);\n margin-inline-start: var(--base-size-8);\n /* stylelint-disable-next-line primer/spacing -- preserve the previous divider's 16px layout footprint */\n margin-inline-end: calc(var(--base-size-8) - 1px);\n list-style: none;\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--borderColor-default);\n }\n\n @media (--viewportRange-narrow) {\n &[data-full-width-narrow='true'] {\n display: flex;\n width: 100%;\n\n --segmented-control-icon-width: 100%;\n }\n\n &[data-full-width-narrow='false'] {\n display: inline-flex;\n width: auto;\n\n --segmented-control-icon-width: 32px;\n }\n }\n\n @media (--viewportRange-regular) {\n &[data-full-width-regular='true'] {\n display: flex;\n width: 100%;\n\n --segmented-control-icon-width: 100%;\n }\n\n &[data-full-width-regular='false'] {\n display: inline-flex;\n width: auto;\n\n --segmented-control-icon-width: 32px;\n }\n }\n\n @media (--viewportRange-wide) {\n &[data-full-width-wide='true'] {\n display: flex;\n width: 100%;\n\n --segmented-control-icon-width: 100%;\n }\n\n &[data-full-width-wide='false'] {\n display: inline-flex;\n width: auto;\n\n --segmented-control-icon-width: 32px;\n }\n\n &[data-full-width-regular='true']:not([data-full-width-wide='true']) {\n display: inline-flex;\n width: auto;\n\n --segmented-control-icon-width: 32px;\n }\n }\n\n /* Hide when dropdown variant is active */\n &[data-variant='dropdown'] {\n display: none;\n }\n\n &:where([data-variant='subtle']) {\n @mixin subtleVariant;\n }\n\n /* Handle hideLabels variant - hide button text */\n &[data-variant='hideLabels'] .Text {\n display: none;\n }\n\n @media (--viewportRange-narrow) {\n &[data-variant-narrow='dropdown'] {\n display: none;\n }\n\n &[data-variant-narrow='hideLabels'] .Text {\n display: none;\n }\n\n &:where([data-variant-narrow='subtle']) {\n @mixin subtleVariant;\n }\n }\n\n @media (--viewportRange-regular) {\n &[data-variant-regular='dropdown'] {\n display: none;\n }\n\n &[data-variant-regular='hideLabels'] .Text {\n display: none;\n }\n\n &:where([data-variant-regular='subtle']) {\n @mixin subtleVariant;\n }\n }\n\n @media (--viewportRange-wide) {\n &[data-variant-wide='dropdown'] {\n display: none;\n }\n\n &[data-variant-wide='hideLabels'] .Text {\n display: none;\n }\n\n &:where([data-variant-wide='subtle']) {\n @mixin subtleVariant;\n }\n\n &:where([data-variant-regular='subtle']):not([data-variant-wide='subtle']) {\n @mixin defaultVariant;\n }\n }\n\n &:where([data-size='small']) {\n /* TODO: use primitive `control.{small|medium}.size` when it is available */\n height: 28px;\n font-size: var(--text-body-size-small);\n }\n}\n\n.DropdownGroup {\n --segmented-control-action-size: 32px;\n --segmented-control-list-flex: 0 1 auto;\n\n display: inline-flex;\n align-items: center;\n gap: var(--base-size-4);\n\n &[data-full-width='true'] {\n width: 100%;\n\n --segmented-control-list-flex: 1 1 auto;\n }\n\n &[data-full-width='false'] {\n width: auto;\n }\n\n @media (--viewportRange-narrow) {\n &[data-full-width-narrow='true'] {\n width: 100%;\n\n --segmented-control-list-flex: 1 1 auto;\n }\n\n &[data-full-width-narrow='false'] {\n width: auto;\n }\n }\n\n @media (--viewportRange-regular) {\n &[data-full-width-regular='true'] {\n width: 100%;\n\n --segmented-control-list-flex: 1 1 auto;\n }\n\n &[data-full-width-regular='false'] {\n width: auto;\n }\n }\n\n @media (--viewportRange-wide) {\n &[data-full-width-wide='true'] {\n width: 100%;\n\n --segmented-control-list-flex: 1 1 auto;\n }\n\n &[data-full-width-wide='false'] {\n width: auto;\n }\n\n &[data-full-width-regular='true']:not([data-full-width-wide='true']) {\n width: auto;\n\n --segmented-control-list-flex: 0 1 auto;\n }\n }\n\n &[data-size='small'] {\n --segmented-control-action-size: 28px;\n }\n\n > .SegmentedControl {\n min-width: 0;\n flex: var(--segmented-control-list-flex);\n }\n}\n\n.InlineAction {\n display: flex;\n\n &[data-variant='dropdown'] {\n display: none;\n }\n\n @media (--viewportRange-narrow) {\n &[data-variant-narrow='dropdown'] {\n display: none;\n }\n }\n\n @media (--viewportRange-regular) {\n &[data-variant-regular='dropdown'] {\n display: none;\n }\n }\n\n @media (--viewportRange-wide) {\n &[data-variant-wide='dropdown'] {\n display: none;\n }\n }\n}\n\n.DropdownContainer {\n display: none;\n\n /* Show when dropdown variant is active */\n &[data-variant='dropdown'] {\n display: block;\n }\n\n @media (--viewportRange-narrow) {\n &[data-variant-narrow='dropdown'] {\n display: block;\n }\n }\n\n @media (--viewportRange-regular) {\n &[data-variant-regular='dropdown'] {\n display: block;\n }\n }\n\n @media (--viewportRange-wide) {\n &[data-variant-wide='dropdown'] {\n display: block;\n }\n }\n}\n\n.Item {\n position: relative;\n display: block;\n /* stylelint-disable-next-line primer/spacing */\n margin-top: -1px;\n /* stylelint-disable-next-line primer/spacing */\n margin-bottom: -1px;\n flex-grow: 1;\n\n &:not(:last-child) {\n /* stylelint-disable-next-line primer/spacing */\n margin-right: 1px;\n\n &::after {\n position: absolute;\n top: var(--base-size-8);\n right: calc(-1 * var(--base-size-2));\n bottom: var(--base-size-8);\n width: 1px;\n content: '';\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--borderColor-default);\n }\n\n /* stylelint-disable-next-line selector-pseudo-class-disallowed-list -- scoped to CSS Module, audited (github/github-ui#17224) */\n &:has(+ [data-selected])::after,\n /* stylelint-disable-next-line selector-pseudo-class-disallowed-list -- account for a hidden divider in the default variant */\n &:has(+ :where([data-component='SegmentedControl.Divider']) + :where([data-selected]))::after,\n &:where([data-selected])::after {\n background-color: transparent;\n }\n }\n\n &:first-child {\n /* stylelint-disable-next-line primer/spacing */\n margin-left: -1px;\n }\n\n &:last-child {\n /* stylelint-disable-next-line primer/spacing */\n margin-right: -1px;\n }\n\n .Counter {\n grid-column: 3;\n margin-inline-start: var(--base-size-8);\n display: flex;\n align-items: center;\n }\n}\n\n.ActionItem {\n display: flex;\n align-items: center;\n margin-inline-start: 0;\n}\n\n.ActionButton {\n width: var(--segmented-control-action-size);\n height: var(--segmented-control-action-size);\n padding: 0;\n}\n\n.Button {\n /* TODO: use primitive `primer.control.medium.paddingInline.normal` when it is available */\n --segmented-control-button-inner-padding: 12px;\n --segmented-control-button-bg-inset: 4px;\n\n width: 100%;\n height: 100%;\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--segmented-control-button-bg-inset);\n font-family: inherit;\n font-size: inherit;\n font-weight: var(--base-text-weight-normal);\n color: currentColor;\n cursor: pointer;\n background-color: transparent;\n border-color: transparent;\n border-width: 0;\n /* stylelint-disable-next-line primer/borders */\n border-radius: var(--segmented-control-outer-radius);\n\n & svg {\n fill: var(--fgColor-muted);\n color: var(--fgColor-muted);\n }\n\n /* fallback :focus state */\n &:focus:not(:disabled) {\n outline: var(--base-size-2) solid var(--fgColor-accent);\n outline-offset: -1px;\n box-shadow: none;\n\n /* remove fallback :focus if :focus-visible is supported */\n &:not(:focus-visible) {\n outline: solid 1px transparent;\n }\n }\n\n /* default focus state */\n &:focus-visible:not(:disabled) {\n outline: var(--base-size-2) solid var(--fgColor-accent);\n outline-offset: -1px;\n box-shadow: none;\n }\n\n /* stylelint-disable-next-line selector-max-specificity */\n &:focus:focus-visible:not(:last-child)::after {\n /* fixes an issue where the focus outline shows over the pseudo-element */\n width: 0;\n }\n\n &[aria-disabled='true']:not([aria-pressed='true']) {\n cursor: not-allowed;\n color: var(--fgColor-disabled);\n background-color: transparent;\n\n & svg {\n fill: var(--fgColor-disabled);\n color: var(--fgColor-disabled);\n }\n }\n\n @media (pointer: coarse) {\n &::before {\n position: absolute;\n top: 50%;\n right: 0;\n left: 0;\n min-height: 44px;\n content: '';\n transform: translateY(-50%);\n }\n }\n}\n\n.IconButton {\n width: var(--segmented-control-icon-width, 32px);\n}\n\n.Content {\n display: grid;\n grid-template-columns: auto minmax(0, max-content) auto;\n height: 100%;\n /* stylelint-disable-next-line primer/spacing */\n padding-right: calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset));\n /* stylelint-disable-next-line primer/spacing */\n padding-left: calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset));\n border-color: transparent;\n border-style: solid;\n border-width: var(--borderWidth-thin);\n background-color: transparent;\n transition: background-color var(--base-duration-200) var(--base-easing-easeInOut);\n\n /*\n innerRadius = outerRadius - distance/2\n https://stackoverflow.com/questions/2932146/math-problem-determine-the-corner-radius-of-an-inner-border-based-on-outer-corn\n */\n /* stylelint-disable-next-line primer/borders */\n border-radius: calc(var(--segmented-control-outer-radius) - var(--segmented-control-button-bg-inset) / 2);\n align-items: center;\n justify-content: center;\n}\n\n.Button[aria-pressed='true'] {\n padding: 0;\n font-weight: var(--base-text-weight-semibold);\n\n .Content {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--segmented-control-button-inner-padding);\n /* stylelint-disable-next-line primer/spacing */\n padding-left: var(--segmented-control-button-inner-padding);\n anchor-name: --segmented-control-current-item;\n\n @supports not (anchor-name: --value) {\n background-color: var(--controlKnob-bgColor-rest);\n border-color: var(--controlKnob-borderColor-rest);\n /* stylelint-disable-next-line primer/borders */\n border-radius: var(--segmented-control-outer-radius);\n }\n }\n}\n\n.Button:not([aria-pressed='true'], [aria-disabled='true']) {\n &:hover .Content {\n /* stylelint-disable-next-line primer/colors -- each variant supplies a semantic background token */\n background-color: var(--segmented-control-button-bgColor-hover, var(--controlTrack-bgColor-hover));\n }\n\n &:active .Content {\n background-color: var(--controlTrack-bgColor-active);\n }\n}\n\n.Text {\n grid-column: 2;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.Text::after {\n display: block;\n height: 0;\n overflow: hidden;\n font-weight: var(--base-text-weight-semibold);\n pointer-events: none;\n visibility: hidden;\n content: attr(data-text);\n user-select: none;\n}\n\n.LeadingIcon {\n grid-column: 1;\n margin-right: var(--base-size-4);\n}\n"]}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { c } from "../utils/react-compiler-runtime.js";
|
|
2
|
+
import useIsomorphicLayoutEffect from "../utils/useIsomorphicLayoutEffect.js";
|
|
3
|
+
import { useResizeObserver } from "../hooks/useResizeObserver.js";
|
|
2
4
|
import CounterLabel from "../CounterLabel/CounterLabel.js";
|
|
5
|
+
import { Tooltip } from "../TooltipV2/Tooltip.js";
|
|
3
6
|
import SegmentedControl_module_css_default from "./SegmentedControl.module.css.js";
|
|
7
|
+
import { useRef, useState } from "react";
|
|
4
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
9
|
import { clsx } from "clsx";
|
|
6
10
|
import { isElement } from "react-is";
|
|
7
11
|
//#region src/SegmentedControl/SegmentedControlButton.tsx
|
|
8
12
|
const SegmentedControlButton = (t0) => {
|
|
9
|
-
const $ = c(
|
|
13
|
+
const $ = c(44);
|
|
10
14
|
let children;
|
|
11
15
|
let className;
|
|
12
16
|
let count;
|
|
@@ -55,103 +59,142 @@ const SegmentedControlButton = (t0) => {
|
|
|
55
59
|
ariaDisabled = $[10];
|
|
56
60
|
rest = $[11];
|
|
57
61
|
}
|
|
58
|
-
const
|
|
62
|
+
const labelRef = useRef(null);
|
|
63
|
+
const [isTruncated, setIsTruncated] = useState(false);
|
|
59
64
|
let t1;
|
|
60
65
|
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
61
|
-
t1 =
|
|
66
|
+
t1 = () => {
|
|
67
|
+
const label = labelRef.current;
|
|
68
|
+
if (label) setIsTruncated(label.scrollWidth > label.clientWidth);
|
|
69
|
+
};
|
|
62
70
|
$[12] = t1;
|
|
63
71
|
} else t1 = $[12];
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
let
|
|
67
|
-
if ($[13] !==
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
$[15] =
|
|
76
|
-
} else
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
const updateTruncation = t1;
|
|
73
|
+
useResizeObserver(updateTruncation, labelRef);
|
|
74
|
+
let t2;
|
|
75
|
+
if ($[13] !== children || $[14] !== selected) {
|
|
76
|
+
t2 = [
|
|
77
|
+
children,
|
|
78
|
+
selected,
|
|
79
|
+
updateTruncation
|
|
80
|
+
];
|
|
81
|
+
$[13] = children;
|
|
82
|
+
$[14] = selected;
|
|
83
|
+
$[15] = t2;
|
|
84
|
+
} else t2 = $[15];
|
|
85
|
+
useIsomorphicLayoutEffect(updateTruncation, t2);
|
|
86
|
+
const LeadingVisual = leadingVisual !== null && leadingVisual !== void 0 ? leadingVisual : leadingIcon;
|
|
87
|
+
let t3;
|
|
88
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
89
|
+
t3 = clsx(SegmentedControl_module_css_default.Item);
|
|
90
|
+
$[16] = t3;
|
|
91
|
+
} else t3 = $[16];
|
|
92
|
+
const t4 = selected ? "" : void 0;
|
|
93
|
+
const t5 = isTruncated ? children : "";
|
|
94
|
+
const t6 = !isTruncated;
|
|
95
|
+
const t7 = disabled || ariaDisabled || void 0;
|
|
96
|
+
let t8;
|
|
97
|
+
if ($[17] !== className) {
|
|
98
|
+
t8 = clsx(SegmentedControl_module_css_default.Button, className);
|
|
99
|
+
$[17] = className;
|
|
100
|
+
$[18] = t8;
|
|
101
|
+
} else t8 = $[18];
|
|
102
|
+
let t9;
|
|
103
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
104
|
+
t9 = clsx(SegmentedControl_module_css_default.Content, "segmentedControl-content");
|
|
105
|
+
$[19] = t9;
|
|
106
|
+
} else t9 = $[19];
|
|
107
|
+
let t10;
|
|
108
|
+
if ($[20] !== LeadingVisual) {
|
|
109
|
+
t10 = LeadingVisual && /* @__PURE__ */ jsx("div", {
|
|
80
110
|
className: SegmentedControl_module_css_default.LeadingIcon,
|
|
81
111
|
children: isElement(LeadingVisual) ? LeadingVisual : /* @__PURE__ */ jsx(LeadingVisual, {})
|
|
82
112
|
});
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
} else
|
|
86
|
-
let
|
|
87
|
-
if ($[
|
|
88
|
-
|
|
89
|
-
$[
|
|
90
|
-
} else
|
|
91
|
-
let
|
|
92
|
-
if ($[
|
|
93
|
-
|
|
94
|
-
|
|
113
|
+
$[20] = LeadingVisual;
|
|
114
|
+
$[21] = t10;
|
|
115
|
+
} else t10 = $[21];
|
|
116
|
+
let t11;
|
|
117
|
+
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
118
|
+
t11 = clsx(SegmentedControl_module_css_default.Text, "segmentedControl-text");
|
|
119
|
+
$[22] = t11;
|
|
120
|
+
} else t11 = $[22];
|
|
121
|
+
let t12;
|
|
122
|
+
if ($[23] !== children) {
|
|
123
|
+
t12 = /* @__PURE__ */ jsx("div", {
|
|
124
|
+
ref: labelRef,
|
|
125
|
+
className: t11,
|
|
95
126
|
"data-text": children,
|
|
96
127
|
children
|
|
97
128
|
});
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
} else
|
|
101
|
-
let
|
|
102
|
-
if ($[
|
|
103
|
-
|
|
129
|
+
$[23] = children;
|
|
130
|
+
$[24] = t12;
|
|
131
|
+
} else t12 = $[24];
|
|
132
|
+
let t13;
|
|
133
|
+
if ($[25] !== count) {
|
|
134
|
+
t13 = count !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
104
135
|
className: SegmentedControl_module_css_default.Counter,
|
|
105
136
|
children: /* @__PURE__ */ jsx(CounterLabel, { children: count })
|
|
106
137
|
});
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
} else
|
|
110
|
-
let
|
|
111
|
-
if ($[
|
|
112
|
-
|
|
113
|
-
className:
|
|
138
|
+
$[25] = count;
|
|
139
|
+
$[26] = t13;
|
|
140
|
+
} else t13 = $[26];
|
|
141
|
+
let t14;
|
|
142
|
+
if ($[27] !== t10 || $[28] !== t12 || $[29] !== t13) {
|
|
143
|
+
t14 = /* @__PURE__ */ jsxs("span", {
|
|
144
|
+
className: t9,
|
|
114
145
|
children: [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
146
|
+
t10,
|
|
147
|
+
t12,
|
|
148
|
+
t13
|
|
118
149
|
]
|
|
119
150
|
});
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
} else
|
|
125
|
-
let
|
|
126
|
-
if ($[
|
|
127
|
-
|
|
151
|
+
$[27] = t10;
|
|
152
|
+
$[28] = t12;
|
|
153
|
+
$[29] = t13;
|
|
154
|
+
$[30] = t14;
|
|
155
|
+
} else t14 = $[30];
|
|
156
|
+
let t15;
|
|
157
|
+
if ($[31] !== rest || $[32] !== selected || $[33] !== t14 || $[34] !== t7 || $[35] !== t8) {
|
|
158
|
+
t15 = /* @__PURE__ */ jsx("button", {
|
|
128
159
|
"aria-pressed": selected,
|
|
129
|
-
"aria-disabled":
|
|
130
|
-
className:
|
|
160
|
+
"aria-disabled": t7,
|
|
161
|
+
className: t8,
|
|
131
162
|
type: "button",
|
|
132
163
|
...rest,
|
|
133
|
-
children:
|
|
164
|
+
children: t14
|
|
134
165
|
});
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
} else
|
|
142
|
-
let
|
|
143
|
-
if ($[
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
166
|
+
$[31] = rest;
|
|
167
|
+
$[32] = selected;
|
|
168
|
+
$[33] = t14;
|
|
169
|
+
$[34] = t7;
|
|
170
|
+
$[35] = t8;
|
|
171
|
+
$[36] = t15;
|
|
172
|
+
} else t15 = $[36];
|
|
173
|
+
let t16;
|
|
174
|
+
if ($[37] !== t15 || $[38] !== t5 || $[39] !== t6) {
|
|
175
|
+
t16 = /* @__PURE__ */ jsx(Tooltip, {
|
|
176
|
+
text: t5,
|
|
177
|
+
_privateDisableTooltip: t6,
|
|
178
|
+
children: t15
|
|
179
|
+
});
|
|
180
|
+
$[37] = t15;
|
|
181
|
+
$[38] = t5;
|
|
182
|
+
$[39] = t6;
|
|
183
|
+
$[40] = t16;
|
|
184
|
+
} else t16 = $[40];
|
|
185
|
+
let t17;
|
|
186
|
+
if ($[41] !== t16 || $[42] !== t4) {
|
|
187
|
+
t17 = /* @__PURE__ */ jsx("li", {
|
|
188
|
+
className: t3,
|
|
189
|
+
"data-selected": t4,
|
|
147
190
|
"data-component": "SegmentedControl.Button",
|
|
148
|
-
children:
|
|
191
|
+
children: t16
|
|
149
192
|
});
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
} else
|
|
154
|
-
return
|
|
193
|
+
$[41] = t16;
|
|
194
|
+
$[42] = t4;
|
|
195
|
+
$[43] = t17;
|
|
196
|
+
} else t17 = $[43];
|
|
197
|
+
return t17;
|
|
155
198
|
};
|
|
156
199
|
SegmentedControlButton.__SLOT__ = Symbol("SegmentedControl.Button");
|
|
157
200
|
//#endregion
|
|
@@ -17,7 +17,7 @@ type TooltipProps = React.PropsWithChildren<{
|
|
|
17
17
|
*/
|
|
18
18
|
delay?: 'short' | 'medium' | 'long';
|
|
19
19
|
/**
|
|
20
|
-
* Private API for use internally only.
|
|
20
|
+
* Private API for use internally only. Closes the tooltip and prevents it from opening if `true`.
|
|
21
21
|
*
|
|
22
22
|
* Accessibility note: This prop should be used with caution. Only use when needing to
|
|
23
23
|
* programmatically close the tooltip in response to a specific user action, such as
|