@zendeskgarden/react-accordions 9.0.0-next.2 → 9.0.0-next.21

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 (64) hide show
  1. package/dist/esm/elements/accordion/Accordion.js +111 -0
  2. package/dist/esm/elements/accordion/components/Header.js +96 -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 +36 -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 +56 -0
  23. package/dist/esm/styled/accordion/StyledRotateIcon.js +36 -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 +61 -0
  27. package/dist/esm/styled/stepper/StyledInnerContent.js +30 -0
  28. package/dist/esm/styled/stepper/StyledLabel.js +31 -0
  29. package/dist/esm/styled/stepper/StyledLabelText.js +22 -0
  30. package/dist/esm/styled/stepper/StyledLine.js +30 -0
  31. package/dist/esm/styled/stepper/StyledStep.js +32 -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 +33 -0
  35. package/dist/esm/styled/timeline/StyledItemIcon.js +38 -0
  36. package/dist/esm/styled/timeline/StyledOppositeContent.js +22 -0
  37. package/dist/esm/styled/timeline/StyledSeparator.js +30 -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 +231 -179
  47. package/dist/typings/elements/timeline/components/Item.d.ts +0 -4
  48. package/dist/typings/index.d.ts +0 -2
  49. package/dist/typings/styled/accordion/StyledButton.d.ts +4 -4
  50. package/dist/typings/styled/accordion/StyledHeader.d.ts +2 -3
  51. package/dist/typings/styled/accordion/StyledInnerPanel.d.ts +1 -1
  52. package/dist/typings/styled/accordion/StyledPanel.d.ts +4 -4
  53. package/dist/typings/styled/accordion/StyledRotateIcon.d.ts +5 -2
  54. package/dist/typings/styled/stepper/StyledContent.d.ts +1 -1
  55. package/dist/typings/styled/stepper/StyledIcon.d.ts +2 -2
  56. package/dist/typings/styled/stepper/StyledLabel.d.ts +2 -2
  57. package/dist/typings/styled/stepper/StyledLabelText.d.ts +2 -2
  58. package/dist/typings/styled/stepper/StyledStep.d.ts +1 -1
  59. package/dist/typings/styled/stepper/StyledStepper.d.ts +1 -1
  60. package/dist/typings/styled/timeline/StyledItem.d.ts +2 -3
  61. package/dist/typings/styled/timeline/StyledItemIcon.d.ts +3 -2
  62. package/dist/typings/types/index.d.ts +4 -4
  63. package/package.json +8 -8
  64. 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() { 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
+ 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() { 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
+ 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() { 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
+ 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': '9.0.0-next.21'
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,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 styled, { css } from 'styled-components';
8
+ import { getLineHeight, retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'accordions.button';
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
+ });
23
+ return css(["color:", ";&:hover{cursor:", ";color:", ";}"], color, showColor && 'pointer', showColor && color);
24
+ };
25
+ const StyledButton = styled.button.attrs({
26
+ 'data-garden-id': COMPONENT_ID,
27
+ 'data-garden-version': '9.0.0-next.21'
28
+ }).withConfig({
29
+ displayName: "StyledButton",
30
+ componentId: "sc-xj3hy7-0"
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));
32
+ StyledButton.defaultProps = {
33
+ theme: DEFAULT_THEME
34
+ };
35
+
36
+ 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
+ import { StyledButton } from './StyledButton.js';
10
+
11
+ const COMPONENT_ID = 'accordions.header';
12
+ const StyledHeader = styled.div.attrs({
13
+ 'data-garden-id': COMPONENT_ID,
14
+ 'data-garden-version': '9.0.0-next.21'
15
+ }).withConfig({
16
+ displayName: "StyledHeader",
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.$isCollapsible || !props.$isExpanded) && 'pointer', props => focusStyles({
19
+ theme: props.theme,
20
+ inset: true,
21
+ selector: `&:has(${StyledButton}:focus-visible)`
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': '9.0.0-next.21'
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,56 @@
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, getColor, getLineHeight } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'accordions.panel';
11
+ const colorStyles = _ref => {
12
+ let {
13
+ theme,
14
+ $isBare
15
+ } = _ref;
16
+ return css(["border-bottom-color:", ";"], $isBare ? 'transparent' : getColor({
17
+ theme,
18
+ variable: 'border.default'
19
+ }));
20
+ };
21
+ const sizeStyles = props => {
22
+ const {
23
+ theme,
24
+ $isCompact,
25
+ $isExpanded
26
+ } = props;
27
+ const {
28
+ base
29
+ } = theme.space;
30
+ let paddingTop = base * 2;
31
+ let paddingHorizontal = base * 5;
32
+ let paddingBottom = base * 8;
33
+ if ($isCompact) {
34
+ paddingTop = base * 2;
35
+ paddingHorizontal = base * 3;
36
+ paddingBottom = base * 4;
37
+ }
38
+ if ($isExpanded === false) {
39
+ paddingTop = 0;
40
+ paddingBottom = 0;
41
+ }
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);
43
+ };
44
+ const StyledPanel = styled.section.attrs({
45
+ 'data-garden-id': COMPONENT_ID,
46
+ 'data-garden-version': '9.0.0-next.21'
47
+ }).withConfig({
48
+ displayName: "StyledPanel",
49
+ componentId: "sc-1piryze-0"
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));
51
+ StyledPanel.defaultProps = {
52
+ $isAnimated: true,
53
+ theme: DEFAULT_THEME
54
+ };
55
+
56
+ export { StyledPanel };
@@ -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 styled, { css } from 'styled-components';
8
+ import { StyledBaseIcon, retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'accordions.rotate_icon';
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
+ });
23
+ return css(["color:", ";&:hover{color:", ";}"], color, showColor && color);
24
+ };
25
+ const StyledRotateIcon = styled(StyledBaseIcon).attrs({
26
+ 'data-garden-id': COMPONENT_ID,
27
+ 'data-garden-version': '9.0.0-next.21'
28
+ }).withConfig({
29
+ displayName: "StyledRotateIcon",
30
+ componentId: "sc-hp435q-0"
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));
32
+ StyledRotateIcon.defaultProps = {
33
+ theme: DEFAULT_THEME
34
+ };
35
+
36
+ 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': '9.0.0-next.21'
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': '9.0.0-next.21'
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,61 @@
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, getColor } 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 = _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);
46
+ };
47
+ const StyledIcon = styled.div.attrs({
48
+ 'data-garden-id': COMPONENT_ID,
49
+ 'data-garden-version': '9.0.0-next.21'
50
+ }).withConfig({
51
+ displayName: "StyledIcon",
52
+ componentId: "sc-v20nz9-1"
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));
54
+ StyledIconFlexContainer.defaultProps = {
55
+ theme: DEFAULT_THEME
56
+ };
57
+ StyledIcon.defaultProps = {
58
+ theme: DEFAULT_THEME
59
+ };
60
+
61
+ export { StyledIcon, StyledIconFlexContainer };