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

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/main.js CHANGED
@@ -4,59 +4,83 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var React = require('react');
7
+ var designSystemBaseForm = require('@mirohq/design-system-base-form');
7
8
  var interactions = require('@react-aria/interactions');
8
9
  var designSystemUtils = require('@mirohq/design-system-utils');
9
- var designSystemBaseForm = require('@mirohq/design-system-base-form');
10
10
  var designSystemInput = require('@mirohq/design-system-input');
11
11
  var designSystemIcons = require('@mirohq/design-system-icons');
12
12
  var designSystemStitches = require('@mirohq/design-system-stitches');
13
13
  var designSystemPrimitive = require('@mirohq/design-system-primitive');
14
- var Ariakit = require('@ariakit/react');
15
14
  var reactPopover = require('@radix-ui/react-popover');
15
+ var react = require('@ariakit/react');
16
16
 
17
17
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
18
 
19
- function _interopNamespace(e) {
20
- if (e && e.__esModule) return e;
21
- var n = Object.create(null);
22
- if (e) {
23
- Object.keys(e).forEach(function (k) {
24
- if (k !== 'default') {
25
- var d = Object.getOwnPropertyDescriptor(e, k);
26
- Object.defineProperty(n, k, d.get ? d : {
27
- enumerable: true,
28
- get: function () { return e[k]; }
29
- });
30
- }
31
- });
32
- }
33
- n["default"] = e;
34
- return Object.freeze(n);
35
- }
36
-
37
19
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
38
- var Ariakit__namespace = /*#__PURE__*/_interopNamespace(Ariakit);
39
20
 
40
21
  const StyledTrigger = designSystemStitches.styled(designSystemInput.Input, {});
41
22
 
23
+ const ComboboxContext = React.createContext({});
24
+ const ComboboxProvider = ({
25
+ children,
26
+ defaultOpen,
27
+ valid,
28
+ value: valueProp,
29
+ defaultValue: defaultValueProp,
30
+ ...restProps
31
+ }) => {
32
+ const [openState, setOpenState] = React.useState(defaultOpen);
33
+ const [value, setValue] = React.useState(valueProp);
34
+ const [defaultValue, setDefaultValue] = React.useState(defaultValueProp);
35
+ const [searchValue, setSearchValue] = React.useState();
36
+ const { valid: formFieldValid } = designSystemBaseForm.useFormFieldContext();
37
+ return /* @__PURE__ */ jsxRuntime.jsx(
38
+ ComboboxContext.Provider,
39
+ {
40
+ value: {
41
+ ...restProps,
42
+ valid: valid != null ? valid : formFieldValid,
43
+ openState,
44
+ setOpenState,
45
+ value,
46
+ setValue,
47
+ setDefaultValue,
48
+ defaultValue,
49
+ searchValue,
50
+ setSearchValue
51
+ },
52
+ children
53
+ }
54
+ );
55
+ };
56
+ const useComboboxContext = () => React.useContext(ComboboxContext);
57
+
42
58
  const Trigger = React__default["default"].forwardRef(
43
59
  ({
44
60
  id,
45
61
  children,
46
62
  size = "large",
47
63
  "aria-describedby": ariaDescribedBy,
64
+ "aria-invalid": ariaInvalid,
65
+ placeholder,
48
66
  onHoverChange,
49
67
  onHoverStart,
50
68
  onHoverEnd,
51
69
  ...restProps
52
70
  }, forwardRef) => {
71
+ const {
72
+ "aria-disabled": ariaDisabled,
73
+ valid: comboboxValid,
74
+ disabled,
75
+ value
76
+ } = useComboboxContext();
53
77
  const {
54
78
  formElementId,
55
79
  ariaDescribedBy: formFieldContextDescribedBy,
56
- ariaInvalid,
80
+ ariaInvalid: formFieldAriaInvalid,
57
81
  valid: formFieldValid
58
82
  } = designSystemBaseForm.useFormFieldContext();
59
- const valid = formFieldValid;
83
+ const valid = formFieldValid != null ? formFieldValid : comboboxValid;
60
84
  const { hoverProps } = interactions.useHover({
61
85
  onHoverStart,
62
86
  onHoverEnd,
@@ -67,14 +91,17 @@ const Trigger = React__default["default"].forwardRef(
67
91
  const commonProps = {
68
92
  ...restProps,
69
93
  ref: forwardRef,
70
- "aria-invalid": ariaInvalid,
94
+ "aria-disabled": ariaDisabled,
95
+ "aria-invalid": ariaInvalid != null ? ariaInvalid : formFieldAriaInvalid,
71
96
  "aria-describedby": designSystemUtils.stringAttrValue(
72
97
  ariaDescribedBy,
73
98
  formFieldContextDescribedBy
74
99
  ),
75
100
  valid,
101
+ disabled,
76
102
  invalid: designSystemUtils.booleanishAttrValue(valid),
77
- id: id != null ? id : formElementId
103
+ id: id != null ? id : formElementId,
104
+ placeholder: value === void 0 ? placeholder : void 0
78
105
  };
79
106
  const variants = {
80
107
  size
@@ -95,7 +122,12 @@ const StyledContent = designSystemStitches.styled(designSystemPrimitive.Primitiv
95
122
  zIndex: "$select"
96
123
  });
97
124
 
98
- const Content = React__default["default"].forwardRef(({ children, ...restProps }, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledContent, { ...restProps, ref: forwardRef, children }));
125
+ const Content = React__default["default"].forwardRef(({ children, ...restProps }, forwardRef) => {
126
+ const { open, openState } = useComboboxContext();
127
+ if (!designSystemUtils.booleanify(open != null ? open : openState))
128
+ return null;
129
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledContent, { ...restProps, ref: forwardRef, children });
130
+ });
99
131
 
100
132
  const StyledItem = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
101
133
  borderRadius: "$50",
@@ -114,34 +146,114 @@ const StyledItem = designSystemStitches.styled(designSystemPrimitive.Primitive.d
114
146
  }
115
147
  });
116
148
 
117
- const StyledItemIndicator = designSystemStitches.styled(Ariakit__namespace.ComboboxItemCheck, {});
118
-
119
149
  const Item = React__default["default"].forwardRef(
120
- ({ textValue, children, ...restProps }, forwardRef) => /* @__PURE__ */ jsxRuntime.jsxs(StyledItem, { ref: forwardRef, ...restProps, children: [
121
- /* @__PURE__ */ jsxRuntime.jsx(StyledItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconCheckMark, { size: "small" }) }),
122
- children
123
- ] })
150
+ ({ value, textValue, children, ...restProps }, forwardRef) => {
151
+ const { value: comboboxValue } = useComboboxContext();
152
+ const isSelected = comboboxValue === value;
153
+ return /* @__PURE__ */ jsxRuntime.jsxs(StyledItem, { ref: forwardRef, ...restProps, children: [
154
+ isSelected && /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconCheckMark, { size: "small", weight: "thin" }),
155
+ children
156
+ ] });
157
+ }
124
158
  );
125
159
 
126
160
  const Portal = (props) => /* @__PURE__ */ jsxRuntime.jsx(reactPopover.Portal, { ...props });
127
161
 
128
- const StyledGroup = designSystemStitches.styled(Ariakit.Group, {});
162
+ const StyledGroup = designSystemStitches.styled(react.Group, {});
129
163
 
