@zendeskgarden/react-accordions 9.0.0-next.6 → 9.0.0-next.7
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
CHANGED
|
@@ -70,7 +70,7 @@ const sizeStyles$2 = props => {
|
|
|
70
70
|
};
|
|
71
71
|
const StyledContent = styled__default.default.div.attrs({
|
|
72
72
|
'data-garden-id': COMPONENT_ID$k,
|
|
73
|
-
'data-garden-version': '9.0.0-next.
|
|
73
|
+
'data-garden-version': '9.0.0-next.7'
|
|
74
74
|
}).withConfig({
|
|
75
75
|
displayName: "StyledContent",
|
|
76
76
|
componentId: "sc-mazvvo-0"
|
|
@@ -82,7 +82,7 @@ StyledContent.defaultProps = {
|
|
|
82
82
|
const COMPONENT_ID$j = 'accordions.step_line';
|
|
83
83
|
const StyledLine = styled__default.default.div.attrs({
|
|
84
84
|
'data-garden-id': COMPONENT_ID$j,
|
|
85
|
-
'data-garden-version': '9.0.0-next.
|
|
85
|
+
'data-garden-version': '9.0.0-next.7'
|
|
86
86
|
}).withConfig({
|
|
87
87
|
displayName: "StyledLine",
|
|
88
88
|
componentId: "sc-1gkpjbr-0"
|
|
@@ -94,7 +94,7 @@ StyledLine.defaultProps = {
|
|
|
94
94
|
const COMPONENT_ID$i = 'accordions.step';
|
|
95
95
|
const StyledStep = styled__default.default.li.attrs({
|
|
96
96
|
'data-garden-id': COMPONENT_ID$i,
|
|
97
|
-
'data-garden-version': '9.0.0-next.
|
|
97
|
+
'data-garden-version': '9.0.0-next.7'
|
|
98
98
|
}).withConfig({
|
|
99
99
|
displayName: "StyledStep",
|
|
100
100
|
componentId: "sc-12fiwtz-0"
|
|
@@ -106,7 +106,7 @@ StyledStep.defaultProps = {
|
|
|
106
106
|
const COMPONENT_ID$h = 'accordions.step_inner_content';
|
|
107
107
|
const StyledInnerContent = styled__default.default.div.attrs({
|
|
108
108
|
'data-garden-id': COMPONENT_ID$h,
|
|
109
|
-
'data-garden-version': '9.0.0-next.
|
|
109
|
+
'data-garden-version': '9.0.0-next.7'
|
|
110
110
|
}).withConfig({
|
|
111
111
|
displayName: "StyledInnerContent",
|
|
112
112
|
componentId: "sc-1xs9fh7-0"
|
|
@@ -118,7 +118,7 @@ StyledInnerContent.defaultProps = {
|
|
|
118
118
|
const COMPONENT_ID$g = 'accordions.stepper';
|
|
119
119
|
const StyledStepper = styled__default.default.ol.attrs({
|
|
120
120
|
'data-garden-id': COMPONENT_ID$g,
|
|
121
|
-
'data-garden-version': '9.0.0-next.
|
|
121
|
+
'data-garden-version': '9.0.0-next.7'
|
|
122
122
|
}).withConfig({
|
|
123
123
|
displayName: "StyledStepper",
|
|
124
124
|
componentId: "sc-dsxw0f-0"
|
|
@@ -142,7 +142,7 @@ const colorStyles$3 = props => {
|
|
|
142
142
|
};
|
|
143
143
|
const StyledIcon = styled__default.default.div.attrs({
|
|
144
144
|
'data-garden-id': COMPONENT_ID$f,
|
|
145
|
-
'data-garden-version': '9.0.0-next.
|
|
145
|
+
'data-garden-version': '9.0.0-next.7'
|
|
146
146
|
}).withConfig({
|
|
147
147
|
displayName: "StyledIcon",
|
|
148
148
|
componentId: "sc-v20nz9-1"
|
|
@@ -157,7 +157,7 @@ StyledIcon.defaultProps = {
|
|
|
157
157
|
const COMPONENT_ID$e = 'accordions.step_label';
|
|
158
158
|
const StyledLabel = styled__default.default.div.attrs({
|
|
159
159
|
'data-garden-id': COMPONENT_ID$e,
|
|
160
|
-
'data-garden-version': '9.0.0-next.
|
|
160
|
+
'data-garden-version': '9.0.0-next.7'
|
|
161
161
|
}).withConfig({
|
|
162
162
|
displayName: "StyledLabel",
|
|
163
163
|
componentId: "sc-1o82llj-0"
|
|
@@ -169,7 +169,7 @@ StyledLabel.defaultProps = {
|
|
|
169
169
|
const COMPONENT_ID$d = 'accordions.step_label_text';
|
|
170
170
|
const StyledLabelText = styled__default.default.div.attrs({
|
|
171
171
|
'data-garden-id': COMPONENT_ID$d,
|
|
172
|
-
'data-garden-version': '9.0.0-next.
|
|
172
|
+
'data-garden-version': '9.0.0-next.7'
|
|
173
173
|
}).withConfig({
|
|
174
174
|
displayName: "StyledLabelText",
|
|
175
175
|
componentId: "sc-111m5zo-0"
|
|
@@ -181,7 +181,7 @@ StyledLabelText.defaultProps = {
|
|
|
181
181
|
const COMPONENT_ID$c = 'accordions.accordion';
|
|
182
182
|
const StyledAccordion = styled__default.default.div.attrs({
|
|
183
183
|
'data-garden-id': COMPONENT_ID$c,
|
|
184
|
-
'data-garden-version': '9.0.0-next.
|
|
184
|
+
'data-garden-version': '9.0.0-next.7'
|
|
185
185
|
}).withConfig({
|
|
186
186
|
displayName: "StyledAccordion",
|
|
187
187
|
componentId: "sc-niv9ic-0"
|
|
@@ -223,7 +223,7 @@ const sizeStyles = props => {
|
|
|
223
223
|
};
|
|
224
224
|
const StyledPanel = styled__default.default.section.attrs({
|
|
225
225
|
'data-garden-id': COMPONENT_ID$b,
|
|
226
|
-
'data-garden-version': '9.0.0-next.
|
|
226
|
+
'data-garden-version': '9.0.0-next.7'
|
|
227
227
|
}).withConfig({
|
|
228
228
|
displayName: "StyledPanel",
|
|
229
229
|
componentId: "sc-1piryze-0"
|
|
@@ -236,7 +236,7 @@ StyledPanel.defaultProps = {
|
|
|
236
236
|
const COMPONENT_ID$a = 'accordions.section';
|
|
237
237
|
const StyledSection = styled__default.default.div.attrs({
|
|
238
238
|
'data-garden-id': COMPONENT_ID$a,
|
|
239
|
-
'data-garden-version': '9.0.0-next.
|
|
239
|
+
'data-garden-version': '9.0.0-next.7'
|
|
240
240
|
}).withConfig({
|
|
241
241
|
displayName: "StyledSection",
|
|
242
242
|
componentId: "sc-v2t9bd-0"
|
|
@@ -245,24 +245,7 @@ StyledSection.defaultProps = {
|
|
|
245
245
|
theme: reactTheming.DEFAULT_THEME
|
|
246
246
|
};
|
|
247
247
|
|
|
248
|
-
const COMPONENT_ID$9 = 'accordions.
|
|
249
|
-
const StyledHeader = styled__default.default.div.attrs({
|
|
250
|
-
'data-garden-id': COMPONENT_ID$9,
|
|
251
|
-
'data-garden-version': '9.0.0-next.6'
|
|
252
|
-
}).withConfig({
|
|
253
|
-
displayName: "StyledHeader",
|
|
254
|
-
componentId: "sc-2c6rbr-0"
|
|
255
|
-
})(["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 => reactTheming.focusStyles({
|
|
256
|
-
theme: props.theme,
|
|
257
|
-
inset: true,
|
|
258
|
-
condition: props.isFocused,
|
|
259
|
-
selector: '&:focus-within'
|
|
260
|
-
}), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$9, props));
|
|
261
|
-
StyledHeader.defaultProps = {
|
|
262
|
-
theme: reactTheming.DEFAULT_THEME
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
const COMPONENT_ID$8 = 'accordions.button';
|
|
248
|
+
const COMPONENT_ID$9 = 'accordions.button';
|
|
266
249
|
const colorStyles$1 = props => {
|
|
267
250
|
const showColor = props.isCollapsible || !props.isExpanded;
|
|
268
251
|
let color = reactTheming.getColorV8('foreground', 600 , props.theme);
|
|
@@ -272,20 +255,36 @@ const colorStyles$1 = props => {
|
|
|
272
255
|
return styled.css(["color:", ";&:hover{cursor:", ";color:", ";}"], color, showColor && 'pointer', showColor && color);
|
|
273
256
|
};
|
|
274
257
|
const StyledButton = styled__default.default.button.attrs({
|
|
275
|
-
'data-garden-id': COMPONENT_ID$
|
|
276
|
-
'data-garden-version': '9.0.0-next.
|
|
258
|
+
'data-garden-id': COMPONENT_ID$9,
|
|
259
|
+
'data-garden-version': '9.0.0-next.7'
|
|
277
260
|
}).withConfig({
|
|
278
261
|
displayName: "StyledButton",
|
|
279
262
|
componentId: "sc-xj3hy7-0"
|
|
280
|
-
})(["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 => reactTheming.getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => props.theme.fontWeights.semibold, colorStyles$1, props => (props.isCollapsible || !props.isExpanded) && 'pointer', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$
|
|
263
|
+
})(["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 => reactTheming.getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => props.theme.fontWeights.semibold, colorStyles$1, props => (props.isCollapsible || !props.isExpanded) && 'pointer', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$9, props));
|
|
281
264
|
StyledButton.defaultProps = {
|
|
282
265
|
theme: reactTheming.DEFAULT_THEME
|
|
283
266
|
};
|
|
284
267
|
|
|
268
|
+
const COMPONENT_ID$8 = 'accordions.header';
|
|
269
|
+
const StyledHeader = styled__default.default.div.attrs({
|
|
270
|
+
'data-garden-id': COMPONENT_ID$8,
|
|
271
|
+
'data-garden-version': '9.0.0-next.7'
|
|
272
|
+
}).withConfig({
|
|
273
|
+
displayName: "StyledHeader",
|
|
274
|
+
componentId: "sc-2c6rbr-0"
|
|
275
|
+
})(["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 => reactTheming.focusStyles({
|
|
276
|
+
theme: props.theme,
|
|
277
|
+
inset: true,
|
|
278
|
+
selector: `&:has(${StyledButton}:focus-visible)`
|
|
279
|
+
}), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$8, props));
|
|
280
|
+
StyledHeader.defaultProps = {
|
|
281
|
+
theme: reactTheming.DEFAULT_THEME
|
|
282
|
+
};
|
|
283
|
+
|
|
285
284
|
const COMPONENT_ID$7 = 'accordions.step_inner_panel';
|
|
286
285
|
const StyledInnerPanel = styled__default.default.div.attrs({
|
|
287
286
|
'data-garden-id': COMPONENT_ID$7,
|
|
288
|
-
'data-garden-version': '9.0.0-next.
|
|
287
|
+
'data-garden-version': '9.0.0-next.7'
|
|
289
288
|
}).withConfig({
|
|
290
289
|
displayName: "StyledInnerPanel",
|
|
291
290
|
componentId: "sc-8nbueg-0"
|
|
@@ -316,7 +315,7 @@ _ref => {
|
|
|
316
315
|
return React.cloneElement(React.Children.only(children), props);
|
|
317
316
|
}).attrs({
|
|
318
317
|
'data-garden-id': COMPONENT_ID$6,
|
|
319
|
-
'data-garden-version': '9.0.0-next.
|
|
318
|
+
'data-garden-version': '9.0.0-next.7'
|
|
320
319
|
}).withConfig({
|
|
321
320
|
displayName: "StyledRotateIcon",
|
|
322
321
|
componentId: "sc-hp435q-0"
|
|
@@ -328,7 +327,7 @@ StyledRotateIcon.defaultProps = {
|
|
|
328
327
|
const COMPONENT_ID$5 = 'timeline';
|
|
329
328
|
const StyledTimeline = styled__default.default.ol.attrs({
|
|
330
329
|
'data-garden-id': COMPONENT_ID$5,
|
|
331
|
-
'data-garden-version': '9.0.0-next.
|
|
330
|
+
'data-garden-version': '9.0.0-next.7'
|
|
332
331
|
}).withConfig({
|
|
333
332
|
displayName: "StyledTimeline",
|
|
334
333
|
componentId: "sc-pig5kv-0"
|
|
@@ -340,7 +339,7 @@ StyledTimeline.defaultProps = {
|
|
|
340
339
|
const COMPONENT_ID$4 = 'timeline.content.separator';
|
|
341
340
|
const StyledSeparator = styled__default.default.div.attrs({
|
|
342
341
|
'data-garden-id': COMPONENT_ID$4,
|
|
343
|
-
'data-garden-version': '9.0.0-next.
|
|
342
|
+
'data-garden-version': '9.0.0-next.7'
|
|
344
343
|
}).withConfig({
|
|
345
344
|
displayName: "StyledSeparator",
|
|
346
345
|
componentId: "sc-fki51e-0"
|
|
@@ -352,7 +351,7 @@ StyledSeparator.defaultProps = {
|
|
|
352
351
|
const COMPONENT_ID$3 = 'timeline.content';
|
|
353
352
|
const StyledTimelineContent = styled__default.default.div.attrs({
|
|
354
353
|
'data-garden-id': COMPONENT_ID$3,
|
|
355
|
-
'data-garden-version': '9.0.0-next.
|
|
354
|
+
'data-garden-version': '9.0.0-next.7'
|
|
356
355
|
}).withConfig({
|
|
357
356
|
displayName: "StyledContent__StyledTimelineContent",
|
|
358
357
|
componentId: "sc-19phgu1-0"
|
|
@@ -364,7 +363,7 @@ StyledTimelineContent.defaultProps = {
|
|
|
364
363
|
const COMPONENT_ID$2 = 'timeline.opposite.content';
|
|
365
364
|
const StyledOppositeContent = styled__default.default.div.attrs({
|
|
366
365
|
'data-garden-id': COMPONENT_ID$2,
|
|
367
|
-
'data-garden-version': '9.0.0-next.
|
|
366
|
+
'data-garden-version': '9.0.0-next.7'
|
|
368
367
|
}).withConfig({
|
|
369
368
|
displayName: "StyledOppositeContent",
|
|
370
369
|
componentId: "sc-jurh2k-0"
|
|
@@ -376,7 +375,7 @@ StyledOppositeContent.defaultProps = {
|
|
|
376
375
|
const COMPONENT_ID$1 = 'timeline.item';
|
|
377
376
|
const StyledTimelineItem = styled__default.default.li.attrs({
|
|
378
377
|
'data-garden-id': COMPONENT_ID$1,
|
|
379
|
-
'data-garden-version': '9.0.0-next.
|
|
378
|
+
'data-garden-version': '9.0.0-next.7'
|
|
380
379
|
}).withConfig({
|
|
381
380
|
displayName: "StyledItem__StyledTimelineItem",
|
|
382
381
|
componentId: "sc-5mcnzm-0"
|
|
@@ -395,7 +394,7 @@ const StyledItemIcon = styled__default.default(_ref => {
|
|
|
395
394
|
return React.cloneElement(React.Children.only(children), props);
|
|
396
395
|
}).attrs({
|
|
397
396
|
'data-garden-id': COMPONENT_ID,
|
|
398
|
-
'data-garden-version': '9.0.0-next.
|
|
397
|
+
'data-garden-version': '9.0.0-next.7'
|
|
399
398
|
}).withConfig({
|
|
400
399
|
displayName: "StyledItemIcon",
|
|
401
400
|
componentId: "sc-vz2l6e-0"
|
|
@@ -492,8 +491,6 @@ var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
|
492
491
|
const HeaderComponent = React.forwardRef((props, ref) => {
|
|
493
492
|
const {
|
|
494
493
|
onClick,
|
|
495
|
-
onFocus,
|
|
496
|
-
onBlur,
|
|
497
494
|
onMouseOver,
|
|
498
495
|
onMouseOut,
|
|
499
496
|
role,
|
|
@@ -509,7 +506,6 @@ const HeaderComponent = React.forwardRef((props, ref) => {
|
|
|
509
506
|
expandedSections
|
|
510
507
|
} = useAccordionContext();
|
|
511
508
|
const sectionValue = useSectionContext();
|
|
512
|
-
const [isFocused, setIsFocused] = React.useState(false);
|
|
513
509
|
const [isHovered, setIsHovered] = React.useState(false);
|
|
514
510
|
const isExpanded = expandedSections.includes(sectionValue);
|
|
515
511
|
const {
|
|
@@ -520,16 +516,6 @@ const HeaderComponent = React.forwardRef((props, ref) => {
|
|
|
520
516
|
type: 'button',
|
|
521
517
|
value: sectionValue
|
|
522
518
|
});
|
|
523
|
-
const onHeaderFocus = e => {
|
|
524
|
-
e.persist();
|
|
525
|
-
setTimeout(() => {
|
|
526
|
-
const isAccordionButton = e.target.getAttribute('data-garden-id') === COMPONENT_ID$8;
|
|
527
|
-
const isFocusVisible = e.target.getAttribute('data-garden-focus-visible');
|
|
528
|
-
if (isAccordionButton && isFocusVisible) {
|
|
529
|
-
setIsFocused(true);
|
|
530
|
-
}
|
|
531
|
-
}, 0);
|
|
532
|
-
};
|
|
533
519
|
const value = React.useMemo(() => ({
|
|
534
520
|
isHovered,
|
|
535
521
|
otherTriggerProps
|
|
@@ -538,15 +524,12 @@ const HeaderComponent = React.forwardRef((props, ref) => {
|
|
|
538
524
|
value: value
|
|
539
525
|
}, React__namespace.default.createElement(StyledHeader, _extends$3({
|
|
540
526
|
isCollapsible: isCollapsible,
|
|
541
|
-
isExpanded: isExpanded
|
|
542
|
-
isFocused: isFocused
|
|
527
|
+
isExpanded: isExpanded
|
|
543
528
|
}, getHeaderProps({
|
|
544
529
|
ref,
|
|
545
530
|
'aria-level': ariaLevel,
|
|
546
531
|
role: role === undefined || role === null ? role : 'heading',
|
|
547
532
|
onClick: containerUtilities.composeEventHandlers(onClick, onTriggerClick),
|
|
548
|
-
onFocus: containerUtilities.composeEventHandlers(onFocus, onHeaderFocus),
|
|
549
|
-
onBlur: containerUtilities.composeEventHandlers(onBlur, () => setIsFocused(false)),
|
|
550
533
|
onMouseOver: containerUtilities.composeEventHandlers(onMouseOver, () => setIsHovered(true)),
|
|
551
534
|
onMouseOut: containerUtilities.composeEventHandlers(onMouseOut, () => setIsHovered(false)),
|
|
552
535
|
...other
|
package/dist/index.esm.js
CHANGED
|
@@ -45,7 +45,7 @@ const sizeStyles$2 = props => {
|
|
|
45
45
|
};
|
|
46
46
|
const StyledContent = styled.div.attrs({
|
|
47
47
|
'data-garden-id': COMPONENT_ID$k,
|
|
48
|
-
'data-garden-version': '9.0.0-next.
|
|
48
|
+
'data-garden-version': '9.0.0-next.7'
|
|
49
49
|
}).withConfig({
|
|
50
50
|
displayName: "StyledContent",
|
|
51
51
|
componentId: "sc-mazvvo-0"
|
|
@@ -57,7 +57,7 @@ StyledContent.defaultProps = {
|
|
|
57
57
|
const COMPONENT_ID$j = 'accordions.step_line';
|
|
58
58
|
const StyledLine = styled.div.attrs({
|
|
59
59
|
'data-garden-id': COMPONENT_ID$j,
|
|
60
|
-
'data-garden-version': '9.0.0-next.
|
|
60
|
+
'data-garden-version': '9.0.0-next.7'
|
|
61
61
|
}).withConfig({
|
|
62
62
|
displayName: "StyledLine",
|
|
63
63
|
componentId: "sc-1gkpjbr-0"
|
|
@@ -69,7 +69,7 @@ StyledLine.defaultProps = {
|
|
|
69
69
|
const COMPONENT_ID$i = 'accordions.step';
|
|
70
70
|
const StyledStep = styled.li.attrs({
|
|
71
71
|
'data-garden-id': COMPONENT_ID$i,
|
|
72
|
-
'data-garden-version': '9.0.0-next.
|
|
72
|
+
'data-garden-version': '9.0.0-next.7'
|
|
73
73
|
}).withConfig({
|
|
74
74
|
displayName: "StyledStep",
|
|
75
75
|
componentId: "sc-12fiwtz-0"
|
|
@@ -81,7 +81,7 @@ StyledStep.defaultProps = {
|
|
|
81
81
|
const COMPONENT_ID$h = 'accordions.step_inner_content';
|
|
82
82
|
const StyledInnerContent = styled.div.attrs({
|
|
83
83
|
'data-garden-id': COMPONENT_ID$h,
|
|
84
|
-
'data-garden-version': '9.0.0-next.
|
|
84
|
+
'data-garden-version': '9.0.0-next.7'
|
|
85
85
|
}).withConfig({
|
|
86
86
|
displayName: "StyledInnerContent",
|
|
87
87
|
componentId: "sc-1xs9fh7-0"
|
|
@@ -93,7 +93,7 @@ StyledInnerContent.defaultProps = {
|
|
|
93
93
|
const COMPONENT_ID$g = 'accordions.stepper';
|
|
94
94
|
const StyledStepper = styled.ol.attrs({
|
|
95
95
|
'data-garden-id': COMPONENT_ID$g,
|
|
96
|
-
'data-garden-version': '9.0.0-next.
|
|
96
|
+
'data-garden-version': '9.0.0-next.7'
|
|
97
97
|
}).withConfig({
|
|
98
98
|
displayName: "StyledStepper",
|
|
99
99
|
componentId: "sc-dsxw0f-0"
|
|
@@ -117,7 +117,7 @@ const colorStyles$3 = props => {
|
|
|
117
117
|
};
|
|
118
118
|
const StyledIcon = styled.div.attrs({
|
|
119
119
|
'data-garden-id': COMPONENT_ID$f,
|
|
120
|
-
'data-garden-version': '9.0.0-next.
|
|
120
|
+
'data-garden-version': '9.0.0-next.7'
|
|
121
121
|
}).withConfig({
|
|
122
122
|
displayName: "StyledIcon",
|
|
123
123
|
componentId: "sc-v20nz9-1"
|
|
@@ -132,7 +132,7 @@ StyledIcon.defaultProps = {
|
|
|
132
132
|
const COMPONENT_ID$e = 'accordions.step_label';
|
|
133
133
|
const StyledLabel = styled.div.attrs({
|
|
134
134
|
'data-garden-id': COMPONENT_ID$e,
|
|
135
|
-
'data-garden-version': '9.0.0-next.
|
|
135
|
+
'data-garden-version': '9.0.0-next.7'
|
|
136
136
|
}).withConfig({
|
|
137
137
|
displayName: "StyledLabel",
|
|
138
138
|
componentId: "sc-1o82llj-0"
|
|
@@ -144,7 +144,7 @@ StyledLabel.defaultProps = {
|
|
|
144
144
|
const COMPONENT_ID$d = 'accordions.step_label_text';
|
|
145
145
|
const StyledLabelText = styled.div.attrs({
|
|
146
146
|
'data-garden-id': COMPONENT_ID$d,
|
|
147
|
-
'data-garden-version': '9.0.0-next.
|
|
147
|
+
'data-garden-version': '9.0.0-next.7'
|
|
148
148
|
}).withConfig({
|
|
149
149
|
displayName: "StyledLabelText",
|
|
150
150
|
componentId: "sc-111m5zo-0"
|
|
@@ -156,7 +156,7 @@ StyledLabelText.defaultProps = {
|
|
|
156
156
|
const COMPONENT_ID$c = 'accordions.accordion';
|
|
157
157
|
const StyledAccordion = styled.div.attrs({
|
|
158
158
|
'data-garden-id': COMPONENT_ID$c,
|
|
159
|
-
'data-garden-version': '9.0.0-next.
|
|
159
|
+
'data-garden-version': '9.0.0-next.7'
|
|
160
160
|
}).withConfig({
|
|
161
161
|
displayName: "StyledAccordion",
|
|
162
162
|
componentId: "sc-niv9ic-0"
|
|
@@ -198,7 +198,7 @@ const sizeStyles = props => {
|
|
|
198
198
|
};
|
|
199
199
|
const StyledPanel = styled.section.attrs({
|
|
200
200
|
'data-garden-id': COMPONENT_ID$b,
|
|
201
|
-
'data-garden-version': '9.0.0-next.
|
|
201
|
+
'data-garden-version': '9.0.0-next.7'
|
|
202
202
|
}).withConfig({
|
|
203
203
|
displayName: "StyledPanel",
|
|
204
204
|
componentId: "sc-1piryze-0"
|
|
@@ -211,7 +211,7 @@ StyledPanel.defaultProps = {
|
|
|
211
211
|
const COMPONENT_ID$a = 'accordions.section';
|
|
212
212
|
const StyledSection = styled.div.attrs({
|
|
213
213
|
'data-garden-id': COMPONENT_ID$a,
|
|
214
|
-
'data-garden-version': '9.0.0-next.
|
|
214
|
+
'data-garden-version': '9.0.0-next.7'
|
|
215
215
|
}).withConfig({
|
|
216
216
|
displayName: "StyledSection",
|
|
217
217
|
componentId: "sc-v2t9bd-0"
|
|
@@ -220,24 +220,7 @@ StyledSection.defaultProps = {
|
|
|
220
220
|
theme: DEFAULT_THEME
|
|
221
221
|
};
|
|
222
222
|
|
|
223
|
-
const COMPONENT_ID$9 = 'accordions.
|
|
224
|
-
const StyledHeader = styled.div.attrs({
|
|
225
|
-
'data-garden-id': COMPONENT_ID$9,
|
|
226
|
-
'data-garden-version': '9.0.0-next.6'
|
|
227
|
-
}).withConfig({
|
|
228
|
-
displayName: "StyledHeader",
|
|
229
|
-
componentId: "sc-2c6rbr-0"
|
|
230
|
-
})(["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({
|
|
231
|
-
theme: props.theme,
|
|
232
|
-
inset: true,
|
|
233
|
-
condition: props.isFocused,
|
|
234
|
-
selector: '&:focus-within'
|
|
235
|
-
}), props => retrieveComponentStyles(COMPONENT_ID$9, props));
|
|
236
|
-
StyledHeader.defaultProps = {
|
|
237
|
-
theme: DEFAULT_THEME
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
const COMPONENT_ID$8 = 'accordions.button';
|
|
223
|
+
const COMPONENT_ID$9 = 'accordions.button';
|
|
241
224
|
const colorStyles$1 = props => {
|
|
242
225
|
const showColor = props.isCollapsible || !props.isExpanded;
|
|
243
226
|
let color = getColorV8('foreground', 600 , props.theme);
|
|
@@ -247,20 +230,36 @@ const colorStyles$1 = props => {
|
|
|
247
230
|
return css(["color:", ";&:hover{cursor:", ";color:", ";}"], color, showColor && 'pointer', showColor && color);
|
|
248
231
|
};
|
|
249
232
|
const StyledButton = styled.button.attrs({
|
|
250
|
-
'data-garden-id': COMPONENT_ID$
|
|
251
|
-
'data-garden-version': '9.0.0-next.
|
|
233
|
+
'data-garden-id': COMPONENT_ID$9,
|
|
234
|
+
'data-garden-version': '9.0.0-next.7'
|
|
252
235
|
}).withConfig({
|
|
253
236
|
displayName: "StyledButton",
|
|
254
237
|
componentId: "sc-xj3hy7-0"
|
|
255
|
-
})(["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$1, props => (props.isCollapsible || !props.isExpanded) && 'pointer', props => retrieveComponentStyles(COMPONENT_ID$
|
|
238
|
+
})(["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$1, props => (props.isCollapsible || !props.isExpanded) && 'pointer', props => retrieveComponentStyles(COMPONENT_ID$9, props));
|
|
256
239
|
StyledButton.defaultProps = {
|
|
257
240
|
theme: DEFAULT_THEME
|
|
258
241
|
};
|
|
259
242
|
|
|
243
|
+
const COMPONENT_ID$8 = 'accordions.header';
|
|
244
|
+
const StyledHeader = styled.div.attrs({
|
|
245
|
+
'data-garden-id': COMPONENT_ID$8,
|
|
246
|
+
'data-garden-version': '9.0.0-next.7'
|
|
247
|
+
}).withConfig({
|
|
248
|
+
displayName: "StyledHeader",
|
|
249
|
+
componentId: "sc-2c6rbr-0"
|
|
250
|
+
})(["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({
|
|
251
|
+
theme: props.theme,
|
|
252
|
+
inset: true,
|
|
253
|
+
selector: `&:has(${StyledButton}:focus-visible)`
|
|
254
|
+
}), props => retrieveComponentStyles(COMPONENT_ID$8, props));
|
|
255
|
+
StyledHeader.defaultProps = {
|
|
256
|
+
theme: DEFAULT_THEME
|
|
257
|
+
};
|
|
258
|
+
|
|
260
259
|
const COMPONENT_ID$7 = 'accordions.step_inner_panel';
|
|
261
260
|
const StyledInnerPanel = styled.div.attrs({
|
|
262
261
|
'data-garden-id': COMPONENT_ID$7,
|
|
263
|
-
'data-garden-version': '9.0.0-next.
|
|
262
|
+
'data-garden-version': '9.0.0-next.7'
|
|
264
263
|
}).withConfig({
|
|
265
264
|
displayName: "StyledInnerPanel",
|
|
266
265
|
componentId: "sc-8nbueg-0"
|
|
@@ -291,7 +290,7 @@ _ref => {
|
|
|
291
290
|
return cloneElement(Children.only(children), props);
|
|
292
291
|
}).attrs({
|
|
293
292
|
'data-garden-id': COMPONENT_ID$6,
|
|
294
|
-
'data-garden-version': '9.0.0-next.
|
|
293
|
+
'data-garden-version': '9.0.0-next.7'
|
|
295
294
|
}).withConfig({
|
|
296
295
|
displayName: "StyledRotateIcon",
|
|
297
296
|
componentId: "sc-hp435q-0"
|
|
@@ -303,7 +302,7 @@ StyledRotateIcon.defaultProps = {
|
|
|
303
302
|
const COMPONENT_ID$5 = 'timeline';
|
|
304
303
|
const StyledTimeline = styled.ol.attrs({
|
|
305
304
|
'data-garden-id': COMPONENT_ID$5,
|
|
306
|
-
'data-garden-version': '9.0.0-next.
|
|
305
|
+
'data-garden-version': '9.0.0-next.7'
|
|
307
306
|
}).withConfig({
|
|
308
307
|
displayName: "StyledTimeline",
|
|
309
308
|
componentId: "sc-pig5kv-0"
|
|
@@ -315,7 +314,7 @@ StyledTimeline.defaultProps = {
|
|
|
315
314
|
const COMPONENT_ID$4 = 'timeline.content.separator';
|
|
316
315
|
const StyledSeparator = styled.div.attrs({
|
|
317
316
|
'data-garden-id': COMPONENT_ID$4,
|
|
318
|
-
'data-garden-version': '9.0.0-next.
|
|
317
|
+
'data-garden-version': '9.0.0-next.7'
|
|
319
318
|
}).withConfig({
|
|
320
319
|
displayName: "StyledSeparator",
|
|
321
320
|
componentId: "sc-fki51e-0"
|
|
@@ -327,7 +326,7 @@ StyledSeparator.defaultProps = {
|
|
|
327
326
|
const COMPONENT_ID$3 = 'timeline.content';
|
|
328
327
|
const StyledTimelineContent = styled.div.attrs({
|
|
329
328
|
'data-garden-id': COMPONENT_ID$3,
|
|
330
|
-
'data-garden-version': '9.0.0-next.
|
|
329
|
+
'data-garden-version': '9.0.0-next.7'
|
|
331
330
|
}).withConfig({
|
|
332
331
|
displayName: "StyledContent__StyledTimelineContent",
|
|
333
332
|
componentId: "sc-19phgu1-0"
|
|
@@ -339,7 +338,7 @@ StyledTimelineContent.defaultProps = {
|
|
|
339
338
|
const COMPONENT_ID$2 = 'timeline.opposite.content';
|
|
340
339
|
const StyledOppositeContent = styled.div.attrs({
|
|
341
340
|
'data-garden-id': COMPONENT_ID$2,
|
|
342
|
-
'data-garden-version': '9.0.0-next.
|
|
341
|
+
'data-garden-version': '9.0.0-next.7'
|
|
343
342
|
}).withConfig({
|
|
344
343
|
displayName: "StyledOppositeContent",
|
|
345
344
|
componentId: "sc-jurh2k-0"
|
|
@@ -351,7 +350,7 @@ StyledOppositeContent.defaultProps = {
|
|
|
351
350
|
const COMPONENT_ID$1 = 'timeline.item';
|
|
352
351
|
const StyledTimelineItem = styled.li.attrs({
|
|
353
352
|
'data-garden-id': COMPONENT_ID$1,
|
|
354
|
-
'data-garden-version': '9.0.0-next.
|
|
353
|
+
'data-garden-version': '9.0.0-next.7'
|
|
355
354
|
}).withConfig({
|
|
356
355
|
displayName: "StyledItem__StyledTimelineItem",
|
|
357
356
|
componentId: "sc-5mcnzm-0"
|
|
@@ -370,7 +369,7 @@ const StyledItemIcon = styled(_ref => {
|
|
|
370
369
|
return cloneElement(Children.only(children), props);
|
|
371
370
|
}).attrs({
|
|
372
371
|
'data-garden-id': COMPONENT_ID,
|
|
373
|
-
'data-garden-version': '9.0.0-next.
|
|
372
|
+
'data-garden-version': '9.0.0-next.7'
|
|
374
373
|
}).withConfig({
|
|
375
374
|
displayName: "StyledItemIcon",
|
|
376
375
|
componentId: "sc-vz2l6e-0"
|
|
@@ -467,8 +466,6 @@ var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
|
467
466
|
const HeaderComponent = forwardRef((props, ref) => {
|
|
468
467
|
const {
|
|
469
468
|
onClick,
|
|
470
|
-
onFocus,
|
|
471
|
-
onBlur,
|
|
472
469
|
onMouseOver,
|
|
473
470
|
onMouseOut,
|
|
474
471
|
role,
|
|
@@ -484,7 +481,6 @@ const HeaderComponent = forwardRef((props, ref) => {
|
|
|
484
481
|
expandedSections
|
|
485
482
|
} = useAccordionContext();
|
|
486
483
|
const sectionValue = useSectionContext();
|
|
487
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
488
484
|
const [isHovered, setIsHovered] = useState(false);
|
|
489
485
|
const isExpanded = expandedSections.includes(sectionValue);
|
|
490
486
|
const {
|
|
@@ -495,16 +491,6 @@ const HeaderComponent = forwardRef((props, ref) => {
|
|
|
495
491
|
type: 'button',
|
|
496
492
|
value: sectionValue
|
|
497
493
|
});
|
|
498
|
-
const onHeaderFocus = e => {
|
|
499
|
-
e.persist();
|
|
500
|
-
setTimeout(() => {
|
|
501
|
-
const isAccordionButton = e.target.getAttribute('data-garden-id') === COMPONENT_ID$8;
|
|
502
|
-
const isFocusVisible = e.target.getAttribute('data-garden-focus-visible');
|
|
503
|
-
if (isAccordionButton && isFocusVisible) {
|
|
504
|
-
setIsFocused(true);
|
|
505
|
-
}
|
|
506
|
-
}, 0);
|
|
507
|
-
};
|
|
508
494
|
const value = useMemo(() => ({
|
|
509
495
|
isHovered,
|
|
510
496
|
otherTriggerProps
|
|
@@ -513,15 +499,12 @@ const HeaderComponent = forwardRef((props, ref) => {
|
|
|
513
499
|
value: value
|
|
514
500
|
}, React__default.createElement(StyledHeader, _extends$3({
|
|
515
501
|
isCollapsible: isCollapsible,
|
|
516
|
-
isExpanded: isExpanded
|
|
517
|
-
isFocused: isFocused
|
|
502
|
+
isExpanded: isExpanded
|
|
518
503
|
}, getHeaderProps({
|
|
519
504
|
ref,
|
|
520
505
|
'aria-level': ariaLevel,
|
|
521
506
|
role: role === undefined || role === null ? role : 'heading',
|
|
522
507
|
onClick: composeEventHandlers(onClick, onTriggerClick),
|
|
523
|
-
onFocus: composeEventHandlers(onFocus, onHeaderFocus),
|
|
524
|
-
onBlur: composeEventHandlers(onBlur, () => setIsFocused(false)),
|
|
525
508
|
onMouseOver: composeEventHandlers(onMouseOver, () => setIsHovered(true)),
|
|
526
509
|
onMouseOut: composeEventHandlers(onMouseOut, () => setIsHovered(false)),
|
|
527
510
|
...other
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-accordions",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.7",
|
|
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>",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"prop-types": "^15.5.7"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@zendeskgarden/react-theming": "^
|
|
30
|
+
"@zendeskgarden/react-theming": "^9.0.0",
|
|
31
31
|
"react": ">=16.8.0",
|
|
32
32
|
"react-dom": ">=16.8.0",
|
|
33
33
|
"styled-components": "^5.3.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@zendeskgarden/react-theming": "^9.0.0-next.
|
|
36
|
+
"@zendeskgarden/react-theming": "^9.0.0-next.7",
|
|
37
37
|
"@zendeskgarden/svg-icons": "7.0.0"
|
|
38
38
|
},
|
|
39
39
|
"keywords": [
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"zendeskgarden:src": "src/index.ts",
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "50a2b45b2e237a490a6d460818d33498b92479ec"
|
|
51
51
|
}
|