@elliemae/ds-accordion 2.0.0-alpha.10 → 2.0.0-alpha.14
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/cjs/DSAccordion.js +16 -8
- package/cjs/DSAccordionHeader.js +17 -19
- package/cjs/DSAccordionHeaderActions.js +15 -7
- package/cjs/DSAccordionHeaderTitle.js +8 -7
- package/cjs/DSAccordionItem.js +8 -13
- package/esm/DSAccordion.js +16 -8
- package/esm/DSAccordionHeader.js +16 -16
- package/esm/DSAccordionHeaderActions.js +15 -7
- package/esm/DSAccordionHeaderTitle.js +8 -7
- package/esm/DSAccordionItem.js +6 -8
- package/package.json +13 -7
- package/types/DSAccordion.d.ts +43 -6
- package/types/DSAccordionHeader.d.ts +1 -1
- package/types/DSAccordionItem.d.ts +6 -1
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
package/cjs/DSAccordion.js
CHANGED
|
@@ -4,6 +4,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
7
14
|
var React = require('react');
|
|
8
15
|
var reactDesc = require('react-desc');
|
|
9
16
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
@@ -23,14 +30,15 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
23
30
|
|
|
24
31
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
25
32
|
|
|
26
|
-
const DSAccordion =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
const DSAccordion = _ref => {
|
|
34
|
+
let {
|
|
35
|
+
containerProps = {},
|
|
36
|
+
activeValue = '',
|
|
37
|
+
children,
|
|
38
|
+
allowMultipleOpen = false,
|
|
39
|
+
contentExpandable = false,
|
|
40
|
+
onChange = () => {}
|
|
41
|
+
} = _ref;
|
|
34
42
|
const {
|
|
35
43
|
cssClassName
|
|
36
44
|
} = dsClassnames.convertPropToCssClassName('accordion');
|
package/cjs/DSAccordionHeader.js
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
4
|
require('react');
|
|
5
5
|
var dsSystem = require('@elliemae/ds-system');
|
|
6
|
-
var
|
|
7
|
-
var ChevronRight = require('@elliemae/ds-icons/ChevronRight');
|
|
6
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
8
7
|
var DSButton = require('@elliemae/ds-button');
|
|
9
8
|
var DSAccordionHeaderActions = require('./DSAccordionHeaderActions.js');
|
|
10
9
|
var DSAccordionHeaderTitle = require('./DSAccordionHeaderTitle.js');
|
|
@@ -13,37 +12,36 @@ var blocks = require('./blocks.js');
|
|
|
13
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
13
|
|
|
15
14
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
16
|
-
var ChevronDown__default = /*#__PURE__*/_interopDefaultLegacy(ChevronDown);
|
|
17
|
-
var ChevronRight__default = /*#__PURE__*/_interopDefaultLegacy(ChevronRight);
|
|
18
15
|
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
19
16
|
|
|
20
|
-
const DSAccordionHeader = dsSystem.withTheme(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
const DSAccordionHeader = dsSystem.withTheme(_ref => {
|
|
18
|
+
let {
|
|
19
|
+
title,
|
|
20
|
+
secondaryTitle,
|
|
21
|
+
customActions,
|
|
22
|
+
idx,
|
|
23
|
+
icon,
|
|
24
|
+
selected,
|
|
25
|
+
setTabRef,
|
|
26
|
+
onClick,
|
|
27
|
+
onKeyDown
|
|
28
|
+
} = _ref;
|
|
31
29
|
const mobile = dsSystem.useIsMobile();
|
|
32
30
|
const hasSecondaryTitle = Boolean(secondaryTitle);
|
|
33
31
|
const selectedClass = selected ? 'selected' : '';
|
|
34
32
|
const labelClass = hasSecondaryTitle ? 'secondary-title' : '';
|
|
35
|
-
const IconMobile = selected ?
|
|
33
|
+
const IconMobile = selected ? dsIcons.ChevronDown : dsIcons.ChevronRight;
|
|
36
34
|
return /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
|
|
37
|
-
"aria-controls":
|
|
35
|
+
"aria-controls": "sec".concat(idx),
|
|
38
36
|
"aria-expanded": selected,
|
|
39
37
|
"aria-label": title,
|
|
40
38
|
as: "div",
|
|
41
39
|
buttonType: "secondary",
|
|
42
|
-
className:
|
|
40
|
+
className: "".concat(blocks.accordionButton, " ").concat(selectedClass, " ").concat(hasSecondaryTitle ? 'with-secondary-title' : ''),
|
|
43
41
|
"data-testid": "ds-accordion_item-header",
|
|
44
42
|
innerRef: setTabRef,
|
|
45
43
|
labelText: /*#__PURE__*/_jsx__default["default"]("div", {
|
|
46
|
-
className:
|
|
44
|
+
className: "".concat(blocks.accordionTitle, " ").concat(selectedClass, " ").concat(labelClass)
|
|
47
45
|
}, void 0, !mobile && icon, /*#__PURE__*/_jsx__default["default"](DSAccordionHeaderTitle, {
|
|
48
46
|
idx: idx,
|
|
49
47
|
secondaryTitle: secondaryTitle,
|
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
4
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
5
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
6
13
|
require('react');
|
|
7
14
|
var DSButton = require('@elliemae/ds-button');
|
|
8
15
|
var blocks = require('./blocks.js');
|
|
@@ -21,17 +28,18 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
21
28
|
|
|
22
29
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
23
30
|
|
|
24
|
-
const DSAccordionHeaderActions =
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
const DSAccordionHeaderActions = _ref => {
|
|
32
|
+
let {
|
|
33
|
+
customActions
|
|
34
|
+
} = _ref;
|
|
27
35
|
if (!customActions) return null;
|
|
28
36
|
return /*#__PURE__*/_jsx__default["default"]("div", {
|
|
29
|
-
className:
|
|
30
|
-
}, void 0, customActions.map((
|
|
37
|
+
className: "".concat(blocks.accordionActions)
|
|
38
|
+
}, void 0, customActions.map((_ref2, key) => {
|
|
31
39
|
let {
|
|
32
40
|
onClick
|
|
33
|
-
} =
|
|
34
|
-
rest = _objectWithoutProperties__default["default"](
|
|
41
|
+
} = _ref2,
|
|
42
|
+
rest = _objectWithoutProperties__default["default"](_ref2, _excluded);
|
|
35
43
|
|
|
36
44
|
return /*#__PURE__*/jsxRuntime.jsx(DSButton__default["default"], _objectSpread(_objectSpread({
|
|
37
45
|
onClick: e => {
|
|
@@ -12,16 +12,17 @@ var DSTruncatedTooltipText__default = /*#__PURE__*/_interopDefaultLegacy(DSTrunc
|
|
|
12
12
|
|
|
13
13
|
var _div;
|
|
14
14
|
|
|
15
|
-
const DSAccordionHeader =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const DSAccordionHeader = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
title,
|
|
18
|
+
secondaryTitle,
|
|
19
|
+
idx
|
|
20
|
+
} = _ref;
|
|
20
21
|
const hasSecondaryTitle = Boolean(secondaryTitle);
|
|
21
22
|
return /*#__PURE__*/_jsx__default["default"]("div", {
|
|
22
|
-
className:
|
|
23
|
+
className: "".concat(blocks.accordionTitleWrapper, " ").concat(hasSecondaryTitle ? 'with-secondary-title' : '')
|
|
23
24
|
}, void 0, /*#__PURE__*/_jsx__default["default"]("h2", {
|
|
24
|
-
id:
|
|
25
|
+
id: "accordion_".concat(idx, "id")
|
|
25
26
|
}, void 0, /*#__PURE__*/_jsx__default["default"](DSTruncatedTooltipText__default["default"], {
|
|
26
27
|
className: blocks.accordionH2Title,
|
|
27
28
|
value: title
|
package/cjs/DSAccordionItem.js
CHANGED
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
6
|
var React = require('react');
|
|
8
|
-
var
|
|
9
|
-
var ArrowheadDown = require('@elliemae/ds-icons/ArrowheadDown');
|
|
7
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
10
8
|
var GroupItem = require('@elliemae/ds-shared/GroupContext/GroupItem');
|
|
11
9
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
12
10
|
var reactDesc = require('react-desc');
|
|
@@ -16,10 +14,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
16
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
15
|
|
|
18
16
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
19
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
20
17
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
|
-
var ArrowheadRight__default = /*#__PURE__*/_interopDefaultLegacy(ArrowheadRight);
|
|
22
|
-
var ArrowheadDown__default = /*#__PURE__*/_interopDefaultLegacy(ArrowheadDown);
|
|
23
18
|
var GroupItem__default = /*#__PURE__*/_interopDefaultLegacy(GroupItem);
|
|
24
19
|
|
|
25
20
|
const ICON_SIZE = 's';
|
|
@@ -34,7 +29,7 @@ class DSAccordionItem extends React.Component {
|
|
|
34
29
|
constructor(props) {
|
|
35
30
|
super(props);
|
|
36
31
|
|
|
37
|
-
|
|
32
|
+
this.setHeight = element => {
|
|
38
33
|
const {
|
|
39
34
|
actualHeight
|
|
40
35
|
} = this.state;
|
|
@@ -52,7 +47,7 @@ class DSAccordionItem extends React.Component {
|
|
|
52
47
|
});
|
|
53
48
|
}
|
|
54
49
|
}, 0);
|
|
55
|
-
}
|
|
50
|
+
};
|
|
56
51
|
|
|
57
52
|
this.childElements = /*#__PURE__*/React__default["default"].createRef();
|
|
58
53
|
this.state = {
|
|
@@ -115,10 +110,10 @@ class DSAccordionItem extends React.Component {
|
|
|
115
110
|
}), /*#__PURE__*/_jsx__default["default"]("div", {
|
|
116
111
|
"data-testid": "ds-accordion_item-content",
|
|
117
112
|
"aria-hidden": !selected,
|
|
118
|
-
"aria-labelledby":
|
|
119
|
-
className:
|
|
113
|
+
"aria-labelledby": "accordion_".concat(idx, "id"),
|
|
114
|
+
className: "".concat(classNameElement('container'), " ").concat(selected ? 'expanded' : 'closed'),
|
|
120
115
|
"data-testid": "ds-accordion_item-content",
|
|
121
|
-
id:
|
|
116
|
+
id: "sec".concat(idx),
|
|
122
117
|
role: "region",
|
|
123
118
|
style: {
|
|
124
119
|
height: selected ? actualHeight : 0
|
|
@@ -159,11 +154,11 @@ const props = {
|
|
|
159
154
|
customActions: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.object).description('accordion item custom actions')
|
|
160
155
|
};
|
|
161
156
|
DSAccordionItem.defaultProps = {
|
|
162
|
-
iconClosed: () => /*#__PURE__*/_jsx__default["default"](
|
|
157
|
+
iconClosed: () => /*#__PURE__*/_jsx__default["default"](dsIcons.ArrowheadRight, {
|
|
163
158
|
width: "20px",
|
|
164
159
|
color: ['brand-primary', 800]
|
|
165
160
|
}),
|
|
166
|
-
iconOpened: () => /*#__PURE__*/_jsx__default["default"](
|
|
161
|
+
iconOpened: () => /*#__PURE__*/_jsx__default["default"](dsIcons.ArrowheadDown, {
|
|
167
162
|
width: "20px",
|
|
168
163
|
color: ['brand-primary', 800]
|
|
169
164
|
}),
|
package/esm/DSAccordion.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
5
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
6
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
8
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
3
10
|
import React from 'react';
|
|
4
11
|
import { PropTypes, describe } from 'react-desc';
|
|
5
12
|
import { convertPropToCssClassName } from '@elliemae/ds-classnames';
|
|
@@ -12,14 +19,15 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
12
19
|
|
|
13
20
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
14
21
|
|
|
15
|
-
const DSAccordion =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
const DSAccordion = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
containerProps = {},
|
|
25
|
+
activeValue = '',
|
|
26
|
+
children,
|
|
27
|
+
allowMultipleOpen = false,
|
|
28
|
+
contentExpandable = false,
|
|
29
|
+
onChange = () => {}
|
|
30
|
+
} = _ref;
|
|
23
31
|
const {
|
|
24
32
|
cssClassName
|
|
25
33
|
} = convertPropToCssClassName('accordion');
|
package/esm/DSAccordionHeader.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
2
|
import 'react';
|
|
3
3
|
import { withTheme, useIsMobile } from '@elliemae/ds-system';
|
|
4
|
-
import ChevronDown from '@elliemae/ds-icons
|
|
5
|
-
import ChevronRight from '@elliemae/ds-icons/ChevronRight';
|
|
4
|
+
import { ChevronDown, ChevronRight } from '@elliemae/ds-icons';
|
|
6
5
|
import DSButton from '@elliemae/ds-button';
|
|
7
6
|
import DSAccordionHeaderActions from './DSAccordionHeaderActions.js';
|
|
8
7
|
import DSAccordionHeader$1 from './DSAccordionHeaderTitle.js';
|
|
9
8
|
import { accordionButton, accordionTitle } from './blocks.js';
|
|
10
9
|
|
|
11
|
-
const DSAccordionHeader = withTheme(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
const DSAccordionHeader = withTheme(_ref => {
|
|
11
|
+
let {
|
|
12
|
+
title,
|
|
13
|
+
secondaryTitle,
|
|
14
|
+
customActions,
|
|
15
|
+
idx,
|
|
16
|
+
icon,
|
|
17
|
+
selected,
|
|
18
|
+
setTabRef,
|
|
19
|
+
onClick,
|
|
20
|
+
onKeyDown
|
|
21
|
+
} = _ref;
|
|
22
22
|
const mobile = useIsMobile();
|
|
23
23
|
const hasSecondaryTitle = Boolean(secondaryTitle);
|
|
24
24
|
const selectedClass = selected ? 'selected' : '';
|
|
25
25
|
const labelClass = hasSecondaryTitle ? 'secondary-title' : '';
|
|
26
26
|
const IconMobile = selected ? ChevronDown : ChevronRight;
|
|
27
27
|
return /*#__PURE__*/_jsx(DSButton, {
|
|
28
|
-
"aria-controls":
|
|
28
|
+
"aria-controls": "sec".concat(idx),
|
|
29
29
|
"aria-expanded": selected,
|
|
30
30
|
"aria-label": title,
|
|
31
31
|
as: "div",
|
|
32
32
|
buttonType: "secondary",
|
|
33
|
-
className:
|
|
33
|
+
className: "".concat(accordionButton, " ").concat(selectedClass, " ").concat(hasSecondaryTitle ? 'with-secondary-title' : ''),
|
|
34
34
|
"data-testid": "ds-accordion_item-header",
|
|
35
35
|
innerRef: setTabRef,
|
|
36
36
|
labelText: /*#__PURE__*/_jsx("div", {
|
|
37
|
-
className:
|
|
37
|
+
className: "".concat(accordionTitle, " ").concat(selectedClass, " ").concat(labelClass)
|
|
38
38
|
}, void 0, !mobile && icon, /*#__PURE__*/_jsx(DSAccordionHeader$1, {
|
|
39
39
|
idx: idx,
|
|
40
40
|
secondaryTitle: secondaryTitle,
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
6
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
8
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
9
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
10
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
4
11
|
import 'react';
|
|
5
12
|
import DSButton, { BUTTON_TYPE } from '@elliemae/ds-button';
|
|
6
13
|
import { accordionActions } from './blocks.js';
|
|
@@ -12,17 +19,18 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
12
19
|
|
|
13
20
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
14
21
|
|
|
15
|
-
const DSAccordionHeaderActions =
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
const DSAccordionHeaderActions = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
customActions
|
|
25
|
+
} = _ref;
|
|
18
26
|
if (!customActions) return null;
|
|
19
27
|
return /*#__PURE__*/_jsx("div", {
|
|
20
|
-
className:
|
|
21
|
-
}, void 0, customActions.map((
|
|
28
|
+
className: "".concat(accordionActions)
|
|
29
|
+
}, void 0, customActions.map((_ref2, key) => {
|
|
22
30
|
let {
|
|
23
31
|
onClick
|
|
24
|
-
} =
|
|
25
|
-
rest = _objectWithoutProperties(
|
|
32
|
+
} = _ref2,
|
|
33
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
26
34
|
|
|
27
35
|
return /*#__PURE__*/jsx(DSButton, _objectSpread(_objectSpread({
|
|
28
36
|
onClick: e => {
|
|
@@ -5,16 +5,17 @@ import { accordionTitleWrapper, accordionH2Title, accordionSecondaryTitle } from
|
|
|
5
5
|
|
|
6
6
|
var _div;
|
|
7
7
|
|
|
8
|
-
const DSAccordionHeader =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const DSAccordionHeader = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
title,
|
|
11
|
+
secondaryTitle,
|
|
12
|
+
idx
|
|
13
|
+
} = _ref;
|
|
13
14
|
const hasSecondaryTitle = Boolean(secondaryTitle);
|
|
14
15
|
return /*#__PURE__*/_jsx("div", {
|
|
15
|
-
className:
|
|
16
|
+
className: "".concat(accordionTitleWrapper, " ").concat(hasSecondaryTitle ? 'with-secondary-title' : '')
|
|
16
17
|
}, void 0, /*#__PURE__*/_jsx("h2", {
|
|
17
|
-
id:
|
|
18
|
+
id: "accordion_".concat(idx, "id")
|
|
18
19
|
}, void 0, /*#__PURE__*/_jsx(DSTruncatedTooltipText, {
|
|
19
20
|
className: accordionH2Title,
|
|
20
21
|
value: title
|
package/esm/DSAccordionItem.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
2
|
import React, { Component } from 'react';
|
|
4
|
-
import ArrowheadRight from '@elliemae/ds-icons
|
|
5
|
-
import ArrowheadDown from '@elliemae/ds-icons/ArrowheadDown';
|
|
3
|
+
import { ArrowheadRight, ArrowheadDown } from '@elliemae/ds-icons';
|
|
6
4
|
import GroupItem from '@elliemae/ds-shared/GroupContext/GroupItem';
|
|
7
5
|
import { convertPropToCssClassName } from '@elliemae/ds-classnames';
|
|
8
6
|
import { PropTypes, describe } from 'react-desc';
|
|
@@ -21,7 +19,7 @@ class DSAccordionItem extends Component {
|
|
|
21
19
|
constructor(props) {
|
|
22
20
|
super(props);
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
this.setHeight = element => {
|
|
25
23
|
const {
|
|
26
24
|
actualHeight
|
|
27
25
|
} = this.state;
|
|
@@ -39,7 +37,7 @@ class DSAccordionItem extends Component {
|
|
|
39
37
|
});
|
|
40
38
|
}
|
|
41
39
|
}, 0);
|
|
42
|
-
}
|
|
40
|
+
};
|
|
43
41
|
|
|
44
42
|
this.childElements = /*#__PURE__*/React.createRef();
|
|
45
43
|
this.state = {
|
|
@@ -102,10 +100,10 @@ class DSAccordionItem extends Component {
|
|
|
102
100
|
}), /*#__PURE__*/_jsx("div", {
|
|
103
101
|
"data-testid": "ds-accordion_item-content",
|
|
104
102
|
"aria-hidden": !selected,
|
|
105
|
-
"aria-labelledby":
|
|
106
|
-
className:
|
|
103
|
+
"aria-labelledby": "accordion_".concat(idx, "id"),
|
|
104
|
+
className: "".concat(classNameElement('container'), " ").concat(selected ? 'expanded' : 'closed'),
|
|
107
105
|
"data-testid": "ds-accordion_item-content",
|
|
108
|
-
id:
|
|
106
|
+
id: "sec".concat(idx),
|
|
109
107
|
role: "region",
|
|
110
108
|
style: {
|
|
111
109
|
height: selected ? actualHeight : 0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-accordion",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.14",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Accordion",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -56,14 +56,20 @@
|
|
|
56
56
|
"build": "node ../../scripts/build/build.js"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@elliemae/ds-button": "2.0.0-alpha.
|
|
60
|
-
"@elliemae/ds-classnames": "2.0.0-alpha.
|
|
61
|
-
"@elliemae/ds-icons": "2.0.0-alpha.
|
|
62
|
-
"@elliemae/ds-shared": "2.0.0-alpha.
|
|
63
|
-
"@elliemae/ds-system": "2.0.0-alpha.
|
|
64
|
-
"@elliemae/ds-truncated-tooltip-text": "2.0.0-alpha.
|
|
59
|
+
"@elliemae/ds-button": "2.0.0-alpha.14",
|
|
60
|
+
"@elliemae/ds-classnames": "2.0.0-alpha.14",
|
|
61
|
+
"@elliemae/ds-icons": "2.0.0-alpha.14",
|
|
62
|
+
"@elliemae/ds-shared": "2.0.0-alpha.14",
|
|
63
|
+
"@elliemae/ds-system": "2.0.0-alpha.14",
|
|
64
|
+
"@elliemae/ds-truncated-tooltip-text": "2.0.0-alpha.14",
|
|
65
65
|
"react-desc": "^4.1.3"
|
|
66
66
|
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@testing-library/jest-dom": "~5.15.0",
|
|
69
|
+
"@testing-library/react": "~12.1.2",
|
|
70
|
+
"react": "^17.0.2",
|
|
71
|
+
"react-dom": "^17.0.2"
|
|
72
|
+
},
|
|
67
73
|
"peerDependencies": {
|
|
68
74
|
"react": "^17.0.2",
|
|
69
75
|
"react-dom": "^17.0.2"
|
package/types/DSAccordion.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
/// <reference types="react" />
|
|
2
3
|
declare const DSAccordion: {
|
|
3
4
|
({ containerProps, activeValue, children, allowMultipleOpen, contentExpandable, onChange, }: {
|
|
@@ -10,11 +11,21 @@ declare const DSAccordion: {
|
|
|
10
11
|
}): JSX.Element;
|
|
11
12
|
propTypes: {
|
|
12
13
|
/** inject props to wrapper */
|
|
13
|
-
containerProps:
|
|
14
|
+
containerProps: {
|
|
15
|
+
defaultValue<T = unknown>(arg: T): {
|
|
16
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
17
|
+
};
|
|
18
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
19
|
+
};
|
|
14
20
|
/**
|
|
15
21
|
* Selected default active value
|
|
16
22
|
*/
|
|
17
|
-
activeValue:
|
|
23
|
+
activeValue: {
|
|
24
|
+
defaultValue<T = unknown>(arg: T): {
|
|
25
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
26
|
+
};
|
|
27
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
28
|
+
};
|
|
18
29
|
/**
|
|
19
30
|
* Accordion items to show
|
|
20
31
|
*/
|
|
@@ -22,17 +33,43 @@ declare const DSAccordion: {
|
|
|
22
33
|
/**
|
|
23
34
|
* Allows multiple accordion items to be open at the same time
|
|
24
35
|
*/
|
|
25
|
-
allowMultipleOpen:
|
|
36
|
+
allowMultipleOpen: {
|
|
37
|
+
defaultValue<T = unknown>(arg: T): {
|
|
38
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
39
|
+
};
|
|
40
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
41
|
+
};
|
|
26
42
|
/**
|
|
27
43
|
* Whether content is expandable or not
|
|
28
44
|
*/
|
|
29
|
-
contentExpandable:
|
|
45
|
+
contentExpandable: {
|
|
46
|
+
defaultValue<T = unknown>(arg: T): {
|
|
47
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
48
|
+
};
|
|
49
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
50
|
+
};
|
|
30
51
|
/**
|
|
31
52
|
* Allows a function that is triggered once the accordion changes
|
|
32
53
|
*/
|
|
33
|
-
onChange:
|
|
54
|
+
onChange: {
|
|
55
|
+
defaultValue<T = unknown>(arg: T): {
|
|
56
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
57
|
+
};
|
|
58
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
59
|
+
};
|
|
34
60
|
};
|
|
35
61
|
};
|
|
36
|
-
declare const DSAccordionWithSchema:
|
|
62
|
+
declare const DSAccordionWithSchema: {
|
|
63
|
+
(props?: {
|
|
64
|
+
containerProps?: {} | undefined;
|
|
65
|
+
activeValue?: string | undefined;
|
|
66
|
+
children: any;
|
|
67
|
+
allowMultipleOpen?: boolean | undefined;
|
|
68
|
+
contentExpandable?: boolean | undefined;
|
|
69
|
+
onChange?: (() => void) | undefined;
|
|
70
|
+
} | undefined): JSX.Element;
|
|
71
|
+
propTypes: unknown;
|
|
72
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
73
|
+
};
|
|
37
74
|
export { DSAccordion, DSAccordionWithSchema };
|
|
38
75
|
export default DSAccordion;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
import { Component } from 'react';
|
|
2
3
|
declare class DSAccordionItem extends Component {
|
|
3
4
|
constructor(props: any);
|
|
@@ -6,6 +7,10 @@ declare class DSAccordionItem extends Component {
|
|
|
6
7
|
setHeight: (element: any) => void;
|
|
7
8
|
render(): JSX.Element;
|
|
8
9
|
}
|
|
9
|
-
declare const DSAccordionItemWithSchema:
|
|
10
|
+
declare const DSAccordionItemWithSchema: {
|
|
11
|
+
(props?: unknown): JSX.Element;
|
|
12
|
+
propTypes: unknown;
|
|
13
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
14
|
+
};
|
|
10
15
|
export { DSAccordionItem, DSAccordionItemWithSchema };
|
|
11
16
|
export default DSAccordionItem;
|
package/cjs/package.json
DELETED