@doist/reactist 21.1.1 → 22.0.0-beta

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.
Files changed (38) hide show
  1. package/dist/reactist.cjs.development.js +304 -58
  2. package/dist/reactist.cjs.development.js.map +1 -1
  3. package/dist/reactist.cjs.production.min.js +1 -1
  4. package/dist/reactist.cjs.production.min.js.map +1 -1
  5. package/es/base-field/base-field.module.css.js +1 -1
  6. package/es/index.js +1 -1
  7. package/es/menu/menu.js +301 -56
  8. package/es/menu/menu.js.map +1 -1
  9. package/es/menu/menu.module.css.js +4 -0
  10. package/es/menu/menu.module.css.js.map +1 -0
  11. package/es/select-field/select-field.module.css.js +1 -1
  12. package/es/text-area/text-area.module.css.js +1 -1
  13. package/es/text-field/text-field.module.css.js +1 -1
  14. package/lib/base-field/base-field.module.css.js +1 -1
  15. package/lib/index.js +1 -1
  16. package/lib/menu/index.d.ts +1 -2
  17. package/lib/menu/menu.d.ts +163 -23
  18. package/lib/menu/menu.js +1 -1
  19. package/lib/menu/menu.js.map +1 -1
  20. package/lib/menu/menu.module.css.js +2 -0
  21. package/lib/menu/menu.module.css.js.map +1 -0
  22. package/lib/select-field/select-field.module.css.js +1 -1
  23. package/lib/text-area/text-area.module.css.js +1 -1
  24. package/lib/text-field/text-field.module.css.js +1 -1
  25. package/package.json +1 -1
  26. package/styles/base-field.css +1 -1
  27. package/styles/base-field.module.css.css +1 -1
  28. package/styles/menu.css +8 -1
  29. package/styles/menu.module.css.css +1 -0
  30. package/styles/password-field.css +2 -2
  31. package/styles/reactist.css +6 -6
  32. package/styles/select-field.css +2 -2
  33. package/styles/select-field.module.css.css +1 -1
  34. package/styles/switch-field.css +1 -1
  35. package/styles/text-area.css +2 -2
  36. package/styles/text-area.module.css.css +1 -1
  37. package/styles/text-field.css +2 -2
  38. package/styles/text-field.module.css.css +1 -1
@@ -1,4 +1,4 @@
1
- var modules_540a88ff = {"container":"_2e189908","auxiliaryLabel":"_83051e0a","bordered":"fd20ef50","error":"d1a17d92","primaryLabel":"_75e0afa0","secondaryLabel":"d04a867d","messageIcon":"_77b2107e"};
1
+ var modules_540a88ff = {"container":"_616a033e","auxiliaryLabel":"_0b88d85e","bordered":"c466cda3","error":"_4156d9cb","primaryLabel":"_274ef80a","secondaryLabel":"_2c4a8aed","messageIcon":"cd105f69"};
2
2
 
3
3
  export default modules_540a88ff;
4
4
  //# sourceMappingURL=base-field.module.css.js.map
package/es/index.js CHANGED
@@ -28,7 +28,7 @@ export { Avatar } from './avatar/avatar.js';
28
28
  export { Badge } from './badge/badge.js';
29
29
  export { Modal, ModalActions, ModalBody, ModalCloseButton, ModalFooter, ModalHeader } from './modal/modal.js';
30
30
  export { Tab, TabAwareSlot, TabList, TabPanel, Tabs } from './tabs/tabs.js';
31
- export { ContextMenuTrigger, Menu, MenuButton, MenuGroup, MenuItem, MenuList, SubMenu } from './menu/menu.js';
31
+ export { ContextMenuTrigger, IconMenuItem, IconsMenuGroup, Menu, MenuButton, MenuGroup, MenuItem, MenuList, SubMenu, SubMenuItem, SubMenuList } from './menu/menu.js';
32
32
  export { default as DeprecatedButton } from './components/deprecated-button/index.js';
33
33
  export { default as DeprecatedDropdown } from './components/deprecated-dropdown/index.js';
34
34
  export { COLORS } from './components/color-picker/color-picker.js';
package/es/menu/menu.js CHANGED
@@ -1,16 +1,25 @@
1
1
  import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
- import { useState, useMemo, useEffect, useCallback, createElement, useContext, forwardRef, Children, cloneElement, createContext } from 'react';
2
+ import { forwardRef, useState, useMemo, useEffect, useImperativeHandle, useCallback, createElement, useContext, Children, cloneElement, createContext } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import { polymorphicComponent } from '../utils/polymorphism.js';
5
+ import { Box } from '../box/box.js';
6
+ import { Tooltip } from '../tooltip/tooltip.js';
7
+ import { useId } from '../utils/common-helpers.js';
8
+ import { Text } from '../text/text.js';
5
9
  import { Portal } from 'ariakit/portal';
6
10
  import { useMenuState, MenuButton as MenuButton$1, Menu as Menu$1, MenuItem as MenuItem$1, MenuGroup as MenuGroup$1 } from 'ariakit/menu';
11
+ import styles from './menu.module.css.js';
7
12
 
8
13
  const _excluded = ["children", "onItemSelect"],
9
14
  _excluded2 = ["exceptionallySetClassName"],
