@mirohq/design-system-combobox 0.1.0-combobox.1 → 0.1.0-combobox.3

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/dist/module.js CHANGED
@@ -1,16 +1,39 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import React, { createContext, useState, useContext, useEffect } from 'react';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import React, { createContext, useRef, useState, useContext, useEffect } from 'react';
3
+ import * as Ariakit from '@ariakit/react';
4
+ import { Combobox as Combobox$1, ComboboxItem, Group as Group$1, GroupLabel as GroupLabel$1 } from '@ariakit/react';
3
5
  import { useFormFieldContext } from '@mirohq/design-system-base-form';
4
- import { useHover } from '@react-aria/interactions';
5
- import { stringAttrValue, booleanishAttrValue, booleanify } from '@mirohq/design-system-utils';
6
- import { Input } from '@mirohq/design-system-input';
7
- import { IconChevronDown, IconCheckMark } from '@mirohq/design-system-icons';
6
+ import * as RadixPopover from '@radix-ui/react-popover';
7
+ import { Portal as Portal$1 } from '@radix-ui/react-popover';
8
+ import { stringAttrValue, booleanishAttrValue, mergeRefs, booleanify } from '@mirohq/design-system-utils';
9
+ import { IconChevronDown, IconCross } from '@mirohq/design-system-icons';
8
10
  import { styled } from '@mirohq/design-system-stitches';
11
+ import { Input } from '@mirohq/design-system-input';
12
+ import { useAriaDisabled } from '@mirohq/design-system-use-aria-disabled';
13
+ import { focus } from '@mirohq/design-system-styles';
14
+ import { BaseButton } from '@mirohq/design-system-base-button';
9
15
  import { Primitive } from '@mirohq/design-system-primitive';
10
- import { Portal as Portal$1 } from '@radix-ui/react-popover';
11
- import { Group as Group$1, GroupLabel as GroupLabel$1 } from '@ariakit/react';
12
16
 
13
- const StyledTrigger = styled(Input, {});
17
+ const StyledActionButton = styled(Input.ActionButton, {
18
+ position: "absolute",
19
+ right: "$100",
20
+ top: "10px"
21
+ });
22
+ const StyledInput = styled(Input, {
23
+ flexWrap: "wrap",
24
+ flexGrow: 1,
25
+ gap: "$50",
26
+ minHeight: "$12",
27
+ "&&&": {
28
+ height: "max-content",
29
+ padding: "$100 $400 $100 $100"
30
+ },
31
+ "& input": {
32
+ minWidth: "30px",
33
+ flexBasis: 0,
34
+ flexGrow: 1
35
+ }
36
+ });
14
37
 
15
38
  const ComboboxContext = createContext({});
