@purpurds/accordion 5.35.0 → 6.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.
@@ -1,21 +1,21 @@
1
1
  import { jsx as o, jsxs as v } from "react/jsx-runtime";
2
2
  import { useContext as k, useId as R, useState as M, createContext as H } from "react";
3
- function C(t) {
4
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
3
+ function C(a) {
4
+ return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
5
5
  }
6
- var $ = { exports: {} };
6
+ var x = { exports: {} };
7
7
  /*!
8
8
  Copyright (c) 2018 Jed Watson.
9
9
  Licensed under the MIT License (MIT), see
10
10
  http://jedwatson.github.io/classnames
11
11
  */
12
- (function(t) {
12
+ (function(a) {
13
13
  (function() {
14
14
  var n = {}.hasOwnProperty;
15
15
  function p() {
16
16
  for (var r = "", e = 0; e < arguments.length; e++) {
17
- var a = arguments[e];
18
- a && (r = i(r, u(a)));
17
+ var t = arguments[e];
18
+ t && (r = i(r, u(t)));
19
19
  }
20
20
  return r;
21
21
  }
@@ -29,17 +29,17 @@ var $ = { exports: {} };
29
29
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
30
30
  return r.toString();
31
31
  var e = "";
32
- for (var a in r)
33
- n.call(r, a) && r[a] && (e = i(e, a));
32
+ for (var t in r)
33
+ n.call(r, t) && r[t] && (e = i(e, t));
34
34
  return e;
35
35
  }
36
36
  function i(r, e) {
37
37
  return e ? r ? r + " " + e : r + e : r;
38
38
  }
39
- t.exports ? (p.default = p, t.exports = p) : window.classNames = p;
39
+ a.exports ? (p.default = p, a.exports = p) : window.classNames = p;
40
40
  })();
41
- })($);
42
- var D = $.exports;
41
+ })(x);
42
+ var D = x.exports;
43
43
  const B = /* @__PURE__ */ C(D), g = {
44
44
  "purpur-heading": "_purpur-heading_k9fhq_1",
45
45
  "purpur-heading--hyphens": "_purpur-heading--hyphens_k9fhq_8",
@@ -65,30 +65,30 @@ const B = /* @__PURE__ */ C(D), g = {
65
65
  TITLE600: "title-600",
66
66
  TITLE700: "title-700",
67
67
  SUBSECTION100: "subsection-100"
68
- }, m = "purpur-heading", y = ({
69
- ["data-testid"]: t,
68
+ }, f = "purpur-heading", y = ({
69
+ ["data-testid"]: a,
70
70
  children: n,
71
71
  className: p = "",
72
72
  enableHyphenation: u = !1,
73
73
  negative: i = !1,
74
74
  tag: r,
75
75
  variant: e = G.TITLE100,
76
- ...a
76
+ ...t
77
77
  }) => {
78
78
  const s = r, l = B([
79
79
  p,
80
- g[m],
81
- g[`${m}--${e}`],
80
+ g[f],
81
+ g[`${f}--${e}`],
82
82
  {
83
- [g[`${m}--hyphens`]]: u,
84
- [g[`${m}--negative`]]: i
83
+ [g[`${f}--hyphens`]]: u,
84
+ [g[`${f}--negative`]]: i
85
85
  }
86
86
  ]);
87
- return /* @__PURE__ */ o(s, { ...a, className: l, "data-testid": t, children: n });
87
+ return /* @__PURE__ */ o(s, { ...t, className: l, "data-testid": a, children: n });
88
88
  };
89
89
  y.displayName = "Heading";
90
- function V(t) {
91
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
90
+ function U(a) {
91
+ return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
92
92
  }
93
93
  var A = { exports: {} };
94
94
  /*!
@@ -96,13 +96,13 @@ var A = { exports: {} };
96
96
  Licensed under the MIT License (MIT), see
97
97
  http://jedwatson.github.io/classnames
98
98
  */
99
- (function(t) {
99
+ (function(a) {
100
100
  (function() {
101
101
  var n = {}.hasOwnProperty;
102
102
  function p() {
103
103
  for (var r = "", e = 0; e < arguments.length; e++) {
104
- var a = arguments[e];
105
- a && (r = i(r, u.call(this, a)));
104
+ var t = arguments[e];
105
+ t && (r = i(r, u.call(this, t)));
106
106
  }
107
107
  return r;
108
108
  }
@@ -116,24 +116,24 @@ var A = { exports: {} };
116
116
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
117
117
  return r.toString();
118
118
  var e = "";
119
- for (var a in r)
120
- n.call(r, a) && r[a] && (e = i(e, this && this[a] || a));
119
+ for (var t in r)
120
+ n.call(r, t) && r[t] && (e = i(e, this && this[t] || t));
121
121
  return e;
122
122
  }
123
123
  function i(r, e) {
124
124
  return e ? r ? r + " " + e : r + e : r;
125
125
  }
126
- t.exports ? (p.default = p, t.exports = p) : window.classNames = p;
126
+ a.exports ? (p.default = p, a.exports = p) : window.classNames = p;
127
127
  })();
128
128
  })(A);
129
- var U = A.exports;
130
- const N = /* @__PURE__ */ V(U), z = {
129
+ var V = A.exports;
130
+ const N = /* @__PURE__ */ U(V), z = {
131
131
  "purpur-accordion": "_purpur-accordion_u887g_1",
132
132
  "purpur-accordion__title": "_purpur-accordion__title_u887g_4",
133
133
  "purpur-accordion--negative": "_purpur-accordion--negative_u887g_13"
134
134
  };
135
- function F(t) {
136
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
135
+ function F(a) {
136
+ return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
137
137
  }
138
138
  var w = { exports: {} };
139
139
  /*!
@@ -141,13 +141,13 @@ var w = { exports: {} };
141
141
  Licensed under the MIT License (MIT), see
142
142
  http://jedwatson.github.io/classnames
143
143
  */
144
- (function(t) {
144
+ (function(a) {
145
145
  (function() {
146
146
  var n = {}.hasOwnProperty;
147
147
  function p() {
148
148
  for (var r = "", e = 0; e < arguments.length; e++) {
149
- var a = arguments[e];
150
- a && (r = i(r, u.call(this, a)));
149
+ var t = arguments[e];
150
+ t && (r = i(r, u.call(this, t)));
151
151
  }
152
152
  return r;
153
153
  }
@@ -161,18 +161,18 @@ var w = { exports: {} };
161
161
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
162
162
  return r.toString();
163
163
  var e = "";
164
- for (var a in r)
165
- n.call(r, a) && r[a] && (e = i(e, this && this[a] || a));
164
+ for (var t in r)
165
+ n.call(r, t) && r[t] && (e = i(e, this && this[t] || t));
166
166
  return e;
167
167
  }
168
168
  function i(r, e) {
169
169
  return e ? r ? r + " " + e : r + e : r;
170
170
  }
171
- t.exports ? (p.default = p, t.exports = p) : window.classNames = p;
171
+ a.exports ? (p.default = p, a.exports = p) : window.classNames = p;
172
172
  })();
173
173
  })(w);
174
- var J = w.exports;
175
- const X = /* @__PURE__ */ F(J), Y = {
174
+ var Z = w.exports;
175
+ const J = /* @__PURE__ */ F(Z), K = {
176
176
  "purpur-icon": "_purpur-icon_8u1lq_1",
177
177
  "purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
178
178
  "purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
@@ -180,53 +180,47 @@ const X = /* @__PURE__ */ F(J), Y = {
180
180
  "purpur-icon--md": "_purpur-icon--md_8u1lq_16",
181
181
  "purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
182
182
  "purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
183
- }, Z = {
184
- name: "chevron-down",
185
- svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M20.136 7.864a.9.9 0 0 0-1.272 0L12 14.727 5.136 7.864a.9.9 0 0 0-1.272 1.272l7.5 7.5a.9.9 0 0 0 1.272 0l7.5-7.5a.9.9 0 0 0 0-1.272Z" clip-rule="evenodd"/></svg>',
186
- keywords: ["chevron-down"],
187
- category: "utility"
188
- }, T = (t) => /* @__PURE__ */ o(
189
- S,
190
- {
191
- ...t,
192
- svg: Z
193
- }
194
- );
195
- T.displayName = "IconChevronDown";
196
- const K = X.bind(Y), b = "purpur-icon", Q = "md", W = (t) => t.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), rr = ({ content: t = "", title: n } = {}) => {
183
+ }, Q = J.bind(K), b = "purpur-icon", W = "md", X = (a) => a.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), Y = ({ content: a = "", title: n } = {}) => {
197
184
  const p = [
198
185
  { name: "xmlns", value: "http://www.w3.org/2000/svg" },
199
186
  { name: "fill", value: "currentColor" },
200
187
  { name: "viewBox", value: "0 0 24 24" },
201
188
  n ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
202
189
  ], u = n ? `<title>${n}</title>` : "";
203
- return `<svg ${W(p)}>${u}${t}</svg>`;
204
- }, er = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(), S = ({
205
- ["data-testid"]: t,
190
+ return `<svg ${X(p)}>${u}${a}</svg>`;
191
+ }, rr = (a) => a.replace(/<(\/?)svg([^>]*)>/g, "").trim(), T = ({
192
+ ["data-testid"]: a,
206
193
  svg: n,
207
194
  allyTitle: p,
208
195
  className: u,
209
- size: i = Q,
196
+ size: i = W,
210
197
  ...r
211
198
  }) => {
212
- const e = rr({
213
- content: er(n.svg),
199
+ const e = Y({
200
+ content: rr(n.svg),
214
201
  title: p
215
- }), a = K(u, b, `${b}--${i}`);
202
+ }), t = Q(u, b, `${b}--${i}`);
216
203
  return /* @__PURE__ */ o(
217
204
  "span",
218
205
  {
219
206
  "aria-label": p,
220
- className: a,
221
- "data-testid": t,
207
+ className: t,
208
+ "data-testid": a,
222
209
  dangerouslySetInnerHTML: { __html: e },
223
210
  ...r
224
211
  }
225
212
  );
226
213
  };
227
- S.displayName = "Icon";
228
- function tr(t) {
229
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
214
+ T.displayName = "Icon";
215
+ const er = {
216
+ name: "chevron-down",
217
+ svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M20.136 7.864a.9.9 0 0 0-1.272 0L12 14.727 5.136 7.864a.9.9 0 0 0-1.272 1.272l7.5 7.5a.9.9 0 0 0 1.272 0l7.5-7.5a.9.9 0 0 0 0-1.272Z" clip-rule="evenodd"/></svg>',
218
+ keywords: ["chevron-down"],
219
+ category: "utility"
220
+ }, S = (a) => /* @__PURE__ */ o(T, { ...a, svg: er });
221
+ S.displayName = "IconChevronDown";
222
+ function ar(a) {
223
+ return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
230
224
  }
231
225
  var I = { exports: {} };
232
226
  /*!
@@ -234,13 +228,13 @@ var I = { exports: {} };
234
228
  Licensed under the MIT License (MIT), see
235
229
  http://jedwatson.github.io/classnames
236
230
  */
237
- (function(t) {
231
+ (function(a) {
238
232
  (function() {
239
233
  var n = {}.hasOwnProperty;
240
234
  function p() {
241
235
  for (var r = "", e = 0; e < arguments.length; e++) {
242
- var a = arguments[e];
243
- a && (r = i(r, u(a)));
236
+ var t = arguments[e];
237
+ t && (r = i(r, u(t)));
244
238
  }
245
239
  return r;
246
240
  }
@@ -254,18 +248,18 @@ var I = { exports: {} };
254
248
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
255
249
  return r.toString();
256
250
  var e = "";
257
- for (var a in r)
258
- n.call(r, a) && r[a] && (e = i(e, a));
251
+ for (var t in r)
252
+ n.call(r, t) && r[t] && (e = i(e, t));
259
253
  return e;
260
254
  }
261
255
  function i(r, e) {
262
256
  return e ? r ? r + " " + e : r + e : r;
263
257
  }
264
- t.exports ? (p.default = p, t.exports = p) : window.classNames = p;
258
+ a.exports ? (p.default = p, a.exports = p) : window.classNames = p;
265
259
  })();
266
260
  })(I);
267
- var ar = I.exports;
268
- const pr = /* @__PURE__ */ tr(ar), d = {
261
+ var tr = I.exports;
262
+ const pr = /* @__PURE__ */ ar(tr), d = {
269
263
  "purpur-paragraph": "_purpur-paragraph_1rh57_1",
270
264
  "purpur-paragraph--disabled": "_purpur-paragraph--disabled_1rh57_7",
271
265
  "purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1rh57_10",
@@ -292,14 +286,14 @@ const pr = /* @__PURE__ */ tr(ar), d = {
292
286
  OVERLINE100: "overline-100",
293
287
  OVERLINE200: "overline-200"
294
288
  }, h = "purpur-paragraph", O = ({
295
- ["data-testid"]: t,
289
+ ["data-testid"]: a,
296
290
  children: n,
297
291
  className: p,
298
292
  disabled: u,
299
293
  enableHyphenation: i = !1,
300
294
  negative: r = !1,
301
295
  variant: e = nr.PARAGRAPH100,
302
- ...a
296
+ ...t
303
297
  }) => {
304
298
  const s = pr([
305
299
  p,
@@ -311,22 +305,22 @@ const pr = /* @__PURE__ */ tr(ar), d = {
311
305
  [d[`${h}--negative`]]: r
312
306
  }
313
307
  ]);
314
- return /* @__PURE__ */ o("p", { ...a, className: s, "data-testid": t, children: n });
308
+ return /* @__PURE__ */ o("p", { ...t, className: s, "data-testid": a, children: n });
315
309
  };
316
310
  O.displayName = "Paragraph";
317
311
  const ir = {
318
- "purpur-accordion-item": "_purpur-accordion-item_mvbea_1",
319
- "purpur-accordion-item__header": "_purpur-accordion-item__header_mvbea_10",
320
- "purpur-accordion-item__trigger": "_purpur-accordion-item__trigger_mvbea_13",
321
- "purpur-accordion-item__trigger__icon": "_purpur-accordion-item__trigger__icon_mvbea_43",
322
- "purpur-accordion-item__title": "_purpur-accordion-item__title_mvbea_49",
323
- "purpur-accordion-item__icon": "_purpur-accordion-item__icon_mvbea_50",
324
- "purpur-accordion-item__rotate": "_purpur-accordion-item__rotate_mvbea_64",
325
- "purpur-accordion-item__content": "_purpur-accordion-item__content_mvbea_67",
326
- "purpur-accordion-item__contentText": "_purpur-accordion-item__contentText_mvbea_78",
327
- "purpur-accordion-item--negative": "_purpur-accordion-item--negative_mvbea_99"
312
+ "purpur-accordion-item": "_purpur-accordion-item_12e59_1",
313
+ "purpur-accordion-item__header": "_purpur-accordion-item__header_12e59_10",
314
+ "purpur-accordion-item__trigger": "_purpur-accordion-item__trigger_12e59_13",
315
+ "purpur-accordion-item__trigger__icon": "_purpur-accordion-item__trigger__icon_12e59_43",
316
+ "purpur-accordion-item__title": "_purpur-accordion-item__title_12e59_49",
317
+ "purpur-accordion-item__icon": "_purpur-accordion-item__icon_12e59_50",
318
+ "purpur-accordion-item__rotate": "_purpur-accordion-item__rotate_12e59_64",
319
+ "purpur-accordion-item__content": "_purpur-accordion-item__content_12e59_67",
320
+ "purpur-accordion-item__contentText": "_purpur-accordion-item__contentText_12e59_78",
321
+ "purpur-accordion-item--negative": "_purpur-accordion-item--negative_12e59_99"
328
322
  }, _ = N.bind(ir), c = "purpur-accordion-item", ur = ({
329
- children: t,
323
+ children: a,
330
324
  className: n,
331
325
  title: p,
332
326
  titleTag: u = "h3",
@@ -334,14 +328,14 @@ const ir = {
334
328
  onClick: r,
335
329
  ...e
336
330
  }) => {
337
- const a = k(q), s = R(), [l, E] = M(!i), L = _([
331
+ const t = k(q), s = R(), [l, E] = M(!i), j = _([
338
332
  n,
339
333
  c,
340
334
  {
341
- [`${c}--negative`]: a
335
+ [`${c}--negative`]: t
342
336
  }
343
337
  ]);
344
- return /* @__PURE__ */ v("div", { className: L, ...e, children: [
338
+ return /* @__PURE__ */ v("div", { className: j, ...e, children: [
345
339
  /* @__PURE__ */ o(
346
340
  y,
347
341
  {
@@ -353,8 +347,8 @@ const ir = {
353
347
  {
354
348
  type: "button",
355
349
  "data-state": l ? "open" : "close",
356
- onClick: (j) => {
357
- r && r(j), E(!l);
350
+ onClick: (L) => {
351
+ r && r(L), E(!l);
358
352
  },
359
353
  className: _(`${c}__trigger`, n, {
360
354
  [`${c}__rotate`]: !l
@@ -364,7 +358,7 @@ const ir = {
364
358
  id: s + "button",
365
359
  children: [
366
360
  p,
367
- /* @__PURE__ */ o(T, { size: "md", className: _(`${c}__icon`), "aria-hidden": !0 })
361
+ /* @__PURE__ */ o(S, { size: "md", className: _(`${c}__icon`), "aria-hidden": !0 })
368
362
  ]
369
363
  }
370
364
  )
@@ -378,37 +372,37 @@ const ir = {
378
372
  id: s,
379
373
  "aria-labelledby": s + "button",
380
374
  role: "region",
381
- children: /* @__PURE__ */ o("div", { className: _(`${c}__contentText`), children: typeof t == "string" ? /* @__PURE__ */ o(O, { variant: "paragraph-200", children: t }) : t })
375
+ children: /* @__PURE__ */ o("div", { className: _(`${c}__contentText`), children: typeof a == "string" ? /* @__PURE__ */ o(O, { variant: "paragraph-200", children: a }) : a })
382
376
  }
383
377
  )
384
378
  ] });
385
- }, x = N.bind(z), f = "purpur-accordion", q = H(!1), P = ({
386
- ["data-testid"]: t,
379
+ }, $ = N.bind(z), m = "purpur-accordion", q = H(!1), P = ({
380
+ ["data-testid"]: a,
387
381
  children: n,
388
382
  className: p,
389
383
  negative: u = !1,
390
384
  title: i,
391
385
  titleTag: r = "h2",
392
386
  titleVariant: e = "title-300",
393
- schema: a,
387
+ schema: t,
394
388
  ...s
395
389
  }) => {
396
- const l = x([
390
+ const l = $([
397
391
  p,
398
- f,
392
+ m,
399
393
  {
400
- [`${f}--negative`]: u
394
+ [`${m}--negative`]: u
401
395
  }
402
396
  ]);
403
- return /* @__PURE__ */ v("div", { className: l, "data-testid": t, ...s, children: [
404
- i && /* @__PURE__ */ o(y, { tag: r, variant: e, className: x(`${f}__title`), children: i }),
397
+ return /* @__PURE__ */ v("div", { className: l, "data-testid": a, ...s, children: [
398
+ i && /* @__PURE__ */ o(y, { tag: r, variant: e, className: $(`${m}__title`), children: i }),
405
399
  /* @__PURE__ */ o(q.Provider, { value: u, children: n }),
406
- a && /* @__PURE__ */ o(
400
+ t && /* @__PURE__ */ o(
407
401
  "script",
408
402
  {
409
403
  type: "application/ld+json",
410
404
  dangerouslySetInnerHTML: {
411
- __html: a
405
+ __html: t
412
406
  }
413
407
  }
414
408
  )