@elliemae/ds-accordion 3.22.0-next.37 → 3.22.0-next.38

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.
@@ -36,7 +36,10 @@ var import_react = __toESM(require("react"));
36
36
  const useAccordionRefs = ({ children }) => (0, import_react.useMemo)(() => {
37
37
  const focusableChildrenReferences = [];
38
38
  const allChildrenReferences = {};
39
- import_react.default.Children.map(children, (child, index) => {
39
+ const filteredChildren = import_react.default.Children.toArray(children).filter(
40
+ (child) => child !== void 0 && child !== null
41
+ );
42
+ filteredChildren.map((child, index) => {
40
43
  const { value, disabled } = child.props;
41
44
  const currentRef = import_react.default.createRef();
42
45
  allChildrenReferences[index] = currentRef;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 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", "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,eAAAA,QAAM,SAAS,IAAI,UAAU,CAAC,OAA2D,UAAU;AAEjG,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;",
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
6
  "names": ["React"]
7
7
  }
@@ -3,7 +3,10 @@ import React2, { useMemo } from "react";
3
3
  const useAccordionRefs = ({ children }) => useMemo(() => {
4
4
  const focusableChildrenReferences = [];
5
5
  const allChildrenReferences = {};
6
- React2.Children.map(children, (child, index) => {
6
+ const filteredChildren = React2.Children.toArray(children).filter(
7
+ (child) => child !== void 0 && child !== null
8
+ );
9
+ filteredChildren.map((child, index) => {
7
10
  const { value, disabled } = child.props;
8
11
  const currentRef = React2.createRef();
9
12
  allChildrenReferences[index] = currentRef;
@@ -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.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;",
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 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"],
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,QAAM,mBAAmBA,OAAM,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,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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-accordion",
3
- "version": "3.22.0-next.37",
3
+ "version": "3.22.0-next.38",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Accordion",
6
6
  "files": [
@@ -83,27 +83,23 @@
83
83
  "indent": 4
84
84
  },
85
85
  "dependencies": {
86
- "lodash": "~4.17.21",
87
- "@elliemae/ds-button-v2": "3.22.0-next.37",
88
- "@elliemae/ds-grid": "3.22.0-next.37",
89
- "@elliemae/ds-icons": "3.22.0-next.37",
90
- "@elliemae/ds-popperjs": "3.22.0-next.37",
91
- "@elliemae/ds-props-helpers": "3.22.0-next.37",
92
- "@elliemae/ds-system": "3.22.0-next.37",
93
- "@elliemae/ds-utilities": "3.22.0-next.37"
86
+ "@elliemae/ds-button-v2": "3.22.0-next.38",
87
+ "@elliemae/ds-popperjs": "3.22.0-next.38",
88
+ "@elliemae/ds-grid": "3.22.0-next.38",
89
+ "@elliemae/ds-system": "3.22.0-next.38",
90
+ "@elliemae/ds-props-helpers": "3.22.0-next.38",
91
+ "@elliemae/ds-utilities": "3.22.0-next.38",
92
+ "@elliemae/ds-icons": "3.22.0-next.38"
94
93
  },
95
94
  "devDependencies": {
96
95
  "@elliemae/pui-cli": "~9.0.0-next.22",
97
96
  "@testing-library/jest-dom": "~5.16.5",
98
97
  "@testing-library/react": "~12.1.3",
99
98
  "@testing-library/user-event": "~13.5.0",
100
- "@xstyled/system": "3.7.0",
101
- "@xstyled/util": "3.7.0",
102
99
  "jest-axe": "^7.0.1",
103
100
  "react": "^17.0.2",
104
101
  "react-dom": "^17.0.2",
105
- "styled-components": "~5.3.9",
106
- "@elliemae/ds-monorepo-devops": "3.22.0-next.37"
102
+ "@elliemae/ds-monorepo-devops": "3.22.0-next.38"
107
103
  },
108
104
  "peerDependencies": {
109
105
  "react": "^17.0.2",