@zendeskgarden/react-accordions 8.75.1 → 8.76.1

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.
Files changed (48) hide show
  1. package/dist/esm/elements/accordion/Accordion.js +111 -0
  2. package/dist/esm/elements/accordion/components/Header.js +112 -0
  3. package/dist/esm/elements/accordion/components/Label.js +60 -0
  4. package/dist/esm/elements/accordion/components/Panel.js +70 -0
  5. package/dist/esm/elements/accordion/components/Section.js +36 -0
  6. package/dist/esm/elements/stepper/Stepper.js +77 -0
  7. package/dist/esm/elements/stepper/components/Content.js +52 -0
  8. package/dist/esm/elements/stepper/components/Label.js +76 -0
  9. package/dist/esm/elements/stepper/components/Step.js +53 -0
  10. package/dist/esm/elements/timeline/Timeline.js +60 -0
  11. package/dist/esm/elements/timeline/components/Content.js +52 -0
  12. package/dist/esm/elements/timeline/components/Item.js +70 -0
  13. package/dist/esm/elements/timeline/components/OppositeContent.js +36 -0
  14. package/dist/esm/index.js +9 -0
  15. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/circle-full-stroke.svg.js +28 -0
  16. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/check-sm-stroke.svg.js +29 -0
  17. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-down-stroke.svg.js +25 -0
  18. package/dist/esm/styled/accordion/StyledAccordion.js +22 -0
  19. package/dist/esm/styled/accordion/StyledButton.js +30 -0
  20. package/dist/esm/styled/accordion/StyledHeader.js +27 -0
  21. package/dist/esm/styled/accordion/StyledInnerPanel.js +23 -0
  22. package/dist/esm/styled/accordion/StyledPanel.js +53 -0
  23. package/dist/esm/styled/accordion/StyledRotateIcon.js +42 -0
  24. package/dist/esm/styled/accordion/StyledSection.js +23 -0
  25. package/dist/esm/styled/stepper/StyledContent.js +35 -0
  26. package/dist/esm/styled/stepper/StyledIcon.js +37 -0
  27. package/dist/esm/styled/stepper/StyledInnerContent.js +22 -0
  28. package/dist/esm/styled/stepper/StyledLabel.js +22 -0
  29. package/dist/esm/styled/stepper/StyledLabelText.js +22 -0
  30. package/dist/esm/styled/stepper/StyledLine.js +22 -0
  31. package/dist/esm/styled/stepper/StyledStep.js +24 -0
  32. package/dist/esm/styled/stepper/StyledStepper.js +22 -0
  33. package/dist/esm/styled/timeline/StyledContent.js +22 -0
  34. package/dist/esm/styled/timeline/StyledItem.js +25 -0
  35. package/dist/esm/styled/timeline/StyledItemIcon.js +31 -0
  36. package/dist/esm/styled/timeline/StyledOppositeContent.js +22 -0
  37. package/dist/esm/styled/timeline/StyledSeparator.js +22 -0
  38. package/dist/esm/styled/timeline/StyledTimeline.js +22 -0
  39. package/dist/esm/utils/useAccordionContext.js +18 -0
  40. package/dist/esm/utils/useHeaderContext.js +18 -0
  41. package/dist/esm/utils/useSectionContext.js +18 -0
  42. package/dist/esm/utils/useStepContext.js +18 -0
  43. package/dist/esm/utils/useStepperContext.js +18 -0
  44. package/dist/esm/utils/useTimelineContext.js +18 -0
  45. package/dist/esm/utils/useTimelineItemContext.js +18 -0
  46. package/dist/index.cjs.js +39 -55
  47. package/package.json +5 -5
  48. package/dist/index.esm.js +0 -881
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React__default, { forwardRef, useMemo } from 'react';
8
+ import '../../utils/useStepperContext.js';
9
+ import '../../utils/useStepContext.js';
10
+ import '../../utils/useAccordionContext.js';
11
+ import '../../utils/useSectionContext.js';
12
+ import '../../utils/useHeaderContext.js';
13
+ import { TimelineContext } from '../../utils/useTimelineContext.js';
14
+ import '../../utils/useTimelineItemContext.js';
15
+ import '../../styled/stepper/StyledStep.js';
16
+ import '../../styled/stepper/StyledContent.js';
17
+ import '../../styled/stepper/StyledInnerContent.js';
18
+ import '../../styled/stepper/StyledLine.js';
19
+ import '../../styled/stepper/StyledStepper.js';
20
+ import '../../styled/stepper/StyledIcon.js';
21
+ import '../../styled/stepper/StyledLabel.js';
22
+ import '../../styled/stepper/StyledLabelText.js';
23
+ import '../../styled/accordion/StyledAccordion.js';
24
+ import '../../styled/accordion/StyledSection.js';
25
+ import '../../styled/accordion/StyledHeader.js';
26
+ import '../../styled/accordion/StyledButton.js';
27
+ import '../../styled/accordion/StyledPanel.js';
28
+ import '../../styled/accordion/StyledInnerPanel.js';
29
+ import '../../styled/accordion/StyledRotateIcon.js';
30
+ import { StyledTimeline } from '../../styled/timeline/StyledTimeline.js';
31
+ import '../../styled/timeline/StyledItem.js';
32
+ import '../../styled/timeline/StyledItemIcon.js';
33
+ import '../../styled/timeline/StyledContent.js';
34
+ import '../../styled/timeline/StyledOppositeContent.js';
35
+ import '../../styled/timeline/StyledSeparator.js';
36
+ import { Item } from './components/Item.js';
37
+ import { Content } from './components/Content.js';
38
+ import { OppositeContent } from './components/OppositeContent.js';
39
+
40
+ const TimelineComponent = forwardRef((_ref, ref) => {
41
+ let {
42
+ isAlternate,
43
+ ...props
44
+ } = _ref;
45
+ const value = useMemo(() => ({
46
+ isAlternate
47
+ }), [isAlternate]);
48
+ return React__default.createElement(TimelineContext.Provider, {
49
+ value: value
50
+ }, React__default.createElement(StyledTimeline, Object.assign({
51
+ ref: ref
52
+ }, props)));
53
+ });
54
+ TimelineComponent.displayName = 'Timeline';
55
+ const Timeline = TimelineComponent;
56
+ Timeline.Content = Content;
57
+ Timeline.Item = Item;
58
+ Timeline.OppositeContent = OppositeContent;
59
+
60
+ export { Timeline };
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React__default, { forwardRef } from 'react';
8
+ import SvgCircleFullStroke from '../../../node_modules/@zendeskgarden/svg-icons/src/12/circle-full-stroke.svg.js';
9
+ import '../../../styled/stepper/StyledStep.js';
10
+ import '../../../styled/stepper/StyledContent.js';
11
+ import '../../../styled/stepper/StyledInnerContent.js';
12
+ import '../../../styled/stepper/StyledLine.js';
13
+ import '../../../styled/stepper/StyledStepper.js';
14
+ import '../../../styled/stepper/StyledIcon.js';
15
+ import '../../../styled/stepper/StyledLabel.js';
16
+ import '../../../styled/stepper/StyledLabelText.js';
17
+ import '../../../styled/accordion/StyledAccordion.js';
18
+ import '../../../styled/accordion/StyledSection.js';
19
+ import '../../../styled/accordion/StyledHeader.js';
20
+ import '../../../styled/accordion/StyledButton.js';
21
+ import '../../../styled/accordion/StyledPanel.js';
22
+ import '../../../styled/accordion/StyledInnerPanel.js';
23
+ import '../../../styled/accordion/StyledRotateIcon.js';
24
+ import '../../../styled/timeline/StyledTimeline.js';
25
+ import '../../../styled/timeline/StyledItem.js';
26
+ import { StyledItemIcon } from '../../../styled/timeline/StyledItemIcon.js';
27
+ import { StyledTimelineContent } from '../../../styled/timeline/StyledContent.js';
28
+ import '../../../styled/timeline/StyledOppositeContent.js';
29
+ import { StyledSeparator } from '../../../styled/timeline/StyledSeparator.js';
30
+ import '../../../utils/useStepperContext.js';
31
+ import '../../../utils/useStepContext.js';
32
+ import '../../../utils/useAccordionContext.js';
33
+ import '../../../utils/useSectionContext.js';
34
+ import '../../../utils/useHeaderContext.js';
35
+ import '../../../utils/useTimelineContext.js';
36
+ import { useTimelineItemContext } from '../../../utils/useTimelineItemContext.js';
37
+
38
+ const ContentComponent = forwardRef((props, ref) => {
39
+ const {
40
+ icon,
41
+ surfaceColor
42
+ } = useTimelineItemContext();
43
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(StyledSeparator, null, React__default.createElement(StyledItemIcon, {
44
+ surfaceColor: surfaceColor
45
+ }, icon || React__default.createElement(SvgCircleFullStroke, null))), React__default.createElement(StyledTimelineContent, Object.assign({
46
+ ref: ref
47
+ }, props)));
48
+ });
49
+ ContentComponent.displayName = 'Timeline.Content';
50
+ const Content = ContentComponent;
51
+
52
+ export { Content };
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React__default, { forwardRef, useMemo, Children } from 'react';
8
+ import { OppositeContent } from './OppositeContent.js';
9
+ import '../../../styled/stepper/StyledStep.js';
10
+ import '../../../styled/stepper/StyledContent.js';
11
+ import '../../../styled/stepper/StyledInnerContent.js';
12
+ import '../../../styled/stepper/StyledLine.js';
13
+ import '../../../styled/stepper/StyledStepper.js';
14
+ import '../../../styled/stepper/StyledIcon.js';
15
+ import '../../../styled/stepper/StyledLabel.js';
16
+ import '../../../styled/stepper/StyledLabelText.js';
17
+ import '../../../styled/accordion/StyledAccordion.js';
18
+ import '../../../styled/accordion/StyledSection.js';
19
+ import '../../../styled/accordion/StyledHeader.js';
20
+ import '../../../styled/accordion/StyledButton.js';
21
+ import '../../../styled/accordion/StyledPanel.js';
22
+ import '../../../styled/accordion/StyledInnerPanel.js';
23
+ import '../../../styled/accordion/StyledRotateIcon.js';
24
+ import '../../../styled/timeline/StyledTimeline.js';
25
+ import { StyledTimelineItem } from '../../../styled/timeline/StyledItem.js';
26
+ import '../../../styled/timeline/StyledItemIcon.js';
27
+ import '../../../styled/timeline/StyledContent.js';
28
+ import '../../../styled/timeline/StyledOppositeContent.js';
29
+ import '../../../styled/timeline/StyledSeparator.js';
30
+ import '../../../utils/useStepperContext.js';
31
+ import '../../../utils/useStepContext.js';
32
+ import '../../../utils/useAccordionContext.js';
33
+ import '../../../utils/useSectionContext.js';
34
+ import '../../../utils/useHeaderContext.js';
35
+ import { useTimelineContext } from '../../../utils/useTimelineContext.js';
36
+ import { TimelineItemContext } from '../../../utils/useTimelineItemContext.js';
37
+
38
+ const ItemComponent = forwardRef((_ref, ref) => {
39
+ let {
40
+ icon,
41
+ surfaceColor,
42
+ ...props
43
+ } = _ref;
44
+ const value = useMemo(() => ({
45
+ icon,
46
+ surfaceColor
47
+ }), [icon, surfaceColor]);
48
+ const {
49
+ isAlternate
50
+ } = useTimelineContext();
51
+ let hasOppositeContent = false;
52
+ Children.forEach(props.children, child => {
53
+ if (child) {
54
+ if (child.type === OppositeContent) {
55
+ hasOppositeContent = true;
56
+ }
57
+ }
58
+ });
59
+ return React__default.createElement(TimelineItemContext.Provider, {
60
+ value: value
61
+ }, React__default.createElement(StyledTimelineItem, Object.assign({
62
+ ref: ref,
63
+ isAlternate: isAlternate,
64
+ hasOppositeContent: hasOppositeContent
65
+ }, props)));
66
+ });
67
+ ItemComponent.displayName = 'Timeline.Item';
68
+ const Item = ItemComponent;
69
+
70
+ export { Item };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React__default, { forwardRef } from 'react';
8
+ import '../../../styled/stepper/StyledStep.js';
9
+ import '../../../styled/stepper/StyledContent.js';
10
+ import '../../../styled/stepper/StyledInnerContent.js';
11
+ import '../../../styled/stepper/StyledLine.js';
12
+ import '../../../styled/stepper/StyledStepper.js';
13
+ import '../../../styled/stepper/StyledIcon.js';
14
+ import '../../../styled/stepper/StyledLabel.js';
15
+ import '../../../styled/stepper/StyledLabelText.js';
16
+ import '../../../styled/accordion/StyledAccordion.js';
17
+ import '../../../styled/accordion/StyledSection.js';
18
+ import '../../../styled/accordion/StyledHeader.js';
19
+ import '../../../styled/accordion/StyledButton.js';
20
+ import '../../../styled/accordion/StyledPanel.js';
21
+ import '../../../styled/accordion/StyledInnerPanel.js';
22
+ import '../../../styled/accordion/StyledRotateIcon.js';
23
+ import '../../../styled/timeline/StyledTimeline.js';
24
+ import '../../../styled/timeline/StyledItem.js';
25
+ import '../../../styled/timeline/StyledItemIcon.js';
26
+ import '../../../styled/timeline/StyledContent.js';
27
+ import { StyledOppositeContent } from '../../../styled/timeline/StyledOppositeContent.js';
28
+ import '../../../styled/timeline/StyledSeparator.js';
29
+
30
+ const OppositeContentComponent = forwardRef((props, ref) => React__default.createElement(StyledOppositeContent, Object.assign({
31
+ ref: ref
32
+ }, props)));
33
+ OppositeContentComponent.displayName = 'Timeline.OppositeContent';
34
+ const OppositeContent = OppositeContentComponent;
35
+
36
+ export { OppositeContent };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ export { Accordion } from './elements/accordion/Accordion.js';
8
+ export { Stepper } from './elements/stepper/Stepper.js';
9
+ export { Timeline } from './elements/timeline/Timeline.js';
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import * as React from 'react';
8
+
9
+ var _circle;
10
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
11
+ var SvgCircleFullStroke = function SvgCircleFullStroke(props) {
12
+ return /*#__PURE__*/React.createElement("svg", _extends({
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ width: 12,
15
+ height: 12,
16
+ focusable: "false",
17
+ viewBox: "0 0 12 12",
18
+ "aria-hidden": "true"
19
+ }, props), _circle || (_circle = /*#__PURE__*/React.createElement("circle", {
20
+ cx: 6,
21
+ cy: 6,
22
+ r: 4.5,
23
+ fill: "none",
24
+ stroke: "currentColor"
25
+ })));
26
+ };
27
+
28
+ export { SvgCircleFullStroke as default };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import * as React from 'react';
8
+
9
+ var _path;
10
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
11
+ var SvgCheckSmStroke = function SvgCheckSmStroke(props) {
12
+ return /*#__PURE__*/React.createElement("svg", _extends({
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ width: 16,
15
+ height: 16,
16
+ focusable: "false",
17
+ viewBox: "0 0 16 16",
18
+ "aria-hidden": "true"
19
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
20
+ fill: "none",
21
+ stroke: "currentColor",
22
+ strokeLinecap: "round",
23
+ strokeLinejoin: "round",
24
+ strokeWidth: 1.25,
25
+ d: "M3 9l3 3 7-7"
26
+ })));
27
+ };
28
+
29
+ export { SvgCheckSmStroke as default };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import * as React from 'react';
8
+
9
+ var _path;
10
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
11
+ var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
12
+ return /*#__PURE__*/React.createElement("svg", _extends({
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ width: 16,
15
+ height: 16,
16
+ focusable: "false",
17
+ viewBox: "0 0 16 16",
18
+ "aria-hidden": "true"
19
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
20
+ fill: "currentColor",
21
+ d: "M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"
22
+ })));
23
+ };
24
+
25
+ export { SvgChevronDownStroke as default };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'accordions.accordion';
11
+ const StyledAccordion = styled.div.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '8.76.1'
14
+ }).withConfig({
15
+ displayName: "StyledAccordion",
16
+ componentId: "sc-niv9ic-0"
17
+ })(["", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
18
+ StyledAccordion.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ export { StyledAccordion };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled, { css } from 'styled-components';
8
+ import { getLineHeight, retrieveComponentStyles, DEFAULT_THEME, getColorV8 } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'accordions.button';
11
+ const colorStyles = props => {
12
+ const showColor = props.isCollapsible || !props.isExpanded;
13
+ let color = getColorV8('foreground', 600 , props.theme);
14
+ if (showColor && props.isHovered) {
15
+ color = getColorV8('primaryHue', 600, props.theme);
16
+ }
17
+ return css(["color:", ";&:hover{cursor:", ";color:", ";}"], color, showColor && 'pointer', showColor && color);
18
+ };
19
+ const StyledButton = styled.button.attrs({
20
+ 'data-garden-id': COMPONENT_ID,
21
+ 'data-garden-version': '8.76.1'
22
+ }).withConfig({
23
+ displayName: "StyledButton",
24
+ 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.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
+ StyledButton.defaultProps = {
27
+ theme: DEFAULT_THEME
28
+ };
29
+
30
+ export { COMPONENT_ID, StyledButton };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled from 'styled-components';
8
+ import { focusStyles, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'accordions.header';
11
+ const StyledHeader = styled.div.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '8.76.1'
14
+ }).withConfig({
15
+ displayName: "StyledHeader",
16
+ componentId: "sc-2c6rbr-0"
17
+ })(["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({
18
+ theme: props.theme,
19
+ inset: true,
20
+ condition: props.isFocused,
21
+ selector: '&:focus-within'
22
+ }), props => retrieveComponentStyles(COMPONENT_ID, props));
23
+ StyledHeader.defaultProps = {
24
+ theme: DEFAULT_THEME
25
+ };
26
+
27
+ export { StyledHeader };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { StyledPanel } from './StyledPanel.js';
10
+
11
+ const COMPONENT_ID = 'accordions.step_inner_panel';
12
+ const StyledInnerPanel = styled.div.attrs({
13
+ 'data-garden-id': COMPONENT_ID,
14
+ 'data-garden-version': '8.76.1'
15
+ }).withConfig({
16
+ displayName: "StyledInnerPanel",
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.isAnimated && 'visibility 0s 0.25s', StyledPanel, props => retrieveComponentStyles(COMPONENT_ID, props));
19
+ StyledInnerPanel.defaultProps = {
20
+ theme: DEFAULT_THEME
21
+ };
22
+
23
+ export { StyledInnerPanel };
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled, { css } from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME, getColorV8, getLineHeight } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'accordions.panel';
11
+ const colorStyles = props => {
12
+ const {
13
+ theme,
14
+ isBare
15
+ } = props;
16
+ return css(["border-bottom-color:", ";"], isBare ? 'transparent' : getColorV8('neutralHue', 300, theme));
17
+ };
18
+ const sizeStyles = props => {
19
+ const {
20
+ theme,
21
+ isCompact,
22
+ isExpanded
23
+ } = props;
24
+ const {
25
+ base
26
+ } = theme.space;
27
+ let paddingTop = base * 2;
28
+ let paddingHorizontal = base * 5;
29
+ let paddingBottom = base * 8;
30
+ if (isCompact) {
31
+ paddingTop = base * 2;
32
+ paddingHorizontal = base * 3;
33
+ paddingBottom = base * 4;
34
+ }
35
+ if (isExpanded === false) {
36
+ paddingTop = 0;
37
+ paddingBottom = 0;
38
+ }
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);
40
+ };
41
+ const StyledPanel = styled.section.attrs({
42
+ 'data-garden-id': COMPONENT_ID,
43
+ 'data-garden-version': '8.76.1'
44
+ }).withConfig({
45
+ displayName: "StyledPanel",
46
+ componentId: "sc-1piryze-0"
47
+ })(["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
+ StyledPanel.defaultProps = {
49
+ isAnimated: true,
50
+ theme: DEFAULT_THEME
51
+ };
52
+
53
+ export { StyledPanel };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { cloneElement, Children } from 'react';
8
+ import styled, { css } from 'styled-components';
9
+ import { retrieveComponentStyles, DEFAULT_THEME, getColorV8 } from '@zendeskgarden/react-theming';
10
+
11
+ const COMPONENT_ID = 'accordions.rotate_icon';
12
+ const colorStyles = props => {
13
+ const showColor = props.isCollapsible || !props.isRotated;
14
+ let color = getColorV8('neutralHue', 600, props.theme);
15
+ if (showColor && props.isHovered) {
16
+ color = getColorV8('primaryHue', 600, props.theme);
17
+ }
18
+ return css(["color:", ";&:hover{color:", ";}"], color, showColor && color);
19
+ };
20
+ const StyledRotateIcon = styled(
21
+ _ref => {
22
+ let {
23
+ children,
24
+ isRotated,
25
+ isHovered,
26
+ isCompact,
27
+ isCollapsible,
28
+ ...props
29
+ } = _ref;
30
+ return cloneElement(Children.only(children), props);
31
+ }).attrs({
32
+ 'data-garden-id': COMPONENT_ID,
33
+ 'data-garden-version': '8.76.1'
34
+ }).withConfig({
35
+ displayName: "StyledRotateIcon",
36
+ componentId: "sc-hp435q-0"
37
+ })(["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));
38
+ StyledRotateIcon.defaultProps = {
39
+ theme: DEFAULT_THEME
40
+ };
41
+
42
+ export { StyledRotateIcon };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { StyledPanel } from './StyledPanel.js';
10
+
11
+ const COMPONENT_ID = 'accordions.section';
12
+ const StyledSection = styled.div.attrs({
13
+ 'data-garden-id': COMPONENT_ID,
14
+ 'data-garden-version': '8.76.1'
15
+ }).withConfig({
16
+ displayName: "StyledSection",
17
+ componentId: "sc-v2t9bd-0"
18
+ })(["&:last-child ", "{border:none;}", ";"], StyledPanel, props => retrieveComponentStyles(COMPONENT_ID, props));
19
+ StyledSection.defaultProps = {
20
+ theme: DEFAULT_THEME
21
+ };
22
+
23
+ export { StyledSection };
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled, { css } from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'accordions.step_content';
11
+ const sizeStyles = props => {
12
+ const {
13
+ rtl,
14
+ space
15
+ } = props.theme;
16
+ const paddingBottom = props.isActive ? space.base * 8 : space.base * 6;
17
+ const paddingRight = rtl ? space.base * 6 : space.base * 5;
18
+ const paddingLeft = rtl ? space.base * 5 : space.base * 6;
19
+ const marginRight = rtl ? space.base * 3 : '0';
20
+ const marginLeft = rtl ? '0' : space.base * 3;
21
+ const marginVertical = space.base * 3;
22
+ return css(["margin:", "px ", "px ", "px ", "px;padding:0 ", "px ", "px ", "px;min-width:", "px;height:auto;"], marginVertical, marginRight, marginVertical, marginLeft, paddingRight, paddingBottom, paddingLeft, space.base * 30);
23
+ };
24
+ const StyledContent = styled.div.attrs({
25
+ 'data-garden-id': COMPONENT_ID,
26
+ 'data-garden-version': '8.76.1'
27
+ }).withConfig({
28
+ displayName: "StyledContent",
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.isActive ? 1 : 0, sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
31
+ StyledContent.defaultProps = {
32
+ theme: DEFAULT_THEME
33
+ };
34
+
35
+ export { StyledContent };
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled, { css } from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME, getLineHeight, getColorV8 } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'accordions.step_icon';
11
+ const StyledIconFlexContainer = styled.div.withConfig({
12
+ displayName: "StyledIcon__StyledIconFlexContainer",
13
+ componentId: "sc-v20nz9-0"
14
+ })(["display:flex;flex-basis:100%;justify-content:center;width:100%;"]);
15
+ const sizeStyles = props => {
16
+ const size = `${props.theme.space.base * 6}px`;
17
+ const fontSize = props.theme.fontSizes.sm;
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
+ };
20
+ const colorStyles = props => {
21
+ return css(["background:", ";color:", ";"], props.isActive ? getColorV8('neutralHue', 600, props.theme) : getColorV8('neutralHue', 200, props.theme), props.isActive ? getColorV8('background', 600 , props.theme) : getColorV8('foreground', 600 , props.theme));
22
+ };
23
+ const StyledIcon = styled.div.attrs({
24
+ 'data-garden-id': COMPONENT_ID,
25
+ 'data-garden-version': '8.76.1'
26
+ }).withConfig({
27
+ displayName: "StyledIcon",
28
+ componentId: "sc-v20nz9-1"
29
+ })(["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
+
37
+ export { StyledIcon, StyledIconFlexContainer };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled from 'styled-components';
8
+ import { getLineHeight, getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'accordions.step_inner_content';
11
+ const StyledInnerContent = styled.div.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '8.76.1'
14
+ }).withConfig({
15
+ displayName: "StyledInnerContent",
16
+ componentId: "sc-1xs9fh7-0"
17
+ })(["overflow:hidden;line-height:", ";color:", ";font-size:", ";", ";"], props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => getColorV8('foreground', 600 , props.theme), props => props.theme.fontSizes.md, props => retrieveComponentStyles(COMPONENT_ID, props));
18
+ StyledInnerContent.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ export { StyledInnerContent };