@elliemae/ds-legacy-accordion 1.0.0-rc.1
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/DSAccordion.js +52 -0
- package/dist/cjs/DSAccordion.js.map +7 -0
- package/dist/cjs/DSAccordionCTX.js +38 -0
- package/dist/cjs/DSAccordionCTX.js.map +7 -0
- package/dist/cjs/config/useAccordion.js +80 -0
- package/dist/cjs/config/useAccordion.js.map +7 -0
- package/dist/cjs/config/useAccordionRefs.js +51 -0
- package/dist/cjs/config/useAccordionRefs.js.map +7 -0
- package/dist/cjs/defaultProps.js +63 -0
- package/dist/cjs/defaultProps.js.map +7 -0
- package/dist/cjs/exported-related/DSAccordionDefinitions.js +58 -0
- package/dist/cjs/exported-related/DSAccordionDefinitions.js.map +7 -0
- package/dist/cjs/exported-related/index.js +30 -0
- package/dist/cjs/exported-related/index.js.map +7 -0
- package/dist/cjs/index.js +40 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/parts/accordionContent/AccordionContent.js +71 -0
- package/dist/cjs/parts/accordionContent/AccordionContent.js.map +7 -0
- package/dist/cjs/parts/accordionContent/styles.js +44 -0
- package/dist/cjs/parts/accordionContent/styles.js.map +7 -0
- package/dist/cjs/parts/accordionItem/DSAccordionItem.js +359 -0
- package/dist/cjs/parts/accordionItem/DSAccordionItem.js.map +7 -0
- package/dist/cjs/parts/accordionItem/styles.js +195 -0
- package/dist/cjs/parts/accordionItem/styles.js.map +7 -0
- package/dist/cjs/parts/accordionItem/useAccordionItem.js +79 -0
- package/dist/cjs/parts/accordionItem/useAccordionItem.js.map +7 -0
- package/dist/cjs/propTypes.js +62 -0
- package/dist/cjs/propTypes.js.map +7 -0
- package/dist/cjs/react-desc-prop-types.js +78 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/sharedTypes.js +28 -0
- package/dist/cjs/sharedTypes.js.map +7 -0
- package/dist/esm/DSAccordion.js +22 -0
- package/dist/esm/DSAccordion.js.map +7 -0
- package/dist/esm/DSAccordionCTX.js +8 -0
- package/dist/esm/DSAccordionCTX.js.map +7 -0
- package/dist/esm/config/useAccordion.js +50 -0
- package/dist/esm/config/useAccordion.js.map +7 -0
- package/dist/esm/config/useAccordionRefs.js +21 -0
- package/dist/esm/config/useAccordionRefs.js.map +7 -0
- package/dist/esm/defaultProps.js +33 -0
- package/dist/esm/defaultProps.js.map +7 -0
- package/dist/esm/exported-related/DSAccordionDefinitions.js +28 -0
- package/dist/esm/exported-related/DSAccordionDefinitions.js.map +7 -0
- package/dist/esm/exported-related/index.js +3 -0
- package/dist/esm/exported-related/index.js.map +7 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/parts/accordionContent/AccordionContent.js +41 -0
- package/dist/esm/parts/accordionContent/AccordionContent.js.map +7 -0
- package/dist/esm/parts/accordionContent/styles.js +14 -0
- package/dist/esm/parts/accordionContent/styles.js.map +7 -0
- package/dist/esm/parts/accordionItem/DSAccordionItem.js +345 -0
- package/dist/esm/parts/accordionItem/DSAccordionItem.js.map +7 -0
- package/dist/esm/parts/accordionItem/styles.js +165 -0
- package/dist/esm/parts/accordionItem/styles.js.map +7 -0
- package/dist/esm/parts/accordionItem/useAccordionItem.js +49 -0
- package/dist/esm/parts/accordionItem/useAccordionItem.js.map +7 -0
- package/dist/esm/propTypes.js +32 -0
- package/dist/esm/propTypes.js.map +7 -0
- package/dist/esm/react-desc-prop-types.js +53 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/sharedTypes.js +2 -0
- package/dist/esm/sharedTypes.js.map +7 -0
- package/dist/types/DSAccordion.d.ts +9 -0
- package/dist/types/DSAccordionCTX.d.ts +12 -0
- package/dist/types/config/useAccordion.d.ts +12 -0
- package/dist/types/config/useAccordionRefs.d.ts +12 -0
- package/dist/types/defaultProps.d.ts +3 -0
- package/dist/types/exported-related/DSAccordionDefinitions.d.ts +19 -0
- package/dist/types/exported-related/index.d.ts +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/parts/accordionContent/AccordionContent.d.ts +2 -0
- package/dist/types/parts/accordionContent/styles.d.ts +1 -0
- package/dist/types/parts/accordionItem/DSAccordionItem.d.ts +9 -0
- package/dist/types/parts/accordionItem/styles.d.ts +46 -0
- package/dist/types/parts/accordionItem/useAccordionItem.d.ts +12 -0
- package/dist/types/propTypes.d.ts +17 -0
- package/dist/types/react-desc-prop-types.d.ts +972 -0
- package/dist/types/sharedTypes.d.ts +19 -0
- package/dist/types/tests/Accordion.callback.test.d.ts +1 -0
- package/dist/types/tests/Accordion.keyboard.test.d.ts +1 -0
- package/dist/types/tests/Accordion.test.d.ts +1 -0
- package/dist/types/tests/a11y/axe.test.d.ts +1 -0
- package/package.json +124 -0
|
@@ -0,0 +1,52 @@
|
|
|
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 DSAccordion_exports = {};
|
|
30
|
+
__export(DSAccordion_exports, {
|
|
31
|
+
DSAccordion: () => DSAccordion,
|
|
32
|
+
DSAccordionWithSchema: () => DSAccordionWithSchema,
|
|
33
|
+
default: () => DSAccordion_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(DSAccordion_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
|
+
var import_ds_legacy_props_helpers = require("@elliemae/ds-legacy-props-helpers");
|
|
39
|
+
var import_AccordionContent = require("./parts/accordionContent/AccordionContent.js");
|
|
40
|
+
var import_useAccordion = require("./config/useAccordion.js");
|
|
41
|
+
var import_DSAccordionCTX = require("./DSAccordionCTX.js");
|
|
42
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
43
|
+
var import_exported_related = require("./exported-related/index.js");
|
|
44
|
+
const DSAccordion = (props) => {
|
|
45
|
+
const ctx = (0, import_useAccordion.useAccordion)(props);
|
|
46
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DSAccordionCTX.DSAccordionContext.Provider, { value: ctx, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_AccordionContent.AccordionContent, {}) });
|
|
47
|
+
};
|
|
48
|
+
DSAccordion.displayName = import_exported_related.DSAccordionName;
|
|
49
|
+
const DSAccordionWithSchema = (0, import_ds_legacy_props_helpers.describe)(DSAccordion);
|
|
50
|
+
DSAccordionWithSchema.propTypes = import_react_desc_prop_types.accordionPropTypes;
|
|
51
|
+
var DSAccordion_default = DSAccordion;
|
|
52
|
+
//# sourceMappingURL=DSAccordion.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSAccordion.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe } from '@elliemae/ds-legacy-props-helpers';\nimport { AccordionContent } from './parts/accordionContent/AccordionContent.js';\nimport { useAccordion } from './config/useAccordion.js';\nimport { DSAccordionContext } from './DSAccordionCTX.js';\nimport { accordionPropTypes } from './react-desc-prop-types.js';\nimport type { DSAccordionT } from './react-desc-prop-types.js';\nimport { DSAccordionName } from './exported-related/index.js';\n\nconst DSAccordion = (props: DSAccordionT.Props): JSX.Element => {\n const ctx = useAccordion(props);\n\n return (\n <DSAccordionContext.Provider value={ctx}>\n <AccordionContent />\n </DSAccordionContext.Provider>\n );\n};\n\nDSAccordion.displayName = DSAccordionName;\nconst DSAccordionWithSchema = describe(DSAccordion);\nDSAccordionWithSchema.propTypes = accordionPropTypes as WeakValidationMap<unknown>;\n\nexport { DSAccordion, DSAccordionWithSchema };\n\nexport default DSAccordion;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADejB;AAbN,qCAAyB;AACzB,8BAAiC;AACjC,0BAA6B;AAC7B,4BAAmC;AACnC,mCAAmC;AAEnC,8BAAgC;AAEhC,MAAM,cAAc,CAAC,UAA2C;AAC9D,QAAM,UAAM,kCAAa,KAAK;AAE9B,SACE,4CAAC,yCAAmB,UAAnB,EAA4B,OAAO,KAClC,sDAAC,4CAAiB,GACpB;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,4BAAwB,yCAAS,WAAW;AAClD,sBAAsB,YAAY;AAIlC,IAAO,sBAAQ;",
|
|
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 DSAccordionCTX_exports = {};
|
|
30
|
+
__export(DSAccordionCTX_exports, {
|
|
31
|
+
DSAccordionContext: () => DSAccordionContext
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(DSAccordionCTX_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
const defaultContext = {};
|
|
37
|
+
const DSAccordionContext = (0, import_react.createContext)(defaultContext);
|
|
38
|
+
//# sourceMappingURL=DSAccordionCTX.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSAccordionCTX.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { createContext } from 'react';\nimport type { DSAccordionT } from './react-desc-prop-types.js';\nimport type { DSAccordionInternalsT } from './sharedTypes.js';\n\ninterface DSAccordionContextT {\n props: DSAccordionT.InternalProps;\n actualActiveValue: DSAccordionInternalsT.InternalActiveValue;\n setActiveValues: (value: string | number, e: React.MouseEvent | React.KeyboardEvent) => void;\n focusableChildrenReferences: DSAccordionInternalsT.FocusableChildrenReferences[];\n allChildrenReferences: DSAccordionInternalsT.AllChildrenReferences;\n}\n\nconst defaultContext = {} as DSAccordionContextT;\n\nexport const DSAccordionContext = createContext<DSAccordionContextT>(defaultContext);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAY9B,MAAM,iBAAiB,CAAC;AAEjB,MAAM,yBAAqB,4BAAmC,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
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 useAccordion_exports = {};
|
|
30
|
+
__export(useAccordion_exports, {
|
|
31
|
+
useAccordion: () => useAccordion
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useAccordion_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
var import_ds_legacy_props_helpers = require("@elliemae/ds-legacy-props-helpers");
|
|
37
|
+
var import_useAccordionRefs = require("./useAccordionRefs.js");
|
|
38
|
+
var import_defaultProps = require("../defaultProps.js");
|
|
39
|
+
const useAccordion = (props) => {
|
|
40
|
+
const propsWithDefaults = (0, import_ds_legacy_props_helpers.useMemoMergePropsWithDefault)(props, import_defaultProps.defaultProps);
|
|
41
|
+
const { activeValue, allowMultipleOpen, onChange } = propsWithDefaults;
|
|
42
|
+
const { focusableChildrenReferences, allChildrenReferences } = (0, import_useAccordionRefs.useAccordionRefs)(propsWithDefaults);
|
|
43
|
+
const [internalActiveValue, setInternalActiveValue] = (0, import_react.useState)(activeValue);
|
|
44
|
+
const actualActiveValue = (0, import_react.useMemo)(() => {
|
|
45
|
+
if (activeValue === void 0)
|
|
46
|
+
return internalActiveValue;
|
|
47
|
+
return activeValue;
|
|
48
|
+
}, [activeValue, internalActiveValue]);
|
|
49
|
+
const setActiveValues = (0, import_react.useCallback)(
|
|
50
|
+
(value, e) => {
|
|
51
|
+
let newState;
|
|
52
|
+
if (allowMultipleOpen && (actualActiveValue === void 0 || actualActiveValue === null))
|
|
53
|
+
newState = [value];
|
|
54
|
+
else if (allowMultipleOpen && Array.isArray(actualActiveValue))
|
|
55
|
+
if (!actualActiveValue.some((currentValues) => currentValues === value))
|
|
56
|
+
newState = [...actualActiveValue, value];
|
|
57
|
+
else
|
|
58
|
+
newState = actualActiveValue.filter((currentValues) => currentValues !== value);
|
|
59
|
+
else if (actualActiveValue === value)
|
|
60
|
+
newState = null;
|
|
61
|
+
else
|
|
62
|
+
newState = value;
|
|
63
|
+
setInternalActiveValue(newState);
|
|
64
|
+
return onChange(newState, e);
|
|
65
|
+
},
|
|
66
|
+
[actualActiveValue, allowMultipleOpen, onChange]
|
|
67
|
+
);
|
|
68
|
+
const ctx = (0, import_react.useMemo)(
|
|
69
|
+
() => ({
|
|
70
|
+
props: propsWithDefaults,
|
|
71
|
+
actualActiveValue,
|
|
72
|
+
setActiveValues,
|
|
73
|
+
focusableChildrenReferences,
|
|
74
|
+
allChildrenReferences
|
|
75
|
+
}),
|
|
76
|
+
[actualActiveValue, allChildrenReferences, focusableChildrenReferences, propsWithDefaults, setActiveValues]
|
|
77
|
+
);
|
|
78
|
+
return ctx;
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=useAccordion.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/useAccordion.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import type React from 'react';\nimport { useMemo, useState, useCallback } from 'react';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-legacy-props-helpers';\nimport { useAccordionRefs } from './useAccordionRefs.js';\nimport { defaultProps } from '../defaultProps.js';\nimport type { DSAccordionT } from '../react-desc-prop-types.js';\nimport type { DSAccordionInternalsT } from '../sharedTypes.js';\n\ninterface DSAccordionUseAccordionContextT {\n props: DSAccordionT.InternalProps;\n actualActiveValue: DSAccordionInternalsT.InternalActiveValue;\n setActiveValues: (value: string | number, e: React.MouseEvent | React.KeyboardEvent) => void;\n focusableChildrenReferences: DSAccordionInternalsT.FocusableChildrenReferences[];\n allChildrenReferences: DSAccordionInternalsT.AllChildrenReferences;\n}\n\nexport const useAccordion = (props: DSAccordionT.Props): DSAccordionUseAccordionContextT => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps) as DSAccordionT.InternalProps;\n\n const { activeValue, allowMultipleOpen, onChange } = propsWithDefaults;\n\n const { focusableChildrenReferences, allChildrenReferences } = useAccordionRefs(propsWithDefaults);\n\n const [internalActiveValue, setInternalActiveValue] =\n useState<DSAccordionInternalsT.InternalActiveValue>(activeValue);\n\n const actualActiveValue = useMemo(() => {\n if (activeValue === undefined) return internalActiveValue;\n return activeValue;\n }, [activeValue, internalActiveValue]);\n\n const setActiveValues = useCallback(\n (value: string | number, e: React.MouseEvent | React.KeyboardEvent) => {\n let newState: DSAccordionInternalsT.InternalActiveValue;\n if (allowMultipleOpen && (actualActiveValue === undefined || actualActiveValue === null)) newState = [value];\n else if (allowMultipleOpen && Array.isArray(actualActiveValue))\n if (!actualActiveValue.some((currentValues: string | number) => currentValues === value))\n newState = [...actualActiveValue, value];\n else newState = actualActiveValue.filter((currentValues: string | number) => currentValues !== value);\n else if (actualActiveValue === value) newState = null;\n else newState = value;\n setInternalActiveValue(newState);\n return onChange(newState, e);\n },\n [actualActiveValue, allowMultipleOpen, onChange],\n );\n const ctx = useMemo(\n () => ({\n props: propsWithDefaults,\n actualActiveValue,\n setActiveValues,\n focusableChildrenReferences,\n allChildrenReferences,\n }),\n [actualActiveValue, allChildrenReferences, focusableChildrenReferences, propsWithDefaults, setActiveValues],\n );\n\n return ctx;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAA+C;AAC/C,qCAA6C;AAC7C,8BAAiC;AACjC,0BAA6B;AAYtB,MAAM,eAAe,CAAC,UAA+D;AAC1F,QAAM,wBAAoB,6DAA6B,OAAO,gCAAY;AAE1E,QAAM,EAAE,aAAa,mBAAmB,SAAS,IAAI;AAErD,QAAM,EAAE,6BAA6B,sBAAsB,QAAI,0CAAiB,iBAAiB;AAEjG,QAAM,CAAC,qBAAqB,sBAAsB,QAChD,uBAAoD,WAAW;AAEjE,QAAM,wBAAoB,sBAAQ,MAAM;AACtC,QAAI,gBAAgB;AAAW,aAAO;AACtC,WAAO;AAAA,EACT,GAAG,CAAC,aAAa,mBAAmB,CAAC;AAErC,QAAM,sBAAkB;AAAA,IACtB,CAAC,OAAwB,MAA8C;AACrE,UAAI;AACJ,UAAI,sBAAsB,sBAAsB,UAAa,sBAAsB;AAAO,mBAAW,CAAC,KAAK;AAAA,eAClG,qBAAqB,MAAM,QAAQ,iBAAiB;AAC3D,YAAI,CAAC,kBAAkB,KAAK,CAAC,kBAAmC,kBAAkB,KAAK;AACrF,qBAAW,CAAC,GAAG,mBAAmB,KAAK;AAAA;AACpC,qBAAW,kBAAkB,OAAO,CAAC,kBAAmC,kBAAkB,KAAK;AAAA,eAC7F,sBAAsB;AAAO,mBAAW;AAAA;AAC5C,mBAAW;AAChB,6BAAuB,QAAQ;AAC/B,aAAO,SAAS,UAAU,CAAC;AAAA,IAC7B;AAAA,IACA,CAAC,mBAAmB,mBAAmB,QAAQ;AAAA,EACjD;AACA,QAAM,UAAM;AAAA,IACV,OAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,mBAAmB,uBAAuB,6BAA6B,mBAAmB,eAAe;AAAA,EAC5G;AAEA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 useAccordionRefs_exports = {};
|
|
30
|
+
__export(useAccordionRefs_exports, {
|
|
31
|
+
useAccordionRefs: () => useAccordionRefs
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useAccordionRefs_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
const useAccordionRefs = ({ children }) => (0, import_react.useMemo)(() => {
|
|
37
|
+
const focusableChildrenReferences = [];
|
|
38
|
+
const allChildrenReferences = {};
|
|
39
|
+
const filteredChildren = import_react.default.Children.toArray(children).filter(
|
|
40
|
+
(child) => child !== void 0 && child !== null
|
|
41
|
+
);
|
|
42
|
+
filteredChildren.map((child, index) => {
|
|
43
|
+
const { value, disabled } = child.props;
|
|
44
|
+
const currentRef = import_react.default.createRef();
|
|
45
|
+
allChildrenReferences[index] = currentRef;
|
|
46
|
+
if (!disabled)
|
|
47
|
+
focusableChildrenReferences.push({ index, value, ref: currentRef });
|
|
48
|
+
});
|
|
49
|
+
return { focusableChildrenReferences, allChildrenReferences };
|
|
50
|
+
}, [children]);
|
|
51
|
+
//# sourceMappingURL=useAccordionRefs.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/useAccordionRefs.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React, { useMemo } from 'react';\nimport type { DSAccordionT } from '../react-desc-prop-types.js';\nimport type { DSAccordionInternalsT } from '../sharedTypes.js';\n\ninterface UseAccordionRefsPropsT {\n children: React.ReactElement<DSAccordionT.InternalItemProps>[];\n}\n\ninterface UseAccordionRefsReturnTypeT {\n focusableChildrenReferences: DSAccordionInternalsT.FocusableChildrenReferences[];\n allChildrenReferences: DSAccordionInternalsT.AllChildrenReferences;\n}\n\nexport const useAccordionRefs = ({ children }: UseAccordionRefsPropsT): UseAccordionRefsReturnTypeT =>\n useMemo(() => {\n const focusableChildrenReferences: DSAccordionInternalsT.FocusableChildrenReferences[] = [];\n const allChildrenReferences: DSAccordionInternalsT.AllChildrenReferences = {};\n\n const filteredChildren = React.Children.toArray(children).filter(\n (child) => child !== undefined && child !== null,\n ) as React.ReactElement<DSAccordionT.InternalItemProps>[];\n\n filteredChildren.map((child: React.ReactElement<DSAccordionT.InternalItemProps>, index) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const { value, disabled } = child.props;\n const currentRef = React.createRef<HTMLButtonElement>();\n allChildrenReferences[index] = currentRef;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n if (!disabled) focusableChildrenReferences.push({ index, value, ref: currentRef });\n });\n return { focusableChildrenReferences, allChildrenReferences };\n }, [children]);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA+B;AAaxB,MAAM,mBAAmB,CAAC,EAAE,SAAS,UAC1C,sBAAQ,MAAM;AACZ,QAAM,8BAAmF,CAAC;AAC1F,QAAM,wBAAqE,CAAC;AAE5E,QAAM,mBAAmB,aAAAA,QAAM,SAAS,QAAQ,QAAQ,EAAE;AAAA,IACxD,CAAC,UAAU,UAAU,UAAa,UAAU;AAAA,EAC9C;AAEA,mBAAiB,IAAI,CAAC,OAA2D,UAAU;AAEzF,UAAM,EAAE,OAAO,SAAS,IAAI,MAAM;AAClC,UAAM,aAAa,aAAAA,QAAM,UAA6B;AACtD,0BAAsB,KAAK,IAAI;AAE/B,QAAI,CAAC;AAAU,kCAA4B,KAAK,EAAE,OAAO,OAAO,KAAK,WAAW,CAAC;AAAA,EACnF,CAAC;AACD,SAAO,EAAE,6BAA6B,sBAAsB;AAC9D,GAAG,CAAC,QAAQ,CAAC;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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 defaultProps_exports = {};
|
|
30
|
+
__export(defaultProps_exports, {
|
|
31
|
+
accordionItemDefaultProps: () => accordionItemDefaultProps,
|
|
32
|
+
defaultProps: () => defaultProps
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(defaultProps_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var import_react = require("react");
|
|
38
|
+
var import_ds_legacy_icons = require("@elliemae/ds-legacy-icons");
|
|
39
|
+
const DefaultIconClosed = (0, import_react.memo)(
|
|
40
|
+
({ isDSMobile = false }) => isDSMobile ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_legacy_icons.ChevronRight, { width: "20px", color: ["brand-primary", "800"] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_legacy_icons.ArrowheadRight, { width: "20px" })
|
|
41
|
+
);
|
|
42
|
+
const DefaultIconOpen = (0, import_react.memo)(
|
|
43
|
+
({ isDSMobile = false }) => isDSMobile ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_legacy_icons.ChevronDown, { width: "20px", color: ["brand-primary", "800"] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_legacy_icons.ArrowheadDown, { width: "20px" })
|
|
44
|
+
);
|
|
45
|
+
const noop = () => {
|
|
46
|
+
};
|
|
47
|
+
const defaultProps = {
|
|
48
|
+
containerProps: {},
|
|
49
|
+
allowMultipleOpen: false,
|
|
50
|
+
onChange: noop,
|
|
51
|
+
children: [],
|
|
52
|
+
isDSMobile: false
|
|
53
|
+
};
|
|
54
|
+
const accordionItemDefaultProps = {
|
|
55
|
+
iconClosed: DefaultIconClosed,
|
|
56
|
+
iconOpened: DefaultIconOpen,
|
|
57
|
+
title: "",
|
|
58
|
+
customActions: [],
|
|
59
|
+
disabled: false,
|
|
60
|
+
xStyledPropsContent: {},
|
|
61
|
+
keepContentMounted: false
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=defaultProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/defaultProps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React, { memo } from 'react';\nimport { ArrowheadRight, ArrowheadDown, ChevronRight, ChevronDown } from '@elliemae/ds-legacy-icons';\nimport type { DSAccordionInternalsT } from './sharedTypes.js';\nimport type { DSAccordionT } from './react-desc-prop-types.js';\n\nconst DefaultIconClosed = memo(({ isDSMobile = false }: DSAccordionInternalsT.DefaultIconProps) =>\n isDSMobile ? <ChevronRight width=\"20px\" color={['brand-primary', '800']} /> : <ArrowheadRight width=\"20px\" />,\n);\n\nconst DefaultIconOpen = memo(({ isDSMobile = false }: DSAccordionInternalsT.DefaultIconProps) =>\n isDSMobile ? <ChevronDown width=\"20px\" color={['brand-primary', '800']} /> : <ArrowheadDown width=\"20px\" />,\n);\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\n\nexport const defaultProps: DSAccordionT.DefaultProps = {\n containerProps: {},\n allowMultipleOpen: false,\n onChange: noop,\n children: [],\n isDSMobile: false,\n};\n\nexport const accordionItemDefaultProps: DSAccordionT.ItemDefaultProps = {\n iconClosed: DefaultIconClosed,\n iconOpened: DefaultIconOpen,\n title: '',\n customActions: [],\n disabled: false,\n xStyledPropsContent: {},\n keepContentMounted: false,\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADMR;AANf,mBAA4B;AAC5B,6BAAyE;AAIzE,MAAM,wBAAoB;AAAA,EAAK,CAAC,EAAE,aAAa,MAAM,MACnD,aAAa,4CAAC,uCAAa,OAAM,QAAO,OAAO,CAAC,iBAAiB,KAAK,GAAG,IAAK,4CAAC,yCAAe,OAAM,QAAO;AAC7G;AAEA,MAAM,sBAAkB;AAAA,EAAK,CAAC,EAAE,aAAa,MAAM,MACjD,aAAa,4CAAC,sCAAY,OAAM,QAAO,OAAO,CAAC,iBAAiB,KAAK,GAAG,IAAK,4CAAC,wCAAc,OAAM,QAAO;AAC3G;AAGA,MAAM,OAAO,MAAY;AAAC;AAEnB,MAAM,eAA0C;AAAA,EACrD,gBAAgB,CAAC;AAAA,EACjB,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,UAAU,CAAC;AAAA,EACX,YAAY;AACd;AAEO,MAAM,4BAA2D;AAAA,EACtE,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,eAAe,CAAC;AAAA,EAChB,UAAU;AAAA,EACV,qBAAqB,CAAC;AAAA,EACtB,oBAAoB;AACtB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var DSAccordionDefinitions_exports = {};
|
|
30
|
+
__export(DSAccordionDefinitions_exports, {
|
|
31
|
+
DSAccordionDataTestid: () => DSAccordionDataTestid,
|
|
32
|
+
DSAccordionName: () => DSAccordionName,
|
|
33
|
+
DSAccordionSlots: () => DSAccordionSlots
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(DSAccordionDefinitions_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_ds_legacy_system = require("@elliemae/ds-legacy-system");
|
|
38
|
+
const DSAccordionName = "DSAccordion";
|
|
39
|
+
const DSAccordionSlots = {
|
|
40
|
+
CONTAINER: "root",
|
|
41
|
+
ITEM_CONTAINER: "item-container",
|
|
42
|
+
ITEM_HEADER_CONTAINER: "item-header-container",
|
|
43
|
+
ITEM_HEADER_ADDON: "item-header-addon",
|
|
44
|
+
ITEM_HEADER_TITLE_CONTAINER: "item-header-titles-container",
|
|
45
|
+
ITEM_HEADER_PRIMARY_TITLE: "item-header-primary-title",
|
|
46
|
+
ITEM_HEADER_SECONDARY_TITLE: "item-header-secondary-title",
|
|
47
|
+
ITEM_HEADER_CUSTOM_ACTIONS_CONTAINER: "item-header-custom-actions-container",
|
|
48
|
+
ITEM_HEADER_TOOLTIP: "item-header-tooltip",
|
|
49
|
+
ITEM_CONTENT_CONTAINER: "item-content-container"
|
|
50
|
+
};
|
|
51
|
+
const DSAccordionDataTestid = {
|
|
52
|
+
...(0, import_ds_legacy_system.slotObjectToDataTestIds)(DSAccordionName, DSAccordionSlots),
|
|
53
|
+
ITEM_CONTENT_CONTAINER: "ds-accordion_item-content",
|
|
54
|
+
ITEM_HEADER_CONTAINER: "ds-accordion_item-header",
|
|
55
|
+
ITEM_CONTAINER: "ds-accordion_item",
|
|
56
|
+
CONTAINER: "ds-accordion_group"
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=DSAccordionDefinitions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/exported-related/DSAccordionDefinitions.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-legacy-system';\n\nexport const DSAccordionName = 'DSAccordion';\n\nexport const DSAccordionSlots = {\n CONTAINER: 'root',\n ITEM_CONTAINER: 'item-container',\n ITEM_HEADER_CONTAINER: 'item-header-container',\n ITEM_HEADER_ADDON: 'item-header-addon',\n ITEM_HEADER_TITLE_CONTAINER: 'item-header-titles-container',\n ITEM_HEADER_PRIMARY_TITLE: 'item-header-primary-title',\n ITEM_HEADER_SECONDARY_TITLE: 'item-header-secondary-title',\n ITEM_HEADER_CUSTOM_ACTIONS_CONTAINER: 'item-header-custom-actions-container',\n ITEM_HEADER_TOOLTIP: 'item-header-tooltip',\n ITEM_CONTENT_CONTAINER: 'item-content-container',\n};\n\nexport const DSAccordionDataTestid = {\n ...slotObjectToDataTestIds(DSAccordionName, DSAccordionSlots),\n ITEM_CONTENT_CONTAINER: 'ds-accordion_item-content',\n ITEM_HEADER_CONTAINER: 'ds-accordion_item-header',\n ITEM_CONTAINER: 'ds-accordion_item',\n CONTAINER: 'ds-accordion_group',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAwC;AAEjC,MAAM,kBAAkB;AAExB,MAAM,mBAAmB;AAAA,EAC9B,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,uBAAuB;AAAA,EACvB,mBAAmB;AAAA,EACnB,6BAA6B;AAAA,EAC7B,2BAA2B;AAAA,EAC3B,6BAA6B;AAAA,EAC7B,sCAAsC;AAAA,EACtC,qBAAqB;AAAA,EACrB,wBAAwB;AAC1B;AAEO,MAAM,wBAAwB;AAAA,EACnC,OAAG,iDAAwB,iBAAiB,gBAAgB;AAAA,EAC5D,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,gBAAgB;AAAA,EAChB,WAAW;AACb;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
25
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
|
+
var exported_related_exports = {};
|
|
27
|
+
module.exports = __toCommonJS(exported_related_exports);
|
|
28
|
+
var React = __toESM(require("react"));
|
|
29
|
+
__reExport(exported_related_exports, require("./DSAccordionDefinitions.js"), module.exports);
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/exported-related/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export * from './DSAccordionDefinitions.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,qCAAc,wCAAd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var src_exports = {};
|
|
31
|
+
__export(src_exports, {
|
|
32
|
+
default: () => import_DSAccordion.default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(src_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
__reExport(src_exports, require("./DSAccordion.js"), module.exports);
|
|
37
|
+
__reExport(src_exports, require("./parts/accordionItem/DSAccordionItem.js"), module.exports);
|
|
38
|
+
__reExport(src_exports, require("./exported-related/index.js"), module.exports);
|
|
39
|
+
var import_DSAccordion = __toESM(require("./DSAccordion.js"));
|
|
40
|
+
//# 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": ["import {} from '@xstyled/system';\nimport {} from '@xstyled/util';\nexport * from './DSAccordion.js';\nexport * from './parts/accordionItem/DSAccordionItem.js';\nexport * from './exported-related/index.js';\n\nexport { default } from './DSAccordion.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,wBAAc,6BAFd;AAGA,wBAAc,qDAHd;AAIA,wBAAc,wCAJd;AAMA,yBAAwB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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 AccordionContent_exports = {};
|
|
30
|
+
__export(AccordionContent_exports, {
|
|
31
|
+
AccordionContent: () => AccordionContent
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(AccordionContent_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_ds_legacy_props_helpers = require("@elliemae/ds-legacy-props-helpers");
|
|
38
|
+
var import_DSAccordionCTX = require("../../DSAccordionCTX.js");
|
|
39
|
+
var import_DSAccordionDefinitions = require("../../exported-related/DSAccordionDefinitions.js");
|
|
40
|
+
var import_styles = require("./styles.js");
|
|
41
|
+
var import_lodash = require("lodash");
|
|
42
|
+
const AccordionContent = () => {
|
|
43
|
+
const { props } = (0, import_react.useContext)(import_DSAccordionCTX.DSAccordionContext);
|
|
44
|
+
const getOwnerProps = (0, import_react.useCallback)(() => props, [props]);
|
|
45
|
+
const getOwnerPropsArguments = (0, import_react.useCallback)(() => ({}), []);
|
|
46
|
+
const { containerProps, children, ...rest } = props;
|
|
47
|
+
const restWithoutOnChange = (0, import_lodash.omit)(rest, "onChange");
|
|
48
|
+
const childrenWithIndex = [];
|
|
49
|
+
const xstyledAttrs = (0, import_ds_legacy_props_helpers.useGetXstyledProps)(restWithoutOnChange);
|
|
50
|
+
const globalAttrs = (0, import_ds_legacy_props_helpers.useGetGlobalAttributes)(restWithoutOnChange);
|
|
51
|
+
import_react.default.Children.toArray(children).filter((child) => child !== void 0 && child !== null).forEach(
|
|
52
|
+
(child, index) => childrenWithIndex.push(
|
|
53
|
+
import_react.default.cloneElement(child, {
|
|
54
|
+
dsIndex: index
|
|
55
|
+
})
|
|
56
|
+
)
|
|
57
|
+
);
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
+
import_styles.StyledContainer,
|
|
60
|
+
{
|
|
61
|
+
"data-testid": import_DSAccordionDefinitions.DSAccordionDataTestid.CONTAINER,
|
|
62
|
+
...containerProps,
|
|
63
|
+
...globalAttrs,
|
|
64
|
+
...xstyledAttrs,
|
|
65
|
+
getOwnerProps,
|
|
66
|
+
getOwnerPropsArguments,
|
|
67
|
+
children: childrenWithIndex
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=AccordionContent.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/accordionContent/AccordionContent.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React, { useCallback, useContext } from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-legacy-props-helpers';\nimport { DSAccordionContext } from '../../DSAccordionCTX.js';\nimport { DSAccordionDataTestid } from '../../exported-related/DSAccordionDefinitions.js';\nimport { StyledContainer } from './styles.js';\nimport type { DSAccordionT } from '../../react-desc-prop-types.js';\nimport { omit } from 'lodash';\n\nexport const AccordionContent = (): JSX.Element => {\n const { props } = useContext(DSAccordionContext);\n\n const getOwnerProps = useCallback(() => props, [props]);\n const getOwnerPropsArguments = useCallback(() => ({}), []);\n\n const { containerProps, children, ...rest } = props;\n\n const restWithoutOnChange = omit(rest, 'onChange');\n\n const childrenWithIndex: React.ReactElement<DSAccordionT.InternalItemProps>[] = [];\n\n const xstyledAttrs = useGetXstyledProps(restWithoutOnChange);\n\n const globalAttrs = useGetGlobalAttributes(restWithoutOnChange);\n\n React.Children.toArray(children)\n .filter((child) => child !== undefined && child !== null)\n .forEach((child, index) =>\n childrenWithIndex.push(\n React.cloneElement(child, {\n dsIndex: index,\n }),\n ),\n );\n\n return (\n <StyledContainer\n data-testid={DSAccordionDataTestid.CONTAINER}\n {...containerProps}\n {...globalAttrs}\n {...xstyledAttrs}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {childrenWithIndex}\n </StyledContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmCnB;AAnCJ,mBAA+C;AAC/C,qCAA2D;AAC3D,4BAAmC;AACnC,oCAAsC;AACtC,oBAAgC;AAEhC,oBAAqB;AAEd,MAAM,mBAAmB,MAAmB;AACjD,QAAM,EAAE,MAAM,QAAI,yBAAW,wCAAkB;AAE/C,QAAM,oBAAgB,0BAAY,MAAM,OAAO,CAAC,KAAK,CAAC;AACtD,QAAM,6BAAyB,0BAAY,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzD,QAAM,EAAE,gBAAgB,UAAU,GAAG,KAAK,IAAI;AAE9C,QAAM,0BAAsB,oBAAK,MAAM,UAAU;AAEjD,QAAM,oBAA0E,CAAC;AAEjF,QAAM,mBAAe,mDAAmB,mBAAmB;AAE3D,QAAM,kBAAc,uDAAuB,mBAAmB;AAE9D,eAAAA,QAAM,SAAS,QAAQ,QAAQ,EAC5B,OAAO,CAAC,UAAU,UAAU,UAAa,UAAU,IAAI,EACvD;AAAA,IAAQ,CAAC,OAAO,UACf,kBAAkB;AAAA,MAChB,aAAAA,QAAM,aAAa,OAAO;AAAA,QACxB,SAAS;AAAA,MACX,CAAC;AAAA,IACH;AAAA,EACF;AAEF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,oDAAsB;AAAA,MAClC,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|