130
164
  const Group = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledGroup, { ...props, ref: forwardRef }));
131
165
 
132
- const StyledGroupLabel = designSystemStitches.styled(Ariakit.GroupLabel, {});
166
+ const StyledGroupLabel = designSystemStitches.styled(react.GroupLabel, {});
133
167
 
134
168
  const GroupLabel = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledGroupLabel, { ...props, ref: forwardRef }));
135
169
 
136
- const StyledCombobox = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {});
170
+ const StyledValue = designSystemStitches.styled(designSystemPrimitive.Primitive.span, {});
137
171
 
138
- const Combobox = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledCombobox, { ...props, ref: forwardRef }));
172
+ const Value = React__default["default"].forwardRef(
173
+ (props, forwardRef) => {
174
+ const { value } = useComboboxContext();
175
+ const isEmpty = value === void 0;
176
+ if (isEmpty) {
177
+ return null;
178
+ }
179
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledValue, { ref: forwardRef, ...props, children: value });
180
+ }
181
+ );
182
+
183
+ const StyledComboboxContent = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {});
184
+
185
+ const Root = React__default["default"].forwardRef(
186
+ ({
187
+ onOpen,
188
+ onClose,
189
+ onValueChange,
190
+ value: valueProp,
191
+ children,
192
+ ...restProps
193
+ }, forwardRef) => {
194
+ const {
195
+ required,
196
+ readOnly,
197
+ "aria-disabled": ariaDisabled,
198
+ disabled,
199
+ direction
200
+ } = useComboboxContext();
201
+ const { setRequired, setDisabled, setAriaDisabled, setReadOnly } = designSystemBaseForm.useFormFieldContext();
202
+ React.useEffect(() => {
203
+ setRequired == null ? void 0 : setRequired(required);
204
+ setDisabled == null ? void 0 : setDisabled(disabled);
205
+ setAriaDisabled == null ? void 0 : setAriaDisabled(ariaDisabled);
206
+ setReadOnly == null ? void 0 : setReadOnly(readOnly);
207
+ }, [
208
+ readOnly,
209
+ disabled,
210
+ ariaDisabled,
211
+ required,
212
+ setRequired,
213
+ setDisabled,
214
+ setAriaDisabled,
215
+ setReadOnly
216
+ ]);
217
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledComboboxContent, { ...restProps, ref: forwardRef, dir: direction, children });
218
+ }
219
+ );
220
+ const Combobox = React__default["default"].forwardRef(
221
+ ({
222
+ "aria-disabled": ariaDisabled,
223
+ defaultOpen = false,
224
+ open,
225
+ valid,
226
+ disabled,
227
+ readOnly,
228
+ required,
229
+ value,
230
+ defaultValue,
231
+ direction = "ltr",
232
+ ...restProps
233
+ }, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(
234
+ ComboboxProvider,
235
+ {
236
+ defaultValue,
237
+ value,
238
+ defaultOpen,
239
+ open,
240
+ valid,
241
+ required,
242
+ disabled,
243
+ readOnly,
244
+ "aria-disabled": ariaDisabled,
245
+ direction,
246
+ children: /* @__PURE__ */ jsxRuntime.jsx(Root, { ...restProps, value, ref: forwardRef })
247
+ }
248
+ )
249
+ );
139
250
  Combobox.Portal = Portal;
140
251
  Combobox.Trigger = Trigger;
141
252
  Combobox.Content = Content;
142
253
  Combobox.Item = Item;
143
254
  Combobox.Group = Group;
144
255
  Combobox.GroupLabel = GroupLabel;
256
+ Combobox.Value = Value;
145
257
 
146
258
  exports.Combobox = Combobox;
147
259
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sources":["../src/partials/trigger.styled.tsx","../src/partials/trigger.tsx","../src/partials/content.styled.tsx","../src/partials/content.tsx","../src/partials/item.styled.tsx","../src/partials/item-indicator.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/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 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'\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\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 onHoverChange,\n onHoverStart,\n onHoverEnd,\n ...restProps\n },\n forwardRef\n ) => {\n const {\n formElementId,\n ariaDescribedBy: formFieldContextDescribedBy,\n ariaInvalid,\n valid: formFieldValid,\n } = useFormFieldContext()\n\n /** @todo: validity, add validation logic after implementing the combobox context */\n const valid = formFieldValid\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-invalid': ariaInvalid,\n 'aria-describedby': stringAttrValue(\n ariaDescribedBy,\n formFieldContextDescribedBy\n ),\n valid,\n invalid: booleanishAttrValue(valid),\n id: id ?? formElementId,\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'\n\nimport { StyledContent } from './content.styled'\nimport type { StyledContentProps } from './content.styled'\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 <StyledContent {...restProps} ref={forwardRef}>\n {children}\n </StyledContent>\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 * as Ariakit from '@ariakit/react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledItemIndicator = styled(Ariakit.ComboboxItemCheck, {})\n\nexport type StyledItemIndicatorProps = StrictComponentProps<\n typeof StyledItemIndicator\n>\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 { StyledItemIndicator } from './item-indicator.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\nexport const Item = React.forwardRef<ElementRef<typeof StyledItem>, ItemProps>(\n ({ textValue, children, ...restProps }, forwardRef) => (\n <StyledItem ref={forwardRef} {...restProps}>\n <StyledItemIndicator>\n <IconCheckMark size='small' />\n </StyledItemIndicator>\n {children}\n </StyledItem>\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 type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\nexport const StyledCombobox = styled(Primitive.div, {})\n\nexport type StyledComboboxProps = ComponentPropsWithRef<typeof StyledCombobox>\n","import React from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\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 { StyledCombobox } from './combobox.styled'\nimport type { StyledComboboxProps } from './combobox.styled'\n\nexport interface ComboboxProps extends StyledComboboxProps {}\n\nexport const Combobox = React.forwardRef<\n ElementRef<typeof StyledCombobox>,\n ComboboxProps\n>((props, forwardRef) => (\n <StyledCombobox {...props} ref={forwardRef} />\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}\n\nCombobox.Portal = Portal\nCombobox.Trigger = Trigger\nCombobox.Content = Content\nCombobox.Item = Item\nCombobox.Group = Group\nCombobox.GroupLabel = GroupLabel\n"],"names":["styled","Input","React","useFormFieldContext","useHover","stringAttrValue","booleanishAttrValue","jsx","IconChevronDown","Primitive","Ariakit","jsxs","IconCheckMark","RadixPortal","Group","GroupLabel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,MAAM,aAAgB,GAAAA,2BAAA,CAAOC,uBAAO,EAAA,EAAE,CAAA;;ACwBtC,MAAM,UAAUC,yBAAM,CAAA,UAAA;AAAA,EAI3B,CACE;AAAA,IACE,EAAA;AAAA,IACA,QAAA;AAAA,IACA,IAAO,GAAA,OAAA;AAAA,IACP,kBAAoB,EAAA,eAAA;AAAA,IACpB,aAAA;AAAA,IACA,YAAA;AAAA,IACA,UAAA;AAAA,IACA,GAAG,SAAA;AAAA,KAEL,UACG,KAAA;AACH,IAAM,MAAA;AAAA,MACJ,aAAA;AAAA,MACA,eAAiB,EAAA,2BAAA;AAAA,MACjB,WAAA;AAAA,MACA,KAAO,EAAA,cAAA;AAAA,QACLC,wCAAoB,EAAA,CAAA;AAGxB,IAAA,MAAM,KAAQ,GAAA,cAAA,CAAA;AAEd,IAAM,MAAA,EAAE,UAAW,EAAA,GAAIC,qBAAS,CAAA;AAAA,MAC9B,YAAA;AAAA,MACA,UAAA;AAAA,MACA,eAAe,CAAc,UAAA,KAAA;AAC3B,QAAgB,aAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,aAAA,CAAA,UAAA,CAAA,CAAA;AAAA,OAClB;AAAA,KACD,CAAA,CAAA;AAED,IAAA,MAAM,WAAc,GAAA;AAAA,MAClB,GAAG,SAAA;AAAA,MACH,GAAK,EAAA,UAAA;AAAA,MACL,cAAgB,EAAA,WAAA;AAAA,MAChB,kBAAoB,EAAAC,iCAAA;AAAA,QAClB,eAAA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AA,CAAC,KAAO,EAAA,UAAA,qBAAgBK,cAAA,CAAA,gBAAA,EAAA,EAAkB,GAAG,KAAA,EAAO,GAAK,EAAA,UAAA,EAAY,CAAE,CAAA;;ACPlE,MAAM,cAAiB,GAAAP,2BAAA,CAAOS,+BAAU,CAAA,GAAA,EAAK,EAAE,CAAA;;ACU/C,MAAM,QAAW,GAAAP,yBAAA,CAAM,UAG5B,CAAA,CAAC,KAAO,EAAA,UAAA,qBACPK,cAAA,CAAA,cAAA,EAAA,EAAgB,GAAG,KAAA,EAAO,GAAK,EAAA,UAAA,EAAY,CAC7C,EAAA;AAWD,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;;;;"}
1
+ {"version":3,"file":"main.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":["styled","Input","createContext","useState","useFormFieldContext","jsx","useContext","React","useHover","stringAttrValue","booleanishAttrValue","IconChevronDown","Primitive","booleanify","jsxs","IconCheckMark","RadixPortal","Group","GroupLabel","useEffect"],"mappings":";;;;;;;;;;;;;;;;;;;;AAIO,MAAM,aAAgB,GAAAA,2BAAA,CAAOC,uBAAO,EAAA,EAAE,CAAA;;ACsB7C,MAAM,eAAA,GAAkBC,mBAAoC,CAAA,EAAS,CAAA,CAAA;AAE9D,MAAM,mBAAmB,CAAC;AAAA,EAC/B,QAAA;AAAA,EACA,WAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAO,EAAA,SAAA;AAAA,EACP,YAAc,EAAA,gBAAA;AAAA,EACd,GAAG,SAAA;AACL,CAA6D,KAAA;AAC3D,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAIC,eAAS,WAAW,CAAA,CAAA;AACtD,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAIA,eAAS,SAAS,CAAA,CAAA;AAC5C,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAAA,GAAIA,eAAS,gBAAgB,CAAA,CAAA;AACjE,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAIA,cAA6B,EAAA,CAAA;AAEnE,EAAA,MAAM,EAAE,KAAA,EAAO,cAAe,EAAA,GAAIC,wCAAoB,EAAA,CAAA;AAEtD,EACE,uBAAAC,cAAA;AAAA,IAAC,eAAgB,CAAA,QAAA;AAAA,IAAhB;AAAA,MACC,KAAO,EAAA;AAAA,QACL,GAAG,SAAA;AAAA,QACH,OAAO,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,yBAAM,CAAA,UAAA;AAAA,EAI5B,CACE;AAAA,IACE,eAAiB,EAAA,YAAA;AAAA,IACjB,WAAc,GAAA,KAAA;AAAA,IACd,IAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA;AAAA,IACA,YAAA;AAAA,IACA,SAAY,GAAA,KAAA;AAAA,IACZ,GAAG,SAAA;AAAA,KAEL,UAEA,qBAAAF,cAAA;AAAA,IAAC,gBAAA;AAAA,IAAA;AAAA,MACC,YAAA;AAAA,MACA,KAAA;AAAA,MACA,WAAA;AAAA,MACA,IAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,eAAe,EAAA,YAAA;AAAA,MACf,SAAA;AAAA,MAEA,yCAAC,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;;;;"}
package/dist/module.js CHANGED
@@ -1,36 +1,78 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import React from 'react';
3
- import { useHover } from '@react-aria/interactions';
4
- import { stringAttrValue, booleanishAttrValue } from '@mirohq/design-system-utils';
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import React, { createContext, useState, useContext, useEffect } from 'react';
5
3
  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
6
  import { Input } from '@mirohq/design-system-input';
7
7
  import { IconChevronDown, IconCheckMark } from '@mirohq/design-system-icons';
8
8
  import { styled } from '@mirohq/design-system-stitches';
9
9
  import { Primitive } from '@mirohq/design-system-primitive';
10
- import * as Ariakit from '@ariakit/react';
11
- import { Group as Group$1, GroupLabel as GroupLabel$1 } from '@ariakit/react';
12
10
  import { Portal as Portal$1 } from '@radix-ui/react-popover';
11
+ import { Group as Group$1, GroupLabel as GroupLabel$1 } from '@ariakit/react';
13
12
 
14
13
  const StyledTrigger = styled(Input, {});
15
14
 
15
+ const ComboboxContext = createContext({});
16
+ const ComboboxProvider = ({
17
+ children,
18
+ defaultOpen,
19
+ valid,
20
+ value: valueProp,
21
+ defaultValue: defaultValueProp,
22
+ ...restProps
23
+ }) => {
24
+ const [openState, setOpenState] = useState(defaultOpen);
25
+ const [value, setValue] = useState(valueProp);
26
+ const [defaultValue, setDefaultValue] = useState(defaultValueProp);
27
+ const [searchValue, setSearchValue] = useState();
28
+ const { valid: formFieldValid } = useFormFieldContext();
29
+ return /* @__PURE__ */ jsx(
30
+ ComboboxContext.Provider,
31
+ {
32
+ value: {
33
+ ...restProps,
34
+ valid: valid != null ? valid : formFieldValid,
35
+ openState,
36
+ setOpenState,
37
+ value,
38
+ setValue,
39
+ setDefaultValue,
40
+ defaultValue,
41
+ searchValue,
42
+ setSearchValue
43
+ },
44
+ children
45
+ }
46
+ );
47
+ };
48
+ const useComboboxContext = () => useContext(ComboboxContext);
49
+
16
50
  const Trigger = React.forwardRef(
17
51
  ({
18
52
  id,
19
53
  children,
20
54
  size = "large",
21
55
  "aria-describedby": ariaDescribedBy,
56
+ "aria-invalid": ariaInvalid,
57
+ placeholder,
22
58
  onHoverChange,
23
59
  onHoverStart,
24
60
  onHoverEnd,
25
61
  ...restProps
26
62
  }, forwardRef) => {
63
+ const {
64
+ "aria-disabled": ariaDisabled,
65
+ valid: comboboxValid,
66
+ disabled,
67
+ value
68
+ } = useComboboxContext();
27
69
  const {
28
70
  formElementId,
29
71
  ariaDescribedBy: formFieldContextDescribedBy,
30
- ariaInvalid,
72
+ ariaInvalid: formFieldAriaInvalid,
31
73
  valid: formFieldValid
32
74
  } = useFormFieldContext();
33
- const valid = formFieldValid;
75
+ const valid = formFieldValid != null ? formFieldValid : comboboxValid;
34
76
  const { hoverProps } = useHover({
35
77
  onHoverStart,
36
78
  onHoverEnd,
@@ -41,14 +83,17 @@ const Trigger = React.forwardRef(
41
83
  const commonProps = {
42
84
  ...restProps,
43
85
  ref: forwardRef,
44
- "aria-invalid": ariaInvalid,
86
+ "aria-disabled": ariaDisabled,
87
+ "aria-invalid": ariaInvalid != null ? ariaInvalid : formFieldAriaInvalid,
45
88
  "aria-describedby": stringAttrValue(
46
89
  ariaDescribedBy,
47
90
  formFieldContextDescribedBy
48
91
  ),
49
92
  valid,
93
+ disabled,
50
94
  invalid: booleanishAttrValue(valid),
51
- id: id != null ? id : formElementId
95
+ id: id != null ? id : formElementId,
96
+ placeholder: value === void 0 ? placeholder : void 0
52
97
  };
53
98
  const variants = {
54
99
  size
@@ -69,7 +114,12 @@ const StyledContent = styled(Primitive.div, {
69
114
  zIndex: "$select"
70
115
  });
71
116
 
72
- const Content = React.forwardRef(({ children, ...restProps }, forwardRef) => /* @__PURE__ */ jsx(StyledContent, { ...restProps, ref: forwardRef, children }));
117
+ 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 });
122
+ });
73
123
 
74
124
  const StyledItem = styled(Primitive.div, {
75
125
  borderRadius: "$50",
@@ -88,13 +138,15 @@ const StyledItem = styled(Primitive.div, {
88
138
  }
89
139
  });
90
140
 
91
- const StyledItemIndicator = styled(Ariakit.ComboboxItemCheck, {});
92
-
93
141
  const Item = React.forwardRef(
94
- ({ textValue, children, ...restProps }, forwardRef) => /* @__PURE__ */ jsxs(StyledItem, { ref: forwardRef, ...restProps, children: [
95
- /* @__PURE__ */ jsx(StyledItemIndicator, { children: /* @__PURE__ */ jsx(IconCheckMark, { size: "small" }) }),
96
- children
97
- ] })
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
+ ] });
149
+ }
98
150
  );
