@cleartrip/ct-design-accordion 4.0.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +79 -0
  2. package/dist/Accordion.d.ts +3 -3
  3. package/dist/Accordion.d.ts.map +1 -1
  4. package/dist/Accordion.native.d.ts +6 -0
  5. package/dist/Accordion.native.d.ts.map +1 -0
  6. package/dist/ct-design-accordion.browser.cjs.js +1 -1
  7. package/dist/ct-design-accordion.browser.cjs.js.map +1 -1
  8. package/dist/ct-design-accordion.browser.esm.js +1 -1
  9. package/dist/ct-design-accordion.browser.esm.js.map +1 -1
  10. package/dist/ct-design-accordion.cjs.js +72 -76
  11. package/dist/ct-design-accordion.cjs.js.map +1 -1
  12. package/dist/ct-design-accordion.esm.js +71 -73
  13. package/dist/ct-design-accordion.esm.js.map +1 -1
  14. package/dist/ct-design-accordion.umd.js +1697 -146
  15. package/dist/ct-design-accordion.umd.js.map +1 -1
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.native.d.ts +3 -0
  19. package/dist/index.native.d.ts.map +1 -0
  20. package/dist/style.d.ts +21 -4
  21. package/dist/style.d.ts.map +1 -1
  22. package/dist/type.d.ts +27 -20
  23. package/dist/type.d.ts.map +1 -1
  24. package/dist/webStyle.d.ts +6 -0
  25. package/dist/webStyle.d.ts.map +1 -0
  26. package/package.json +36 -12
  27. package/src/Accordion.native.tsx +107 -0
  28. package/src/Accordion.tsx +97 -0
  29. package/src/index.native.ts +2 -0
  30. package/src/index.ts +2 -0
  31. package/src/style.ts +33 -0
  32. package/src/type.ts +85 -0
  33. package/src/webStyle.ts +21 -0
  34. package/dist/StyledAccordion/StyledAccordion.d.ts +0 -15
  35. package/dist/StyledAccordion/StyledAccordion.d.ts.map +0 -1
  36. package/dist/StyledAccordion/index.d.ts +0 -2
  37. package/dist/StyledAccordion/index.d.ts.map +0 -1
  38. package/dist/StyledAccordion/style.d.ts +0 -14
  39. package/dist/StyledAccordion/style.d.ts.map +0 -1
  40. package/dist/StyledAccordion/type.d.ts +0 -7
  41. package/dist/StyledAccordion/type.d.ts.map +0 -1
