@elliemae/ds-accordion 2.2.1 → 2.3.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/cjs/DSAccordion.js +50 -29
  2. package/cjs/DSAccordion.js.map +7 -0
  3. package/cjs/DSAccordionCTX.js +40 -14
  4. package/cjs/DSAccordionCTX.js.map +7 -0
  5. package/cjs/DSAccordionDatatestid.js +38 -10
  6. package/cjs/DSAccordionDatatestid.js.map +7 -0
  7. package/cjs/DSAccordionTypes.js +27 -2
  8. package/cjs/DSAccordionTypes.js.map +7 -0
  9. package/cjs/config/useAccordion.js +59 -36
  10. package/cjs/config/useAccordion.js.map +7 -0
  11. package/cjs/config/useAccordionRefs.js +46 -39
  12. package/cjs/config/useAccordionRefs.js.map +7 -0
  13. package/cjs/defaultProps.js +49 -39
  14. package/cjs/defaultProps.js.map +7 -0
  15. package/cjs/index.js +37 -14
  16. package/cjs/index.js.map +7 -0
  17. package/cjs/parts/accordionContent/AccordionContent.js +44 -35
  18. package/cjs/parts/accordionContent/AccordionContent.js.map +7 -0
  19. package/cjs/parts/accordionItem/DSAccordionItem.js +147 -174
  20. package/cjs/parts/accordionItem/DSAccordionItem.js.map +7 -0
  21. package/cjs/parts/accordionItem/styles.js +138 -144
  22. package/cjs/parts/accordionItem/styles.js.map +7 -0
  23. package/cjs/parts/accordionItem/useAccordionItem.js +52 -39
  24. package/cjs/parts/accordionItem/useAccordionItem.js.map +7 -0
  25. package/cjs/propTypes.js +53 -22
  26. package/cjs/propTypes.js.map +7 -0
  27. package/esm/DSAccordion.js +18 -16
  28. package/esm/DSAccordion.js.map +7 -0
  29. package/esm/DSAccordionCTX.js +10 -9
  30. package/esm/DSAccordionCTX.js.map +7 -0
  31. package/esm/DSAccordionDatatestid.js +9 -6
  32. package/esm/DSAccordionDatatestid.js.map +7 -0
  33. package/esm/DSAccordionTypes.js +2 -1
  34. package/esm/DSAccordionTypes.js.map +7 -0
  35. package/esm/config/useAccordion.js +25 -27
  36. package/esm/config/useAccordion.js.map +7 -0
  37. package/esm/config/useAccordionRefs.js +17 -31
  38. package/esm/config/useAccordionRefs.js.map +7 -0
  39. package/esm/defaultProps.js +21 -31
  40. package/esm/defaultProps.js.map +7 -0
  41. package/esm/index.js +8 -2
  42. package/esm/index.js.map +7 -0
  43. package/esm/parts/accordionContent/AccordionContent.js +14 -25
  44. package/esm/parts/accordionContent/AccordionContent.js.map +7 -0
  45. package/esm/parts/accordionItem/DSAccordionItem.js +114 -147
  46. package/esm/parts/accordionItem/DSAccordionItem.js.map +7 -0
  47. package/esm/parts/accordionItem/styles.js +112 -131
  48. package/esm/parts/accordionItem/styles.js.map +7 -0
  49. package/esm/parts/accordionItem/useAccordionItem.js +21 -33
  50. package/esm/parts/accordionItem/useAccordionItem.js.map +7 -0
  51. package/esm/propTypes.js +24 -17
  52. package/esm/propTypes.js.map +7 -0
  53. package/package.json +7 -11
  54. package/cjs/parts/accordionItem/useIsShowingEllipsis.js +0 -37
  55. package/esm/parts/accordionItem/useIsShowingEllipsis.js +0 -33
  56. package/types/parts/accordionItem/useIsShowingEllipsis.d.ts +0 -5