99
151
 
100
152
  const Portal = (props) => /* @__PURE__ */ jsx(Portal$1, { ...props });
@@ -107,15 +159,93 @@ const StyledGroupLabel = styled(GroupLabel$1, {});
107
159
 
108
160
  const GroupLabel = React.forwardRef((props, forwardRef) => /* @__PURE__ */ jsx(StyledGroupLabel, { ...props, ref: forwardRef }));
109
161
 
110
- const StyledCombobox = styled(Primitive.div, {});
162
+ const StyledValue = styled(Primitive.span, {});
163
+
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
+ }
173
+ );
111
174
 
112
- const Combobox = React.forwardRef((props, forwardRef) => /* @__PURE__ */ jsx(StyledCombobox, { ...props, ref: forwardRef }));
175
+ const StyledComboboxContent = styled(Primitive.div, {});
176
+
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
+ );
212
+ const Combobox = React.forwardRef(
213
+ ({
214
+ "aria-disabled": ariaDisabled,
215
+ defaultOpen = false,
216
+ open,
217
+ valid,
218
+ disabled,
219
+ readOnly,
220
+ required,
221
+ value,
222
+ defaultValue,
223
+ direction = "ltr",
224
+ ...restProps
225
+ }, forwardRef) => /* @__PURE__ */ jsx(
226
+ ComboboxProvider,
227
+ {
228
+ defaultValue,
229
+ value,
230
+ defaultOpen,
231
+ open,
232
+ valid,
233
+ required,
234
+ disabled,
235
+ readOnly,
236
+ "aria-disabled": ariaDisabled,
237
+ direction,
238
+ children: /* @__PURE__ */ jsx(Root, { ...restProps, value, ref: forwardRef })
239
+ }
240
+ )
241
+ );
113
242
  Combobox.Portal = Portal;
