@elliemae/ds-accordion 2.3.1 → 3.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSAccordion.js +52 -0
- package/dist/cjs/DSAccordion.js.map +7 -0
- package/dist/cjs/DSAccordionCTX.js +46 -0
- package/dist/cjs/DSAccordionCTX.js.map +7 -0
- package/dist/cjs/DSAccordionDatatestid.js +42 -0
- package/dist/cjs/DSAccordionDatatestid.js.map +7 -0
- package/dist/cjs/DSAccordionTypes.js +27 -0
- package/dist/cjs/DSAccordionTypes.js.map +7 -0
- package/dist/cjs/config/useAccordion.js +73 -0
- package/dist/cjs/config/useAccordion.js.map +7 -0
- package/dist/cjs/config/useAccordionRefs.js +47 -0
- package/dist/cjs/config/useAccordionRefs.js.map +7 -0
- package/dist/cjs/defaultProps.js +64 -0
- package/dist/cjs/defaultProps.js.map +7 -0
- package/dist/cjs/index.js +37 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/parts/accordionContent/AccordionContent.js +66 -0
- package/dist/cjs/parts/accordionContent/AccordionContent.js.map +7 -0
- package/dist/cjs/parts/accordionItem/DSAccordionItem.js +211 -0
- package/dist/cjs/parts/accordionItem/DSAccordionItem.js.map +7 -0
- package/dist/cjs/parts/accordionItem/styles.js +143 -0
- package/dist/cjs/parts/accordionItem/styles.js.map +7 -0
- package/dist/cjs/parts/accordionItem/useAccordionItem.js +66 -0
- package/dist/cjs/parts/accordionItem/useAccordionItem.js.map +7 -0
- package/dist/cjs/propTypes.js +57 -0
- package/dist/cjs/propTypes.js.map +7 -0
- package/dist/esm/DSAccordion.js +23 -0
- package/dist/esm/DSAccordion.js.map +7 -0
- package/dist/esm/DSAccordionCTX.js +17 -0
- package/dist/esm/DSAccordionCTX.js.map +7 -0
- package/dist/esm/DSAccordionDatatestid.js +13 -0
- package/dist/esm/DSAccordionDatatestid.js.map +7 -0
- package/dist/esm/DSAccordionTypes.js +2 -0
- package/dist/esm/DSAccordionTypes.js.map +7 -0
- package/dist/esm/config/useAccordion.js +44 -0
- package/dist/esm/config/useAccordion.js.map +7 -0
- package/dist/esm/config/useAccordionRefs.js +18 -0
- package/dist/esm/config/useAccordionRefs.js.map +7 -0
- package/dist/esm/defaultProps.js +35 -0
- package/dist/esm/defaultProps.js.map +7 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/parts/accordionContent/AccordionContent.js +39 -0
- package/dist/esm/parts/accordionContent/AccordionContent.js.map +7 -0
- package/dist/esm/parts/accordionItem/DSAccordionItem.js +194 -0
- package/dist/esm/parts/accordionItem/DSAccordionItem.js.map +7 -0
- package/dist/esm/parts/accordionItem/styles.js +114 -0
- package/dist/esm/parts/accordionItem/styles.js.map +7 -0
- package/dist/esm/parts/accordionItem/useAccordionItem.js +37 -0
- package/dist/esm/parts/accordionItem/useAccordionItem.js.map +7 -0
- package/dist/esm/propTypes.js +28 -0
- package/dist/esm/propTypes.js.map +7 -0
- package/package.json +59 -49
- package/cjs/DSAccordion.js +0 -31
- package/cjs/DSAccordionCTX.js +0 -20
- package/cjs/DSAccordionDatatestid.js +0 -14
- package/cjs/DSAccordionTypes.js +0 -2
- package/cjs/config/useAccordion.js +0 -50
- package/cjs/config/useAccordionRefs.js +0 -40
- package/cjs/defaultProps.js +0 -54
- package/cjs/index.js +0 -14
- package/cjs/parts/accordionContent/AccordionContent.js +0 -41
- package/cjs/parts/accordionItem/DSAccordionItem.js +0 -206
- package/cjs/parts/accordionItem/styles.js +0 -149
- package/cjs/parts/accordionItem/useAccordionItem.js +0 -53
- package/cjs/propTypes.js +0 -26
- package/esm/DSAccordion.js +0 -21
- package/esm/DSAccordionCTX.js +0 -16
- package/esm/DSAccordionDatatestid.js +0 -10
- package/esm/DSAccordionTypes.js +0 -1
- package/esm/config/useAccordion.js +0 -46
- package/esm/config/useAccordionRefs.js +0 -32
- package/esm/defaultProps.js +0 -45
- package/esm/index.js +0 -2
- package/esm/parts/accordionContent/AccordionContent.js +0 -32
- package/esm/parts/accordionItem/DSAccordionItem.js +0 -193
- package/esm/parts/accordionItem/styles.js +0 -133
- package/esm/parts/accordionItem/useAccordionItem.js +0 -49
- package/esm/propTypes.js +0 -21
- package/types/DSAccordion.d.ts +0 -45
- package/types/DSAccordionCTX.d.ts +0 -3
- package/types/DSAccordionDatatestid.d.ts +0 -8
- package/types/DSAccordionTypes.d.ts +0 -137
- package/types/config/useAccordion.d.ts +0 -2
- package/types/config/useAccordionRefs.d.ts +0 -2
- package/types/defaultProps.d.ts +0 -3
- package/types/index.d.ts +0 -4
- package/types/parts/accordionContent/AccordionContent.d.ts +0 -2
- package/types/parts/accordionItem/DSAccordionItem.d.ts +0 -53
- package/types/parts/accordionItem/styles.d.ts +0 -10
- package/types/parts/accordionItem/useAccordionItem.d.ts +0 -2
- package/types/propTypes.d.ts +0 -73
- package/types/tests/Accordion.test.d.ts +0 -1
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
const StyledItemContainer = /*#__PURE__*/styled.div.withConfig({
|
|
4
|
-
componentId: "sc-fnpjby-0"
|
|
5
|
-
})(["display:grid;grid-template-rows:auto auto;border-bottom:1px solid ", ";align-items:center;"], _ref => {
|
|
6
|
-
let {
|
|
7
|
-
theme
|
|
8
|
-
} = _ref;
|
|
9
|
-
return theme.colors.neutral[200];
|
|
10
|
-
});
|
|
11
|
-
const StyledItemHeader = /*#__PURE__*/styled.button.withConfig({
|
|
12
|
-
componentId: "sc-fnpjby-1"
|
|
13
|
-
})(["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 => {
|
|
14
|
-
let {
|
|
15
|
-
theme,
|
|
16
|
-
withSecondaryTitle
|
|
17
|
-
} = _ref2;
|
|
18
|
-
return withSecondaryTitle ? theme.space.m : theme.space.s;
|
|
19
|
-
}, _ref3 => {
|
|
20
|
-
let {
|
|
21
|
-
disabled
|
|
22
|
-
} = _ref3;
|
|
23
|
-
return disabled ? 'not-allowed' : 'pointer';
|
|
24
|
-
}, _ref4 => {
|
|
25
|
-
let {
|
|
26
|
-
isDSMobile
|
|
27
|
-
} = _ref4;
|
|
28
|
-
return isDSMobile ? "0 16px" : "0";
|
|
29
|
-
}, _ref5 => {
|
|
30
|
-
let {
|
|
31
|
-
isDSMobile
|
|
32
|
-
} = _ref5;
|
|
33
|
-
return isDSMobile ? "flex-direction: row-reverse;" : "";
|
|
34
|
-
}, _ref6 => {
|
|
35
|
-
let {
|
|
36
|
-
theme
|
|
37
|
-
} = _ref6;
|
|
38
|
-
return theme.colors.brand[700];
|
|
39
|
-
});
|
|
40
|
-
const StyledItemContent = /*#__PURE__*/styled.div.withConfig({
|
|
41
|
-
componentId: "sc-fnpjby-2"
|
|
42
|
-
})(["margin:", ";grid-column:1/2;"], _ref7 => {
|
|
43
|
-
let {
|
|
44
|
-
isDSMobile
|
|
45
|
-
} = _ref7;
|
|
46
|
-
return isDSMobile ? "16px 16px 24px 16px" : "16px 16px 16px 32px";
|
|
47
|
-
});
|
|
48
|
-
const StyledItemAddon = /*#__PURE__*/styled.div.withConfig({
|
|
49
|
-
componentId: "sc-fnpjby-3"
|
|
50
|
-
})(["", " height:100%;width:", ";display:grid;place-items:center;& .em-ds-icon svg{fill:", ";}"], _ref8 => {
|
|
51
|
-
let {
|
|
52
|
-
theme,
|
|
53
|
-
isDSMobile
|
|
54
|
-
} = _ref8;
|
|
55
|
-
return !isDSMobile ? "padding: 0 ".concat(theme.space.xxs, ";") : "";
|
|
56
|
-
}, _ref9 => {
|
|
57
|
-
let {
|
|
58
|
-
theme
|
|
59
|
-
} = _ref9;
|
|
60
|
-
return theme.space.s;
|
|
61
|
-
}, _ref10 => {
|
|
62
|
-
let {
|
|
63
|
-
disabled,
|
|
64
|
-
theme
|
|
65
|
-
} = _ref10;
|
|
66
|
-
return disabled ? theme.colors.neutral[200] : theme.colors.brand[800];
|
|
67
|
-
});
|
|
68
|
-
const StyledItemTitles = /*#__PURE__*/styled.div.withConfig({
|
|
69
|
-
componentId: "sc-fnpjby-4"
|
|
70
|
-
})(["display:grid;grid-template-columns:100%;width:100%;align-content:center;"]);
|
|
71
|
-
const StyledPrimaryTitle = /*#__PURE__*/styled.div.withConfig({
|
|
72
|
-
componentId: "sc-fnpjby-5"
|
|
73
|
-
})(["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 => {
|
|
74
|
-
let {
|
|
75
|
-
disabled,
|
|
76
|
-
theme
|
|
77
|
-
} = _ref11;
|
|
78
|
-
return disabled ? theme.colors.neutral[200] : theme.colors.neutral[700];
|
|
79
|
-
}, _ref12 => {
|
|
80
|
-
let {
|
|
81
|
-
theme,
|
|
82
|
-
isDSMobile
|
|
83
|
-
} = _ref12;
|
|
84
|
-
return isDSMobile ? theme.fontWeights.regular : theme.fontWeights.regular;
|
|
85
|
-
}, _ref13 => {
|
|
86
|
-
let {
|
|
87
|
-
theme
|
|
88
|
-
} = _ref13;
|
|
89
|
-
return theme.space.xs;
|
|
90
|
-
});
|
|
91
|
-
const StyledSecondaryTitle = /*#__PURE__*/styled.span.withConfig({
|
|
92
|
-
componentId: "sc-fnpjby-6"
|
|
93
|
-
})(["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 => {
|
|
94
|
-
let {
|
|
95
|
-
theme
|
|
96
|
-
} = _ref14;
|
|
97
|
-
return theme.fontSizes.label[200];
|
|
98
|
-
}, _ref15 => {
|
|
99
|
-
let {
|
|
100
|
-
disabled,
|
|
101
|
-
theme
|
|
102
|
-
} = _ref15;
|
|
103
|
-
return disabled ? theme.colors.neutral[200] : theme.colors.neutral[500];
|
|
104
|
-
}, _ref16 => {
|
|
105
|
-
let {
|
|
106
|
-
theme
|
|
107
|
-
} = _ref16;
|
|
108
|
-
return theme.space.xs;
|
|
109
|
-
});
|
|
110
|
-
const StyledItemCustomActions = /*#__PURE__*/styled.div.withConfig({
|
|
111
|
-
componentId: "sc-fnpjby-7"
|
|
112
|
-
})(["display:grid;grid-auto-flow:column;grid-gap:", ";margin:0 ", ";justify-content:flex-end;"], _ref17 => {
|
|
113
|
-
let {
|
|
114
|
-
theme
|
|
115
|
-
} = _ref17;
|
|
116
|
-
return theme.space.xxs;
|
|
117
|
-
}, _ref18 => {
|
|
118
|
-
let {
|
|
119
|
-
theme
|
|
120
|
-
} = _ref18;
|
|
121
|
-
return theme.space.xs;
|
|
122
|
-
});
|
|
123
|
-
const StyledItemHeaderContainer = /*#__PURE__*/styled.div.withConfig({
|
|
124
|
-
componentId: "sc-fnpjby-8"
|
|
125
|
-
})(["display:grid;grid-template-columns:auto max-content;place-items:center;position:relative;&:hover{", "}"], _ref19 => {
|
|
126
|
-
let {
|
|
127
|
-
disabled,
|
|
128
|
-
theme
|
|
129
|
-
} = _ref19;
|
|
130
|
-
return !disabled ? "background: ".concat(theme.colors.brand[200], ";") : "";
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
export { StyledItemAddon, StyledItemContainer, StyledItemContent, StyledItemCustomActions, StyledItemHeader, StyledItemHeaderContainer, StyledItemTitles, StyledPrimaryTitle, StyledSecondaryTitle };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.some.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.some.js';
|
|
4
|
-
import { useContext, useMemo, useCallback } from 'react';
|
|
5
|
-
import { DSAccordionContext } from '../../DSAccordionCTX.js';
|
|
6
|
-
|
|
7
|
-
const useAccordionItem = _ref => {
|
|
8
|
-
let {
|
|
9
|
-
value,
|
|
10
|
-
disabled
|
|
11
|
-
} = _ref;
|
|
12
|
-
const {
|
|
13
|
-
actualActiveValue,
|
|
14
|
-
setActiveValues,
|
|
15
|
-
focusableChildrenReferences
|
|
16
|
-
} = useContext(DSAccordionContext);
|
|
17
|
-
const selected = useMemo(() => {
|
|
18
|
-
if (Array.isArray(actualActiveValue)) {
|
|
19
|
-
return actualActiveValue.some(currentValue => currentValue === value);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return value === actualActiveValue;
|
|
23
|
-
}, [actualActiveValue, value]);
|
|
24
|
-
const handleOnClick = useCallback(e => {
|
|
25
|
-
if (!disabled) setActiveValues(value, e);
|
|
26
|
-
}, [disabled, setActiveValues, value]);
|
|
27
|
-
const handleOnKeyDown = useCallback((e, _dsIndex) => {
|
|
28
|
-
if (!disabled && e.key === 'ArrowDown') {
|
|
29
|
-
var _focusableChildrenRef, _focusableChildrenRef2, _focusableChildrenRef3, _focusableChildrenRef4, _focusableChildrenRef5;
|
|
30
|
-
|
|
31
|
-
const currentIndex = focusableChildrenReferences.findIndex(item => item.index === _dsIndex);
|
|
32
|
-
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();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (!disabled && e.key === 'ArrowUp') {
|
|
36
|
-
var _focusableChildrenRef6, _focusableChildrenRef7, _focusableChildrenRef8, _focusableChildrenRef9, _focusableChildrenRef10;
|
|
37
|
-
|
|
38
|
-
const currentIndex = focusableChildrenReferences.findIndex(item => item.index === _dsIndex);
|
|
39
|
-
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();
|
|
40
|
-
}
|
|
41
|
-
}, [disabled, focusableChildrenReferences]);
|
|
42
|
-
return {
|
|
43
|
-
handleOnClick,
|
|
44
|
-
handleOnKeyDown,
|
|
45
|
-
selected
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export { useAccordionItem };
|
package/esm/propTypes.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { PropTypes } from 'react-desc';
|
|
2
|
-
|
|
3
|
-
const accordionItemPropTypes = {
|
|
4
|
-
children: PropTypes.node.description('Dimsum AccordionItem content.').isRequired,
|
|
5
|
-
title: PropTypes.string.description('Set a primary title.'),
|
|
6
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Dimsum AccordionItem value, this value should be unique.').isRequired,
|
|
7
|
-
iconClosed: PropTypes.node.description('Custom Dimsum Icon when it is closed.'),
|
|
8
|
-
iconOpened: PropTypes.node.description('Custom Dimsum Icon when it is open.'),
|
|
9
|
-
secondaryTitle: PropTypes.string.description('Set a secondary title'),
|
|
10
|
-
customActions: PropTypes.arrayOf(PropTypes.object).description('Set Dimsum AccordionItem custom actions.'),
|
|
11
|
-
renderCustomActions: 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.')
|
|
12
|
-
};
|
|
13
|
-
const accordionPropTypes = {
|
|
14
|
-
containerProps: PropTypes.object.description('Adds props to the container.'),
|
|
15
|
-
activeValue: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])), PropTypes.string, PropTypes.number]).description('Selected active value. This property makes the component a controlled one.'),
|
|
16
|
-
children: PropTypes.node.description('Dimsum AccordionItems to show.'),
|
|
17
|
-
allowMultipleOpen: PropTypes.bool.description('Allows multiple Dimsum AccordionItems to be open at the same time.'),
|
|
18
|
-
onChange: PropTypes.func.description('Callback function once the Dimsum Accordion changes.')
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { accordionItemPropTypes, accordionPropTypes };
|
package/types/DSAccordion.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
|
-
import type { DSAccordionPropsT } from './DSAccordionTypes';
|
|
4
|
-
declare const DSAccordion: {
|
|
5
|
-
(props: DSAccordionPropsT): JSX.Element;
|
|
6
|
-
propTypes: {
|
|
7
|
-
containerProps: {
|
|
8
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
9
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
10
|
-
};
|
|
11
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
12
|
-
};
|
|
13
|
-
activeValue: {
|
|
14
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
15
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
16
|
-
};
|
|
17
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
18
|
-
};
|
|
19
|
-
children: {
|
|
20
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
21
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
22
|
-
};
|
|
23
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
24
|
-
};
|
|
25
|
-
allowMultipleOpen: {
|
|
26
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
27
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
28
|
-
};
|
|
29
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
30
|
-
};
|
|
31
|
-
onChange: {
|
|
32
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
33
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
34
|
-
};
|
|
35
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
declare const DSAccordionWithSchema: {
|
|
40
|
-
(props?: unknown): JSX.Element;
|
|
41
|
-
propTypes: unknown;
|
|
42
|
-
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
43
|
-
};
|
|
44
|
-
export { DSAccordion, DSAccordionWithSchema };
|
|
45
|
-
export default DSAccordion;
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare type InternalActiveValueT = (string | number)[] | string | number | null | undefined;
|
|
3
|
-
export interface DefaultIconPropsT {
|
|
4
|
-
isDSMobile: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface CustomActionsT {
|
|
7
|
-
onClick: (e: React.MouseEvent) => void;
|
|
8
|
-
id: string;
|
|
9
|
-
}
|
|
10
|
-
export interface FocusableChildrenReferences {
|
|
11
|
-
index: number;
|
|
12
|
-
value: string | number;
|
|
13
|
-
ref: React.MutableRefObject<HTMLButtonElement | null>;
|
|
14
|
-
}
|
|
15
|
-
export interface AllChildrenReferences {
|
|
16
|
-
[index: string]: React.MutableRefObject<HTMLButtonElement | null>;
|
|
17
|
-
}
|
|
18
|
-
export interface DSAccordionPropsT {
|
|
19
|
-
containerProps?: Record<string, unknown>;
|
|
20
|
-
activeValue?: (string | number)[] | string | number | null;
|
|
21
|
-
children?: React.ReactElement<DSAccordionItemPropsT>[];
|
|
22
|
-
allowMultipleOpen?: boolean;
|
|
23
|
-
contentExpandable?: boolean;
|
|
24
|
-
onChange?: (value: (string | number)[] | string | number | null, e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
isDSMobile?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface DSAccordionDefaultPropsT {
|
|
29
|
-
containerProps: Record<string, unknown>;
|
|
30
|
-
allowMultipleOpen: boolean;
|
|
31
|
-
contentExpandable: boolean;
|
|
32
|
-
onChange: (value: (string | number)[] | string | number | null, e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
33
|
-
children: React.ReactElement<DSAccordionItemPropsT>[];
|
|
34
|
-
isDSMobile: boolean;
|
|
35
|
-
}
|
|
36
|
-
export interface DSAccordionPropsWithDefaultsT {
|
|
37
|
-
containerProps: Record<string, unknown>;
|
|
38
|
-
activeValue?: (string | number)[] | string | number | null;
|
|
39
|
-
children: React.ReactElement<DSAccordionItemPropsT>[];
|
|
40
|
-
allowMultipleOpen: boolean;
|
|
41
|
-
contentExpandable: boolean;
|
|
42
|
-
onChange: (value: (string | number)[] | string | number | null, e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
43
|
-
isDSMobile: boolean;
|
|
44
|
-
}
|
|
45
|
-
export interface DSAccordionItemPropsT {
|
|
46
|
-
title?: string;
|
|
47
|
-
value: string | number;
|
|
48
|
-
iconClosed?: React.FunctionComponent<DefaultIconPropsT>;
|
|
49
|
-
iconOpened?: React.FunctionComponent<DefaultIconPropsT>;
|
|
50
|
-
children?: React.ReactNode;
|
|
51
|
-
secondaryTitle?: string;
|
|
52
|
-
customActions?: CustomActionsT[];
|
|
53
|
-
disabled?: boolean;
|
|
54
|
-
dsIndex: number;
|
|
55
|
-
renderCustomActions?: (props: {
|
|
56
|
-
allRefs: AllChildrenReferences;
|
|
57
|
-
actualActiveValue: InternalActiveValueT;
|
|
58
|
-
}) => JSX.Element;
|
|
59
|
-
}
|
|
60
|
-
export interface DSAccordionItemDefaultPropsT {
|
|
61
|
-
iconClosed: React.MemoExoticComponent<React.FunctionComponent<DefaultIconPropsT>>;
|
|
62
|
-
iconOpened: React.MemoExoticComponent<React.FunctionComponent<DefaultIconPropsT>>;
|
|
63
|
-
title: string;
|
|
64
|
-
customActions: CustomActionsT[];
|
|
65
|
-
disabled: boolean;
|
|
66
|
-
}
|
|
67
|
-
export interface DSAccordionItemPropsWithDefaultsT {
|
|
68
|
-
title: string;
|
|
69
|
-
value: string | number;
|
|
70
|
-
iconClosed: React.MemoExoticComponent<React.FunctionComponent<DefaultIconPropsT>> | React.FunctionComponent<DefaultIconPropsT>;
|
|
71
|
-
iconOpened: React.MemoExoticComponent<React.FunctionComponent<DefaultIconPropsT>> | React.FunctionComponent<DefaultIconPropsT>;
|
|
72
|
-
children?: React.ReactNode;
|
|
73
|
-
secondaryTitle?: string;
|
|
74
|
-
customActions: CustomActionsT[];
|
|
75
|
-
disabled: boolean;
|
|
76
|
-
dsIndex: number;
|
|
77
|
-
renderCustomActions?: (props: {
|
|
78
|
-
allRefs: AllChildrenReferences;
|
|
79
|
-
actualActiveValue: InternalActiveValueT;
|
|
80
|
-
}) => JSX.Element;
|
|
81
|
-
}
|
|
82
|
-
export interface DSAccordionContextT {
|
|
83
|
-
props: DSAccordionPropsWithDefaultsT;
|
|
84
|
-
actualActiveValue: InternalActiveValueT;
|
|
85
|
-
setActiveValues: (value: string | number, e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
86
|
-
focusableChildrenReferences: FocusableChildrenReferences[];
|
|
87
|
-
allChildrenReferences: AllChildrenReferences;
|
|
88
|
-
}
|
|
89
|
-
export interface DSAccordionUseAccordionContextT {
|
|
90
|
-
props: DSAccordionPropsWithDefaultsT;
|
|
91
|
-
actualActiveValue: InternalActiveValueT;
|
|
92
|
-
setActiveValues: (value: string | number, e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
93
|
-
focusableChildrenReferences: FocusableChildrenReferences[];
|
|
94
|
-
allChildrenReferences: AllChildrenReferences;
|
|
95
|
-
}
|
|
96
|
-
export interface UseAccordionPropsT {
|
|
97
|
-
value: string | number;
|
|
98
|
-
disabled: boolean;
|
|
99
|
-
}
|
|
100
|
-
export interface UseAccordionItemReturnTypeT {
|
|
101
|
-
handleOnClick: (e: React.MouseEvent) => void;
|
|
102
|
-
handleOnKeyDown: (e: React.KeyboardEvent, dsIndex: number) => void;
|
|
103
|
-
selected: boolean;
|
|
104
|
-
}
|
|
105
|
-
export interface UseAccordionRefsPropsT {
|
|
106
|
-
children: React.ReactElement<DSAccordionItemPropsT>[];
|
|
107
|
-
}
|
|
108
|
-
export interface UseAccordionRefsReturnTypeT {
|
|
109
|
-
focusableChildrenReferences: FocusableChildrenReferences[];
|
|
110
|
-
allChildrenReferences: AllChildrenReferences;
|
|
111
|
-
}
|
|
112
|
-
export interface StyledItemHeaderPropsT {
|
|
113
|
-
withCustomActions: boolean;
|
|
114
|
-
withSecondaryTitle?: string;
|
|
115
|
-
isDSMobile: boolean;
|
|
116
|
-
}
|
|
117
|
-
export interface StyledItemTitlesPropsT {
|
|
118
|
-
withSecondaryTitle?: string;
|
|
119
|
-
isDSMobile: boolean;
|
|
120
|
-
}
|
|
121
|
-
export interface StyledPrimaryTitlePropsT {
|
|
122
|
-
disabled: boolean;
|
|
123
|
-
isDSMobile: boolean;
|
|
124
|
-
}
|
|
125
|
-
export interface StyledItemContentPropsT {
|
|
126
|
-
isDSMobile: boolean;
|
|
127
|
-
}
|
|
128
|
-
export interface StyledSecondaryTitlePropsT {
|
|
129
|
-
disabled: boolean;
|
|
130
|
-
}
|
|
131
|
-
export interface StyledItemAddonPropsT {
|
|
132
|
-
disabled: boolean;
|
|
133
|
-
isDSMobile: boolean;
|
|
134
|
-
}
|
|
135
|
-
export interface StyledItemHeaderContainerPropsT {
|
|
136
|
-
disabled: boolean;
|
|
137
|
-
}
|
package/types/defaultProps.d.ts
DELETED
package/types/index.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
|
-
import type { DSAccordionItemPropsT } from '../../DSAccordionTypes';
|
|
4
|
-
declare const DSAccordionItem: {
|
|
5
|
-
(props: DSAccordionItemPropsT): JSX.Element;
|
|
6
|
-
propTypes: {
|
|
7
|
-
children: import("react-desc").PropTypesDescValue;
|
|
8
|
-
title: {
|
|
9
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
10
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
11
|
-
};
|
|
12
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
13
|
-
};
|
|
14
|
-
value: import("react-desc").PropTypesDescValue;
|
|
15
|
-
iconClosed: {
|
|
16
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
17
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
18
|
-
};
|
|
19
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
20
|
-
};
|
|
21
|
-
iconOpened: {
|
|
22
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
23
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
24
|
-
};
|
|
25
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
26
|
-
};
|
|
27
|
-
secondaryTitle: {
|
|
28
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
29
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
30
|
-
};
|
|
31
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
32
|
-
};
|
|
33
|
-
customActions: {
|
|
34
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
35
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
36
|
-
};
|
|
37
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
38
|
-
};
|
|
39
|
-
renderCustomActions: {
|
|
40
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
41
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
42
|
-
};
|
|
43
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
declare const DSAccordionItemWithSchema: {
|
|
48
|
-
(props?: unknown): JSX.Element;
|
|
49
|
-
propTypes: unknown;
|
|
50
|
-
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
51
|
-
};
|
|
52
|
-
export { DSAccordionItem, DSAccordionItemWithSchema };
|
|
53
|
-
export default DSAccordionItem;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { StyledItemAddonPropsT, StyledItemHeaderPropsT, StyledItemTitlesPropsT, StyledPrimaryTitlePropsT, StyledSecondaryTitlePropsT, StyledItemContentPropsT, StyledItemHeaderContainerPropsT } from '../../DSAccordionTypes';
|
|
2
|
-
export declare const StyledItemContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
-
export declare const StyledItemHeader: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, StyledItemHeaderPropsT, never>;
|
|
4
|
-
export declare const StyledItemContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledItemContentPropsT, never>;
|
|
5
|
-
export declare const StyledItemAddon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledItemAddonPropsT, never>;
|
|
6
|
-
export declare const StyledItemTitles: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledItemTitlesPropsT, never>;
|
|
7
|
-
export declare const StyledPrimaryTitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledPrimaryTitlePropsT, never>;
|
|
8
|
-
export declare const StyledSecondaryTitle: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, StyledSecondaryTitlePropsT, never>;
|
|
9
|
-
export declare const StyledItemCustomActions: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
10
|
-
export declare const StyledItemHeaderContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledItemHeaderContainerPropsT, never>;
|
package/types/propTypes.d.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
export declare const accordionItemPropTypes: {
|
|
3
|
-
children: import("react-desc").PropTypesDescValue;
|
|
4
|
-
title: {
|
|
5
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
6
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
7
|
-
};
|
|
8
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
9
|
-
};
|
|
10
|
-
value: import("react-desc").PropTypesDescValue;
|
|
11
|
-
iconClosed: {
|
|
12
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
13
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
14
|
-
};
|
|
15
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
16
|
-
};
|
|
17
|
-
iconOpened: {
|
|
18
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
19
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
20
|
-
};
|
|
21
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
22
|
-
};
|
|
23
|
-
secondaryTitle: {
|
|
24
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
25
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
26
|
-
};
|
|
27
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
28
|
-
};
|
|
29
|
-
customActions: {
|
|
30
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
31
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
32
|
-
};
|
|
33
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
34
|
-
};
|
|
35
|
-
renderCustomActions: {
|
|
36
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
37
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
38
|
-
};
|
|
39
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export declare const accordionPropTypes: {
|
|
43
|
-
containerProps: {
|
|
44
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
45
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
46
|
-
};
|
|
47
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
48
|
-
};
|
|
49
|
-
activeValue: {
|
|
50
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
51
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
52
|
-
};
|
|
53
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
54
|
-
};
|
|
55
|
-
children: {
|
|
56
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
57
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
58
|
-
};
|
|
59
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
60
|
-
};
|
|
61
|
-
allowMultipleOpen: {
|
|
62
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
63
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
64
|
-
};
|
|
65
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
66
|
-
};
|
|
67
|
-
onChange: {
|
|
68
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
69
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
70
|
-
};
|
|
71
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|