@superdispatch/ui 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,36 +1,16 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["items"];
4
- import { ResizeObserver } from '@juggle/resize-observer';
5
4
  import { Divider, Grid, Menu, MenuItem, Toolbar, Typography } from '@material-ui/core';
6
5
  import { MoreHoriz } from '@material-ui/icons';
7
6
  import { makeStyles } from '@material-ui/styles';
8
- import { useEventHandler } from '@superdispatch/hooks';
9
- import { forwardRef, useLayoutEffect, useRef, useState } from 'react';
7
+ import { forwardRef, useRef, useState } from 'react';
10
8
  import { Button } from "../button/Button.js";
11
9
  import { DropdownButton } from "../dropdown-button/DropdownButton.js";
10
+ import { useResizeObserver } from "../utils/ResizeObserver.js";
12
11
  import { jsx as _jsx } from "react/jsx-runtime";
13
12
  import { Fragment as _Fragment } from "react/jsx-runtime";
14
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
15
-
16
- function useResizeObserver(node, observer) {
17
- var handler = useEventHandler(observer);
18
- useLayoutEffect(() => {
19
- if (!node) {
20
- return;
21
- }
22
-
23
- var resizeObserver = new ResizeObserver(() => {
24
- handler(node);
25
- });
26
- resizeObserver.observe(node);
27
- handler(node);
28
- return () => {
29
- resizeObserver.disconnect();
30
- };
31
- }, [node, handler]);
32
- }
33
-
34
14
  var useStyles = /*#__PURE__*/makeStyles({
35
15
  actions: {
36
16
  overflow: 'hidden'
@@ -0,0 +1,116 @@
1
+ import { Divider, Grid, Menu, MenuItem } from '@material-ui/core';
2
+ import { MoreHoriz } from '@material-ui/icons';
3
+ import { makeStyles } from '@material-ui/styles';
4
+ import { cloneElement, forwardRef, useRef, useState } from 'react';
5
+ import { Button } from "../button/Button.js";
6
+ import { mergeRefs } from "../utils/mergeRefs.js";
7
+ import { useResizeObserver } from "../utils/ResizeObserver.js";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { Fragment as _Fragment } from "react/jsx-runtime";
10
+ import { jsxs as _jsxs } from "react/jsx-runtime";
11
+ var useStyles = /*#__PURE__*/makeStyles({
12
+ root: {
13
+ overflow: 'hidden',
14
+ height: '100%'
15
+ }
16
+ }, {
17
+ name: 'SD-AdaptiveVerticalToolbar'
18
+ });
19
+
20
+ var defaultMoreElement = /*#__PURE__*/_jsx(Button, {
21
+ type: "button",
22
+ children: /*#__PURE__*/_jsx(MoreHoriz, {})
23
+ });
24
+
25
+ export var AdaptiveVerticalToolbar = /*#__PURE__*/forwardRef((_ref, ref) => {
26
+ var {
27
+ items,
28
+ moreElement = defaultMoreElement,
29
+ renderItem = item => item.label
30
+ } = _ref;
31
+ var styles = useStyles();
32
+ var itemNodes = useRef([]);
33
+ var optionsButtonRef = useRef(null);
34
+ var [firstHiddenIdx, setFirstHiddenIdx] = useState(-1);
35
+ var menuItems = firstHiddenIdx === -1 ? [] : items.slice(firstHiddenIdx);
36
+ var [menuButtonNode, setMenuButtonRef] = useState();
37
+ var [rootNode, setRootNode] = useState(null);
38
+ useResizeObserver(rootNode, node => {
39
+ var _optionsButtonRef$cur;
40
+
41
+ var rootRect = node.getBoundingClientRect();
42
+ var rootHeight = rootRect.bottom;
43
+ var optionsButtonRect = (_optionsButtonRef$cur = optionsButtonRef.current) === null || _optionsButtonRef$cur === void 0 ? void 0 : _optionsButtonRef$cur.getBoundingClientRect();
44
+ var optionsButtonWidth = (optionsButtonRect === null || optionsButtonRect === void 0 ? void 0 : optionsButtonRect.height) || 0;
45
+ var maxBottomPosition = rootHeight - optionsButtonWidth;
46
+ var mountedNodes = itemNodes.current.filter(x => x != null);
47
+ var hiddenIdx = mountedNodes.findIndex((itemNode, idx) => {
48
+ itemNode.removeAttribute('hidden');
49
+ var itemRect = itemNode.getBoundingClientRect(); // Ignore options button height when checking last item.
50
+
51
+ if (idx === mountedNodes.length - 1) {
52
+ return itemRect.bottom > rootHeight;
53
+ }
54
+
55
+ return itemRect.bottom > maxBottomPosition;
56
+ });
57
+
58
+ if (hiddenIdx !== -1) {
59
+ mountedNodes.slice(hiddenIdx).forEach(itemNode => {
60
+ itemNode.setAttribute('hidden', 'true');
61
+ });
62
+ }
63
+
64
+ setFirstHiddenIdx(hiddenIdx);
65
+ });
66
+ return /*#__PURE__*/_jsxs(Grid, {
67
+ spacing: 1,
68
+ direction: "column",
69
+ container: true,
70
+ wrap: "nowrap",
71
+ className: styles.root,
72
+ ref: mergeRefs(ref, node => {
73
+ setRootNode(node);
74
+ }),
75
+ children: [items.map((item, idx) => /*#__PURE__*/_jsx(Grid, {
76
+ item: true,
77
+ ref: node => {
78
+ itemNodes.current[idx] = node;
79
+ },
80
+ children: renderItem(item)
81
+ }, item.key)), menuItems.length > 0 && /*#__PURE__*/_jsxs(Grid, {
82
+ item: true,
83
+ ref: optionsButtonRef,
84
+ component: "div",
85
+ children: [/*#__PURE__*/cloneElement(moreElement, {
86
+ onClick: _ref2 => {
87
+ var {
88
+ currentTarget
89
+ } = _ref2;
90
+ setMenuButtonRef(currentTarget);
91
+ }
92
+ }), /*#__PURE__*/_jsx(Menu, {
93
+ open: !!menuButtonNode,
94
+ anchorEl: menuButtonNode,
95
+ onClose: () => {
96
+ setMenuButtonRef(undefined);
97
+ },
98
+ children: menuItems.map((item, index, arr) => {
99
+ var next = arr[index + 1];
100
+ return /*#__PURE__*/_jsxs(_Fragment, {
101
+ children: [/*#__PURE__*/_jsx(MenuItem, {
102
+ onClick: event => {
103
+ var _item$onClick;
104
+
105
+ (_item$onClick = item.onClick) === null || _item$onClick === void 0 ? void 0 : _item$onClick.call(item, event);
106
+ setMenuButtonRef(undefined);
107
+ },
108
+ children: item.label
109
+ }, item.key), next && next.menuGroupKey !== item.menuGroupKey && /*#__PURE__*/_jsx(Divider, {})]
110
+ });
111
+ })
112
+ })]
113
+ })]
114
+ });
115
+ });
116
+ if (process.env.NODE_ENV !== "production") AdaptiveVerticalToolbar.displayName = "AdaptiveVerticalToolbar";
package/dist-src/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./adaptive-toolbar/AdaptiveToolbar.js";
2
+ export * from "./adaptive-vertical-toolbar/AdaptiveVerticalToolbar.js";
2
3
  export * from "./avatar-button/AvatarButton.js";
3
4
  export * from "./button/Button.js";
4
5
  export * from "./card-button/CardButton.js";
@@ -37,5 +38,6 @@ export * from "./tiles/Tiles.js";
37
38
  export * from "./utils/isEmptyReactNode.js";
38
39
  export * from "./utils/mergeRefs.js";
39
40
  export * from "./utils/renderChildren.js";
41
+ export * from "./utils/ResizeObserver.js";
40
42
  export * from "./utils/useUID.js";
41
43
  export * from "./utils/VisibilityObserver.js";
@@ -0,0 +1,20 @@
1
+ import { ResizeObserver } from '@juggle/resize-observer';
2
+ import { useEventHandler } from '@superdispatch/hooks';
3
+ import { useLayoutEffect } from 'react';
4
+ export function useResizeObserver(node, observer) {
5
+ var handler = useEventHandler(observer);
6
+ useLayoutEffect(() => {
7
+ if (!node) {
8
+ return;
9
+ }
10
+
11
+ var resizeObserver = new ResizeObserver(() => {
12
+ handler(node);
13
+ });
14
+ resizeObserver.observe(node);
15
+ handler(node);
16
+ return () => {
17
+ resizeObserver.disconnect();
18
+ };
19
+ }, [node, handler]);
20
+ }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ButtonProps as ButtonProps$1, ToolbarProps, AvatarClassKey, AvatarTypeMap, ButtonBaseProps, CheckboxProps, FormControlLabelProps, FormControlProps, FormGroupProps, FormLabelProps, FormHelperTextProps, TypographyProps, TooltipProps, ListProps, ListTypeMap, MenuListProps, ButtonGroupProps, GridProps, CardClassKey, CardProps, CardContentProps, RadioProps, RadioGroupProps, SnackbarContentProps as SnackbarContentProps$1, SnackbarContentClassKey as SnackbarContentClassKey$1, SnackbarProps as SnackbarProps$1, Theme } from '@material-ui/core';
3
- import { RefAttributes, ForwardRefExoticComponent, Key, ReactNode, MouseEvent, ButtonHTMLAttributes, Ref, ElementType, HTMLAttributes, ReactElement, ConsumerProps } from 'react';
3
+ import { RefAttributes, ForwardRefExoticComponent, Key, ReactNode, MouseEvent, ReactElement, EventHandler, ButtonHTMLAttributes, Ref, ElementType, HTMLAttributes, ConsumerProps } from 'react';
4
4
  import { ClassNameMap } from '@material-ui/styles';
5
5
  import { Property } from 'csstype';
6
6
  import { CommonProps } from '@material-ui/core/OverridableComponent';
@@ -33,6 +33,21 @@ interface AdaptiveToolbarProps extends RefAttributes<HTMLDivElement>, Omit<Toolb
33
33
  }
34
34
  declare const AdaptiveToolbar: ForwardRefExoticComponent<AdaptiveToolbarProps>;
35
35
 
36
+ interface AdaptiveVerticalToolbarItem {
37
+ key: Key;
38
+ label: ReactNode;
39
+ menuGroupKey?: Key;
40
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
41
+ }
42
+ interface AdaptiveVerticalToolbarProps extends RefAttributes<HTMLDivElement>, Omit<ToolbarProps, 'children'> {
43
+ items: AdaptiveVerticalToolbarItem[];
44
+ renderItem?: (item: AdaptiveVerticalToolbarItem) => ReactNode;
45
+ moreElement?: ReactElement<{
46
+ onClick: EventHandler<MouseEvent<HTMLElement>>;
47
+ }>;
48
+ }
49
+ declare const AdaptiveVerticalToolbar: ForwardRefExoticComponent<AdaptiveVerticalToolbarProps>;
50
+
36
51
  declare type AvatarButtonClassKey = 'button' | 'overlay' | 'progress' | 'withIcon' | 'sizeLarge' | Exclude<AvatarClassKey, 'circle'>;
37
52
  interface AvatarButtonProps extends RefAttributes<HTMLButtonElement>, ButtonHTMLAttributes<HTMLButtonElement> {
38
53
  size?: 'small' | 'large';
@@ -402,6 +417,8 @@ declare function assignRef<T>(ref: Ref<T> | undefined, value: T): void;
402
417
 
403
418
  declare function renderChildren(node: ReactNode): null | ReactElement;
404
419
 
420
+ declare function useResizeObserver<T extends HTMLElement>(node: null | undefined | T, observer: (node: T) => void): void;
421
+
405
422
  declare function useUID(defaultID?: string): string;
406
423
 
407
424
  declare type ElementVisibility = 'undetermined' | 'visible' | 'invisible';
@@ -423,4 +440,4 @@ interface VisibilityObserverProps extends VisibilityObserverOptions {
423
440
  }
424
441
  declare function VisibilityObserver({ render, onChange, ...options }: VisibilityObserverProps): null | ReactElement;
425
442
 
426
- export { AdaptiveToolbar, AdaptiveToolbarDropdownItem, AdaptiveToolbarItem, AdaptiveToolbarProps, AvatarButton, AvatarButtonClassKey, AvatarButtonProps, Button, ButtonProps, CardButton, CardButtonClassKey, CardButtonProps, CheckboxField, CheckboxFieldProps, CheckboxGroupField, CheckboxGroupFieldProps, CollapseBreakpoint, CollapseProp, Color, ColorProp, ColorVariant, Column, ColumnProps, ColumnWidth, Columns, ColumnsProps, DescriptionList, DescriptionListItem, DescriptionListItemProps, DescriptionListProps, DrawerActions, DrawerActionsProps, DrawerContent, DrawerContentProps, DrawerList, DrawerListProps, DrawerTitle, DrawerTitleProps, DropdownButton, ElementVisibility, GridStack, GridStackProps, HorizontalAlign, InfoCard, InfoCardClassKey, InfoCardProps, Inline, InlineGrid, InlineGridProps, InlineProps, NegativeSpaceProp, OverflowText, OverflowTextProps, PartialResponsivePropRecord, RadioField, RadioFieldProps, RadioGroupField, RadioGroupFieldProps, ResponsiveContext, ResponsiveContextProvider, ResponsiveContextProviderProps, ResponsiveProp, ResponsivePropPrimitive, ResponsivePropRecord, ResponsivePropTuple, ResponsivePropTupleInit, Snackbar, SnackbarCloseReason, SnackbarContent, SnackbarContentProps, SnackbarProps, SnackbarStack, SnackbarStackConsumer, SnackbarStackOptions, SnackbarStackProvider, SnackbarStackProviderProps, SnackbarVariant, SpaceProp, Stack, StackProps, SuperDispatchTheme, Tag, TagClassKey, TagProps, ThemeProvider, ThemeProviderProps, Tiles, TilesColumns, TilesProps, TilesSpace, VerticalAlign, VisibilityObserver, VisibilityObserverOptions, VisibilityObserverProps, VisibilityObserverRenderProps, assignRef, isColorProp, isEmptyReactNode, mergeRefs, parseAlignProp, parseCollapsedBelow, parseResponsiveProp, parseSpaceProp, renderChildren, useCollapseBreakpoint, useResponsiveContext, useResponsiveProp, useResponsivePropRecord, useResponsiveValue, useSnackbarStack, useUID, useVisibilityObserver };
443
+ export { AdaptiveToolbar, AdaptiveToolbarDropdownItem, AdaptiveToolbarItem, AdaptiveToolbarProps, AdaptiveVerticalToolbar, AdaptiveVerticalToolbarItem, AdaptiveVerticalToolbarProps, AvatarButton, AvatarButtonClassKey, AvatarButtonProps, Button, ButtonProps, CardButton, CardButtonClassKey, CardButtonProps, CheckboxField, CheckboxFieldProps, CheckboxGroupField, CheckboxGroupFieldProps, CollapseBreakpoint, CollapseProp, Color, ColorProp, ColorVariant, Column, ColumnProps, ColumnWidth, Columns, ColumnsProps, DescriptionList, DescriptionListItem, DescriptionListItemProps, DescriptionListProps, DrawerActions, DrawerActionsProps, DrawerContent, DrawerContentProps, DrawerList, DrawerListProps, DrawerTitle, DrawerTitleProps, DropdownButton, ElementVisibility, GridStack, GridStackProps, HorizontalAlign, InfoCard, InfoCardClassKey, InfoCardProps, Inline, InlineGrid, InlineGridProps, InlineProps, NegativeSpaceProp, OverflowText, OverflowTextProps, PartialResponsivePropRecord, RadioField, RadioFieldProps, RadioGroupField, RadioGroupFieldProps, ResponsiveContext, ResponsiveContextProvider, ResponsiveContextProviderProps, ResponsiveProp, ResponsivePropPrimitive, ResponsivePropRecord, ResponsivePropTuple, ResponsivePropTupleInit, Snackbar, SnackbarCloseReason, SnackbarContent, SnackbarContentProps, SnackbarProps, SnackbarStack, SnackbarStackConsumer, SnackbarStackOptions, SnackbarStackProvider, SnackbarStackProviderProps, SnackbarVariant, SpaceProp, Stack, StackProps, SuperDispatchTheme, Tag, TagClassKey, TagProps, ThemeProvider, ThemeProviderProps, Tiles, TilesColumns, TilesProps, TilesSpace, VerticalAlign, VisibilityObserver, VisibilityObserverOptions, VisibilityObserverProps, VisibilityObserverRenderProps, assignRef, isColorProp, isEmptyReactNode, mergeRefs, parseAlignProp, parseCollapsedBelow, parseResponsiveProp, parseSpaceProp, renderChildren, useCollapseBreakpoint, useResizeObserver, useResponsiveContext, useResponsiveProp, useResponsivePropRecord, useResponsiveValue, useSnackbarStack, useUID, useVisibilityObserver };
package/dist-web/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
2
2
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
- import { ResizeObserver } from '@juggle/resize-observer';
4
3
  import { Button as Button$1, CircularProgress, ButtonGroup, Popover, MenuList, Toolbar, Grid, MenuItem, Typography, Menu, Divider, ButtonBase, Avatar, FormControl, FormControlLabel, Checkbox, FormHelperText, FormLabel, FormGroup, useMediaQuery, Tooltip, SvgIcon, AppBar, List, Card, CardContent, Radio, RadioGroup, SnackbarContent as SnackbarContent$1, IconButton, Portal, Snackbar as Snackbar$1, Slide, CssBaseline, createTheme, createGenerateClassName } from '@material-ui/core';
5
4
  import { MoreHoriz, Close, Warning, CheckCircle } from '@material-ui/icons';
6
5
  import { makeStyles, StylesProvider, ThemeProvider as ThemeProvider$1 } from '@material-ui/styles';
7
- import { useEventHandler, useDeepEqualValue, useValueObserver, useDeepEqualMemo, useConstant } from '@superdispatch/hooks';
8
- import { forwardRef, useState, useRef, useLayoutEffect, useMemo, useContext, createContext, Children, useCallback } from 'react';
6
+ import { forwardRef, useState, useRef, useLayoutEffect, cloneElement, useMemo, useContext, createContext, Children, useCallback } from 'react';
9
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
10
8
  import styled, { css, ThemeProvider as ThemeProvider$2 } from 'styled-components';
9
+ import { ResizeObserver } from '@juggle/resize-observer';
10
+ import { useEventHandler, useDeepEqualValue, useValueObserver, useDeepEqualMemo, useConstant } from '@superdispatch/hooks';
11
11
  import clsx from 'clsx';
12
12
  import flattenChildren from 'react-keyed-flatten-children';
13
13
  import createBreakpoints from '@material-ui/core/styles/createBreakpoints';
@@ -145,8 +145,6 @@ var DropdownButton = /*#__PURE__*/forwardRef((_ref2, ref) => {
145
145
  });
146
146
  if (process.env.NODE_ENV !== "production") DropdownButton.displayName = "DropdownButton";
147
147
 
148
- var _excluded$2 = ["items"];
149
-
150
148
  function useResizeObserver(node, observer) {
151
149
  var handler = useEventHandler(observer);
152
150
  useLayoutEffect(() => {
@@ -165,6 +163,7 @@ function useResizeObserver(node, observer) {
165
163
  }, [node, handler]);
166
164
  }
167
165
 
166
+ var _excluded$2 = ["items"];
168
167
  var useStyles = /*#__PURE__*/makeStyles({
169
168
  actions: {
170
169
  overflow: 'hidden'
@@ -304,6 +303,134 @@ var AdaptiveToolbar = /*#__PURE__*/forwardRef((_ref, ref) => {
304
303
  });
305
304
  if (process.env.NODE_ENV !== "production") AdaptiveToolbar.displayName = "AdaptiveToolbar";
306
305
 
306
+ function mergeRefs() {
307
+ for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
308
+ refs[_key] = arguments[_key];
309
+ }
310
+
311
+ return node => {
312
+ refs.forEach(ref => {
313
+ assignRef(ref, node);
314
+ });
315
+ };
316
+ }
317
+ function assignRef(ref, value) {
318
+ if (ref) {
319
+ if (typeof ref === 'function') {
320
+ ref(value);
321
+ } else {
322
+ ref.current = value;
323
+ }
324
+ }
325
+ }
326
+
327
+ var useStyles$1 = /*#__PURE__*/makeStyles({
328
+ root: {
329
+ overflow: 'hidden',
330
+ height: '100%'
331
+ }
332
+ }, {
333
+ name: 'SD-AdaptiveVerticalToolbar'
334
+ });
335
+
336
+ var defaultMoreElement = /*#__PURE__*/jsx(Button, {
337
+ type: "button",
338
+ children: /*#__PURE__*/jsx(MoreHoriz, {})
339
+ });
340
+
341
+ var AdaptiveVerticalToolbar = /*#__PURE__*/forwardRef((_ref, ref) => {
342
+ var {
343
+ items,
344
+ moreElement = defaultMoreElement,
345
+ renderItem = item => item.label
346
+ } = _ref;
347
+ var styles = useStyles$1();
348
+ var itemNodes = useRef([]);
349
+ var optionsButtonRef = useRef(null);
350
+ var [firstHiddenIdx, setFirstHiddenIdx] = useState(-1);
351
+ var menuItems = firstHiddenIdx === -1 ? [] : items.slice(firstHiddenIdx);
352
+ var [menuButtonNode, setMenuButtonRef] = useState();
353
+ var [rootNode, setRootNode] = useState(null);
354
+ useResizeObserver(rootNode, node => {
355
+ var _optionsButtonRef$cur;
356
+
357
+ var rootRect = node.getBoundingClientRect();
358
+ var rootHeight = rootRect.bottom;
359
+ var optionsButtonRect = (_optionsButtonRef$cur = optionsButtonRef.current) === null || _optionsButtonRef$cur === void 0 ? void 0 : _optionsButtonRef$cur.getBoundingClientRect();
360
+ var optionsButtonWidth = (optionsButtonRect === null || optionsButtonRect === void 0 ? void 0 : optionsButtonRect.height) || 0;
361
+ var maxBottomPosition = rootHeight - optionsButtonWidth;
362
+ var mountedNodes = itemNodes.current.filter(x => x != null);
363
+ var hiddenIdx = mountedNodes.findIndex((itemNode, idx) => {
364
+ itemNode.removeAttribute('hidden');
365
+ var itemRect = itemNode.getBoundingClientRect(); // Ignore options button height when checking last item.
366
+
367
+ if (idx === mountedNodes.length - 1) {
368
+ return itemRect.bottom > rootHeight;
369
+ }
370
+
371
+ return itemRect.bottom > maxBottomPosition;
372
+ });
373
+
374
+ if (hiddenIdx !== -1) {
375
+ mountedNodes.slice(hiddenIdx).forEach(itemNode => {
376
+ itemNode.setAttribute('hidden', 'true');
377
+ });
378
+ }
379
+
380
+ setFirstHiddenIdx(hiddenIdx);
381
+ });
382
+ return /*#__PURE__*/jsxs(Grid, {
383
+ spacing: 1,
384
+ direction: "column",
385
+ container: true,
386
+ wrap: "nowrap",
387
+ className: styles.root,
388
+ ref: mergeRefs(ref, node => {
389
+ setRootNode(node);
390
+ }),
391
+ children: [items.map((item, idx) => /*#__PURE__*/jsx(Grid, {
392
+ item: true,
393
+ ref: node => {
394
+ itemNodes.current[idx] = node;
395
+ },
396
+ children: renderItem(item)
397
+ }, item.key)), menuItems.length > 0 && /*#__PURE__*/jsxs(Grid, {
398
+ item: true,
399
+ ref: optionsButtonRef,
400
+ component: "div",
401
+ children: [/*#__PURE__*/cloneElement(moreElement, {
402
+ onClick: _ref2 => {
403
+ var {
404
+ currentTarget
405
+ } = _ref2;
406
+ setMenuButtonRef(currentTarget);
407
+ }
408
+ }), /*#__PURE__*/jsx(Menu, {
409
+ open: !!menuButtonNode,
410
+ anchorEl: menuButtonNode,
411
+ onClose: () => {
412
+ setMenuButtonRef(undefined);
413
+ },
414
+ children: menuItems.map((item, index, arr) => {
415
+ var next = arr[index + 1];
416
+ return /*#__PURE__*/jsxs(Fragment, {
417
+ children: [/*#__PURE__*/jsx(MenuItem, {
418
+ onClick: event => {
419
+ var _item$onClick;
420
+
421
+ (_item$onClick = item.onClick) === null || _item$onClick === void 0 ? void 0 : _item$onClick.call(item, event);
422
+ setMenuButtonRef(undefined);
423
+ },
424
+ children: item.label
425
+ }, item.key), next && next.menuGroupKey !== item.menuGroupKey && /*#__PURE__*/jsx(Divider, {})]
426
+ });
427
+ })
428
+ })]
429
+ })]
430
+ });
431
+ });
432
+ if (process.env.NODE_ENV !== "production") AdaptiveVerticalToolbar.displayName = "AdaptiveVerticalToolbar";
433
+
307
434
  var Color;
308
435
 
309
436
  (function (Color) {
@@ -384,7 +511,7 @@ function isColorProp(name) {
384
511
 
385
512
  var _excluded$3 = ["size", "icon", "isLoading", "classes", "disabled", "avatarRef", "className", "alt", "imgProps", "sizes", "src", "srcSet", "variant", "children"],
386
513
  _excluded2 = ["button", "overlay", "progress", "withIcon", "sizeLarge"];
387
- var useStyles$1 = /*#__PURE__*/makeStyles(theme => {
514
+ var useStyles$2 = /*#__PURE__*/makeStyles(theme => {
388
515
  var sm = theme.breakpoints.up('sm');
389
516
  return {
390
517
  button: {
@@ -494,7 +621,7 @@ var AvatarButton = /*#__PURE__*/forwardRef((_ref, ref) => {
494
621
  } = _ref,
495
622
  props = _objectWithoutProperties(_ref, _excluded$3);
496
623
 
497
- var _useStyles = useStyles$1({
624
+ var _useStyles = useStyles$2({
498
625
  classes
499
626
  }),
500
627
  {
@@ -535,7 +662,7 @@ var AvatarButton = /*#__PURE__*/forwardRef((_ref, ref) => {
535
662
  if (process.env.NODE_ENV !== "production") AvatarButton.displayName = "AvatarButton";
536
663
 
537
664
  var _excluded$4 = ["hint", "size", "error", "classes", "className", "children", "endIcon", "startIcon", "disabled"];
538
- var useStyles$2 = /*#__PURE__*/makeStyles(theme => ({
665
+ var useStyles$3 = /*#__PURE__*/makeStyles(theme => ({
539
666
  root: {
540
667
  width: '100%',
541
668
  display: 'flex',
@@ -620,7 +747,7 @@ var CardButton = /*#__PURE__*/forwardRef((_ref, ref) => {
620
747
  } = _ref,
621
748
  props = _objectWithoutProperties(_ref, _excluded$4);
622
749
 
623
- var styles = useStyles$2({
750
+ var styles = useStyles$3({
624
751
  classes
625
752
  });
626
753
  return /*#__PURE__*/jsx(ButtonBase, _objectSpread(_objectSpread({}, props), {}, {
@@ -990,7 +1117,7 @@ function VisibilityObserver(_ref2) {
990
1117
 
991
1118
  var _excluded$8 = ["title", "enterDelay"],
992
1119
  _excluded2$1 = ["onClick", "children", "className", "disableUnderline", "TooltipProps"];
993
- var useStyles$3 = /*#__PURE__*/makeStyles(theme => ({
1120
+ var useStyles$4 = /*#__PURE__*/makeStyles(theme => ({
994
1121
  root: {
995
1122
  marginBottom: -1,
996
1123
  borderBottom: '1px dashed transparent',
@@ -1024,7 +1151,7 @@ var OverflowText = /*#__PURE__*/forwardRef((_ref, rootRef) => {
1024
1151
  props = _objectWithoutProperties(_ref, _excluded2$1);
1025
1152
 
1026
1153
  var [isOpen, setIsOpen] = useState(false);
1027
- var styles = useStyles$3();
1154
+ var styles = useStyles$4();
1028
1155
  return /*#__PURE__*/jsx(VisibilityObserver, {
1029
1156
  render: _ref2 => {
1030
1157
  var {
@@ -1087,7 +1214,7 @@ function sizeVariant(theme, mobileSpacing, desktopSpacing) {
1087
1214
  };
1088
1215
  }
1089
1216
 
1090
- var useStyles$4 = /*#__PURE__*/makeStyles(theme => ({
1217
+ var useStyles$5 = /*#__PURE__*/makeStyles(theme => ({
1091
1218
  list: sizeVariant(theme, 2, 1),
1092
1219
  listSmall: sizeVariant(theme, 1, 0.5),
1093
1220
  listLarge: sizeVariant(theme, 3, 2),
@@ -1118,7 +1245,7 @@ var DescriptionList = /*#__PURE__*/forwardRef((_ref, ref) => {
1118
1245
  } = _ref,
1119
1246
  props = _objectWithoutProperties(_ref, _excluded$9);
1120
1247
 
1121
- var styles = useStyles$4();
1248
+ var styles = useStyles$5();
1122
1249
  return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({}, props), {}, {
1123
1250
  ref: ref,
1124
1251
  "data-size": size,
@@ -1144,7 +1271,7 @@ var DescriptionListItem = /*#__PURE__*/forwardRef((_ref2, ref) => {
1144
1271
  contentTypographyProps,
1145
1272
  fallback
1146
1273
  } = _ref2;
1147
- var styles = useStyles$4();
1274
+ var styles = useStyles$5();
1148
1275
  var labelID = useUID(labelTypographyProps === null || labelTypographyProps === void 0 ? void 0 : labelTypographyProps.id);
1149
1276
  var shouldRenderFallback = isEmptyReactNode(content);
1150
1277
  return /*#__PURE__*/jsxs("div", {
@@ -1173,7 +1300,7 @@ var DescriptionListItem = /*#__PURE__*/forwardRef((_ref2, ref) => {
1173
1300
  if (process.env.NODE_ENV !== "production") DescriptionListItem.displayName = "DescriptionListItem";
1174
1301
 
1175
1302
  var _excluded$a = ["children", "className"];
1176
- var useStyles$5 = /*#__PURE__*/makeStyles(theme => ({
1303
+ var useStyles$6 = /*#__PURE__*/makeStyles(theme => ({
1177
1304
  appBar: {
1178
1305
  '&&': {
1179
1306
  bottom: 0,
@@ -1208,7 +1335,7 @@ var DrawerActions = /*#__PURE__*/forwardRef((_ref, appBarRef) => {
1208
1335
  } = _ref,
1209
1336
  props = _objectWithoutProperties(_ref, _excluded$a);
1210
1337
 
1211
- var styles = useStyles$5();
1338
+ var styles = useStyles$6();
1212
1339
  return /*#__PURE__*/jsx(VisibilityObserver, {
1213
1340
  render: _ref2 => {
1214
1341
  var {
@@ -1234,7 +1361,7 @@ var DrawerActions = /*#__PURE__*/forwardRef((_ref, appBarRef) => {
1234
1361
  if (process.env.NODE_ENV !== "production") DrawerActions.displayName = "DrawerActions";
1235
1362
 
1236
1363
  var _excluded$b = ["className"];
1237
- var useStyles$6 = /*#__PURE__*/makeStyles(theme => ({
1364
+ var useStyles$7 = /*#__PURE__*/makeStyles(theme => ({
1238
1365
  root: {
1239
1366
  maxWidth: '100%',
1240
1367
  padding: theme.spacing(2, 3),
@@ -1251,7 +1378,7 @@ var DrawerContent = /*#__PURE__*/forwardRef((_ref, ref) => {
1251
1378
  } = _ref,
1252
1379
  props = _objectWithoutProperties(_ref, _excluded$b);
1253
1380
 
1254
- var styles = useStyles$6();
1381
+ var styles = useStyles$7();
1255
1382
  return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({}, props), {}, {
1256
1383
  ref: ref,
1257
1384
  className: clsx(styles.root, className)
@@ -1279,7 +1406,7 @@ function listItemMixins(theme, space) {
1279
1406
  };
1280
1407
  }
1281
1408
 
1282
- var useStyles$7 = /*#__PURE__*/makeStyles(theme => ({
1409
+ var useStyles$8 = /*#__PURE__*/makeStyles(theme => ({
1283
1410
  root: _objectSpread(_objectSpread({
1284
1411
  maxWidth: '100%'
1285
1412
  }, listItemMixins(theme, 3)), {}, {
@@ -1294,7 +1421,7 @@ var DrawerList = /*#__PURE__*/forwardRef((_ref, ref) => {
1294
1421
  } = _ref,
1295
1422
  props = _objectWithoutProperties(_ref, _excluded$c);
1296
1423
 
1297
- var styles = useStyles$7();
1424
+ var styles = useStyles$8();
1298
1425
  return /*#__PURE__*/jsx(List, _objectSpread(_objectSpread({}, props), {}, {
1299
1426
  ref: ref,
1300
1427
  component: "div",
@@ -1304,7 +1431,7 @@ var DrawerList = /*#__PURE__*/forwardRef((_ref, ref) => {
1304
1431
  if (process.env.NODE_ENV !== "production") DrawerList.displayName = "DrawerList";
1305
1432
 
1306
1433
  var _excluded$d = ["title", "titleTypographyProps", "subtitle", "subtitleTypographyProps", "startAction", "endAction", "className"];
1307
- var useStyles$8 = /*#__PURE__*/makeStyles(theme => ({
1434
+ var useStyles$9 = /*#__PURE__*/makeStyles(theme => ({
1308
1435
  appBar: {
1309
1436
  '&&': {
1310
1437
  borderTop: 'none',
@@ -1354,7 +1481,7 @@ var DrawerTitle = /*#__PURE__*/forwardRef((_ref, appBarRef) => {
1354
1481
  } = _ref,
1355
1482
  props = _objectWithoutProperties(_ref, _excluded$d);
1356
1483
 
1357
- var styles = useStyles$8();
1484
+ var styles = useStyles$9();
1358
1485
  return /*#__PURE__*/jsx(VisibilityObserver, {
1359
1486
  render: _ref2 => {
1360
1487
  var {
@@ -1465,30 +1592,9 @@ var InlineGrid = /*#__PURE__*/forwardRef((_ref, ref) => {
1465
1592
  });
1466
1593
  if (process.env.NODE_ENV !== "production") InlineGrid.displayName = "InlineGrid";
1467
1594
 
1468
- function mergeRefs() {
1469
- for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
1470
- refs[_key] = arguments[_key];
1471
- }
1472
-
1473
- return node => {
1474
- refs.forEach(ref => {
1475
- assignRef(ref, node);
1476
- });
1477
- };
1478
- }
1479
- function assignRef(ref, value) {
1480
- if (ref) {
1481
- if (typeof ref === 'function') {
1482
- ref(value);
1483
- } else {
1484
- ref.current = value;
1485
- }
1486
- }
1487
- }
1488
-
1489
1595
  var _excluded$g = ["size", "square", "classes", "children", "className", "CardContentProps"],
1490
1596
  _excluded2$2 = ["content", "sizeLarge", "fullWidth"];
1491
- var useStyles$9 = /*#__PURE__*/makeStyles(theme => ({
1597
+ var useStyles$a = /*#__PURE__*/makeStyles(theme => ({
1492
1598
  root: {
1493
1599
  '&$fullWidth': {
1494
1600
  borderRadius: 0,
@@ -1520,7 +1626,7 @@ var InfoCard = /*#__PURE__*/forwardRef((_ref, _ref2) => {
1520
1626
  } = _ref,
1521
1627
  props = _objectWithoutProperties(_ref, _excluded$g);
1522
1628
 
1523
- var _useStyles = useStyles$9({
1629
+ var _useStyles = useStyles$a({
1524
1630
  classes
1525
1631
  }),
1526
1632
  {
@@ -1678,7 +1784,7 @@ function useCollapseBreakpoint(collapseBreakpoint) {
1678
1784
 
1679
1785
  var _excluded$j = ["action", "children", "onClose", "className", "classes", "variant"],
1680
1786
  _excluded2$3 = ["icon", "closeButton", "variantError", "variantSuccess"];
1681
- var useStyles$a = /*#__PURE__*/makeStyles(theme => ({
1787
+ var useStyles$b = /*#__PURE__*/makeStyles(theme => ({
1682
1788
  root: {
1683
1789
  color: Color.White,
1684
1790
  backgroundColor: Color.Dark500,
@@ -1723,7 +1829,7 @@ var SnackbarContent = /*#__PURE__*/forwardRef((_ref, ref) => {
1723
1829
  } = _ref,
1724
1830
  props = _objectWithoutProperties(_ref, _excluded$j);
1725
1831
 
1726
- var _useStyles = useStyles$a({
1832
+ var _useStyles = useStyles$b({
1727
1833
  classes
1728
1834
  }),
1729
1835
  {
@@ -1963,7 +2069,7 @@ var Stack = /*#__PURE__*/forwardRef((_ref2, ref) => {
1963
2069
  if (process.env.NODE_ENV !== "production") Stack.displayName = "Stack";
1964
2070
 
1965
2071
  var _excluded$m = ["color", "variant", "children", "classes", "className", "noWrap", "fontWeight", "component"];
1966
- var useStyles$b = /*#__PURE__*/makeStyles(theme => ({
2072
+ var useStyles$c = /*#__PURE__*/makeStyles(theme => ({
1967
2073
  root: {
1968
2074
  maxWidth: '100%',
1969
2075
  alignItems: 'center',
@@ -2048,7 +2154,7 @@ var Tag = /*#__PURE__*/forwardRef((_ref, ref) => {
2048
2154
  } = _ref,
2049
2155
  props = _objectWithoutProperties(_ref, _excluded$m);
2050
2156
 
2051
- var styles = useStyles$b({
2157
+ var styles = useStyles$c({
2052
2158
  classes
2053
2159
  });
2054
2160
  return /*#__PURE__*/jsx(Typography, _objectSpread(_objectSpread({}, props), {}, {
@@ -3495,7 +3601,7 @@ function columnVariant(columns) {
3495
3601
  };
3496
3602
  }
3497
3603
 
3498
- var useStyles$c = /*#__PURE__*/makeStyles(theme => ({
3604
+ var useStyles$d = /*#__PURE__*/makeStyles(theme => ({
3499
3605
  root: {
3500
3606
  paddingTop: PREVENT_COLLAPSE,
3501
3607
  '&:before': {
@@ -3539,7 +3645,7 @@ var Tiles = /*#__PURE__*/forwardRef((_ref, ref) => {
3539
3645
  space: spaceProp = 1,
3540
3646
  columns: columnsProp = 1
3541
3647
  } = _ref;
3542
- var styles = useStyles$c({});
3648
+ var styles = useStyles$d({});
3543
3649
  var space = useResponsivePropRecord(spaceProp);
3544
3650
  var columns = useResponsivePropRecord(columnsProp);
3545
3651
  return /*#__PURE__*/jsx("div", {
@@ -3559,5 +3665,5 @@ var Tiles = /*#__PURE__*/forwardRef((_ref, ref) => {
3559
3665
  });
3560
3666
  if (process.env.NODE_ENV !== "production") Tiles.displayName = "Tiles";
3561
3667
 
3562
- export { AdaptiveToolbar, AvatarButton, Button, CardButton, CheckboxField, CheckboxGroupField, Color, Column, Columns, DescriptionList, DescriptionListItem, DrawerActions, DrawerContent, DrawerList, DrawerTitle, DropdownButton, GridStack, InfoCard, Inline, InlineGrid, OverflowText, RadioField, RadioGroupField, ResponsiveContextProvider, Snackbar, SnackbarContent, SnackbarStackConsumer, SnackbarStackProvider, Stack, Tag, ThemeProvider, Tiles, VisibilityObserver, assignRef, isColorProp, isEmptyReactNode, mergeRefs, parseAlignProp, parseCollapsedBelow, parseResponsiveProp, parseSpaceProp, renderChildren, useCollapseBreakpoint, useResponsiveContext, useResponsiveProp, useResponsivePropRecord, useResponsiveValue, useSnackbarStack, useUID, useVisibilityObserver };
3668
+ export { AdaptiveToolbar, AdaptiveVerticalToolbar, AvatarButton, Button, CardButton, CheckboxField, CheckboxGroupField, Color, Column, Columns, DescriptionList, DescriptionListItem, DrawerActions, DrawerContent, DrawerList, DrawerTitle, DropdownButton, GridStack, InfoCard, Inline, InlineGrid, OverflowText, RadioField, RadioGroupField, ResponsiveContextProvider, Snackbar, SnackbarContent, SnackbarStackConsumer, SnackbarStackProvider, Stack, Tag, ThemeProvider, Tiles, VisibilityObserver, assignRef, isColorProp, isEmptyReactNode, mergeRefs, parseAlignProp, parseCollapsedBelow, parseResponsiveProp, parseSpaceProp, renderChildren, useCollapseBreakpoint, useResizeObserver, useResponsiveContext, useResponsiveProp, useResponsivePropRecord, useResponsiveValue, useSnackbarStack, useUID, useVisibilityObserver };
3563
3669
  //# sourceMappingURL=index.js.map