@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/esm/v3/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// src/v3/SingleSelect.tsx
|
|
2
|
-
import * as
|
|
2
|
+
import * as React5 from "react";
|
|
3
3
|
import { Select as Select3 } from "@base-ui/react/select";
|
|
4
|
-
import styled4 from "styled-components";
|
|
5
4
|
|
|
6
5
|
// src/v3/SeedsPortal.tsx
|
|
7
6
|
import * as React from "react";
|
|
@@ -24,49 +23,51 @@ function useSeedsPortalContainer() {
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
// src/v3/Common/SelectItem.tsx
|
|
27
|
-
import "react";
|
|
26
|
+
import * as React2 from "react";
|
|
28
27
|
import { Select } from "@base-ui/react/select";
|
|
29
|
-
import styled from "styled-components";
|
|
30
28
|
import Radio from "@sproutsocial/seeds-react-radio";
|
|
31
29
|
import Checkbox from "@sproutsocial/seeds-react-checkbox";
|
|
32
30
|
import { Icon } from "@sproutsocial/seeds-react-icon";
|
|
33
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
34
|
-
var StyledItem = styled(Select.Item)`
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
gap: 8px;
|
|
38
|
-
padding: 6px 8px;
|
|
39
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
40
|
-
font-size: 14px;
|
|
41
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
42
|
-
cursor: default;
|
|
43
|
-
outline: none;
|
|
44
31
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
32
|
+
// src/v3/Common/cn.ts
|
|
33
|
+
function cn(...inputs) {
|
|
34
|
+
const classes = [];
|
|
35
|
+
for (const input of inputs) {
|
|
36
|
+
if (!input) continue;
|
|
37
|
+
if (typeof input === "string") {
|
|
38
|
+
classes.push(input);
|
|
39
|
+
} else if (typeof input === "object") {
|
|
40
|
+
for (const [key, value] of Object.entries(input)) {
|
|
41
|
+
if (value) {
|
|
42
|
+
classes.push(key);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
51
46
|
}
|
|
47
|
+
return classes.join(" ");
|
|
48
|
+
}
|
|
52
49
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
50
|
+
// src/v3/Common/SelectItem.tsx
|
|
51
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
52
|
+
var StyledItem = React2.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx(
|
|
53
|
+
Select.Item,
|
|
54
|
+
{
|
|
55
|
+
ref,
|
|
56
|
+
className: cn("seeds-select-item", className),
|
|
57
|
+
...rest
|
|
58
|
+
}
|
|
59
|
+
));
|
|
60
|
+
StyledItem.displayName = "StyledItem";
|
|
61
|
+
var StyledItemIndicator = React2.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx(
|
|
62
|
+
Select.ItemIndicator,
|
|
63
|
+
{
|
|
64
|
+
ref,
|
|
65
|
+
className: cn("seeds-select-item-indicator", className),
|
|
66
|
+
...rest
|
|
67
|
+
}
|
|
68
|
+
));
|
|
69
|
+
StyledItemIndicator.displayName = "StyledItemIndicator";
|
|
70
|
+
var StyledItemText = Select.ItemText;
|
|
70
71
|
function CheckIcon() {
|
|
71
72
|
return /* @__PURE__ */ jsx(Icon, { name: "check-outline", fixedWidth: true, "aria-hidden": true });
|
|
72
73
|
}
|
|
@@ -137,176 +138,153 @@ function groupItems(data, groupBy) {
|
|
|
137
138
|
}
|
|
138
139
|
|
|
139
140
|
// src/v3/Common/SelectStyles.tsx
|
|
141
|
+
import * as React3 from "react";
|
|
140
142
|
import { Select as Select2 } from "@base-ui/react/select";
|
|
141
|
-
import
|
|
142
|
-
|
|
143
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
144
|
+
var Field = React3.forwardRef(
|
|
145
|
+
({ $fullWidth, className, ...rest }, ref) => /* @__PURE__ */ jsx2(
|
|
146
|
+
"div",
|
|
147
|
+
{
|
|
148
|
+
ref,
|
|
149
|
+
className: cn(
|
|
150
|
+
"seeds-menu-field",
|
|
151
|
+
{ "seeds-menu-field--inline": $fullWidth === false },
|
|
152
|
+
className
|
|
153
|
+
),
|
|
154
|
+
...rest
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
);
|
|
158
|
+
Field.displayName = "Field";
|
|
159
|
+
var SelectLabel = React3.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx2(
|
|
160
|
+
Select2.Label,
|
|
161
|
+
{
|
|
162
|
+
ref,
|
|
163
|
+
className: cn("seeds-menu-label", className),
|
|
164
|
+
...rest
|
|
165
|
+
}
|
|
166
|
+
));
|
|
167
|
+
SelectLabel.displayName = "SelectLabel";
|
|
168
|
+
var SelectTrigger = React3.forwardRef(({ $isInvalid, className, ...rest }, ref) => /* @__PURE__ */ jsx2(
|
|
169
|
+
Select2.Trigger,
|
|
170
|
+
{
|
|
171
|
+
ref,
|
|
172
|
+
className: cn(
|
|
173
|
+
"seeds-select-trigger",
|
|
174
|
+
{ "seeds-select-trigger--invalid": !!$isInvalid },
|
|
175
|
+
className
|
|
176
|
+
),
|
|
177
|
+
...rest
|
|
178
|
+
}
|
|
179
|
+
));
|
|
180
|
+
SelectTrigger.displayName = "SelectTrigger";
|
|
181
|
+
var SelectValue = React3.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx2(
|
|
182
|
+
Select2.Value,
|
|
183
|
+
{
|
|
184
|
+
ref,
|
|
185
|
+
className: cn("seeds-select-value", className),
|
|
186
|
+
...rest
|
|
187
|
+
}
|
|
188
|
+
));
|
|
189
|
+
SelectValue.displayName = "SelectValue";
|
|
190
|
+
var SelectIcon = React3.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx2(
|
|
191
|
+
Select2.Icon,
|
|
192
|
+
{
|
|
193
|
+
ref,
|
|
194
|
+
className: cn("seeds-select-icon", className),
|
|
195
|
+
...rest
|
|
196
|
+
}
|
|
197
|
+
));
|
|
198
|
+
SelectIcon.displayName = "SelectIcon";
|
|
199
|
+
var SelectGroup = React3.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx2(
|
|
200
|
+
Select2.Group,
|
|
201
|
+
{
|
|
202
|
+
ref,
|
|
203
|
+
className: cn("seeds-select-group", className),
|
|
204
|
+
...rest
|
|
205
|
+
}
|
|
206
|
+
));
|
|
207
|
+
SelectGroup.displayName = "SelectGroup";
|
|
208
|
+
var SelectGroupLabel = React3.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx2(
|
|
209
|
+
Select2.GroupLabel,
|
|
210
|
+
{
|
|
211
|
+
ref,
|
|
212
|
+
className: cn("seeds-select-group-label", className),
|
|
213
|
+
...rest
|
|
214
|
+
}
|
|
215
|
+
));
|
|
216
|
+
SelectGroupLabel.displayName = "SelectGroupLabel";
|
|
217
|
+
var SelectSeparator = React3.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx2(
|
|
218
|
+
Select2.Separator,
|
|
219
|
+
{
|
|
220
|
+
ref,
|
|
221
|
+
className: cn("seeds-select-separator", className),
|
|
222
|
+
...rest
|
|
223
|
+
}
|
|
224
|
+
));
|
|
225
|
+
SelectSeparator.displayName = "SelectSeparator";
|
|
226
|
+
var SelectPositioner = React3.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx2(
|
|
227
|
+
Select2.Positioner,
|
|
228
|
+
{
|
|
229
|
+
ref,
|
|
230
|
+
className: cn("seeds-select-positioner", className),
|
|
231
|
+
...rest
|
|
232
|
+
}
|
|
233
|
+
));
|
|
234
|
+
SelectPositioner.displayName = "SelectPositioner";
|
|
235
|
+
var SelectPopup = React3.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx2(
|
|
236
|
+
Select2.Popup,
|
|
237
|
+
{
|
|
238
|
+
ref,
|
|
239
|
+
className: cn("seeds-select-popup", className),
|
|
240
|
+
...rest
|
|
241
|
+
}
|
|
242
|
+
));
|
|
243
|
+
SelectPopup.displayName = "SelectPopup";
|
|
143
244
|
|
|
144
245
|
// src/v3/Common/SelectIcons.tsx
|
|
145
|
-
import "react";
|
|
146
|
-
import styled2 from "styled-components";
|
|
246
|
+
import * as React4 from "react";
|
|
147
247
|
import { Icon as Icon2 } from "@sproutsocial/seeds-react-icon";
|
|
148
|
-
import { jsx as
|
|
149
|
-
var StyledChevron =
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
248
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
249
|
+
var StyledChevron = React4.forwardRef(({ $isOpen, className, ...rest }, ref) => /* @__PURE__ */ jsx3(
|
|
250
|
+
"div",
|
|
251
|
+
{
|
|
252
|
+
ref,
|
|
253
|
+
className: cn(
|
|
254
|
+
"seeds-menu-chevron",
|
|
255
|
+
{ "seeds-menu-chevron--open": !!$isOpen },
|
|
256
|
+
className
|
|
257
|
+
),
|
|
258
|
+
...rest
|
|
259
|
+
}
|
|
260
|
+
));
|
|
261
|
+
StyledChevron.displayName = "StyledChevron";
|
|
155
262
|
function ChevronIcon() {
|
|
156
|
-
return /* @__PURE__ */
|
|
263
|
+
return /* @__PURE__ */ jsx3(Icon2, { name: "chevron-down-outline", fixedWidth: true, "aria-hidden": true });
|
|
157
264
|
}
|
|
158
265
|
function ClearIcon() {
|
|
159
|
-
return /* @__PURE__ */
|
|
266
|
+
return /* @__PURE__ */ jsx3(Icon2, { name: "circle-x-outline", fixedWidth: true, "aria-hidden": true, size: "mini" });
|
|
160
267
|
}
|
|
161
268
|
function CheckIcon2() {
|
|
162
|
-
return /* @__PURE__ */
|
|
269
|
+
return /* @__PURE__ */ jsx3(Icon2, { name: "check-outline", fixedWidth: true, "aria-hidden": true });
|
|
163
270
|
}
|
|
164
271
|
|
|
165
|
-
// src/v3/Common/SelectStyles.tsx
|
|
166
|
-
var invalidStyles = css`
|
|
167
|
-
border-color: ${({ theme }) => theme.colors.form.border.error};
|
|
168
|
-
|
|
169
|
-
${StyledChevron} {
|
|
170
|
-
color: ${({ theme }) => theme.colors.icon.error};
|
|
171
|
-
}
|
|
172
|
-
`;
|
|
173
|
-
var Field = styled3.div`
|
|
174
|
-
display: ${({ $fullWidth }) => $fullWidth === false ? "inline-flex" : "flex"};
|
|
175
|
-
flex-direction: column;
|
|
176
|
-
gap: ${({ theme }) => theme.space[200]};
|
|
177
|
-
${({ $fullWidth }) => $fullWidth !== false && "width: 100%;"}
|
|
178
|
-
`;
|
|
179
|
-
var SelectLabel = styled3(Select2.Label)`
|
|
180
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
181
|
-
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
182
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
183
|
-
`;
|
|
184
|
-
var SelectTrigger = styled3(Select2.Trigger)`
|
|
185
|
-
display: flex;
|
|
186
|
-
align-items: center;
|
|
187
|
-
justify-content: space-between;
|
|
188
|
-
gap: ${({ theme }) => theme.space[300]};
|
|
189
|
-
padding: ${({ theme }) => `${theme.space[300]}`};
|
|
190
|
-
min-width: 160px;
|
|
191
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
192
|
-
border: 1px solid ${({ theme }) => theme.colors.form.border.base};
|
|
193
|
-
background: ${({ theme }) => theme.colors.form.background.base};
|
|
194
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
195
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
196
|
-
cursor: default;
|
|
197
|
-
outline: none;
|
|
198
|
-
transition: border-color ${({ theme }) => theme.duration.fast}
|
|
199
|
-
${({ theme }) => theme.easing.ease_in},
|
|
200
|
-
box-shadow ${({ theme }) => theme.duration.fast}
|
|
201
|
-
${({ theme }) => theme.easing.ease_in};
|
|
202
|
-
|
|
203
|
-
&:focus-visible {
|
|
204
|
-
${focusRing}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
&[data-popup-open] {
|
|
208
|
-
${focusRing}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
&[data-popup-open] [data-chevron] {
|
|
212
|
-
transform: rotate(-180deg);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
&[data-disabled] {
|
|
216
|
-
opacity: 0.4;
|
|
217
|
-
cursor: not-allowed;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
${({ $isInvalid }) => $isInvalid && invalidStyles}
|
|
221
|
-
`;
|
|
222
|
-
var SelectValue = styled3(Select2.Value)`
|
|
223
|
-
min-width: 0;
|
|
224
|
-
overflow: hidden;
|
|
225
|
-
`;
|
|
226
|
-
var SelectIcon = styled3(Select2.Icon)`
|
|
227
|
-
display: flex;
|
|
228
|
-
align-items: center;
|
|
229
|
-
color: ${({ theme }) => theme.colors.icon.base};
|
|
230
|
-
flex-shrink: 0;
|
|
231
|
-
`;
|
|
232
|
-
var SelectGroup = styled3(Select2.Group)`
|
|
233
|
-
display: block;
|
|
234
|
-
`;
|
|
235
|
-
var SelectGroupLabel = styled3(Select2.GroupLabel)`
|
|
236
|
-
padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]} ${theme.space[200]}`};
|
|
237
|
-
font-size: ${({ theme }) => theme.typography[100].fontSize};
|
|
238
|
-
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
239
|
-
text-transform: uppercase;
|
|
240
|
-
letter-spacing: 0.05em;
|
|
241
|
-
color: ${({ theme }) => theme.colors.text.subtext};
|
|
242
|
-
`;
|
|
243
|
-
var SelectSeparator = styled3(Select2.Separator)`
|
|
244
|
-
height: 1px;
|
|
245
|
-
margin: ${({ theme }) => `${theme.space[200]} ${theme.space[300]}`};
|
|
246
|
-
background: ${({ theme }) => theme.colors.container.border.base};
|
|
247
|
-
`;
|
|
248
|
-
var SelectPositioner = styled3(Select2.Positioner)`
|
|
249
|
-
width: var(--anchor-width);
|
|
250
|
-
z-index: 7;
|
|
251
|
-
`;
|
|
252
|
-
var SelectPopup = styled3(Select2.Popup)`
|
|
253
|
-
font-family: ${({ theme }) => theme.fontFamily};
|
|
254
|
-
background: ${({ theme }) => theme.colors.container.background.base};
|
|
255
|
-
border: 1px solid ${({ theme }) => theme.colors.container.border.base};
|
|
256
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
257
|
-
box-shadow: ${({ theme }) => theme.shadows.low};
|
|
258
|
-
outline: none;
|
|
259
|
-
max-height: min(var(--available-height, 400px), 400px);
|
|
260
|
-
overflow-y: auto;
|
|
261
|
-
padding: ${({ theme }) => theme.space[200]};
|
|
262
|
-
|
|
263
|
-
&[data-open] {
|
|
264
|
-
animation: select-popup-in 120ms ease-out;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
&[data-closed] {
|
|
268
|
-
animation: select-popup-out 100ms ease-in;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
@keyframes select-popup-in {
|
|
272
|
-
from {
|
|
273
|
-
opacity: 0;
|
|
274
|
-
transform: scale(0.95);
|
|
275
|
-
}
|
|
276
|
-
to {
|
|
277
|
-
opacity: 1;
|
|
278
|
-
transform: scale(1);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
@keyframes select-popup-out {
|
|
283
|
-
from {
|
|
284
|
-
opacity: 1;
|
|
285
|
-
transform: scale(1);
|
|
286
|
-
}
|
|
287
|
-
to {
|
|
288
|
-
opacity: 0;
|
|
289
|
-
transform: scale(0.95);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
`;
|
|
293
|
-
|
|
294
272
|
// src/v3/SingleSelect.tsx
|
|
295
|
-
import { Fragment as Fragment2, jsx as
|
|
296
|
-
var StyledValue =
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
`;
|
|
273
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
274
|
+
var StyledValue = React5.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx4(
|
|
275
|
+
Select3.Value,
|
|
276
|
+
{
|
|
277
|
+
ref,
|
|
278
|
+
className: cn("seeds-select-value-text", className),
|
|
279
|
+
...rest
|
|
280
|
+
}
|
|
281
|
+
));
|
|
282
|
+
StyledValue.displayName = "StyledValue";
|
|
307
283
|
function SingleSelect(props) {
|
|
308
284
|
const { id, placeholder, includePlaceholderItem, fullWidth = true } = props;
|
|
309
285
|
const ariaDescribedBy = props["aria-describedby"];
|
|
286
|
+
const ariaLabel = props["aria-label"];
|
|
287
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
310
288
|
const isInvalid = props.isInvalid;
|
|
311
289
|
const isChildrenMode = "children" in props && props.children != null;
|
|
312
290
|
const selectedItemId = props.selectedItemId;
|
|
@@ -321,7 +299,7 @@ function SingleSelect(props) {
|
|
|
321
299
|
const renderGroupHeading = isChildrenMode ? void 0 : props.renderGroupHeading;
|
|
322
300
|
const children = isChildrenMode ? props.children : void 0;
|
|
323
301
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
324
|
-
const items =
|
|
302
|
+
const items = React5.useMemo(() => {
|
|
325
303
|
const dataItems = data.map((item) => ({
|
|
326
304
|
value: String(item.id),
|
|
327
305
|
label: itemToString(item)
|
|
@@ -333,11 +311,11 @@ function SingleSelect(props) {
|
|
|
333
311
|
}, [data, itemToString, includePlaceholderItem, placeholder]);
|
|
334
312
|
const dataWithPlaceholder = includePlaceholderItem ? [{ id: null, value: null, label: placeholder ?? "" }, ...data] : data;
|
|
335
313
|
const isControlled = selectedItemId !== void 0;
|
|
336
|
-
const [internalValue, setInternalValue] =
|
|
314
|
+
const [internalValue, setInternalValue] = React5.useState(
|
|
337
315
|
defaultSelectedItemId != null ? String(defaultSelectedItemId) : null
|
|
338
316
|
);
|
|
339
317
|
const value = isControlled ? selectedItemId != null ? String(selectedItemId) : null : internalValue;
|
|
340
|
-
const selectedItem =
|
|
318
|
+
const selectedItem = React5.useMemo(
|
|
341
319
|
() => value != null ? data.find((d) => String(d.id) === value) ?? null : null,
|
|
342
320
|
[data, value]
|
|
343
321
|
);
|
|
@@ -355,7 +333,7 @@ function SingleSelect(props) {
|
|
|
355
333
|
}
|
|
356
334
|
}
|
|
357
335
|
return /* @__PURE__ */ jsxs2(Field, { $fullWidth: fullWidth, children: [
|
|
358
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ jsx4("div", { ref: containerRef, style: { position: "relative" } }),
|
|
359
337
|
/* @__PURE__ */ jsxs2(
|
|
360
338
|
Select3.Root,
|
|
361
339
|
{
|
|
@@ -373,51 +351,58 @@ function SingleSelect(props) {
|
|
|
373
351
|
"aria-required": props.required || void 0,
|
|
374
352
|
$isInvalid: isInvalid,
|
|
375
353
|
children: [
|
|
376
|
-
/* @__PURE__ */
|
|
377
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ jsx4(StyledValue, { placeholder, children: renderSelection && selectedItem ? renderSelection(selectedItem) : void 0 }),
|
|
355
|
+
/* @__PURE__ */ jsx4(SelectIcon, { children: /* @__PURE__ */ jsx4(StyledChevron, { "data-chevron": true, children: /* @__PURE__ */ jsx4(ChevronIcon, {}) }) })
|
|
378
356
|
]
|
|
379
357
|
}
|
|
380
358
|
),
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
359
|
+
/* @__PURE__ */ jsx4(Select3.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx4(SelectPositioner, { sideOffset: 8, alignItemWithTrigger: false, children: /* @__PURE__ */ jsxs2(SelectPopup, { children: [
|
|
360
|
+
/* @__PURE__ */ jsx4(Select3.ScrollUpArrow, {}),
|
|
361
|
+
/* @__PURE__ */ jsx4(
|
|
362
|
+
Select3.List,
|
|
363
|
+
{
|
|
364
|
+
"aria-label": ariaLabel,
|
|
365
|
+
"aria-labelledby": ariaLabelledBy,
|
|
366
|
+
children: children ? children : groupBy ? groupItems(data, groupBy).map((group, index, arr) => /* @__PURE__ */ jsxs2(React5.Fragment, { children: [
|
|
367
|
+
/* @__PURE__ */ jsxs2(SelectGroup, { children: [
|
|
368
|
+
/* @__PURE__ */ jsx4(SelectGroupLabel, { children: renderGroupHeading ? renderGroupHeading(group.value) : group.value }),
|
|
369
|
+
group.items.map((item) => /* @__PURE__ */ jsx4(
|
|
370
|
+
SelectItem,
|
|
371
|
+
{
|
|
372
|
+
value: String(item.id),
|
|
373
|
+
label: itemToString(item),
|
|
374
|
+
disabled: item.disabled,
|
|
375
|
+
inputType,
|
|
376
|
+
renderItem: renderItem ? () => renderItem(item) : () => itemToString(item)
|
|
377
|
+
},
|
|
378
|
+
item.id
|
|
379
|
+
))
|
|
380
|
+
] }),
|
|
381
|
+
index < arr.length - 1 && /* @__PURE__ */ jsx4(SelectSeparator, {})
|
|
382
|
+
] }, group.value)) : /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
383
|
+
includePlaceholderItem && /* @__PURE__ */ jsx4(
|
|
384
|
+
SelectItem,
|
|
385
|
+
{
|
|
386
|
+
value: null,
|
|
387
|
+
label: placeholder ?? ""
|
|
388
|
+
},
|
|
389
|
+
"placeholder"
|
|
390
|
+
),
|
|
391
|
+
data.map((item) => /* @__PURE__ */ jsx4(
|
|
392
|
+
SelectItem,
|
|
393
|
+
{
|
|
394
|
+
value: String(item.id),
|
|
395
|
+
label: itemToString(item),
|
|
396
|
+
disabled: item.disabled,
|
|
397
|
+
inputType,
|
|
398
|
+
renderItem: renderItem ? () => renderItem(item) : () => itemToString(item)
|
|
399
|
+
},
|
|
400
|
+
item.id
|
|
401
|
+
))
|
|
402
|
+
] })
|
|
403
|
+
}
|
|
404
|
+
),
|
|
405
|
+
/* @__PURE__ */ jsx4(Select3.ScrollDownArrow, {})
|
|
421
406
|
] }) }) })
|
|
422
407
|
]
|
|
423
408
|
}
|
|
@@ -426,27 +411,19 @@ function SingleSelect(props) {
|
|
|
426
411
|
}
|
|
427
412
|
|
|
428
413
|
// src/v3/MultiSelect.tsx
|
|
429
|
-
import * as
|
|
414
|
+
import * as React6 from "react";
|
|
430
415
|
import { Select as Select4 } from "@base-ui/react/select";
|
|
431
|
-
import
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
white-space: nowrap;
|
|
438
|
-
`;
|
|
439
|
-
var Placeholder = styled5.div`
|
|
440
|
-
color: ${({ theme }) => theme.colors.text.subtext};
|
|
441
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
442
|
-
line-height: 16px;
|
|
443
|
-
padding-top: 2px;
|
|
444
|
-
padding-bottom: 2px;
|
|
445
|
-
margin: 2px 8px 0px 0px;
|
|
446
|
-
`;
|
|
416
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
417
|
+
var SelectionText = ({
|
|
418
|
+
className,
|
|
419
|
+
...rest
|
|
420
|
+
}) => /* @__PURE__ */ jsx5("span", { className: cn("seeds-select-selection-text", className), ...rest });
|
|
421
|
+
var Placeholder = ({ className, ...rest }) => /* @__PURE__ */ jsx5("div", { className: cn("seeds-select-placeholder", className), ...rest });
|
|
447
422
|
function MultiSelect(props) {
|
|
448
423
|
const { id, placeholder = "Select...", fullWidth = true } = props;
|
|
449
424
|
const ariaDescribedBy = props["aria-describedby"];
|
|
425
|
+
const ariaLabel = props["aria-label"];
|
|
426
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
450
427
|
const isInvalid = props.isInvalid;
|
|
451
428
|
const isChildrenMode = "children" in props && props.children != null;
|
|
452
429
|
const data = isChildrenMode ? [] : props.data;
|
|
@@ -465,18 +442,18 @@ function MultiSelect(props) {
|
|
|
465
442
|
const children = isChildrenMode ? props.children : void 0;
|
|
466
443
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
467
444
|
const isControlled = selectedItemIds !== void 0;
|
|
468
|
-
const [internalValue, setInternalValue] =
|
|
445
|
+
const [internalValue, setInternalValue] = React6.useState(
|
|
469
446
|
() => defaultSelectedItemIds?.map(String) ?? []
|
|
470
447
|
);
|
|
471
448
|
const value = isControlled ? selectedItemIds.map(String) : internalValue;
|
|
472
|
-
const items =
|
|
449
|
+
const items = React6.useMemo(
|
|
473
450
|
() => data.map((item) => ({
|
|
474
451
|
value: String(item.id),
|
|
475
452
|
label: itemToString(item)
|
|
476
453
|
})),
|
|
477
454
|
[data, itemToString]
|
|
478
455
|
);
|
|
479
|
-
const selectedItems =
|
|
456
|
+
const selectedItems = React6.useMemo(
|
|
480
457
|
() => value.map((v) => data.find((d) => String(d.id) === v)).filter((d) => d != null),
|
|
481
458
|
[data, value]
|
|
482
459
|
);
|
|
@@ -493,7 +470,7 @@ function MultiSelect(props) {
|
|
|
493
470
|
}
|
|
494
471
|
}
|
|
495
472
|
return /* @__PURE__ */ jsxs3(Field, { $fullWidth: fullWidth, children: [
|
|
496
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ jsx5("div", { ref: containerRef, style: { position: "relative" } }),
|
|
497
474
|
/* @__PURE__ */ jsxs3(
|
|
498
475
|
Select4.Root,
|
|
499
476
|
{
|
|
@@ -512,10 +489,10 @@ function MultiSelect(props) {
|
|
|
512
489
|
"aria-required": props.required || void 0,
|
|
513
490
|
$isInvalid: isInvalid,
|
|
514
491
|
children: [
|
|
515
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ jsx5(SelectValue, { children: () => {
|
|
516
493
|
if (renderSelection) return renderSelection(selectedItems);
|
|
517
494
|
if (selectedItems.length === 0)
|
|
518
|
-
return /* @__PURE__ */
|
|
495
|
+
return /* @__PURE__ */ jsx5(Placeholder, { children: placeholder });
|
|
519
496
|
const visibleItems = maxSelections != null ? selectedItems.slice(0, maxSelections) : selectedItems;
|
|
520
497
|
const overflowCount = maxSelections != null && selectedItems.length > maxSelections ? selectedItems.length - maxSelections : 0;
|
|
521
498
|
const text = visibleItems.map(
|
|
@@ -526,16 +503,35 @@ function MultiSelect(props) {
|
|
|
526
503
|
overflowCount > 0 ? `, +${overflowCount}` : ""
|
|
527
504
|
] });
|
|
528
505
|
} }),
|
|
529
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ jsx5(SelectIcon, { children: /* @__PURE__ */ jsx5(StyledChevron, { "data-chevron": true, children: /* @__PURE__ */ jsx5(ChevronIcon, {}) }) })
|
|
530
507
|
]
|
|
531
508
|
}
|
|
532
509
|
),
|
|
533
|
-
/* @__PURE__ */
|
|
534
|
-
/* @__PURE__ */
|
|
535
|
-
/* @__PURE__ */
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
510
|
+
/* @__PURE__ */ jsx5(Select4.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx5(SelectPositioner, { sideOffset: 8, alignItemWithTrigger: false, children: /* @__PURE__ */ jsxs3(SelectPopup, { children: [
|
|
511
|
+
/* @__PURE__ */ jsx5(Select4.ScrollUpArrow, {}),
|
|
512
|
+
/* @__PURE__ */ jsx5(
|
|
513
|
+
Select4.List,
|
|
514
|
+
{
|
|
515
|
+
"aria-label": ariaLabel,
|
|
516
|
+
"aria-labelledby": ariaLabelledBy,
|
|
517
|
+
children: children ? children : groupBy ? groupItems(data, groupBy).map((group, index, arr) => /* @__PURE__ */ jsxs3(React6.Fragment, { children: [
|
|
518
|
+
/* @__PURE__ */ jsxs3(SelectGroup, { children: [
|
|
519
|
+
/* @__PURE__ */ jsx5(SelectGroupLabel, { children: renderGroupHeading ? renderGroupHeading(group.value) : group.value }),
|
|
520
|
+
group.items.map((item) => /* @__PURE__ */ jsx5(
|
|
521
|
+
SelectItem,
|
|
522
|
+
{
|
|
523
|
+
value: String(item.id),
|
|
524
|
+
label: itemToString(item),
|
|
525
|
+
disabled: item.disabled,
|
|
526
|
+
inputType,
|
|
527
|
+
hidden: removeSelectedItems && value.includes(String(item.id)),
|
|
528
|
+
renderItem: renderItem ? () => renderItem(item) : void 0
|
|
529
|
+
},
|
|
530
|
+
item.id
|
|
531
|
+
))
|
|
532
|
+
] }),
|
|
533
|
+
index < arr.length - 1 && /* @__PURE__ */ jsx5(SelectSeparator, {})
|
|
534
|
+
] }, group.value)) : data.map((item) => /* @__PURE__ */ jsx5(
|
|
539
535
|
SelectItem,
|
|
540
536
|
{
|
|
541
537
|
value: String(item.id),
|
|
@@ -543,25 +539,13 @@ function MultiSelect(props) {
|
|
|
543
539
|
disabled: item.disabled,
|
|
544
540
|
inputType,
|
|
545
541
|
hidden: removeSelectedItems && value.includes(String(item.id)),
|
|
546
|
-
renderItem: renderItem ? () => renderItem(item) :
|
|
542
|
+
renderItem: renderItem ? () => renderItem(item) : () => itemToString(item)
|
|
547
543
|
},
|
|
548
544
|
item.id
|
|
549
545
|
))
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
SelectItem,
|
|
554
|
-
{
|
|
555
|
-
value: String(item.id),
|
|
556
|
-
label: itemToString(item),
|
|
557
|
-
disabled: item.disabled,
|
|
558
|
-
inputType,
|
|
559
|
-
hidden: removeSelectedItems && value.includes(String(item.id)),
|
|
560
|
-
renderItem: renderItem ? () => renderItem(item) : () => itemToString(item)
|
|
561
|
-
},
|
|
562
|
-
item.id
|
|
563
|
-
)) }),
|
|
564
|
-
/* @__PURE__ */ jsx4(Select4.ScrollDownArrow, {})
|
|
546
|
+
}
|
|
547
|
+
),
|
|
548
|
+
/* @__PURE__ */ jsx5(Select4.ScrollDownArrow, {})
|
|
565
549
|
] }) }) })
|
|
566
550
|
]
|
|
567
551
|
}
|
|
@@ -570,14 +554,14 @@ function MultiSelect(props) {
|
|
|
570
554
|
}
|
|
571
555
|
|
|
572
556
|
// src/v3/SingleCombobox.tsx
|
|
573
|
-
import * as
|
|
557
|
+
import * as React11 from "react";
|
|
574
558
|
import { Combobox as Combobox3 } from "@base-ui/react/combobox";
|
|
575
559
|
import "@tanstack/react-virtual";
|
|
576
560
|
|
|
577
561
|
// src/v3/Common/useSuppressEscapeClear.ts
|
|
578
|
-
import * as
|
|
562
|
+
import * as React7 from "react";
|
|
579
563
|
function useSuppressEscapeClear(open) {
|
|
580
|
-
return
|
|
564
|
+
return React7.useCallback(
|
|
581
565
|
(event) => {
|
|
582
566
|
if (event.key === "Escape" && !open) {
|
|
583
567
|
event.stopPropagation();
|
|
@@ -588,309 +572,189 @@ function useSuppressEscapeClear(open) {
|
|
|
588
572
|
}
|
|
589
573
|
|
|
590
574
|
// src/v3/Common/ComboboxItem.tsx
|
|
591
|
-
import * as
|
|
575
|
+
import * as React9 from "react";
|
|
592
576
|
import Radio2 from "@sproutsocial/seeds-react-radio";
|
|
593
577
|
import Checkbox3 from "@sproutsocial/seeds-react-checkbox";
|
|
594
578
|
|
|
595
579
|
// src/v3/Common/ComboboxStyles.tsx
|
|
580
|
+
import * as React8 from "react";
|
|
596
581
|
import { Combobox } from "@base-ui/react/combobox";
|
|
597
|
-
import styled6, { css as css2 } from "styled-components";
|
|
598
|
-
import { focusRing as focusRing2 } from "@sproutsocial/seeds-react-mixins";
|
|
599
582
|
import Checkbox2 from "@sproutsocial/seeds-react-checkbox";
|
|
600
|
-
import { jsx as
|
|
601
|
-
var
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
var ComboboxList = styled6(Combobox.List)`
|
|
771
|
-
padding: ${({ theme }) => theme.space[200]};
|
|
772
|
-
|
|
773
|
-
&:empty {
|
|
774
|
-
padding: 0;
|
|
775
|
-
}
|
|
776
|
-
`;
|
|
777
|
-
var ComboboxStatus = styled6(Combobox.Status)`
|
|
778
|
-
padding: ${({ theme }) => `${theme.space[300]} ${theme.space[350]}`};
|
|
779
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
780
|
-
color: ${({ theme }) => theme.colors.text.subtext};
|
|
781
|
-
|
|
782
|
-
&:empty {
|
|
783
|
-
padding: 0;
|
|
784
|
-
}
|
|
785
|
-
`;
|
|
786
|
-
var ComboboxEmpty = styled6(Combobox.Empty)`
|
|
787
|
-
padding: ${({ theme }) => `${theme.space[300]} ${theme.space[350]}`};
|
|
788
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
789
|
-
color: ${({ theme }) => theme.colors.text.subtext};
|
|
790
|
-
|
|
791
|
-
&:empty {
|
|
792
|
-
padding: 0;
|
|
793
|
-
}
|
|
794
|
-
`;
|
|
795
|
-
var ComboboxItem = styled6(Combobox.Item)`
|
|
796
|
-
display: flex;
|
|
797
|
-
align-items: center;
|
|
798
|
-
gap: ${({ theme }) => theme.space[300]};
|
|
799
|
-
padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]}`};
|
|
800
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
801
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
802
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
803
|
-
cursor: default;
|
|
804
|
-
outline: none;
|
|
805
|
-
|
|
806
|
-
&[data-highlighted] {
|
|
807
|
-
background: ${({ theme }) => theme.colors.listItem.background.hover};
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
&[data-selected] {
|
|
811
|
-
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
&[data-disabled] {
|
|
815
|
-
opacity: 0.5;
|
|
816
|
-
cursor: not-allowed;
|
|
817
|
-
}
|
|
818
|
-
`;
|
|
819
|
-
var ComboboxItemIndicator = styled6(Combobox.ItemIndicator)`
|
|
820
|
-
display: flex;
|
|
821
|
-
align-items: center;
|
|
822
|
-
width: ${({ theme }) => theme.space[400]};
|
|
823
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
824
|
-
visibility: hidden;
|
|
825
|
-
|
|
826
|
-
&[data-selected] {
|
|
827
|
-
visibility: visible;
|
|
828
|
-
}
|
|
829
|
-
`;
|
|
830
|
-
var ComboboxGroup = styled6(Combobox.Group)`
|
|
831
|
-
display: block;
|
|
832
|
-
`;
|
|
833
|
-
var ComboboxGroupLabel = styled6(Combobox.GroupLabel)`
|
|
834
|
-
padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]} ${theme.space[200]}`};
|
|
835
|
-
font-size: ${({ theme }) => theme.typography[100].fontSize};
|
|
836
|
-
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
837
|
-
text-transform: uppercase;
|
|
838
|
-
letter-spacing: 0.05em;
|
|
839
|
-
color: ${({ theme }) => theme.colors.text.subtext};
|
|
840
|
-
`;
|
|
841
|
-
var ComboboxSeparator = styled6.div`
|
|
842
|
-
height: 1px;
|
|
843
|
-
margin: ${({ theme }) => `${theme.space[200]} ${theme.space[300]}`};
|
|
844
|
-
background: ${({ theme }) => theme.colors.container.border.base};
|
|
845
|
-
`;
|
|
846
|
-
var ComboboxGroupHeaderItem = styled6(Combobox.Item)`
|
|
847
|
-
display: flex;
|
|
848
|
-
align-items: center;
|
|
849
|
-
gap: ${({ theme }) => theme.space[300]};
|
|
850
|
-
padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]}`};
|
|
851
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
852
|
-
font-size: ${({ theme }) => theme.typography[100].fontSize};
|
|
853
|
-
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
854
|
-
text-transform: uppercase;
|
|
855
|
-
letter-spacing: 0.05em;
|
|
856
|
-
color: ${({ theme }) => theme.colors.text.subtext};
|
|
857
|
-
cursor: default;
|
|
858
|
-
outline: none;
|
|
859
|
-
|
|
860
|
-
&[data-highlighted] {
|
|
861
|
-
background: ${({ theme }) => theme.colors.listItem.background.hover};
|
|
862
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
&[data-disabled] {
|
|
866
|
-
opacity: 0.4;
|
|
867
|
-
cursor: not-allowed;
|
|
868
|
-
pointer-events: none;
|
|
869
|
-
}
|
|
870
|
-
`;
|
|
871
|
-
var ComboboxSelectAllItem = styled6(Combobox.Item)`
|
|
872
|
-
display: flex;
|
|
873
|
-
align-items: center;
|
|
874
|
-
gap: ${({ theme }) => theme.space[300]};
|
|
875
|
-
padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]}`};
|
|
876
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
877
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
878
|
-
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
879
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
880
|
-
cursor: default;
|
|
881
|
-
outline: none;
|
|
882
|
-
border-bottom: 1px solid ${({ theme }) => theme.colors.container.border.base};
|
|
883
|
-
margin-bottom: ${({ theme }) => theme.space[200]};
|
|
884
|
-
|
|
885
|
-
&[data-highlighted] {
|
|
886
|
-
background: ${({ theme }) => theme.colors.listItem.background.hover};
|
|
887
|
-
}
|
|
888
|
-
`;
|
|
583
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
584
|
+
var ComboboxLabel = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6("label", { ref, className: cn("seeds-menu-label", className), ...rest }));
|
|
585
|
+
ComboboxLabel.displayName = "ComboboxLabel";
|
|
586
|
+
var ComboboxInputGroup = React8.forwardRef(({ $isInvalid, className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
587
|
+
Combobox.InputGroup,
|
|
588
|
+
{
|
|
589
|
+
ref,
|
|
590
|
+
className: cn(
|
|
591
|
+
"seeds-combobox-input-group",
|
|
592
|
+
{ "seeds-combobox-input-group--invalid": !!$isInvalid },
|
|
593
|
+
className
|
|
594
|
+
),
|
|
595
|
+
...rest
|
|
596
|
+
}
|
|
597
|
+
));
|
|
598
|
+
ComboboxInputGroup.displayName = "ComboboxInputGroup";
|
|
599
|
+
var ComboboxInput = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
600
|
+
Combobox.Input,
|
|
601
|
+
{
|
|
602
|
+
ref,
|
|
603
|
+
className: cn("seeds-combobox-input", className),
|
|
604
|
+
...rest
|
|
605
|
+
}
|
|
606
|
+
));
|
|
607
|
+
ComboboxInput.displayName = "ComboboxInput";
|
|
608
|
+
var ComboboxTokenInput = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
609
|
+
Combobox.Input,
|
|
610
|
+
{
|
|
611
|
+
ref,
|
|
612
|
+
className: cn("seeds-combobox-token-input", className),
|
|
613
|
+
...rest
|
|
614
|
+
}
|
|
615
|
+
));
|
|
616
|
+
ComboboxTokenInput.displayName = "ComboboxTokenInput";
|
|
617
|
+
var ComboboxActionButtons = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
618
|
+
"div",
|
|
619
|
+
{
|
|
620
|
+
ref,
|
|
621
|
+
className: cn("seeds-combobox-action-buttons", className),
|
|
622
|
+
...rest
|
|
623
|
+
}
|
|
624
|
+
));
|
|
625
|
+
ComboboxActionButtons.displayName = "ComboboxActionButtons";
|
|
626
|
+
var ComboboxClear = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
627
|
+
Combobox.Clear,
|
|
628
|
+
{
|
|
629
|
+
ref,
|
|
630
|
+
tabIndex: 0,
|
|
631
|
+
className: cn("seeds-combobox-clear", className),
|
|
632
|
+
...rest
|
|
633
|
+
}
|
|
634
|
+
));
|
|
635
|
+
ComboboxClear.displayName = "ComboboxClear";
|
|
636
|
+
var ComboboxTrigger = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
637
|
+
Combobox.Trigger,
|
|
638
|
+
{
|
|
639
|
+
ref,
|
|
640
|
+
className: cn("seeds-combobox-trigger", className),
|
|
641
|
+
...rest
|
|
642
|
+
}
|
|
643
|
+
));
|
|
644
|
+
ComboboxTrigger.displayName = "ComboboxTrigger";
|
|
645
|
+
var ComboboxPositioner = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
646
|
+
Combobox.Positioner,
|
|
647
|
+
{
|
|
648
|
+
ref,
|
|
649
|
+
className: cn("seeds-combobox-positioner", className),
|
|
650
|
+
...rest
|
|
651
|
+
}
|
|
652
|
+
));
|
|
653
|
+
ComboboxPositioner.displayName = "ComboboxPositioner";
|
|
654
|
+
var ComboboxPopup = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
655
|
+
Combobox.Popup,
|
|
656
|
+
{
|
|
657
|
+
ref,
|
|
658
|
+
className: cn("seeds-combobox-popup", className),
|
|
659
|
+
...rest
|
|
660
|
+
}
|
|
661
|
+
));
|
|
662
|
+
ComboboxPopup.displayName = "ComboboxPopup";
|
|
663
|
+
var ComboboxList = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
664
|
+
Combobox.List,
|
|
665
|
+
{
|
|
666
|
+
ref,
|
|
667
|
+
className: cn("seeds-combobox-list", className),
|
|
668
|
+
...rest
|
|
669
|
+
}
|
|
670
|
+
));
|
|
671
|
+
ComboboxList.displayName = "ComboboxList";
|
|
672
|
+
var ComboboxStatus = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
673
|
+
Combobox.Status,
|
|
674
|
+
{
|
|
675
|
+
ref,
|
|
676
|
+
className: cn("seeds-combobox-status", className),
|
|
677
|
+
...rest
|
|
678
|
+
}
|
|
679
|
+
));
|
|
680
|
+
ComboboxStatus.displayName = "ComboboxStatus";
|
|
681
|
+
var ComboboxEmpty = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
682
|
+
Combobox.Empty,
|
|
683
|
+
{
|
|
684
|
+
ref,
|
|
685
|
+
className: cn("seeds-combobox-empty", className),
|
|
686
|
+
...rest
|
|
687
|
+
}
|
|
688
|
+
));
|
|
689
|
+
ComboboxEmpty.displayName = "ComboboxEmpty";
|
|
690
|
+
var ComboboxItem = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
691
|
+
Combobox.Item,
|
|
692
|
+
{
|
|
693
|
+
ref,
|
|
694
|
+
className: cn("seeds-combobox-item", className),
|
|
695
|
+
...rest
|
|
696
|
+
}
|
|
697
|
+
));
|
|
698
|
+
ComboboxItem.displayName = "ComboboxItem";
|
|
699
|
+
var ComboboxItemIndicator = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
700
|
+
Combobox.ItemIndicator,
|
|
701
|
+
{
|
|
702
|
+
ref,
|
|
703
|
+
className: cn("seeds-combobox-item-indicator", className),
|
|
704
|
+
...rest
|
|
705
|
+
}
|
|
706
|
+
));
|
|
707
|
+
ComboboxItemIndicator.displayName = "ComboboxItemIndicator";
|
|
708
|
+
var ComboboxGroup = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
709
|
+
Combobox.Group,
|
|
710
|
+
{
|
|
711
|
+
ref,
|
|
712
|
+
className: cn("seeds-combobox-group", className),
|
|
713
|
+
...rest
|
|
714
|
+
}
|
|
715
|
+
));
|
|
716
|
+
ComboboxGroup.displayName = "ComboboxGroup";
|
|
717
|
+
var ComboboxGroupLabel = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
718
|
+
Combobox.GroupLabel,
|
|
719
|
+
{
|
|
720
|
+
ref,
|
|
721
|
+
className: cn("seeds-combobox-group-label", className),
|
|
722
|
+
...rest
|
|
723
|
+
}
|
|
724
|
+
));
|
|
725
|
+
ComboboxGroupLabel.displayName = "ComboboxGroupLabel";
|
|
726
|
+
var ComboboxSeparator = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
727
|
+
"div",
|
|
728
|
+
{
|
|
729
|
+
ref,
|
|
730
|
+
className: cn("seeds-combobox-separator", className),
|
|
731
|
+
...rest
|
|
732
|
+
}
|
|
733
|
+
));
|
|
734
|
+
ComboboxSeparator.displayName = "ComboboxSeparator";
|
|
735
|
+
var ComboboxGroupHeaderItem = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
736
|
+
Combobox.Item,
|
|
737
|
+
{
|
|
738
|
+
ref,
|
|
739
|
+
className: cn("seeds-combobox-group-header-item", className),
|
|
740
|
+
...rest
|
|
741
|
+
}
|
|
742
|
+
));
|
|
743
|
+
ComboboxGroupHeaderItem.displayName = "ComboboxGroupHeaderItem";
|
|
744
|
+
var ComboboxSelectAllItem = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
745
|
+
Combobox.Item,
|
|
746
|
+
{
|
|
747
|
+
ref,
|
|
748
|
+
className: cn("seeds-combobox-select-all-item", className),
|
|
749
|
+
...rest
|
|
750
|
+
}
|
|
751
|
+
));
|
|
752
|
+
ComboboxSelectAllItem.displayName = "ComboboxSelectAllItem";
|
|
889
753
|
function ComboboxGroupHeaderCheckbox({
|
|
890
754
|
$state,
|
|
891
755
|
id
|
|
892
756
|
}) {
|
|
893
|
-
return /* @__PURE__ */
|
|
757
|
+
return /* @__PURE__ */ jsx6(
|
|
894
758
|
Checkbox2,
|
|
895
759
|
{
|
|
896
760
|
id,
|
|
@@ -902,196 +766,114 @@ function ComboboxGroupHeaderCheckbox({
|
|
|
902
766
|
}
|
|
903
767
|
);
|
|
904
768
|
}
|
|
905
|
-
var ComboboxToken =
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
&:focus-visible {
|
|
970
|
-
${focusRing2}
|
|
971
|
-
}
|
|
972
|
-
`;
|
|
973
|
-
var SearchableSelectTrigger = styled6(Combobox.Trigger)`
|
|
974
|
-
display: flex;
|
|
975
|
-
align-items: center;
|
|
976
|
-
justify-content: space-between;
|
|
977
|
-
gap: ${({ theme }) => theme.space[300]};
|
|
978
|
-
padding: ${({ theme }) => theme.space[200]} ${({ theme }) => theme.space[350]};
|
|
979
|
-
min-width: 160px;
|
|
980
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
981
|
-
border: 1px solid ${({ theme }) => theme.colors.form.border.base};
|
|
982
|
-
background: ${({ theme }) => theme.colors.form.background.base};
|
|
983
|
-
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
984
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
985
|
-
cursor: default;
|
|
986
|
-
outline: none;
|
|
987
|
-
user-select: none;
|
|
988
|
-
transition: border-color ${({ theme }) => theme.duration.fast}
|
|
989
|
-
${({ theme }) => theme.easing.ease_in},
|
|
990
|
-
box-shadow ${({ theme }) => theme.duration.fast}
|
|
991
|
-
${({ theme }) => theme.easing.ease_in};
|
|
992
|
-
|
|
993
|
-
&:focus-visible {
|
|
994
|
-
${focusRing2}
|
|
995
|
-
}
|
|
996
|
-
|
|
997
|
-
&[data-popup-open] [data-chevron] {
|
|
998
|
-
transform: rotate(-180deg);
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
&[data-disabled] {
|
|
1002
|
-
opacity: 0.4;
|
|
1003
|
-
cursor: not-allowed;
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
${({ $isInvalid }) => $isInvalid && invalidStyles2}
|
|
1007
|
-
`;
|
|
1008
|
-
var SearchableSelectTriggerIcon = styled6(Combobox.Icon)`
|
|
1009
|
-
display: flex;
|
|
1010
|
-
align-items: center;
|
|
1011
|
-
color: ${({ theme }) => theme.colors.icon.base};
|
|
1012
|
-
flex-shrink: 0;
|
|
1013
|
-
`;
|
|
1014
|
-
var SearchableSelectPlaceholder = styled6.span`
|
|
1015
|
-
color: ${({ theme }) => theme.colors.text.subtext};
|
|
1016
|
-
padding: ${({ theme }) => theme.space[200]} 0;
|
|
1017
|
-
`;
|
|
769
|
+
var ComboboxToken = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
770
|
+
Combobox.Chips,
|
|
771
|
+
{
|
|
772
|
+
ref,
|
|
773
|
+
className: cn("seeds-combobox-tokens", className),
|
|
774
|
+
...rest
|
|
775
|
+
}
|
|
776
|
+
));
|
|
777
|
+
ComboboxToken.displayName = "ComboboxToken";
|
|
778
|
+
var ComboboxTokenInputGroup = React8.forwardRef(({ $isInvalid, className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
779
|
+
Combobox.InputGroup,
|
|
780
|
+
{
|
|
781
|
+
ref,
|
|
782
|
+
className: cn(
|
|
783
|
+
"seeds-combobox-token-input-group",
|
|
784
|
+
{ "seeds-combobox-token-input-group--invalid": !!$isInvalid },
|
|
785
|
+
className
|
|
786
|
+
),
|
|
787
|
+
...rest
|
|
788
|
+
}
|
|
789
|
+
));
|
|
790
|
+
ComboboxTokenInputGroup.displayName = "ComboboxTokenInputGroup";
|
|
791
|
+
var Token = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6("span", { ref, className: cn("seeds-combobox-token", className), ...rest }));
|
|
792
|
+
Token.displayName = "Token";
|
|
793
|
+
var TokenRemove = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
794
|
+
"button",
|
|
795
|
+
{
|
|
796
|
+
ref,
|
|
797
|
+
className: cn("seeds-combobox-token-remove", className),
|
|
798
|
+
...rest
|
|
799
|
+
}
|
|
800
|
+
));
|
|
801
|
+
TokenRemove.displayName = "TokenRemove";
|
|
802
|
+
var SearchableSelectTrigger = React8.forwardRef(({ $isInvalid, className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
803
|
+
Combobox.Trigger,
|
|
804
|
+
{
|
|
805
|
+
ref,
|
|
806
|
+
className: cn(
|
|
807
|
+
"seeds-searchable-select-trigger",
|
|
808
|
+
{ "seeds-searchable-select-trigger--invalid": !!$isInvalid },
|
|
809
|
+
className
|
|
810
|
+
),
|
|
811
|
+
...rest
|
|
812
|
+
}
|
|
813
|
+
));
|
|
814
|
+
SearchableSelectTrigger.displayName = "SearchableSelectTrigger";
|
|
815
|
+
var SearchableSelectTriggerIcon = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
816
|
+
Combobox.Icon,
|
|
817
|
+
{
|
|
818
|
+
ref,
|
|
819
|
+
className: cn("seeds-searchable-select-trigger-icon", className),
|
|
820
|
+
...rest
|
|
821
|
+
}
|
|
822
|
+
));
|
|
823
|
+
SearchableSelectTriggerIcon.displayName = "SearchableSelectTriggerIcon";
|
|
824
|
+
var SearchableSelectPlaceholder = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
825
|
+
"span",
|
|
826
|
+
{
|
|
827
|
+
ref,
|
|
828
|
+
className: cn("seeds-searchable-select-placeholder", className),
|
|
829
|
+
...rest
|
|
830
|
+
}
|
|
831
|
+
));
|
|
832
|
+
SearchableSelectPlaceholder.displayName = "SearchableSelectPlaceholder";
|
|
1018
833
|
var SearchableSelectPopup = ComboboxPopup;
|
|
1019
|
-
var SearchableSelectSearchContainer =
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
flex-wrap: wrap;
|
|
1057
|
-
min-width: 160px;
|
|
1058
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
1059
|
-
border: 1px solid ${({ theme }) => theme.colors.form.border.base};
|
|
1060
|
-
background: ${({ theme }) => theme.colors.form.background.base};
|
|
1061
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
1062
|
-
padding: ${({ theme }) => theme.space[200]} ${({ theme }) => theme.space[300]};
|
|
1063
|
-
gap: ${({ theme }) => theme.space[200]};
|
|
1064
|
-
cursor: default;
|
|
1065
|
-
text-align: left;
|
|
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
|
-
${focusRing2}
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
|
-
&[data-popup-open] {
|
|
1078
|
-
border-color: ${({ theme }) => theme.colors.blue[600]};
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
&[data-popup-open] [data-chevron] {
|
|
1082
|
-
transform: rotate(-180deg);
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
&[data-disabled] {
|
|
1086
|
-
opacity: 0.4;
|
|
1087
|
-
cursor: not-allowed;
|
|
834
|
+
var SearchableSelectSearchContainer = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
835
|
+
"div",
|
|
836
|
+
{
|
|
837
|
+
ref,
|
|
838
|
+
className: cn("seeds-searchable-select-search-container", className),
|
|
839
|
+
...rest
|
|
840
|
+
}
|
|
841
|
+
));
|
|
842
|
+
SearchableSelectSearchContainer.displayName = "SearchableSelectSearchContainer";
|
|
843
|
+
var SearchableSelectInput = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
844
|
+
Combobox.Input,
|
|
845
|
+
{
|
|
846
|
+
ref,
|
|
847
|
+
className: cn("seeds-searchable-select-input", className),
|
|
848
|
+
...rest
|
|
849
|
+
}
|
|
850
|
+
));
|
|
851
|
+
SearchableSelectInput.displayName = "SearchableSelectInput";
|
|
852
|
+
var SearchableSelectList = React8.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
853
|
+
Combobox.List,
|
|
854
|
+
{
|
|
855
|
+
ref,
|
|
856
|
+
className: cn("seeds-searchable-select-list", className),
|
|
857
|
+
...rest
|
|
858
|
+
}
|
|
859
|
+
));
|
|
860
|
+
SearchableSelectList.displayName = "SearchableSelectList";
|
|
861
|
+
var SearchableSelectTokenTrigger = React8.forwardRef(({ $isInvalid, className, ...rest }, ref) => /* @__PURE__ */ jsx6(
|
|
862
|
+
Combobox.Trigger,
|
|
863
|
+
{
|
|
864
|
+
ref,
|
|
865
|
+
className: cn(
|
|
866
|
+
"seeds-searchable-select-token-trigger",
|
|
867
|
+
{ "seeds-searchable-select-token-trigger--invalid": !!$isInvalid },
|
|
868
|
+
className
|
|
869
|
+
),
|
|
870
|
+
...rest
|
|
1088
871
|
}
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
`;
|
|
872
|
+
));
|
|
873
|
+
SearchableSelectTokenTrigger.displayName = "SearchableSelectTokenTrigger";
|
|
1092
874
|
|
|
1093
875
|
// src/v3/Common/ComboboxItem.tsx
|
|
1094
|
-
import { jsx as
|
|
876
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1095
877
|
function ComboboxItemInner({
|
|
1096
878
|
value,
|
|
1097
879
|
itemId,
|
|
@@ -1114,11 +896,11 @@ function ComboboxItemInner({
|
|
|
1114
896
|
disabled,
|
|
1115
897
|
"data-qa-menu-item": label,
|
|
1116
898
|
children: [
|
|
1117
|
-
inputType === "radio" ? /* @__PURE__ */
|
|
899
|
+
inputType === "radio" ? /* @__PURE__ */ jsx7(
|
|
1118
900
|
ComboboxItemIndicator,
|
|
1119
901
|
{
|
|
1120
902
|
keepMounted: true,
|
|
1121
|
-
render: (_props, state) => /* @__PURE__ */
|
|
903
|
+
render: (_props, state) => /* @__PURE__ */ jsx7(
|
|
1122
904
|
Radio2,
|
|
1123
905
|
{
|
|
1124
906
|
checked: state.selected,
|
|
@@ -1130,11 +912,11 @@ function ComboboxItemInner({
|
|
|
1130
912
|
}
|
|
1131
913
|
)
|
|
1132
914
|
}
|
|
1133
|
-
) : inputType === "checkbox" ? /* @__PURE__ */
|
|
915
|
+
) : inputType === "checkbox" ? /* @__PURE__ */ jsx7(
|
|
1134
916
|
ComboboxItemIndicator,
|
|
1135
917
|
{
|
|
1136
918
|
keepMounted: true,
|
|
1137
|
-
render: (_props, state) => /* @__PURE__ */
|
|
919
|
+
render: (_props, state) => /* @__PURE__ */ jsx7(
|
|
1138
920
|
Checkbox3,
|
|
1139
921
|
{
|
|
1140
922
|
checked: state.selected,
|
|
@@ -1146,17 +928,17 @@ function ComboboxItemInner({
|
|
|
1146
928
|
}
|
|
1147
929
|
)
|
|
1148
930
|
}
|
|
1149
|
-
) : inputType === "icon" ? /* @__PURE__ */
|
|
1150
|
-
/* @__PURE__ */
|
|
931
|
+
) : inputType === "icon" ? /* @__PURE__ */ jsx7(ComboboxItemIndicator, { keepMounted: true, children: /* @__PURE__ */ jsx7(CheckIcon2, {}) }) : null,
|
|
932
|
+
/* @__PURE__ */ jsx7("span", { children: renderItem ? renderItem() : label })
|
|
1151
933
|
]
|
|
1152
934
|
}
|
|
1153
935
|
);
|
|
1154
936
|
}
|
|
1155
|
-
var ComboboxItem2 =
|
|
937
|
+
var ComboboxItem2 = React9.forwardRef(ComboboxItemInner);
|
|
1156
938
|
var ComboboxItem_default = ComboboxItem2;
|
|
1157
939
|
|
|
1158
940
|
// src/v3/Common/VirtualizedComboboxList.tsx
|
|
1159
|
-
import * as
|
|
941
|
+
import * as React10 from "react";
|
|
1160
942
|
import { Combobox as Combobox2 } from "@base-ui/react/combobox";
|
|
1161
943
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
1162
944
|
|
|
@@ -1175,7 +957,7 @@ function isCreatableSentinel(v) {
|
|
|
1175
957
|
}
|
|
1176
958
|
|
|
1177
959
|
// src/v3/Common/VirtualizedComboboxList.tsx
|
|
1178
|
-
import { jsx as
|
|
960
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1179
961
|
var ITEM_HEIGHT = 32;
|
|
1180
962
|
function isGroupHeaderSentinel(v) {
|
|
1181
963
|
return typeof v === "object" && v !== null && "__groupHeader" in v;
|
|
@@ -1197,7 +979,7 @@ function VirtualizedComboboxList({
|
|
|
1197
979
|
renderCreatableItem
|
|
1198
980
|
}) {
|
|
1199
981
|
const filteredItems = Combobox2.useFilteredItems();
|
|
1200
|
-
const scrollElementRef =
|
|
982
|
+
const scrollElementRef = React10.useRef(null);
|
|
1201
983
|
const virtualizer = useVirtualizer({
|
|
1202
984
|
enabled: open,
|
|
1203
985
|
count: filteredItems.length,
|
|
@@ -1209,8 +991,8 @@ function VirtualizedComboboxList({
|
|
|
1209
991
|
scrollPaddingStart: 4,
|
|
1210
992
|
scrollPaddingEnd: 4
|
|
1211
993
|
});
|
|
1212
|
-
|
|
1213
|
-
const handleScrollRef =
|
|
994
|
+
React10.useImperativeHandle(virtualizerRef, () => virtualizer);
|
|
995
|
+
const handleScrollRef = React10.useCallback(
|
|
1214
996
|
(el) => {
|
|
1215
997
|
scrollElementRef.current = el;
|
|
1216
998
|
if (el) requestAnimationFrame(() => virtualizer.measure());
|
|
@@ -1220,7 +1002,7 @@ function VirtualizedComboboxList({
|
|
|
1220
1002
|
if (!filteredItems.length) return null;
|
|
1221
1003
|
const selectedArray = Array.isArray(value) ? value : value != null ? [value] : [];
|
|
1222
1004
|
const totalSize = virtualizer.getTotalSize();
|
|
1223
|
-
return /* @__PURE__ */
|
|
1005
|
+
return /* @__PURE__ */ jsx8(
|
|
1224
1006
|
"div",
|
|
1225
1007
|
{
|
|
1226
1008
|
role: "presentation",
|
|
@@ -1231,7 +1013,7 @@ function VirtualizedComboboxList({
|
|
|
1231
1013
|
overflowY: "auto",
|
|
1232
1014
|
overscrollBehavior: "contain"
|
|
1233
1015
|
},
|
|
1234
|
-
children: /* @__PURE__ */
|
|
1016
|
+
children: /* @__PURE__ */ jsx8(
|
|
1235
1017
|
"div",
|
|
1236
1018
|
{
|
|
1237
1019
|
role: "presentation",
|
|
@@ -1248,7 +1030,7 @@ function VirtualizedComboboxList({
|
|
|
1248
1030
|
boxSizing: "border-box"
|
|
1249
1031
|
};
|
|
1250
1032
|
if (isPlaceholderSentinel(row)) {
|
|
1251
|
-
return /* @__PURE__ */
|
|
1033
|
+
return /* @__PURE__ */ jsx8(
|
|
1252
1034
|
ComboboxItem_default,
|
|
1253
1035
|
{
|
|
1254
1036
|
index: virtualItem.index,
|
|
@@ -1276,7 +1058,7 @@ function VirtualizedComboboxList({
|
|
|
1276
1058
|
style: baseStyle,
|
|
1277
1059
|
ref: virtualizer.measureElement,
|
|
1278
1060
|
children: [
|
|
1279
|
-
/* @__PURE__ */
|
|
1061
|
+
/* @__PURE__ */ jsx8(ComboboxGroupHeaderCheckbox, { $state: state, id: "__selectAll" }),
|
|
1280
1062
|
"Select all"
|
|
1281
1063
|
]
|
|
1282
1064
|
},
|
|
@@ -1300,7 +1082,7 @@ function VirtualizedComboboxList({
|
|
|
1300
1082
|
style: baseStyle,
|
|
1301
1083
|
ref: virtualizer.measureElement,
|
|
1302
1084
|
children: [
|
|
1303
|
-
/* @__PURE__ */
|
|
1085
|
+
/* @__PURE__ */ jsx8(
|
|
1304
1086
|
ComboboxGroupHeaderCheckbox,
|
|
1305
1087
|
{
|
|
1306
1088
|
$state: state,
|
|
@@ -1325,7 +1107,7 @@ function VirtualizedComboboxList({
|
|
|
1325
1107
|
return null;
|
|
1326
1108
|
}
|
|
1327
1109
|
const item = row;
|
|
1328
|
-
return /* @__PURE__ */
|
|
1110
|
+
return /* @__PURE__ */ jsx8(
|
|
1329
1111
|
ComboboxItem_default,
|
|
1330
1112
|
{
|
|
1331
1113
|
index: virtualItem.index,
|
|
@@ -1349,7 +1131,7 @@ function VirtualizedComboboxList({
|
|
|
1349
1131
|
}
|
|
1350
1132
|
|
|
1351
1133
|
// src/v3/SingleCombobox.tsx
|
|
1352
|
-
import { jsx as
|
|
1134
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1353
1135
|
function SingleCombobox(props) {
|
|
1354
1136
|
const {
|
|
1355
1137
|
id,
|
|
@@ -1359,6 +1141,8 @@ function SingleCombobox(props) {
|
|
|
1359
1141
|
fullWidth = true
|
|
1360
1142
|
} = props;
|
|
1361
1143
|
const ariaDescribedBy = props["aria-describedby"];
|
|
1144
|
+
const ariaLabel = props["aria-label"];
|
|
1145
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
1362
1146
|
const isInvalid = props.isInvalid;
|
|
1363
1147
|
const isChildrenMode = "children" in props && props.children != null;
|
|
1364
1148
|
const data = isChildrenMode ? [] : props.data;
|
|
@@ -1373,18 +1157,18 @@ function SingleCombobox(props) {
|
|
|
1373
1157
|
const defaultSelectedItemId = props.defaultSelectedItemId;
|
|
1374
1158
|
const onSelectedItemIdChange = props.onSelectedItemIdChange;
|
|
1375
1159
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
1376
|
-
const [open, setOpen] =
|
|
1377
|
-
const virtualizerRef =
|
|
1160
|
+
const [open, setOpen] = React11.useState(false);
|
|
1161
|
+
const virtualizerRef = React11.useRef(null);
|
|
1378
1162
|
const onInputKeyDownCapture = useSuppressEscapeClear(open);
|
|
1379
1163
|
const isControlled = selectedItemId !== void 0;
|
|
1380
|
-
const idToItem =
|
|
1164
|
+
const idToItem = React11.useCallback(
|
|
1381
1165
|
(id2) => {
|
|
1382
1166
|
if (id2 == null) return null;
|
|
1383
1167
|
return data.find((d) => String(d.id) === String(id2)) ?? null;
|
|
1384
1168
|
},
|
|
1385
1169
|
[data]
|
|
1386
1170
|
);
|
|
1387
|
-
const [internalValue, setInternalValue] =
|
|
1171
|
+
const [internalValue, setInternalValue] = React11.useState(
|
|
1388
1172
|
() => idToItem(defaultSelectedItemId)
|
|
1389
1173
|
);
|
|
1390
1174
|
const value = isControlled ? idToItem(selectedItemId) : internalValue;
|
|
@@ -1396,12 +1180,12 @@ function SingleCombobox(props) {
|
|
|
1396
1180
|
onSelectedItemIdChange(newItem ? newItem.id : null);
|
|
1397
1181
|
}
|
|
1398
1182
|
}
|
|
1399
|
-
const groups =
|
|
1183
|
+
const groups = React11.useMemo(
|
|
1400
1184
|
() => groupBy ? groupItems(data, groupBy) : null,
|
|
1401
1185
|
[data, groupBy]
|
|
1402
1186
|
);
|
|
1403
1187
|
return /* @__PURE__ */ jsxs6(Field, { $fullWidth: fullWidth, children: [
|
|
1404
|
-
/* @__PURE__ */
|
|
1188
|
+
/* @__PURE__ */ jsx9("div", { ref: containerRef, style: { position: "relative" } }),
|
|
1405
1189
|
/* @__PURE__ */ jsxs6(
|
|
1406
1190
|
Combobox3.Root,
|
|
1407
1191
|
{
|
|
@@ -1436,7 +1220,7 @@ function SingleCombobox(props) {
|
|
|
1436
1220
|
$isInvalid: isInvalid,
|
|
1437
1221
|
onKeyDownCapture: onInputKeyDownCapture,
|
|
1438
1222
|
children: [
|
|
1439
|
-
/* @__PURE__ */
|
|
1223
|
+
/* @__PURE__ */ jsx9(
|
|
1440
1224
|
ComboboxInput,
|
|
1441
1225
|
{
|
|
1442
1226
|
placeholder,
|
|
@@ -1447,21 +1231,23 @@ function SingleCombobox(props) {
|
|
|
1447
1231
|
}
|
|
1448
1232
|
),
|
|
1449
1233
|
/* @__PURE__ */ jsxs6(ComboboxActionButtons, { children: [
|
|
1450
|
-
/* @__PURE__ */
|
|
1451
|
-
/* @__PURE__ */
|
|
1234
|
+
/* @__PURE__ */ jsx9(ComboboxClear, { "aria-label": "Clear selection", children: /* @__PURE__ */ jsx9(ClearIcon, {}) }),
|
|
1235
|
+
/* @__PURE__ */ jsx9(ComboboxTrigger, { "aria-label": "Open popup", children: /* @__PURE__ */ jsx9(StyledChevron, { $isOpen: open, children: /* @__PURE__ */ jsx9(ChevronIcon, {}) }) })
|
|
1452
1236
|
] })
|
|
1453
1237
|
]
|
|
1454
1238
|
}
|
|
1455
1239
|
),
|
|
1456
|
-
/* @__PURE__ */
|
|
1240
|
+
/* @__PURE__ */ jsx9(Combobox3.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx9(ComboboxPositioner, { sideOffset: 4, children: /* @__PURE__ */ jsxs6(
|
|
1457
1241
|
ComboboxPopup,
|
|
1458
1242
|
{
|
|
1459
1243
|
style: isVirtualized ? { display: "flex", flexDirection: "column" } : void 0,
|
|
1460
1244
|
children: [
|
|
1461
|
-
/* @__PURE__ */
|
|
1462
|
-
/* @__PURE__ */
|
|
1245
|
+
/* @__PURE__ */ jsx9(ComboboxEmpty, { children: emptyText }),
|
|
1246
|
+
/* @__PURE__ */ jsx9(
|
|
1463
1247
|
ComboboxList,
|
|
1464
1248
|
{
|
|
1249
|
+
"aria-label": ariaLabel,
|
|
1250
|
+
"aria-labelledby": ariaLabelledBy,
|
|
1465
1251
|
style: isVirtualized ? {
|
|
1466
1252
|
padding: 0,
|
|
1467
1253
|
flex: 1,
|
|
@@ -1469,7 +1255,7 @@ function SingleCombobox(props) {
|
|
|
1469
1255
|
display: "flex",
|
|
1470
1256
|
flexDirection: "column"
|
|
1471
1257
|
} : void 0,
|
|
1472
|
-
children: isVirtualized ? /* @__PURE__ */
|
|
1258
|
+
children: isVirtualized ? /* @__PURE__ */ jsx9(
|
|
1473
1259
|
VirtualizedComboboxList,
|
|
1474
1260
|
{
|
|
1475
1261
|
open,
|
|
@@ -1482,10 +1268,10 @@ function SingleCombobox(props) {
|
|
|
1482
1268
|
renderItem,
|
|
1483
1269
|
renderGroupHeading
|
|
1484
1270
|
}
|
|
1485
|
-
) : children ? children : groups ? ((group, index) => /* @__PURE__ */ jsxs6(
|
|
1271
|
+
) : children ? children : groups ? ((group, index) => /* @__PURE__ */ jsxs6(React11.Fragment, { children: [
|
|
1486
1272
|
/* @__PURE__ */ jsxs6(ComboboxGroup, { items: group.items, children: [
|
|
1487
|
-
/* @__PURE__ */
|
|
1488
|
-
/* @__PURE__ */
|
|
1273
|
+
/* @__PURE__ */ jsx9(ComboboxGroupLabel, { children: renderGroupHeading ? renderGroupHeading(group.value) : group.value }),
|
|
1274
|
+
/* @__PURE__ */ jsx9(Combobox3.Collection, { children: (item) => /* @__PURE__ */ jsx9(
|
|
1489
1275
|
ComboboxItem_default,
|
|
1490
1276
|
{
|
|
1491
1277
|
value: item,
|
|
@@ -1498,8 +1284,8 @@ function SingleCombobox(props) {
|
|
|
1498
1284
|
item.id
|
|
1499
1285
|
) })
|
|
1500
1286
|
] }),
|
|
1501
|
-
index < groups.length - 1 && /* @__PURE__ */
|
|
1502
|
-
] }, group.value)) : ((item) => /* @__PURE__ */
|
|
1287
|
+
index < groups.length - 1 && /* @__PURE__ */ jsx9(ComboboxSeparator, {})
|
|
1288
|
+
] }, group.value)) : ((item) => /* @__PURE__ */ jsx9(
|
|
1503
1289
|
ComboboxItem_default,
|
|
1504
1290
|
{
|
|
1505
1291
|
value: item,
|
|
@@ -1523,11 +1309,11 @@ function SingleCombobox(props) {
|
|
|
1523
1309
|
}
|
|
1524
1310
|
|
|
1525
1311
|
// src/v3/MultiCombobox.tsx
|
|
1526
|
-
import * as
|
|
1312
|
+
import * as React12 from "react";
|
|
1527
1313
|
import { Combobox as Combobox4 } from "@base-ui/react/combobox";
|
|
1528
1314
|
import "@tanstack/react-virtual";
|
|
1529
1315
|
import Icon3 from "@sproutsocial/seeds-react-icon";
|
|
1530
|
-
import { Fragment as Fragment6, jsx as
|
|
1316
|
+
import { Fragment as Fragment6, jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1531
1317
|
function makeGroupHeaderSentinel(groupName) {
|
|
1532
1318
|
return { __groupHeader: true, groupName };
|
|
1533
1319
|
}
|
|
@@ -1551,6 +1337,8 @@ function MultiCombobox(props) {
|
|
|
1551
1337
|
fullWidth = true
|
|
1552
1338
|
} = props;
|
|
1553
1339
|
const ariaDescribedBy = props["aria-describedby"];
|
|
1340
|
+
const ariaLabel = props["aria-label"];
|
|
1341
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
1554
1342
|
const isInvalid = props.isInvalid;
|
|
1555
1343
|
const isChildrenMode = "children" in props && props.children != null;
|
|
1556
1344
|
const data = isChildrenMode ? [] : props.data;
|
|
@@ -1576,31 +1364,31 @@ function MultiCombobox(props) {
|
|
|
1576
1364
|
const defaultSelectedItemIds = props.defaultSelectedItemIds;
|
|
1577
1365
|
const onSelectedItemIdsChange = props.onSelectedItemIdsChange;
|
|
1578
1366
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
1579
|
-
const [open, setOpen] =
|
|
1580
|
-
const [internalInputValue, setInternalInputValue] =
|
|
1581
|
-
const skipNextInputChangeRef =
|
|
1582
|
-
const virtualizerRef =
|
|
1583
|
-
const inputRef =
|
|
1367
|
+
const [open, setOpen] = React12.useState(false);
|
|
1368
|
+
const [internalInputValue, setInternalInputValue] = React12.useState("");
|
|
1369
|
+
const skipNextInputChangeRef = React12.useRef(false);
|
|
1370
|
+
const virtualizerRef = React12.useRef(null);
|
|
1371
|
+
const inputRef = React12.useRef(null);
|
|
1584
1372
|
const onInputKeyDownCapture = useSuppressEscapeClear(open);
|
|
1585
1373
|
const isControlled = selectedItemIds !== void 0;
|
|
1586
|
-
const idsToItems =
|
|
1374
|
+
const idsToItems = React12.useCallback(
|
|
1587
1375
|
(ids) => ids.map((id2) => data.find((d) => d.id === id2)).filter((d) => d != null),
|
|
1588
1376
|
[data]
|
|
1589
1377
|
);
|
|
1590
|
-
const [internalValue, setInternalValue] =
|
|
1378
|
+
const [internalValue, setInternalValue] = React12.useState(
|
|
1591
1379
|
() => defaultSelectedItemIds ? idsToItems(defaultSelectedItemIds) : []
|
|
1592
1380
|
);
|
|
1593
1381
|
const value = isControlled ? idsToItems(selectedItemIds) : internalValue;
|
|
1594
|
-
const visibleData =
|
|
1382
|
+
const visibleData = React12.useMemo(
|
|
1595
1383
|
() => removeSelectedItems ? data.filter((item) => !value.some((v) => v.id === item.id)) : data,
|
|
1596
1384
|
[data, value, removeSelectedItems]
|
|
1597
1385
|
);
|
|
1598
|
-
const groups =
|
|
1386
|
+
const groups = React12.useMemo(
|
|
1599
1387
|
() => groupBy ? groupItems(visibleData, groupBy) : null,
|
|
1600
1388
|
[visibleData, groupBy]
|
|
1601
1389
|
);
|
|
1602
1390
|
const currentInputValue = inputValue ?? internalInputValue;
|
|
1603
|
-
const creatableSentinel =
|
|
1391
|
+
const creatableSentinel = React12.useMemo(() => {
|
|
1604
1392
|
if (!creatableProp) return null;
|
|
1605
1393
|
const trimmed = currentInputValue.trim();
|
|
1606
1394
|
if (!trimmed) return null;
|
|
@@ -1611,7 +1399,7 @@ function MultiCombobox(props) {
|
|
|
1611
1399
|
if (exactExists) return null;
|
|
1612
1400
|
return makeCreatableSentinel(trimmed);
|
|
1613
1401
|
}, [creatableProp, currentInputValue, data, itemToString]);
|
|
1614
|
-
const flatItems =
|
|
1402
|
+
const flatItems = React12.useMemo(() => {
|
|
1615
1403
|
if (!selectHeadings && !selectAll) return null;
|
|
1616
1404
|
if (!groups && !selectAll) return null;
|
|
1617
1405
|
const rows = [];
|
|
@@ -1706,7 +1494,7 @@ function MultiCombobox(props) {
|
|
|
1706
1494
|
const selectedCount = value.length;
|
|
1707
1495
|
const state = selectedCount === 0 ? "none" : selectedCount === totalCount ? "all" : "partial";
|
|
1708
1496
|
return /* @__PURE__ */ jsxs7(ComboboxSelectAllItem, { value: row, children: [
|
|
1709
|
-
/* @__PURE__ */
|
|
1497
|
+
/* @__PURE__ */ jsx10(ComboboxGroupHeaderCheckbox, { $state: state, id: "__selectAll" }),
|
|
1710
1498
|
selectAllLabel
|
|
1711
1499
|
] }, "__selectAll");
|
|
1712
1500
|
}
|
|
@@ -1723,7 +1511,7 @@ function MultiCombobox(props) {
|
|
|
1723
1511
|
value: row,
|
|
1724
1512
|
disabled: isGroupHeaderDisabled?.(row.groupName),
|
|
1725
1513
|
children: [
|
|
1726
|
-
/* @__PURE__ */
|
|
1514
|
+
/* @__PURE__ */ jsx10(
|
|
1727
1515
|
ComboboxGroupHeaderCheckbox,
|
|
1728
1516
|
{
|
|
1729
1517
|
$state: state,
|
|
@@ -1740,7 +1528,7 @@ function MultiCombobox(props) {
|
|
|
1740
1528
|
return renderCreatableItem(row);
|
|
1741
1529
|
}
|
|
1742
1530
|
const item = row;
|
|
1743
|
-
return /* @__PURE__ */
|
|
1531
|
+
return /* @__PURE__ */ jsx10(
|
|
1744
1532
|
ComboboxItem_default,
|
|
1745
1533
|
{
|
|
1746
1534
|
value: item,
|
|
@@ -1754,7 +1542,7 @@ function MultiCombobox(props) {
|
|
|
1754
1542
|
);
|
|
1755
1543
|
}
|
|
1756
1544
|
function renderCreatableItem(sentinel, style, index, measureRef) {
|
|
1757
|
-
return /* @__PURE__ */
|
|
1545
|
+
return /* @__PURE__ */ jsx10(
|
|
1758
1546
|
ComboboxItem_default,
|
|
1759
1547
|
{
|
|
1760
1548
|
value: sentinel,
|
|
@@ -1762,7 +1550,7 @@ function MultiCombobox(props) {
|
|
|
1762
1550
|
label: `Create "${sentinel.label}"`,
|
|
1763
1551
|
inputType: "none",
|
|
1764
1552
|
renderItem: () => /* @__PURE__ */ jsxs7(Fragment6, { children: [
|
|
1765
|
-
/* @__PURE__ */
|
|
1553
|
+
/* @__PURE__ */ jsx10(Icon3, { name: "plus-outline", size: "mini" }),
|
|
1766
1554
|
`Create "${sentinel.label}"`
|
|
1767
1555
|
] }),
|
|
1768
1556
|
style,
|
|
@@ -1778,7 +1566,7 @@ function MultiCombobox(props) {
|
|
|
1778
1566
|
const hasSentinels = selectAll || selectHeadings;
|
|
1779
1567
|
const rootValue = hasSentinels ? [...value] : value;
|
|
1780
1568
|
return /* @__PURE__ */ jsxs7(Field, { $fullWidth: fullWidth, children: [
|
|
1781
|
-
/* @__PURE__ */
|
|
1569
|
+
/* @__PURE__ */ jsx10("div", { ref: containerRef, style: { position: "relative" } }),
|
|
1782
1570
|
/* @__PURE__ */ jsxs7(
|
|
1783
1571
|
Combobox4.Root,
|
|
1784
1572
|
{
|
|
@@ -1854,7 +1642,7 @@ function MultiCombobox(props) {
|
|
|
1854
1642
|
},
|
|
1855
1643
|
items: rootItems,
|
|
1856
1644
|
children: [
|
|
1857
|
-
/* @__PURE__ */
|
|
1645
|
+
/* @__PURE__ */ jsx10(
|
|
1858
1646
|
ComboboxTokenInputGroup,
|
|
1859
1647
|
{
|
|
1860
1648
|
$isInvalid: isInvalid,
|
|
@@ -1866,13 +1654,13 @@ function MultiCombobox(props) {
|
|
|
1866
1654
|
return /* @__PURE__ */ jsxs7(Fragment6, { children: [
|
|
1867
1655
|
visibleTokens.map((item) => /* @__PURE__ */ jsxs7(Token, { children: [
|
|
1868
1656
|
renderToken ? renderToken(item) : itemToString(item),
|
|
1869
|
-
/* @__PURE__ */
|
|
1657
|
+
/* @__PURE__ */ jsx10(
|
|
1870
1658
|
TokenRemove,
|
|
1871
1659
|
{
|
|
1872
1660
|
"aria-label": `Remove ${itemToString(item)}`,
|
|
1873
1661
|
onPointerDown: (e) => e.preventDefault(),
|
|
1874
1662
|
onClick: (e) => removeItem(item, e),
|
|
1875
|
-
children: /* @__PURE__ */
|
|
1663
|
+
children: /* @__PURE__ */ jsx10(Icon3, { name: "x-outline", size: "mini" })
|
|
1876
1664
|
}
|
|
1877
1665
|
)
|
|
1878
1666
|
] }, item.id)),
|
|
@@ -1882,7 +1670,7 @@ function MultiCombobox(props) {
|
|
|
1882
1670
|
] }, "__overflow")
|
|
1883
1671
|
] });
|
|
1884
1672
|
})(),
|
|
1885
|
-
/* @__PURE__ */
|
|
1673
|
+
/* @__PURE__ */ jsx10(
|
|
1886
1674
|
ComboboxTokenInput,
|
|
1887
1675
|
{
|
|
1888
1676
|
ref: inputRef,
|
|
@@ -1894,23 +1682,25 @@ function MultiCombobox(props) {
|
|
|
1894
1682
|
}
|
|
1895
1683
|
),
|
|
1896
1684
|
/* @__PURE__ */ jsxs7(ComboboxActionButtons, { children: [
|
|
1897
|
-
/* @__PURE__ */
|
|
1898
|
-
/* @__PURE__ */
|
|
1685
|
+
/* @__PURE__ */ jsx10(ComboboxClear, { "aria-label": "Clear all", children: /* @__PURE__ */ jsx10(ClearIcon, {}) }),
|
|
1686
|
+
/* @__PURE__ */ jsx10(ComboboxTrigger, { "aria-label": "Open popup", children: /* @__PURE__ */ jsx10(StyledChevron, { $isOpen: open, children: /* @__PURE__ */ jsx10(ChevronIcon, {}) }) })
|
|
1899
1687
|
] })
|
|
1900
1688
|
] })
|
|
1901
1689
|
}
|
|
1902
1690
|
),
|
|
1903
|
-
/* @__PURE__ */
|
|
1691
|
+
/* @__PURE__ */ jsx10(Combobox4.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx10(ComboboxPositioner, { sideOffset: 4, children: /* @__PURE__ */ jsxs7(
|
|
1904
1692
|
ComboboxPopup,
|
|
1905
1693
|
{
|
|
1906
1694
|
"aria-busy": isLoading || void 0,
|
|
1907
1695
|
style: isVirtualized ? { display: "flex", flexDirection: "column" } : void 0,
|
|
1908
1696
|
children: [
|
|
1909
|
-
/* @__PURE__ */
|
|
1910
|
-
/* @__PURE__ */
|
|
1911
|
-
/* @__PURE__ */
|
|
1697
|
+
/* @__PURE__ */ jsx10(ComboboxStatus, { children: isLoading ? loadingText : null }),
|
|
1698
|
+
/* @__PURE__ */ jsx10(ComboboxEmpty, { children: isLoading ? null : emptyText }),
|
|
1699
|
+
/* @__PURE__ */ jsx10(
|
|
1912
1700
|
ComboboxList,
|
|
1913
1701
|
{
|
|
1702
|
+
"aria-label": ariaLabel,
|
|
1703
|
+
"aria-labelledby": ariaLabelledBy,
|
|
1914
1704
|
style: isVirtualized ? {
|
|
1915
1705
|
padding: 0,
|
|
1916
1706
|
flex: 1,
|
|
@@ -1918,7 +1708,7 @@ function MultiCombobox(props) {
|
|
|
1918
1708
|
display: "flex",
|
|
1919
1709
|
flexDirection: "column"
|
|
1920
1710
|
} : void 0,
|
|
1921
|
-
children: isVirtualized ? /* @__PURE__ */
|
|
1711
|
+
children: isVirtualized ? /* @__PURE__ */ jsx10(
|
|
1922
1712
|
VirtualizedComboboxList,
|
|
1923
1713
|
{
|
|
1924
1714
|
open,
|
|
@@ -1943,10 +1733,10 @@ function MultiCombobox(props) {
|
|
|
1943
1733
|
return renderCreatableItem(group);
|
|
1944
1734
|
}
|
|
1945
1735
|
const g = group;
|
|
1946
|
-
return /* @__PURE__ */ jsxs7(
|
|
1736
|
+
return /* @__PURE__ */ jsxs7(React12.Fragment, { children: [
|
|
1947
1737
|
/* @__PURE__ */ jsxs7(ComboboxGroup, { items: g.items, children: [
|
|
1948
|
-
/* @__PURE__ */
|
|
1949
|
-
/* @__PURE__ */
|
|
1738
|
+
/* @__PURE__ */ jsx10(ComboboxGroupLabel, { children: renderGroupHeading ? renderGroupHeading(g.value) : g.value }),
|
|
1739
|
+
/* @__PURE__ */ jsx10(Combobox4.Collection, { children: (item) => /* @__PURE__ */ jsx10(
|
|
1950
1740
|
ComboboxItem_default,
|
|
1951
1741
|
{
|
|
1952
1742
|
value: item,
|
|
@@ -1959,14 +1749,14 @@ function MultiCombobox(props) {
|
|
|
1959
1749
|
item.id
|
|
1960
1750
|
) })
|
|
1961
1751
|
] }),
|
|
1962
|
-
index < groups.length - 1 && /* @__PURE__ */
|
|
1752
|
+
index < groups.length - 1 && /* @__PURE__ */ jsx10(ComboboxSeparator, {})
|
|
1963
1753
|
] }, g.value);
|
|
1964
1754
|
}) : ((item) => {
|
|
1965
1755
|
if (isCreatableSentinel(item)) {
|
|
1966
1756
|
return renderCreatableItem(item);
|
|
1967
1757
|
}
|
|
1968
1758
|
const dataItem = item;
|
|
1969
|
-
return /* @__PURE__ */
|
|
1759
|
+
return /* @__PURE__ */ jsx10(
|
|
1970
1760
|
ComboboxItem_default,
|
|
1971
1761
|
{
|
|
1972
1762
|
value: dataItem,
|
|
@@ -1991,10 +1781,10 @@ function MultiCombobox(props) {
|
|
|
1991
1781
|
}
|
|
1992
1782
|
|
|
1993
1783
|
// src/v3/SingleSearchableSelect.tsx
|
|
1994
|
-
import * as
|
|
1784
|
+
import * as React13 from "react";
|
|
1995
1785
|
import { Combobox as Combobox5 } from "@base-ui/react/combobox";
|
|
1996
1786
|
import "@tanstack/react-virtual";
|
|
1997
|
-
import { Fragment as Fragment8, jsx as
|
|
1787
|
+
import { Fragment as Fragment8, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1998
1788
|
function SingleSearchableSelect(props) {
|
|
1999
1789
|
const {
|
|
2000
1790
|
id,
|
|
@@ -2008,6 +1798,8 @@ function SingleSearchableSelect(props) {
|
|
|
2008
1798
|
fullWidth = true
|
|
2009
1799
|
} = props;
|
|
2010
1800
|
const ariaDescribedBy = props["aria-describedby"];
|
|
1801
|
+
const ariaLabel = props["aria-label"];
|
|
1802
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
2011
1803
|
const isInvalid = props.isInvalid;
|
|
2012
1804
|
const isChildrenMode = "children" in props && props.children != null;
|
|
2013
1805
|
const data = isChildrenMode ? [] : props.data;
|
|
@@ -2023,17 +1815,17 @@ function SingleSearchableSelect(props) {
|
|
|
2023
1815
|
const defaultSelectedItemId = props.defaultSelectedItemId;
|
|
2024
1816
|
const onSelectedItemIdChange = props.onSelectedItemIdChange;
|
|
2025
1817
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
2026
|
-
const [open, setOpen] =
|
|
2027
|
-
const virtualizerRef =
|
|
1818
|
+
const [open, setOpen] = React13.useState(false);
|
|
1819
|
+
const virtualizerRef = React13.useRef(null);
|
|
2028
1820
|
const isControlled = selectedItemId !== void 0;
|
|
2029
|
-
const idToItem =
|
|
1821
|
+
const idToItem = React13.useCallback(
|
|
2030
1822
|
(id2) => {
|
|
2031
1823
|
if (id2 == null) return null;
|
|
2032
1824
|
return data.find((d) => String(d.id) === String(id2)) ?? null;
|
|
2033
1825
|
},
|
|
2034
1826
|
[data]
|
|
2035
1827
|
);
|
|
2036
|
-
const [internalValue, setInternalValue] =
|
|
1828
|
+
const [internalValue, setInternalValue] = React13.useState(
|
|
2037
1829
|
() => idToItem(defaultSelectedItemId)
|
|
2038
1830
|
);
|
|
2039
1831
|
const value = isControlled ? idToItem(selectedItemId) : internalValue;
|
|
@@ -2044,12 +1836,12 @@ function SingleSearchableSelect(props) {
|
|
|
2044
1836
|
onSelectedItemIdChange(realItem ? realItem.id : null);
|
|
2045
1837
|
}
|
|
2046
1838
|
}
|
|
2047
|
-
const groups =
|
|
1839
|
+
const groups = React13.useMemo(
|
|
2048
1840
|
() => groupBy ? groupItems(data, groupBy) : null,
|
|
2049
1841
|
[data, groupBy]
|
|
2050
1842
|
);
|
|
2051
1843
|
return /* @__PURE__ */ jsxs8(Field, { $fullWidth: fullWidth, children: [
|
|
2052
|
-
/* @__PURE__ */
|
|
1844
|
+
/* @__PURE__ */ jsx11("div", { ref: containerRef, style: { position: "relative" } }),
|
|
2053
1845
|
/* @__PURE__ */ jsxs8(
|
|
2054
1846
|
Combobox5.Root,
|
|
2055
1847
|
{
|
|
@@ -2092,29 +1884,31 @@ function SingleSearchableSelect(props) {
|
|
|
2092
1884
|
"aria-required": props.required || void 0,
|
|
2093
1885
|
$isInvalid: isInvalid,
|
|
2094
1886
|
children: [
|
|
2095
|
-
/* @__PURE__ */
|
|
2096
|
-
/* @__PURE__ */
|
|
1887
|
+
/* @__PURE__ */ jsx11(SearchableSelectPlaceholder, { children: /* @__PURE__ */ jsx11(Combobox5.Value, { placeholder, children: value ? renderSelection ? renderSelection(value) : itemToString(value) : placeholder }) }),
|
|
1888
|
+
/* @__PURE__ */ jsx11(SearchableSelectTriggerIcon, { children: /* @__PURE__ */ jsx11(StyledChevron, { "data-chevron": true, children: /* @__PURE__ */ jsx11(ChevronIcon, {}) }) })
|
|
2097
1889
|
]
|
|
2098
1890
|
}
|
|
2099
1891
|
),
|
|
2100
|
-
/* @__PURE__ */
|
|
1892
|
+
/* @__PURE__ */ jsx11(Combobox5.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx11(ComboboxPositioner, { sideOffset: 4, children: /* @__PURE__ */ jsxs8(
|
|
2101
1893
|
SearchableSelectPopup,
|
|
2102
1894
|
{
|
|
2103
1895
|
"aria-busy": isLoading || void 0,
|
|
2104
1896
|
style: { display: "flex", flexDirection: "column" },
|
|
2105
1897
|
children: [
|
|
2106
|
-
/* @__PURE__ */
|
|
1898
|
+
/* @__PURE__ */ jsx11(SearchableSelectSearchContainer, { children: /* @__PURE__ */ jsx11(
|
|
2107
1899
|
SearchableSelectInput,
|
|
2108
1900
|
{
|
|
2109
1901
|
placeholder: searchPlaceholder,
|
|
2110
1902
|
autoFocus: true
|
|
2111
1903
|
}
|
|
2112
1904
|
) }),
|
|
2113
|
-
/* @__PURE__ */
|
|
2114
|
-
/* @__PURE__ */
|
|
2115
|
-
/* @__PURE__ */
|
|
1905
|
+
/* @__PURE__ */ jsx11(ComboboxStatus, { children: isLoading ? loadingText : null }),
|
|
1906
|
+
/* @__PURE__ */ jsx11(ComboboxEmpty, { children: isLoading ? null : emptyText }),
|
|
1907
|
+
/* @__PURE__ */ jsx11(
|
|
2116
1908
|
SearchableSelectList,
|
|
2117
1909
|
{
|
|
1910
|
+
"aria-label": ariaLabel,
|
|
1911
|
+
"aria-labelledby": ariaLabelledBy,
|
|
2118
1912
|
style: isVirtualized ? {
|
|
2119
1913
|
padding: 0,
|
|
2120
1914
|
flex: 1,
|
|
@@ -2122,7 +1916,7 @@ function SingleSearchableSelect(props) {
|
|
|
2122
1916
|
display: "flex",
|
|
2123
1917
|
flexDirection: "column"
|
|
2124
1918
|
} : void 0,
|
|
2125
|
-
children: isVirtualized ? /* @__PURE__ */
|
|
1919
|
+
children: isVirtualized ? /* @__PURE__ */ jsx11(
|
|
2126
1920
|
VirtualizedComboboxList,
|
|
2127
1921
|
{
|
|
2128
1922
|
open,
|
|
@@ -2134,10 +1928,10 @@ function SingleSearchableSelect(props) {
|
|
|
2134
1928
|
inputType,
|
|
2135
1929
|
renderItem
|
|
2136
1930
|
}
|
|
2137
|
-
) : children ? children : groups ? ((group, index) => /* @__PURE__ */ jsxs8(
|
|
1931
|
+
) : children ? children : groups ? ((group, index) => /* @__PURE__ */ jsxs8(React13.Fragment, { children: [
|
|
2138
1932
|
/* @__PURE__ */ jsxs8(ComboboxGroup, { items: group.items, children: [
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
/* @__PURE__ */
|
|
1933
|
+
/* @__PURE__ */ jsx11(ComboboxGroupLabel, { children: renderGroupHeading ? renderGroupHeading(group.value) : group.value }),
|
|
1934
|
+
/* @__PURE__ */ jsx11(Combobox5.Collection, { children: (item) => /* @__PURE__ */ jsx11(
|
|
2141
1935
|
ComboboxItem_default,
|
|
2142
1936
|
{
|
|
2143
1937
|
value: item,
|
|
@@ -2150,9 +1944,9 @@ function SingleSearchableSelect(props) {
|
|
|
2150
1944
|
item.id
|
|
2151
1945
|
) })
|
|
2152
1946
|
] }),
|
|
2153
|
-
index < groups.length - 1 && /* @__PURE__ */
|
|
1947
|
+
index < groups.length - 1 && /* @__PURE__ */ jsx11(ComboboxSeparator, {})
|
|
2154
1948
|
] }, group.value)) : /* @__PURE__ */ jsxs8(Fragment8, { children: [
|
|
2155
|
-
includePlaceholderItem && /* @__PURE__ */
|
|
1949
|
+
includePlaceholderItem && /* @__PURE__ */ jsx11(
|
|
2156
1950
|
ComboboxItem_default,
|
|
2157
1951
|
{
|
|
2158
1952
|
value: makePlaceholderSentinel(placeholder),
|
|
@@ -2162,7 +1956,7 @@ function SingleSearchableSelect(props) {
|
|
|
2162
1956
|
},
|
|
2163
1957
|
"placeholder"
|
|
2164
1958
|
),
|
|
2165
|
-
/* @__PURE__ */
|
|
1959
|
+
/* @__PURE__ */ jsx11(Combobox5.Collection, { children: (item) => /* @__PURE__ */ jsx11(
|
|
2166
1960
|
ComboboxItem_default,
|
|
2167
1961
|
{
|
|
2168
1962
|
value: item,
|
|
@@ -2187,18 +1981,15 @@ function SingleSearchableSelect(props) {
|
|
|
2187
1981
|
}
|
|
2188
1982
|
|
|
2189
1983
|
// src/v3/MultiSearchableSelect.tsx
|
|
2190
|
-
import * as
|
|
1984
|
+
import * as React14 from "react";
|
|
2191
1985
|
import { Combobox as Combobox6 } from "@base-ui/react/combobox";
|
|
2192
1986
|
import "@tanstack/react-virtual";
|
|
2193
1987
|
import Icon4 from "@sproutsocial/seeds-react-icon";
|
|
2194
|
-
import
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
text-overflow: ellipsis;
|
|
2200
|
-
white-space: nowrap;
|
|
2201
|
-
`;
|
|
1988
|
+
import { Fragment as Fragment10, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1989
|
+
var SelectionText2 = ({
|
|
1990
|
+
className,
|
|
1991
|
+
...rest
|
|
1992
|
+
}) => /* @__PURE__ */ jsx12("span", { className: cn("seeds-select-selection-text", className), ...rest });
|
|
2202
1993
|
function makeGroupHeaderSentinel2(groupName) {
|
|
2203
1994
|
return { __groupHeader: true, groupName };
|
|
2204
1995
|
}
|
|
@@ -2221,6 +2012,8 @@ function MultiSearchableSelect(props) {
|
|
|
2221
2012
|
fullWidth = true
|
|
2222
2013
|
} = props;
|
|
2223
2014
|
const ariaDescribedBy = props["aria-describedby"];
|
|
2015
|
+
const ariaLabel = props["aria-label"];
|
|
2016
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
2224
2017
|
const isInvalid = props.isInvalid;
|
|
2225
2018
|
const isChildrenMode = "children" in props && props.children != null;
|
|
2226
2019
|
const data = isChildrenMode ? [] : props.data;
|
|
@@ -2243,29 +2036,29 @@ function MultiSearchableSelect(props) {
|
|
|
2243
2036
|
const defaultSelectedItemIds = props.defaultSelectedItemIds;
|
|
2244
2037
|
const onSelectedItemIdsChange = props.onSelectedItemIdsChange;
|
|
2245
2038
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
2246
|
-
const [open, setOpen] =
|
|
2247
|
-
const [internalInputValue, setInternalInputValue] =
|
|
2248
|
-
const skipNextInputChangeRef =
|
|
2249
|
-
const virtualizerRef =
|
|
2039
|
+
const [open, setOpen] = React14.useState(false);
|
|
2040
|
+
const [internalInputValue, setInternalInputValue] = React14.useState("");
|
|
2041
|
+
const skipNextInputChangeRef = React14.useRef(false);
|
|
2042
|
+
const virtualizerRef = React14.useRef(null);
|
|
2250
2043
|
const isControlled = selectedItemIds !== void 0;
|
|
2251
|
-
const idsToItems =
|
|
2044
|
+
const idsToItems = React14.useCallback(
|
|
2252
2045
|
(ids) => ids.map((id2) => data.find((d) => d.id === id2)).filter((d) => d != null),
|
|
2253
2046
|
[data]
|
|
2254
2047
|
);
|
|
2255
|
-
const [internalValue, setInternalValue] =
|
|
2048
|
+
const [internalValue, setInternalValue] = React14.useState(
|
|
2256
2049
|
() => defaultSelectedItemIds ? idsToItems(defaultSelectedItemIds) : []
|
|
2257
2050
|
);
|
|
2258
2051
|
const value = isControlled ? idsToItems(selectedItemIds) : internalValue;
|
|
2259
|
-
const visibleData =
|
|
2052
|
+
const visibleData = React14.useMemo(
|
|
2260
2053
|
() => removeSelectedItems ? data.filter((item) => !value.some((v) => v.id === item.id)) : data,
|
|
2261
2054
|
[data, value, removeSelectedItems]
|
|
2262
2055
|
);
|
|
2263
|
-
const groups =
|
|
2056
|
+
const groups = React14.useMemo(
|
|
2264
2057
|
() => groupBy ? groupItems(visibleData, groupBy) : null,
|
|
2265
2058
|
[visibleData, groupBy]
|
|
2266
2059
|
);
|
|
2267
2060
|
const currentInputValue = internalInputValue;
|
|
2268
|
-
const creatableSentinel =
|
|
2061
|
+
const creatableSentinel = React14.useMemo(() => {
|
|
2269
2062
|
if (!creatableProp) return null;
|
|
2270
2063
|
const trimmed = currentInputValue.trim();
|
|
2271
2064
|
if (!trimmed) return null;
|
|
@@ -2276,7 +2069,7 @@ function MultiSearchableSelect(props) {
|
|
|
2276
2069
|
if (exactExists) return null;
|
|
2277
2070
|
return makeCreatableSentinel(trimmed);
|
|
2278
2071
|
}, [creatableProp, currentInputValue, data, itemToString]);
|
|
2279
|
-
const flatItems =
|
|
2072
|
+
const flatItems = React14.useMemo(() => {
|
|
2280
2073
|
if (!groups || !selectHeadings && !selectAll) return null;
|
|
2281
2074
|
const rows = [];
|
|
2282
2075
|
if (selectAll) rows.push(SELECT_ALL_SENTINEL2);
|
|
@@ -2357,7 +2150,7 @@ function MultiSearchableSelect(props) {
|
|
|
2357
2150
|
const selectedCount = value.length;
|
|
2358
2151
|
const state = selectedCount === 0 ? "none" : selectedCount === totalCount ? "all" : "partial";
|
|
2359
2152
|
return /* @__PURE__ */ jsxs9(ComboboxSelectAllItem, { value: row, children: [
|
|
2360
|
-
/* @__PURE__ */
|
|
2153
|
+
/* @__PURE__ */ jsx12(ComboboxGroupHeaderCheckbox, { $state: state, id: "__selectAll" }),
|
|
2361
2154
|
"Select all"
|
|
2362
2155
|
] }, "__selectAll");
|
|
2363
2156
|
}
|
|
@@ -2369,7 +2162,7 @@ function MultiSearchableSelect(props) {
|
|
|
2369
2162
|
).length;
|
|
2370
2163
|
const state = selectedCount === 0 ? "none" : selectedCount === groupItemsList.length ? "all" : "partial";
|
|
2371
2164
|
return /* @__PURE__ */ jsxs9(ComboboxGroupHeaderItem, { value: row, children: [
|
|
2372
|
-
/* @__PURE__ */
|
|
2165
|
+
/* @__PURE__ */ jsx12(
|
|
2373
2166
|
ComboboxGroupHeaderCheckbox,
|
|
2374
2167
|
{
|
|
2375
2168
|
$state: state,
|
|
@@ -2383,7 +2176,7 @@ function MultiSearchableSelect(props) {
|
|
|
2383
2176
|
return renderCreatableItem(row);
|
|
2384
2177
|
}
|
|
2385
2178
|
const item = row;
|
|
2386
|
-
return /* @__PURE__ */
|
|
2179
|
+
return /* @__PURE__ */ jsx12(
|
|
2387
2180
|
ComboboxItem_default,
|
|
2388
2181
|
{
|
|
2389
2182
|
value: item,
|
|
@@ -2397,7 +2190,7 @@ function MultiSearchableSelect(props) {
|
|
|
2397
2190
|
);
|
|
2398
2191
|
}
|
|
2399
2192
|
function renderCreatableItem(sentinel, style, index, measureRef) {
|
|
2400
|
-
return /* @__PURE__ */
|
|
2193
|
+
return /* @__PURE__ */ jsx12(
|
|
2401
2194
|
ComboboxItem_default,
|
|
2402
2195
|
{
|
|
2403
2196
|
value: sentinel,
|
|
@@ -2405,7 +2198,7 @@ function MultiSearchableSelect(props) {
|
|
|
2405
2198
|
label: `Create "${sentinel.label}"`,
|
|
2406
2199
|
inputType: "none",
|
|
2407
2200
|
renderItem: () => /* @__PURE__ */ jsxs9(Fragment10, { children: [
|
|
2408
|
-
/* @__PURE__ */
|
|
2201
|
+
/* @__PURE__ */ jsx12(Icon4, { name: "plus-outline", size: "mini" }),
|
|
2409
2202
|
`Create "${sentinel.label}"`
|
|
2410
2203
|
] }),
|
|
2411
2204
|
style,
|
|
@@ -2421,7 +2214,7 @@ function MultiSearchableSelect(props) {
|
|
|
2421
2214
|
const hasSentinels = selectAll || selectHeadings;
|
|
2422
2215
|
const rootValue = hasSentinels ? [...value] : value;
|
|
2423
2216
|
return /* @__PURE__ */ jsxs9(Field, { $fullWidth: fullWidth, children: [
|
|
2424
|
-
/* @__PURE__ */
|
|
2217
|
+
/* @__PURE__ */ jsx12("div", { ref: containerRef, style: { position: "relative" } }),
|
|
2425
2218
|
/* @__PURE__ */ jsxs9(
|
|
2426
2219
|
Combobox6.Root,
|
|
2427
2220
|
{
|
|
@@ -2502,29 +2295,31 @@ function MultiSearchableSelect(props) {
|
|
|
2502
2295
|
text,
|
|
2503
2296
|
overflowCount > 0 ? `, +${overflowCount}` : ""
|
|
2504
2297
|
] });
|
|
2505
|
-
})() : /* @__PURE__ */
|
|
2506
|
-
/* @__PURE__ */
|
|
2298
|
+
})() : /* @__PURE__ */ jsx12(SearchableSelectPlaceholder, { children: placeholder }),
|
|
2299
|
+
/* @__PURE__ */ jsx12(SearchableSelectTriggerIcon, { style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsx12(StyledChevron, { "data-chevron": true, children: /* @__PURE__ */ jsx12(ChevronIcon, {}) }) })
|
|
2507
2300
|
]
|
|
2508
2301
|
}
|
|
2509
2302
|
),
|
|
2510
|
-
/* @__PURE__ */
|
|
2303
|
+
/* @__PURE__ */ jsx12(Combobox6.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx12(ComboboxPositioner, { sideOffset: 4, children: /* @__PURE__ */ jsxs9(
|
|
2511
2304
|
SearchableSelectPopup,
|
|
2512
2305
|
{
|
|
2513
2306
|
"aria-busy": isLoading || void 0,
|
|
2514
2307
|
style: { display: "flex", flexDirection: "column" },
|
|
2515
2308
|
children: [
|
|
2516
|
-
/* @__PURE__ */
|
|
2309
|
+
/* @__PURE__ */ jsx12(SearchableSelectSearchContainer, { children: /* @__PURE__ */ jsx12(
|
|
2517
2310
|
SearchableSelectInput,
|
|
2518
2311
|
{
|
|
2519
2312
|
placeholder: searchPlaceholder,
|
|
2520
2313
|
autoFocus: true
|
|
2521
2314
|
}
|
|
2522
2315
|
) }),
|
|
2523
|
-
/* @__PURE__ */
|
|
2524
|
-
/* @__PURE__ */
|
|
2525
|
-
/* @__PURE__ */
|
|
2316
|
+
/* @__PURE__ */ jsx12(ComboboxStatus, { children: isLoading ? loadingText : null }),
|
|
2317
|
+
/* @__PURE__ */ jsx12(ComboboxEmpty, { children: isLoading ? null : emptyText }),
|
|
2318
|
+
/* @__PURE__ */ jsx12(
|
|
2526
2319
|
SearchableSelectList,
|
|
2527
2320
|
{
|
|
2321
|
+
"aria-label": ariaLabel,
|
|
2322
|
+
"aria-labelledby": ariaLabelledBy,
|
|
2528
2323
|
style: isVirtualized ? {
|
|
2529
2324
|
padding: 0,
|
|
2530
2325
|
flex: 1,
|
|
@@ -2532,7 +2327,7 @@ function MultiSearchableSelect(props) {
|
|
|
2532
2327
|
display: "flex",
|
|
2533
2328
|
flexDirection: "column"
|
|
2534
2329
|
} : void 0,
|
|
2535
|
-
children: isVirtualized ? /* @__PURE__ */
|
|
2330
|
+
children: isVirtualized ? /* @__PURE__ */ jsx12(
|
|
2536
2331
|
VirtualizedComboboxList,
|
|
2537
2332
|
{
|
|
2538
2333
|
open,
|
|
@@ -2556,10 +2351,10 @@ function MultiSearchableSelect(props) {
|
|
|
2556
2351
|
return renderCreatableItem(group);
|
|
2557
2352
|
}
|
|
2558
2353
|
const g = group;
|
|
2559
|
-
return /* @__PURE__ */ jsxs9(
|
|
2354
|
+
return /* @__PURE__ */ jsxs9(React14.Fragment, { children: [
|
|
2560
2355
|
/* @__PURE__ */ jsxs9(ComboboxGroup, { items: g.items, children: [
|
|
2561
|
-
/* @__PURE__ */
|
|
2562
|
-
/* @__PURE__ */
|
|
2356
|
+
/* @__PURE__ */ jsx12(ComboboxGroupLabel, { children: renderGroupHeading ? renderGroupHeading(g.value) : g.value }),
|
|
2357
|
+
/* @__PURE__ */ jsx12(Combobox6.Collection, { children: (item) => /* @__PURE__ */ jsx12(
|
|
2563
2358
|
ComboboxItem_default,
|
|
2564
2359
|
{
|
|
2565
2360
|
value: item,
|
|
@@ -2572,14 +2367,14 @@ function MultiSearchableSelect(props) {
|
|
|
2572
2367
|
item.id
|
|
2573
2368
|
) })
|
|
2574
2369
|
] }),
|
|
2575
|
-
index < groups.length - 1 && /* @__PURE__ */
|
|
2370
|
+
index < groups.length - 1 && /* @__PURE__ */ jsx12(ComboboxSeparator, {})
|
|
2576
2371
|
] }, g.value);
|
|
2577
2372
|
}) : ((item) => {
|
|
2578
2373
|
if (isCreatableSentinel(item)) {
|
|
2579
2374
|
return renderCreatableItem(item);
|
|
2580
2375
|
}
|
|
2581
2376
|
const dataItem = item;
|
|
2582
|
-
return /* @__PURE__ */
|
|
2377
|
+
return /* @__PURE__ */ jsx12(
|
|
2583
2378
|
ComboboxItem_default,
|
|
2584
2379
|
{
|
|
2585
2380
|
value: dataItem,
|
|
@@ -2604,153 +2399,141 @@ function MultiSearchableSelect(props) {
|
|
|
2604
2399
|
}
|
|
2605
2400
|
|
|
2606
2401
|
// src/v3/ActionMenu.tsx
|
|
2607
|
-
import * as
|
|
2402
|
+
import * as React16 from "react";
|
|
2608
2403
|
import { Menu as Menu2 } from "@base-ui/react/menu";
|
|
2609
2404
|
import Radio3 from "@sproutsocial/seeds-react-radio";
|
|
2610
2405
|
import Checkbox4 from "@sproutsocial/seeds-react-checkbox";
|
|
2611
2406
|
import { Icon as Icon5 } from "@sproutsocial/seeds-react-icon";
|
|
2612
2407
|
|
|
2613
2408
|
// src/v3/ActionMenuStyles.tsx
|
|
2409
|
+
import * as React15 from "react";
|
|
2614
2410
|
import { Menu } from "@base-ui/react/menu";
|
|
2615
|
-
import
|
|
2616
|
-
|
|
2617
|
-
var
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2411
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
2412
|
+
var ActionMenuTrigger = Menu.Trigger;
|
|
2413
|
+
var ActionMenuPositioner = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx13(
|
|
2414
|
+
Menu.Positioner,
|
|
2415
|
+
{
|
|
2416
|
+
ref,
|
|
2417
|
+
className: cn("seeds-action-menu-positioner", className),
|
|
2418
|
+
...rest
|
|
2419
|
+
}
|
|
2420
|
+
));
|
|
2421
|
+
ActionMenuPositioner.displayName = "ActionMenuPositioner";
|
|
2422
|
+
var ActionMenuPopup = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx13(
|
|
2423
|
+
Menu.Popup,
|
|
2424
|
+
{
|
|
2425
|
+
ref,
|
|
2426
|
+
"data-base-ui-swipe-ignore": "",
|
|
2427
|
+
className: cn("seeds-action-menu-popup", className),
|
|
2428
|
+
...rest
|
|
2429
|
+
}
|
|
2430
|
+
));
|
|
2431
|
+
ActionMenuPopup.displayName = "ActionMenuPopup";
|
|
2432
|
+
var ActionMenuGroup = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx13(
|
|
2433
|
+
Menu.Group,
|
|
2434
|
+
{
|
|
2435
|
+
ref,
|
|
2436
|
+
className: cn("seeds-action-menu-group", className),
|
|
2437
|
+
...rest
|
|
2438
|
+
}
|
|
2439
|
+
));
|
|
2440
|
+
ActionMenuGroup.displayName = "ActionMenuGroup";
|
|
2441
|
+
var ActionMenuGroupLabel = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx13(
|
|
2442
|
+
Menu.GroupLabel,
|
|
2443
|
+
{
|
|
2444
|
+
ref,
|
|
2445
|
+
className: cn("seeds-action-menu-group-label", className),
|
|
2446
|
+
...rest
|
|
2447
|
+
}
|
|
2448
|
+
));
|
|
2449
|
+
ActionMenuGroupLabel.displayName = "ActionMenuGroupLabel";
|
|
2450
|
+
var ActionMenuSeparator = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx13(
|
|
2451
|
+
Menu.Separator,
|
|
2452
|
+
{
|
|
2453
|
+
ref,
|
|
2454
|
+
className: cn("seeds-action-menu-separator", className),
|
|
2455
|
+
...rest
|
|
2456
|
+
}
|
|
2457
|
+
));
|
|
2458
|
+
ActionMenuSeparator.displayName = "ActionMenuSeparator";
|
|
2459
|
+
var StyledMenuItem = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx13(
|
|
2460
|
+
Menu.Item,
|
|
2461
|
+
{
|
|
2462
|
+
ref,
|
|
2463
|
+
className: cn("seeds-action-menu-item", className),
|
|
2464
|
+
...rest
|
|
2465
|
+
}
|
|
2466
|
+
));
|
|
2467
|
+
StyledMenuItem.displayName = "StyledMenuItem";
|
|
2468
|
+
var StyledCheckboxItem = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx13(
|
|
2469
|
+
Menu.CheckboxItem,
|
|
2470
|
+
{
|
|
2471
|
+
ref,
|
|
2472
|
+
className: cn(
|
|
2473
|
+
"seeds-action-menu-item",
|
|
2474
|
+
"seeds-action-menu-item--flex",
|
|
2475
|
+
className
|
|
2476
|
+
),
|
|
2477
|
+
...rest
|
|
2478
|
+
}
|
|
2479
|
+
));
|
|
2480
|
+
StyledCheckboxItem.displayName = "StyledCheckboxItem";
|
|
2481
|
+
var StyledRadioItem = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx13(
|
|
2482
|
+
Menu.RadioItem,
|
|
2483
|
+
{
|
|
2484
|
+
ref,
|
|
2485
|
+
className: cn(
|
|
2486
|
+
"seeds-action-menu-item",
|
|
2487
|
+
"seeds-action-menu-item--flex",
|
|
2488
|
+
className
|
|
2489
|
+
),
|
|
2490
|
+
...rest
|
|
2491
|
+
}
|
|
2492
|
+
));
|
|
2493
|
+
StyledRadioItem.displayName = "StyledRadioItem";
|
|
2494
|
+
var StyledCheckboxItemIndicator = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx13(
|
|
2495
|
+
Menu.CheckboxItemIndicator,
|
|
2496
|
+
{
|
|
2497
|
+
ref,
|
|
2498
|
+
className: cn("seeds-action-menu-item-indicator", className),
|
|
2499
|
+
...rest
|
|
2500
|
+
}
|
|
2501
|
+
));
|
|
2502
|
+
StyledCheckboxItemIndicator.displayName = "StyledCheckboxItemIndicator";
|
|
2503
|
+
var StyledRadioItemIndicator = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx13(
|
|
2504
|
+
Menu.RadioItemIndicator,
|
|
2505
|
+
{
|
|
2506
|
+
ref,
|
|
2507
|
+
className: cn("seeds-action-menu-item-indicator", className),
|
|
2508
|
+
...rest
|
|
2509
|
+
}
|
|
2510
|
+
));
|
|
2511
|
+
StyledRadioItemIndicator.displayName = "StyledRadioItemIndicator";
|
|
2512
|
+
var StyledSubmenuTrigger = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx13(
|
|
2513
|
+
Menu.SubmenuTrigger,
|
|
2514
|
+
{
|
|
2515
|
+
ref,
|
|
2516
|
+
className: cn(
|
|
2517
|
+
"seeds-action-menu-item",
|
|
2518
|
+
"seeds-action-menu-submenu-trigger",
|
|
2519
|
+
className
|
|
2520
|
+
),
|
|
2521
|
+
...rest
|
|
2663
2522
|
}
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
`;
|
|
2673
|
-
var ActionMenuSeparator = styled8(Menu.Separator)`
|
|
2674
|
-
height: 1px;
|
|
2675
|
-
margin: ${({ theme }) => `${theme.space[300]} -${theme.space[300]}`};
|
|
2676
|
-
background: ${({ theme }) => theme.colors.container.border.base};
|
|
2677
|
-
`;
|
|
2678
|
-
var menuItemStyles = css3`
|
|
2679
|
-
box-sizing: border-box;
|
|
2680
|
-
display: block;
|
|
2681
|
-
width: 100%;
|
|
2682
|
-
border-radius: ${({ theme }) => theme.radii[500]};
|
|
2683
|
-
background-color: ${({ theme }) => theme.colors.listItem.background.base};
|
|
2684
|
-
border: 1px solid ${({ theme }) => theme.colors.listItem.background.base};
|
|
2685
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
2686
|
-
font-family: ${({ theme }) => theme.fontFamily};
|
|
2687
|
-
font-weight: ${({ theme }) => theme.fontWeights.normal};
|
|
2688
|
-
text-align: left;
|
|
2689
|
-
text-decoration: none;
|
|
2690
|
-
padding: ${({ theme }) => theme.space[300]};
|
|
2691
|
-
outline: 0;
|
|
2692
|
-
${({ theme }) => theme.typography[200]};
|
|
2693
|
-
transition: all ${({ theme }) => theme.duration.fast};
|
|
2694
|
-
cursor: pointer;
|
|
2695
|
-
user-select: none;
|
|
2696
|
-
|
|
2697
|
-
&[data-highlighted] {
|
|
2698
|
-
border-color: ${({ theme }) => theme.colors.listItem.border.base};
|
|
2699
|
-
background-color: ${({ theme }) => theme.colors.listItem.background.hover};
|
|
2700
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
2701
|
-
text-decoration: none;
|
|
2523
|
+
));
|
|
2524
|
+
StyledSubmenuTrigger.displayName = "StyledSubmenuTrigger";
|
|
2525
|
+
var StyledLinkItem = React15.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx13(
|
|
2526
|
+
Menu.LinkItem,
|
|
2527
|
+
{
|
|
2528
|
+
ref,
|
|
2529
|
+
className: cn("seeds-action-menu-item", className),
|
|
2530
|
+
...rest
|
|
2702
2531
|
}
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
cursor: not-allowed;
|
|
2706
|
-
opacity: 0.4;
|
|
2707
|
-
}
|
|
2708
|
-
`;
|
|
2709
|
-
var StyledMenuItem = styled8(Menu.Item)`
|
|
2710
|
-
${menuItemStyles}
|
|
2711
|
-
`;
|
|
2712
|
-
var StyledCheckboxItem = styled8(Menu.CheckboxItem)`
|
|
2713
|
-
${menuItemStyles}
|
|
2714
|
-
display: flex;
|
|
2715
|
-
align-items: center;
|
|
2716
|
-
gap: ${({ theme }) => theme.space[300]};
|
|
2717
|
-
`;
|
|
2718
|
-
var StyledRadioItem = styled8(Menu.RadioItem)`
|
|
2719
|
-
${menuItemStyles}
|
|
2720
|
-
display: flex;
|
|
2721
|
-
align-items: center;
|
|
2722
|
-
gap: ${({ theme }) => theme.space[300]};
|
|
2723
|
-
`;
|
|
2724
|
-
var StyledCheckboxItemIndicator = styled8(Menu.CheckboxItemIndicator)`
|
|
2725
|
-
display: flex;
|
|
2726
|
-
align-items: center;
|
|
2727
|
-
width: 16px;
|
|
2728
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
2729
|
-
`;
|
|
2730
|
-
var StyledRadioItemIndicator = styled8(Menu.RadioItemIndicator)`
|
|
2731
|
-
display: flex;
|
|
2732
|
-
align-items: center;
|
|
2733
|
-
width: 16px;
|
|
2734
|
-
color: ${({ theme }) => theme.colors.text.body};
|
|
2735
|
-
`;
|
|
2736
|
-
var StyledSubmenuTrigger = styled8(Menu.SubmenuTrigger)`
|
|
2737
|
-
${menuItemStyles}
|
|
2738
|
-
display: flex;
|
|
2739
|
-
align-items: center;
|
|
2740
|
-
gap: ${({ theme }) => theme.space[300]};
|
|
2741
|
-
justify-content: space-between;
|
|
2742
|
-
|
|
2743
|
-
&[data-popup-open] {
|
|
2744
|
-
border-color: ${({ theme }) => theme.colors.listItem.border.base};
|
|
2745
|
-
background-color: ${({ theme }) => theme.colors.listItem.background.hover};
|
|
2746
|
-
}
|
|
2747
|
-
`;
|
|
2748
|
-
var StyledLinkItem = styled8(Menu.LinkItem)`
|
|
2749
|
-
${menuItemStyles}
|
|
2750
|
-
`;
|
|
2532
|
+
));
|
|
2533
|
+
StyledLinkItem.displayName = "StyledLinkItem";
|
|
2751
2534
|
|
|
2752
2535
|
// src/v3/ActionMenu.tsx
|
|
2753
|
-
import { Fragment as Fragment11, jsx as
|
|
2536
|
+
import { Fragment as Fragment11, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2754
2537
|
function ActionMenu({
|
|
2755
2538
|
trigger,
|
|
2756
2539
|
children,
|
|
@@ -2767,9 +2550,9 @@ function ActionMenu({
|
|
|
2767
2550
|
defaultOpen,
|
|
2768
2551
|
onOpenChange,
|
|
2769
2552
|
children: [
|
|
2770
|
-
/* @__PURE__ */
|
|
2771
|
-
/* @__PURE__ */
|
|
2772
|
-
/* @__PURE__ */
|
|
2553
|
+
/* @__PURE__ */ jsx14("div", { ref: containerRef, style: { position: "relative" } }),
|
|
2554
|
+
/* @__PURE__ */ jsx14(ActionMenuTrigger, { render: trigger, disabled }),
|
|
2555
|
+
/* @__PURE__ */ jsx14(Menu2.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx14(ActionMenuPositioner, { sideOffset: 8, children: /* @__PURE__ */ jsx14(ActionMenuPopup, { children }) }) })
|
|
2773
2556
|
]
|
|
2774
2557
|
}
|
|
2775
2558
|
);
|
|
@@ -2781,10 +2564,10 @@ function MenuGroup({
|
|
|
2781
2564
|
}) {
|
|
2782
2565
|
return /* @__PURE__ */ jsxs10(Fragment11, { children: [
|
|
2783
2566
|
/* @__PURE__ */ jsxs10(ActionMenuGroup, { children: [
|
|
2784
|
-
label && /* @__PURE__ */
|
|
2567
|
+
label && /* @__PURE__ */ jsx14(ActionMenuGroupLabel, { children: label }),
|
|
2785
2568
|
children
|
|
2786
2569
|
] }),
|
|
2787
|
-
showSeparator && /* @__PURE__ */
|
|
2570
|
+
showSeparator && /* @__PURE__ */ jsx14(ActionMenuSeparator, {})
|
|
2788
2571
|
] });
|
|
2789
2572
|
}
|
|
2790
2573
|
function MenuRadioGroup({
|
|
@@ -2793,7 +2576,7 @@ function MenuRadioGroup({
|
|
|
2793
2576
|
defaultValue,
|
|
2794
2577
|
onValueChange
|
|
2795
2578
|
}) {
|
|
2796
|
-
return /* @__PURE__ */
|
|
2579
|
+
return /* @__PURE__ */ jsx14(
|
|
2797
2580
|
Menu2.RadioGroup,
|
|
2798
2581
|
{
|
|
2799
2582
|
value,
|
|
@@ -2804,7 +2587,7 @@ function MenuRadioGroup({
|
|
|
2804
2587
|
);
|
|
2805
2588
|
}
|
|
2806
2589
|
function MenuItem(props) {
|
|
2807
|
-
const generatedId =
|
|
2590
|
+
const generatedId = React16.useId();
|
|
2808
2591
|
if (props.type === "checkbox") {
|
|
2809
2592
|
const {
|
|
2810
2593
|
children: children2,
|
|
@@ -2825,11 +2608,11 @@ function MenuItem(props) {
|
|
|
2825
2608
|
disabled: disabled2,
|
|
2826
2609
|
closeOnClick: closeOnClick2,
|
|
2827
2610
|
children: [
|
|
2828
|
-
/* @__PURE__ */
|
|
2611
|
+
/* @__PURE__ */ jsx14(
|
|
2829
2612
|
StyledCheckboxItemIndicator,
|
|
2830
2613
|
{
|
|
2831
2614
|
keepMounted: true,
|
|
2832
|
-
render: (_indicatorProps, state) => /* @__PURE__ */
|
|
2615
|
+
render: (_indicatorProps, state) => /* @__PURE__ */ jsx14(
|
|
2833
2616
|
Checkbox4,
|
|
2834
2617
|
{
|
|
2835
2618
|
checked: state.checked,
|
|
@@ -2856,11 +2639,11 @@ function MenuItem(props) {
|
|
|
2856
2639
|
disabled: disabled2,
|
|
2857
2640
|
closeOnClick: closeOnClick2,
|
|
2858
2641
|
children: [
|
|
2859
|
-
/* @__PURE__ */
|
|
2642
|
+
/* @__PURE__ */ jsx14(
|
|
2860
2643
|
StyledRadioItemIndicator,
|
|
2861
2644
|
{
|
|
2862
2645
|
keepMounted: true,
|
|
2863
|
-
render: (_indicatorProps, state) => /* @__PURE__ */
|
|
2646
|
+
render: (_indicatorProps, state) => /* @__PURE__ */ jsx14(
|
|
2864
2647
|
Radio3,
|
|
2865
2648
|
{
|
|
2866
2649
|
checked: state.checked,
|
|
@@ -2887,9 +2670,9 @@ function MenuItem(props) {
|
|
|
2887
2670
|
target
|
|
2888
2671
|
} = props;
|
|
2889
2672
|
if (href) {
|
|
2890
|
-
return /* @__PURE__ */
|
|
2673
|
+
return /* @__PURE__ */ jsx14(StyledLinkItem, { href, target, closeOnClick, children });
|
|
2891
2674
|
}
|
|
2892
|
-
return /* @__PURE__ */
|
|
2675
|
+
return /* @__PURE__ */ jsx14(
|
|
2893
2676
|
StyledMenuItem,
|
|
2894
2677
|
{
|
|
2895
2678
|
onClick,
|
|
@@ -2916,9 +2699,9 @@ function MenuSub({
|
|
|
2916
2699
|
onOpenChange,
|
|
2917
2700
|
closeParentOnEsc,
|
|
2918
2701
|
children: [
|
|
2919
|
-
/* @__PURE__ */
|
|
2702
|
+
/* @__PURE__ */ jsx14("div", { ref: containerRef, style: { position: "relative" } }),
|
|
2920
2703
|
trigger,
|
|
2921
|
-
/* @__PURE__ */
|
|
2704
|
+
/* @__PURE__ */ jsx14(Menu2.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx14(ActionMenuPositioner, { sideOffset: getOffset, alignOffset: getOffset, children: /* @__PURE__ */ jsx14(ActionMenuPopup, { children }) }) })
|
|
2922
2705
|
]
|
|
2923
2706
|
}
|
|
2924
2707
|
);
|
|
@@ -2940,7 +2723,7 @@ function MenuSubTrigger({
|
|
|
2940
2723
|
openOnHover,
|
|
2941
2724
|
children: [
|
|
2942
2725
|
children,
|
|
2943
|
-
/* @__PURE__ */
|
|
2726
|
+
/* @__PURE__ */ jsx14(Icon5, { name: "chevron-right-outline", fixedWidth: true, "aria-hidden": true })
|
|
2944
2727
|
]
|
|
2945
2728
|
}
|
|
2946
2729
|
);
|
|
@@ -2952,35 +2735,41 @@ import "@sproutsocial/seeds-react-button";
|
|
|
2952
2735
|
import { Icon as Icon6 } from "@sproutsocial/seeds-react-icon";
|
|
2953
2736
|
|
|
2954
2737
|
// src/v3/MenuButtonStyles.tsx
|
|
2955
|
-
import
|
|
2738
|
+
import * as React17 from "react";
|
|
2956
2739
|
import { Button } from "@sproutsocial/seeds-react-button";
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
var
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2740
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2741
|
+
var MenuButtonContainer = React17.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx15(
|
|
2742
|
+
"div",
|
|
2743
|
+
{
|
|
2744
|
+
ref,
|
|
2745
|
+
className: cn("seeds-menu-button-container", className),
|
|
2746
|
+
...rest
|
|
2747
|
+
}
|
|
2748
|
+
));
|
|
2749
|
+
MenuButtonContainer.displayName = "MenuButtonContainer";
|
|
2750
|
+
var MainButton = React17.forwardRef(
|
|
2751
|
+
({ className, ...rest }, ref) => /* @__PURE__ */ jsx15(
|
|
2752
|
+
Button,
|
|
2753
|
+
{
|
|
2754
|
+
ref,
|
|
2755
|
+
className: cn("seeds-menu-button-main", className),
|
|
2756
|
+
...rest
|
|
2757
|
+
}
|
|
2758
|
+
)
|
|
2759
|
+
);
|
|
2760
|
+
MainButton.displayName = "MainButton";
|
|
2761
|
+
var TriggerButton = React17.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx15(
|
|
2762
|
+
Button,
|
|
2763
|
+
{
|
|
2764
|
+
ref,
|
|
2765
|
+
className: cn("seeds-menu-button-trigger", className),
|
|
2766
|
+
...rest
|
|
2767
|
+
}
|
|
2768
|
+
));
|
|
2769
|
+
TriggerButton.displayName = "TriggerButton";
|
|
2981
2770
|
|
|
2982
2771
|
// src/v3/MenuButton.tsx
|
|
2983
|
-
import { jsx as
|
|
2772
|
+
import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2984
2773
|
function MenuButton({
|
|
2985
2774
|
actionMenu,
|
|
2986
2775
|
appearance = "primary",
|
|
@@ -2991,7 +2780,7 @@ function MenuButton({
|
|
|
2991
2780
|
...rest
|
|
2992
2781
|
}) {
|
|
2993
2782
|
return /* @__PURE__ */ jsxs11(MenuButtonContainer, { children: [
|
|
2994
|
-
/* @__PURE__ */
|
|
2783
|
+
/* @__PURE__ */ jsx16(
|
|
2995
2784
|
MainButton,
|
|
2996
2785
|
{
|
|
2997
2786
|
appearance,
|
|
@@ -3001,18 +2790,18 @@ function MenuButton({
|
|
|
3001
2790
|
children
|
|
3002
2791
|
}
|
|
3003
2792
|
),
|
|
3004
|
-
/* @__PURE__ */
|
|
2793
|
+
/* @__PURE__ */ jsx16(
|
|
3005
2794
|
ActionMenu,
|
|
3006
2795
|
{
|
|
3007
2796
|
disabled,
|
|
3008
|
-
trigger: /* @__PURE__ */
|
|
2797
|
+
trigger: /* @__PURE__ */ jsx16(
|
|
3009
2798
|
TriggerButton,
|
|
3010
2799
|
{
|
|
3011
2800
|
appearance,
|
|
3012
2801
|
size,
|
|
3013
2802
|
disabled,
|
|
3014
2803
|
ariaLabel: menuButtonAriaLabel,
|
|
3015
|
-
children: /* @__PURE__ */
|
|
2804
|
+
children: /* @__PURE__ */ jsx16(Icon6, { name: "chevron-down-outline", fixedWidth: true, "aria-hidden": true })
|
|
3016
2805
|
}
|
|
3017
2806
|
),
|
|
3018
2807
|
children: actionMenu
|