@webiny/ui 6.0.0 → 6.1.0-beta.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.
@@ -44,7 +44,7 @@ export declare const AccordionItem: ((props: AccordionItemProps) => React.JSX.El
44
44
  originalName: string;
45
45
  displayName: string;
46
46
  } & {
47
- createDecorator: (decorator: import("../../../react-composition/src").ComponentDecorator<((props: import("@webiny/admin-ui").SeparatorProps) => React.JSX.Element) & {
47
+ createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<((props: import("@webiny/admin-ui").SeparatorProps) => React.JSX.Element) & {
48
48
  original: (props: import("@webiny/admin-ui").SeparatorProps) => React.JSX.Element;
49
49
  originalName: string;
50
50
  displayName: string;
@@ -63,7 +63,7 @@ export declare const AccordionItem: ((props: AccordionItemProps) => React.JSX.El
63
63
  originalName: string;
64
64
  displayName: string;
65
65
  } & {
66
- createDecorator: (decorator: import("../../../react-composition/src").ComponentDecorator<(({ onClick, ...props }: import("@webiny/admin-ui/Accordion/components/AccordionItemAction").AccordionItemActionProps) => React.JSX.Element) & {
66
+ createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<(({ onClick, ...props }: import("@webiny/admin-ui/Accordion/components/AccordionItemAction").AccordionItemActionProps) => React.JSX.Element) & {
67
67
  original: ({ onClick, ...props }: import("@webiny/admin-ui/Accordion/components/AccordionItemAction").AccordionItemActionProps) => React.JSX.Element;
68
68
  originalName: string;
69
69
  displayName: string;
@@ -82,7 +82,7 @@ export declare const AccordionItem: ((props: AccordionItemProps) => React.JSX.El
82
82
  originalName: string;
83
83
  displayName: string;
84
84
  } & {
85
- createDecorator: (decorator: import("../../../react-composition/src").ComponentDecorator<((props: import("@webiny/admin-ui").SeparatorProps) => React.JSX.Element) & {
85
+ createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<((props: import("@webiny/admin-ui").SeparatorProps) => React.JSX.Element) & {
86
86
  original: (props: import("@webiny/admin-ui").SeparatorProps) => React.JSX.Element;
87
87
  originalName: string;
88
88
  displayName: string;
@@ -102,7 +102,7 @@ export declare const AccordionItem: ((props: AccordionItemProps) => React.JSX.El
102
102
  originalName: string;
103
103
  displayName: string;
104
104
  } & {
105
- createDecorator: (decorator: import("../../../react-composition/src").ComponentDecorator<((props: import("@webiny/admin-ui").IconProps) => React.JSX.Element) & {
105
+ createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<((props: import("@webiny/admin-ui").IconProps) => React.JSX.Element) & {
106
106
  original: (props: import("@webiny/admin-ui").IconProps) => React.JSX.Element;
107
107
  originalName: string;
108
108
  displayName: string;
@@ -4,7 +4,7 @@ interface AccordionItemActionsProps {
4
4
  }
5
5
  export declare const AccordionItemActions: ({ children }: AccordionItemActionsProps) => React.JSX.Element;
6
6
  export interface AccordionItemActionProps {
7
- icon: JSX.Element;
7
+ icon: React.JSX.Element;
8
8
  onClick: () => void;
9
9
  tooltip?: string;
10
10
  disabled?: boolean;
@@ -15,7 +15,7 @@ export interface AccordionItemActionProps {
15
15
  */
16
16
  export declare const AccordionItemAction: ({ icon, onClick, tooltip, disabled }: AccordionItemActionProps) => React.JSX.Element;
17
17
  export interface AccordionItemElementProps {
18
- element: JSX.Element;
18
+ element: React.JSX.Element;
19
19
  }
20
20
  /**
21
21
  * @deprecated This component is deprecated and will be removed in future releases.
@@ -1 +1 @@
1
- {"version":3,"names":["React","IconButton","Tooltip","AccordionItemActions","children","createElement","Fragment","AccordionItemAction","icon","onClick","tooltip","disabled","iconButton","e","stopPropagation","placement","content","AccordionItemElement","element"],"sources":["AccordionItemActions.tsx"],"sourcesContent":["import React from \"react\";\nimport { IconButton } from \"~/Button/index.js\";\nimport { Tooltip } from \"~/Tooltip/index.js\";\n\ninterface AccordionItemActionsProps {\n children: React.ReactNode;\n}\n\nexport const AccordionItemActions = ({ children }: AccordionItemActionsProps) => {\n return <>{children}</>;\n};\n\nexport interface AccordionItemActionProps {\n icon: JSX.Element;\n onClick: () => void;\n tooltip?: string;\n disabled?: boolean;\n}\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `Accordion.Item.Action` component from the `@webiny/admin-ui` package instead.\n */\nexport const AccordionItemAction = ({\n icon,\n onClick,\n tooltip,\n disabled\n}: AccordionItemActionProps) => {\n const iconButton = (\n <IconButton\n disabled={disabled}\n icon={icon}\n onClick={e => {\n e.stopPropagation();\n onClick();\n }}\n />\n );\n\n if (!tooltip) {\n return iconButton;\n }\n\n return (\n <Tooltip placement={\"bottom\"} content={tooltip}>\n {iconButton}\n </Tooltip>\n );\n};\n\nexport interface AccordionItemElementProps {\n element: JSX.Element;\n}\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `Accordion.Item.Action` component from the `@webiny/admin-ui` package instead.\n */\nexport const AccordionItemElement = ({ element }: AccordionItemElementProps) => {\n return <div onClick={e => e.stopPropagation()}>{element}</div>;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU;AACnB,SAASC,OAAO;AAMhB,OAAO,MAAMC,oBAAoB,GAAGA,CAAC;EAAEC;AAAoC,CAAC,KAAK;EAC7E,oBAAOJ,KAAA,CAAAK,aAAA,CAAAL,KAAA,CAAAM,QAAA,QAAGF,QAAW,CAAC;AAC1B,CAAC;AASD;AACA;AACA;AACA;AACA,OAAO,MAAMG,mBAAmB,GAAGA,CAAC;EAChCC,IAAI;EACJC,OAAO;EACPC,OAAO;EACPC;AACsB,CAAC,KAAK;EAC5B,MAAMC,UAAU,gBACZZ,KAAA,CAAAK,aAAA,CAACJ,UAAU;IACPU,QAAQ,EAAEA,QAAS;IACnBH,IAAI,EAAEA,IAAK;IACXC,OAAO,EAAEI,CAAC,IAAI;MACVA,CAAC,CAACC,eAAe,CAAC,CAAC;MACnBL,OAAO,CAAC,CAAC;IACb;EAAE,CACL,CACJ;EAED,IAAI,CAACC,OAAO,EAAE;IACV,OAAOE,UAAU;EACrB;EAEA,oBACIZ,KAAA,CAAAK,aAAA,CAACH,OAAO;IAACa,SAAS,EAAE,QAAS;IAACC,OAAO,EAAEN;EAAQ,GAC1CE,UACI,CAAC;AAElB,CAAC;AAMD;AACA;AACA;AACA;AACA,OAAO,MAAMK,oBAAoB,GAAGA,CAAC;EAAEC;AAAmC,CAAC,KAAK;EAC5E,oBAAOlB,KAAA,CAAAK,aAAA;IAAKI,OAAO,EAAEI,CAAC,IAAIA,CAAC,CAACC,eAAe,CAAC;EAAE,GAAEI,OAAa,CAAC;AAClE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","IconButton","Tooltip","AccordionItemActions","children","createElement","Fragment","AccordionItemAction","icon","onClick","tooltip","disabled","iconButton","e","stopPropagation","placement","content","AccordionItemElement","element"],"sources":["AccordionItemActions.tsx"],"sourcesContent":["import React from \"react\";\nimport { IconButton } from \"~/Button/index.js\";\nimport { Tooltip } from \"~/Tooltip/index.js\";\n\ninterface AccordionItemActionsProps {\n children: React.ReactNode;\n}\n\nexport const AccordionItemActions = ({ children }: AccordionItemActionsProps) => {\n return <>{children}</>;\n};\n\nexport interface AccordionItemActionProps {\n icon: React.JSX.Element;\n onClick: () => void;\n tooltip?: string;\n disabled?: boolean;\n}\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `Accordion.Item.Action` component from the `@webiny/admin-ui` package instead.\n */\nexport const AccordionItemAction = ({\n icon,\n onClick,\n tooltip,\n disabled\n}: AccordionItemActionProps) => {\n const iconButton = (\n <IconButton\n disabled={disabled}\n icon={icon}\n onClick={e => {\n e.stopPropagation();\n onClick();\n }}\n />\n );\n\n if (!tooltip) {\n return iconButton;\n }\n\n return (\n <Tooltip placement={\"bottom\"} content={tooltip}>\n {iconButton}\n </Tooltip>\n );\n};\n\nexport interface AccordionItemElementProps {\n element: React.JSX.Element;\n}\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `Accordion.Item.Action` component from the `@webiny/admin-ui` package instead.\n */\nexport const AccordionItemElement = ({ element }: AccordionItemElementProps) => {\n return <div onClick={e => e.stopPropagation()}>{element}</div>;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU;AACnB,SAASC,OAAO;AAMhB,OAAO,MAAMC,oBAAoB,GAAGA,CAAC;EAAEC;AAAoC,CAAC,KAAK;EAC7E,oBAAOJ,KAAA,CAAAK,aAAA,CAAAL,KAAA,CAAAM,QAAA,QAAGF,QAAW,CAAC;AAC1B,CAAC;AASD;AACA;AACA;AACA;AACA,OAAO,MAAMG,mBAAmB,GAAGA,CAAC;EAChCC,IAAI;EACJC,OAAO;EACPC,OAAO;EACPC;AACsB,CAAC,KAAK;EAC5B,MAAMC,UAAU,gBACZZ,KAAA,CAAAK,aAAA,CAACJ,UAAU;IACPU,QAAQ,EAAEA,QAAS;IACnBH,IAAI,EAAEA,IAAK;IACXC,OAAO,EAAEI,CAAC,IAAI;MACVA,CAAC,CAACC,eAAe,CAAC,CAAC;MACnBL,OAAO,CAAC,CAAC;IACb;EAAE,CACL,CACJ;EAED,IAAI,CAACC,OAAO,EAAE;IACV,OAAOE,UAAU;EACrB;EAEA,oBACIZ,KAAA,CAAAK,aAAA,CAACH,OAAO;IAACa,SAAS,EAAE,QAAS;IAACC,OAAO,EAAEN;EAAQ,GAC1CE,UACI,CAAC;AAElB,CAAC;AAMD;AACA;AACA;AACA;AACA,OAAO,MAAMK,oBAAoB,GAAGA,CAAC;EAAEC;AAAmC,CAAC,KAAK;EAC5E,oBAAOlB,KAAA,CAAAK,aAAA;IAAKI,OAAO,EAAEI,CAAC,IAAIA,CAAC,CAACC,eAAe,CAAC;EAAE,GAAEI,OAAa,CAAC;AAClE,CAAC","ignoreList":[]}
package/Menu/Menu.js CHANGED
@@ -64,7 +64,9 @@ const MenuItem = ({
64
64
  ...rest
65
65
  }) => {
66
66
  const icon = useMemo(() => {
67
- const foundIcon = React.Children.toArray(children).find(isIconElement);
67
+ const foundIcon = React.Children.toArray(children).find(item => {
68
+ return isIconElement(item);
69
+ });
68
70
  // Handles this usage: packages/app-admin/src/components/OptionsMenu/OptionsMenuItem.tsx
69
71
  if (/*#__PURE__*/React.isValidElement(foundIcon) && foundIcon.type === ListItemGraphic) {
70
72
  return foundIcon.props.children;
package/Menu/Menu.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","DropdownMenu","AdminUiDropdownMenu","ListItemGraphic","Menu","props","children","handle","className","onOpen","open","onClose","createElement","trigger","onOpenChange","closeMenu","console","log","MenuDivider","Separator","isIconElement","element","isValidElement","type","MenuItem","rest","icon","foundIcon","Children","toArray","find","content","filter","child","Item","Object","assign","text"],"sources":["Menu.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { DropdownMenu as AdminUiDropdownMenu } from \"@webiny/admin-ui/DropdownMenu/index.js\";\nimport { ListItemGraphic } from \"~/List/index.js\";\n\nexport type MenuChildrenFunctionProps = {\n closeMenu: () => void;\n};\n\nexport interface RenderableMenuChildren {\n (props: MenuChildrenFunctionProps): React.ReactNode;\n}\n\nexport interface BaseMenuItemProps {\n /** Adds a ripple effect to the component */\n ripple?: any;\n /** A modifier for a selected state. */\n selected?: boolean;\n /** A modifier for an active state. */\n activated?: boolean;\n /** A modifier for a disabled state. */\n disabled?: boolean;\n}\n\nexport type MenuProps = {\n /** Opens the menu. */\n open?: boolean;\n /** Make the menu position fixed. */\n fixed?: boolean;\n /** Renders the menu to a portal. Useful for situations where the content might be cutoff by an overflow: hidden container. You can pass \"true\" to render to the default RMWC portal. */\n renderToPortal?: any;\n /** Manually position the menu to one of the corners. */\n anchorCorner?: any;\n /** Children to render. */\n children?: React.ReactNode;\n /** An internal api for cross component communication. */\n apiRef?: (api: any | null) => void;\n /** Advanced: A reference to the MDCFoundation. */\n foundationRef?: any;\n /** Callback that fires when a Menu item is selected. evt.detail = { index: number; item: HTMLElement; } */\n onSelect?: (evt: any) => void;\n /** Whether or not to focus the first list item on open. Defaults to true. */\n focusOnOpen?: boolean;\n\n // A handler which triggers the menu, e.g. button or link.\n handle?: React.ReactElement;\n\n // @deprecated With the introduction of the new Admin UI, this prop is no longer supported, and it will be removed in future releases.\n // Position the menu to one of anchor corners.\n // 'bottomEnd' | 'bottomLeft' | 'bottomRight' | 'bottomStart' | 'topEnd' | 'topLeft' | 'topRight' | 'topStart'\n anchor?:\n | \"bottomEnd\"\n | \"bottomLeft\"\n | \"bottomRight\"\n | \"bottomStart\"\n | \"topEnd\"\n | \"topLeft\"\n | \"topRight\"\n | \"topStart\";\n\n // Class that will be added to the Menu element.\n className?: string;\n\n // @deprecated With the introduction of the new Admin UI, this prop is no longer supported, and it will be removed in future releases.\n // If true, prevents menu from opening when clicked.\n disabled?: boolean;\n\n onOpen?: () => void;\n onClose?: () => void;\n\n // For testing purposes.\n \"data-testid\"?: string;\n\n // @deprecated With the introduction of the new Admin UI, this prop is no longer supported, and it will be removed in future releases.\n // If rendering to portal, you can specify an exact zIndex.\n portalZIndex?: number;\n} & ( // You can use either `children` or `render`, but not both.\n | {\n // One or more MenuItem components.\n children: React.ReactNode | RenderableMenuChildren;\n render?: never;\n }\n | {\n render: RenderableMenuChildren;\n children?: never;\n }\n);\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `DropdownMenu` component from the `@webiny/admin-ui` package instead.\n */\nconst Menu = (props: MenuProps) => {\n const {\n children,\n handle,\n\n className,\n onOpen,\n open,\n onClose\n\n // Deprecated properties.\n // disabled,\n // onSelect,\n // anchor = \"topStart\",\n // render,\n // renderToPortal,\n // portalZIndex = 99\n } = props;\n\n return (\n <AdminUiDropdownMenu\n open={open}\n trigger={handle}\n className={className}\n onOpenChange={open => {\n if (open) {\n if (!onOpen) {\n return;\n }\n onOpen();\n } else if (onClose) {\n onClose();\n }\n }}\n data-testid={props[\"data-testid\"]}\n >\n {typeof children === \"function\"\n ? children({\n closeMenu: () => {\n console.log(\n \"Deprecated: This function is deprecated and will be removed in future releases.\"\n );\n }\n })\n : children}\n </AdminUiDropdownMenu>\n );\n};\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `DropdownMenu.Separator` component from the `@webiny/admin-ui` package instead.\n */\nconst MenuDivider = () => {\n return <AdminUiDropdownMenu.Separator />;\n};\n\ninterface MenuItemProps extends BaseMenuItemProps {\n children: React.ReactNode;\n className?: string;\n onClick?: (event: React.MouseEvent) => void;\n \"data-testid\"?: string;\n}\n\nconst isIconElement = (element: React.ReactNode) => {\n return React.isValidElement(element) && element.type === ListItemGraphic;\n};\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `DropdownMenu/Item` component from the `@webiny/admin-ui` package instead.\n */\nconst MenuItem = ({ children, ...rest }: MenuItemProps) => {\n const icon = useMemo(() => {\n const foundIcon = React.Children.toArray(children).find(isIconElement);\n // Handles this usage: packages/app-admin/src/components/OptionsMenu/OptionsMenuItem.tsx\n if (React.isValidElement(foundIcon) && foundIcon.type === ListItemGraphic) {\n return foundIcon.props.children;\n }\n return foundIcon;\n }, [children]);\n\n const content = useMemo(() => {\n return React.Children.toArray(children).filter(child => {\n return !isIconElement(child);\n });\n }, [children]);\n\n return <AdminUiDropdownMenu.Item icon={icon} text={content} {...rest} />;\n};\n\nexport { Menu, MenuItem, MenuDivider };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,YAAY,IAAIC,mBAAmB,QAAQ,wCAAwC;AAC5F,SAASC,eAAe;AAqFxB;AACA;AACA;AACA;AACA,MAAMC,IAAI,GAAIC,KAAgB,IAAK;EAC/B,MAAM;IACFC,QAAQ;IACRC,MAAM;IAENC,SAAS;IACTC,MAAM;IACNC,IAAI;IACJC;;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;EACJ,CAAC,GAAGN,KAAK;EAET,oBACIN,KAAA,CAAAa,aAAA,CAACV,mBAAmB;IAChBQ,IAAI,EAAEA,IAAK;IACXG,OAAO,EAAEN,MAAO;IAChBC,SAAS,EAAEA,SAAU;IACrBM,YAAY,EAAEJ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1B,OAAOD,KAAK,CAAC6B,QAAQ,CAACC,OAAO,CAACvB,QAAQ,CAAC,CAAC0B,MAAM,CAACC,KAAK,IAAI;MACpD,OAAO,CAACb,aAAa,CAACa,KAAK,CAAC;IAChC,CAAC,CAAC;EACN,CAAC,EAAE,CAAC3B,QAAQ,CAAC,CAAC;EAEd,oBAAOP,KAAA,CAAAa,aAAA,CAACV,mBAAmB,CAACgC,IAAI,EAAAC,MAAA,CAAAC,MAAA;IAACV,IAAI,EAAEA,IAAK;IAACW,IAAI,EAAEN;EAAQ,GAAKN,IAAI,CAAG,CAAC;AAC5E,CAAC;AAED,SAASrB,IAAI,EAAEoB,QAAQ,EAAEN,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","DropdownMenu","AdminUiDropdownMenu","ListItemGraphic","Menu","props","children","handle","className","onOpen","open","onClose","createElement","trigger","onOpenChange","closeMenu","console","log","MenuDivider","Separator","isIconElement","element","isValidElement","type","MenuItem","rest","icon","foundIcon","Children","toArray","find","item","content","filter","child","Item","Object","assign","text"],"sources":["Menu.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { DropdownMenu as AdminUiDropdownMenu } from \"@webiny/admin-ui/DropdownMenu/index.js\";\nimport { ListItemGraphic } from \"~/List/index.js\";\n\nexport type MenuChildrenFunctionProps = {\n closeMenu: () => void;\n};\n\nexport interface RenderableMenuChildren {\n (props: MenuChildrenFunctionProps): React.ReactNode;\n}\n\nexport interface BaseMenuItemProps {\n /** Adds a ripple effect to the component */\n ripple?: any;\n /** A modifier for a selected state. */\n selected?: boolean;\n /** A modifier for an active state. */\n activated?: boolean;\n /** A modifier for a disabled state. */\n disabled?: boolean;\n}\n\nexport type MenuProps = {\n /** Opens the menu. */\n open?: boolean;\n /** Make the menu position fixed. */\n fixed?: boolean;\n /** Renders the menu to a portal. Useful for situations where the content might be cutoff by an overflow: hidden container. You can pass \"true\" to render to the default RMWC portal. */\n renderToPortal?: any;\n /** Manually position the menu to one of the corners. */\n anchorCorner?: any;\n /** Children to render. */\n children?: React.ReactNode;\n /** An internal api for cross component communication. */\n apiRef?: (api: any | null) => void;\n /** Advanced: A reference to the MDCFoundation. */\n foundationRef?: any;\n /** Callback that fires when a Menu item is selected. evt.detail = { index: number; item: HTMLElement; } */\n onSelect?: (evt: any) => void;\n /** Whether or not to focus the first list item on open. Defaults to true. */\n focusOnOpen?: boolean;\n\n // A handler which triggers the menu, e.g. button or link.\n handle?: React.ReactElement;\n\n // @deprecated With the introduction of the new Admin UI, this prop is no longer supported, and it will be removed in future releases.\n // Position the menu to one of anchor corners.\n // 'bottomEnd' | 'bottomLeft' | 'bottomRight' | 'bottomStart' | 'topEnd' | 'topLeft' | 'topRight' | 'topStart'\n anchor?:\n | \"bottomEnd\"\n | \"bottomLeft\"\n | \"bottomRight\"\n | \"bottomStart\"\n | \"topEnd\"\n | \"topLeft\"\n | \"topRight\"\n | \"topStart\";\n\n // Class that will be added to the Menu element.\n className?: string;\n\n // @deprecated With the introduction of the new Admin UI, this prop is no longer supported, and it will be removed in future releases.\n // If true, prevents menu from opening when clicked.\n disabled?: boolean;\n\n onOpen?: () => void;\n onClose?: () => void;\n\n // For testing purposes.\n \"data-testid\"?: string;\n\n // @deprecated With the introduction of the new Admin UI, this prop is no longer supported, and it will be removed in future releases.\n // If rendering to portal, you can specify an exact zIndex.\n portalZIndex?: number;\n} & ( // You can use either `children` or `render`, but not both.\n | {\n // One or more MenuItem components.\n children: React.ReactNode | RenderableMenuChildren;\n render?: never;\n }\n | {\n render: RenderableMenuChildren;\n children?: never;\n }\n);\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `DropdownMenu` component from the `@webiny/admin-ui` package instead.\n */\nconst Menu = (props: MenuProps) => {\n const {\n children,\n handle,\n\n className,\n onOpen,\n open,\n onClose\n\n // Deprecated properties.\n // disabled,\n // onSelect,\n // anchor = \"topStart\",\n // render,\n // renderToPortal,\n // portalZIndex = 99\n } = props;\n\n return (\n <AdminUiDropdownMenu\n open={open}\n trigger={handle}\n className={className}\n onOpenChange={open => {\n if (open) {\n if (!onOpen) {\n return;\n }\n onOpen();\n } else if (onClose) {\n onClose();\n }\n }}\n data-testid={props[\"data-testid\"]}\n >\n {typeof children === \"function\"\n ? children({\n closeMenu: () => {\n console.log(\n \"Deprecated: This function is deprecated and will be removed in future releases.\"\n );\n }\n })\n : children}\n </AdminUiDropdownMenu>\n );\n};\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `DropdownMenu.Separator` component from the `@webiny/admin-ui` package instead.\n */\nconst MenuDivider = () => {\n return <AdminUiDropdownMenu.Separator />;\n};\n\ninterface MenuItemProps extends BaseMenuItemProps {\n children: React.ReactNode;\n className?: string;\n onClick?: (event: React.MouseEvent) => void;\n \"data-testid\"?: string;\n}\n\nconst isIconElement = (element: React.ReactNode) => {\n return React.isValidElement(element) && element.type === ListItemGraphic;\n};\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `DropdownMenu/Item` component from the `@webiny/admin-ui` package instead.\n */\nconst MenuItem = ({ children, ...rest }: MenuItemProps) => {\n const icon = useMemo(() => {\n const foundIcon = React.Children.toArray(children).find(\n (item): item is React.ReactElement<React.PropsWithChildren> => {\n return isIconElement(item);\n }\n );\n // Handles this usage: packages/app-admin/src/components/OptionsMenu/OptionsMenuItem.tsx\n if (React.isValidElement(foundIcon) && foundIcon.type === ListItemGraphic) {\n return foundIcon.props.children;\n }\n return foundIcon;\n }, [children]);\n\n const content = useMemo(() => {\n return React.Children.toArray(children).filter(child => {\n return !isIconElement(child);\n });\n }, [children]);\n\n return <AdminUiDropdownMenu.Item icon={icon} text={content} {...rest} />;\n};\n\nexport { Menu, MenuItem, MenuDivider };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,YAAY,IAAIC,mBAAmB,QAAQ,wCAAwC;AAC5F,SAASC,eAAe;AAqFxB;AACA;AACA;AACA;AACA,MAAMC,IAAI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,CAACwB,IAAI,CAClDC,IAAI,IAA0D;MAC3D,OAAOX,aAAa,CAACW,IAAI,CAAC;IAC9B,CACJ,CAAC;IACD;IACA,IAAI,aAAAhC,KAAK,CAACuB,cAAc,CAACK,SAAS,CAAC,IAAIA,SAAS,CAACJ,IAAI,KAAKpB,eAAe,EAAE;MACvE,OAAOwB,SAAS,CAACtB,KAAK,CAACC,QAAQ;IACnC;IACA,OAAOqB,SAAS;EACpB,CAAC,EAAE,CAACrB,QAAQ,CAAC,CAAC;EAEd,MAAM0B,OAAO,GAAGhC,OAAO,CAAC,MAAM;IAC1B,OAAOD,KAAK,CAAC6B,QAAQ,CAACC,OAAO,CAACvB,QAAQ,CAAC,CAAC2B,MAAM,CAACC,KAAK,IAAI;MACpD,OAAO,CAACd,aAAa,CAACc,KAAK,CAAC;IAChC,CAAC,CAAC;EACN,CAAC,EAAE,CAAC5B,QAAQ,CAAC,CAAC;EAEd,oBAAOP,KAAA,CAAAa,aAAA,CAACV,mBAAmB,CAACiC,IAAI,EAAAC,MAAA,CAAAC,MAAA;IAACX,IAAI,EAAEA,IAAK;IAACY,IAAI,EAAEN;EAAQ,GAAKP,IAAI,CAAG,CAAC;AAC5E,CAAC;AAED,SAASrB,IAAI,EAAEoB,QAAQ,EAAEN,WAAW","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/ui",
3
- "version": "6.0.0",
3
+ "version": "6.1.0-beta.0",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -15,17 +15,17 @@
15
15
  ],
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
- "@svgr/webpack": "6.5.1",
19
- "@webiny/admin-ui": "6.0.0",
20
- "@webiny/utils": "6.0.0",
18
+ "@svgr/webpack": "8.1.0",
19
+ "@webiny/admin-ui": "6.1.0-beta.0",
20
+ "@webiny/utils": "6.1.0-beta.0",
21
21
  "classnames": "2.5.1",
22
22
  "lodash": "4.17.23"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@emotion/babel-plugin": "11.13.5",
26
- "@testing-library/react": "15.0.7",
27
- "@webiny/build-tools": "6.0.0",
28
- "@webiny/validation": "6.0.0",
26
+ "@testing-library/react": "16.3.2",
27
+ "@webiny/build-tools": "6.1.0-beta.0",
28
+ "@webiny/validation": "6.1.0-beta.0",
29
29
  "babel-loader": "10.1.1",
30
30
  "execa": "5.1.1",
31
31
  "ncp": "2.0.0",
@@ -49,5 +49,5 @@
49
49
  ]
50
50
  }
51
51
  },
52
- "gitHead": "9c6892640a45679ff521e25cd6587dff57393a2e"
52
+ "gitHead": "a3bd3695c66c79238e380d7360d9731b5fcf9c87"
53
53
  }