@elliemae/ds-menu-items-single 3.27.0-next.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/cjs/DSMenuItemsSingle.js +106 -0
  2. package/dist/cjs/DSMenuItemsSingle.js.map +7 -0
  3. package/dist/cjs/config/useMenuItemsSingle.js +59 -0
  4. package/dist/cjs/config/useMenuItemsSingle.js.map +7 -0
  5. package/dist/cjs/config/useValidateProps.js +41 -0
  6. package/dist/cjs/config/useValidateProps.js.map +7 -0
  7. package/dist/cjs/constants/index.js +25 -0
  8. package/dist/cjs/constants/index.js.map +7 -0
  9. package/dist/cjs/index.js +38 -0
  10. package/dist/cjs/index.js.map +7 -0
  11. package/dist/cjs/package.json +7 -0
  12. package/dist/cjs/react-desc-prop-types.js +79 -0
  13. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  14. package/dist/esm/DSMenuItemsSingle.js +81 -0
  15. package/dist/esm/DSMenuItemsSingle.js.map +7 -0
  16. package/dist/esm/config/useMenuItemsSingle.js +29 -0
  17. package/dist/esm/config/useMenuItemsSingle.js.map +7 -0
  18. package/dist/esm/config/useValidateProps.js +11 -0
  19. package/dist/esm/config/useValidateProps.js.map +7 -0
  20. package/dist/esm/constants/index.js +2 -0
  21. package/dist/esm/constants/index.js.map +7 -0
  22. package/dist/esm/index.js +8 -0
  23. package/dist/esm/index.js.map +7 -0
  24. package/dist/esm/package.json +7 -0
  25. package/dist/esm/react-desc-prop-types.js +52 -0
  26. package/dist/esm/react-desc-prop-types.js.map +7 -0
  27. package/dist/types/DSMenuItemsSingle.d.ts +5 -0
  28. package/dist/types/config/useMenuItemsSingle.d.ts +13 -0
  29. package/dist/types/config/useValidateProps.d.ts +3 -0
  30. package/dist/types/constants/index.d.ts +0 -0
  31. package/dist/types/index.d.ts +2 -0
  32. package/dist/types/react-desc-prop-types.d.ts +29 -0
  33. package/package.json +75 -0
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var DSMenuItemsSingle_exports = {};
30
+ __export(DSMenuItemsSingle_exports, {
31
+ DSMenuItemsSingle: () => DSMenuItemsSingle,
32
+ DSMenuItemsSingleWithSchema: () => DSMenuItemsSingleWithSchema
33
+ });
34
+ module.exports = __toCommonJS(DSMenuItemsSingle_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var import_react = __toESM(require("react"));
38
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
39
+ var import_ds_menu_items_commons = require("@elliemae/ds-menu-items-commons");
40
+ var import_ds_icons = require("@elliemae/ds-icons");
41
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
42
+ var import_useMenuItemsSingle = require("./config/useMenuItemsSingle.js");
43
+ const DSMenuItemsSingle = (props) => {
44
+ const { propsWithDefault, globalProps, xstyledProps } = (0, import_useMenuItemsSingle.useMenuItemsSingle)(props);
45
+ const {
46
+ dsId,
47
+ label,
48
+ secondaryLabel,
49
+ isSelected,
50
+ onClick,
51
+ isActive,
52
+ innerRef,
53
+ onMouseDown,
54
+ onMouseEnter,
55
+ onMouseLeave,
56
+ wrapperStyles,
57
+ render: Render,
58
+ dataTestid,
59
+ disabled
60
+ } = propsWithDefault;
61
+ const onMouseDownHandler = import_react.default.useCallback(
62
+ (e) => {
63
+ if (disabled)
64
+ return;
65
+ onMouseDown?.(e);
66
+ },
67
+ [disabled, onMouseDown]
68
+ );
69
+ const gridLayout = import_react.default.useMemo(() => {
70
+ const cols = ["16px", "auto"];
71
+ if (secondaryLabel)
72
+ cols.push("min-content");
73
+ return cols;
74
+ }, [secondaryLabel]);
75
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
76
+ import_ds_menu_items_commons.StyledGlobalMenuItemWrapper,
77
+ {
78
+ "aria-selected": isSelected,
79
+ id: dsId,
80
+ role: "option",
81
+ isActive,
82
+ isSelected,
83
+ onClick,
84
+ innerRef,
85
+ onMouseDown: onMouseDownHandler,
86
+ onMouseEnter,
87
+ onMouseLeave,
88
+ className: isActive ? "ds-list-item-active" : "",
89
+ style: wrapperStyles,
90
+ "data-testid": dataTestid,
91
+ disabled,
92
+ "data-type": "single",
93
+ ...globalProps,
94
+ ...xstyledProps,
95
+ children: Render !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Render, { ...propsWithDefault }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_menu_items_commons.StyledContentWrapper, { cols: gridLayout, minHeight: "16px", gutter: "xxs", alignItems: "center", children: [
96
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.Checkmark, { size: "s", color: ["brand-primary", "600"] }) }),
97
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_menu_items_commons.StyleMenuItemLabel, { children: label }),
98
+ secondaryLabel !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_menu_items_commons.StyleMenuItemSecondaryLabel, { children: secondaryLabel })
99
+ ] })
100
+ }
101
+ );
102
+ };
103
+ DSMenuItemsSingle.displayName = "DSSingleMenuItem";
104
+ const DSMenuItemsSingleWithSchema = (0, import_ds_props_helpers.describe)(DSMenuItemsSingle);
105
+ DSMenuItemsSingleWithSchema.propTypes = import_react_desc_prop_types.DSMenuItemsSinglePropTypesSchema;
106
+ //# sourceMappingURL=DSMenuItemsSingle.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/DSMenuItemsSingle.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 { Checkmark } from '@elliemae/ds-icons';\nimport { type DSMenuItemsSingleT, DSMenuItemsSinglePropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsSingle } from './config/useMenuItemsSingle.js';\n\nconst DSMenuItemsSingle: React.ComponentType<DSMenuItemsSingleT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useMenuItemsSingle(props);\n const {\n dsId,\n label,\n secondaryLabel,\n isSelected,\n onClick,\n isActive,\n innerRef,\n onMouseDown,\n onMouseEnter,\n onMouseLeave,\n wrapperStyles,\n render: Render,\n dataTestid,\n disabled,\n } = propsWithDefault;\n\n const onMouseDownHandler = React.useCallback(\n (e: React.MouseEvent) => {\n if (disabled) return;\n onMouseDown?.(e);\n },\n [disabled, onMouseDown],\n );\n\n const gridLayout = React.useMemo(() => {\n const cols = ['16px', 'auto'];\n if (secondaryLabel) cols.push('min-content');\n return cols;\n }, [secondaryLabel]);\n\n return (\n <StyledGlobalMenuItemWrapper\n aria-selected={isSelected}\n id={dsId}\n role=\"option\"\n isActive={isActive}\n isSelected={isSelected}\n onClick={onClick}\n innerRef={innerRef}\n onMouseDown={onMouseDownHandler}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n className={isActive ? 'ds-list-item-active' : ''}\n style={wrapperStyles}\n data-testid={dataTestid}\n disabled={disabled}\n data-type=\"single\"\n {...globalProps}\n {...xstyledProps}\n >\n {Render !== undefined ? (\n <Render {...propsWithDefault} />\n ) : (\n <StyledContentWrapper cols={gridLayout} minHeight=\"16px\" gutter=\"xxs\" alignItems=\"center\">\n <div>{isSelected && <Checkmark size=\"s\" color={['brand-primary', '600']} />}</div>\n <StyleMenuItemLabel>{label}</StyleMenuItemLabel>\n {secondaryLabel !== undefined && <StyleMenuItemSecondaryLabel>{secondaryLabel}</StyleMenuItemSecondaryLabel>}\n </StyledContentWrapper>\n )}\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// this is `'DSSingleMenuItem'` for legacy reasons, when moving to inheritance pattern this has been kept as it was to avoid complications\nDSMenuItemsSingle.displayName = 'DSSingleMenuItem';\nconst DSMenuItemsSingleWithSchema = describe(DSMenuItemsSingle);\nDSMenuItemsSingleWithSchema.propTypes = DSMenuItemsSinglePropTypesSchema;\n\nexport { DSMenuItemsSingle, DSMenuItemsSingleWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkEf;AAlER,mBAAkB;AAClB,8BAAyB;AACzB,mCAKO;AACP,sBAA0B;AAC1B,mCAA0E;AAC1E,gCAAmC;AAEnC,MAAM,oBAAmE,CAAC,UAAU;AAClF,QAAM,EAAE,kBAAkB,aAAa,aAAa,QAAI,8CAAmB,KAAK;AAChF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;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,qBAAqB,aAAAA,QAAM;AAAA,IAC/B,CAAC,MAAwB;AACvB,UAAI;AAAU;AACd,oBAAc,CAAC;AAAA,IACjB;AAAA,IACA,CAAC,UAAU,WAAW;AAAA,EACxB;AAEA,QAAM,aAAa,aAAAA,QAAM,QAAQ,MAAM;AACrC,UAAM,OAAO,CAAC,QAAQ,MAAM;AAC5B,QAAI;AAAgB,WAAK,KAAK,aAAa;AAC3C,WAAO;AAAA,EACT,GAAG,CAAC,cAAc,CAAC;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,iBAAe;AAAA,MACf,IAAI;AAAA,MACJ,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA,WAAW,WAAW,wBAAwB;AAAA,MAC9C,OAAO;AAAA,MACP,eAAa;AAAA,MACb;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA,MACH,GAAG;AAAA,MAEH,qBAAW,SACV,4CAAC,UAAQ,GAAG,kBAAkB,IAE9B,6CAAC,qDAAqB,MAAM,YAAY,WAAU,QAAO,QAAO,OAAM,YAAW,UAC/E;AAAA,oDAAC,SAAK,wBAAc,4CAAC,6BAAU,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAG,GAAG;AAAA,QAC5E,4CAAC,mDAAoB,iBAAM;AAAA,QAC1B,mBAAmB,UAAa,4CAAC,4DAA6B,0BAAe;AAAA,SAChF;AAAA;AAAA,EAEJ;AAEJ;AAGA,kBAAkB,cAAc;AAChC,MAAM,kCAA8B,kCAAS,iBAAiB;AAC9D,4BAA4B,YAAY;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useMenuItemsSingle_exports = {};
30
+ __export(useMenuItemsSingle_exports, {
31
+ useMenuItemsSingle: () => useMenuItemsSingle
32
+ });
33
+ module.exports = __toCommonJS(useMenuItemsSingle_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_react = __toESM(require("react"));
36
+ var import_lodash = require("lodash");
37
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
+ var import_react_desc_prop_types = require("../react-desc-prop-types.js");
39
+ var import_useValidateProps = require("./useValidateProps.js");
40
+ const useMenuItemsSingle = (propsFromUser) => {
41
+ const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(propsFromUser, import_react_desc_prop_types.defaultProps);
42
+ (0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSMenuItemsSinglePropTypes);
43
+ const sourceGlobalProps = propsWithDefault.original ?? propsWithDefault;
44
+ const globalProps = (0, import_lodash.omit)((0, import_ds_props_helpers.useGetGlobalAttributes)(sourceGlobalProps), [
45
+ "cols",
46
+ "rows",
47
+ "wrap"
48
+ ]);
49
+ const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(sourceGlobalProps);
50
+ return import_react.default.useMemo(
51
+ () => ({
52
+ propsWithDefault,
53
+ globalProps,
54
+ xstyledProps
55
+ }),
56
+ [propsWithDefault, globalProps, xstyledProps]
57
+ );
58
+ };
59
+ //# sourceMappingURL=useMenuItemsSingle.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/config/useMenuItemsSingle.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport { omit } from 'lodash';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { type DSMenuItemsSingleT, DSMenuItemsSinglePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface MenuItemsSingleCTX {\n propsWithDefault: DSMenuItemsSingleT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n}\n\nexport const useMenuItemsSingle = (propsFromUser: DSMenuItemsSingleT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSMenuItemsSingleT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSMenuItemsSinglePropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n\n // menuitems use original prop from dsdropdownmenu or dscombobox\n // We may want to review if this is required or makes sense, but for now we will keep it to avoid breaking changes\n const sourceGlobalProps =\n (propsWithDefault.original as unknown as DSMenuItemsSingleT.InternalProps) ?? propsWithDefault;\n\n const globalProps = omit(useGetGlobalAttributes<DSMenuItemsSingleT.InternalProps>(sourceGlobalProps), [\n 'cols',\n 'rows',\n 'wrap',\n ]);\n const xstyledProps = useGetXstyledProps(sourceGlobalProps);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n }),\n [propsWithDefault, globalProps, xstyledProps],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,oBAAqB;AACrB,8BAAyF;AACzF,mCAAkF;AAClF,8BAAiC;AAQ1B,MAAM,qBAAqB,CAAC,kBAA4C;AAI7E,QAAM,uBAAmB,sDAA+D,eAAe,yCAAY;AACnH,gDAAiB,kBAAkB,uDAA0B;AAO7D,QAAM,oBACH,iBAAiB,YAA4D;AAEhF,QAAM,kBAAc,wBAAK,gDAAyD,iBAAiB,GAAG;AAAA,IACpG;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,mBAAe,4CAAmB,iBAAiB;AAEzD,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,aAAa,YAAY;AAAA,EAC9C;AACF;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useValidateProps_exports = {};
30
+ __export(useValidateProps_exports, {
31
+ useValidateProps: () => useValidateProps
32
+ });
33
+ module.exports = __toCommonJS(useValidateProps_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
36
+ var import_ds_menu_items_commons = require("@elliemae/ds-menu-items-commons");
37
+ const DSMenuItemsSingleName = `${import_ds_menu_items_commons.DSMenuItemName}Single`;
38
+ const useValidateProps = (props, propTypes) => {
39
+ (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, DSMenuItemsSingleName);
40
+ };
41
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/config/useValidateProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { DSMenuItemName } from '@elliemae/ds-menu-items-commons';\nimport type { WeakValidationMap } from 'react';\nimport { type DSMenuItemsSingleT } from '../react-desc-prop-types.js';\n\n// because this is inherited from the common props, we do not want to put this in the /constants/index.ts file\n// this is strictly defined here because this is meant to strictly influence ONLY the ERROR layer\n// this is 100% decoupled from ds-slots & data-testid\n// this constants only affect the shown error message as of 21/december/2023\nconst DSMenuItemsSingleName = `${DSMenuItemName}Single`;\n\nexport const useValidateProps = (\n props: DSMenuItemsSingleT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsSingleName);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAC/C,mCAA+B;AAQ/B,MAAM,wBAAwB,GAAG;AAE1B,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,8DAA+B,OAAO,WAAW,qBAAqB;AACxE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var React = __toESM(require("react"));
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var src_exports = {};
30
+ __export(src_exports, {
31
+ DSMenuItemsSingle: () => import_DSMenuItemsSingle.DSMenuItemsSingle,
32
+ DSMenuItemsSingleWithSchema: () => import_DSMenuItemsSingle.DSMenuItemsSingleWithSchema
33
+ });
34
+ module.exports = __toCommonJS(src_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_DSMenuItemsSingle = require("./DSMenuItemsSingle.js");
37
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSMenuItemsSingle, DSMenuItemsSingleWithSchema } from './DSMenuItemsSingle.js';\nexport { type DSMenuItemsSingleT } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,+BAA+D;AAC/D,mCAAwC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "commonjs",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var react_desc_prop_types_exports = {};
30
+ __export(react_desc_prop_types_exports, {
31
+ DSMenuItemsSinglePropTypes: () => DSMenuItemsSinglePropTypes,
32
+ DSMenuItemsSinglePropTypesSchema: () => DSMenuItemsSinglePropTypesSchema,
33
+ defaultProps: () => defaultProps
34
+ });
35
+ module.exports = __toCommonJS(react_desc_prop_types_exports);
36
+ var React = __toESM(require("react"));
37
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
+ var import_ds_menu_items_commons = require("@elliemae/ds-menu-items-commons");
39
+ const defaultProps = {
40
+ ...import_ds_menu_items_commons.DSMenuItemsCommonsDefaultProps,
41
+ label: "",
42
+ isActive: false,
43
+ disabled: false,
44
+ isSelected: false,
45
+ onClick: () => {
46
+ },
47
+ onMouseDown: () => {
48
+ },
49
+ onMouseEnter: () => {
50
+ },
51
+ onMouseLeave: () => {
52
+ },
53
+ dataTestid: "ds-menu-item",
54
+ // in legacy code for some reasons this was explicitly set in the defaultProps...
55
+ tabIndex: 0
56
+ };
57
+ const { tabIndex, label, value, ...notOvverriddenCommonPropsTypes } = import_ds_props_helpers.globalAttributesPropTypes;
58
+ const DSMenuItemsSinglePropTypes = {
59
+ // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps
60
+ // they are NOT inherited from a common element from ds-menu-items-commons
61
+ ...notOvverriddenCommonPropsTypes,
62
+ ...import_ds_props_helpers.xstyledPropTypes,
63
+ ...import_ds_menu_items_commons.DSMenuItemsCommonsPropTypes,
64
+ // TODO - add support to PropTypes.oneOf for typeof number
65
+ // currently PropTypes.oneOf([0, -1]) is not supported
66
+ tabIndex: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.number, import_ds_props_helpers.PropTypes.string]).description(
67
+ "The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed."
68
+ ),
69
+ label: import_ds_props_helpers.PropTypes.string.description("The label of the menu item."),
70
+ value: import_ds_props_helpers.PropTypes.any.description("The value of the menu item."),
71
+ isActive: import_ds_props_helpers.PropTypes.bool.description("Whether the menu item is active."),
72
+ secondaryLabel: import_ds_props_helpers.PropTypes.string.description("The secondary label of the menu item."),
73
+ disabled: import_ds_props_helpers.PropTypes.bool.description("Whether the menu item is disabled."),
74
+ isSelected: import_ds_props_helpers.PropTypes.bool.description("Whether the menu item is selected."),
75
+ dataTestid: import_ds_props_helpers.PropTypes.string.description("A custom data-testid for your e2e testing")
76
+ // in legacy code for some reasons this was explicitly set in the defaultProps...
77
+ };
78
+ const DSMenuItemsSinglePropTypesSchema = DSMenuItemsSinglePropTypes;
79
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 {\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 DSMenuItemsSingleT {\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 isActive: boolean;\n disabled: boolean;\n isSelected: boolean;\n onClick: React.MouseEventHandler;\n onMouseDown: React.MouseEventHandler;\n onMouseEnter: React.MouseEventHandler;\n onMouseLeave: React.MouseEventHandler;\n dataTestid: string;\n tabIndex: number;\n };\n\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsSingleT.InternalProps> & {\n secondaryLabel?: string;\n value?: unknown; // for some reason, legacy code says this is optional...\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: DSMenuItemsSingleT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n label: '',\n isActive: false,\n disabled: false,\n isSelected: false,\n onClick: () => {},\n onMouseDown: () => {},\n onMouseEnter: () => {},\n onMouseLeave: () => {},\n dataTestid: 'ds-menu-item', // in legacy code for some reasons this was explicitly set in the defaultProps...\n tabIndex: 0,\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 DSMenuItemsSinglePropTypes: DSPropTypesSchema<DSMenuItemsSingleT.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 // 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 secondaryLabel: PropTypes.string.description('The secondary label of the menu item.'),\n disabled: PropTypes.bool.description('Whether the menu item is disabled.'),\n isSelected: PropTypes.bool.description('Whether the menu item is selected.'),\n dataTestid: PropTypes.string.description('A custom data-testid for your e2e testing'), // in legacy code for some reasons this was explicitly set in the defaultProps...\n};\n\nexport const DSMenuItemsSinglePropTypesSchema =\n DSMenuItemsSinglePropTypes as unknown as WeakValidationMap<DSMenuItemsSingleT.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;AAiDA,MAAM,eAAgD;AAAA,EAC3D,GAAG;AAAA,EACH,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,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;AAAA,EACZ,UAAU;AACZ;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,EAGH,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,gBAAgB,kCAAU,OAAO,YAAY,uCAAuC;AAAA,EACpF,UAAU,kCAAU,KAAK,YAAY,oCAAoC;AAAA,EACzE,YAAY,kCAAU,KAAK,YAAY,oCAAoC;AAAA,EAC3E,YAAY,kCAAU,OAAO,YAAY,2CAA2C;AAAA;AACtF;AAEO,MAAM,mCACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,81 @@
1
+ import * as React from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import React2 from "react";
4
+ import { describe } from "@elliemae/ds-props-helpers";
5
+ import {
6
+ StyledGlobalMenuItemWrapper,
7
+ StyledContentWrapper,
8
+ StyleMenuItemLabel,
9
+ StyleMenuItemSecondaryLabel
10
+ } from "@elliemae/ds-menu-items-commons";
11
+ import { Checkmark } from "@elliemae/ds-icons";
12
+ import { DSMenuItemsSinglePropTypesSchema } from "./react-desc-prop-types.js";
13
+ import { useMenuItemsSingle } from "./config/useMenuItemsSingle.js";
14
+ const DSMenuItemsSingle = (props) => {
15
+ const { propsWithDefault, globalProps, xstyledProps } = useMenuItemsSingle(props);
16
+ const {
17
+ dsId,
18
+ label,
19
+ secondaryLabel,
20
+ isSelected,
21
+ onClick,
22
+ isActive,
23
+ innerRef,
24
+ onMouseDown,
25
+ onMouseEnter,
26
+ onMouseLeave,
27
+ wrapperStyles,
28
+ render: Render,
29
+ dataTestid,
30
+ disabled
31
+ } = propsWithDefault;
32
+ const onMouseDownHandler = React2.useCallback(
33
+ (e) => {
34
+ if (disabled)
35
+ return;
36
+ onMouseDown?.(e);
37
+ },
38
+ [disabled, onMouseDown]
39
+ );
40
+ const gridLayout = React2.useMemo(() => {
41
+ const cols = ["16px", "auto"];
42
+ if (secondaryLabel)
43
+ cols.push("min-content");
44
+ return cols;
45
+ }, [secondaryLabel]);
46
+ return /* @__PURE__ */ jsx(
47
+ StyledGlobalMenuItemWrapper,
48
+ {
49
+ "aria-selected": isSelected,
50
+ id: dsId,
51
+ role: "option",
52
+ isActive,
53
+ isSelected,
54
+ onClick,
55
+ innerRef,
56
+ onMouseDown: onMouseDownHandler,
57
+ onMouseEnter,
58
+ onMouseLeave,
59
+ className: isActive ? "ds-list-item-active" : "",
60
+ style: wrapperStyles,
61
+ "data-testid": dataTestid,
62
+ disabled,
63
+ "data-type": "single",
64
+ ...globalProps,
65
+ ...xstyledProps,
66
+ children: Render !== void 0 ? /* @__PURE__ */ jsx(Render, { ...propsWithDefault }) : /* @__PURE__ */ jsxs(StyledContentWrapper, { cols: gridLayout, minHeight: "16px", gutter: "xxs", alignItems: "center", children: [
67
+ /* @__PURE__ */ jsx("div", { children: isSelected && /* @__PURE__ */ jsx(Checkmark, { size: "s", color: ["brand-primary", "600"] }) }),
68
+ /* @__PURE__ */ jsx(StyleMenuItemLabel, { children: label }),
69
+ secondaryLabel !== void 0 && /* @__PURE__ */ jsx(StyleMenuItemSecondaryLabel, { children: secondaryLabel })
70
+ ] })
71
+ }
72
+ );
73
+ };
74
+ DSMenuItemsSingle.displayName = "DSSingleMenuItem";
75
+ const DSMenuItemsSingleWithSchema = describe(DSMenuItemsSingle);
76
+ DSMenuItemsSingleWithSchema.propTypes = DSMenuItemsSinglePropTypesSchema;
77
+ export {
78
+ DSMenuItemsSingle,
79
+ DSMenuItemsSingleWithSchema
80
+ };
81
+ //# sourceMappingURL=DSMenuItemsSingle.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSMenuItemsSingle.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 { Checkmark } from '@elliemae/ds-icons';\nimport { type DSMenuItemsSingleT, DSMenuItemsSinglePropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsSingle } from './config/useMenuItemsSingle.js';\n\nconst DSMenuItemsSingle: React.ComponentType<DSMenuItemsSingleT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useMenuItemsSingle(props);\n const {\n dsId,\n label,\n secondaryLabel,\n isSelected,\n onClick,\n isActive,\n innerRef,\n onMouseDown,\n onMouseEnter,\n onMouseLeave,\n wrapperStyles,\n render: Render,\n dataTestid,\n disabled,\n } = propsWithDefault;\n\n const onMouseDownHandler = React.useCallback(\n (e: React.MouseEvent) => {\n if (disabled) return;\n onMouseDown?.(e);\n },\n [disabled, onMouseDown],\n );\n\n const gridLayout = React.useMemo(() => {\n const cols = ['16px', 'auto'];\n if (secondaryLabel) cols.push('min-content');\n return cols;\n }, [secondaryLabel]);\n\n return (\n <StyledGlobalMenuItemWrapper\n aria-selected={isSelected}\n id={dsId}\n role=\"option\"\n isActive={isActive}\n isSelected={isSelected}\n onClick={onClick}\n innerRef={innerRef}\n onMouseDown={onMouseDownHandler}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n className={isActive ? 'ds-list-item-active' : ''}\n style={wrapperStyles}\n data-testid={dataTestid}\n disabled={disabled}\n data-type=\"single\"\n {...globalProps}\n {...xstyledProps}\n >\n {Render !== undefined ? (\n <Render {...propsWithDefault} />\n ) : (\n <StyledContentWrapper cols={gridLayout} minHeight=\"16px\" gutter=\"xxs\" alignItems=\"center\">\n <div>{isSelected && <Checkmark size=\"s\" color={['brand-primary', '600']} />}</div>\n <StyleMenuItemLabel>{label}</StyleMenuItemLabel>\n {secondaryLabel !== undefined && <StyleMenuItemSecondaryLabel>{secondaryLabel}</StyleMenuItemSecondaryLabel>}\n </StyledContentWrapper>\n )}\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// this is `'DSSingleMenuItem'` for legacy reasons, when moving to inheritance pattern this has been kept as it was to avoid complications\nDSMenuItemsSingle.displayName = 'DSSingleMenuItem';\nconst DSMenuItemsSingleWithSchema = describe(DSMenuItemsSingle);\nDSMenuItemsSingleWithSchema.propTypes = DSMenuItemsSinglePropTypesSchema;\n\nexport { DSMenuItemsSingle, DSMenuItemsSingleWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACkEf,cAEA,YAFA;AAlER,OAAOA,YAAW;AAClB,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAC1B,SAAkC,wCAAwC;AAC1E,SAAS,0BAA0B;AAEnC,MAAM,oBAAmE,CAAC,UAAU;AAClF,QAAM,EAAE,kBAAkB,aAAa,aAAa,IAAI,mBAAmB,KAAK;AAChF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;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,qBAAqBA,OAAM;AAAA,IAC/B,CAAC,MAAwB;AACvB,UAAI;AAAU;AACd,oBAAc,CAAC;AAAA,IACjB;AAAA,IACA,CAAC,UAAU,WAAW;AAAA,EACxB;AAEA,QAAM,aAAaA,OAAM,QAAQ,MAAM;AACrC,UAAM,OAAO,CAAC,QAAQ,MAAM;AAC5B,QAAI;AAAgB,WAAK,KAAK,aAAa;AAC3C,WAAO;AAAA,EACT,GAAG,CAAC,cAAc,CAAC;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,iBAAe;AAAA,MACf,IAAI;AAAA,MACJ,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA,WAAW,WAAW,wBAAwB;AAAA,MAC9C,OAAO;AAAA,MACP,eAAa;AAAA,MACb;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA,MACH,GAAG;AAAA,MAEH,qBAAW,SACV,oBAAC,UAAQ,GAAG,kBAAkB,IAE9B,qBAAC,wBAAqB,MAAM,YAAY,WAAU,QAAO,QAAO,OAAM,YAAW,UAC/E;AAAA,4BAAC,SAAK,wBAAc,oBAAC,aAAU,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAG,GAAG;AAAA,QAC5E,oBAAC,sBAAoB,iBAAM;AAAA,QAC1B,mBAAmB,UAAa,oBAAC,+BAA6B,0BAAe;AAAA,SAChF;AAAA;AAAA,EAEJ;AAEJ;AAGA,kBAAkB,cAAc;AAChC,MAAM,8BAA8B,SAAS,iBAAiB;AAC9D,4BAA4B,YAAY;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { omit } from "lodash";
4
+ import { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
5
+ import { DSMenuItemsSinglePropTypes, defaultProps } from "../react-desc-prop-types.js";
6
+ import { useValidateProps } from "./useValidateProps.js";
7
+ const useMenuItemsSingle = (propsFromUser) => {
8
+ const propsWithDefault = useMemoMergePropsWithDefault(propsFromUser, defaultProps);
9
+ useValidateProps(propsWithDefault, DSMenuItemsSinglePropTypes);
10
+ const sourceGlobalProps = propsWithDefault.original ?? propsWithDefault;
11
+ const globalProps = omit(useGetGlobalAttributes(sourceGlobalProps), [
12
+ "cols",
13
+ "rows",
14
+ "wrap"
15
+ ]);
16
+ const xstyledProps = useGetXstyledProps(sourceGlobalProps);
17
+ return React2.useMemo(
18
+ () => ({
19
+ propsWithDefault,
20
+ globalProps,
21
+ xstyledProps
22
+ }),
23
+ [propsWithDefault, globalProps, xstyledProps]
24
+ );
25
+ };
26
+ export {
27
+ useMenuItemsSingle
28
+ };
29
+ //# sourceMappingURL=useMenuItemsSingle.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useMenuItemsSingle.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { omit } from 'lodash';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { type DSMenuItemsSingleT, DSMenuItemsSinglePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface MenuItemsSingleCTX {\n propsWithDefault: DSMenuItemsSingleT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n}\n\nexport const useMenuItemsSingle = (propsFromUser: DSMenuItemsSingleT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSMenuItemsSingleT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSMenuItemsSinglePropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n\n // menuitems use original prop from dsdropdownmenu or dscombobox\n // We may want to review if this is required or makes sense, but for now we will keep it to avoid breaking changes\n const sourceGlobalProps =\n (propsWithDefault.original as unknown as DSMenuItemsSingleT.InternalProps) ?? propsWithDefault;\n\n const globalProps = omit(useGetGlobalAttributes<DSMenuItemsSingleT.InternalProps>(sourceGlobalProps), [\n 'cols',\n 'rows',\n 'wrap',\n ]);\n const xstyledProps = useGetXstyledProps(sourceGlobalProps);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n }),\n [propsWithDefault, globalProps, xstyledProps],\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,YAAY;AACrB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAkC,4BAA4B,oBAAoB;AAClF,SAAS,wBAAwB;AAQ1B,MAAM,qBAAqB,CAAC,kBAA4C;AAI7E,QAAM,mBAAmB,6BAA+D,eAAe,YAAY;AACnH,mBAAiB,kBAAkB,0BAA0B;AAO7D,QAAM,oBACH,iBAAiB,YAA4D;AAEhF,QAAM,cAAc,KAAK,uBAAyD,iBAAiB,GAAG;AAAA,IACpG;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,eAAe,mBAAmB,iBAAiB;AAEzD,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,aAAa,YAAY;AAAA,EAC9C;AACF;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
3
+ import { DSMenuItemName } from "@elliemae/ds-menu-items-commons";
4
+ const DSMenuItemsSingleName = `${DSMenuItemName}Single`;
5
+ const useValidateProps = (props, propTypes) => {
6
+ useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsSingleName);
7
+ };
8
+ export {
9
+ useValidateProps
10
+ };
11
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { DSMenuItemName } from '@elliemae/ds-menu-items-commons';\nimport type { WeakValidationMap } from 'react';\nimport { type DSMenuItemsSingleT } from '../react-desc-prop-types.js';\n\n// because this is inherited from the common props, we do not want to put this in the /constants/index.ts file\n// this is strictly defined here because this is meant to strictly influence ONLY the ERROR layer\n// this is 100% decoupled from ds-slots & data-testid\n// this constants only affect the shown error message as of 21/december/2023\nconst DSMenuItemsSingleName = `${DSMenuItemName}Single`;\n\nexport const useValidateProps = (\n props: DSMenuItemsSingleT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsSingleName);\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAC/C,SAAS,sBAAsB;AAQ/B,MAAM,wBAAwB,GAAG;AAE1B,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,qBAAqB;AACxE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import * as React from "react";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import { DSMenuItemsSingle, DSMenuItemsSingleWithSchema } from "./DSMenuItemsSingle.js";
3
+ import {} from "./react-desc-prop-types.js";
4
+ export {
5
+ DSMenuItemsSingle,
6
+ DSMenuItemsSingleWithSchema
7
+ };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSMenuItemsSingle, DSMenuItemsSingleWithSchema } from './DSMenuItemsSingle.js';\nexport { type DSMenuItemsSingleT } from './react-desc-prop-types.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,mBAAmB,mCAAmC;AAC/D,eAAwC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,52 @@
1
+ import * as React from "react";
2
+ import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-props-helpers";
3
+ import {
4
+ DSMenuItemsCommonsPropTypes,
5
+ DSMenuItemsCommonsDefaultProps
6
+ } from "@elliemae/ds-menu-items-commons";
7
+ const defaultProps = {
8
+ ...DSMenuItemsCommonsDefaultProps,
9
+ label: "",
10
+ isActive: false,
11
+ disabled: false,
12
+ isSelected: false,
13
+ onClick: () => {
14
+ },
15
+ onMouseDown: () => {
16
+ },
17
+ onMouseEnter: () => {
18
+ },
19
+ onMouseLeave: () => {
20
+ },
21
+ dataTestid: "ds-menu-item",
22
+ // in legacy code for some reasons this was explicitly set in the defaultProps...
23
+ tabIndex: 0
24
+ };
25
+ const { tabIndex, label, value, ...notOvverriddenCommonPropsTypes } = globalAttributesPropTypes;
26
+ const DSMenuItemsSinglePropTypes = {
27
+ // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps
28
+ // they are NOT inherited from a common element from ds-menu-items-commons
29
+ ...notOvverriddenCommonPropsTypes,
30
+ ...xstyledPropTypes,
31
+ ...DSMenuItemsCommonsPropTypes,
32
+ // TODO - add support to PropTypes.oneOf for typeof number
33
+ // currently PropTypes.oneOf([0, -1]) is not supported
34
+ tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description(
35
+ "The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed."
36
+ ),
37
+ label: PropTypes.string.description("The label of the menu item."),
38
+ value: PropTypes.any.description("The value of the menu item."),
39
+ isActive: PropTypes.bool.description("Whether the menu item is active."),
40
+ secondaryLabel: PropTypes.string.description("The secondary label of the menu item."),
41
+ disabled: PropTypes.bool.description("Whether the menu item is disabled."),
42
+ isSelected: PropTypes.bool.description("Whether the menu item is selected."),
43
+ dataTestid: PropTypes.string.description("A custom data-testid for your e2e testing")
44
+ // in legacy code for some reasons this was explicitly set in the defaultProps...
45
+ };
46
+ const DSMenuItemsSinglePropTypesSchema = DSMenuItemsSinglePropTypes;
47
+ export {
48
+ DSMenuItemsSinglePropTypes,
49
+ DSMenuItemsSinglePropTypesSchema,
50
+ defaultProps
51
+ };
52
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 {\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 DSMenuItemsSingleT {\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 isActive: boolean;\n disabled: boolean;\n isSelected: boolean;\n onClick: React.MouseEventHandler;\n onMouseDown: React.MouseEventHandler;\n onMouseEnter: React.MouseEventHandler;\n onMouseLeave: React.MouseEventHandler;\n dataTestid: string;\n tabIndex: number;\n };\n\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsSingleT.InternalProps> & {\n secondaryLabel?: string;\n value?: unknown; // for some reason, legacy code says this is optional...\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: DSMenuItemsSingleT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n label: '',\n isActive: false,\n disabled: false,\n isSelected: false,\n onClick: () => {},\n onMouseDown: () => {},\n onMouseEnter: () => {},\n onMouseLeave: () => {},\n dataTestid: 'ds-menu-item', // in legacy code for some reasons this was explicitly set in the defaultProps...\n tabIndex: 0,\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 DSMenuItemsSinglePropTypes: DSPropTypesSchema<DSMenuItemsSingleT.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 // 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 secondaryLabel: PropTypes.string.description('The secondary label of the menu item.'),\n disabled: PropTypes.bool.description('Whether the menu item is disabled.'),\n isSelected: PropTypes.bool.description('Whether the menu item is selected.'),\n dataTestid: PropTypes.string.description('A custom data-testid for your e2e testing'), // in legacy code for some reasons this was explicitly set in the defaultProps...\n};\n\nexport const DSMenuItemsSinglePropTypesSchema =\n DSMenuItemsSinglePropTypes as unknown as WeakValidationMap<DSMenuItemsSingleT.Props>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AAiDA,MAAM,eAAgD;AAAA,EAC3D,GAAG;AAAA,EACH,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,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;AAAA,EACZ,UAAU;AACZ;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,EAGH,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,gBAAgB,UAAU,OAAO,YAAY,uCAAuC;AAAA,EACpF,UAAU,UAAU,KAAK,YAAY,oCAAoC;AAAA,EACzE,YAAY,UAAU,KAAK,YAAY,oCAAoC;AAAA,EAC3E,YAAY,UAAU,OAAO,YAAY,2CAA2C;AAAA;AACtF;AAEO,MAAM,mCACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { type DSMenuItemsSingleT } from './react-desc-prop-types.js';
3
+ declare const DSMenuItemsSingle: React.ComponentType<DSMenuItemsSingleT.Props>;
4
+ declare const DSMenuItemsSingleWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSMenuItemsSingleT.Props>;
5
+ export { DSMenuItemsSingle, DSMenuItemsSingleWithSchema };
@@ -0,0 +1,13 @@
1
+ /// <reference types="lodash" />
2
+ import { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';
3
+ import { type DSMenuItemsSingleT } from '../react-desc-prop-types.js';
4
+ export interface MenuItemsSingleCTX {
5
+ propsWithDefault: DSMenuItemsSingleT.InternalProps;
6
+ globalProps: ReturnType<typeof useGetGlobalAttributes>;
7
+ xstyledProps: ReturnType<typeof useGetXstyledProps>;
8
+ }
9
+ export declare const useMenuItemsSingle: (propsFromUser: DSMenuItemsSingleT.Props) => {
10
+ propsWithDefault: DSMenuItemsSingleT.InternalProps;
11
+ globalProps: import("lodash").Omit<import("@elliemae/ds-props-helpers").GlobalAttributesT<Element>, "cols" | "rows" | "wrap">;
12
+ xstyledProps: import("@elliemae/ds-props-helpers").XstyledProps;
13
+ };
@@ -0,0 +1,3 @@
1
+ import type { WeakValidationMap } from 'react';
2
+ import { type DSMenuItemsSingleT } from '../react-desc-prop-types.js';
3
+ export declare const useValidateProps: (props: DSMenuItemsSingleT.InternalProps, propTypes: WeakValidationMap<unknown>) => void;
File without changes
@@ -0,0 +1,2 @@
1
+ export { DSMenuItemsSingle, DSMenuItemsSingleWithSchema } from './DSMenuItemsSingle.js';
2
+ export { type DSMenuItemsSingleT } from './react-desc-prop-types.js';
@@ -0,0 +1,29 @@
1
+ import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';
2
+ import { type DSMenuItemsCommonsT } from '@elliemae/ds-menu-items-commons';
3
+ import type React from 'react';
4
+ export declare namespace DSMenuItemsSingleT {
5
+ type RequiredProps = DSMenuItemsCommonsT.RequiredProps;
6
+ type DefaultProps = DSMenuItemsCommonsT.DefaultProps & {
7
+ label: string;
8
+ isActive: boolean;
9
+ disabled: boolean;
10
+ isSelected: boolean;
11
+ onClick: React.MouseEventHandler;
12
+ onMouseDown: React.MouseEventHandler;
13
+ onMouseEnter: React.MouseEventHandler;
14
+ onMouseLeave: React.MouseEventHandler;
15
+ dataTestid: string;
16
+ tabIndex: number;
17
+ };
18
+ type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsSingleT.InternalProps> & {
19
+ secondaryLabel?: string;
20
+ value?: unknown;
21
+ };
22
+ interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps>, XstyledProps, RequiredProps {
23
+ }
24
+ interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps>, XstyledProps, RequiredProps {
25
+ }
26
+ }
27
+ export declare const defaultProps: DSMenuItemsSingleT.DefaultProps;
28
+ export declare const DSMenuItemsSinglePropTypes: DSPropTypesSchema<DSMenuItemsSingleT.InternalProps>;
29
+ export declare const DSMenuItemsSinglePropTypesSchema: React.WeakValidationMap<DSMenuItemsSingleT.Props>;
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "@elliemae/ds-menu-items-single",
3
+ "version": "3.27.0-next.11",
4
+ "license": "MIT",
5
+ "description": "ICE MT - Dimsum - Menu Items Single",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "module": "./dist/esm/index.js",
10
+ "main": "./dist/cjs/index.js",
11
+ "types": "./dist/types/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.js"
16
+ }
17
+ },
18
+ "sideEffects": [
19
+ "*.css",
20
+ "*.scss"
21
+ ],
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://git.elliemae.io/platform-ui/dimsum.git"
25
+ },
26
+ "engines": {
27
+ "pnpm": ">=6",
28
+ "node": ">=16"
29
+ },
30
+ "author": "ICE MT",
31
+ "jestSonar": {
32
+ "sonar56x": true,
33
+ "reportPath": "reports",
34
+ "reportFile": "tests.xml",
35
+ "indent": 4
36
+ },
37
+ "dependencies": {
38
+ "@xstyled/styled-components": "~3.6.0",
39
+ "@elliemae/ds-icons": "3.27.0-next.11",
40
+ "@elliemae/ds-menu-items-commons": "3.27.0-next.11",
41
+ "@elliemae/ds-props-helpers": "3.27.0-next.11",
42
+ "@elliemae/ds-utilities": "3.27.0-next.11",
43
+ "@elliemae/ds-system": "3.27.0-next.11"
44
+ },
45
+ "devDependencies": {
46
+ "lodash": "^4.17.21",
47
+ "styled-components": "~5.3.9",
48
+ "@elliemae/ds-monorepo-devops": "3.27.0-next.11"
49
+ },
50
+ "peerDependencies": {
51
+ "@testing-library/jest-dom": "~5.16.4",
52
+ "@testing-library/react": "~12.1.3",
53
+ "@testing-library/user-event": "~13.5.0",
54
+ "lodash": "^4.17.21",
55
+ "react": "^17.0.2",
56
+ "react-dom": "^17.0.2",
57
+ "styled-components": "~5.3.9"
58
+ },
59
+ "publishConfig": {
60
+ "access": "public",
61
+ "typeSafety": true
62
+ },
63
+ "scripts": {
64
+ "dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
65
+ "test": "pui-cli test --passWithNoTests",
66
+ "lint": "node ../../../scripts/lint.mjs --fix",
67
+ "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
68
+ "dts": "node ../../scripts/dts.mjs",
69
+ "dts:withdeps": "pnpm --filter {.}... dts",
70
+ "build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
71
+ "dev:build": "pnpm --filter {.}... build",
72
+ "dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
73
+ "checkDeps": "npx -yes ../../util/ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
74
+ }
75
+ }