114
243
  Combobox.Trigger = Trigger;
115
244
  Combobox.Content = Content;
116
245
  Combobox.Item = Item;
117
246
  Combobox.Group = Group;
118
247
  Combobox.GroupLabel = GroupLabel;
248
+ Combobox.Value = Value;
119
249
 
120
250
  export { Combobox };
121
251
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../src/partials/trigger.styled.tsx","../src/partials/trigger.tsx","../src/partials/content.styled.tsx","../src/partials/content.tsx","../src/partials/item.styled.tsx","../src/partials/item-indicator.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/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 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'\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\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 onHoverChange,\n onHoverStart,\n onHoverEnd,\n ...restProps\n },\n forwardRef\n ) => {\n const {\n formElementId,\n ariaDescribedBy: formFieldContextDescribedBy,\n ariaInvalid,\n valid: formFieldValid,\n } = useFormFieldContext()\n\n /** @todo: validity, add validation logic after implementing the combobox context */\n const valid = formFieldValid\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-invalid': ariaInvalid,\n 'aria-describedby': stringAttrValue(\n ariaDescribedBy,\n formFieldContextDescribedBy\n ),\n valid,\n invalid: booleanishAttrValue(valid),\n id: id ?? formElementId,\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'\n\nimport { StyledContent } from './content.styled'\nimport type { StyledContentProps } from './content.styled'\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 <StyledContent {...restProps} ref={forwardRef}>\n {children}\n </StyledContent>\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 * as Ariakit from '@ariakit/react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledItemIndicator = styled(Ariakit.ComboboxItemCheck, {})\n\nexport type StyledItemIndicatorProps = StrictComponentProps<\n typeof StyledItemIndicator\n>\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 { StyledItemIndicator } from './item-indicator.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\nexport const Item = React.forwardRef<ElementRef<typeof StyledItem>, ItemProps>(\n ({ textValue, children, ...restProps }, forwardRef) => (\n <StyledItem ref={forwardRef} {...restProps}>\n <StyledItemIndicator>\n <IconCheckMark size='small' />\n </StyledItemIndicator>\n {children}\n </StyledItem>\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 type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\nexport const StyledCombobox = styled(Primitive.div, {})\n\nexport type StyledComboboxProps = ComponentPropsWithRef<typeof StyledCombobox>\n","import React from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\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 { StyledCombobox } from './combobox.styled'\nimport type { StyledComboboxProps } from './combobox.styled'\n\nexport interface ComboboxProps extends StyledComboboxProps {}\n\nexport const Combobox = React.forwardRef<\n ElementRef<typeof StyledCombobox>,\n ComboboxProps\n>((props, forwardRef) => (\n <StyledCombobox {...props} ref={forwardRef} />\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}\n\nCombobox.Portal = Portal\nCombobox.Trigger = Trigger\nCombobox.Content = Content\nCombobox.Item = Item\nCombobox.Group = Group\nCombobox.GroupLabel = GroupLabel\n"],"names":["RadixPortal","Group","GroupLabel"],"mappings":";;;;;;;;;;;;;AAI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A,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;;;;"}
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,MAAA,CAAO,KAAO,EAAA,EAAE,CAAA;;ACsB7C,MAAM,eAAA,GAAkB,aAAoC,CAAA,EAAS,C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AA,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;;;;"}
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import react__default, { ReactNode, ComponentPropsWithRef } from 'react';
2
+ import react__default, { ReactNode } from 'react';
3
3
  import { HoverEvents } from '@react-types/shared';
