@zendeskgarden/react-accordions 8.59.0 → 8.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +55 -44
- package/dist/index.esm.js +58 -47
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -77,7 +77,7 @@ const sizeStyles$1 = props => {
|
|
|
77
77
|
};
|
|
78
78
|
const StyledContent = styled__default["default"].div.attrs({
|
|
79
79
|
'data-garden-id': COMPONENT_ID$k,
|
|
80
|
-
'data-garden-version': '8.
|
|
80
|
+
'data-garden-version': '8.60.0'
|
|
81
81
|
}).withConfig({
|
|
82
82
|
displayName: "StyledContent",
|
|
83
83
|
componentId: "sc-mazvvo-0"
|
|
@@ -89,7 +89,7 @@ StyledContent.defaultProps = {
|
|
|
89
89
|
const COMPONENT_ID$j = 'accordions.step_line';
|
|
90
90
|
const StyledLine = styled__default["default"].div.attrs({
|
|
91
91
|
'data-garden-id': COMPONENT_ID$j,
|
|
92
|
-
'data-garden-version': '8.
|
|
92
|
+
'data-garden-version': '8.60.0'
|
|
93
93
|
}).withConfig({
|
|
94
94
|
displayName: "StyledLine",
|
|
95
95
|
componentId: "sc-1gkpjbr-0"
|
|
@@ -101,7 +101,7 @@ StyledLine.defaultProps = {
|
|
|
101
101
|
const COMPONENT_ID$i = 'accordions.step';
|
|
102
102
|
const StyledStep = styled__default["default"].li.attrs({
|
|
103
103
|
'data-garden-id': COMPONENT_ID$i,
|
|
104
|
-
'data-garden-version': '8.
|
|
104
|
+
'data-garden-version': '8.60.0'
|
|
105
105
|
}).withConfig({
|
|
106
106
|
displayName: "StyledStep",
|
|
107
107
|
componentId: "sc-12fiwtz-0"
|
|
@@ -113,7 +113,7 @@ StyledStep.defaultProps = {
|
|
|
113
113
|
const COMPONENT_ID$h = 'accordions.step_inner_content';
|
|
114
114
|
const StyledInnerContent = styled__default["default"].div.attrs({
|
|
115
115
|
'data-garden-id': COMPONENT_ID$h,
|
|
116
|
-
'data-garden-version': '8.
|
|
116
|
+
'data-garden-version': '8.60.0'
|
|
117
117
|
}).withConfig({
|
|
118
118
|
displayName: "StyledInnerContent",
|
|
119
119
|
componentId: "sc-1xs9fh7-0"
|
|
@@ -125,7 +125,7 @@ StyledInnerContent.defaultProps = {
|
|
|
125
125
|
const COMPONENT_ID$g = 'accordions.stepper';
|
|
126
126
|
const StyledStepper = styled__default["default"].ol.attrs({
|
|
127
127
|
'data-garden-id': COMPONENT_ID$g,
|
|
128
|
-
'data-garden-version': '8.
|
|
128
|
+
'data-garden-version': '8.60.0'
|
|
129
129
|
}).withConfig({
|
|
130
130
|
displayName: "StyledStepper",
|
|
131
131
|
componentId: "sc-dsxw0f-0"
|
|
@@ -149,7 +149,7 @@ const colorStyles$2 = props => {
|
|
|
149
149
|
};
|
|
150
150
|
const StyledIcon = styled__default["default"].div.attrs({
|
|
151
151
|
'data-garden-id': COMPONENT_ID$f,
|
|
152
|
-
'data-garden-version': '8.
|
|
152
|
+
'data-garden-version': '8.60.0'
|
|
153
153
|
}).withConfig({
|
|
154
154
|
displayName: "StyledIcon",
|
|
155
155
|
componentId: "sc-v20nz9-1"
|
|
@@ -164,7 +164,7 @@ StyledIcon.defaultProps = {
|
|
|
164
164
|
const COMPONENT_ID$e = 'accordions.step_label';
|
|
165
165
|
const StyledLabel = styled__default["default"].div.attrs({
|
|
166
166
|
'data-garden-id': COMPONENT_ID$e,
|
|
167
|
-
'data-garden-version': '8.
|
|
167
|
+
'data-garden-version': '8.60.0'
|
|
168
168
|
}).withConfig({
|
|
169
169
|
displayName: "StyledLabel",
|
|
170
170
|
componentId: "sc-1o82llj-0"
|
|
@@ -176,7 +176,7 @@ StyledLabel.defaultProps = {
|
|
|
176
176
|
const COMPONENT_ID$d = 'accordions.step_label_text';
|
|
177
177
|
const StyledLabelText = styled__default["default"].div.attrs({
|
|
178
178
|
'data-garden-id': COMPONENT_ID$d,
|
|
179
|
-
'data-garden-version': '8.
|
|
179
|
+
'data-garden-version': '8.60.0'
|
|
180
180
|
}).withConfig({
|
|
181
181
|
displayName: "StyledLabelText",
|
|
182
182
|
componentId: "sc-111m5zo-0"
|
|
@@ -188,7 +188,7 @@ StyledLabelText.defaultProps = {
|
|
|
188
188
|
const COMPONENT_ID$c = 'accordions.accordion';
|
|
189
189
|
const StyledAccordion = styled__default["default"].div.attrs({
|
|
190
190
|
'data-garden-id': COMPONENT_ID$c,
|
|
191
|
-
'data-garden-version': '8.
|
|
191
|
+
'data-garden-version': '8.60.0'
|
|
192
192
|
}).withConfig({
|
|
193
193
|
displayName: "StyledAccordion",
|
|
194
194
|
componentId: "sc-niv9ic-0"
|
|
@@ -218,7 +218,7 @@ const paddingStyles = props => {
|
|
|
218
218
|
};
|
|
219
219
|
const StyledPanel = styled__default["default"].section.attrs({
|
|
220
220
|
'data-garden-id': COMPONENT_ID$b,
|
|
221
|
-
'data-garden-version': '8.
|
|
221
|
+
'data-garden-version': '8.60.0'
|
|
222
222
|
}).withConfig({
|
|
223
223
|
displayName: "StyledPanel",
|
|
224
224
|
componentId: "sc-1piryze-0"
|
|
@@ -231,7 +231,7 @@ StyledPanel.defaultProps = {
|
|
|
231
231
|
const COMPONENT_ID$a = 'accordions.section';
|
|
232
232
|
const StyledSection = styled__default["default"].div.attrs({
|
|
233
233
|
'data-garden-id': COMPONENT_ID$a,
|
|
234
|
-
'data-garden-version': '8.
|
|
234
|
+
'data-garden-version': '8.60.0'
|
|
235
235
|
}).withConfig({
|
|
236
236
|
displayName: "StyledSection",
|
|
237
237
|
componentId: "sc-v2t9bd-0"
|
|
@@ -243,7 +243,7 @@ StyledSection.defaultProps = {
|
|
|
243
243
|
const COMPONENT_ID$9 = 'accordions.header';
|
|
244
244
|
const StyledHeader = styled__default["default"].div.attrs({
|
|
245
245
|
'data-garden-id': COMPONENT_ID$9,
|
|
246
|
-
'data-garden-version': '8.
|
|
246
|
+
'data-garden-version': '8.60.0'
|
|
247
247
|
}).withConfig({
|
|
248
248
|
displayName: "StyledHeader",
|
|
249
249
|
componentId: "sc-2c6rbr-0"
|
|
@@ -263,7 +263,7 @@ const colorStyles$1 = props => {
|
|
|
263
263
|
};
|
|
264
264
|
const StyledButton = styled__default["default"].button.attrs({
|
|
265
265
|
'data-garden-id': COMPONENT_ID$8,
|
|
266
|
-
'data-garden-version': '8.
|
|
266
|
+
'data-garden-version': '8.60.0'
|
|
267
267
|
}).withConfig({
|
|
268
268
|
displayName: "StyledButton",
|
|
269
269
|
componentId: "sc-xj3hy7-0"
|
|
@@ -275,7 +275,7 @@ StyledButton.defaultProps = {
|
|
|
275
275
|
const COMPONENT_ID$7 = 'accordions.step_inner_panel';
|
|
276
276
|
const StyledInnerPanel = styled__default["default"].div.attrs({
|
|
277
277
|
'data-garden-id': COMPONENT_ID$7,
|
|
278
|
-
'data-garden-version': '8.
|
|
278
|
+
'data-garden-version': '8.60.0'
|
|
279
279
|
}).withConfig({
|
|
280
280
|
displayName: "StyledInnerPanel",
|
|
281
281
|
componentId: "sc-8nbueg-0"
|
|
@@ -307,7 +307,7 @@ _ref => {
|
|
|
307
307
|
return React.cloneElement(React.Children.only(children), props);
|
|
308
308
|
}).attrs({
|
|
309
309
|
'data-garden-id': COMPONENT_ID$6,
|
|
310
|
-
'data-garden-version': '8.
|
|
310
|
+
'data-garden-version': '8.60.0'
|
|
311
311
|
}).withConfig({
|
|
312
312
|
displayName: "StyledRotateIcon",
|
|
313
313
|
componentId: "sc-hp435q-0"
|
|
@@ -319,7 +319,7 @@ StyledRotateIcon.defaultProps = {
|
|
|
319
319
|
const COMPONENT_ID$5 = 'timeline';
|
|
320
320
|
const StyledTimeline = styled__default["default"].ol.attrs({
|
|
321
321
|
'data-garden-id': COMPONENT_ID$5,
|
|
322
|
-
'data-garden-version': '8.
|
|
322
|
+
'data-garden-version': '8.60.0'
|
|
323
323
|
}).withConfig({
|
|
324
324
|
displayName: "StyledTimeline",
|
|
325
325
|
componentId: "sc-pig5kv-0"
|
|
@@ -331,7 +331,7 @@ StyledTimeline.defaultProps = {
|
|
|
331
331
|
const COMPONENT_ID$4 = 'timeline.content.separator';
|
|
332
332
|
const StyledSeparator = styled__default["default"].div.attrs({
|
|
333
333
|
'data-garden-id': COMPONENT_ID$4,
|
|
334
|
-
'data-garden-version': '8.
|
|
334
|
+
'data-garden-version': '8.60.0'
|
|
335
335
|
}).withConfig({
|
|
336
336
|
displayName: "StyledSeparator",
|
|
337
337
|
componentId: "sc-fki51e-0"
|
|
@@ -343,7 +343,7 @@ StyledSeparator.defaultProps = {
|
|
|
343
343
|
const COMPONENT_ID$3 = 'timeline.content';
|
|
344
344
|
const StyledTimelineContent = styled__default["default"].div.attrs({
|
|
345
345
|
'data-garden-id': COMPONENT_ID$3,
|
|
346
|
-
'data-garden-version': '8.
|
|
346
|
+
'data-garden-version': '8.60.0'
|
|
347
347
|
}).withConfig({
|
|
348
348
|
displayName: "StyledContent__StyledTimelineContent",
|
|
349
349
|
componentId: "sc-19phgu1-0"
|
|
@@ -355,7 +355,7 @@ StyledTimelineContent.defaultProps = {
|
|
|
355
355
|
const COMPONENT_ID$2 = 'timeline.opposite.content';
|
|
356
356
|
const StyledOppositeContent = styled__default["default"].div.attrs({
|
|
357
357
|
'data-garden-id': COMPONENT_ID$2,
|
|
358
|
-
'data-garden-version': '8.
|
|
358
|
+
'data-garden-version': '8.60.0'
|
|
359
359
|
}).withConfig({
|
|
360
360
|
displayName: "StyledOppositeContent",
|
|
361
361
|
componentId: "sc-jurh2k-0"
|
|
@@ -367,7 +367,7 @@ StyledOppositeContent.defaultProps = {
|
|
|
367
367
|
const COMPONENT_ID$1 = 'timeline.item';
|
|
368
368
|
const StyledTimelineItem = styled__default["default"].li.attrs({
|
|
369
369
|
'data-garden-id': COMPONENT_ID$1,
|
|
370
|
-
'data-garden-version': '8.
|
|
370
|
+
'data-garden-version': '8.60.0'
|
|
371
371
|
}).withConfig({
|
|
372
372
|
displayName: "StyledItem__StyledTimelineItem",
|
|
373
373
|
componentId: "sc-5mcnzm-0"
|
|
@@ -386,7 +386,7 @@ const StyledItemIcon = styled__default["default"](_ref => {
|
|
|
386
386
|
return React.cloneElement(React.Children.only(children), props);
|
|
387
387
|
}).attrs({
|
|
388
388
|
'data-garden-id': COMPONENT_ID,
|
|
389
|
-
'data-garden-version': '8.
|
|
389
|
+
'data-garden-version': '8.60.0'
|
|
390
390
|
}).withConfig({
|
|
391
391
|
displayName: "StyledItemIcon",
|
|
392
392
|
componentId: "sc-vz2l6e-0"
|
|
@@ -597,22 +597,29 @@ const PanelComponent = React.forwardRef((props, ref) => {
|
|
|
597
597
|
const panelRef = React.useRef();
|
|
598
598
|
const index = useSectionContext();
|
|
599
599
|
const isExpanded = expandedSections.includes(index);
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
child.style.maxHeight = `${child.scrollHeight}px`;
|
|
604
|
-
}
|
|
605
|
-
}, 100), [panelRef]);
|
|
606
|
-
React__default["default"].useEffect(() => {
|
|
600
|
+
const theme = React.useContext(styled.ThemeContext);
|
|
601
|
+
const environment = reactTheming.useDocument(theme);
|
|
602
|
+
React.useEffect(() => {
|
|
607
603
|
if (!isAnimated) {
|
|
608
604
|
return undefined;
|
|
609
605
|
}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
606
|
+
if (environment) {
|
|
607
|
+
const updateMaxHeight = debounce__default["default"](() => {
|
|
608
|
+
if (panelRef.current) {
|
|
609
|
+
const child = panelRef.current.children[0];
|
|
610
|
+
child.style.maxHeight = `${child.scrollHeight}px`;
|
|
611
|
+
}
|
|
612
|
+
}, 100);
|
|
613
|
+
const win = environment.defaultView || window;
|
|
614
|
+
win.addEventListener('resize', updateMaxHeight);
|
|
615
|
+
updateMaxHeight();
|
|
616
|
+
return () => {
|
|
617
|
+
updateMaxHeight.cancel();
|
|
618
|
+
win.removeEventListener('resize', updateMaxHeight);
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
return undefined;
|
|
622
|
+
}, [isAnimated, panelRef, environment, props.children]);
|
|
616
623
|
return React__default["default"].createElement(StyledPanel, getPanelProps({
|
|
617
624
|
role: null,
|
|
618
625
|
ref: mergeRefs__default["default"]([panelRef, ref]),
|
|
@@ -788,22 +795,26 @@ const ContentComponent$1 = React.forwardRef((props, ref) => {
|
|
|
788
795
|
currentStepIndex
|
|
789
796
|
} = useStepContext();
|
|
790
797
|
const isActive = currentStepIndex === activeIndex;
|
|
791
|
-
const
|
|
792
|
-
|
|
793
|
-
const child = contentRef.current.children[0];
|
|
794
|
-
child.style.maxHeight = `${child.scrollHeight}px`;
|
|
795
|
-
}
|
|
796
|
-
}, 100), [contentRef]);
|
|
798
|
+
const theme = React.useContext(styled.ThemeContext);
|
|
799
|
+
const environment = reactTheming.useDocument(theme);
|
|
797
800
|
React.useEffect(() => {
|
|
798
|
-
if (isActive && isHorizontal === false) {
|
|
799
|
-
|
|
801
|
+
if (environment && isActive && isHorizontal === false) {
|
|
802
|
+
const win = environment.defaultView || window;
|
|
803
|
+
const updateMaxHeight = debounce__default["default"](() => {
|
|
804
|
+
if (contentRef.current) {
|
|
805
|
+
const child = contentRef.current.children[0];
|
|
806
|
+
child.style.maxHeight = `${child.scrollHeight}px`;
|
|
807
|
+
}
|
|
808
|
+
}, 100);
|
|
809
|
+
win.addEventListener('resize', updateMaxHeight);
|
|
800
810
|
updateMaxHeight();
|
|
801
811
|
return () => {
|
|
802
|
-
|
|
812
|
+
updateMaxHeight.cancel();
|
|
813
|
+
win.removeEventListener('resize', updateMaxHeight);
|
|
803
814
|
};
|
|
804
815
|
}
|
|
805
816
|
return undefined;
|
|
806
|
-
}, [isActive, isHorizontal,
|
|
817
|
+
}, [isActive, isHorizontal, contentRef, environment]);
|
|
807
818
|
return isHorizontal === false ? React__default["default"].createElement(StyledContent, _extends$3({
|
|
808
819
|
ref: mergeRefs__default["default"]([contentRef, ref]),
|
|
809
820
|
isActive: isActive
|
package/dist/index.esm.js
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import * as React from 'react';
|
|
9
|
-
import React__default, { cloneElement, Children, createContext, useContext, forwardRef, useRef, useState, useMemo,
|
|
9
|
+
import React__default, { cloneElement, Children, createContext, useContext, forwardRef, useRef, useState, useMemo, useEffect, useLayoutEffect } from 'react';
|
|
10
10
|
import { useAccordion } from '@zendeskgarden/container-accordion';
|
|
11
|
-
import styled, { css } from 'styled-components';
|
|
12
|
-
import { retrieveComponentStyles, DEFAULT_THEME, getColor, getLineHeight } from '@zendeskgarden/react-theming';
|
|
11
|
+
import styled, { css, ThemeContext } from 'styled-components';
|
|
12
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor, getLineHeight, useDocument } from '@zendeskgarden/react-theming';
|
|
13
13
|
import { math } from 'polished';
|
|
14
14
|
import { composeEventHandlers } from '@zendeskgarden/container-utilities';
|
|
15
15
|
import debounce from 'lodash.debounce';
|
|
@@ -47,7 +47,7 @@ const sizeStyles$1 = props => {
|
|
|
47
47
|
};
|
|
48
48
|
const StyledContent = styled.div.attrs({
|
|
49
49
|
'data-garden-id': COMPONENT_ID$k,
|
|
50
|
-
'data-garden-version': '8.
|
|
50
|
+
'data-garden-version': '8.60.0'
|
|
51
51
|
}).withConfig({
|
|
52
52
|
displayName: "StyledContent",
|
|
53
53
|
componentId: "sc-mazvvo-0"
|
|
@@ -59,7 +59,7 @@ StyledContent.defaultProps = {
|
|
|
59
59
|
const COMPONENT_ID$j = 'accordions.step_line';
|
|
60
60
|
const StyledLine = styled.div.attrs({
|
|
61
61
|
'data-garden-id': COMPONENT_ID$j,
|
|
62
|
-
'data-garden-version': '8.
|
|
62
|
+
'data-garden-version': '8.60.0'
|
|
63
63
|
}).withConfig({
|
|
64
64
|
displayName: "StyledLine",
|
|
65
65
|
componentId: "sc-1gkpjbr-0"
|
|
@@ -71,7 +71,7 @@ StyledLine.defaultProps = {
|
|
|
71
71
|
const COMPONENT_ID$i = 'accordions.step';
|
|
72
72
|
const StyledStep = styled.li.attrs({
|
|
73
73
|
'data-garden-id': COMPONENT_ID$i,
|
|
74
|
-
'data-garden-version': '8.
|
|
74
|
+
'data-garden-version': '8.60.0'
|
|
75
75
|
}).withConfig({
|
|
76
76
|
displayName: "StyledStep",
|
|
77
77
|
componentId: "sc-12fiwtz-0"
|
|
@@ -83,7 +83,7 @@ StyledStep.defaultProps = {
|
|
|
83
83
|
const COMPONENT_ID$h = 'accordions.step_inner_content';
|
|
84
84
|
const StyledInnerContent = styled.div.attrs({
|
|
85
85
|
'data-garden-id': COMPONENT_ID$h,
|
|
86
|
-
'data-garden-version': '8.
|
|
86
|
+
'data-garden-version': '8.60.0'
|
|
87
87
|
}).withConfig({
|
|
88
88
|
displayName: "StyledInnerContent",
|
|
89
89
|
componentId: "sc-1xs9fh7-0"
|
|
@@ -95,7 +95,7 @@ StyledInnerContent.defaultProps = {
|
|
|
95
95
|
const COMPONENT_ID$g = 'accordions.stepper';
|
|
96
96
|
const StyledStepper = styled.ol.attrs({
|
|
97
97
|
'data-garden-id': COMPONENT_ID$g,
|
|
98
|
-
'data-garden-version': '8.
|
|
98
|
+
'data-garden-version': '8.60.0'
|
|
99
99
|
}).withConfig({
|
|
100
100
|
displayName: "StyledStepper",
|
|
101
101
|
componentId: "sc-dsxw0f-0"
|
|
@@ -119,7 +119,7 @@ const colorStyles$2 = props => {
|
|
|
119
119
|
};
|
|
120
120
|
const StyledIcon = styled.div.attrs({
|
|
121
121
|
'data-garden-id': COMPONENT_ID$f,
|
|
122
|
-
'data-garden-version': '8.
|
|
122
|
+
'data-garden-version': '8.60.0'
|
|
123
123
|
}).withConfig({
|
|
124
124
|
displayName: "StyledIcon",
|
|
125
125
|
componentId: "sc-v20nz9-1"
|
|
@@ -134,7 +134,7 @@ StyledIcon.defaultProps = {
|
|
|
134
134
|
const COMPONENT_ID$e = 'accordions.step_label';
|
|
135
135
|
const StyledLabel = styled.div.attrs({
|
|
136
136
|
'data-garden-id': COMPONENT_ID$e,
|
|
137
|
-
'data-garden-version': '8.
|
|
137
|
+
'data-garden-version': '8.60.0'
|
|
138
138
|
}).withConfig({
|
|
139
139
|
displayName: "StyledLabel",
|
|
140
140
|
componentId: "sc-1o82llj-0"
|
|
@@ -146,7 +146,7 @@ StyledLabel.defaultProps = {
|
|
|
146
146
|
const COMPONENT_ID$d = 'accordions.step_label_text';
|
|
147
147
|
const StyledLabelText = styled.div.attrs({
|
|
148
148
|
'data-garden-id': COMPONENT_ID$d,
|
|
149
|
-
'data-garden-version': '8.
|
|
149
|
+
'data-garden-version': '8.60.0'
|
|
150
150
|
}).withConfig({
|
|
151
151
|
displayName: "StyledLabelText",
|
|
152
152
|
componentId: "sc-111m5zo-0"
|
|
@@ -158,7 +158,7 @@ StyledLabelText.defaultProps = {
|
|
|
158
158
|
const COMPONENT_ID$c = 'accordions.accordion';
|
|
159
159
|
const StyledAccordion = styled.div.attrs({
|
|
160
160
|
'data-garden-id': COMPONENT_ID$c,
|
|
161
|
-
'data-garden-version': '8.
|
|
161
|
+
'data-garden-version': '8.60.0'
|
|
162
162
|
}).withConfig({
|
|
163
163
|
displayName: "StyledAccordion",
|
|
164
164
|
componentId: "sc-niv9ic-0"
|
|
@@ -188,7 +188,7 @@ const paddingStyles = props => {
|
|
|
188
188
|
};
|
|
189
189
|
const StyledPanel = styled.section.attrs({
|
|
190
190
|
'data-garden-id': COMPONENT_ID$b,
|
|
191
|
-
'data-garden-version': '8.
|
|
191
|
+
'data-garden-version': '8.60.0'
|
|
192
192
|
}).withConfig({
|
|
193
193
|
displayName: "StyledPanel",
|
|
194
194
|
componentId: "sc-1piryze-0"
|
|
@@ -201,7 +201,7 @@ StyledPanel.defaultProps = {
|
|
|
201
201
|
const COMPONENT_ID$a = 'accordions.section';
|
|
202
202
|
const StyledSection = styled.div.attrs({
|
|
203
203
|
'data-garden-id': COMPONENT_ID$a,
|
|
204
|
-
'data-garden-version': '8.
|
|
204
|
+
'data-garden-version': '8.60.0'
|
|
205
205
|
}).withConfig({
|
|
206
206
|
displayName: "StyledSection",
|
|
207
207
|
componentId: "sc-v2t9bd-0"
|
|
@@ -213,7 +213,7 @@ StyledSection.defaultProps = {
|
|
|
213
213
|
const COMPONENT_ID$9 = 'accordions.header';
|
|
214
214
|
const StyledHeader = styled.div.attrs({
|
|
215
215
|
'data-garden-id': COMPONENT_ID$9,
|
|
216
|
-
'data-garden-version': '8.
|
|
216
|
+
'data-garden-version': '8.60.0'
|
|
217
217
|
}).withConfig({
|
|
218
218
|
displayName: "StyledHeader",
|
|
219
219
|
componentId: "sc-2c6rbr-0"
|
|
@@ -233,7 +233,7 @@ const colorStyles$1 = props => {
|
|
|
233
233
|
};
|
|
234
234
|
const StyledButton = styled.button.attrs({
|
|
235
235
|
'data-garden-id': COMPONENT_ID$8,
|
|
236
|
-
'data-garden-version': '8.
|
|
236
|
+
'data-garden-version': '8.60.0'
|
|
237
237
|
}).withConfig({
|
|
238
238
|
displayName: "StyledButton",
|
|
239
239
|
componentId: "sc-xj3hy7-0"
|
|
@@ -245,7 +245,7 @@ StyledButton.defaultProps = {
|
|
|
245
245
|
const COMPONENT_ID$7 = 'accordions.step_inner_panel';
|
|
246
246
|
const StyledInnerPanel = styled.div.attrs({
|
|
247
247
|
'data-garden-id': COMPONENT_ID$7,
|
|
248
|
-
'data-garden-version': '8.
|
|
248
|
+
'data-garden-version': '8.60.0'
|
|
249
249
|
}).withConfig({
|
|
250
250
|
displayName: "StyledInnerPanel",
|
|
251
251
|
componentId: "sc-8nbueg-0"
|
|
@@ -277,7 +277,7 @@ _ref => {
|
|
|
277
277
|
return cloneElement(Children.only(children), props);
|
|
278
278
|
}).attrs({
|
|
279
279
|
'data-garden-id': COMPONENT_ID$6,
|
|
280
|
-
'data-garden-version': '8.
|
|
280
|
+
'data-garden-version': '8.60.0'
|
|
281
281
|
}).withConfig({
|
|
282
282
|
displayName: "StyledRotateIcon",
|
|
283
283
|
componentId: "sc-hp435q-0"
|
|
@@ -289,7 +289,7 @@ StyledRotateIcon.defaultProps = {
|
|
|
289
289
|
const COMPONENT_ID$5 = 'timeline';
|
|
290
290
|
const StyledTimeline = styled.ol.attrs({
|
|
291
291
|
'data-garden-id': COMPONENT_ID$5,
|
|
292
|
-
'data-garden-version': '8.
|
|
292
|
+
'data-garden-version': '8.60.0'
|
|
293
293
|
}).withConfig({
|
|
294
294
|
displayName: "StyledTimeline",
|
|
295
295
|
componentId: "sc-pig5kv-0"
|
|
@@ -301,7 +301,7 @@ StyledTimeline.defaultProps = {
|
|
|
301
301
|
const COMPONENT_ID$4 = 'timeline.content.separator';
|
|
302
302
|
const StyledSeparator = styled.div.attrs({
|
|
303
303
|
'data-garden-id': COMPONENT_ID$4,
|
|
304
|
-
'data-garden-version': '8.
|
|
304
|
+
'data-garden-version': '8.60.0'
|
|
305
305
|
}).withConfig({
|
|
306
306
|
displayName: "StyledSeparator",
|
|
307
307
|
componentId: "sc-fki51e-0"
|
|
@@ -313,7 +313,7 @@ StyledSeparator.defaultProps = {
|
|
|
313
313
|
const COMPONENT_ID$3 = 'timeline.content';
|
|
314
314
|
const StyledTimelineContent = styled.div.attrs({
|
|
315
315
|
'data-garden-id': COMPONENT_ID$3,
|
|
316
|
-
'data-garden-version': '8.
|
|
316
|
+
'data-garden-version': '8.60.0'
|
|
317
317
|
}).withConfig({
|
|
318
318
|
displayName: "StyledContent__StyledTimelineContent",
|
|
319
319
|
componentId: "sc-19phgu1-0"
|
|
@@ -325,7 +325,7 @@ StyledTimelineContent.defaultProps = {
|
|
|
325
325
|
const COMPONENT_ID$2 = 'timeline.opposite.content';
|
|
326
326
|
const StyledOppositeContent = styled.div.attrs({
|
|
327
327
|
'data-garden-id': COMPONENT_ID$2,
|
|
328
|
-
'data-garden-version': '8.
|
|
328
|
+
'data-garden-version': '8.60.0'
|
|
329
329
|
}).withConfig({
|
|
330
330
|
displayName: "StyledOppositeContent",
|
|
331
331
|
componentId: "sc-jurh2k-0"
|
|
@@ -337,7 +337,7 @@ StyledOppositeContent.defaultProps = {
|
|
|
337
337
|
const COMPONENT_ID$1 = 'timeline.item';
|
|
338
338
|
const StyledTimelineItem = styled.li.attrs({
|
|
339
339
|
'data-garden-id': COMPONENT_ID$1,
|
|
340
|
-
'data-garden-version': '8.
|
|
340
|
+
'data-garden-version': '8.60.0'
|
|
341
341
|
}).withConfig({
|
|
342
342
|
displayName: "StyledItem__StyledTimelineItem",
|
|
343
343
|
componentId: "sc-5mcnzm-0"
|
|
@@ -356,7 +356,7 @@ const StyledItemIcon = styled(_ref => {
|
|
|
356
356
|
return cloneElement(Children.only(children), props);
|
|
357
357
|
}).attrs({
|
|
358
358
|
'data-garden-id': COMPONENT_ID,
|
|
359
|
-
'data-garden-version': '8.
|
|
359
|
+
'data-garden-version': '8.60.0'
|
|
360
360
|
}).withConfig({
|
|
361
361
|
displayName: "StyledItemIcon",
|
|
362
362
|
componentId: "sc-vz2l6e-0"
|
|
@@ -567,22 +567,29 @@ const PanelComponent = forwardRef((props, ref) => {
|
|
|
567
567
|
const panelRef = useRef();
|
|
568
568
|
const index = useSectionContext();
|
|
569
569
|
const isExpanded = expandedSections.includes(index);
|
|
570
|
-
const
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
child.style.maxHeight = `${child.scrollHeight}px`;
|
|
574
|
-
}
|
|
575
|
-
}, 100), [panelRef]);
|
|
576
|
-
React__default.useEffect(() => {
|
|
570
|
+
const theme = useContext(ThemeContext);
|
|
571
|
+
const environment = useDocument(theme);
|
|
572
|
+
useEffect(() => {
|
|
577
573
|
if (!isAnimated) {
|
|
578
574
|
return undefined;
|
|
579
575
|
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
576
|
+
if (environment) {
|
|
577
|
+
const updateMaxHeight = debounce(() => {
|
|
578
|
+
if (panelRef.current) {
|
|
579
|
+
const child = panelRef.current.children[0];
|
|
580
|
+
child.style.maxHeight = `${child.scrollHeight}px`;
|
|
581
|
+
}
|
|
582
|
+
}, 100);
|
|
583
|
+
const win = environment.defaultView || window;
|
|
584
|
+
win.addEventListener('resize', updateMaxHeight);
|
|
585
|
+
updateMaxHeight();
|
|
586
|
+
return () => {
|
|
587
|
+
updateMaxHeight.cancel();
|
|
588
|
+
win.removeEventListener('resize', updateMaxHeight);
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
return undefined;
|
|
592
|
+
}, [isAnimated, panelRef, environment, props.children]);
|
|
586
593
|
return React__default.createElement(StyledPanel, getPanelProps({
|
|
587
594
|
role: null,
|
|
588
595
|
ref: mergeRefs([panelRef, ref]),
|
|
@@ -758,22 +765,26 @@ const ContentComponent$1 = forwardRef((props, ref) => {
|
|
|
758
765
|
currentStepIndex
|
|
759
766
|
} = useStepContext();
|
|
760
767
|
const isActive = currentStepIndex === activeIndex;
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
const child = contentRef.current.children[0];
|
|
764
|
-
child.style.maxHeight = `${child.scrollHeight}px`;
|
|
765
|
-
}
|
|
766
|
-
}, 100), [contentRef]);
|
|
768
|
+
const theme = useContext(ThemeContext);
|
|
769
|
+
const environment = useDocument(theme);
|
|
767
770
|
useEffect(() => {
|
|
768
|
-
if (isActive && isHorizontal === false) {
|
|
769
|
-
|
|
771
|
+
if (environment && isActive && isHorizontal === false) {
|
|
772
|
+
const win = environment.defaultView || window;
|
|
773
|
+
const updateMaxHeight = debounce(() => {
|
|
774
|
+
if (contentRef.current) {
|
|
775
|
+
const child = contentRef.current.children[0];
|
|
776
|
+
child.style.maxHeight = `${child.scrollHeight}px`;
|
|
777
|
+
}
|
|
778
|
+
}, 100);
|
|
779
|
+
win.addEventListener('resize', updateMaxHeight);
|
|
770
780
|
updateMaxHeight();
|
|
771
781
|
return () => {
|
|
772
|
-
|
|
782
|
+
updateMaxHeight.cancel();
|
|
783
|
+
win.removeEventListener('resize', updateMaxHeight);
|
|
773
784
|
};
|
|
774
785
|
}
|
|
775
786
|
return undefined;
|
|
776
|
-
}, [isActive, isHorizontal,
|
|
787
|
+
}, [isActive, isHorizontal, contentRef, environment]);
|
|
777
788
|
return isHorizontal === false ? React__default.createElement(StyledContent, _extends$3({
|
|
778
789
|
ref: mergeRefs([contentRef, ref]),
|
|
779
790
|
isActive: isActive
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-accordions",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.60.0",
|
|
4
4
|
"description": "Components related to accordions in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/lodash.debounce": "4.0.7",
|
|
39
|
-
"@zendeskgarden/react-theming": "^8.
|
|
39
|
+
"@zendeskgarden/react-theming": "^8.60.0",
|
|
40
40
|
"@zendeskgarden/svg-icons": "6.33.0"
|
|
41
41
|
},
|
|
42
42
|
"keywords": [
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"zendeskgarden:src": "src/index.ts",
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "8adf13e61f58a64a0ba06794c0362f665e846fe9"
|
|
54
54
|
}
|