@elliemae/ds-menu-items-separator 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.
- package/dist/cjs/DSMenuItemsSeparator.js +61 -0
- package/dist/cjs/DSMenuItemsSeparator.js.map +7 -0
- package/dist/cjs/config/useMenuItemsSeparator.js +62 -0
- package/dist/cjs/config/useMenuItemsSeparator.js.map +7 -0
- package/dist/cjs/config/useValidateProps.js +41 -0
- package/dist/cjs/config/useValidateProps.js.map +7 -0
- package/dist/cjs/constants/index.js +25 -0
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +38 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/react-desc-prop-types.js +56 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/esm/DSMenuItemsSeparator.js +31 -0
- package/dist/esm/DSMenuItemsSeparator.js.map +7 -0
- package/dist/esm/config/useMenuItemsSeparator.js +32 -0
- package/dist/esm/config/useMenuItemsSeparator.js.map +7 -0
- package/dist/esm/config/useValidateProps.js +11 -0
- package/dist/esm/config/useValidateProps.js.map +7 -0
- package/dist/esm/constants/index.js +2 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/react-desc-prop-types.js +29 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/types/DSMenuItemsSeparator.d.ts +5 -0
- package/dist/types/config/useMenuItemsSeparator.d.ts +13 -0
- package/dist/types/config/useValidateProps.d.ts +3 -0
- package/dist/types/constants/index.d.ts +0 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/react-desc-prop-types.d.ts +27 -0
- package/package.json +76 -0
|
@@ -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 DSMenuItemsSeparator_exports = {};
|
|
30
|
+
__export(DSMenuItemsSeparator_exports, {
|
|
31
|
+
DSMenuItemsSeparator: () => DSMenuItemsSeparator,
|
|
32
|
+
DSMenuItemsSeparatorWithSchema: () => DSMenuItemsSeparatorWithSchema
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(DSMenuItemsSeparator_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_useMenuItemsSeparator = require("./config/useMenuItemsSeparator.js");
|
|
41
|
+
const DSMenuItemsSeparator = (props) => {
|
|
42
|
+
const { propsWithDefault, globalProps, xstyledProps } = (0, import_useMenuItemsSeparator.useMenuItemsSeparator)(props);
|
|
43
|
+
const { wrapperStyles, innerRef, render: Render } = propsWithDefault;
|
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
+
import_ds_menu_items_commons.StyledSeparatorWrapper,
|
|
46
|
+
{
|
|
47
|
+
style: wrapperStyles,
|
|
48
|
+
innerRef,
|
|
49
|
+
"aria-label": "separator",
|
|
50
|
+
role: "option",
|
|
51
|
+
tabIndex: void 0,
|
|
52
|
+
...globalProps,
|
|
53
|
+
...xstyledProps,
|
|
54
|
+
children: Render ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Render, { ...propsWithDefault }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_menu_items_commons.StyledSeparator, {})
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
DSMenuItemsSeparator.displayName = "DSMenuItemSeparator";
|
|
59
|
+
const DSMenuItemsSeparatorWithSchema = (0, import_ds_props_helpers.describe)(DSMenuItemsSeparator);
|
|
60
|
+
DSMenuItemsSeparatorWithSchema.propTypes = import_react_desc_prop_types.DSMenuItemsSeparatorPropTypesSchema;
|
|
61
|
+
//# sourceMappingURL=DSMenuItemsSeparator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSMenuItemsSeparator.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { StyledSeparatorWrapper, StyledSeparator } from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsSeparatorT, DSMenuItemsSeparatorPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsSeparator } from './config/useMenuItemsSeparator.js';\n\nconst DSMenuItemsSeparator: React.ComponentType<DSMenuItemsSeparatorT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useMenuItemsSeparator(props);\n const { wrapperStyles, innerRef, render: Render } = propsWithDefault;\n return (\n <StyledSeparatorWrapper\n style={wrapperStyles}\n innerRef={innerRef}\n aria-label=\"separator\"\n role=\"option\"\n tabIndex={undefined}\n {...globalProps}\n {...xstyledProps}\n >\n {Render ? <Render {...propsWithDefault} /> : <StyledSeparator />}\n </StyledSeparatorWrapper>\n );\n};\n\n// this is `'DSMenuItemSeparator'` for legacy reasons, when moving to inheritance pattern this has been kept as it was to avoid complications\nDSMenuItemsSeparator.displayName = 'DSMenuItemSeparator';\nconst DSMenuItemsSeparatorWithSchema = describe(DSMenuItemsSeparator);\nDSMenuItemsSeparatorWithSchema.propTypes = DSMenuItemsSeparatorPropTypesSchema;\n\nexport { DSMenuItemsSeparator, DSMenuItemsSeparatorWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmBP;AAlBhB,8BAAyB;AACzB,mCAAwD;AACxD,mCAAgF;AAChF,mCAAsC;AAEtC,MAAM,uBAAyE,CAAC,UAAU;AACxF,QAAM,EAAE,kBAAkB,aAAa,aAAa,QAAI,oDAAsB,KAAK;AACnF,QAAM,EAAE,eAAe,UAAU,QAAQ,OAAO,IAAI;AACpD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,MACP;AAAA,MACA,cAAW;AAAA,MACX,MAAK;AAAA,MACL,UAAU;AAAA,MACT,GAAG;AAAA,MACH,GAAG;AAAA,MAEH,mBAAS,4CAAC,UAAQ,GAAG,kBAAkB,IAAK,4CAAC,gDAAgB;AAAA;AAAA,EAChE;AAEJ;AAGA,qBAAqB,cAAc;AACnC,MAAM,qCAAiC,kCAAS,oBAAoB;AACpE,+BAA+B,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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 useMenuItemsSeparator_exports = {};
|
|
30
|
+
__export(useMenuItemsSeparator_exports, {
|
|
31
|
+
useMenuItemsSeparator: () => useMenuItemsSeparator
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useMenuItemsSeparator_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 useMenuItemsSeparator = (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.DSMenuItemsSeparatorPropTypes);
|
|
46
|
+
const sourceGlobalProps = propsWithDefault.original ?? propsWithDefault;
|
|
47
|
+
const globalProps = (0, import_lodash.omit)((0, import_ds_props_helpers.useGetGlobalAttributes)(sourceGlobalProps), [
|
|
48
|
+
"cols",
|
|
49
|
+
"rows",
|
|
50
|
+
"wrap"
|
|
51
|
+
]);
|
|
52
|
+
const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(sourceGlobalProps);
|
|
53
|
+
return import_react.default.useMemo(
|
|
54
|
+
() => ({
|
|
55
|
+
propsWithDefault,
|
|
56
|
+
globalProps,
|
|
57
|
+
xstyledProps
|
|
58
|
+
}),
|
|
59
|
+
[propsWithDefault, globalProps, xstyledProps]
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=useMenuItemsSeparator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/useMenuItemsSeparator.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 DSMenuItemsSeparatorT, DSMenuItemsSeparatorPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface MenuItemsSeparatorCTX {\n propsWithDefault: DSMenuItemsSeparatorT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n}\n\nexport const useMenuItemsSeparator = (propsFromUser: DSMenuItemsSeparatorT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSMenuItemsSeparatorT.InternalProps>(\n propsFromUser,\n defaultProps,\n );\n useValidateProps(propsWithDefault, DSMenuItemsSeparatorPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n\n // menuitems use original prop from dsdropdownmenu or dscombobox\n // We may want to review if this is required or makes sense, but for now we will keep it to avoid breaking changes\n const sourceGlobalProps =\n (propsWithDefault.original as unknown as DSMenuItemsSeparatorT.InternalProps) ?? propsWithDefault;\n\n const globalProps = omit(useGetGlobalAttributes<DSMenuItemsSeparatorT.InternalProps>(sourceGlobalProps), [\n 'cols',\n 'rows',\n 'wrap',\n ]);\n const xstyledProps = useGetXstyledProps(sourceGlobalProps);\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,mCAAwF;AACxF,8BAAiC;AAQ1B,MAAM,wBAAwB,CAAC,kBAA+C;AAInF,QAAM,uBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,gDAAiB,kBAAkB,0DAA6B;AAOhE,QAAM,oBACH,iBAAiB,YAA+D;AAEnF,QAAM,kBAAc,wBAAK,gDAA4D,iBAAiB,GAAG;AAAA,IACvG;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,mBAAe,4CAAmB,iBAAiB;AACzD,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 DSMenuItemsSeparatorName = `${import_ds_menu_items_commons.DSMenuItemName}Separator`;
|
|
38
|
+
const useValidateProps = (props, propTypes) => {
|
|
39
|
+
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, DSMenuItemsSeparatorName);
|
|
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 DSMenuItemsSeparatorT } 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 DSMenuItemsSeparatorName = `${DSMenuItemName}Separator`;\n\nexport const useValidateProps = (\n props: DSMenuItemsSeparatorT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsSeparatorName);\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,2BAA2B,GAAG;AAE7B,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,8DAA+B,OAAO,WAAW,wBAAwB;AAC3E;",
|
|
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,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
|
+
DSMenuItemsSeparator: () => import_DSMenuItemsSeparator.DSMenuItemsSeparator,
|
|
32
|
+
DSMenuItemsSeparatorWithSchema: () => import_DSMenuItemsSeparator.DSMenuItemsSeparatorWithSchema
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(src_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_DSMenuItemsSeparator = require("./DSMenuItemsSeparator.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 { DSMenuItemsSeparator, DSMenuItemsSeparatorWithSchema } from './DSMenuItemsSeparator.js';\nexport { type DSMenuItemsSeparatorT } 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,kCAAqE;AACrE,mCAA2C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
DSMenuItemsSeparatorPropTypes: () => DSMenuItemsSeparatorPropTypes,
|
|
32
|
+
DSMenuItemsSeparatorPropTypesSchema: () => DSMenuItemsSeparatorPropTypesSchema,
|
|
33
|
+
defaultProps: () => defaultProps
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
|
+
var import_ds_menu_items_commons = require("@elliemae/ds-menu-items-commons");
|
|
39
|
+
const defaultProps = {
|
|
40
|
+
...import_ds_menu_items_commons.DSMenuItemsCommonsDefaultProps,
|
|
41
|
+
role: "option"
|
|
42
|
+
};
|
|
43
|
+
const { dsId, ...commonsWithoutOverwrites } = import_ds_menu_items_commons.DSMenuItemsCommonsPropTypes;
|
|
44
|
+
const DSMenuItemsSeparatorPropTypes = {
|
|
45
|
+
// each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps
|
|
46
|
+
// they are NOT inherited from a common element from ds-menu-items-commons
|
|
47
|
+
...import_ds_props_helpers.xstyledPropTypes,
|
|
48
|
+
...commonsWithoutOverwrites,
|
|
49
|
+
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
50
|
+
role: import_ds_props_helpers.PropTypes.string.description('the arial role to apply to the separator, defaults to "option"').defaultValue("option"),
|
|
51
|
+
tabIndex: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.number, import_ds_props_helpers.PropTypes.string]).description(
|
|
52
|
+
"The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed."
|
|
53
|
+
)
|
|
54
|
+
};
|
|
55
|
+
const DSMenuItemsSeparatorPropTypesSchema = DSMenuItemsSeparatorPropTypes;
|
|
56
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n type DSMenuItemsCommonsT,\n DSMenuItemsCommonsPropTypes,\n DSMenuItemsCommonsDefaultProps,\n} from '@elliemae/ds-menu-items-commons';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSMenuItemsSeparatorT {\n /*******************************************************************************************\n ******************************** IMPORTANT DISCLAIMER *************************************\n *******************************************************************************************\n This component violates `common.RequiredProps` because\n - it does not have a `dsId` prop\n - not only it is not required, it's literally ignored\n this is \"okay\" because the separator is not selectable nor activatable, but may not scale well...\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 export type RequiredProps = Record<string, never>;\n\n export type DefaultProps = DSMenuItemsCommonsT.DefaultProps & {\n role?: string;\n };\n\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsSeparatorT.InternalProps>;\n\n // this is not \"standard\" because of what was said in the disclaimer above.\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n // no \"RequiredProps\" because of what was said in the disclaimer above.\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n // no \"RequiredProps\" because of what was said in the disclaimer above.\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps {}\n}\n\nexport const defaultProps: DSMenuItemsSeparatorT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n role: 'option',\n};\n\n// check the disclaimer above, this affects the validation.\n// eslint-disable-next-line no-unused-vars\nconst { dsId, ...commonsWithoutOverwrites } = DSMenuItemsCommonsPropTypes;\n\nexport const DSMenuItemsSeparatorPropTypes: DSPropTypesSchema<DSMenuItemsSeparatorT.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 ...xstyledPropTypes,\n ...commonsWithoutOverwrites,\n ...globalAttributesPropTypes,\n role: PropTypes.string\n .description('the arial role to apply to the separator, defaults to \"option\"')\n .defaultValue('option'),\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description(\n 'The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed.',\n ),\n};\n\nexport const DSMenuItemsSeparatorPropTypesSchema =\n DSMenuItemsSeparatorPropTypes as unknown as WeakValidationMap<DSMenuItemsSeparatorT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;AACvE,mCAIO;AAyCA,MAAM,eAAmD;AAAA,EAC9D,GAAG;AAAA,EACH,MAAM;AACR;AAIA,MAAM,EAAE,MAAM,GAAG,yBAAyB,IAAI;AAEvC,MAAM,gCAAwF;AAAA;AAAA;AAAA,EAGnG,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,kCAAU,OACb,YAAY,gEAAgE,EAC5E,aAAa,QAAQ;AAAA,EACxB,UAAU,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,EAAE;AAAA,IAClE;AAAA,EACF;AACF;AAEO,MAAM,sCACX;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { describe } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import { StyledSeparatorWrapper, StyledSeparator } from "@elliemae/ds-menu-items-commons";
|
|
5
|
+
import { DSMenuItemsSeparatorPropTypesSchema } from "./react-desc-prop-types.js";
|
|
6
|
+
import { useMenuItemsSeparator } from "./config/useMenuItemsSeparator.js";
|
|
7
|
+
const DSMenuItemsSeparator = (props) => {
|
|
8
|
+
const { propsWithDefault, globalProps, xstyledProps } = useMenuItemsSeparator(props);
|
|
9
|
+
const { wrapperStyles, innerRef, render: Render } = propsWithDefault;
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
StyledSeparatorWrapper,
|
|
12
|
+
{
|
|
13
|
+
style: wrapperStyles,
|
|
14
|
+
innerRef,
|
|
15
|
+
"aria-label": "separator",
|
|
16
|
+
role: "option",
|
|
17
|
+
tabIndex: void 0,
|
|
18
|
+
...globalProps,
|
|
19
|
+
...xstyledProps,
|
|
20
|
+
children: Render ? /* @__PURE__ */ jsx(Render, { ...propsWithDefault }) : /* @__PURE__ */ jsx(StyledSeparator, {})
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
DSMenuItemsSeparator.displayName = "DSMenuItemSeparator";
|
|
25
|
+
const DSMenuItemsSeparatorWithSchema = describe(DSMenuItemsSeparator);
|
|
26
|
+
DSMenuItemsSeparatorWithSchema.propTypes = DSMenuItemsSeparatorPropTypesSchema;
|
|
27
|
+
export {
|
|
28
|
+
DSMenuItemsSeparator,
|
|
29
|
+
DSMenuItemsSeparatorWithSchema
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=DSMenuItemsSeparator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSMenuItemsSeparator.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { StyledSeparatorWrapper, StyledSeparator } from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsSeparatorT, DSMenuItemsSeparatorPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsSeparator } from './config/useMenuItemsSeparator.js';\n\nconst DSMenuItemsSeparator: React.ComponentType<DSMenuItemsSeparatorT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useMenuItemsSeparator(props);\n const { wrapperStyles, innerRef, render: Render } = propsWithDefault;\n return (\n <StyledSeparatorWrapper\n style={wrapperStyles}\n innerRef={innerRef}\n aria-label=\"separator\"\n role=\"option\"\n tabIndex={undefined}\n {...globalProps}\n {...xstyledProps}\n >\n {Render ? <Render {...propsWithDefault} /> : <StyledSeparator />}\n </StyledSeparatorWrapper>\n );\n};\n\n// this is `'DSMenuItemSeparator'` for legacy reasons, when moving to inheritance pattern this has been kept as it was to avoid complications\nDSMenuItemsSeparator.displayName = 'DSMenuItemSeparator';\nconst DSMenuItemsSeparatorWithSchema = describe(DSMenuItemsSeparator);\nDSMenuItemsSeparatorWithSchema.propTypes = DSMenuItemsSeparatorPropTypesSchema;\n\nexport { DSMenuItemsSeparator, DSMenuItemsSeparatorWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACmBP;AAlBhB,SAAS,gBAAgB;AACzB,SAAS,wBAAwB,uBAAuB;AACxD,SAAqC,2CAA2C;AAChF,SAAS,6BAA6B;AAEtC,MAAM,uBAAyE,CAAC,UAAU;AACxF,QAAM,EAAE,kBAAkB,aAAa,aAAa,IAAI,sBAAsB,KAAK;AACnF,QAAM,EAAE,eAAe,UAAU,QAAQ,OAAO,IAAI;AACpD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,MACP;AAAA,MACA,cAAW;AAAA,MACX,MAAK;AAAA,MACL,UAAU;AAAA,MACT,GAAG;AAAA,MACH,GAAG;AAAA,MAEH,mBAAS,oBAAC,UAAQ,GAAG,kBAAkB,IAAK,oBAAC,mBAAgB;AAAA;AAAA,EAChE;AAEJ;AAGA,qBAAqB,cAAc;AACnC,MAAM,iCAAiC,SAAS,oBAAoB;AACpE,+BAA+B,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 { DSMenuItemsSeparatorPropTypes, defaultProps } from "../react-desc-prop-types.js";
|
|
6
|
+
import { useValidateProps } from "./useValidateProps.js";
|
|
7
|
+
const useMenuItemsSeparator = (propsFromUser) => {
|
|
8
|
+
const propsWithDefault = useMemoMergePropsWithDefault(
|
|
9
|
+
propsFromUser,
|
|
10
|
+
defaultProps
|
|
11
|
+
);
|
|
12
|
+
useValidateProps(propsWithDefault, DSMenuItemsSeparatorPropTypes);
|
|
13
|
+
const sourceGlobalProps = propsWithDefault.original ?? propsWithDefault;
|
|
14
|
+
const globalProps = omit(useGetGlobalAttributes(sourceGlobalProps), [
|
|
15
|
+
"cols",
|
|
16
|
+
"rows",
|
|
17
|
+
"wrap"
|
|
18
|
+
]);
|
|
19
|
+
const xstyledProps = useGetXstyledProps(sourceGlobalProps);
|
|
20
|
+
return React2.useMemo(
|
|
21
|
+
() => ({
|
|
22
|
+
propsWithDefault,
|
|
23
|
+
globalProps,
|
|
24
|
+
xstyledProps
|
|
25
|
+
}),
|
|
26
|
+
[propsWithDefault, globalProps, xstyledProps]
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
useMenuItemsSeparator
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=useMenuItemsSeparator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useMenuItemsSeparator.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 DSMenuItemsSeparatorT, DSMenuItemsSeparatorPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface MenuItemsSeparatorCTX {\n propsWithDefault: DSMenuItemsSeparatorT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n}\n\nexport const useMenuItemsSeparator = (propsFromUser: DSMenuItemsSeparatorT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSMenuItemsSeparatorT.InternalProps>(\n propsFromUser,\n defaultProps,\n );\n useValidateProps(propsWithDefault, DSMenuItemsSeparatorPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n\n // menuitems use original prop from dsdropdownmenu or dscombobox\n // We may want to review if this is required or makes sense, but for now we will keep it to avoid breaking changes\n const sourceGlobalProps =\n (propsWithDefault.original as unknown as DSMenuItemsSeparatorT.InternalProps) ?? propsWithDefault;\n\n const globalProps = omit(useGetGlobalAttributes<DSMenuItemsSeparatorT.InternalProps>(sourceGlobalProps), [\n 'cols',\n 'rows',\n 'wrap',\n ]);\n const xstyledProps = useGetXstyledProps(sourceGlobalProps);\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,SAAqC,+BAA+B,oBAAoB;AACxF,SAAS,wBAAwB;AAQ1B,MAAM,wBAAwB,CAAC,kBAA+C;AAInF,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,mBAAiB,kBAAkB,6BAA6B;AAOhE,QAAM,oBACH,iBAAiB,YAA+D;AAEnF,QAAM,cAAc,KAAK,uBAA4D,iBAAiB,GAAG;AAAA,IACvG;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,eAAe,mBAAmB,iBAAiB;AACzD,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 DSMenuItemsSeparatorName = `${DSMenuItemName}Separator`;
|
|
5
|
+
const useValidateProps = (props, propTypes) => {
|
|
6
|
+
useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsSeparatorName);
|
|
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 DSMenuItemsSeparatorT } 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 DSMenuItemsSeparatorName = `${DSMenuItemName}Separator`;\n\nexport const useValidateProps = (\n props: DSMenuItemsSeparatorT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsSeparatorName);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAC/C,SAAS,sBAAsB;AAQ/B,MAAM,2BAA2B,GAAG;AAE7B,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,wBAAwB;AAC3E;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DSMenuItemsSeparator, DSMenuItemsSeparatorWithSchema } from "./DSMenuItemsSeparator.js";
|
|
3
|
+
import {} from "./react-desc-prop-types.js";
|
|
4
|
+
export {
|
|
5
|
+
DSMenuItemsSeparator,
|
|
6
|
+
DSMenuItemsSeparatorWithSchema
|
|
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 { DSMenuItemsSeparator, DSMenuItemsSeparatorWithSchema } from './DSMenuItemsSeparator.js';\nexport { type DSMenuItemsSeparatorT } from './react-desc-prop-types.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,sBAAsB,sCAAsC;AACrE,eAA2C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import {
|
|
4
|
+
DSMenuItemsCommonsPropTypes,
|
|
5
|
+
DSMenuItemsCommonsDefaultProps
|
|
6
|
+
} from "@elliemae/ds-menu-items-commons";
|
|
7
|
+
const defaultProps = {
|
|
8
|
+
...DSMenuItemsCommonsDefaultProps,
|
|
9
|
+
role: "option"
|
|
10
|
+
};
|
|
11
|
+
const { dsId, ...commonsWithoutOverwrites } = DSMenuItemsCommonsPropTypes;
|
|
12
|
+
const DSMenuItemsSeparatorPropTypes = {
|
|
13
|
+
// each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps
|
|
14
|
+
// they are NOT inherited from a common element from ds-menu-items-commons
|
|
15
|
+
...xstyledPropTypes,
|
|
16
|
+
...commonsWithoutOverwrites,
|
|
17
|
+
...globalAttributesPropTypes,
|
|
18
|
+
role: PropTypes.string.description('the arial role to apply to the separator, defaults to "option"').defaultValue("option"),
|
|
19
|
+
tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description(
|
|
20
|
+
"The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed."
|
|
21
|
+
)
|
|
22
|
+
};
|
|
23
|
+
const DSMenuItemsSeparatorPropTypesSchema = DSMenuItemsSeparatorPropTypes;
|
|
24
|
+
export {
|
|
25
|
+
DSMenuItemsSeparatorPropTypes,
|
|
26
|
+
DSMenuItemsSeparatorPropTypesSchema,
|
|
27
|
+
defaultProps
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n type DSMenuItemsCommonsT,\n DSMenuItemsCommonsPropTypes,\n DSMenuItemsCommonsDefaultProps,\n} from '@elliemae/ds-menu-items-commons';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSMenuItemsSeparatorT {\n /*******************************************************************************************\n ******************************** IMPORTANT DISCLAIMER *************************************\n *******************************************************************************************\n This component violates `common.RequiredProps` because\n - it does not have a `dsId` prop\n - not only it is not required, it's literally ignored\n this is \"okay\" because the separator is not selectable nor activatable, but may not scale well...\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 export type RequiredProps = Record<string, never>;\n\n export type DefaultProps = DSMenuItemsCommonsT.DefaultProps & {\n role?: string;\n };\n\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsSeparatorT.InternalProps>;\n\n // this is not \"standard\" because of what was said in the disclaimer above.\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n // no \"RequiredProps\" because of what was said in the disclaimer above.\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n // no \"RequiredProps\" because of what was said in the disclaimer above.\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps {}\n}\n\nexport const defaultProps: DSMenuItemsSeparatorT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n role: 'option',\n};\n\n// check the disclaimer above, this affects the validation.\n// eslint-disable-next-line no-unused-vars\nconst { dsId, ...commonsWithoutOverwrites } = DSMenuItemsCommonsPropTypes;\n\nexport const DSMenuItemsSeparatorPropTypes: DSPropTypesSchema<DSMenuItemsSeparatorT.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 ...xstyledPropTypes,\n ...commonsWithoutOverwrites,\n ...globalAttributesPropTypes,\n role: PropTypes.string\n .description('the arial role to apply to the separator, defaults to \"option\"')\n .defaultValue('option'),\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description(\n 'The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed.',\n ),\n};\n\nexport const DSMenuItemsSeparatorPropTypesSchema =\n DSMenuItemsSeparatorPropTypes as unknown as WeakValidationMap<DSMenuItemsSeparatorT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AAyCA,MAAM,eAAmD;AAAA,EAC9D,GAAG;AAAA,EACH,MAAM;AACR;AAIA,MAAM,EAAE,MAAM,GAAG,yBAAyB,IAAI;AAEvC,MAAM,gCAAwF;AAAA;AAAA;AAAA,EAGnG,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,UAAU,OACb,YAAY,gEAAgE,EAC5E,aAAa,QAAQ;AAAA,EACxB,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE;AAAA,IAClE;AAAA,EACF;AACF;AAEO,MAAM,sCACX;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DSMenuItemsSeparatorT } from './react-desc-prop-types.js';
|
|
3
|
+
declare const DSMenuItemsSeparator: React.ComponentType<DSMenuItemsSeparatorT.Props>;
|
|
4
|
+
declare const DSMenuItemsSeparatorWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSMenuItemsSeparatorT.Props>;
|
|
5
|
+
export { DSMenuItemsSeparator, DSMenuItemsSeparatorWithSchema };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';
|
|
3
|
+
import { type DSMenuItemsSeparatorT } from '../react-desc-prop-types.js';
|
|
4
|
+
export interface MenuItemsSeparatorCTX {
|
|
5
|
+
propsWithDefault: DSMenuItemsSeparatorT.InternalProps;
|
|
6
|
+
globalProps: ReturnType<typeof useGetGlobalAttributes>;
|
|
7
|
+
xstyledProps: ReturnType<typeof useGetXstyledProps>;
|
|
8
|
+
}
|
|
9
|
+
export declare const useMenuItemsSeparator: (propsFromUser: DSMenuItemsSeparatorT.Props) => {
|
|
10
|
+
propsWithDefault: DSMenuItemsSeparatorT.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
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
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 DSMenuItemsSeparatorT {
|
|
5
|
+
/*******************************************************************************************
|
|
6
|
+
******************************** IMPORTANT DISCLAIMER *************************************
|
|
7
|
+
*******************************************************************************************
|
|
8
|
+
This component violates `common.RequiredProps` because
|
|
9
|
+
- it does not have a `dsId` prop
|
|
10
|
+
- not only it is not required, it's literally ignored
|
|
11
|
+
this is "okay" because the separator is not selectable nor activatable, but may not scale well...
|
|
12
|
+
|
|
13
|
+
I am reflecting what the code is actually doing instead of what we "meant" to do.
|
|
14
|
+
***************************************************************************************** */
|
|
15
|
+
type RequiredProps = Record<string, never>;
|
|
16
|
+
type DefaultProps = DSMenuItemsCommonsT.DefaultProps & {
|
|
17
|
+
role?: string;
|
|
18
|
+
};
|
|
19
|
+
type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsSeparatorT.InternalProps>;
|
|
20
|
+
interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>, XstyledProps {
|
|
21
|
+
}
|
|
22
|
+
interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>, XstyledProps {
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export declare const defaultProps: DSMenuItemsSeparatorT.DefaultProps;
|
|
26
|
+
export declare const DSMenuItemsSeparatorPropTypes: DSPropTypesSchema<DSMenuItemsSeparatorT.InternalProps>;
|
|
27
|
+
export declare const DSMenuItemsSeparatorPropTypesSchema: WeakValidationMap<DSMenuItemsSeparatorT.Props>;
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elliemae/ds-menu-items-separator",
|
|
3
|
+
"version": "3.27.0-next.11",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "ICE MT - Dimsum - Menu Items Separator",
|
|
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
|
+
}
|