@zendeskgarden/react-accordions 9.0.0-next.17 → 9.0.0-next.19
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/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 +1 -1
- package/dist/esm/elements/timeline/components/Item.js +2 -2
- package/dist/esm/styled/accordion/StyledAccordion.js +1 -1
- package/dist/esm/styled/accordion/StyledButton.js +15 -9
- package/dist/esm/styled/accordion/StyledHeader.js +2 -2
- package/dist/esm/styled/accordion/StyledInnerPanel.js +2 -2
- package/dist/esm/styled/accordion/StyledPanel.js +17 -14
- package/dist/esm/styled/accordion/StyledRotateIcon.js +14 -8
- package/dist/esm/styled/accordion/StyledSection.js +1 -1
- package/dist/esm/styled/stepper/StyledContent.js +3 -3
- package/dist/esm/styled/stepper/StyledIcon.js +29 -5
- package/dist/esm/styled/stepper/StyledInnerContent.js +11 -3
- package/dist/esm/styled/stepper/StyledLabel.js +12 -3
- package/dist/esm/styled/stepper/StyledLabelText.js +2 -2
- package/dist/esm/styled/stepper/StyledLine.js +11 -3
- package/dist/esm/styled/stepper/StyledStep.js +11 -3
- package/dist/esm/styled/stepper/StyledStepper.js +2 -2
- package/dist/esm/styled/timeline/StyledContent.js +1 -1
- package/dist/esm/styled/timeline/StyledItem.js +11 -3
- package/dist/esm/styled/timeline/StyledItemIcon.js +19 -4
- package/dist/esm/styled/timeline/StyledOppositeContent.js +1 -1
- package/dist/esm/styled/timeline/StyledSeparator.js +11 -3
- package/dist/esm/styled/timeline/StyledTimeline.js +1 -1
- package/dist/index.cjs.js +189 -86
- 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/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 -1
- package/dist/typings/types/index.d.ts +1 -1
- package/package.json +3 -3
|
@@ -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,7 +44,7 @@ const StepComponent = forwardRef((_ref, ref) => {
|
|
|
44
44
|
} = useStepperContext();
|
|
45
45
|
return React__default.createElement(StyledStep, Object.assign({
|
|
46
46
|
ref: ref,
|
|
47
|
-
isHorizontal: isHorizontal
|
|
47
|
+
$isHorizontal: isHorizontal
|
|
48
48
|
}, props), isHorizontal && React__default.createElement(StyledLine, null), children);
|
|
49
49
|
});
|
|
50
50
|
StepComponent.displayName = 'Stepper.Step';
|
|
@@ -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';
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
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-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.19'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledAccordion",
|
|
16
16
|
componentId: "sc-niv9ic-0"
|
|
@@ -5,24 +5,30 @@
|
|
|
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, DEFAULT_THEME,
|
|
8
|
+
import { getLineHeight, retrieveComponentStyles, DEFAULT_THEME, 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-next.
|
|
27
|
+
'data-garden-version': '9.0.0-next.19'
|
|
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
|
|
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));
|
|
26
32
|
StyledButton.defaultProps = {
|
|
27
33
|
theme: DEFAULT_THEME
|
|
28
34
|
};
|
|
@@ -11,11 +11,11 @@ import { StyledButton } from './StyledButton.js';
|
|
|
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-next.
|
|
14
|
+
'data-garden-version': '9.0.0-next.19'
|
|
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)`
|
|
@@ -11,11 +11,11 @@ import { StyledPanel } from './StyledPanel.js';
|
|
|
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-next.
|
|
14
|
+
'data-garden-version': '9.0.0-next.19'
|
|
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
|
|
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));
|
|
19
19
|
StyledInnerPanel.defaultProps = {
|
|
20
20
|
theme: DEFAULT_THEME
|
|
21
21
|
};
|
|
@@ -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-next.
|
|
46
|
+
'data-garden-version': '9.0.0-next.19'
|
|
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,20 +5,26 @@
|
|
|
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, DEFAULT_THEME,
|
|
8
|
+
import { StyledBaseIcon, retrieveComponentStyles, DEFAULT_THEME, 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-next.
|
|
27
|
+
'data-garden-version': '9.0.0-next.19'
|
|
22
28
|
}).withConfig({
|
|
23
29
|
displayName: "StyledRotateIcon",
|
|
24
30
|
componentId: "sc-hp435q-0"
|
|
@@ -11,7 +11,7 @@ import { StyledPanel } from './StyledPanel.js';
|
|
|
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-next.
|
|
14
|
+
'data-garden-version': '9.0.0-next.19'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledSection",
|
|
17
17
|
componentId: "sc-v2t9bd-0"
|
|
@@ -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,11 +23,11 @@ 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-next.
|
|
26
|
+
'data-garden-version': '9.0.0-next.19'
|
|
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
|
|
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));
|
|
31
31
|
StyledContent.defaultProps = {
|
|
32
32
|
theme: DEFAULT_THEME
|
|
33
33
|
};
|
|
@@ -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, DEFAULT_THEME, getLineHeight,
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getLineHeight, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'accordions.step_icon';
|
|
11
11
|
const StyledIconFlexContainer = styled.div.withConfig({
|
|
@@ -15,14 +15,38 @@ 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-next.
|
|
49
|
+
'data-garden-version': '9.0.0-next.19'
|
|
26
50
|
}).withConfig({
|
|
27
51
|
displayName: "StyledIcon",
|
|
28
52
|
componentId: "sc-v20nz9-1"
|
|
@@ -5,16 +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, DEFAULT_THEME } 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-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.19'
|
|
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),
|
|
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));
|
|
18
26
|
StyledInnerContent.defaultProps = {
|
|
19
27
|
theme: DEFAULT_THEME
|
|
20
28
|
};
|
|
@@ -5,16 +5,25 @@
|
|
|
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, DEFAULT_THEME } 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-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.19'
|
|
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
|
|
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));
|
|
18
27
|
StyledLabel.defaultProps = {
|
|
19
28
|
theme: DEFAULT_THEME
|
|
20
29
|
};
|
|
@@ -10,11 +10,11 @@ import { DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
|
10
10
|
const COMPONENT_ID = 'accordions.step_label_text';
|
|
11
11
|
const StyledLabelText = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.19'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledLabelText",
|
|
16
16
|
componentId: "sc-111m5zo-0"
|
|
17
|
-
})(["display:", ";padding:", ";word-wrap:", ";"], props => props
|
|
17
|
+
})(["display:", ";padding:", ";word-wrap:", ";"], props => props.$isHidden && 'none', props => props.$isHorizontal && `0 ${props.theme.space.base * 3}px`, props => props.$isHorizontal && 'break-word');
|
|
18
18
|
StyledLabelText.defaultProps = {
|
|
19
19
|
theme: DEFAULT_THEME
|
|
20
20
|
};
|
|
@@ -5,16 +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 {
|
|
8
|
+
import { getColor, DEFAULT_THEME } 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-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.19'
|
|
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,
|
|
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
|
+
});
|
|
18
26
|
StyledLine.defaultProps = {
|
|
19
27
|
theme: DEFAULT_THEME
|
|
20
28
|
};
|
|
@@ -5,18 +5,26 @@
|
|
|
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, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledContent } from './StyledContent.js';
|
|
10
10
|
import { StyledLine } from './StyledLine.js';
|
|
11
11
|
|
|
12
12
|
const COMPONENT_ID = 'accordions.step';
|
|
13
13
|
const StyledStep = styled.li.attrs({
|
|
14
14
|
'data-garden-id': COMPONENT_ID,
|
|
15
|
-
'data-garden-version': '9.0.0-next.
|
|
15
|
+
'data-garden-version': '9.0.0-next.19'
|
|
16
16
|
}).withConfig({
|
|
17
17
|
displayName: "StyledStep",
|
|
18
18
|
componentId: "sc-12fiwtz-0"
|
|
19
|
-
})(["position:", ";flex:", ";min-width:", ";&:last-of-type ", "{display:", ";}&:first-of-type ", "{display:", ";}&:not(:last-of-type) ", "{border-", ":", ";border-color:", ";}", ";"], props => props
|
|
19
|
+
})(["position:", ";flex:", ";min-width:", ";&:last-of-type ", "{display:", ";}&:first-of-type ", "{display:", ";}&:not(:last-of-type) ", "{border-", ":", ";border-color:", ";}", ";"], props => props.$isHorizontal && 'relative', props => props.$isHorizontal && '1', props => props.$isHorizontal && `${props.theme.space.base * 15}px`, StyledLine, props => props.theme.rtl && 'none', StyledLine, props => !props.theme.rtl && 'none', StyledContent, props => props.theme.rtl ? 'right' : 'left', props => props.theme.borders.sm, _ref => {
|
|
20
|
+
let {
|
|
21
|
+
theme
|
|
22
|
+
} = _ref;
|
|
23
|
+
return getColor({
|
|
24
|
+
theme,
|
|
25
|
+
variable: 'border.default'
|
|
26
|
+
});
|
|
27
|
+
}, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
20
28
|
StyledStep.defaultProps = {
|
|
21
29
|
theme: DEFAULT_THEME
|
|
22
30
|
};
|
|
@@ -10,11 +10,11 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
10
10
|
const COMPONENT_ID = 'accordions.stepper';
|
|
11
11
|
const StyledStepper = styled.ol.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.19'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledStepper",
|
|
16
16
|
componentId: "sc-dsxw0f-0"
|
|
17
|
-
})(["display:", ";margin:0;padding:0;list-style:none;", ";"], props => props
|
|
17
|
+
})(["display:", ";margin:0;padding:0;list-style:none;", ";"], props => props.$isHorizontal && 'flex', props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
18
|
StyledStepper.defaultProps = {
|
|
19
19
|
theme: DEFAULT_THEME
|
|
20
20
|
};
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
10
10
|
const COMPONENT_ID = 'timeline.content';
|
|
11
11
|
const StyledTimelineContent = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.19'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledContent__StyledTimelineContent",
|
|
16
16
|
componentId: "sc-19phgu1-0"
|
|
@@ -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 { getLineHeight,
|
|
8
|
+
import { getLineHeight, getColor, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledSeparator } from './StyledSeparator.js';
|
|
10
10
|
import { StyledTimelineContent } from './StyledContent.js';
|
|
11
11
|
import { StyledOppositeContent } from './StyledOppositeContent.js';
|
|
@@ -13,11 +13,19 @@ import { StyledOppositeContent } from './StyledOppositeContent.js';
|
|
|
13
13
|
const COMPONENT_ID = 'timeline.item';
|
|
14
14
|
const StyledTimelineItem = styled.li.attrs({
|
|
15
15
|
'data-garden-id': COMPONENT_ID,
|
|
16
|
-
'data-garden-version': '9.0.0-next.
|
|
16
|
+
'data-garden-version': '9.0.0-next.19'
|
|
17
17
|
}).withConfig({
|
|
18
18
|
displayName: "StyledItem__StyledTimelineItem",
|
|
19
19
|
componentId: "sc-5mcnzm-0"
|
|
20
|
-
})(["display:flex;position:relative;line-height:", ";color:", ";font-size:", ";&:last-of-type ", "::after{display:none;}", " ", " ", ";"], props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md),
|
|
20
|
+
})(["display:flex;position:relative;line-height:", ";color:", ";font-size:", ";&:last-of-type ", "::after{display:none;}", " ", " ", ";"], props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), _ref => {
|
|
21
|
+
let {
|
|
22
|
+
theme
|
|
23
|
+
} = _ref;
|
|
24
|
+
return getColor({
|
|
25
|
+
theme,
|
|
26
|
+
variable: 'foreground.default'
|
|
27
|
+
});
|
|
28
|
+
}, props => props.theme.fontSizes.md, StyledSeparator, props => !props.$hasOppositeContent && props.$isAlternate && css(["&::before{flex:1;padding:", "px;content:'';}"], props.theme.space.base * 4), props => props.$isAlternate && css(["&:nth-child(even){flex-direction:row-reverse;", "{text-align:", ";}", "{text-align:", ";}}"], StyledOppositeContent, props.theme.rtl ? 'right' : 'left', StyledTimelineContent, props.theme.rtl ? 'left' : 'right'), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
21
29
|
StyledTimelineItem.defaultProps = {
|
|
22
30
|
theme: DEFAULT_THEME
|
|
23
31
|
};
|
|
@@ -4,18 +4,33 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import styled from 'styled-components';
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
8
|
import { math } from 'polished';
|
|
9
|
-
import { StyledBaseIcon,
|
|
9
|
+
import { StyledBaseIcon, retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'timeline.icon';
|
|
12
|
+
const colorStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
$surfaceColor,
|
|
15
|
+
theme
|
|
16
|
+
} = _ref;
|
|
17
|
+
const foregroundColor = getColor({
|
|
18
|
+
theme,
|
|
19
|
+
variable: 'border.emphasis'
|
|
20
|
+
});
|
|
21
|
+
const backgroundColor = $surfaceColor || getColor({
|
|
22
|
+
theme,
|
|
23
|
+
variable: 'background.default'
|
|
24
|
+
});
|
|
25
|
+
return css(["background-color:", ";color:", ";"], backgroundColor, foregroundColor);
|
|
26
|
+
};
|
|
12
27
|
const StyledItemIcon = styled(StyledBaseIcon).attrs({
|
|
13
28
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0-next.
|
|
29
|
+
'data-garden-version': '9.0.0-next.19'
|
|
15
30
|
}).withConfig({
|
|
16
31
|
displayName: "StyledItemIcon",
|
|
17
32
|
componentId: "sc-vz2l6e-0"
|
|
18
|
-
})(["z-index:1;box-sizing:content-box;
|
|
33
|
+
})(["z-index:1;box-sizing:content-box;padding:", "px 0;width:", ";height:", ";", " ", ";"], props => props.theme.space.base, props => math(`${props.theme.iconSizes.sm} + 1`), props => math(`${props.theme.iconSizes.sm} + 1`), colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
19
34
|
StyledItemIcon.defaultProps = {
|
|
20
35
|
theme: DEFAULT_THEME
|
|
21
36
|
};
|