10
- _excluded3 = ["as"],
11
- _excluded4 = ["exceptionallySetClassName", "modal"],
12
- _excluded5 = ["value", "children", "onSelect", "hideOnSelect", "onClick", "exceptionallySetClassName", "as"],
13
- _excluded6 = ["label", "children", "exceptionallySetClassName"];
15
+ _excluded3 = ["exceptionallySetClassName", "label", "icon"],
16
+ _excluded4 = ["as"],
17
+ _excluded5 = ["exceptionallySetClassName", "modal"],
18
+ _excluded6 = ["exceptionallySetClassName", "modal"],
19
+ _excluded7 = ["value", "label", "description", "icon", "shortcut", "tone", "children", "onSelect", "hideOnSelect", "onClick", "exceptionallySetClassName", "as"],
20
+ _excluded8 = ["label", "info", "children", "exceptionallySetClassName"],
21
+ _excluded9 = ["value", "label", "description", "icon", "onSelect", "hideOnSelect", "onClick", "exceptionallySetClassName", "as"],
22
+ _excluded10 = ["children"];
14
23
  const MenuContext = /*#__PURE__*/createContext( // Ariakit gives us no means to obtain a valid initial/default value of type MenuStateReturn
15
24
  // (it is normally obtained by calling useMenuState but we can't call hooks outside components).
16
25
  // This is however of little consequence since this value is only used if some of the components
@@ -22,7 +31,7 @@ const MenuContext = /*#__PURE__*/createContext( // Ariakit gives us no means to
22
31
  * management for the menu components inside it.
23
32
  */
24
33
 
25
- function Menu(_ref) {
34
+ const Menu = /*#__PURE__*/forwardRef(function Menu(_ref, ref) {
26
35
  let {
27
36
  children,
28
37
  onItemSelect
@@ -42,6 +51,9 @@ function Menu(_ref) {
42
51
  useEffect(() => {
43
52
  if (!state.open) handleAnchorRectChange(null);
44
53
  }, [state.open]);
54
+ useImperativeHandle(ref, () => ({
55
+ open: state.show
56
+ }));
45
57
  const handleItemSelect = useCallback(function handleItemSelect(value) {
46
58
  if (onItemSelect) onItemSelect(value);
47
59
  }, [onItemSelect]);
@@ -53,12 +65,11 @@ function Menu(_ref) {
53
65
  return /*#__PURE__*/createElement(MenuContext.Provider, {
54
66
  value: value
55
67
  }, children);
56
- }
68
+ });
57
69
  /**
58
70
  * A button to toggle a dropdown menu open or closed.
59
71
  */
60
72
 
61
-
62
73
  const MenuButton = /*#__PURE__*/polymorphicComponent(function MenuButton(_ref2, ref) {
63
74
  let {
64
75
  exceptionallySetClassName
@@ -71,17 +82,104 @@ const MenuButton = /*#__PURE__*/polymorphicComponent(function MenuButton(_ref2,
71
82
  return /*#__PURE__*/createElement(MenuButton$1, _objectSpread2(_objectSpread2({}, props), {}, {
72
83
  state: state,
73
84
  ref: ref,
74
- className: classNames('reactist_menubutton', exceptionallySetClassName)
85
+ className: exceptionallySetClassName
86
+ }));
87
+ });
88
+ /**
89
+ * Renders the content inside a standard MenuItem. It is extracted into a component for reuse in
90
+ * the SubMenuItem, which is a MenuItem visually, but semantically it's closer to be a MenuButton.
91
+ * @private
92
+ */
93
+
94
+ function MenuItemContent({
95
+ label,
96
+ description,
97
+ icon,
98
+ shortcut,
99
+ id
100
+ }) {
101
+ if (!label) return null;
102
+ return /*#__PURE__*/createElement(Box, {
103
+ display: "flex",
104
+ gap: "small",
105
+ alignItems: "center",
106
+ width: "full",
107
+ "aria-hidden": true
108
+ }, icon ? /*#__PURE__*/createElement("div", {
109
+ className: styles.menuItemIcon
110
+ }, icon) : null, /*#__PURE__*/createElement(Box, {
111
+ display: "inlineFlex",
112
+ flexDirection: "column",
113
+ gap: "xsmall",
114
+ paddingY: "xsmall",
115
+ alignItems: "flexStart",
116
+ overflow: "hidden",
117
+ flexGrow: 1
118
+ }, /*#__PURE__*/createElement(Text, {
119
+ id: id + "-label",
120
+ weight: description ? 'semibold' : 'regular',
121
+ size: "copy",
122
+ lineClamp: 1,
123
+ exceptionallySetClassName: styles.menuItemLabel
124
+ }, label), description ? /*#__PURE__*/createElement(Text, {
125
+ id: id + "-description",
126
+ size: "copy",
127
+ tone: "secondary",
128
+ exceptionallySetClassName: styles.menuItemDescription
129
+ }, description) : null), shortcut ? /*#__PURE__*/createElement("div", null, shortcut) : null);
130
+ } //
131
+ // SubMenuItem
132
+ //
133
+
134
+
135
+ function ArrowRightIcon() {
136
+ return /*#__PURE__*/createElement("svg", {
137
+ width: "24",
138
+ height: "24"
139
+ }, /*#__PURE__*/createElement("path", {
140
+ d: "M14.243 12L9.646 7.404a.5.5 0 1 1 .708-.707l4.95 4.95a.5.5 0 0 1 0 .707l-4.95 4.95a.5.5 0 0 1-.708-.708L14.243 12z",
141
+ fill: "currentColor",
142
+ fillRule: "evenodd"
143
+ }));
144
+ }
145
+ /**
146
+ * A menu item to toggle a sub-menu open or closed.
147
+ */
148
+
149
+
150
+ const SubMenuItem = /*#__PURE__*/polymorphicComponent(function SubMenuItem(_ref3, ref) {
151
+ let {
152
+ exceptionallySetClassName,
153
+ label,
154
+ icon
155
+ } = _ref3,
156
+ props = _objectWithoutProperties(_ref3, _excluded3);
157
+
158
+ const id = useId(props.id);
159
+ const {
160
+ state
161
+ } = useContext(MenuContext);
162
+ return /*#__PURE__*/createElement(MenuButton$1, _objectSpread2(_objectSpread2({
163
+ "aria-labelledby": label && !props['aria-label'] ? id + "-label" : undefined
164
+ }, props), {}, {
165
+ state: state,
166
+ ref: ref,
167
+ className: classNames(styles.menuItem, exceptionallySetClassName)
168
+ }), /*#__PURE__*/createElement(MenuItemContent, {
169
+ id: id,
170
+ icon: icon,
171
+ label: label,
172
+ shortcut: /*#__PURE__*/createElement(ArrowRightIcon, null)
75
173
  }));
76
174
  }); //
77
175
  // ContextMenuTrigger
78
176
  //
79
177
 
80
- const ContextMenuTrigger = /*#__PURE__*/polymorphicComponent(function ContextMenuTrigger(_ref3, ref) {
178
+ const ContextMenuTrigger = /*#__PURE__*/polymorphicComponent(function ContextMenuTrigger(_ref4, ref) {
81
179
  let {
82
180
  as: component = 'div'
83
- } = _ref3,
84
- props = _objectWithoutProperties(_ref3, _excluded3);
181
+ } = _ref4,
182
+ props = _objectWithoutProperties(_ref4, _excluded4);
85
183
 
86
184
  const {
87
185
  handleAnchorRectChange,
@@ -104,42 +202,59 @@ const ContextMenuTrigger = /*#__PURE__*/polymorphicComponent(function ContextMen
104
202
  * The dropdown menu itself, containing a list of menu items.
105
203
  */
106
204
 
107
- const MenuList = /*#__PURE__*/polymorphicComponent(function MenuList(_ref4, ref) {
205
+ const MenuList = /*#__PURE__*/polymorphicComponent(function MenuList(_ref5, ref) {
108
206
  let {
109
207
  exceptionallySetClassName,
110
208
  modal = true
111
- } = _ref4,
112
- props = _objectWithoutProperties(_ref4, _excluded4);
209
+ } = _ref5,
210
+ props = _objectWithoutProperties(_ref5, _excluded5);
113
211
 
114
212
  const {
115
213
  state
116
214
  } = useContext(MenuContext);
117
- return state.open ? /*#__PURE__*/createElement(Portal, {
215
+ if (!state.open) return null;
216
+ return /*#__PURE__*/createElement(Portal, {
118
217
  preserveTabOrder: true
119
218
  }, /*#__PURE__*/createElement(Menu$1, _objectSpread2(_objectSpread2({}, props), {}, {
120
219
  state: state,
121
220
  ref: ref,
122
- className: classNames('reactist_menulist', exceptionallySetClassName),
221
+ className: classNames(styles.menuList, exceptionallySetClassName),
123
222
  modal: modal
124
- }))) : null;
223
+ })));
125
224
  });
126
225
  /**
127
- * A menu item inside a menu list. It can be selected by the user, triggering the `onSelect`
128
- * callback.
226
+ * Mostly equivalent to the `MenuList`, but to be used inside a `SubMenu`.
129
227
  */
130
228
 
131
- const MenuItem = /*#__PURE__*/polymorphicComponent(function MenuItem(_ref5, ref) {
229
+ const SubMenuList = /*#__PURE__*/polymorphicComponent(function SubMenuList(_ref6, ref) {
132
230
  let {
133
- value,
134
- children,
135
- onSelect,
136
- hideOnSelect = true,
137
- onClick,
138
231
  exceptionallySetClassName,
139
- as = 'button'
140
- } = _ref5,
141
- props = _objectWithoutProperties(_ref5, _excluded5);
232
+ modal = true
233
+ } = _ref6,
234
+ props = _objectWithoutProperties(_ref6, _excluded6);
142
235
 
236
+ const {
237
+ state
238
+ } = useContext(MenuContext);
239
+ if (!state.open) return null;
240
+ return /*#__PURE__*/createElement(Portal, {
241
+ preserveTabOrder: true
242
+ }, /*#__PURE__*/createElement(Menu$1, _objectSpread2(_objectSpread2({}, props), {}, {
243
+ state: state,
244
+ ref: ref,
245
+ className: classNames(styles.menuList, styles.subMenuList, exceptionallySetClassName),
246
+ modal: modal
247
+ })));
248
+ }); //
249
+ // MenuItem
250
+ //
251
+
252
+ function useMenuItemClickHandler({
253
+ value,
254
+ hideOnSelect,
255
+ onClick,
256
+ onSelect
257
+ }) {
143
258
  const {
144
259
  handleItemSelect,
145
260
  state
@@ -147,42 +262,95 @@ const MenuItem = /*#__PURE__*/polymorphicComponent(function MenuItem(_ref5, ref)
147
262
  const {
148
263
  hide
149
264
  } = state;
150
- const handleClick = useCallback(function handleClick(event) {
265
+ return useCallback(function handleClick(event) {
151
266
  onClick == null ? void 0 : onClick(event);
152
267
  const onSelectResult = onSelect && !event.defaultPrevented ? onSelect() : undefined;
153
268
  const shouldClose = onSelectResult !== false && hideOnSelect;
154
269
  handleItemSelect(value);
155
270
  if (shouldClose) hide();
156
271
  }, [onSelect, onClick, handleItemSelect, hideOnSelect, hide, value]);
157
- return /*#__PURE__*/createElement(MenuItem$1, _objectSpread2(_objectSpread2({}, props), {}, {
272
+ }
273
+ /**
274
+ * A menu item inside a menu list. It can be selected by the user, triggering the `onSelect`
275
+ * callback.
276
+ */
277
+
278
+
279
+ const MenuItem = /*#__PURE__*/polymorphicComponent(function MenuItem(_ref7, ref) {
280
+ let {
281
+ value,
282
+ label,
283
+ description,
284
+ icon,
285
+ shortcut,
286
+ tone,
287
+ children,
288
+ onSelect,
289
+ hideOnSelect = true,
290
+ onClick,
291
+ exceptionallySetClassName,
292
+ as = 'button'
293
+ } = _ref7,
294
+ props = _objectWithoutProperties(_ref7, _excluded7);
295
+
296
+ const id = useId(props.id);
297
+ const {
298
+ state
299
+ } = useContext(MenuContext);
300
+ const handleClick = useMenuItemClickHandler({
301
+ value,
302
+ onSelect,
303
+ onClick,
304
+ hideOnSelect
305
+ });
306
+ return /*#__PURE__*/createElement(MenuItem$1, _objectSpread2(_objectSpread2({
307
+ "aria-labelledby": label && !props['aria-label'] ? id + "-label" : undefined,
308
+ "aria-describedby": label && description ? id + "-description" : undefined
309
+ }, props), {}, {
158
310
  as: as,
159
311
  state: state,
160
312
  ref: ref,
161
313
  onClick: handleClick,
162
- className: exceptionallySetClassName,
314
+ className: classNames(styles.menuItem, tone === 'destructive' ? styles.destructive : null, exceptionallySetClassName),
163
315
  hideOnClick: false
164
- }), children);
316
+ }), children ? /*#__PURE__*/createElement(Box, {
317
+ width: "full",
318
+ className: label ? undefined : styles.legacyLayout
319
+ }, children) : null, /*#__PURE__*/createElement(MenuItemContent, {
320
+ id: id,
321
+ icon: icon,
322
+ label: label,
323
+ description: description,
324
+ shortcut: shortcut
325
+ }));
165
326
  });
166
327
  /**
167
- * This component can be rendered alongside other `MenuItem` inside a `MenuList` in order to have
168
- * a sub-menu.
328
+ * This component can be rendered alongside other `MenuItem` elements inside a `MenuList` to show a
329
+ * sub-menu.
330
+ *
331
+ * Its children are expected to be exactly two elements, in the following order:
332
+ *
333
+ * 1. A `SubMenuItem` element: the menu item that triggers the sub-menu to open.
334
+ * 2. A `SubMenuList` element: the list of menu items that will be shown when the sub-menu is open.
169
335
  *
170
- * Its children are expected to have the structure of a first level menu (a `MenuButton` and a
171
- * `MenuList`).
336
+ * ## Usage
172
337
  *
173
338
  * ```jsx
174
- * <MenuItem label="Edit profile" />
175
- * <SubMenu>
176
- * <MenuButton>More options</MenuButton>
339
+ * <Menu>
340
+ * <MenuButton>Menu</MenuButton>
177
341
  * <MenuList>
178
- * <MenuItem label="Preferences" />
179
- * <MenuItem label="Sign out" />
342
+ * <MenuItem label="Item 1" />
343
+ * <MenuItem label="Item 2" />
344
+ * <SubMenu>
345
+ * <SubMenuItem label="Submenu" />
346
+ * <SubMenuList>
347
+ * <MenuItem label="Submenu Item 1" />
348
+ * <MenuItem label="Submenu Item 2" />
349
+ * </SubMenuList>
350
+ * </SubMenu>
180
351
  * </MenuList>
181
- * </SubMenu>
352
+ * </Menu>
182
353
  * ```
183
- *
184
- * The `MenuButton` will become a menu item in the current menu items list, and it will lead to
185
- * opening a sub-menu with the menu items list below it.
186
354
  */
187
355
 
188
356
  const SubMenu = /*#__PURE__*/forwardRef(function SubMenu({
@@ -214,7 +382,9 @@ const SubMenu = /*#__PURE__*/forwardRef(function SubMenu({
214
382
  state: state,
215
383
  ref: ref,
216
384
  hideOnClick: false
217
- }, renderMenuButton), list);
385
+ }, renderMenuButton), /*#__PURE__*/createElement("div", {
386
+ className: styles.subMenuContainer
387
+ }, list));
218
388
  });
219
389
  /**
220
390
  * A way to semantically group some menu items.
@@ -223,26 +393,101 @@ const SubMenu = /*#__PURE__*/forwardRef(function SubMenu({
223
393
  * before and/or after the group if you so wish.
224
394
  */
225
395
 
226
- const MenuGroup = /*#__PURE__*/polymorphicComponent(function MenuGroup(_ref6, ref) {
396
+ const MenuGroup = /*#__PURE__*/polymorphicComponent(function MenuGroup(_ref8, ref) {
227
397
  let {
228
398
  label,
399
+ info,
229
400
  children,
230
401
  exceptionallySetClassName
231
- } = _ref6,
232
- props = _objectWithoutProperties(_ref6, _excluded6);
402
+ } = _ref8,
403
+ props = _objectWithoutProperties(_ref8, _excluded8);
233
404
 
405
+ const id = useId(props.id);
234
406
  const {
235
407
  state
236
408
  } = useContext(MenuContext);
237
- return /*#__PURE__*/createElement(MenuGroup$1, _objectSpread2(_objectSpread2({}, props), {}, {
409
+ return /*#__PURE__*/createElement(MenuGroup$1, _objectSpread2(_objectSpread2({
410
+ "aria-labelledby": "menugroup-label-" + id
411
+ }, props), {}, {
412
+ id: id,
238
413
  ref: ref,
239
414
  state: state,
240
415
  className: exceptionallySetClassName
241
- }), label ? /*#__PURE__*/createElement("div", {
242
- role: "presentation",
243
- className: "reactist_menugroup__label"
244
- }, label) : null, children);
416
+ }), /*#__PURE__*/createElement(Box, {
417
+ display: "flex",
418
+ alignItems: "center",
419
+ gap: "small",
420
+ className: styles.menuGroupLabel
421
+ }, /*#__PURE__*/createElement(Text, {
422
+ id: "menugroup-label-" + id,
423
+ size: "copy",
424
+ weight: "semibold"
425
+ }, label), info ? /*#__PURE__*/createElement(Box, {
426
+ flexShrink: 0,
427
+ display: "flex",
428
+ alignItems: "center",
429
+ justifyContent: "center",
430
+ className: styles.menuGroupInfo
431
+ }, info) : null), children);
432
+ });
433
+ /**
434
+ * A menu item that visually only shows as an icon. It must be used inside an `IconsMenuGroup`.
435
+ */
436
+
437
+ const IconMenuItem = /*#__PURE__*/polymorphicComponent(function IconMenuItem(_ref9, ref) {
438
+ let {
439
+ value,
440
+ label,
441
+ description,
442
+ icon,
443
+ onSelect,
444
+ hideOnSelect = true,
445
+ onClick,
446
+ exceptionallySetClassName,
447
+ as = 'button'
448
+ } = _ref9,
449
+ props = _objectWithoutProperties(_ref9, _excluded9);
450
+
451
+ const id = useId(props.id);
452
+ const {
453
+ state
454
+ } = useContext(MenuContext);
455
+ const handleClick = useMenuItemClickHandler({
456
+ value,
457
+ onSelect,
458
+ onClick,
459
+ hideOnSelect
460
+ });
461
+ return /*#__PURE__*/createElement(Tooltip, {
462
+ content: label
463
+ }, /*#__PURE__*/createElement(MenuItem$1, _objectSpread2(_objectSpread2({
464
+ "aria-label": label,
465
+ "aria-describedby": id + "-description"
466
+ }, props), {}, {
467
+ as: as,
468
+ state: state,
469
+ ref: ref,
470
+ onClick: handleClick,
471
+ className: classNames(styles.iconMenuItem, exceptionallySetClassName),
472
+ hideOnClick: false
473
+ }), icon));
474
+ });
475
+ /**
476
+ * Semantically equivalent to `MenuGroup`, but meant to group `IconMenuItem`s only.
477
+ */
478
+
479
+ const IconsMenuGroup = /*#__PURE__*/polymorphicComponent(function IconsMenuGroup(_ref10, ref) {
480
+ let {
481
+ children
482
+ } = _ref10,
483
+ props = _objectWithoutProperties(_ref10, _excluded10);
484
+
485
+ return /*#__PURE__*/createElement(MenuGroup, _objectSpread2(_objectSpread2({}, props), {}, {
486
+ ref: ref
487
+ }), /*#__PURE__*/createElement("div", {
488
+ className: styles.iconsMenuGroup
489
+ }, children));
245
490
  });
246
491
 
247
- export { ContextMenuTrigger, Menu, MenuButton, MenuGroup, MenuItem, MenuList, SubMenu };
492
+ export { ContextMenuTrigger, IconMenuItem, IconsMenuGroup, Menu, MenuButton, MenuGroup, MenuItem, MenuList, SubMenu, SubMenuItem, SubMenuList };
248
493
  //# sourceMappingURL=menu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu.js","sources":["../../src/menu/menu.tsx"],"sourcesContent":["import * as React from 'react'\nimport classNames from 'classnames'\n\nimport { polymorphicComponent } from '../utils/polymorphism'\n\n//\n// Reactist menu is a thin wrapper around Ariakit's menu components. This may or may not be\n// temporary. Our goal is to make it transparent for the users of Reactist of this implementation\n// detail. We may change in the future the external lib we use, or even implement it all internally,\n// as long as we keep the same outer interface as intact as possible.\n//\n// Around the heavy lifting of the external lib we just add some features to better integrate the\n// menu to Reactist's more opinionated approach (e.g. using our button with its custom variants and\n// other features, easily show keyboard shortcuts in menu items, etc.)\n//\nimport * as Ariakit from 'ariakit/menu'\nimport { Portal } from 'ariakit/portal'\n\nimport './menu.less'\n\ntype NativeProps<E extends HTMLElement> = React.DetailedHTMLProps<React.HTMLAttributes<E>, E>\n\ntype MenuContextState = {\n state: Ariakit.MenuState\n handleItemSelect: (value: string | null | undefined) => void\n handleAnchorRectChange: (value: { x: number; y: number } | null) => void\n}\n\nconst MenuContext = React.createContext<MenuContextState>(\n // Ariakit gives us no means to obtain a valid initial/default value of type MenuStateReturn\n // (it is normally obtained by calling useMenuState but we can't call hooks outside components).\n // This is however of little consequence since this value is only used if some of the components\n // are used outside Menu, something that should not happen and we do not support.\n // @ts-expect-error\n {},\n)\n\n//\n// Menu\n//\n\ntype MenuProps = Omit<Ariakit.MenuStateProps, 'visible'> & {\n /**\n * The `Menu` must contain a `MenuList` that defines the menu options. It must also contain a\n * `MenuButton` that triggers the menu to be opened or closed.\n */\n children: React.ReactNode\n\n /**\n * An optional callback that will be called back whenever a menu item is selected. It receives\n * the `value` of the selected `MenuItem`.\n *\n * If you pass down this callback, it is recommended that you properly memoize it so it does not\n * change on every render.\n */\n onItemSelect?: (value: string | null | undefined) => void\n}\n\n/**\n * Wrapper component to control a menu. It does not render anything, only providing the state\n * management for the menu components inside it.\n */\nfunction Menu({ children, onItemSelect, ...props }: MenuProps) {\n const [anchorRect, handleAnchorRectChange] = React.useState<{ x: number; y: number } | null>(\n null,\n )\n const getAnchorRect = React.useMemo(() => {\n return anchorRect ? () => anchorRect : undefined\n }, [anchorRect])\n\n const state = Ariakit.useMenuState({\n focusLoop: true,\n gutter: 8,\n shift: 4,\n getAnchorRect,\n ...props,\n })\n\n React.useEffect(() => {\n if (!state.open) handleAnchorRectChange(null)\n }, [state.open])\n\n const handleItemSelect = React.useCallback(\n function handleItemSelect(value: string | null | undefined) {\n if (onItemSelect) onItemSelect(value)\n },\n [onItemSelect],\n )\n\n const value: MenuContextState = React.useMemo(\n () => ({\n state,\n handleItemSelect,\n handleAnchorRectChange,\n }),\n [state, handleItemSelect],\n )\n\n return <MenuContext.Provider value={value}>{children}</MenuContext.Provider>\n}\n\n//\n// MenuButton\n//\n\ntype MenuButtonProps = Omit<Ariakit.MenuButtonProps, 'state' | 'className' | 'as'>\n\n/**\n * A button to toggle a dropdown menu open or closed.\n */\nconst MenuButton = polymorphicComponent<'button', MenuButtonProps>(function MenuButton(\n { exceptionallySetClassName, ...props },\n ref,\n) {\n const { state } = React.useContext(MenuContext)\n return (\n <Ariakit.MenuButton\n {...props}\n state={state}\n ref={ref}\n className={classNames('reactist_menubutton', exceptionallySetClassName)}\n />\n )\n})\n\n//\n// ContextMenuTrigger\n//\nconst ContextMenuTrigger = polymorphicComponent<'div', unknown>(function ContextMenuTrigger(\n { as: component = 'div', ...props },\n ref,\n) {\n const { handleAnchorRectChange, state } = React.useContext(MenuContext)\n const handleContextMenu = React.useCallback(\n (event: React.MouseEvent) => {\n event.preventDefault()\n handleAnchorRectChange({ x: event.clientX, y: event.clientY })\n state.show()\n },\n [handleAnchorRectChange, state],\n )\n\n return React.createElement(component, { ...props, onContextMenu: handleContextMenu, ref })\n})\n\n//\n// MenuList\n//\n\ntype MenuListProps = Omit<Ariakit.MenuProps, 'state' | 'className'>\n\n/**\n * The dropdown menu itself, containing a list of menu items.\n */\nconst MenuList = polymorphicComponent<'div', MenuListProps>(function MenuList(\n { exceptionallySetClassName, modal = true, ...props },\n ref,\n) {\n const { state } = React.useContext(MenuContext)\n\n return state.open ? (\n <Portal preserveTabOrder>\n <Ariakit.Menu\n {...props}\n state={state}\n ref={ref}\n className={classNames('reactist_menulist', exceptionallySetClassName)}\n modal={modal}\n />\n </Portal>\n ) : null\n})\n\n//\n// MenuItem\n//\n\ntype MenuItemProps = {\n /**\n * An optional value given to this menu item. It is passed on to the parent `Menu`'s\n * `onItemSelect` when you provide that instead of (or alongside) providing individual\n * `onSelect` callbacks to each menu item.\n */\n value?: string\n /**\n * The content inside the menu item.\n */\n children: React.ReactNode\n /**\n * When `true` the menu item is disabled and won't be selectable or be part of the keyboard\n * navigation across the menu options.\n *\n * @default true\n */\n disabled?: boolean\n /**\n * When `true` the menu will close when the menu item is selected, in addition to performing the\n * action that the menu item is set out to do.\n *\n * Set this to `false` to make sure that a given menu item does not auto-closes the menu when\n * selected. This should be the exception and not the norm, as the default is to auto-close.\n *\n * @default true\n */\n hideOnSelect?: boolean\n /**\n * The action to perform when the menu item is selected.\n *\n * If you return `false` from this function, the menu will not auto-close when this menu item\n * is selected. Though you should use `hideOnSelect` for this purpose, this allows you to\n * achieve the same effect conditionally and dynamically deciding at run time.\n */\n onSelect?: () => unknown\n /**\n * The event handler called when the menu item is clicked.\n *\n * This is similar to `onSelect`, but a bit different. You can certainly use it to trigger the\n * action that the menu item represents. But in general you should prefer `onSelect` for that.\n *\n * The main use for this handler is to get access to the click event. This can be used, for\n * example, to call `event.preventDefault()`, which will effectively prevent the rest of the\n * consequences of the click, including preventing `onSelect` from being called. In particular,\n * this is useful in menu items that are links, and you want the click to not trigger navigation\n * under some circumstances.\n */\n onClick?: (event: React.MouseEvent) => void\n}\n\n/**\n * A menu item inside a menu list. It can be selected by the user, triggering the `onSelect`\n * callback.\n */\nconst MenuItem = polymorphicComponent<'button', MenuItemProps>(function MenuItem(\n {\n value,\n children,\n onSelect,\n hideOnSelect = true,\n onClick,\n exceptionallySetClassName,\n as = 'button',\n ...props\n },\n ref,\n) {\n const { handleItemSelect, state } = React.useContext(MenuContext)\n const { hide } = state\n\n const handleClick = React.useCallback(\n function handleClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event)\n const onSelectResult: unknown =\n onSelect && !event.defaultPrevented ? onSelect() : undefined\n const shouldClose = onSelectResult !== false && hideOnSelect\n handleItemSelect(value)\n if (shouldClose) hide()\n },\n [onSelect, onClick, handleItemSelect, hideOnSelect, hide, value],\n )\n\n return (\n <Ariakit.MenuItem\n {...props}\n as={as}\n state={state}\n ref={ref}\n onClick={handleClick}\n className={exceptionallySetClassName}\n hideOnClick={false}\n >\n {children}\n </Ariakit.MenuItem>\n )\n})\n\n//\n// SubMenu\n//\n\ntype SubMenuProps = Pick<MenuProps, 'children' | 'onItemSelect'>\n\n/**\n * This component can be rendered alongside other `MenuItem` inside a `MenuList` in order to have\n * a sub-menu.\n *\n * Its children are expected to have the structure of a first level menu (a `MenuButton` and a\n * `MenuList`).\n *\n * ```jsx\n * <MenuItem label=\"Edit profile\" />\n * <SubMenu>\n * <MenuButton>More options</MenuButton>\n * <MenuList>\n * <MenuItem label=\"Preferences\" />\n * <MenuItem label=\"Sign out\" />\n * </MenuList>\n * </SubMenu>\n * ```\n *\n * The `MenuButton` will become a menu item in the current menu items list, and it will lead to\n * opening a sub-menu with the menu items list below it.\n */\nconst SubMenu = React.forwardRef<HTMLDivElement, SubMenuProps>(function SubMenu(\n { children, onItemSelect },\n ref,\n) {\n const { handleItemSelect: parentMenuItemSelect, state } = React.useContext(MenuContext)\n const { hide: parentMenuHide } = state\n\n const handleSubItemSelect = React.useCallback(\n function handleSubItemSelect(value: string | null | undefined) {\n if (onItemSelect) onItemSelect(value)\n parentMenuItemSelect(value)\n parentMenuHide()\n },\n [parentMenuHide, parentMenuItemSelect, onItemSelect],\n )\n\n const [button, list] = React.Children.toArray(children)\n\n // Ariakit needs to be able to pass props to the MenuButton\n // and combine it with the MenuItem component\n const renderMenuButton = React.useCallback(\n function renderMenuButton(props: MenuButtonProps) {\n return React.cloneElement(button as React.ReactElement, props)\n },\n [button],\n )\n\n return (\n <Menu onItemSelect={handleSubItemSelect}>\n <Ariakit.MenuItem as=\"div\" state={state} ref={ref} hideOnClick={false}>\n {renderMenuButton}\n </Ariakit.MenuItem>\n {list}\n </Menu>\n )\n})\n\n//\n// MenuGroup\n//\n\ntype MenuGroupProps = Omit<NativeProps<HTMLDivElement>, 'className'> & {\n /**\n * A label to be shown visually and also used to semantically label the group.\n */\n label: string\n}\n\n/**\n * A way to semantically group some menu items.\n *\n * This group does not add any visual separator. You can do that yourself adding `<hr />` elements\n * before and/or after the group if you so wish.\n */\nconst MenuGroup = polymorphicComponent<'div', MenuGroupProps>(function MenuGroup(\n { label, children, exceptionallySetClassName, ...props },\n ref,\n) {\n const { state } = React.useContext(MenuContext)\n return (\n <Ariakit.MenuGroup {...props} ref={ref} state={state} className={exceptionallySetClassName}>\n {label ? (\n <div role=\"presentation\" className=\"reactist_menugroup__label\">\n {label}\n </div>\n ) : null}\n {children}\n </Ariakit.MenuGroup>\n )\n})\n\nexport { ContextMenuTrigger, Menu, MenuButton, MenuList, MenuItem, SubMenu, MenuGroup }\nexport type { MenuButtonProps, MenuListProps, MenuItemProps, MenuGroupProps }\n"],"names":["MenuContext","React","Menu","children","onItemSelect","props","anchorRect","handleAnchorRectChange","getAnchorRect","undefined","state","Ariakit","focusLoop","gutter","shift","open","handleItemSelect","value","Provider","MenuButton","polymorphicComponent","ref","exceptionallySetClassName","className","classNames","ContextMenuTrigger","as","component","handleContextMenu","event","preventDefault","x","clientX","y","clientY","show","onContextMenu","MenuList","modal","Portal","preserveTabOrder","MenuItem","onSelect","hideOnSelect","onClick","hide","handleClick","onSelectResult","defaultPrevented","shouldClose","hideOnClick","SubMenu","parentMenuItemSelect","parentMenuHide","handleSubItemSelect","button","list","toArray","renderMenuButton","MenuGroup","label","role"],"mappings":";;;;;;;;;;;;;AA4BA,MAAMA,WAAW,gBAAGC,aAAA;AAEhB;AACA;AACA;AACA;AACA,EANgB,CAApB;AA8BA;;;;;AAIA,SAASC,IAAT;MAAc;IAAEC,QAAF;IAAYC;;MAAiBC;;EACvC,MAAM,CAACC,UAAD,EAAaC,sBAAb,IAAuCN,QAAA,CACzC,IADyC,CAA7C;EAGA,MAAMO,aAAa,GAAGP,OAAA,CAAc;IAChC,OAAOK,UAAU,GAAG,MAAMA,UAAT,GAAsBG,SAAvC;GADkB,EAEnB,CAACH,UAAD,CAFmB,CAAtB;EAIA,MAAMI,KAAK,GAAGC,YAAA;IACVC,SAAS,EAAE,IADD;IAEVC,MAAM,EAAE,CAFE;IAGVC,KAAK,EAAE,CAHG;IAIVN;KACGH,KALO,EAAd;EAQAJ,SAAA,CAAgB;IACZ,IAAI,CAACS,KAAK,CAACK,IAAX,EAAiBR,sBAAsB,CAAC,IAAD,CAAtB;GADrB,EAEG,CAACG,KAAK,CAACK,IAAP,CAFH;EAIA,MAAMC,gBAAgB,GAAGf,WAAA,CACrB,SAASe,gBAAT,CAA0BC,KAA1B;IACI,IAAIb,YAAJ,EAAkBA,YAAY,CAACa,KAAD,CAAZ;GAFD,EAIrB,CAACb,YAAD,CAJqB,CAAzB;EAOA,MAAMa,KAAK,GAAqBhB,OAAA,CAC5B,OAAO;IACHS,KADG;IAEHM,gBAFG;IAGHT;GAHJ,CAD4B,EAM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uC,KAAF;IAASzD,QAAT;IAAmBmB;;MAA8BjB;;EAGjD,MAAM;IAAEK;MAAUT,UAAA,CAAiBD,WAAjB,CAAlB;EACA,oBACIC,aAAA,CAACU,WAAD,oCAAuBN,KAAvB;IAA8BgB,GAAG,EAAEA,GAAnC;IAAwCX,KAAK,EAAEA,KAA/C;IAAsDa,SAAS,EAAED;MAC5DsC,KAAK,gBACF3D,aAAA,MAAA;IAAK4D,IAAI,EAAC;IAAetC,SAAS,EAAC;GAAnC,EACKqC,KADL,CADE,GAIF,IALR,EAMKzD,QANL,CADJ;AAUH,CAfqC;;;;"}
1
+ {"version":3,"file":"menu.js","sources":["../../src/menu/menu.tsx"],"sourcesContent":["import * as React from 'react'\nimport classNames from 'classnames'\n\nimport { polymorphicComponent } from '../utils/polymorphism'\n\n//\n// Reactist menu is a thin wrapper around Ariakit's menu components. This may or may not be\n// temporary. Our goal is to make it transparent for the users of Reactist of this implementation\n// detail. We may change in the future the external lib we use, or even implement it all internally,\n// as long as we keep the same outer interface as intact as possible.\n//\n// Around the heavy lifting of the external lib we just add some features to better integrate the\n// menu to Reactist's more opinionated approach (e.g. using our button with its custom variants and\n// other features, easily show keyboard shortcuts in menu items, etc.)\n//\nimport * as Ariakit from 'ariakit/menu'\nimport { Portal } from 'ariakit/portal'\n\nimport { Box } from '../box'\nimport { Text } from '../text'\nimport { useId } from '../utils/common-helpers'\n\nimport styles from './menu.module.css'\nimport { Tooltip } from '../tooltip'\n\ntype NativeProps<E extends HTMLElement> = React.DetailedHTMLProps<React.HTMLAttributes<E>, E>\n\ntype MenuContextState = {\n state: Ariakit.MenuState\n handleItemSelect: (value: string | null | undefined) => void\n handleAnchorRectChange: (value: { x: number; y: number } | null) => void\n}\n\nconst MenuContext = React.createContext<MenuContextState>(\n // Ariakit gives us no means to obtain a valid initial/default value of type MenuStateReturn\n // (it is normally obtained by calling useMenuState but we can't call hooks outside components).\n // This is however of little consequence since this value is only used if some of the components\n // are used outside Menu, something that should not happen and we do not support.\n // @ts-expect-error\n {},\n)\n\n//\n// Menu\n//\n\ntype MenuProps = Omit<Ariakit.MenuStateProps, 'visible'> & {\n /**\n * The `Menu` must contain a `MenuList` that defines the menu options. It must also contain a\n * `MenuButton` that triggers the menu to be opened or closed.\n */\n children: React.ReactNode\n\n /**\n * An optional callback that will be called back whenever a menu item is selected. It receives\n * the `value` of the selected `MenuItem`.\n *\n * If you pass down this callback, it is recommended that you properly memoize it so it does not\n * change on every render.\n */\n onItemSelect?: (value: string | null | undefined) => void\n}\n\ntype MenuHandle = {\n open: () => void\n}\n\n/**\n * Wrapper component to control a menu. It does not render anything, only providing the state\n * management for the menu components inside it.\n */\nconst Menu = React.forwardRef<MenuHandle, MenuProps>(function Menu(\n { children, onItemSelect, ...props },\n ref,\n) {\n const [anchorRect, handleAnchorRectChange] = React.useState<{ x: number; y: number } | null>(\n null,\n )\n const getAnchorRect = React.useMemo(() => {\n return anchorRect ? () => anchorRect : undefined\n }, [anchorRect])\n\n const state = Ariakit.useMenuState({\n focusLoop: true,\n gutter: 8,\n shift: 4,\n getAnchorRect,\n ...props,\n })\n\n React.useEffect(() => {\n if (!state.open) handleAnchorRectChange(null)\n }, [state.open])\n\n React.useImperativeHandle(ref, () => ({ open: state.show }))\n\n const handleItemSelect = React.useCallback(\n function handleItemSelect(value: string | null | undefined) {\n if (onItemSelect) onItemSelect(value)\n },\n [onItemSelect],\n )\n\n const value: MenuContextState = React.useMemo(\n () => ({\n state,\n handleItemSelect,\n handleAnchorRectChange,\n }),\n [state, handleItemSelect],\n )\n\n return <MenuContext.Provider value={value}>{children}</MenuContext.Provider>\n})\n\n//\n// MenuButton\n//\n\ntype MenuButtonProps = Omit<Ariakit.MenuButtonProps, 'state' | 'className' | 'as'>\n\n/**\n * A button to toggle a dropdown menu open or closed.\n */\nconst MenuButton = polymorphicComponent<'button', MenuButtonProps>(function MenuButton(\n { exceptionallySetClassName, ...props },\n ref,\n) {\n const { state } = React.useContext(MenuContext)\n return (\n <Ariakit.MenuButton\n {...props}\n state={state}\n ref={ref}\n className={exceptionallySetClassName}\n />\n )\n})\n\n//\n// MenuItemContent\n//\n\ntype MenuItemContentProps = {\n id: string\n\n /**\n * The menu item's label.\n */\n label?: NonNullable<React.ReactNode>\n\n /**\n * The menu item's description, typically used to provide additional information about what the\n * menu item does.\n *\n * When used, it is rendered below the label. The label is also shown more prominently (e.g.\n * using bold text), while the description is rendered using text in secondary tone.\n *\n * Therefore, for the description to be rendered, you must also provide a `label`.\n */\n description?: React.ReactNode\n\n /**\n * An optional icon to render next to the menu item's label.\n *\n * For the icon to be rendered, you must also provide a `label`.\n */\n icon?: React.ReactNode\n\n /**\n * An optional element to render to the right of the menu item's label. It is often used to\n * show a keyboard shortcut for the menu item.\n *\n * For the shortcut to be rendered, you must also provide a `label`.\n */\n shortcut?: React.ReactNode\n}\n\n/**\n * Renders the content inside a standard MenuItem. It is extracted into a component for reuse in\n * the SubMenuItem, which is a MenuItem visually, but semantically it's closer to be a MenuButton.\n * @private\n */\nfunction MenuItemContent({ label, description, icon, shortcut, id }: MenuItemContentProps) {\n if (!label) return null\n return (\n <Box\n display=\"flex\"\n gap=\"small\"\n alignItems=\"center\"\n width=\"full\"\n aria-hidden // the menu item is labelled via aria-labelledby and aria-describedby\n >\n {icon ? <div className={styles.menuItemIcon}>{icon}</div> : null}\n <Box\n display=\"inlineFlex\"\n flexDirection=\"column\"\n gap=\"xsmall\"\n paddingY=\"xsmall\"\n alignItems=\"flexStart\"\n overflow=\"hidden\"\n flexGrow={1}\n >\n <Text\n id={`${id}-label`}\n weight={description ? 'semibold' : 'regular'}\n size=\"copy\"\n lineClamp={1}\n exceptionallySetClassName={styles.menuItemLabel}\n >\n {label}\n </Text>\n {description ? (\n <Text\n id={`${id}-description`}\n size=\"copy\"\n tone=\"secondary\"\n exceptionallySetClassName={styles.menuItemDescription}\n >\n {description}\n </Text>\n ) : null}\n </Box>\n {shortcut ? <div>{shortcut}</div> : null}\n </Box>\n )\n}\n\n//\n// SubMenuItem\n//\n\nfunction ArrowRightIcon() {\n return (\n <svg width=\"24\" height=\"24\">\n <path\n d=\"M14.243 12L9.646 7.404a.5.5 0 1 1 .708-.707l4.95 4.95a.5.5 0 0 1 0 .707l-4.95 4.95a.5.5 0 0 1-.708-.708L14.243 12z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n </svg>\n )\n}\n\ntype SubMenuItemProps = Omit<Ariakit.MenuButtonProps, 'state' | 'className' | 'as' | 'children'> &\n Pick<MenuItemProps, 'label' | 'icon'>\n\n/**\n * A menu item to toggle a sub-menu open or closed.\n */\nconst SubMenuItem = polymorphicComponent<'button', SubMenuItemProps>(function SubMenuItem(\n { exceptionallySetClassName, label, icon, ...props },\n ref,\n) {\n const id = useId(props.id)\n const { state } = React.useContext(MenuContext)\n return (\n <Ariakit.MenuButton\n aria-labelledby={label && !props['aria-label'] ? `${id}-label` : undefined}\n {...props}\n state={state}\n ref={ref}\n className={classNames(styles.menuItem, exceptionallySetClassName)}\n >\n <MenuItemContent id={id} icon={icon} label={label} shortcut={<ArrowRightIcon />} />\n </Ariakit.MenuButton>\n )\n})\n\n//\n// ContextMenuTrigger\n//\nconst ContextMenuTrigger = polymorphicComponent<'div', unknown>(function ContextMenuTrigger(\n { as: component = 'div', ...props },\n ref,\n) {\n const { handleAnchorRectChange, state } = React.useContext(MenuContext)\n const handleContextMenu = React.useCallback(\n (event: React.MouseEvent) => {\n event.preventDefault()\n handleAnchorRectChange({ x: event.clientX, y: event.clientY })\n state.show()\n },\n [handleAnchorRectChange, state],\n )\n\n return React.createElement(component, { ...props, onContextMenu: handleContextMenu, ref })\n})\n\n//\n// MenuList and SubMenuList\n//\n\ntype MenuListProps = Omit<Ariakit.MenuProps, 'state' | 'className'>\n\n/**\n * The dropdown menu itself, containing a list of menu items.\n */\nconst MenuList = polymorphicComponent<'div', MenuListProps>(function MenuList(\n { exceptionallySetClassName, modal = true, ...props },\n ref,\n) {\n const { state } = React.useContext(MenuContext)\n if (!state.open) return null\n\n return (\n <Portal preserveTabOrder>\n <Ariakit.Menu\n {...props}\n state={state}\n ref={ref}\n className={classNames(styles.menuList, exceptionallySetClassName)}\n modal={modal}\n />\n </Portal>\n )\n})\n\n/**\n * Mostly equivalent to the `MenuList`, but to be used inside a `SubMenu`.\n */\nconst SubMenuList = polymorphicComponent<'div', MenuListProps>(function SubMenuList(\n { exceptionallySetClassName, modal = true, ...props },\n ref,\n) {\n const { state } = React.useContext(MenuContext)\n if (!state.open) return null\n\n return (\n <Portal preserveTabOrder>\n <Ariakit.Menu\n {...props}\n state={state}\n ref={ref}\n className={classNames(\n styles.menuList,\n styles.subMenuList,\n exceptionallySetClassName,\n )}\n modal={modal}\n />\n </Portal>\n )\n})\n\n//\n// MenuItem\n//\n\nfunction useMenuItemClickHandler({\n value,\n hideOnSelect,\n onClick,\n onSelect,\n}: Pick<MenuItemProps, 'value' | 'hideOnSelect' | 'onClick' | 'onSelect'>) {\n const { handleItemSelect, state } = React.useContext(MenuContext)\n const { hide } = state\n\n return React.useCallback(\n function handleClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event)\n const onSelectResult: unknown =\n onSelect && !event.defaultPrevented ? onSelect() : undefined\n const shouldClose = onSelectResult !== false && hideOnSelect\n handleItemSelect(value)\n if (shouldClose) hide()\n },\n [onSelect, onClick, handleItemSelect, hideOnSelect, hide, value],\n )\n}\n\ntype MenuItemProps = {\n /**\n * An optional value given to this menu item.\n *\n * It is passed on to the parent `Menu`'s `onItemSelect` when you provide that instead of (or\n * alongside) providing individual `onSelect` callbacks to each menu item.\n */\n value?: string\n\n /**\n * The menu item's content.\n *\n * Prefer using `label` instead. In addition to `label`, you can also use `description`, `icon`\n * and `shortcut`, to provide richer content inside the menu item.\n *\n * However, you can still use `children` to provide arbitrary content inside the menu item. You\n * can even combine `children` with the other props to provide a richer menu item. The\n * `children` content will be rendered first, followed by the regular menu item content\n * generated using the `label`, `description`, `icon` and `shortcut` props (if the `label` is\n * present).\n */\n children?: React.ReactNode\n\n /**\n * The menu item's label.\n */\n label?: NonNullable<React.ReactNode>\n\n /**\n * The menu item's description, typically used to provide additional information about what the\n * menu item does.\n *\n * When used, it is rendered below the label. The label is also shown more prominently (e.g.\n * using bold text), while the description is rendered using text in secondary tone.\n *\n * Therefore, for the description to be rendered, you must also provide a `label`.\n */\n description?: React.ReactNode\n\n /**\n * An optional icon to render next to the menu item's label.\n *\n * For the icon to be rendered, you must also provide a `label`.\n */\n icon?: NonNullable<React.ReactNode>\n\n /**\n * An optional element to render to the right of the menu item's label. It is often used to\n * show a keyboard shortcut for the menu item.\n *\n * For the shortcut to be rendered, you must also provide a `label`.\n */\n shortcut?: React.ReactNode\n\n /**\n * The tone to use for the menu item.\n */\n tone?: 'normal' | 'destructive'\n\n /**\n * When `true` the menu item is disabled and won't be selectable or be part of the keyboard\n * navigation across the menu options.\n *\n * @default true\n */\n disabled?: boolean\n\n /**\n * When `true` the menu will close when the menu item is selected, in addition to performing the\n * action that the menu item is set out to do.\n *\n * Set this to `false` to make sure that a given menu item does not auto-closes the menu when\n * selected. This should be the exception and not the norm, as the default is to auto-close.\n *\n * @default true\n */\n hideOnSelect?: boolean\n\n /**\n * The action to perform when the menu item is selected.\n *\n * If you return `false` from this function, the menu will not auto-close when this menu item\n * is selected. Though you should use `hideOnSelect` for this purpose, this allows you to\n * achieve the same effect conditionally and dynamically deciding at run time.\n */\n onSelect?: () => unknown\n\n /**\n * The event handler called when the menu item is clicked.\n *\n * This is similar to `onSelect`, but a bit different. You can certainly use it to trigger the\n * action that the menu item represents. But in general you should prefer `onSelect` for that.\n *\n * The main use for this handler is to get access to the click event. This can be used, for\n * example, to call `event.preventDefault()`, which will effectively prevent the rest of the\n * consequences of the click, including preventing `onSelect` from being called. In particular,\n * this is useful in menu items that are links, and you want the click to not trigger navigation\n * under some circumstances.\n */\n onClick?: (event: React.MouseEvent) => void\n}\n\n/**\n * A menu item inside a menu list. It can be selected by the user, triggering the `onSelect`\n * callback.\n */\nconst MenuItem = polymorphicComponent<'button', MenuItemProps>(function MenuItem(\n {\n value,\n label,\n description,\n icon,\n shortcut,\n tone,\n children,\n onSelect,\n hideOnSelect = true,\n onClick,\n exceptionallySetClassName,\n as = 'button',\n ...props\n },\n ref,\n) {\n const id = useId(props.id)\n const { state } = React.useContext(MenuContext)\n const handleClick = useMenuItemClickHandler({ value, onSelect, onClick, hideOnSelect })\n\n return (\n <Ariakit.MenuItem\n aria-labelledby={label && !props['aria-label'] ? `${id}-label` : undefined}\n aria-describedby={label && description ? `${id}-description` : undefined}\n {...props}\n as={as}\n state={state}\n ref={ref}\n onClick={handleClick}\n className={classNames(\n styles.menuItem,\n tone === 'destructive' ? styles.destructive : null,\n exceptionallySetClassName,\n )}\n hideOnClick={false}\n >\n {children ? (\n <Box width=\"full\" className={label ? undefined : styles.legacyLayout}>\n {children}\n </Box>\n ) : null}\n\n <MenuItemContent\n id={id}\n icon={icon}\n label={label}\n description={description}\n shortcut={shortcut}\n />\n </Ariakit.MenuItem>\n )\n})\n\n//\n// SubMenu\n//\n\ntype SubMenuProps = Pick<MenuProps, 'children' | 'onItemSelect'>\n\n/**\n * This component can be rendered alongside other `MenuItem` elements inside a `MenuList` to show a\n * sub-menu.\n *\n * Its children are expected to be exactly two elements, in the following order:\n *\n * 1. A `SubMenuItem` element: the menu item that triggers the sub-menu to open.\n * 2. A `SubMenuList` element: the list of menu items that will be shown when the sub-menu is open.\n *\n * ## Usage\n *\n * ```jsx\n * <Menu>\n * <MenuButton>Menu</MenuButton>\n * <MenuList>\n * <MenuItem label=\"Item 1\" />\n * <MenuItem label=\"Item 2\" />\n * <SubMenu>\n * <SubMenuItem label=\"Submenu\" />\n * <SubMenuList>\n * <MenuItem label=\"Submenu Item 1\" />\n * <MenuItem label=\"Submenu Item 2\" />\n * </SubMenuList>\n * </SubMenu>\n * </MenuList>\n * </Menu>\n * ```\n */\nconst SubMenu = React.forwardRef<HTMLDivElement, SubMenuProps>(function SubMenu(\n { children, onItemSelect },\n ref,\n) {\n const { handleItemSelect: parentMenuItemSelect, state } = React.useContext(MenuContext)\n const { hide: parentMenuHide } = state\n\n const handleSubItemSelect = React.useCallback(\n function handleSubItemSelect(value: string | null | undefined) {\n if (onItemSelect) onItemSelect(value)\n parentMenuItemSelect(value)\n parentMenuHide()\n },\n [parentMenuHide, parentMenuItemSelect, onItemSelect],\n )\n\n const [button, list] = React.Children.toArray(children)\n\n // Ariakit needs to be able to pass props to the MenuButton\n // and combine it with the MenuItem component\n const renderMenuButton = React.useCallback(\n function renderMenuButton(props: MenuButtonProps) {\n return React.cloneElement(button as React.ReactElement, props)\n },\n [button],\n )\n\n return (\n <Menu onItemSelect={handleSubItemSelect}>\n <Ariakit.MenuItem as=\"div\" state={state} ref={ref} hideOnClick={false}>\n {renderMenuButton}\n </Ariakit.MenuItem>\n <div className={styles.subMenuContainer}>{list}</div>\n </Menu>\n )\n})\n\n//\n// MenuGroup\n//\n\ntype MenuGroupProps = Omit<NativeProps<HTMLDivElement>, 'className'> & {\n /**\n * A label to be shown visually and also used to semantically label the group.\n */\n label: NonNullable<React.ReactNode>\n\n /**\n * An optional info element to be shown to the right of the label.\n *\n * This is useful and often used to:\n * - Provide a link to any documentation related to the menu items in the group\n * - Show a keyboard shortcut that triggers the menu items in the group\n *\n * It is strongly recommended that this should be a icon-only element. It is also strongly\n * recommended that, when using it to provide a link, you use the very `IconMenuItem` component\n * to make the link be yet another menu item accessible in the menu via keyboard navigation.\n * Here's an example of how to do that:\n *\n * ```jsx\n * <MenuGroup\n * label=\"A group of related options\"\n * info={\n * <IconMenuItem\n * label=\"Help about this group of options\"\n * icon=\"ℹ️\"\n * as=\"a\"\n * href=\"http://help.example.com\"\n * target=\"_blank\"\n * rel=\"noreferrer noopener\"\n * />\n * }\n * >\n * <MenuItem label=\"First option\" icon={<FirstIcon />} />\n * <MenuItem label=\"Second option\" icon={<SecondIcon />} />\n * </MenuGroup>\n * ```\n */\n info?: React.ReactNode\n}\n\n/**\n * A way to semantically group some menu items.\n *\n * This group does not add any visual separator. You can do that yourself adding `<hr />` elements\n * before and/or after the group if you so wish.\n */\nconst MenuGroup = polymorphicComponent<'div', MenuGroupProps>(function MenuGroup(\n { label, info, children, exceptionallySetClassName, ...props },\n ref,\n) {\n const id = useId(props.id)\n const { state } = React.useContext(MenuContext)\n return (\n <Ariakit.MenuGroup\n aria-labelledby={`menugroup-label-${id}`}\n {...props}\n id={id}\n ref={ref}\n state={state}\n className={exceptionallySetClassName}\n >\n <Box display=\"flex\" alignItems=\"center\" gap=\"small\" className={styles.menuGroupLabel}>\n <Text id={`menugroup-label-${id}`} size=\"copy\" weight=\"semibold\">\n {label}\n </Text>\n {info ? (\n <Box\n flexShrink={0}\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n className={styles.menuGroupInfo}\n >\n {info}\n </Box>\n ) : null}\n </Box>\n {children}\n </Ariakit.MenuGroup>\n )\n})\n\n//\n// IconMenuItem & IconsMenuGroup\n//\n\ntype IconMenuItemProps = Pick<MenuItemProps, 'value' | 'hideOnSelect' | 'onSelect' | 'onClick'> & {\n /**\n * A label for assistive technologies to describe the menu item.\n *\n * When not provided, the `label` is used. But this is useful when you want the tooltip label\n * to be different from the label for assistive technologies.\n */\n 'aria-label'?: string\n\n /**\n * The menu item's label, which is not shown visually on the menu item, but it is used to\n * show a tooltip for the menu item when hovered or focused.\n *\n * It is also used as the semantic label for assistive technologies, unless you provide an\n * `aria-label` as well.\n */\n label: string\n\n /**\n * A description for assistive technologies to describe the menu item.\n */\n description?: React.ReactNode\n\n /**\n * The icon to show on the menu item.\n */\n icon: NonNullable<React.ReactNode>\n}\n\n/**\n * A menu item that visually only shows as an icon. It must be used inside an `IconsMenuGroup`.\n */\nconst IconMenuItem = polymorphicComponent<'button', IconMenuItemProps>(function IconMenuItem(\n {\n value,\n label,\n description,\n icon,\n onSelect,\n hideOnSelect = true,\n onClick,\n exceptionallySetClassName,\n as = 'button',\n ...props\n },\n ref,\n) {\n const id = useId(props.id)\n const { state } = React.useContext(MenuContext)\n const handleClick = useMenuItemClickHandler({ value, onSelect, onClick, hideOnSelect })\n\n return (\n <Tooltip content={label}>\n <Ariakit.MenuItem\n aria-label={label}\n aria-describedby={`${id}-description`}\n {...props}\n as={as}\n state={state}\n ref={ref}\n onClick={handleClick}\n className={classNames(styles.iconMenuItem, exceptionallySetClassName)}\n hideOnClick={false}\n >\n {icon}\n </Ariakit.MenuItem>\n </Tooltip>\n )\n})\n\n/**\n * Semantically equivalent to `MenuGroup`, but meant to group `IconMenuItem`s only.\n */\nconst IconsMenuGroup = polymorphicComponent<'div', MenuGroupProps>(function IconsMenuGroup(\n { children, ...props },\n ref,\n) {\n return (\n <MenuGroup {...props} ref={ref}>\n <div className={styles.iconsMenuGroup}>{children}</div>\n </MenuGroup>\n )\n})\n\nexport {\n ContextMenuTrigger,\n IconMenuItem,\n IconsMenuGroup,\n Menu,\n MenuButton,\n MenuGroup,\n MenuItem,\n MenuList,\n SubMenu,\n SubMenuItem,\n SubMenuList,\n}\n\nexport type {\n IconMenuItemProps,\n MenuButtonProps,\n MenuGroupProps,\n MenuHandle,\n MenuItemProps,\n MenuListProps,\n MenuProps,\n SubMenuItemProps,\n SubMenuProps,\n}\n"],"names":["MenuContext","React","Menu","ref","children","onItemSelect","props","anchorRect","handleAnchorRectChange","getAnchorRect","undefined","state","Ariakit","focusLoop","gutter","shift","open","show","handleItemSelect","value","Provider","MenuButton","polymorphicComponent","exceptionallySetClassName","className","MenuItemContent","label","description","icon","shortcut","id","Box","display","gap","alignItems","width","styles","menuItemIcon","flexDirection","paddingY","overflow","flexGrow","Text","weight","size","lineClamp","menuItemLabel","tone","menuItemDescription","ArrowRightIcon","height","d","fill","fillRule","SubMenuItem","useId","classNames","menuItem","ContextMenuTrigger","as","component","handleContextMenu","event","preventDefault","x","clientX","y","clientY","onContextMenu","MenuList","modal","Portal","preserveTabOrder","menuList","SubMenuList","subMenuList","useMenuItemClickHandler","hideOnSelect","onClick","onSelect","hide","handleClick","onSelectResult","defaultPrevented","shouldClose","MenuItem","destructive","hideOnClick","legacyLayout","SubMenu","parentMenuItemSelect","parentMenuHide","handleSubItemSelect","button","list","toArray","renderMenuButton","subMenuContainer","MenuGroup","info","menuGroupLabel","flexShrink","justifyContent","menuGroupInfo","IconMenuItem","Tooltip","content","iconMenuItem","IconsMenuGroup","iconsMenuGroup"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAMA,WAAW,gBAAGC,aAAA;AAEhB;AACA;AACA;AACA;AACA,EANgB,CAApB;AAkCA;;;;;MAIMC,IAAI,gBAAGD,UAAA,CAAwC,SAASC,IAAT,OAEjDC,GAFiD;MACjD;IAAEC,QAAF;IAAYC;;MAAiBC;;EAG7B,MAAM,CAACC,UAAD,EAAaC,sBAAb,IAAuCP,QAAA,CACzC,IADyC,CAA7C;EAGA,MAAMQ,aAAa,GAAGR,OAAA,CAAc;IAChC,OAAOM,UAAU,GAAG,MAAMA,UAAT,GAAsBG,SAAvC;GADkB,EAEnB,CAACH,UAAD,CAFmB,CAAtB;EAIA,MAAMI,KAAK,GAAGC,YAAA;IACVC,SAAS,EAAE,IADD;IAEVC,MAAM,EAAE,CAFE;IAGVC,KAAK,EAAE,CAHG;IAIVN;KACGH,KALO,EAAd;EAQAL,SAAA,CAAgB;IACZ,IAAI,CAACU,KAAK,CAACK,IAAX,EAAiBR,sBAAsB,CAAC,IAAD,CAAtB;GADrB,EAEG,CAACG,KAAK,CAACK,IAAP,CAFH;EAIAf,mBAAA,CAA0BE,GAA1B,EAA+B,OAAO;IAAEa,IAAI,EAAEL,KAAK,CAACM;GAArB,CAA/B;EAEA,MAAMC,gBAAgB,GAAGjB,WAAA,CACrB,SAASiB,gBAAT,CAA0BC,KAA1B;IACI,IAAId,YAAJ,EAAkBA,YAAY,CAACc,KAAD,CAAZ;GAFD,EAIrB,CAACd,YAAD,CAJqB,CAAzB;EAOA,MAAMc,KAAK,GAAqBlB,OAAA,CAC5B,OAAO;IACHU,KADG;IAEHO,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AAD;kBACgBc,KADhB;wBAEyBI;KACjBxB,KAHR;IAIIqD,EAAE,EAAEA,EAJR;IAKIhD,KAAK,EAAEA,KALX;IAMIR,GAAG,EAAEA,GANT;IAOI2E,OAAO,EAAEG,WAPb;IAQIzD,SAAS,EAAEgC,UAAU,CAACpB,MAAM,CAACuE,YAAR,EAAsBpF,yBAAtB,CARzB;IASIgE,WAAW,EAAE;MAEZ3D,IAXL,CADJ,CADJ;AAiBH,CApCwC;AAsCzC;;;;MAGMgF,cAAc,gBAAGtF,oBAAoB,CAAwB,SAASsF,cAAT,SAE/DzG,GAF+D;MAC/D;IAAEC;;MAAaE;;EAGf,oBACIL,aAAA,CAACiG,SAAD,oCAAe5F,KAAf;IAAsBH,GAAG,EAAEA;mBACvBF,aAAA,MAAA;IAAKuB,SAAS,EAAEY,MAAM,CAACyE;GAAvB,EAAwCzG,QAAxC,CADJ,CADJ;AAKH,CAT0C;;;;"}
@@ -0,0 +1,4 @@
1
+ var modules_2befbba6 = {"menuList":"c63e79f3","subMenuList":"_1e89cfc6","iconMenuItem":"_1b808bea","menuItem":"_8607099d","legacyLayout":"_609759d5","menuGroupLabel":"f1730843","menuItemIcon":"_7cec7dce","menuItemLabel":"_91c012d8","menuItemDescription":"bb494fd4","destructive":"_503b074a","menuGroupInfo":"ad6d2e4a","iconsMenuGroup":"_410b11f2"};
2
+
3
+ export default modules_2befbba6;
4
+ //# sourceMappingURL=menu.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,4 +1,4 @@
1
- var modules_1fa9b208 = {"selectWrapper":"a804edbf","bordered":"_50a3655f","error":"a6d38abf"};
1
+ var modules_1fa9b208 = {"selectWrapper":"a9cbb3a6","bordered":"f3869290","error":"aefdbdaa"};
2
2
 
3
3
  export default modules_1fa9b208;
4
4
  //# sourceMappingURL=select-field.module.css.js.map