@elliemae/ds-menu-items-skeleton 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/DSMenuItemsSkeleton.js +68 -0
  2. package/dist/cjs/DSMenuItemsSkeleton.js.map +7 -0
  3. package/dist/cjs/config/useMenuItemsSkeleton.js +61 -0
  4. package/dist/cjs/config/useMenuItemsSkeleton.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 +53 -0
  13. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  14. package/dist/esm/DSMenuItemsSkeleton.js +38 -0
  15. package/dist/esm/DSMenuItemsSkeleton.js.map +7 -0
  16. package/dist/esm/config/useMenuItemsSkeleton.js +31 -0
  17. package/dist/esm/config/useMenuItemsSkeleton.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 +23 -0
  26. package/dist/esm/react-desc-prop-types.js.map +7 -0
  27. package/dist/types/DSMenuItemsSkeleton.d.ts +5 -0
  28. package/dist/types/config/useMenuItemsSkeleton.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 +34 -0
  33. package/package.json +74 -0
@@ -0,0 +1,68 @@
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 DSMenuItemsSkeleton_exports = {};
30
+ __export(DSMenuItemsSkeleton_exports, {
31
+ DSMenuItemsSkeleton: () => DSMenuItemsSkeleton,
32
+ DSMenuItemsSkeletonWithSchema: () => DSMenuItemsSkeletonWithSchema
33
+ });
34
+ module.exports = __toCommonJS(DSMenuItemsSkeleton_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_skeleton = require("@elliemae/ds-skeleton");
39
+ var import_ds_menu_items_commons = require("@elliemae/ds-menu-items-commons");
40
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
41
+ var import_useMenuItemsSkeleton = require("./config/useMenuItemsSkeleton.js");
42
+ const gridLayout = ["16px", "auto"];
43
+ const DSMenuItemsSkeleton = (props) => {
44
+ const { propsWithDefault, globalProps, xstyledProps } = (0, import_useMenuItemsSkeleton.useMenuItemsSkeleton)(props);
45
+ const { wrapperStyles, isActive, dsId } = propsWithDefault;
46
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
47
+ import_ds_menu_items_commons.StyledGlobalMenuItemWrapper,
48
+ {
49
+ id: dsId,
50
+ "data-type": "skeleton",
51
+ "data-testid": "ds-skeleton-menu-item",
52
+ role: "option",
53
+ "aria-label": "skeleton",
54
+ style: wrapperStyles,
55
+ isActive,
56
+ ...globalProps,
57
+ ...xstyledProps,
58
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_menu_items_commons.StyledContentWrapper, { cols: gridLayout, minHeight: "16px", gutter: "xxs", alignItems: "center", children: [
59
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_skeleton.DSSkeleton, { variant: "rectangular", width: "100%" }),
60
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_skeleton.DSSkeleton, { variant: "rectangular", width: "100%" })
61
+ ] })
62
+ }
63
+ );
64
+ };
65
+ DSMenuItemsSkeleton.displayName = "DSMenuItemSkeleton";
66
+ const DSMenuItemsSkeletonWithSchema = (0, import_ds_props_helpers.describe)(DSMenuItemsSkeleton);
67
+ DSMenuItemsSkeletonWithSchema.propTypes = import_react_desc_prop_types.DSMenuItemsSkeletonPropTypesSchema;
68
+ //# sourceMappingURL=DSMenuItemsSkeleton.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/DSMenuItemsSkeleton.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSSkeleton } from '@elliemae/ds-skeleton';\nimport { StyledGlobalMenuItemWrapper, StyledContentWrapper } from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsSkeletonT, DSMenuItemsSkeletonPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsSkeleton } from './config/useMenuItemsSkeleton.js';\nconst gridLayout = ['16px', 'auto'];\n\nconst DSMenuItemsSkeleton: React.ComponentType<DSMenuItemsSkeletonT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useMenuItemsSkeleton(props);\n const { wrapperStyles, isActive, dsId } = propsWithDefault;\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n data-type=\"skeleton\"\n data-testid=\"ds-skeleton-menu-item\"\n role=\"option\"\n aria-label=\"skeleton\"\n style={wrapperStyles}\n isActive={isActive}\n {...globalProps}\n {...xstyledProps}\n >\n <StyledContentWrapper cols={gridLayout} minHeight=\"16px\" gutter=\"xxs\" alignItems=\"center\">\n <DSSkeleton variant=\"rectangular\" width={'100%'} />\n <DSSkeleton variant=\"rectangular\" width={'100%'} />\n </StyledContentWrapper>\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// the component used to not even define this...\nDSMenuItemsSkeleton.displayName = 'DSMenuItemSkeleton';\nconst DSMenuItemsSkeletonWithSchema = describe(DSMenuItemsSkeleton);\nDSMenuItemsSkeletonWithSchema.propTypes = DSMenuItemsSkeletonPropTypesSchema;\n\nexport { DSMenuItemsSkeleton, DSMenuItemsSkeletonWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADwBjB;AAvBN,8BAAyB;AACzB,yBAA2B;AAC3B,mCAAkE;AAClE,mCAA8E;AAC9E,kCAAqC;AACrC,MAAM,aAAa,CAAC,QAAQ,MAAM;AAElC,MAAM,sBAAuE,CAAC,UAAU;AACtF,QAAM,EAAE,kBAAkB,aAAa,aAAa,QAAI,kDAAqB,KAAK;AAClF,QAAM,EAAE,eAAe,UAAU,KAAK,IAAI;AAE1C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ,aAAU;AAAA,MACV,eAAY;AAAA,MACZ,MAAK;AAAA,MACL,cAAW;AAAA,MACX,OAAO;AAAA,MACP;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ,uDAAC,qDAAqB,MAAM,YAAY,WAAU,QAAO,QAAO,OAAM,YAAW,UAC/E;AAAA,oDAAC,iCAAW,SAAQ,eAAc,OAAO,QAAQ;AAAA,QACjD,4CAAC,iCAAW,SAAQ,eAAc,OAAO,QAAQ;AAAA,SACnD;AAAA;AAAA,EACF;AAEJ;AAGA,oBAAoB,cAAc;AAClC,MAAM,oCAAgC,kCAAS,mBAAmB;AAClE,8BAA8B,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,61 @@
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 useMenuItemsSkeleton_exports = {};
30
+ __export(useMenuItemsSkeleton_exports, {
31
+ useMenuItemsSkeleton: () => useMenuItemsSkeleton
32
+ });
33
+ module.exports = __toCommonJS(useMenuItemsSkeleton_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 useMenuItemsSkeleton = (propsFromUser) => {
41
+ const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(
42
+ propsFromUser,
43
+ import_react_desc_prop_types.defaultProps
44
+ );
45
+ (0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSMenuItemsSkeletonPropTypes);
46
+ const globalProps = (0, import_lodash.omit)((0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault), [
47
+ "cols",
48
+ "rows",
49
+ "wrap"
50
+ ]);
51
+ const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(propsWithDefault);
52
+ return import_react.default.useMemo(
53
+ () => ({
54
+ propsWithDefault,
55
+ globalProps,
56
+ xstyledProps
57
+ }),
58
+ [propsWithDefault, globalProps, xstyledProps]
59
+ );
60
+ };
61
+ //# sourceMappingURL=useMenuItemsSkeleton.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/config/useMenuItemsSkeleton.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 DSMenuItemsSkeletonT, DSMenuItemsSkeletonPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface MenuItemsSkeletonCTX {\n propsWithDefault: DSMenuItemsSkeletonT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n}\n\nexport const useMenuItemsSkeleton = (propsFromUser: DSMenuItemsSkeletonT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSMenuItemsSkeletonT.InternalProps>(\n propsFromUser,\n defaultProps,\n );\n useValidateProps(propsWithDefault, DSMenuItemsSkeletonPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = omit(useGetGlobalAttributes<DSMenuItemsSkeletonT.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,mCAAsF;AACtF,8BAAiC;AAQ1B,MAAM,uBAAuB,CAAC,kBAA8C;AAIjF,QAAM,uBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,gDAAiB,kBAAkB,yDAA4B;AAI/D,QAAM,kBAAc,wBAAK,gDAA2D,gBAAgB,GAAG;AAAA,IACrG;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 DSMenuItemsSkeletonName = `${import_ds_menu_items_commons.DSMenuItemName}Skeleton`;
38
+ const useValidateProps = (props, propTypes) => {
39
+ (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, DSMenuItemsSkeletonName);
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 DSMenuItemsSkeletonT } 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 DSMenuItemsSkeletonName = `${DSMenuItemName}Skeleton`;\n\nexport const useValidateProps = (\n props: DSMenuItemsSkeletonT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsSkeletonName);\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,0BAA0B,GAAG;AAE5B,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,8DAA+B,OAAO,WAAW,uBAAuB;AAC1E;",
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
+ DSMenuItemsSkeleton: () => import_DSMenuItemsSkeleton.DSMenuItemsSkeleton,
32
+ DSMenuItemsSkeletonWithSchema: () => import_DSMenuItemsSkeleton.DSMenuItemsSkeletonWithSchema
33
+ });
34
+ module.exports = __toCommonJS(src_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_DSMenuItemsSkeleton = require("./DSMenuItemsSkeleton.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 { DSMenuItemsSkeleton, DSMenuItemsSkeletonWithSchema } from './DSMenuItemsSkeleton.js';\nexport { type DSMenuItemsSkeletonT } 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,iCAAmE;AACnE,mCAA0C;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "commonjs",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -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 react_desc_prop_types_exports = {};
30
+ __export(react_desc_prop_types_exports, {
31
+ DSMenuItemsSkeletonPropTypes: () => DSMenuItemsSkeletonPropTypes,
32
+ DSMenuItemsSkeletonPropTypesSchema: () => DSMenuItemsSkeletonPropTypesSchema,
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
+ wrapperStyles: {}
40
+ };
41
+ const DSMenuItemsSkeletonPropTypes = {
42
+ // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps
43
+ // they are NOT inherited from a common element from ds-menu-items-commons
44
+ ...import_ds_props_helpers.globalAttributesPropTypes,
45
+ ...import_ds_props_helpers.xstyledPropTypes,
46
+ dsId: import_ds_props_helpers.PropTypes.string.description(
47
+ 'This is used as "id" in the DOM, you need this to be able to make this A11Y accessible.'
48
+ ).isRequired,
49
+ isActive: import_ds_props_helpers.PropTypes.bool.description("Whether the menu item is active."),
50
+ wrapperStyles: import_ds_props_helpers.PropTypes.object.description("The styles to apply to the wrapper element, if any.")
51
+ };
52
+ const DSMenuItemsSkeletonPropTypesSchema = DSMenuItemsSkeletonPropTypes;
53
+ //# 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 DSMenuItemsCommonsT } from '@elliemae/ds-menu-items-commons';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSMenuItemsSkeletonT {\n /*******************************************************************************************\n ******************************** IMPORTANT DISCLAIMER *************************************\n *******************************************************************************************\n This component violates `common.RequiredProps` because\n - it does not have a 'render' prop\n - it does not have an 'original' prop\n - it does not have an 'innerRef' prop\n - it does not have any \"schema\" validator\n\n Legacy was not supporting global attributes but during the refactor I added them.\n It was not merging \"default\" props either, but I added them as well. (only for wrapperStyles)\n Those changes should be 100% backward compatible.\n \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\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 = {\n wrapperStyles?: DSMenuItemsCommonsT.DefaultProps['wrapperStyles'];\n };\n\n export type OptionalProps = {\n isActive?: boolean;\n };\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSMenuItemsSkeletonT.DefaultProps = {\n wrapperStyles: {},\n};\n\nexport const DSMenuItemsSkeletonPropTypes: DSPropTypesSchema<DSMenuItemsSkeletonT.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 dsId: PropTypes.string.description(\n 'This is used as \"id\" in the DOM, you need this to be able to make this A11Y accessible.',\n ).isRequired,\n isActive: PropTypes.bool.description('Whether the menu item is active.'),\n wrapperStyles: PropTypes.object.description('The styles to apply to the wrapper element, if any.'),\n};\n\nexport const DSMenuItemsSkeletonPropTypesSchema =\n DSMenuItemsSkeletonPropTypes as unknown as WeakValidationMap<DSMenuItemsSkeletonT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;AAkDhE,MAAM,eAAkD;AAAA,EAC7D,eAAe,CAAC;AAClB;AAEO,MAAM,+BAAsF;AAAA;AAAA;AAAA,EAGjG,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,kCAAU,OAAO;AAAA,IACrB;AAAA,EACF,EAAE;AAAA,EACF,UAAU,kCAAU,KAAK,YAAY,kCAAkC;AAAA,EACvE,eAAe,kCAAU,OAAO,YAAY,qDAAqD;AACnG;AAEO,MAAM,qCACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,38 @@
1
+ import * as React from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { describe } from "@elliemae/ds-props-helpers";
4
+ import { DSSkeleton } from "@elliemae/ds-skeleton";
5
+ import { StyledGlobalMenuItemWrapper, StyledContentWrapper } from "@elliemae/ds-menu-items-commons";
6
+ import { DSMenuItemsSkeletonPropTypesSchema } from "./react-desc-prop-types.js";
7
+ import { useMenuItemsSkeleton } from "./config/useMenuItemsSkeleton.js";
8
+ const gridLayout = ["16px", "auto"];
9
+ const DSMenuItemsSkeleton = (props) => {
10
+ const { propsWithDefault, globalProps, xstyledProps } = useMenuItemsSkeleton(props);
11
+ const { wrapperStyles, isActive, dsId } = propsWithDefault;
12
+ return /* @__PURE__ */ jsx(
13
+ StyledGlobalMenuItemWrapper,
14
+ {
15
+ id: dsId,
16
+ "data-type": "skeleton",
17
+ "data-testid": "ds-skeleton-menu-item",
18
+ role: "option",
19
+ "aria-label": "skeleton",
20
+ style: wrapperStyles,
21
+ isActive,
22
+ ...globalProps,
23
+ ...xstyledProps,
24
+ children: /* @__PURE__ */ jsxs(StyledContentWrapper, { cols: gridLayout, minHeight: "16px", gutter: "xxs", alignItems: "center", children: [
25
+ /* @__PURE__ */ jsx(DSSkeleton, { variant: "rectangular", width: "100%" }),
26
+ /* @__PURE__ */ jsx(DSSkeleton, { variant: "rectangular", width: "100%" })
27
+ ] })
28
+ }
29
+ );
30
+ };
31
+ DSMenuItemsSkeleton.displayName = "DSMenuItemSkeleton";
32
+ const DSMenuItemsSkeletonWithSchema = describe(DSMenuItemsSkeleton);
33
+ DSMenuItemsSkeletonWithSchema.propTypes = DSMenuItemsSkeletonPropTypesSchema;
34
+ export {
35
+ DSMenuItemsSkeleton,
36
+ DSMenuItemsSkeletonWithSchema
37
+ };
38
+ //# sourceMappingURL=DSMenuItemsSkeleton.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSMenuItemsSkeleton.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSSkeleton } from '@elliemae/ds-skeleton';\nimport { StyledGlobalMenuItemWrapper, StyledContentWrapper } from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsSkeletonT, DSMenuItemsSkeletonPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsSkeleton } from './config/useMenuItemsSkeleton.js';\nconst gridLayout = ['16px', 'auto'];\n\nconst DSMenuItemsSkeleton: React.ComponentType<DSMenuItemsSkeletonT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useMenuItemsSkeleton(props);\n const { wrapperStyles, isActive, dsId } = propsWithDefault;\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n data-type=\"skeleton\"\n data-testid=\"ds-skeleton-menu-item\"\n role=\"option\"\n aria-label=\"skeleton\"\n style={wrapperStyles}\n isActive={isActive}\n {...globalProps}\n {...xstyledProps}\n >\n <StyledContentWrapper cols={gridLayout} minHeight=\"16px\" gutter=\"xxs\" alignItems=\"center\">\n <DSSkeleton variant=\"rectangular\" width={'100%'} />\n <DSSkeleton variant=\"rectangular\" width={'100%'} />\n </StyledContentWrapper>\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// the component used to not even define this...\nDSMenuItemsSkeleton.displayName = 'DSMenuItemSkeleton';\nconst DSMenuItemsSkeletonWithSchema = describe(DSMenuItemsSkeleton);\nDSMenuItemsSkeletonWithSchema.propTypes = DSMenuItemsSkeletonPropTypesSchema;\n\nexport { DSMenuItemsSkeleton, DSMenuItemsSkeletonWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACwBjB,SACE,KADF;AAvBN,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,6BAA6B,4BAA4B;AAClE,SAAoC,0CAA0C;AAC9E,SAAS,4BAA4B;AACrC,MAAM,aAAa,CAAC,QAAQ,MAAM;AAElC,MAAM,sBAAuE,CAAC,UAAU;AACtF,QAAM,EAAE,kBAAkB,aAAa,aAAa,IAAI,qBAAqB,KAAK;AAClF,QAAM,EAAE,eAAe,UAAU,KAAK,IAAI;AAE1C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ,aAAU;AAAA,MACV,eAAY;AAAA,MACZ,MAAK;AAAA,MACL,cAAW;AAAA,MACX,OAAO;AAAA,MACP;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ,+BAAC,wBAAqB,MAAM,YAAY,WAAU,QAAO,QAAO,OAAM,YAAW,UAC/E;AAAA,4BAAC,cAAW,SAAQ,eAAc,OAAO,QAAQ;AAAA,QACjD,oBAAC,cAAW,SAAQ,eAAc,OAAO,QAAQ;AAAA,SACnD;AAAA;AAAA,EACF;AAEJ;AAGA,oBAAoB,cAAc;AAClC,MAAM,gCAAgC,SAAS,mBAAmB;AAClE,8BAA8B,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,31 @@
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 { DSMenuItemsSkeletonPropTypes, defaultProps } from "../react-desc-prop-types.js";
6
+ import { useValidateProps } from "./useValidateProps.js";
7
+ const useMenuItemsSkeleton = (propsFromUser) => {
8
+ const propsWithDefault = useMemoMergePropsWithDefault(
9
+ propsFromUser,
10
+ defaultProps
11
+ );
12
+ useValidateProps(propsWithDefault, DSMenuItemsSkeletonPropTypes);
13
+ const globalProps = omit(useGetGlobalAttributes(propsWithDefault), [
14
+ "cols",
15
+ "rows",
16
+ "wrap"
17
+ ]);
18
+ const xstyledProps = useGetXstyledProps(propsWithDefault);
19
+ return React2.useMemo(
20
+ () => ({
21
+ propsWithDefault,
22
+ globalProps,
23
+ xstyledProps
24
+ }),
25
+ [propsWithDefault, globalProps, xstyledProps]
26
+ );
27
+ };
28
+ export {
29
+ useMenuItemsSkeleton
30
+ };
31
+ //# sourceMappingURL=useMenuItemsSkeleton.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useMenuItemsSkeleton.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 DSMenuItemsSkeletonT, DSMenuItemsSkeletonPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface MenuItemsSkeletonCTX {\n propsWithDefault: DSMenuItemsSkeletonT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n}\n\nexport const useMenuItemsSkeleton = (propsFromUser: DSMenuItemsSkeletonT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSMenuItemsSkeletonT.InternalProps>(\n propsFromUser,\n defaultProps,\n );\n useValidateProps(propsWithDefault, DSMenuItemsSkeletonPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = omit(useGetGlobalAttributes<DSMenuItemsSkeletonT.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,SAAoC,8BAA8B,oBAAoB;AACtF,SAAS,wBAAwB;AAQ1B,MAAM,uBAAuB,CAAC,kBAA8C;AAIjF,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,mBAAiB,kBAAkB,4BAA4B;AAI/D,QAAM,cAAc,KAAK,uBAA2D,gBAAgB,GAAG;AAAA,IACrG;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 DSMenuItemsSkeletonName = `${DSMenuItemName}Skeleton`;
5
+ const useValidateProps = (props, propTypes) => {
6
+ useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsSkeletonName);
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 DSMenuItemsSkeletonT } 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 DSMenuItemsSkeletonName = `${DSMenuItemName}Skeleton`;\n\nexport const useValidateProps = (\n props: DSMenuItemsSkeletonT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsSkeletonName);\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAC/C,SAAS,sBAAsB;AAQ/B,MAAM,0BAA0B,GAAG;AAE5B,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,uBAAuB;AAC1E;",
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 { DSMenuItemsSkeleton, DSMenuItemsSkeletonWithSchema } from "./DSMenuItemsSkeleton.js";
3
+ import {} from "./react-desc-prop-types.js";
4
+ export {
5
+ DSMenuItemsSkeleton,
6
+ DSMenuItemsSkeletonWithSchema
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 { DSMenuItemsSkeleton, DSMenuItemsSkeletonWithSchema } from './DSMenuItemsSkeleton.js';\nexport { type DSMenuItemsSkeletonT } from './react-desc-prop-types.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,qBAAqB,qCAAqC;AACnE,eAA0C;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,23 @@
1
+ import * as React from "react";
2
+ import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-props-helpers";
3
+ const defaultProps = {
4
+ wrapperStyles: {}
5
+ };
6
+ const DSMenuItemsSkeletonPropTypes = {
7
+ // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps
8
+ // they are NOT inherited from a common element from ds-menu-items-commons
9
+ ...globalAttributesPropTypes,
10
+ ...xstyledPropTypes,
11
+ dsId: PropTypes.string.description(
12
+ 'This is used as "id" in the DOM, you need this to be able to make this A11Y accessible.'
13
+ ).isRequired,
14
+ isActive: PropTypes.bool.description("Whether the menu item is active."),
15
+ wrapperStyles: PropTypes.object.description("The styles to apply to the wrapper element, if any.")
16
+ };
17
+ const DSMenuItemsSkeletonPropTypesSchema = DSMenuItemsSkeletonPropTypes;
18
+ export {
19
+ DSMenuItemsSkeletonPropTypes,
20
+ DSMenuItemsSkeletonPropTypesSchema,
21
+ defaultProps
22
+ };
23
+ //# 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 DSMenuItemsCommonsT } from '@elliemae/ds-menu-items-commons';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSMenuItemsSkeletonT {\n /*******************************************************************************************\n ******************************** IMPORTANT DISCLAIMER *************************************\n *******************************************************************************************\n This component violates `common.RequiredProps` because\n - it does not have a 'render' prop\n - it does not have an 'original' prop\n - it does not have an 'innerRef' prop\n - it does not have any \"schema\" validator\n\n Legacy was not supporting global attributes but during the refactor I added them.\n It was not merging \"default\" props either, but I added them as well. (only for wrapperStyles)\n Those changes should be 100% backward compatible.\n \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\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 = {\n wrapperStyles?: DSMenuItemsCommonsT.DefaultProps['wrapperStyles'];\n };\n\n export type OptionalProps = {\n isActive?: boolean;\n };\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSMenuItemsSkeletonT.DefaultProps = {\n wrapperStyles: {},\n};\n\nexport const DSMenuItemsSkeletonPropTypes: DSPropTypesSchema<DSMenuItemsSkeletonT.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 dsId: PropTypes.string.description(\n 'This is used as \"id\" in the DOM, you need this to be able to make this A11Y accessible.',\n ).isRequired,\n isActive: PropTypes.bool.description('Whether the menu item is active.'),\n wrapperStyles: PropTypes.object.description('The styles to apply to the wrapper element, if any.'),\n};\n\nexport const DSMenuItemsSkeletonPropTypesSchema =\n DSMenuItemsSkeletonPropTypes as unknown as WeakValidationMap<DSMenuItemsSkeletonT.Props>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AAkDhE,MAAM,eAAkD;AAAA,EAC7D,eAAe,CAAC;AAClB;AAEO,MAAM,+BAAsF;AAAA;AAAA;AAAA,EAGjG,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,UAAU,OAAO;AAAA,IACrB;AAAA,EACF,EAAE;AAAA,EACF,UAAU,UAAU,KAAK,YAAY,kCAAkC;AAAA,EACvE,eAAe,UAAU,OAAO,YAAY,qDAAqD;AACnG;AAEO,MAAM,qCACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { type DSMenuItemsSkeletonT } from './react-desc-prop-types.js';
3
+ declare const DSMenuItemsSkeleton: React.ComponentType<DSMenuItemsSkeletonT.Props>;
4
+ declare const DSMenuItemsSkeletonWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSMenuItemsSkeletonT.Props>;
5
+ export { DSMenuItemsSkeleton, DSMenuItemsSkeletonWithSchema };
@@ -0,0 +1,13 @@
1
+ /// <reference types="lodash" />
2
+ import { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';
3
+ import { type DSMenuItemsSkeletonT } from '../react-desc-prop-types.js';
4
+ export interface MenuItemsSkeletonCTX {
5
+ propsWithDefault: DSMenuItemsSkeletonT.InternalProps;
6
+ globalProps: ReturnType<typeof useGetGlobalAttributes>;
7
+ xstyledProps: ReturnType<typeof useGetXstyledProps>;
8
+ }
9
+ export declare const useMenuItemsSkeleton: (propsFromUser: DSMenuItemsSkeletonT.Props) => {
10
+ propsWithDefault: DSMenuItemsSkeletonT.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 DSMenuItemsSkeletonT } from '../react-desc-prop-types.js';
3
+ export declare const useValidateProps: (props: DSMenuItemsSkeletonT.InternalProps, propTypes: WeakValidationMap<unknown>) => void;
File without changes
@@ -0,0 +1,2 @@
1
+ export { DSMenuItemsSkeleton, DSMenuItemsSkeletonWithSchema } from './DSMenuItemsSkeleton.js';
2
+ export { type DSMenuItemsSkeletonT } from './react-desc-prop-types.js';
@@ -0,0 +1,34 @@
1
+ import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';
2
+ import { type DSMenuItemsCommonsT } from '@elliemae/ds-menu-items-commons';
3
+ import type { WeakValidationMap } from 'react';
4
+ export declare namespace DSMenuItemsSkeletonT {
5
+ /*******************************************************************************************
6
+ ******************************** IMPORTANT DISCLAIMER *************************************
7
+ *******************************************************************************************
8
+ This component violates `common.RequiredProps` because
9
+ - it does not have a 'render' prop
10
+ - it does not have an 'original' prop
11
+ - it does not have an 'innerRef' prop
12
+ - it does not have any "schema" validator
13
+
14
+ Legacy was not supporting global attributes but during the refactor I added them.
15
+ It was not merging "default" props either, but I added them as well. (only for wrapperStyles)
16
+ Those changes should be 100% backward compatible.
17
+
18
+ I am reflecting what the code is actually doing instead of what we "meant" to do.
19
+ ***************************************************************************************** */
20
+ type RequiredProps = DSMenuItemsCommonsT.RequiredProps;
21
+ type DefaultProps = {
22
+ wrapperStyles?: DSMenuItemsCommonsT.DefaultProps['wrapperStyles'];
23
+ };
24
+ type OptionalProps = {
25
+ isActive?: boolean;
26
+ };
27
+ interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>, XstyledProps, RequiredProps {
28
+ }
29
+ interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>, XstyledProps, RequiredProps {
30
+ }
31
+ }
32
+ export declare const defaultProps: DSMenuItemsSkeletonT.DefaultProps;
33
+ export declare const DSMenuItemsSkeletonPropTypes: DSPropTypesSchema<DSMenuItemsSkeletonT.InternalProps>;
34
+ export declare const DSMenuItemsSkeletonPropTypesSchema: WeakValidationMap<DSMenuItemsSkeletonT.Props>;
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@elliemae/ds-menu-items-skeleton",
3
+ "version": "3.27.0-next.11",
4
+ "license": "MIT",
5
+ "description": "ICE MT - Dimsum - Menu Items Skeleton",
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-menu-items-commons": "3.27.0-next.11",
40
+ "@elliemae/ds-props-helpers": "3.27.0-next.11",
41
+ "@elliemae/ds-skeleton": "3.27.0-next.11",
42
+ "@elliemae/ds-utilities": "3.27.0-next.11"
43
+ },
44
+ "devDependencies": {
45
+ "lodash": "^4.17.21",
46
+ "styled-components": "~5.3.9",
47
+ "@elliemae/ds-monorepo-devops": "3.27.0-next.11"
48
+ },
49
+ "peerDependencies": {
50
+ "@testing-library/jest-dom": "~5.16.4",
51
+ "@testing-library/react": "~12.1.3",
52
+ "@testing-library/user-event": "~13.5.0",
53
+ "lodash": "^4.17.21",
54
+ "react": "^17.0.2",
55
+ "react-dom": "^17.0.2",
56
+ "styled-components": "~5.3.9"
57
+ },
58
+ "publishConfig": {
59
+ "access": "public",
60
+ "typeSafety": true
61
+ },
62
+ "scripts": {
63
+ "dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
64
+ "test": "pui-cli test --passWithNoTests",
65
+ "lint": "node ../../../scripts/lint.mjs --fix",
66
+ "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
67
+ "dts": "node ../../scripts/dts.mjs",
68
+ "dts:withdeps": "pnpm --filter {.}... dts",
69
+ "build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
70
+ "dev:build": "pnpm --filter {.}... build",
71
+ "dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
72
+ "checkDeps": "npx -yes ../../util/ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
73
+ }
74
+ }