16
39
  const ComboboxProvider = ({
@@ -21,8 +44,10 @@ const ComboboxProvider = ({
21
44
  defaultValue: defaultValueProp,
22
45
  ...restProps
23
46
  }) => {
47
+ const triggerRef = useRef(null);
48
+ const contentRef = useRef(null);
24
49
  const [openState, setOpenState] = useState(defaultOpen);
25
- const [value, setValue] = useState(valueProp);
50
+ const [value, setValue] = useState(valueProp != null ? valueProp : []);
26
51
  const [defaultValue, setDefaultValue] = useState(defaultValueProp);
27
52
  const [searchValue, setSearchValue] = useState();
28
53
  const { valid: formFieldValid } = useFormFieldContext();
@@ -39,7 +64,9 @@ const ComboboxProvider = ({
39
64
  setDefaultValue,
40
65
  defaultValue,
41
66
  searchValue,
42
- setSearchValue
67
+ setSearchValue,
68
+ triggerRef,
69
+ contentRef
43
70
  },
44
71
  children
45
72
  }
@@ -55,16 +82,14 @@ const Trigger = React.forwardRef(
55
82
  "aria-describedby": ariaDescribedBy,
56
83
  "aria-invalid": ariaInvalid,
57
84
  placeholder,
58
- onHoverChange,
59
- onHoverStart,
60
- onHoverEnd,
61
85
  ...restProps
62
86
  }, forwardRef) => {
63
87
  const {
64
88
  "aria-disabled": ariaDisabled,
65
89
  valid: comboboxValid,
66
90
  disabled,
67
- value
91
+ value,
92
+ triggerRef
68
93
  } = useComboboxContext();
69
94
  const {
70
95
  formElementId,
@@ -73,16 +98,8 @@ const Trigger = React.forwardRef(
73
98
  valid: formFieldValid
74
99
  } = useFormFieldContext();
75
100
  const valid = formFieldValid != null ? formFieldValid : comboboxValid;
76
- const { hoverProps } = useHover({
77
- onHoverStart,
78
- onHoverEnd,
79
- onHoverChange: (isHovering) => {
80
- onHoverChange == null ? void 0 : onHoverChange(isHovering);
81
- }
82
- });
83
- const commonProps = {
101
+ const inputProps = {
84
102
  ...restProps,
85
- ref: forwardRef,
86
103
  "aria-disabled": ariaDisabled,
87
104
  "aria-invalid": ariaInvalid != null ? ariaInvalid : formFieldAriaInvalid,
88
105
  "aria-describedby": stringAttrValue(
@@ -93,35 +110,61 @@ const Trigger = React.forwardRef(
93
110
  disabled,
94
111
  invalid: booleanishAttrValue(valid),
95
112
  id: id != null ? id : formElementId,
96
- placeholder: value === void 0 ? placeholder : void 0
113
+ placeholder: (value == null ? void 0 : value.length) === 0 ? placeholder : void 0
97
114
  };
98
115
  const variants = {
99
116
  size
100
117
  };
101
- return /* @__PURE__ */ jsxs(StyledTrigger, { ...hoverProps, ...commonProps, ...variants, children: [
102
- children,
103
- /* @__PURE__ */ jsx(Input.ActionButton, { label: "custom label", children: /* @__PURE__ */ jsx(IconChevronDown, { size: "small", weight: "thin" }) })
104
- ] });
118
+ return /* @__PURE__ */ jsx(RadixPopover.Anchor, { ref: mergeRefs([triggerRef, forwardRef]), children: /* @__PURE__ */ jsx(
119
+ Combobox$1,
120
+ {
121
+ render: /* @__PURE__ */ jsxs(StyledInput, { ...inputProps, ...variants, children: [
122
+ children,
123
+ /* @__PURE__ */ jsx(StyledActionButton, { label: "custom label", children: /* @__PURE__ */ jsx(IconChevronDown, { size: "small", weight: "thin" }) })
124
+ ] })
125
+ }
126
+ ) });
105
127
  }
106
128
  );
107
129
 
108
- const StyledContent = styled(Primitive.div, {
130
+ const StyledContent = styled(RadixPopover.Content, {
109
131
  backgroundColor: "$background-neutrals-container",
110
132
  borderRadius: "$50",
111
133
  boxShadow: "$50",
112
- minWidth: "var(--radix-select-trigger-width)",
113
- padding: "$50",
114
- zIndex: "$select"
134
+ fontSize: "$175",
135
+ fontWeight: "normal",
136
+ lineHeight: "1.5",
137
+ minWidth: "var(--radix-popover-trigger-width)",
138
+ zIndex: "$select",
139
+ overflowY: "auto",
140
+ marginTop: "$200"
115
141
  });
116
142
 
117
143
  const Content = React.forwardRef(({ children, ...restProps }, forwardRef) => {
118
- const { open, openState } = useComboboxContext();
119
- if (!booleanify(open != null ? open : openState))
120
- return null;
121
- return /* @__PURE__ */ jsx(StyledContent, { ...restProps, ref: forwardRef, children });
144
+ const { triggerRef, contentRef } = useComboboxContext();
145
+ return /* @__PURE__ */ jsx(
146
+ StyledContent,
147
+ {
148
+ ...restProps,
149
+ ref: mergeRefs([forwardRef, contentRef]),
150
+ onOpenAutoFocus: (event) => event.preventDefault(),
151
+ onInteractOutside: (event) => {
152
+ var _a, _b;
153
+ const target = event.target;
154
+ const isTrigger = target === triggerRef.current;
155
+ const isContent = (_b = target != null && ((_a = contentRef.current) == null ? void 0 : _a.contains(target))) != null ? _b : false;
156
+ if (isTrigger || isContent) {
157
+ event.preventDefault();
158
+ }
159
+ },
160
+ children
161
+ }
162
+ );
122
163
  });
123
164
 
124
- const StyledItem = styled(Primitive.div, {
165
+ const StyledItem = styled(ComboboxItem, {
166
+ display: "flex",
167
+ alignItems: "center",
125
168
  borderRadius: "$50",
126
169
  boxSizing: "border-box",
127
170
  color: "$text-neutrals",
@@ -132,20 +175,39 @@ const StyledItem = styled(Primitive.div, {
132
175
  userSelect: "none",
133
176
  padding: "6px 0",
134
177
  paddingInline: "$150 $100",
178
+ ...focus.css({
179
+ boxShadow: "$focus-small",
180
+ outline: "1px solid transparent"
181
+ }),
135
182
  '&:hover:not([aria-disabled="true"])': {
136
183
  background: "$background-primary-subtle-hover",
137
184
  color: "$text-primary-hover"
185
+ },
186
+ "&:disabled, &[aria-disabled=true], &[data-disabled]": {
187
+ cursor: "default",
188
+ color: "$text-neutrals-disabled"
138
189
  }
139
190
  });
140
191
 
141
192
  const Item = React.forwardRef(
142
- ({ value, textValue, children, ...restProps }, forwardRef) => {
143
- const { value: comboboxValue } = useComboboxContext();
144
- const isSelected = comboboxValue === value;
145
- return /* @__PURE__ */ jsxs(StyledItem, { ref: forwardRef, ...restProps, children: [
146
- isSelected && /* @__PURE__ */ jsx(IconCheckMark, { size: "small", weight: "thin" }),
147
- children
148
- ] });
193
+ ({ disabled = false, value, textValue, children, ...restProps }, forwardRef) => {
194
+ const { "aria-disabled": ariaDisabled, ...restAriaDisabledProps } = useAriaDisabled(restProps, { allowArrows: true });
195
+ return /* @__PURE__ */ jsxs(
196
+ StyledItem,
197
+ {
198
+ ...restProps,
199
+ ...restAriaDisabledProps,
200
+ focusable: true,
201
+ accessibleWhenDisabled: ariaDisabled === true,
202
+ disabled: ariaDisabled === true || disabled,
203
+ ref: forwardRef,
204
+ value,
205
+ children: [
206
+ /* @__PURE__ */ jsx(Ariakit.ComboboxItemCheck, {}),
207
+ children
208
+ ]
209
+ }
210
+ );
149
211
  }
150
212
  );
151
213
 
@@ -159,56 +221,114 @@ const StyledGroupLabel = styled(GroupLabel$1, {});
159
221
 
160
222
  const GroupLabel = React.forwardRef((props, forwardRef) => /* @__PURE__ */ jsx(StyledGroupLabel, { ...props, ref: forwardRef }));
161
223
 
162
- const StyledValue = styled(Primitive.span, {});
224
+ const StyledChip = styled(Primitive.div, {
225
+ fontSize: "$150",
226
+ padding: "$50 $100",
227
+ borderRadius: "$half",
228
+ display: "flex",
229
+ alignItems: "center",
230
+ gap: "$50",
231
+ whiteSpace: "nowrap",
232
+ maxWidth: "$35",
233
+ background: "$gray-100",
234
+ color: "$gray-900"
235
+ });
236
+ const StyledChipContent = styled(Primitive.div, {
237
+ textOverflow: "ellipsis",
238
+ whiteSpace: "nowrap",
239
+ overflow: "hidden",
240
+ lineHeight: 1.3
241
+ });
163
242
 
164
- const Value = React.forwardRef(
165
- (props, forwardRef) => {
166
- const { value } = useComboboxContext();
167
- const isEmpty = value === void 0;
168
- if (isEmpty) {
169
- return null;
170
- }
171
- return /* @__PURE__ */ jsx(StyledValue, { ref: forwardRef, ...props, children: value });
172
- }
243
+ const StyledLeftSlot = styled(Primitive.span, {
244
+ order: -1,
245
+ marginRight: "$50"
246
+ });
247
+
248
+ const LeftSlot = StyledLeftSlot;
249
+
250
+ const Chip = React.forwardRef(
251
+ ({ children, disabled = false, onRemove, removeChipAriaLabel, ...restProps }, forwardRef) => /* @__PURE__ */ jsxs(StyledChip, { ...restProps, ref: forwardRef, children: [
252
+ /* @__PURE__ */ jsx(StyledChipContent, { children }),
253
+ !booleanify(disabled) && /* @__PURE__ */ jsx(BaseButton, { onClick: onRemove, "aria-label": removeChipAriaLabel, children: /* @__PURE__ */ jsx(IconCross, { size: "small", weight: "thin", color: "gray-500" }) })
254
+ ] })
173
255
  );
256
+ Chip.LeftSlot = LeftSlot;
257
+
258
+ const Value = ({ removeChipAriaLabel }) => {
259
+ const {
260
+ value,
261
+ setValue,
262
+ disabled,
263
+ "aria-disabled": ariaDisabled
264
+ } = useComboboxContext();
265
+ const isEmpty = value === void 0 || value.length === 0;
266
+ const isDisabled = ariaDisabled === true || disabled;
267
+ const onItemRemove = (item) => {
268
+ setValue((prevValue) => prevValue.filter((value2) => value2 !== item));
269
+ };
270
+ if (isEmpty) {
271
+ return null;
272
+ }
273
+ return /* @__PURE__ */ jsx(Fragment, { children: value.map((item) => /* @__PURE__ */ jsx(
274
+ Chip,
275
+ {
276
+ onRemove: () => onItemRemove(item),
277
+ disabled: isDisabled,
278
+ removeChipAriaLabel,
279
+ children: item
280
+ },
281
+ item
282
+ )) });
283
+ };
174
284
 
175
285
  const StyledComboboxContent = styled(Primitive.div, {});
176
286
 
177
- const Root = React.forwardRef(
178
- ({
179
- onOpen,
180
- onClose,
181
- onValueChange,
182
- value: valueProp,
183
- children,
184
- ...restProps
185
- }, forwardRef) => {
186
- const {
187
- required,
188
- readOnly,
189
- "aria-disabled": ariaDisabled,
190
- disabled,
191
- direction
192
- } = useComboboxContext();
193
- const { setRequired, setDisabled, setAriaDisabled, setReadOnly } = useFormFieldContext();
194
- useEffect(() => {
195
- setRequired == null ? void 0 : setRequired(required);
196
- setDisabled == null ? void 0 : setDisabled(disabled);
197
- setAriaDisabled == null ? void 0 : setAriaDisabled(ariaDisabled);
198
- setReadOnly == null ? void 0 : setReadOnly(readOnly);
199
- }, [
200
- readOnly,
201
- disabled,
202
- ariaDisabled,
203
- required,
204
- setRequired,
205
- setDisabled,
206
- setAriaDisabled,
207
- setReadOnly
208
- ]);
209
- return /* @__PURE__ */ jsx(StyledComboboxContent, { ...restProps, ref: forwardRef, dir: direction, children });
210
- }
211
- );
287
+ const Root = React.forwardRef(({ value: valueProp, onValueChange, children, ...restProps }, forwardRef) => {
288
+ const {
289
+ openState,
290
+ setOpenState,
291
+ defaultValue,
292
+ value,
293
+ setValue,
294
+ required,
295
+ readOnly,
296
+ "aria-disabled": ariaDisabled,
297
+ disabled,
298
+ direction
299
+ } = useComboboxContext();
300
+ const { setRequired, setDisabled, setAriaDisabled, setReadOnly } = useFormFieldContext();
301
+ useEffect(() => {
302
+ setRequired == null ? void 0 : setRequired(required);
303
+ setDisabled == null ? void 0 : setDisabled(disabled);
304
+ setAriaDisabled == null ? void 0 : setAriaDisabled(ariaDisabled);
305
+ setReadOnly == null ? void 0 : setReadOnly(readOnly);
306
+ }, [
307
+ readOnly,
308
+ disabled,
309
+ ariaDisabled,
310
+ required,
311
+ setRequired,
312
+ setDisabled,
313
+ setAriaDisabled,
314
+ setReadOnly
315
+ ]);
316
+ const onSetSelectedValue = (newValue) => {
317
+ onValueChange == null ? void 0 : onValueChange(newValue);
318
+ setValue(newValue);
319
+ };
320
+ return /* @__PURE__ */ jsx(RadixPopover.Root, { open: openState, onOpenChange: setOpenState, children: /* @__PURE__ */ jsx(
321
+ Ariakit.ComboboxProvider,
322
+ {
323
+ open: openState,
324
+ setOpen: setOpenState,
325
+ defaultSelectedValue: defaultValue,
326
+ selectedValue: value,
327
+ setSelectedValue: onSetSelectedValue,
328
+ children: /* @__PURE__ */ jsx(StyledComboboxContent, { ...restProps, ref: forwardRef, dir: direction, children })
329
+ }
330
+ ) });
331
+ });
212
332
  const Combobox = React.forwardRef(
213
333
  ({
214
334
  "aria-disabled": ariaDisabled,
@@ -220,6 +340,8 @@ const Combobox = React.forwardRef(
220
340
  required,
221
341
  value,
222
342
  defaultValue,
343
+ onOpen,
344
+ onValueChange,
223
345
  direction = "ltr",
224
346
  ...restProps
225
347
  }, forwardRef) => /* @__PURE__ */ jsx(
@@ -247,5 +369,5 @@ Combobox.Group = Group;
247
369
  Combobox.GroupLabel = GroupLabel;
248
370
  Combobox.Value = Value;
249
371
 
250
- export { Combobox };
372
+ export { Chip, Combobox };
251
373
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../src/partials/trigger.styled.tsx","../src/hooks/use-combobox-context.tsx","../src/partials/trigger.tsx","../src/partials/content.styled.tsx","../src/partials/content.tsx","../src/partials/item.styled.tsx","../src/partials/item.tsx","../src/partials/portal.tsx","../src/partials/group.styled.tsx","../src/partials/group.tsx","../src/partials/group-label.styled.tsx","../src/partials/group-label.tsx","../src/partials/value.styled.tsx","../src/partials/value.tsx","../src/combobox.styled.tsx","../src/combobox.tsx"],"sourcesContent":["import type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Input } from '@mirohq/design-system-input'\n\nexport const StyledTrigger = styled(Input, {})\n\nexport type StyledTriggerProps = StrictComponentProps<typeof StyledTrigger>\n","import { createContext, useContext, useState } from 'react'\nimport type { PropsWithChildren } from 'react'\nimport { useFormFieldContext } from '@mirohq/design-system-base-form'\nimport type { FormElementProps } from '@mirohq/design-system-base-form'\n\nimport type { Direction } from '../types'\n\ninterface ComboboxProps extends FormElementProps {\n open?: boolean\n defaultOpen?: boolean\n value?: string\n defaultValue?: string\n searchValue?: string\n direction?: Direction\n}\n\ninterface ComboboxContextProps extends ComboboxProps {\n setOpenState: React.Dispatch<React.SetStateAction<boolean | undefined>>\n openState?: boolean | undefined\n setValue: React.Dispatch<React.SetStateAction<string | undefined>>\n setDefaultValue: React.Dispatch<React.SetStateAction<string | undefined>>\n setSearchValue: React.Dispatch<React.SetStateAction<string | undefined>>\n}\n\nexport type ComboboxProviderProps = ComboboxProps\n\nconst ComboboxContext = createContext<ComboboxContextProps>({} as any)\n\nexport const ComboboxProvider = ({\n children,\n defaultOpen,\n valid,\n value: valueProp,\n defaultValue: defaultValueProp,\n ...restProps\n}: PropsWithChildren<ComboboxProviderProps>): JSX.Element => {\n const [openState, setOpenState] = useState(defaultOpen)\n const [value, setValue] = useState(valueProp)\n const [defaultValue, setDefaultValue] = useState(defaultValueProp)\n const [searchValue, setSearchValue] = useState<string | undefined>()\n\n const { valid: formFieldValid } = useFormFieldContext()\n\n return (\n <ComboboxContext.Provider\n value={{\n ...restProps,\n valid: valid ?? formFieldValid,\n openState,\n setOpenState,\n value,\n setValue,\n setDefaultValue,\n defaultValue,\n searchValue,\n setSearchValue,\n }}\n >\n {children}\n </ComboboxContext.Provider>\n )\n}\n\nexport const useComboboxContext = (): ComboboxContextProps =>\n useContext(ComboboxContext)\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { useHover } from '@react-aria/interactions'\nimport type { HoverEvents } from '@react-types/shared'\nimport {\n booleanishAttrValue,\n stringAttrValue,\n} from '@mirohq/design-system-utils'\nimport { useFormFieldContext } from '@mirohq/design-system-base-form'\nimport { Input } from '@mirohq/design-system-input'\nimport { IconChevronDown } from '@mirohq/design-system-icons'\n\nimport { StyledTrigger } from './trigger.styled'\nimport type { StyledTriggerProps } from './trigger.styled'\nimport { useComboboxContext } from '../hooks/use-combobox-context'\n\nexport interface TriggerProps extends StyledTriggerProps, HoverEvents {\n /**\n * The content.\n */\n children?: React.ReactNode\n\n /**\n * The size of the trigger.\n * @default 'large'\n */\n size?: StyledTriggerProps['size']\n\n /**\n * The content that will be rendered inside the Combobox.Trigger when no value or\n * defaultValue is set.\n */\n placeholder?: string\n}\n\nexport const Trigger = React.forwardRef<\n ElementRef<typeof StyledTrigger>,\n TriggerProps\n>(\n (\n {\n id,\n children,\n size = 'large',\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n placeholder,\n onHoverChange,\n onHoverStart,\n onHoverEnd,\n ...restProps\n },\n forwardRef\n ) => {\n const {\n 'aria-disabled': ariaDisabled,\n valid: comboboxValid,\n disabled,\n value,\n } = useComboboxContext()\n\n const {\n formElementId,\n ariaDescribedBy: formFieldContextDescribedBy,\n ariaInvalid: formFieldAriaInvalid,\n valid: formFieldValid,\n } = useFormFieldContext()\n\n const valid = formFieldValid ?? comboboxValid\n\n const { hoverProps } = useHover({\n onHoverStart,\n onHoverEnd,\n onHoverChange: isHovering => {\n onHoverChange?.(isHovering)\n },\n })\n\n const commonProps = {\n ...restProps,\n ref: forwardRef,\n 'aria-disabled': ariaDisabled,\n 'aria-invalid': ariaInvalid ?? formFieldAriaInvalid,\n 'aria-describedby': stringAttrValue(\n ariaDescribedBy,\n formFieldContextDescribedBy\n ),\n valid,\n disabled,\n invalid: booleanishAttrValue(valid),\n id: id ?? formElementId,\n placeholder: value === undefined ? placeholder : undefined,\n }\n\n const variants = {\n size,\n }\n\n return (\n <StyledTrigger {...hoverProps} {...commonProps} {...variants}>\n {children}\n <Input.ActionButton label='custom label'>\n <IconChevronDown size='small' weight='thin' />\n </Input.ActionButton>\n </StyledTrigger>\n )\n }\n)\n","import { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\n\nexport const StyledContent = styled(Primitive.div, {\n backgroundColor: '$background-neutrals-container',\n borderRadius: '$50',\n boxShadow: '$50',\n minWidth: 'var(--radix-select-trigger-width)',\n padding: '$50',\n zIndex: '$select',\n})\n\nexport type StyledContentProps = StrictComponentProps<typeof StyledContent>\n","import React from 'react'\nimport type { ElementRef, ReactNode } from 'react'\nimport { booleanify } from '@mirohq/design-system-utils'\n\nimport { StyledContent } from './content.styled'\nimport type { StyledContentProps } from './content.styled'\nimport { useComboboxContext } from '../hooks/use-combobox-context'\n\nexport interface ContentProps extends StyledContentProps {\n /**\n * Combobox's content.\n */\n children?: ReactNode\n}\n\nexport const Content = React.forwardRef<\n ElementRef<typeof StyledContent>,\n ContentProps\n>(({ children, ...restProps }, forwardRef) => {\n const { open, openState } = useComboboxContext()\n\n if (!booleanify(open ?? openState)) return null\n\n return (\n <StyledContent {...restProps} ref={forwardRef}>\n {children}\n </StyledContent>\n )\n})\n","import { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\n\nexport const StyledItem = styled(Primitive.div, {\n borderRadius: '$50',\n boxSizing: 'border-box',\n color: '$text-neutrals',\n cursor: 'pointer',\n fontSize: '$175',\n lineHeight: 1.5,\n position: 'relative',\n userSelect: 'none',\n padding: '6px 0',\n paddingInline: '$150 $100',\n\n '&:hover:not([aria-disabled=\"true\"])': {\n background: '$background-primary-subtle-hover',\n color: '$text-primary-hover',\n },\n})\n\nexport type StyledItemProps = StrictComponentProps<typeof StyledItem>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { IconCheckMark } from '@mirohq/design-system-icons'\n\nimport { StyledItem } from './item.styled'\nimport type { StyledItemProps } from './item.styled'\nimport { useComboboxContext } from '../hooks/use-combobox-context'\n\nexport interface ItemProps extends StyledItemProps {\n /**\n * The value given as data when submitted with a name.\n */\n value: string\n\n /**\n * When true, prevents the user from interacting with the item.\n * @default false\n */\n disabled?: boolean\n\n /**\n * Optional text used for typeahead purposes. By default the typeahead\n * behavior will use the Combobox's item text. Use this when the content is\n * complex, or you have non-textual content inside.\n */\n textValue?: string\n}\n\nexport const Item = React.forwardRef<ElementRef<typeof StyledItem>, ItemProps>(\n ({ value, textValue, children, ...restProps }, forwardRef) => {\n const { value: comboboxValue } = useComboboxContext()\n const isSelected = comboboxValue === value\n\n return (\n <StyledItem ref={forwardRef} {...restProps}>\n {isSelected && <IconCheckMark size='small' weight='thin' />}\n {children}\n </StyledItem>\n )\n }\n)\n","import React from 'react'\nimport type { PopoverPortalProps } from '@radix-ui/react-popover'\nimport { Portal as RadixPortal } from '@radix-ui/react-popover'\n\nexport interface PortalProps extends PopoverPortalProps {\n /**\n * Specify a container element to portal the content into.\n */\n container?: HTMLElement | null\n}\n\nexport const Portal: React.FC<PortalProps> = props => <RadixPortal {...props} />\n","import { Group } from '@ariakit/react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledGroup = styled(Group, {})\n\nexport type StyledGroupProps = StrictComponentProps<typeof StyledGroup>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledGroup } from './group.styled'\nimport type { StyledGroupProps } from './group.styled'\n\nexport interface GroupProps extends StyledGroupProps {}\n\nexport const Group = React.forwardRef<\n ElementRef<typeof StyledGroup>,\n GroupProps\n>((props, forwardRef) => <StyledGroup {...props} ref={forwardRef} />)\n","import { GroupLabel } from '@ariakit/react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledGroupLabel = styled(GroupLabel, {})\n\nexport type StyledGroupLabelProps = StrictComponentProps<\n typeof StyledGroupLabel\n>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledGroupLabel } from './group-label.styled'\nimport type { StyledGroupLabelProps } from './group-label.styled'\n\nexport interface GroupLabelProps extends StyledGroupLabelProps {}\n\nexport const GroupLabel = React.forwardRef<\n ElementRef<typeof StyledGroupLabel>,\n GroupLabelProps\n>((props, forwardRef) => <StyledGroupLabel {...props} ref={forwardRef} />)\n","import { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\n\nexport const StyledValue = styled(Primitive.span, {})\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { useComboboxContext } from '../hooks/use-combobox-context'\nimport { StyledValue } from './value.styled'\n\nexport const Value = React.forwardRef<ElementRef<typeof StyledValue>>(\n (props, forwardRef) => {\n const { value } = useComboboxContext()\n const isEmpty = value === undefined\n\n if (isEmpty) {\n return null\n }\n\n return (\n <StyledValue ref={forwardRef} {...props}>\n {value}\n </StyledValue>\n )\n }\n)\n","import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\nexport const StyledComboboxContent = styled(Primitive.div, {})\n\nexport type StyledComboboxProps = ComponentPropsWithRef<\n typeof StyledComboboxContent\n>\n","import React, { useEffect } from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\nimport { useFormFieldContext } from '@mirohq/design-system-base-form'\n\nimport { Trigger } from './partials/trigger'\nimport { Content } from './partials/content'\nimport { Item } from './partials/item'\nimport { Portal } from './partials/portal'\nimport { Group } from './partials/group'\nimport { GroupLabel } from './partials/group-label'\nimport { Value } from './partials/value'\nimport { StyledComboboxContent } from './combobox.styled'\nimport {\n ComboboxProvider,\n useComboboxContext,\n} from './hooks/use-combobox-context'\nimport type { ComboboxProviderProps } from './hooks/use-combobox-context'\nimport type { Direction } from './types'\n\nexport interface ComboboxProps extends ComboboxProviderProps {\n /**\n * The value of the combobox when initially rendered. Use when you do not need\n * to control the state of the combobox.\n */\n defaultValue?: string\n\n /**\n * The controlled value of the combobox. Should be used in conjunction with\n * onValueChange.\n */\n value?: string\n\n /**\n * Event handler called when the value changes.\n */\n onValueChange?: (value: string) => void\n\n /**\n * The open state of the combobox when it is initially rendered. Use when you do\n * not need to control its open state.\n * @default false\n */\n defaultOpen?: boolean\n\n /**\n * The controlled open state of the combobox. Must be used in conjunction with\n * onOpen and onClose.\n */\n open?: boolean\n\n /**\n * Event handler called when the combobox opens.\n */\n onOpen?: () => void\n\n /**\n * Event handler called when the combobox closes.\n */\n onClose?: () => void\n\n /**\n * The reading direction of the combobox when applicable. If omitted, inherits\n * globally from DirectionProvider or assumes LTR (left-to-right) reading\n * mode.\n * @default 'ltr'\n */\n direction?: Direction\n\n /**\n * The content of the combobox\n */\n children?: React.ReactNode\n}\n\nconst Root = React.forwardRef<\n ElementRef<typeof StyledComboboxContent>,\n ComboboxProps\n>(\n (\n {\n onOpen,\n onClose,\n onValueChange,\n value: valueProp,\n children,\n ...restProps\n },\n forwardRef\n ) => {\n const {\n required,\n readOnly,\n 'aria-disabled': ariaDisabled,\n disabled,\n direction,\n } = useComboboxContext()\n\n const { setRequired, setDisabled, setAriaDisabled, setReadOnly } =\n useFormFieldContext()\n\n useEffect(() => {\n setRequired?.(required)\n setDisabled?.(disabled)\n setAriaDisabled?.(ariaDisabled)\n setReadOnly?.(readOnly)\n }, [\n readOnly,\n disabled,\n ariaDisabled,\n required,\n setRequired,\n setDisabled,\n setAriaDisabled,\n setReadOnly,\n ])\n\n return (\n <StyledComboboxContent {...restProps} ref={forwardRef} dir={direction}>\n {children}\n </StyledComboboxContent>\n )\n }\n)\n\nexport const Combobox = React.forwardRef<\n ElementRef<typeof StyledComboboxContent>,\n ComboboxProps\n>(\n (\n {\n 'aria-disabled': ariaDisabled,\n defaultOpen = false,\n open,\n valid,\n disabled,\n readOnly,\n required,\n value,\n defaultValue,\n direction = 'ltr',\n ...restProps\n },\n forwardRef\n ) => (\n <ComboboxProvider\n defaultValue={defaultValue}\n value={value}\n defaultOpen={defaultOpen}\n open={open}\n valid={valid}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n aria-disabled={ariaDisabled}\n direction={direction}\n >\n <Root {...restProps} value={value} ref={forwardRef} />\n </ComboboxProvider>\n )\n) as ForwardRefExoticComponent<ComboboxProps> & Partials\n\nexport interface Partials {\n Portal: typeof Portal\n Trigger: typeof Trigger\n Content: typeof Content\n Item: typeof Item\n Group: typeof Group\n GroupLabel: typeof GroupLabel\n Value: typeof Value\n}\n\nCombobox.Portal = Portal\nCombobox.Trigger = Trigger\nCombobox.Content = Content\nCombobox.Item = Item\nCombobox.Group = Group\nCombobox.GroupLabel = GroupLabel\nCombobox.Value = Value\n"],"names":["RadixPortal","Group","GroupLabel"],"mappings":";;;;;;;;;;;;AAIO,MAAM,aAAgB,GAAA,MAA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AAAA,MAEA,8BAAC,IAAM,EAAA,EAAA,GAAG,SAAW,EAAA,KAAA,EAAc,KAAK,UAAY,EAAA,CAAA;AAAA,KAAA;AAAA,GACtD;AAEJ,EAAA;AAYA,QAAA,CAAS,MAAS,GAAA,MAAA,CAAA;AAClB,QAAA,CAAS,OAAU,GAAA,OAAA,CAAA;AACnB,QAAA,CAAS,OAAU,GAAA,OAAA,CAAA;AACnB,QAAA,CAAS,IAAO,GAAA,IAAA,CAAA;AAChB,QAAA,CAAS,KAAQ,GAAA,KAAA,CAAA;AACjB,QAAA,CAAS,UAAa,GAAA,UAAA,CAAA;AACtB,QAAA,CAAS,KAAQ,GAAA,KAAA;;;;"}
1
+ {"version":3,"file":"module.js","sources":["../src/partials/trigger.styled.tsx","../src/hooks/use-combobox-context.tsx","../src/partials/trigger.tsx","../src/partials/content.styled.tsx","../src/partials/content.tsx","../src/partials/item.styled.tsx","../src/partials/item.tsx","../src/partials/portal.tsx","../src/partials/group.styled.tsx","../src/partials/group.tsx","../src/partials/group-label.styled.tsx","../src/partials/group-label.tsx","../src/chip/chip.styled.tsx","../src/chip/left-icon.styled.tsx","../src/chip/left-slot.tsx","../src/chip/chip.tsx","../src/partials/value.tsx","../src/combobox.styled.tsx","../src/combobox.tsx"],"sourcesContent":["import { styled } from '@mirohq/design-system-stitches'\nimport { Input } from '@mirohq/design-system-input'\n\nexport const StyledActionButton = styled(Input.ActionButton, {\n position: 'absolute',\n right: '$100',\n top: '10px',\n})\n\nexport const StyledInput = styled(Input, {\n flexWrap: 'wrap',\n flexGrow: 1,\n gap: '$50',\n minHeight: '$12',\n\n '&&&': {\n height: 'max-content',\n padding: '$100 $400 $100 $100',\n },\n\n '& input': {\n minWidth: '30px',\n flexBasis: 0,\n flexGrow: 1,\n },\n})\n","import React, { createContext, useContext, useRef, useState } from 'react'\nimport type { PropsWithChildren } from 'react'\nimport { useFormFieldContext } from '@mirohq/design-system-base-form'\nimport type { FormElementProps } from '@mirohq/design-system-base-form'\n\nimport type { Direction } from '../types'\n\ninterface ComboboxProps extends FormElementProps {\n open?: boolean\n defaultOpen?: boolean\n value?: string[]\n defaultValue?: string[]\n searchValue?: string\n direction?: Direction\n}\n\ninterface ComboboxContextProps extends ComboboxProps {\n setOpenState: React.Dispatch<React.SetStateAction<boolean | undefined>>\n openState?: boolean | undefined\n setValue: React.Dispatch<React.SetStateAction<string[]>>\n setDefaultValue: React.Dispatch<React.SetStateAction<string[] | undefined>>\n setSearchValue: React.Dispatch<React.SetStateAction<string | undefined>>\n triggerRef: React.RefObject<HTMLInputElement>\n contentRef: React.RefObject<HTMLDivElement>\n}\n\nexport type ComboboxProviderProps = ComboboxProps\n\nconst ComboboxContext = createContext<ComboboxContextProps>({} as any)\n\nexport const ComboboxProvider = ({\n children,\n defaultOpen,\n valid,\n value: valueProp,\n defaultValue: defaultValueProp,\n ...restProps\n}: PropsWithChildren<ComboboxProviderProps>): JSX.Element => {\n const triggerRef = useRef<HTMLInputElement>(null)\n const contentRef = useRef<HTMLDivElement>(null)\n\n const [openState, setOpenState] = useState(defaultOpen)\n const [value, setValue] = useState(valueProp ?? [])\n const [defaultValue, setDefaultValue] = useState(defaultValueProp)\n const [searchValue, setSearchValue] = useState<string | undefined>()\n\n const { valid: formFieldValid } = useFormFieldContext()\n\n return (\n <ComboboxContext.Provider\n value={{\n ...restProps,\n valid: valid ?? formFieldValid,\n openState,\n setOpenState,\n value,\n setValue,\n setDefaultValue,\n defaultValue,\n searchValue,\n setSearchValue,\n triggerRef,\n contentRef,\n }}\n >\n {children}\n </ComboboxContext.Provider>\n )\n}\n\nexport const useComboboxContext = (): ComboboxContextProps =>\n useContext(ComboboxContext)\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { Combobox } from '@ariakit/react'\nimport {\n booleanishAttrValue,\n mergeRefs,\n stringAttrValue,\n} from '@mirohq/design-system-utils'\nimport { useFormFieldContext } from '@mirohq/design-system-base-form'\nimport { IconChevronDown } from '@mirohq/design-system-icons'\nimport type { Input, InputProps } from '@mirohq/design-system-input'\nimport * as RadixPopover from '@radix-ui/react-popover'\n\nimport { StyledActionButton, StyledInput } from './trigger.styled'\nimport { useComboboxContext } from '../hooks/use-combobox-context'\n\nexport type TriggerProps = InputProps & {\n /**\n * The content.\n */\n children?: React.ReactNode\n\n /**\n * The size of the trigger.\n * @default 'large'\n */\n size?: InputProps['size']\n\n /**\n * The content that will be rendered inside the Combobox.Trigger when no value or\n * defaultValue is set.\n */\n placeholder?: string\n}\n\nexport const Trigger = React.forwardRef<ElementRef<typeof Input>, TriggerProps>(\n (\n {\n id,\n children,\n size = 'large',\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n placeholder,\n ...restProps\n },\n forwardRef\n ) => {\n const {\n 'aria-disabled': ariaDisabled,\n valid: comboboxValid,\n disabled,\n value,\n triggerRef,\n } = useComboboxContext()\n\n const {\n formElementId,\n ariaDescribedBy: formFieldContextDescribedBy,\n ariaInvalid: formFieldAriaInvalid,\n valid: formFieldValid,\n } = useFormFieldContext()\n\n const valid = formFieldValid ?? comboboxValid\n\n const inputProps = {\n ...restProps,\n 'aria-disabled': ariaDisabled,\n 'aria-invalid': ariaInvalid ?? formFieldAriaInvalid,\n 'aria-describedby': stringAttrValue(\n ariaDescribedBy,\n formFieldContextDescribedBy\n ),\n valid,\n disabled,\n invalid: booleanishAttrValue(valid),\n id: id ?? formElementId,\n placeholder: value?.length === 0 ? placeholder : undefined,\n }\n\n const variants = {\n size,\n }\n\n return (\n <RadixPopover.Anchor ref={mergeRefs([triggerRef, forwardRef])}>\n <Combobox\n render={\n <StyledInput {...inputProps} {...variants}>\n {children}\n {/* @todo https://miro.atlassian.net/browse/CLC-335 */}\n <StyledActionButton label='custom label'>\n <IconChevronDown size='small' weight='thin' />\n </StyledActionButton>\n </StyledInput>\n }\n />\n </RadixPopover.Anchor>\n )\n }\n)\n","import { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport * as RadixPopover from '@radix-ui/react-popover'\n\nexport const StyledContent = styled(RadixPopover.Content, {\n backgroundColor: '$background-neutrals-container',\n borderRadius: '$50',\n boxShadow: '$50',\n fontSize: '$175',\n fontWeight: 'normal',\n lineHeight: '1.5',\n minWidth: 'var(--radix-popover-trigger-width)',\n zIndex: '$select',\n overflowY: 'auto',\n marginTop: '$200',\n})\n\nexport type StyledContentProps = StrictComponentProps<typeof StyledContent>\n","import React from 'react'\nimport type { ElementRef, ReactNode } from 'react'\nimport { mergeRefs } from '@mirohq/design-system-utils'\n\nimport { StyledContent } from './content.styled'\nimport type { StyledContentProps } from './content.styled'\nimport { useComboboxContext } from '../hooks/use-combobox-context'\n\nexport interface ContentProps extends StyledContentProps {\n /**\n * Combobox's content.\n */\n children?: ReactNode\n}\n\nexport const Content = React.forwardRef<\n ElementRef<typeof StyledContent>,\n ContentProps\n>(({ children, ...restProps }, forwardRef) => {\n const { triggerRef, contentRef } = useComboboxContext()\n\n return (\n <StyledContent\n {...restProps}\n ref={mergeRefs([forwardRef, contentRef])}\n onOpenAutoFocus={event => event.preventDefault()}\n onInteractOutside={event => {\n const target = event.target as Element | null\n const isTrigger = target === triggerRef.current\n const isContent =\n (target != null && contentRef.current?.contains(target)) ?? false\n if (isTrigger || isContent) {\n event.preventDefault()\n }\n }}\n >\n {children}\n </StyledContent>\n )\n})\n","import { ComboboxItem } from '@ariakit/react'\nimport { focus } from '@mirohq/design-system-styles'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledItem = styled(ComboboxItem, {\n display: 'flex',\n alignItems: 'center',\n borderRadius: '$50',\n boxSizing: 'border-box',\n color: '$text-neutrals',\n cursor: 'pointer',\n fontSize: '$175',\n lineHeight: 1.5,\n position: 'relative',\n userSelect: 'none',\n padding: '6px 0',\n paddingInline: '$150 $100',\n\n ...focus.css({\n boxShadow: '$focus-small',\n outline: '1px solid transparent',\n }),\n\n '&:hover:not([aria-disabled=\"true\"])': {\n background: '$background-primary-subtle-hover',\n color: '$text-primary-hover',\n },\n\n '&:disabled, &[aria-disabled=true], &[data-disabled]': {\n cursor: 'default',\n color: '$text-neutrals-disabled',\n },\n})\n\nexport type StyledItemProps = StrictComponentProps<typeof StyledItem>\n","import React from 'react'\nimport type { ElementRef, ReactNode } from 'react'\nimport * as Ariakit from '@ariakit/react'\nimport { useAriaDisabled } from '@mirohq/design-system-use-aria-disabled'\n\nimport { StyledItem } from './item.styled'\nimport type { StyledItemProps } from './item.styled'\n\nexport interface ItemProps extends StyledItemProps {\n /**\n * The value given as data when submitted with a name.\n */\n value: string\n\n /**\n * When true, prevents the user from interacting with the item.\n * @default false\n */\n disabled?: boolean\n\n /**\n * Optional text used for typeahead purposes. By default the typeahead\n * behavior will use the Combobox's item text. Use this when the content is\n * complex, or you have non-textual content inside.\n */\n textValue?: string\n\n /**\n * Item's content.\n */\n children?: ReactNode\n}\n\nexport const Item = React.forwardRef<ElementRef<typeof StyledItem>, ItemProps>(\n (\n { disabled = false, value, textValue, children, ...restProps },\n forwardRef\n ) => {\n const { 'aria-disabled': ariaDisabled, ...restAriaDisabledProps } =\n useAriaDisabled(restProps, { allowArrows: true })\n\n return (\n <StyledItem\n {...restProps}\n {...restAriaDisabledProps}\n focusable\n accessibleWhenDisabled={ariaDisabled === true}\n disabled={ariaDisabled === true || disabled}\n ref={forwardRef}\n value={value}\n >\n <Ariakit.ComboboxItemCheck />\n {children}\n </StyledItem>\n )\n }\n)\n","import React from 'react'\nimport type { PopoverPortalProps } from '@radix-ui/react-popover'\nimport { Portal as RadixPortal } from '@radix-ui/react-popover'\n\nexport interface PortalProps extends PopoverPortalProps {\n /**\n * Specify a container element to portal the content into.\n */\n container?: HTMLElement | null\n}\n\nexport const Portal: React.FC<PortalProps> = props => <RadixPortal {...props} />\n","import { Group } from '@ariakit/react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledGroup = styled(Group, {})\n\nexport type StyledGroupProps = StrictComponentProps<typeof StyledGroup>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledGroup } from './group.styled'\nimport type { StyledGroupProps } from './group.styled'\n\nexport interface GroupProps extends StyledGroupProps {}\n\nexport const Group = React.forwardRef<\n ElementRef<typeof StyledGroup>,\n GroupProps\n>((props, forwardRef) => <StyledGroup {...props} ref={forwardRef} />)\n","import { GroupLabel } from '@ariakit/react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledGroupLabel = styled(GroupLabel, {})\n\nexport type StyledGroupLabelProps = StrictComponentProps<\n typeof StyledGroupLabel\n>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledGroupLabel } from './group-label.styled'\nimport type { StyledGroupLabelProps } from './group-label.styled'\n\nexport interface GroupLabelProps extends StyledGroupLabelProps {}\n\nexport const GroupLabel = React.forwardRef<\n ElementRef<typeof StyledGroupLabel>,\n GroupLabelProps\n>((props, forwardRef) => <StyledGroupLabel {...props} ref={forwardRef} />)\n","import { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\n\nexport const StyledChip = styled(Primitive.div, {\n fontSize: '$150',\n padding: '$50 $100',\n borderRadius: '$half',\n display: 'flex',\n alignItems: 'center',\n gap: '$50',\n whiteSpace: 'nowrap',\n maxWidth: '$35',\n background: '$gray-100',\n color: '$gray-900',\n})\n\nexport const StyledChipContent = styled(Primitive.div, {\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n lineHeight: 1.3,\n})\n\nexport type StyledChipProps = StrictComponentProps<typeof StyledChip>\n","import type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\n\nexport const StyledLeftSlot = styled(Primitive.span, {\n order: -1,\n marginRight: '$50',\n})\n\nexport type StyledLeftSlotProps = StrictComponentProps<typeof StyledLeftSlot>\n","import type { StyledLeftSlotProps } from './left-icon.styled'\nimport { StyledLeftSlot } from './left-icon.styled'\n\nexport interface LeftSlotProps extends StyledLeftSlotProps {}\n\nexport const LeftSlot = StyledLeftSlot\n","import React from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\nimport { BaseButton } from '@mirohq/design-system-base-button'\nimport { IconCross } from '@mirohq/design-system-icons'\nimport { booleanify } from '@mirohq/design-system-utils'\n\nimport { StyledChip, StyledChipContent } from './chip.styled'\nimport type { StyledChipProps } from './chip.styled'\nimport { LeftSlot } from './left-slot'\n\nexport type ChipProps = StyledChipProps & {\n /**\n * Event handler called when the chip's remove button is clicked.\n */\n onRemove?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void\n\n /**\n * When true, prevents the user from interacting with the item.\n * @default false\n */\n disabled?: boolean\n\n /**\n * Remove chip label used to make the button recognizable by the screen readers.\n */\n removeChipAriaLabel?: string\n}\n\nexport const Chip = React.forwardRef<ElementRef<typeof StyledChip>, ChipProps>(\n (\n { children, disabled = false, onRemove, removeChipAriaLabel, ...restProps },\n forwardRef\n ) => (\n <StyledChip {...restProps} ref={forwardRef}>\n <StyledChipContent>{children}</StyledChipContent>\n {!booleanify(disabled) && (\n <BaseButton onClick={onRemove} aria-label={removeChipAriaLabel}>\n <IconCross size='small' weight='thin' color='gray-500' />\n </BaseButton>\n )}\n </StyledChip>\n )\n) as ForwardRefExoticComponent<ChipProps> & Partials\n\nexport interface Partials {\n LeftSlot: typeof LeftSlot\n}\n\nChip.LeftSlot = LeftSlot\n","import type { FC } from 'react'\nimport React from 'react'\n\nimport { useComboboxContext } from '../hooks/use-combobox-context'\nimport { Chip } from '../chip/chip'\nimport type { StyledChipProps } from '../chip/chip.styled'\n\nexport type ValueProps = StyledChipProps & {\n /**\n * Remove chip label used to make the button recognizable by the screen readers.\n */\n removeChipAriaLabel?: string\n}\n\nexport const Value: FC<ValueProps> = ({ removeChipAriaLabel }) => {\n const {\n value,\n setValue,\n disabled,\n 'aria-disabled': ariaDisabled,\n } = useComboboxContext()\n const isEmpty = value === undefined || value.length === 0\n const isDisabled = ariaDisabled === true || disabled\n\n const onItemRemove = (item: string): void => {\n setValue(prevValue => prevValue.filter(value => value !== item))\n }\n\n if (isEmpty) {\n return null\n }\n\n return (\n <>\n {value.map(item => (\n <Chip\n key={item}\n onRemove={() => onItemRemove(item)}\n disabled={isDisabled}\n removeChipAriaLabel={removeChipAriaLabel}\n >\n {item}\n </Chip>\n ))}\n </>\n )\n}\n","import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\nexport const StyledComboboxContent = styled(Primitive.div, {})\n\nexport type StyledComboboxProps = ComponentPropsWithRef<\n typeof StyledComboboxContent\n>\n","import React, { useEffect } from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\nimport * as Ariakit from '@ariakit/react'\nimport { useFormFieldContext } from '@mirohq/design-system-base-form'\nimport * as RadixPopover from '@radix-ui/react-popover'\n\nimport { Trigger } from './partials/trigger'\nimport { Content } from './partials/content'\nimport { Item } from './partials/item'\nimport { Portal } from './partials/portal'\nimport { Group } from './partials/group'\nimport { GroupLabel } from './partials/group-label'\nimport { Value } from './partials/value'\nimport { StyledComboboxContent } from './combobox.styled'\nimport {\n ComboboxProvider,\n useComboboxContext,\n} from './hooks/use-combobox-context'\nimport type { ComboboxProviderProps } from './hooks/use-combobox-context'\nimport type { Direction } from './types'\n\nexport interface ComboboxProps extends ComboboxProviderProps {\n /**\n * The value of the combobox when initially rendered. Use when you do not need\n * to control the state of the combobox.\n */\n defaultValue?: string[]\n\n /**\n * The controlled value of the combobox. Should be used in conjunction with\n * onValueChange.\n */\n value?: string[]\n\n /**\n * Event handler called when the value changes.\n */\n onValueChange?: (value: string[]) => void\n\n /**\n * The open state of the combobox when it is initially rendered. Use when you do\n * not need to control its open state.\n * @default false\n */\n defaultOpen?: boolean\n\n /**\n * The controlled open state of the combobox. Must be used in conjunction with\n * onOpen and onClose.\n */\n open?: boolean\n\n /**\n * Event handler called when the combobox opens.\n */\n onOpen?: () => void\n\n /**\n * Event handler called when the combobox closes.\n */\n onClose?: () => void\n\n /**\n * The reading direction of the combobox when applicable. If omitted, inherits\n * globally from DirectionProvider or assumes LTR (left-to-right) reading\n * mode.\n * @default 'ltr'\n */\n direction?: Direction\n\n /**\n * The content of the combobox\n */\n children?: React.ReactNode\n}\n\nconst Root = React.forwardRef<\n ElementRef<typeof StyledComboboxContent>,\n ComboboxProps\n>(({ value: valueProp, onValueChange, children, ...restProps }, forwardRef) => {\n const {\n openState,\n setOpenState,\n defaultValue,\n value,\n setValue,\n required,\n readOnly,\n 'aria-disabled': ariaDisabled,\n disabled,\n direction,\n } = useComboboxContext()\n\n const { setRequired, setDisabled, setAriaDisabled, setReadOnly } =\n useFormFieldContext()\n\n useEffect(() => {\n setRequired?.(required)\n setDisabled?.(disabled)\n setAriaDisabled?.(ariaDisabled)\n setReadOnly?.(readOnly)\n }, [\n readOnly,\n disabled,\n ariaDisabled,\n required,\n setRequired,\n setDisabled,\n setAriaDisabled,\n setReadOnly,\n ])\n\n const onSetSelectedValue = (newValue: string | string[]): void => {\n // setSelectedValue from Ariakit.ComboboxProvider expects to accept a union string | string[], type cast is required to specify that it's a multi value\n onValueChange?.(newValue as string[])\n setValue(newValue as string[])\n }\n\n return (\n <RadixPopover.Root open={openState} onOpenChange={setOpenState}>\n <Ariakit.ComboboxProvider\n open={openState}\n setOpen={setOpenState}\n defaultSelectedValue={defaultValue}\n selectedValue={value}\n setSelectedValue={onSetSelectedValue}\n >\n <StyledComboboxContent {...restProps} ref={forwardRef} dir={direction}>\n {children}\n </StyledComboboxContent>\n </Ariakit.ComboboxProvider>\n </RadixPopover.Root>\n )\n})\n\nexport const Combobox = React.forwardRef<\n ElementRef<typeof StyledComboboxContent>,\n ComboboxProps\n>(\n (\n {\n 'aria-disabled': ariaDisabled,\n defaultOpen = false,\n open,\n valid,\n disabled,\n readOnly,\n required,\n value,\n defaultValue,\n onOpen,\n onValueChange,\n direction = 'ltr',\n ...restProps\n },\n forwardRef\n ) => (\n <ComboboxProvider\n defaultValue={defaultValue}\n value={value}\n defaultOpen={defaultOpen}\n open={open}\n valid={valid}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n aria-disabled={ariaDisabled}\n direction={direction}\n >\n <Root {...restProps} value={value} ref={forwardRef} />\n </ComboboxProvider>\n )\n) as ForwardRefExoticComponent<ComboboxProps> & Partials\n\nexport interface Partials {\n Portal: typeof Portal\n Trigger: typeof Trigger\n Content: typeof Content\n Item: typeof Item\n Group: typeof Group\n GroupLabel: typeof GroupLabel\n Value: typeof Value\n}\n\nCombobox.Portal = Portal\nCombobox.Trigger = Trigger\nCombobox.Content = Content\nCombobox.Item = Item\nCombobox.Group = Group\nCombobox.GroupLabel = GroupLabel\nCombobox.Value = Value\n"],"names":["Combobox","RadixPortal","Group","GroupLabel","value"],"mappings":";;;;;;;;;;;;;;;;AAGa,MAAA,kBAAA,GAAqB,MAAO,CAAA,KAAA,CAAM,YAAc,EAAA;AAAA,EAC3D,QAAU,EAAA,UAAA;AAAA,EACV,KAAO,EAAA,MAAA;AAAA,EACP,GAAK,EAAA,MAAA;AACP,CAAC,CAAA,CAAA;AAEY,MAAA,WAAA,GAAc,OAAO,KAAO,EAAA;AAAA,EACvC,QAAU,EAAA,MAAA;AAAA,EACV,QAAU,EAAA,CAAA;AAAA,EACV,GAAK,EAAA,KAAA;AAAA,EACL,SAAW,EAAA,KAAA;AAAA,EAEX,KAAO,EAAA;AAAA,IACL,MAAQ,EAAA,aAAA;AAAA,IACR,OAAS,EAAA,qBAAA;AAAA,GACX;AAAA,EAEA,SAAW,EAAA;AAAA,IACT,QAAU,EAAA,MAAA;AAAA,IACV,SAAW,EAAA,CAAA;AAAA,IACX,QAAU,EAAA,CAAA;AAAA,G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