@elliemae/ds-menu-items-action 3.41.2-rc.1 → 3.42.0-rc.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.
- package/dist/cjs/DSMenuItemsAction.js +3 -1
- package/dist/cjs/DSMenuItemsAction.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +4 -2
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/esm/DSMenuItemsAction.js +3 -1
- package/dist/esm/DSMenuItemsAction.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +4 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/types/config/useMenuItemsAction.d.ts +13 -13
- package/dist/types/react-desc-prop-types.d.ts +1 -0
- package/package.json +7 -7
|
@@ -52,7 +52,8 @@ const DSMenuItemsAction = (props) => {
|
|
|
52
52
|
wrapperStyles,
|
|
53
53
|
optionsShouldHavePadding,
|
|
54
54
|
render: Render,
|
|
55
|
-
applyAriaDisabled
|
|
55
|
+
applyAriaDisabled,
|
|
56
|
+
as
|
|
56
57
|
} = propsWithDefault;
|
|
57
58
|
const handleOnClick = import_react.default.useCallback(
|
|
58
59
|
(e) => {
|
|
@@ -81,6 +82,7 @@ const DSMenuItemsAction = (props) => {
|
|
|
81
82
|
...globalAttributes,
|
|
82
83
|
onClick: handleOnClick,
|
|
83
84
|
...xStyledProps,
|
|
85
|
+
as,
|
|
84
86
|
children: Render !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Render, { ...propsWithDefault }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_menu_items_commons.StyledContentWrapper, { cols: gridLayout, minHeight: "16px", gutter: "xxs", alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
85
87
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_menu_items_commons.StyleMenuItemLabel, { children: label }),
|
|
86
88
|
secondaryLabel !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_menu_items_commons.StyleMenuItemSecondaryLabel, { children: secondaryLabel })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSMenuItemsAction.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport {\n StyledGlobalMenuItemWrapper,\n StyledContentWrapper,\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n} from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsActionT, DSMenuItemsActionPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsAction } from './config/useMenuItemsAction.js';\n\nconst DSMenuItemsAction: React.ComponentType<DSMenuItemsActionT.Props> = (props) => {\n const { propsWithDefault, globalProps: globalAttributes, xstyledProps: xStyledProps } = useMenuItemsAction(props);\n\n const {\n dsId,\n label,\n secondaryLabel,\n onClick,\n isActive,\n disabled,\n innerRef,\n wrapperStyles,\n optionsShouldHavePadding,\n render: Render,\n applyAriaDisabled,\n } = propsWithDefault;\n\n const handleOnClick = React.useCallback(\n (e: React.MouseEvent) => {\n if (disabled || applyAriaDisabled) return;\n onClick?.(e);\n },\n [disabled, applyAriaDisabled, onClick],\n );\n\n const gridLayout = React.useMemo(() => {\n const cols = ['auto'];\n if (secondaryLabel) cols.push('min-content');\n return cols;\n }, [secondaryLabel]);\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n role=\"option\"\n isActive={isActive}\n disabled={disabled}\n innerRef={innerRef}\n pl={optionsShouldHavePadding ? 40 : 16}\n style={wrapperStyles}\n data-type=\"action\"\n aria-disabled={applyAriaDisabled}\n {...globalAttributes}\n onClick={handleOnClick}\n {...xStyledProps}\n >\n {Render !== undefined ? (\n <Render {...propsWithDefault} />\n ) : (\n <StyledContentWrapper cols={gridLayout} minHeight=\"16px\" gutter=\"xxs\" alignItems=\"center\">\n <>\n <StyleMenuItemLabel>{label}</StyleMenuItemLabel>\n {secondaryLabel !== undefined && (\n <StyleMenuItemSecondaryLabel>{secondaryLabel}</StyleMenuItemSecondaryLabel>\n )}\n </>\n </StyledContentWrapper>\n )}\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// this is `'DSActionMenuItem'` for legacy reasons, when moving to inheritance pattern this has been kept as it was to avoid complications\nDSMenuItemsAction.displayName = 'DSActionMenuItem';\nconst DSMenuItemsActionWithSchema = describe(DSMenuItemsAction);\nDSMenuItemsActionWithSchema.propTypes = DSMenuItemsActionPropTypesSchema;\n\nexport { DSMenuItemsAction, DSMenuItemsActionWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport {\n StyledGlobalMenuItemWrapper,\n StyledContentWrapper,\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n} from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsActionT, DSMenuItemsActionPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsAction } from './config/useMenuItemsAction.js';\n\nconst DSMenuItemsAction: React.ComponentType<DSMenuItemsActionT.Props> = (props) => {\n const { propsWithDefault, globalProps: globalAttributes, xstyledProps: xStyledProps } = useMenuItemsAction(props);\n\n const {\n dsId,\n label,\n secondaryLabel,\n onClick,\n isActive,\n disabled,\n innerRef,\n wrapperStyles,\n optionsShouldHavePadding,\n render: Render,\n applyAriaDisabled,\n as,\n } = propsWithDefault;\n\n const handleOnClick = React.useCallback(\n (e: React.MouseEvent) => {\n if (disabled || applyAriaDisabled) return;\n onClick?.(e);\n },\n [disabled, applyAriaDisabled, onClick],\n );\n\n const gridLayout = React.useMemo(() => {\n const cols = ['auto'];\n if (secondaryLabel) cols.push('min-content');\n return cols;\n }, [secondaryLabel]);\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n role=\"option\"\n isActive={isActive}\n disabled={disabled}\n innerRef={innerRef}\n pl={optionsShouldHavePadding ? 40 : 16}\n style={wrapperStyles}\n data-type=\"action\"\n aria-disabled={applyAriaDisabled}\n {...globalAttributes}\n onClick={handleOnClick}\n {...xStyledProps}\n as={as}\n >\n {Render !== undefined ? (\n <Render {...propsWithDefault} />\n ) : (\n <StyledContentWrapper cols={gridLayout} minHeight=\"16px\" gutter=\"xxs\" alignItems=\"center\">\n <>\n <StyleMenuItemLabel>{label}</StyleMenuItemLabel>\n {secondaryLabel !== undefined && (\n <StyleMenuItemSecondaryLabel>{secondaryLabel}</StyleMenuItemSecondaryLabel>\n )}\n </>\n </StyledContentWrapper>\n )}\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// this is `'DSActionMenuItem'` for legacy reasons, when moving to inheritance pattern this has been kept as it was to avoid complications\nDSMenuItemsAction.displayName = 'DSActionMenuItem';\nconst DSMenuItemsActionWithSchema = describe(DSMenuItemsAction);\nDSMenuItemsActionWithSchema.propTypes = DSMenuItemsActionPropTypesSchema;\n\nexport { DSMenuItemsAction, DSMenuItemsActionWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD4Df;AA5DR,mBAAkB;AAClB,8BAAyB;AACzB,mCAKO;AACP,mCAA0E;AAC1E,gCAAmC;AAEnC,MAAM,oBAAmE,CAAC,UAAU;AAClF,QAAM,EAAE,kBAAkB,aAAa,kBAAkB,cAAc,aAAa,QAAI,8CAAmB,KAAK;AAEhH,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,gBAAgB,aAAAA,QAAM;AAAA,IAC1B,CAAC,MAAwB;AACvB,UAAI,YAAY,kBAAmB;AACnC,gBAAU,CAAC;AAAA,IACb;AAAA,IACA,CAAC,UAAU,mBAAmB,OAAO;AAAA,EACvC;AAEA,QAAM,aAAa,aAAAA,QAAM,QAAQ,MAAM;AACrC,UAAM,OAAO,CAAC,MAAM;AACpB,QAAI,eAAgB,MAAK,KAAK,aAAa;AAC3C,WAAO;AAAA,EACT,GAAG,CAAC,cAAc,CAAC;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,IAAI,2BAA2B,KAAK;AAAA,MACpC,OAAO;AAAA,MACP,aAAU;AAAA,MACV,iBAAe;AAAA,MACd,GAAG;AAAA,MACJ,SAAS;AAAA,MACR,GAAG;AAAA,MACJ;AAAA,MAEC,qBAAW,SACV,4CAAC,UAAQ,GAAG,kBAAkB,IAE9B,4CAAC,qDAAqB,MAAM,YAAY,WAAU,QAAO,QAAO,OAAM,YAAW,UAC/E,sFACE;AAAA,oDAAC,mDAAoB,iBAAM;AAAA,QAC1B,mBAAmB,UAClB,4CAAC,4DAA6B,0BAAe;AAAA,SAEjD,GACF;AAAA;AAAA,EAEJ;AAEJ;AAGA,kBAAkB,cAAc;AAChC,MAAM,kCAA8B,kCAAS,iBAAiB;AAC9D,4BAA4B,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -46,7 +46,8 @@ const defaultProps = {
|
|
|
46
46
|
},
|
|
47
47
|
optionsShouldHavePadding: false,
|
|
48
48
|
tabIndex: 0,
|
|
49
|
-
applyAriaDisabled: false
|
|
49
|
+
applyAriaDisabled: false,
|
|
50
|
+
as: "li"
|
|
50
51
|
};
|
|
51
52
|
const { tabIndex, label, value, ...notOvverriddenGlobalPropsTypes } = import_ds_props_helpers.globalAttributesPropTypes;
|
|
52
53
|
const DSMenuItemsActionPropTypes = {
|
|
@@ -69,7 +70,8 @@ const DSMenuItemsActionPropTypes = {
|
|
|
69
70
|
secondaryLabel: import_ds_props_helpers.PropTypes.string.description("The secondary label of the menu item."),
|
|
70
71
|
applyAriaDisabled: import_ds_props_helpers.PropTypes.bool.description(
|
|
71
72
|
"Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION."
|
|
72
|
-
).defaultValue(false)
|
|
73
|
+
).defaultValue(false),
|
|
74
|
+
as: import_ds_props_helpers.PropTypes.string.description("The HTML element to render the menu item as.")
|
|
73
75
|
};
|
|
74
76
|
const DSMenuItemsActionPropTypesSchema = DSMenuItemsActionPropTypes;
|
|
75
77
|
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -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, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n type DSMenuItemsCommonsT,\n DSMenuItemsCommonsPropTypes,\n DSMenuItemsCommonsDefaultProps,\n} from '@elliemae/ds-menu-items-commons';\nimport type React from 'react';\n\nexport declare namespace DSMenuItemsActionT {\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 label: string;\n value: unknown;\n disabled: boolean;\n isActive: boolean;\n onClick: React.MouseEventHandler;\n optionsShouldHavePadding: boolean;\n tabIndex: 0 | -1 | '0' | '-1';\n applyAriaDisabled: boolean;\n };\n\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsActionT.InternalProps> & {\n secondaryLabel?: string;\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: DSMenuItemsActionT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n label: '',\n value: undefined,\n disabled: false,\n isActive: false,\n onClick: () => {},\n optionsShouldHavePadding: false,\n tabIndex: 0,\n applyAriaDisabled: false,\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, ...notOvverriddenGlobalPropsTypes } = globalAttributesPropTypes;\n\nexport const DSMenuItemsActionPropTypes: DSPropTypesSchema<DSMenuItemsActionT.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 ...notOvverriddenGlobalPropsTypes,\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]).description(\n 'The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed.',\n ),\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.'),\n optionsShouldHavePadding: PropTypes.bool.description(\n 'Whether the menu item should have padding. This is used in the context of a menu with options.',\n ),\n secondaryLabel: PropTypes.string.description('The secondary label of the menu item.'),\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 DSMenuItemsActionPropTypesSchema =\n DSMenuItemsActionPropTypes as unknown as ValidationMap<DSMenuItemsActionT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;AACvE,mCAIO;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n type DSMenuItemsCommonsT,\n DSMenuItemsCommonsPropTypes,\n DSMenuItemsCommonsDefaultProps,\n} from '@elliemae/ds-menu-items-commons';\nimport type React from 'react';\n\nexport declare namespace DSMenuItemsActionT {\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 label: string;\n value: unknown;\n disabled: boolean;\n isActive: boolean;\n onClick: React.MouseEventHandler;\n optionsShouldHavePadding: boolean;\n tabIndex: 0 | -1 | '0' | '-1';\n applyAriaDisabled: boolean;\n as: keyof JSX.IntrinsicElements;\n };\n\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsActionT.InternalProps> & {\n secondaryLabel?: string;\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: DSMenuItemsActionT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n label: '',\n value: undefined,\n disabled: false,\n isActive: false,\n onClick: () => {},\n optionsShouldHavePadding: false,\n tabIndex: 0,\n applyAriaDisabled: false,\n as: 'li',\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, ...notOvverriddenGlobalPropsTypes } = globalAttributesPropTypes;\n\nexport const DSMenuItemsActionPropTypes: DSPropTypesSchema<DSMenuItemsActionT.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 ...notOvverriddenGlobalPropsTypes,\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]).description(\n 'The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed.',\n ),\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.'),\n optionsShouldHavePadding: PropTypes.bool.description(\n 'Whether the menu item should have padding. This is used in the context of a menu with options.',\n ),\n secondaryLabel: PropTypes.string.description('The secondary label of the menu item.'),\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 as: PropTypes.string.description('The HTML element to render the menu item as.'),\n};\n\nexport const DSMenuItemsActionPropTypesSchema =\n DSMenuItemsActionPropTypes as unknown as ValidationMap<DSMenuItemsActionT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;AACvE,mCAIO;AA8CA,MAAM,eAAgD;AAAA,EAC3D,GAAG;AAAA,EACH,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,IAAI;AACN;AAIA,MAAM,EAAE,UAAU,OAAO,OAAO,GAAG,+BAA+B,IAAI;AAE/D,MAAM,6BAAkF;AAAA;AAAA;AAAA,EAG7F,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA,EAIH,UAAU,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,EAAE;AAAA,IAClE;AAAA,EACF;AAAA,EACA,OAAO,kCAAU,OAAO,YAAY,6BAA6B;AAAA,EACjE,OAAO,kCAAU,IAAI,YAAY,6BAA6B;AAAA,EAC9D,UAAU,kCAAU,KAAK,YAAY,kCAAkC;AAAA,EACvE,0BAA0B,kCAAU,KAAK;AAAA,IACvC;AAAA,EACF;AAAA,EACA,gBAAgB,kCAAU,OAAO,YAAY,uCAAuC;AAAA,EACpF,mBAAmB,kCAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,IAAI,kCAAU,OAAO,YAAY,8CAA8C;AACjF;AAEO,MAAM,mCACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -23,7 +23,8 @@ const DSMenuItemsAction = (props) => {
|
|
|
23
23
|
wrapperStyles,
|
|
24
24
|
optionsShouldHavePadding,
|
|
25
25
|
render: Render,
|
|
26
|
-
applyAriaDisabled
|
|
26
|
+
applyAriaDisabled,
|
|
27
|
+
as
|
|
27
28
|
} = propsWithDefault;
|
|
28
29
|
const handleOnClick = React2.useCallback(
|
|
29
30
|
(e) => {
|
|
@@ -52,6 +53,7 @@ const DSMenuItemsAction = (props) => {
|
|
|
52
53
|
...globalAttributes,
|
|
53
54
|
onClick: handleOnClick,
|
|
54
55
|
...xStyledProps,
|
|
56
|
+
as,
|
|
55
57
|
children: Render !== void 0 ? /* @__PURE__ */ jsx(Render, { ...propsWithDefault }) : /* @__PURE__ */ jsx(StyledContentWrapper, { cols: gridLayout, minHeight: "16px", gutter: "xxs", alignItems: "center", children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
56
58
|
/* @__PURE__ */ jsx(StyleMenuItemLabel, { children: label }),
|
|
57
59
|
secondaryLabel !== void 0 && /* @__PURE__ */ jsx(StyleMenuItemSecondaryLabel, { children: secondaryLabel })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSMenuItemsAction.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport {\n StyledGlobalMenuItemWrapper,\n StyledContentWrapper,\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n} from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsActionT, DSMenuItemsActionPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsAction } from './config/useMenuItemsAction.js';\n\nconst DSMenuItemsAction: React.ComponentType<DSMenuItemsActionT.Props> = (props) => {\n const { propsWithDefault, globalProps: globalAttributes, xstyledProps: xStyledProps } = useMenuItemsAction(props);\n\n const {\n dsId,\n label,\n secondaryLabel,\n onClick,\n isActive,\n disabled,\n innerRef,\n wrapperStyles,\n optionsShouldHavePadding,\n render: Render,\n applyAriaDisabled,\n } = propsWithDefault;\n\n const handleOnClick = React.useCallback(\n (e: React.MouseEvent) => {\n if (disabled || applyAriaDisabled) return;\n onClick?.(e);\n },\n [disabled, applyAriaDisabled, onClick],\n );\n\n const gridLayout = React.useMemo(() => {\n const cols = ['auto'];\n if (secondaryLabel) cols.push('min-content');\n return cols;\n }, [secondaryLabel]);\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n role=\"option\"\n isActive={isActive}\n disabled={disabled}\n innerRef={innerRef}\n pl={optionsShouldHavePadding ? 40 : 16}\n style={wrapperStyles}\n data-type=\"action\"\n aria-disabled={applyAriaDisabled}\n {...globalAttributes}\n onClick={handleOnClick}\n {...xStyledProps}\n >\n {Render !== undefined ? (\n <Render {...propsWithDefault} />\n ) : (\n <StyledContentWrapper cols={gridLayout} minHeight=\"16px\" gutter=\"xxs\" alignItems=\"center\">\n <>\n <StyleMenuItemLabel>{label}</StyleMenuItemLabel>\n {secondaryLabel !== undefined && (\n <StyleMenuItemSecondaryLabel>{secondaryLabel}</StyleMenuItemSecondaryLabel>\n )}\n </>\n </StyledContentWrapper>\n )}\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// this is `'DSActionMenuItem'` for legacy reasons, when moving to inheritance pattern this has been kept as it was to avoid complications\nDSMenuItemsAction.displayName = 'DSActionMenuItem';\nconst DSMenuItemsActionWithSchema = describe(DSMenuItemsAction);\nDSMenuItemsActionWithSchema.propTypes = DSMenuItemsActionPropTypesSchema;\n\nexport { DSMenuItemsAction, DSMenuItemsActionWithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport {\n StyledGlobalMenuItemWrapper,\n StyledContentWrapper,\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n} from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsActionT, DSMenuItemsActionPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsAction } from './config/useMenuItemsAction.js';\n\nconst DSMenuItemsAction: React.ComponentType<DSMenuItemsActionT.Props> = (props) => {\n const { propsWithDefault, globalProps: globalAttributes, xstyledProps: xStyledProps } = useMenuItemsAction(props);\n\n const {\n dsId,\n label,\n secondaryLabel,\n onClick,\n isActive,\n disabled,\n innerRef,\n wrapperStyles,\n optionsShouldHavePadding,\n render: Render,\n applyAriaDisabled,\n as,\n } = propsWithDefault;\n\n const handleOnClick = React.useCallback(\n (e: React.MouseEvent) => {\n if (disabled || applyAriaDisabled) return;\n onClick?.(e);\n },\n [disabled, applyAriaDisabled, onClick],\n );\n\n const gridLayout = React.useMemo(() => {\n const cols = ['auto'];\n if (secondaryLabel) cols.push('min-content');\n return cols;\n }, [secondaryLabel]);\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n role=\"option\"\n isActive={isActive}\n disabled={disabled}\n innerRef={innerRef}\n pl={optionsShouldHavePadding ? 40 : 16}\n style={wrapperStyles}\n data-type=\"action\"\n aria-disabled={applyAriaDisabled}\n {...globalAttributes}\n onClick={handleOnClick}\n {...xStyledProps}\n as={as}\n >\n {Render !== undefined ? (\n <Render {...propsWithDefault} />\n ) : (\n <StyledContentWrapper cols={gridLayout} minHeight=\"16px\" gutter=\"xxs\" alignItems=\"center\">\n <>\n <StyleMenuItemLabel>{label}</StyleMenuItemLabel>\n {secondaryLabel !== undefined && (\n <StyleMenuItemSecondaryLabel>{secondaryLabel}</StyleMenuItemSecondaryLabel>\n )}\n </>\n </StyledContentWrapper>\n )}\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// this is `'DSActionMenuItem'` for legacy reasons, when moving to inheritance pattern this has been kept as it was to avoid complications\nDSMenuItemsAction.displayName = 'DSActionMenuItem';\nconst DSMenuItemsActionWithSchema = describe(DSMenuItemsAction);\nDSMenuItemsActionWithSchema.propTypes = DSMenuItemsActionPropTypesSchema;\n\nexport { DSMenuItemsAction, DSMenuItemsActionWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC4Df,SAGE,UAHF,KAGE,YAHF;AA5DR,OAAOA,YAAW;AAClB,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAkC,wCAAwC;AAC1E,SAAS,0BAA0B;AAEnC,MAAM,oBAAmE,CAAC,UAAU;AAClF,QAAM,EAAE,kBAAkB,aAAa,kBAAkB,cAAc,aAAa,IAAI,mBAAmB,KAAK;AAEhH,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,gBAAgBA,OAAM;AAAA,IAC1B,CAAC,MAAwB;AACvB,UAAI,YAAY,kBAAmB;AACnC,gBAAU,CAAC;AAAA,IACb;AAAA,IACA,CAAC,UAAU,mBAAmB,OAAO;AAAA,EACvC;AAEA,QAAM,aAAaA,OAAM,QAAQ,MAAM;AACrC,UAAM,OAAO,CAAC,MAAM;AACpB,QAAI,eAAgB,MAAK,KAAK,aAAa;AAC3C,WAAO;AAAA,EACT,GAAG,CAAC,cAAc,CAAC;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,IAAI,2BAA2B,KAAK;AAAA,MACpC,OAAO;AAAA,MACP,aAAU;AAAA,MACV,iBAAe;AAAA,MACd,GAAG;AAAA,MACJ,SAAS;AAAA,MACR,GAAG;AAAA,MACJ;AAAA,MAEC,qBAAW,SACV,oBAAC,UAAQ,GAAG,kBAAkB,IAE9B,oBAAC,wBAAqB,MAAM,YAAY,WAAU,QAAO,QAAO,OAAM,YAAW,UAC/E,2CACE;AAAA,4BAAC,sBAAoB,iBAAM;AAAA,QAC1B,mBAAmB,UAClB,oBAAC,+BAA6B,0BAAe;AAAA,SAEjD,GACF;AAAA;AAAA,EAEJ;AAEJ;AAGA,kBAAkB,cAAc;AAChC,MAAM,8BAA8B,SAAS,iBAAiB;AAC9D,4BAA4B,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -14,7 +14,8 @@ const defaultProps = {
|
|
|
14
14
|
},
|
|
15
15
|
optionsShouldHavePadding: false,
|
|
16
16
|
tabIndex: 0,
|
|
17
|
-
applyAriaDisabled: false
|
|
17
|
+
applyAriaDisabled: false,
|
|
18
|
+
as: "li"
|
|
18
19
|
};
|
|
19
20
|
const { tabIndex, label, value, ...notOvverriddenGlobalPropsTypes } = globalAttributesPropTypes;
|
|
20
21
|
const DSMenuItemsActionPropTypes = {
|
|
@@ -37,7 +38,8 @@ const DSMenuItemsActionPropTypes = {
|
|
|
37
38
|
secondaryLabel: PropTypes.string.description("The secondary label of the menu item."),
|
|
38
39
|
applyAriaDisabled: PropTypes.bool.description(
|
|
39
40
|
"Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION."
|
|
40
|
-
).defaultValue(false)
|
|
41
|
+
).defaultValue(false),
|
|
42
|
+
as: PropTypes.string.description("The HTML element to render the menu item as.")
|
|
41
43
|
};
|
|
42
44
|
const DSMenuItemsActionPropTypesSchema = DSMenuItemsActionPropTypes;
|
|
43
45
|
export {
|
|
@@ -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, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n type DSMenuItemsCommonsT,\n DSMenuItemsCommonsPropTypes,\n DSMenuItemsCommonsDefaultProps,\n} from '@elliemae/ds-menu-items-commons';\nimport type React from 'react';\n\nexport declare namespace DSMenuItemsActionT {\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 label: string;\n value: unknown;\n disabled: boolean;\n isActive: boolean;\n onClick: React.MouseEventHandler;\n optionsShouldHavePadding: boolean;\n tabIndex: 0 | -1 | '0' | '-1';\n applyAriaDisabled: boolean;\n };\n\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsActionT.InternalProps> & {\n secondaryLabel?: string;\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: DSMenuItemsActionT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n label: '',\n value: undefined,\n disabled: false,\n isActive: false,\n onClick: () => {},\n optionsShouldHavePadding: false,\n tabIndex: 0,\n applyAriaDisabled: false,\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, ...notOvverriddenGlobalPropsTypes } = globalAttributesPropTypes;\n\nexport const DSMenuItemsActionPropTypes: DSPropTypesSchema<DSMenuItemsActionT.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 ...notOvverriddenGlobalPropsTypes,\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]).description(\n 'The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed.',\n ),\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.'),\n optionsShouldHavePadding: PropTypes.bool.description(\n 'Whether the menu item should have padding. This is used in the context of a menu with options.',\n ),\n secondaryLabel: PropTypes.string.description('The secondary label of the menu item.'),\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 DSMenuItemsActionPropTypesSchema =\n DSMenuItemsActionPropTypes as unknown as ValidationMap<DSMenuItemsActionT.Props>;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE;AAAA,EAEE;AAAA,EACA;AAAA,OACK;
|
|
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, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n type DSMenuItemsCommonsT,\n DSMenuItemsCommonsPropTypes,\n DSMenuItemsCommonsDefaultProps,\n} from '@elliemae/ds-menu-items-commons';\nimport type React from 'react';\n\nexport declare namespace DSMenuItemsActionT {\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 label: string;\n value: unknown;\n disabled: boolean;\n isActive: boolean;\n onClick: React.MouseEventHandler;\n optionsShouldHavePadding: boolean;\n tabIndex: 0 | -1 | '0' | '-1';\n applyAriaDisabled: boolean;\n as: keyof JSX.IntrinsicElements;\n };\n\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsActionT.InternalProps> & {\n secondaryLabel?: string;\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: DSMenuItemsActionT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n label: '',\n value: undefined,\n disabled: false,\n isActive: false,\n onClick: () => {},\n optionsShouldHavePadding: false,\n tabIndex: 0,\n applyAriaDisabled: false,\n as: 'li',\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, ...notOvverriddenGlobalPropsTypes } = globalAttributesPropTypes;\n\nexport const DSMenuItemsActionPropTypes: DSPropTypesSchema<DSMenuItemsActionT.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 ...notOvverriddenGlobalPropsTypes,\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]).description(\n 'The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed.',\n ),\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.'),\n optionsShouldHavePadding: PropTypes.bool.description(\n 'Whether the menu item should have padding. This is used in the context of a menu with options.',\n ),\n secondaryLabel: PropTypes.string.description('The secondary label of the menu item.'),\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 as: PropTypes.string.description('The HTML element to render the menu item as.'),\n};\n\nexport const DSMenuItemsActionPropTypesSchema =\n DSMenuItemsActionPropTypes as unknown as ValidationMap<DSMenuItemsActionT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AA8CA,MAAM,eAAgD;AAAA,EAC3D,GAAG;AAAA,EACH,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,IAAI;AACN;AAIA,MAAM,EAAE,UAAU,OAAO,OAAO,GAAG,+BAA+B,IAAI;AAE/D,MAAM,6BAAkF;AAAA;AAAA;AAAA,EAG7F,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA,EAIH,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE;AAAA,IAClE;AAAA,EACF;AAAA,EACA,OAAO,UAAU,OAAO,YAAY,6BAA6B;AAAA,EACjE,OAAO,UAAU,IAAI,YAAY,6BAA6B;AAAA,EAC9D,UAAU,UAAU,KAAK,YAAY,kCAAkC;AAAA,EACvE,0BAA0B,UAAU,KAAK;AAAA,IACvC;AAAA,EACF;AAAA,EACA,gBAAgB,UAAU,OAAO,YAAY,uCAAuC;AAAA,EACpF,mBAAmB,UAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,IAAI,UAAU,OAAO,YAAY,8CAA8C;AACjF;AAEO,MAAM,mCACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,13 +8,21 @@ export interface MenuItemsActionCTX {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const useMenuItemsAction: (propsFromUser: DSMenuItemsActionT.Props) => {
|
|
10
10
|
propsWithDefault: DSMenuItemsActionT.InternalProps;
|
|
11
|
-
globalProps: Partial<Pick<object, "label" | "
|
|
11
|
+
globalProps: Partial<Pick<object, "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "value" | "disabled" | "onClick" | "tabIndex" | "list" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "type" | "useMap" | "width" | "wmode" | "wrap"> & Omit<{
|
|
12
|
+
cite?: string | undefined;
|
|
13
|
+
data?: string | undefined;
|
|
14
|
+
form?: string | undefined;
|
|
12
15
|
label?: string | undefined;
|
|
16
|
+
slot?: string | undefined;
|
|
17
|
+
span?: number | undefined;
|
|
18
|
+
style?: React.CSSProperties | undefined;
|
|
19
|
+
summary?: string | undefined;
|
|
20
|
+
title?: string | undefined;
|
|
21
|
+
pattern?: string | undefined;
|
|
13
22
|
value?: string | number | readonly string[] | undefined;
|
|
14
23
|
disabled?: boolean | undefined;
|
|
15
24
|
onClick?: React.MouseEventHandler<HTMLLIElement> | undefined;
|
|
16
25
|
tabIndex?: 0 | -1 | undefined;
|
|
17
|
-
form?: string | undefined;
|
|
18
26
|
list?: string | undefined;
|
|
19
27
|
"aria-activedescendant"?: string | undefined;
|
|
20
28
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
@@ -28,7 +36,7 @@ export declare const useMenuItemsAction: (propsFromUser: DSMenuItemsActionT.Prop
|
|
|
28
36
|
"aria-colindextext"?: string | undefined;
|
|
29
37
|
"aria-colspan"?: number | undefined;
|
|
30
38
|
"aria-controls"?: string | undefined;
|
|
31
|
-
"aria-current"?: boolean | "true" | "false" | "step" | "page" | "location" | "date" |
|
|
39
|
+
"aria-current"?: boolean | "time" | "true" | "false" | "step" | "page" | "location" | "date" | undefined;
|
|
32
40
|
"aria-describedby"?: string | undefined;
|
|
33
41
|
"aria-description"?: string | undefined;
|
|
34
42
|
"aria-details"?: string | undefined;
|
|
@@ -38,7 +46,7 @@ export declare const useMenuItemsAction: (propsFromUser: DSMenuItemsActionT.Prop
|
|
|
38
46
|
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
39
47
|
"aria-flowto"?: string | undefined;
|
|
40
48
|
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
41
|
-
"aria-haspopup"?: boolean | "
|
|
49
|
+
"aria-haspopup"?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
|
|
42
50
|
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
43
51
|
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
44
52
|
"aria-keyshortcuts"?: string | undefined;
|
|
@@ -244,10 +252,7 @@ export declare const useMenuItemsAction: (propsFromUser: DSMenuItemsActionT.Prop
|
|
|
244
252
|
id?: string | undefined;
|
|
245
253
|
lang?: string | undefined;
|
|
246
254
|
nonce?: string | undefined;
|
|
247
|
-
slot?: string | undefined;
|
|
248
255
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
249
|
-
style?: React.CSSProperties | undefined;
|
|
250
|
-
title?: string | undefined;
|
|
251
256
|
translate?: "yes" | "no" | undefined;
|
|
252
257
|
radioGroup?: string | undefined;
|
|
253
258
|
role?: React.AriaRole | undefined;
|
|
@@ -274,7 +279,7 @@ export declare const useMenuItemsAction: (propsFromUser: DSMenuItemsActionT.Prop
|
|
|
274
279
|
results?: number | undefined;
|
|
275
280
|
security?: string | undefined;
|
|
276
281
|
unselectable?: "on" | "off" | undefined;
|
|
277
|
-
inputMode?: "
|
|
282
|
+
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
278
283
|
is?: string | undefined;
|
|
279
284
|
accept?: string | undefined;
|
|
280
285
|
acceptCharset?: string | undefined;
|
|
@@ -291,14 +296,12 @@ export declare const useMenuItemsAction: (propsFromUser: DSMenuItemsActionT.Prop
|
|
|
291
296
|
charSet?: string | undefined;
|
|
292
297
|
challenge?: string | undefined;
|
|
293
298
|
checked?: boolean | undefined;
|
|
294
|
-
cite?: string | undefined;
|
|
295
299
|
classID?: string | undefined;
|
|
296
300
|
cols?: number | undefined;
|
|
297
301
|
colSpan?: number | undefined;
|
|
298
302
|
controls?: boolean | undefined;
|
|
299
303
|
coords?: string | undefined;
|
|
300
304
|
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
301
|
-
data?: string | undefined;
|
|
302
305
|
dateTime?: string | undefined;
|
|
303
306
|
default?: boolean | undefined;
|
|
304
307
|
defer?: boolean | undefined;
|
|
@@ -339,7 +342,6 @@ export declare const useMenuItemsAction: (propsFromUser: DSMenuItemsActionT.Prop
|
|
|
339
342
|
noValidate?: boolean | undefined;
|
|
340
343
|
open?: boolean | undefined;
|
|
341
344
|
optimum?: number | undefined;
|
|
342
|
-
pattern?: string | undefined;
|
|
343
345
|
placeholder?: string | undefined;
|
|
344
346
|
playsInline?: boolean | undefined;
|
|
345
347
|
poster?: string | undefined;
|
|
@@ -358,14 +360,12 @@ export declare const useMenuItemsAction: (propsFromUser: DSMenuItemsActionT.Prop
|
|
|
358
360
|
shape?: string | undefined;
|
|
359
361
|
size?: number | undefined;
|
|
360
362
|
sizes?: string | undefined;
|
|
361
|
-
span?: number | undefined;
|
|
362
363
|
src?: string | undefined;
|
|
363
364
|
srcDoc?: string | undefined;
|
|
364
365
|
srcLang?: string | undefined;
|
|
365
366
|
srcSet?: string | undefined;
|
|
366
367
|
start?: number | undefined;
|
|
367
368
|
step?: string | number | undefined;
|
|
368
|
-
summary?: string | undefined;
|
|
369
369
|
target?: string | undefined;
|
|
370
370
|
type?: string | undefined;
|
|
371
371
|
useMap?: string | undefined;
|
|
@@ -12,6 +12,7 @@ export declare namespace DSMenuItemsActionT {
|
|
|
12
12
|
optionsShouldHavePadding: boolean;
|
|
13
13
|
tabIndex: 0 | -1 | '0' | '-1';
|
|
14
14
|
applyAriaDisabled: boolean;
|
|
15
|
+
as: keyof JSX.IntrinsicElements;
|
|
15
16
|
};
|
|
16
17
|
type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsActionT.InternalProps> & {
|
|
17
18
|
secondaryLabel?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-menu-items-action",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.42.0-rc.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Menu Items Action",
|
|
6
6
|
"files": [
|
|
@@ -37,16 +37,16 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@xstyled/styled-components": "~3.6.0",
|
|
40
|
-
"@elliemae/ds-button": "3.
|
|
41
|
-
"@elliemae/ds-grid": "3.
|
|
42
|
-
"@elliemae/ds-
|
|
43
|
-
"@elliemae/ds-
|
|
44
|
-
"@elliemae/ds-
|
|
40
|
+
"@elliemae/ds-button": "3.42.0-rc.0",
|
|
41
|
+
"@elliemae/ds-grid": "3.42.0-rc.0",
|
|
42
|
+
"@elliemae/ds-menu-items-commons": "3.42.0-rc.0",
|
|
43
|
+
"@elliemae/ds-system": "3.42.0-rc.0",
|
|
44
|
+
"@elliemae/ds-props-helpers": "3.42.0-rc.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"lodash": "^4.17.21",
|
|
48
48
|
"styled-components": "~5.3.9",
|
|
49
|
-
"@elliemae/ds-monorepo-devops": "3.
|
|
49
|
+
"@elliemae/ds-monorepo-devops": "3.42.0-rc.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@testing-library/jest-dom": "~5.16.4",
|