@primer/react 0.0.0-20260831205533 → 0.0.0-20260915162741

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.
Files changed (218) hide show
  1. package/CHANGELOG.md +39 -3
  2. package/dist/ActionBar/ActionBar.js +2 -2
  3. package/dist/ActionList/Description.js +3 -3
  4. package/dist/ActionList/Divider.js +2 -2
  5. package/dist/ActionList/Group.js +4 -4
  6. package/dist/ActionList/GroupHeadingTrailingAction.js +2 -2
  7. package/dist/ActionList/Heading.js +3 -3
  8. package/dist/ActionList/Item.js +4 -4
  9. package/dist/ActionList/List.js +3 -3
  10. package/dist/ActionList/Selection.js +2 -2
  11. package/dist/ActionList/TrailingAction.js +3 -3
  12. package/dist/ActionList/Visuals.js +3 -3
  13. package/dist/ActionMenu/ActionMenu.js +2 -2
  14. package/dist/AnchoredOverlay/AnchoredOverlay.js +3 -3
  15. package/dist/Autocomplete/Autocomplete.js +2 -2
  16. package/dist/Autocomplete/AutocompleteInput.js +1 -1
  17. package/dist/Autocomplete/AutocompleteMenu.js +3 -3
  18. package/dist/Autocomplete/AutocompleteOverlay.js +3 -3
  19. package/dist/Avatar/Avatar.js +3 -3
  20. package/dist/AvatarStack/AvatarStack.js +3 -3
  21. package/dist/Banner/Banner.js +3 -3
  22. package/dist/BaseStyles.js +2 -2
  23. package/dist/Blankslate/Blankslate.js +3 -3
  24. package/dist/BranchName/BranchName.js +2 -2
  25. package/dist/Breadcrumbs/Breadcrumbs.js +3 -3
  26. package/dist/Button/Button.js +2 -2
  27. package/dist/Button/{ButtonBase-b44e29d1.css → ButtonBase-faef2674.css} +2 -2
  28. package/dist/Button/ButtonBase-faef2674.css.map +1 -0
  29. package/dist/Button/ButtonBase.js +4 -4
  30. package/dist/Button/ButtonBase.module.css.js +1 -1
  31. package/dist/Button/IconButton.js +3 -3
  32. package/dist/Button/LinkButton.js +2 -2
  33. package/dist/ButtonGroup/ButtonGroup.js +3 -3
  34. package/dist/Card/Card.js +3 -3
  35. package/dist/Checkbox/Checkbox.js +2 -2
  36. package/dist/CheckboxGroup/CheckboxGroup.js +2 -2
  37. package/dist/CircleBadge/CircleBadge.js +2 -2
  38. package/dist/ConfirmationDialog/ConfirmationDialog.js +2 -2
  39. package/dist/CounterLabel/CounterLabel.js +3 -3
  40. package/dist/DataTable/DataTable.d.ts +20 -20
  41. package/dist/DataTable/DataTable.js +42 -27
  42. package/dist/DataTable/ErrorDialog.js +1 -1
  43. package/dist/DataTable/Pagination.js +5 -5
  44. package/dist/DataTable/Table-50e68700.css +2 -0
  45. package/dist/DataTable/Table-50e68700.css.map +1 -0
  46. package/dist/DataTable/Table.d.ts +1 -0
  47. package/dist/DataTable/Table.js +74 -44
  48. package/dist/DataTable/Table.module.css.js +7 -2
  49. package/dist/DataTable/TableGroup.d.ts +41 -0
  50. package/dist/DataTable/TableGroup.js +159 -0
  51. package/dist/DataTable/TableGroupContext.js +5 -0
  52. package/dist/DataTable/index.d.ts +4 -2
  53. package/dist/DataTable/index.js +2 -0
  54. package/dist/DataTable/row.d.ts +24 -1
  55. package/dist/DataTable/useTable.js +157 -80
  56. package/dist/DataTable/utils.d.ts +4 -2
  57. package/dist/Details/Details.js +3 -3
  58. package/dist/Dialog/Dialog.js +3 -3
  59. package/dist/FeatureFlags/DefaultFeatureFlags.js +1 -2
  60. package/dist/FeatureFlags/FeatureFlags.js +2 -2
  61. package/dist/FeatureFlags/useFeatureFlag.js +1 -1
  62. package/dist/FilteredActionList/FilteredActionList.js +2 -2
  63. package/dist/FilteredActionList/FilteredActionListInput.js +2 -2
  64. package/dist/FilteredActionList/FilteredActionListLoaders.js +1 -1
  65. package/dist/Flash/Flash.js +3 -3
  66. package/dist/FormControl/FormControl.js +4 -4
  67. package/dist/FormControl/FormControlCaption.js +2 -2
  68. package/dist/FormControl/FormControlLabel.js +1 -1
  69. package/dist/FormControl/FormControlLeadingVisual.js +1 -1
  70. package/dist/FormControl/_FormControlContext.js +1 -1
  71. package/dist/FormControl/_FormControlValidation.js +1 -1
  72. package/dist/Header/Header.js +3 -3
  73. package/dist/Heading/Heading.js +3 -3
  74. package/dist/Hidden/Hidden.js +2 -2
  75. package/dist/InlineMessage/InlineMessage.js +2 -2
  76. package/dist/KeybindingHint/KeybindingHint.js +3 -3
  77. package/dist/KeybindingHint/components/Chord.js +4 -4
  78. package/dist/KeybindingHint/components/Key.js +1 -1
  79. package/dist/KeybindingHint/components/Sequence.js +3 -3
  80. package/dist/Label/Label.js +3 -3
  81. package/dist/LabelGroup/LabelGroup.js +2 -2
  82. package/dist/Link/Link.js +3 -3
  83. package/dist/NavList/NavList.js +6 -6
  84. package/dist/Octicon/Octicon.js +2 -2
  85. package/dist/Overlay/Overlay.js +2 -2
  86. package/dist/PageHeader/PageHeader.js +4 -4
  87. package/dist/PageLayout/DragHandle.js +2 -2
  88. package/dist/PageLayout/PageLayout.js +3 -3
  89. package/dist/PageLayout/usePaneWidth.js +1 -1
  90. package/dist/Pagehead/Pagehead.js +2 -2
  91. package/dist/Pagination/Pagination.js +4 -4
  92. package/dist/Popover/Popover.js +3 -3
  93. package/dist/Portal/Portal.js +1 -1
  94. package/dist/ProgressBar/ProgressBar.js +3 -3
  95. package/dist/Radio/Radio.js +3 -3
  96. package/dist/RadioGroup/RadioGroup.js +1 -1
  97. package/dist/RelativeTime/RelativeTime.js +1 -1
  98. package/dist/ScrollableRegion/ScrollableRegion.js +3 -3
  99. package/dist/SegmentedControl/SegmentedControl-e68d4197.css +2 -0
  100. package/dist/SegmentedControl/SegmentedControl-e68d4197.css.map +1 -0
  101. package/dist/SegmentedControl/SegmentedControl.d.ts +5 -1
  102. package/dist/SegmentedControl/SegmentedControl.js +204 -167
  103. package/dist/SegmentedControl/SegmentedControl.module.css.js +8 -4
  104. package/dist/SegmentedControl/SegmentedControlAction.d.ts +12 -0
  105. package/dist/SegmentedControl/SegmentedControlAction.js +111 -0
  106. package/dist/SegmentedControl/SegmentedControlActionContext.js +5 -0
  107. package/dist/SegmentedControl/SegmentedControlButton.js +2 -2
  108. package/dist/SegmentedControl/SegmentedControlDivider.d.ts +9 -0
  109. package/dist/SegmentedControl/SegmentedControlDivider.js +24 -0
  110. package/dist/SegmentedControl/SegmentedControlIconButton.js +2 -2
  111. package/dist/SegmentedControl/index.d.ts +3 -1
  112. package/dist/Select/Select.js +3 -3
  113. package/dist/SelectPanel/SelectPanel.js +3 -3
  114. package/dist/SelectPanel/SelectPanelMessage.js +2 -2
  115. package/dist/SideNav.js +2 -2
  116. package/dist/Skeleton/SkeletonBox.js +3 -3
  117. package/dist/SkeletonAvatar/SkeletonAvatar.js +2 -2
  118. package/dist/SkeletonText/SkeletonText.js +2 -2
  119. package/dist/Spinner/Spinner.js +3 -3
  120. package/dist/SplitPageLayout/SplitPageLayout.js +1 -1
  121. package/dist/Stack/Stack.js +3 -3
  122. package/dist/StateLabel/StateLabel.js +3 -3
  123. package/dist/SubNav/SubNav.js +3 -3
  124. package/dist/TabNav/TabNav.js +3 -3
  125. package/dist/Text/Text.js +2 -2
  126. package/dist/TextInput/TextInput.js +5 -5
  127. package/dist/TextInputWithTokens/TextInputWithTokens.js +3 -3
  128. package/dist/Textarea/Textarea.js +4 -4
  129. package/dist/ThemeProvider.js +2 -2
  130. package/dist/Timeline/Timeline.js +3 -3
  131. package/dist/ToggleSwitch/ToggleSwitch.js +4 -4
  132. package/dist/Token/IssueLabelToken.js +3 -3
  133. package/dist/Token/Token.js +3 -3
  134. package/dist/Token/TokenBase.js +3 -3
  135. package/dist/Token/_RemoveTokenButton.js +1 -1
  136. package/dist/Token/_TokenTextContainer.js +2 -2
  137. package/dist/Tooltip/Tooltip.js +2 -2
  138. package/dist/TooltipV2/Tooltip.js +21 -11
  139. package/dist/TopicTag/TopicTag.js +2 -2
  140. package/dist/TopicTag/TopicTagGroup.js +2 -2
  141. package/dist/TreeView/TreeView.js +9 -9
  142. package/dist/TreeView/useRovingTabIndex.js +1 -1
  143. package/dist/TreeView/useTreeItemCache.js +1 -1
  144. package/dist/TreeView/useTypeahead.js +1 -1
  145. package/dist/Truncate/Truncate.js +2 -2
  146. package/dist/UnderlineNav/UnderlineNav.js +3 -3
  147. package/dist/UnderlineNav/UnderlineNavItem.js +2 -2
  148. package/dist/VisuallyHidden/VisuallyHidden.js +2 -2
  149. package/dist/_VisuallyHidden.js +2 -2
  150. package/dist/deprecated/ActionList/Divider.js +1 -1
  151. package/dist/deprecated/ActionList/Group.js +1 -1
  152. package/dist/deprecated/ActionList/Header.js +2 -2
  153. package/dist/deprecated/ActionList/Item.js +4 -4
  154. package/dist/deprecated/ActionList/List.js +3 -3
  155. package/dist/deprecated/ActionMenu.js +2 -2
  156. package/dist/deprecated/DialogV1/Dialog.js +4 -4
  157. package/dist/deprecated/FilteredSearch/FilteredSearch.js +2 -2
  158. package/dist/deprecated/UnderlineNav/UnderlineNav.js +3 -3
  159. package/dist/experimental/IssueLabel/IssueLabel.js +2 -2
  160. package/dist/experimental/SelectPanel2/SelectPanel.js +5 -5
  161. package/dist/experimental/Tabs/Tabs.js +23 -26
  162. package/dist/experimental/Tabs/useTab.js +1 -1
  163. package/dist/experimental/Tabs/useTabList.js +17 -21
  164. package/dist/experimental/Tabs/useTabPanel.js +1 -1
  165. package/dist/experimental/UnderlinePanels/UnderlinePanels.js +10 -15
  166. package/dist/experimental/index.d.ts +6 -5
  167. package/dist/experimental/index.js +1 -1
  168. package/dist/hooks/useDetails.js +1 -1
  169. package/dist/hooks/useDialog.js +1 -1
  170. package/dist/hooks/useMedia.js +1 -1
  171. package/dist/hooks/useMenuInitialFocus.js +1 -1
  172. package/dist/hooks/useMenuKeyboardNavigation.js +1 -1
  173. package/dist/hooks/useMergedRefs.js +1 -1
  174. package/dist/hooks/useMnemonics.js +1 -1
  175. package/dist/hooks/useOpenAndCloseFocus.js +1 -1
  176. package/dist/hooks/useOverflow.js +5 -5
  177. package/dist/hooks/useOverlay.js +1 -1
  178. package/dist/hooks/useProvidedStateOrCreate.js +1 -1
  179. package/dist/hooks/useRefObjectAsForwardedRef.js +1 -1
  180. package/dist/hooks/useRenderForcingRef.js +1 -1
  181. package/dist/hooks/useScrollFlash.js +1 -1
  182. package/dist/hooks/useSyncedState.js +1 -1
  183. package/dist/index.d.ts +5 -1
  184. package/dist/index.js +3 -1
  185. package/dist/internal/components/ButtonReset.js +2 -2
  186. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +4 -4
  187. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js +3 -3
  188. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js +3 -3
  189. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js +2 -2
  190. package/dist/internal/components/ConditionalWrapper.js +1 -1
  191. package/dist/internal/components/InputLabel.js +2 -2
  192. package/dist/internal/components/InputValidation.js +2 -2
  193. package/dist/internal/components/OverflowObserverProvider.js +2 -2
  194. package/dist/internal/components/TextInputInnerAction.js +4 -4
  195. package/dist/internal/components/TextInputInnerVisualSlot.js +2 -2
  196. package/dist/internal/components/TextInputWrapper.js +3 -3
  197. package/dist/internal/components/ThemeProviderBase.js +1 -1
  198. package/dist/internal/components/UnderlineTabbedInterface.js +3 -3
  199. package/dist/internal/components/UnstyledTextInput.js +3 -3
  200. package/dist/internal/components/ValidationAnimationContainer.js +2 -2
  201. package/dist/internal/hooks/useEffectCallback.js +1 -1
  202. package/dist/internal/hooks/useEffectOnce.js +1 -1
  203. package/dist/internal/hooks/useOverflowObserver.js +1 -1
  204. package/dist/internal/hooks/useThemeProvider.js +1 -1
  205. package/dist/live-region/Announce.js +2 -2
  206. package/dist/live-region/AriaAlert.d.ts +1 -1
  207. package/dist/live-region/AriaAlert.js +1 -1
  208. package/dist/live-region/AriaStatus.js +1 -1
  209. package/dist/next/ThemeProvider.js +1 -1
  210. package/dist/utils/descendant-registry.js +2 -2
  211. package/dist/utils/react-compiler-runtime.js +32 -0
  212. package/generated/components.json +185 -10
  213. package/package.json +8 -8
  214. package/dist/Button/ButtonBase-b44e29d1.css.map +0 -1
  215. package/dist/DataTable/Table-7f5cb3e4.css +0 -2
  216. package/dist/DataTable/Table-7f5cb3e4.css.map +0 -1
  217. package/dist/SegmentedControl/SegmentedControl-4ef72733.css +0 -2
  218. package/dist/SegmentedControl/SegmentedControl-4ef72733.css.map +0 -1
