@elliemae/ds-accordion 3.16.0-next.2 → 3.16.0-next.21
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 +11 -7
- package/dist/cjs/DSAccordion.js.map +2 -2
- package/dist/cjs/DSAccordionCTX.js +4 -0
- package/dist/cjs/DSAccordionCTX.js.map +2 -2
- package/dist/cjs/config/useAccordion.js +8 -4
- package/dist/cjs/config/useAccordion.js.map +2 -2
- package/dist/cjs/config/useAccordionRefs.js +4 -0
- package/dist/cjs/config/useAccordionRefs.js.map +2 -2
- package/dist/cjs/defaultProps.js +4 -0
- package/dist/cjs/defaultProps.js.map +2 -2
- package/dist/cjs/exported-related/DSAccordionDatatestid.js +4 -0
- package/dist/cjs/exported-related/DSAccordionDatatestid.js.map +1 -1
- package/dist/cjs/exported-related/index.js +6 -2
- package/dist/cjs/exported-related/index.js.map +2 -2
- package/dist/cjs/exported-related/theming.js +4 -0
- package/dist/cjs/exported-related/theming.js.map +1 -1
- package/dist/cjs/index.js +8 -4
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/parts/accordionContent/AccordionContent.js +10 -6
- package/dist/cjs/parts/accordionContent/AccordionContent.js.map +2 -2
- package/dist/cjs/parts/accordionContent/styles.js +5 -1
- package/dist/cjs/parts/accordionContent/styles.js.map +2 -2
- package/dist/cjs/parts/accordionItem/DSAccordionItem.js +103 -75
- package/dist/cjs/parts/accordionItem/DSAccordionItem.js.map +2 -2
- package/dist/cjs/parts/accordionItem/styles.js +5 -17
- package/dist/cjs/parts/accordionItem/styles.js.map +2 -2
- package/dist/cjs/parts/accordionItem/useAccordionItem.js +5 -1
- package/dist/cjs/parts/accordionItem/useAccordionItem.js.map +2 -2
- package/dist/cjs/propTypes.js +62 -0
- package/dist/cjs/propTypes.js.map +7 -0
- package/dist/cjs/react-desc-prop-types.js +27 -23
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/sharedTypes.js +4 -0
- package/dist/cjs/sharedTypes.js.map +2 -2
- package/dist/esm/DSAccordion.js +6 -6
- package/dist/esm/DSAccordion.js.map +1 -1
- package/dist/esm/DSAccordionCTX.js.map +1 -1
- package/dist/esm/config/useAccordion.js +3 -3
- package/dist/esm/config/useAccordion.js.map +1 -1
- package/dist/esm/config/useAccordionRefs.js.map +2 -2
- package/dist/esm/defaultProps.js.map +1 -1
- package/dist/esm/exported-related/index.js +2 -2
- package/dist/esm/exported-related/index.js.map +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +7 -0
- package/dist/esm/parts/accordionContent/AccordionContent.js +4 -4
- package/dist/esm/parts/accordionContent/AccordionContent.js.map +2 -2
- package/dist/esm/parts/accordionContent/styles.js +1 -1
- package/dist/esm/parts/accordionContent/styles.js.map +1 -1
- package/dist/esm/parts/accordionItem/DSAccordionItem.js +96 -73
- package/dist/esm/parts/accordionItem/DSAccordionItem.js.map +2 -2
- package/dist/esm/parts/accordionItem/styles.js +2 -18
- package/dist/esm/parts/accordionItem/styles.js.map +2 -2
- package/dist/esm/parts/accordionItem/useAccordionItem.js +1 -1
- package/dist/esm/parts/accordionItem/useAccordionItem.js.map +2 -2
- package/dist/esm/propTypes.js +32 -0
- package/dist/esm/propTypes.js.map +7 -0
- package/dist/esm/react-desc-prop-types.js +3 -3
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/types/DSAccordion.d.ts +2 -2
- package/dist/types/DSAccordionCTX.d.ts +2 -2
- package/dist/types/config/useAccordion.d.ts +2 -2
- package/dist/types/config/useAccordionRefs.d.ts +2 -2
- package/dist/types/defaultProps.d.ts +1 -1
- package/dist/types/exported-related/index.d.ts +2 -2
- package/dist/types/index.d.ts +4 -4
- package/dist/types/parts/accordionContent/styles.d.ts +1 -0
- package/dist/types/parts/accordionItem/DSAccordionItem.d.ts +2 -2
- package/dist/types/parts/accordionItem/styles.d.ts +44 -0
- package/dist/types/propTypes.d.ts +17 -0
- package/dist/types/react-desc-prop-types.d.ts +898 -898
- package/dist/types/sharedTypes.d.ts +1 -1
- package/dist/types/tests/a11y/axe.test.d.ts +1 -0
- package/package.json +10 -8
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
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.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -29,40 +33,40 @@ __export(react_desc_prop_types_exports, {
|
|
|
29
33
|
});
|
|
30
34
|
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
31
35
|
var React = __toESM(require("react"));
|
|
32
|
-
var
|
|
36
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
33
37
|
const accordionItemPropTypes = {
|
|
34
|
-
...
|
|
35
|
-
...
|
|
36
|
-
children:
|
|
37
|
-
title:
|
|
38
|
-
value:
|
|
38
|
+
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
39
|
+
...import_ds_props_helpers.xstyledPropTypes,
|
|
40
|
+
children: import_ds_props_helpers.PropTypes.node.description("Dimsum AccordionItem content.").isRequired,
|
|
41
|
+
title: import_ds_props_helpers.PropTypes.string.description("Set a primary title."),
|
|
42
|
+
value: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.string, import_ds_props_helpers.PropTypes.number]).description(
|
|
39
43
|
"Dimsum AccordionItem value, this value should be unique."
|
|
40
44
|
).isRequired,
|
|
41
|
-
iconClosed:
|
|
42
|
-
iconOpened:
|
|
43
|
-
secondaryTitle:
|
|
44
|
-
xStyledPropsContent:
|
|
45
|
+
iconClosed: import_ds_props_helpers.PropTypes.node.description("Custom Dimsum Icon when it is closed.").deprecated({ version: "3.x" }),
|
|
46
|
+
iconOpened: import_ds_props_helpers.PropTypes.node.description("Custom Dimsum Icon when it is open.").deprecated({ version: "3.x" }),
|
|
47
|
+
secondaryTitle: import_ds_props_helpers.PropTypes.string.description("Set a secondary title"),
|
|
48
|
+
xStyledPropsContent: import_ds_props_helpers.PropTypes.shape(import_ds_props_helpers.xstyledPropTypes).description(
|
|
45
49
|
"This property is xStyledProps object to apply in the content wrapper"
|
|
46
50
|
),
|
|
47
|
-
customActions:
|
|
48
|
-
renderCustomActions:
|
|
51
|
+
customActions: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.object).description("Set Dimsum AccordionItem custom actions.").deprecated({ version: "3.x" }),
|
|
52
|
+
renderCustomActions: import_ds_props_helpers.PropTypes.func.description(
|
|
49
53
|
"This property will render any JSX in the header controls area. You can access to all references and active values within the props. Rendered as a function which does not allow hook calls inside."
|
|
50
54
|
).deprecated({ version: "4.x" }),
|
|
51
|
-
CustomActions:
|
|
55
|
+
CustomActions: import_ds_props_helpers.PropTypes.func.description(
|
|
52
56
|
"This property will render any JSX in the header controls area. You can access to all references and active values within the props."
|
|
53
57
|
)
|
|
54
58
|
};
|
|
55
59
|
const accordionPropTypes = {
|
|
56
|
-
...
|
|
57
|
-
...
|
|
58
|
-
containerProps:
|
|
59
|
-
activeValue:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
61
|
+
...import_ds_props_helpers.xstyledPropTypes,
|
|
62
|
+
containerProps: import_ds_props_helpers.PropTypes.object.description("Adds props to the container.").deprecated({ version: "4.x" }),
|
|
63
|
+
activeValue: import_ds_props_helpers.PropTypes.oneOfType([
|
|
64
|
+
import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.string, import_ds_props_helpers.PropTypes.number])),
|
|
65
|
+
import_ds_props_helpers.PropTypes.string,
|
|
66
|
+
import_ds_props_helpers.PropTypes.number
|
|
63
67
|
]).description("Selected active value. This property makes the component a controlled one."),
|
|
64
|
-
children:
|
|
65
|
-
allowMultipleOpen:
|
|
66
|
-
onChange:
|
|
68
|
+
children: import_ds_props_helpers.PropTypes.node.description("Dimsum AccordionItems to show."),
|
|
69
|
+
allowMultipleOpen: import_ds_props_helpers.PropTypes.bool.description("Allows multiple Dimsum AccordionItems to be open at the same time."),
|
|
70
|
+
onChange: import_ds_props_helpers.PropTypes.func.description("Callback function once the Dimsum Accordion changes.")
|
|
67
71
|
};
|
|
68
72
|
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type React from 'react';\nimport
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type React from 'react';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes, type XstyledProps } from '@elliemae/ds-props-helpers';\nimport type { DSAccordionInternalsT } from './sharedTypes.js';\n\nexport declare namespace DSAccordionT {\n export interface DefaultProps {\n containerProps: Record<string, unknown>;\n allowMultipleOpen: boolean;\n onChange: (value: (string | number)[] | string | number | null, e: React.MouseEvent | React.KeyboardEvent) => void;\n children: React.ReactElement<InternalItemProps>[];\n isDSMobile: boolean;\n }\n\n export interface OptionalProps {\n activeValue?: DSAccordionInternalsT.InternalActiveValue;\n }\n\n export interface RequiredProps {\n children: React.ReactElement<ItemProps>[];\n }\n\n export interface Props extends OptionalProps, Partial<Omit<DefaultProps, 'children'>>, RequiredProps {}\n\n export interface ItemDefaultProps {\n iconClosed: React.MemoExoticComponent<React.FunctionComponent<DSAccordionInternalsT.DefaultIconProps>>;\n iconOpened: React.MemoExoticComponent<React.FunctionComponent<DSAccordionInternalsT.DefaultIconProps>>;\n title: string;\n customActions: DSAccordionInternalsT.CustomActions[];\n disabled: boolean;\n xStyledPropsContent: XstyledProps;\n }\n\n export interface ItemOptionalProps {\n secondaryTitle?: string;\n renderCustomActions?: (props: {\n allRefs: DSAccordionInternalsT.AllChildrenReferences;\n actualActiveValue: DSAccordionInternalsT.InternalActiveValue;\n }) => JSX.Element;\n CustomActions?: React.ComponentType<{\n allRefs: DSAccordionInternalsT.AllChildrenReferences;\n actualActiveValue: DSAccordionInternalsT.InternalActiveValue;\n }>;\n }\n\n export interface ItemRequiredProps {\n children: React.ReactNode;\n value: string | number;\n }\n\n export interface ItemProps extends ItemRequiredProps, ItemOptionalProps, Partial<ItemDefaultProps> {}\n\n export interface InternalItemProps\n extends ItemRequiredProps,\n ItemOptionalProps,\n Omit<ItemDefaultProps, 'disabled' | 'customActions' | 'iconClosed' | 'iconOpened'> {\n dsIndex: number;\n disabled: boolean;\n customActions: DSAccordionInternalsT.CustomActions[];\n iconClosed: React.MemoExoticComponent<React.FunctionComponent<DSAccordionInternalsT.DefaultIconProps>>;\n iconOpened: React.MemoExoticComponent<React.FunctionComponent<DSAccordionInternalsT.DefaultIconProps>>;\n }\n\n export interface InternalProps\n extends OptionalProps,\n Partial<Omit<DefaultProps, 'children' | 'isDSMobile' | 'onChange'>> {\n children: React.ReactElement<InternalItemProps>[];\n isDSMobile: boolean;\n onChange: (value: (string | number)[] | string | number | null, e: React.MouseEvent | React.KeyboardEvent) => void;\n }\n}\n\nexport const accordionItemPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n children: PropTypes.node.description('Dimsum AccordionItem content.').isRequired,\n title: PropTypes.string.description('Set a primary title.'),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description(\n 'Dimsum AccordionItem value, this value should be unique.',\n ).isRequired,\n iconClosed: PropTypes.node.description('Custom Dimsum Icon when it is closed.').deprecated({ version: '3.x' }),\n iconOpened: PropTypes.node.description('Custom Dimsum Icon when it is open.').deprecated({ version: '3.x' }),\n secondaryTitle: PropTypes.string.description('Set a secondary title'),\n xStyledPropsContent: PropTypes.shape(xstyledPropTypes).description(\n 'This property is xStyledProps object to apply in the content wrapper',\n ),\n customActions: PropTypes.arrayOf(PropTypes.object)\n .description('Set Dimsum AccordionItem custom actions.')\n .deprecated({ version: '3.x' }),\n renderCustomActions: PropTypes.func\n .description(\n 'This property will render any JSX in the header controls area. You can access to all references and active values within the props. Rendered as a function which does not allow hook calls inside.',\n )\n .deprecated({ version: '4.x' }),\n CustomActions: PropTypes.func.description(\n 'This property will render any JSX in the header controls area. You can access to all references and active values within the props.',\n ),\n};\n\nexport const accordionPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n containerProps: PropTypes.object.description('Adds props to the container.').deprecated({ version: '4.x' }),\n activeValue: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),\n PropTypes.string,\n PropTypes.number,\n ]).description('Selected active value. This property makes the component a controlled one.'),\n children: PropTypes.node.description('Dimsum AccordionItems to show.'),\n allowMultipleOpen: PropTypes.bool.description('Allows multiple Dimsum AccordionItems to be open at the same time.'),\n onChange: PropTypes.func.description('Callback function once the Dimsum Accordion changes.'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAA0F;AAsEnF,MAAM,yBAAyB;AAAA,EACpC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,kCAAU,KAAK,YAAY,+BAA+B,EAAE;AAAA,EACtE,OAAO,kCAAU,OAAO,YAAY,sBAAsB;AAAA,EAC1D,OAAO,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,EAAE;AAAA,IAC/D;AAAA,EACF,EAAE;AAAA,EACF,YAAY,kCAAU,KAAK,YAAY,uCAAuC,EAAE,WAAW,EAAE,SAAS,MAAM,CAAC;AAAA,EAC7G,YAAY,kCAAU,KAAK,YAAY,qCAAqC,EAAE,WAAW,EAAE,SAAS,MAAM,CAAC;AAAA,EAC3G,gBAAgB,kCAAU,OAAO,YAAY,uBAAuB;AAAA,EACpE,qBAAqB,kCAAU,MAAM,wCAAgB,EAAE;AAAA,IACrD;AAAA,EACF;AAAA,EACA,eAAe,kCAAU,QAAQ,kCAAU,MAAM,EAC9C,YAAY,0CAA0C,EACtD,WAAW,EAAE,SAAS,MAAM,CAAC;AAAA,EAChC,qBAAqB,kCAAU,KAC5B;AAAA,IACC;AAAA,EACF,EACC,WAAW,EAAE,SAAS,MAAM,CAAC;AAAA,EAChC,eAAe,kCAAU,KAAK;AAAA,IAC5B;AAAA,EACF;AACF;AAEO,MAAM,qBAAqB;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,gBAAgB,kCAAU,OAAO,YAAY,8BAA8B,EAAE,WAAW,EAAE,SAAS,MAAM,CAAC;AAAA,EAC1G,aAAa,kCAAU,UAAU;AAAA,IAC/B,kCAAU,QAAQ,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,CAAC;AAAA,IAC3E,kCAAU;AAAA,IACV,kCAAU;AAAA,EACZ,CAAC,EAAE,YAAY,4EAA4E;AAAA,EAC3F,UAAU,kCAAU,KAAK,YAAY,gCAAgC;AAAA,EACrE,mBAAmB,kCAAU,KAAK,YAAY,oEAAoE;AAAA,EAClH,UAAU,kCAAU,KAAK,YAAY,sDAAsD;AAC7F;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/sharedTypes.js
CHANGED
|
@@ -14,6 +14,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
14
|
return to;
|
|
15
15
|
};
|
|
16
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.
|
|
17
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
22
|
mod
|
|
19
23
|
));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/sharedTypes.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export declare namespace DSAccordionInternalsT {\n export interface CustomActions {\n onClick: (e: React.MouseEvent) => void;\n id: string;\n }\n\n export interface DefaultIconProps {\n isDSMobile
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export declare namespace DSAccordionInternalsT {\n export interface CustomActions {\n onClick: (e: React.MouseEvent) => void;\n id: string;\n }\n\n export interface DefaultIconProps {\n isDSMobile?: boolean;\n }\n\n export interface FocusableChildrenReferences {\n index: number;\n value: string | number;\n ref: React.MutableRefObject<HTMLButtonElement | null>;\n }\n\n export interface AllChildrenReferences {\n [index: string]: React.MutableRefObject<HTMLButtonElement | null>;\n }\n\n export type InternalActiveValue = (string | number)[] | string | number | null | undefined;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/DSAccordion.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { describe } from "@elliemae/ds-
|
|
4
|
-
import { AccordionContent } from "./parts/accordionContent/AccordionContent";
|
|
5
|
-
import { useAccordion } from "./config/useAccordion";
|
|
6
|
-
import { DSAccordionContext } from "./DSAccordionCTX";
|
|
7
|
-
import { accordionPropTypes } from "./react-desc-prop-types";
|
|
8
|
-
import { DSAccordionName } from "./exported-related/theming";
|
|
3
|
+
import { describe } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import { AccordionContent } from "./parts/accordionContent/AccordionContent.js";
|
|
5
|
+
import { useAccordion } from "./config/useAccordion.js";
|
|
6
|
+
import { DSAccordionContext } from "./DSAccordionCTX.js";
|
|
7
|
+
import { accordionPropTypes } from "./react-desc-prop-types.js";
|
|
8
|
+
import { DSAccordionName } from "./exported-related/theming.js";
|
|
9
9
|
const DSAccordion = (props) => {
|
|
10
10
|
const ctx = useAccordion(props);
|
|
11
11
|
return /* @__PURE__ */ jsx(DSAccordionContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx(AccordionContent, {}) });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSAccordion.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe } from '@elliemae/ds-
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe } from '@elliemae/ds-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/theming.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"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACejB;AAbN,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AAEnC,SAAS,uBAAuB;AAEhC,MAAM,cAAc,CAAC,UAA2C;AAC9D,QAAM,MAAM,aAAa,KAAK;AAE9B,SACE,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,KAClC,8BAAC,oBAAiB,GACpB;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW;AAClD,sBAAsB,YAAY;AAIlC,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSAccordionCTX.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createContext } from 'react';\nimport type { DSAccordionT } from './react-desc-prop-types';\nimport type { DSAccordionInternalsT } from './sharedTypes';\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"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qBAAqB;AAY9B,MAAM,iBAAiB,CAAC;AAEjB,MAAM,qBAAqB,cAAmC,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useMemo, useState, useCallback } from "react";
|
|
3
|
-
import { useMemoMergePropsWithDefault } from "@elliemae/ds-
|
|
4
|
-
import { useAccordionRefs } from "./useAccordionRefs";
|
|
5
|
-
import { defaultProps } from "../defaultProps";
|
|
3
|
+
import { useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import { useAccordionRefs } from "./useAccordionRefs.js";
|
|
5
|
+
import { defaultProps } from "../defaultProps.js";
|
|
6
6
|
const useAccordion = (props) => {
|
|
7
7
|
const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps);
|
|
8
8
|
const { activeValue, allowMultipleOpen, onChange } = propsWithDefaults;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useAccordion.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport { useMemo, useState, useCallback } from 'react';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport { useMemo, useState, useCallback } from 'react';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-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"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,SAAS,UAAU,mBAAmB;AAC/C,SAAS,oCAAoC;AAC7C,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAYtB,MAAM,eAAe,CAAC,UAA+D;AAC1F,QAAM,oBAAoB,6BAA6B,OAAO,YAAY;AAE1E,QAAM,EAAE,aAAa,mBAAmB,SAAS,IAAI;AAErD,QAAM,EAAE,6BAA6B,sBAAsB,IAAI,iBAAiB,iBAAiB;AAEjG,QAAM,CAAC,qBAAqB,sBAAsB,IAChD,SAAoD,WAAW;AAEjE,QAAM,oBAAoB,QAAQ,MAAM;AACtC,QAAI,gBAAgB;AAAW,aAAO;AACtC,WAAO;AAAA,EACT,GAAG,CAAC,aAAa,mBAAmB,CAAC;AAErC,QAAM,kBAAkB;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,MAAM;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
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useAccordionRefs.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport type { DSAccordionT } from '../react-desc-prop-types';\nimport type { DSAccordionInternalsT } from '../sharedTypes';\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 React.Children.map(children, (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"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,UAAS,eAAe;AAaxB,MAAM,mBAAmB,CAAC,EAAE,SAAS,MAC1C,QAAQ,MAAM;AACZ,QAAM,8BAAmF,CAAC;AAC1F,QAAM,wBAAqE,CAAC;AAE5E,EAAAA,OAAM,SAAS,IAAI,UAAU,CAAC,OAA2D,UAAU;AAEjG,UAAM,EAAE,OAAO,SAAS,IAAI,MAAM;AAClC,UAAM,aAAaA,OAAM,UAA6B;AACtD,0BAAsB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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 React.Children.map(children, (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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,UAAS,eAAe;AAaxB,MAAM,mBAAmB,CAAC,EAAE,SAAS,MAC1C,QAAQ,MAAM;AACZ,QAAM,8BAAmF,CAAC;AAC1F,QAAM,wBAAqE,CAAC;AAE5E,EAAAA,OAAM,SAAS,IAAI,UAAU,CAAC,OAA2D,UAAU;AAEjG,UAAM,EAAE,OAAO,SAAS,IAAI,MAAM;AAClC,UAAM,aAAaA,OAAM,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
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/defaultProps.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { memo } from 'react';\nimport { ArrowheadRight, ArrowheadDown, ChevronRight, ChevronDown } from '@elliemae/ds-icons';\nimport type { DSAccordionInternalsT } from './sharedTypes';\nimport type { DSAccordionT } from './react-desc-prop-types';\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};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { memo } from 'react';\nimport { ArrowheadRight, ArrowheadDown, ChevronRight, ChevronDown } from '@elliemae/ds-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};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACMR;AANf,SAAgB,YAAY;AAC5B,SAAS,gBAAgB,eAAe,cAAc,mBAAmB;AAIzE,MAAM,oBAAoB;AAAA,EAAK,CAAC,EAAE,aAAa,MAAM,MACnD,aAAa,oBAAC,gBAAa,OAAM,QAAO,OAAO,CAAC,iBAAiB,KAAK,GAAG,IAAK,oBAAC,kBAAe,OAAM,QAAO;AAC7G;AAEA,MAAM,kBAAkB;AAAA,EAAK,CAAC,EAAE,aAAa,MAAM,MACjD,aAAa,oBAAC,eAAY,OAAM,QAAO,OAAO,CAAC,iBAAiB,KAAK,GAAG,IAAK,oBAAC,iBAAc,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;AACxB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/exported-related/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSAccordionDatatestid';\nexport * from './theming';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSAccordionDatatestid.js';\nexport * from './theming.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export * from "./DSAccordion";
|
|
3
|
-
export * from "./parts/accordionItem/DSAccordionItem";
|
|
4
|
-
export * from "./exported-related";
|
|
5
|
-
import { default as default2 } from "./DSAccordion";
|
|
2
|
+
export * from "./DSAccordion.js";
|
|
3
|
+
export * from "./parts/accordionItem/DSAccordionItem.js";
|
|
4
|
+
export * from "./exported-related/index.js";
|
|
5
|
+
import { default as default2 } from "./DSAccordion.js";
|
|
6
6
|
export {
|
|
7
7
|
default2 as default
|
|
8
8
|
};
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSAccordion';\nexport * from './parts/accordionItem/DSAccordionItem';\nexport * from './exported-related';\n\nexport { default } from './DSAccordion';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSAccordion.js';\nexport * from './parts/accordionItem/DSAccordionItem.js';\nexport * from './exported-related/index.js';\n\nexport { default } from './DSAccordion.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;AAEd,SAAS,WAAAA,gBAAe;",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import React2, { useContext } from "react";
|
|
4
|
-
import { useGetGlobalAttributes, useGetXstyledProps } from "@elliemae/ds-
|
|
5
|
-
import { DSAccordionContext } from "../../DSAccordionCTX";
|
|
6
|
-
import { DSAccordionDataTestid } from "../../exported-related/DSAccordionDatatestid";
|
|
7
|
-
import { StyledContainer } from "./styles";
|
|
4
|
+
import { useGetGlobalAttributes, useGetXstyledProps } from "@elliemae/ds-props-helpers";
|
|
5
|
+
import { DSAccordionContext } from "../../DSAccordionCTX.js";
|
|
6
|
+
import { DSAccordionDataTestid } from "../../exported-related/DSAccordionDatatestid.js";
|
|
7
|
+
import { StyledContainer } from "./styles.js";
|
|
8
8
|
const AccordionContent = () => {
|
|
9
9
|
const {
|
|
10
10
|
props: { containerProps, children, onChange, ...rest }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/accordionContent/AccordionContent.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC2BnB;AA3BJ,OAAOA,UAAS,kBAAkB;AAClC,SAAS,wBAAwB,0BAA0B;AAC3D,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,uBAAuB;AAGzB,MAAM,mBAAmB,MAAmB;AACjD,QAAM;AAAA,IACJ,OAAO,EAAE,gBAAgB,UAAU,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { DSAccordionContext } from '../../DSAccordionCTX.js';\nimport { DSAccordionDataTestid } from '../../exported-related/DSAccordionDatatestid.js';\nimport { StyledContainer } from './styles.js';\nimport type { DSAccordionT } from '../../react-desc-prop-types.js';\n\nexport const AccordionContent = (): JSX.Element => {\n const {\n props: { containerProps, children, onChange, ...rest },\n } = useContext(DSAccordionContext);\n\n const childrenWithIndex: React.ReactElement<DSAccordionT.InternalItemProps>[] = [];\n\n const xstyledAttrs = useGetXstyledProps(rest);\n\n const globalAttrs = useGetGlobalAttributes(rest);\n\n React.Children.forEach(children, (child, index) =>\n childrenWithIndex.push(\n React.cloneElement(child, {\n dsIndex: index,\n }),\n ),\n );\n\n return (\n <StyledContainer data-testid={DSAccordionDataTestid.GROUP} {...containerProps} {...globalAttrs} {...xstyledAttrs}>\n {childrenWithIndex}\n </StyledContainer>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC2BnB;AA3BJ,OAAOA,UAAS,kBAAkB;AAClC,SAAS,wBAAwB,0BAA0B;AAC3D,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,uBAAuB;AAGzB,MAAM,mBAAmB,MAAmB;AACjD,QAAM;AAAA,IACJ,OAAO,EAAE,gBAAgB,UAAU,UAAU,GAAG,KAAK;AAAA,EACvD,IAAI,WAAW,kBAAkB;AAEjC,QAAM,oBAA0E,CAAC;AAEjF,QAAM,eAAe,mBAAmB,IAAI;AAE5C,QAAM,cAAc,uBAAuB,IAAI;AAE/C,EAAAA,OAAM,SAAS;AAAA,IAAQ;AAAA,IAAU,CAAC,OAAO,UACvC,kBAAkB;AAAA,MAChBA,OAAM,aAAa,OAAO;AAAA,QACxB,SAAS;AAAA,MACX,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SACE,oBAAC,mBAAgB,eAAa,sBAAsB,OAAQ,GAAG,gBAAiB,GAAG,aAAc,GAAG,cACjG,6BACH;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { styled, xStyledCommonProps } from "@elliemae/ds-system";
|
|
3
|
-
import { DSAccordionName, DSAccordionSlots } from "../../exported-related";
|
|
3
|
+
import { DSAccordionName, DSAccordionSlots } from "../../exported-related/index.js";
|
|
4
4
|
const StyledContainer = styled("div", {
|
|
5
5
|
name: DSAccordionName,
|
|
6
6
|
slot: DSAccordionSlots.CONTAINER
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/accordionContent/styles.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSAccordionName, DSAccordionSlots } from '../../exported-related';\n\nexport const StyledContainer = styled('div', {\n name: DSAccordionName,\n slot: DSAccordionSlots.CONTAINER,\n})`\n min-width: 240px;\n ${xStyledCommonProps};\n`;\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSAccordionName, DSAccordionSlots } from '../../exported-related/index.js';\n\nexport const StyledContainer = styled('div', {\n name: DSAccordionName,\n slot: DSAccordionSlots.CONTAINER,\n})`\n min-width: 240px;\n ${xStyledCommonProps};\n`;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,0BAA0B;AAC3C,SAAS,iBAAiB,wBAAwB;AAE3C,MAAM,kBAAkB,OAAO,OAAO;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,iBAAiB;AACzB,CAAC;AAAA;AAAA,IAEG;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useContext, useCallback, useMemo } from "react";
|
|
4
4
|
import {
|
|
5
5
|
useMemoMergePropsWithDefault,
|
|
6
6
|
describe,
|
|
7
|
-
useIsShowingEllipsis,
|
|
8
7
|
useGetGlobalAttributes,
|
|
9
8
|
useGetXstyledProps
|
|
10
|
-
} from "@elliemae/ds-
|
|
9
|
+
} from "@elliemae/ds-props-helpers";
|
|
10
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
11
|
+
import { useIsShowingEllipsis } from "@elliemae/ds-utilities";
|
|
11
12
|
import { DSButton, BUTTON_TYPE } from "@elliemae/ds-button";
|
|
12
13
|
import { DSPopperJS } from "@elliemae/ds-popperjs";
|
|
13
|
-
import { accordionItemDefaultProps } from "../../defaultProps";
|
|
14
|
+
import { accordionItemDefaultProps } from "../../defaultProps.js";
|
|
14
15
|
import {
|
|
15
16
|
StyledItemAddon,
|
|
16
17
|
StyledItemContainer,
|
|
@@ -22,11 +23,11 @@ import {
|
|
|
22
23
|
StyledPrimaryTitle,
|
|
23
24
|
StyledSecondaryTitle,
|
|
24
25
|
StyledTooltipContent
|
|
25
|
-
} from "./styles";
|
|
26
|
-
import { useAccordionItem } from "./useAccordionItem";
|
|
27
|
-
import { DSAccordionContext } from "../../DSAccordionCTX";
|
|
28
|
-
import { DSAccordionDataTestid } from "../../exported-related/DSAccordionDatatestid";
|
|
29
|
-
import { accordionItemPropTypes } from "../../react-desc-prop-types";
|
|
26
|
+
} from "./styles.js";
|
|
27
|
+
import { useAccordionItem } from "./useAccordionItem.js";
|
|
28
|
+
import { DSAccordionContext } from "../../DSAccordionCTX.js";
|
|
29
|
+
import { DSAccordionDataTestid } from "../../exported-related/DSAccordionDatatestid.js";
|
|
30
|
+
import { accordionItemPropTypes } from "../../react-desc-prop-types.js";
|
|
30
31
|
const DSAccordionItem = (props) => {
|
|
31
32
|
const propsWithDefaults = useMemoMergePropsWithDefault(
|
|
32
33
|
props,
|
|
@@ -78,58 +79,6 @@ const DSAccordionItem = (props) => {
|
|
|
78
79
|
}, [CustomActions, actualActiveValue, allChildrenReferences, customActions, isDSMobile, renderCustomActions]);
|
|
79
80
|
const { isShowingEllipsis: isPrimaryShowingEllipsis, setElement: setPrimaryElement } = useIsShowingEllipsis();
|
|
80
81
|
const { isShowingEllipsis: isSecondaryShowingEllipsis, setElement: setSecondaryElement } = useIsShowingEllipsis();
|
|
81
|
-
const Titles = useMemo(() => {
|
|
82
|
-
if ((isPrimaryShowingEllipsis || isSecondaryShowingEllipsis) && !isDSMobile)
|
|
83
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
84
|
-
/* @__PURE__ */ jsx(
|
|
85
|
-
StyledPrimaryTitle,
|
|
86
|
-
{
|
|
87
|
-
ref: setPrimaryElement,
|
|
88
|
-
...title ? { id: `accordion_${title || ""}id` } : void 0,
|
|
89
|
-
disabled,
|
|
90
|
-
isDSMobile,
|
|
91
|
-
selected,
|
|
92
|
-
withSecondaryTitle: secondaryTitle,
|
|
93
|
-
children: title
|
|
94
|
-
}
|
|
95
|
-
),
|
|
96
|
-
!isDSMobile && secondaryTitle && /* @__PURE__ */ jsx(StyledSecondaryTitle, { ref: setSecondaryElement, disabled, selected, children: secondaryTitle }),
|
|
97
|
-
/* @__PURE__ */ jsx(DSPopperJS, { referenceElement, showPopover, children: /* @__PURE__ */ jsxs(StyledTooltipContent, { children: [
|
|
98
|
-
/* @__PURE__ */ jsx("p", { children: title }),
|
|
99
|
-
/* @__PURE__ */ jsxs("p", { children: [
|
|
100
|
-
" ",
|
|
101
|
-
secondaryTitle
|
|
102
|
-
] })
|
|
103
|
-
] }) })
|
|
104
|
-
] });
|
|
105
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
106
|
-
/* @__PURE__ */ jsx(
|
|
107
|
-
StyledPrimaryTitle,
|
|
108
|
-
{
|
|
109
|
-
ref: setPrimaryElement,
|
|
110
|
-
...title ? { id: `accordion_${title || ""}id` } : void 0,
|
|
111
|
-
disabled,
|
|
112
|
-
isDSMobile,
|
|
113
|
-
selected,
|
|
114
|
-
withSecondaryTitle: secondaryTitle,
|
|
115
|
-
children: title
|
|
116
|
-
}
|
|
117
|
-
),
|
|
118
|
-
!isDSMobile && secondaryTitle && /* @__PURE__ */ jsx(StyledSecondaryTitle, { ref: setSecondaryElement, disabled, selected, children: secondaryTitle })
|
|
119
|
-
] });
|
|
120
|
-
}, [
|
|
121
|
-
disabled,
|
|
122
|
-
isDSMobile,
|
|
123
|
-
isPrimaryShowingEllipsis,
|
|
124
|
-
isSecondaryShowingEllipsis,
|
|
125
|
-
referenceElement,
|
|
126
|
-
secondaryTitle,
|
|
127
|
-
setPrimaryElement,
|
|
128
|
-
setSecondaryElement,
|
|
129
|
-
showPopover,
|
|
130
|
-
selected,
|
|
131
|
-
title
|
|
132
|
-
]);
|
|
133
82
|
const onKeyDownWithIndex = useCallback(
|
|
134
83
|
(e) => {
|
|
135
84
|
handleOnKeyDown(e, dsIndex);
|
|
@@ -151,6 +100,84 @@ const DSAccordionItem = (props) => {
|
|
|
151
100
|
onFocus: handleOnFocus,
|
|
152
101
|
onBlur: handleOnBlur
|
|
153
102
|
};
|
|
103
|
+
const titleDesktop = useMemo(
|
|
104
|
+
() => /* @__PURE__ */ jsxs(
|
|
105
|
+
Grid,
|
|
106
|
+
{
|
|
107
|
+
onMouseEnter: handleOnFocus,
|
|
108
|
+
onMouseLeave: handleOnBlur,
|
|
109
|
+
rows: ["auto", "auto"],
|
|
110
|
+
rowGap: secondaryTitle ? "3px" : "0px",
|
|
111
|
+
padding: "6px 0px",
|
|
112
|
+
width: "100%",
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ jsxs(Grid, { cols: ["20px", "auto"], children: [
|
|
115
|
+
/* @__PURE__ */ jsx(StyledItemAddon, { disabled, children: selected ? /* @__PURE__ */ jsx(IconOpened, {}) : /* @__PURE__ */ jsx(IconClosed, {}) }),
|
|
116
|
+
/* @__PURE__ */ jsx(StyledItemTitles, { withSecondaryTitle: secondaryTitle, selected, children: /* @__PURE__ */ jsx(
|
|
117
|
+
StyledPrimaryTitle,
|
|
118
|
+
{
|
|
119
|
+
ref: setPrimaryElement,
|
|
120
|
+
...title ? { id: `accordion_${title || ""}id` } : void 0,
|
|
121
|
+
disabled,
|
|
122
|
+
selected,
|
|
123
|
+
withSecondaryTitle: secondaryTitle,
|
|
124
|
+
children: title
|
|
125
|
+
}
|
|
126
|
+
) })
|
|
127
|
+
] }),
|
|
128
|
+
secondaryTitle && /* @__PURE__ */ jsxs(Grid, { cols: ["20px", "auto"], children: [
|
|
129
|
+
/* @__PURE__ */ jsx("div", {}),
|
|
130
|
+
/* @__PURE__ */ jsx(StyledSecondaryTitle, { ref: setSecondaryElement, disabled, selected, children: secondaryTitle })
|
|
131
|
+
] })
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
[
|
|
136
|
+
setPrimaryElement,
|
|
137
|
+
IconOpened,
|
|
138
|
+
IconClosed,
|
|
139
|
+
setSecondaryElement,
|
|
140
|
+
handleOnBlur,
|
|
141
|
+
handleOnFocus,
|
|
142
|
+
handleOnBlur,
|
|
143
|
+
secondaryTitle,
|
|
144
|
+
disabled,
|
|
145
|
+
selected,
|
|
146
|
+
IconOpened,
|
|
147
|
+
IconClosed,
|
|
148
|
+
setPrimaryElement,
|
|
149
|
+
title,
|
|
150
|
+
disabled
|
|
151
|
+
]
|
|
152
|
+
);
|
|
153
|
+
const titleMobile = useMemo(
|
|
154
|
+
() => /* @__PURE__ */ jsx(Grid, { width: "100%", children: /* @__PURE__ */ jsxs(Grid, { cols: ["auto", "20px"], children: [
|
|
155
|
+
/* @__PURE__ */ jsx(
|
|
156
|
+
StyledItemTitles,
|
|
157
|
+
{
|
|
158
|
+
onMouseEnter: handleOnFocus,
|
|
159
|
+
onMouseLeave: handleOnBlur,
|
|
160
|
+
isDSMobile: true,
|
|
161
|
+
withSecondaryTitle: secondaryTitle,
|
|
162
|
+
selected,
|
|
163
|
+
children: /* @__PURE__ */ jsx(
|
|
164
|
+
StyledPrimaryTitle,
|
|
165
|
+
{
|
|
166
|
+
ref: setPrimaryElement,
|
|
167
|
+
...title ? { id: `accordion_${title || ""}id` } : void 0,
|
|
168
|
+
disabled,
|
|
169
|
+
isDSMobile: true,
|
|
170
|
+
selected,
|
|
171
|
+
withSecondaryTitle: secondaryTitle,
|
|
172
|
+
children: title
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
),
|
|
177
|
+
/* @__PURE__ */ jsx(StyledItemAddon, { disabled, isDSMobile: true, children: selected ? /* @__PURE__ */ jsx(IconOpened, { isDSMobile: true }) : /* @__PURE__ */ jsx(IconClosed, { isDSMobile: true }) })
|
|
178
|
+
] }) }),
|
|
179
|
+
[handleOnFocus, handleOnBlur, secondaryTitle, selected, setPrimaryElement, title, disabled, IconOpened, IconClosed]
|
|
180
|
+
);
|
|
154
181
|
return /* @__PURE__ */ jsxs(StyledItemContainer, { "data-testid": DSAccordionDataTestid.ITEM.CONTAINER, className, ...xstyledAttrs, children: [
|
|
155
182
|
/* @__PURE__ */ jsxs(StyledItemHeaderContainer, { disabled, ref: setReferenceElement, children: [
|
|
156
183
|
/* @__PURE__ */ jsxs(
|
|
@@ -173,18 +200,14 @@ const DSAccordionItem = (props) => {
|
|
|
173
200
|
...handlers,
|
|
174
201
|
...globalAttrs,
|
|
175
202
|
children: [
|
|
176
|
-
|
|
177
|
-
/* @__PURE__ */ jsx(
|
|
178
|
-
|
|
179
|
-
{
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
selected,
|
|
185
|
-
children: Titles
|
|
186
|
-
}
|
|
187
|
-
)
|
|
203
|
+
isDSMobile ? titleMobile : titleDesktop,
|
|
204
|
+
/* @__PURE__ */ jsx(DSPopperJS, { referenceElement, showPopover: !selected && showPopover, children: /* @__PURE__ */ jsxs(StyledTooltipContent, { children: [
|
|
205
|
+
/* @__PURE__ */ jsx("p", { children: title }),
|
|
206
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
207
|
+
" ",
|
|
208
|
+
secondaryTitle
|
|
209
|
+
] })
|
|
210
|
+
] }) })
|
|
188
211
|
]
|
|
189
212
|
}
|
|
190
213
|
),
|