@@ -1,149 +1,143 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var styles_exports = {};
29
+ __export(styles_exports, {
30
+ StyledItemAddon: () => StyledItemAddon,
31
+ StyledItemContainer: () => StyledItemContainer,
32
+ StyledItemContent: () => StyledItemContent,
33
+ StyledItemCustomActions: () => StyledItemCustomActions,
34
+ StyledItemHeader: () => StyledItemHeader,
35
+ StyledItemHeaderContainer: () => StyledItemHeaderContainer,
36
+ StyledItemTitles: () => StyledItemTitles,
37
+ StyledPrimaryTitle: () => StyledPrimaryTitle,
38
+ StyledSecondaryTitle: () => StyledSecondaryTitle
39
+ });
40
+ var React = __toESM(require("react"));
41
+ var import_styled_components = __toESM(require("styled-components"));
42
+ const StyledItemContainer = import_styled_components.default.div`
43
+ display: grid;
44
+ grid-template-rows: auto auto;
45
+ border-bottom: 1px solid ${({ theme }) => theme.colors.neutral[200]};
46
+ align-items: center;
47
+ `;
48
+ const StyledItemHeader = import_styled_components.default.button`
49
+ display: flex;
50
+ height: ${({ theme, withSecondaryTitle }) => withSecondaryTitle ? theme.space.m : theme.space.s};
51
+ width: 100%;
52
+ align-items: center;
53
+ border: none;
54
+ outline: none;
55
+ background: none;
4
56
 
5
- var styled = require('styled-components');
57
+ &:hover {
58
+ cursor: ${({ disabled }) => disabled ? "not-allowed" : "pointer"};
59
+ }
6
60
 
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
61
+ padding: ${({ isDSMobile }) => isDSMobile ? `0 16px` : `0`};
8
62
 
9
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
63
+ ${({ isDSMobile }) => isDSMobile ? `flex-direction: row-reverse;` : ``}
10
64
 
11
- const StyledItemContainer = /*#__PURE__*/styled__default["default"].div.withConfig({
12
- componentId: "sc-fnpjby-0"
13
- })(["display:grid;grid-template-rows:auto auto;border-bottom:1px solid ", ";align-items:center;"], _ref => {
14
- let {
15
- theme
16
- } = _ref;
17
- return theme.colors.neutral[200];
18
- });
19
- const StyledItemHeader = /*#__PURE__*/styled__default["default"].button.withConfig({
20
- componentId: "sc-fnpjby-1"
21
- })(["display:flex;height:", ";width:100%;align-items:center;border:none;outline:none;background:none;&:hover{cursor:", ";}padding:", ";", " &:focus{&:after{position:absolute;content:'';left:0;top:0;width:100%;height:100%;border-radius:2px;border:2px solid ", ";pointer-events:none;}}"], _ref2 => {
22
- let {
23
- theme,
24
- withSecondaryTitle
25
- } = _ref2;
26
- return withSecondaryTitle ? theme.space.m : theme.space.s;
27
- }, _ref3 => {
28
- let {
29
- disabled
30
- } = _ref3;
31
- return disabled ? 'not-allowed' : 'pointer';
32
- }, _ref4 => {
33
- let {
34
- isDSMobile
35
- } = _ref4;
36
- return isDSMobile ? "0 16px" : "0";
37
- }, _ref5 => {
38
- let {
39
- isDSMobile
40
- } = _ref5;
41
- return isDSMobile ? "flex-direction: row-reverse;" : "";
42
- }, _ref6 => {
43
- let {
44
- theme
45
- } = _ref6;
46
- return theme.colors.brand[700];
47
- });
48
- const StyledItemContent = /*#__PURE__*/styled__default["default"].div.withConfig({
49
- componentId: "sc-fnpjby-2"
50
- })(["margin:", ";grid-column:1/2;"], _ref7 => {
51
- let {
52
- isDSMobile
53
- } = _ref7;
54
- return isDSMobile ? "16px 16px 24px 16px" : "16px 16px 16px 32px";
55
- });
56
- const StyledItemAddon = /*#__PURE__*/styled__default["default"].div.withConfig({
57
- componentId: "sc-fnpjby-3"
58
- })(["", " height:100%;width:", ";display:grid;place-items:center;& .em-ds-icon svg{fill:", ";}"], _ref8 => {
59
- let {
60
- theme,
61
- isDSMobile
62
- } = _ref8;
63
- return !isDSMobile ? "padding: 0 ".concat(theme.space.xxs, ";") : "";
64
- }, _ref9 => {
65
- let {
66
- theme
67
- } = _ref9;
68
- return theme.space.s;
69
- }, _ref10 => {
70
- let {
71
- disabled,
72
- theme
73
- } = _ref10;
74
- return disabled ? theme.colors.neutral[200] : theme.colors.brand[800];
75
- });
76
- const StyledItemTitles = /*#__PURE__*/styled__default["default"].div.withConfig({
77
- componentId: "sc-fnpjby-4"
78
- })(["display:grid;grid-template-columns:100%;width:100%;align-content:center;"]);
79
- const StyledPrimaryTitle = /*#__PURE__*/styled__default["default"].div.withConfig({
80
- componentId: "sc-fnpjby-5"
81
- })(["margin:0;font-size:16px;color:", ";font-weight:", ";text-overflow:ellipsis;overflow:hidden;height:", ";width:100%;text-align:left;display:block;white-space:nowrap;"], _ref11 => {
82
- let {
83
- disabled,
84
- theme
85
- } = _ref11;
86
- return disabled ? theme.colors.neutral[200] : theme.colors.neutral[700];
87
- }, _ref12 => {
88
- let {
89
- theme,
90
- isDSMobile
91
- } = _ref12;
92
- return isDSMobile ? theme.fontWeights.regular : theme.fontWeights.regular;
93
- }, _ref13 => {
94
- let {
95
- theme
96
- } = _ref13;
97
- return theme.space.xs;
98
- });
99
- const StyledSecondaryTitle = /*#__PURE__*/styled__default["default"].span.withConfig({
100
- componentId: "sc-fnpjby-6"
101
- })(["margin:0;font-size:", ";text-align:left;color:", ";text-overflow:ellipsis;overflow:hidden;height:", ";width:100%;text-align:left;display:block;white-space:nowrap;"], _ref14 => {
102
- let {
103
- theme
104
- } = _ref14;
105
- return theme.fontSizes.label[200];
106
- }, _ref15 => {
107
- let {
108
- disabled,
109
- theme
110
- } = _ref15;
111
- return disabled ? theme.colors.neutral[200] : theme.colors.neutral[500];
112
- }, _ref16 => {
113
- let {
114
- theme
115
- } = _ref16;
116
- return theme.space.xs;
117
- });
118
- const StyledItemCustomActions = /*#__PURE__*/styled__default["default"].div.withConfig({
119
- componentId: "sc-fnpjby-7"
120
- })(["display:grid;grid-auto-flow:column;grid-gap:", ";margin:0 ", ";justify-content:flex-end;"], _ref17 => {
121
- let {
122
- theme
123
- } = _ref17;
124
- return theme.space.xxs;
125
- }, _ref18 => {
126
- let {
127
- theme
128
- } = _ref18;
129
- return theme.space.xs;
130
- });
131
- const StyledItemHeaderContainer = /*#__PURE__*/styled__default["default"].div.withConfig({
132
- componentId: "sc-fnpjby-8"
133
- })(["display:grid;grid-template-columns:auto max-content;place-items:center;position:relative;&:hover{", "}"], _ref19 => {
134
- let {
135
- disabled,
136
- theme
137
- } = _ref19;
138
- return !disabled ? "background: ".concat(theme.colors.brand[200], ";") : "";
139
- });
65
+ &:focus {
66
+ &:after {
67
+ position: absolute;
68
+ content: '';
69
+ left: 0;
70
+ top: 0;
71
+ width: 100%;
72
+ height: 100%;
73
+ border-radius: 2px;
74
+ border: 2px solid ${({ theme }) => theme.colors.brand[700]};
75
+ pointer-events: none;
76
+ }
77
+ }
78
+ `;
79
+ const StyledItemContent = import_styled_components.default.div`
80
+ margin: ${({ isDSMobile }) => isDSMobile ? `16px 16px 24px 16px` : `16px 16px 16px 32px`};
81
+ grid-column: 1/2;
82
+ `;
83
+ const StyledItemAddon = import_styled_components.default.div`
84
+ ${({ theme, isDSMobile }) => !isDSMobile ? `padding: 0 ${theme.space.xxs};` : ``}
85
+ height: 100%;
86
+ width: ${({ theme }) => theme.space.s};
87
+ display: grid;
88
+ place-items: center;
140
89
 
141
- exports.StyledItemAddon = StyledItemAddon;
142
- exports.StyledItemContainer = StyledItemContainer;
143
- exports.StyledItemContent = StyledItemContent;
144
- exports.StyledItemCustomActions = StyledItemCustomActions;
145
- exports.StyledItemHeader = StyledItemHeader;
146
- exports.StyledItemHeaderContainer = StyledItemHeaderContainer;
147
- exports.StyledItemTitles = StyledItemTitles;
148
- exports.StyledPrimaryTitle = StyledPrimaryTitle;
149
- exports.StyledSecondaryTitle = StyledSecondaryTitle;
90
+ & .em-ds-icon svg {
91
+ fill: ${({ disabled, theme }) => disabled ? theme.colors.neutral[200] : theme.colors.brand[800]};
92
+ }
93
+ `;
94
+ const StyledItemTitles = import_styled_components.default.div`
95
+ display: grid;
96
+ grid-template-columns: 100%;
97
+ width: 100%;
98
+ align-content: center;
99
+ `;
100
+ const StyledPrimaryTitle = import_styled_components.default.div`
101
+ margin: 0;
102
+ font-size: 16px;
103
+ color: ${({ disabled, theme }) => disabled ? theme.colors.neutral[200] : theme.colors.neutral[700]};
104
+ font-weight: ${({ theme, isDSMobile }) => isDSMobile ? theme.fontWeights.regular : theme.fontWeights.regular};
105
+ text-overflow: ellipsis;
106
+ overflow: hidden;
107
+ height: ${({ theme }) => theme.space.xs};
108
+ width: 100%;
109
+ text-align: left;
110
+ display: block;
111
+ white-space: nowrap;
112
+ `;
113
+ const StyledSecondaryTitle = import_styled_components.default.span`
114
+ margin: 0;
115
+ font-size: ${({ theme }) => theme.fontSizes.label[200]};
116
+ text-align: left;
117
+ color: ${({ disabled, theme }) => disabled ? theme.colors.neutral[200] : theme.colors.neutral[500]};
118
+ text-overflow: ellipsis;
119
+ overflow: hidden;
120
+ height: ${({ theme }) => theme.space.xs};
121
+ width: 100%;
122
+ text-align: left;
123
+ display: block;
124
+ white-space: nowrap;
125
+ `;
126
+ const StyledItemCustomActions = import_styled_components.default.div`
127
+ display: grid;
128
+ grid-auto-flow: column;
129
+ grid-gap: ${({ theme }) => theme.space.xxs};
130
+ margin: 0 ${({ theme }) => theme.space.xs};
131
+ justify-content: flex-end;
132
+ `;
133
+ const StyledItemHeaderContainer = import_styled_components.default.div`
134
+ display: grid;
135
+ grid-template-columns: auto max-content;
136
+ place-items: center;
137
+ position: relative;
138
+ &:hover {
139
+ ${({ disabled, theme }) => !disabled ? `background: ${theme.colors.brand[200]};` : ``}
140
+ }
141
+ `;
142
+ module.exports = __toCommonJS(styles_exports);
143
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/parts/accordionItem/styles.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import styled from 'styled-components';\nimport type {\n StyledItemAddonPropsT,\n StyledItemHeaderPropsT,\n StyledItemTitlesPropsT,\n StyledPrimaryTitlePropsT,\n StyledSecondaryTitlePropsT,\n StyledItemContentPropsT,\n StyledItemHeaderContainerPropsT,\n} from '../../DSAccordionTypes';\n\nexport const StyledItemContainer = styled.div`\n display: grid;\n grid-template-rows: auto auto;\n border-bottom: 1px solid ${({ theme }) => theme.colors.neutral[200]};\n align-items: center;\n`;\n\nexport const StyledItemHeader = styled.button<StyledItemHeaderPropsT>`\n display: flex;\n height: ${({ theme, withSecondaryTitle }) => (withSecondaryTitle ? theme.space.m : theme.space.s)};\n width: 100%;\n align-items: center;\n border: none;\n outline: none;\n background: none;\n\n &:hover {\n cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};\n }\n\n padding: ${({ isDSMobile }) => (isDSMobile ? `0 16px` : `0`)};\n\n ${({ isDSMobile }) => (isDSMobile ? `flex-direction: row-reverse;` : ``)}\n\n &:focus {\n &:after {\n position: absolute;\n content: '';\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n border-radius: 2px;\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n pointer-events: none;\n }\n }\n`;\n\nexport const StyledItemContent = styled.div<StyledItemContentPropsT>`\n margin: ${({ isDSMobile }) => (isDSMobile ? `16px 16px 24px 16px` : `16px 16px 16px 32px`)};\n grid-column: 1/2;\n`;\n\nexport const StyledItemAddon = styled.div<StyledItemAddonPropsT>`\n ${({ theme, isDSMobile }) => (!isDSMobile ? `padding: 0 ${theme.space.xxs};` : ``)}\n height: 100%;\n width: ${({ theme }) => theme.space.s};\n display: grid;\n place-items: center;\n\n & .em-ds-icon svg {\n fill: ${({ disabled, theme }) => (disabled ? theme.colors.neutral[200] : theme.colors.brand[800])};\n }\n`;\n\nexport const StyledItemTitles = styled.div<StyledItemTitlesPropsT>`\n display: grid;\n grid-template-columns: 100%;\n width: 100%;\n align-content: center;\n`;\n\nexport const StyledPrimaryTitle = styled.div<StyledPrimaryTitlePropsT>`\n margin: 0;\n font-size: 16px;\n color: ${({ disabled, theme }) => (disabled ? theme.colors.neutral[200] : theme.colors.neutral[700])};\n font-weight: ${({ theme, isDSMobile }) => (isDSMobile ? theme.fontWeights.regular : theme.fontWeights.regular)};\n text-overflow: ellipsis;\n overflow: hidden;\n height: ${({ theme }) => theme.space.xs};\n width: 100%;\n text-align: left;\n display: block;\n white-space: nowrap;\n`;\n\nexport const StyledSecondaryTitle = styled.span<StyledSecondaryTitlePropsT>`\n margin: 0;\n font-size: ${({ theme }) => theme.fontSizes.label[200]};\n text-align: left;\n color: ${({ disabled, theme }) => (disabled ? theme.colors.neutral[200] : theme.colors.neutral[500])};\n text-overflow: ellipsis;\n overflow: hidden;\n height: ${({ theme }) => theme.space.xs};\n width: 100%;\n text-align: left;\n display: block;\n white-space: nowrap;\n`;\n\nexport const StyledItemCustomActions = styled.div`\n display: grid;\n grid-auto-flow: column;\n grid-gap: ${({ theme }) => theme.space.xxs};\n margin: 0 ${({ theme }) => theme.space.xs};\n justify-content: flex-end;\n`;\n\nexport const StyledItemHeaderContainer = styled.div<StyledItemHeaderContainerPropsT>`\n display: grid;\n grid-template-columns: auto max-content;\n place-items: center;\n position: relative;\n &:hover {\n ${({ disabled, theme }) => (!disabled ? `background: ${theme.colors.brand[200]};` : ``)}\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AAWZ,MAAM,sBAAsB,iCAAO;AAAA;AAAA;AAAA,6BAGb,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAAA;AAI1D,MAAM,mBAAmB,iCAAO;AAAA;AAAA,YAE3B,CAAC,EAAE,OAAO,yBAA0B,qBAAqB,MAAM,MAAM,IAAI,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAQnF,CAAC,EAAE,eAAgB,WAAW,gBAAgB;AAAA;AAAA;AAAA,aAG/C,CAAC,EAAE,iBAAkB,aAAa,WAAW;AAAA;AAAA,IAEtD,CAAC,EAAE,iBAAkB,aAAa,iCAAiC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAW7C,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAMrD,MAAM,oBAAoB,iCAAO;AAAA,YAC5B,CAAC,EAAE,iBAAkB,aAAa,wBAAwB;AAAA;AAAA;AAI/D,MAAM,kBAAkB,iCAAO;AAAA,IAClC,CAAC,EAAE,OAAO,iBAAkB,CAAC,aAAa,cAAc,MAAM,MAAM,SAAS;AAAA;AAAA,WAEtE,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,YAK1B,CAAC,EAAE,UAAU,YAAa,WAAW,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,MAAM;AAAA;AAAA;AAIzF,MAAM,mBAAmB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOhC,MAAM,qBAAqB,iCAAO;AAAA;AAAA;AAAA,WAG9B,CAAC,EAAE,UAAU,YAAa,WAAW,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,QAAQ;AAAA,iBAChF,CAAC,EAAE,OAAO,iBAAkB,aAAa,MAAM,YAAY,UAAU,MAAM,YAAY;AAAA;AAAA;AAAA,YAG5F,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAOhC,MAAM,uBAAuB,iCAAO;AAAA;AAAA,eAE5B,CAAC,EAAE,YAAY,MAAM,UAAU,MAAM;AAAA;AAAA,WAEzC,CAAC,EAAE,UAAU,YAAa,WAAW,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA,YAGrF,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAOhC,MAAM,0BAA0B,iCAAO;AAAA;AAAA;AAAA,cAGhC,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,cAC3B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA;AAIlC,MAAM,4BAA4B,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAM1C,CAAC,EAAE,UAAU,YAAa,CAAC,WAAW,eAAe,MAAM,OAAO,MAAM,UAAU;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,46 +1,59 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- require('core-js/modules/esnext.async-iterator.some.js');
6
- require('core-js/modules/esnext.iterator.constructor.js');
7
- require('core-js/modules/esnext.iterator.some.js');
8
- var React = require('react');
9
- var DSAccordionCTX = require('../../DSAccordionCTX.js');
10
-
11
- const useAccordionItem = _ref => {
12
- let {
13
- value,
14
- disabled
15
- } = _ref;
16
- const {
17
- actualActiveValue,
18
- setActiveValues,
19
- focusableChildrenReferences
20
- } = React.useContext(DSAccordionCTX.DSAccordionContext);
21
- const selected = React.useMemo(() => {
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var useAccordionItem_exports = {};
29
+ __export(useAccordionItem_exports, {
30
+ useAccordionItem: () => useAccordionItem
31
+ });
32
+ var React = __toESM(require("react"));
33
+ var import_react = require("react");
34
+ var import_DSAccordionCTX = require("../../DSAccordionCTX");
35
+ const useAccordionItem = ({ value, disabled }) => {
36
+ const { actualActiveValue, setActiveValues, focusableChildrenReferences } = (0, import_react.useContext)(import_DSAccordionCTX.DSAccordionContext);
37
+ const selected = (0, import_react.useMemo)(() => {
22
38
  if (Array.isArray(actualActiveValue)) {
23
- return actualActiveValue.some(currentValue => currentValue === value);
39
+ return actualActiveValue.some((currentValue) => currentValue === value);
24
40
  }
25
-
26
41
  return value === actualActiveValue;
27
42
  }, [actualActiveValue, value]);
28
- const handleOnClick = React.useCallback(e => {
29
- if (!disabled) setActiveValues(value, e);
43
+ const handleOnClick = (0, import_react.useCallback)((e) => {
44
+ if (!disabled)
45
+ setActiveValues(value, e);
30
46
  }, [disabled, setActiveValues, value]);
31
- const handleOnKeyDown = React.useCallback((e, _dsIndex) => {
32
- if (!disabled && e.key === 'ArrowDown') {
33
- var _focusableChildrenRef, _focusableChildrenRef2, _focusableChildrenRef3, _focusableChildrenRef4, _focusableChildrenRef5;
34
-
35
- const currentIndex = focusableChildrenReferences.findIndex(item => item.index === _dsIndex);
36
- if ((_focusableChildrenRef = focusableChildrenReferences[currentIndex + 1]) !== null && _focusableChildrenRef !== void 0 && (_focusableChildrenRef2 = _focusableChildrenRef.ref) !== null && _focusableChildrenRef2 !== void 0 && _focusableChildrenRef2.current) (_focusableChildrenRef3 = focusableChildrenReferences[currentIndex + 1]) === null || _focusableChildrenRef3 === void 0 ? void 0 : (_focusableChildrenRef4 = _focusableChildrenRef3.ref) === null || _focusableChildrenRef4 === void 0 ? void 0 : (_focusableChildrenRef5 = _focusableChildrenRef4.current) === null || _focusableChildrenRef5 === void 0 ? void 0 : _focusableChildrenRef5.focus();
47
+ const handleOnKeyDown = (0, import_react.useCallback)((e, _dsIndex) => {
48
+ if (!disabled && e.key === "ArrowDown") {
49
+ const currentIndex = focusableChildrenReferences.findIndex((item) => item.index === _dsIndex);
50
+ if (focusableChildrenReferences[currentIndex + 1]?.ref?.current)
51
+ focusableChildrenReferences[currentIndex + 1]?.ref?.current?.focus();
37
52
  }
38
-
39
- if (!disabled && e.key === 'ArrowUp') {
40
- var _focusableChildrenRef6, _focusableChildrenRef7, _focusableChildrenRef8, _focusableChildrenRef9, _focusableChildrenRef10;
41
-
42
- const currentIndex = focusableChildrenReferences.findIndex(item => item.index === _dsIndex);
43
- if ((_focusableChildrenRef6 = focusableChildrenReferences[currentIndex - 1]) !== null && _focusableChildrenRef6 !== void 0 && (_focusableChildrenRef7 = _focusableChildrenRef6.ref) !== null && _focusableChildrenRef7 !== void 0 && _focusableChildrenRef7.current) (_focusableChildrenRef8 = focusableChildrenReferences[currentIndex - 1]) === null || _focusableChildrenRef8 === void 0 ? void 0 : (_focusableChildrenRef9 = _focusableChildrenRef8.ref) === null || _focusableChildrenRef9 === void 0 ? void 0 : (_focusableChildrenRef10 = _focusableChildrenRef9.current) === null || _focusableChildrenRef10 === void 0 ? void 0 : _focusableChildrenRef10.focus();
53
+ if (!disabled && e.key === "ArrowUp") {
54
+ const currentIndex = focusableChildrenReferences.findIndex((item) => item.index === _dsIndex);
55
+ if (focusableChildrenReferences[currentIndex - 1]?.ref?.current)
56
+ focusableChildrenReferences[currentIndex - 1]?.ref?.current?.focus();
44
57
  }
45
58
  }, [disabled, focusableChildrenReferences]);
46
59
  return {
@@ -49,5 +62,5 @@ const useAccordionItem = _ref => {
49
62
  selected
50
63
  };
51
64
  };
52
-
53
- exports.useAccordionItem = useAccordionItem;
65
+ module.exports = __toCommonJS(useAccordionItem_exports);
66
+ //# sourceMappingURL=useAccordionItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/parts/accordionItem/useAccordionItem.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React, { useCallback, useContext, useMemo } from 'react';\nimport { DSAccordionContext } from '../../DSAccordionCTX';\nimport type { UseAccordionPropsT, UseAccordionItemReturnTypeT } from '../../DSAccordionTypes';\n\nexport const useAccordionItem = ({ value, disabled }: UseAccordionPropsT): UseAccordionItemReturnTypeT => {\n const { actualActiveValue, setActiveValues, focusableChildrenReferences } = useContext(DSAccordionContext);\n\n const selected = useMemo(() => {\n if (Array.isArray(actualActiveValue)) {\n return actualActiveValue.some((currentValue) => currentValue === value);\n }\n return value === actualActiveValue;\n }, [actualActiveValue, value]);\n\n const handleOnClick = useCallback(\n (e: React.MouseEvent) => {\n if (!disabled) setActiveValues(value, e);\n },\n [disabled, setActiveValues, value],\n );\n\n const handleOnKeyDown = useCallback(\n (e: React.KeyboardEvent, _dsIndex: number) => {\n if (!disabled && e.key === 'ArrowDown') {\n const currentIndex = focusableChildrenReferences.findIndex((item) => item.index === _dsIndex);\n if (focusableChildrenReferences[currentIndex + 1]?.ref?.current)\n focusableChildrenReferences[currentIndex + 1]?.ref?.current?.focus();\n }\n\n if (!disabled && e.key === 'ArrowUp') {\n const currentIndex = focusableChildrenReferences.findIndex((item) => item.index === _dsIndex);\n if (focusableChildrenReferences[currentIndex - 1]?.ref?.current)\n focusableChildrenReferences[currentIndex - 1]?.ref?.current?.focus();\n }\n },\n [disabled, focusableChildrenReferences],\n );\n\n return {\n handleOnClick,\n handleOnKeyDown,\n selected,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwD;AACxD,4BAAmC;AAG5B,MAAM,mBAAmB,CAAC,EAAE,OAAO,eAAgE;AACxG,QAAM,EAAE,mBAAmB,iBAAiB,gCAAgC,6BAAW;AAEvF,QAAM,WAAW,0BAAQ,MAAM;AAC7B,QAAI,MAAM,QAAQ,oBAAoB;AACpC,aAAO,kBAAkB,KAAK,CAAC,iBAAiB,iBAAiB;AAAA;AAEnE,WAAO,UAAU;AAAA,KAChB,CAAC,mBAAmB;AAEvB,QAAM,gBAAgB,8BACpB,CAAC,MAAwB;AACvB,QAAI,CAAC;AAAU,sBAAgB,OAAO;AAAA,KAExC,CAAC,UAAU,iBAAiB;AAG9B,QAAM,kBAAkB,8BACtB,CAAC,GAAwB,aAAqB;AAC5C,QAAI,CAAC,YAAY,EAAE,QAAQ,aAAa;AACtC,YAAM,eAAe,4BAA4B,UAAU,CAAC,SAAS,KAAK,UAAU;AACpF,UAAI,4BAA4B,eAAe,IAAI,KAAK;AACtD,oCAA4B,eAAe,IAAI,KAAK,SAAS;AAAA;AAGjE,QAAI,CAAC,YAAY,EAAE,QAAQ,WAAW;AACpC,YAAM,eAAe,4BAA4B,UAAU,CAAC,SAAS,KAAK,UAAU;AACpF,UAAI,4BAA4B,eAAe,IAAI,KAAK;AACtD,oCAA4B,eAAe,IAAI,KAAK,SAAS;AAAA;AAAA,KAGnE,CAAC,UAAU;AAGb,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA;AAAA;",
6
+ "names": []
7
+ }
package/cjs/propTypes.js CHANGED
@@ -1,26 +1,57 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var reactDesc = require('react-desc');
6
-
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var propTypes_exports = {};
29
+ __export(propTypes_exports, {
30
+ accordionItemPropTypes: () => accordionItemPropTypes,
31
+ accordionPropTypes: () => accordionPropTypes
32
+ });
33
+ var React = __toESM(require("react"));
34
+ var import_react_desc = require("react-desc");
7
35
  const accordionItemPropTypes = {
8
- children: reactDesc.PropTypes.node.description('Dimsum AccordionItem content.').isRequired,
9
- title: reactDesc.PropTypes.string.description('Set a primary title.'),
10
- value: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.number]).description('Dimsum AccordionItem value, this value should be unique.').isRequired,
11
- iconClosed: reactDesc.PropTypes.node.description('Custom Dimsum Icon when it is closed.'),
12
- iconOpened: reactDesc.PropTypes.node.description('Custom Dimsum Icon when it is open.'),
13
- secondaryTitle: reactDesc.PropTypes.string.description('Set a secondary title'),
14
- customActions: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.object).description('Set Dimsum AccordionItem custom actions.'),
15
- renderCustomActions: reactDesc.PropTypes.func.description('This property will render any JSX in the custom actions area. You can access to all references and active values within the props.')
36
+ children: import_react_desc.PropTypes.node.description("Dimsum AccordionItem content.").isRequired,
37
+ title: import_react_desc.PropTypes.string.description("Set a primary title."),
38
+ value: import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.string, import_react_desc.PropTypes.number]).description("Dimsum AccordionItem value, this value should be unique.").isRequired,
39
+ iconClosed: import_react_desc.PropTypes.node.description("Custom Dimsum Icon when it is closed."),
40
+ iconOpened: import_react_desc.PropTypes.node.description("Custom Dimsum Icon when it is open."),
41
+ secondaryTitle: import_react_desc.PropTypes.string.description("Set a secondary title"),
42
+ customActions: import_react_desc.PropTypes.arrayOf(import_react_desc.PropTypes.object).description("Set Dimsum AccordionItem custom actions."),
43
+ renderCustomActions: import_react_desc.PropTypes.func.description("This property will render any JSX in the custom actions area. You can access to all references and active values within the props.")
16
44
  };
17
45
  const accordionPropTypes = {
18
- containerProps: reactDesc.PropTypes.object.description('Adds props to the container.'),
19
- activeValue: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.number])), reactDesc.PropTypes.string, reactDesc.PropTypes.number]).description('Selected active value. This property makes the component a controlled one.'),
20
- children: reactDesc.PropTypes.node.description('Dimsum AccordionItems to show.'),
21
- allowMultipleOpen: reactDesc.PropTypes.bool.description('Allows multiple Dimsum AccordionItems to be open at the same time.'),
22
- onChange: reactDesc.PropTypes.func.description('Callback function once the Dimsum Accordion changes.')
46
+ containerProps: import_react_desc.PropTypes.object.description("Adds props to the container."),
47
+ activeValue: import_react_desc.PropTypes.oneOfType([
48
+ import_react_desc.PropTypes.arrayOf(import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.string, import_react_desc.PropTypes.number])),
49
+ import_react_desc.PropTypes.string,
50
+ import_react_desc.PropTypes.number
51
+ ]).description("Selected active value. This property makes the component a controlled one."),
52
+ children: import_react_desc.PropTypes.node.description("Dimsum AccordionItems to show."),
53
+ allowMultipleOpen: import_react_desc.PropTypes.bool.description("Allows multiple Dimsum AccordionItems to be open at the same time."),
54
+ onChange: import_react_desc.PropTypes.func.description("Callback function once the Dimsum Accordion changes.")
23
55
  };
24
-
25
- exports.accordionItemPropTypes = accordionItemPropTypes;
26
- exports.accordionPropTypes = accordionPropTypes;
56
+ module.exports = __toCommonJS(propTypes_exports);
57
+ //# sourceMappingURL=propTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/propTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { PropTypes } from 'react-desc';\n\nexport const accordionItemPropTypes = {\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.'),\n iconOpened: PropTypes.node.description('Custom Dimsum Icon when it is open.'),\n secondaryTitle: PropTypes.string.description('Set a secondary title'),\n customActions: PropTypes.arrayOf(PropTypes.object).description('Set Dimsum AccordionItem custom actions.'),\n renderCustomActions: PropTypes.func.description(\n 'This property will render any JSX in the custom actions area. You can access to all references and active values within the props.',\n ),\n};\n\nexport const accordionPropTypes = {\n containerProps: PropTypes.object.description('Adds props to the container.'),\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;ACAA,YAAuB;ADAvB,wBAA0B;AAEnB,MAAM,yBAAyB;AAAA,EACpC,UAAU,4BAAU,KAAK,YAAY,iCAAiC;AAAA,EACtE,OAAO,4BAAU,OAAO,YAAY;AAAA,EACpC,OAAO,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,SAAS,YAC/D,4DACA;AAAA,EACF,YAAY,4BAAU,KAAK,YAAY;AAAA,EACvC,YAAY,4BAAU,KAAK,YAAY;AAAA,EACvC,gBAAgB,4BAAU,OAAO,YAAY;AAAA,EAC7C,eAAe,4BAAU,QAAQ,4BAAU,QAAQ,YAAY;AAAA,EAC/D,qBAAqB,4BAAU,KAAK,YAClC;AAAA;AAIG,MAAM,qBAAqB;AAAA,EAChC,gBAAgB,4BAAU,OAAO,YAAY;AAAA,EAC7C,aAAa,4BAAU,UAAU;AAAA,IAC/B,4BAAU,QAAQ,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU;AAAA,IACnE,4BAAU;AAAA,IACV,4BAAU;AAAA,KACT,YAAY;AAAA,EACf,UAAU,4BAAU,KAAK,YAAY;AAAA,EACrC,mBAAmB,4BAAU,KAAK,YAAY;AAAA,EAC9C,UAAU,4BAAU,KAAK,YAAY;AAAA;",
6
+ "names": []
7
+ }
@@ -1,21 +1,23 @@
1
- import _jsx2 from '@babel/runtime/helpers/esm/jsx';
2
- import 'react';
3
- import { describe } from 'react-desc';
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 './propTypes.js';
8
-
9
- var _AccordionContent;
10
-
11
- const DSAccordion = props => {
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { describe } from "react-desc";
4
+ import { AccordionContent } from "./parts/accordionContent/AccordionContent";
5
+ import { useAccordion } from "./config/useAccordion";
6
+ import { DSAccordionContext } from "./DSAccordionCTX";
7
+ import { accordionPropTypes } from "./propTypes";
8
+ const DSAccordion = (props) => {
12
9
  const ctx = useAccordion(props);
13
- return /*#__PURE__*/_jsx2(DSAccordionContext.Provider, {
10
+ return /* @__PURE__ */ React2.createElement(DSAccordionContext.Provider, {
14
11
  value: ctx
15
- }, void 0, _AccordionContent || (_AccordionContent = /*#__PURE__*/_jsx2(AccordionContent, {})));
12
+ }, /* @__PURE__ */ React2.createElement(AccordionContent, null));
16
13
  };
17
-
14
+ DSAccordion.propTypes = accordionPropTypes;
18
15
  const DSAccordionWithSchema = describe(DSAccordion);
19
16
  DSAccordionWithSchema.propTypes = accordionPropTypes;
20
-
21
- export { DSAccordion, DSAccordionWithSchema, DSAccordion as default };
17
+ var DSAccordion_default = DSAccordion;
18
+ export {
19
+ DSAccordion,
20
+ DSAccordionWithSchema,
21
+ DSAccordion_default as default
22
+ };
23
+ //# sourceMappingURL=DSAccordion.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSAccordion.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from 'react-desc';\nimport { AccordionContent } from './parts/accordionContent/AccordionContent';\nimport { useAccordion } from './config/useAccordion';\nimport { DSAccordionContext } from './DSAccordionCTX';\nimport { accordionPropTypes } from './propTypes';\nimport type { DSAccordionPropsT } from './DSAccordionTypes';\n\nconst DSAccordion = (props: DSAccordionPropsT): JSX.Element => {\n const ctx = useAccordion(props);\n\n return (\n <DSAccordionContext.Provider value={ctx}>\n <AccordionContent />\n </DSAccordionContext.Provider>\n );\n};\n\nDSAccordion.propTypes = accordionPropTypes;\nconst DSAccordionWithSchema = describe(DSAccordion);\nDSAccordionWithSchema.propTypes = accordionPropTypes;\n\nexport { DSAccordion, DSAccordionWithSchema };\n\nexport default DSAccordion;\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AAGA,MAAM,cAAc,CAAC,UAA0C;AAC7D,QAAM,MAAM,aAAa;AAEzB,SACE,qCAAC,mBAAmB,UAApB;AAAA,IAA6B,OAAO;AAAA,KAClC,qCAAC,kBAAD;AAAA;AAKN,YAAY,YAAY;AACxB,MAAM,wBAAwB,SAAS;AACvC,sBAAsB,YAAY;AAIlC,IAAO,sBAAQ;",
6
+ "names": []
7
+ }
@@ -1,9 +1,8 @@
1
- import { createContext } from 'react';
2
- import { defaultProps } from './defaultProps.js';
3
-
4
- // eslint-disable-next-line @typescript-eslint/no-empty-function
5
- const noop = () => {};
6
-
1
+ import * as React from "react";
2
+ import { createContext } from "react";
3
+ import { defaultProps } from "./defaultProps";
4
+ const noop = () => {
5
+ };
7
6
  const defaultContext = {
8
7
  props: defaultProps,
9
8
  actualActiveValue: [],
@@ -11,6 +10,8 @@ const defaultContext = {
11
10
  focusableChildrenReferences: [],
12
11
  allChildrenReferences: {}
13
12
  };
14
- const DSAccordionContext = /*#__PURE__*/createContext(defaultContext);
15
-
16
- export { DSAccordionContext };
13
+ const DSAccordionContext = createContext(defaultContext);
14
+ export {
15
+ DSAccordionContext
16
+ };
17
+ //# sourceMappingURL=DSAccordionCTX.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 { defaultProps } from './defaultProps';\nimport type { DSAccordionContextT } from './DSAccordionTypes';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\n\nconst defaultContext = {\n props: defaultProps,\n actualActiveValue: [],\n setActiveValues: noop,\n focusableChildrenReferences: [],\n allChildrenReferences: {},\n};\n\nexport const DSAccordionContext = createContext<DSAccordionContextT>(defaultContext);\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AAIA,MAAM,OAAO,MAAY;AAAA;AAEzB,MAAM,iBAAiB;AAAA,EACrB,OAAO;AAAA,EACP,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,6BAA6B;AAAA,EAC7B,uBAAuB;AAAA;AAGlB,MAAM,qBAAqB,cAAmC;",
6
+ "names": []
7
+ }
@@ -1,10 +1,13 @@
1
+ import * as React from "react";
1
2
  const DSAccordionDataTestid = {
2
3
  ITEM: {
3
- CONTENT: 'ds-accordion_item-content',
4
- HEADER: 'ds-accordion_item-header',
5
- CONTAINER: 'ds-accordion_item'
4
+ CONTENT: "ds-accordion_item-content",
5
+ HEADER: "ds-accordion_item-header",
6
+ CONTAINER: "ds-accordion_item"
6
7
  },
7
- GROUP: 'ds-accordion_group'
8
+ GROUP: "ds-accordion_group"
8
9
  };
9
-
10
- export { DSAccordionDataTestid };
10
+ export {
11
+ DSAccordionDataTestid
12
+ };
13
+ //# sourceMappingURL=DSAccordionDatatestid.js.map