@@ -1,10 +1,11 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import { DEFAULT_SORT_DIRECTION, SortDirection, strategies, transition } from "./sorting.js";
2
- import { c } from "react-compiler-runtime";
3
- import { useState } from "react";
3
+ import { useId, useState } from "react";
4
4
  //#region src/DataTable/useTable.ts
5
5
  function useTable(t0) {
6
- const $ = c(21);
6
+ const $ = c(29);
7
7
  const { columns, data, initialSortColumn, initialSortDirection, externalSorting, getRowId } = t0;
8
+ const tableId = useId();
8
9
  const [rowOrder, setRowOrder] = useState(data);
9
10
  const [prevData, setPrevData] = useState(data);
10
11
  const [prevColumns, setPrevColumns] = useState(columns);
@@ -29,18 +30,26 @@ function useTable(t0) {
29
30
  }
30
31
  }
31
32
  let t2;
32
- let t3;
33
- let t4;
34
- if ($[4] !== columns || $[5] !== data || $[6] !== externalSorting || $[7] !== getRowId || $[8] !== prevData || $[9] !== rowOrder || $[10] !== sortByColumn) {
35
- let t5;
36
- if ($[14] !== sortByColumn) {
37
- t5 = (column_1) => {
33
+ if ($[4] !== rowOrder) {
34
+ t2 = rowOrder.some(isDataTableRowGroup);
35
+ $[4] = rowOrder;
36
+ $[5] = t2;
37
+ } else t2 = $[5];
38
+ const hasGroups = t2;
39
+ let bodies;
40
+ let headers;
41
+ let sortBy;
42
+ if ($[6] !== columns || $[7] !== data || $[8] !== externalSorting || $[9] !== getRowId || $[10] !== hasGroups || $[11] !== prevData || $[12] !== rowOrder || $[13] !== sortByColumn || $[14] !== tableId) {
43
+ let t3;
44
+ if ($[18] !== hasGroups || $[19] !== sortByColumn || $[20] !== tableId) {
45
+ t3 = (column_1, index) => {
38
46
  var _column_1$id;
39
47
  const id_0 = (_column_1$id = column_1.id) !== null && _column_1$id !== void 0 ? _column_1$id : column_1.field;
40
48
  if (id_0 === void 0) throw new Error("Expected either an `id` or `field` to be defined for a Column");
41
49
  const sortable = column_1.sortBy !== void 0 && column_1.sortBy !== false;
42
50
  return {
43
51
  id: id_0,
52
+ domId: hasGroups ? `${tableId}-column-${index}` : void 0,
44
53
  column: column_1,
45
54
  isSortable() {
46
55
  return sortable;
@@ -51,103 +60,171 @@ function useTable(t0) {
51
60
  }
52
61
  };
53
62
  };
54
- $[14] = sortByColumn;
55
- $[15] = t5;
56
- } else t5 = $[15];
57
- const headers = columns.map(t5);
63
+ $[18] = hasGroups;
64
+ $[19] = sortByColumn;
65
+ $[20] = tableId;
66
+ $[21] = t3;
67
+ } else t3 = $[21];
68
+ headers = columns.map(t3);
58
69
  if (data !== prevData) {
59
70
  setPrevData(data);
60
- setRowOrder(data);
61
- if (sortByColumn) sortRows(sortByColumn);
71
+ updateRowOrder(data, sortByColumn);
62
72
  }
63
- const sortBy = function sortBy(header) {
73
+ sortBy = function sortBy(header) {
64
74
  const sortState = {
65
75
  id: header.id,
66
76
  direction: sortByColumn && sortByColumn.id === header.id ? transition(sortByColumn.direction) : DEFAULT_SORT_DIRECTION
67
77
  };
68
78
  setSortByColumn(sortState);
69
- sortRows(sortState);
79
+ updateRowOrder(rowOrder, sortState);
70
80
  };
71
- function sortRows(state) {
72
- const header_1 = headers.find((header_0) => header_0.id === state.id);
73
- if (!header_1) throw new Error(`Unable to find header with id: ${state.id}`);
81
+ function updateRowOrder(rows, state) {
82
+ if (externalSorting || state === null) setRowOrder(rows);
83
+ else {
84
+ const sortedRows = getSortedRowOrder(rows, state);
85
+ setRowOrder(sortedRows);
86
+ }
87
+ }
88
+ function getSortedRowOrder(currentRowOrder, state_0) {
89
+ const header_1 = headers.find((header_0) => header_0.id === state_0.id);
90
+ if (!header_1) throw new Error(`Unable to find header with id: ${state_0.id}`);
74
91
  if (header_1.column.sortBy === false || header_1.column.sortBy === void 0) throw new Error("The column for this header is not sortable");
75
- if (externalSorting) return;
76
- const sortMethod = header_1.column.sortBy === true ? strategies.basic : typeof header_1.column.sortBy === "string" ? strategies[header_1.column.sortBy] : header_1.column.sortBy;
77
- setRowOrder((rowOrder_0) => rowOrder_0.slice().sort((a, b) => {
78
- if (header_1.column.field === void 0) return 0;
79
- if (typeof header_1.column.sortBy === "function") {
80
- if (state.direction === SortDirection.ASC) return sortMethod(a, b);
81
- return sortMethod(b, a);
82
- }
83
- const valueA = get(a, header_1.column.field);
84
- const valueB = get(b, header_1.column.field);
85
- const valueAIsBlank = isBlankValue(valueA);
86
- const valueBIsBlank = isBlankValue(valueB);
87
- if (!valueAIsBlank && !valueBIsBlank) {
88
- if (state.direction === SortDirection.ASC) return sortMethod(valueA, valueB);
89
- return sortMethod(valueB, valueA);
90
- }
91
- if (!valueAIsBlank) return -1;
92
- if (!valueBIsBlank) return 1;
93
- return 0;
94
- }));
92
+ const column_2 = header_1.column;
93
+ const sortMethod = column_2.sortBy === true ? strategies.basic : typeof column_2.sortBy === "string" ? strategies[column_2.sortBy] : column_2.sortBy;
94
+ const sortData = function sortData(rows_0) {
95
+ return rows_0.slice().sort((a, b) => {
96
+ if (column_2.field === void 0) return 0;
97
+ if (typeof column_2.sortBy === "function") {
98
+ if (state_0.direction === SortDirection.ASC) return sortMethod(a, b);
99
+ return sortMethod(b, a);
100
+ }
101
+ const valueA = get(a, column_2.field);
102
+ const valueB = get(b, column_2.field);
103
+ const valueAIsBlank = isBlankValue(valueA);
104
+ const valueBIsBlank = isBlankValue(valueB);
105
+ if (!valueAIsBlank && !valueBIsBlank) {
106
+ if (state_0.direction === SortDirection.ASC) return sortMethod(valueA, valueB);
107
+ return sortMethod(valueB, valueA);
108
+ }
109
+ if (!valueAIsBlank) return -1;
110
+ if (!valueBIsBlank) return 1;
111
+ return 0;
112
+ });
113
+ };
114
+ const sorted = [];
115
+ let ungroupedRows = [];
116
+ const appendUngroupedRows = function appendUngroupedRows() {
117
+ for (const row of sortData(ungroupedRows)) sorted.push(row);
118
+ ungroupedRows = [];
119
+ };
120
+ for (const item of currentRowOrder) if (isDataTableRowGroup(item)) {
121
+ appendUngroupedRows();
122
+ sorted.push({
123
+ ...item,
124
+ rows: sortData(item.rows)
125
+ });
126
+ } else ungroupedRows.push(item);
127
+ appendUngroupedRows();
128
+ return sorted;
95
129
  }
96
- t2 = headers;
97
- t3 = rowOrder.map((row) => {
98
- const rowId = getRowId(row);
130
+ const createRow = function createRow(row_0, rowIndex) {
131
+ const rowId = getRowId(row_0);
132
+ const rowHeaderIds = hasGroups ? headers.flatMap((header_2, index_0) => header_2.column.rowHeader ? [`${tableId}-row-${rowIndex}-header-${index_0}`] : []) : [];
99
133
  return {
134
+ type: "row",
100
135
  id: `${rowId}`,
101
136
  getValue() {
102
- return row;
137
+ return row_0;
103
138
  },
104
139
  getCells() {
105
- return headers.map((header_2) => {
106
- var _header_2$column$rowH;
140
+ return headers.map((header_3, index_1) => {
141
+ var _header_3$column$rowH;
142
+ const rowHeader = (_header_3$column$rowH = header_3.column.rowHeader) !== null && _header_3$column$rowH !== void 0 ? _header_3$column$rowH : false;
107
143
  return {
108
- id: `${rowId}:${header_2.id}`,
109
- column: header_2.column,
110
- rowHeader: (_header_2$column$rowH = header_2.column.rowHeader) !== null && _header_2$column$rowH !== void 0 ? _header_2$column$rowH : false,
144
+ id: `${rowId}:${header_3.id}`,
145
+ domId: hasGroups && rowHeader ? `${tableId}-row-${rowIndex}-header-${index_1}` : void 0,
146
+ headers: hasGroups ? (rowHeader ? [header_3.domId] : [...rowHeaderIds, header_3.domId]).join(" ") : void 0,
147
+ column: header_3.column,
148
+ rowHeader,
111
149
  getValue() {
112
- if (header_2.column.field !== void 0) return get(row, header_2.column.field);
113
- throw new Error(`Unable to get value for column header ${header_2.id}`);
150
+ if (header_3.column.field !== void 0) return get(row_0, header_3.column.field);
151
+ throw new Error(`Unable to get value for column header ${header_3.id}`);
114
152
  }
115
153
  };
116
154
  });
117
155
  }
118
156
  };
119
- });
120
- t4 = { sortBy };
121
- $[4] = columns;
122
- $[5] = data;
123
- $[6] = externalSorting;
124
- $[7] = getRowId;
125
- $[8] = prevData;
126
- $[9] = rowOrder;
127
- $[10] = sortByColumn;
128
- $[11] = t2;
129
- $[12] = t3;
130
- $[13] = t4;
157
+ };
158
+ bodies = [];
159
+ let rowIndex_0 = 0;
160
+ let body = {
161
+ type: "row-body",
162
+ key: "rows:start",
163
+ rows: []
164
+ };
165
+ for (const item_0 of rowOrder) if (isDataTableRowGroup(item_0)) {
166
+ if (body.rows.length > 0) bodies.push(body);
167
+ const groupStartIndex = rowIndex_0;
168
+ bodies.push({
169
+ type: "row-group",
170
+ key: `group:${item_0.groupId}`,
171
+ id: item_0.groupId,
172
+ label: item_0.label,
173
+ rows: item_0.rows.map((row_1, index_2) => createRow(row_1, groupStartIndex + index_2)),
174
+ "aria-label": item_0["aria-label"]
175
+ });
176
+ rowIndex_0 = rowIndex_0 + item_0.rows.length;
177
+ body = {
178
+ type: "row-body",
179
+ key: `rows:after:${item_0.groupId}`,
180
+ rows: []
181
+ };
182
+ } else {
183
+ body.rows.push(createRow(item_0, rowIndex_0));
184
+ rowIndex_0 = rowIndex_0 + 1;
185
+ }
186
+ if (body.rows.length > 0 || bodies.length === 0) bodies.push(body);
187
+ $[6] = columns;
188
+ $[7] = data;
189
+ $[8] = externalSorting;
190
+ $[9] = getRowId;
191
+ $[10] = hasGroups;
192
+ $[11] = prevData;
193
+ $[12] = rowOrder;
194
+ $[13] = sortByColumn;
195
+ $[14] = tableId;
196
+ $[15] = bodies;
197
+ $[16] = headers;
198
+ $[17] = sortBy;
131
199
  } else {
132
- t2 = $[11];
133
- t3 = $[12];
134
- t4 = $[13];
200
+ bodies = $[15];
201
+ headers = $[16];
202
+ sortBy = $[17];
135
203
  }
136
- let t5;
137
- if ($[16] !== gridTemplateColumns || $[17] !== t2 || $[18] !== t3 || $[19] !== t4) {
138
- t5 = {
139
- headers: t2,
140
- rows: t3,
141
- actions: t4,
142
- gridTemplateColumns
204
+ let t3;
205
+ if ($[22] !== sortBy) {
206
+ t3 = { sortBy };
207
+ $[22] = sortBy;
208
+ $[23] = t3;
209
+ } else t3 = $[23];
210
+ let t4;
211
+ if ($[24] !== bodies || $[25] !== gridTemplateColumns || $[26] !== headers || $[27] !== t3) {
212
+ t4 = {
213
+ headers,
214
+ actions: t3,
215
+ gridTemplateColumns,
216
+ bodies
143
217
  };
144
- $[16] = gridTemplateColumns;
145
- $[17] = t2;
146
- $[18] = t3;
147
- $[19] = t4;
148
- $[20] = t5;
149
- } else t5 = $[20];
150
- return t5;
218
+ $[24] = bodies;
219
+ $[25] = gridTemplateColumns;
220
+ $[26] = headers;
221
+ $[27] = t3;
222
+ $[28] = t4;
223
+ } else t4 = $[28];
224
+ return t4;
225
+ }
226
+ function isDataTableRowGroup(item) {
227
+ return "groupId" in item && "rows" in item && Array.isArray(item.rows);
151
228
  }
152
229
  function getInitialSortState(columns, initialSortColumn, initialSortDirection) {
153
230
  if (initialSortColumn !== void 0) {
@@ -1,4 +1,5 @@
1
1
  //#region src/DataTable/utils.d.ts
2
+ type IsAny<T> = 0 extends 1 & T ? true : false;
2
3
  type ArrayOfLength<Length extends number, SizedArray extends Array<unknown> = []> = SizedArray['length'] extends Length ? SizedArray : ArrayOfLength<Length, [...SizedArray, SizedArray['length']]>;
3
4
  type MaxLength = ArrayOfLength<10>[number];
4
5
  type ArrayIndex<A extends ReadonlyArray<any>, Keys extends number = never> = A extends readonly [] ? Keys : A extends readonly [infer _, ...infer Tail] ? ArrayIndex<Tail, Keys | Tail['length']> : Keys;
@@ -6,6 +7,7 @@ type ArrayWithinBounds<T> = T extends ReadonlyArray<any> & {
6
7
  length: infer Length;
7
8
  } ? Length extends MaxLength ? T : never : never;
8
9
  type ObjectPaths<T> = T extends readonly any[] & ArrayWithinBounds<T> ? `${ArrayIndex<T>}` | PrefixPath<T, ArrayIndex<T>> : T extends any[] ? never & 'Unable to determine keys of potentially boundless array' : T extends Date ? never : T extends object ? Extract<keyof T, string | number> | PrefixPath<T, Extract<keyof T, string | number>> : never;
9
- type PrefixPath<T, Prefix> = Prefix extends Extract<keyof T, number | string> ? `${Prefix}.${ObjectPaths<T[Prefix]>}` : never;
10
+ type PrefixPath<T, Prefix> = Prefix extends Extract<keyof T, number | string> ? `${Prefix}.${NestedObjectPaths<T[Prefix]>}` : never;
11
+ type NestedObjectPaths<T> = IsAny<T> extends true ? string : ObjectPaths<T>;
10
12
  //#endregion
11
- export { ObjectPaths };
13
+ export { IsAny, ObjectPaths };
@@ -1,10 +1,10 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import { useMergedRefs } from "../hooks/useMergedRefs.js";
2
3
  import { warning } from "../utils/warning.js";
3
4
  import Details_module_css_default from "./Details.module.css.js";
4
- import { c } from "react-compiler-runtime";
5
- import { clsx } from "clsx";
6
- import { jsx } from "react/jsx-runtime";
7
5
  import React, { useEffect } from "react";
6
+ import { jsx } from "react/jsx-runtime";
7
+ import { clsx } from "clsx";
8
8
  //#region src/Details/Details.tsx
9
9
  const Root = /*#__PURE__*/ React.forwardRef((t0, forwardRef) => {
10
10
  var _dataComponent;
@@ -13,9 +13,9 @@ import Portal_default from "../Portal/index.js";
13
13
  import { ScrollableRegion } from "../ScrollableRegion/ScrollableRegion.js";
14
14
  import Dialog_module_css_default from "./Dialog.module.css.js";
15
15
  import { DialogContext } from "./DialogContext.js";
16
- import { clsx } from "clsx";
17
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
18
16
  import React, { useCallback, useEffect, useRef, useState } from "react";
17
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
18
+ import { clsx } from "clsx";
19
19
  import { FocusKeys } from "@primer/behaviors";
20
20
  import { XIcon } from "@primer/octicons-react";
21
21
  //#region src/Dialog/Dialog.tsx
@@ -261,7 +261,7 @@ const Buttons = ({ buttons }) => {
261
261
  (_readRef$current = readRef.current) === null || _readRef$current === void 0 || _readRef$current.focus();
262
262
  } else setHasRendered(hasRendered + 1);
263
263
  }, [readRef, hasRendered]);
264
- return /*#__PURE__*/ jsx(Fragment, { children: buttons.map((dialogButtonProps, index) => {
264
+ return /*#__PURE__*/ jsx(Fragment$1, { children: buttons.map((dialogButtonProps, index) => {
265
265
  const { content, buttonType = "default", autoFocus = false, ...buttonProps } = dialogButtonProps;
266
266
  return /*#__PURE__*/ jsx(ButtonComponent, {
267
267
  "data-component": "Dialog.FooterButton",
@@ -8,8 +8,7 @@ const DefaultFeatureFlags = FeatureFlagScope.create({
8
8
  primer_react_action_list_group_heading_trailing_action: false,
9
9
  primer_react_action_list_item_gap: false,
10
10
  primer_react_timeline_list_semantics: false,
11
- primer_react_merged_forwarded_refs: false,
12
- primer_react_underline_panels_controlled: false
11
+ primer_react_merged_forwarded_refs: false
13
12
  });
14
13
  //#endregion
15
14
  export { DefaultFeatureFlags };
@@ -1,8 +1,8 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import { FeatureFlagScope } from "./FeatureFlagScope.js";
2
3
  import { FeatureFlagContext } from "./FeatureFlagContext.js";
3
- import { c } from "react-compiler-runtime";
4
- import { jsx } from "react/jsx-runtime";
5
4
  import { useContext } from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
6
  //#region src/FeatureFlags/FeatureFlags.tsx
7
7
  function FeatureFlags(t0) {
8
8
  const $ = c(6);
@@ -1,5 +1,5 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import { FeatureFlagContext } from "./FeatureFlagContext.js";
2
- import { c } from "react-compiler-runtime";
3
3
  import { useContext } from "react";
4
4
  //#region src/FeatureFlags/useFeatureFlag.ts
5
5
  /**
@@ -14,9 +14,9 @@ import { FilteredActionListBodyLoader } from "./FilteredActionListLoaders.js";
14
14
  import FilteredActionList_module_css_default from "./FilteredActionList.module.css.js";
15
15
  import { useAnnouncements } from "./useAnnouncements.js";
16
16
  import { FilteredActionListInput } from "./FilteredActionListInput.js";
17
- import { clsx } from "clsx";
18
- import { jsx, jsxs } from "react/jsx-runtime";
19
17
  import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react";
18
+ import { jsx, jsxs } from "react/jsx-runtime";
19
+ import { clsx } from "clsx";
20
20
  import { FocusKeys, scrollIntoView } from "@primer/behaviors";
21
21
  import { isValidElementType } from "react-is";
22
22
  import { useVirtualizer } from "@tanstack/react-virtual";
@@ -1,8 +1,8 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import TextInput_default from "../TextInput/TextInput.js";
2
3
  import FilteredActionList_module_css_default from "./FilteredActionList.module.css.js";
3
- import { c } from "react-compiler-runtime";
4
- import { clsx } from "clsx";
5
4
  import { jsx } from "react/jsx-runtime";
5
+ import { clsx } from "clsx";
6
6
  //#region src/FilteredActionList/FilteredActionListInput.tsx
7
7
  function FilteredActionListInput(t0) {
8
8
  const $ = c(28);
@@ -1,9 +1,9 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import Spinner from "../Spinner/Spinner.js";
2
3
  import { Stack } from "../Stack/Stack.js";
3
4
  import { SkeletonBox } from "../Skeleton/SkeletonBox.js";
4
5
  import FilteredActionListLoaders_module_css_default from "./FilteredActionListLoaders.module.css.js";
5
6
  import { FilteredActionListLoadingTypes } from "./constants.js";
6
- import { c } from "react-compiler-runtime";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  //#region src/FilteredActionList/FilteredActionListLoaders.tsx
9
9
  const SKELETON_ROW_HEIGHT = 24;
@@ -1,8 +1,8 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import Flash_module_css_default from "./Flash.module.css.js";
2
- import { c } from "react-compiler-runtime";
3
- import { clsx } from "clsx";
4
- import { jsx } from "react/jsx-runtime";
5
3
  import React from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { clsx } from "clsx";
6
6
  //#region src/Flash/Flash.tsx
7
7
  /**
8
8
  * @deprecated Use `Banner` instead. If migration is not yet possible, import `Flash` from `@primer/react/deprecated`.
@@ -1,3 +1,4 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import { useId as useId$1 } from "../hooks/useId.js";
2
3
  import { warning } from "../utils/warning.js";
3
4
  import { isSlot } from "../utils/is-slot.js";
@@ -18,10 +19,9 @@ import FormControlLabel from "./FormControlLabel.js";
18
19
  import FormControlLeadingVisual from "./FormControlLeadingVisual.js";
19
20
  import FormControlValidation from "./_FormControlValidation.js";
20
21
  import FormControl_module_css_default from "./FormControl.module.css.js";
21
- import { c } from "react-compiler-runtime";
22
- import { clsx } from "clsx";
23
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
24
22
  import React, { useContext } from "react";
23
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
24
+ import { clsx } from "clsx";
25
25
  var FormControl_default = Object.assign(/* @__PURE__ */ React.forwardRef((t0, ref) => {
26
26
  var _slots$validation, _slots$label;
27
27
  const $ = c(32);
@@ -125,7 +125,7 @@ var FormControl_default = Object.assign(/* @__PURE__ */ React.forwardRef((t0, re
125
125
  } else t8 = $[15];
126
126
  let t9;
127
127
  if ($[16] !== t6 || $[17] !== t7 || $[18] !== t8) {
128
- t9 = /*#__PURE__*/ jsxs(Fragment, { children: [
128
+ t9 = /*#__PURE__*/ jsxs(Fragment$1, { children: [
129
129
  t6,
130
130
  t7,
131
131
  t8
@@ -1,9 +1,9 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import Text_default from "../Text/Text.js";
2
3
  import { useFormControlContext } from "./_FormControlContext.js";
3
4
  import FormControlCaption_module_css_default from "./FormControlCaption.module.css.js";
4
- import { c } from "react-compiler-runtime";
5
- import { clsx } from "clsx";
6
5
  import { jsx } from "react/jsx-runtime";
6
+ import { clsx } from "clsx";
7
7
  //#region src/FormControl/FormControlCaption.tsx
8
8
  function FormControlCaption(t0) {
9
9
  const $ = c(8);
@@ -1,6 +1,6 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import { useFormControlContext } from "./_FormControlContext.js";
2
3
  import { InputLabel } from "../internal/components/InputLabel.js";
3
- import { c } from "react-compiler-runtime";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/FormControl/FormControlLabel.tsx
6
6
  const FormControlLabel = (t0) => {
@@ -1,6 +1,6 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import { useFormControlContext } from "./_FormControlContext.js";
2
3
  import FormControlLeadingVisual_module_css_default from "./FormControlLeadingVisual.module.css.js";
3
- import { c } from "react-compiler-runtime";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/FormControl/FormControlLeadingVisual.tsx
6
6
  const FormControlLeadingVisual = (t0) => {
@@ -1,4 +1,4 @@
1
- import { c } from "react-compiler-runtime";
1
+ import { c } from "../utils/react-compiler-runtime.js";
2
2
  import { createContext, useContext } from "react";
3
3
  //#region src/FormControl/_FormControlContext.tsx
4
4
  const FormControlContext = /*#__PURE__*/ createContext(null);
@@ -1,6 +1,6 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import InputValidation from "../internal/components/InputValidation.js";
2
3
  import { useFormControlContext } from "./_FormControlContext.js";
3
- import { c } from "react-compiler-runtime";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/FormControl/_FormControlValidation.tsx
6
6
  const FormControlValidation = (t0) => {
@@ -1,8 +1,8 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import Header_module_css_default from "./Header.module.css.js";
2
- import { c } from "react-compiler-runtime";
3
- import { clsx } from "clsx";
4
- import { jsx } from "react/jsx-runtime";
5
3
  import React from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { clsx } from "clsx";
6
6
  //#region src/Header/Header.tsx
7
7
  const Header = /*#__PURE__*/ React.forwardRef(function Header(t0, forwardRef) {
8
8
  const $ = c(13);
@@ -1,10 +1,10 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import { useMergedRefs } from "../hooks/useMergedRefs.js";
2
3
  import { useDevOnlyEffect } from "../internal/hooks/useDevOnlyEffect.js";
3
4
  import Heading_module_css_default from "./Heading.module.css.js";
4
- import { c } from "react-compiler-runtime";
5
- import { clsx } from "clsx";
6
- import { jsx } from "react/jsx-runtime";
7
5
  import React, { forwardRef } from "react";
6
+ import { jsx } from "react/jsx-runtime";
7
+ import { clsx } from "clsx";
8
8
  //#region src/Heading/Heading.tsx
9
9
  const Heading = /*#__PURE__*/ forwardRef((t0, forwardedRef) => {
10
10
  const $ = c(15);
@@ -1,7 +1,7 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import Hidden_module_css_default from "./Hidden.module.css.js";
2
- import { c } from "react-compiler-runtime";
3
- import { clsx } from "clsx";
4
3
  import { jsx } from "react/jsx-runtime";
4
+ import { clsx } from "clsx";
5
5
  //#region src/Hidden/Hidden.tsx
6
6
  function normalize(hiddenViewports) {
7
7
  if (Array.isArray(hiddenViewports)) {
@@ -1,7 +1,7 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import InlineMessage_module_css_default from "./InlineMessage.module.css.js";
2
- import { c } from "react-compiler-runtime";
3
- import { clsx } from "clsx";
4
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { clsx } from "clsx";
5
5
  import { isValidElementType } from "react-is";
6
6
  import { AlertFillIcon, AlertIcon, CheckCircleFillIcon, CheckCircleIcon, InfoIcon } from "@primer/octicons-react";
7
7
  //#region src/InlineMessage/InlineMessage.tsx
@@ -1,10 +1,10 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import Text_default from "../Text/Text.js";
2
3
  import { Sequence } from "./components/Sequence.js";
3
4
  import KeybindingHint_module_css_default from "./KeybindingHint.module.css.js";
4
- import { c } from "react-compiler-runtime";
5
- import { clsx } from "clsx";
6
- import { jsx } from "react/jsx-runtime";
7
5
  import { memo } from "react";
6
+ import { jsx } from "react/jsx-runtime";
7
+ import { clsx } from "clsx";
8
8
  //#region src/KeybindingHint/KeybindingHint.tsx
9
9
  /** `kbd` element with style resets. */
10
10
  const Kbd = (t0) => {
@@ -1,11 +1,11 @@
1
+ import { c } from "../../utils/react-compiler-runtime.js";
1
2
  import Text_default from "../../Text/Text.js";
2
3
  import { Key } from "./Key.js";
3
4
  import Chord_module_css_default from "./Chord.module.css.js";
4
5
  import { splitChord } from "./utils.js";
5
- import { c } from "react-compiler-runtime";
6
- import { clsx } from "clsx";
6
+ import { Fragment } from "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
- import { Fragment as Fragment$1 } from "react";
8
+ import { clsx } from "clsx";
9
9
  //#region src/KeybindingHint/components/Chord.tsx
10
10
  const Chord = (t0) => {
11
11
  const $ = c(13);
@@ -35,7 +35,7 @@ const Chord = (t0) => {
35
35
  if ($[5] !== format || $[6] !== keys) {
36
36
  let t10;
37
37
  if ($[8] !== format) {
38
- t10 = (k, i) => /*#__PURE__*/ jsxs(Fragment$1, { children: [i > 0 && format === "full" ? /*#__PURE__*/ jsx("span", {
38
+ t10 = (k, i) => /*#__PURE__*/ jsxs(Fragment, { children: [i > 0 && format === "full" ? /*#__PURE__*/ jsx("span", {
39
39
  "aria-hidden": true,
40
40
  children: " + "
41
41
  }) : " ", /*#__PURE__*/ jsx(Key, {
@@ -1,7 +1,7 @@
1
+ import { c } from "../../utils/react-compiler-runtime.js";
1
2
  import VisuallyHidden from "../../_VisuallyHidden.js";
2
3
  import { accessibleKeyName, condensedKeyName, fullKeyName } from "../key-names.js";
3
4
  import { usePlatform } from "../platform.js";
4
- import { c } from "react-compiler-runtime";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/KeybindingHint/components/Key.tsx
7
7
  /** Renders a single key with accessible alternative text. */
@@ -1,10 +1,10 @@
1
1
  import VisuallyHidden from "../../_VisuallyHidden.js";
2
2
  import { Chord } from "./Chord.js";
3
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
- import { Fragment as Fragment$1 } from "react";
3
+ import { Fragment } from "react";
4
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/KeybindingHint/components/Sequence.tsx
6
6
  const splitSequence = (sequence) => sequence.split(" ");
7
- const Sequence = ({ keys, ...chordProps }) => splitSequence(keys).map((c, i) => /*#__PURE__*/ jsxs(Fragment$1, { children: [i > 0 && /*#__PURE__*/ jsxs(Fragment, { children: [/*#__PURE__*/ jsx(VisuallyHidden, { children: "then" }), " "] }), /*#__PURE__*/ jsx(Chord, {
7
+ const Sequence = ({ keys, ...chordProps }) => splitSequence(keys).map((c, i) => /*#__PURE__*/ jsxs(Fragment, { children: [i > 0 && /*#__PURE__*/ jsxs(Fragment$1, { children: [/*#__PURE__*/ jsx(VisuallyHidden, { children: "then" }), " "] }), /*#__PURE__*/ jsx(Chord, {
8
8
  keys: c,
9
9
  ...chordProps
10
10
  })] }, i));
@@ -1,8 +1,8 @@
1
+ import { c } from "../utils/react-compiler-runtime.js";
1
2
  import Label_module_css_default from "./Label.module.css.js";
2
- import { c } from "react-compiler-runtime";
3
- import { clsx } from "clsx";
4
- import { jsx } from "react/jsx-runtime";
5
3
  import React from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { clsx } from "clsx";
6
6
  //#region src/Label/Label.tsx
7
7
  const Label = /*#__PURE__*/ React.forwardRef(function Label(t0, ref) {
8
8
  const $ = c(15);