@primer/react 38.43.0-rc.fd837f586 → 38.44.0-rc.0c9e08268

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.
@@ -4,51 +4,81 @@ 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(61);
8
- const { columns, data, initialSortColumn, initialSortDirection, externalSorting, getRowId, rowSelection: t1, selectedRows: controlledSelectedRows, defaultSelectedRows, onSelectionChange, isRowSelectable } = t0;
7
+ const $ = c(77);
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
+ const collapsibleGroups = t2 === void 0 ? false : t2;
10
11
  const tableId = useId();
11
12
  const [rowOrder, setRowOrder] = useState(data);
12
13
  const [prevData, setPrevData] = useState(data);
13
14
  const [prevColumns, setPrevColumns] = useState(columns);
14
- let t2;
15
+ let t3;
15
16
  if ($[0] !== columns || $[1] !== initialSortColumn || $[2] !== initialSortDirection) {
16
- t2 = () => getInitialSortState(columns, initialSortColumn, initialSortDirection);
17
+ t3 = () => getInitialSortState(columns, initialSortColumn, initialSortDirection);
17
18
  $[0] = columns;
18
19
  $[1] = initialSortColumn;
19
20
  $[2] = initialSortDirection;
20
- $[3] = t2;
21
- } else t2 = $[3];
22
- const [sortByColumn, setSortByColumn] = useState(t2);
23
- let t3;
21
+ $[3] = t3;
22
+ } else t3 = $[3];
23
+ const [sortByColumn, setSortByColumn] = useState(t3);
24
+ let t4;
24
25
  if ($[4] !== defaultSelectedRows) {
25
- t3 = () => defaultSelectedRows !== null && defaultSelectedRows !== void 0 ? defaultSelectedRows : /* @__PURE__ */ new Set();
26
+ t4 = () => defaultSelectedRows !== null && defaultSelectedRows !== void 0 ? defaultSelectedRows : /* @__PURE__ */ new Set();
26
27
  $[4] = defaultSelectedRows;
27
- $[5] = t3;
28
- } else t3 = $[5];
29
- let t4;
28
+ $[5] = t4;
29
+ } else t4 = $[5];
30
+ let t5;
30
31
  if ($[6] !== onSelectionChange) {
31
- t4 = (nextSelectedRows) => {
32
+ t5 = (nextSelectedRows) => {
32
33
  onSelectionChange === null || onSelectionChange === void 0 || onSelectionChange({ selectedRows: new Set(nextSelectedRows) });
33
34
  };
34
35
  $[6] = onSelectionChange;
35
- $[7] = t4;
36
- } else t4 = $[7];
37
- let t5;
38
- if ($[8] !== controlledSelectedRows || $[9] !== t3 || $[10] !== t4) {
39
- t5 = {
36
+ $[7] = t5;
37
+ } else t5 = $[7];
38
+ let t6;
39
+ if ($[8] !== controlledSelectedRows || $[9] !== t4 || $[10] !== t5) {
40
+ t6 = {
40
41
  name: "DataTable selectedRows",
41
42
  value: controlledSelectedRows,
42
- defaultValue: t3,
43
- onChange: t4
43
+ defaultValue: t4,
44
+ onChange: t5
44
45
  };
45
46
  $[8] = controlledSelectedRows;
46
- $[9] = t3;
47
- $[10] = t4;
48
- $[11] = t5;
49
- } else t5 = $[11];
50
- const [selectedRows, setSelectedRows] = useControllableState(t5);
47
+ $[9] = t4;
48
+ $[10] = t5;
49
+ $[11] = t6;
50
+ } else t6 = $[11];
51
+ const [selectedRows, setSelectedRows] = useControllableState(t6);
51
52
  const { gridTemplateColumns } = useTableLayout(columns, rowSelection);
53
+ let t7;
54
+ if ($[12] !== data || $[13] !== defaultExpandedGroups) {
55
+ t7 = () => defaultExpandedGroups !== null && defaultExpandedGroups !== void 0 ? defaultExpandedGroups : new Set(data.filter(isDataTableRowGroup).map(_temp));
56
+ $[12] = data;
57
+ $[13] = defaultExpandedGroups;
58
+ $[14] = t7;
59
+ } else t7 = $[14];
60
+ let t8;
61
+ if ($[15] !== onExpandedGroupsChange) {
62
+ t8 = (nextExpandedGroups) => {
63
+ onExpandedGroupsChange === null || onExpandedGroupsChange === void 0 || onExpandedGroupsChange({ expandedGroups: new Set(nextExpandedGroups) });
64
+ };
65
+ $[15] = onExpandedGroupsChange;
66
+ $[16] = t8;
67
+ } else t8 = $[16];
68
+ let t9;
69
+ if ($[17] !== controlledExpandedGroups || $[18] !== t7 || $[19] !== t8) {
70
+ t9 = {
71
+ name: "DataTable expandedGroups",
72
+ value: controlledExpandedGroups,
73
+ defaultValue: t7,
74
+ onChange: t8
75
+ };
76
+ $[17] = controlledExpandedGroups;
77
+ $[18] = t7;
78
+ $[19] = t8;
79
+ $[20] = t9;
80
+ } else t9 = $[20];
81
+ const [expandedGroups, setExpandedGroups] = useControllableState(t9);
52
82
  if (columns !== prevColumns) {
53
83
  setPrevColumns(columns);
54
84
  if (sortByColumn) {
@@ -59,21 +89,21 @@ function useTable(t0) {
59
89
  })) setSortByColumn(null);
60
90
  }
