@sproutsocial/seeds-react-menu 1.16.16 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +14 -22
- package/CHANGELOG.md +51 -0
- package/dist/esm/index.js +542 -229
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/v3/index.js +870 -1081
- package/dist/esm/v3/index.js.map +1 -1
- package/dist/v3/index.d.mts +82 -38
- package/dist/v3/index.d.ts +82 -38
- package/dist/v3/index.js +887 -1098
- package/dist/v3/index.js.map +1 -1
- package/dist/v3/menu.css +947 -0
- package/package.json +20 -21
- package/src/ActionMenu/ActionMenu.stories.tsx +1 -1
- package/src/Autocomplete/Autocomplete.stories.tsx +1 -1
- package/src/MenuContent/MenuContent.stories.tsx +1 -1
- package/src/MenuFooter/MenuFooter.stories.tsx +1 -1
- package/src/MenuGroup/MenuGroup.stories.tsx +1 -1
- package/src/MenuHeader/MenuHeader.stories.tsx +1 -1
- package/src/MenuItem/MenuItem.stories.tsx +1 -1
- package/src/MenuToggleButton/MenuToggleButton.stories.tsx +1 -1
- package/src/MultiSelectMenu/MultiSelectMenu.stories.tsx +1 -1
- package/src/NestedMenu/NestedMenu.stories.tsx +1 -1
- package/src/SingleSelectMenu/SingleSelectMenu.stories.tsx +1 -1
- package/src/SubmenuItem/SubmenuItem.stories.tsx +1 -1
- package/src/v3/ActionMenu.stories.tsx +1 -1
- package/src/v3/ActionMenuStyles.tsx +169 -149
- package/src/v3/Common/ComboboxStyles.tsx +396 -511
- package/src/v3/Common/SelectIcons.tsx +17 -8
- package/src/v3/Common/SelectItem.tsx +25 -38
- package/src/v3/Common/SelectStyles.tsx +146 -144
- package/src/v3/Common/cn.ts +38 -0
- package/src/v3/MenuButton.stories.tsx +1 -1
- package/src/v3/MenuButtonStyles.tsx +55 -34
- package/src/v3/ModalStories.stories.tsx +1 -1
- package/src/v3/MultiCombobox.stories.tsx +1 -1
- package/src/v3/MultiCombobox.tsx +7 -0
- package/src/v3/MultiSearchableSelect.stories.tsx +1 -1
- package/src/v3/MultiSearchableSelect.tsx +15 -8
- package/src/v3/MultiSelect.stories.tsx +1 -1
- package/src/v3/MultiSelect.tsx +20 -17
- package/src/v3/SingleCombobox.stories.tsx +1 -1
- package/src/v3/SingleCombobox.tsx +7 -0
- package/src/v3/SingleSearchableSelect.stories.tsx +1 -1
- package/src/v3/SingleSearchableSelect.tsx +7 -0
- package/src/v3/SingleSelect.stories.tsx +1 -1
- package/src/v3/SingleSelect.tsx +22 -14
- package/src/v3/__tests__/ariaLabels.test.tsx +133 -0
- package/src/v3/menu.css +947 -0
- package/tsup.config.ts +0 -1
- package/dist/esm/chunk-ROQATIB7.js +0 -357
- package/dist/esm/chunk-ROQATIB7.js.map +0 -1
- package/dist/esm/v2/index.js +0 -2089
- package/dist/esm/v2/index.js.map +0 -1
- package/dist/v2/index.d.mts +0 -108
- package/dist/v2/index.d.ts +0 -108
- package/dist/v2/index.js +0 -2280
- package/dist/v2/index.js.map +0 -1
- package/src/v2/Autocomplete/Autocomplete.stories.tsx +0 -645
- package/src/v2/Autocomplete/MultiAutocomplete.tsx +0 -487
- package/src/v2/Autocomplete/SingleAutocomplete.tsx +0 -366
- package/src/v2/Autocomplete/index.ts +0 -2
- package/src/v2/Common-V2/ComboboxContent.tsx +0 -457
- package/src/v2/Common-V2/MenuGroup.tsx +0 -60
- package/src/v2/Common-V2/MenuGroupTypes.ts +0 -30
- package/src/v2/Common-V2/MenuHeading.tsx +0 -83
- package/src/v2/Common-V2/MenuItem.tsx +0 -138
- package/src/v2/Common-V2/Popout.tsx +0 -124
- package/src/v2/Common-V2/PopoutTypes.tsx +0 -109
- package/src/v2/Common-V2/SelectToggleButton.tsx +0 -99
- package/src/v2/Common-V2/index.ts +0 -11
- package/src/v2/Common-V2/props.ts +0 -84
- package/src/v2/Common-V2/styles.tsx +0 -41
- package/src/v2/Common-V2/types.ts +0 -16
- package/src/v2/Common-V2/useHighlightedIndex.ts +0 -62
- package/src/v2/Common-V2/utils.ts +0 -238
- package/src/v2/SearchableSelect/AutocompleteContent.tsx +0 -325
- package/src/v2/SearchableSelect/SearchableMultiSelect.tsx +0 -527
- package/src/v2/SearchableSelect/SearchableSelect.tsx +0 -395
- package/src/v2/SearchableSelect/index.ts +0 -12
- package/src/v2/Select/MultiSelect.tsx +0 -417
- package/src/v2/Select/Select.stories.tsx +0 -593
- package/src/v2/Select/SingleSelect.tsx +0 -285
- package/src/v2/Select/index.ts +0 -2
- package/src/v2/index.ts +0 -2
package/dist/v3/index.js
CHANGED
|
@@ -79,9 +79,8 @@ __export(v3_exports, {
|
|
|
79
79
|
module.exports = __toCommonJS(v3_exports);
|
|
80
80
|
|
|
81
81
|
// src/v3/SingleSelect.tsx
|
|
82
|
-
var
|
|
82
|
+
var React5 = __toESM(require("react"));
|
|
83
83
|
var import_select3 = require("@base-ui/react/select");
|
|
84
|
-
var import_styled_components4 = __toESM(require("styled-components"));
|
|
85
84
|
|
|
86
85
|
// src/v3/SeedsPortal.tsx
|
|
87
86
|
var React = __toESM(require("react"));
|
|
@@ -104,49 +103,51 @@ function useSeedsPortalContainer() {
|
|
|
104
103
|
}
|
|
105
104
|
|
|
106
105
|
// src/v3/Common/SelectItem.tsx
|
|
107
|
-
var React2 = require("react");
|
|
106
|
+
var React2 = __toESM(require("react"));
|
|
108
107
|
var import_select = require("@base-ui/react/select");
|
|
109
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
110
108
|
var import_seeds_react_radio = __toESM(require("@sproutsocial/seeds-react-radio"));
|
|
111
109
|
var import_seeds_react_checkbox = __toESM(require("@sproutsocial/seeds-react-checkbox"));
|
|
112
110
|
var import_seeds_react_icon = require("@sproutsocial/seeds-react-icon");
|
|
113
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
114
|
-
var StyledItem = (0, import_styled_components.default)(import_select.Select.Item)`
|
|
115
|
-
display: flex;
|
|
116
|
-
align-items: center;
|
|
117
|
-
gap: 8px;
|
|
118
|
-
padding: 6px 8px;
|
|
119
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
120
|
-
font-size: 14px;
|
|
121
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
122
|
-
cursor: default;
|
|
123
|
-
outline: none;
|
|
124
111
|
|
|
125
|
-
|
|
126
|
-
|
|
112
|
+
// src/v3/Common/cn.ts
|
|
113
|
+
function cn(...inputs) {
|
|
114
|
+
const classes = [];
|
|
115
|
+
for (const input of inputs) {
|
|
116
|
+
if (!input) continue;
|
|
117
|
+
if (typeof input === "string") {
|
|
118
|
+
classes.push(input);
|
|
119
|
+
} else if (typeof input === "object") {
|
|
120
|
+
for (const [key, value] of Object.entries(input)) {
|
|
121
|
+
if (value) {
|
|
122
|
+
classes.push(key);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
127
126
|
}
|
|
127
|
+
return classes.join(" ");
|
|
128
|
+
}
|
|
128
129
|
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
// src/v3/Common/SelectItem.tsx
|
|
131
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
132
|
+
var StyledItem = React2.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
133
|
+
import_select.Select.Item,
|
|
134
|
+
{
|
|
135
|
+
ref,
|
|
136
|
+
className: cn("seeds-select-item", className),
|
|
137
|
+
...rest
|
|
131
138
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
align-items: center;
|
|
141
|
-
width: 16px;
|
|
142
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
143
|
-
visibility: hidden;
|
|
144
|
-
|
|
145
|
-
&[data-selected] {
|
|
146
|
-
visibility: visible;
|
|
139
|
+
));
|
|
140
|
+
StyledItem.displayName = "StyledItem";
|
|
141
|
+
var StyledItemIndicator = React2.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
142
|
+
import_select.Select.ItemIndicator,
|
|
143
|
+
{
|
|
144
|
+
ref,
|
|
145
|
+
className: cn("seeds-select-item-indicator", className),
|
|
146
|
+
...rest
|
|
147
147
|
}
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
));
|
|
149
|
+
StyledItemIndicator.displayName = "StyledItemIndicator";
|
|
150
|
+
var StyledItemText = import_select.Select.ItemText;
|
|
150
151
|
function CheckIcon() {
|
|
151
152
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_seeds_react_icon.Icon, { name: "check-outline", fixedWidth: true, "aria-hidden": true });
|
|
152
153
|
}
|
|
@@ -217,176 +218,153 @@ function groupItems(data, groupBy) {
|
|
|
217
218
|
}
|
|
218
219
|
|
|
219
220
|
// src/v3/Common/SelectStyles.tsx
|
|
221
|
+
var React3 = __toESM(require("react"));
|
|
220
222
|
var import_select2 = require("@base-ui/react/select");
|
|
221
|
-
var import_styled_components3 = __toESM(require("styled-components"));
|
|
222
|
-
var import_seeds_react_mixins = require("@sproutsocial/seeds-react-mixins");
|
|
223
|
-
|
|
224
|
-
// src/v3/Common/SelectIcons.tsx
|
|
225
|
-
var React3 = require("react");
|
|
226
|
-
var import_styled_components2 = __toESM(require("styled-components"));
|
|
227
|
-
var import_seeds_react_icon2 = require("@sproutsocial/seeds-react-icon");
|
|
228
223
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
229
|
-
var
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
color: ${({ theme }) => theme.colors.icon.error};
|
|
251
|
-
}
|
|
252
|
-
`;
|
|
253
|
-
var Field = import_styled_components3.default.div`
|
|
254
|
-
display: ${({ $fullWidth }) => $fullWidth === false ? "inline-flex" : "flex"};
|
|
255
|
-
flex-direction: column;
|
|
256
|
-
gap: ${({ theme }) => theme.space[200]};
|
|
257
|
-
${({ $fullWidth }) => $fullWidth !== false && "width: 100%;"}
|
|
258
|
-
`;
|
|
259
|
-
var SelectLabel = (0, import_styled_components3.default)(import_select2.Select.Label)`
|
|
260
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
261
|
-
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
262
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
263
|
-
`;
|
|
264
|
-
var SelectTrigger = (0, import_styled_components3.default)(import_select2.Select.Trigger)`
|
|
265
|
-
display: flex;
|
|
266
|
-
align-items: center;
|
|
267
|
-
justify-content: space-between;
|
|
268
|
-
gap: ${({ theme }) => theme.space[300]};
|
|
269
|
-
padding: ${({ theme }) => `${theme.space[300]}`};
|
|
270
|
-
min-width: 160px;
|
|
271
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
272
|
-
border: 1px solid ${({ theme }) => theme.colors.form.border.base};
|
|
273
|
-
background: ${({ theme }) => theme.colors.form.background.base};
|
|
274
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
275
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
276
|
-
cursor: default;
|
|
277
|
-
outline: none;
|
|
278
|
-
transition: border-color ${({ theme }) => theme.duration.fast}
|
|
279
|
-
${({ theme }) => theme.easing.ease_in},
|
|
280
|
-
box-shadow ${({ theme }) => theme.duration.fast}
|
|
281
|
-
${({ theme }) => theme.easing.ease_in};
|
|
282
|
-
|
|
283
|
-
&:focus-visible {
|
|
284
|
-
${import_seeds_react_mixins.focusRing}
|
|
224
|
+
var Field = React3.forwardRef(
|
|
225
|
+
({ $fullWidth, className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
226
|
+
"div",
|
|
227
|
+
{
|
|
228
|
+
ref,
|
|
229
|
+
className: cn(
|
|
230
|
+
"seeds-menu-field",
|
|
231
|
+
{ "seeds-menu-field--inline": $fullWidth === false },
|
|
232
|
+
className
|
|
233
|
+
),
|
|
234
|
+
...rest
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
);
|
|
238
|
+
Field.displayName = "Field";
|
|
239
|
+
var SelectLabel = React3.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
240
|
+
import_select2.Select.Label,
|
|
241
|
+
{
|
|
242
|
+
ref,
|
|
243
|
+
className: cn("seeds-menu-label", className),
|
|
244
|
+
...rest
|
|
285
245
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
246
|
+
));
|
|
247
|
+
SelectLabel.displayName = "SelectLabel";
|
|
248
|
+
var SelectTrigger = React3.forwardRef(({ $isInvalid, className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
249
|
+
import_select2.Select.Trigger,
|
|
250
|
+
{
|
|
251
|
+
ref,
|
|
252
|
+
className: cn(
|
|
253
|
+
"seeds-select-trigger",
|
|
254
|
+
{ "seeds-select-trigger--invalid": !!$isInvalid },
|
|
255
|
+
className
|
|
256
|
+
),
|
|
257
|
+
...rest
|
|
289
258
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
259
|
+
));
|
|
260
|
+
SelectTrigger.displayName = "SelectTrigger";
|
|
261
|
+
var SelectValue = React3.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
262
|
+
import_select2.Select.Value,
|
|
263
|
+
{
|
|
264
|
+
ref,
|
|
265
|
+
className: cn("seeds-select-value", className),
|
|
266
|
+
...rest
|
|
293
267
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
268
|
+
));
|
|
269
|
+
SelectValue.displayName = "SelectValue";
|
|
270
|
+
var SelectIcon = React3.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
271
|
+
import_select2.Select.Icon,
|
|
272
|
+
{
|
|
273
|
+
ref,
|
|
274
|
+
className: cn("seeds-select-icon", className),
|
|
275
|
+
...rest
|
|
298
276
|
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
display: flex;
|
|
308
|
-
align-items: center;
|
|
309
|
-
color: ${({ theme }) => theme.colors.icon.base};
|
|
310
|
-
flex-shrink: 0;
|
|
311
|
-
`;
|
|
312
|
-
var SelectGroup = (0, import_styled_components3.default)(import_select2.Select.Group)`
|
|
313
|
-
display: block;
|
|
314
|
-
`;
|
|
315
|
-
var SelectGroupLabel = (0, import_styled_components3.default)(import_select2.Select.GroupLabel)`
|
|
316
|
-
padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]} ${theme.space[200]}`};
|
|
317
|
-
font-size: ${({ theme }) => theme.typography[100].fontSize};
|
|
318
|
-
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
319
|
-
text-transform: uppercase;
|
|
320
|
-
letter-spacing: 0.05em;
|
|
321
|
-
color: ${({ theme }) => theme.colors.text.subtext};
|
|
322
|
-
`;
|
|
323
|
-
var SelectSeparator = (0, import_styled_components3.default)(import_select2.Select.Separator)`
|
|
324
|
-
height: 1px;
|
|
325
|
-
margin: ${({ theme }) => `${theme.space[200]} ${theme.space[300]}`};
|
|
326
|
-
background: ${({ theme }) => theme.colors.container.border.base};
|
|
327
|
-
`;
|
|
328
|
-
var SelectPositioner = (0, import_styled_components3.default)(import_select2.Select.Positioner)`
|
|
329
|
-
width: var(--anchor-width);
|
|
330
|
-
z-index: 7;
|
|
331
|
-
`;
|
|
332
|
-
var SelectPopup = (0, import_styled_components3.default)(import_select2.Select.Popup)`
|
|
333
|
-
font-family: ${({ theme }) => theme.fontFamily};
|
|
334
|
-
background: ${({ theme }) => theme.colors.container.background.base};
|
|
335
|
-
border: 1px solid ${({ theme }) => theme.colors.container.border.base};
|
|
336
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
337
|
-
box-shadow: ${({ theme }) => theme.shadows.low};
|
|
338
|
-
outline: none;
|
|
339
|
-
max-height: min(var(--available-height, 400px), 400px);
|
|
340
|
-
overflow-y: auto;
|
|
341
|
-
padding: ${({ theme }) => theme.space[200]};
|
|
342
|
-
|
|
343
|
-
&[data-open] {
|
|
344
|
-
animation: select-popup-in 120ms ease-out;
|
|
277
|
+
));
|
|
278
|
+
SelectIcon.displayName = "SelectIcon";
|
|
279
|
+
var SelectGroup = React3.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
280
|
+
import_select2.Select.Group,
|
|
281
|
+
{
|
|
282
|
+
ref,
|
|
283
|
+
className: cn("seeds-select-group", className),
|
|
284
|
+
...rest
|
|
345
285
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
286
|
+
));
|
|
287
|
+
SelectGroup.displayName = "SelectGroup";
|
|
288
|
+
var SelectGroupLabel = React3.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
289
|
+
import_select2.Select.GroupLabel,
|
|
290
|
+
{
|
|
291
|
+
ref,
|
|
292
|
+
className: cn("seeds-select-group-label", className),
|
|
293
|
+
...rest
|
|
349
294
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
transform: scale(1);
|
|
359
|
-
}
|
|
295
|
+
));
|
|
296
|
+
SelectGroupLabel.displayName = "SelectGroupLabel";
|
|
297
|
+
var SelectSeparator = React3.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
298
|
+
import_select2.Select.Separator,
|
|
299
|
+
{
|
|
300
|
+
ref,
|
|
301
|
+
className: cn("seeds-select-separator", className),
|
|
302
|
+
...rest
|
|
360
303
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
304
|
+
));
|
|
305
|
+
SelectSeparator.displayName = "SelectSeparator";
|
|
306
|
+
var SelectPositioner = React3.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
307
|
+
import_select2.Select.Positioner,
|
|
308
|
+
{
|
|
309
|
+
ref,
|
|
310
|
+
className: cn("seeds-select-positioner", className),
|
|
311
|
+
...rest
|
|
312
|
+
}
|
|
313
|
+
));
|
|
314
|
+
SelectPositioner.displayName = "SelectPositioner";
|
|
315
|
+
var SelectPopup = React3.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
316
|
+
import_select2.Select.Popup,
|
|
317
|
+
{
|
|
318
|
+
ref,
|
|
319
|
+
className: cn("seeds-select-popup", className),
|
|
320
|
+
...rest
|
|
371
321
|
}
|
|
372
|
-
|
|
322
|
+
));
|
|
323
|
+
SelectPopup.displayName = "SelectPopup";
|
|
373
324
|
|
|
374
|
-
// src/v3/
|
|
325
|
+
// src/v3/Common/SelectIcons.tsx
|
|
326
|
+
var React4 = __toESM(require("react"));
|
|
327
|
+
var import_seeds_react_icon2 = require("@sproutsocial/seeds-react-icon");
|
|
375
328
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
376
|
-
var
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
329
|
+
var StyledChevron = React4.forwardRef(({ $isOpen, className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
330
|
+
"div",
|
|
331
|
+
{
|
|
332
|
+
ref,
|
|
333
|
+
className: cn(
|
|
334
|
+
"seeds-menu-chevron",
|
|
335
|
+
{ "seeds-menu-chevron--open": !!$isOpen },
|
|
336
|
+
className
|
|
337
|
+
),
|
|
338
|
+
...rest
|
|
339
|
+
}
|
|
340
|
+
));
|
|
341
|
+
StyledChevron.displayName = "StyledChevron";
|
|
342
|
+
function ChevronIcon() {
|
|
343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_seeds_react_icon2.Icon, { name: "chevron-down-outline", fixedWidth: true, "aria-hidden": true });
|
|
344
|
+
}
|
|
345
|
+
function ClearIcon() {
|
|
346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_seeds_react_icon2.Icon, { name: "circle-x-outline", fixedWidth: true, "aria-hidden": true, size: "mini" });
|
|
347
|
+
}
|
|
348
|
+
function CheckIcon2() {
|
|
349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_seeds_react_icon2.Icon, { name: "check-outline", fixedWidth: true, "aria-hidden": true });
|
|
350
|
+
}
|
|
382
351
|
|
|
383
|
-
|
|
384
|
-
|
|
352
|
+
// src/v3/SingleSelect.tsx
|
|
353
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
354
|
+
var StyledValue = React5.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
355
|
+
import_select3.Select.Value,
|
|
356
|
+
{
|
|
357
|
+
ref,
|
|
358
|
+
className: cn("seeds-select-value-text", className),
|
|
359
|
+
...rest
|
|
385
360
|
}
|
|
386
|
-
|
|
361
|
+
));
|
|
362
|
+
StyledValue.displayName = "StyledValue";
|
|
387
363
|
function SingleSelect(props) {
|
|
388
364
|
const { id, placeholder, includePlaceholderItem, fullWidth = true } = props;
|
|
389
365
|
const ariaDescribedBy = props["aria-describedby"];
|
|
366
|
+
const ariaLabel = props["aria-label"];
|
|
367
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
390
368
|
const isInvalid = props.isInvalid;
|
|
391
369
|
const isChildrenMode = "children" in props && props.children != null;
|
|
392
370
|
const selectedItemId = props.selectedItemId;
|
|
@@ -401,7 +379,7 @@ function SingleSelect(props) {
|
|
|
401
379
|
const renderGroupHeading = isChildrenMode ? void 0 : props.renderGroupHeading;
|
|
402
380
|
const children = isChildrenMode ? props.children : void 0;
|
|
403
381
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
404
|
-
const items =
|
|
382
|
+
const items = React5.useMemo(() => {
|
|
405
383
|
const dataItems = data.map((item) => ({
|
|
406
384
|
value: String(item.id),
|
|
407
385
|
label: itemToString(item)
|
|
@@ -413,11 +391,11 @@ function SingleSelect(props) {
|
|
|
413
391
|
}, [data, itemToString, includePlaceholderItem, placeholder]);
|
|
414
392
|
const dataWithPlaceholder = includePlaceholderItem ? [{ id: null, value: null, label: placeholder ?? "" }, ...data] : data;
|
|
415
393
|
const isControlled = selectedItemId !== void 0;
|
|
416
|
-
const [internalValue, setInternalValue] =
|
|
394
|
+
const [internalValue, setInternalValue] = React5.useState(
|
|
417
395
|
defaultSelectedItemId != null ? String(defaultSelectedItemId) : null
|
|
418
396
|
);
|
|
419
397
|
const value = isControlled ? selectedItemId != null ? String(selectedItemId) : null : internalValue;
|
|
420
|
-
const selectedItem =
|
|
398
|
+
const selectedItem = React5.useMemo(
|
|
421
399
|
() => value != null ? data.find((d) => String(d.id) === value) ?? null : null,
|
|
422
400
|
[data, value]
|
|
423
401
|
);
|
|
@@ -434,9 +412,9 @@ function SingleSelect(props) {
|
|
|
434
412
|
}
|
|
435
413
|
}
|
|
436
414
|
}
|
|
437
|
-
return /* @__PURE__ */ (0,
|
|
438
|
-
/* @__PURE__ */ (0,
|
|
439
|
-
/* @__PURE__ */ (0,
|
|
415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
416
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
417
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
440
418
|
import_select3.Select.Root,
|
|
441
419
|
{
|
|
442
420
|
items,
|
|
@@ -445,7 +423,7 @@ function SingleSelect(props) {
|
|
|
445
423
|
onValueChange: handleValueChange,
|
|
446
424
|
id,
|
|
447
425
|
children: [
|
|
448
|
-
/* @__PURE__ */ (0,
|
|
426
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
449
427
|
SelectTrigger,
|
|
450
428
|
{
|
|
451
429
|
"aria-describedby": ariaDescribedBy,
|
|
@@ -453,51 +431,58 @@ function SingleSelect(props) {
|
|
|
453
431
|
"aria-required": props.required || void 0,
|
|
454
432
|
$isInvalid: isInvalid,
|
|
455
433
|
children: [
|
|
456
|
-
/* @__PURE__ */ (0,
|
|
457
|
-
/* @__PURE__ */ (0,
|
|
434
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StyledValue, { placeholder, children: renderSelection && selectedItem ? renderSelection(selectedItem) : void 0 }),
|
|
435
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SelectIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StyledChevron, { "data-chevron": true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ChevronIcon, {}) }) })
|
|
458
436
|
]
|
|
459
437
|
}
|
|
460
438
|
),
|
|
461
|
-
/* @__PURE__ */ (0,
|
|
462
|
-
/* @__PURE__ */ (0,
|
|
463
|
-
/* @__PURE__ */ (0,
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
439
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_select3.Select.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SelectPositioner, { sideOffset: 8, alignItemWithTrigger: false, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(SelectPopup, { children: [
|
|
440
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_select3.Select.ScrollUpArrow, {}),
|
|
441
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
442
|
+
import_select3.Select.List,
|
|
443
|
+
{
|
|
444
|
+
"aria-label": ariaLabel,
|
|
445
|
+
"aria-labelledby": ariaLabelledBy,
|
|
446
|
+
children: children ? children : groupBy ? groupItems(data, groupBy).map((group, index, arr) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(React5.Fragment, { children: [
|
|
447
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(SelectGroup, { children: [
|
|
448
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SelectGroupLabel, { children: renderGroupHeading ? renderGroupHeading(group.value) : group.value }),
|
|
449
|
+
group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
450
|
+
SelectItem,
|
|
451
|
+
{
|
|
452
|
+
value: String(item.id),
|
|
453
|
+
label: itemToString(item),
|
|
454
|
+
disabled: item.disabled,
|
|
455
|
+
inputType,
|
|
456
|
+
renderItem: renderItem ? () => renderItem(item) : () => itemToString(item)
|
|
457
|
+
},
|
|
458
|
+
item.id
|
|
459
|
+
))
|
|
460
|
+
] }),
|
|
461
|
+
index < arr.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SelectSeparator, {})
|
|
462
|
+
] }, group.value)) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
463
|
+
includePlaceholderItem && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
464
|
+
SelectItem,
|
|
465
|
+
{
|
|
466
|
+
value: null,
|
|
467
|
+
label: placeholder ?? ""
|
|
468
|
+
},
|
|
469
|
+
"placeholder"
|
|
470
|
+
),
|
|
471
|
+
data.map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
472
|
+
SelectItem,
|
|
473
|
+
{
|
|
474
|
+
value: String(item.id),
|
|
475
|
+
label: itemToString(item),
|
|
476
|
+
disabled: item.disabled,
|
|
477
|
+
inputType,
|
|
478
|
+
renderItem: renderItem ? () => renderItem(item) : () => itemToString(item)
|
|
479
|
+
},
|
|
480
|
+
item.id
|
|
481
|
+
))
|
|
482
|
+
] })
|
|
483
|
+
}
|
|
484
|
+
),
|
|
485
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_select3.Select.ScrollDownArrow, {})
|
|
501
486
|
] }) }) })
|
|
502
487
|
]
|
|
503
488
|
}
|
|
@@ -506,27 +491,19 @@ function SingleSelect(props) {
|
|
|
506
491
|
}
|
|
507
492
|
|
|
508
493
|
// src/v3/MultiSelect.tsx
|
|
509
|
-
var
|
|
494
|
+
var React6 = __toESM(require("react"));
|
|
510
495
|
var import_select4 = require("@base-ui/react/select");
|
|
511
|
-
var
|
|
512
|
-
var
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
white-space: nowrap;
|
|
518
|
-
`;
|
|
519
|
-
var Placeholder = import_styled_components5.default.div`
|
|
520
|
-
color: ${({ theme }) => theme.colors.text.subtext};
|
|
521
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
522
|
-
line-height: 16px;
|
|
523
|
-
padding-top: 2px;
|
|
524
|
-
padding-bottom: 2px;
|
|
525
|
-
margin: 2px 8px 0px 0px;
|
|
526
|
-
`;
|
|
496
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
497
|
+
var SelectionText = ({
|
|
498
|
+
className,
|
|
499
|
+
...rest
|
|
500
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: cn("seeds-select-selection-text", className), ...rest });
|
|
501
|
+
var Placeholder = ({ className, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: cn("seeds-select-placeholder", className), ...rest });
|
|
527
502
|
function MultiSelect(props) {
|
|
528
503
|
const { id, placeholder = "Select...", fullWidth = true } = props;
|
|
529
504
|
const ariaDescribedBy = props["aria-describedby"];
|
|
505
|
+
const ariaLabel = props["aria-label"];
|
|
506
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
530
507
|
const isInvalid = props.isInvalid;
|
|
531
508
|
const isChildrenMode = "children" in props && props.children != null;
|
|
532
509
|
const data = isChildrenMode ? [] : props.data;
|
|
@@ -545,18 +522,18 @@ function MultiSelect(props) {
|
|
|
545
522
|
const children = isChildrenMode ? props.children : void 0;
|
|
546
523
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
547
524
|
const isControlled = selectedItemIds !== void 0;
|
|
548
|
-
const [internalValue, setInternalValue] =
|
|
525
|
+
const [internalValue, setInternalValue] = React6.useState(
|
|
549
526
|
() => defaultSelectedItemIds?.map(String) ?? []
|
|
550
527
|
);
|
|
551
528
|
const value = isControlled ? selectedItemIds.map(String) : internalValue;
|
|
552
|
-
const items =
|
|
529
|
+
const items = React6.useMemo(
|
|
553
530
|
() => data.map((item) => ({
|
|
554
531
|
value: String(item.id),
|
|
555
532
|
label: itemToString(item)
|
|
556
533
|
})),
|
|
557
534
|
[data, itemToString]
|
|
558
535
|
);
|
|
559
|
-
const selectedItems =
|
|
536
|
+
const selectedItems = React6.useMemo(
|
|
560
537
|
() => value.map((v) => data.find((d) => String(d.id) === v)).filter((d) => d != null),
|
|
561
538
|
[data, value]
|
|
562
539
|
);
|
|
@@ -572,9 +549,9 @@ function MultiSelect(props) {
|
|
|
572
549
|
onSelectedItemIdsChange(ids);
|
|
573
550
|
}
|
|
574
551
|
}
|
|
575
|
-
return /* @__PURE__ */ (0,
|
|
576
|
-
/* @__PURE__ */ (0,
|
|
577
|
-
/* @__PURE__ */ (0,
|
|
552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
553
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
554
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
578
555
|
import_select4.Select.Root,
|
|
579
556
|
{
|
|
580
557
|
multiple: true,
|
|
@@ -584,7 +561,7 @@ function MultiSelect(props) {
|
|
|
584
561
|
disabled: props.disabled,
|
|
585
562
|
id,
|
|
586
563
|
children: [
|
|
587
|
-
/* @__PURE__ */ (0,
|
|
564
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
588
565
|
SelectTrigger,
|
|
589
566
|
{
|
|
590
567
|
"aria-describedby": ariaDescribedBy,
|
|
@@ -592,30 +569,49 @@ function MultiSelect(props) {
|
|
|
592
569
|
"aria-required": props.required || void 0,
|
|
593
570
|
$isInvalid: isInvalid,
|
|
594
571
|
children: [
|
|
595
|
-
/* @__PURE__ */ (0,
|
|
572
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectValue, { children: () => {
|
|
596
573
|
if (renderSelection) return renderSelection(selectedItems);
|
|
597
574
|
if (selectedItems.length === 0)
|
|
598
|
-
return /* @__PURE__ */ (0,
|
|
575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Placeholder, { children: placeholder });
|
|
599
576
|
const visibleItems = maxSelections != null ? selectedItems.slice(0, maxSelections) : selectedItems;
|
|
600
577
|
const overflowCount = maxSelections != null && selectedItems.length > maxSelections ? selectedItems.length - maxSelections : 0;
|
|
601
578
|
const text = visibleItems.map(
|
|
602
579
|
(item) => customRenderSelections ? customRenderSelections(item) : itemToString(item)
|
|
603
580
|
).join(", ");
|
|
604
|
-
return /* @__PURE__ */ (0,
|
|
581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(SelectionText, { children: [
|
|
605
582
|
text,
|
|
606
583
|
overflowCount > 0 ? `, +${overflowCount}` : ""
|
|
607
584
|
] });
|
|
608
585
|
} }),
|
|
609
|
-
/* @__PURE__ */ (0,
|
|
586
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StyledChevron, { "data-chevron": true, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChevronIcon, {}) }) })
|
|
610
587
|
]
|
|
611
588
|
}
|
|
612
589
|
),
|
|
613
|
-
/* @__PURE__ */ (0,
|
|
614
|
-
/* @__PURE__ */ (0,
|
|
615
|
-
/* @__PURE__ */ (0,
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
590
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_select4.Select.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectPositioner, { sideOffset: 8, alignItemWithTrigger: false, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(SelectPopup, { children: [
|
|
591
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_select4.Select.ScrollUpArrow, {}),
|
|
592
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
593
|
+
import_select4.Select.List,
|
|
594
|
+
{
|
|
595
|
+
"aria-label": ariaLabel,
|
|
596
|
+
"aria-labelledby": ariaLabelledBy,
|
|
597
|
+
children: children ? children : groupBy ? groupItems(data, groupBy).map((group, index, arr) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(React6.Fragment, { children: [
|
|
598
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(SelectGroup, { children: [
|
|
599
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectGroupLabel, { children: renderGroupHeading ? renderGroupHeading(group.value) : group.value }),
|
|
600
|
+
group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
601
|
+
SelectItem,
|
|
602
|
+
{
|
|
603
|
+
value: String(item.id),
|
|
604
|
+
label: itemToString(item),
|
|
605
|
+
disabled: item.disabled,
|
|
606
|
+
inputType,
|
|
607
|
+
hidden: removeSelectedItems && value.includes(String(item.id)),
|
|
608
|
+
renderItem: renderItem ? () => renderItem(item) : void 0
|
|
609
|
+
},
|
|
610
|
+
item.id
|
|
611
|
+
))
|
|
612
|
+
] }),
|
|
613
|
+
index < arr.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectSeparator, {})
|
|
614
|
+
] }, group.value)) : data.map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
619
615
|
SelectItem,
|
|
620
616
|
{
|
|
621
617
|
value: String(item.id),
|
|
@@ -623,25 +619,13 @@ function MultiSelect(props) {
|
|
|
623
619
|
disabled: item.disabled,
|
|
624
620
|
inputType,
|
|
625
621
|
hidden: removeSelectedItems && value.includes(String(item.id)),
|
|
626
|
-
renderItem: renderItem ? () => renderItem(item) :
|
|
622
|
+
renderItem: renderItem ? () => renderItem(item) : () => itemToString(item)
|
|
627
623
|
},
|
|
628
624
|
item.id
|
|
629
625
|
))
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
SelectItem,
|
|
634
|
-
{
|
|
635
|
-
value: String(item.id),
|
|
636
|
-
label: itemToString(item),
|
|
637
|
-
disabled: item.disabled,
|
|
638
|
-
inputType,
|
|
639
|
-
hidden: removeSelectedItems && value.includes(String(item.id)),
|
|
640
|
-
renderItem: renderItem ? () => renderItem(item) : () => itemToString(item)
|
|
641
|
-
},
|
|
642
|
-
item.id
|
|
643
|
-
)) }),
|
|
644
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_select4.Select.ScrollDownArrow, {})
|
|
626
|
+
}
|
|
627
|
+
),
|
|
628
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_select4.Select.ScrollDownArrow, {})
|
|
645
629
|
] }) }) })
|
|
646
630
|
]
|
|
647
631
|
}
|
|
@@ -650,14 +634,14 @@ function MultiSelect(props) {
|
|
|
650
634
|
}
|
|
651
635
|
|
|
652
636
|
// src/v3/SingleCombobox.tsx
|
|
653
|
-
var
|
|
637
|
+
var React11 = __toESM(require("react"));
|
|
654
638
|
var import_combobox3 = require("@base-ui/react/combobox");
|
|
655
639
|
var import_react_virtual2 = require("@tanstack/react-virtual");
|
|
656
640
|
|
|
657
641
|
// src/v3/Common/useSuppressEscapeClear.ts
|
|
658
|
-
var
|
|
642
|
+
var React7 = __toESM(require("react"));
|
|
659
643
|
function useSuppressEscapeClear(open) {
|
|
660
|
-
return
|
|
644
|
+
return React7.useCallback(
|
|
661
645
|
(event) => {
|
|
662
646
|
if (event.key === "Escape" && !open) {
|
|
663
647
|
event.stopPropagation();
|
|
@@ -668,309 +652,189 @@ function useSuppressEscapeClear(open) {
|
|
|
668
652
|
}
|
|
669
653
|
|
|
670
654
|
// src/v3/Common/ComboboxItem.tsx
|
|
671
|
-
var
|
|
655
|
+
var React9 = __toESM(require("react"));
|
|
672
656
|
var import_seeds_react_radio2 = __toESM(require("@sproutsocial/seeds-react-radio"));
|
|
673
657
|
var import_seeds_react_checkbox3 = __toESM(require("@sproutsocial/seeds-react-checkbox"));
|
|
674
658
|
|
|
675
659
|
// src/v3/Common/ComboboxStyles.tsx
|
|
660
|
+
var React8 = __toESM(require("react"));
|
|
676
661
|
var import_combobox = require("@base-ui/react/combobox");
|
|
677
|
-
var import_styled_components6 = __toESM(require("styled-components"));
|
|
678
|
-
var import_seeds_react_mixins2 = require("@sproutsocial/seeds-react-mixins");
|
|
679
662
|
var import_seeds_react_checkbox2 = __toESM(require("@sproutsocial/seeds-react-checkbox"));
|
|
680
|
-
var
|
|
681
|
-
var
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
var ComboboxInputGroup = (0, import_styled_components6.default)(import_combobox.Combobox.InputGroup)`
|
|
694
|
-
display: flex;
|
|
695
|
-
align-items: center;
|
|
696
|
-
min-width: 160px;
|
|
697
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
698
|
-
border: 1px solid ${({ theme }) => theme.colors.form.border.base};
|
|
699
|
-
background: ${({ theme }) => theme.colors.form.background.base};
|
|
700
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
701
|
-
transition: border-color ${({ theme }) => theme.duration.fast}
|
|
702
|
-
${({ theme }) => theme.easing.ease_in},
|
|
703
|
-
box-shadow ${({ theme }) => theme.duration.fast}
|
|
704
|
-
${({ theme }) => theme.easing.ease_in};
|
|
705
|
-
|
|
706
|
-
&:focus-within {
|
|
707
|
-
${import_seeds_react_mixins2.focusRing}
|
|
663
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
664
|
+
var ComboboxLabel = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { ref, className: cn("seeds-menu-label", className), ...rest }));
|
|
665
|
+
ComboboxLabel.displayName = "ComboboxLabel";
|
|
666
|
+
var ComboboxInputGroup = React8.forwardRef(({ $isInvalid, className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
667
|
+
import_combobox.Combobox.InputGroup,
|
|
668
|
+
{
|
|
669
|
+
ref,
|
|
670
|
+
className: cn(
|
|
671
|
+
"seeds-combobox-input-group",
|
|
672
|
+
{ "seeds-combobox-input-group--invalid": !!$isInvalid },
|
|
673
|
+
className
|
|
674
|
+
),
|
|
675
|
+
...rest
|
|
708
676
|
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
677
|
+
));
|
|
678
|
+
ComboboxInputGroup.displayName = "ComboboxInputGroup";
|
|
679
|
+
var ComboboxInput = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
680
|
+
import_combobox.Combobox.Input,
|
|
681
|
+
{
|
|
682
|
+
ref,
|
|
683
|
+
className: cn("seeds-combobox-input", className),
|
|
684
|
+
...rest
|
|
713
685
|
}
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
background: transparent;
|
|
723
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
724
|
-
line-height: ${({ theme }) => theme.typography[200].lineHeight};
|
|
725
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
726
|
-
outline: none;
|
|
727
|
-
|
|
728
|
-
&::placeholder {
|
|
729
|
-
color: ${({ theme }) => theme.colors.text.subtext};
|
|
686
|
+
));
|
|
687
|
+
ComboboxInput.displayName = "ComboboxInput";
|
|
688
|
+
var ComboboxTokenInput = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
689
|
+
import_combobox.Combobox.Input,
|
|
690
|
+
{
|
|
691
|
+
ref,
|
|
692
|
+
className: cn("seeds-combobox-token-input", className),
|
|
693
|
+
...rest
|
|
730
694
|
}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
padding: ${({ theme }) => theme.space[200]} ${({ theme }) => theme.space[300]}
|
|
740
|
-
${({ theme }) => theme.space[200]} ${({ theme }) => theme.space[350]};
|
|
741
|
-
border: none !important;
|
|
742
|
-
background: transparent;
|
|
743
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
744
|
-
line-height: ${({ theme }) => theme.typography[200].lineHeight};
|
|
745
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
746
|
-
outline: none;
|
|
747
|
-
|
|
748
|
-
&::placeholder {
|
|
749
|
-
color: ${({ theme }) => theme.colors.text.subtext};
|
|
695
|
+
));
|
|
696
|
+
ComboboxTokenInput.displayName = "ComboboxTokenInput";
|
|
697
|
+
var ComboboxActionButtons = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
698
|
+
"div",
|
|
699
|
+
{
|
|
700
|
+
ref,
|
|
701
|
+
className: cn("seeds-combobox-action-buttons", className),
|
|
702
|
+
...rest
|
|
750
703
|
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
margin-left: auto;
|
|
761
|
-
gap: ${({ theme }) => theme.space[100]};
|
|
762
|
-
`;
|
|
763
|
-
var ComboboxClear = (0, import_styled_components6.default)(import_combobox.Combobox.Clear).attrs({ tabIndex: 0 })`
|
|
764
|
-
display: flex;
|
|
765
|
-
align-items: center;
|
|
766
|
-
justify-content: center;
|
|
767
|
-
width: 20px;
|
|
768
|
-
height: 20px;
|
|
769
|
-
border: none;
|
|
770
|
-
background: transparent;
|
|
771
|
-
color: ${({ theme }) => theme.colors.icon.base};
|
|
772
|
-
cursor: pointer;
|
|
773
|
-
border-radius: ${({ theme }) => theme.radii[300]};
|
|
774
|
-
padding: 0;
|
|
775
|
-
|
|
776
|
-
&:hover {
|
|
777
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
704
|
+
));
|
|
705
|
+
ComboboxActionButtons.displayName = "ComboboxActionButtons";
|
|
706
|
+
var ComboboxClear = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
707
|
+
import_combobox.Combobox.Clear,
|
|
708
|
+
{
|
|
709
|
+
ref,
|
|
710
|
+
tabIndex: 0,
|
|
711
|
+
className: cn("seeds-combobox-clear", className),
|
|
712
|
+
...rest
|
|
778
713
|
}
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
714
|
+
));
|
|
715
|
+
ComboboxClear.displayName = "ComboboxClear";
|
|
716
|
+
var ComboboxTrigger = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
717
|
+
import_combobox.Combobox.Trigger,
|
|
718
|
+
{
|
|
719
|
+
ref,
|
|
720
|
+
className: cn("seeds-combobox-trigger", className),
|
|
721
|
+
...rest
|
|
782
722
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
justify-content: center;
|
|
792
|
-
width: 20px;
|
|
793
|
-
height: 20px;
|
|
794
|
-
border: none;
|
|
795
|
-
background: transparent;
|
|
796
|
-
color: ${({ theme }) => theme.colors.icon.base};
|
|
797
|
-
cursor: default;
|
|
798
|
-
padding: 0;
|
|
799
|
-
|
|
800
|
-
&:hover {
|
|
801
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
802
|
-
}
|
|
803
|
-
`;
|
|
804
|
-
var ComboboxPositioner = (0, import_styled_components6.default)(import_combobox.Combobox.Positioner)`
|
|
805
|
-
width: var(--anchor-width);
|
|
806
|
-
z-index: 7;
|
|
807
|
-
`;
|
|
808
|
-
var ComboboxPopup = (0, import_styled_components6.default)(import_combobox.Combobox.Popup)`
|
|
809
|
-
font-family: ${({ theme }) => theme.fontFamily};
|
|
810
|
-
background: ${({ theme }) => theme.colors.container.background.base};
|
|
811
|
-
border: 1px solid ${({ theme }) => theme.colors.container.border.base};
|
|
812
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
813
|
-
box-shadow: ${({ theme }) => theme.shadows.medium};
|
|
814
|
-
outline: none;
|
|
815
|
-
width: 100%;
|
|
816
|
-
max-height: min(var(--available-height, 400px), 400px);
|
|
817
|
-
overflow-y: auto;
|
|
818
|
-
padding: 0;
|
|
819
|
-
|
|
820
|
-
&[data-open] {
|
|
821
|
-
animation: combobox-popup-in 120ms ease-out;
|
|
723
|
+
));
|
|
724
|
+
ComboboxTrigger.displayName = "ComboboxTrigger";
|
|
725
|
+
var ComboboxPositioner = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
726
|
+
import_combobox.Combobox.Positioner,
|
|
727
|
+
{
|
|
728
|
+
ref,
|
|
729
|
+
className: cn("seeds-combobox-positioner", className),
|
|
730
|
+
...rest
|
|
822
731
|
}
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
732
|
+
));
|
|
733
|
+
ComboboxPositioner.displayName = "ComboboxPositioner";
|
|
734
|
+
var ComboboxPopup = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
735
|
+
import_combobox.Combobox.Popup,
|
|
736
|
+
{
|
|
737
|
+
ref,
|
|
738
|
+
className: cn("seeds-combobox-popup", className),
|
|
739
|
+
...rest
|
|
826
740
|
}
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
transform: scale(1);
|
|
836
|
-
}
|
|
741
|
+
));
|
|
742
|
+
ComboboxPopup.displayName = "ComboboxPopup";
|
|
743
|
+
var ComboboxList = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
744
|
+
import_combobox.Combobox.List,
|
|
745
|
+
{
|
|
746
|
+
ref,
|
|
747
|
+
className: cn("seeds-combobox-list", className),
|
|
748
|
+
...rest
|
|
837
749
|
}
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
transform: scale(0.95);
|
|
847
|
-
}
|
|
750
|
+
));
|
|
751
|
+
ComboboxList.displayName = "ComboboxList";
|
|
752
|
+
var ComboboxStatus = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
753
|
+
import_combobox.Combobox.Status,
|
|
754
|
+
{
|
|
755
|
+
ref,
|
|
756
|
+
className: cn("seeds-combobox-status", className),
|
|
757
|
+
...rest
|
|
848
758
|
}
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
var ComboboxStatus = (0, import_styled_components6.default)(import_combobox.Combobox.Status)`
|
|
858
|
-
padding: ${({ theme }) => `${theme.space[300]} ${theme.space[350]}`};
|
|
859
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
860
|
-
color: ${({ theme }) => theme.colors.text.subtext};
|
|
861
|
-
|
|
862
|
-
&:empty {
|
|
863
|
-
padding: 0;
|
|
864
|
-
}
|
|
865
|
-
`;
|
|
866
|
-
var ComboboxEmpty = (0, import_styled_components6.default)(import_combobox.Combobox.Empty)`
|
|
867
|
-
padding: ${({ theme }) => `${theme.space[300]} ${theme.space[350]}`};
|
|
868
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
869
|
-
color: ${({ theme }) => theme.colors.text.subtext};
|
|
870
|
-
|
|
871
|
-
&:empty {
|
|
872
|
-
padding: 0;
|
|
873
|
-
}
|
|
874
|
-
`;
|
|
875
|
-
var ComboboxItem = (0, import_styled_components6.default)(import_combobox.Combobox.Item)`
|
|
876
|
-
display: flex;
|
|
877
|
-
align-items: center;
|
|
878
|
-
gap: ${({ theme }) => theme.space[300]};
|
|
879
|
-
padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]}`};
|
|
880
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
881
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
882
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
883
|
-
cursor: default;
|
|
884
|
-
outline: none;
|
|
885
|
-
|
|
886
|
-
&[data-highlighted] {
|
|
887
|
-
background: ${({ theme }) => theme.colors.listItem.background.hover};
|
|
759
|
+
));
|
|
760
|
+
ComboboxStatus.displayName = "ComboboxStatus";
|
|
761
|
+
var ComboboxEmpty = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
762
|
+
import_combobox.Combobox.Empty,
|
|
763
|
+
{
|
|
764
|
+
ref,
|
|
765
|
+
className: cn("seeds-combobox-empty", className),
|
|
766
|
+
...rest
|
|
888
767
|
}
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
768
|
+
));
|
|
769
|
+
ComboboxEmpty.displayName = "ComboboxEmpty";
|
|
770
|
+
var ComboboxItem = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
771
|
+
import_combobox.Combobox.Item,
|
|
772
|
+
{
|
|
773
|
+
ref,
|
|
774
|
+
className: cn("seeds-combobox-item", className),
|
|
775
|
+
...rest
|
|
892
776
|
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
align-items: center;
|
|
902
|
-
width: ${({ theme }) => theme.space[400]};
|
|
903
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
904
|
-
visibility: hidden;
|
|
905
|
-
|
|
906
|
-
&[data-selected] {
|
|
907
|
-
visibility: visible;
|
|
908
|
-
}
|
|
909
|
-
`;
|
|
910
|
-
var ComboboxGroup = (0, import_styled_components6.default)(import_combobox.Combobox.Group)`
|
|
911
|
-
display: block;
|
|
912
|
-
`;
|
|
913
|
-
var ComboboxGroupLabel = (0, import_styled_components6.default)(import_combobox.Combobox.GroupLabel)`
|
|
914
|
-
padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]} ${theme.space[200]}`};
|
|
915
|
-
font-size: ${({ theme }) => theme.typography[100].fontSize};
|
|
916
|
-
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
917
|
-
text-transform: uppercase;
|
|
918
|
-
letter-spacing: 0.05em;
|
|
919
|
-
color: ${({ theme }) => theme.colors.text.subtext};
|
|
920
|
-
`;
|
|
921
|
-
var ComboboxSeparator = import_styled_components6.default.div`
|
|
922
|
-
height: 1px;
|
|
923
|
-
margin: ${({ theme }) => `${theme.space[200]} ${theme.space[300]}`};
|
|
924
|
-
background: ${({ theme }) => theme.colors.container.border.base};
|
|
925
|
-
`;
|
|
926
|
-
var ComboboxGroupHeaderItem = (0, import_styled_components6.default)(import_combobox.Combobox.Item)`
|
|
927
|
-
display: flex;
|
|
928
|
-
align-items: center;
|
|
929
|
-
gap: ${({ theme }) => theme.space[300]};
|
|
930
|
-
padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]}`};
|
|
931
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
932
|
-
font-size: ${({ theme }) => theme.typography[100].fontSize};
|
|
933
|
-
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
934
|
-
text-transform: uppercase;
|
|
935
|
-
letter-spacing: 0.05em;
|
|
936
|
-
color: ${({ theme }) => theme.colors.text.subtext};
|
|
937
|
-
cursor: default;
|
|
938
|
-
outline: none;
|
|
939
|
-
|
|
940
|
-
&[data-highlighted] {
|
|
941
|
-
background: ${({ theme }) => theme.colors.listItem.background.hover};
|
|
942
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
777
|
+
));
|
|
778
|
+
ComboboxItem.displayName = "ComboboxItem";
|
|
779
|
+
var ComboboxItemIndicator = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
780
|
+
import_combobox.Combobox.ItemIndicator,
|
|
781
|
+
{
|
|
782
|
+
ref,
|
|
783
|
+
className: cn("seeds-combobox-item-indicator", className),
|
|
784
|
+
...rest
|
|
943
785
|
}
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
display: flex;
|
|
953
|
-
align-items: center;
|
|
954
|
-
gap: ${({ theme }) => theme.space[300]};
|
|
955
|
-
padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]}`};
|
|
956
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
957
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
958
|
-
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
959
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
960
|
-
cursor: default;
|
|
961
|
-
outline: none;
|
|
962
|
-
border-bottom: 1px solid ${({ theme }) => theme.colors.container.border.base};
|
|
963
|
-
margin-bottom: ${({ theme }) => theme.space[200]};
|
|
964
|
-
|
|
965
|
-
&[data-highlighted] {
|
|
966
|
-
background: ${({ theme }) => theme.colors.listItem.background.hover};
|
|
786
|
+
));
|
|
787
|
+
ComboboxItemIndicator.displayName = "ComboboxItemIndicator";
|
|
788
|
+
var ComboboxGroup = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
789
|
+
import_combobox.Combobox.Group,
|
|
790
|
+
{
|
|
791
|
+
ref,
|
|
792
|
+
className: cn("seeds-combobox-group", className),
|
|
793
|
+
...rest
|
|
967
794
|
}
|
|
968
|
-
|
|
795
|
+
));
|
|
796
|
+
ComboboxGroup.displayName = "ComboboxGroup";
|
|
797
|
+
var ComboboxGroupLabel = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
798
|
+
import_combobox.Combobox.GroupLabel,
|
|
799
|
+
{
|
|
800
|
+
ref,
|
|
801
|
+
className: cn("seeds-combobox-group-label", className),
|
|
802
|
+
...rest
|
|
803
|
+
}
|
|
804
|
+
));
|
|
805
|
+
ComboboxGroupLabel.displayName = "ComboboxGroupLabel";
|
|
806
|
+
var ComboboxSeparator = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
807
|
+
"div",
|
|
808
|
+
{
|
|
809
|
+
ref,
|
|
810
|
+
className: cn("seeds-combobox-separator", className),
|
|
811
|
+
...rest
|
|
812
|
+
}
|
|
813
|
+
));
|
|
814
|
+
ComboboxSeparator.displayName = "ComboboxSeparator";
|
|
815
|
+
var ComboboxGroupHeaderItem = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
816
|
+
import_combobox.Combobox.Item,
|
|
817
|
+
{
|
|
818
|
+
ref,
|
|
819
|
+
className: cn("seeds-combobox-group-header-item", className),
|
|
820
|
+
...rest
|
|
821
|
+
}
|
|
822
|
+
));
|
|
823
|
+
ComboboxGroupHeaderItem.displayName = "ComboboxGroupHeaderItem";
|
|
824
|
+
var ComboboxSelectAllItem = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
825
|
+
import_combobox.Combobox.Item,
|
|
826
|
+
{
|
|
827
|
+
ref,
|
|
828
|
+
className: cn("seeds-combobox-select-all-item", className),
|
|
829
|
+
...rest
|
|
830
|
+
}
|
|
831
|
+
));
|
|
832
|
+
ComboboxSelectAllItem.displayName = "ComboboxSelectAllItem";
|
|
969
833
|
function ComboboxGroupHeaderCheckbox({
|
|
970
834
|
$state,
|
|
971
835
|
id
|
|
972
836
|
}) {
|
|
973
|
-
return /* @__PURE__ */ (0,
|
|
837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
974
838
|
import_seeds_react_checkbox2.default,
|
|
975
839
|
{
|
|
976
840
|
id,
|
|
@@ -982,196 +846,114 @@ function ComboboxGroupHeaderCheckbox({
|
|
|
982
846
|
}
|
|
983
847
|
);
|
|
984
848
|
}
|
|
985
|
-
var ComboboxToken = (0,
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
var ComboboxTokenInputGroup = (0, import_styled_components6.default)(import_combobox.Combobox.InputGroup)`
|
|
992
|
-
display: flex;
|
|
993
|
-
align-items: center;
|
|
994
|
-
flex-wrap: wrap;
|
|
995
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
996
|
-
border: 1px solid ${({ theme }) => theme.colors.form.border.base};
|
|
997
|
-
background: ${({ theme }) => theme.colors.form.background.base};
|
|
998
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
999
|
-
padding: ${({ theme }) => `${theme.space[200]} ${theme.space[300]} ${theme.space[200]} ${theme.space[200]}`};
|
|
1000
|
-
gap: ${({ theme }) => theme.space[200]};
|
|
1001
|
-
transition: border-color ${({ theme }) => theme.duration.fast}
|
|
1002
|
-
${({ theme }) => theme.easing.ease_in},
|
|
1003
|
-
box-shadow ${({ theme }) => theme.duration.fast}
|
|
1004
|
-
${({ theme }) => theme.easing.ease_in};
|
|
1005
|
-
|
|
1006
|
-
&:focus-within {
|
|
1007
|
-
${import_seeds_react_mixins2.focusRing}
|
|
849
|
+
var ComboboxToken = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
850
|
+
import_combobox.Combobox.Chips,
|
|
851
|
+
{
|
|
852
|
+
ref,
|
|
853
|
+
className: cn("seeds-combobox-tokens", className),
|
|
854
|
+
...rest
|
|
1008
855
|
}
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
856
|
+
));
|
|
857
|
+
ComboboxToken.displayName = "ComboboxToken";
|
|
858
|
+
var ComboboxTokenInputGroup = React8.forwardRef(({ $isInvalid, className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
859
|
+
import_combobox.Combobox.InputGroup,
|
|
860
|
+
{
|
|
861
|
+
ref,
|
|
862
|
+
className: cn(
|
|
863
|
+
"seeds-combobox-token-input-group",
|
|
864
|
+
{ "seeds-combobox-token-input-group--invalid": !!$isInvalid },
|
|
865
|
+
className
|
|
866
|
+
),
|
|
867
|
+
...rest
|
|
1013
868
|
}
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
background: ${({ theme }) => theme.colors.container.background.base};
|
|
1025
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
1026
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
1027
|
-
font-weight: ${({ theme }) => theme.fontWeights.normal};
|
|
1028
|
-
line-height: 1;
|
|
1029
|
-
white-space: nowrap;
|
|
1030
|
-
transition: all ${({ theme }) => theme.duration.fast}
|
|
1031
|
-
${({ theme }) => theme.easing.ease_inout};
|
|
1032
|
-
|
|
1033
|
-
&:hover {
|
|
1034
|
-
box-shadow: ${({ theme }) => theme.shadows.low};
|
|
1035
|
-
border-color: ${({ theme }) => theme.colors.container.border.base};
|
|
1036
|
-
}
|
|
1037
|
-
`;
|
|
1038
|
-
var TokenRemove = import_styled_components6.default.button`
|
|
1039
|
-
display: flex;
|
|
1040
|
-
align-items: center;
|
|
1041
|
-
justify-content: center;
|
|
1042
|
-
border: none;
|
|
1043
|
-
background: transparent;
|
|
1044
|
-
color: inherit;
|
|
1045
|
-
cursor: pointer;
|
|
1046
|
-
padding: 0;
|
|
1047
|
-
line-height: 1;
|
|
1048
|
-
|
|
1049
|
-
&:focus-visible {
|
|
1050
|
-
${import_seeds_react_mixins2.focusRing}
|
|
1051
|
-
}
|
|
1052
|
-
`;
|
|
1053
|
-
var SearchableSelectTrigger = (0, import_styled_components6.default)(import_combobox.Combobox.Trigger)`
|
|
1054
|
-
display: flex;
|
|
1055
|
-
align-items: center;
|
|
1056
|
-
justify-content: space-between;
|
|
1057
|
-
gap: ${({ theme }) => theme.space[300]};
|
|
1058
|
-
padding: ${({ theme }) => theme.space[200]} ${({ theme }) => theme.space[350]};
|
|
1059
|
-
min-width: 160px;
|
|
1060
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
1061
|
-
border: 1px solid ${({ theme }) => theme.colors.form.border.base};
|
|
1062
|
-
background: ${({ theme }) => theme.colors.form.background.base};
|
|
1063
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
1064
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
1065
|
-
cursor: default;
|
|
1066
|
-
outline: none;
|
|
1067
|
-
user-select: none;
|
|
1068
|
-
transition: border-color ${({ theme }) => theme.duration.fast}
|
|
1069
|
-
${({ theme }) => theme.easing.ease_in},
|
|
1070
|
-
box-shadow ${({ theme }) => theme.duration.fast}
|
|
1071
|
-
${({ theme }) => theme.easing.ease_in};
|
|
1072
|
-
|
|
1073
|
-
&:focus-visible {
|
|
1074
|
-
${import_seeds_react_mixins2.focusRing}
|
|
869
|
+
));
|
|
870
|
+
ComboboxTokenInputGroup.displayName = "ComboboxTokenInputGroup";
|
|
871
|
+
var Token = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { ref, className: cn("seeds-combobox-token", className), ...rest }));
|
|
872
|
+
Token.displayName = "Token";
|
|
873
|
+
var TokenRemove = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
874
|
+
"button",
|
|
875
|
+
{
|
|
876
|
+
ref,
|
|
877
|
+
className: cn("seeds-combobox-token-remove", className),
|
|
878
|
+
...rest
|
|
1075
879
|
}
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
880
|
+
));
|
|
881
|
+
TokenRemove.displayName = "TokenRemove";
|
|
882
|
+
var SearchableSelectTrigger = React8.forwardRef(({ $isInvalid, className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
883
|
+
import_combobox.Combobox.Trigger,
|
|
884
|
+
{
|
|
885
|
+
ref,
|
|
886
|
+
className: cn(
|
|
887
|
+
"seeds-searchable-select-trigger",
|
|
888
|
+
{ "seeds-searchable-select-trigger--invalid": !!$isInvalid },
|
|
889
|
+
className
|
|
890
|
+
),
|
|
891
|
+
...rest
|
|
1079
892
|
}
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
893
|
+
));
|
|
894
|
+
SearchableSelectTrigger.displayName = "SearchableSelectTrigger";
|
|
895
|
+
var SearchableSelectTriggerIcon = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
896
|
+
import_combobox.Combobox.Icon,
|
|
897
|
+
{
|
|
898
|
+
ref,
|
|
899
|
+
className: cn("seeds-searchable-select-trigger-icon", className),
|
|
900
|
+
...rest
|
|
1084
901
|
}
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
`;
|
|
1094
|
-
var SearchableSelectPlaceholder = import_styled_components6.default.span`
|
|
1095
|
-
color: ${({ theme }) => theme.colors.text.subtext};
|
|
1096
|
-
padding: ${({ theme }) => theme.space[200]} 0;
|
|
1097
|
-
`;
|
|
1098
|
-
var SearchableSelectPopup = ComboboxPopup;
|
|
1099
|
-
var SearchableSelectSearchContainer = import_styled_components6.default.div`
|
|
1100
|
-
padding: ${({ theme }) => theme.space[300]};
|
|
1101
|
-
border-bottom: 1px solid ${({ theme }) => theme.colors.container.border.base};
|
|
1102
|
-
flex-shrink: 0;
|
|
1103
|
-
`;
|
|
1104
|
-
var SearchableSelectInput = (0, import_styled_components6.default)(import_combobox.Combobox.Input)`
|
|
1105
|
-
width: 100%;
|
|
1106
|
-
height: ${({ theme }) => theme.space[500]};
|
|
1107
|
-
padding: 0 ${({ theme }) => theme.space[300]};
|
|
1108
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
1109
|
-
border: 1px solid ${({ theme }) => theme.colors.container.border.base};
|
|
1110
|
-
background: ${({ theme }) => theme.colors.container.background.base};
|
|
1111
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
1112
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
1113
|
-
outline: none;
|
|
1114
|
-
box-sizing: border-box;
|
|
1115
|
-
|
|
1116
|
-
&:focus {
|
|
1117
|
-
${import_seeds_react_mixins2.focusRing}
|
|
902
|
+
));
|
|
903
|
+
SearchableSelectTriggerIcon.displayName = "SearchableSelectTriggerIcon";
|
|
904
|
+
var SearchableSelectPlaceholder = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
905
|
+
"span",
|
|
906
|
+
{
|
|
907
|
+
ref,
|
|
908
|
+
className: cn("seeds-searchable-select-placeholder", className),
|
|
909
|
+
...rest
|
|
1118
910
|
}
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
min-height: 0;
|
|
1129
|
-
&:empty {
|
|
1130
|
-
padding: 0;
|
|
1131
|
-
}
|
|
1132
|
-
`;
|
|
1133
|
-
var SearchableSelectTokenTrigger = (0, import_styled_components6.default)(import_combobox.Combobox.Trigger)`
|
|
1134
|
-
display: flex;
|
|
1135
|
-
align-items: center;
|
|
1136
|
-
flex-wrap: wrap;
|
|
1137
|
-
min-width: 160px;
|
|
1138
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
1139
|
-
border: 1px solid ${({ theme }) => theme.colors.form.border.base};
|
|
1140
|
-
background: ${({ theme }) => theme.colors.form.background.base};
|
|
1141
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
1142
|
-
padding: ${({ theme }) => theme.space[200]} ${({ theme }) => theme.space[300]};
|
|
1143
|
-
gap: ${({ theme }) => theme.space[200]};
|
|
1144
|
-
cursor: default;
|
|
1145
|
-
text-align: left;
|
|
1146
|
-
outline: none;
|
|
1147
|
-
user-select: none;
|
|
1148
|
-
transition: border-color ${({ theme }) => theme.duration.fast}
|
|
1149
|
-
${({ theme }) => theme.easing.ease_in},
|
|
1150
|
-
box-shadow ${({ theme }) => theme.duration.fast}
|
|
1151
|
-
${({ theme }) => theme.easing.ease_in};
|
|
1152
|
-
|
|
1153
|
-
&:focus-visible {
|
|
1154
|
-
${import_seeds_react_mixins2.focusRing}
|
|
911
|
+
));
|
|
912
|
+
SearchableSelectPlaceholder.displayName = "SearchableSelectPlaceholder";
|
|
913
|
+
var SearchableSelectPopup = ComboboxPopup;
|
|
914
|
+
var SearchableSelectSearchContainer = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
915
|
+
"div",
|
|
916
|
+
{
|
|
917
|
+
ref,
|
|
918
|
+
className: cn("seeds-searchable-select-search-container", className),
|
|
919
|
+
...rest
|
|
1155
920
|
}
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
921
|
+
));
|
|
922
|
+
SearchableSelectSearchContainer.displayName = "SearchableSelectSearchContainer";
|
|
923
|
+
var SearchableSelectInput = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
924
|
+
import_combobox.Combobox.Input,
|
|
925
|
+
{
|
|
926
|
+
ref,
|
|
927
|
+
className: cn("seeds-searchable-select-input", className),
|
|
928
|
+
...rest
|
|
1159
929
|
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
930
|
+
));
|
|
931
|
+
SearchableSelectInput.displayName = "SearchableSelectInput";
|
|
932
|
+
var SearchableSelectList = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
933
|
+
import_combobox.Combobox.List,
|
|
934
|
+
{
|
|
935
|
+
ref,
|
|
936
|
+
className: cn("seeds-searchable-select-list", className),
|
|
937
|
+
...rest
|
|
1163
938
|
}
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
939
|
+
));
|
|
940
|
+
SearchableSelectList.displayName = "SearchableSelectList";
|
|
941
|
+
var SearchableSelectTokenTrigger = React8.forwardRef(({ $isInvalid, className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
942
|
+
import_combobox.Combobox.Trigger,
|
|
943
|
+
{
|
|
944
|
+
ref,
|
|
945
|
+
className: cn(
|
|
946
|
+
"seeds-searchable-select-token-trigger",
|
|
947
|
+
{ "seeds-searchable-select-token-trigger--invalid": !!$isInvalid },
|
|
948
|
+
className
|
|
949
|
+
),
|
|
950
|
+
...rest
|
|
1168
951
|
}
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
`;
|
|
952
|
+
));
|
|
953
|
+
SearchableSelectTokenTrigger.displayName = "SearchableSelectTokenTrigger";
|
|
1172
954
|
|
|
1173
955
|
// src/v3/Common/ComboboxItem.tsx
|
|
1174
|
-
var
|
|
956
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1175
957
|
function ComboboxItemInner({
|
|
1176
958
|
value,
|
|
1177
959
|
itemId,
|
|
@@ -1183,7 +965,7 @@ function ComboboxItemInner({
|
|
|
1183
965
|
"data-index": dataIndex,
|
|
1184
966
|
style
|
|
1185
967
|
}, ref) {
|
|
1186
|
-
return /* @__PURE__ */ (0,
|
|
968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1187
969
|
ComboboxItem,
|
|
1188
970
|
{
|
|
1189
971
|
value,
|
|
@@ -1194,11 +976,11 @@ function ComboboxItemInner({
|
|
|
1194
976
|
disabled,
|
|
1195
977
|
"data-qa-menu-item": label,
|
|
1196
978
|
children: [
|
|
1197
|
-
inputType === "radio" ? /* @__PURE__ */ (0,
|
|
979
|
+
inputType === "radio" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1198
980
|
ComboboxItemIndicator,
|
|
1199
981
|
{
|
|
1200
982
|
keepMounted: true,
|
|
1201
|
-
render: (_props, state) => /* @__PURE__ */ (0,
|
|
983
|
+
render: (_props, state) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1202
984
|
import_seeds_react_radio2.default,
|
|
1203
985
|
{
|
|
1204
986
|
checked: state.selected,
|
|
@@ -1210,11 +992,11 @@ function ComboboxItemInner({
|
|
|
1210
992
|
}
|
|
1211
993
|
)
|
|
1212
994
|
}
|
|
1213
|
-
) : inputType === "checkbox" ? /* @__PURE__ */ (0,
|
|
995
|
+
) : inputType === "checkbox" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1214
996
|
ComboboxItemIndicator,
|
|
1215
997
|
{
|
|
1216
998
|
keepMounted: true,
|
|
1217
|
-
render: (_props, state) => /* @__PURE__ */ (0,
|
|
999
|
+
render: (_props, state) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1218
1000
|
import_seeds_react_checkbox3.default,
|
|
1219
1001
|
{
|
|
1220
1002
|
checked: state.selected,
|
|
@@ -1226,17 +1008,17 @@ function ComboboxItemInner({
|
|
|
1226
1008
|
}
|
|
1227
1009
|
)
|
|
1228
1010
|
}
|
|
1229
|
-
) : inputType === "icon" ? /* @__PURE__ */ (0,
|
|
1230
|
-
/* @__PURE__ */ (0,
|
|
1011
|
+
) : inputType === "icon" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ComboboxItemIndicator, { keepMounted: true, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CheckIcon2, {}) }) : null,
|
|
1012
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: renderItem ? renderItem() : label })
|
|
1231
1013
|
]
|
|
1232
1014
|
}
|
|
1233
1015
|
);
|
|
1234
1016
|
}
|
|
1235
|
-
var ComboboxItem2 =
|
|
1017
|
+
var ComboboxItem2 = React9.forwardRef(ComboboxItemInner);
|
|
1236
1018
|
var ComboboxItem_default = ComboboxItem2;
|
|
1237
1019
|
|
|
1238
1020
|
// src/v3/Common/VirtualizedComboboxList.tsx
|
|
1239
|
-
var
|
|
1021
|
+
var React10 = __toESM(require("react"));
|
|
1240
1022
|
var import_combobox2 = require("@base-ui/react/combobox");
|
|
1241
1023
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
1242
1024
|
|
|
@@ -1255,7 +1037,7 @@ function isCreatableSentinel(v) {
|
|
|
1255
1037
|
}
|
|
1256
1038
|
|
|
1257
1039
|
// src/v3/Common/VirtualizedComboboxList.tsx
|
|
1258
|
-
var
|
|
1040
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1259
1041
|
var ITEM_HEIGHT = 32;
|
|
1260
1042
|
function isGroupHeaderSentinel(v) {
|
|
1261
1043
|
return typeof v === "object" && v !== null && "__groupHeader" in v;
|
|
@@ -1277,7 +1059,7 @@ function VirtualizedComboboxList({
|
|
|
1277
1059
|
renderCreatableItem
|
|
1278
1060
|
}) {
|
|
1279
1061
|
const filteredItems = import_combobox2.Combobox.useFilteredItems();
|
|
1280
|
-
const scrollElementRef =
|
|
1062
|
+
const scrollElementRef = React10.useRef(null);
|
|
1281
1063
|
const virtualizer = (0, import_react_virtual.useVirtualizer)({
|
|
1282
1064
|
enabled: open,
|
|
1283
1065
|
count: filteredItems.length,
|
|
@@ -1289,8 +1071,8 @@ function VirtualizedComboboxList({
|
|
|
1289
1071
|
scrollPaddingStart: 4,
|
|
1290
1072
|
scrollPaddingEnd: 4
|
|
1291
1073
|
});
|
|
1292
|
-
|
|
1293
|
-
const handleScrollRef =
|
|
1074
|
+
React10.useImperativeHandle(virtualizerRef, () => virtualizer);
|
|
1075
|
+
const handleScrollRef = React10.useCallback(
|
|
1294
1076
|
(el) => {
|
|
1295
1077
|
scrollElementRef.current = el;
|
|
1296
1078
|
if (el) requestAnimationFrame(() => virtualizer.measure());
|
|
@@ -1300,7 +1082,7 @@ function VirtualizedComboboxList({
|
|
|
1300
1082
|
if (!filteredItems.length) return null;
|
|
1301
1083
|
const selectedArray = Array.isArray(value) ? value : value != null ? [value] : [];
|
|
1302
1084
|
const totalSize = virtualizer.getTotalSize();
|
|
1303
|
-
return /* @__PURE__ */ (0,
|
|
1085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1304
1086
|
"div",
|
|
1305
1087
|
{
|
|
1306
1088
|
role: "presentation",
|
|
@@ -1311,7 +1093,7 @@ function VirtualizedComboboxList({
|
|
|
1311
1093
|
overflowY: "auto",
|
|
1312
1094
|
overscrollBehavior: "contain"
|
|
1313
1095
|
},
|
|
1314
|
-
children: /* @__PURE__ */ (0,
|
|
1096
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1315
1097
|
"div",
|
|
1316
1098
|
{
|
|
1317
1099
|
role: "presentation",
|
|
@@ -1328,7 +1110,7 @@ function VirtualizedComboboxList({
|
|
|
1328
1110
|
boxSizing: "border-box"
|
|
1329
1111
|
};
|
|
1330
1112
|
if (isPlaceholderSentinel(row)) {
|
|
1331
|
-
return /* @__PURE__ */ (0,
|
|
1113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1332
1114
|
ComboboxItem_default,
|
|
1333
1115
|
{
|
|
1334
1116
|
index: virtualItem.index,
|
|
@@ -1347,7 +1129,7 @@ function VirtualizedComboboxList({
|
|
|
1347
1129
|
const selectedCount = selectedArray.length;
|
|
1348
1130
|
const totalCount = data.length;
|
|
1349
1131
|
const state = selectedCount === 0 ? "none" : selectedCount === totalCount ? "all" : "partial";
|
|
1350
|
-
return /* @__PURE__ */ (0,
|
|
1132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1351
1133
|
ComboboxSelectAllItem,
|
|
1352
1134
|
{
|
|
1353
1135
|
index: virtualItem.index,
|
|
@@ -1356,7 +1138,7 @@ function VirtualizedComboboxList({
|
|
|
1356
1138
|
style: baseStyle,
|
|
1357
1139
|
ref: virtualizer.measureElement,
|
|
1358
1140
|
children: [
|
|
1359
|
-
/* @__PURE__ */ (0,
|
|
1141
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ComboboxGroupHeaderCheckbox, { $state: state, id: "__selectAll" }),
|
|
1360
1142
|
"Select all"
|
|
1361
1143
|
]
|
|
1362
1144
|
},
|
|
@@ -1370,7 +1152,7 @@ function VirtualizedComboboxList({
|
|
|
1370
1152
|
(item2) => selectedArray.some((s) => s.id === item2.id)
|
|
1371
1153
|
).length;
|
|
1372
1154
|
const state = selectedCount === 0 ? "none" : selectedCount === groupItems2.length ? "all" : "partial";
|
|
1373
|
-
return /* @__PURE__ */ (0,
|
|
1155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1374
1156
|
ComboboxGroupHeaderItem,
|
|
1375
1157
|
{
|
|
1376
1158
|
index: virtualItem.index,
|
|
@@ -1380,7 +1162,7 @@ function VirtualizedComboboxList({
|
|
|
1380
1162
|
style: baseStyle,
|
|
1381
1163
|
ref: virtualizer.measureElement,
|
|
1382
1164
|
children: [
|
|
1383
|
-
/* @__PURE__ */ (0,
|
|
1165
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1384
1166
|
ComboboxGroupHeaderCheckbox,
|
|
1385
1167
|
{
|
|
1386
1168
|
$state: state,
|
|
@@ -1405,7 +1187,7 @@ function VirtualizedComboboxList({
|
|
|
1405
1187
|
return null;
|
|
1406
1188
|
}
|
|
1407
1189
|
const item = row;
|
|
1408
|
-
return /* @__PURE__ */ (0,
|
|
1190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1409
1191
|
ComboboxItem_default,
|
|
1410
1192
|
{
|
|
1411
1193
|
index: virtualItem.index,
|
|
@@ -1429,7 +1211,7 @@ function VirtualizedComboboxList({
|
|
|
1429
1211
|
}
|
|
1430
1212
|
|
|
1431
1213
|
// src/v3/SingleCombobox.tsx
|
|
1432
|
-
var
|
|
1214
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1433
1215
|
function SingleCombobox(props) {
|
|
1434
1216
|
const {
|
|
1435
1217
|
id,
|
|
@@ -1439,6 +1221,8 @@ function SingleCombobox(props) {
|
|
|
1439
1221
|
fullWidth = true
|
|
1440
1222
|
} = props;
|
|
1441
1223
|
const ariaDescribedBy = props["aria-describedby"];
|
|
1224
|
+
const ariaLabel = props["aria-label"];
|
|
1225
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
1442
1226
|
const isInvalid = props.isInvalid;
|
|
1443
1227
|
const isChildrenMode = "children" in props && props.children != null;
|
|
1444
1228
|
const data = isChildrenMode ? [] : props.data;
|
|
@@ -1453,18 +1237,18 @@ function SingleCombobox(props) {
|
|
|
1453
1237
|
const defaultSelectedItemId = props.defaultSelectedItemId;
|
|
1454
1238
|
const onSelectedItemIdChange = props.onSelectedItemIdChange;
|
|
1455
1239
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
1456
|
-
const [open, setOpen] =
|
|
1457
|
-
const virtualizerRef =
|
|
1240
|
+
const [open, setOpen] = React11.useState(false);
|
|
1241
|
+
const virtualizerRef = React11.useRef(null);
|
|
1458
1242
|
const onInputKeyDownCapture = useSuppressEscapeClear(open);
|
|
1459
1243
|
const isControlled = selectedItemId !== void 0;
|
|
1460
|
-
const idToItem =
|
|
1244
|
+
const idToItem = React11.useCallback(
|
|
1461
1245
|
(id2) => {
|
|
1462
1246
|
if (id2 == null) return null;
|
|
1463
1247
|
return data.find((d) => String(d.id) === String(id2)) ?? null;
|
|
1464
1248
|
},
|
|
1465
1249
|
[data]
|
|
1466
1250
|
);
|
|
1467
|
-
const [internalValue, setInternalValue] =
|
|
1251
|
+
const [internalValue, setInternalValue] = React11.useState(
|
|
1468
1252
|
() => idToItem(defaultSelectedItemId)
|
|
1469
1253
|
);
|
|
1470
1254
|
const value = isControlled ? idToItem(selectedItemId) : internalValue;
|
|
@@ -1476,13 +1260,13 @@ function SingleCombobox(props) {
|
|
|
1476
1260
|
onSelectedItemIdChange(newItem ? newItem.id : null);
|
|
1477
1261
|
}
|
|
1478
1262
|
}
|
|
1479
|
-
const groups =
|
|
1263
|
+
const groups = React11.useMemo(
|
|
1480
1264
|
() => groupBy ? groupItems(data, groupBy) : null,
|
|
1481
1265
|
[data, groupBy]
|
|
1482
1266
|
);
|
|
1483
|
-
return /* @__PURE__ */ (0,
|
|
1484
|
-
/* @__PURE__ */ (0,
|
|
1485
|
-
/* @__PURE__ */ (0,
|
|
1267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
1268
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
1269
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1486
1270
|
import_combobox3.Combobox.Root,
|
|
1487
1271
|
{
|
|
1488
1272
|
id,
|
|
@@ -1510,13 +1294,13 @@ function SingleCombobox(props) {
|
|
|
1510
1294
|
}
|
|
1511
1295
|
} : void 0,
|
|
1512
1296
|
children: [
|
|
1513
|
-
/* @__PURE__ */ (0,
|
|
1297
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1514
1298
|
ComboboxInputGroup,
|
|
1515
1299
|
{
|
|
1516
1300
|
$isInvalid: isInvalid,
|
|
1517
1301
|
onKeyDownCapture: onInputKeyDownCapture,
|
|
1518
1302
|
children: [
|
|
1519
|
-
/* @__PURE__ */ (0,
|
|
1303
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1520
1304
|
ComboboxInput,
|
|
1521
1305
|
{
|
|
1522
1306
|
placeholder,
|
|
@@ -1526,22 +1310,24 @@ function SingleCombobox(props) {
|
|
|
1526
1310
|
"aria-required": props.required || void 0
|
|
1527
1311
|
}
|
|
1528
1312
|
),
|
|
1529
|
-
/* @__PURE__ */ (0,
|
|
1530
|
-
/* @__PURE__ */ (0,
|
|
1531
|
-
/* @__PURE__ */ (0,
|
|
1313
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(ComboboxActionButtons, { children: [
|
|
1314
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ComboboxClear, { "aria-label": "Clear selection", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ClearIcon, {}) }),
|
|
1315
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ComboboxTrigger, { "aria-label": "Open popup", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(StyledChevron, { $isOpen: open, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChevronIcon, {}) }) })
|
|
1532
1316
|
] })
|
|
1533
1317
|
]
|
|
1534
1318
|
}
|
|
1535
1319
|
),
|
|
1536
|
-
/* @__PURE__ */ (0,
|
|
1320
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_combobox3.Combobox.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ComboboxPositioner, { sideOffset: 4, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1537
1321
|
ComboboxPopup,
|
|
1538
1322
|
{
|
|
1539
1323
|
style: isVirtualized ? { display: "flex", flexDirection: "column" } : void 0,
|
|
1540
1324
|
children: [
|
|
1541
|
-
/* @__PURE__ */ (0,
|
|
1542
|
-
/* @__PURE__ */ (0,
|
|
1325
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ComboboxEmpty, { children: emptyText }),
|
|
1326
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1543
1327
|
ComboboxList,
|
|
1544
1328
|
{
|
|
1329
|
+
"aria-label": ariaLabel,
|
|
1330
|
+
"aria-labelledby": ariaLabelledBy,
|
|
1545
1331
|
style: isVirtualized ? {
|
|
1546
1332
|
padding: 0,
|
|
1547
1333
|
flex: 1,
|
|
@@ -1549,7 +1335,7 @@ function SingleCombobox(props) {
|
|
|
1549
1335
|
display: "flex",
|
|
1550
1336
|
flexDirection: "column"
|
|
1551
1337
|
} : void 0,
|
|
1552
|
-
children: isVirtualized ? /* @__PURE__ */ (0,
|
|
1338
|
+
children: isVirtualized ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1553
1339
|
VirtualizedComboboxList,
|
|
1554
1340
|
{
|
|
1555
1341
|
open,
|
|
@@ -1562,10 +1348,10 @@ function SingleCombobox(props) {
|
|
|
1562
1348
|
renderItem,
|
|
1563
1349
|
renderGroupHeading
|
|
1564
1350
|
}
|
|
1565
|
-
) : children ? children : groups ? ((group, index) => /* @__PURE__ */ (0,
|
|
1566
|
-
/* @__PURE__ */ (0,
|
|
1567
|
-
/* @__PURE__ */ (0,
|
|
1568
|
-
/* @__PURE__ */ (0,
|
|
1351
|
+
) : children ? children : groups ? ((group, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(React11.Fragment, { children: [
|
|
1352
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(ComboboxGroup, { items: group.items, children: [
|
|
1353
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ComboboxGroupLabel, { children: renderGroupHeading ? renderGroupHeading(group.value) : group.value }),
|
|
1354
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_combobox3.Combobox.Collection, { children: (item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1569
1355
|
ComboboxItem_default,
|
|
1570
1356
|
{
|
|
1571
1357
|
value: item,
|
|
@@ -1578,8 +1364,8 @@ function SingleCombobox(props) {
|
|
|
1578
1364
|
item.id
|
|
1579
1365
|
) })
|
|
1580
1366
|
] }),
|
|
1581
|
-
index < groups.length - 1 && /* @__PURE__ */ (0,
|
|
1582
|
-
] }, group.value)) : ((item) => /* @__PURE__ */ (0,
|
|
1367
|
+
index < groups.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ComboboxSeparator, {})
|
|
1368
|
+
] }, group.value)) : ((item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1583
1369
|
ComboboxItem_default,
|
|
1584
1370
|
{
|
|
1585
1371
|
value: item,
|
|
@@ -1603,11 +1389,11 @@ function SingleCombobox(props) {
|
|
|
1603
1389
|
}
|
|
1604
1390
|
|
|
1605
1391
|
// src/v3/MultiCombobox.tsx
|
|
1606
|
-
var
|
|
1392
|
+
var React12 = __toESM(require("react"));
|
|
1607
1393
|
var import_combobox4 = require("@base-ui/react/combobox");
|
|
1608
1394
|
var import_react_virtual3 = require("@tanstack/react-virtual");
|
|
1609
1395
|
var import_seeds_react_icon3 = __toESM(require("@sproutsocial/seeds-react-icon"));
|
|
1610
|
-
var
|
|
1396
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1611
1397
|
function makeGroupHeaderSentinel(groupName) {
|
|
1612
1398
|
return { __groupHeader: true, groupName };
|
|
1613
1399
|
}
|
|
@@ -1631,6 +1417,8 @@ function MultiCombobox(props) {
|
|
|
1631
1417
|
fullWidth = true
|
|
1632
1418
|
} = props;
|
|
1633
1419
|
const ariaDescribedBy = props["aria-describedby"];
|
|
1420
|
+
const ariaLabel = props["aria-label"];
|
|
1421
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
1634
1422
|
const isInvalid = props.isInvalid;
|
|
1635
1423
|
const isChildrenMode = "children" in props && props.children != null;
|
|
1636
1424
|
const data = isChildrenMode ? [] : props.data;
|
|
@@ -1656,31 +1444,31 @@ function MultiCombobox(props) {
|
|
|
1656
1444
|
const defaultSelectedItemIds = props.defaultSelectedItemIds;
|
|
1657
1445
|
const onSelectedItemIdsChange = props.onSelectedItemIdsChange;
|
|
1658
1446
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
1659
|
-
const [open, setOpen] =
|
|
1660
|
-
const [internalInputValue, setInternalInputValue] =
|
|
1661
|
-
const skipNextInputChangeRef =
|
|
1662
|
-
const virtualizerRef =
|
|
1663
|
-
const inputRef =
|
|
1447
|
+
const [open, setOpen] = React12.useState(false);
|
|
1448
|
+
const [internalInputValue, setInternalInputValue] = React12.useState("");
|
|
1449
|
+
const skipNextInputChangeRef = React12.useRef(false);
|
|
1450
|
+
const virtualizerRef = React12.useRef(null);
|
|
1451
|
+
const inputRef = React12.useRef(null);
|
|
1664
1452
|
const onInputKeyDownCapture = useSuppressEscapeClear(open);
|
|
1665
1453
|
const isControlled = selectedItemIds !== void 0;
|
|
1666
|
-
const idsToItems =
|
|
1454
|
+
const idsToItems = React12.useCallback(
|
|
1667
1455
|
(ids) => ids.map((id2) => data.find((d) => d.id === id2)).filter((d) => d != null),
|
|
1668
1456
|
[data]
|
|
1669
1457
|
);
|
|
1670
|
-
const [internalValue, setInternalValue] =
|
|
1458
|
+
const [internalValue, setInternalValue] = React12.useState(
|
|
1671
1459
|
() => defaultSelectedItemIds ? idsToItems(defaultSelectedItemIds) : []
|
|
1672
1460
|
);
|
|
1673
1461
|
const value = isControlled ? idsToItems(selectedItemIds) : internalValue;
|
|
1674
|
-
const visibleData =
|
|
1462
|
+
const visibleData = React12.useMemo(
|
|
1675
1463
|
() => removeSelectedItems ? data.filter((item) => !value.some((v) => v.id === item.id)) : data,
|
|
1676
1464
|
[data, value, removeSelectedItems]
|
|
1677
1465
|
);
|
|
1678
|
-
const groups =
|
|
1466
|
+
const groups = React12.useMemo(
|
|
1679
1467
|
() => groupBy ? groupItems(visibleData, groupBy) : null,
|
|
1680
1468
|
[visibleData, groupBy]
|
|
1681
1469
|
);
|
|
1682
1470
|
const currentInputValue = inputValue ?? internalInputValue;
|
|
1683
|
-
const creatableSentinel =
|
|
1471
|
+
const creatableSentinel = React12.useMemo(() => {
|
|
1684
1472
|
if (!creatableProp) return null;
|
|
1685
1473
|
const trimmed = currentInputValue.trim();
|
|
1686
1474
|
if (!trimmed) return null;
|
|
@@ -1691,7 +1479,7 @@ function MultiCombobox(props) {
|
|
|
1691
1479
|
if (exactExists) return null;
|
|
1692
1480
|
return makeCreatableSentinel(trimmed);
|
|
1693
1481
|
}, [creatableProp, currentInputValue, data, itemToString]);
|
|
1694
|
-
const flatItems =
|
|
1482
|
+
const flatItems = React12.useMemo(() => {
|
|
1695
1483
|
if (!selectHeadings && !selectAll) return null;
|
|
1696
1484
|
if (!groups && !selectAll) return null;
|
|
1697
1485
|
const rows = [];
|
|
@@ -1785,8 +1573,8 @@ function MultiCombobox(props) {
|
|
|
1785
1573
|
const totalCount = data.length;
|
|
1786
1574
|
const selectedCount = value.length;
|
|
1787
1575
|
const state = selectedCount === 0 ? "none" : selectedCount === totalCount ? "all" : "partial";
|
|
1788
|
-
return /* @__PURE__ */ (0,
|
|
1789
|
-
/* @__PURE__ */ (0,
|
|
1576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(ComboboxSelectAllItem, { value: row, children: [
|
|
1577
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ComboboxGroupHeaderCheckbox, { $state: state, id: "__selectAll" }),
|
|
1790
1578
|
selectAllLabel
|
|
1791
1579
|
] }, "__selectAll");
|
|
1792
1580
|
}
|
|
@@ -1797,13 +1585,13 @@ function MultiCombobox(props) {
|
|
|
1797
1585
|
(item2) => value.some((s) => s.id === item2.id)
|
|
1798
1586
|
).length;
|
|
1799
1587
|
const state = selectedCount === 0 ? "none" : selectedCount === groupItemsList.length ? "all" : "partial";
|
|
1800
|
-
return /* @__PURE__ */ (0,
|
|
1588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1801
1589
|
ComboboxGroupHeaderItem,
|
|
1802
1590
|
{
|
|
1803
1591
|
value: row,
|
|
1804
1592
|
disabled: isGroupHeaderDisabled?.(row.groupName),
|
|
1805
1593
|
children: [
|
|
1806
|
-
/* @__PURE__ */ (0,
|
|
1594
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1807
1595
|
ComboboxGroupHeaderCheckbox,
|
|
1808
1596
|
{
|
|
1809
1597
|
$state: state,
|
|
@@ -1820,7 +1608,7 @@ function MultiCombobox(props) {
|
|
|
1820
1608
|
return renderCreatableItem(row);
|
|
1821
1609
|
}
|
|
1822
1610
|
const item = row;
|
|
1823
|
-
return /* @__PURE__ */ (0,
|
|
1611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1824
1612
|
ComboboxItem_default,
|
|
1825
1613
|
{
|
|
1826
1614
|
value: item,
|
|
@@ -1834,15 +1622,15 @@ function MultiCombobox(props) {
|
|
|
1834
1622
|
);
|
|
1835
1623
|
}
|
|
1836
1624
|
function renderCreatableItem(sentinel, style, index, measureRef) {
|
|
1837
|
-
return /* @__PURE__ */ (0,
|
|
1625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1838
1626
|
ComboboxItem_default,
|
|
1839
1627
|
{
|
|
1840
1628
|
value: sentinel,
|
|
1841
1629
|
itemId: "__creatable",
|
|
1842
1630
|
label: `Create "${sentinel.label}"`,
|
|
1843
1631
|
inputType: "none",
|
|
1844
|
-
renderItem: () => /* @__PURE__ */ (0,
|
|
1845
|
-
/* @__PURE__ */ (0,
|
|
1632
|
+
renderItem: () => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
1633
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_seeds_react_icon3.default, { name: "plus-outline", size: "mini" }),
|
|
1846
1634
|
`Create "${sentinel.label}"`
|
|
1847
1635
|
] }),
|
|
1848
1636
|
style,
|
|
@@ -1857,9 +1645,9 @@ function MultiCombobox(props) {
|
|
|
1857
1645
|
const rootItems = creatableSentinel && Array.isArray(baseItems) ? [...baseItems, creatableSentinel] : baseItems;
|
|
1858
1646
|
const hasSentinels = selectAll || selectHeadings;
|
|
1859
1647
|
const rootValue = hasSentinels ? [...value] : value;
|
|
1860
|
-
return /* @__PURE__ */ (0,
|
|
1861
|
-
/* @__PURE__ */ (0,
|
|
1862
|
-
/* @__PURE__ */ (0,
|
|
1648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
1649
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
1650
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1863
1651
|
import_combobox4.Combobox.Root,
|
|
1864
1652
|
{
|
|
1865
1653
|
multiple: true,
|
|
@@ -1934,35 +1722,35 @@ function MultiCombobox(props) {
|
|
|
1934
1722
|
},
|
|
1935
1723
|
items: rootItems,
|
|
1936
1724
|
children: [
|
|
1937
|
-
/* @__PURE__ */ (0,
|
|
1725
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1938
1726
|
ComboboxTokenInputGroup,
|
|
1939
1727
|
{
|
|
1940
1728
|
$isInvalid: isInvalid,
|
|
1941
1729
|
onKeyDownCapture: onInputKeyDownCapture,
|
|
1942
|
-
children: /* @__PURE__ */ (0,
|
|
1730
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(ComboboxToken, { children: [
|
|
1943
1731
|
renderSelection ? renderSelection(value) : (() => {
|
|
1944
1732
|
const visibleTokens = maxTokens != null ? value.slice(0, maxTokens) : value;
|
|
1945
1733
|
const overflow = maxTokens != null ? value.length - maxTokens : 0;
|
|
1946
|
-
return /* @__PURE__ */ (0,
|
|
1947
|
-
visibleTokens.map((item) => /* @__PURE__ */ (0,
|
|
1734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
1735
|
+
visibleTokens.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Token, { children: [
|
|
1948
1736
|
renderToken ? renderToken(item) : itemToString(item),
|
|
1949
|
-
/* @__PURE__ */ (0,
|
|
1737
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1950
1738
|
TokenRemove,
|
|
1951
1739
|
{
|
|
1952
1740
|
"aria-label": `Remove ${itemToString(item)}`,
|
|
1953
1741
|
onPointerDown: (e) => e.preventDefault(),
|
|
1954
1742
|
onClick: (e) => removeItem(item, e),
|
|
1955
|
-
children: /* @__PURE__ */ (0,
|
|
1743
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_seeds_react_icon3.default, { name: "x-outline", size: "mini" })
|
|
1956
1744
|
}
|
|
1957
1745
|
)
|
|
1958
1746
|
] }, item.id)),
|
|
1959
|
-
overflow > 0 && /* @__PURE__ */ (0,
|
|
1747
|
+
overflow > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Token, { children: [
|
|
1960
1748
|
"+",
|
|
1961
1749
|
overflow
|
|
1962
1750
|
] }, "__overflow")
|
|
1963
1751
|
] });
|
|
1964
1752
|
})(),
|
|
1965
|
-
/* @__PURE__ */ (0,
|
|
1753
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1966
1754
|
ComboboxTokenInput,
|
|
1967
1755
|
{
|
|
1968
1756
|
ref: inputRef,
|
|
@@ -1973,24 +1761,26 @@ function MultiCombobox(props) {
|
|
|
1973
1761
|
"aria-required": props.required || void 0
|
|
1974
1762
|
}
|
|
1975
1763
|
),
|
|
1976
|
-
/* @__PURE__ */ (0,
|
|
1977
|
-
/* @__PURE__ */ (0,
|
|
1978
|
-
/* @__PURE__ */ (0,
|
|
1764
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(ComboboxActionButtons, { children: [
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ComboboxClear, { "aria-label": "Clear all", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ClearIcon, {}) }),
|
|
1766
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ComboboxTrigger, { "aria-label": "Open popup", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(StyledChevron, { $isOpen: open, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChevronIcon, {}) }) })
|
|
1979
1767
|
] })
|
|
1980
1768
|
] })
|
|
1981
1769
|
}
|
|
1982
1770
|
),
|
|
1983
|
-
/* @__PURE__ */ (0,
|
|
1771
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_combobox4.Combobox.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ComboboxPositioner, { sideOffset: 4, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1984
1772
|
ComboboxPopup,
|
|
1985
1773
|
{
|
|
1986
1774
|
"aria-busy": isLoading || void 0,
|
|
1987
1775
|
style: isVirtualized ? { display: "flex", flexDirection: "column" } : void 0,
|
|
1988
1776
|
children: [
|
|
1989
|
-
/* @__PURE__ */ (0,
|
|
1990
|
-
/* @__PURE__ */ (0,
|
|
1991
|
-
/* @__PURE__ */ (0,
|
|
1777
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ComboboxStatus, { children: isLoading ? loadingText : null }),
|
|
1778
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ComboboxEmpty, { children: isLoading ? null : emptyText }),
|
|
1779
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1992
1780
|
ComboboxList,
|
|
1993
1781
|
{
|
|
1782
|
+
"aria-label": ariaLabel,
|
|
1783
|
+
"aria-labelledby": ariaLabelledBy,
|
|
1994
1784
|
style: isVirtualized ? {
|
|
1995
1785
|
padding: 0,
|
|
1996
1786
|
flex: 1,
|
|
@@ -1998,7 +1788,7 @@ function MultiCombobox(props) {
|
|
|
1998
1788
|
display: "flex",
|
|
1999
1789
|
flexDirection: "column"
|
|
2000
1790
|
} : void 0,
|
|
2001
|
-
children: isVirtualized ? /* @__PURE__ */ (0,
|
|
1791
|
+
children: isVirtualized ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2002
1792
|
VirtualizedComboboxList,
|
|
2003
1793
|
{
|
|
2004
1794
|
open,
|
|
@@ -2023,10 +1813,10 @@ function MultiCombobox(props) {
|
|
|
2023
1813
|
return renderCreatableItem(group);
|
|
2024
1814
|
}
|
|
2025
1815
|
const g = group;
|
|
2026
|
-
return /* @__PURE__ */ (0,
|
|
2027
|
-
/* @__PURE__ */ (0,
|
|
2028
|
-
/* @__PURE__ */ (0,
|
|
2029
|
-
/* @__PURE__ */ (0,
|
|
1816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(React12.Fragment, { children: [
|
|
1817
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(ComboboxGroup, { items: g.items, children: [
|
|
1818
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ComboboxGroupLabel, { children: renderGroupHeading ? renderGroupHeading(g.value) : g.value }),
|
|
1819
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_combobox4.Combobox.Collection, { children: (item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2030
1820
|
ComboboxItem_default,
|
|
2031
1821
|
{
|
|
2032
1822
|
value: item,
|
|
@@ -2039,14 +1829,14 @@ function MultiCombobox(props) {
|
|
|
2039
1829
|
item.id
|
|
2040
1830
|
) })
|
|
2041
1831
|
] }),
|
|
2042
|
-
index < groups.length - 1 && /* @__PURE__ */ (0,
|
|
1832
|
+
index < groups.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ComboboxSeparator, {})
|
|
2043
1833
|
] }, g.value);
|
|
2044
1834
|
}) : ((item) => {
|
|
2045
1835
|
if (isCreatableSentinel(item)) {
|
|
2046
1836
|
return renderCreatableItem(item);
|
|
2047
1837
|
}
|
|
2048
1838
|
const dataItem = item;
|
|
2049
|
-
return /* @__PURE__ */ (0,
|
|
1839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2050
1840
|
ComboboxItem_default,
|
|
2051
1841
|
{
|
|
2052
1842
|
value: dataItem,
|
|
@@ -2071,10 +1861,10 @@ function MultiCombobox(props) {
|
|
|
2071
1861
|
}
|
|
2072
1862
|
|
|
2073
1863
|
// src/v3/SingleSearchableSelect.tsx
|
|
2074
|
-
var
|
|
1864
|
+
var React13 = __toESM(require("react"));
|
|
2075
1865
|
var import_combobox5 = require("@base-ui/react/combobox");
|
|
2076
1866
|
var import_react_virtual4 = require("@tanstack/react-virtual");
|
|
2077
|
-
var
|
|
1867
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2078
1868
|
function SingleSearchableSelect(props) {
|
|
2079
1869
|
const {
|
|
2080
1870
|
id,
|
|
@@ -2088,6 +1878,8 @@ function SingleSearchableSelect(props) {
|
|
|
2088
1878
|
fullWidth = true
|
|
2089
1879
|
} = props;
|
|
2090
1880
|
const ariaDescribedBy = props["aria-describedby"];
|
|
1881
|
+
const ariaLabel = props["aria-label"];
|
|
1882
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
2091
1883
|
const isInvalid = props.isInvalid;
|
|
2092
1884
|
const isChildrenMode = "children" in props && props.children != null;
|
|
2093
1885
|
const data = isChildrenMode ? [] : props.data;
|
|
@@ -2103,17 +1895,17 @@ function SingleSearchableSelect(props) {
|
|
|
2103
1895
|
const defaultSelectedItemId = props.defaultSelectedItemId;
|
|
2104
1896
|
const onSelectedItemIdChange = props.onSelectedItemIdChange;
|
|
2105
1897
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
2106
|
-
const [open, setOpen] =
|
|
2107
|
-
const virtualizerRef =
|
|
1898
|
+
const [open, setOpen] = React13.useState(false);
|
|
1899
|
+
const virtualizerRef = React13.useRef(null);
|
|
2108
1900
|
const isControlled = selectedItemId !== void 0;
|
|
2109
|
-
const idToItem =
|
|
1901
|
+
const idToItem = React13.useCallback(
|
|
2110
1902
|
(id2) => {
|
|
2111
1903
|
if (id2 == null) return null;
|
|
2112
1904
|
return data.find((d) => String(d.id) === String(id2)) ?? null;
|
|
2113
1905
|
},
|
|
2114
1906
|
[data]
|
|
2115
1907
|
);
|
|
2116
|
-
const [internalValue, setInternalValue] =
|
|
1908
|
+
const [internalValue, setInternalValue] = React13.useState(
|
|
2117
1909
|
() => idToItem(defaultSelectedItemId)
|
|
2118
1910
|
);
|
|
2119
1911
|
const value = isControlled ? idToItem(selectedItemId) : internalValue;
|
|
@@ -2124,13 +1916,13 @@ function SingleSearchableSelect(props) {
|
|
|
2124
1916
|
onSelectedItemIdChange(realItem ? realItem.id : null);
|
|
2125
1917
|
}
|
|
2126
1918
|
}
|
|
2127
|
-
const groups =
|
|
1919
|
+
const groups = React13.useMemo(
|
|
2128
1920
|
() => groupBy ? groupItems(data, groupBy) : null,
|
|
2129
1921
|
[data, groupBy]
|
|
2130
1922
|
);
|
|
2131
|
-
return /* @__PURE__ */ (0,
|
|
2132
|
-
/* @__PURE__ */ (0,
|
|
2133
|
-
/* @__PURE__ */ (0,
|
|
1923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
1924
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
1925
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2134
1926
|
import_combobox5.Combobox.Root,
|
|
2135
1927
|
{
|
|
2136
1928
|
id,
|
|
@@ -2163,7 +1955,7 @@ function SingleSearchableSelect(props) {
|
|
|
2163
1955
|
}
|
|
2164
1956
|
} : void 0,
|
|
2165
1957
|
children: [
|
|
2166
|
-
/* @__PURE__ */ (0,
|
|
1958
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2167
1959
|
SearchableSelectTrigger,
|
|
2168
1960
|
{
|
|
2169
1961
|
id,
|
|
@@ -2172,29 +1964,31 @@ function SingleSearchableSelect(props) {
|
|
|
2172
1964
|
"aria-required": props.required || void 0,
|
|
2173
1965
|
$isInvalid: isInvalid,
|
|
2174
1966
|
children: [
|
|
2175
|
-
/* @__PURE__ */ (0,
|
|
2176
|
-
/* @__PURE__ */ (0,
|
|
1967
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SearchableSelectPlaceholder, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_combobox5.Combobox.Value, { placeholder, children: value ? renderSelection ? renderSelection(value) : itemToString(value) : placeholder }) }),
|
|
1968
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SearchableSelectTriggerIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(StyledChevron, { "data-chevron": true, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ChevronIcon, {}) }) })
|
|
2177
1969
|
]
|
|
2178
1970
|
}
|
|
2179
1971
|
),
|
|
2180
|
-
/* @__PURE__ */ (0,
|
|
1972
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_combobox5.Combobox.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ComboboxPositioner, { sideOffset: 4, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2181
1973
|
SearchableSelectPopup,
|
|
2182
1974
|
{
|
|
2183
1975
|
"aria-busy": isLoading || void 0,
|
|
2184
1976
|
style: { display: "flex", flexDirection: "column" },
|
|
2185
1977
|
children: [
|
|
2186
|
-
/* @__PURE__ */ (0,
|
|
1978
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SearchableSelectSearchContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2187
1979
|
SearchableSelectInput,
|
|
2188
1980
|
{
|
|
2189
1981
|
placeholder: searchPlaceholder,
|
|
2190
1982
|
autoFocus: true
|
|
2191
1983
|
}
|
|
2192
1984
|
) }),
|
|
2193
|
-
/* @__PURE__ */ (0,
|
|
2194
|
-
/* @__PURE__ */ (0,
|
|
2195
|
-
/* @__PURE__ */ (0,
|
|
1985
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ComboboxStatus, { children: isLoading ? loadingText : null }),
|
|
1986
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ComboboxEmpty, { children: isLoading ? null : emptyText }),
|
|
1987
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2196
1988
|
SearchableSelectList,
|
|
2197
1989
|
{
|
|
1990
|
+
"aria-label": ariaLabel,
|
|
1991
|
+
"aria-labelledby": ariaLabelledBy,
|
|
2198
1992
|
style: isVirtualized ? {
|
|
2199
1993
|
padding: 0,
|
|
2200
1994
|
flex: 1,
|
|
@@ -2202,7 +1996,7 @@ function SingleSearchableSelect(props) {
|
|
|
2202
1996
|
display: "flex",
|
|
2203
1997
|
flexDirection: "column"
|
|
2204
1998
|
} : void 0,
|
|
2205
|
-
children: isVirtualized ? /* @__PURE__ */ (0,
|
|
1999
|
+
children: isVirtualized ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2206
2000
|
VirtualizedComboboxList,
|
|
2207
2001
|
{
|
|
2208
2002
|
open,
|
|
@@ -2214,10 +2008,10 @@ function SingleSearchableSelect(props) {
|
|
|
2214
2008
|
inputType,
|
|
2215
2009
|
renderItem
|
|
2216
2010
|
}
|
|
2217
|
-
) : children ? children : groups ? ((group, index) => /* @__PURE__ */ (0,
|
|
2218
|
-
/* @__PURE__ */ (0,
|
|
2219
|
-
/* @__PURE__ */ (0,
|
|
2220
|
-
/* @__PURE__ */ (0,
|
|
2011
|
+
) : children ? children : groups ? ((group, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(React13.Fragment, { children: [
|
|
2012
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(ComboboxGroup, { items: group.items, children: [
|
|
2013
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ComboboxGroupLabel, { children: renderGroupHeading ? renderGroupHeading(group.value) : group.value }),
|
|
2014
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_combobox5.Combobox.Collection, { children: (item) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2221
2015
|
ComboboxItem_default,
|
|
2222
2016
|
{
|
|
2223
2017
|
value: item,
|
|
@@ -2230,9 +2024,9 @@ function SingleSearchableSelect(props) {
|
|
|
2230
2024
|
item.id
|
|
2231
2025
|
) })
|
|
2232
2026
|
] }),
|
|
2233
|
-
index < groups.length - 1 && /* @__PURE__ */ (0,
|
|
2234
|
-
] }, group.value)) : /* @__PURE__ */ (0,
|
|
2235
|
-
includePlaceholderItem && /* @__PURE__ */ (0,
|
|
2027
|
+
index < groups.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ComboboxSeparator, {})
|
|
2028
|
+
] }, group.value)) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
2029
|
+
includePlaceholderItem && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2236
2030
|
ComboboxItem_default,
|
|
2237
2031
|
{
|
|
2238
2032
|
value: makePlaceholderSentinel(placeholder),
|
|
@@ -2242,7 +2036,7 @@ function SingleSearchableSelect(props) {
|
|
|
2242
2036
|
},
|
|
2243
2037
|
"placeholder"
|
|
2244
2038
|
),
|
|
2245
|
-
/* @__PURE__ */ (0,
|
|
2039
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_combobox5.Combobox.Collection, { children: (item) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2246
2040
|
ComboboxItem_default,
|
|
2247
2041
|
{
|
|
2248
2042
|
value: item,
|
|
@@ -2267,18 +2061,15 @@ function SingleSearchableSelect(props) {
|
|
|
2267
2061
|
}
|
|
2268
2062
|
|
|
2269
2063
|
// src/v3/MultiSearchableSelect.tsx
|
|
2270
|
-
var
|
|
2064
|
+
var React14 = __toESM(require("react"));
|
|
2271
2065
|
var import_combobox6 = require("@base-ui/react/combobox");
|
|
2272
2066
|
var import_react_virtual5 = require("@tanstack/react-virtual");
|
|
2273
2067
|
var import_seeds_react_icon4 = __toESM(require("@sproutsocial/seeds-react-icon"));
|
|
2274
|
-
var
|
|
2275
|
-
var
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
text-overflow: ellipsis;
|
|
2280
|
-
white-space: nowrap;
|
|
2281
|
-
`;
|
|
2068
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2069
|
+
var SelectionText2 = ({
|
|
2070
|
+
className,
|
|
2071
|
+
...rest
|
|
2072
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: cn("seeds-select-selection-text", className), ...rest });
|
|
2282
2073
|
function makeGroupHeaderSentinel2(groupName) {
|
|
2283
2074
|
return { __groupHeader: true, groupName };
|
|
2284
2075
|
}
|
|
@@ -2301,6 +2092,8 @@ function MultiSearchableSelect(props) {
|
|
|
2301
2092
|
fullWidth = true
|
|
2302
2093
|
} = props;
|
|
2303
2094
|
const ariaDescribedBy = props["aria-describedby"];
|
|
2095
|
+
const ariaLabel = props["aria-label"];
|
|
2096
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
2304
2097
|
const isInvalid = props.isInvalid;
|
|
2305
2098
|
const isChildrenMode = "children" in props && props.children != null;
|
|
2306
2099
|
const data = isChildrenMode ? [] : props.data;
|
|
@@ -2323,29 +2116,29 @@ function MultiSearchableSelect(props) {
|
|
|
2323
2116
|
const defaultSelectedItemIds = props.defaultSelectedItemIds;
|
|
2324
2117
|
const onSelectedItemIdsChange = props.onSelectedItemIdsChange;
|
|
2325
2118
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
2326
|
-
const [open, setOpen] =
|
|
2327
|
-
const [internalInputValue, setInternalInputValue] =
|
|
2328
|
-
const skipNextInputChangeRef =
|
|
2329
|
-
const virtualizerRef =
|
|
2119
|
+
const [open, setOpen] = React14.useState(false);
|
|
2120
|
+
const [internalInputValue, setInternalInputValue] = React14.useState("");
|
|
2121
|
+
const skipNextInputChangeRef = React14.useRef(false);
|
|
2122
|
+
const virtualizerRef = React14.useRef(null);
|
|
2330
2123
|
const isControlled = selectedItemIds !== void 0;
|
|
2331
|
-
const idsToItems =
|
|
2124
|
+
const idsToItems = React14.useCallback(
|
|
2332
2125
|
(ids) => ids.map((id2) => data.find((d) => d.id === id2)).filter((d) => d != null),
|
|
2333
2126
|
[data]
|
|
2334
2127
|
);
|
|
2335
|
-
const [internalValue, setInternalValue] =
|
|
2128
|
+
const [internalValue, setInternalValue] = React14.useState(
|
|
2336
2129
|
() => defaultSelectedItemIds ? idsToItems(defaultSelectedItemIds) : []
|
|
2337
2130
|
);
|
|
2338
2131
|
const value = isControlled ? idsToItems(selectedItemIds) : internalValue;
|
|
2339
|
-
const visibleData =
|
|
2132
|
+
const visibleData = React14.useMemo(
|
|
2340
2133
|
() => removeSelectedItems ? data.filter((item) => !value.some((v) => v.id === item.id)) : data,
|
|
2341
2134
|
[data, value, removeSelectedItems]
|
|
2342
2135
|
);
|
|
2343
|
-
const groups =
|
|
2136
|
+
const groups = React14.useMemo(
|
|
2344
2137
|
() => groupBy ? groupItems(visibleData, groupBy) : null,
|
|
2345
2138
|
[visibleData, groupBy]
|
|
2346
2139
|
);
|
|
2347
2140
|
const currentInputValue = internalInputValue;
|
|
2348
|
-
const creatableSentinel =
|
|
2141
|
+
const creatableSentinel = React14.useMemo(() => {
|
|
2349
2142
|
if (!creatableProp) return null;
|
|
2350
2143
|
const trimmed = currentInputValue.trim();
|
|
2351
2144
|
if (!trimmed) return null;
|
|
@@ -2356,7 +2149,7 @@ function MultiSearchableSelect(props) {
|
|
|
2356
2149
|
if (exactExists) return null;
|
|
2357
2150
|
return makeCreatableSentinel(trimmed);
|
|
2358
2151
|
}, [creatableProp, currentInputValue, data, itemToString]);
|
|
2359
|
-
const flatItems =
|
|
2152
|
+
const flatItems = React14.useMemo(() => {
|
|
2360
2153
|
if (!groups || !selectHeadings && !selectAll) return null;
|
|
2361
2154
|
const rows = [];
|
|
2362
2155
|
if (selectAll) rows.push(SELECT_ALL_SENTINEL2);
|
|
@@ -2436,8 +2229,8 @@ function MultiSearchableSelect(props) {
|
|
|
2436
2229
|
const totalCount = data.length;
|
|
2437
2230
|
const selectedCount = value.length;
|
|
2438
2231
|
const state = selectedCount === 0 ? "none" : selectedCount === totalCount ? "all" : "partial";
|
|
2439
|
-
return /* @__PURE__ */ (0,
|
|
2440
|
-
/* @__PURE__ */ (0,
|
|
2232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(ComboboxSelectAllItem, { value: row, children: [
|
|
2233
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ComboboxGroupHeaderCheckbox, { $state: state, id: "__selectAll" }),
|
|
2441
2234
|
"Select all"
|
|
2442
2235
|
] }, "__selectAll");
|
|
2443
2236
|
}
|
|
@@ -2448,8 +2241,8 @@ function MultiSearchableSelect(props) {
|
|
|
2448
2241
|
(item2) => value.some((s) => s.id === item2.id)
|
|
2449
2242
|
).length;
|
|
2450
2243
|
const state = selectedCount === 0 ? "none" : selectedCount === groupItemsList.length ? "all" : "partial";
|
|
2451
|
-
return /* @__PURE__ */ (0,
|
|
2452
|
-
/* @__PURE__ */ (0,
|
|
2244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(ComboboxGroupHeaderItem, { value: row, children: [
|
|
2245
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2453
2246
|
ComboboxGroupHeaderCheckbox,
|
|
2454
2247
|
{
|
|
2455
2248
|
$state: state,
|
|
@@ -2463,7 +2256,7 @@ function MultiSearchableSelect(props) {
|
|
|
2463
2256
|
return renderCreatableItem(row);
|
|
2464
2257
|
}
|
|
2465
2258
|
const item = row;
|
|
2466
|
-
return /* @__PURE__ */ (0,
|
|
2259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2467
2260
|
ComboboxItem_default,
|
|
2468
2261
|
{
|
|
2469
2262
|
value: item,
|
|
@@ -2477,15 +2270,15 @@ function MultiSearchableSelect(props) {
|
|
|
2477
2270
|
);
|
|
2478
2271
|
}
|
|
2479
2272
|
function renderCreatableItem(sentinel, style, index, measureRef) {
|
|
2480
|
-
return /* @__PURE__ */ (0,
|
|
2273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2481
2274
|
ComboboxItem_default,
|
|
2482
2275
|
{
|
|
2483
2276
|
value: sentinel,
|
|
2484
2277
|
itemId: "__creatable",
|
|
2485
2278
|
label: `Create "${sentinel.label}"`,
|
|
2486
2279
|
inputType: "none",
|
|
2487
|
-
renderItem: () => /* @__PURE__ */ (0,
|
|
2488
|
-
/* @__PURE__ */ (0,
|
|
2280
|
+
renderItem: () => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
2281
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_seeds_react_icon4.default, { name: "plus-outline", size: "mini" }),
|
|
2489
2282
|
`Create "${sentinel.label}"`
|
|
2490
2283
|
] }),
|
|
2491
2284
|
style,
|
|
@@ -2500,9 +2293,9 @@ function MultiSearchableSelect(props) {
|
|
|
2500
2293
|
const rootItems = creatableSentinel && Array.isArray(baseItems) ? [...baseItems, creatableSentinel] : baseItems;
|
|
2501
2294
|
const hasSentinels = selectAll || selectHeadings;
|
|
2502
2295
|
const rootValue = hasSentinels ? [...value] : value;
|
|
2503
|
-
return /* @__PURE__ */ (0,
|
|
2504
|
-
/* @__PURE__ */ (0,
|
|
2505
|
-
/* @__PURE__ */ (0,
|
|
2296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
2297
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
2298
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2506
2299
|
import_combobox6.Combobox.Root,
|
|
2507
2300
|
{
|
|
2508
2301
|
multiple: true,
|
|
@@ -2563,7 +2356,7 @@ function MultiSearchableSelect(props) {
|
|
|
2563
2356
|
},
|
|
2564
2357
|
items: rootItems,
|
|
2565
2358
|
children: [
|
|
2566
|
-
/* @__PURE__ */ (0,
|
|
2359
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2567
2360
|
SearchableSelectTokenTrigger,
|
|
2568
2361
|
{
|
|
2569
2362
|
id,
|
|
@@ -2578,33 +2371,35 @@ function MultiSearchableSelect(props) {
|
|
|
2578
2371
|
const text = visibleItems.map(
|
|
2579
2372
|
(item) => customRenderSelections ? customRenderSelections(item) : itemToString(item)
|
|
2580
2373
|
).join(", ");
|
|
2581
|
-
return /* @__PURE__ */ (0,
|
|
2374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(SelectionText2, { children: [
|
|
2582
2375
|
text,
|
|
2583
2376
|
overflowCount > 0 ? `, +${overflowCount}` : ""
|
|
2584
2377
|
] });
|
|
2585
|
-
})() : /* @__PURE__ */ (0,
|
|
2586
|
-
/* @__PURE__ */ (0,
|
|
2378
|
+
})() : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SearchableSelectPlaceholder, { children: placeholder }),
|
|
2379
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SearchableSelectTriggerIcon, { style: { marginLeft: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(StyledChevron, { "data-chevron": true, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChevronIcon, {}) }) })
|
|
2587
2380
|
]
|
|
2588
2381
|
}
|
|
2589
2382
|
),
|
|
2590
|
-
/* @__PURE__ */ (0,
|
|
2383
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_combobox6.Combobox.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ComboboxPositioner, { sideOffset: 4, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2591
2384
|
SearchableSelectPopup,
|
|
2592
2385
|
{
|
|
2593
2386
|
"aria-busy": isLoading || void 0,
|
|
2594
2387
|
style: { display: "flex", flexDirection: "column" },
|
|
2595
2388
|
children: [
|
|
2596
|
-
/* @__PURE__ */ (0,
|
|
2389
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SearchableSelectSearchContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2597
2390
|
SearchableSelectInput,
|
|
2598
2391
|
{
|
|
2599
2392
|
placeholder: searchPlaceholder,
|
|
2600
2393
|
autoFocus: true
|
|
2601
2394
|
}
|
|
2602
2395
|
) }),
|
|
2603
|
-
/* @__PURE__ */ (0,
|
|
2604
|
-
/* @__PURE__ */ (0,
|
|
2605
|
-
/* @__PURE__ */ (0,
|
|
2396
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ComboboxStatus, { children: isLoading ? loadingText : null }),
|
|
2397
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ComboboxEmpty, { children: isLoading ? null : emptyText }),
|
|
2398
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2606
2399
|
SearchableSelectList,
|
|
2607
2400
|
{
|
|
2401
|
+
"aria-label": ariaLabel,
|
|
2402
|
+
"aria-labelledby": ariaLabelledBy,
|
|
2608
2403
|
style: isVirtualized ? {
|
|
2609
2404
|
padding: 0,
|
|
2610
2405
|
flex: 1,
|
|
@@ -2612,7 +2407,7 @@ function MultiSearchableSelect(props) {
|
|
|
2612
2407
|
display: "flex",
|
|
2613
2408
|
flexDirection: "column"
|
|
2614
2409
|
} : void 0,
|
|
2615
|
-
children: isVirtualized ? /* @__PURE__ */ (0,
|
|
2410
|
+
children: isVirtualized ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2616
2411
|
VirtualizedComboboxList,
|
|
2617
2412
|
{
|
|
2618
2413
|
open,
|
|
@@ -2636,10 +2431,10 @@ function MultiSearchableSelect(props) {
|
|
|
2636
2431
|
return renderCreatableItem(group);
|
|
2637
2432
|
}
|
|
2638
2433
|
const g = group;
|
|
2639
|
-
return /* @__PURE__ */ (0,
|
|
2640
|
-
/* @__PURE__ */ (0,
|
|
2641
|
-
/* @__PURE__ */ (0,
|
|
2642
|
-
/* @__PURE__ */ (0,
|
|
2434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(React14.Fragment, { children: [
|
|
2435
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(ComboboxGroup, { items: g.items, children: [
|
|
2436
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ComboboxGroupLabel, { children: renderGroupHeading ? renderGroupHeading(g.value) : g.value }),
|
|
2437
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_combobox6.Combobox.Collection, { children: (item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2643
2438
|
ComboboxItem_default,
|
|
2644
2439
|
{
|
|
2645
2440
|
value: item,
|
|
@@ -2652,14 +2447,14 @@ function MultiSearchableSelect(props) {
|
|
|
2652
2447
|
item.id
|
|
2653
2448
|
) })
|
|
2654
2449
|
] }),
|
|
2655
|
-
index < groups.length - 1 && /* @__PURE__ */ (0,
|
|
2450
|
+
index < groups.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ComboboxSeparator, {})
|
|
2656
2451
|
] }, g.value);
|
|
2657
2452
|
}) : ((item) => {
|
|
2658
2453
|
if (isCreatableSentinel(item)) {
|
|
2659
2454
|
return renderCreatableItem(item);
|
|
2660
2455
|
}
|
|
2661
2456
|
const dataItem = item;
|
|
2662
|
-
return /* @__PURE__ */ (0,
|
|
2457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2663
2458
|
ComboboxItem_default,
|
|
2664
2459
|
{
|
|
2665
2460
|
value: dataItem,
|
|
@@ -2684,153 +2479,141 @@ function MultiSearchableSelect(props) {
|
|
|
2684
2479
|
}
|
|
2685
2480
|
|
|
2686
2481
|
// src/v3/ActionMenu.tsx
|
|
2687
|
-
var
|
|
2482
|
+
var React16 = __toESM(require("react"));
|
|
2688
2483
|
var import_menu2 = require("@base-ui/react/menu");
|
|
2689
2484
|
var import_seeds_react_radio3 = __toESM(require("@sproutsocial/seeds-react-radio"));
|
|
2690
2485
|
var import_seeds_react_checkbox4 = __toESM(require("@sproutsocial/seeds-react-checkbox"));
|
|
2691
2486
|
var import_seeds_react_icon5 = require("@sproutsocial/seeds-react-icon");
|
|
2692
2487
|
|
|
2693
2488
|
// src/v3/ActionMenuStyles.tsx
|
|
2489
|
+
var React15 = __toESM(require("react"));
|
|
2694
2490
|
var import_menu = require("@base-ui/react/menu");
|
|
2695
|
-
var
|
|
2696
|
-
var
|
|
2697
|
-
var
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
"data-base-ui-swipe-ignore": ""
|
|
2704
|
-
})`
|
|
2705
|
-
font-family: ${({ theme }) => theme.fontFamily};
|
|
2706
|
-
background: ${({ theme }) => theme.colors.container.background.base};
|
|
2707
|
-
border: 1px solid ${({ theme }) => theme.colors.container.border.base};
|
|
2708
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
2709
|
-
box-shadow: ${({ theme }) => theme.shadows.low};
|
|
2710
|
-
outline: none;
|
|
2711
|
-
max-height: min(var(--available-height, 400px), 400px);
|
|
2712
|
-
overflow-y: auto;
|
|
2713
|
-
padding: ${({ theme }) => theme.space[300]};
|
|
2714
|
-
|
|
2715
|
-
&[data-open] {
|
|
2716
|
-
animation: action-menu-popup-in 120ms ease-out;
|
|
2491
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2492
|
+
var ActionMenuTrigger = import_menu.Menu.Trigger;
|
|
2493
|
+
var ActionMenuPositioner = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2494
|
+
import_menu.Menu.Positioner,
|
|
2495
|
+
{
|
|
2496
|
+
ref,
|
|
2497
|
+
className: cn("seeds-action-menu-positioner", className),
|
|
2498
|
+
...rest
|
|
2717
2499
|
}
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2500
|
+
));
|
|
2501
|
+
ActionMenuPositioner.displayName = "ActionMenuPositioner";
|
|
2502
|
+
var ActionMenuPopup = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2503
|
+
import_menu.Menu.Popup,
|
|
2504
|
+
{
|
|
2505
|
+
ref,
|
|
2506
|
+
"data-base-ui-swipe-ignore": "",
|
|
2507
|
+
className: cn("seeds-action-menu-popup", className),
|
|
2508
|
+
...rest
|
|
2721
2509
|
}
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
transform: scale(1);
|
|
2731
|
-
}
|
|
2510
|
+
));
|
|
2511
|
+
ActionMenuPopup.displayName = "ActionMenuPopup";
|
|
2512
|
+
var ActionMenuGroup = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2513
|
+
import_menu.Menu.Group,
|
|
2514
|
+
{
|
|
2515
|
+
ref,
|
|
2516
|
+
className: cn("seeds-action-menu-group", className),
|
|
2517
|
+
...rest
|
|
2732
2518
|
}
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
transform: scale(0.95);
|
|
2742
|
-
}
|
|
2519
|
+
));
|
|
2520
|
+
ActionMenuGroup.displayName = "ActionMenuGroup";
|
|
2521
|
+
var ActionMenuGroupLabel = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2522
|
+
import_menu.Menu.GroupLabel,
|
|
2523
|
+
{
|
|
2524
|
+
ref,
|
|
2525
|
+
className: cn("seeds-action-menu-group-label", className),
|
|
2526
|
+
...rest
|
|
2743
2527
|
}
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
`;
|
|
2753
|
-
var ActionMenuSeparator = (0, import_styled_components8.default)(import_menu.Menu.Separator)`
|
|
2754
|
-
height: 1px;
|
|
2755
|
-
margin: ${({ theme }) => `${theme.space[300]} -${theme.space[300]}`};
|
|
2756
|
-
background: ${({ theme }) => theme.colors.container.border.base};
|
|
2757
|
-
`;
|
|
2758
|
-
var menuItemStyles = import_styled_components8.css`
|
|
2759
|
-
box-sizing: border-box;
|
|
2760
|
-
display: block;
|
|
2761
|
-
width: 100%;
|
|
2762
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
2763
|
-
background-color: ${({ theme }) => theme.colors.listItem.background.base};
|
|
2764
|
-
border: 1px solid ${({ theme }) => theme.colors.listItem.background.base};
|
|
2765
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
2766
|
-
font-family: ${({ theme }) => theme.fontFamily};
|
|
2767
|
-
font-weight: ${({ theme }) => theme.fontWeights.normal};
|
|
2768
|
-
text-align: left;
|
|
2769
|
-
text-decoration: none;
|
|
2770
|
-
padding: ${({ theme }) => theme.space[300]};
|
|
2771
|
-
outline: 0;
|
|
2772
|
-
${({ theme }) => theme.typography[200]};
|
|
2773
|
-
transition: all ${({ theme }) => theme.duration.fast};
|
|
2774
|
-
cursor: pointer;
|
|
2775
|
-
user-select: none;
|
|
2776
|
-
|
|
2777
|
-
&[data-highlighted] {
|
|
2778
|
-
border-color: ${({ theme }) => theme.colors.listItem.border.base};
|
|
2779
|
-
background-color: ${({ theme }) => theme.colors.listItem.background.hover};
|
|
2780
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
2781
|
-
text-decoration: none;
|
|
2528
|
+
));
|
|
2529
|
+
ActionMenuGroupLabel.displayName = "ActionMenuGroupLabel";
|
|
2530
|
+
var ActionMenuSeparator = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2531
|
+
import_menu.Menu.Separator,
|
|
2532
|
+
{
|
|
2533
|
+
ref,
|
|
2534
|
+
className: cn("seeds-action-menu-separator", className),
|
|
2535
|
+
...rest
|
|
2782
2536
|
}
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
}
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2537
|
+
));
|
|
2538
|
+
ActionMenuSeparator.displayName = "ActionMenuSeparator";
|
|
2539
|
+
var StyledMenuItem = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2540
|
+
import_menu.Menu.Item,
|
|
2541
|
+
{
|
|
2542
|
+
ref,
|
|
2543
|
+
className: cn("seeds-action-menu-item", className),
|
|
2544
|
+
...rest
|
|
2545
|
+
}
|
|
2546
|
+
));
|
|
2547
|
+
StyledMenuItem.displayName = "StyledMenuItem";
|
|
2548
|
+
var StyledCheckboxItem = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2549
|
+
import_menu.Menu.CheckboxItem,
|
|
2550
|
+
{
|
|
2551
|
+
ref,
|
|
2552
|
+
className: cn(
|
|
2553
|
+
"seeds-action-menu-item",
|
|
2554
|
+
"seeds-action-menu-item--flex",
|
|
2555
|
+
className
|
|
2556
|
+
),
|
|
2557
|
+
...rest
|
|
2558
|
+
}
|
|
2559
|
+
));
|
|
2560
|
+
StyledCheckboxItem.displayName = "StyledCheckboxItem";
|
|
2561
|
+
var StyledRadioItem = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2562
|
+
import_menu.Menu.RadioItem,
|
|
2563
|
+
{
|
|
2564
|
+
ref,
|
|
2565
|
+
className: cn(
|
|
2566
|
+
"seeds-action-menu-item",
|
|
2567
|
+
"seeds-action-menu-item--flex",
|
|
2568
|
+
className
|
|
2569
|
+
),
|
|
2570
|
+
...rest
|
|
2571
|
+
}
|
|
2572
|
+
));
|
|
2573
|
+
StyledRadioItem.displayName = "StyledRadioItem";
|
|
2574
|
+
var StyledCheckboxItemIndicator = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2575
|
+
import_menu.Menu.CheckboxItemIndicator,
|
|
2576
|
+
{
|
|
2577
|
+
ref,
|
|
2578
|
+
className: cn("seeds-action-menu-item-indicator", className),
|
|
2579
|
+
...rest
|
|
2580
|
+
}
|
|
2581
|
+
));
|
|
2582
|
+
StyledCheckboxItemIndicator.displayName = "StyledCheckboxItemIndicator";
|
|
2583
|
+
var StyledRadioItemIndicator = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2584
|
+
import_menu.Menu.RadioItemIndicator,
|
|
2585
|
+
{
|
|
2586
|
+
ref,
|
|
2587
|
+
className: cn("seeds-action-menu-item-indicator", className),
|
|
2588
|
+
...rest
|
|
2589
|
+
}
|
|
2590
|
+
));
|
|
2591
|
+
StyledRadioItemIndicator.displayName = "StyledRadioItemIndicator";
|
|
2592
|
+
var StyledSubmenuTrigger = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2593
|
+
import_menu.Menu.SubmenuTrigger,
|
|
2594
|
+
{
|
|
2595
|
+
ref,
|
|
2596
|
+
className: cn(
|
|
2597
|
+
"seeds-action-menu-item",
|
|
2598
|
+
"seeds-action-menu-submenu-trigger",
|
|
2599
|
+
className
|
|
2600
|
+
),
|
|
2601
|
+
...rest
|
|
2602
|
+
}
|
|
2603
|
+
));
|
|
2604
|
+
StyledSubmenuTrigger.displayName = "StyledSubmenuTrigger";
|
|
2605
|
+
var StyledLinkItem = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2606
|
+
import_menu.Menu.LinkItem,
|
|
2607
|
+
{
|
|
2608
|
+
ref,
|
|
2609
|
+
className: cn("seeds-action-menu-item", className),
|
|
2610
|
+
...rest
|
|
2611
|
+
}
|
|
2612
|
+
));
|
|
2613
|
+
StyledLinkItem.displayName = "StyledLinkItem";
|
|
2831
2614
|
|
|
2832
2615
|
// src/v3/ActionMenu.tsx
|
|
2833
|
-
var
|
|
2616
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2834
2617
|
function ActionMenu({
|
|
2835
2618
|
trigger,
|
|
2836
2619
|
children,
|
|
@@ -2840,16 +2623,16 @@ function ActionMenu({
|
|
|
2840
2623
|
disabled
|
|
2841
2624
|
}) {
|
|
2842
2625
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
2843
|
-
return /* @__PURE__ */ (0,
|
|
2626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2844
2627
|
import_menu2.Menu.Root,
|
|
2845
2628
|
{
|
|
2846
2629
|
open,
|
|
2847
2630
|
defaultOpen,
|
|
2848
2631
|
onOpenChange,
|
|
2849
2632
|
children: [
|
|
2850
|
-
/* @__PURE__ */ (0,
|
|
2851
|
-
/* @__PURE__ */ (0,
|
|
2852
|
-
/* @__PURE__ */ (0,
|
|
2633
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
2634
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ActionMenuTrigger, { render: trigger, disabled }),
|
|
2635
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_menu2.Menu.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ActionMenuPositioner, { sideOffset: 8, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ActionMenuPopup, { children }) }) })
|
|
2853
2636
|
]
|
|
2854
2637
|
}
|
|
2855
2638
|
);
|
|
@@ -2859,12 +2642,12 @@ function MenuGroup({
|
|
|
2859
2642
|
label,
|
|
2860
2643
|
showSeparator = false
|
|
2861
2644
|
}) {
|
|
2862
|
-
return /* @__PURE__ */ (0,
|
|
2863
|
-
/* @__PURE__ */ (0,
|
|
2864
|
-
label && /* @__PURE__ */ (0,
|
|
2645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
2646
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(ActionMenuGroup, { children: [
|
|
2647
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ActionMenuGroupLabel, { children: label }),
|
|
2865
2648
|
children
|
|
2866
2649
|
] }),
|
|
2867
|
-
showSeparator && /* @__PURE__ */ (0,
|
|
2650
|
+
showSeparator && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ActionMenuSeparator, {})
|
|
2868
2651
|
] });
|
|
2869
2652
|
}
|
|
2870
2653
|
function MenuRadioGroup({
|
|
@@ -2873,7 +2656,7 @@ function MenuRadioGroup({
|
|
|
2873
2656
|
defaultValue,
|
|
2874
2657
|
onValueChange
|
|
2875
2658
|
}) {
|
|
2876
|
-
return /* @__PURE__ */ (0,
|
|
2659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2877
2660
|
import_menu2.Menu.RadioGroup,
|
|
2878
2661
|
{
|
|
2879
2662
|
value,
|
|
@@ -2884,7 +2667,7 @@ function MenuRadioGroup({
|
|
|
2884
2667
|
);
|
|
2885
2668
|
}
|
|
2886
2669
|
function MenuItem(props) {
|
|
2887
|
-
const generatedId =
|
|
2670
|
+
const generatedId = React16.useId();
|
|
2888
2671
|
if (props.type === "checkbox") {
|
|
2889
2672
|
const {
|
|
2890
2673
|
children: children2,
|
|
@@ -2896,7 +2679,7 @@ function MenuItem(props) {
|
|
|
2896
2679
|
id
|
|
2897
2680
|
} = props;
|
|
2898
2681
|
const itemId = id ?? `checkbox-menu-item-${generatedId}`;
|
|
2899
|
-
return /* @__PURE__ */ (0,
|
|
2682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2900
2683
|
StyledCheckboxItem,
|
|
2901
2684
|
{
|
|
2902
2685
|
checked,
|
|
@@ -2905,11 +2688,11 @@ function MenuItem(props) {
|
|
|
2905
2688
|
disabled: disabled2,
|
|
2906
2689
|
closeOnClick: closeOnClick2,
|
|
2907
2690
|
children: [
|
|
2908
|
-
/* @__PURE__ */ (0,
|
|
2691
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2909
2692
|
StyledCheckboxItemIndicator,
|
|
2910
2693
|
{
|
|
2911
2694
|
keepMounted: true,
|
|
2912
|
-
render: (_indicatorProps, state) => /* @__PURE__ */ (0,
|
|
2695
|
+
render: (_indicatorProps, state) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2913
2696
|
import_seeds_react_checkbox4.default,
|
|
2914
2697
|
{
|
|
2915
2698
|
checked: state.checked,
|
|
@@ -2929,18 +2712,18 @@ function MenuItem(props) {
|
|
|
2929
2712
|
}
|
|
2930
2713
|
if (props.type === "radio") {
|
|
2931
2714
|
const { children: children2, value, disabled: disabled2, closeOnClick: closeOnClick2 = false } = props;
|
|
2932
|
-
return /* @__PURE__ */ (0,
|
|
2715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2933
2716
|
StyledRadioItem,
|
|
2934
2717
|
{
|
|
2935
2718
|
value,
|
|
2936
2719
|
disabled: disabled2,
|
|
2937
2720
|
closeOnClick: closeOnClick2,
|
|
2938
2721
|
children: [
|
|
2939
|
-
/* @__PURE__ */ (0,
|
|
2722
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2940
2723
|
StyledRadioItemIndicator,
|
|
2941
2724
|
{
|
|
2942
2725
|
keepMounted: true,
|
|
2943
|
-
render: (_indicatorProps, state) => /* @__PURE__ */ (0,
|
|
2726
|
+
render: (_indicatorProps, state) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2944
2727
|
import_seeds_react_radio3.default,
|
|
2945
2728
|
{
|
|
2946
2729
|
checked: state.checked,
|
|
@@ -2967,9 +2750,9 @@ function MenuItem(props) {
|
|
|
2967
2750
|
target
|
|
2968
2751
|
} = props;
|
|
2969
2752
|
if (href) {
|
|
2970
|
-
return /* @__PURE__ */ (0,
|
|
2753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(StyledLinkItem, { href, target, closeOnClick, children });
|
|
2971
2754
|
}
|
|
2972
|
-
return /* @__PURE__ */ (0,
|
|
2755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2973
2756
|
StyledMenuItem,
|
|
2974
2757
|
{
|
|
2975
2758
|
onClick,
|
|
@@ -2988,7 +2771,7 @@ function MenuSub({
|
|
|
2988
2771
|
closeParentOnEsc = false
|
|
2989
2772
|
}) {
|
|
2990
2773
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
2991
|
-
return /* @__PURE__ */ (0,
|
|
2774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2992
2775
|
import_menu2.Menu.SubmenuRoot,
|
|
2993
2776
|
{
|
|
2994
2777
|
open,
|
|
@@ -2996,9 +2779,9 @@ function MenuSub({
|
|
|
2996
2779
|
onOpenChange,
|
|
2997
2780
|
closeParentOnEsc,
|
|
2998
2781
|
children: [
|
|
2999
|
-
/* @__PURE__ */ (0,
|
|
2782
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
3000
2783
|
trigger,
|
|
3001
|
-
/* @__PURE__ */ (0,
|
|
2784
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_menu2.Menu.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ActionMenuPositioner, { sideOffset: getOffset, alignOffset: getOffset, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ActionMenuPopup, { children }) }) })
|
|
3002
2785
|
]
|
|
3003
2786
|
}
|
|
3004
2787
|
);
|
|
@@ -3012,7 +2795,7 @@ function MenuSubTrigger({
|
|
|
3012
2795
|
label,
|
|
3013
2796
|
openOnHover = true
|
|
3014
2797
|
}) {
|
|
3015
|
-
return /* @__PURE__ */ (0,
|
|
2798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
3016
2799
|
StyledSubmenuTrigger,
|
|
3017
2800
|
{
|
|
3018
2801
|
disabled,
|
|
@@ -3020,47 +2803,53 @@ function MenuSubTrigger({
|
|
|
3020
2803
|
openOnHover,
|
|
3021
2804
|
children: [
|
|
3022
2805
|
children,
|
|
3023
|
-
/* @__PURE__ */ (0,
|
|
2806
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_seeds_react_icon5.Icon, { name: "chevron-right-outline", fixedWidth: true, "aria-hidden": true })
|
|
3024
2807
|
]
|
|
3025
2808
|
}
|
|
3026
2809
|
);
|
|
3027
2810
|
}
|
|
3028
2811
|
|
|
3029
2812
|
// src/v3/MenuButton.tsx
|
|
3030
|
-
var
|
|
2813
|
+
var React18 = require("react");
|
|
3031
2814
|
var import_seeds_react_button2 = require("@sproutsocial/seeds-react-button");
|
|
3032
2815
|
var import_seeds_react_icon6 = require("@sproutsocial/seeds-react-icon");
|
|
3033
2816
|
|
|
3034
2817
|
// src/v3/MenuButtonStyles.tsx
|
|
3035
|
-
var
|
|
2818
|
+
var React17 = __toESM(require("react"));
|
|
3036
2819
|
var import_seeds_react_button = require("@sproutsocial/seeds-react-button");
|
|
3037
|
-
var
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
border-bottom-right-radius: 0;
|
|
3045
|
-
}
|
|
3046
|
-
`;
|
|
3047
|
-
var TriggerButton = (0, import_styled_components9.default)(import_seeds_react_button.Button)`
|
|
3048
|
-
&& {
|
|
3049
|
-
border-top-left-radius: 0;
|
|
3050
|
-
border-bottom-left-radius: 0;
|
|
3051
|
-
}
|
|
3052
|
-
|
|
3053
|
-
.Icon-svg {
|
|
3054
|
-
transition: transform ${({ theme }) => theme.duration.fast} ease;
|
|
2820
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2821
|
+
var MenuButtonContainer = React17.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2822
|
+
"div",
|
|
2823
|
+
{
|
|
2824
|
+
ref,
|
|
2825
|
+
className: cn("seeds-menu-button-container", className),
|
|
2826
|
+
...rest
|
|
3055
2827
|
}
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
2828
|
+
));
|
|
2829
|
+
MenuButtonContainer.displayName = "MenuButtonContainer";
|
|
2830
|
+
var MainButton = React17.forwardRef(
|
|
2831
|
+
({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2832
|
+
import_seeds_react_button.Button,
|
|
2833
|
+
{
|
|
2834
|
+
ref,
|
|
2835
|
+
className: cn("seeds-menu-button-main", className),
|
|
2836
|
+
...rest
|
|
2837
|
+
}
|
|
2838
|
+
)
|
|
2839
|
+
);
|
|
2840
|
+
MainButton.displayName = "MainButton";
|
|
2841
|
+
var TriggerButton = React17.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2842
|
+
import_seeds_react_button.Button,
|
|
2843
|
+
{
|
|
2844
|
+
ref,
|
|
2845
|
+
className: cn("seeds-menu-button-trigger", className),
|
|
2846
|
+
...rest
|
|
3059
2847
|
}
|
|
3060
|
-
|
|
2848
|
+
));
|
|
2849
|
+
TriggerButton.displayName = "TriggerButton";
|
|
3061
2850
|
|
|
3062
2851
|
// src/v3/MenuButton.tsx
|
|
3063
|
-
var
|
|
2852
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
3064
2853
|
function MenuButton({
|
|
3065
2854
|
actionMenu,
|
|
3066
2855
|
appearance = "primary",
|
|
@@ -3070,8 +2859,8 @@ function MenuButton({
|
|
|
3070
2859
|
children,
|
|
3071
2860
|
...rest
|
|
3072
2861
|
}) {
|
|
3073
|
-
return /* @__PURE__ */ (0,
|
|
3074
|
-
/* @__PURE__ */ (0,
|
|
2862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(MenuButtonContainer, { children: [
|
|
2863
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3075
2864
|
MainButton,
|
|
3076
2865
|
{
|
|
3077
2866
|
appearance,
|
|
@@ -3081,18 +2870,18 @@ function MenuButton({
|
|
|
3081
2870
|
children
|
|
3082
2871
|
}
|
|
3083
2872
|
),
|
|
3084
|
-
/* @__PURE__ */ (0,
|
|
2873
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3085
2874
|
ActionMenu,
|
|
3086
2875
|
{
|
|
3087
2876
|
disabled,
|
|
3088
|
-
trigger: /* @__PURE__ */ (0,
|
|
2877
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3089
2878
|
TriggerButton,
|
|
3090
2879
|
{
|
|
3091
2880
|
appearance,
|
|
3092
2881
|
size,
|
|
3093
2882
|
disabled,
|
|
3094
2883
|
ariaLabel: menuButtonAriaLabel,
|
|
3095
|
-
children: /* @__PURE__ */ (0,
|
|
2884
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_seeds_react_icon6.Icon, { name: "chevron-down-outline", fixedWidth: true, "aria-hidden": true })
|
|
3096
2885
|
}
|
|
3097
2886
|
),
|
|
3098
2887
|
children: actionMenu
|