4
4
  import * as _mirohq_design_system_stitches from '@mirohq/design-system-stitches';
5
5
  import { StrictComponentProps } from '@mirohq/design-system-stitches';
@@ -10,6 +10,7 @@ import * as packages_components_input_src_types from 'packages/components/input/
10
10
  import * as _mirohq_design_system_primitive from '@mirohq/design-system-primitive';
11
11
  import { PopoverPortalProps } from '@radix-ui/react-popover';
12
12
  import * as _ariakit_react from '@ariakit/react';
13
+ import { FormElementProps } from '@mirohq/design-system-base-form';
13
14
 
14
15
  declare const StyledTrigger: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<_stitches_react_types_styled_component.StyledComponent<react.ForwardRefExoticComponent<packages_components_input_src_types.ClearableInputProps> & packages_components_input_src_input.Partials, {}, {}, _stitches_react_types_css_util.CSS<{}, {
15
16
  'border-widths': {
@@ -512,6 +513,11 @@ interface TriggerProps extends StyledTriggerProps, HoverEvents {
512
513
  * @default 'large'
513
514
  */
514
515
  size?: StyledTriggerProps['size'];
516
+ /**
517
+ * The content that will be rendered inside the Combobox.Trigger when no value or
518
+ * defaultValue is set.
519
+ */
520
+ placeholder?: string;
515
521
  }
516
522
  declare const Trigger: react__default.ForwardRefExoticComponent<Omit<TriggerProps, "ref"> & react__default.RefAttributes<HTMLInputElement>>;
517
523
 
@@ -2522,498 +2528,65 @@ interface GroupLabelProps extends StyledGroupLabelProps {
2522
2528
  }
2523
2529
  declare const GroupLabel: react__default.ForwardRefExoticComponent<Omit<GroupLabelProps, "ref"> & react__default.RefAttributes<HTMLDivElement>>;
2524
2530
 
2525
- declare const StyledCombobox: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<_stitches_react_types_styled_component.StyledComponent<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"div">>, {}, {}, _stitches_react_types_css_util.CSS<{}, {
2526
- 'border-widths': {
2527
- readonly none: 0;
2528
- readonly sm: "1px";
2529
- readonly md: "2px";
2530
- readonly lg: "4px";
2531
- };
2532
- colors: {
2533
- readonly black: any;
2534
- readonly 'blue-100': any;
2535
- readonly 'blue-200': any;
2536
- readonly 'blue-300': any;
2537
- readonly 'blue-400': any;
2538
- readonly 'blue-500': any;
2539
- readonly 'blue-600': any;
2540
- readonly 'blue-700': any;
2541
- readonly 'blue-800': any;
2542
- readonly 'blue-900': any;
2543
- readonly 'blue-1000': any;
2544
- readonly 'gray-100': any;
2545
- readonly 'gray-200': any;
2546
- readonly 'gray-300': any;
2547
- readonly 'gray-400': any;
2548
- readonly 'gray-500': any;
2549
- readonly 'gray-600': any;
2550
- readonly 'gray-700': any;
2551
- readonly 'gray-800': any;
2552
- readonly 'gray-900': any;
2553
- readonly 'green-100': any;
2554
- readonly 'green-200': any;
2555
- readonly 'green-300': any;
2556
- readonly 'green-400': any;
2557
- readonly 'green-500': any;
2558
- readonly 'green-600': any;
2559
- readonly 'green-700': any;
2560
- readonly 'green-800': any;
2561
- readonly 'green-900': any;
2562
- readonly 'indigo-100': any;
2563
- readonly 'indigo-200': any;
2564
- readonly 'indigo-300': any;
2565
- readonly 'indigo-400': any;
2566
- readonly 'indigo-500': any;
2567
- readonly 'indigo-600': any;
2568
- readonly 'indigo-700': any;
2569
- readonly 'indigo-800': any;
2570
- readonly 'indigo-900': any;
2571
- readonly 'red-100': any;
2572
- readonly 'red-200': any;
2573
- readonly 'red-300': any;
2574
- readonly 'red-400': any;
2575
- readonly 'red-500': any;
2576
- readonly 'red-600': any;
2577
- readonly 'red-700': any;
2578
- readonly 'red-800': any;
2579
- readonly 'red-900': any;
2580
- readonly transparent: any;
2581
- readonly white: any;
2582
- readonly 'yellow-100': any;
2583
- readonly 'yellow-200': any;
2584
- readonly 'yellow-300': any;
2585
- readonly 'yellow-400': any;
2586
- readonly 'yellow-500': any;
2587
- readonly 'yellow-600': any;
2588
- readonly 'yellow-700': any;
2589
- readonly 'yellow-800': any;
2590
- readonly 'yellow-900': any;
2591
- "background-alpha-active"?: any;
2592
- "background-alpha-hover"?: any;
2593
- "background-danger-prominent"?: any;
2594
- "background-danger-prominent-active"?: any;
2595
- "background-danger-prominent-hover"?: any;
2596
- "background-danger-subtle"?: any;
2597
- "background-danger-subtle-active"?: any;
2598
- "background-danger-subtle-hover"?: any;
2599
- "background-neutrals"?: any;
2600
- "background-neutrals-active"?: any;
2601
- "background-neutrals-container"?: any;
2602
- "background-neutrals-controls-disabled"?: any;
2603
- "background-neutrals-disabled"?: any;
2604
- "background-neutrals-hover"?: any;
2605
- "background-neutrals-inactive"?: any;
2606
- "background-neutrals-inactive-hover"?: any;
2607
- "background-neutrals-inverted"?: any;
2608
- "background-neutrals-inverted-subtle"?: any;
2609
- "background-neutrals-page"?: any;
2610
- "background-neutrals-page-subtle"?: any;
2611
- "background-neutrals-scrolls"?: any;
2612
- "background-neutrals-scrolls-expanded"?: any;
2613
- "background-neutrals-scrolls-hover"?: any;
2614
- "background-neutrals-scrolls-pressed"?: any;
2615
- "background-neutrals-scrolls-pressed-hover"?: any;
2616
- "background-neutrals-subtle"?: any;
2617
- "background-neutrals-subtle-active"?: any;
2618
- "background-neutrals-subtle-hover"?: any;
2619
- "background-primary-prominent"?: any;
2620
- "background-primary-prominent-active"?: any;
2621
- "background-primary-prominent-expanded"?: any;
2622
- "background-primary-prominent-hover"?: any;
2623
- "background-primary-prominent-pressed"?: any;
2624
- "background-primary-prominent-pressed-hover"?: any;
2625
- "background-primary-prominent-selected"?: any;
2626
- "background-primary-subtle"?: any;
2627
- "background-primary-subtle-active"?: any;
2628
- "background-primary-subtle-expanded"?: any;
2629
- "background-primary-subtle-hover"?: any;
2630
- "background-primary-subtle-pressed"?: any;
2631
- "background-primary-subtle-pressed-hover"?: any;
2632
- "background-primary-subtle-selected"?: any;
2633
- "background-success"?: any;
2634
- "background-success-prominent"?: any;
2635
- "background-success-prominent-active"?: any;
2636
- "background-success-prominent-hover"?: any;
2637
- "background-warning-prominent"?: any;
2638
- "background-warning-subtle"?: any;
2639
- "border-danger"?: any;
2640
- "border-danger-active"?: any;
2641
- "border-danger-hover"?: any;
2642
- "border-focus-inner"?: any;
2643
- "border-focus-middle"?: any;
2644
- "border-focus-outer"?: any;
2645
- "border-neutrals"?: any;
2646
- "border-neutrals-active"?: any;
2647
- "border-neutrals-controls"?: any;
2648
- "border-neutrals-controls-disabled"?: any;
2649
- "border-neutrals-disabled"?: any;
2650
- "border-neutrals-hover"?: any;
2651
- "border-neutrals-inverted"?: any;
2652
- "border-neutrals-subtle"?: any;
2653
- "border-neutrals-text"?: any;
2654
- "border-neutrals-text-active"?: any;
2655
- "border-neutrals-text-hover"?: any;
2656
- "border-neutrals-text-subtle"?: any;
2657
- "border-neutrals-text-subtle-active"?: any;
2658
- "border-neutrals-text-subtle-hover"?: any;
2659
- "border-neutrals-transparent"?: any;
2660
- "border-primary"?: any;
2661
- "border-primary-active"?: any;
2662
- "border-primary-hover"?: any;
2663
- "border-primary-inverted"?: any;
2664
- "border-success"?: any;
2665
- "border-success-active"?: any;
2666
- "border-success-hover"?: any;
2667
- "border-warning"?: any;
2668
- "icon-danger"?: any;
2669
- "icon-danger-active"?: any;
2670
- "icon-danger-hover"?: any;
2671
- "icon-danger-inverted"?: any;
2672
- "icon-neutrals"?: any;
2673
- "icon-neutrals-disabled"?: any;
2674
- "icon-neutrals-inactive"?: any;
2675
- "icon-neutrals-inactive-hover"?: any;
2676
- "icon-neutrals-inverted"?: any;
2677
- "icon-neutrals-search"?: any;
2678
- "icon-neutrals-subtle"?: any;
2679
- "icon-neutrals-text"?: any;
2680
- "icon-primary"?: any;
2681
- "icon-primary-active"?: any;
2682
- "icon-primary-hover"?: any;
2683
- "icon-primary-inverted"?: any;
2684
- "icon-primary-selected"?: any;
2685
- "icon-success"?: any;
2686
- "icon-success-active"?: any;
2687
- "icon-success-hover"?: any;
2688
- "icon-success-inverted"?: any;
2689
- "icon-warning"?: any;
2690
- "icon-warning-prominent"?: any;
2691
- "icon-warning-subtle"?: any;
2692
- "text-danger"?: any;
2693
- "text-danger-active"?: any;
2694
- "text-danger-hover"?: any;
2695
- "text-danger-inverted"?: any;
2696
- "text-neutrals"?: any;
2697
- "text-neutrals-active"?: any;
2698
- "text-neutrals-disabled"?: any;
2699
- "text-neutrals-hover"?: any;
2700
- "text-neutrals-inverted"?: any;
2701
- "text-neutrals-placeholder"?: any;
2702
- "text-neutrals-placeholder-only"?: any;
2703
- "text-neutrals-subtle"?: any;
2704
- "text-neutrals-subtle-active"?: any;
2705
- "text-neutrals-subtle-hover"?: any;
2706
- "text-primary"?: any;
2707
- "text-primary-active"?: any;
2708
- "text-primary-hover"?: any;
2709
- "text-primary-inverted"?: any;
2710
- "text-primary-inverted-subtle"?: any;
2711
- "text-primary-selected"?: any;
2712
- "text-success"?: any;
2713
- "text-success-active"?: any;
2714
- "text-success-hover"?: any;
2715
- "text-success-inverted"?: any;
2716
- "text-warning"?: any;
2717
- "text-warning-subtle"?: any;
2718
- };
2719
- 'font-sizes': {
2720
- readonly 150: "0.75rem";
2721
- readonly 175: "0.875rem";
2722
- readonly 200: "1rem";
2723
- readonly 225: "1.125rem";
2724
- readonly 250: "1.25rem";
2725
- readonly 300: "1.5rem";
2726
- readonly 400: "2rem";
2727
- readonly 500: "2.5rem";
2728
- readonly 600: "3rem";
2729
- readonly 800: "4rem";
2730
- readonly 900: "4.5rem";
2731
- };
2732
- fonts: {
2733
- readonly heading: "Roobert, sans-serif";
2734
- readonly body: "Open Sans, sans-serif";
2735
- };
2736
- radii: {
2737
- readonly none: 0;
2738
- readonly half: "999em";
2739
- readonly 25: "2px";
2740
- readonly 50: "4px";
2741
- readonly 75: "6px";
2742
- readonly 100: "8px";
2743
- readonly 200: "16px";
2744
- };
2745
- shadows: {
2746
- readonly 'focus-small': "0 0 0 2px $colors$border-focus-outer, inset 0 0 0 2px $colors$border-focus-middle, inset 0 0 0 3px $colors$border-focus-inner";
2747
- readonly 'focus-small-outline': "0 0 0 2px $colors$border-focus-outer, inset 0 0 0 1px $colors$border-focus-middle, inset 0 0 0 2px $colors$border-focus-inner";
2748
- readonly 'focus-large': "0 0 0 4px $colors$border-focus-inner, inset 0 0 0 2px $colors$border-focus-middle, inset 0 0 0 3px $colors$border-focus-outer";
2749
- readonly 'focus-controls': "0 0 0 1px $colors$border-focus-inner, 0 0 0 3px $colors$border-focus-middle, 0 0 0 5px $colors$border-focus-outer";
2750
- readonly 'focus-controls-error': "0 0 0 1px $colors$border-focus-inner, 0 0 0 3px $colors$border-danger, 0 0 0 5px $colors$background-danger-subtle-hover";
2751
- readonly 'focus-controls-success': "0 0 0 1px $colors$border-focus-inner, 0 0 0 3px $colors$background-success-prominent, 0 0 0 5px $colors$background-success";
2752
- };
2753
- sizes: {
2754
- readonly number: string;
2755
- readonly 'icon-200': "16px";
2756
- readonly 'icon-300': "24px";
2757
- readonly 'icon-400': "32px";
2758
- };
2759
- space: {
2760
- readonly 0: "0px";
2761
- readonly 25: "2px";
2762
- readonly 50: "4px";
2763
- readonly 100: "8px";
2764
- readonly 150: "12px";
2765
- readonly 200: "16px";
2766
- readonly 300: "24px";
2767
- readonly 400: "32px";
2768
- readonly 500: "40px";
2769
- readonly 600: "48px";
2770
- readonly 700: "56px";
2771
- readonly 800: "64px";
2772
- readonly 1200: "96px";
2773
- readonly 1600: "128px";
2774
- };
2775
- 'space-gap': {
2776
- readonly 0: any;
2777
- readonly 50: any;
2778
- readonly 100: any;
2779
- readonly 200: any;
2780
- readonly 300: any;
2781
- };
2782
- 'space-inset': {
2783
- readonly 0: any;
2784
- readonly 50: any;
2785
- readonly 100: any;
2786
- readonly 150: any;
2787
- readonly 200: any;
2788
- readonly 300: any;
2789
- readonly 400: any;
2790
- readonly 500: any;
2791
- readonly 600: any;
2792
- readonly 700: any;
2793
- readonly 800: any;
2794
- readonly 1200: any;
2795
- readonly 1600: any;
2796
- };
2797
- 'space-offset': {
2798
- readonly 0: any;
2799
- readonly 50: any;
2800
- readonly 100: any;
2801
- readonly 150: any;
2802
- readonly 200: any;
2803
- readonly 300: any;
2804
- readonly 400: any;
2805
- readonly 600: any;
2806
- readonly 800: any;
2807
- readonly 1200: any;
2808
- readonly 1600: any;
2809
- readonly 'stacking-0': any;
2810
- readonly 'stacking-100': any;
2811
- readonly 'stacking-200': any;
2812
- readonly 'stacking-300': any;
2813
- readonly 'stacking-400': any;
2814
- readonly 'stacking-500': any;
2815
- readonly 'stacking-800': any;
2816
- };
2817
- 'stroke-width': {
2818
- readonly thin: "1.5px";
2819
- readonly normal: "2px";
2820
- readonly bold: "4px";
2821
- };
2822
- 'z-indices': {
2823
- readonly dropdownMenu: 100;
2824
- readonly select: 200;
2825
- readonly popover: 300;
2826
- readonly tooltip: 400;
2827
- };
2828
- }, {
2829
- readonly background: "colors";
2830
- readonly backgroundColor: "colors";
2831
- readonly backgroundImage: "colors";
2832
- readonly blockSize: "sizes";
2833
- readonly border: "colors";
2834
- readonly borderBlock: "colors";
2835
- readonly borderBlockEnd: "colors";
2836
- readonly borderBlockStart: "colors";
2837
- readonly borderBottom: "colors";
2838
- readonly borderBottomColor: "colors";
2839
- readonly borderBottomLeftRadius: "radii";
2840
- readonly borderBottomRightRadius: "radii";
2841
- readonly borderBottomStyle: "border-styles";
2842
- readonly borderBottomWidth: "border-widths";
2843
- readonly borderColor: "colors";
2844
- readonly borderImage: "colors";
2845
- readonly borderInline: "colors";
2846
- readonly borderInlineEnd: "colors";
2847
- readonly borderInlineStart: "colors";
2848
- readonly borderLeft: "colors";
2849
- readonly borderLeftColor: "colors";
2850
- readonly borderLeftStyle: "border-styles";
2851
- readonly borderLeftWidth: "border-widths";
2852
- readonly borderRadius: "radii";
2853
- readonly borderRight: "colors";
2854
- readonly borderRightColor: "colors";
2855
- readonly borderRightStyle: "border-styles";
2856
- readonly borderRightWidth: "border-widths";
2857
- readonly borderSpacing: "space-offset";
2858
- readonly borderStyle: "border-styles";
2859
- readonly borderTop: "colors";
2860
- readonly borderTopColor: "colors";
2861
- readonly borderTopLeftRadius: "radii";
2862
- readonly borderTopRightRadius: "radii";
2863
- readonly borderTopStyle: "border-styles";
2864
- readonly borderTopWidth: "border-widths";
2865
- readonly borderWidth: "border-widths";
2866
- readonly bottom: "space";
2867
- readonly boxShadow: "shadows";
2868
- readonly caretColor: "colors";
2869
- readonly color: "colors";
2870
- readonly columnGap: "space-gap";
2871
- readonly columnRuleColor: "colors";
2872
- readonly fill: "colors";
2873
- readonly flexBasis: "sizes";
2874
- readonly fontFamily: "fonts";
2875
- readonly fontSize: "font-sizes";
2876
- readonly fontWeight: "font-weights";
2877
- readonly gap: "space-gap";
2878
- readonly gridColumnGap: "space-gap";
2879
- readonly gridGap: "space-gap";
2880
- readonly gridRowGap: "space-gap";
2881
- readonly gridTemplateColumns: "sizes";
2882
- readonly gridTemplateRows: "sizes";
2883
- readonly height: "sizes";
2884
- readonly inlineSize: "sizes";
2885
- readonly inset: "space-inset";
2886
- readonly insetBlock: "space-inset";
2887
- readonly insetBlockEnd: "space-inset";
2888
- readonly insetBlockStart: "space-inset";
2889
- readonly insetInline: "space-inset";
2890
- readonly insetInlineEnd: "space-inset";
2891
- readonly insetInlineStart: "space-inset";
2892
- readonly left: "space";
2893
- readonly letterSpacing: "letter-spacings";
2894
- readonly lineHeight: "line-heights";
2895
- readonly margin: "space-offset";
2896
- readonly marginBlock: "space-offset";
2897
- readonly marginBlockEnd: "space-offset";
2898
- readonly marginBlockStart: "space-offset";
2899
- readonly marginBottom: "space-offset";
2900
- readonly marginInline: "space-offset";
2901
- readonly marginInlineEnd: "space-offset";
2902
- readonly marginInlineStart: "space-offset";
2903
- readonly marginLeft: "space-offset";
2904
- readonly marginRight: "space-offset";
2905
- readonly marginTop: "space-offset";
2906
- readonly maxBlockSize: "sizes";
2907
- readonly maxHeight: "sizes";
2908
- readonly maxInlineSize: "sizes";
2909
- readonly maxWidth: "sizes";
2910
- readonly minBlockSize: "sizes";
2911
- readonly minHeight: "sizes";
2912
- readonly minInlineSize: "sizes";
2913
- readonly minWidth: "sizes";
2914
- readonly outline: "colors";
2915
- readonly outlineColor: "colors";
2916
- readonly padding: "space-inset";
2917
- readonly paddingBlock: "space-inset";
2918
- readonly paddingBlockEnd: "space-inset";
2919
- readonly paddingBlockStart: "space-inset";
2920
- readonly paddingBottom: "space-inset";
2921
- readonly paddingInline: "space-inset";
2922
- readonly paddingInlineEnd: "space-inset";
2923
- readonly paddingInlineStart: "space-inset";
2924
- readonly paddingLeft: "space-inset";
2925
- readonly paddingRight: "space-inset";
2926
- readonly paddingTop: "space-inset";
2927
- readonly right: "space";
2928
- readonly rowGap: "space-gap";
2929
- readonly scrollMargin: "space-offset";
2930
- readonly scrollMarginBlock: "space-offset";
2931
- readonly scrollMarginBlockEnd: "space-offset";
2932
- readonly scrollMarginBlockStart: "space-offset";
2933
- readonly scrollMarginBottom: "space-offset";
2934
- readonly scrollMarginInline: "space-offset";
2935
- readonly scrollMarginInlineEnd: "space-offset";
2936
- readonly scrollMarginInlineStart: "space-offset";
2937
- readonly scrollMarginLeft: "space-offset";
2938
- readonly scrollMarginRight: "space-offset";
2939
- readonly scrollMarginTop: "space-offset";
2940
- readonly scrollPadding: "space-inset";
2941
- readonly scrollPaddingBlock: "space-inset";
2942
- readonly scrollPaddingBlockEnd: "space-inset";
2943
- readonly scrollPaddingBlockStart: "space-inset";
2944
- readonly scrollPaddingBottom: "space-inset";
2945
- readonly scrollPaddingInline: "space-inset";
2946
- readonly scrollPaddingInlineEnd: "space-inset";
2947
- readonly scrollPaddingInlineStart: "space-inset";
2948
- readonly scrollPaddingLeft: "space-inset";
2949
- readonly scrollPaddingRight: "space-inset";
2950
- readonly scrollPaddingTop: "space-inset";
2951
- readonly stroke: "colors";
2952
- readonly strokeWidth: "stroke-width";
2953
- readonly textDecorationColor: "colors";
2954
- readonly textShadow: "shadows";
2955
- readonly top: "space";
2956
- readonly transition: "transitions";
2957
- readonly width: "sizes";
2958
- readonly zIndex: "z-indices";
2959
- }, {
2960
- paddingX: (value: {
2961
- readonly [$$PropertyValue]: "padding";
2962
- }) => {
2963
- paddingLeft: {
2964
- readonly [$$PropertyValue]: "padding";
2965
- };
2966
- paddingRight: {
2967
- readonly [$$PropertyValue]: "padding";
2968
- };
2969
- };
2970
- paddingY: (value: {
2971
- readonly [$$PropertyValue]: "padding";
2972
- }) => {
2973
- paddingTop: {
2974
- readonly [$$PropertyValue]: "padding";
2975
- };
2976
- paddingBottom: {
2977
- readonly [$$PropertyValue]: "padding";
2978
- };
2979
- };
2980
- marginX: (value: {
2981
- readonly [$$PropertyValue]: "margin";
2982
- }) => {
2983
- marginLeft: {
2984
- readonly [$$PropertyValue]: "margin";
2985
- };
2986
- marginRight: {
2987
- readonly [$$PropertyValue]: "margin";
2988
- };
2989
- };
2990
- marginY: (value: {
2991
- readonly [$$PropertyValue]: "margin";
2992
- }) => {
2993
- marginTop: {
2994
- readonly [$$PropertyValue]: "margin";
2995
- };
2996
- marginBottom: {
2997
- readonly [$$PropertyValue]: "margin";
2998
- };
2999
- };
3000
- square: (value: {
3001
- readonly [$$PropertyValue]: "width";
3002
- }) => {
3003
- width: {
3004
- readonly [$$PropertyValue]: "width";
3005
- };
3006
- height: {
3007
- readonly [$$PropertyValue]: "width";
3008
- };
3009
- };
3010
- _hover: (css: _stitches_react_types_css_util.CSSProperties) => {
3011
- '&:hover, &[data-hovered]': _stitches_react_types_css_util.CSSProperties;
3012
- };
3013
- }>>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLDivElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"div">>, {}, {}>;
3014
- declare type StyledComboboxProps = ComponentPropsWithRef<typeof StyledCombobox>;
2531
+ declare const Value: react__default.ForwardRefExoticComponent<react__default.RefAttributes<HTMLSpanElement>>;
2532
+
2533
+ declare type Direction = 'ltr' | 'rtl';
2534
+
2535
+ interface ComboboxProps$1 extends FormElementProps {
2536
+ open?: boolean;
2537
+ defaultOpen?: boolean;
2538
+ value?: string;
2539
+ defaultValue?: string;
2540
+ searchValue?: string;
2541
+ direction?: Direction;
2542
+ }
2543
+ declare type ComboboxProviderProps = ComboboxProps$1;
3015
2544
 
3016
- interface ComboboxProps extends StyledComboboxProps {
2545
+ interface ComboboxProps extends ComboboxProviderProps {
2546
+ /**
2547
+ * The value of the combobox when initially rendered. Use when you do not need
2548
+ * to control the state of the combobox.
2549
+ */
2550
+ defaultValue?: string;
2551
+ /**
2552
+ * The controlled value of the combobox. Should be used in conjunction with
2553
+ * onValueChange.
2554
+ */
2555
+ value?: string;
2556
+ /**
2557
+ * Event handler called when the value changes.
2558
+ */
2559
+ onValueChange?: (value: string) => void;
2560
+ /**
2561
+ * The open state of the combobox when it is initially rendered. Use when you do
2562
+ * not need to control its open state.
2563
+ * @default false
2564
+ */
2565
+ defaultOpen?: boolean;
2566
+ /**
2567
+ * The controlled open state of the combobox. Must be used in conjunction with
2568
+ * onOpen and onClose.
2569
+ */
2570
+ open?: boolean;
2571
+ /**
2572
+ * Event handler called when the combobox opens.
2573
+ */
2574
+ onOpen?: () => void;
2575
+ /**
2576
+ * Event handler called when the combobox closes.
2577
+ */
2578
+ onClose?: () => void;
2579
+ /**
2580
+ * The reading direction of the combobox when applicable. If omitted, inherits
2581
+ * globally from DirectionProvider or assumes LTR (left-to-right) reading
2582
+ * mode.
2583
+ * @default 'ltr'
2584
+ */
2585
+ direction?: Direction;
2586
+ /**
2587
+ * The content of the combobox
2588
+ */
2589
+ children?: react__default.ReactNode;
3017
2590
  }
3018
2591
  declare const Combobox: react__default.ForwardRefExoticComponent<ComboboxProps> & Partials;
3019
2592
  interface Partials {
@@ -3023,6 +2596,7 @@ interface Partials {
3023
2596
  Item: typeof Item;
3024
2597
  Group: typeof Group;
3025
2598
  GroupLabel: typeof GroupLabel;
2599
+ Value: typeof Value;
3026
2600
  }
3027
2601
 
3028
2602
  export { Combobox, ComboboxProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mirohq/design-system-combobox",
3
- "version": "0.1.0-combobox.0",
3
+ "version": "0.1.0-combobox.1",
4
4
  "description": "",
5
5
  "author": "Miro",
6
6
  "source": "src/index.ts",
@@ -32,13 +32,13 @@
32
32
  "@react-aria/interactions": "^3.13.0",
33
33
  "@react-types/shared": "^3.16.0",
34
34
  "@mirohq/design-system-base-form": "^0.1.0",
35
+ "@mirohq/design-system-form": "^0.1.1",
35
36
  "@mirohq/design-system-icons": "^0.36.2",
36
37
  "@mirohq/design-system-input": "^0.1.1",
37
- "@mirohq/design-system-form": "^0.1.1",
38
+ "@mirohq/design-system-stitches": "^2.6.0",
38
39
  "@mirohq/design-system-primitive": "^1.1.2",
39
40
  "@mirohq/design-system-styles": "^1.1.19",
40
- "@mirohq/design-system-utils": "^0.15.0",
41
- "@mirohq/design-system-stitches": "^2.6.0"
41
+ "@mirohq/design-system-utils": "^0.15.0"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "rollup -c ../../../rollup.config.js",