@zendeskgarden/react-accordions 8.75.0 → 8.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,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_label';
11
+ const StyledLabel = styled.div.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '8.76.0'
14
+ }).withConfig({
15
+ displayName: "StyledLabel",
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.isHorizontal && 'flex', props => !props.isHorizontal && 'center', props => props.isHorizontal && 'center', props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.isActive ? getColorV8('foreground', 600 , props.theme) : getColorV8('neutralHue', 600, props.theme), props => props.theme.fontSizes.md, props => props.isActive && 600, props => retrieveComponentStyles(COMPONENT_ID, props));
18
+ StyledLabel.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ export { StyledLabel };
@@ -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 { DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'accordions.step_label_text';
11
+ const StyledLabelText = styled.div.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '8.76.0'
14
+ }).withConfig({
15
+ displayName: "StyledLabelText",
16
+ componentId: "sc-111m5zo-0"
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
+ StyledLabelText.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ export { StyledLabelText };
@@ -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 { getColorV8, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'accordions.step_line';
11
+ const StyledLine = styled.div.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '8.76.0'
14
+ }).withConfig({
15
+ displayName: "StyledLine",
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, props => getColorV8('neutralHue', 300, props.theme));
18
+ StyledLine.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ export { StyledLine };
@@ -0,0 +1,24 @@
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 { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { StyledContent } from './StyledContent.js';
10
+ import { StyledLine } from './StyledLine.js';
11
+
12
+ const COMPONENT_ID = 'accordions.step';
13
+ const StyledStep = styled.li.attrs({
14
+ 'data-garden-id': COMPONENT_ID,
15
+ 'data-garden-version': '8.76.0'
16
+ }).withConfig({
17
+ displayName: "StyledStep",
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.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, props => getColorV8('neutralHue', 300, props.theme), props => retrieveComponentStyles(COMPONENT_ID, props));
20
+ StyledStep.defaultProps = {
21
+ theme: DEFAULT_THEME
22
+ };
23
+
24
+ export { StyledStep };
@@ -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.stepper';
11
+ const StyledStepper = styled.ol.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '8.76.0'
14
+ }).withConfig({
15
+ displayName: "StyledStepper",
16
+ componentId: "sc-dsxw0f-0"
17
+ })(["display:", ";margin:0;padding:0;list-style:none;", ";"], props => props.isHorizontal && 'flex', props => retrieveComponentStyles(COMPONENT_ID, props));
18
+ StyledStepper.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ export { StyledStepper };
@@ -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 = 'timeline.content';
11
+ const StyledTimelineContent = styled.div.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '8.76.0'
14
+ }).withConfig({
15
+ displayName: "StyledContent__StyledTimelineContent",
16
+ componentId: "sc-19phgu1-0"
17
+ })(["flex:1;padding:", ";", ";"], props => `${props.theme.space.base * 5}px ${props.theme.space.base * 4}px`, props => retrieveComponentStyles(COMPONENT_ID, props));
18
+ StyledTimelineContent.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ export { StyledTimelineContent };
@@ -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 styled, { css } from 'styled-components';
8
+ import { getLineHeight, getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { StyledSeparator } from './StyledSeparator.js';
10
+ import { StyledTimelineContent } from './StyledContent.js';
11
+ import { StyledOppositeContent } from './StyledOppositeContent.js';
12
+
13
+ const COMPONENT_ID = 'timeline.item';
14
+ const StyledTimelineItem = styled.li.attrs({
15
+ 'data-garden-id': COMPONENT_ID,
16
+ 'data-garden-version': '8.76.0'
17
+ }).withConfig({
18
+ displayName: "StyledItem__StyledTimelineItem",
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), props => getColorV8('foreground', 600 , props.theme), 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
+ StyledTimelineItem.defaultProps = {
22
+ theme: DEFAULT_THEME
23
+ };
24
+
25
+ export { StyledTimelineItem };
@@ -0,0 +1,31 @@
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 from 'styled-components';
9
+ import { math } from 'polished';
10
+ import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
11
+
12
+ const COMPONENT_ID = 'timeline.icon';
13
+ const StyledItemIcon = styled(_ref => {
14
+ let {
15
+ surfaceColor,
16
+ children,
17
+ ...props
18
+ } = _ref;
19
+ return cloneElement(Children.only(children), props);
20
+ }).attrs({
21
+ 'data-garden-id': COMPONENT_ID,
22
+ 'data-garden-version': '8.76.0'
23
+ }).withConfig({
24
+ displayName: "StyledItemIcon",
25
+ componentId: "sc-vz2l6e-0"
26
+ })(["z-index:1;box-sizing:content-box;background-color:", ";padding:", "px 0;width:", ";height:", ";color:", ";", ";"], props => props.surfaceColor || getColorV8('background', 600 , props.theme), props => props.theme.space.base, props => math(`${props.theme.iconSizes.sm} + 1`), props => math(`${props.theme.iconSizes.sm} + 1`), props => getColorV8('neutralHue', 600, props.theme), props => retrieveComponentStyles(COMPONENT_ID, props));
27
+ StyledItemIcon.defaultProps = {
28
+ theme: DEFAULT_THEME
29
+ };
30
+
31
+ export { StyledItemIcon };
@@ -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 = 'timeline.opposite.content';
11
+ const StyledOppositeContent = styled.div.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '8.76.0'
14
+ }).withConfig({
15
+ displayName: "StyledOppositeContent",
16
+ componentId: "sc-jurh2k-0"
17
+ })(["flex:1;padding:", ";text-align:", ";", ";"], props => `${props.theme.space.base * 5}px ${props.theme.space.base * 4}px`, props => props.theme.rtl ? 'left' : 'right', props => retrieveComponentStyles(COMPONENT_ID, props));
18
+ StyledOppositeContent.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ export { StyledOppositeContent };
@@ -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 { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'timeline.content.separator';
11
+ const StyledSeparator = styled.div.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '8.76.0'
14
+ }).withConfig({
15
+ displayName: "StyledSeparator",
16
+ componentId: "sc-fki51e-0"
17
+ })(["display:flex;position:relative;justify-content:center;padding:", ";&::after{position:absolute;border-left:", ";height:100%;content:'';}", ";"], props => `${props.theme.space.base * 5}px ${props.theme.space.base}px`, props => `${props.theme.borders.sm} ${getColorV8('neutralHue', 600, props.theme)}`, props => retrieveComponentStyles(COMPONENT_ID, props));
18
+ StyledSeparator.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ export { StyledSeparator };
@@ -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 = 'timeline';
11
+ const StyledTimeline = styled.ol.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '8.76.0'
14
+ }).withConfig({
15
+ displayName: "StyledTimeline",
16
+ componentId: "sc-pig5kv-0"
17
+ })(["margin:0;padding:0;list-style:none;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
18
+ StyledTimeline.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ export { StyledTimeline };
@@ -0,0 +1,18 @@
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 { createContext, useContext } from 'react';
8
+
9
+ const AccordionContext = createContext(undefined);
10
+ const useAccordionContext = () => {
11
+ const context = useContext(AccordionContext);
12
+ if (context === undefined) {
13
+ throw new Error('This component must be rendered within a Accordion component');
14
+ }
15
+ return context;
16
+ };
17
+
18
+ export { AccordionContext, useAccordionContext };
@@ -0,0 +1,18 @@
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 { createContext, useContext } from 'react';
8
+
9
+ const HeaderContext = createContext(undefined);
10
+ const useHeaderContext = () => {
11
+ const context = useContext(HeaderContext);
12
+ if (context === undefined) {
13
+ throw new Error('This component must be rendered within a Accordion.Header component');
14
+ }
15
+ return context;
16
+ };
17
+
18
+ export { HeaderContext, useHeaderContext };
@@ -0,0 +1,18 @@
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 { createContext, useContext } from 'react';
8
+
9
+ const SectionContext = createContext(undefined);
10
+ const useSectionContext = () => {
11
+ const context = useContext(SectionContext);
12
+ if (context === undefined) {
13
+ throw new Error('This component must be rendered within an Accordion component');
14
+ }
15
+ return context;
16
+ };
17
+
18
+ export { SectionContext, useSectionContext };
@@ -0,0 +1,18 @@
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 { createContext, useContext } from 'react';
8
+
9
+ const StepContext = createContext(undefined);
10
+ const useStepContext = () => {
11
+ const context = useContext(StepContext);
12
+ if (context === undefined) {
13
+ throw new Error('This component must be rendered within a Stepper component');
14
+ }
15
+ return context;
16
+ };
17
+
18
+ export { StepContext, useStepContext };
@@ -0,0 +1,18 @@
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 { createContext, useContext } from 'react';
8
+
9
+ const StepperContext = createContext(undefined);
10
+ const useStepperContext = () => {
11
+ const context = useContext(StepperContext);
12
+ if (context === undefined) {
13
+ throw new Error('This component must be rendered within a Stepper component');
14
+ }
15
+ return context;
16
+ };
17
+
18
+ export { StepperContext, useStepperContext };
@@ -0,0 +1,18 @@
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 { createContext, useContext } from 'react';
8
+
9
+ const TimelineContext = createContext(undefined);
10
+ const useTimelineContext = () => {
11
+ const context = useContext(TimelineContext);
12
+ if (context === undefined) {
13
+ throw new Error('This component must be rendered within a Timeline component');
14
+ }
15
+ return context;
16
+ };
17
+
18
+ export { TimelineContext, useTimelineContext };
@@ -0,0 +1,18 @@
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 { createContext, useContext } from 'react';
8
+
9
+ const TimelineItemContext = createContext(undefined);
10
+ const useTimelineItemContext = () => {
11
+ const context = useContext(TimelineItemContext);
12
+ if (context === undefined) {
13
+ throw new Error('This component must be rendered within a Timeline.Item component');
14
+ }
15
+ return context;
16
+ };
17
+
18
+ export { TimelineItemContext, useTimelineItemContext };