@elliemae/ds-menu-items-section 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/DSMenuItemsSection.js +53 -0
  2. package/dist/cjs/DSMenuItemsSection.js.map +7 -0
  3. package/dist/cjs/config/useMenuItemsSection.js +58 -0
  4. package/dist/cjs/config/useMenuItemsSection.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 +60 -0
  13. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  14. package/dist/esm/DSMenuItemsSection.js +23 -0
  15. package/dist/esm/DSMenuItemsSection.js.map +7 -0
  16. package/dist/esm/config/useMenuItemsSection.js +28 -0
  17. package/dist/esm/config/useMenuItemsSection.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 +30 -0
  26. package/dist/esm/react-desc-prop-types.js.map +7 -0
  27. package/dist/types/DSMenuItemsSection.d.ts +5 -0
  28. package/dist/types/config/useMenuItemsSection.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 +26 -0
  33. package/package.json +76 -0
@@ -0,0 +1,53 @@
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 DSMenuItemsSection_exports = {};
30
+ __export(DSMenuItemsSection_exports, {
31
+ DSMenuItemsSection: () => DSMenuItemsSection,
32
+ DSMenuItemsSectionWithSchema: () => DSMenuItemsSectionWithSchema
33
+ });
34
+ module.exports = __toCommonJS(DSMenuItemsSection_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_jsx_runtime = require("react/jsx-runtime");
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
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
40
+ var import_useMenuItemsSection = require("./config/useMenuItemsSection.js");
41
+ const DSMenuItemsSection = (props) => {
42
+ const {
43
+ // propsWithDefault, // legacy code was not using this for anything else than globalProps and xstyledProps
44
+ globalProps,
45
+ xstyledProps
46
+ } = (0, import_useMenuItemsSection.useMenuItemsSection)(props);
47
+ const { label, wrapperStyles, innerRef, render: Render } = props;
48
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_menu_items_commons.StyledSectionWrapper, { style: wrapperStyles, innerRef, role: "option", ...globalProps, ...xstyledProps, children: Render !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Render, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_menu_items_commons.StyledGroupLabel, { children: label }) });
49
+ };
50
+ DSMenuItemsSection.displayName = "DSSectionMenuItem";
51
+ const DSMenuItemsSectionWithSchema = (0, import_ds_props_helpers.describe)(DSMenuItemsSection);
52
+ DSMenuItemsSectionWithSchema.propTypes = import_react_desc_prop_types.DSMenuItemsSectionPropTypesSchema;
53
+ //# sourceMappingURL=DSMenuItemsSection.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/DSMenuItemsSection.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { StyledSectionWrapper, StyledGroupLabel } from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsSectionT, DSMenuItemsSectionPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsSection } from './config/useMenuItemsSection.js';\n\nconst DSMenuItemsSection: React.ComponentType<DSMenuItemsSectionT.Props> = (props) => {\n const {\n // propsWithDefault, // legacy code was not using this for anything else than globalProps and xstyledProps\n globalProps,\n xstyledProps,\n } = useMenuItemsSection(props);\n\n // since we have `{}` as DefaultProps, props and propsWithDefault are basically the same...\n // this is kept as is to avoid complications, but it could be simplified/improved\n const { label, wrapperStyles, innerRef, render: Render } = props;\n\n return (\n <StyledSectionWrapper style={wrapperStyles} innerRef={innerRef} role=\"option\" {...globalProps} {...xstyledProps}>\n {Render !== undefined ? <Render {...props} /> : <StyledGroupLabel>{label}</StyledGroupLabel>}\n </StyledSectionWrapper>\n );\n};\n\n// this is `'DSSectionMenuItem'` for legacy reasons, when moving to inheritance pattern this has been kept as it was to avoid complications\nDSMenuItemsSection.displayName = 'DSSectionMenuItem';\nconst DSMenuItemsSectionWithSchema = describe(DSMenuItemsSection);\nDSMenuItemsSectionWithSchema.propTypes = DSMenuItemsSectionPropTypesSchema;\n\nexport { DSMenuItemsSection, DSMenuItemsSectionWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmBO;AAlB9B,8BAAyB;AACzB,mCAAuD;AACvD,mCAA4E;AAC5E,iCAAoC;AAEpC,MAAM,qBAAqE,CAAC,UAAU;AACpF,QAAM;AAAA;AAAA,IAEJ;AAAA,IACA;AAAA,EACF,QAAI,gDAAoB,KAAK;AAI7B,QAAM,EAAE,OAAO,eAAe,UAAU,QAAQ,OAAO,IAAI;AAE3D,SACE,4CAAC,qDAAqB,OAAO,eAAe,UAAoB,MAAK,UAAU,GAAG,aAAc,GAAG,cAChG,qBAAW,SAAY,4CAAC,UAAQ,GAAG,OAAO,IAAK,4CAAC,iDAAkB,iBAAM,GAC3E;AAEJ;AAGA,mBAAmB,cAAc;AACjC,MAAM,mCAA+B,kCAAS,kBAAkB;AAChE,6BAA6B,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,58 @@
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 useMenuItemsSection_exports = {};
30
+ __export(useMenuItemsSection_exports, {
31
+ useMenuItemsSection: () => useMenuItemsSection
32
+ });
33
+ module.exports = __toCommonJS(useMenuItemsSection_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 useMenuItemsSection = (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.DSMenuItemsSectionPropTypes);
43
+ const globalProps = (0, import_lodash.omit)((0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault), [
44
+ "cols",
45
+ "rows",
46
+ "wrap"
47
+ ]);
48
+ const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(propsWithDefault);
49
+ return import_react.default.useMemo(
50
+ () => ({
51
+ propsWithDefault,
52
+ globalProps,
53
+ xstyledProps
54
+ }),
55
+ [propsWithDefault, globalProps, xstyledProps]
56
+ );
57
+ };
58
+ //# sourceMappingURL=useMenuItemsSection.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/config/useMenuItemsSection.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 DSMenuItemsSectionT, DSMenuItemsSectionPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface MenuItemsSectionCTX {\n propsWithDefault: DSMenuItemsSectionT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n}\n\nexport const useMenuItemsSection = (propsFromUser: DSMenuItemsSectionT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSMenuItemsSectionT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSMenuItemsSectionPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = omit(useGetGlobalAttributes<DSMenuItemsSectionT.InternalProps>(propsWithDefault), [\n 'cols',\n 'rows',\n 'wrap',\n ]);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\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,mCAAoF;AACpF,8BAAiC;AAQ1B,MAAM,sBAAsB,CAAC,kBAA6C;AAI/E,QAAM,uBAAmB,sDAAgE,eAAe,yCAAY;AACpH,gDAAiB,kBAAkB,wDAA2B;AAI9D,QAAM,kBAAc,wBAAK,gDAA0D,gBAAgB,GAAG;AAAA,IACpG;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,mBAAe,4CAAmB,gBAAgB;AAExD,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 DSMenuItemsSectionName = `${import_ds_menu_items_commons.DSMenuItemName}Section`;
38
+ const useValidateProps = (props, propTypes) => {
39
+ (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, DSMenuItemsSectionName);
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 DSMenuItemsSectionT } 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 DSMenuItemsSectionName = `${DSMenuItemName}Section`;\n\nexport const useValidateProps = (\n props: DSMenuItemsSectionT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsSectionName);\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,yBAAyB,GAAG;AAE3B,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,8DAA+B,OAAO,WAAW,sBAAsB;AACzE;",
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
+ DSMenuItemsSection: () => import_DSMenuItemsSection.DSMenuItemsSection,
32
+ DSMenuItemsSectionWithSchema: () => import_DSMenuItemsSection.DSMenuItemsSectionWithSchema
33
+ });
34
+ module.exports = __toCommonJS(src_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_DSMenuItemsSection = require("./DSMenuItemsSection.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 { DSMenuItemsSection, DSMenuItemsSectionWithSchema } from './DSMenuItemsSection.js';\nexport { type DSMenuItemsSectionT } 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,gCAAiE;AACjE,mCAAyC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "commonjs",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,60 @@
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
+ DSMenuItemsSectionPropTypes: () => DSMenuItemsSectionPropTypes,
32
+ DSMenuItemsSectionPropTypesSchema: () => DSMenuItemsSectionPropTypesSchema,
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
+ const defaultProps = {};
39
+ const DSMenuItemsSectionPropTypes = {
40
+ // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps
41
+ // they are NOT inherited from a common element from ds-menu-items-commons
42
+ ...import_ds_props_helpers.globalAttributesPropTypes,
43
+ ...import_ds_props_helpers.xstyledPropTypes,
44
+ label: import_ds_props_helpers.PropTypes.string.description("The label of the menu item."),
45
+ // we need to re-declare those even if they are part of the common definitions because this diverges from the common implementation in the "defaultValues" part...
46
+ wrapperStyles: import_ds_props_helpers.PropTypes.object.description("Styles to be applied to the wrapper element if any."),
47
+ render: import_ds_props_helpers.PropTypes.func.description(
48
+ "A React component that can be used to render the menu item if the default one is not the desired one."
49
+ ).signature("React.ComponentType"),
50
+ innerRef: import_ds_props_helpers.PropTypes.oneOfType([
51
+ import_ds_props_helpers.PropTypes.shape({
52
+ current: import_ds_props_helpers.PropTypes.node
53
+ }),
54
+ import_ds_props_helpers.PropTypes.func.description(
55
+ " A ref object or callback function to access the main underlying DOM element of the menu item."
56
+ )
57
+ ])
58
+ };
59
+ const DSMenuItemsSectionPropTypesSchema = DSMenuItemsSectionPropTypes;
60
+ //# 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 type React from 'react';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSMenuItemsSectionT {\n /*******************************************************************************************\n ******************************** IMPORTANT DISCLAIMER *************************************\n *******************************************************************************************\n the way this component was actually implemented was not inheriting from common,\n it was \"ignoring\" the default props and instead reading directly from what the user passed\n I am reflecting what the code is actually doing instead of what we \"meant\" to do.\n ***************************************************************************************** */\n\n // sections can not be \"selected\" nor activated and for this reason we never had an hard requirement for the dsId\n // this may not scale well but to avoid breaking changes we are keeping it this way, if we ever need to add it we will do a V2\n export type RequiredProps = Record<string, never>;\n\n // as per the comment above, the legacy implementation was not considering the default props at all\n // as such we are not defining any default props here\n export type DefaultProps = Record<string, never>;\n\n export type OptionalProps = {\n label?: string; // we have null coalescing in the render, if they don't give us a label we will print an empty section...\n wrapperStyles?: React.CSSProperties; // in react style={undefined} is valid, so it's an optional prop...\n innerRef?: React.Ref<HTMLLIElement>; // in react ref={undefined} is valid, so it's an optional prop...\n render?: React.ComponentType<DSMenuItemsSectionT.Props>; // if render === undefined, we print the opinionated default\n };\n\n // this is not \"standard\" because of what was said in the disclaimer above.\n export interface Props\n extends OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof OptionalProps>,\n XstyledProps {}\n\n // this is not \"standard\" because of what was said in the disclaimer above.\n export interface InternalProps\n extends OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof OptionalProps>,\n XstyledProps {}\n}\nexport const defaultProps: DSMenuItemsSectionT.DefaultProps = {};\n\nexport const DSMenuItemsSectionPropTypes: DSPropTypesSchema<DSMenuItemsSectionT.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 ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n label: PropTypes.string.description('The label of the menu item.'),\n // we need to re-declare those even if they are part of the common definitions because this diverges from the common implementation in the \"defaultValues\" part...\n wrapperStyles: PropTypes.object.description('Styles to be applied to the wrapper element if any.'),\n render: PropTypes.func\n .description(\n 'A React component that can be used to render the menu item if the default one is not the desired one.',\n )\n .signature('React.ComponentType'),\n innerRef: PropTypes.oneOfType([\n PropTypes.shape({\n current: PropTypes.node,\n }),\n PropTypes.func.description(\n ' A ref object or callback function to access the main underlying DOM element of the menu item.',\n ),\n ]),\n};\n\nexport const DSMenuItemsSectionPropTypesSchema =\n DSMenuItemsSectionPropTypes as unknown as WeakValidationMap<DSMenuItemsSectionT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;AAwChE,MAAM,eAAiD,CAAC;AAExD,MAAM,8BAAoF;AAAA;AAAA;AAAA,EAG/F,GAAG;AAAA,EACH,GAAG;AAAA,EACH,OAAO,kCAAU,OAAO,YAAY,6BAA6B;AAAA;AAAA,EAEjE,eAAe,kCAAU,OAAO,YAAY,qDAAqD;AAAA,EACjG,QAAQ,kCAAU,KACf;AAAA,IACC;AAAA,EACF,EACC,UAAU,qBAAqB;AAAA,EAClC,UAAU,kCAAU,UAAU;AAAA,IAC5B,kCAAU,MAAM;AAAA,MACd,SAAS,kCAAU;AAAA,IACrB,CAAC;AAAA,IACD,kCAAU,KAAK;AAAA,MACb;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEO,MAAM,oCACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,23 @@
1
+ import * as React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { describe } from "@elliemae/ds-props-helpers";
4
+ import { StyledSectionWrapper, StyledGroupLabel } from "@elliemae/ds-menu-items-commons";
5
+ import { DSMenuItemsSectionPropTypesSchema } from "./react-desc-prop-types.js";
6
+ import { useMenuItemsSection } from "./config/useMenuItemsSection.js";
7
+ const DSMenuItemsSection = (props) => {
8
+ const {
9
+ // propsWithDefault, // legacy code was not using this for anything else than globalProps and xstyledProps
10
+ globalProps,
11
+ xstyledProps
12
+ } = useMenuItemsSection(props);
13
+ const { label, wrapperStyles, innerRef, render: Render } = props;
14
+ return /* @__PURE__ */ jsx(StyledSectionWrapper, { style: wrapperStyles, innerRef, role: "option", ...globalProps, ...xstyledProps, children: Render !== void 0 ? /* @__PURE__ */ jsx(Render, { ...props }) : /* @__PURE__ */ jsx(StyledGroupLabel, { children: label }) });
15
+ };
16
+ DSMenuItemsSection.displayName = "DSSectionMenuItem";
17
+ const DSMenuItemsSectionWithSchema = describe(DSMenuItemsSection);
18
+ DSMenuItemsSectionWithSchema.propTypes = DSMenuItemsSectionPropTypesSchema;
19
+ export {
20
+ DSMenuItemsSection,
21
+ DSMenuItemsSectionWithSchema
22
+ };
23
+ //# sourceMappingURL=DSMenuItemsSection.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSMenuItemsSection.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { StyledSectionWrapper, StyledGroupLabel } from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsSectionT, DSMenuItemsSectionPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsSection } from './config/useMenuItemsSection.js';\n\nconst DSMenuItemsSection: React.ComponentType<DSMenuItemsSectionT.Props> = (props) => {\n const {\n // propsWithDefault, // legacy code was not using this for anything else than globalProps and xstyledProps\n globalProps,\n xstyledProps,\n } = useMenuItemsSection(props);\n\n // since we have `{}` as DefaultProps, props and propsWithDefault are basically the same...\n // this is kept as is to avoid complications, but it could be simplified/improved\n const { label, wrapperStyles, innerRef, render: Render } = props;\n\n return (\n <StyledSectionWrapper style={wrapperStyles} innerRef={innerRef} role=\"option\" {...globalProps} {...xstyledProps}>\n {Render !== undefined ? <Render {...props} /> : <StyledGroupLabel>{label}</StyledGroupLabel>}\n </StyledSectionWrapper>\n );\n};\n\n// this is `'DSSectionMenuItem'` for legacy reasons, when moving to inheritance pattern this has been kept as it was to avoid complications\nDSMenuItemsSection.displayName = 'DSSectionMenuItem';\nconst DSMenuItemsSectionWithSchema = describe(DSMenuItemsSection);\nDSMenuItemsSectionWithSchema.propTypes = DSMenuItemsSectionPropTypesSchema;\n\nexport { DSMenuItemsSection, DSMenuItemsSectionWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACmBO;AAlB9B,SAAS,gBAAgB;AACzB,SAAS,sBAAsB,wBAAwB;AACvD,SAAmC,yCAAyC;AAC5E,SAAS,2BAA2B;AAEpC,MAAM,qBAAqE,CAAC,UAAU;AACpF,QAAM;AAAA;AAAA,IAEJ;AAAA,IACA;AAAA,EACF,IAAI,oBAAoB,KAAK;AAI7B,QAAM,EAAE,OAAO,eAAe,UAAU,QAAQ,OAAO,IAAI;AAE3D,SACE,oBAAC,wBAAqB,OAAO,eAAe,UAAoB,MAAK,UAAU,GAAG,aAAc,GAAG,cAChG,qBAAW,SAAY,oBAAC,UAAQ,GAAG,OAAO,IAAK,oBAAC,oBAAkB,iBAAM,GAC3E;AAEJ;AAGA,mBAAmB,cAAc;AACjC,MAAM,+BAA+B,SAAS,kBAAkB;AAChE,6BAA6B,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
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 { DSMenuItemsSectionPropTypes, defaultProps } from "../react-desc-prop-types.js";
6
+ import { useValidateProps } from "./useValidateProps.js";
7
+ const useMenuItemsSection = (propsFromUser) => {
8
+ const propsWithDefault = useMemoMergePropsWithDefault(propsFromUser, defaultProps);
9
+ useValidateProps(propsWithDefault, DSMenuItemsSectionPropTypes);
10
+ const globalProps = omit(useGetGlobalAttributes(propsWithDefault), [
11
+ "cols",
12
+ "rows",
13
+ "wrap"
14
+ ]);
15
+ const xstyledProps = useGetXstyledProps(propsWithDefault);
16
+ return React2.useMemo(
17
+ () => ({
18
+ propsWithDefault,
19
+ globalProps,
20
+ xstyledProps
21
+ }),
22
+ [propsWithDefault, globalProps, xstyledProps]
23
+ );
24
+ };
25
+ export {
26
+ useMenuItemsSection
27
+ };
28
+ //# sourceMappingURL=useMenuItemsSection.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useMenuItemsSection.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 DSMenuItemsSectionT, DSMenuItemsSectionPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface MenuItemsSectionCTX {\n propsWithDefault: DSMenuItemsSectionT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n}\n\nexport const useMenuItemsSection = (propsFromUser: DSMenuItemsSectionT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSMenuItemsSectionT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSMenuItemsSectionPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = omit(useGetGlobalAttributes<DSMenuItemsSectionT.InternalProps>(propsWithDefault), [\n 'cols',\n 'rows',\n 'wrap',\n ]);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\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,SAAmC,6BAA6B,oBAAoB;AACpF,SAAS,wBAAwB;AAQ1B,MAAM,sBAAsB,CAAC,kBAA6C;AAI/E,QAAM,mBAAmB,6BAAgE,eAAe,YAAY;AACpH,mBAAiB,kBAAkB,2BAA2B;AAI9D,QAAM,cAAc,KAAK,uBAA0D,gBAAgB,GAAG;AAAA,IACpG;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,eAAe,mBAAmB,gBAAgB;AAExD,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 DSMenuItemsSectionName = `${DSMenuItemName}Section`;
5
+ const useValidateProps = (props, propTypes) => {
6
+ useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsSectionName);
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 DSMenuItemsSectionT } 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 DSMenuItemsSectionName = `${DSMenuItemName}Section`;\n\nexport const useValidateProps = (\n props: DSMenuItemsSectionT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsSectionName);\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAC/C,SAAS,sBAAsB;AAQ/B,MAAM,yBAAyB,GAAG;AAE3B,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,sBAAsB;AACzE;",
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 { DSMenuItemsSection, DSMenuItemsSectionWithSchema } from "./DSMenuItemsSection.js";
3
+ import {} from "./react-desc-prop-types.js";
4
+ export {
5
+ DSMenuItemsSection,
6
+ DSMenuItemsSectionWithSchema
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 { DSMenuItemsSection, DSMenuItemsSectionWithSchema } from './DSMenuItemsSection.js';\nexport { type DSMenuItemsSectionT } from './react-desc-prop-types.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,oBAAoB,oCAAoC;AACjE,eAAyC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,30 @@
1
+ import * as React from "react";
2
+ import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-props-helpers";
3
+ const defaultProps = {};
4
+ const DSMenuItemsSectionPropTypes = {
5
+ // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps
6
+ // they are NOT inherited from a common element from ds-menu-items-commons
7
+ ...globalAttributesPropTypes,
8
+ ...xstyledPropTypes,
9
+ label: PropTypes.string.description("The label of the menu item."),
10
+ // we need to re-declare those even if they are part of the common definitions because this diverges from the common implementation in the "defaultValues" part...
11
+ wrapperStyles: PropTypes.object.description("Styles to be applied to the wrapper element if any."),
12
+ render: PropTypes.func.description(
13
+ "A React component that can be used to render the menu item if the default one is not the desired one."
14
+ ).signature("React.ComponentType"),
15
+ innerRef: PropTypes.oneOfType([
16
+ PropTypes.shape({
17
+ current: PropTypes.node
18
+ }),
19
+ PropTypes.func.description(
20
+ " A ref object or callback function to access the main underlying DOM element of the menu item."
21
+ )
22
+ ])
23
+ };
24
+ const DSMenuItemsSectionPropTypesSchema = DSMenuItemsSectionPropTypes;
25
+ export {
26
+ DSMenuItemsSectionPropTypes,
27
+ DSMenuItemsSectionPropTypesSchema,
28
+ defaultProps
29
+ };
30
+ //# 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 type React from 'react';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSMenuItemsSectionT {\n /*******************************************************************************************\n ******************************** IMPORTANT DISCLAIMER *************************************\n *******************************************************************************************\n the way this component was actually implemented was not inheriting from common,\n it was \"ignoring\" the default props and instead reading directly from what the user passed\n I am reflecting what the code is actually doing instead of what we \"meant\" to do.\n ***************************************************************************************** */\n\n // sections can not be \"selected\" nor activated and for this reason we never had an hard requirement for the dsId\n // this may not scale well but to avoid breaking changes we are keeping it this way, if we ever need to add it we will do a V2\n export type RequiredProps = Record<string, never>;\n\n // as per the comment above, the legacy implementation was not considering the default props at all\n // as such we are not defining any default props here\n export type DefaultProps = Record<string, never>;\n\n export type OptionalProps = {\n label?: string; // we have null coalescing in the render, if they don't give us a label we will print an empty section...\n wrapperStyles?: React.CSSProperties; // in react style={undefined} is valid, so it's an optional prop...\n innerRef?: React.Ref<HTMLLIElement>; // in react ref={undefined} is valid, so it's an optional prop...\n render?: React.ComponentType<DSMenuItemsSectionT.Props>; // if render === undefined, we print the opinionated default\n };\n\n // this is not \"standard\" because of what was said in the disclaimer above.\n export interface Props\n extends OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof OptionalProps>,\n XstyledProps {}\n\n // this is not \"standard\" because of what was said in the disclaimer above.\n export interface InternalProps\n extends OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof OptionalProps>,\n XstyledProps {}\n}\nexport const defaultProps: DSMenuItemsSectionT.DefaultProps = {};\n\nexport const DSMenuItemsSectionPropTypes: DSPropTypesSchema<DSMenuItemsSectionT.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 ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n label: PropTypes.string.description('The label of the menu item.'),\n // we need to re-declare those even if they are part of the common definitions because this diverges from the common implementation in the \"defaultValues\" part...\n wrapperStyles: PropTypes.object.description('Styles to be applied to the wrapper element if any.'),\n render: PropTypes.func\n .description(\n 'A React component that can be used to render the menu item if the default one is not the desired one.',\n )\n .signature('React.ComponentType'),\n innerRef: PropTypes.oneOfType([\n PropTypes.shape({\n current: PropTypes.node,\n }),\n PropTypes.func.description(\n ' A ref object or callback function to access the main underlying DOM element of the menu item.',\n ),\n ]),\n};\n\nexport const DSMenuItemsSectionPropTypesSchema =\n DSMenuItemsSectionPropTypes as unknown as WeakValidationMap<DSMenuItemsSectionT.Props>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AAwChE,MAAM,eAAiD,CAAC;AAExD,MAAM,8BAAoF;AAAA;AAAA;AAAA,EAG/F,GAAG;AAAA,EACH,GAAG;AAAA,EACH,OAAO,UAAU,OAAO,YAAY,6BAA6B;AAAA;AAAA,EAEjE,eAAe,UAAU,OAAO,YAAY,qDAAqD;AAAA,EACjG,QAAQ,UAAU,KACf;AAAA,IACC;AAAA,EACF,EACC,UAAU,qBAAqB;AAAA,EAClC,UAAU,UAAU,UAAU;AAAA,IAC5B,UAAU,MAAM;AAAA,MACd,SAAS,UAAU;AAAA,IACrB,CAAC;AAAA,IACD,UAAU,KAAK;AAAA,MACb;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEO,MAAM,oCACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { type DSMenuItemsSectionT } from './react-desc-prop-types.js';
3
+ declare const DSMenuItemsSection: React.ComponentType<DSMenuItemsSectionT.Props>;
4
+ declare const DSMenuItemsSectionWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSMenuItemsSectionT.Props>;
5
+ export { DSMenuItemsSection, DSMenuItemsSectionWithSchema };
@@ -0,0 +1,13 @@
1
+ /// <reference types="lodash" />
2
+ import { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';
3
+ import { type DSMenuItemsSectionT } from '../react-desc-prop-types.js';
4
+ export interface MenuItemsSectionCTX {
5
+ propsWithDefault: DSMenuItemsSectionT.InternalProps;
6
+ globalProps: ReturnType<typeof useGetGlobalAttributes>;
7
+ xstyledProps: ReturnType<typeof useGetXstyledProps>;
8
+ }
9
+ export declare const useMenuItemsSection: (propsFromUser: DSMenuItemsSectionT.Props) => {
10
+ propsWithDefault: DSMenuItemsSectionT.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 DSMenuItemsSectionT } from '../react-desc-prop-types.js';
3
+ export declare const useValidateProps: (props: DSMenuItemsSectionT.InternalProps, propTypes: WeakValidationMap<unknown>) => void;
File without changes
@@ -0,0 +1,2 @@
1
+ export { DSMenuItemsSection, DSMenuItemsSectionWithSchema } from './DSMenuItemsSection.js';
2
+ export { type DSMenuItemsSectionT } from './react-desc-prop-types.js';
@@ -0,0 +1,26 @@
1
+ import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';
2
+ import type React from 'react';
3
+ export declare namespace DSMenuItemsSectionT {
4
+ /*******************************************************************************************
5
+ ******************************** IMPORTANT DISCLAIMER *************************************
6
+ *******************************************************************************************
7
+ the way this component was actually implemented was not inheriting from common,
8
+ it was "ignoring" the default props and instead reading directly from what the user passed
9
+ I am reflecting what the code is actually doing instead of what we "meant" to do.
10
+ ***************************************************************************************** */
11
+ type RequiredProps = Record<string, never>;
12
+ type DefaultProps = Record<string, never>;
13
+ type OptionalProps = {
14
+ label?: string;
15
+ wrapperStyles?: React.CSSProperties;
16
+ innerRef?: React.Ref<HTMLLIElement>;
17
+ render?: React.ComponentType<DSMenuItemsSectionT.Props>;
18
+ };
19
+ interface Props extends OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof OptionalProps>, XstyledProps {
20
+ }
21
+ interface InternalProps extends OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof OptionalProps>, XstyledProps {
22
+ }
23
+ }
24
+ export declare const defaultProps: DSMenuItemsSectionT.DefaultProps;
25
+ export declare const DSMenuItemsSectionPropTypes: DSPropTypesSchema<DSMenuItemsSectionT.InternalProps>;
26
+ export declare const DSMenuItemsSectionPropTypesSchema: React.WeakValidationMap<DSMenuItemsSectionT.Props>;
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@elliemae/ds-menu-items-section",
3
+ "version": "3.27.0-next.11",
4
+ "license": "MIT",
5
+ "description": "ICE MT - Dimsum - Menu Items Section",
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-button": "3.27.0-next.11",
40
+ "@elliemae/ds-grid": "3.27.0-next.11",
41
+ "@elliemae/ds-menu-items-commons": "3.27.0-next.11",
42
+ "@elliemae/ds-props-helpers": "3.27.0-next.11",
43
+ "@elliemae/ds-system": "3.27.0-next.11",
44
+ "@elliemae/ds-utilities": "3.27.0-next.11"
45
+ },
46
+ "devDependencies": {
47
+ "lodash": "^4.17.21",
48
+ "styled-components": "~5.3.9",
49
+ "@elliemae/ds-monorepo-devops": "3.27.0-next.11"
50
+ },
51
+ "peerDependencies": {
52
+ "@testing-library/jest-dom": "~5.16.4",
53
+ "@testing-library/react": "~12.1.3",
54
+ "@testing-library/user-event": "~13.5.0",
55
+ "lodash": "^4.17.21",
56
+ "react": "^17.0.2",
57
+ "react-dom": "^17.0.2",
58
+ "styled-components": "~5.3.9"
59
+ },
60
+ "publishConfig": {
61
+ "access": "public",
62
+ "typeSafety": true
63
+ },
64
+ "scripts": {
65
+ "dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
66
+ "test": "pui-cli test --passWithNoTests",
67
+ "lint": "node ../../../scripts/lint.mjs --fix",
68
+ "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
69
+ "dts": "node ../../scripts/dts.mjs",
70
+ "dts:withdeps": "pnpm --filter {.}... dts",
71
+ "build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
72
+ "dev:build": "pnpm --filter {.}... build",
73
+ "dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
74
+ "checkDeps": "npx -yes ../../util/ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
75
+ }
76
+ }