@elliemae/ds-menu-items-single-with-submenu 3.70.0-next.63 → 3.70.0-next.69

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,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type { SizingProps } from '@elliemae/ds-system';\nimport {\n type DSMenuItemsCommonsT,\n DSMenuItemsCommonsPropTypes,\n DSMenuItemsCommonsDefaultProps,\n} from '@elliemae/ds-menu-items-commons';\nimport type React from 'react';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSMenuItemsSingleWithSubmenuT {\n // typescript inheritance has no syntax support for \"interfaces\", we have to use union types instead...\n export type RequiredProps = DSMenuItemsCommonsT.RequiredProps;\n\n export type DefaultProps = DSMenuItemsCommonsT.DefaultProps & {\n // this is a lie, the \"default\" label is not producing anything useful...\n // the idea of \"default\" is that if the user does not provide a value, we still have a valid value to use...\n label: string;\n isActive: boolean;\n disabled: boolean;\n applyAriaDisabled: boolean;\n isSelected: boolean;\n onClick: React.MouseEventHandler<Element>;\n onMouseDown: React.MouseEventHandler<Element>;\n onMouseEnter: React.MouseEventHandler<Element>;\n onMouseLeave: React.MouseEventHandler<Element>;\n dataTestid: string;\n tabIndex: 0 | -1 | '0' | '-1';\n\n isSubmenuOpened: boolean;\n onSubmenuOpen: React.MouseEventHandler<Element>;\n rightAddon: 'ellipsis' | 'chevron';\n optionsShouldHavePadding: boolean;\n Dropdown: React.ComponentType<React.PropsWithChildren<DSMenuItemsSingleWithSubmenuT.DefaultProps['dropdownProps']>>;\n // this is a lie, the \"default\" dropdownProps is not producing anything useful...\n // the idea of \"default\" is that if the user does not provide a value, we still have a valid value to use...\n dropdownProps: {\n options: unknown[];\n onSubmenuToggle?: (\n nextOpenedSubmenus: Record<string, boolean>,\n submenu: unknown,\n e: React.MouseEvent<Element> | React.KeyboardEvent<Element>,\n ) => void;\n openedSubmenus?: Record<string, boolean>;\n selectedOptions?: Record<string, boolean>;\n onKeyDown?: React.KeyboardEventHandler;\n onOptionClick?: (\n nextSelectedOptions: Record<string, boolean>,\n clickedOption: unknown,\n e: React.MouseEvent<Element> | React.KeyboardEvent<Element>,\n ) => void;\n onClickOutside?: (\n e: React.MouseEvent<Element> | React.KeyboardEvent<Element> | React.TouchEvent<Element>,\n ) => void;\n minWidth?: SizingProps['minWidth'];\n maxHeight?: SizingProps['maxHeight'];\n [key: string]: unknown;\n };\n };\n\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsSingleWithSubmenuT.InternalProps> & {\n secondaryLabel?: string;\n value?: unknown;\n onSubmenuClose?: React.MouseEventHandler<Element>;\n };\n\n // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps\n // they are NOT inherited from a common element from ds-menu-items-commons\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSMenuItemsSingleWithSubmenuT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n\n isSelected: false,\n onClick: () => {},\n onMouseDown: () => {},\n onMouseEnter: () => {},\n onMouseLeave: () => {},\n dataTestid: 'ds-menu-item',\n tabIndex: 0,\n\n // this is a lie, the \"default\" label is not producing anything useful...\n // the idea of \"default\" is that if the user does not provide a value, we still have a valid value to use...\n label: '',\n isActive: false,\n disabled: false,\n applyAriaDisabled: false,\n isSubmenuOpened: false,\n onSubmenuOpen: () => {},\n rightAddon: 'chevron',\n optionsShouldHavePadding: false,\n Dropdown: () => null,\n // this is a lie, the \"default\" dropdownProps is not producing anything useful...\n // the idea of \"default\" is that if the user does not provide a value, we still have a valid value to use...\n dropdownProps: {\n options: [],\n onSubmenuToggle: () => {},\n openedSubmenus: {},\n selectedOptions: {},\n onKeyDown: () => {},\n onOptionClick: () => {},\n onClickOutside: () => {},\n minWidth: 'auto',\n maxHeight: 'auto',\n },\n};\n\n// we are removing some keys from the global attributes because they are overridden by the action props\n// eslint-disable-next-line no-unused-vars\nconst { tabIndex, label, value, ...notOvverriddenCommonPropsTypes } = globalAttributesPropTypes;\n\nexport const DSMenuItemsSingleWithSubmenuPropTypes: DSPropTypesSchema<DSMenuItemsSingleWithSubmenuT.InternalProps> = {\n // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps\n // they are NOT inherited from a common element from ds-menu-items-commons\n ...notOvverriddenCommonPropsTypes,\n ...xstyledPropTypes,\n ...DSMenuItemsCommonsPropTypes,\n\n // TODO - add support to PropTypes.oneOf for typeof number\n // currently PropTypes.oneOf([0, -1]) is not supported\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed.')\n .defaultValue(defaultProps.tabIndex),\n label: PropTypes.string.description('The label of the menu item.'),\n value: PropTypes.any.description('The value of the menu item.'),\n isActive: PropTypes.bool.description('Whether the menu item is active.').defaultValue(defaultProps.isActive),\n optionsShouldHavePadding: PropTypes.bool\n .description('Whether the menu item should have padding. This is used in the context of a menu with options.')\n .defaultValue(defaultProps.optionsShouldHavePadding),\n secondaryLabel: PropTypes.string.description('The secondary label of the menu item.'),\n isSelected: PropTypes.bool\n .description('Whether the menu item has to show the selected state or not.')\n .defaultValue(defaultProps.isSelected),\n dataTestid: PropTypes.string.description('The data-testid of the menu item.').defaultValue(defaultProps.dataTestid),\n isSubmenuOpened: PropTypes.bool\n .description('Whether the submenu is opened or not.')\n .defaultValue(defaultProps.isSubmenuOpened),\n onSubmenuOpen: PropTypes.func.description('Callback fired when the user tries to open the submenu.'),\n onSubmenuClose: PropTypes.func.description('Callback fired when the user tries to close the submenu.'),\n rightAddon: PropTypes.oneOf(['ellipsis', 'chevron']).description(\n 'The visual element to display on the right side of the menu item.',\n ),\n Dropdown: PropTypes.func.description('The Dropdown component to use to render the submenu.'),\n dropdownProps: PropTypes.shape({\n options: PropTypes.arrayOf(PropTypes.any).description('The options to display in the submenu.'),\n onSubmenuToggle: PropTypes.func\n .description(\n 'Callback fired when the user tries to toggle the submenu. It receives the next opened submenus, the submenu and the event.',\n )\n .signature(\n '((nextOpenedSubmenus: Record<string, boolean>, submenu: unknown, e: React.MouseEvent | React.KeyboardEvent) => void)',\n ),\n openedSubmenus: PropTypes.objectOf(PropTypes.bool).description('The opened submenus.'),\n selectedOptions: PropTypes.objectOf(PropTypes.bool).description('The selected options.'),\n onKeyDown: PropTypes.func.description('Callback fired when the user presses a key.'),\n onOptionClick: PropTypes.func\n .description(\n 'Callback fired when the user clicks on an option. It receives the next selected options, the clicked option and the event.',\n )\n .signature(\n '((nextSelectedOptions: Record<string, boolean>, clickedOption: unknown, e: React.MouseEvent | React.KeyboardEvent) => void)',\n ),\n onClickOutside: PropTypes.func\n .description('Callback fired when the user clicks outside the submenu.')\n .signature('((e: MouseEvent | React.KeyboardEvent | TouchEvent) => void)'),\n minWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('The min width of the submenu.'),\n maxHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('The max height of the submenu.'),\n }).description('The props to pass to the Dropdown component.'),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n};\n\nexport const DSMenuItemsSingleWithSubmenuPropTypesSchema =\n DSMenuItemsSingleWithSubmenuPropTypes as unknown as WeakValidationMap<DSMenuItemsSingleWithSubmenuT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;AAEvE,mCAIO;AAmFA,MAAM,eAA2D;AAAA,EACtE,GAAG;AAAA,EAEH,YAAY;AAAA,EACZ,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,aAAa,MAAM;AAAA,EAAC;AAAA,EACpB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,YAAY;AAAA,EACZ,UAAU;AAAA;AAAA;AAAA,EAIV,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,YAAY;AAAA,EACZ,0BAA0B;AAAA,EAC1B,UAAU,MAAM;AAAA;AAAA;AAAA,EAGhB,eAAe;AAAA,IACb,SAAS,CAAC;AAAA,IACV,iBAAiB,MAAM;AAAA,IAAC;AAAA,IACxB,gBAAgB,CAAC;AAAA,IACjB,iBAAiB,CAAC;AAAA,IAClB,WAAW,MAAM;AAAA,IAAC;AAAA,IAClB,eAAe,MAAM;AAAA,IAAC;AAAA,IACtB,gBAAgB,MAAM;AAAA,IAAC;AAAA,IACvB,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AACF;AAIA,MAAM,EAAE,UAAU,OAAO,OAAO,GAAG,+BAA+B,IAAI;AAE/D,MAAM,wCAAwG;AAAA;AAAA;AAAA,EAGnH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GA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,eAAe,kCAAU,KACtB;AAAA,MACC;AAAA,IACF,EACC;AAAA,MACC;AAAA,IACF;AAAA,IACF,gBAAgB,kCAAU,KACvB,YAAY,0DAA0D,EACtE,UAAU,8DAA8D;AAAA,IAC3E,UAAU,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,EAAE,YAAY,+BAA+B;AAAA,IAC/G,WAAW,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,EAAE,YAAY,gCAAgC;AAAA,EACnH,CAAC,EAAE,YAAY,8CAA8C;AAAA,EAC7D,mBAAmB,kCAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AACvB;AAEO,MAAM,8CACX;",
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type { SizingProps } from '@elliemae/ds-system';\nimport {\n type DSMenuItemsCommonsT,\n DSMenuItemsCommonsPropTypes,\n DSMenuItemsCommonsDefaultProps,\n} from '@elliemae/ds-menu-items-commons';\nimport type React from 'react';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSMenuItemsSingleWithSubmenuT {\n // typescript inheritance has no syntax support for \"interfaces\", we have to use union types instead...\n export type RequiredProps = DSMenuItemsCommonsT.RequiredProps;\n\n export type DefaultProps = DSMenuItemsCommonsT.DefaultProps & {\n // this is a lie, the \"default\" label is not producing anything useful...\n // the idea of \"default\" is that if the user does not provide a value, we still have a valid value to use...\n label: string;\n isActive: boolean;\n disabled: boolean;\n applyAriaDisabled: boolean;\n isSelected: boolean;\n onClick: React.MouseEventHandler<Element>;\n onMouseDown: React.MouseEventHandler<Element>;\n onMouseEnter: React.MouseEventHandler<Element>;\n onMouseLeave: React.MouseEventHandler<Element>;\n dataTestid: string;\n tabIndex: 0 | -1 | '0' | '-1';\n\n isSubmenuOpened: boolean;\n onSubmenuOpen: React.MouseEventHandler<Element>;\n rightAddon: 'ellipsis' | 'chevron';\n optionsShouldHavePadding: boolean;\n Dropdown: React.ComponentType<React.PropsWithChildren<DSMenuItemsSingleWithSubmenuT.DefaultProps['dropdownProps']>>;\n // this is a lie, the \"default\" dropdownProps is not producing anything useful...\n // the idea of \"default\" is that if the user does not provide a value, we still have a valid value to use...\n dropdownProps: {\n options: unknown[];\n onSubmenuToggle?: (\n nextOpenedSubmenus: Record<string, boolean>,\n submenu: unknown,\n e: React.MouseEvent<Element> | React.KeyboardEvent<Element>,\n ) => void;\n openedSubmenus?: Record<string, boolean>;\n selectedOptions?: Record<string, boolean>;\n onKeyDown?: React.KeyboardEventHandler;\n onOptionClick?: (\n nextSelectedOptions: Record<string, boolean>,\n clickedOption: unknown,\n e: React.MouseEvent<Element> | React.KeyboardEvent<Element>,\n ) => void;\n onClickOutside?: (\n e: React.MouseEvent<Element> | React.KeyboardEvent<Element> | React.TouchEvent<Element>,\n ) => void;\n minWidth?: SizingProps['minWidth'];\n maxHeight?: SizingProps['maxHeight'];\n [key: string]: unknown;\n };\n };\n\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsSingleWithSubmenuT.InternalProps> & {\n secondaryLabel?: string;\n value?: unknown;\n onSubmenuClose?: React.MouseEventHandler<Element>;\n };\n\n // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps\n // they are NOT inherited from a common element from ds-menu-items-commons\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSMenuItemsSingleWithSubmenuT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n\n isSelected: false,\n onClick: () => {},\n onMouseDown: () => {},\n onMouseEnter: () => {},\n onMouseLeave: () => {},\n dataTestid: 'ds-menu-item',\n tabIndex: 0,\n\n // this is a lie, the \"default\" label is not producing anything useful...\n // the idea of \"default\" is that if the user does not provide a value, we still have a valid value to use...\n label: '',\n isActive: false,\n disabled: false,\n applyAriaDisabled: false,\n isSubmenuOpened: false,\n onSubmenuOpen: () => {},\n rightAddon: 'chevron',\n optionsShouldHavePadding: false,\n Dropdown: () => null,\n // this is a lie, the \"default\" dropdownProps is not producing anything useful...\n // the idea of \"default\" is that if the user does not provide a value, we still have a valid value to use...\n dropdownProps: {\n options: [],\n onSubmenuToggle: () => {},\n openedSubmenus: {},\n selectedOptions: {},\n onKeyDown: () => {},\n onOptionClick: () => {},\n onClickOutside: () => {},\n minWidth: 'auto',\n maxHeight: 'auto',\n },\n};\n\n// we are removing some keys from the global attributes because they are overridden by the action props\n// eslint-disable-next-line no-unused-vars\nconst { tabIndex, label, value, ...notOvverriddenCommonPropsTypes } = globalAttributesPropTypes;\n\nexport const DSMenuItemsSingleWithSubmenuPropTypes: DSPropTypesSchema<DSMenuItemsSingleWithSubmenuT.InternalProps> = {\n // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps\n // they are NOT inherited from a common element from ds-menu-items-commons\n ...notOvverriddenCommonPropsTypes,\n ...xstyledPropTypes,\n ...DSMenuItemsCommonsPropTypes,\n\n // TODO - add support to PropTypes.oneOf for typeof number\n // currently PropTypes.oneOf([0, -1]) is not supported\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed.')\n .defaultValue(defaultProps.tabIndex),\n label: PropTypes.string.description('The label of the menu item.'),\n value: PropTypes.any.description('The value of the menu item.'),\n isActive: PropTypes.bool.description('Whether the menu item is active.').defaultValue(defaultProps.isActive),\n optionsShouldHavePadding: PropTypes.bool\n .description('Whether the menu item should have padding. This is used in the context of a menu with options.')\n .defaultValue(defaultProps.optionsShouldHavePadding),\n secondaryLabel: PropTypes.string.description('The secondary label of the menu item.'),\n isSelected: PropTypes.bool\n .description('Whether the menu item has to show the selected state or not.')\n .defaultValue(defaultProps.isSelected),\n dataTestid: PropTypes.string.description('The data-testid of the menu item.').defaultValue(defaultProps.dataTestid),\n isSubmenuOpened: PropTypes.bool\n .description('Whether the submenu is opened or not.')\n .defaultValue(defaultProps.isSubmenuOpened),\n onSubmenuOpen: PropTypes.func.description('Callback fired when the user tries to open the submenu.'),\n onSubmenuClose: PropTypes.func.description('Callback fired when the user tries to close the submenu.'),\n rightAddon: PropTypes.oneOf(['ellipsis', 'chevron']).description(\n 'The visual element to display on the right side of the menu item.',\n ),\n Dropdown: PropTypes.func.description('The Dropdown component to use to render the submenu.'),\n dropdownProps: PropTypes.shape({\n options: PropTypes.arrayOf(PropTypes.any).description('The options to display in the submenu.'),\n onSubmenuToggle: PropTypes.func\n .description(\n 'Callback fired when the user tries to toggle the submenu. It receives the next opened submenus, the submenu and the event.',\n )\n .signature(\n '((nextOpenedSubmenus: Record<string, boolean>, submenu: unknown, e: React.MouseEvent | React.KeyboardEvent) => void)',\n ),\n openedSubmenus: PropTypes.objectOf(PropTypes.bool).description('The opened submenus.'),\n selectedOptions: PropTypes.objectOf(PropTypes.bool).description('The selected options.'),\n onKeyDown: PropTypes.func.description('Callback fired when the user presses a key.'),\n onOptionClick: PropTypes.func\n .description(\n 'Callback fired when the user clicks on an option. It receives the next selected options, the clicked option and the event.',\n )\n .signature(\n '((nextSelectedOptions: Record<string, boolean>, clickedOption: unknown, e: React.MouseEvent | React.KeyboardEvent) => void)',\n ),\n onClickOutside: PropTypes.func\n .description('Callback fired when the user clicks outside the submenu.')\n .signature('((e: MouseEvent | React.KeyboardEvent | TouchEvent) => void)'),\n minWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('The min width of the submenu.'),\n maxHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('The max height of the submenu.'),\n }).description('The props to pass to the Dropdown component.'),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n};\n\nexport const DSMenuItemsSingleWithSubmenuPropTypesSchema =\n DSMenuItemsSingleWithSubmenuPropTypes as unknown as WeakValidationMap<DSMenuItemsSingleWithSubmenuT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;AAEvE,mCAIO;AAqFA,MAAM,eAA2D;AAAA,EACtE,GAAG;AAAA,EAEH,YAAY;AAAA,EACZ,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,aAAa,MAAM;AAAA,EAAC;AAAA,EACpB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,YAAY;AAAA,EACZ,UAAU;AAAA;AAAA;AAAA,EAIV,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,YAAY;AAAA,EACZ,0BAA0B;AAAA,EAC1B,UAAU,MAAM;AAAA;AAAA;AAAA,EAGhB,eAAe;AAAA,IACb,SAAS,CAAC;AAAA,IACV,iBAAiB,MAAM;AAAA,IAAC;AAAA,IACxB,gBAAgB,CAAC;AAAA,IACjB,iBAAiB,CAAC;AAAA,IAClB,WAAW,MAAM;AAAA,IAAC;AAAA,IAClB,eAAe,MAAM;AAAA,IAAC;AAAA,IACtB,gBAAgB,MAAM;AAAA,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,IACF;AAAA,IACF,gBAAgB,kCAAU,SAAS,kCAAU,IAAI,EAAE,YAAY,sBAAsB;AAAA,IACrF,iBAAiB,kCAAU,SAAS,kCAAU,IAAI,EAAE,YAAY,uBAAuB;AAAA,IACvF,WAAW,kCAAU,KAAK,YAAY,6CAA6C;AAAA,IACnF,eAAe,kCAAU,KACtB;AAAA,MACC;AAAA,IACF,EACC;AAAA,MACC;AAAA,IACF;AAAA,IACF,gBAAgB,kCAAU,KACvB,YAAY,0DAA0D,EACtE,UAAU,8DAA8D;AAAA,IAC3E,UAAU,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,EAAE,YAAY,+BAA+B;AAAA,IAC/G,WAAW,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,EAAE,YAAY,gCAAgC;AAAA,EACnH,CAAC,EAAE,YAAY,8CAA8C;AAAA,EAC7D,mBAAmB,kCAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AACvB;AAEO,MAAM,8CACX;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type { SizingProps } from '@elliemae/ds-system';\nimport {\n type DSMenuItemsCommonsT,\n DSMenuItemsCommonsPropTypes,\n DSMenuItemsCommonsDefaultProps,\n} from '@elliemae/ds-menu-items-commons';\nimport type React from 'react';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSMenuItemsSingleWithSubmenuT {\n // typescript inheritance has no syntax support for \"interfaces\", we have to use union types instead...\n export type RequiredProps = DSMenuItemsCommonsT.RequiredProps;\n\n export type DefaultProps = DSMenuItemsCommonsT.DefaultProps & {\n // this is a lie, the \"default\" label is not producing anything useful...\n // the idea of \"default\" is that if the user does not provide a value, we still have a valid value to use...\n label: string;\n isActive: boolean;\n disabled: boolean;\n applyAriaDisabled: boolean;\n isSelected: boolean;\n onClick: React.MouseEventHandler<Element>;\n onMouseDown: React.MouseEventHandler<Element>;\n onMouseEnter: React.MouseEventHandler<Element>;\n onMouseLeave: React.MouseEventHandler<Element>;\n dataTestid: string;\n tabIndex: 0 | -1 | '0' | '-1';\n\n isSubmenuOpened: boolean;\n onSubmenuOpen: React.MouseEventHandler<Element>;\n rightAddon: 'ellipsis' | 'chevron';\n optionsShouldHavePadding: boolean;\n Dropdown: React.ComponentType<React.PropsWithChildren<DSMenuItemsSingleWithSubmenuT.DefaultProps['dropdownProps']>>;\n // this is a lie, the \"default\" dropdownProps is not producing anything useful...\n // the idea of \"default\" is that if the user does not provide a value, we still have a valid value to use...\n dropdownProps: {\n options: unknown[];\n onSubmenuToggle?: (\n nextOpenedSubmenus: Record<string, boolean>,\n submenu: unknown,\n e: React.MouseEvent<Element> | React.KeyboardEvent<Element>,\n ) => void;\n openedSubmenus?: Record<string, boolean>;\n selectedOptions?: Record<string, boolean>;\n onKeyDown?: React.KeyboardEventHandler;\n onOptionClick?: (\n nextSelectedOptions: Record<string, boolean>,\n clickedOption: unknown,\n e: React.MouseEvent<Element> | React.KeyboardEvent<Element>,\n ) => void;\n onClickOutside?: (\n e: React.MouseEvent<Element> | React.KeyboardEvent<Element> | React.TouchEvent<Element>,\n ) => void;\n minWidth?: SizingProps['minWidth'];\n maxHeight?: SizingProps['maxHeight'];\n [key: string]: unknown;\n };\n };\n\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsSingleWithSubmenuT.InternalProps> & {\n secondaryLabel?: string;\n value?: unknown;\n onSubmenuClose?: React.MouseEventHandler<Element>;\n };\n\n // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps\n // they are NOT inherited from a common element from ds-menu-items-commons\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSMenuItemsSingleWithSubmenuT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n\n isSelected: false,\n onClick: () => {},\n onMouseDown: () => {},\n onMouseEnter: () => {},\n onMouseLeave: () => {},\n dataTestid: 'ds-menu-item',\n tabIndex: 0,\n\n // this is a lie, the \"default\" label is not producing anything useful...\n // the idea of \"default\" is that if the user does not provide a value, we still have a valid value to use...\n label: '',\n isActive: false,\n disabled: false,\n applyAriaDisabled: false,\n isSubmenuOpened: false,\n onSubmenuOpen: () => {},\n rightAddon: 'chevron',\n optionsShouldHavePadding: false,\n Dropdown: () => null,\n // this is a lie, the \"default\" dropdownProps is not producing anything useful...\n // the idea of \"default\" is that if the user does not provide a value, we still have a valid value to use...\n dropdownProps: {\n options: [],\n onSubmenuToggle: () => {},\n openedSubmenus: {},\n selectedOptions: {},\n onKeyDown: () => {},\n onOptionClick: () => {},\n onClickOutside: () => {},\n minWidth: 'auto',\n maxHeight: 'auto',\n },\n};\n\n// we are removing some keys from the global attributes because they are overridden by the action props\n// eslint-disable-next-line no-unused-vars\nconst { tabIndex, label, value, ...notOvverriddenCommonPropsTypes } = globalAttributesPropTypes;\n\nexport const DSMenuItemsSingleWithSubmenuPropTypes: DSPropTypesSchema<DSMenuItemsSingleWithSubmenuT.InternalProps> = {\n // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps\n // they are NOT inherited from a common element from ds-menu-items-commons\n ...notOvverriddenCommonPropsTypes,\n ...xstyledPropTypes,\n ...DSMenuItemsCommonsPropTypes,\n\n // TODO - add support to PropTypes.oneOf for typeof number\n // currently PropTypes.oneOf([0, -1]) is not supported\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed.')\n .defaultValue(defaultProps.tabIndex),\n label: PropTypes.string.description('The label of the menu item.'),\n value: PropTypes.any.description('The value of the menu item.'),\n isActive: PropTypes.bool.description('Whether the menu item is active.').defaultValue(defaultProps.isActive),\n optionsShouldHavePadding: PropTypes.bool\n .description('Whether the menu item should have padding. This is used in the context of a menu with options.')\n .defaultValue(defaultProps.optionsShouldHavePadding),\n secondaryLabel: PropTypes.string.description('The secondary label of the menu item.'),\n isSelected: PropTypes.bool\n .description('Whether the menu item has to show the selected state or not.')\n .defaultValue(defaultProps.isSelected),\n dataTestid: PropTypes.string.description('The data-testid of the menu item.').defaultValue(defaultProps.dataTestid),\n isSubmenuOpened: PropTypes.bool\n .description('Whether the submenu is opened or not.')\n .defaultValue(defaultProps.isSubmenuOpened),\n onSubmenuOpen: PropTypes.func.description('Callback fired when the user tries to open the submenu.'),\n onSubmenuClose: PropTypes.func.description('Callback fired when the user tries to close the submenu.'),\n rightAddon: PropTypes.oneOf(['ellipsis', 'chevron']).description(\n 'The visual element to display on the right side of the menu item.',\n ),\n Dropdown: PropTypes.func.description('The Dropdown component to use to render the submenu.'),\n dropdownProps: PropTypes.shape({\n options: PropTypes.arrayOf(PropTypes.any).description('The options to display in the submenu.'),\n onSubmenuToggle: PropTypes.func\n .description(\n 'Callback fired when the user tries to toggle the submenu. It receives the next opened submenus, the submenu and the event.',\n )\n .signature(\n '((nextOpenedSubmenus: Record<string, boolean>, submenu: unknown, e: React.MouseEvent | React.KeyboardEvent) => void)',\n ),\n openedSubmenus: PropTypes.objectOf(PropTypes.bool).description('The opened submenus.'),\n selectedOptions: PropTypes.objectOf(PropTypes.bool).description('The selected options.'),\n onKeyDown: PropTypes.func.description('Callback fired when the user presses a key.'),\n onOptionClick: PropTypes.func\n .description(\n 'Callback fired when the user clicks on an option. It receives the next selected options, the clicked option and the event.',\n )\n .signature(\n '((nextSelectedOptions: Record<string, boolean>, clickedOption: unknown, e: React.MouseEvent | React.KeyboardEvent) => void)',\n ),\n onClickOutside: PropTypes.func\n .description('Callback fired when the user clicks outside the submenu.')\n .signature('((e: MouseEvent | React.KeyboardEvent | TouchEvent) => void)'),\n minWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('The min width of the submenu.'),\n maxHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('The max height of the submenu.'),\n }).description('The props to pass to the Dropdown component.'),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n};\n\nexport const DSMenuItemsSingleWithSubmenuPropTypesSchema =\n DSMenuItemsSingleWithSubmenuPropTypes as unknown as WeakValidationMap<DSMenuItemsSingleWithSubmenuT.Props>;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AAEvE;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AAmFA,MAAM,eAA2D;AAAA,EACtE,GAAG;AAAA,EAEH,YAAY;AAAA,EACZ,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,aAAa,MAAM;AAAA,EAAC;AAAA,EACpB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,YAAY;AAAA,EACZ,UAAU;AAAA;AAAA;AAAA,EAIV,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,eAAe,MAAM;AAA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AAAA,EACrG,YAAY,UAAU,MAAM,CAAC,YAAY,SAAS,CAAC,EAAE;AAAA,IACnD;AAAA,EACF;AAAA,EACA,UAAU,UAAU,KAAK,YAAY,sDAAsD;AAAA,EAC3F,eAAe,UAAU,MAAM;AAAA,IAC7B,SAAS,UAAU,QAAQ,UAAU,GAAG,EAAE,YAAY,wCAAwC;AAAA,IAC9F,iBAAiB,UAAU,KACxB;AAAA,MACC;AAAA,IACF,EACC;AAAA,MACC;AAAA,IACF;AAAA,IACF,gBAAgB,UAAU,SAAS,UAAU,IAAI,EAAE,YAAY,sBAAsB;AAAA,IACrF,iBAAiB,UAAU,SAAS,UAAU,IAAI,EAAE,YAAY,uBAAuB;AAAA,IACvF,WAAW,UAAU,KAAK,YAAY,6CAA6C;AAAA,IACnF,eAAe,UAAU,KACtB;AAAA,MACC;AAAA,IACF,EACC;AAAA,MACC;AAAA,IACF;AAAA,IACF,gBAAgB,UAAU,KACvB,YAAY,0DAA0D,EACtE,UAAU,8DAA8D;AAAA,IAC3E,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,+BAA+B;AAAA,IAC/G,WAAW,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,gCAAgC;AAAA,EACnH,CAAC,EAAE,YAAY,8CAA8C;AAAA,EAC7D,mBAAmB,UAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AACvB;AAEO,MAAM,8CACX;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type { SizingProps } from '@elliemae/ds-system';\nimport {\n type DSMenuItemsCommonsT,\n DSMenuItemsCommonsPropTypes,\n DSMenuItemsCommonsDefaultProps,\n} from '@elliemae/ds-menu-items-commons';\nimport type React from 'react';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSMenuItemsSingleWithSubmenuT {\n // typescript inheritance has no syntax support for \"interfaces\", we have to use union types instead...\n export type RequiredProps = DSMenuItemsCommonsT.RequiredProps;\n\n export type DefaultProps = DSMenuItemsCommonsT.DefaultProps & {\n // this is a lie, the \"default\" label is not producing anything useful...\n // the idea of \"default\" is that if the user does not provide a value, we still have a valid value to use...\n label: string;\n isActive: boolean;\n disabled: boolean;\n applyAriaDisabled: boolean;\n isSelected: boolean;\n onClick: React.MouseEventHandler<Element>;\n onMouseDown: React.MouseEventHandler<Element>;\n onMouseEnter: React.MouseEventHandler<Element>;\n onMouseLeave: React.MouseEventHandler<Element>;\n dataTestid: string;\n tabIndex: 0 | -1 | '0' | '-1';\n\n isSubmenuOpened: boolean;\n onSubmenuOpen: React.MouseEventHandler<Element>;\n rightAddon: 'ellipsis' | 'chevron';\n optionsShouldHavePadding: boolean;\n Dropdown: React.ComponentType<React.PropsWithChildren<DSMenuItemsSingleWithSubmenuT.DefaultProps['dropdownProps']>>;\n // this is a lie, the \"default\" dropdownProps is not producing anything useful...\n // the idea of \"default\" is that if the user does not provide a value, we still have a valid value to use...\n dropdownProps: {\n options: unknown[];\n onSubmenuToggle?: (\n nextOpenedSubmenus: Record<string, boolean>,\n submenu: unknown,\n e: React.MouseEvent<Element> | React.KeyboardEvent<Element>,\n ) => void;\n openedSubmenus?: Record<string, boolean>;\n selectedOptions?: Record<string, boolean>;\n onKeyDown?: React.KeyboardEventHandler;\n onOptionClick?: (\n nextSelectedOptions: Record<string, boolean>,\n clickedOption: unknown,\n e: React.MouseEvent<Element> | React.KeyboardEvent<Element>,\n ) => void;\n onClickOutside?: (\n e: React.MouseEvent<Element> | React.KeyboardEvent<Element> | React.TouchEvent<Element>,\n ) => void;\n minWidth?: SizingProps['minWidth'];\n maxHeight?: SizingProps['maxHeight'];\n [key: string]: unknown;\n };\n };\n\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsSingleWithSubmenuT.InternalProps> & {\n secondaryLabel?: string;\n value?: unknown;\n onSubmenuClose?: React.MouseEventHandler<Element>;\n };\n\n // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps\n // they are NOT inherited from a common element from ds-menu-items-commons\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSMenuItemsSingleWithSubmenuT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n\n isSelected: false,\n onClick: () => {},\n onMouseDown: () => {},\n onMouseEnter: () => {},\n onMouseLeave: () => {},\n dataTestid: 'ds-menu-item',\n tabIndex: 0,\n\n // this is a lie, the \"default\" label is not producing anything useful...\n // the idea of \"default\" is that if the user does not provide a value, we still have a valid value to use...\n label: '',\n isActive: false,\n disabled: false,\n applyAriaDisabled: false,\n isSubmenuOpened: false,\n onSubmenuOpen: () => {},\n rightAddon: 'chevron',\n optionsShouldHavePadding: false,\n Dropdown: () => null,\n // this is a lie, the \"default\" dropdownProps is not producing anything useful...\n // the idea of \"default\" is that if the user does not provide a value, we still have a valid value to use...\n dropdownProps: {\n options: [],\n onSubmenuToggle: () => {},\n openedSubmenus: {},\n selectedOptions: {},\n onKeyDown: () => {},\n onOptionClick: () => {},\n onClickOutside: () => {},\n minWidth: 'auto',\n maxHeight: 'auto',\n },\n};\n\n// we are removing some keys from the global attributes because they are overridden by the action props\n// eslint-disable-next-line no-unused-vars\nconst { tabIndex, label, value, ...notOvverriddenCommonPropsTypes } = globalAttributesPropTypes;\n\nexport const DSMenuItemsSingleWithSubmenuPropTypes: DSPropTypesSchema<DSMenuItemsSingleWithSubmenuT.InternalProps> = {\n // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps\n // they are NOT inherited from a common element from ds-menu-items-commons\n ...notOvverriddenCommonPropsTypes,\n ...xstyledPropTypes,\n ...DSMenuItemsCommonsPropTypes,\n\n // TODO - add support to PropTypes.oneOf for typeof number\n // currently PropTypes.oneOf([0, -1]) is not supported\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed.')\n .defaultValue(defaultProps.tabIndex),\n label: PropTypes.string.description('The label of the menu item.'),\n value: PropTypes.any.description('The value of the menu item.'),\n isActive: PropTypes.bool.description('Whether the menu item is active.').defaultValue(defaultProps.isActive),\n optionsShouldHavePadding: PropTypes.bool\n .description('Whether the menu item should have padding. This is used in the context of a menu with options.')\n .defaultValue(defaultProps.optionsShouldHavePadding),\n secondaryLabel: PropTypes.string.description('The secondary label of the menu item.'),\n isSelected: PropTypes.bool\n .description('Whether the menu item has to show the selected state or not.')\n .defaultValue(defaultProps.isSelected),\n dataTestid: PropTypes.string.description('The data-testid of the menu item.').defaultValue(defaultProps.dataTestid),\n isSubmenuOpened: PropTypes.bool\n .description('Whether the submenu is opened or not.')\n .defaultValue(defaultProps.isSubmenuOpened),\n onSubmenuOpen: PropTypes.func.description('Callback fired when the user tries to open the submenu.'),\n onSubmenuClose: PropTypes.func.description('Callback fired when the user tries to close the submenu.'),\n rightAddon: PropTypes.oneOf(['ellipsis', 'chevron']).description(\n 'The visual element to display on the right side of the menu item.',\n ),\n Dropdown: PropTypes.func.description('The Dropdown component to use to render the submenu.'),\n dropdownProps: PropTypes.shape({\n options: PropTypes.arrayOf(PropTypes.any).description('The options to display in the submenu.'),\n onSubmenuToggle: PropTypes.func\n .description(\n 'Callback fired when the user tries to toggle the submenu. It receives the next opened submenus, the submenu and the event.',\n )\n .signature(\n '((nextOpenedSubmenus: Record<string, boolean>, submenu: unknown, e: React.MouseEvent | React.KeyboardEvent) => void)',\n ),\n openedSubmenus: PropTypes.objectOf(PropTypes.bool).description('The opened submenus.'),\n selectedOptions: PropTypes.objectOf(PropTypes.bool).description('The selected options.'),\n onKeyDown: PropTypes.func.description('Callback fired when the user presses a key.'),\n onOptionClick: PropTypes.func\n .description(\n 'Callback fired when the user clicks on an option. It receives the next selected options, the clicked option and the event.',\n )\n .signature(\n '((nextSelectedOptions: Record<string, boolean>, clickedOption: unknown, e: React.MouseEvent | React.KeyboardEvent) => void)',\n ),\n onClickOutside: PropTypes.func\n .description('Callback fired when the user clicks outside the submenu.')\n .signature('((e: MouseEvent | React.KeyboardEvent | TouchEvent) => void)'),\n minWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('The min width of the submenu.'),\n maxHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('The max height of the submenu.'),\n }).description('The props to pass to the Dropdown component.'),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n};\n\nexport const DSMenuItemsSingleWithSubmenuPropTypesSchema =\n DSMenuItemsSingleWithSubmenuPropTypes as unknown as WeakValidationMap<DSMenuItemsSingleWithSubmenuT.Props>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AAEvE;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AAqFA,MAAM,eAA2D;AAAA,EACtE,GAAG;AAAA,EAEH,YAAY;AAAA,EACZ,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,aAAa,MAAM;AAAA,EAAC;AAAA,EACpB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,YAAY;AAAA,EACZ,UAAU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,YAAY,uCAAuC,EACnD,aAAa,aAAa,eAAe;AAAA,EAC5C,eAAe,UAAU,KAAK,YAAY,yDAAyD;AAAA,EACnG,gBAAgB,UAAU,KAAK,YAAY,0DAA0D;AAAA,EACrG,YAAY,UAAU,MAAM,CAAC,YAAY,SAAS,CAAC,EAAE;AAAA,IACnD;AAAA,EACF;AAAA,EACA,UAAU,UAAU,KAAK,YAAY,sDAAsD;AAAA,EAC3F,eAAe,UAAU,MAAM;AAAA,IAC7B,SAAS,UAAU,QAAQ,UAAU,GAAG,EAAE,YAAY,wCAAwC;AAAA,IAC9F,iBAAiB,UAAU,KACxB;AAAA,MACC;AAAA,IACF,EACC;AAAA,MACC;AAAA,IACF;AAAA,IACF,gBAAgB,UAAU,SAAS,UAAU,IAAI,EAAE,YAAY,sBAAsB;AAAA,IACrF,iBAAiB,UAAU,SAAS,UAAU,IAAI,EAAE,YAAY,uBAAuB;AAAA,IACvF,WAAW,UAAU,KAAK,YAAY,6CAA6C;AAAA,IACnF,eAAe,UAAU,KACtB;AAAA,MACC;AAAA,IACF,EACC;AAAA,MACC;AAAA,IACF;AAAA,IACF,gBAAgB,UAAU,KACvB,YAAY,0DAA0D,EACtE,UAAU,8DAA8D;AAAA,IAC3E,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,+BAA+B;AAAA,IAC/G,WAAW,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,gCAAgC;AAAA,EACnH,CAAC,EAAE,YAAY,8CAA8C;AAAA,EAC7D,mBAAmB,UAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AACvB;AAEO,MAAM,8CACX;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-menu-items-single-with-submenu",
3
- "version": "3.70.0-next.63",
3
+ "version": "3.70.0-next.69",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Menu Items Single With Submenu",
6
6
  "files": [
@@ -36,17 +36,17 @@
36
36
  "indent": 4
37
37
  },
38
38
  "dependencies": {
39
- "@elliemae/ds-grid": "3.70.0-next.63",
40
- "@elliemae/ds-menu-items-commons": "3.70.0-next.63",
41
- "@elliemae/ds-system": "3.70.0-next.63",
42
- "@elliemae/ds-icons": "3.70.0-next.63",
43
- "@elliemae/ds-props-helpers": "3.70.0-next.63"
39
+ "@elliemae/ds-grid": "3.70.0-next.69",
40
+ "@elliemae/ds-icons": "3.70.0-next.69",
41
+ "@elliemae/ds-system": "3.70.0-next.69",
42
+ "@elliemae/ds-menu-items-commons": "3.70.0-next.69",
43
+ "@elliemae/ds-props-helpers": "3.70.0-next.69"
44
44
  },
45
45
  "devDependencies": {
46
46
  "jest": "^30.0.0",
47
47
  "lodash-es": "^4.18.1",
48
48
  "styled-components": "~5.3.11",
49
- "@elliemae/ds-monorepo-devops": "3.70.0-next.63"
49
+ "@elliemae/ds-monorepo-devops": "3.70.0-next.69"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@testing-library/jest-dom": "^6.6.3",