carbon-react 106.6.6 → 106.6.9
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/esm/__internal__/utils/argTypes/specialCharacters.d.ts +36 -0
- package/esm/__internal__/utils/argTypes/specialCharacters.js +36 -0
- package/esm/components/accordion/accordion-group/accordion-group.component.d.ts +9 -23
- package/esm/components/accordion/accordion-group/accordion-group.component.js +222 -25
- package/esm/components/accordion/accordion.component.d.ts +44 -2
- package/esm/components/accordion/accordion.component.js +648 -68
- package/esm/components/accordion/accordion.style.d.ts +45 -9
- package/esm/components/accordion/index.d.ts +4 -2
- package/esm/components/decimal/decimal.component.js +12 -10
- package/esm/components/menu/menu-item/menu-item.style.js +6 -3
- package/esm/components/multi-action-button/index.d.ts +2 -1
- package/esm/components/multi-action-button/multi-action-button.component.d.ts +9 -52
- package/esm/components/multi-action-button/multi-action-button.component.js +471 -67
- package/esm/components/multi-action-button/multi-action-button.config.d.ts +3 -3
- package/esm/components/multi-action-button/multi-action-button.style.d.ts +10 -2
- package/esm/components/multi-action-button/multi-action-button.style.js +4 -7
- package/esm/components/portal/portal.js +0 -5
- package/esm/components/portrait/portrait-initials.component.js +1 -2
- package/esm/components/tile-select/__internal__/accordion/accordion.style.d.ts +2 -2
- package/esm/components/tooltip/tooltip.component.d.ts +3 -0
- package/esm/style/utils/filter-out-styled-system-spacing-props.d.ts +1 -1
- package/esm/style/utils/filter-out-styled-system-spacing-props.js +1 -1
- package/lib/__internal__/utils/argTypes/specialCharacters.d.ts +36 -0
- package/lib/__internal__/utils/argTypes/specialCharacters.js +46 -0
- package/lib/components/accordion/accordion-group/accordion-group.component.d.ts +9 -23
- package/lib/components/accordion/accordion-group/accordion-group.component.js +225 -29
- package/lib/components/accordion/accordion.component.d.ts +44 -2
- package/lib/components/accordion/accordion.component.js +649 -70
- package/lib/components/accordion/accordion.style.d.ts +45 -9
- package/lib/components/accordion/index.d.ts +4 -2
- package/lib/components/decimal/decimal.component.js +12 -10
- package/lib/components/menu/menu-item/menu-item.style.js +6 -3
- package/lib/components/multi-action-button/index.d.ts +2 -1
- package/lib/components/multi-action-button/multi-action-button.component.d.ts +9 -52
- package/lib/components/multi-action-button/multi-action-button.component.js +471 -70
- package/lib/components/multi-action-button/multi-action-button.config.d.ts +3 -3
- package/lib/components/multi-action-button/multi-action-button.style.d.ts +10 -2
- package/lib/components/multi-action-button/multi-action-button.style.js +4 -7
- package/lib/components/portal/portal.js +0 -6
- package/lib/components/portrait/portrait-initials.component.js +1 -5
- package/lib/components/tile-select/__internal__/accordion/accordion.style.d.ts +2 -2
- package/lib/components/tooltip/tooltip.component.d.ts +3 -0
- package/lib/style/utils/filter-out-styled-system-spacing-props.d.ts +1 -1
- package/lib/style/utils/filter-out-styled-system-spacing-props.js +1 -1
- package/package.json +2 -1
- package/esm/__internal__/utils/helpers/browser/index.d.ts +0 -15
- package/esm/__internal__/utils/helpers/browser/index.js +0 -33
- package/esm/components/accordion/accordion-group/accordion-group.d.ts +0 -17
- package/esm/components/accordion/accordion.d.ts +0 -54
- package/esm/components/action-popover/action-popover-test.stories.js +0 -76
- package/esm/components/button-bar/button-bar-test.stories.js +0 -122
- package/esm/components/draggable/draggable-test.stories.js +0 -48
- package/esm/components/duelling-picklist/duelling-picklist-test.stories.js +0 -539
- package/esm/components/menu/menu-test.stories.js +0 -109
- package/esm/components/multi-action-button/multi-action-button.d.ts +0 -10
- package/esm/components/profile/profile-test.stories.js +0 -55
- package/esm/components/progress-tracker/progress-tracker-test.stories.js +0 -63
- package/esm/components/select/simple-select/simple-select-test.stories.js +0 -193
- package/esm/components/show-edit-pod/show-edit-pod-test.stories.js +0 -143
- package/esm/components/textarea/textarea-test.stories.js +0 -154
- package/lib/__internal__/utils/helpers/browser/index.d.ts +0 -15
- package/lib/__internal__/utils/helpers/browser/index.js +0 -40
- package/lib/__internal__/utils/helpers/browser/package.json +0 -6
- package/lib/components/accordion/accordion-group/accordion-group.d.ts +0 -17
- package/lib/components/accordion/accordion.d.ts +0 -54
- package/lib/components/action-popover/action-popover-test.stories.js +0 -95
- package/lib/components/button-bar/button-bar-test.stories.js +0 -145
- package/lib/components/draggable/draggable-test.stories.js +0 -66
- package/lib/components/duelling-picklist/duelling-picklist-test.stories.js +0 -573
- package/lib/components/menu/menu-test.stories.js +0 -132
- package/lib/components/multi-action-button/multi-action-button.d.ts +0 -10
- package/lib/components/profile/profile-test.stories.js +0 -75
- package/lib/components/progress-tracker/progress-tracker-test.stories.js +0 -79
- package/lib/components/select/simple-select/simple-select-test.stories.js +0 -206
- package/lib/components/show-edit-pod/show-edit-pod-test.stories.js +0 -165
- package/lib/components/textarea/textarea-test.stories.js +0 -173
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const singleSpecialCharacters: {
|
|
2
|
+
options: string[];
|
|
3
|
+
mapping: {
|
|
4
|
+
minus: string;
|
|
5
|
+
questionMark: string;
|
|
6
|
+
hash: string;
|
|
7
|
+
at: string;
|
|
8
|
+
dollar: string;
|
|
9
|
+
percent: string;
|
|
10
|
+
caret: string;
|
|
11
|
+
exclamation: string;
|
|
12
|
+
asterisk: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare const email: {
|
|
16
|
+
options: string[];
|
|
17
|
+
mapping: {
|
|
18
|
+
email: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const number: {
|
|
22
|
+
options: string[];
|
|
23
|
+
mapping: {
|
|
24
|
+
floatNumberCommaString: string;
|
|
25
|
+
floatMinusNumberCommaString: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
declare const _default: {
|
|
29
|
+
options: string[];
|
|
30
|
+
mapping: {
|
|
31
|
+
undefined: undefined;
|
|
32
|
+
otherLanguage: string;
|
|
33
|
+
specialCharacters: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const singleSpecialCharacters = {
|
|
2
|
+
options: ["minus", "questionMark", "hash", "at", "dollar", "percent", "caret", "exclamation", "asterisk"],
|
|
3
|
+
mapping: {
|
|
4
|
+
minus: "-",
|
|
5
|
+
questionMark: "?",
|
|
6
|
+
hash: "#",
|
|
7
|
+
at: "@",
|
|
8
|
+
dollar: "$",
|
|
9
|
+
percent: "%",
|
|
10
|
+
caret: "^",
|
|
11
|
+
exclamation: "!",
|
|
12
|
+
asterisk: "*"
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export const email = {
|
|
16
|
+
options: ["email"],
|
|
17
|
+
mapping: {
|
|
18
|
+
email: "test.frontend.squad@gmail.com"
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export const number = {
|
|
22
|
+
options: ["floatNumberCommaString", "floatMinusNumberCommaString"],
|
|
23
|
+
mapping: {
|
|
24
|
+
floatNumberCommaString: "0,112",
|
|
25
|
+
floatMinusNumberCommaString: "-0,112"
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export default {
|
|
29
|
+
options: ["undefined", "otherLanguage", "specialCharacters"],
|
|
30
|
+
mapping: {
|
|
31
|
+
// eslint-disable-next-line object-shorthand
|
|
32
|
+
undefined: undefined,
|
|
33
|
+
otherLanguage: "mp150ú¿¡üßä",
|
|
34
|
+
specialCharacters: "!@#$%^*()_+-=~[];:.,?{}&\"'<>"
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -1,24 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
children: (props: any, propName: any, componentName: any) => undefined;
|
|
9
|
-
marginBottom?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
10
|
-
margin?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
11
|
-
m?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
12
|
-
marginLeft?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
13
|
-
ml?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
14
|
-
marginRight?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
15
|
-
mr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
16
|
-
marginTop?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
17
|
-
mt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
18
|
-
mb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
19
|
-
marginX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
20
|
-
mx?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
21
|
-
marginY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
22
|
-
my?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
23
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MarginProps } from "styled-system";
|
|
3
|
+
declare type AccordionGroupChild = React.ReactElement | boolean | null | undefined | AccordionGroupChildArray;
|
|
4
|
+
interface AccordionGroupChildArray extends Array<AccordionGroupChild> {
|
|
5
|
+
}
|
|
6
|
+
export interface AccordionGroupProps extends MarginProps {
|
|
7
|
+
children?: AccordionGroupChild;
|
|
24
8
|
}
|
|
9
|
+
export declare const AccordionGroup: ({ children, ...rest }: AccordionGroupProps) => JSX.Element;
|
|
10
|
+
export default AccordionGroup;
|
|
@@ -1,26 +1,43 @@
|
|
|
1
1
|
import React, { useMemo, useCallback } from "react";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import invariant from "invariant";
|
|
4
4
|
import Events from "../../../__internal__/utils/helpers/events";
|
|
5
|
-
import Accordion from "../accordion.component
|
|
6
|
-
import { StyledAccordionGroup } from "../accordion.style
|
|
7
|
-
const marginProptypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
|
|
5
|
+
import Accordion from "../accordion.component";
|
|
6
|
+
import { StyledAccordionGroup } from "../accordion.style";
|
|
8
7
|
|
|
9
8
|
const AccordionGroup = ({
|
|
10
9
|
children,
|
|
11
10
|
...rest
|
|
12
11
|
}) => {
|
|
13
|
-
const
|
|
12
|
+
const hasProperChildren = useMemo(() => {
|
|
13
|
+
let hasAccordionChildren = true;
|
|
14
|
+
React.Children.toArray(children).forEach(child => {
|
|
15
|
+
if (typeof child === "string" || /*#__PURE__*/React.isValidElement(child) && child.type.displayName !== "Accordion") {
|
|
16
|
+
hasAccordionChildren = false;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return hasAccordionChildren;
|
|
20
|
+
}, [children]);
|
|
21
|
+
invariant(hasProperChildren, `AccordionGroup accepts only children of type \`${Accordion.displayName}\`.`);
|
|
22
|
+
const filteredChildren = useMemo(() => React.Children.toArray(children).filter(child => {
|
|
23
|
+
return /*#__PURE__*/React.isValidElement(child);
|
|
24
|
+
}), [children]);
|
|
14
25
|
const refs = useMemo(() => filteredChildren.map(child => child.ref || /*#__PURE__*/React.createRef()), [filteredChildren]);
|
|
15
26
|
const focusAccordion = useCallback((ev, index) => {
|
|
16
27
|
ev.preventDefault();
|
|
17
28
|
|
|
18
29
|
if (index === -1) {
|
|
19
|
-
|
|
30
|
+
var _refs$current;
|
|
31
|
+
|
|
32
|
+
(_refs$current = refs[refs.length - 1].current) === null || _refs$current === void 0 ? void 0 : _refs$current.focus();
|
|
20
33
|
} else if (index === refs.length) {
|
|
21
|
-
|
|
34
|
+
var _refs$0$current;
|
|
35
|
+
|
|
36
|
+
(_refs$0$current = refs[0].current) === null || _refs$0$current === void 0 ? void 0 : _refs$0$current.focus();
|
|
22
37
|
} else {
|
|
23
|
-
|
|
38
|
+
var _refs$index$current;
|
|
39
|
+
|
|
40
|
+
(_refs$index$current = refs[index].current) === null || _refs$index$current === void 0 ? void 0 : _refs$index$current.focus();
|
|
24
41
|
}
|
|
25
42
|
}, [refs]);
|
|
26
43
|
const handleKeyboardAccessibility = useCallback((ev, index) => {
|
|
@@ -40,27 +57,207 @@ const AccordionGroup = ({
|
|
|
40
57
|
focusAccordion(ev, refs.length - 1);
|
|
41
58
|
}
|
|
42
59
|
}, [focusAccordion, refs]);
|
|
43
|
-
return /*#__PURE__*/React.createElement(StyledAccordionGroup, rest, filteredChildren.map((child, index) =>
|
|
60
|
+
return /*#__PURE__*/React.createElement(StyledAccordionGroup, rest, filteredChildren.map((child, index) =>
|
|
61
|
+
/*#__PURE__*/
|
|
62
|
+
// casted to ReactElement as there is no overload for an FunctionComponentElement in cloneElement
|
|
63
|
+
React.cloneElement(child, {
|
|
44
64
|
ref: refs[index],
|
|
45
65
|
index,
|
|
46
66
|
handleKeyboardAccessibility
|
|
47
67
|
})));
|
|
48
68
|
};
|
|
49
69
|
|
|
50
|
-
AccordionGroup.propTypes = {
|
|
51
|
-
children: (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
AccordionGroup.propTypes = {
|
|
71
|
+
"children": PropTypes.oneOfType([PropTypes.element, PropTypes.shape({
|
|
72
|
+
"__@iterator": PropTypes.func.isRequired,
|
|
73
|
+
"__@unscopables": PropTypes.func.isRequired,
|
|
74
|
+
"concat": PropTypes.func.isRequired,
|
|
75
|
+
"copyWithin": PropTypes.func.isRequired,
|
|
76
|
+
"entries": PropTypes.func.isRequired,
|
|
77
|
+
"every": PropTypes.func.isRequired,
|
|
78
|
+
"fill": PropTypes.func.isRequired,
|
|
79
|
+
"filter": PropTypes.func.isRequired,
|
|
80
|
+
"find": PropTypes.func.isRequired,
|
|
81
|
+
"findIndex": PropTypes.func.isRequired,
|
|
82
|
+
"flat": PropTypes.func.isRequired,
|
|
83
|
+
"flatMap": PropTypes.func.isRequired,
|
|
84
|
+
"forEach": PropTypes.func.isRequired,
|
|
85
|
+
"includes": PropTypes.func.isRequired,
|
|
86
|
+
"indexOf": PropTypes.func.isRequired,
|
|
87
|
+
"join": PropTypes.func.isRequired,
|
|
88
|
+
"keys": PropTypes.func.isRequired,
|
|
89
|
+
"lastIndexOf": PropTypes.func.isRequired,
|
|
90
|
+
"length": PropTypes.number.isRequired,
|
|
91
|
+
"map": PropTypes.func.isRequired,
|
|
92
|
+
"pop": PropTypes.func.isRequired,
|
|
93
|
+
"push": PropTypes.func.isRequired,
|
|
94
|
+
"reduce": PropTypes.func.isRequired,
|
|
95
|
+
"reduceRight": PropTypes.func.isRequired,
|
|
96
|
+
"reverse": PropTypes.func.isRequired,
|
|
97
|
+
"shift": PropTypes.func.isRequired,
|
|
98
|
+
"slice": PropTypes.func.isRequired,
|
|
99
|
+
"some": PropTypes.func.isRequired,
|
|
100
|
+
"sort": PropTypes.func.isRequired,
|
|
101
|
+
"splice": PropTypes.func.isRequired,
|
|
102
|
+
"toLocaleString": PropTypes.func.isRequired,
|
|
103
|
+
"toString": PropTypes.func.isRequired,
|
|
104
|
+
"unshift": PropTypes.func.isRequired,
|
|
105
|
+
"values": PropTypes.func.isRequired
|
|
106
|
+
}), PropTypes.bool]),
|
|
107
|
+
"m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
108
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
109
|
+
"description": PropTypes.string,
|
|
110
|
+
"toString": PropTypes.func.isRequired,
|
|
111
|
+
"valueOf": PropTypes.func.isRequired
|
|
112
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
113
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
114
|
+
"description": PropTypes.string,
|
|
115
|
+
"toString": PropTypes.func.isRequired,
|
|
116
|
+
"valueOf": PropTypes.func.isRequired
|
|
117
|
+
}), PropTypes.string]),
|
|
118
|
+
"margin": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
119
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
120
|
+
"description": PropTypes.string,
|
|
121
|
+
"toString": PropTypes.func.isRequired,
|
|
122
|
+
"valueOf": PropTypes.func.isRequired
|
|
123
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
124
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
125
|
+
"description": PropTypes.string,
|
|
126
|
+
"toString": PropTypes.func.isRequired,
|
|
127
|
+
"valueOf": PropTypes.func.isRequired
|
|
128
|
+
}), PropTypes.string]),
|
|
129
|
+
"marginBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
130
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
131
|
+
"description": PropTypes.string,
|
|
132
|
+
"toString": PropTypes.func.isRequired,
|
|
133
|
+
"valueOf": PropTypes.func.isRequired
|
|
134
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
135
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
136
|
+
"description": PropTypes.string,
|
|
137
|
+
"toString": PropTypes.func.isRequired,
|
|
138
|
+
"valueOf": PropTypes.func.isRequired
|
|
139
|
+
}), PropTypes.string]),
|
|
140
|
+
"marginLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
141
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
142
|
+
"description": PropTypes.string,
|
|
143
|
+
"toString": PropTypes.func.isRequired,
|
|
144
|
+
"valueOf": PropTypes.func.isRequired
|
|
145
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
146
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
147
|
+
"description": PropTypes.string,
|
|
148
|
+
"toString": PropTypes.func.isRequired,
|
|
149
|
+
"valueOf": PropTypes.func.isRequired
|
|
150
|
+
}), PropTypes.string]),
|
|
151
|
+
"marginRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
152
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
153
|
+
"description": PropTypes.string,
|
|
154
|
+
"toString": PropTypes.func.isRequired,
|
|
155
|
+
"valueOf": PropTypes.func.isRequired
|
|
156
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
157
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
158
|
+
"description": PropTypes.string,
|
|
159
|
+
"toString": PropTypes.func.isRequired,
|
|
160
|
+
"valueOf": PropTypes.func.isRequired
|
|
161
|
+
}), PropTypes.string]),
|
|
162
|
+
"marginTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
163
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
164
|
+
"description": PropTypes.string,
|
|
165
|
+
"toString": PropTypes.func.isRequired,
|
|
166
|
+
"valueOf": PropTypes.func.isRequired
|
|
167
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
168
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
169
|
+
"description": PropTypes.string,
|
|
170
|
+
"toString": PropTypes.func.isRequired,
|
|
171
|
+
"valueOf": PropTypes.func.isRequired
|
|
172
|
+
}), PropTypes.string]),
|
|
173
|
+
"marginX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
174
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
175
|
+
"description": PropTypes.string,
|
|
176
|
+
"toString": PropTypes.func.isRequired,
|
|
177
|
+
"valueOf": PropTypes.func.isRequired
|
|
178
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
179
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
180
|
+
"description": PropTypes.string,
|
|
181
|
+
"toString": PropTypes.func.isRequired,
|
|
182
|
+
"valueOf": PropTypes.func.isRequired
|
|
183
|
+
}), PropTypes.string]),
|
|
184
|
+
"marginY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
185
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
186
|
+
"description": PropTypes.string,
|
|
187
|
+
"toString": PropTypes.func.isRequired,
|
|
188
|
+
"valueOf": PropTypes.func.isRequired
|
|
189
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
190
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
191
|
+
"description": PropTypes.string,
|
|
192
|
+
"toString": PropTypes.func.isRequired,
|
|
193
|
+
"valueOf": PropTypes.func.isRequired
|
|
194
|
+
}), PropTypes.string]),
|
|
195
|
+
"mb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
196
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
197
|
+
"description": PropTypes.string,
|
|
198
|
+
"toString": PropTypes.func.isRequired,
|
|
199
|
+
"valueOf": PropTypes.func.isRequired
|
|
200
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
201
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
202
|
+
"description": PropTypes.string,
|
|
203
|
+
"toString": PropTypes.func.isRequired,
|
|
204
|
+
"valueOf": PropTypes.func.isRequired
|
|
205
|
+
}), PropTypes.string]),
|
|
206
|
+
"ml": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
207
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
208
|
+
"description": PropTypes.string,
|
|
209
|
+
"toString": PropTypes.func.isRequired,
|
|
210
|
+
"valueOf": PropTypes.func.isRequired
|
|
211
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
212
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
213
|
+
"description": PropTypes.string,
|
|
214
|
+
"toString": PropTypes.func.isRequired,
|
|
215
|
+
"valueOf": PropTypes.func.isRequired
|
|
216
|
+
}), PropTypes.string]),
|
|
217
|
+
"mr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
218
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
219
|
+
"description": PropTypes.string,
|
|
220
|
+
"toString": PropTypes.func.isRequired,
|
|
221
|
+
"valueOf": PropTypes.func.isRequired
|
|
222
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
223
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
224
|
+
"description": PropTypes.string,
|
|
225
|
+
"toString": PropTypes.func.isRequired,
|
|
226
|
+
"valueOf": PropTypes.func.isRequired
|
|
227
|
+
}), PropTypes.string]),
|
|
228
|
+
"mt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
229
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
230
|
+
"description": PropTypes.string,
|
|
231
|
+
"toString": PropTypes.func.isRequired,
|
|
232
|
+
"valueOf": PropTypes.func.isRequired
|
|
233
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
234
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
235
|
+
"description": PropTypes.string,
|
|
236
|
+
"toString": PropTypes.func.isRequired,
|
|
237
|
+
"valueOf": PropTypes.func.isRequired
|
|
238
|
+
}), PropTypes.string]),
|
|
239
|
+
"mx": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
240
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
241
|
+
"description": PropTypes.string,
|
|
242
|
+
"toString": PropTypes.func.isRequired,
|
|
243
|
+
"valueOf": PropTypes.func.isRequired
|
|
244
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
245
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
246
|
+
"description": PropTypes.string,
|
|
247
|
+
"toString": PropTypes.func.isRequired,
|
|
248
|
+
"valueOf": PropTypes.func.isRequired
|
|
249
|
+
}), PropTypes.string]),
|
|
250
|
+
"my": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
251
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
252
|
+
"description": PropTypes.string,
|
|
253
|
+
"toString": PropTypes.func.isRequired,
|
|
254
|
+
"valueOf": PropTypes.func.isRequired
|
|
255
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
256
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
257
|
+
"description": PropTypes.string,
|
|
258
|
+
"toString": PropTypes.func.isRequired,
|
|
259
|
+
"valueOf": PropTypes.func.isRequired
|
|
260
|
+
}), PropTypes.string])
|
|
65
261
|
};
|
|
262
|
+
export { AccordionGroup };
|
|
66
263
|
export default AccordionGroup;
|
|
@@ -1,3 +1,45 @@
|
|
|
1
|
-
export default Accordion;
|
|
2
|
-
declare const Accordion: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
3
1
|
import React from "react";
|
|
2
|
+
import { SpaceProps } from "styled-system";
|
|
3
|
+
import { StyledAccordionContainerProps } from "./accordion.style";
|
|
4
|
+
export interface AccordionProps extends StyledAccordionContainerProps, SpaceProps {
|
|
5
|
+
/** Width of the buttonHeading when it's set, defaults to 150px */
|
|
6
|
+
buttonWidth?: number;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/** Set the default state of expansion of the Accordion if component is meant to be used as uncontrolled */
|
|
9
|
+
defaultExpanded?: boolean;
|
|
10
|
+
/** Disable padding for the content */
|
|
11
|
+
disableContentPadding?: boolean;
|
|
12
|
+
/** Sets the expansion state of the Accordion if component is meant to be used as controlled */
|
|
13
|
+
expanded?: boolean;
|
|
14
|
+
/** An error message to be displayed in the tooltip */
|
|
15
|
+
error?: string;
|
|
16
|
+
/** Styled system spacing props provided to Accordion Title */
|
|
17
|
+
headerSpacing?: SpaceProps;
|
|
18
|
+
id?: string;
|
|
19
|
+
/** Sets icon type - accepted values: 'chevron_down' (default), 'dropdown' */
|
|
20
|
+
iconType?: "chevron_down" | "dropdown";
|
|
21
|
+
/** Sets icon alignment - accepted values: 'left', 'right' (default) */
|
|
22
|
+
iconAlign?: "left" | "right";
|
|
23
|
+
/** Sets accordion title */
|
|
24
|
+
title: React.ReactNode;
|
|
25
|
+
/** An info message to be displayed in the tooltip */
|
|
26
|
+
info?: string;
|
|
27
|
+
/** Callback fired when expansion state changes */
|
|
28
|
+
onChange?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>, isExpanded: boolean) => void;
|
|
29
|
+
/** When the Accordion is open the title can change to this */
|
|
30
|
+
openTitle?: string;
|
|
31
|
+
/** Sets accordion size */
|
|
32
|
+
size?: "large" | "small";
|
|
33
|
+
/** Sets accordion sub title */
|
|
34
|
+
subTitle?: string;
|
|
35
|
+
/** A warning message to be displayed in the tooltip */
|
|
36
|
+
warning?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface AccordionInternalProps {
|
|
39
|
+
/** @ignore @private */
|
|
40
|
+
handleKeyboardAccessibility?: (ev: React.KeyboardEvent<HTMLElement>, index?: number) => void;
|
|
41
|
+
/** @ignore @private */
|
|
42
|
+
index?: number;
|
|
43
|
+
}
|
|
44
|
+
export declare const Accordion: React.ForwardRefExoticComponent<AccordionProps & AccordionInternalProps & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
export default Accordion;
|