61
91
  }
62
- let t6;
63
- if ($[12] !== rowOrder) {
64
- t6 = rowOrder.some(isDataTableRowGroup);
65
- $[12] = rowOrder;
66
- $[13] = t6;
67
- } else t6 = $[13];
68
- const hasGroups = t6;
92
+ let t10;
93
+ if ($[21] !== rowOrder) {
94
+ t10 = rowOrder.some(isDataTableRowGroup);
95
+ $[21] = rowOrder;
96
+ $[22] = t10;
97
+ } else t10 = $[22];
98
+ const hasGroups = t10;
69
99
  let bodies;
70
100
  let headers;
71
101
  let sortBy;
72
- let t7;
73
- if ($[14] !== columns || $[15] !== data || $[16] !== externalSorting || $[17] !== getRowId || $[18] !== hasGroups || $[19] !== isRowSelectable || $[20] !== prevData || $[21] !== rowOrder || $[22] !== rowSelection || $[23] !== selectedRows || $[24] !== sortByColumn || $[25] !== tableId) {
74
- let t8;
75
- if ($[30] !== hasGroups || $[31] !== sortByColumn || $[32] !== tableId) {
76
- t8 = (column_1, index) => {
102
+ let t11;
103
+ if ($[23] !== collapsibleGroups || $[24] !== columns || $[25] !== data || $[26] !== expandedGroups || $[27] !== externalSorting || $[28] !== getRowId || $[29] !== hasGroups || $[30] !== isRowSelectable || $[31] !== prevData || $[32] !== rowOrder || $[33] !== rowSelection || $[34] !== selectedRows || $[35] !== sortByColumn || $[36] !== tableId) {
104
+ let t12;
105
+ if ($[41] !== hasGroups || $[42] !== sortByColumn || $[43] !== tableId) {
106
+ t12 = (column_1, index) => {
77
107
  var _column_1$id;
78
108
  const id_0 = (_column_1$id = column_1.id) !== null && _column_1$id !== void 0 ? _column_1$id : column_1.field;
79
109
  if (id_0 === void 0) throw new Error("Expected either an `id` or `field` to be defined for a Column");
@@ -91,12 +121,12 @@ function useTable(t0) {
91
121
  }
92
122
  };
93
123
  };
94
- $[30] = hasGroups;
95
- $[31] = sortByColumn;
96
- $[32] = tableId;
97
- $[33] = t8;
98
- } else t8 = $[33];
99
- headers = columns.map(t8);
124
+ $[41] = hasGroups;
125
+ $[42] = sortByColumn;
126
+ $[43] = tableId;
127
+ $[44] = t12;
128
+ } else t12 = $[44];
129
+ headers = columns.map(t12);
100
130
  if (data !== prevData) {
101
131
  setPrevData(data);
102
132
  updateRowOrder(data, sortByColumn);
@@ -204,16 +234,17 @@ function useTable(t0) {
204
234
  const groupStartIndex = rowIndex_0;
205
235
  bodies.push({
206
236
  type: "row-group",
207
- key: `group:${item_0.groupId}`,
237
+ key: `group:${typeof item_0.groupId}:${item_0.groupId}`,
208
238
  id: item_0.groupId,
209
239
  label: item_0.label,
210
240
  rows: item_0.rows.map((row_1, index_2) => createRow(row_1, groupStartIndex + index_2)),
241
+ expanded: !collapsibleGroups || expandedGroups.has(item_0.groupId),
211
242
  "aria-label": item_0["aria-label"]
212
243
  });
213
244
  rowIndex_0 = rowIndex_0 + item_0.rows.length;
214
245
  body = {
215
246
  type: "row-body",
216
- key: `rows:after:${item_0.groupId}`,
247
+ key: `rows:after:${typeof item_0.groupId}:${item_0.groupId}`,
217
248
  rows: []
218
249
  };
219
250
  } else {
@@ -221,132 +252,154 @@ function useTable(t0) {
221
252
  rowIndex_0 = rowIndex_0 + 1;
222
253
  }
223
254
  if (body.rows.length > 0 || bodies.length === 0) bodies.push(body);
224
- t7 = bodies.flatMap(_temp).filter(_temp2);
225
- $[14] = columns;
226
- $[15] = data;
227
- $[16] = externalSorting;
228
- $[17] = getRowId;
229
- $[18] = hasGroups;
230
- $[19] = isRowSelectable;
231
- $[20] = prevData;
232
- $[21] = rowOrder;
233
- $[22] = rowSelection;
234
- $[23] = selectedRows;
235
- $[24] = sortByColumn;
236
- $[25] = tableId;
237
- $[26] = bodies;
238
- $[27] = headers;
239
- $[28] = sortBy;
240
- $[29] = t7;
255
+ t11 = bodies.flatMap(_temp2).filter(_temp3);
256
+ $[23] = collapsibleGroups;
257
+ $[24] = columns;
258
+ $[25] = data;
259
+ $[26] = expandedGroups;
260
+ $[27] = externalSorting;
261
+ $[28] = getRowId;
262
+ $[29] = hasGroups;
263
+ $[30] = isRowSelectable;
264
+ $[31] = prevData;
265
+ $[32] = rowOrder;
266
+ $[33] = rowSelection;
267
+ $[34] = selectedRows;
268
+ $[35] = sortByColumn;
269
+ $[36] = tableId;
270
+ $[37] = bodies;
271
+ $[38] = headers;
272
+ $[39] = sortBy;
273
+ $[40] = t11;
241
274
  } else {
242
- bodies = $[26];
243
- headers = $[27];
244
- sortBy = $[28];
245
- t7 = $[29];
275
+ bodies = $[37];
276
+ headers = $[38];
277
+ sortBy = $[39];
278
+ t11 = $[40];
246
279
  }
247
- const selectableRows = t7;
248
- let t8;
249
- if ($[34] !== selectableRows) {
250
- t8 = new Set(selectableRows.filter(_temp3).map(_temp4));
251
- $[34] = selectableRows;
252
- $[35] = t8;
253
- } else t8 = $[35];
254
- const effectiveSelectedRows = t8;
280
+ const selectableRows = t11;
281
+ let t12;
282
+ if ($[45] !== selectableRows) {
283
+ t12 = new Set(selectableRows.filter(_temp4).map(_temp5));
284
+ $[45] = selectableRows;
285
+ $[46] = t12;
286
+ } else t12 = $[46];
287
+ const effectiveSelectedRows = t12;
255
288
  const selectedCount = effectiveSelectedRows.size;
256
289
  const selectableCount = selectableRows.length;
257
290
  const allSelected = selectableCount > 0 && selectedCount === selectableCount;
258
291
  const someSelected = selectedCount > 0 && !allSelected;
259
- let t9;
260
- if ($[36] !== selectedRows || $[37] !== setSelectedRows) {
261
- t9 = function toggleRowSelection(row_5) {
292
+ let t13;
293
+ if ($[47] !== selectedRows || $[48] !== setSelectedRows) {
294
+ t13 = function toggleRowSelection(row_5) {
262
295
  if (!row_5.selectable) return;
263
296
  const nextSelectedRows_0 = new Set(selectedRows);
264
297
  if (nextSelectedRows_0.has(row_5.selectionId)) nextSelectedRows_0.delete(row_5.selectionId);
265
298
  else nextSelectedRows_0.add(row_5.selectionId);
266
299
  setSelectedRows(nextSelectedRows_0);
267
300
  };
268
- $[36] = selectedRows;
269
- $[37] = setSelectedRows;
270
- $[38] = t9;
271
- } else t9 = $[38];
272
- const toggleRowSelection = t9;
273
- let t10;
274
- if ($[39] !== allSelected || $[40] !== selectableRows || $[41] !== selectedRows || $[42] !== setSelectedRows) {
275
- t10 = function toggleAllRows() {
301
+ $[47] = selectedRows;
302
+ $[48] = setSelectedRows;
303
+ $[49] = t13;
304
+ } else t13 = $[49];
305
+ const toggleRowSelection = t13;
306
+ let t14;
307
+ if ($[50] !== allSelected || $[51] !== selectableRows || $[52] !== selectedRows || $[53] !== setSelectedRows) {
308
+ t14 = function toggleAllRows() {
276
309
  if (selectableRows.length === 0) return;
277
310
  const nextSelectedRows_1 = new Set(selectedRows);
278
311
  for (const row_6 of selectableRows) if (allSelected) nextSelectedRows_1.delete(row_6.selectionId);
279
312
  else nextSelectedRows_1.add(row_6.selectionId);
280
313
  setSelectedRows(nextSelectedRows_1);
281
314
  };
282
- $[39] = allSelected;
283
- $[40] = selectableRows;
284
- $[41] = selectedRows;
285
- $[42] = setSelectedRows;
286
- $[43] = t10;
287
- } else t10 = $[43];
288
- const toggleAllRows = t10;
289
- let t11;
290
- if ($[44] !== sortBy || $[45] !== toggleAllRows || $[46] !== toggleRowSelection) {
291
- t11 = {
315
+ $[50] = allSelected;
316
+ $[51] = selectableRows;
317
+ $[52] = selectedRows;
318
+ $[53] = setSelectedRows;
319
+ $[54] = t14;
320
+ } else t14 = $[54];
321
+ const toggleAllRows = t14;
322
+ let t15;
323
+ if ($[55] !== collapsibleGroups || $[56] !== expandedGroups || $[57] !== setExpandedGroups) {
324
+ t15 = function toggleGroupExpansion(group_0) {
325
+ if (!collapsibleGroups) return;
326
+ const nextExpandedGroups_0 = new Set(expandedGroups);
327
+ if (nextExpandedGroups_0.has(group_0.id)) nextExpandedGroups_0.delete(group_0.id);
328
+ else nextExpandedGroups_0.add(group_0.id);
329
+ setExpandedGroups(nextExpandedGroups_0);
330
+ };
331
+ $[55] = collapsibleGroups;
332
+ $[56] = expandedGroups;
333
+ $[57] = setExpandedGroups;
334
+ $[58] = t15;
335
+ } else t15 = $[58];
336
+ const toggleGroupExpansion = t15;
337
+ let t16;
338
+ if ($[59] !== sortBy || $[60] !== toggleAllRows || $[61] !== toggleGroupExpansion || $[62] !== toggleRowSelection) {
339
+ t16 = {
292
340
  sortBy,
293
341
  toggleRowSelection,
294
- toggleAllRows
342
+ toggleAllRows,
343
+ toggleGroupExpansion
295
344
  };
296
- $[44] = sortBy;
297
- $[45] = toggleAllRows;
298
- $[46] = toggleRowSelection;
299
- $[47] = t11;
300
- } else t11 = $[47];
301
- const t12 = `${tableId}-selection-column`;
302
- let t13;
303
- if ($[48] !== allSelected || $[49] !== effectiveSelectedRows || $[50] !== selectableCount || $[51] !== selectedCount || $[52] !== someSelected || $[53] !== t12) {
304
- t13 = {
305
- headerId: t12,
345
+ $[59] = sortBy;
346
+ $[60] = toggleAllRows;
347
+ $[61] = toggleGroupExpansion;
348
+ $[62] = toggleRowSelection;
349
+ $[63] = t16;
350
+ } else t16 = $[63];
351
+ const t17 = `${tableId}-selection-column`;
352
+ let t18;
353
+ if ($[64] !== allSelected || $[65] !== effectiveSelectedRows || $[66] !== selectableCount || $[67] !== selectedCount || $[68] !== someSelected || $[69] !== t17) {
354
+ t18 = {
355
+ headerId: t17,
306
356
  selectedRows: effectiveSelectedRows,
307
357
  allSelected,
308
358
  someSelected,
309
359
  selectableCount,
310
360
  selectedCount
311
361
  };
312
- $[48] = allSelected;
313
- $[49] = effectiveSelectedRows;
314
- $[50] = selectableCount;
315
- $[51] = selectedCount;
316
- $[52] = someSelected;
317
- $[53] = t12;
318
- $[54] = t13;
319
- } else t13 = $[54];
320
- let t14;
321
- if ($[55] !== bodies || $[56] !== gridTemplateColumns || $[57] !== headers || $[58] !== t11 || $[59] !== t13) {
322
- t14 = {
362
+ $[64] = allSelected;
363
+ $[65] = effectiveSelectedRows;
364
+ $[66] = selectableCount;
365
+ $[67] = selectedCount;
366
+ $[68] = someSelected;
367
+ $[69] = t17;
368
+ $[70] = t18;
369
+ } else t18 = $[70];
370
+ let t19;
371
+ if ($[71] !== bodies || $[72] !== gridTemplateColumns || $[73] !== headers || $[74] !== t16 || $[75] !== t18) {
372
+ t19 = {
323
373
  headers,
324
- actions: t11,
325
- selection: t13,
374
+ actions: t16,
375
+ selection: t18,
326
376
  gridTemplateColumns,
327
377
  bodies
328
378
  };
329
- $[55] = bodies;
330
- $[56] = gridTemplateColumns;
331
- $[57] = headers;
332
- $[58] = t11;
333
- $[59] = t13;
334
- $[60] = t14;
335
- } else t14 = $[60];
336
- return t14;
379
+ $[71] = bodies;
380
+ $[72] = gridTemplateColumns;
381
+ $[73] = headers;
382
+ $[74] = t16;
383
+ $[75] = t18;
384
+ $[76] = t19;
385
+ } else t19 = $[76];
386
+ return t19;
337
387
  }
338
- function _temp4(row_4) {
388
+ function _temp5(row_4) {
339
389
  return row_4.selectionId;
340
390
  }
341
- function _temp3(row_3) {
391
+ function _temp4(row_3) {
342
392
  return row_3.selected;
343
393
  }
344
- function _temp2(row_2) {
394
+ function _temp3(row_2) {
345
395
  return row_2.selectable;
346
396
  }
347
- function _temp(body_0) {
397
+ function _temp2(body_0) {
348
398
  return body_0.rows;
349
399
  }
400
+ function _temp(group) {
401
+ return group.groupId;
402
+ }
350
403
  function isDataTableRowGroup(item) {
351
404
  return "groupId" in item && "rows" in item && Array.isArray(item.rows);
352
405
  }
@@ -1,29 +1,124 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import { defaultTokenSize } from "./constants.js";
2
3
  import _RemoveTokenButton_module_css_default from "./_RemoveTokenButton.module.css.js";
3
4
  import { jsx } from "react/jsx-runtime";
4
5
  import { clsx } from "clsx";
5
6
  import { XIcon } from "@primer/octicons-react";
6
7
  //#region src/Token/_RemoveTokenButton.tsx
7
- const RemoveTokenButton = ({ "aria-label": ariaLabel, isParentInteractive, size = defaultTokenSize, className, borderOffset = 0, as: _as, children: _children, ...rest }) => {
8
- if (isParentInteractive) return /* @__PURE__ */ jsx("span", {
9
- ...rest,
10
- tabIndex: -1,
11
- "aria-label": ariaLabel,
12
- "data-size": size,
13
- className: clsx(_RemoveTokenButton_module_css_default.TokenButton, className),
14
- style: { transform: `translate(${borderOffset}px, -${borderOffset}px)` },
15
- children: /* @__PURE__ */ jsx(XIcon, { size: size === "small" || size === "medium" ? 12 : 16 })
16
- });
17
- return /* @__PURE__ */ jsx("button", {
18
- ...rest,
19
- "aria-label": "Remove token",
20
- "data-size": size,
21
- className: clsx(_RemoveTokenButton_module_css_default.TokenButton, className),
22
- style: { transform: `translate(${borderOffset}px, -${borderOffset}px)` },
23
- ref: rest.ref,
24
- type: "button",
25
- children: /* @__PURE__ */ jsx(XIcon, { size: size === "small" || size === "medium" ? 12 : 16 })
26
- });
8
+ const RemoveTokenButton = (t0) => {
9
+ const $ = c(32);
10
+ let ariaLabel;
11
+ let className;
12
+ let isParentInteractive;
13
+ let rest;
14
+ let t1;
15
+ let t2;
16
+ if ($[0] !== t0) {
17
+ const { "aria-label": t3, isParentInteractive: t4, size: t5, className: t6, borderOffset: t7, as: _as, children: _children, ...t8 } = t0;
18
+ ariaLabel = t3;
19
+ isParentInteractive = t4;
20
+ t1 = t5;
21
+ className = t6;
22
+ t2 = t7;
23
+ rest = t8;
24
+ $[0] = t0;
25
+ $[1] = ariaLabel;
26
+ $[2] = className;
27
+ $[3] = isParentInteractive;
28
+ $[4] = rest;
29
+ $[5] = t1;
30
+ $[6] = t2;
31
+ } else {
32
+ ariaLabel = $[1];
33
+ className = $[2];
34
+ isParentInteractive = $[3];
35
+ rest = $[4];
36
+ t1 = $[5];
37
+ t2 = $[6];
38
+ }
39
+ const size = t1 === void 0 ? defaultTokenSize : t1;
40
+ const borderOffset = t2 === void 0 ? 0 : t2;
41
+ if (isParentInteractive) {
42
+ let t3;
43
+ if ($[7] !== className) {
44
+ t3 = clsx(_RemoveTokenButton_module_css_default.TokenButton, className);
45
+ $[7] = className;
46
+ $[8] = t3;
47
+ } else t3 = $[8];
48
+ const t4 = `translate(${borderOffset}px, -${borderOffset}px)`;
49
+ let t5;
50
+ if ($[9] !== t4) {
51
+ t5 = { transform: t4 };
52
+ $[9] = t4;
53
+ $[10] = t5;
54
+ } else t5 = $[10];
55
+ const t6 = size === "small" || size === "medium" ? 12 : 16;
56
+ let t7;
57
+ if ($[11] !== t6) {
58
+ t7 = /* @__PURE__ */ jsx(XIcon, { size: t6 });
59
+ $[11] = t6;
60
+ $[12] = t7;
61
+ } else t7 = $[12];
62
+ let t8;
63
+ if ($[13] !== ariaLabel || $[14] !== rest || $[15] !== size || $[16] !== t3 || $[17] !== t5 || $[18] !== t7) {
64
+ t8 = /* @__PURE__ */ jsx("span", {
65
+ ...rest,
66
+ tabIndex: -1,
67
+ "aria-label": ariaLabel,
68
+ "data-size": size,
69
+ className: t3,
70
+ style: t5,
71
+ children: t7
72
+ });
73
+ $[13] = ariaLabel;
74
+ $[14] = rest;
75
+ $[15] = size;
76
+ $[16] = t3;
77
+ $[17] = t5;
78
+ $[18] = t7;
79
+ $[19] = t8;
80
+ } else t8 = $[19];
81
+ return t8;
82
+ }
83
+ let t3;
84
+ if ($[20] !== className) {
85
+ t3 = clsx(_RemoveTokenButton_module_css_default.TokenButton, className);
86
+ $[20] = className;
87
+ $[21] = t3;
88
+ } else t3 = $[21];
89
+ const t4 = `translate(${borderOffset}px, -${borderOffset}px)`;
90
+ let t5;
91
+ if ($[22] !== t4) {
92
+ t5 = { transform: t4 };
93
+ $[22] = t4;
94
+ $[23] = t5;
95
+ } else t5 = $[23];
96
+ const t6 = size === "small" || size === "medium" ? 12 : 16;
97
+ let t7;
98
+ if ($[24] !== t6) {
99
+ t7 = /* @__PURE__ */ jsx(XIcon, { size: t6 });
100
+ $[24] = t6;
101
+ $[25] = t7;
102
+ } else t7 = $[25];
103
+ let t8;
104
+ if ($[26] !== rest || $[27] !== size || $[28] !== t3 || $[29] !== t5 || $[30] !== t7) {
105
+ t8 = /* @__PURE__ */ jsx("button", {
106
+ ...rest,
107
+ "aria-label": "Remove token",
108
+ "data-size": size,
109
+ className: t3,
110
+ style: t5,
111
+ type: "button",
112
+ children: t7
113
+ });
114
+ $[26] = rest;
115
+ $[27] = size;
116
+ $[28] = t3;
117
+ $[29] = t5;
118
+ $[30] = t7;
119
+ $[31] = t8;
120
+ } else t8 = $[31];
121
+ return t8;
27
122
  };
28
123
  //#endregion
29
124
  export { RemoveTokenButton as default };