@zendeskgarden/react-accordions 8.57.0 → 8.58.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 +394 -698
- package/dist/index.esm.js +394 -698
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -16,299 +16,114 @@ import debounce from 'lodash.debounce';
|
|
|
16
16
|
import mergeRefs from 'react-merge-refs';
|
|
17
17
|
import PropTypes from 'prop-types';
|
|
18
18
|
|
|
19
|
-
function ownKeys(object, enumerableOnly) {
|
|
20
|
-
var keys = Object.keys(object);
|
|
21
|
-
|
|
22
|
-
if (Object.getOwnPropertySymbols) {
|
|
23
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
24
|
-
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
25
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
26
|
-
})), keys.push.apply(keys, symbols);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return keys;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function _objectSpread2(target) {
|
|
33
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
34
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
35
|
-
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
36
|
-
_defineProperty(target, key, source[key]);
|
|
37
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
38
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return target;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function _defineProperty(obj, key, value) {
|
|
46
|
-
if (key in obj) {
|
|
47
|
-
Object.defineProperty(obj, key, {
|
|
48
|
-
value: value,
|
|
49
|
-
enumerable: true,
|
|
50
|
-
configurable: true,
|
|
51
|
-
writable: true
|
|
52
|
-
});
|
|
53
|
-
} else {
|
|
54
|
-
obj[key] = value;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return obj;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
19
|
function _extends$3() {
|
|
61
20
|
_extends$3 = Object.assign ? Object.assign.bind() : function (target) {
|
|
62
21
|
for (var i = 1; i < arguments.length; i++) {
|
|
63
22
|
var source = arguments[i];
|
|
64
|
-
|
|
65
23
|
for (var key in source) {
|
|
66
24
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
67
25
|
target[key] = source[key];
|
|
68
26
|
}
|
|
69
27
|
}
|
|
70
28
|
}
|
|
71
|
-
|
|
72
29
|
return target;
|
|
73
30
|
};
|
|
74
31
|
return _extends$3.apply(this, arguments);
|
|
75
32
|
}
|
|
76
33
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return target;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function _objectWithoutProperties(source, excluded) {
|
|
93
|
-
if (source == null) return {};
|
|
94
|
-
|
|
95
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
96
|
-
|
|
97
|
-
var key, i;
|
|
98
|
-
|
|
99
|
-
if (Object.getOwnPropertySymbols) {
|
|
100
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
101
|
-
|
|
102
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
103
|
-
key = sourceSymbolKeys[i];
|
|
104
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
105
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
106
|
-
target[key] = source[key];
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return target;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function _slicedToArray(arr, i) {
|
|
114
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function _arrayWithHoles(arr) {
|
|
118
|
-
if (Array.isArray(arr)) return arr;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function _iterableToArrayLimit(arr, i) {
|
|
122
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
123
|
-
|
|
124
|
-
if (_i == null) return;
|
|
125
|
-
var _arr = [];
|
|
126
|
-
var _n = true;
|
|
127
|
-
var _d = false;
|
|
128
|
-
|
|
129
|
-
var _s, _e;
|
|
130
|
-
|
|
131
|
-
try {
|
|
132
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
133
|
-
_arr.push(_s.value);
|
|
134
|
-
|
|
135
|
-
if (i && _arr.length === i) break;
|
|
136
|
-
}
|
|
137
|
-
} catch (err) {
|
|
138
|
-
_d = true;
|
|
139
|
-
_e = err;
|
|
140
|
-
} finally {
|
|
141
|
-
try {
|
|
142
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
143
|
-
} finally {
|
|
144
|
-
if (_d) throw _e;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return _arr;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
152
|
-
if (!o) return;
|
|
153
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
154
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
155
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
156
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
157
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function _arrayLikeToArray(arr, len) {
|
|
161
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
162
|
-
|
|
163
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
164
|
-
|
|
165
|
-
return arr2;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function _nonIterableRest() {
|
|
169
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
var COMPONENT_ID$k = 'accordions.step_content';
|
|
173
|
-
var sizeStyles$1 = function sizeStyles(props) {
|
|
174
|
-
var _props$theme = props.theme,
|
|
175
|
-
rtl = _props$theme.rtl,
|
|
176
|
-
space = _props$theme.space;
|
|
177
|
-
var paddingBottom = props.isActive ? space.base * 8 : space.base * 6;
|
|
178
|
-
var paddingRight = rtl ? space.base * 6 : space.base * 5;
|
|
179
|
-
var paddingLeft = rtl ? space.base * 5 : space.base * 6;
|
|
180
|
-
var marginRight = rtl ? space.base * 3 : '0';
|
|
181
|
-
var marginLeft = rtl ? '0' : space.base * 3;
|
|
182
|
-
var marginVertical = space.base * 3;
|
|
34
|
+
const COMPONENT_ID$k = 'accordions.step_content';
|
|
35
|
+
const sizeStyles$1 = props => {
|
|
36
|
+
const {
|
|
37
|
+
rtl,
|
|
38
|
+
space
|
|
39
|
+
} = props.theme;
|
|
40
|
+
const paddingBottom = props.isActive ? space.base * 8 : space.base * 6;
|
|
41
|
+
const paddingRight = rtl ? space.base * 6 : space.base * 5;
|
|
42
|
+
const paddingLeft = rtl ? space.base * 5 : space.base * 6;
|
|
43
|
+
const marginRight = rtl ? space.base * 3 : '0';
|
|
44
|
+
const marginLeft = rtl ? '0' : space.base * 3;
|
|
45
|
+
const marginVertical = space.base * 3;
|
|
183
46
|
return css(["margin:", "px ", "px ", "px ", "px;padding:0 ", "px ", "px ", "px;"], marginVertical, marginRight, marginVertical, marginLeft, paddingRight, paddingBottom, paddingLeft);
|
|
184
47
|
};
|
|
185
|
-
|
|
48
|
+
const StyledContent = styled.div.attrs({
|
|
186
49
|
'data-garden-id': COMPONENT_ID$k,
|
|
187
|
-
'data-garden-version': '8.
|
|
50
|
+
'data-garden-version': '8.58.0'
|
|
188
51
|
}).withConfig({
|
|
189
52
|
displayName: "StyledContent",
|
|
190
53
|
componentId: "sc-mazvvo-0"
|
|
191
|
-
})(["", " min-width:", "px;word-break:break-word;", ";"], sizeStyles$1,
|
|
192
|
-
return props.theme.space.base * 30;
|
|
193
|
-
}, function (props) {
|
|
194
|
-
return retrieveComponentStyles(COMPONENT_ID$k, props);
|
|
195
|
-
});
|
|
54
|
+
})(["", " min-width:", "px;word-break:break-word;", ";"], sizeStyles$1, props => props.theme.space.base * 30, props => retrieveComponentStyles(COMPONENT_ID$k, props));
|
|
196
55
|
StyledContent.defaultProps = {
|
|
197
56
|
theme: DEFAULT_THEME
|
|
198
57
|
};
|
|
199
58
|
|
|
200
|
-
|
|
201
|
-
|
|
59
|
+
const COMPONENT_ID$j = 'accordions.step_line';
|
|
60
|
+
const StyledLine = styled.div.attrs({
|
|
202
61
|
'data-garden-id': COMPONENT_ID$j,
|
|
203
|
-
'data-garden-version': '8.
|
|
62
|
+
'data-garden-version': '8.58.0'
|
|
204
63
|
}).withConfig({
|
|
205
64
|
displayName: "StyledLine",
|
|
206
65
|
componentId: "sc-1gkpjbr-0"
|
|
207
|
-
})(["display:block;position:absolute;top:", "px;right:", ";left:", ";flex:1;border-top:", ";border-color:", ";"],
|
|
208
|
-
return props.theme.space.base * 3;
|
|
209
|
-
}, function (props) {
|
|
210
|
-
return "calc(50% + ".concat(props.theme.space.base * 6, "px)");
|
|
211
|
-
}, function (props) {
|
|
212
|
-
return "calc(-50% + ".concat(props.theme.space.base * 6, "px)");
|
|
213
|
-
}, function (props) {
|
|
214
|
-
return props.theme.borders.sm;
|
|
215
|
-
}, function (props) {
|
|
216
|
-
return getColor('neutralHue', 300, props.theme);
|
|
217
|
-
});
|
|
66
|
+
})(["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 => getColor('neutralHue', 300, props.theme));
|
|
218
67
|
StyledLine.defaultProps = {
|
|
219
68
|
theme: DEFAULT_THEME
|
|
220
69
|
};
|
|
221
70
|
|
|
222
|
-
|
|
223
|
-
|
|
71
|
+
const COMPONENT_ID$i = 'accordions.step';
|
|
72
|
+
const StyledStep = styled.li.attrs({
|
|
224
73
|
'data-garden-id': COMPONENT_ID$i,
|
|
225
|
-
'data-garden-version': '8.
|
|
74
|
+
'data-garden-version': '8.58.0'
|
|
226
75
|
}).withConfig({
|
|
227
76
|
displayName: "StyledStep",
|
|
228
77
|
componentId: "sc-12fiwtz-0"
|
|
229
|
-
})(["position:", ";flex:", ";min-width:", ";&:last-of-type ", "{display:", ";}&:first-of-type ", "{display:", ";}&:not(:last-of-type) ", "{border-", ":", ";border-color:", ";}", ";"],
|
|
230
|
-
return props.isHorizontal && 'relative';
|
|
231
|
-
}, function (props) {
|
|
232
|
-
return props.isHorizontal && '1';
|
|
233
|
-
}, function (props) {
|
|
234
|
-
return props.isHorizontal && "".concat(props.theme.space.base * 15, "px");
|
|
235
|
-
}, StyledLine, function (props) {
|
|
236
|
-
return props.theme.rtl && 'none';
|
|
237
|
-
}, StyledLine, function (props) {
|
|
238
|
-
return !props.theme.rtl && 'none';
|
|
239
|
-
}, StyledContent, function (props) {
|
|
240
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
241
|
-
}, function (props) {
|
|
242
|
-
return props.theme.borders.sm;
|
|
243
|
-
}, function (props) {
|
|
244
|
-
return getColor('neutralHue', 300, props.theme);
|
|
245
|
-
}, function (props) {
|
|
246
|
-
return retrieveComponentStyles(COMPONENT_ID$i, props);
|
|
247
|
-
});
|
|
78
|
+
})(["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 => getColor('neutralHue', 300, props.theme), props => retrieveComponentStyles(COMPONENT_ID$i, props));
|
|
248
79
|
StyledStep.defaultProps = {
|
|
249
80
|
theme: DEFAULT_THEME
|
|
250
81
|
};
|
|
251
82
|
|
|
252
|
-
|
|
253
|
-
|
|
83
|
+
const COMPONENT_ID$h = 'accordions.step_inner_content';
|
|
84
|
+
const StyledInnerContent = styled.div.attrs({
|
|
254
85
|
'data-garden-id': COMPONENT_ID$h,
|
|
255
|
-
'data-garden-version': '8.
|
|
86
|
+
'data-garden-version': '8.58.0'
|
|
256
87
|
}).withConfig({
|
|
257
88
|
displayName: "StyledInnerContent",
|
|
258
89
|
componentId: "sc-1xs9fh7-0"
|
|
259
|
-
})(["transition:max-height 0.25s ease-in-out;overflow:hidden;max-height:", ";line-height:", ";color:", ";font-size:", ";", ";"],
|
|
260
|
-
return !props.isActive && '0 !important';
|
|
261
|
-
}, function (props) {
|
|
262
|
-
return getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md);
|
|
263
|
-
}, function (props) {
|
|
264
|
-
return props.theme.colors.foreground;
|
|
265
|
-
}, function (props) {
|
|
266
|
-
return props.theme.fontSizes.md;
|
|
267
|
-
}, function (props) {
|
|
268
|
-
return retrieveComponentStyles(COMPONENT_ID$h, props);
|
|
269
|
-
});
|
|
90
|
+
})(["transition:max-height 0.25s ease-in-out;overflow:hidden;max-height:", ";line-height:", ";color:", ";font-size:", ";", ";"], props => !props.isActive && '0 !important', props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.colors.foreground, props => props.theme.fontSizes.md, props => retrieveComponentStyles(COMPONENT_ID$h, props));
|
|
270
91
|
StyledInnerContent.defaultProps = {
|
|
271
92
|
theme: DEFAULT_THEME
|
|
272
93
|
};
|
|
273
94
|
|
|
274
|
-
|
|
275
|
-
|
|
95
|
+
const COMPONENT_ID$g = 'accordions.stepper';
|
|
96
|
+
const StyledStepper = styled.ol.attrs({
|
|
276
97
|
'data-garden-id': COMPONENT_ID$g,
|
|
277
|
-
'data-garden-version': '8.
|
|
98
|
+
'data-garden-version': '8.58.0'
|
|
278
99
|
}).withConfig({
|
|
279
100
|
displayName: "StyledStepper",
|
|
280
101
|
componentId: "sc-dsxw0f-0"
|
|
281
|
-
})(["display:", ";margin:0;padding:0;list-style:none;", ";"],
|
|
282
|
-
return props.isHorizontal && 'flex';
|
|
283
|
-
}, function (props) {
|
|
284
|
-
return retrieveComponentStyles(COMPONENT_ID$g, props);
|
|
285
|
-
});
|
|
102
|
+
})(["display:", ";margin:0;padding:0;list-style:none;", ";"], props => props.isHorizontal && 'flex', props => retrieveComponentStyles(COMPONENT_ID$g, props));
|
|
286
103
|
StyledStepper.defaultProps = {
|
|
287
104
|
theme: DEFAULT_THEME
|
|
288
105
|
};
|
|
289
106
|
|
|
290
|
-
|
|
291
|
-
|
|
107
|
+
const COMPONENT_ID$f = 'accordions.step_icon';
|
|
108
|
+
const StyledIconFlexContainer = styled.div.withConfig({
|
|
292
109
|
displayName: "StyledIcon__StyledIconFlexContainer",
|
|
293
110
|
componentId: "sc-v20nz9-0"
|
|
294
111
|
})(["display:flex;flex-basis:100%;justify-content:center;width:100%;"]);
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
return css(["margin-bottom:", ";margin-", ":", ";width:", ";min-width:", ";height:", ";min-height:", ";line-height:", ";font-size:", ";"], props.isHorizontal &&
|
|
112
|
+
const sizeStyles = props => {
|
|
113
|
+
const size = `${props.theme.space.base * 6}px`;
|
|
114
|
+
const fontSize = props.theme.fontSizes.sm;
|
|
115
|
+
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);
|
|
299
116
|
};
|
|
300
|
-
|
|
117
|
+
const colorStyles$2 = props => {
|
|
301
118
|
return css(["background:", ";color:", ";"], props.isActive ? getColor('neutralHue', 600, props.theme) : getColor('neutralHue', 200, props.theme), props.isActive ? props.theme.colors.background : props.theme.colors.foreground);
|
|
302
119
|
};
|
|
303
|
-
|
|
120
|
+
const StyledIcon = styled.div.attrs({
|
|
304
121
|
'data-garden-id': COMPONENT_ID$f,
|
|
305
|
-
'data-garden-version': '8.
|
|
122
|
+
'data-garden-version': '8.58.0'
|
|
306
123
|
}).withConfig({
|
|
307
124
|
displayName: "StyledIcon",
|
|
308
125
|
componentId: "sc-v20nz9-1"
|
|
309
|
-
})(["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$2,
|
|
310
|
-
return retrieveComponentStyles(COMPONENT_ID$f, props);
|
|
311
|
-
});
|
|
126
|
+
})(["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$2, props => retrieveComponentStyles(COMPONENT_ID$f, props));
|
|
312
127
|
StyledIconFlexContainer.defaultProps = {
|
|
313
128
|
theme: DEFAULT_THEME
|
|
314
129
|
};
|
|
@@ -316,72 +131,50 @@ StyledIcon.defaultProps = {
|
|
|
316
131
|
theme: DEFAULT_THEME
|
|
317
132
|
};
|
|
318
133
|
|
|
319
|
-
|
|
320
|
-
|
|
134
|
+
const COMPONENT_ID$e = 'accordions.step_label';
|
|
135
|
+
const StyledLabel = styled.div.attrs({
|
|
321
136
|
'data-garden-id': COMPONENT_ID$e,
|
|
322
|
-
'data-garden-version': '8.
|
|
137
|
+
'data-garden-version': '8.58.0'
|
|
323
138
|
}).withConfig({
|
|
324
139
|
displayName: "StyledLabel",
|
|
325
140
|
componentId: "sc-1o82llj-0"
|
|
326
|
-
})(["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:", ";", ";"],
|
|
327
|
-
return !props.isHorizontal && 'flex';
|
|
328
|
-
}, function (props) {
|
|
329
|
-
return !props.isHorizontal && 'center';
|
|
330
|
-
}, function (props) {
|
|
331
|
-
return props.isHorizontal && 'center';
|
|
332
|
-
}, function (props) {
|
|
333
|
-
return getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md);
|
|
334
|
-
}, function (props) {
|
|
335
|
-
return props.isActive ? props.theme.colors.foreground : getColor('neutralHue', 600, props.theme);
|
|
336
|
-
}, function (props) {
|
|
337
|
-
return props.theme.fontSizes.md;
|
|
338
|
-
}, function (props) {
|
|
339
|
-
return props.isActive && 600;
|
|
340
|
-
}, function (props) {
|
|
341
|
-
return retrieveComponentStyles(COMPONENT_ID$e, props);
|
|
342
|
-
});
|
|
141
|
+
})(["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 ? props.theme.colors.foreground : getColor('neutralHue', 600, props.theme), props => props.theme.fontSizes.md, props => props.isActive && 600, props => retrieveComponentStyles(COMPONENT_ID$e, props));
|
|
343
142
|
StyledLabel.defaultProps = {
|
|
344
143
|
theme: DEFAULT_THEME
|
|
345
144
|
};
|
|
346
145
|
|
|
347
|
-
|
|
348
|
-
|
|
146
|
+
const COMPONENT_ID$d = 'accordions.step_label_text';
|
|
147
|
+
const StyledLabelText = styled.div.attrs({
|
|
349
148
|
'data-garden-id': COMPONENT_ID$d,
|
|
350
|
-
'data-garden-version': '8.
|
|
149
|
+
'data-garden-version': '8.58.0'
|
|
351
150
|
}).withConfig({
|
|
352
151
|
displayName: "StyledLabelText",
|
|
353
152
|
componentId: "sc-111m5zo-0"
|
|
354
|
-
})(["display:", ";padding:", ";word-wrap:", ";"],
|
|
355
|
-
return props.isHidden && 'none';
|
|
356
|
-
}, function (props) {
|
|
357
|
-
return props.isHorizontal && "0 ".concat(props.theme.space.base * 3, "px");
|
|
358
|
-
}, function (props) {
|
|
359
|
-
return props.isHorizontal && 'break-word';
|
|
360
|
-
});
|
|
153
|
+
})(["display:", ";padding:", ";word-wrap:", ";"], props => props.isHidden && 'none', props => props.isHorizontal && `0 ${props.theme.space.base * 3}px`, props => props.isHorizontal && 'break-word');
|
|
361
154
|
StyledLabelText.defaultProps = {
|
|
362
155
|
theme: DEFAULT_THEME
|
|
363
156
|
};
|
|
364
157
|
|
|
365
|
-
|
|
366
|
-
|
|
158
|
+
const COMPONENT_ID$c = 'accordions.accordion';
|
|
159
|
+
const StyledAccordion = styled.div.attrs({
|
|
367
160
|
'data-garden-id': COMPONENT_ID$c,
|
|
368
|
-
'data-garden-version': '8.
|
|
161
|
+
'data-garden-version': '8.58.0'
|
|
369
162
|
}).withConfig({
|
|
370
163
|
displayName: "StyledAccordion",
|
|
371
164
|
componentId: "sc-niv9ic-0"
|
|
372
|
-
})(["", ";"],
|
|
373
|
-
return retrieveComponentStyles(COMPONENT_ID$c, props);
|
|
374
|
-
});
|
|
165
|
+
})(["", ";"], props => retrieveComponentStyles(COMPONENT_ID$c, props));
|
|
375
166
|
StyledAccordion.defaultProps = {
|
|
376
167
|
theme: DEFAULT_THEME
|
|
377
168
|
};
|
|
378
169
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
170
|
+
const COMPONENT_ID$b = 'accordions.panel';
|
|
171
|
+
const paddingStyles = props => {
|
|
172
|
+
const {
|
|
173
|
+
base
|
|
174
|
+
} = props.theme.space;
|
|
175
|
+
let paddingTop = base * 2;
|
|
176
|
+
let paddingHorizontal = base * 5;
|
|
177
|
+
let paddingBottom = base * 8;
|
|
385
178
|
if (props.isCompact) {
|
|
386
179
|
paddingTop = base * 2;
|
|
387
180
|
paddingHorizontal = base * 3;
|
|
@@ -393,341 +186,254 @@ var paddingStyles = function paddingStyles(props) {
|
|
|
393
186
|
}
|
|
394
187
|
return css(["transition:", ";padding:", "px ", "px ", "px;"], props.isAnimated && 'padding 0.25s ease-in-out', paddingTop, paddingHorizontal, paddingBottom);
|
|
395
188
|
};
|
|
396
|
-
|
|
189
|
+
const StyledPanel = styled.section.attrs({
|
|
397
190
|
'data-garden-id': COMPONENT_ID$b,
|
|
398
|
-
'data-garden-version': '8.
|
|
191
|
+
'data-garden-version': '8.58.0'
|
|
399
192
|
}).withConfig({
|
|
400
193
|
displayName: "StyledPanel",
|
|
401
194
|
componentId: "sc-1piryze-0"
|
|
402
|
-
})(["", ";border-bottom:", ";", ";"], paddingStyles,
|
|
403
|
-
return "".concat(props.theme.borders.sm, " ").concat(props.isBare ? 'transparent' : getColor('neutralHue', 300, props.theme));
|
|
404
|
-
}, function (props) {
|
|
405
|
-
return retrieveComponentStyles(COMPONENT_ID$b, props);
|
|
406
|
-
});
|
|
195
|
+
})(["", ";border-bottom:", ";", ";"], paddingStyles, props => `${props.theme.borders.sm} ${props.isBare ? 'transparent' : getColor('neutralHue', 300, props.theme)}`, props => retrieveComponentStyles(COMPONENT_ID$b, props));
|
|
407
196
|
StyledPanel.defaultProps = {
|
|
408
197
|
isAnimated: true,
|
|
409
198
|
theme: DEFAULT_THEME
|
|
410
199
|
};
|
|
411
200
|
|
|
412
|
-
|
|
413
|
-
|
|
201
|
+
const COMPONENT_ID$a = 'accordions.section';
|
|
202
|
+
const StyledSection = styled.div.attrs({
|
|
414
203
|
'data-garden-id': COMPONENT_ID$a,
|
|
415
|
-
'data-garden-version': '8.
|
|
204
|
+
'data-garden-version': '8.58.0'
|
|
416
205
|
}).withConfig({
|
|
417
206
|
displayName: "StyledSection",
|
|
418
207
|
componentId: "sc-v2t9bd-0"
|
|
419
|
-
})(["&:last-child ", "{border:none;}", ";"], StyledPanel,
|
|
420
|
-
return retrieveComponentStyles(COMPONENT_ID$a, props);
|
|
421
|
-
});
|
|
208
|
+
})(["&:last-child ", "{border:none;}", ";"], StyledPanel, props => retrieveComponentStyles(COMPONENT_ID$a, props));
|
|
422
209
|
StyledSection.defaultProps = {
|
|
423
210
|
theme: DEFAULT_THEME
|
|
424
211
|
};
|
|
425
212
|
|
|
426
|
-
|
|
427
|
-
|
|
213
|
+
const COMPONENT_ID$9 = 'accordions.header';
|
|
214
|
+
const StyledHeader = styled.div.attrs({
|
|
428
215
|
'data-garden-id': COMPONENT_ID$9,
|
|
429
|
-
'data-garden-version': '8.
|
|
216
|
+
'data-garden-version': '8.58.0'
|
|
430
217
|
}).withConfig({
|
|
431
218
|
displayName: "StyledHeader",
|
|
432
219
|
componentId: "sc-2c6rbr-0"
|
|
433
|
-
})(["display:flex;align-items:center;box-shadow:", ";font-size:", ";&:hover{cursor:", ";}", ";"],
|
|
434
|
-
return props.isFocused && "".concat(props.theme.shadows.md(getColor('primaryHue', 600, props.theme, 0.35)), " inset");
|
|
435
|
-
}, function (props) {
|
|
436
|
-
return props.theme.fontSizes.md;
|
|
437
|
-
}, function (props) {
|
|
438
|
-
return (props.isCollapsible || !props.isExpanded) && 'pointer';
|
|
439
|
-
}, function (props) {
|
|
440
|
-
return retrieveComponentStyles(COMPONENT_ID$9, props);
|
|
441
|
-
});
|
|
220
|
+
})(["display:flex;align-items:center;box-shadow:", ";font-size:", ";&:hover{cursor:", ";}", ";"], props => props.isFocused && `${props.theme.shadows.md(getColor('primaryHue', 600, props.theme, 0.35))} inset`, props => props.theme.fontSizes.md, props => (props.isCollapsible || !props.isExpanded) && 'pointer', props => retrieveComponentStyles(COMPONENT_ID$9, props));
|
|
442
221
|
StyledHeader.defaultProps = {
|
|
443
222
|
theme: DEFAULT_THEME
|
|
444
223
|
};
|
|
445
224
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
225
|
+
const COMPONENT_ID$8 = 'accordions.button';
|
|
226
|
+
const colorStyles$1 = props => {
|
|
227
|
+
const showColor = props.isCollapsible || !props.isExpanded;
|
|
228
|
+
let color = props.theme.colors.foreground;
|
|
450
229
|
if (showColor && props.isHovered) {
|
|
451
230
|
color = getColor('primaryHue', 600, props.theme);
|
|
452
231
|
}
|
|
453
232
|
return css(["color:", ";&:hover{cursor:", ";color:", ";}"], color, showColor && 'pointer', showColor && color);
|
|
454
233
|
};
|
|
455
|
-
|
|
234
|
+
const StyledButton = styled.button.attrs({
|
|
456
235
|
'data-garden-id': COMPONENT_ID$8,
|
|
457
|
-
'data-garden-version': '8.
|
|
236
|
+
'data-garden-version': '8.58.0'
|
|
458
237
|
}).withConfig({
|
|
459
238
|
displayName: "StyledButton",
|
|
460
239
|
componentId: "sc-xj3hy7-0"
|
|
461
|
-
})(["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:", ";}", ";"],
|
|
462
|
-
return props.isCompact ? "".concat(props.theme.space.base * 2, "px ").concat(props.theme.space.base * 3, "px") : "".concat(props.theme.space.base * 5, "px");
|
|
463
|
-
}, function (props) {
|
|
464
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
465
|
-
}, function (props) {
|
|
466
|
-
return getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md);
|
|
467
|
-
}, function (props) {
|
|
468
|
-
return props.theme.fontSizes.md;
|
|
469
|
-
}, function (props) {
|
|
470
|
-
return props.theme.fontWeights.semibold;
|
|
471
|
-
}, colorStyles$1, function (props) {
|
|
472
|
-
return (props.isCollapsible || !props.isExpanded) && 'pointer';
|
|
473
|
-
}, function (props) {
|
|
474
|
-
return retrieveComponentStyles(COMPONENT_ID$8, props);
|
|
475
|
-
});
|
|
240
|
+
})(["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$8, props));
|
|
476
241
|
StyledButton.defaultProps = {
|
|
477
242
|
theme: DEFAULT_THEME
|
|
478
243
|
};
|
|
479
244
|
|
|
480
|
-
|
|
481
|
-
|
|
245
|
+
const COMPONENT_ID$7 = 'accordions.step_inner_panel';
|
|
246
|
+
const StyledInnerPanel = styled.div.attrs({
|
|
482
247
|
'data-garden-id': COMPONENT_ID$7,
|
|
483
|
-
'data-garden-version': '8.
|
|
248
|
+
'data-garden-version': '8.58.0'
|
|
484
249
|
}).withConfig({
|
|
485
250
|
displayName: "StyledInnerPanel",
|
|
486
251
|
componentId: "sc-8nbueg-0"
|
|
487
|
-
})(["transition:", ";max-height:", ";overflow:hidden;line-height:", ";font-size:", ";", ";"],
|
|
488
|
-
return props.isAnimated && 'max-height 0.25s ease-in-out';
|
|
489
|
-
}, function (props) {
|
|
490
|
-
return !props.isExpanded && '0 !important';
|
|
491
|
-
}, function (props) {
|
|
492
|
-
return getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md);
|
|
493
|
-
}, function (props) {
|
|
494
|
-
return props.theme.fontSizes.md;
|
|
495
|
-
}, function (props) {
|
|
496
|
-
return retrieveComponentStyles(COMPONENT_ID$7, props);
|
|
497
|
-
});
|
|
252
|
+
})(["transition:", ";max-height:", ";overflow:hidden;line-height:", ";font-size:", ";", ";"], props => props.isAnimated && 'max-height 0.25s ease-in-out', props => !props.isExpanded && '0 !important', props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => retrieveComponentStyles(COMPONENT_ID$7, props));
|
|
498
253
|
StyledInnerPanel.defaultProps = {
|
|
499
254
|
isAnimated: true,
|
|
500
255
|
theme: DEFAULT_THEME
|
|
501
256
|
};
|
|
502
257
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
var color = getColor('neutralHue', 600, props.theme);
|
|
258
|
+
const COMPONENT_ID$6 = 'accordions.rotate_icon';
|
|
259
|
+
const colorStyles = props => {
|
|
260
|
+
const showColor = props.isCollapsible || !props.isRotated;
|
|
261
|
+
let color = getColor('neutralHue', 600, props.theme);
|
|
508
262
|
if (showColor && props.isHovered) {
|
|
509
263
|
color = getColor('primaryHue', 600, props.theme);
|
|
510
264
|
}
|
|
511
265
|
return css(["color:", ";&:hover{color:", ";}"], color, showColor && color);
|
|
512
266
|
};
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
267
|
+
const StyledRotateIcon = styled(
|
|
268
|
+
_ref => {
|
|
269
|
+
let {
|
|
270
|
+
children,
|
|
271
|
+
isRotated,
|
|
272
|
+
isHovered,
|
|
273
|
+
isCompact,
|
|
274
|
+
isCollapsible,
|
|
275
|
+
...props
|
|
276
|
+
} = _ref;
|
|
521
277
|
return cloneElement(Children.only(children), props);
|
|
522
278
|
}).attrs({
|
|
523
279
|
'data-garden-id': COMPONENT_ID$6,
|
|
524
|
-
'data-garden-version': '8.
|
|
280
|
+
'data-garden-version': '8.58.0'
|
|
525
281
|
}).withConfig({
|
|
526
282
|
displayName: "StyledRotateIcon",
|
|
527
283
|
componentId: "sc-hp435q-0"
|
|
528
|
-
})(["transform:", ";transition:transform 0.25s ease-in-out,color 0.1s ease-in-out;box-sizing:content-box;padding:", ";width:", ";height:", ";vertical-align:middle;", " ", ";"],
|
|
529
|
-
return props.isRotated && "rotate(".concat(props.theme.rtl ? '-' : '+', "180deg)");
|
|
530
|
-
}, function (props) {
|
|
531
|
-
return props.isCompact ? "".concat(props.theme.space.base * 1.5, "px ").concat(props.theme.space.base * 3, "px") : "".concat(props.theme.space.base * 5, "px");
|
|
532
|
-
}, function (props) {
|
|
533
|
-
return props.theme.iconSizes.md;
|
|
534
|
-
}, function (props) {
|
|
535
|
-
return props.theme.iconSizes.md;
|
|
536
|
-
}, colorStyles, function (props) {
|
|
537
|
-
return retrieveComponentStyles(COMPONENT_ID$6, props);
|
|
538
|
-
});
|
|
284
|
+
})(["transform:", ";transition:transform 0.25s ease-in-out,color 0.1s ease-in-out;box-sizing:content-box;padding:", ";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, colorStyles, props => retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
539
285
|
StyledRotateIcon.defaultProps = {
|
|
540
286
|
theme: DEFAULT_THEME
|
|
541
287
|
};
|
|
542
288
|
|
|
543
|
-
|
|
544
|
-
|
|
289
|
+
const COMPONENT_ID$5 = 'timeline';
|
|
290
|
+
const StyledTimeline = styled.ol.attrs({
|
|
545
291
|
'data-garden-id': COMPONENT_ID$5,
|
|
546
|
-
'data-garden-version': '8.
|
|
292
|
+
'data-garden-version': '8.58.0'
|
|
547
293
|
}).withConfig({
|
|
548
294
|
displayName: "StyledTimeline",
|
|
549
295
|
componentId: "sc-pig5kv-0"
|
|
550
|
-
})(["margin:0;padding:0;list-style:none;", ";"],
|
|
551
|
-
return retrieveComponentStyles(COMPONENT_ID$5, props);
|
|
552
|
-
});
|
|
296
|
+
})(["margin:0;padding:0;list-style:none;", ";"], props => retrieveComponentStyles(COMPONENT_ID$5, props));
|
|
553
297
|
StyledTimeline.defaultProps = {
|
|
554
298
|
theme: DEFAULT_THEME
|
|
555
299
|
};
|
|
556
300
|
|
|
557
|
-
|
|
558
|
-
|
|
301
|
+
const COMPONENT_ID$4 = 'timeline.content.separator';
|
|
302
|
+
const StyledSeparator = styled.div.attrs({
|
|
559
303
|
'data-garden-id': COMPONENT_ID$4,
|
|
560
|
-
'data-garden-version': '8.
|
|
304
|
+
'data-garden-version': '8.58.0'
|
|
561
305
|
}).withConfig({
|
|
562
306
|
displayName: "StyledSeparator",
|
|
563
307
|
componentId: "sc-fki51e-0"
|
|
564
|
-
})(["display:flex;position:relative;justify-content:center;padding:", ";&::after{position:absolute;border-left:", ";height:100%;content:'';}", ";"],
|
|
565
|
-
return "".concat(props.theme.space.base * 5, "px ").concat(props.theme.space.base, "px");
|
|
566
|
-
}, function (props) {
|
|
567
|
-
return "".concat(props.theme.borders.sm, " ").concat(getColor('neutralHue', 600, props.theme));
|
|
568
|
-
}, function (props) {
|
|
569
|
-
return retrieveComponentStyles(COMPONENT_ID$4, props);
|
|
570
|
-
});
|
|
308
|
+
})(["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} ${getColor('neutralHue', 600, props.theme)}`, props => retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
571
309
|
StyledSeparator.defaultProps = {
|
|
572
310
|
theme: DEFAULT_THEME
|
|
573
311
|
};
|
|
574
312
|
|
|
575
|
-
|
|
576
|
-
|
|
313
|
+
const COMPONENT_ID$3 = 'timeline.content';
|
|
314
|
+
const StyledTimelineContent = styled.div.attrs({
|
|
577
315
|
'data-garden-id': COMPONENT_ID$3,
|
|
578
|
-
'data-garden-version': '8.
|
|
316
|
+
'data-garden-version': '8.58.0'
|
|
579
317
|
}).withConfig({
|
|
580
318
|
displayName: "StyledContent__StyledTimelineContent",
|
|
581
319
|
componentId: "sc-19phgu1-0"
|
|
582
|
-
})(["flex:1;padding:", ";", ";"],
|
|
583
|
-
return "".concat(props.theme.space.base * 5, "px ").concat(props.theme.space.base * 4, "px");
|
|
584
|
-
}, function (props) {
|
|
585
|
-
return retrieveComponentStyles(COMPONENT_ID$3, props);
|
|
586
|
-
});
|
|
320
|
+
})(["flex:1;padding:", ";", ";"], props => `${props.theme.space.base * 5}px ${props.theme.space.base * 4}px`, props => retrieveComponentStyles(COMPONENT_ID$3, props));
|
|
587
321
|
StyledTimelineContent.defaultProps = {
|
|
588
322
|
theme: DEFAULT_THEME
|
|
589
323
|
};
|
|
590
324
|
|
|
591
|
-
|
|
592
|
-
|
|
325
|
+
const COMPONENT_ID$2 = 'timeline.opposite.content';
|
|
326
|
+
const StyledOppositeContent = styled.div.attrs({
|
|
593
327
|
'data-garden-id': COMPONENT_ID$2,
|
|
594
|
-
'data-garden-version': '8.
|
|
328
|
+
'data-garden-version': '8.58.0'
|
|
595
329
|
}).withConfig({
|
|
596
330
|
displayName: "StyledOppositeContent",
|
|
597
331
|
componentId: "sc-jurh2k-0"
|
|
598
|
-
})(["flex:1;padding:", ";text-align:", ";", ";"],
|
|
599
|
-
return "".concat(props.theme.space.base * 5, "px ").concat(props.theme.space.base * 4, "px");
|
|
600
|
-
}, function (props) {
|
|
601
|
-
return props.theme.rtl ? 'left' : 'right';
|
|
602
|
-
}, function (props) {
|
|
603
|
-
return retrieveComponentStyles(COMPONENT_ID$2, props);
|
|
604
|
-
});
|
|
332
|
+
})(["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$2, props));
|
|
605
333
|
StyledOppositeContent.defaultProps = {
|
|
606
334
|
theme: DEFAULT_THEME
|
|
607
335
|
};
|
|
608
336
|
|
|
609
|
-
|
|
610
|
-
|
|
337
|
+
const COMPONENT_ID$1 = 'timeline.item';
|
|
338
|
+
const StyledTimelineItem = styled.li.attrs({
|
|
611
339
|
'data-garden-id': COMPONENT_ID$1,
|
|
612
|
-
'data-garden-version': '8.
|
|
340
|
+
'data-garden-version': '8.58.0'
|
|
613
341
|
}).withConfig({
|
|
614
342
|
displayName: "StyledItem__StyledTimelineItem",
|
|
615
343
|
componentId: "sc-5mcnzm-0"
|
|
616
|
-
})(["display:flex;position:relative;line-height:", ";color:", ";font-size:", ";&:last-of-type ", "::after{display:none;}", " ", " ", ";"],
|
|
617
|
-
return getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md);
|
|
618
|
-
}, function (props) {
|
|
619
|
-
return props.theme.colors.foreground;
|
|
620
|
-
}, function (props) {
|
|
621
|
-
return props.theme.fontSizes.md;
|
|
622
|
-
}, StyledSeparator, function (props) {
|
|
623
|
-
return !props.hasOppositeContent && props.isAlternate && css(["&:before{flex:1;content:'';padding:", "px;}"], props.theme.space.base * 4);
|
|
624
|
-
}, function (props) {
|
|
625
|
-
return 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');
|
|
626
|
-
}, function (props) {
|
|
627
|
-
return retrieveComponentStyles(COMPONENT_ID$1, props);
|
|
628
|
-
});
|
|
344
|
+
})(["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 => props.theme.colors.foreground, props => props.theme.fontSizes.md, StyledSeparator, props => !props.hasOppositeContent && props.isAlternate && css(["&:before{flex:1;content:'';padding:", "px;}"], 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$1, props));
|
|
629
345
|
StyledTimelineItem.defaultProps = {
|
|
630
346
|
theme: DEFAULT_THEME
|
|
631
347
|
};
|
|
632
348
|
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
349
|
+
const COMPONENT_ID = 'timeline.icon';
|
|
350
|
+
const StyledItemIcon = styled(_ref => {
|
|
351
|
+
let {
|
|
352
|
+
surfaceColor,
|
|
353
|
+
children,
|
|
354
|
+
...props
|
|
355
|
+
} = _ref;
|
|
639
356
|
return cloneElement(Children.only(children), props);
|
|
640
357
|
}).attrs({
|
|
641
358
|
'data-garden-id': COMPONENT_ID,
|
|
642
|
-
'data-garden-version': '8.
|
|
359
|
+
'data-garden-version': '8.58.0'
|
|
643
360
|
}).withConfig({
|
|
644
361
|
displayName: "StyledItemIcon",
|
|
645
362
|
componentId: "sc-vz2l6e-0"
|
|
646
|
-
})(["z-index:1;box-sizing:content-box;background-color:", ";padding:", "px 0;width:", ";height:", ";color:", ";", ";"],
|
|
647
|
-
return props.surfaceColor || props.theme.colors.background;
|
|
648
|
-
}, function (props) {
|
|
649
|
-
return props.theme.space.base;
|
|
650
|
-
}, function (props) {
|
|
651
|
-
return math("".concat(props.theme.iconSizes.sm, " + 1"));
|
|
652
|
-
}, function (props) {
|
|
653
|
-
return math("".concat(props.theme.iconSizes.sm, " + 1"));
|
|
654
|
-
}, function (props) {
|
|
655
|
-
return getColor('neutralHue', 600, props.theme);
|
|
656
|
-
}, function (props) {
|
|
657
|
-
return retrieveComponentStyles(COMPONENT_ID, props);
|
|
658
|
-
});
|
|
363
|
+
})(["z-index:1;box-sizing:content-box;background-color:", ";padding:", "px 0;width:", ";height:", ";color:", ";", ";"], props => props.surfaceColor || props.theme.colors.background, props => props.theme.space.base, props => math(`${props.theme.iconSizes.sm} + 1`), props => math(`${props.theme.iconSizes.sm} + 1`), props => getColor('neutralHue', 600, props.theme), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
659
364
|
StyledItemIcon.defaultProps = {
|
|
660
365
|
theme: DEFAULT_THEME
|
|
661
366
|
};
|
|
662
367
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
368
|
+
const StepperContext = createContext(undefined);
|
|
369
|
+
const useStepperContext = () => {
|
|
370
|
+
const context = useContext(StepperContext);
|
|
666
371
|
if (context === undefined) {
|
|
667
372
|
throw new Error('This component must be rendered within a Stepper component');
|
|
668
373
|
}
|
|
669
374
|
return context;
|
|
670
375
|
};
|
|
671
376
|
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
377
|
+
const StepContext = createContext(undefined);
|
|
378
|
+
const useStepContext = () => {
|
|
379
|
+
const context = useContext(StepContext);
|
|
675
380
|
if (context === undefined) {
|
|
676
381
|
throw new Error('This component must be rendered within a Stepper.Step component');
|
|
677
382
|
}
|
|
678
383
|
return context;
|
|
679
384
|
};
|
|
680
385
|
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
386
|
+
const AccordionContext = createContext(undefined);
|
|
387
|
+
const useAccordionContext = () => {
|
|
388
|
+
const context = useContext(AccordionContext);
|
|
684
389
|
if (context === undefined) {
|
|
685
390
|
throw new Error('This component must be rendered within a Accordion component');
|
|
686
391
|
}
|
|
687
392
|
return context;
|
|
688
393
|
};
|
|
689
394
|
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
395
|
+
const SectionContext = createContext(undefined);
|
|
396
|
+
const useSectionContext = () => {
|
|
397
|
+
const context = useContext(SectionContext);
|
|
693
398
|
if (context === undefined) {
|
|
694
399
|
throw new Error('This component must be rendered within a Accordion.Section component');
|
|
695
400
|
}
|
|
696
401
|
return context;
|
|
697
402
|
};
|
|
698
403
|
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
404
|
+
const HeaderContext = createContext(undefined);
|
|
405
|
+
const useHeaderContext = () => {
|
|
406
|
+
const context = useContext(HeaderContext);
|
|
702
407
|
if (context === undefined) {
|
|
703
408
|
throw new Error('This component must be rendered within a Accordion.Header component');
|
|
704
409
|
}
|
|
705
410
|
return context;
|
|
706
411
|
};
|
|
707
412
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
413
|
+
const TimelineContext = createContext(undefined);
|
|
414
|
+
const useTimelineContext = () => {
|
|
415
|
+
const context = useContext(TimelineContext);
|
|
711
416
|
if (context === undefined) {
|
|
712
417
|
throw new Error('This component must be rendered within a Timeline component');
|
|
713
418
|
}
|
|
714
419
|
return context;
|
|
715
420
|
};
|
|
716
421
|
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
422
|
+
const TimelineItemContext = createContext(undefined);
|
|
423
|
+
const useTimelineItemContext = () => {
|
|
424
|
+
const context = useContext(TimelineItemContext);
|
|
720
425
|
if (context === undefined) {
|
|
721
426
|
throw new Error('This component must be rendered within a Timeline.Item component');
|
|
722
427
|
}
|
|
723
428
|
return context;
|
|
724
429
|
};
|
|
725
430
|
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
431
|
+
const SectionComponent = forwardRef((props, ref) => {
|
|
432
|
+
const {
|
|
433
|
+
currentIndexRef
|
|
434
|
+
} = useAccordionContext();
|
|
435
|
+
const sectionIndexRef = useRef(currentIndexRef.current++);
|
|
436
|
+
const sectionIndex = sectionIndexRef.current;
|
|
731
437
|
return React__default.createElement(SectionContext.Provider, {
|
|
732
438
|
value: sectionIndex
|
|
733
439
|
}, React__default.createElement(StyledSection, _extends$3({
|
|
@@ -735,7 +441,7 @@ var SectionComponent = forwardRef(function (props, ref) {
|
|
|
735
441
|
}, props)));
|
|
736
442
|
});
|
|
737
443
|
SectionComponent.displayName = 'Accordion.Section';
|
|
738
|
-
|
|
444
|
+
const Section = SectionComponent;
|
|
739
445
|
|
|
740
446
|
var _path$1;
|
|
741
447
|
|
|
@@ -748,109 +454,97 @@ var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
|
748
454
|
height: 16,
|
|
749
455
|
focusable: "false",
|
|
750
456
|
viewBox: "0 0 16 16",
|
|
751
|
-
"aria-hidden": "true"
|
|
457
|
+
"aria-hidden": "true",
|
|
458
|
+
role: "img"
|
|
752
459
|
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
753
460
|
fill: "currentColor",
|
|
754
461
|
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"
|
|
755
462
|
})));
|
|
756
463
|
};
|
|
757
464
|
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
var _getTriggerProps = getTriggerProps({
|
|
465
|
+
const HeaderComponent = forwardRef((props, ref) => {
|
|
466
|
+
const {
|
|
467
|
+
level: ariaLevel,
|
|
468
|
+
isCompact,
|
|
469
|
+
isCollapsible,
|
|
470
|
+
getHeaderProps,
|
|
471
|
+
getTriggerProps,
|
|
472
|
+
expandedSections
|
|
473
|
+
} = useAccordionContext();
|
|
474
|
+
const {
|
|
475
|
+
onClick,
|
|
476
|
+
onFocus,
|
|
477
|
+
onBlur,
|
|
478
|
+
onMouseOver,
|
|
479
|
+
onMouseOut,
|
|
480
|
+
children,
|
|
481
|
+
...other
|
|
482
|
+
} = props;
|
|
483
|
+
const sectionIndex = useSectionContext();
|
|
484
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
485
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
486
|
+
const isExpanded = expandedSections.includes(sectionIndex);
|
|
487
|
+
const {
|
|
488
|
+
onClick: onTriggerClick,
|
|
489
|
+
onKeyDown,
|
|
490
|
+
...otherTriggerProps
|
|
491
|
+
} = getTriggerProps({
|
|
786
492
|
type: 'button',
|
|
787
493
|
index: sectionIndex
|
|
788
|
-
})
|
|
789
|
-
|
|
790
|
-
_getTriggerProps.onKeyDown;
|
|
791
|
-
var otherTriggerProps = _objectWithoutProperties(_getTriggerProps, _excluded2);
|
|
792
|
-
var onHeaderFocus = function onHeaderFocus(e) {
|
|
494
|
+
});
|
|
495
|
+
const onHeaderFocus = e => {
|
|
793
496
|
e.persist();
|
|
794
|
-
setTimeout(
|
|
795
|
-
|
|
796
|
-
|
|
497
|
+
setTimeout(() => {
|
|
498
|
+
const isAccordionButton = e.target.getAttribute('data-garden-id') === COMPONENT_ID$8;
|
|
499
|
+
const isFocusVisible = e.target.getAttribute('data-garden-focus-visible');
|
|
797
500
|
if (isAccordionButton && isFocusVisible) {
|
|
798
501
|
setIsFocused(true);
|
|
799
502
|
}
|
|
800
503
|
}, 0);
|
|
801
504
|
};
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
};
|
|
807
|
-
}, [isHovered, otherTriggerProps]);
|
|
505
|
+
const value = useMemo(() => ({
|
|
506
|
+
isHovered,
|
|
507
|
+
otherTriggerProps
|
|
508
|
+
}), [isHovered, otherTriggerProps]);
|
|
808
509
|
return React__default.createElement(HeaderContext.Provider, {
|
|
809
510
|
value: value
|
|
810
|
-
}, React__default.createElement(StyledHeader, getHeaderProps(
|
|
811
|
-
ref
|
|
812
|
-
ariaLevel
|
|
813
|
-
isCompact
|
|
814
|
-
isFocused
|
|
815
|
-
isExpanded
|
|
816
|
-
isCollapsible
|
|
511
|
+
}, React__default.createElement(StyledHeader, getHeaderProps({
|
|
512
|
+
ref,
|
|
513
|
+
ariaLevel,
|
|
514
|
+
isCompact,
|
|
515
|
+
isFocused,
|
|
516
|
+
isExpanded,
|
|
517
|
+
isCollapsible,
|
|
817
518
|
onClick: composeEventHandlers(onClick, onTriggerClick),
|
|
818
519
|
onFocus: composeEventHandlers(onFocus, onHeaderFocus),
|
|
819
|
-
onBlur: composeEventHandlers(onBlur,
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
}),
|
|
825
|
-
onMouseOut: composeEventHandlers(onMouseOut, function () {
|
|
826
|
-
return setIsHovered(false);
|
|
827
|
-
})
|
|
828
|
-
}, other)), children, React__default.createElement(StyledRotateIcon, {
|
|
520
|
+
onBlur: composeEventHandlers(onBlur, () => setIsFocused(false)),
|
|
521
|
+
onMouseOver: composeEventHandlers(onMouseOver, () => setIsHovered(true)),
|
|
522
|
+
onMouseOut: composeEventHandlers(onMouseOut, () => setIsHovered(false)),
|
|
523
|
+
...other
|
|
524
|
+
}), children, React__default.createElement(StyledRotateIcon, {
|
|
829
525
|
isCompact: isCompact,
|
|
830
526
|
isHovered: isHovered,
|
|
831
527
|
isRotated: isExpanded,
|
|
832
528
|
isCollapsible: isCollapsible,
|
|
833
|
-
onMouseOver: composeEventHandlers(onMouseOver,
|
|
834
|
-
|
|
835
|
-
}),
|
|
836
|
-
onMouseOut: composeEventHandlers(onMouseOut, function () {
|
|
837
|
-
return setIsHovered(false);
|
|
838
|
-
})
|
|
529
|
+
onMouseOver: composeEventHandlers(onMouseOver, () => setIsHovered(true)),
|
|
530
|
+
onMouseOut: composeEventHandlers(onMouseOut, () => setIsHovered(false))
|
|
839
531
|
}, React__default.createElement(SvgChevronDownStroke, null))));
|
|
840
532
|
});
|
|
841
533
|
HeaderComponent.displayName = 'Accordion.Header';
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
534
|
+
const Header = HeaderComponent;
|
|
535
|
+
|
|
536
|
+
const LabelComponent$1 = forwardRef((props, ref) => {
|
|
537
|
+
const sectionIndex = useSectionContext();
|
|
538
|
+
const {
|
|
539
|
+
isCompact,
|
|
540
|
+
isCollapsible,
|
|
541
|
+
expandedSections
|
|
542
|
+
} = useAccordionContext();
|
|
543
|
+
const isExpanded = expandedSections.includes(sectionIndex);
|
|
544
|
+
const {
|
|
545
|
+
isHovered,
|
|
546
|
+
otherTriggerProps
|
|
547
|
+
} = useHeaderContext();
|
|
854
548
|
return React__default.createElement(StyledButton, _extends$3({
|
|
855
549
|
ref: ref,
|
|
856
550
|
isCompact: isCompact,
|
|
@@ -860,91 +554,93 @@ var LabelComponent$1 = forwardRef(function (props, ref) {
|
|
|
860
554
|
}, otherTriggerProps, props));
|
|
861
555
|
});
|
|
862
556
|
LabelComponent$1.displayName = 'Accordion.Label';
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
557
|
+
const Label$1 = LabelComponent$1;
|
|
558
|
+
|
|
559
|
+
const PanelComponent = forwardRef((props, ref) => {
|
|
560
|
+
const {
|
|
561
|
+
isCompact,
|
|
562
|
+
isBare,
|
|
563
|
+
isAnimated,
|
|
564
|
+
getPanelProps,
|
|
565
|
+
expandedSections
|
|
566
|
+
} = useAccordionContext();
|
|
567
|
+
const panelRef = useRef();
|
|
568
|
+
const index = useSectionContext();
|
|
569
|
+
const isExpanded = expandedSections.includes(index);
|
|
570
|
+
const updateMaxHeight = useCallback(debounce(() => {
|
|
876
571
|
if (panelRef.current) {
|
|
877
|
-
|
|
878
|
-
child.style.maxHeight =
|
|
572
|
+
const child = panelRef.current.children[0];
|
|
573
|
+
child.style.maxHeight = `${child.scrollHeight}px`;
|
|
879
574
|
}
|
|
880
575
|
}, 100), [panelRef]);
|
|
881
|
-
React__default.useEffect(
|
|
576
|
+
React__default.useEffect(() => {
|
|
882
577
|
if (!isAnimated) {
|
|
883
578
|
return undefined;
|
|
884
579
|
}
|
|
885
580
|
addEventListener('resize', updateMaxHeight);
|
|
886
581
|
updateMaxHeight();
|
|
887
|
-
return
|
|
582
|
+
return () => {
|
|
888
583
|
removeEventListener('resize', updateMaxHeight);
|
|
889
584
|
};
|
|
890
585
|
}, [isAnimated, isExpanded, updateMaxHeight, props.children]);
|
|
891
|
-
return React__default.createElement(StyledPanel, getPanelProps(
|
|
586
|
+
return React__default.createElement(StyledPanel, getPanelProps({
|
|
892
587
|
role: null,
|
|
893
588
|
ref: mergeRefs([panelRef, ref]),
|
|
894
|
-
index
|
|
895
|
-
isBare
|
|
896
|
-
isCompact
|
|
897
|
-
isExpanded
|
|
898
|
-
isAnimated
|
|
899
|
-
|
|
589
|
+
index,
|
|
590
|
+
isBare,
|
|
591
|
+
isCompact,
|
|
592
|
+
isExpanded,
|
|
593
|
+
isAnimated,
|
|
594
|
+
...props
|
|
595
|
+
}), React__default.createElement(StyledInnerPanel, {
|
|
900
596
|
isExpanded: isExpanded,
|
|
901
597
|
isAnimated: isAnimated
|
|
902
598
|
}, props.children));
|
|
903
599
|
});
|
|
904
600
|
PanelComponent.displayName = 'Accordion.Panel';
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
601
|
+
const Panel = PanelComponent;
|
|
602
|
+
|
|
603
|
+
const AccordionComponent = forwardRef((_ref, ref) => {
|
|
604
|
+
let {
|
|
605
|
+
level,
|
|
606
|
+
isBare,
|
|
607
|
+
onChange,
|
|
608
|
+
isCompact,
|
|
609
|
+
isAnimated,
|
|
610
|
+
isExpandable,
|
|
611
|
+
isCollapsible,
|
|
612
|
+
defaultExpandedSections,
|
|
613
|
+
expandedSections: controlledExpandedSections,
|
|
614
|
+
...props
|
|
615
|
+
} = _ref;
|
|
616
|
+
const {
|
|
617
|
+
expandedSections,
|
|
618
|
+
getHeaderProps,
|
|
619
|
+
getTriggerProps,
|
|
620
|
+
getPanelProps
|
|
621
|
+
} = useAccordion({
|
|
920
622
|
collapsible: isCollapsible,
|
|
921
623
|
expandable: isExpandable || false,
|
|
922
|
-
onChange
|
|
923
|
-
defaultExpandedSections
|
|
624
|
+
onChange,
|
|
625
|
+
defaultExpandedSections,
|
|
924
626
|
expandedSections: controlledExpandedSections
|
|
925
|
-
})
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
getTriggerProps = _useAccordion.getTriggerProps,
|
|
929
|
-
getPanelProps = _useAccordion.getPanelProps;
|
|
930
|
-
var currentIndexRef = useRef(0);
|
|
931
|
-
useEffect(function () {
|
|
627
|
+
});
|
|
628
|
+
const currentIndexRef = useRef(0);
|
|
629
|
+
useEffect(() => {
|
|
932
630
|
currentIndexRef.current = 0;
|
|
933
631
|
});
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
};
|
|
947
|
-
}, [level, isBare, isCompact, isAnimated, isCollapsible, getPanelProps, getHeaderProps, getTriggerProps, currentIndexRef, expandedSections]);
|
|
632
|
+
const value = useMemo(() => ({
|
|
633
|
+
level,
|
|
634
|
+
isBare,
|
|
635
|
+
isCompact,
|
|
636
|
+
isAnimated,
|
|
637
|
+
isCollapsible,
|
|
638
|
+
getPanelProps,
|
|
639
|
+
getHeaderProps,
|
|
640
|
+
getTriggerProps,
|
|
641
|
+
currentIndexRef,
|
|
642
|
+
expandedSections
|
|
643
|
+
}), [level, isBare, isCompact, isAnimated, isCollapsible, getPanelProps, getHeaderProps, getTriggerProps, currentIndexRef, expandedSections]);
|
|
948
644
|
return React__default.createElement(AccordionContext.Provider, {
|
|
949
645
|
value: value
|
|
950
646
|
}, React__default.createElement(StyledAccordion, _extends$3({
|
|
@@ -956,33 +652,29 @@ AccordionComponent.defaultProps = {
|
|
|
956
652
|
isAnimated: true,
|
|
957
653
|
isCollapsible: true
|
|
958
654
|
};
|
|
959
|
-
|
|
655
|
+
const Accordion = AccordionComponent;
|
|
960
656
|
Accordion.Header = Header;
|
|
961
657
|
Accordion.Label = Label$1;
|
|
962
658
|
Accordion.Panel = Panel;
|
|
963
659
|
Accordion.Section = Section;
|
|
964
660
|
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
setCurrentStepIndex = _useState2[1];
|
|
973
|
-
useLayoutEffect(function () {
|
|
661
|
+
const StepComponent = forwardRef((props, ref) => {
|
|
662
|
+
const {
|
|
663
|
+
currentIndexRef,
|
|
664
|
+
isHorizontal
|
|
665
|
+
} = useStepperContext();
|
|
666
|
+
const [currentStepIndex, setCurrentStepIndex] = useState(currentIndexRef.current);
|
|
667
|
+
useLayoutEffect(() => {
|
|
974
668
|
setCurrentStepIndex(currentIndexRef.current);
|
|
975
669
|
currentIndexRef.current++;
|
|
976
|
-
|
|
977
|
-
return
|
|
670
|
+
const currentIndex = currentIndexRef;
|
|
671
|
+
return () => {
|
|
978
672
|
currentIndex.current--;
|
|
979
673
|
};
|
|
980
674
|
}, [currentIndexRef]);
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
};
|
|
985
|
-
}, [currentStepIndex]);
|
|
675
|
+
const value = useMemo(() => ({
|
|
676
|
+
currentStepIndex
|
|
677
|
+
}), [currentStepIndex]);
|
|
986
678
|
return React__default.createElement(StepContext.Provider, {
|
|
987
679
|
value: value
|
|
988
680
|
}, React__default.createElement(StyledStep, _extends$3({
|
|
@@ -991,7 +683,7 @@ var StepComponent = forwardRef(function (props, ref) {
|
|
|
991
683
|
}, props), isHorizontal && React__default.createElement(StyledLine, null), props.children));
|
|
992
684
|
});
|
|
993
685
|
StepComponent.displayName = 'Stepper.Step';
|
|
994
|
-
|
|
686
|
+
const Step = StepComponent;
|
|
995
687
|
|
|
996
688
|
var _path;
|
|
997
689
|
|
|
@@ -1004,7 +696,8 @@ var SvgCheckSmStroke = function SvgCheckSmStroke(props) {
|
|
|
1004
696
|
height: 16,
|
|
1005
697
|
focusable: "false",
|
|
1006
698
|
viewBox: "0 0 16 16",
|
|
1007
|
-
"aria-hidden": "true"
|
|
699
|
+
"aria-hidden": "true",
|
|
700
|
+
role: "img"
|
|
1008
701
|
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
1009
702
|
fill: "none",
|
|
1010
703
|
stroke: "currentColor",
|
|
@@ -1015,23 +708,26 @@ var SvgCheckSmStroke = function SvgCheckSmStroke(props) {
|
|
|
1015
708
|
})));
|
|
1016
709
|
};
|
|
1017
710
|
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
711
|
+
const LabelComponent = forwardRef((_ref, ref) => {
|
|
712
|
+
let {
|
|
713
|
+
icon,
|
|
714
|
+
iconProps,
|
|
715
|
+
isHidden,
|
|
716
|
+
children,
|
|
717
|
+
...other
|
|
718
|
+
} = _ref;
|
|
719
|
+
const {
|
|
720
|
+
currentStepIndex
|
|
721
|
+
} = useStepContext();
|
|
722
|
+
const {
|
|
723
|
+
activeIndex,
|
|
724
|
+
isHorizontal
|
|
725
|
+
} = useStepperContext();
|
|
726
|
+
const numericStep = currentStepIndex + 1;
|
|
727
|
+
const stepIcon = icon || numericStep;
|
|
728
|
+
const isActive = activeIndex === currentStepIndex;
|
|
729
|
+
const isCompleted = activeIndex > currentStepIndex;
|
|
730
|
+
const styledIcon = React__default.createElement(StyledIcon, {
|
|
1035
731
|
isActive: isActive,
|
|
1036
732
|
isHorizontal: isHorizontal
|
|
1037
733
|
}, isCompleted ? React__default.createElement(SvgCheckSmStroke, iconProps) : stepIcon);
|
|
@@ -1050,27 +746,29 @@ LabelComponent.propTypes = {
|
|
|
1050
746
|
iconProps: PropTypes.object,
|
|
1051
747
|
isHidden: PropTypes.bool
|
|
1052
748
|
};
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
749
|
+
const Label = LabelComponent;
|
|
750
|
+
|
|
751
|
+
const ContentComponent$1 = forwardRef((props, ref) => {
|
|
752
|
+
const contentRef = useRef();
|
|
753
|
+
const {
|
|
754
|
+
activeIndex,
|
|
755
|
+
isHorizontal
|
|
756
|
+
} = useStepperContext();
|
|
757
|
+
const {
|
|
758
|
+
currentStepIndex
|
|
759
|
+
} = useStepContext();
|
|
760
|
+
const isActive = currentStepIndex === activeIndex;
|
|
761
|
+
const updateMaxHeight = useCallback(debounce(() => {
|
|
1064
762
|
if (contentRef.current) {
|
|
1065
|
-
|
|
1066
|
-
child.style.maxHeight =
|
|
763
|
+
const child = contentRef.current.children[0];
|
|
764
|
+
child.style.maxHeight = `${child.scrollHeight}px`;
|
|
1067
765
|
}
|
|
1068
766
|
}, 100), [contentRef]);
|
|
1069
|
-
useEffect(
|
|
767
|
+
useEffect(() => {
|
|
1070
768
|
if (isActive && isHorizontal === false) {
|
|
1071
769
|
addEventListener('resize', updateMaxHeight);
|
|
1072
770
|
updateMaxHeight();
|
|
1073
|
-
return
|
|
771
|
+
return () => {
|
|
1074
772
|
removeEventListener('resize', updateMaxHeight);
|
|
1075
773
|
};
|
|
1076
774
|
}
|
|
@@ -1085,22 +783,21 @@ var ContentComponent$1 = forwardRef(function (props, ref) {
|
|
|
1085
783
|
}, props.children)) : null;
|
|
1086
784
|
});
|
|
1087
785
|
ContentComponent$1.displayName = 'Stepper.Content';
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
useEffect(function () {
|
|
786
|
+
const Content$1 = ContentComponent$1;
|
|
787
|
+
|
|
788
|
+
const StepperComponent = forwardRef((_ref, ref) => {
|
|
789
|
+
let {
|
|
790
|
+
isHorizontal,
|
|
791
|
+
activeIndex,
|
|
792
|
+
...props
|
|
793
|
+
} = _ref;
|
|
794
|
+
const currentIndexRef = useRef(0);
|
|
795
|
+
const stepperContext = useMemo(() => ({
|
|
796
|
+
isHorizontal: isHorizontal || false,
|
|
797
|
+
activeIndex: activeIndex,
|
|
798
|
+
currentIndexRef
|
|
799
|
+
}), [isHorizontal, activeIndex, currentIndexRef]);
|
|
800
|
+
useEffect(() => {
|
|
1104
801
|
currentIndexRef.current = 0;
|
|
1105
802
|
});
|
|
1106
803
|
return React__default.createElement(StepperContext.Provider, {
|
|
@@ -1114,34 +811,32 @@ StepperComponent.displayName = 'Stepper';
|
|
|
1114
811
|
StepperComponent.defaultProps = {
|
|
1115
812
|
activeIndex: 0
|
|
1116
813
|
};
|
|
1117
|
-
|
|
814
|
+
const Stepper = StepperComponent;
|
|
1118
815
|
Stepper.Content = Content$1;
|
|
1119
816
|
Stepper.Label = Label;
|
|
1120
817
|
Stepper.Step = Step;
|
|
1121
818
|
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
}, props));
|
|
1126
|
-
});
|
|
819
|
+
const OppositeContentComponent = forwardRef((props, ref) => React__default.createElement(StyledOppositeContent, _extends$3({
|
|
820
|
+
ref: ref
|
|
821
|
+
}, props)));
|
|
1127
822
|
OppositeContentComponent.displayName = 'Timeline.OppositeContent';
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
Children.forEach(props.children,
|
|
823
|
+
const OppositeContent = OppositeContentComponent;
|
|
824
|
+
|
|
825
|
+
const ItemComponent = forwardRef((_ref, ref) => {
|
|
826
|
+
let {
|
|
827
|
+
icon,
|
|
828
|
+
surfaceColor,
|
|
829
|
+
...props
|
|
830
|
+
} = _ref;
|
|
831
|
+
const value = useMemo(() => ({
|
|
832
|
+
icon,
|
|
833
|
+
surfaceColor
|
|
834
|
+
}), [icon, surfaceColor]);
|
|
835
|
+
const {
|
|
836
|
+
isAlternate
|
|
837
|
+
} = useTimelineContext();
|
|
838
|
+
let hasOppositeContent = false;
|
|
839
|
+
Children.forEach(props.children, child => {
|
|
1145
840
|
if (child) {
|
|
1146
841
|
if (child.type === OppositeContent) {
|
|
1147
842
|
hasOppositeContent = true;
|
|
@@ -1157,7 +852,7 @@ var ItemComponent = forwardRef(function (_ref, ref) {
|
|
|
1157
852
|
}, props)));
|
|
1158
853
|
});
|
|
1159
854
|
ItemComponent.displayName = 'Timeline.Item';
|
|
1160
|
-
|
|
855
|
+
const Item = ItemComponent;
|
|
1161
856
|
|
|
1162
857
|
var _circle;
|
|
1163
858
|
|
|
@@ -1170,7 +865,8 @@ var SvgCircleFullStroke = function SvgCircleFullStroke(props) {
|
|
|
1170
865
|
height: 12,
|
|
1171
866
|
focusable: "false",
|
|
1172
867
|
viewBox: "0 0 12 12",
|
|
1173
|
-
"aria-hidden": "true"
|
|
868
|
+
"aria-hidden": "true",
|
|
869
|
+
role: "img"
|
|
1174
870
|
}, props), _circle || (_circle = /*#__PURE__*/React.createElement("circle", {
|
|
1175
871
|
cx: 6,
|
|
1176
872
|
cy: 6,
|
|
@@ -1180,10 +876,11 @@ var SvgCircleFullStroke = function SvgCircleFullStroke(props) {
|
|
|
1180
876
|
})));
|
|
1181
877
|
};
|
|
1182
878
|
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
879
|
+
const ContentComponent = forwardRef((props, ref) => {
|
|
880
|
+
const {
|
|
881
|
+
icon,
|
|
882
|
+
surfaceColor
|
|
883
|
+
} = useTimelineItemContext();
|
|
1187
884
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement(StyledSeparator, null, React__default.createElement(StyledItemIcon, {
|
|
1188
885
|
surfaceColor: surfaceColor
|
|
1189
886
|
}, icon || React__default.createElement(SvgCircleFullStroke, null))), React__default.createElement(StyledTimelineContent, _extends$3({
|
|
@@ -1191,17 +888,16 @@ var ContentComponent = forwardRef(function (props, ref) {
|
|
|
1191
888
|
}, props)));
|
|
1192
889
|
});
|
|
1193
890
|
ContentComponent.displayName = 'Timeline.Content';
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
}, [isAlternate]);
|
|
891
|
+
const Content = ContentComponent;
|
|
892
|
+
|
|
893
|
+
const TimelineComponent = forwardRef((_ref, ref) => {
|
|
894
|
+
let {
|
|
895
|
+
isAlternate,
|
|
896
|
+
...props
|
|
897
|
+
} = _ref;
|
|
898
|
+
const value = useMemo(() => ({
|
|
899
|
+
isAlternate
|
|
900
|
+
}), [isAlternate]);
|
|
1205
901
|
return React__default.createElement(TimelineContext.Provider, {
|
|
1206
902
|
value: value
|
|
1207
903
|
}, React__default.createElement(StyledTimeline, _extends$3({
|
|
@@ -1209,7 +905,7 @@ var TimelineComponent = forwardRef(function (_ref, ref) {
|
|
|
1209
905
|
}, props)));
|
|
1210
906
|
});
|
|
1211
907
|
TimelineComponent.displayName = 'Timeline';
|
|
1212
|
-
|
|
908
|
+
const Timeline = TimelineComponent;
|
|
1213
909
|
Timeline.Content = Content;
|
|
1214
910
|
Timeline.Item = Item;
|
|
1215
911
|
Timeline.OppositeContent = OppositeContent;
|