@primer/react 38.0.0-rc.1 → 38.0.0-rc.2
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 +46 -0
- package/dist/browser.esm.js +3 -3
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +3 -3
- package/dist/browser.umd.js.map +1 -1
- package/dist/components.css +660 -23
- package/generated/components.json +58 -121
- package/lib/AvatarStack/AvatarStack.d.ts +2 -3
- package/lib/AvatarStack/AvatarStack.d.ts.map +1 -1
- package/lib/AvatarStack/AvatarStack.js +1 -3
- package/lib/Banner/Banner.d.ts.map +1 -1
- package/lib/Banner/Banner.js +3 -1
- package/lib/Blankslate/Blankslate.js +38 -40
- package/lib/BranchName/BranchName.d.ts +6 -3
- package/lib/BranchName/BranchName.d.ts.map +1 -1
- package/lib/BranchName/BranchName.js +1 -3
- package/lib/Button/ButtonBase.js +2 -2
- package/lib/Checkbox/Checkbox.js +187 -56
- package/lib/CircleBadge/CircleBadge.d.ts +4 -0
- package/lib/CircleBadge/CircleBadge.d.ts.map +1 -1
- package/lib/CircleBadge/CircleBadge.js +4 -0
- package/lib/DataTable/useTable.js +63 -82
- package/lib/Details/Details.d.ts +2 -3
- package/lib/Details/Details.d.ts.map +1 -1
- package/lib/Details/Details.js +1 -3
- package/lib/FeatureFlags/FeatureFlags.js +10 -12
- package/lib/FilteredActionList/useAnnouncements.js +31 -40
- package/lib/LabelGroup/LabelGroup.d.ts +1 -2
- package/lib/LabelGroup/LabelGroup.d.ts.map +1 -1
- package/lib/LabelGroup/LabelGroup.js +13 -16
- package/lib/NavList/NavList.js +219 -53
- package/lib/PageLayout/PageLayout.js +53 -55
- package/lib/PointerBox/PointerBox.d.ts +8 -0
- package/lib/PointerBox/PointerBox.d.ts.map +1 -1
- package/lib/PointerBox/PointerBox.js +4 -0
- package/{lib-esm/ProgressBar/ProgressBar-a0957632.css → lib/ProgressBar/ProgressBar-36f689cb.css} +2 -2
- package/lib/ProgressBar/ProgressBar-36f689cb.css.map +1 -0
- package/lib/ProgressBar/ProgressBar.d.ts +3 -4
- package/lib/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/lib/ProgressBar/ProgressBar.module.css.js +1 -1
- package/lib/ProgressBar/index.d.ts +2 -2
- package/lib/ProgressBar/index.d.ts.map +1 -1
- package/lib/Select/Select.d.ts +1 -1
- package/lib/Select/Select.d.ts.map +1 -1
- package/lib/Select/Select.js +53 -65
- package/lib/SelectPanel/{SelectPanel-06900070.css → SelectPanel-e11ce210.css} +2 -2
- package/lib/SelectPanel/SelectPanel-e11ce210.css.map +1 -0
- package/lib/SelectPanel/SelectPanel.d.ts +1 -1
- package/lib/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/lib/SelectPanel/SelectPanel.js +2 -9
- package/lib/SelectPanel/SelectPanel.module.css.js +2 -2
- package/lib/SideNav.d.ts +2 -3
- package/lib/SideNav.d.ts.map +1 -1
- package/lib/SideNav.js +4 -10
- package/lib/StateLabel/StateLabel-50420ff5.css +2 -0
- package/lib/StateLabel/StateLabel-50420ff5.css.map +1 -0
- package/lib/StateLabel/StateLabel.d.ts +6 -5
- package/lib/StateLabel/StateLabel.d.ts.map +1 -1
- package/lib/StateLabel/StateLabel.js +54 -126
- package/lib/StateLabel/StateLabel.module.css.js +2 -2
- package/lib/TextInputWithTokens/TextInputWithTokens.d.ts +6 -0
- package/lib/TextInputWithTokens/TextInputWithTokens.d.ts.map +1 -1
- package/lib/TextInputWithTokens/TextInputWithTokens.js +343 -331
- package/lib/ToggleSwitch/ToggleSwitch-4b23d166.css +2 -0
- package/lib/ToggleSwitch/ToggleSwitch-4b23d166.css.map +1 -0
- package/lib/ToggleSwitch/ToggleSwitch.d.ts +1 -3
- package/lib/ToggleSwitch/ToggleSwitch.d.ts.map +1 -1
- package/lib/ToggleSwitch/ToggleSwitch.js +120 -152
- package/lib/ToggleSwitch/ToggleSwitch.module.css.js +2 -2
- package/lib/Token/IssueLabelToken-0dbbbcdf.css +2 -0
- package/lib/Token/IssueLabelToken-0dbbbcdf.css.map +1 -0
- package/lib/Token/IssueLabelToken.d.ts.map +1 -1
- package/lib/Token/IssueLabelToken.js +7 -65
- package/lib/Token/IssueLabelToken.module.css.js +1 -1
- package/lib/Token/TokenBase.js +73 -82
- package/lib/Token/_RemoveTokenButton.js +106 -26
- package/lib/Tooltip/Tooltip.js +15 -17
- package/lib/TreeView/TreeView.js +18 -20
- package/lib/deprecated/ActionList/List.d.ts.map +1 -1
- package/lib/deprecated/ActionList/List.js +115 -138
- package/lib/deprecated/ActionMenu.js +19 -21
- package/lib/deprecated/index.d.ts +2 -0
- package/lib/deprecated/index.d.ts.map +1 -1
- package/lib/deprecated/index.js +2 -0
- package/lib/hooks/useMenuKeyboardNavigation.js +23 -43
- package/lib/hooks/useMnemonics.js +37 -76
- package/lib/hooks/useOpenAndCloseFocus.js +7 -14
- package/lib/hooks/useOverflow.js +7 -11
- package/lib/hooks/useScrollFlash.js +25 -14
- package/lib/index.d.ts +4 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -10
- package/lib/internal/components/BoxWithFallback.js +40 -35
- package/lib/internal/components/Caret-e686f04c.css +2 -0
- package/lib/internal/components/Caret-e686f04c.css.map +1 -0
- package/lib/internal/components/Caret.d.ts +1 -3
- package/lib/internal/components/Caret.d.ts.map +1 -1
- package/lib/internal/components/Caret.js +14 -48
- package/lib/internal/components/Caret.module.css.js +7 -0
- package/lib/internal/components/LiveRegion.js +8 -10
- package/lib/internal/utils/getGlobalFocusStyles.js +1 -1
- package/lib-esm/AvatarStack/AvatarStack.d.ts +2 -3
- package/lib-esm/AvatarStack/AvatarStack.js +1 -3
- package/lib-esm/Banner/Banner.js +3 -1
- package/lib-esm/Blankslate/Blankslate.js +38 -40
- package/lib-esm/BranchName/BranchName.d.ts +6 -3
- package/lib-esm/BranchName/BranchName.js +1 -3
- package/lib-esm/Button/ButtonBase.js +2 -2
- package/lib-esm/Checkbox/Checkbox.js +187 -56
- package/lib-esm/CircleBadge/CircleBadge.d.ts +4 -0
- package/lib-esm/CircleBadge/CircleBadge.js +4 -0
- package/lib-esm/DataTable/useTable.js +64 -83
- package/lib-esm/Details/Details.d.ts +2 -3
- package/lib-esm/Details/Details.js +1 -3
- package/lib-esm/FeatureFlags/FeatureFlags.js +10 -12
- package/lib-esm/FilteredActionList/useAnnouncements.js +31 -40
- package/lib-esm/LabelGroup/LabelGroup.d.ts +1 -2
- package/lib-esm/LabelGroup/LabelGroup.js +13 -16
- package/lib-esm/NavList/NavList.js +219 -53
- package/lib-esm/PageLayout/PageLayout.js +53 -55
- package/lib-esm/PointerBox/PointerBox.d.ts +8 -0
- package/lib-esm/PointerBox/PointerBox.js +4 -0
- package/{lib/ProgressBar/ProgressBar-a0957632.css → lib-esm/ProgressBar/ProgressBar-36f689cb.css} +2 -2
- package/lib-esm/ProgressBar/ProgressBar-36f689cb.css.map +1 -0
- package/lib-esm/ProgressBar/ProgressBar.d.ts +3 -4
- package/lib-esm/ProgressBar/ProgressBar.module.css.js +1 -1
- package/lib-esm/ProgressBar/index.d.ts +2 -2
- package/lib-esm/Select/Select.d.ts +1 -1
- package/lib-esm/Select/Select.js +53 -65
- package/lib-esm/SelectPanel/{SelectPanel-06900070.css → SelectPanel-e11ce210.css} +2 -2
- package/lib-esm/SelectPanel/SelectPanel-e11ce210.css.map +1 -0
- package/lib-esm/SelectPanel/SelectPanel.d.ts +1 -1
- package/lib-esm/SelectPanel/SelectPanel.js +2 -9
- package/lib-esm/SelectPanel/SelectPanel.module.css.js +2 -2
- package/lib-esm/SideNav.d.ts +2 -3
- package/lib-esm/SideNav.js +4 -10
- package/lib-esm/StateLabel/StateLabel-50420ff5.css +2 -0
- package/lib-esm/StateLabel/StateLabel-50420ff5.css.map +1 -0
- package/lib-esm/StateLabel/StateLabel.d.ts +6 -5
- package/lib-esm/StateLabel/StateLabel.js +55 -123
- package/lib-esm/StateLabel/StateLabel.module.css.js +2 -2
- package/lib-esm/TextInputWithTokens/TextInputWithTokens.d.ts +6 -0
- package/lib-esm/TextInputWithTokens/TextInputWithTokens.js +343 -331
- package/lib-esm/ToggleSwitch/ToggleSwitch-4b23d166.css +2 -0
- package/lib-esm/ToggleSwitch/ToggleSwitch-4b23d166.css.map +1 -0
- package/lib-esm/ToggleSwitch/ToggleSwitch.d.ts +1 -3
- package/lib-esm/ToggleSwitch/ToggleSwitch.js +120 -151
- package/lib-esm/ToggleSwitch/ToggleSwitch.module.css.js +2 -2
- package/lib-esm/Token/IssueLabelToken-0dbbbcdf.css +2 -0
- package/lib-esm/Token/IssueLabelToken-0dbbbcdf.css.map +1 -0
- package/lib-esm/Token/IssueLabelToken.js +7 -65
- package/lib-esm/Token/IssueLabelToken.module.css.js +1 -1
- package/lib-esm/Token/TokenBase.js +73 -82
- package/lib-esm/Token/_RemoveTokenButton.js +106 -26
- package/lib-esm/Tooltip/Tooltip.js +15 -17
- package/lib-esm/TreeView/TreeView.js +18 -20
- package/lib-esm/deprecated/ActionList/List.js +116 -138
- package/lib-esm/deprecated/ActionMenu.js +19 -21
- package/lib-esm/deprecated/index.d.ts +2 -0
- package/lib-esm/deprecated/index.js +1 -0
- package/lib-esm/hooks/useMenuKeyboardNavigation.js +23 -43
- package/lib-esm/hooks/useMnemonics.js +37 -76
- package/lib-esm/hooks/useOpenAndCloseFocus.js +7 -14
- package/lib-esm/hooks/useOverflow.js +7 -11
- package/lib-esm/hooks/useScrollFlash.js +25 -14
- package/lib-esm/index.d.ts +4 -3
- package/lib-esm/index.js +1 -1
- package/lib-esm/internal/components/BoxWithFallback.js +40 -35
- package/lib-esm/internal/components/Caret-e686f04c.css +2 -0
- package/lib-esm/internal/components/Caret-e686f04c.css.map +1 -0
- package/lib-esm/internal/components/Caret.d.ts +1 -3
- package/lib-esm/internal/components/Caret.js +14 -44
- package/lib-esm/internal/components/Caret.module.css.js +5 -0
- package/lib-esm/internal/components/LiveRegion.js +8 -10
- package/lib-esm/internal/utils/getGlobalFocusStyles.js +1 -1
- package/package.json +10 -10
- package/lib/CircleOcticon/CircleOcticon.d.ts +0 -16
- package/lib/CircleOcticon/CircleOcticon.d.ts.map +0 -1
- package/lib/CircleOcticon/CircleOcticon.js +0 -99
- package/lib/CircleOcticon/index.d.ts +0 -3
- package/lib/CircleOcticon/index.d.ts.map +0 -1
- package/lib/ProgressBar/ProgressBar-a0957632.css.map +0 -1
- package/lib/SelectPanel/SelectPanel-06900070.css.map +0 -1
- package/lib/StateLabel/StateLabel-cd27f475.css +0 -2
- package/lib/StateLabel/StateLabel-cd27f475.css.map +0 -1
- package/lib/ToggleSwitch/ToggleSwitch-65936b4b.css +0 -4
- package/lib/ToggleSwitch/ToggleSwitch-65936b4b.css.map +0 -1
- package/lib/Token/IssueLabelToken-99c9b914.css +0 -2
- package/lib/Token/IssueLabelToken-99c9b914.css.map +0 -1
- package/lib-esm/CircleOcticon/CircleOcticon.d.ts +0 -16
- package/lib-esm/CircleOcticon/CircleOcticon.js +0 -97
- package/lib-esm/CircleOcticon/index.d.ts +0 -3
- package/lib-esm/ProgressBar/ProgressBar-a0957632.css.map +0 -1
- package/lib-esm/SelectPanel/SelectPanel-06900070.css.map +0 -1
- package/lib-esm/StateLabel/StateLabel-cd27f475.css +0 -2
- package/lib-esm/StateLabel/StateLabel-cd27f475.css.map +0 -1
- package/lib-esm/ToggleSwitch/ToggleSwitch-65936b4b.css +0 -4
- package/lib-esm/ToggleSwitch/ToggleSwitch-65936b4b.css.map +0 -1
- package/lib-esm/Token/IssueLabelToken-99c9b914.css +0 -2
- package/lib-esm/Token/IssueLabelToken-99c9b914.css.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import { strategies, SortDirection,
|
|
3
|
+
import { strategies, SortDirection, DEFAULT_SORT_DIRECTION, transition } from './sorting.js';
|
|
4
4
|
|
|
5
5
|
function useTable(t0) {
|
|
6
|
-
const $ = c(
|
|
6
|
+
const $ = c(20);
|
|
7
7
|
const {
|
|
8
8
|
columns,
|
|
9
9
|
data,
|
|
@@ -41,12 +41,13 @@ function useTable(t0) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
let
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
let t2;
|
|
45
|
+
let t3;
|
|
46
|
+
let t4;
|
|
47
|
+
if ($[4] !== columns || $[5] !== data || $[6] !== getRowId || $[7] !== prevData || $[8] !== rowOrder || $[9] !== sortByColumn) {
|
|
48
|
+
let t5;
|
|
49
|
+
if ($[13] !== sortByColumn) {
|
|
50
|
+
t5 = column_1 => {
|
|
50
51
|
var _column_1$id;
|
|
51
52
|
const id_0 = (_column_1$id = column_1.id) !== null && _column_1$id !== void 0 ? _column_1$id : column_1.field;
|
|
52
53
|
if (id_0 === undefined) {
|
|
@@ -67,12 +68,12 @@ function useTable(t0) {
|
|
|
67
68
|
}
|
|
68
69
|
};
|
|
69
70
|
};
|
|
70
|
-
$[
|
|
71
|
-
$[
|
|
71
|
+
$[13] = sortByColumn;
|
|
72
|
+
$[14] = t5;
|
|
72
73
|
} else {
|
|
73
|
-
|
|
74
|
+
t5 = $[14];
|
|
74
75
|
}
|
|
75
|
-
headers = columns.map(
|
|
76
|
+
const headers = columns.map(t5);
|
|
76
77
|
if (data !== prevData) {
|
|
77
78
|
setPrevData(data);
|
|
78
79
|
setRowOrder(data);
|
|
@@ -80,7 +81,7 @@ function useTable(t0) {
|
|
|
80
81
|
sortRows(sortByColumn);
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
|
-
sortBy = function sortBy(header) {
|
|
84
|
+
const sortBy = function sortBy(header) {
|
|
84
85
|
const sortState = {
|
|
85
86
|
id: header.id,
|
|
86
87
|
direction: sortByColumn && sortByColumn.id === header.id ? transition(sortByColumn.direction) : DEFAULT_SORT_DIRECTION
|
|
@@ -124,86 +125,66 @@ function useTable(t0) {
|
|
|
124
125
|
return 0;
|
|
125
126
|
}));
|
|
126
127
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
getValue() {
|
|
146
|
-
return row;
|
|
147
|
-
},
|
|
148
|
-
getCells() {
|
|
149
|
-
return headers.map(header_2 => {
|
|
150
|
-
var _header_2$column$rowH;
|
|
151
|
-
return {
|
|
152
|
-
id: `${rowId}:${header_2.id}`,
|
|
153
|
-
column: header_2.column,
|
|
154
|
-
rowHeader: (_header_2$column$rowH = header_2.column.rowHeader) !== null && _header_2$column$rowH !== void 0 ? _header_2$column$rowH : false,
|
|
155
|
-
getValue() {
|
|
156
|
-
if (header_2.column.field !== undefined) {
|
|
157
|
-
return get(row, header_2.column.field);
|
|
158
|
-
}
|
|
159
|
-
throw new Error(`Unable to get value for column header ${header_2.id}`);
|
|
128
|
+
t2 = headers;
|
|
129
|
+
t3 = rowOrder.map(row => {
|
|
130
|
+
const rowId = getRowId(row);
|
|
131
|
+
return {
|
|
132
|
+
id: `${rowId}`,
|
|
133
|
+
getValue() {
|
|
134
|
+
return row;
|
|
135
|
+
},
|
|
136
|
+
getCells() {
|
|
137
|
+
return headers.map(header_2 => {
|
|
138
|
+
var _header_2$column$rowH;
|
|
139
|
+
return {
|
|
140
|
+
id: `${rowId}:${header_2.id}`,
|
|
141
|
+
column: header_2.column,
|
|
142
|
+
rowHeader: (_header_2$column$rowH = header_2.column.rowHeader) !== null && _header_2$column$rowH !== void 0 ? _header_2$column$rowH : false,
|
|
143
|
+
getValue() {
|
|
144
|
+
if (header_2.column.field !== undefined) {
|
|
145
|
+
return get(row, header_2.column.field);
|
|
160
146
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
147
|
+
throw new Error(`Unable to get value for column header ${header_2.id}`);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
});
|
|
151
|
+
}
|
|
165
152
|
};
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
$[18] = t3;
|
|
169
|
-
} else {
|
|
170
|
-
t3 = $[18];
|
|
171
|
-
}
|
|
172
|
-
t2 = rowOrder.map(t3);
|
|
173
|
-
$[12] = getRowId;
|
|
174
|
-
$[13] = headers;
|
|
175
|
-
$[14] = rowOrder;
|
|
176
|
-
$[15] = t2;
|
|
177
|
-
} else {
|
|
178
|
-
t2 = $[15];
|
|
179
|
-
}
|
|
180
|
-
let t3;
|
|
181
|
-
if ($[19] !== sortBy) {
|
|
182
|
-
t3 = {
|
|
153
|
+
});
|
|
154
|
+
t4 = {
|
|
183
155
|
sortBy
|
|
184
156
|
};
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
157
|
+
$[4] = columns;
|
|
158
|
+
$[5] = data;
|
|
159
|
+
$[6] = getRowId;
|
|
160
|
+
$[7] = prevData;
|
|
161
|
+
$[8] = rowOrder;
|
|
162
|
+
$[9] = sortByColumn;
|
|
163
|
+
$[10] = t2;
|
|
164
|
+
$[11] = t3;
|
|
165
|
+
$[12] = t4;
|
|
187
166
|
} else {
|
|
188
|
-
|
|
167
|
+
t2 = $[10];
|
|
168
|
+
t3 = $[11];
|
|
169
|
+
t4 = $[12];
|
|
189
170
|
}
|
|
190
|
-
let
|
|
191
|
-
if ($[
|
|
192
|
-
|
|
193
|
-
headers,
|
|
194
|
-
rows:
|
|
195
|
-
actions:
|
|
171
|
+
let t5;
|
|
172
|
+
if ($[15] !== gridTemplateColumns || $[16] !== t2 || $[17] !== t3 || $[18] !== t4) {
|
|
173
|
+
t5 = {
|
|
174
|
+
headers: t2,
|
|
175
|
+
rows: t3,
|
|
176
|
+
actions: t4,
|
|
196
177
|
gridTemplateColumns
|
|
197
178
|
};
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
179
|
+
$[15] = gridTemplateColumns;
|
|
180
|
+
$[16] = t2;
|
|
181
|
+
$[17] = t3;
|
|
182
|
+
$[18] = t4;
|
|
183
|
+
$[19] = t5;
|
|
203
184
|
} else {
|
|
204
|
-
|
|
185
|
+
t5 = $[19];
|
|
205
186
|
}
|
|
206
|
-
return
|
|
187
|
+
return t5;
|
|
207
188
|
}
|
|
208
189
|
function getInitialSortState(columns, initialSortColumn, initialSortDirection) {
|
|
209
190
|
if (initialSortColumn !== undefined) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
import type { SxProp } from '../sx';
|
|
3
2
|
export type SummaryProps<As extends React.ElementType> = {
|
|
4
3
|
/**
|
|
5
4
|
* HTML element to render summary as.
|
|
@@ -12,9 +11,9 @@ declare namespace Summary {
|
|
|
12
11
|
var displayName: string;
|
|
13
12
|
}
|
|
14
13
|
export { Summary };
|
|
15
|
-
declare const Details: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.DetailsHTMLAttributes<HTMLDetailsElement>, HTMLDetailsElement>, "ref"> &
|
|
14
|
+
declare const Details: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.DetailsHTMLAttributes<HTMLDetailsElement>, HTMLDetailsElement>, "ref"> & React.RefAttributes<HTMLDetailsElement>> & {
|
|
16
15
|
Summary: typeof Summary;
|
|
17
16
|
};
|
|
18
|
-
export type DetailsProps = ComponentPropsWithoutRef<'details'
|
|
17
|
+
export type DetailsProps = ComponentPropsWithoutRef<'details'>;
|
|
19
18
|
export default Details;
|
|
20
19
|
//# sourceMappingURL=Details.d.ts.map
|
|
@@ -3,7 +3,6 @@ import React, { useState, useEffect } from 'react';
|
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import classes from './Details.module.css.js';
|
|
5
5
|
import { useMergedRefs } from '../internal/hooks/useMergedRefs.js';
|
|
6
|
-
import { BoxWithFallback } from '../internal/components/BoxWithFallback.js';
|
|
7
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
7
|
|
|
9
8
|
const Root = /*#__PURE__*/React.forwardRef((t0, forwardRef) => {
|
|
@@ -84,8 +83,7 @@ const Root = /*#__PURE__*/React.forwardRef((t0, forwardRef) => {
|
|
|
84
83
|
}
|
|
85
84
|
let t5;
|
|
86
85
|
if ($[10] !== children || $[11] !== ref || $[12] !== rest || $[13] !== t3 || $[14] !== t4) {
|
|
87
|
-
t5 = /*#__PURE__*/jsxs(
|
|
88
|
-
as: "details",
|
|
86
|
+
t5 = /*#__PURE__*/jsxs("details", {
|
|
89
87
|
className: t3,
|
|
90
88
|
...rest,
|
|
91
89
|
ref: ref,
|
|
@@ -12,31 +12,29 @@ function FeatureFlags(t0) {
|
|
|
12
12
|
} = t0;
|
|
13
13
|
const parentFeatureFlags = useContext(FeatureFlagContext);
|
|
14
14
|
let t1;
|
|
15
|
-
let t2;
|
|
16
15
|
if ($[0] !== flags || $[1] !== parentFeatureFlags) {
|
|
17
|
-
|
|
16
|
+
t1 = FeatureFlagScope.merge(parentFeatureFlags, FeatureFlagScope.create(flags));
|
|
18
17
|
$[0] = flags;
|
|
19
18
|
$[1] = parentFeatureFlags;
|
|
20
|
-
$[2] =
|
|
19
|
+
$[2] = t1;
|
|
21
20
|
} else {
|
|
22
|
-
|
|
21
|
+
t1 = $[2];
|
|
23
22
|
}
|
|
24
|
-
const scope =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
let t3;
|
|
23
|
+
const scope = t1;
|
|
24
|
+
const value = scope;
|
|
25
|
+
let t2;
|
|
28
26
|
if ($[3] !== children || $[4] !== value) {
|
|
29
|
-
|
|
27
|
+
t2 = /*#__PURE__*/jsx(FeatureFlagContext.Provider, {
|
|
30
28
|
value: value,
|
|
31
29
|
children: children
|
|
32
30
|
});
|
|
33
31
|
$[3] = children;
|
|
34
32
|
$[4] = value;
|
|
35
|
-
$[5] =
|
|
33
|
+
$[5] = t2;
|
|
36
34
|
} else {
|
|
37
|
-
|
|
35
|
+
t2 = $[5];
|
|
38
36
|
}
|
|
39
|
-
return
|
|
37
|
+
return t2;
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
export { FeatureFlags };
|
|
@@ -32,7 +32,7 @@ const getItemWithActiveDescendant = (listRef, items) => {
|
|
|
32
32
|
//TODO remove this when we remove usingRemoveActiveDescendant
|
|
33
33
|
|
|
34
34
|
const useAnnouncements = (items, listContainerRef, inputRef, t0, t1, message) => {
|
|
35
|
-
const $ = c(
|
|
35
|
+
const $ = c(33);
|
|
36
36
|
const enabled = t0 === undefined ? true : t0;
|
|
37
37
|
const loading = t1 === undefined ? false : t1;
|
|
38
38
|
const usingRemoveActiveDescendant = useFeatureFlag("primer_react_select_panel_remove_active_descendant");
|
|
@@ -68,7 +68,8 @@ const useAnnouncements = (items, listContainerRef, inputRef, t0, t1, message) =>
|
|
|
68
68
|
}
|
|
69
69
|
const announce$1 = t4;
|
|
70
70
|
let t5;
|
|
71
|
-
|
|
71
|
+
let t6;
|
|
72
|
+
if ($[5] !== announce$1 || $[6] !== inputRef || $[7] !== items || $[8] !== listContainerRef || $[9] !== selectedItems || $[10] !== usingRemoveActiveDescendant) {
|
|
72
73
|
t5 = function announceInitialFocus() {
|
|
73
74
|
const focusHandler = () => {
|
|
74
75
|
if (usingRemoveActiveDescendant) {
|
|
@@ -100,33 +101,23 @@ const useAnnouncements = (items, listContainerRef, inputRef, t0, t1, message) =>
|
|
|
100
101
|
inputElement === null || inputElement === void 0 ? void 0 : inputElement.addEventListener("focus", focusHandler);
|
|
101
102
|
return () => inputElement === null || inputElement === void 0 ? void 0 : inputElement.removeEventListener("focus", focusHandler);
|
|
102
103
|
};
|
|
104
|
+
t6 = [listContainerRef, inputRef, items, liveRegion, announce$1, usingRemoveActiveDescendant, selectedItems];
|
|
103
105
|
$[5] = announce$1;
|
|
104
|
-
$[6] = inputRef
|
|
106
|
+
$[6] = inputRef;
|
|
105
107
|
$[7] = items;
|
|
106
108
|
$[8] = listContainerRef;
|
|
107
109
|
$[9] = selectedItems;
|
|
108
110
|
$[10] = usingRemoveActiveDescendant;
|
|
109
111
|
$[11] = t5;
|
|
112
|
+
$[12] = t6;
|
|
110
113
|
} else {
|
|
111
114
|
t5 = $[11];
|
|
112
|
-
|
|
113
|
-
let t6;
|
|
114
|
-
if ($[12] !== announce$1 || $[13] !== inputRef || $[14] !== items || $[15] !== listContainerRef || $[16] !== selectedItems || $[17] !== usingRemoveActiveDescendant) {
|
|
115
|
-
t6 = [listContainerRef, inputRef, items, liveRegion, announce$1, usingRemoveActiveDescendant, selectedItems];
|
|
116
|
-
$[12] = announce$1;
|
|
117
|
-
$[13] = inputRef;
|
|
118
|
-
$[14] = items;
|
|
119
|
-
$[15] = listContainerRef;
|
|
120
|
-
$[16] = selectedItems;
|
|
121
|
-
$[17] = usingRemoveActiveDescendant;
|
|
122
|
-
$[18] = t6;
|
|
123
|
-
} else {
|
|
124
|
-
t6 = $[18];
|
|
115
|
+
t6 = $[12];
|
|
125
116
|
}
|
|
126
117
|
useEffect(t5, t6);
|
|
127
118
|
const isFirstRender = useFirstRender();
|
|
128
119
|
let t7;
|
|
129
|
-
if ($[
|
|
120
|
+
if ($[13] !== announce$1 || $[14] !== isFirstRender || $[15] !== items || $[16] !== listContainerRef || $[17] !== loading || $[18] !== (message === null || message === void 0 ? void 0 : message.description) || $[19] !== (message === null || message === void 0 ? void 0 : message.title) || $[20] !== selectedItems || $[21] !== usingRemoveActiveDescendant) {
|
|
130
121
|
t7 = function announceListUpdates() {
|
|
131
122
|
if (isFirstRender) {
|
|
132
123
|
return;
|
|
@@ -163,36 +154,36 @@ const useAnnouncements = (items, listContainerRef, inputRef, t0, t1, message) =>
|
|
|
163
154
|
});
|
|
164
155
|
}
|
|
165
156
|
};
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
157
|
+
$[13] = announce$1;
|
|
158
|
+
$[14] = isFirstRender;
|
|
159
|
+
$[15] = items;
|
|
160
|
+
$[16] = listContainerRef;
|
|
161
|
+
$[17] = loading;
|
|
162
|
+
$[18] = message === null || message === void 0 ? void 0 : message.description;
|
|
163
|
+
$[19] = message === null || message === void 0 ? void 0 : message.title;
|
|
164
|
+
$[20] = selectedItems;
|
|
165
|
+
$[21] = usingRemoveActiveDescendant;
|
|
166
|
+
$[22] = t7;
|
|
176
167
|
} else {
|
|
177
|
-
t7 = $[
|
|
168
|
+
t7 = $[22];
|
|
178
169
|
}
|
|
179
170
|
const t8 = message === null || message === void 0 ? void 0 : message.title;
|
|
180
171
|
const t9 = message === null || message === void 0 ? void 0 : message.description;
|
|
181
172
|
let t10;
|
|
182
|
-
if ($[
|
|
173
|
+
if ($[23] !== announce$1 || $[24] !== isFirstRender || $[25] !== items || $[26] !== listContainerRef || $[27] !== loading || $[28] !== selectedItems || $[29] !== t8 || $[30] !== t9 || $[31] !== usingRemoveActiveDescendant) {
|
|
183
174
|
t10 = [announce$1, isFirstRender, items, listContainerRef, liveRegion, usingRemoveActiveDescendant, t8, t9, loading, selectedItems];
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
175
|
+
$[23] = announce$1;
|
|
176
|
+
$[24] = isFirstRender;
|
|
177
|
+
$[25] = items;
|
|
178
|
+
$[26] = listContainerRef;
|
|
179
|
+
$[27] = loading;
|
|
180
|
+
$[28] = selectedItems;
|
|
181
|
+
$[29] = t8;
|
|
182
|
+
$[30] = t9;
|
|
183
|
+
$[31] = usingRemoveActiveDescendant;
|
|
184
|
+
$[32] = t10;
|
|
194
185
|
} else {
|
|
195
|
-
t10 = $[
|
|
186
|
+
t10 = $[32];
|
|
196
187
|
}
|
|
197
188
|
useEffect(t7, t10);
|
|
198
189
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { SxProp } from '../sx';
|
|
3
2
|
export type LabelGroupProps = {
|
|
4
3
|
/** Customize the element type of the rendered container */
|
|
5
4
|
as?: React.ElementType;
|
|
@@ -8,7 +7,7 @@ export type LabelGroupProps = {
|
|
|
8
7
|
/** How many tokens to show. `'auto'` truncates the tokens to fit in the parent container. Passing a number will truncate after that number tokens. If this is undefined, tokens will never be truncated. */
|
|
9
8
|
visibleChildCount?: 'auto' | number;
|
|
10
9
|
className?: string;
|
|
11
|
-
}
|
|
10
|
+
};
|
|
12
11
|
declare const LabelGroup: React.FC<React.PropsWithChildren<LabelGroupProps>>;
|
|
13
12
|
export default LabelGroup;
|
|
14
13
|
//# sourceMappingURL=LabelGroup.d.ts.map
|
|
@@ -8,15 +8,13 @@ import VisuallyHidden from '../_VisuallyHidden.js';
|
|
|
8
8
|
import { IconButton } from '../Button/IconButton.js';
|
|
9
9
|
import { ButtonComponent } from '../Button/Button.js';
|
|
10
10
|
import { useTheme } from '../ThemeProvider.js';
|
|
11
|
-
import sx from '../sx.js';
|
|
12
11
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
13
12
|
import { AnchoredOverlay } from '../AnchoredOverlay/AnchoredOverlay.js';
|
|
14
|
-
import Box from '../Box/Box.js';
|
|
15
13
|
|
|
16
14
|
const StyledLabelGroupContainer = styled.div.withConfig({
|
|
17
15
|
displayName: "LabelGroup__StyledLabelGroupContainer",
|
|
18
16
|
componentId: "sc-6tqg8q-0"
|
|
19
|
-
})(["display:flex;flex-wrap:nowrap;gap:", ";line-height:1;max-width:100%;overflow:hidden;&[data-overflow='inline']{flex-wrap:wrap;}&[data-list]{padding-inline-start:0;margin-block-start:0;margin-block-end:0;list-style-type:none;}"
|
|
17
|
+
})(["display:flex;flex-wrap:nowrap;gap:", ";line-height:1;max-width:100%;overflow:hidden;&[data-overflow='inline']{flex-wrap:wrap;}&[data-list]{padding-inline-start:0;margin-block-start:0;margin-block-end:0;list-style-type:none;}"], get('space.1'));
|
|
20
18
|
const ItemWrapper = styled.div.withConfig({
|
|
21
19
|
displayName: "LabelGroup__ItemWrapper",
|
|
22
20
|
componentId: "sc-6tqg8q-1"
|
|
@@ -109,16 +107,18 @@ const OverlayToggle = t0 => {
|
|
|
109
107
|
focusZoneSettings: {
|
|
110
108
|
disabled: true
|
|
111
109
|
},
|
|
112
|
-
children: /*#__PURE__*/jsxs(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
width: overlayWidth,
|
|
116
|
-
padding: `${overlayPaddingPx}px`,
|
|
117
|
-
children: [/*#__PURE__*/jsx(Box, {
|
|
110
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
111
|
+
style: {
|
|
112
|
+
alignItems: "flex-start",
|
|
118
113
|
display: "flex",
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
114
|
+
width: overlayWidth,
|
|
115
|
+
padding: `${overlayPaddingPx}px`
|
|
116
|
+
},
|
|
117
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
118
|
+
style: {
|
|
119
|
+
display: "flex",
|
|
120
|
+
flexWrap: "wrap",
|
|
121
|
+
gap: "4px"
|
|
122
122
|
},
|
|
123
123
|
children: children
|
|
124
124
|
}), /*#__PURE__*/jsx(IconButton, {
|
|
@@ -126,7 +126,7 @@ const OverlayToggle = t0 => {
|
|
|
126
126
|
icon: XIcon,
|
|
127
127
|
"aria-label": "Close",
|
|
128
128
|
variant: "invisible",
|
|
129
|
-
|
|
129
|
+
style: {
|
|
130
130
|
flexShrink: 0
|
|
131
131
|
}
|
|
132
132
|
})]
|
|
@@ -152,7 +152,6 @@ const LabelGroup = ({
|
|
|
152
152
|
children,
|
|
153
153
|
visibleChildCount,
|
|
154
154
|
overflowStyle = 'overlay',
|
|
155
|
-
sx: sxProp,
|
|
156
155
|
as = 'ul',
|
|
157
156
|
className
|
|
158
157
|
}) => {
|
|
@@ -311,7 +310,6 @@ const LabelGroup = ({
|
|
|
311
310
|
ref: containerRef,
|
|
312
311
|
"data-overflow": overflowStyle === 'inline' && isOverflowShown ? 'inline' : undefined,
|
|
313
312
|
"data-list": isList || undefined,
|
|
314
|
-
sx: sxProp,
|
|
315
313
|
className: className,
|
|
316
314
|
as: as,
|
|
317
315
|
children: [React.Children.map(children, (child_0, index) => /*#__PURE__*/jsx(ItemWrapper
|
|
@@ -345,7 +343,6 @@ const LabelGroup = ({
|
|
|
345
343
|
}) : /*#__PURE__*/jsx(StyledLabelGroupContainer, {
|
|
346
344
|
"data-overflow": "inline",
|
|
347
345
|
"data-list": isList || undefined,
|
|
348
|
-
sx: sxProp,
|
|
349
346
|
as: as,
|
|
350
347
|
className: className,
|
|
351
348
|
children: isList ? React.Children.map(children, (child_1, index_0) => {
|