@@ -1,183 +1,1734 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react'), require('@cleartrip/ct-design-icons'), require('@cleartrip/ct-design-container'), require('@cleartrip/ct-design-transition'), require('@cleartrip/ct-design-typography'), require('styled-components')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react', '@cleartrip/ct-design-icons', '@cleartrip/ct-design-container', '@cleartrip/ct-design-transition', '@cleartrip/ct-design-typography', 'styled-components'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.CTDesignSystemAccordion = {}, global.jsxRuntime, global.React, global.ctDesignIcons, global.ctDesignContainer, global.ctDesignTransition, global.ctDesignTypography, global.styled));
5
- })(this, (function (exports, jsxRuntime, React, ctDesignIcons, ctDesignContainer, ctDesignTransition, ctDesignTypography, styled) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react'), require('@cleartrip/ct-design-container'), require('@cleartrip/ct-design-use-isomorphic-effect'), require('@cleartrip/ct-design-style-manager')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react', '@cleartrip/ct-design-container', '@cleartrip/ct-design-use-isomorphic-effect', '@cleartrip/ct-design-style-manager'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.CTDesignSystemAccordion = {}, global.jsxRuntime, global.React, global.ctDesignContainer, global.useIsomorphicEffect, global.ctDesignStyleManager));
5
+ })(this, (function (exports, jsxRuntime, react, ctDesignContainer, useIsomorphicEffect, ctDesignStyleManager) { 'use strict';
6
6
 
7
7
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
8
 
9
- var React__default = /*#__PURE__*/_interopDefault(React);
10
- var styled__default = /*#__PURE__*/_interopDefault(styled);
11
-
12
- /******************************************************************************
13
- Copyright (c) Microsoft Corporation.
14
-
15
- Permission to use, copy, modify, and/or distribute this software for any
16
- purpose with or without fee is hereby granted.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
19
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
20
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
21
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
22
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
23
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
24
- PERFORMANCE OF THIS SOFTWARE.
25
- ***************************************************************************** */
26
- /* global Reflect, Promise, SuppressedError, Symbol */
27
-
28
- var __assign = function () {
29
- __assign = Object.assign || function __assign(t) {
30
- for (var s, i = 1, n = arguments.length; i < n; i++) {
31
- s = arguments[i];
32
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
33
- }
34
- return t;
9
+ var useIsomorphicEffect__default = /*#__PURE__*/_interopDefault(useIsomorphicEffect);
10
+
11
+ const accordionStaticStyles = ctDesignStyleManager.makeStyles((theme) => ({
12
+ root: {},
13
+ labelRow: {
14
+ display: 'flex',
15
+ flexDirection: 'row',
16
+ alignItems: 'center',
17
+ justifyContent: 'space-between',
18
+ },
19
+ iconContainer: {
20
+ display: 'flex',
21
+ justifyContent: 'center',
22
+ alignItems: 'center',
23
+ marginLeft: theme.spacing[4],
24
+ },
25
+ animatedAccordionRoot: {
26
+ overflow: 'hidden',
27
+ },
28
+ accordionContentRoot: {
29
+ overflow: 'hidden',
30
+ },
31
+ }));
32
+
33
+ var isDevelopment$1 = false;
34
+
35
+ /*
36
+
37
+ Based off glamor's StyleSheet, thanks Sunil ❤️
38
+
39
+ high performance StyleSheet for css-in-js systems
40
+
41
+ - uses multiple style tags behind the scenes for millions of rules
42
+ - uses `insertRule` for appending in production for *much* faster performance
43
+
44
+ // usage
45
+
46
+ import { StyleSheet } from '@emotion/sheet'
47
+
48
+ let styleSheet = new StyleSheet({ key: '', container: document.head })
49
+
50
+ styleSheet.insert('#box { border: 1px solid red; }')
51
+ - appends a css rule into the stylesheet
52
+
53
+ styleSheet.flush()
54
+ - empties the stylesheet of all its contents
55
+
56
+ */
57
+
58
+ function sheetForTag(tag) {
59
+ if (tag.sheet) {
60
+ return tag.sheet;
61
+ } // this weirdness brought to you by firefox
62
+
63
+ /* istanbul ignore next */
64
+
65
+ for (var i = 0; i < document.styleSheets.length; i++) {
66
+ if (document.styleSheets[i].ownerNode === tag) {
67
+ return document.styleSheets[i];
68
+ }
69
+ } // this function should always return with a value
70
+ // TS can't understand it though so we make it stop complaining here
71
+
72
+ return undefined;
73
+ }
74
+ function createStyleElement(options) {
75
+ var tag = document.createElement('style');
76
+ tag.setAttribute('data-emotion', options.key);
77
+ if (options.nonce !== undefined) {
78
+ tag.setAttribute('nonce', options.nonce);
79
+ }
80
+ tag.appendChild(document.createTextNode(''));
81
+ tag.setAttribute('data-s', '');
82
+ return tag;
83
+ }
84
+ var StyleSheet = /*#__PURE__*/function () {
85
+ // Using Node instead of HTMLElement since container may be a ShadowRoot
86
+ function StyleSheet(options) {
87
+ var _this = this;
88
+ this._insertTag = function (tag) {
89
+ var before;
90
+ if (_this.tags.length === 0) {
91
+ if (_this.insertionPoint) {
92
+ before = _this.insertionPoint.nextSibling;
93
+ } else if (_this.prepend) {
94
+ before = _this.container.firstChild;
95
+ } else {
96
+ before = _this.before;
97
+ }
98
+ } else {
99
+ before = _this.tags[_this.tags.length - 1].nextSibling;
100
+ }
101
+ _this.container.insertBefore(tag, before);
102
+ _this.tags.push(tag);
103
+ };
104
+ this.isSpeedy = options.speedy === undefined ? !isDevelopment$1 : options.speedy;
105
+ this.tags = [];
106
+ this.ctr = 0;
107
+ this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
108
+
109
+ this.key = options.key;
110
+ this.container = options.container;
111
+ this.prepend = options.prepend;
112
+ this.insertionPoint = options.insertionPoint;
113
+ this.before = null;
114
+ }
115
+ var _proto = StyleSheet.prototype;
116
+ _proto.hydrate = function hydrate(nodes) {
117
+ nodes.forEach(this._insertTag);
35
118
  };
36
- return __assign.apply(this, arguments);
37
- };
38
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
39
- var e = new Error(message);
40
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
119
+ _proto.insert = function insert(rule) {
120
+ // the max length is how many rules we have per style tag, it's 65000 in speedy mode
121
+ // it's 1 in dev because we insert source maps that map a single rule to a location
122
+ // and you can only have one source map per style tag
123
+ if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
124
+ this._insertTag(createStyleElement(this));
125
+ }
126
+ var tag = this.tags[this.tags.length - 1];
127
+ if (this.isSpeedy) {
128
+ var sheet = sheetForTag(tag);
129
+ try {
130
+ // this is the ultrafast version, works across browsers
131
+ // the big drawback is that the css won't be editable in devtools
132
+ sheet.insertRule(rule, sheet.cssRules.length);
133
+ } catch (e) {}
134
+ } else {
135
+ tag.appendChild(document.createTextNode(rule));
136
+ }
137
+ this.ctr++;
138
+ };
139
+ _proto.flush = function flush() {
140
+ this.tags.forEach(function (tag) {
141
+ var _tag$parentNode;
142
+ return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
143
+ });
144
+ this.tags = [];
145
+ this.ctr = 0;
146
+ };
147
+ return StyleSheet;
148
+ }();
149
+
150
+ var stylisExports = {};
151
+ var stylis = {
152
+ get exports(){ return stylisExports; },
153
+ set exports(v){ stylisExports = v; },
41
154
  };
42
155
 
43
- var getAccordionArrowStyles = function (_a) {
44
- var isOpen = _a.isOpen;
45
- if (isOpen)
46
- return {
47
- transform: 'rotate(-180deg)',
48
- };
49
- return {
50
- transform: 'rotate(0deg)',
51
- };
156
+ (function (module, exports) {
157
+ (function (e, r) {
158
+ r(exports) ;
159
+ })(this, function (e) {
160
+
161
+ var r = "-ms-";
162
+ var a = "-moz-";
163
+ var c = "-webkit-";
164
+ var n = "comm";
165
+ var t = "rule";
166
+ var s = "decl";
167
+ var i = "@page";
168
+ var u = "@media";
169
+ var o = "@import";
170
+ var f = "@charset";
171
+ var l = "@viewport";
172
+ var p = "@supports";
173
+ var h = "@document";
174
+ var v = "@namespace";
175
+ var d = "@keyframes";
176
+ var b = "@font-face";
177
+ var w = "@counter-style";
178
+ var m = "@font-feature-values";
179
+ var g = "@layer";
180
+ var k = Math.abs;
181
+ var $ = String.fromCharCode;
182
+ var x = Object.assign;
183
+ function E(e, r) {
184
+ return M(e, 0) ^ 45 ? (((r << 2 ^ M(e, 0)) << 2 ^ M(e, 1)) << 2 ^ M(e, 2)) << 2 ^ M(e, 3) : 0;
185
+ }
186
+ function y(e) {
187
+ return e.trim();
188
+ }
189
+ function T(e, r) {
190
+ return (e = r.exec(e)) ? e[0] : e;
191
+ }
192
+ function A(e, r, a) {
193
+ return e.replace(r, a);
194
+ }
195
+ function O(e, r) {
196
+ return e.indexOf(r);
197
+ }
198
+ function M(e, r) {
199
+ return e.charCodeAt(r) | 0;
200
+ }
201
+ function C(e, r, a) {
202
+ return e.slice(r, a);
203
+ }
204
+ function R(e) {
205
+ return e.length;
206
+ }
207
+ function S(e) {
208
+ return e.length;
209
+ }
210
+ function z(e, r) {
211
+ return r.push(e), e;
212
+ }
213
+ function N(e, r) {
214
+ return e.map(r).join("");
215
+ }
216
+ e.line = 1;
217
+ e.column = 1;
218
+ e.length = 0;
219
+ e.position = 0;
220
+ e.character = 0;
221
+ e.characters = "";
222
+ function P(r, a, c, n, t, s, i) {
223
+ return {
224
+ value: r,
225
+ root: a,
226
+ parent: c,
227
+ type: n,
228
+ props: t,
229
+ children: s,
230
+ line: e.line,
231
+ column: e.column,
232
+ length: i,
233
+ return: ""
234
+ };
235
+ }
236
+ function j(e, r) {
237
+ return x(P("", null, null, "", null, null, 0), e, {
238
+ length: -e.length
239
+ }, r);
240
+ }
241
+ function U() {
242
+ return e.character;
243
+ }
244
+ function _() {
245
+ e.character = e.position > 0 ? M(e.characters, --e.position) : 0;
246
+ if (e.column--, e.character === 10) e.column = 1, e.line--;
247
+ return e.character;
248
+ }
249
+ function F() {
250
+ e.character = e.position < e.length ? M(e.characters, e.position++) : 0;
251
+ if (e.column++, e.character === 10) e.column = 1, e.line++;
252
+ return e.character;
253
+ }
254
+ function I() {
255
+ return M(e.characters, e.position);
256
+ }
257
+ function L() {
258
+ return e.position;
259
+ }
260
+ function D(r, a) {
261
+ return C(e.characters, r, a);
262
+ }
263
+ function Y(e) {
264
+ switch (e) {
265
+ case 0:
266
+ case 9:
267
+ case 10:
268
+ case 13:
269
+ case 32:
270
+ return 5;
271
+ case 33:
272
+ case 43:
273
+ case 44:
274
+ case 47:
275
+ case 62:
276
+ case 64:
277
+ case 126:
278
+ case 59:
279
+ case 123:
280
+ case 125:
281
+ return 4;
282
+ case 58:
283
+ return 3;
284
+ case 34:
285
+ case 39:
286
+ case 40:
287
+ case 91:
288
+ return 2;
289
+ case 41:
290
+ case 93:
291
+ return 1;
292
+ }
293
+ return 0;
294
+ }
295
+ function K(r) {
296
+ return e.line = e.column = 1, e.length = R(e.characters = r), e.position = 0, [];
297
+ }
298
+ function V(r) {
299
+ return e.characters = "", r;
300
+ }
301
+ function W(r) {
302
+ return y(D(e.position - 1, q(r === 91 ? r + 2 : r === 40 ? r + 1 : r)));
303
+ }
304
+ function B(e) {
305
+ return V(H(K(e)));
306
+ }
307
+ function G(r) {
308
+ while (e.character = I()) if (e.character < 33) F();else break;
309
+ return Y(r) > 2 || Y(e.character) > 3 ? "" : " ";
310
+ }
311
+ function H(r) {
312
+ while (F()) switch (Y(e.character)) {
313
+ case 0:
314
+ z(Q(e.position - 1), r);
315
+ break;
316
+ case 2:
317
+ z(W(e.character), r);
318
+ break;
319
+ default:
320
+ z($(e.character), r);
321
+ }
322
+ return r;
323
+ }
324
+ function Z(r, a) {
325
+ while (--a && F()) if (e.character < 48 || e.character > 102 || e.character > 57 && e.character < 65 || e.character > 70 && e.character < 97) break;
326
+ return D(r, L() + (a < 6 && I() == 32 && F() == 32));
327
+ }
328
+ function q(r) {
329
+ while (F()) switch (e.character) {
330
+ case r:
331
+ return e.position;
332
+ case 34:
333
+ case 39:
334
+ if (r !== 34 && r !== 39) q(e.character);
335
+ break;
336
+ case 40:
337
+ if (r === 41) q(r);
338
+ break;
339
+ case 92:
340
+ F();
341
+ break;
342
+ }
343
+ return e.position;
344
+ }
345
+ function J(r, a) {
346
+ while (F()) if (r + e.character === 47 + 10) break;else if (r + e.character === 42 + 42 && I() === 47) break;
347
+ return "/*" + D(a, e.position - 1) + "*" + $(r === 47 ? r : F());
348
+ }
349
+ function Q(r) {
350
+ while (!Y(I())) F();
351
+ return D(r, e.position);
352
+ }
353
+ function X(e) {
354
+ return V(ee("", null, null, null, [""], e = K(e), 0, [0], e));
355
+ }
356
+ function ee(e, r, a, c, n, t, s, i, u) {
357
+ var o = 0;
358
+ var f = 0;
359
+ var l = s;
360
+ var p = 0;
361
+ var h = 0;
362
+ var v = 0;
363
+ var d = 1;
364
+ var b = 1;
365
+ var w = 1;
366
+ var m = 0;
367
+ var g = "";
368
+ var k = n;
369
+ var x = t;
370
+ var E = c;
371
+ var y = g;
372
+ while (b) switch (v = m, m = F()) {
373
+ case 40:
374
+ if (v != 108 && M(y, l - 1) == 58) {
375
+ if (O(y += A(W(m), "&", "&\f"), "&\f") != -1) w = -1;
376
+ break;
377
+ }
378
+ case 34:
379
+ case 39:
380
+ case 91:
381
+ y += W(m);
382
+ break;
383
+ case 9:
384
+ case 10:
385
+ case 13:
386
+ case 32:
387
+ y += G(v);
388
+ break;
389
+ case 92:
390
+ y += Z(L() - 1, 7);
391
+ continue;
392
+ case 47:
393
+ switch (I()) {
394
+ case 42:
395
+ case 47:
396
+ z(ae(J(F(), L()), r, a), u);
397
+ break;
398
+ default:
399
+ y += "/";
400
+ }
401
+ break;
402
+ case 123 * d:
403
+ i[o++] = R(y) * w;
404
+ case 125 * d:
405
+ case 59:
406
+ case 0:
407
+ switch (m) {
408
+ case 0:
409
+ case 125:
410
+ b = 0;
411
+ case 59 + f:
412
+ if (w == -1) y = A(y, /\f/g, "");
413
+ if (h > 0 && R(y) - l) z(h > 32 ? ce(y + ";", c, a, l - 1) : ce(A(y, " ", "") + ";", c, a, l - 2), u);
414
+ break;
415
+ case 59:
416
+ y += ";";
417
+ default:
418
+ z(E = re(y, r, a, o, f, n, i, g, k = [], x = [], l), t);
419
+ if (m === 123) if (f === 0) ee(y, r, E, E, k, t, l, i, x);else switch (p === 99 && M(y, 3) === 110 ? 100 : p) {
420
+ case 100:
421
+ case 108:
422
+ case 109:
423
+ case 115:
424
+ ee(e, E, E, c && z(re(e, E, E, 0, 0, n, i, g, n, k = [], l), x), n, x, l, i, c ? k : x);
425
+ break;
426
+ default:
427
+ ee(y, E, E, E, [""], x, 0, i, x);
428
+ }
429
+ }
430
+ o = f = h = 0, d = w = 1, g = y = "", l = s;
431
+ break;
432
+ case 58:
433
+ l = 1 + R(y), h = v;
434
+ default:
435
+ if (d < 1) if (m == 123) --d;else if (m == 125 && d++ == 0 && _() == 125) continue;
436
+ switch (y += $(m), m * d) {
437
+ case 38:
438
+ w = f > 0 ? 1 : (y += "\f", -1);
439
+ break;
440
+ case 44:
441
+ i[o++] = (R(y) - 1) * w, w = 1;
442
+ break;
443
+ case 64:
444
+ if (I() === 45) y += W(F());
445
+ p = I(), f = l = R(g = y += Q(L())), m++;
446
+ break;
447
+ case 45:
448
+ if (v === 45 && R(y) == 2) d = 0;
449
+ }
450
+ }
451
+ return t;
452
+ }
453
+ function re(e, r, a, c, n, s, i, u, o, f, l) {
454
+ var p = n - 1;
455
+ var h = n === 0 ? s : [""];
456
+ var v = S(h);
457
+ for (var d = 0, b = 0, w = 0; d < c; ++d) for (var m = 0, g = C(e, p + 1, p = k(b = i[d])), $ = e; m < v; ++m) if ($ = y(b > 0 ? h[m] + " " + g : A(g, /&\f/g, h[m]))) o[w++] = $;
458
+ return P(e, r, a, n === 0 ? t : u, o, f, l);
459
+ }
460
+ function ae(e, r, a) {
461
+ return P(e, r, a, n, $(U()), C(e, 2, -2), 0);
462
+ }
463
+ function ce(e, r, a, c) {
464
+ return P(e, r, a, s, C(e, 0, c), C(e, c + 1, -1), c);
465
+ }
466
+ function ne(e, n, t) {
467
+ switch (E(e, n)) {
468
+ case 5103:
469
+ return c + "print-" + e + e;
470
+ case 5737:
471
+ case 4201:
472
+ case 3177:
473
+ case 3433:
474
+ case 1641:
475
+ case 4457:
476
+ case 2921:
477
+ case 5572:
478
+ case 6356:
479
+ case 5844:
480
+ case 3191:
481
+ case 6645:
482
+ case 3005:
483
+ case 6391:
484
+ case 5879:
485
+ case 5623:
486
+ case 6135:
487
+ case 4599:
488
+ case 4855:
489
+ case 4215:
490
+ case 6389:
491
+ case 5109:
492
+ case 5365:
493
+ case 5621:
494
+ case 3829:
495
+ return c + e + e;
496
+ case 4789:
497
+ return a + e + e;
498
+ case 5349:
499
+ case 4246:
500
+ case 4810:
501
+ case 6968:
502
+ case 2756:
503
+ return c + e + a + e + r + e + e;
504
+ case 5936:
505
+ switch (M(e, n + 11)) {
506
+ case 114:
507
+ return c + e + r + A(e, /[svh]\w+-[tblr]{2}/, "tb") + e;
508
+ case 108:
509
+ return c + e + r + A(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e;
510
+ case 45:
511
+ return c + e + r + A(e, /[svh]\w+-[tblr]{2}/, "lr") + e;
512
+ }
513
+ case 6828:
514
+ case 4268:
515
+ case 2903:
516
+ return c + e + r + e + e;
517
+ case 6165:
518
+ return c + e + r + "flex-" + e + e;
519
+ case 5187:
520
+ return c + e + A(e, /(\w+).+(:[^]+)/, c + "box-$1$2" + r + "flex-$1$2") + e;
521
+ case 5443:
522
+ return c + e + r + "flex-item-" + A(e, /flex-|-self/g, "") + (!T(e, /flex-|baseline/) ? r + "grid-row-" + A(e, /flex-|-self/g, "") : "") + e;
523
+ case 4675:
524
+ return c + e + r + "flex-line-pack" + A(e, /align-content|flex-|-self/g, "") + e;
525
+ case 5548:
526
+ return c + e + r + A(e, "shrink", "negative") + e;
527
+ case 5292:
528
+ return c + e + r + A(e, "basis", "preferred-size") + e;
529
+ case 6060:
530
+ return c + "box-" + A(e, "-grow", "") + c + e + r + A(e, "grow", "positive") + e;
531
+ case 4554:
532
+ return c + A(e, /([^-])(transform)/g, "$1" + c + "$2") + e;
533
+ case 6187:
534
+ return A(A(A(e, /(zoom-|grab)/, c + "$1"), /(image-set)/, c + "$1"), e, "") + e;
535
+ case 5495:
536
+ case 3959:
537
+ return A(e, /(image-set\([^]*)/, c + "$1" + "$`$1");
538
+ case 4968:
539
+ return A(A(e, /(.+:)(flex-)?(.*)/, c + "box-pack:$3" + r + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + c + e + e;
540
+ case 4200:
541
+ if (!T(e, /flex-|baseline/)) return r + "grid-column-align" + C(e, n) + e;
542
+ break;
543
+ case 2592:
544
+ case 3360:
545
+ return r + A(e, "template-", "") + e;
546
+ case 4384:
547
+ case 3616:
548
+ if (t && t.some(function (e, r) {
549
+ return n = r, T(e.props, /grid-\w+-end/);
550
+ })) {
551
+ return ~O(e + (t = t[n].value), "span") ? e : r + A(e, "-start", "") + e + r + "grid-row-span:" + (~O(t, "span") ? T(t, /\d+/) : +T(t, /\d+/) - +T(e, /\d+/)) + ";";
552
+ }
553
+ return r + A(e, "-start", "") + e;
554
+ case 4896:
555
+ case 4128:
556
+ return t && t.some(function (e) {
557
+ return T(e.props, /grid-\w+-start/);
558
+ }) ? e : r + A(A(e, "-end", "-span"), "span ", "") + e;
559
+ case 4095:
560
+ case 3583:
561
+ case 4068:
562
+ case 2532:
563
+ return A(e, /(.+)-inline(.+)/, c + "$1$2") + e;
564
+ case 8116:
565
+ case 7059:
566
+ case 5753:
567
+ case 5535:
568
+ case 5445:
569
+ case 5701:
570
+ case 4933:
571
+ case 4677:
572
+ case 5533:
573
+ case 5789:
574
+ case 5021:
575
+ case 4765:
576
+ if (R(e) - 1 - n > 6) switch (M(e, n + 1)) {
577
+ case 109:
578
+ if (M(e, n + 4) !== 45) break;
579
+ case 102:
580
+ return A(e, /(.+:)(.+)-([^]+)/, "$1" + c + "$2-$3" + "$1" + a + (M(e, n + 3) == 108 ? "$3" : "$2-$3")) + e;
581
+ case 115:
582
+ return ~O(e, "stretch") ? ne(A(e, "stretch", "fill-available"), n, t) + e : e;
583
+ }
584
+ break;
585
+ case 5152:
586
+ case 5920:
587
+ return A(e, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function (a, c, n, t, s, i, u) {
588
+ return r + c + ":" + n + u + (t ? r + c + "-span:" + (s ? i : +i - +n) + u : "") + e;
589
+ });
590
+ case 4949:
591
+ if (M(e, n + 6) === 121) return A(e, ":", ":" + c) + e;
592
+ break;
593
+ case 6444:
594
+ switch (M(e, M(e, 14) === 45 ? 18 : 11)) {
595
+ case 120:
596
+ return A(e, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + c + (M(e, 14) === 45 ? "inline-" : "") + "box$3" + "$1" + c + "$2$3" + "$1" + r + "$2box$3") + e;
597
+ case 100:
598
+ return A(e, ":", ":" + r) + e;
599
+ }
600
+ break;
601
+ case 5719:
602
+ case 2647:
603
+ case 2135:
604
+ case 3927:
605
+ case 2391:
606
+ return A(e, "scroll-", "scroll-snap-") + e;
607
+ }
608
+ return e;
609
+ }
610
+ function te(e, r) {
611
+ var a = "";
612
+ var c = S(e);
613
+ for (var n = 0; n < c; n++) a += r(e[n], n, e, r) || "";
614
+ return a;
615
+ }
616
+ function se(e, r, a, c) {
617
+ switch (e.type) {
618
+ case g:
619
+ if (e.children.length) break;
620
+ case o:
621
+ case s:
622
+ return e.return = e.return || e.value;
623
+ case n:
624
+ return "";
625
+ case d:
626
+ return e.return = e.value + "{" + te(e.children, c) + "}";
627
+ case t:
628
+ e.value = e.props.join(",");
629
+ }
630
+ return R(a = te(e.children, c)) ? e.return = e.value + "{" + a + "}" : "";
631
+ }
632
+ function ie(e) {
633
+ var r = S(e);
634
+ return function (a, c, n, t) {
635
+ var s = "";
636
+ for (var i = 0; i < r; i++) s += e[i](a, c, n, t) || "";
637
+ return s;
638
+ };
639
+ }
640
+ function ue(e) {
641
+ return function (r) {
642
+ if (!r.root) if (r = r.return) e(r);
643
+ };
644
+ }
645
+ function oe(e, n, i, u) {
646
+ if (e.length > -1) if (!e.return) switch (e.type) {
647
+ case s:
648
+ e.return = ne(e.value, e.length, i);
649
+ return;
650
+ case d:
651
+ return te([j(e, {
652
+ value: A(e.value, "@", "@" + c)
653
+ })], u);
654
+ case t:
655
+ if (e.length) return N(e.props, function (n) {
656
+ switch (T(n, /(::plac\w+|:read-\w+)/)) {
657
+ case ":read-only":
658
+ case ":read-write":
659
+ return te([j(e, {
660
+ props: [A(n, /:(read-\w+)/, ":" + a + "$1")]
661
+ })], u);
662
+ case "::placeholder":
663
+ return te([j(e, {
664
+ props: [A(n, /:(plac\w+)/, ":" + c + "input-$1")]
665
+ }), j(e, {
666
+ props: [A(n, /:(plac\w+)/, ":" + a + "$1")]
667
+ }), j(e, {
668
+ props: [A(n, /:(plac\w+)/, r + "input-$1")]
669
+ })], u);
670
+ }
671
+ return "";
672
+ });
673
+ }
674
+ }
675
+ function fe(e) {
676
+ switch (e.type) {
677
+ case t:
678
+ e.props = e.props.map(function (r) {
679
+ return N(B(r), function (r, a, c) {
680
+ switch (M(r, 0)) {
681
+ case 12:
682
+ return C(r, 1, R(r));
683
+ case 0:
684
+ case 40:
685
+ case 43:
686
+ case 62:
687
+ case 126:
688
+ return r;
689
+ case 58:
690
+ if (c[++a] === "global") c[a] = "", c[++a] = "\f" + C(c[a], a = 1, -1);
691
+ case 32:
692
+ return a === 1 ? "" : r;
693
+ default:
694
+ switch (a) {
695
+ case 0:
696
+ e = r;
697
+ return S(c) > 1 ? "" : r;
698
+ case a = S(c) - 1:
699
+ case 2:
700
+ return a === 2 ? r + e + e : r + e;
701
+ default:
702
+ return r;
703
+ }
704
+ }
705
+ });
706
+ });
707
+ }
708
+ }
709
+ e.CHARSET = f;
710
+ e.COMMENT = n;
711
+ e.COUNTER_STYLE = w;
712
+ e.DECLARATION = s;
713
+ e.DOCUMENT = h;
714
+ e.FONT_FACE = b;
715
+ e.FONT_FEATURE_VALUES = m;
716
+ e.IMPORT = o;
717
+ e.KEYFRAMES = d;
718
+ e.LAYER = g;
719
+ e.MEDIA = u;
720
+ e.MOZ = a;
721
+ e.MS = r;
722
+ e.NAMESPACE = v;
723
+ e.PAGE = i;
724
+ e.RULESET = t;
725
+ e.SUPPORTS = p;
726
+ e.VIEWPORT = l;
727
+ e.WEBKIT = c;
728
+ e.abs = k;
729
+ e.alloc = K;
730
+ e.append = z;
731
+ e.assign = x;
732
+ e.caret = L;
733
+ e.char = U;
734
+ e.charat = M;
735
+ e.combine = N;
736
+ e.comment = ae;
737
+ e.commenter = J;
738
+ e.compile = X;
739
+ e.copy = j;
740
+ e.dealloc = V;
741
+ e.declaration = ce;
742
+ e.delimit = W;
743
+ e.delimiter = q;
744
+ e.escaping = Z;
745
+ e.from = $;
746
+ e.hash = E;
747
+ e.identifier = Q;
748
+ e.indexof = O;
749
+ e.match = T;
750
+ e.middleware = ie;
751
+ e.namespace = fe;
752
+ e.next = F;
753
+ e.node = P;
754
+ e.parse = ee;
755
+ e.peek = I;
756
+ e.prefix = ne;
757
+ e.prefixer = oe;
758
+ e.prev = _;
759
+ e.replace = A;
760
+ e.ruleset = re;
761
+ e.rulesheet = ue;
762
+ e.serialize = te;
763
+ e.sizeof = S;
764
+ e.slice = D;
765
+ e.stringify = se;
766
+ e.strlen = R;
767
+ e.substr = C;
768
+ e.token = Y;
769
+ e.tokenize = B;
770
+ e.tokenizer = H;
771
+ e.trim = y;
772
+ e.whitespace = G;
773
+ Object.defineProperty(e, "__esModule", {
774
+ value: true
775
+ });
776
+ });
777
+ })(stylis, stylisExports);
778
+
779
+ var weakMemoize = function weakMemoize(func) {
780
+ var cache = new WeakMap();
781
+ return function (arg) {
782
+ if (cache.has(arg)) {
783
+ // Use non-null assertion because we just checked that the cache `has` it
784
+ // This allows us to remove `undefined` from the return value
785
+ return cache.get(arg);
786
+ }
787
+ var ret = func(arg);
788
+ cache.set(arg, ret);
789
+ return ret;
790
+ };
52
791
  };
53
792
 
54
- var getStyledAccordionStyles = function (_a) {
55
- var theme = _a.theme, showBorders = _a.showBorders;
56
- var borderStyles = showBorders
57
- ? {
58
- borderColor: theme.color.border.default,
59
- borderWidth: theme.border.width.sm,
60
- borderStyle: theme.border.style.solid,
793
+ function memoize(fn) {
794
+ var cache = Object.create(null);
795
+ return function (arg) {
796
+ if (cache[arg] === undefined) cache[arg] = fn(arg);
797
+ return cache[arg];
798
+ };
799
+ }
800
+
801
+ var isBrowser$1 = typeof document !== 'undefined';
802
+ var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
803
+ var previous = 0;
804
+ var character = 0;
805
+ while (true) {
806
+ previous = character;
807
+ character = stylisExports.peek(); // &\f
808
+
809
+ if (previous === 38 && character === 12) {
810
+ points[index] = 1;
811
+ }
812
+ if (stylisExports.token(character)) {
813
+ break;
814
+ }
815
+ stylisExports.next();
816
+ }
817
+ return stylisExports.slice(begin, stylisExports.position);
818
+ };
819
+ var toRules = function toRules(parsed, points) {
820
+ // pretend we've started with a comma
821
+ var index = -1;
822
+ var character = 44;
823
+ do {
824
+ switch (stylisExports.token(character)) {
825
+ case 0:
826
+ // &\f
827
+ if (character === 38 && stylisExports.peek() === 12) {
828
+ // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
829
+ // stylis inserts \f after & to know when & where it should replace this sequence with the context selector
830
+ // and when it should just concatenate the outer and inner selectors
831
+ // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
832
+ points[index] = 1;
833
+ }
834
+ parsed[index] += identifierWithPointTracking(stylisExports.position - 1, points, index);
835
+ break;
836
+ case 2:
837
+ parsed[index] += stylisExports.delimit(character);
838
+ break;
839
+ case 4:
840
+ // comma
841
+ if (character === 44) {
842
+ // colon
843
+ parsed[++index] = stylisExports.peek() === 58 ? '&\f' : '';
844
+ points[index] = parsed[index].length;
845
+ break;
61
846
  }
62
- : {};
63
- return __assign(__assign({}, borderStyles), { paddingLeft: theme.spacing[6], paddingRight: theme.spacing[6], paddingTop: theme.spacing[6], paddingBottom: theme.spacing[6], backgroundColor: theme.color.background.neutral, display: 'flex ', flexDirection: 'column', boxSizing: 'border-box', width: '100%' });
847
+
848
+ // fallthrough
849
+
850
+ default:
851
+ parsed[index] += stylisExports.from(character);
852
+ }
853
+ } while (character = stylisExports.next());
854
+ return parsed;
64
855
  };
65
- var getStyledAccordionContentStyles = function (_a) {
66
- var theme = _a.theme, height = _a.height;
67
- return {
68
- paddingTop: theme.spacing[4],
69
- height: 'auto',
70
- transition: "".concat(height, " 2s ease-in-out"),
71
- overflow: 'hidden',
72
- };
856
+ var getRules = function getRules(value, points) {
857
+ return stylisExports.dealloc(toRules(stylisExports.alloc(value), points));
858
+ }; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
859
+
860
+ var fixedElements = /* #__PURE__ */new WeakMap();
861
+ var compat = function compat(element) {
862
+ if (element.type !== 'rule' || !element.parent ||
863
+ // positive .length indicates that this rule contains pseudo
864
+ // negative .length indicates that this rule has been already prefixed
865
+ element.length < 1) {
866
+ return;
867
+ }
868
+ var value = element.value;
869
+ var parent = element.parent;
870
+ var isImplicitRule = element.column === parent.column && element.line === parent.line;
871
+ while (parent.type !== 'rule') {
872
+ parent = parent.parent;
873
+ if (!parent) return;
874
+ } // short-circuit for the simplest case
875
+
876
+ if (element.props.length === 1 && value.charCodeAt(0) !== 58
877
+ /* colon */ && !fixedElements.get(parent)) {
878
+ return;
879
+ } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
880
+ // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
881
+
882
+ if (isImplicitRule) {
883
+ return;
884
+ }
885
+ fixedElements.set(element, true);
886
+ var points = [];
887
+ var rules = getRules(value, points);
888
+ var parentRules = parent.props;
889
+ for (var i = 0, k = 0; i < rules.length; i++) {
890
+ for (var j = 0; j < parentRules.length; j++, k++) {
891
+ element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
892
+ }
893
+ }
73
894
  };
74
- var getStyledAccordionArrowStyles = function (_a) {
75
- var transform = _a.transform;
76
- return {
77
- display: 'flex',
78
- height: '100%',
79
- marginLeft: 'auto',
80
- transition: 'transform 0.2s ease-in-out',
81
- transform: transform,
82
- cursor: 'pointer',
83
- };
895
+ var removeLabel = function removeLabel(element) {
896
+ if (element.type === 'decl') {
897
+ var value = element.value;
898
+ if (
899
+ // charcode for l
900
+ value.charCodeAt(0) === 108 &&
901
+ // charcode for b
902
+ value.charCodeAt(2) === 98) {
903
+ // this ignores label
904
+ element["return"] = '';
905
+ element.value = '';
906
+ }
907
+ }
84
908
  };
85
909
 
86
- var StyledAccordionWrapper = styled__default.default.div(function (_a) {
87
- var theme = _a.theme, showBorders = _a.showBorders, _b = _a.css, css = _b === void 0 ? {} : _b;
88
- return (__assign(__assign({}, getStyledAccordionStyles({ theme: theme, showBorders: showBorders })), css));
89
- });
90
- var StyledAccordionContent = styled__default.default.div(function (_a) {
91
- var theme = _a.theme, height = _a.height, css = _a.css;
92
- return (__assign(__assign({}, getStyledAccordionContentStyles({
93
- theme: theme,
94
- height: height,
95
- })), css));
96
- });
97
- var StyledAccordionArrow = styled__default.default.div(function (_a) {
98
- var transform = _a.transform, _b = _a.css, css = _b === void 0 ? {} : _b;
99
- return (__assign(__assign({}, getStyledAccordionArrowStyles({ transform: transform })), css));
910
+ /* eslint-disable no-fallthrough */
911
+
912
+ function prefix(value, length) {
913
+ switch (stylisExports.hash(value, length)) {
914
+ // color-adjust
915
+ case 5103:
916
+ return stylisExports.WEBKIT + 'print-' + value + value;
917
+ // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
918
+
919
+ case 5737:
920
+ case 4201:
921
+ case 3177:
922
+ case 3433:
923
+ case 1641:
924
+ case 4457:
925
+ case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
926
+
927
+ case 5572:
928
+ case 6356:
929
+ case 5844:
930
+ case 3191:
931
+ case 6645:
932
+ case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
933
+
934
+ case 6391:
935
+ case 5879:
936
+ case 5623:
937
+ case 6135:
938
+ case 4599:
939
+ case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
940
+
941
+ case 4215:
942
+ case 6389:
943
+ case 5109:
944
+ case 5365:
945
+ case 5621:
946
+ case 3829:
947
+ return stylisExports.WEBKIT + value + value;
948
+ // appearance, user-select, transform, hyphens, text-size-adjust
949
+
950
+ case 5349:
951
+ case 4246:
952
+ case 4810:
953
+ case 6968:
954
+ case 2756:
955
+ return stylisExports.WEBKIT + value + stylisExports.MOZ + value + stylisExports.MS + value + value;
956
+ // flex, flex-direction
957
+
958
+ case 6828:
959
+ case 4268:
960
+ return stylisExports.WEBKIT + value + stylisExports.MS + value + value;
961
+ // order
962
+
963
+ case 6165:
964
+ return stylisExports.WEBKIT + value + stylisExports.MS + 'flex-' + value + value;
965
+ // align-items
966
+
967
+ case 5187:
968
+ return stylisExports.WEBKIT + value + stylisExports.replace(value, /(\w+).+(:[^]+)/, stylisExports.WEBKIT + 'box-$1$2' + stylisExports.MS + 'flex-$1$2') + value;
969
+ // align-self
970
+
971
+ case 5443:
972
+ return stylisExports.WEBKIT + value + stylisExports.MS + 'flex-item-' + stylisExports.replace(value, /flex-|-self/, '') + value;
973
+ // align-content
974
+
975
+ case 4675:
976
+ return stylisExports.WEBKIT + value + stylisExports.MS + 'flex-line-pack' + stylisExports.replace(value, /align-content|flex-|-self/, '') + value;
977
+ // flex-shrink
978
+
979
+ case 5548:
980
+ return stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, 'shrink', 'negative') + value;
981
+ // flex-basis
982
+
983
+ case 5292:
984
+ return stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, 'basis', 'preferred-size') + value;
985
+ // flex-grow
986
+
987
+ case 6060:
988
+ return stylisExports.WEBKIT + 'box-' + stylisExports.replace(value, '-grow', '') + stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, 'grow', 'positive') + value;
989
+ // transition
990
+
991
+ case 4554:
992
+ return stylisExports.WEBKIT + stylisExports.replace(value, /([^-])(transform)/g, '$1' + stylisExports.WEBKIT + '$2') + value;
993
+ // cursor
994
+
995
+ case 6187:
996
+ return stylisExports.replace(stylisExports.replace(stylisExports.replace(value, /(zoom-|grab)/, stylisExports.WEBKIT + '$1'), /(image-set)/, stylisExports.WEBKIT + '$1'), value, '') + value;
997
+ // background, background-image
998
+
999
+ case 5495:
1000
+ case 3959:
1001
+ return stylisExports.replace(value, /(image-set\([^]*)/, stylisExports.WEBKIT + '$1' + '$`$1');
1002
+ // justify-content
1003
+
1004
+ case 4968:
1005
+ return stylisExports.replace(stylisExports.replace(value, /(.+:)(flex-)?(.*)/, stylisExports.WEBKIT + 'box-pack:$3' + stylisExports.MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + stylisExports.WEBKIT + value + value;
1006
+ // (margin|padding)-inline-(start|end)
1007
+
1008
+ case 4095:
1009
+ case 3583:
1010
+ case 4068:
1011
+ case 2532:
1012
+ return stylisExports.replace(value, /(.+)-inline(.+)/, stylisExports.WEBKIT + '$1$2') + value;
1013
+ // (min|max)?(width|height|inline-size|block-size)
1014
+
1015
+ case 8116:
1016
+ case 7059:
1017
+ case 5753:
1018
+ case 5535:
1019
+ case 5445:
1020
+ case 5701:
1021
+ case 4933:
1022
+ case 4677:
1023
+ case 5533:
1024
+ case 5789:
1025
+ case 5021:
1026
+ case 4765:
1027
+ // stretch, max-content, min-content, fill-available
1028
+ if (stylisExports.strlen(value) - 1 - length > 6) switch (stylisExports.charat(value, length + 1)) {
1029
+ // (m)ax-content, (m)in-content
1030
+ case 109:
1031
+ // -
1032
+ if (stylisExports.charat(value, length + 4) !== 45) break;
1033
+ // (f)ill-available, (f)it-content
1034
+
1035
+ case 102:
1036
+ return stylisExports.replace(value, /(.+:)(.+)-([^]+)/, '$1' + stylisExports.WEBKIT + '$2-$3' + '$1' + stylisExports.MOZ + (stylisExports.charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
1037
+ // (s)tretch
1038
+
1039
+ case 115:
1040
+ return ~stylisExports.indexof(value, 'stretch') ? prefix(stylisExports.replace(value, 'stretch', 'fill-available'), length) + value : value;
1041
+ }
1042
+ break;
1043
+ // position: sticky
1044
+
1045
+ case 4949:
1046
+ // (s)ticky?
1047
+ if (stylisExports.charat(value, length + 1) !== 115) break;
1048
+ // display: (flex|inline-flex)
1049
+
1050
+ case 6444:
1051
+ switch (stylisExports.charat(value, stylisExports.strlen(value) - 3 - (~stylisExports.indexof(value, '!important') && 10))) {
1052
+ // stic(k)y
1053
+ case 107:
1054
+ return stylisExports.replace(value, ':', ':' + stylisExports.WEBKIT) + value;
1055
+ // (inline-)?fl(e)x
1056
+
1057
+ case 101:
1058
+ return stylisExports.replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + stylisExports.WEBKIT + (stylisExports.charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + stylisExports.WEBKIT + '$2$3' + '$1' + stylisExports.MS + '$2box$3') + value;
1059
+ }
1060
+ break;
1061
+ // writing-mode
1062
+
1063
+ case 5936:
1064
+ switch (stylisExports.charat(value, length + 11)) {
1065
+ // vertical-l(r)
1066
+ case 114:
1067
+ return stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
1068
+ // vertical-r(l)
1069
+
1070
+ case 108:
1071
+ return stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
1072
+ // horizontal(-)tb
1073
+
1074
+ case 45:
1075
+ return stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
1076
+ }
1077
+ return stylisExports.WEBKIT + value + stylisExports.MS + value + value;
1078
+ }
1079
+ return value;
1080
+ }
1081
+ var prefixer = function prefixer(element, index, children, callback) {
1082
+ if (element.length > -1) if (!element["return"]) switch (element.type) {
1083
+ case stylisExports.DECLARATION:
1084
+ element["return"] = prefix(element.value, element.length);
1085
+ break;
1086
+ case stylisExports.KEYFRAMES:
1087
+ return stylisExports.serialize([stylisExports.copy(element, {
1088
+ value: stylisExports.replace(element.value, '@', '@' + stylisExports.WEBKIT)
1089
+ })], callback);
1090
+ case stylisExports.RULESET:
1091
+ if (element.length) return stylisExports.combine(element.props, function (value) {
1092
+ switch (stylisExports.match(value, /(::plac\w+|:read-\w+)/)) {
1093
+ // :read-(only|write)
1094
+ case ':read-only':
1095
+ case ':read-write':
1096
+ return stylisExports.serialize([stylisExports.copy(element, {
1097
+ props: [stylisExports.replace(value, /:(read-\w+)/, ':' + stylisExports.MOZ + '$1')]
1098
+ })], callback);
1099
+ // :placeholder
1100
+
1101
+ case '::placeholder':
1102
+ return stylisExports.serialize([stylisExports.copy(element, {
1103
+ props: [stylisExports.replace(value, /:(plac\w+)/, ':' + stylisExports.WEBKIT + 'input-$1')]
1104
+ }), stylisExports.copy(element, {
1105
+ props: [stylisExports.replace(value, /:(plac\w+)/, ':' + stylisExports.MOZ + '$1')]
1106
+ }), stylisExports.copy(element, {
1107
+ props: [stylisExports.replace(value, /:(plac\w+)/, stylisExports.MS + 'input-$1')]
1108
+ })], callback);
1109
+ }
1110
+ return '';
1111
+ });
1112
+ }
1113
+ };
1114
+ var getServerStylisCache = isBrowser$1 ? undefined : weakMemoize(function () {
1115
+ return memoize(function () {
1116
+ return {};
1117
+ });
100
1118
  });
1119
+ var defaultStylisPlugins = [prefixer];
1120
+ var createCache = function createCache(options) {
1121
+ var key = options.key;
1122
+ if (isBrowser$1 && key === 'css') {
1123
+ var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
1124
+ // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
1125
+ // note this very very intentionally targets all style elements regardless of the key to ensure
1126
+ // that creating a cache works inside of render of a React component
101
1127
 
102
- var classnamesExports = {};
103
- var classnames = {
104
- get exports(){ return classnamesExports; },
105
- set exports(v){ classnamesExports = v; },
1128
+ Array.prototype.forEach.call(ssrStyles, function (node) {
1129
+ // we want to only move elements which have a space in the data-emotion attribute value
1130
+ // because that indicates that it is an Emotion 11 server-side rendered style elements
1131
+ // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
1132
+ // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
1133
+ // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
1134
+ // will not result in the Emotion 10 styles being destroyed
1135
+ var dataEmotionAttribute = node.getAttribute('data-emotion');
1136
+ if (dataEmotionAttribute.indexOf(' ') === -1) {
1137
+ return;
1138
+ }
1139
+ document.head.appendChild(node);
1140
+ node.setAttribute('data-s', '');
1141
+ });
1142
+ }
1143
+ var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
1144
+ var inserted = {};
1145
+ var container;
1146
+ var nodesToHydrate = [];
1147
+ if (isBrowser$1) {
1148
+ container = options.container || document.head;
1149
+ Array.prototype.forEach.call(
1150
+ // this means we will ignore elements which don't have a space in them which
1151
+ // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
1152
+ document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
1153
+ var attrib = node.getAttribute("data-emotion").split(' ');
1154
+ for (var i = 1; i < attrib.length; i++) {
1155
+ inserted[attrib[i]] = true;
1156
+ }
1157
+ nodesToHydrate.push(node);
1158
+ });
1159
+ }
1160
+ var _insert;
1161
+ var omnipresentPlugins = [compat, removeLabel];
1162
+ if (!getServerStylisCache) {
1163
+ var currentSheet;
1164
+ var finalizingPlugins = [stylisExports.stringify, stylisExports.rulesheet(function (rule) {
1165
+ currentSheet.insert(rule);
1166
+ })];
1167
+ var serializer = stylisExports.middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
1168
+ var stylis = function stylis(styles) {
1169
+ return stylisExports.serialize(stylisExports.compile(styles), serializer);
1170
+ };
1171
+ _insert = function insert(selector, serialized, sheet, shouldCache) {
1172
+ currentSheet = sheet;
1173
+ stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
1174
+ if (shouldCache) {
1175
+ cache.inserted[serialized.name] = true;
1176
+ }
1177
+ };
1178
+ } else {
1179
+ var _finalizingPlugins = [stylisExports.stringify];
1180
+ var _serializer = stylisExports.middleware(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins));
1181
+ var _stylis = function _stylis(styles) {
1182
+ return stylisExports.serialize(stylisExports.compile(styles), _serializer);
1183
+ };
1184
+ var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
1185
+ var getRules = function getRules(selector, serialized) {
1186
+ var name = serialized.name;
1187
+ if (serverStylisCache[name] === undefined) {
1188
+ serverStylisCache[name] = _stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
1189
+ }
1190
+ return serverStylisCache[name];
1191
+ };
1192
+ _insert = function _insert(selector, serialized, sheet, shouldCache) {
1193
+ var name = serialized.name;
1194
+ var rules = getRules(selector, serialized);
1195
+ if (cache.compat === undefined) {
1196
+ // in regular mode, we don't set the styles on the inserted cache
1197
+ // since we don't need to and that would be wasting memory
1198
+ // we return them so that they are rendered in a style tag
1199
+ if (shouldCache) {
1200
+ cache.inserted[name] = true;
1201
+ }
1202
+ return rules;
1203
+ } else {
1204
+ // in compat mode, we put the styles on the inserted cache so
1205
+ // that emotion-server can pull out the styles
1206
+ // except when we don't want to cache it which was in Global but now
1207
+ // is nowhere but we don't want to do a major right now
1208
+ // and just in case we're going to leave the case here
1209
+ // it's also not affecting client side bundle size
1210
+ // so it's really not a big deal
1211
+ if (shouldCache) {
1212
+ cache.inserted[name] = rules;
1213
+ } else {
1214
+ return rules;
1215
+ }
1216
+ }
1217
+ };
1218
+ }
1219
+ var cache = {
1220
+ key: key,
1221
+ sheet: new StyleSheet({
1222
+ key: key,
1223
+ container: container,
1224
+ nonce: options.nonce,
1225
+ speedy: options.speedy,
1226
+ prepend: options.prepend,
1227
+ insertionPoint: options.insertionPoint
1228
+ }),
1229
+ nonce: options.nonce,
1230
+ inserted: inserted,
1231
+ registered: {},
1232
+ insert: _insert
1233
+ };
1234
+ cache.sheet.hydrate(nodesToHydrate);
1235
+ return cache;
106
1236
  };
107
1237
 
108
- /*!
109
- Copyright (c) 2018 Jed Watson.
110
- Licensed under the MIT License (MIT), see
111
- http://jedwatson.github.io/classnames
112
- */
113
- (function (module) {
114
- /* global define */
1238
+ /* eslint-disable */
1239
+ // Inspired by https://github.com/garycourt/murmurhash-js
1240
+ // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
1241
+ function murmur2(str) {
1242
+ // 'm' and 'r' are mixing constants generated offline.
1243
+ // They're not really 'magic', they just happen to work well.
1244
+ // const m = 0x5bd1e995;
1245
+ // const r = 24;
1246
+ // Initialize the hash
1247
+ var h = 0; // Mix 4 bytes at a time into the hash
1248
+
1249
+ var k,
1250
+ i = 0,
1251
+ len = str.length;
1252
+ for (; len >= 4; ++i, len -= 4) {
1253
+ k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
1254
+ k = /* Math.imul(k, m): */
1255
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
1256
+ k ^= /* k >>> r: */
1257
+ k >>> 24;
1258
+ h = /* Math.imul(k, m): */
1259
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ /* Math.imul(h, m): */
1260
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
1261
+ } // Handle the last few bytes of the input array
115
1262
 
116
- (function () {
1263
+ switch (len) {
1264
+ case 3:
1265
+ h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
1266
+ case 2:
1267
+ h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
1268
+ case 1:
1269
+ h ^= str.charCodeAt(i) & 0xff;
1270
+ h = /* Math.imul(h, m): */
1271
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
1272
+ } // Do a few final mixes of the hash to ensure the last few
1273
+ // bytes are well-incorporated.
117
1274
 
118
- var hasOwn = {}.hasOwnProperty;
119
- function classNames() {
120
- var classes = '';
121
- for (var i = 0; i < arguments.length; i++) {
122
- var arg = arguments[i];
123
- if (arg) {
124
- classes = appendClass(classes, parseValue(arg));
1275
+ h ^= h >>> 13;
1276
+ h = /* Math.imul(h, m): */
1277
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
1278
+ return ((h ^ h >>> 15) >>> 0).toString(36);
1279
+ }
1280
+
1281
+ var unitlessKeys = {
1282
+ animationIterationCount: 1,
1283
+ aspectRatio: 1,
1284
+ borderImageOutset: 1,
1285
+ borderImageSlice: 1,
1286
+ borderImageWidth: 1,
1287
+ boxFlex: 1,
1288
+ boxFlexGroup: 1,
1289
+ boxOrdinalGroup: 1,
1290
+ columnCount: 1,
1291
+ columns: 1,
1292
+ flex: 1,
1293
+ flexGrow: 1,
1294
+ flexPositive: 1,
1295
+ flexShrink: 1,
1296
+ flexNegative: 1,
1297
+ flexOrder: 1,
1298
+ gridRow: 1,
1299
+ gridRowEnd: 1,
1300
+ gridRowSpan: 1,
1301
+ gridRowStart: 1,
1302
+ gridColumn: 1,
1303
+ gridColumnEnd: 1,
1304
+ gridColumnSpan: 1,
1305
+ gridColumnStart: 1,
1306
+ msGridRow: 1,
1307
+ msGridRowSpan: 1,
1308
+ msGridColumn: 1,
1309
+ msGridColumnSpan: 1,
1310
+ fontWeight: 1,
1311
+ lineHeight: 1,
1312
+ opacity: 1,
1313
+ order: 1,
1314
+ orphans: 1,
1315
+ scale: 1,
1316
+ tabSize: 1,
1317
+ widows: 1,
1318
+ zIndex: 1,
1319
+ zoom: 1,
1320
+ WebkitLineClamp: 1,
1321
+ // SVG-related properties
1322
+ fillOpacity: 1,
1323
+ floodOpacity: 1,
1324
+ stopOpacity: 1,
1325
+ strokeDasharray: 1,
1326
+ strokeDashoffset: 1,
1327
+ strokeMiterlimit: 1,
1328
+ strokeOpacity: 1,
1329
+ strokeWidth: 1
1330
+ };
1331
+
1332
+ var isDevelopment = false;
1333
+ var hyphenateRegex = /[A-Z]|^ms/g;
1334
+ var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
1335
+ var isCustomProperty = function isCustomProperty(property) {
1336
+ return property.charCodeAt(1) === 45;
1337
+ };
1338
+ var isProcessableValue = function isProcessableValue(value) {
1339
+ return value != null && typeof value !== 'boolean';
1340
+ };
1341
+ var processStyleName = /* #__PURE__ */memoize(function (styleName) {
1342
+ return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
1343
+ });
1344
+ var processStyleValue = function processStyleValue(key, value) {
1345
+ switch (key) {
1346
+ case 'animation':
1347
+ case 'animationName':
1348
+ {
1349
+ if (typeof value === 'string') {
1350
+ return value.replace(animationRegex, function (match, p1, p2) {
1351
+ cursor = {
1352
+ name: p1,
1353
+ styles: p2,
1354
+ next: cursor
1355
+ };
1356
+ return p1;
1357
+ });
125
1358
  }
126
1359
  }
127
- return classes;
128
- }
129
- function parseValue(arg) {
130
- if (typeof arg === 'string' || typeof arg === 'number') {
131
- return arg;
132
- }
133
- if (typeof arg !== 'object') {
1360
+ }
1361
+ if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
1362
+ return value + 'px';
1363
+ }
1364
+ return value;
1365
+ };
1366
+ var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';
1367
+ function handleInterpolation(mergedProps, registered, interpolation) {
1368
+ if (interpolation == null) {
1369
+ return '';
1370
+ }
1371
+ var componentSelector = interpolation;
1372
+ if (componentSelector.__emotion_styles !== undefined) {
1373
+ return componentSelector;
1374
+ }
1375
+ switch (typeof interpolation) {
1376
+ case 'boolean':
1377
+ {
134
1378
  return '';
135
1379
  }
136
- if (Array.isArray(arg)) {
137
- return classNames.apply(null, arg);
138
- }
139
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
140
- return arg.toString();
1380
+ case 'object':
1381
+ {
1382
+ var keyframes = interpolation;
1383
+ if (keyframes.anim === 1) {
1384
+ cursor = {
1385
+ name: keyframes.name,
1386
+ styles: keyframes.styles,
1387
+ next: cursor
1388
+ };
1389
+ return keyframes.name;
1390
+ }
1391
+ var serializedStyles = interpolation;
1392
+ if (serializedStyles.styles !== undefined) {
1393
+ var next = serializedStyles.next;
1394
+ if (next !== undefined) {
1395
+ // not the most efficient thing ever but this is a pretty rare case
1396
+ // and there will be very few iterations of this generally
1397
+ while (next !== undefined) {
1398
+ cursor = {
1399
+ name: next.name,
1400
+ styles: next.styles,
1401
+ next: cursor
1402
+ };
1403
+ next = next.next;
1404
+ }
1405
+ }
1406
+ var styles = serializedStyles.styles + ";";
1407
+ return styles;
1408
+ }
1409
+ return createStringFromObject(mergedProps, registered, interpolation);
141
1410
  }
142
- var classes = '';
143
- for (var key in arg) {
144
- if (hasOwn.call(arg, key) && arg[key]) {
145
- classes = appendClass(classes, key);
1411
+ case 'function':
1412
+ {
1413
+ if (mergedProps !== undefined) {
1414
+ var previousCursor = cursor;
1415
+ var result = interpolation(mergedProps);
1416
+ cursor = previousCursor;
1417
+ return handleInterpolation(mergedProps, registered, result);
146
1418
  }
1419
+ break;
147
1420
  }
148
- return classes;
1421
+ } // finalize string values (regular strings and functions interpolated into css calls)
1422
+
1423
+ var asString = interpolation;
1424
+ if (registered == null) {
1425
+ return asString;
1426
+ }
1427
+ var cached = registered[asString];
1428
+ return cached !== undefined ? cached : asString;
1429
+ }
1430
+ function createStringFromObject(mergedProps, registered, obj) {
1431
+ var string = '';
1432
+ if (Array.isArray(obj)) {
1433
+ for (var i = 0; i < obj.length; i++) {
1434
+ string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
149
1435
  }
150
- function appendClass(value, newClass) {
151
- if (!newClass) {
152
- return value;
153
- }
154
- if (value) {
155
- return value + ' ' + newClass;
1436
+ } else {
1437
+ for (var key in obj) {
1438
+ var value = obj[key];
1439
+ if (typeof value !== 'object') {
1440
+ var asString = value;
1441
+ if (registered != null && registered[asString] !== undefined) {
1442
+ string += key + "{" + registered[asString] + "}";
1443
+ } else if (isProcessableValue(asString)) {
1444
+ string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
1445
+ }
1446
+ } else {
1447
+ if (key === 'NO_COMPONENT_SELECTOR' && isDevelopment) {
1448
+ throw new Error(noComponentSelectorMessage);
1449
+ }
1450
+ if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
1451
+ for (var _i = 0; _i < value.length; _i++) {
1452
+ if (isProcessableValue(value[_i])) {
1453
+ string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
1454
+ }
1455
+ }
1456
+ } else {
1457
+ var interpolated = handleInterpolation(mergedProps, registered, value);
1458
+ switch (key) {
1459
+ case 'animation':
1460
+ case 'animationName':
1461
+ {
1462
+ string += processStyleName(key) + ":" + interpolated + ";";
1463
+ break;
1464
+ }
1465
+ default:
1466
+ {
1467
+ string += key + "{" + interpolated + "}";
1468
+ }
1469
+ }
1470
+ }
156
1471
  }
157
- return value + newClass;
158
1472
  }
159
- if (module.exports) {
160
- classNames.default = classNames;
161
- module.exports = classNames;
162
- } else {
163
- window.classNames = classNames;
1473
+ }
1474
+ return string;
1475
+ }
1476
+ var labelPattern = /label:\s*([^\s;{]+)\s*(;|$)/g; // this is the cursor for keyframes
1477
+ // keyframes are stored on the SerializedStyles object as a linked list
1478
+
1479
+ var cursor;
1480
+ function serializeStyles(args, registered, mergedProps) {
1481
+ if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
1482
+ return args[0];
1483
+ }
1484
+ var stringMode = true;
1485
+ var styles = '';
1486
+ cursor = undefined;
1487
+ var strings = args[0];
1488
+ if (strings == null || strings.raw === undefined) {
1489
+ stringMode = false;
1490
+ styles += handleInterpolation(mergedProps, registered, strings);
1491
+ } else {
1492
+ var asTemplateStringsArr = strings;
1493
+ styles += asTemplateStringsArr[0];
1494
+ } // we start at 1 since we've already handled the first arg
1495
+
1496
+ for (var i = 1; i < args.length; i++) {
1497
+ styles += handleInterpolation(mergedProps, registered, args[i]);
1498
+ if (stringMode) {
1499
+ var templateStringsArr = strings;
1500
+ styles += templateStringsArr[i];
1501
+ }
1502
+ } // using a global regex with .exec is stateful so lastIndex has to be reset each time
1503
+
1504
+ labelPattern.lastIndex = 0;
1505
+ var identifierName = '';
1506
+ var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
1507
+
1508
+ while ((match = labelPattern.exec(styles)) !== null) {
1509
+ identifierName += '-' + match[1];
1510
+ }
1511
+ var name = murmur2(styles) + identifierName;
1512
+ return {
1513
+ name: name,
1514
+ styles: styles,
1515
+ next: cursor
1516
+ };
1517
+ }
1518
+
1519
+ var isBrowser = typeof document !== 'undefined';
1520
+ function getRegisteredStyles(registered, registeredStyles, classNames) {
1521
+ var rawClassName = '';
1522
+ classNames.split(' ').forEach(function (className) {
1523
+ if (registered[className] !== undefined) {
1524
+ registeredStyles.push(registered[className] + ";");
1525
+ } else if (className) {
1526
+ rawClassName += className + " ";
1527
+ }
1528
+ });
1529
+ return rawClassName;
1530
+ }
1531
+ var registerStyles = function registerStyles(cache, serialized, isStringTag) {
1532
+ var className = cache.key + "-" + serialized.name;
1533
+ if (
1534
+ // we only need to add the styles to the registered cache if the
1535
+ // class name could be used further down
1536
+ // the tree but if it's a string tag, we know it won't
1537
+ // so we don't have to add it to registered cache.
1538
+ // this improves memory usage since we can avoid storing the whole style string
1539
+ (isStringTag === false ||
1540
+ // we need to always store it if we're in compat mode and
1541
+ // in node since emotion-server relies on whether a style is in
1542
+ // the registered cache to know whether a style is global or not
1543
+ // also, note that this check will be dead code eliminated in the browser
1544
+ isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
1545
+ cache.registered[className] = serialized.styles;
1546
+ }
1547
+ };
1548
+ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
1549
+ registerStyles(cache, serialized, isStringTag);
1550
+ var className = cache.key + "-" + serialized.name;
1551
+ if (cache.inserted[serialized.name] === undefined) {
1552
+ var stylesForSSR = '';
1553
+ var current = serialized;
1554
+ do {
1555
+ var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
1556
+ if (!isBrowser && maybeStyles !== undefined) {
1557
+ stylesForSSR += maybeStyles;
1558
+ }
1559
+ current = current.next;
1560
+ } while (current !== undefined);
1561
+ if (!isBrowser && stylesForSSR.length !== 0) {
1562
+ return stylesForSSR;
164
1563
  }
165
- })();
166
- })(classnames);
167
- var classNames = classnamesExports;
1564
+ }
1565
+ };
168
1566
 
169
- var Accordion = function (_a) {
170
- var _b = _a.children, children = _b === void 0 ? null : _b, _c = _a.isOpen, isOpen = _c === void 0 ? false : _c, _d = _a.title, title = _d === void 0 ? '' : _d, _e = _a.onClick, onClick = _e === void 0 ? function () { } : _e, _f = _a.showBorders, showBorders = _f === void 0 ? true : _f, _g = _a.titleVariant, titleVariant = _g === void 0 ? 'L1' : _g, _h = _a.subtitle, subtitle = _h === void 0 ? '' : _h, _j = _a.disableTransition, disableTransition = _j === void 0 ? false : _j, _k = _a.styleConfig, styleConfig = _k === void 0 ? {} : _k;
171
- var accordionArrowStyles = getAccordionArrowStyles({
172
- isOpen: isOpen,
1567
+ function insertWithoutScoping(cache, serialized) {
1568
+ if (cache.inserted[serialized.name] === undefined) {
1569
+ return cache.insert('', serialized, cache.sheet, true);
1570
+ }
1571
+ }
1572
+ function merge(registered, css, className) {
1573
+ var registeredStyles = [];
1574
+ var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
1575
+ if (registeredStyles.length < 2) {
1576
+ return className;
1577
+ }
1578
+ return rawClassName + css(registeredStyles);
1579
+ }
1580
+ var createEmotion = function createEmotion(options) {
1581
+ var cache = createCache(options);
1582
+ cache.sheet.speedy = function (value) {
1583
+ this.isSpeedy = value;
1584
+ };
1585
+ cache.compat = true;
1586
+ var css = function css() {
1587
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1588
+ args[_key] = arguments[_key];
1589
+ }
1590
+ var serialized = serializeStyles(args, cache.registered, undefined);
1591
+ insertStyles(cache, serialized, false);
1592
+ return cache.key + "-" + serialized.name;
1593
+ };
1594
+ var keyframes = function keyframes() {
1595
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1596
+ args[_key2] = arguments[_key2];
1597
+ }
1598
+ var serialized = serializeStyles(args, cache.registered);
1599
+ var animation = "animation-" + serialized.name;
1600
+ insertWithoutScoping(cache, {
1601
+ name: serialized.name,
1602
+ styles: "@keyframes " + animation + "{" + serialized.styles + "}"
173
1603
  });
174
- var root = styleConfig.root, headerContainer = styleConfig.headerContainer, titleContainer = styleConfig.titleContainer, titleProp = styleConfig.title, subTitleProp = styleConfig.subTitle, arrow = styleConfig.arrow, childrenContainer = styleConfig.childrenContainer, childrenContentContainer = styleConfig.childrenContentContainer, arrowIcon = styleConfig.arrowIcon;
175
- return (jsxRuntime.jsxs(StyledAccordionWrapper, __assign({ showBorders: showBorders, className: root === null || root === void 0 ? void 0 : root.className, css: root === null || root === void 0 ? void 0 : root.css }, { children: [jsxRuntime.jsxs(ctDesignContainer.Container, __assign({ className: headerContainer === null || headerContainer === void 0 ? void 0 : headerContainer.className, css: headerContainer === null || headerContainer === void 0 ? void 0 : headerContainer.css, display: 'flex', flexDirection: 'row', onClick: onClick }, { children: [jsxRuntime.jsxs(ctDesignContainer.Container, __assign({ className: classNames('flex flex-column', titleContainer === null || titleContainer === void 0 ? void 0 : titleContainer.className), rowGap: '4px', css: titleContainer === null || titleContainer === void 0 ? void 0 : titleContainer.css }, { children: [jsxRuntime.jsx(ctDesignTypography.Typography, __assign({ variant: titleVariant, styleConfig: titleProp }, { children: title })), subtitle && !isOpen && (jsxRuntime.jsx(ctDesignTypography.Typography, __assign({ variant: 'B2', color: 'subheading', styleConfig: subTitleProp }, { children: subtitle })))] })), jsxRuntime.jsx(StyledAccordionArrow, __assign({}, accordionArrowStyles, { className: arrow === null || arrow === void 0 ? void 0 : arrow.className, css: arrow === null || arrow === void 0 ? void 0 : arrow.css }, { children: jsxRuntime.jsx(ctDesignIcons.ChevronDown, __assign({}, arrowIcon)) }))] })), jsxRuntime.jsx(ctDesignContainer.Container, __assign({ className: childrenContainer === null || childrenContainer === void 0 ? void 0 : childrenContainer.className, css: childrenContainer === null || childrenContainer === void 0 ? void 0 : childrenContainer.css }, { children: isOpen && (jsxRuntime.jsx(StyledAccordionContent, __assign({ height: !isOpen ? '0px' : 'auto', className: childrenContentContainer === null || childrenContentContainer === void 0 ? void 0 : childrenContentContainer.className, css: childrenContentContainer === null || childrenContentContainer === void 0 ? void 0 : childrenContentContainer.css }, { children: !disableTransition && React__default.default.isValidElement(children) ? (jsxRuntime.jsx(ctDesignTransition.Transition, __assign({ type: 'slide', in: isOpen, timeout: {
176
- appear: 200,
177
- enter: 200,
178
- exit: 200,
179
- } }, { children: children }))) : (children) }))) }))] })));
1604
+ return animation;
1605
+ };
1606
+ var injectGlobal = function injectGlobal() {
1607
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
1608
+ args[_key3] = arguments[_key3];
1609
+ }
1610
+ var serialized = serializeStyles(args, cache.registered);
1611
+ insertWithoutScoping(cache, serialized);
1612
+ };
1613
+ var cx = function cx() {
1614
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
1615
+ args[_key4] = arguments[_key4];
1616
+ }
1617
+ return merge(cache.registered, css, classnames(args));
1618
+ };
1619
+ return {
1620
+ css: css,
1621
+ cx: cx,
1622
+ injectGlobal: injectGlobal,
1623
+ keyframes: keyframes,
1624
+ hydrate: function hydrate(ids) {
1625
+ ids.forEach(function (key) {
1626
+ cache.inserted[key] = true;
1627
+ });
1628
+ },
1629
+ flush: function flush() {
1630
+ cache.registered = {};
1631
+ cache.inserted = {};
1632
+ cache.sheet.flush();
1633
+ },
1634
+ sheet: cache.sheet,
1635
+ cache: cache,
1636
+ getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered),
1637
+ merge: merge.bind(null, cache.registered, css)
1638
+ };
180
1639
  };
1640
+ var classnames = function classnames(args) {
1641
+ var cls = '';
1642
+ for (var i = 0; i < args.length; i++) {
1643
+ var arg = args[i];
1644
+ if (arg == null) continue;
1645
+ var toAdd = void 0;
1646
+ switch (typeof arg) {
1647
+ case 'boolean':
1648
+ break;
1649
+ case 'object':
1650
+ {
1651
+ if (Array.isArray(arg)) {
1652
+ toAdd = classnames(arg);
1653
+ } else {
1654
+ toAdd = '';
1655
+ for (var k in arg) {
1656
+ if (arg[k] && k) {
1657
+ toAdd && (toAdd += ' ');
1658
+ toAdd += k;
1659
+ }
1660
+ }
1661
+ }
1662
+ break;
1663
+ }
1664
+ default:
1665
+ {
1666
+ toAdd = arg;
1667
+ }
1668
+ }
1669
+ if (toAdd) {
1670
+ cls && (cls += ' ');
1671
+ cls += toAdd;
1672
+ }
1673
+ }
1674
+ return cls;
1675
+ };
1676
+
1677
+ var _createEmotion = createEmotion({
1678
+ key: 'css'
1679
+ }),
1680
+ css = _createEmotion.css;
1681
+
1682
+ const webStaticStyles = {
1683
+ iconTransition: css({
1684
+ transition: 'transform 0.3s',
1685
+ }),
1686
+ contentTransition: css({
1687
+ transition: 'max-height 0.3s ease-in-out',
1688
+ }),
1689
+ };
1690
+
1691
+ const Accordion = react.forwardRef(({ expanded = false, label, onClick, children, expandIcon, disabled = false, styleConfig, isWrappedInAccordionGroup = false, onAccordionGroupClick, }, forwardedRef) => {
1692
+ const { childrenContainer = [], icon = [], label: labelStyle = [], root = [] } = styleConfig || {};
1693
+ const [isExpanded, setIsExpanded] = react.useState(expanded);
1694
+ const accordionContentRef = react.useRef(null);
1695
+ useIsomorphicEffect__default.default(() => {
1696
+ setIsExpanded(expanded);
1697
+ }, [expanded]);
1698
+ const onAccordionClick = () => {
1699
+ if (disabled)
1700
+ return;
1701
+ if (isWrappedInAccordionGroup) {
1702
+ onAccordionGroupClick === null || onAccordionGroupClick === void 0 ? void 0 : onAccordionGroupClick();
1703
+ }
1704
+ else {
1705
+ setIsExpanded((previouslyExpanded) => !previouslyExpanded);
1706
+ }
1707
+ onClick === null || onClick === void 0 ? void 0 : onClick();
1708
+ };
1709
+ const dynamicStyles = ctDesignStyleManager.useStyles(() => {
1710
+ var _a, _b;
1711
+ const contentScrollHeight = (_b = (_a = accordionContentRef.current) === null || _a === void 0 ? void 0 : _a.scrollHeight) !== null && _b !== void 0 ? _b : 0;
1712
+ return {
1713
+ labelRow: {},
1714
+ iconTransform: {
1715
+ transform: isExpanded ? 'rotate(180deg)' : 'rotate(0deg)',
1716
+ },
1717
+ contentMaxHeight: {
1718
+ maxHeight: isExpanded ? contentScrollHeight : 0,
1719
+ },
1720
+ };
1721
+ }, [isExpanded, disabled]);
1722
+ const mergedIconClassName = ctDesignStyleManager.useWebMergeStyles([accordionStaticStyles.iconContainer, webStaticStyles.iconTransition, dynamicStyles.iconTransform, ...icon], [accordionStaticStyles.iconContainer, dynamicStyles.iconTransform, icon]);
1723
+ const mergedContentClassName = ctDesignStyleManager.useWebMergeStyles([
1724
+ accordionStaticStyles.accordionContentRoot,
1725
+ webStaticStyles.contentTransition,
1726
+ dynamicStyles.contentMaxHeight,
1727
+ ...childrenContainer,
1728
+ ], [accordionStaticStyles.accordionContentRoot, dynamicStyles.contentMaxHeight, childrenContainer]);
1729
+ return (jsxRuntime.jsxs(ctDesignContainer.Container, { styleConfig: { root }, children: [jsxRuntime.jsxs(ctDesignContainer.Container, { ref: forwardedRef, onClick: onAccordionClick, styleConfig: { root: [accordionStaticStyles.labelRow, dynamicStyles.labelRow, ...labelStyle] }, children: [label, expandIcon && jsxRuntime.jsx("div", { className: mergedIconClassName, children: expandIcon })] }), jsxRuntime.jsx("div", { ref: accordionContentRef, className: mergedContentClassName, children: children })] }));
1730
+ });
1731
+ Accordion.displayName = 'Accordion';
181
1732
 
182
1733
  exports.Accordion = Accordion;
183
1734