@zendeskgarden/react-accordions 9.0.0-next.9 → 9.0.0
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/esm/elements/accordion/Accordion.js +2 -1
- package/dist/esm/elements/accordion/components/Header.js +2 -2
- package/dist/esm/elements/accordion/components/Label.js +4 -4
- package/dist/esm/elements/accordion/components/Panel.js +5 -5
- package/dist/esm/elements/stepper/Stepper.js +1 -1
- package/dist/esm/elements/stepper/components/Content.js +1 -1
- package/dist/esm/elements/stepper/components/Label.js +6 -6
- package/dist/esm/elements/stepper/components/Step.js +2 -2
- package/dist/esm/elements/timeline/components/Item.js +2 -2
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/circle-full-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/check-sm-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-down-stroke.svg.js +1 -1
- package/dist/esm/styled/accordion/StyledAccordion.js +2 -5
- package/dist/esm/styled/accordion/StyledButton.js +15 -12
- package/dist/esm/styled/accordion/StyledHeader.js +3 -6
- package/dist/esm/styled/accordion/StyledInnerPanel.js +3 -6
- package/dist/esm/styled/accordion/StyledPanel.js +17 -14
- package/dist/esm/styled/accordion/StyledRotateIcon.js +14 -11
- package/dist/esm/styled/accordion/StyledSection.js +2 -5
- package/dist/esm/styled/stepper/StyledContent.js +4 -7
- package/dist/esm/styled/stepper/StyledIcon.js +29 -11
- package/dist/esm/styled/stepper/StyledInnerContent.js +11 -6
- package/dist/esm/styled/stepper/StyledLabel.js +12 -6
- package/dist/esm/styled/stepper/StyledLabelText.js +2 -6
- package/dist/esm/styled/stepper/StyledLine.js +11 -6
- package/dist/esm/styled/stepper/StyledStep.js +11 -6
- package/dist/esm/styled/stepper/StyledStepper.js +3 -6
- package/dist/esm/styled/timeline/StyledContent.js +2 -5
- package/dist/esm/styled/timeline/StyledItem.js +11 -6
- package/dist/esm/styled/timeline/StyledItemIcon.js +27 -7
- package/dist/esm/styled/timeline/StyledOppositeContent.js +2 -5
- package/dist/esm/styled/timeline/StyledSeparator.js +11 -6
- package/dist/esm/styled/timeline/StyledTimeline.js +2 -5
- package/dist/index.cjs.js +203 -154
- package/dist/typings/elements/accordion/Accordion.d.ts +3 -1
- package/dist/typings/elements/stepper/Stepper.d.ts +3 -1
- package/dist/typings/elements/timeline/Timeline.d.ts +3 -1
- package/dist/typings/styled/accordion/StyledButton.d.ts +4 -4
- package/dist/typings/styled/accordion/StyledHeader.d.ts +2 -2
- package/dist/typings/styled/accordion/StyledInnerPanel.d.ts +1 -1
- package/dist/typings/styled/accordion/StyledPanel.d.ts +4 -4
- package/dist/typings/styled/accordion/StyledRotateIcon.d.ts +0 -1
- package/dist/typings/styled/stepper/StyledContent.d.ts +1 -1
- package/dist/typings/styled/stepper/StyledIcon.d.ts +2 -2
- package/dist/typings/styled/stepper/StyledLabel.d.ts +2 -2
- package/dist/typings/styled/stepper/StyledLabelText.d.ts +2 -2
- package/dist/typings/styled/stepper/StyledStep.d.ts +1 -1
- package/dist/typings/styled/stepper/StyledStepper.d.ts +1 -1
- package/dist/typings/styled/timeline/StyledItem.d.ts +2 -3
- package/dist/typings/styled/timeline/StyledItemIcon.d.ts +2 -2
- package/dist/typings/types/index.d.ts +6 -1
- package/dist/typings/utils/useAccordionContext.d.ts +0 -1
- package/dist/typings/utils/useHeaderContext.d.ts +0 -1
- package/dist/typings/utils/useSectionContext.d.ts +0 -1
- package/dist/typings/utils/useStepContext.d.ts +0 -1
- package/dist/typings/utils/useStepperContext.d.ts +0 -1
- package/dist/typings/utils/useTimelineContext.d.ts +0 -1
- package/package.json +7 -8
- package/LICENSE.md +0 -176
|
@@ -56,7 +56,8 @@ const AccordionComponent = forwardRef((_ref, ref) => {
|
|
|
56
56
|
const {
|
|
57
57
|
sections,
|
|
58
58
|
sectionChildren
|
|
59
|
-
} = useMemo(() => Children.toArray(children).filter(isValidElement).map((child, index) =>
|
|
59
|
+
} = useMemo(() => Children.toArray(children).filter(isValidElement).map((child, index) =>
|
|
60
|
+
React__default.createElement(SectionContext.Provider, {
|
|
60
61
|
key: index,
|
|
61
62
|
value: index
|
|
62
63
|
}, child)).reduce((acc, child, index) => {
|
|
@@ -71,8 +71,8 @@ const HeaderComponent = forwardRef((props, ref) => {
|
|
|
71
71
|
return React__default.createElement(HeaderContext.Provider, {
|
|
72
72
|
value: value
|
|
73
73
|
}, React__default.createElement(StyledHeader, Object.assign({
|
|
74
|
-
isCollapsible: isCollapsible,
|
|
75
|
-
isExpanded: isExpanded
|
|
74
|
+
$isCollapsible: isCollapsible,
|
|
75
|
+
$isExpanded: isExpanded
|
|
76
76
|
}, getHeaderProps({
|
|
77
77
|
ref,
|
|
78
78
|
'aria-level': ariaLevel,
|
|
@@ -48,10 +48,10 @@ const LabelComponent = forwardRef((props, ref) => {
|
|
|
48
48
|
} = useHeaderContext();
|
|
49
49
|
return React__default.createElement(StyledButton, Object.assign({
|
|
50
50
|
ref: ref,
|
|
51
|
-
isCompact: isCompact,
|
|
52
|
-
isHovered: isHovered,
|
|
53
|
-
isExpanded: isExpanded,
|
|
54
|
-
isCollapsible: isCollapsible
|
|
51
|
+
$isCompact: isCompact,
|
|
52
|
+
$isHovered: isHovered,
|
|
53
|
+
$isExpanded: isExpanded,
|
|
54
|
+
$isCollapsible: isCollapsible
|
|
55
55
|
}, otherTriggerProps, props));
|
|
56
56
|
});
|
|
57
57
|
LabelComponent.displayName = 'Accordion.Label';
|
|
@@ -51,17 +51,17 @@ const PanelComponent = forwardRef((_ref, ref) => {
|
|
|
51
51
|
const isExpanded = expandedSections.includes(sectionValue);
|
|
52
52
|
return React__default.createElement(StyledPanel, Object.assign({
|
|
53
53
|
inert: isExpanded ? undefined : '',
|
|
54
|
-
isAnimated: isAnimated,
|
|
55
|
-
isBare: isBare,
|
|
56
|
-
isCompact: isCompact,
|
|
57
|
-
isExpanded: isExpanded
|
|
54
|
+
$isAnimated: isAnimated,
|
|
55
|
+
$isBare: isBare,
|
|
56
|
+
$isCompact: isCompact,
|
|
57
|
+
$isExpanded: isExpanded
|
|
58
58
|
}, getPanelProps({
|
|
59
59
|
role: role === undefined ? null : 'region',
|
|
60
60
|
ref,
|
|
61
61
|
value: sectionValue,
|
|
62
62
|
...props
|
|
63
63
|
})), React__default.createElement(StyledInnerPanel, {
|
|
64
|
-
isAnimated: isAnimated
|
|
64
|
+
$isAnimated: isAnimated
|
|
65
65
|
}, children));
|
|
66
66
|
});
|
|
67
67
|
PanelComponent.displayName = 'Accordion.Panel';
|
|
@@ -53,7 +53,7 @@ const StepperComponent = forwardRef((_ref, ref) => {
|
|
|
53
53
|
value: stepperContext
|
|
54
54
|
}, React__default.createElement(StyledStepper, Object.assign({
|
|
55
55
|
ref: ref,
|
|
56
|
-
isHorizontal: isHorizontal
|
|
56
|
+
$isHorizontal: isHorizontal
|
|
57
57
|
}, props), useMemo(() => Children.toArray(children).filter(isValidElement).map((child, index) => React__default.createElement(StepContext.Provider, {
|
|
58
58
|
key: index
|
|
59
59
|
,
|
|
@@ -41,7 +41,7 @@ const ContentComponent = forwardRef((props, ref) => {
|
|
|
41
41
|
} = useStepContext();
|
|
42
42
|
return isHorizontal === false ? React__default.createElement(StyledContent, Object.assign({
|
|
43
43
|
ref: ref,
|
|
44
|
-
isActive: isActive
|
|
44
|
+
$isActive: isActive
|
|
45
45
|
}, props), React__default.createElement(StyledInnerContent, {
|
|
46
46
|
"aria-hidden": !isActive
|
|
47
47
|
}, props.children)) : null;
|
|
@@ -53,16 +53,16 @@ const LabelComponent = forwardRef((_ref, ref) => {
|
|
|
53
53
|
const numericStep = currentStepIndex + 1;
|
|
54
54
|
const stepIcon = icon || numericStep;
|
|
55
55
|
const styledIcon = React__default.createElement(StyledIcon, {
|
|
56
|
-
isActive: isActive,
|
|
57
|
-
isHorizontal: isHorizontal
|
|
56
|
+
$isActive: isActive,
|
|
57
|
+
$isHorizontal: isHorizontal
|
|
58
58
|
}, isCompleted ? React__default.createElement(SvgCheckSmStroke, iconProps) : stepIcon);
|
|
59
59
|
return React__default.createElement(StyledLabel, Object.assign({
|
|
60
60
|
ref: ref,
|
|
61
|
-
isActive: isActive,
|
|
62
|
-
isHorizontal: isHorizontal
|
|
61
|
+
$isActive: isActive,
|
|
62
|
+
$isHorizontal: isHorizontal
|
|
63
63
|
}, other), isHorizontal ? React__default.createElement(StyledIconFlexContainer, null, styledIcon) : styledIcon, React__default.createElement(StyledLabelText, {
|
|
64
|
-
isHidden: isHidden,
|
|
65
|
-
isHorizontal: isHorizontal
|
|
64
|
+
$isHidden: isHidden,
|
|
65
|
+
$isHorizontal: isHorizontal
|
|
66
66
|
}, children));
|
|
67
67
|
});
|
|
68
68
|
LabelComponent.displayName = 'Stepper.Label';
|
|
@@ -44,8 +44,8 @@ const StepComponent = forwardRef((_ref, ref) => {
|
|
|
44
44
|
} = useStepperContext();
|
|
45
45
|
return React__default.createElement(StyledStep, Object.assign({
|
|
46
46
|
ref: ref,
|
|
47
|
-
isHorizontal: isHorizontal
|
|
48
|
-
}, props), isHorizontal && React__default.createElement(StyledLine, null), children);
|
|
47
|
+
$isHorizontal: isHorizontal
|
|
48
|
+
}, props), !!isHorizontal && React__default.createElement(StyledLine, null), children);
|
|
49
49
|
});
|
|
50
50
|
StepComponent.displayName = 'Stepper.Step';
|
|
51
51
|
const Step = StepComponent;
|
|
@@ -60,8 +60,8 @@ const ItemComponent = forwardRef((_ref, ref) => {
|
|
|
60
60
|
value: value
|
|
61
61
|
}, React__default.createElement(StyledTimelineItem, Object.assign({
|
|
62
62
|
ref: ref,
|
|
63
|
-
isAlternate: isAlternate,
|
|
64
|
-
hasOppositeContent: hasOppositeContent
|
|
63
|
+
$isAlternate: isAlternate,
|
|
64
|
+
$hasOppositeContent: hasOppositeContent
|
|
65
65
|
}, props)));
|
|
66
66
|
});
|
|
67
67
|
ItemComponent.displayName = 'Timeline.Item';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
|
|
9
9
|
var _circle;
|
|
10
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
10
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
11
|
var SvgCircleFullStroke = function SvgCircleFullStroke(props) {
|
|
12
12
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
|
|
9
9
|
var _path;
|
|
10
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
10
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
11
|
var SvgCheckSmStroke = function SvgCheckSmStroke(props) {
|
|
12
12
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
|
|
9
9
|
var _path;
|
|
10
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
10
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
11
|
var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
12
12
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5,18 +5,15 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'accordions.accordion';
|
|
11
11
|
const StyledAccordion = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0
|
|
13
|
+
'data-garden-version': '9.0.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledAccordion",
|
|
16
16
|
componentId: "sc-niv9ic-0"
|
|
17
17
|
})(["", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
-
StyledAccordion.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
21
18
|
|
|
22
19
|
export { StyledAccordion };
|
|
@@ -5,26 +5,29 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { getLineHeight, retrieveComponentStyles,
|
|
8
|
+
import { getLineHeight, retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'accordions.button';
|
|
11
|
-
const colorStyles =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const colorStyles = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
$isCollapsible,
|
|
14
|
+
$isExpanded,
|
|
15
|
+
$isHovered,
|
|
16
|
+
theme
|
|
17
|
+
} = _ref;
|
|
18
|
+
const showColor = $isCollapsible || !$isExpanded;
|
|
19
|
+
const color = getColor({
|
|
20
|
+
theme,
|
|
21
|
+
variable: showColor && $isHovered ? 'foreground.primary' : 'foreground.default'
|
|
22
|
+
});
|
|
17
23
|
return css(["color:", ";&:hover{cursor:", ";color:", ";}"], color, showColor && 'pointer', showColor && color);
|
|
18
24
|
};
|
|
19
25
|
const StyledButton = styled.button.attrs({
|
|
20
26
|
'data-garden-id': COMPONENT_ID,
|
|
21
|
-
'data-garden-version': '9.0.0
|
|
27
|
+
'data-garden-version': '9.0.0'
|
|
22
28
|
}).withConfig({
|
|
23
29
|
displayName: "StyledButton",
|
|
24
30
|
componentId: "sc-xj3hy7-0"
|
|
25
|
-
})(["transition:color 0.1s ease-in-out;outline:none;border:none;background:transparent;padding:", ";width:100%;text-align:", ";line-height:", ";font-family:inherit;font-size:", ";font-weight:", ";", " &::-moz-focus-inner{border:0;}&:hover{cursor:", ";}", ";"], props => props
|
|
26
|
-
StyledButton.defaultProps = {
|
|
27
|
-
theme: DEFAULT_THEME
|
|
28
|
-
};
|
|
31
|
+
})(["transition:color 0.1s ease-in-out;outline:none;border:none;background:transparent;padding:", ";width:100%;text-align:", ";line-height:", ";font-family:inherit;font-size:", ";font-weight:", ";", " &::-moz-focus-inner{border:0;}&:hover{cursor:", ";}", ";"], props => props.$isCompact ? `${props.theme.space.base * 2}px ${props.theme.space.base * 3}px` : `${props.theme.space.base * 5}px`, props => props.theme.rtl ? 'right' : 'left', props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => props.theme.fontWeights.semibold, colorStyles, props => (props.$isCollapsible || !props.$isExpanded) && 'pointer', props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
29
32
|
|
|
30
33
|
export { COMPONENT_ID, StyledButton };
|
|
@@ -5,23 +5,20 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { focusStyles, retrieveComponentStyles
|
|
8
|
+
import { focusStyles, retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledButton } from './StyledButton.js';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'accordions.header';
|
|
12
12
|
const StyledHeader = styled.div.attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0
|
|
14
|
+
'data-garden-version': '9.0.0'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledHeader",
|
|
17
17
|
componentId: "sc-2c6rbr-0"
|
|
18
|
-
})(["display:flex;align-items:center;transition:box-shadow 0.1s ease-in-out;font-size:", ";&:hover{cursor:", ";}", " ", ";"], props => props.theme.fontSizes.md, props => (props
|
|
18
|
+
})(["display:flex;align-items:center;transition:box-shadow 0.1s ease-in-out;font-size:", ";&:hover{cursor:", ";}", " ", ";"], props => props.theme.fontSizes.md, props => (props.$isCollapsible || !props.$isExpanded) && 'pointer', props => focusStyles({
|
|
19
19
|
theme: props.theme,
|
|
20
20
|
inset: true,
|
|
21
21
|
selector: `&:has(${StyledButton}:focus-visible)`
|
|
22
22
|
}), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
23
|
-
StyledHeader.defaultProps = {
|
|
24
|
-
theme: DEFAULT_THEME
|
|
25
|
-
};
|
|
26
23
|
|
|
27
24
|
export { StyledHeader };
|
|
@@ -5,19 +5,16 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledPanel } from './StyledPanel.js';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'accordions.step_inner_panel';
|
|
12
12
|
const StyledInnerPanel = styled.div.attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0
|
|
14
|
+
'data-garden-version': '9.0.0'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledInnerPanel",
|
|
17
17
|
componentId: "sc-8nbueg-0"
|
|
18
|
-
})(["overflow:hidden;line-height:inherit;font-size:inherit;", "[aria-hidden='true'] > &{transition:", ";visibility:hidden;}", "[aria-hidden='false'] > &{visibility:visible;}", ";"], StyledPanel, props => props
|
|
19
|
-
StyledInnerPanel.defaultProps = {
|
|
20
|
-
theme: DEFAULT_THEME
|
|
21
|
-
};
|
|
18
|
+
})(["overflow:hidden;line-height:inherit;font-size:inherit;", "[aria-hidden='true'] > &{transition:", ";visibility:hidden;}", "[aria-hidden='false'] > &{visibility:visible;}", ";"], StyledPanel, props => props.$isAnimated && 'visibility 0s 0.25s', StyledPanel, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
22
19
|
|
|
23
20
|
export { StyledInnerPanel };
|
|
@@ -5,21 +5,24 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles, DEFAULT_THEME,
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor, getLineHeight } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'accordions.panel';
|
|
11
|
-
const colorStyles =
|
|
12
|
-
|
|
11
|
+
const colorStyles = _ref => {
|
|
12
|
+
let {
|
|
13
13
|
theme,
|
|
14
|
-
isBare
|
|
15
|
-
} =
|
|
16
|
-
return css(["border-bottom-color:", ";"], isBare ? 'transparent' :
|
|
14
|
+
$isBare
|
|
15
|
+
} = _ref;
|
|
16
|
+
return css(["border-bottom-color:", ";"], $isBare ? 'transparent' : getColor({
|
|
17
|
+
theme,
|
|
18
|
+
variable: 'border.default'
|
|
19
|
+
}));
|
|
17
20
|
};
|
|
18
21
|
const sizeStyles = props => {
|
|
19
22
|
const {
|
|
20
23
|
theme,
|
|
21
|
-
isCompact,
|
|
22
|
-
isExpanded
|
|
24
|
+
$isCompact,
|
|
25
|
+
$isExpanded
|
|
23
26
|
} = props;
|
|
24
27
|
const {
|
|
25
28
|
base
|
|
@@ -27,26 +30,26 @@ const sizeStyles = props => {
|
|
|
27
30
|
let paddingTop = base * 2;
|
|
28
31
|
let paddingHorizontal = base * 5;
|
|
29
32
|
let paddingBottom = base * 8;
|
|
30
|
-
if (isCompact) {
|
|
33
|
+
if ($isCompact) {
|
|
31
34
|
paddingTop = base * 2;
|
|
32
35
|
paddingHorizontal = base * 3;
|
|
33
36
|
paddingBottom = base * 4;
|
|
34
37
|
}
|
|
35
|
-
if (isExpanded === false) {
|
|
38
|
+
if ($isExpanded === false) {
|
|
36
39
|
paddingTop = 0;
|
|
37
40
|
paddingBottom = 0;
|
|
38
41
|
}
|
|
39
|
-
return css(["grid-template-rows:", "fr;border-bottom:", ";padding:", "px ", "px ", "px;line-height:", ";font-size:", ";"], isExpanded ? 1 : 0, theme.borders.sm, paddingTop, paddingHorizontal, paddingBottom, getLineHeight(base * 5, theme.fontSizes.md), theme.fontSizes.md);
|
|
42
|
+
return css(["grid-template-rows:", "fr;border-bottom:", ";padding:", "px ", "px ", "px;line-height:", ";font-size:", ";"], $isExpanded ? 1 : 0, theme.borders.sm, paddingTop, paddingHorizontal, paddingBottom, getLineHeight(base * 5, theme.fontSizes.md), theme.fontSizes.md);
|
|
40
43
|
};
|
|
41
44
|
const StyledPanel = styled.section.attrs({
|
|
42
45
|
'data-garden-id': COMPONENT_ID,
|
|
43
|
-
'data-garden-version': '9.0.0
|
|
46
|
+
'data-garden-version': '9.0.0'
|
|
44
47
|
}).withConfig({
|
|
45
48
|
displayName: "StyledPanel",
|
|
46
49
|
componentId: "sc-1piryze-0"
|
|
47
|
-
})(["display:grid;transition:", ";overflow:hidden;", " ", " ", ";"], props => props
|
|
50
|
+
})(["display:grid;transition:", ";overflow:hidden;", " ", " ", ";"], props => props.$isAnimated && 'padding 0.25s ease-in-out, grid-template-rows 0.25s ease-in-out', sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
48
51
|
StyledPanel.defaultProps = {
|
|
49
|
-
isAnimated: true,
|
|
52
|
+
$isAnimated: true,
|
|
50
53
|
theme: DEFAULT_THEME
|
|
51
54
|
};
|
|
52
55
|
|
|
@@ -5,26 +5,29 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { StyledBaseIcon, retrieveComponentStyles,
|
|
8
|
+
import { StyledBaseIcon, retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'accordions.rotate_icon';
|
|
11
|
-
const colorStyles =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const colorStyles = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
$isCollapsible,
|
|
14
|
+
$isHovered,
|
|
15
|
+
$isRotated,
|
|
16
|
+
theme
|
|
17
|
+
} = _ref;
|
|
18
|
+
const showColor = $isCollapsible || !$isRotated;
|
|
19
|
+
const color = getColor({
|
|
20
|
+
theme,
|
|
21
|
+
variable: showColor && $isHovered ? 'foreground.primary' : 'foreground.subtle'
|
|
22
|
+
});
|
|
17
23
|
return css(["color:", ";&:hover{color:", ";}"], color, showColor && color);
|
|
18
24
|
};
|
|
19
25
|
const StyledRotateIcon = styled(StyledBaseIcon).attrs({
|
|
20
26
|
'data-garden-id': COMPONENT_ID,
|
|
21
|
-
'data-garden-version': '9.0.0
|
|
27
|
+
'data-garden-version': '9.0.0'
|
|
22
28
|
}).withConfig({
|
|
23
29
|
displayName: "StyledRotateIcon",
|
|
24
30
|
componentId: "sc-hp435q-0"
|
|
25
31
|
})(["transform:", ";transition:transform 0.25s ease-in-out,color 0.1s ease-in-out;box-sizing:content-box;padding:", ";width:", ";min-width:", ";height:", ";vertical-align:middle;", " ", ";"], props => props.$isRotated && `rotate(${props.theme.rtl ? '-' : '+'}180deg)`, props => props.$isCompact ? `${props.theme.space.base * 1.5}px ${props.theme.space.base * 3}px` : `${props.theme.space.base * 5}px`, props => props.theme.iconSizes.md, props => props.theme.iconSizes.md, props => props.theme.iconSizes.md, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
26
|
-
StyledRotateIcon.defaultProps = {
|
|
27
|
-
theme: DEFAULT_THEME
|
|
28
|
-
};
|
|
29
32
|
|
|
30
33
|
export { StyledRotateIcon };
|
|
@@ -5,19 +5,16 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledPanel } from './StyledPanel.js';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'accordions.section';
|
|
12
12
|
const StyledSection = styled.div.attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0
|
|
14
|
+
'data-garden-version': '9.0.0'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledSection",
|
|
17
17
|
componentId: "sc-v2t9bd-0"
|
|
18
18
|
})(["&:last-child ", "{border:none;}", ";"], StyledPanel, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
19
|
-
StyledSection.defaultProps = {
|
|
20
|
-
theme: DEFAULT_THEME
|
|
21
|
-
};
|
|
22
19
|
|
|
23
20
|
export { StyledSection };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'accordions.step_content';
|
|
11
11
|
const sizeStyles = props => {
|
|
@@ -13,7 +13,7 @@ const sizeStyles = props => {
|
|
|
13
13
|
rtl,
|
|
14
14
|
space
|
|
15
15
|
} = props.theme;
|
|
16
|
-
const paddingBottom = props
|
|
16
|
+
const paddingBottom = props.$isActive ? space.base * 8 : space.base * 6;
|
|
17
17
|
const paddingRight = rtl ? space.base * 6 : space.base * 5;
|
|
18
18
|
const paddingLeft = rtl ? space.base * 5 : space.base * 6;
|
|
19
19
|
const marginRight = rtl ? space.base * 3 : '0';
|
|
@@ -23,13 +23,10 @@ const sizeStyles = props => {
|
|
|
23
23
|
};
|
|
24
24
|
const StyledContent = styled.div.attrs({
|
|
25
25
|
'data-garden-id': COMPONENT_ID,
|
|
26
|
-
'data-garden-version': '9.0.0
|
|
26
|
+
'data-garden-version': '9.0.0'
|
|
27
27
|
}).withConfig({
|
|
28
28
|
displayName: "StyledContent",
|
|
29
29
|
componentId: "sc-mazvvo-0"
|
|
30
|
-
})(["display:grid;grid-template-rows:", "fr;transition:grid-template-rows 0.25s ease-in-out;word-break:break-word;", " ", ";"], props => props
|
|
31
|
-
StyledContent.defaultProps = {
|
|
32
|
-
theme: DEFAULT_THEME
|
|
33
|
-
};
|
|
30
|
+
})(["display:grid;grid-template-rows:", "fr;transition:grid-template-rows 0.25s ease-in-out;word-break:break-word;", " ", ";"], props => props.$isActive ? 1 : 0, sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
34
31
|
|
|
35
32
|
export { StyledContent };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles,
|
|
8
|
+
import { retrieveComponentStyles, getLineHeight, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'accordions.step_icon';
|
|
11
11
|
const StyledIconFlexContainer = styled.div.withConfig({
|
|
@@ -15,23 +15,41 @@ const StyledIconFlexContainer = styled.div.withConfig({
|
|
|
15
15
|
const sizeStyles = props => {
|
|
16
16
|
const size = `${props.theme.space.base * 6}px`;
|
|
17
17
|
const fontSize = props.theme.fontSizes.sm;
|
|
18
|
-
return css(["margin-bottom:", ";margin-", ":", ";width:", ";min-width:", ";height:", ";min-height:", ";line-height:", ";font-size:", ";"], props
|
|
18
|
+
return css(["margin-bottom:", ";margin-", ":", ";width:", ";min-width:", ";height:", ";min-height:", ";line-height:", ";font-size:", ";"], props.$isHorizontal && `${props.theme.space.base * 2}px`, props.theme.rtl ? 'left' : 'right', !props.$isHorizontal && `${props.theme.space.base * 3}px`, size, size, size, size, getLineHeight(size, fontSize), fontSize);
|
|
19
19
|
};
|
|
20
|
-
const colorStyles =
|
|
21
|
-
|
|
20
|
+
const colorStyles = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
$isActive,
|
|
23
|
+
theme
|
|
24
|
+
} = _ref;
|
|
25
|
+
const foregroundColor = getColor({
|
|
26
|
+
theme,
|
|
27
|
+
variable: $isActive ? 'foreground.onEmphasis' : 'foreground.default'
|
|
28
|
+
});
|
|
29
|
+
const backgroundColor = $isActive ? getColor({
|
|
30
|
+
theme,
|
|
31
|
+
variable: 'background.emphasis',
|
|
32
|
+
dark: {
|
|
33
|
+
offset: -300
|
|
34
|
+
}
|
|
35
|
+
}) : getColor({
|
|
36
|
+
theme,
|
|
37
|
+
variable: 'background.subtle',
|
|
38
|
+
dark: {
|
|
39
|
+
offset: -200
|
|
40
|
+
},
|
|
41
|
+
light: {
|
|
42
|
+
offset: 100
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return css(["background:", ";color:", ";"], backgroundColor, foregroundColor);
|
|
22
46
|
};
|
|
23
47
|
const StyledIcon = styled.div.attrs({
|
|
24
48
|
'data-garden-id': COMPONENT_ID,
|
|
25
|
-
'data-garden-version': '9.0.0
|
|
49
|
+
'data-garden-version': '9.0.0'
|
|
26
50
|
}).withConfig({
|
|
27
51
|
displayName: "StyledIcon",
|
|
28
52
|
componentId: "sc-v20nz9-1"
|
|
29
53
|
})(["display:flex;align-items:center;justify-content:center;transition:background 0.25s ease-in-out,color 0.25s ease-in-out;border-radius:100%;", " ", " ", ";"], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
30
|
-
StyledIconFlexContainer.defaultProps = {
|
|
31
|
-
theme: DEFAULT_THEME
|
|
32
|
-
};
|
|
33
|
-
StyledIcon.defaultProps = {
|
|
34
|
-
theme: DEFAULT_THEME
|
|
35
|
-
};
|
|
36
54
|
|
|
37
55
|
export { StyledIcon, StyledIconFlexContainer };
|
|
@@ -5,18 +5,23 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { getLineHeight,
|
|
8
|
+
import { getLineHeight, getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'accordions.step_inner_content';
|
|
11
11
|
const StyledInnerContent = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0
|
|
13
|
+
'data-garden-version': '9.0.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledInnerContent",
|
|
16
16
|
componentId: "sc-1xs9fh7-0"
|
|
17
|
-
})(["overflow:hidden;line-height:", ";color:", ";font-size:", ";", ";"], props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
17
|
+
})(["overflow:hidden;line-height:", ";color:", ";font-size:", ";", ";"], props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), _ref => {
|
|
18
|
+
let {
|
|
19
|
+
theme
|
|
20
|
+
} = _ref;
|
|
21
|
+
return getColor({
|
|
22
|
+
theme,
|
|
23
|
+
variable: 'foreground.default'
|
|
24
|
+
});
|
|
25
|
+
}, props => props.theme.fontSizes.md, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
21
26
|
|
|
22
27
|
export { StyledInnerContent };
|
|
@@ -5,18 +5,24 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { getLineHeight,
|
|
8
|
+
import { getLineHeight, getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'accordions.step_label';
|
|
11
11
|
const StyledLabel = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0
|
|
13
|
+
'data-garden-version': '9.0.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledLabel",
|
|
16
16
|
componentId: "sc-1o82llj-0"
|
|
17
|
-
})(["display:", ";align-items:", ";transition:color 0.25s ease-in-out,font-weight 0.25s ease-in-out;text-align:", ";line-height:", ";color:", ";font-size:", ";font-weight:", ";", ";"], props => !props
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
})(["display:", ";align-items:", ";transition:color 0.25s ease-in-out,font-weight 0.25s ease-in-out;text-align:", ";line-height:", ";color:", ";font-size:", ";font-weight:", ";", ";"], props => !props.$isHorizontal && 'flex', props => !props.$isHorizontal && 'center', props => props.$isHorizontal && 'center', props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), _ref => {
|
|
18
|
+
let {
|
|
19
|
+
$isActive,
|
|
20
|
+
theme
|
|
21
|
+
} = _ref;
|
|
22
|
+
return getColor({
|
|
23
|
+
theme,
|
|
24
|
+
variable: $isActive ? 'foreground.default' : 'foreground.subtle'
|
|
25
|
+
});
|
|
26
|
+
}, props => props.theme.fontSizes.md, props => props.$isActive && 600, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
21
27
|
|
|
22
28
|
export { StyledLabel };
|
|
@@ -5,18 +5,14 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
8
|
|
|
10
9
|
const COMPONENT_ID = 'accordions.step_label_text';
|
|
11
10
|
const StyledLabelText = styled.div.attrs({
|
|
12
11
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0
|
|
12
|
+
'data-garden-version': '9.0.0'
|
|
14
13
|
}).withConfig({
|
|
15
14
|
displayName: "StyledLabelText",
|
|
16
15
|
componentId: "sc-111m5zo-0"
|
|
17
|
-
})(["display:", ";padding:", ";word-wrap:", ";"], props => props
|
|
18
|
-
StyledLabelText.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
16
|
+
})(["display:", ";padding:", ";word-wrap:", ";"], props => props.$isHidden && 'none', props => props.$isHorizontal && `0 ${props.theme.space.base * 3}px`, props => props.$isHorizontal && 'break-word');
|
|
21
17
|
|
|
22
18
|
export { StyledLabelText };
|
|
@@ -5,18 +5,23 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import {
|
|
8
|
+
import { getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'accordions.step_line';
|
|
11
11
|
const StyledLine = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0
|
|
13
|
+
'data-garden-version': '9.0.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledLine",
|
|
16
16
|
componentId: "sc-1gkpjbr-0"
|
|
17
|
-
})(["display:block;position:absolute;top:", "px;right:", ";left:", ";flex:1;border-top:", ";border-color:", ";"], props => props.theme.space.base * 3, props => `calc(50% + ${props.theme.space.base * 6}px)`, props => `calc(-50% + ${props.theme.space.base * 6}px)`, props => props.theme.borders.sm,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
17
|
+
})(["display:block;position:absolute;top:", "px;right:", ";left:", ";flex:1;border-top:", ";border-color:", ";"], props => props.theme.space.base * 3, props => `calc(50% + ${props.theme.space.base * 6}px)`, props => `calc(-50% + ${props.theme.space.base * 6}px)`, props => props.theme.borders.sm, _ref => {
|
|
18
|
+
let {
|
|
19
|
+
theme
|
|
20
|
+
} = _ref;
|
|
21
|
+
return getColor({
|
|
22
|
+
theme,
|
|
23
|
+
variable: 'border.default'
|
|
24
|
+
});
|
|
25
|
+
});
|
|
21
26
|
|
|
22
27
|
export { StyledLine };
|