@purpurds/accordion 5.35.0 → 6.0.1
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/LICENSE.txt +3 -3
- package/dist/accordion.cjs.js +5 -5
- package/dist/accordion.cjs.js.map +1 -1
- package/dist/accordion.es.js +98 -104
- package/dist/accordion.es.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +5 -5
- package/src/accordion-item.module.scss +1 -1
- package/src/accordion-item.tsx +1 -1
package/dist/accordion.es.js
CHANGED
@@ -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(
|
4
|
-
return
|
3
|
+
function C(a) {
|
4
|
+
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
5
5
|
}
|
6
|
-
var
|
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(
|
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
|
18
|
-
|
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
|
33
|
-
n.call(r,
|
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
|
-
|
39
|
+
a.exports ? (p.default = p, a.exports = p) : window.classNames = p;
|
40
40
|
})();
|
41
|
-
})(
|
42
|
-
var D =
|
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
|
-
},
|
69
|
-
["data-testid"]:
|
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
|
-
...
|
76
|
+
...t
|
77
77
|
}) => {
|
78
78
|
const s = r, l = B([
|
79
79
|
p,
|
80
|
-
g[
|
81
|
-
g[`${
|
80
|
+
g[f],
|
81
|
+
g[`${f}--${e}`],
|
82
82
|
{
|
83
|
-
[g[`${
|
84
|
-
[g[`${
|
83
|
+
[g[`${f}--hyphens`]]: u,
|
84
|
+
[g[`${f}--negative`]]: i
|
85
85
|
}
|
86
86
|
]);
|
87
|
-
return /* @__PURE__ */ o(s, { ...
|
87
|
+
return /* @__PURE__ */ o(s, { ...t, className: l, "data-testid": a, children: n });
|
88
88
|
};
|
89
89
|
y.displayName = "Heading";
|
90
|
-
function
|
91
|
-
return
|
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(
|
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
|
105
|
-
|
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
|
120
|
-
n.call(r,
|
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
|
-
|
126
|
+
a.exports ? (p.default = p, a.exports = p) : window.classNames = p;
|
127
127
|
})();
|
128
128
|
})(A);
|
129
|
-
var
|
130
|
-
const N = /* @__PURE__ */ V
|
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(
|
136
|
-
return
|
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(
|
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
|
150
|
-
|
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
|
165
|
-
n.call(r,
|
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
|
-
|
171
|
+
a.exports ? (p.default = p, a.exports = p) : window.classNames = p;
|
172
172
|
})();
|
173
173
|
})(w);
|
174
|
-
var
|
175
|
-
const
|
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
|
-
},
|
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 ${
|
204
|
-
},
|
205
|
-
["data-testid"]:
|
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 =
|
196
|
+
size: i = W,
|
210
197
|
...r
|
211
198
|
}) => {
|
212
|
-
const e =
|
213
|
-
content:
|
199
|
+
const e = Y({
|
200
|
+
content: rr(n.svg),
|
214
201
|
title: p
|
215
|
-
}),
|
202
|
+
}), t = Q(u, b, `${b}--${i}`);
|
216
203
|
return /* @__PURE__ */ o(
|
217
204
|
"span",
|
218
205
|
{
|
219
206
|
"aria-label": p,
|
220
|
-
className:
|
221
|
-
"data-testid":
|
207
|
+
className: t,
|
208
|
+
"data-testid": a,
|
222
209
|
dangerouslySetInnerHTML: { __html: e },
|
223
210
|
...r
|
224
211
|
}
|
225
212
|
);
|
226
213
|
};
|
227
|
-
|
228
|
-
|
229
|
-
|
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(
|
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
|
243
|
-
|
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
|
258
|
-
n.call(r,
|
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
|
-
|
258
|
+
a.exports ? (p.default = p, a.exports = p) : window.classNames = p;
|
265
259
|
})();
|
266
260
|
})(I);
|
267
|
-
var
|
268
|
-
const pr = /* @__PURE__ */ tr
|
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"]:
|
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
|
-
...
|
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", { ...
|
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-
|
319
|
-
"purpur-accordion-item__header": "_purpur-accordion-
|
320
|
-
"purpur-accordion-item__trigger": "_purpur-accordion-
|
321
|
-
"purpur-accordion-item__trigger__icon": "_purpur-accordion-
|
322
|
-
"purpur-accordion-item__title": "_purpur-accordion-
|
323
|
-
"purpur-accordion-item__icon": "_purpur-accordion-
|
324
|
-
"purpur-accordion-item__rotate": "_purpur-accordion-
|
325
|
-
"purpur-accordion-item__content": "_purpur-accordion-
|
326
|
-
"purpur-accordion-item__contentText": "_purpur-accordion-
|
327
|
-
"purpur-accordion-item--negative": "_purpur-accordion-item--
|
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:
|
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
|
331
|
+
const t = k(q), s = R(), [l, E] = M(!i), j = _([
|
338
332
|
n,
|
339
333
|
c,
|
340
334
|
{
|
341
|
-
[`${c}--negative`]:
|
335
|
+
[`${c}--negative`]: t
|
342
336
|
}
|
343
337
|
]);
|
344
|
-
return /* @__PURE__ */ v("div", { className:
|
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: (
|
357
|
-
r && r(
|
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(
|
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
|
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
|
-
},
|
386
|
-
["data-testid"]:
|
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:
|
387
|
+
schema: t,
|
394
388
|
...s
|
395
389
|
}) => {
|
396
|
-
const l =
|
390
|
+
const l = $([
|
397
391
|
p,
|
398
|
-
|
392
|
+
m,
|
399
393
|
{
|
400
|
-
[`${
|
394
|
+
[`${m}--negative`]: u
|
401
395
|
}
|
402
396
|
]);
|
403
|
-
return /* @__PURE__ */ v("div", { className: l, "data-testid":
|
404
|
-
i && /* @__PURE__ */ o(y, { tag: r, variant: e, className:
|
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
|
-
|
400
|
+
t && /* @__PURE__ */ o(
|
407
401
|
"script",
|
408
402
|
{
|
409
403
|
type: "application/ld+json",
|
410
404
|
dangerouslySetInnerHTML: {
|
411
|
-
__html:
|
405
|
+
__html: t
|
412
406
|
}
|
413
407
|
}
|
414
408
|
)
|