@purpurds/card 5.6.0 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE.txt +5 -5
- package/dist/card.cjs.js +3 -3
- package/dist/card.cjs.js.map +1 -1
- package/dist/card.es.js +45 -45
- package/dist/card.es.js.map +1 -1
- package/package.json +11 -11
package/dist/card.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as $, Children as y, isValidElement as x, createElement as b, cloneElement as
|
|
1
|
+
import { jsxs as A, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as $, Children as y, isValidElement as x, createElement as b, cloneElement as I, useEffect as tr, Fragment as er } from "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
function ar(t) {
|
|
5
5
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
@@ -210,7 +210,7 @@ const Nr = /* @__PURE__ */ $r(xr), O = {
|
|
|
210
210
|
SUCCESS: "success",
|
|
211
211
|
WARNING: "warning",
|
|
212
212
|
ERROR: "error"
|
|
213
|
-
},
|
|
213
|
+
}, Cr = (t) => {
|
|
214
214
|
switch (t) {
|
|
215
215
|
case c.ATTENTION:
|
|
216
216
|
case c.SPECIAL:
|
|
@@ -228,7 +228,7 @@ const Nr = /* @__PURE__ */ $r(xr), O = {
|
|
|
228
228
|
default:
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
|
-
},
|
|
231
|
+
}, Sr = ({
|
|
232
232
|
children: t,
|
|
233
233
|
showIcon: n = !0,
|
|
234
234
|
variant: e,
|
|
@@ -237,19 +237,19 @@ const Nr = /* @__PURE__ */ $r(xr), O = {
|
|
|
237
237
|
className: r = "",
|
|
238
238
|
...a
|
|
239
239
|
}) => {
|
|
240
|
-
const u =
|
|
241
|
-
return /* @__PURE__ */
|
|
240
|
+
const u = Cr(e), s = Nr([r, O[j], O[`${j}--${e}`]]);
|
|
241
|
+
return /* @__PURE__ */ A("span", { "aria-label": i, className: s, "data-testid": p, ...a, children: [
|
|
242
242
|
n && u && /* @__PURE__ */ o(br, { "data-testid": `${p}-icon`, allyTitle: i, size: "xs", svg: u }),
|
|
243
243
|
t
|
|
244
244
|
] });
|
|
245
|
-
},
|
|
245
|
+
}, Ar = {
|
|
246
246
|
"purpur-card-badge": "_purpur-card-badge_r7moe_1"
|
|
247
|
-
}, kr = l.bind(
|
|
247
|
+
}, kr = l.bind(Ar), Or = "purpur-card-badge", jr = ({
|
|
248
248
|
["data-testid"]: t = "purpur-card-badge",
|
|
249
249
|
variant: n,
|
|
250
250
|
text: e
|
|
251
251
|
}) => n && e ? /* @__PURE__ */ o(
|
|
252
|
-
|
|
252
|
+
Sr,
|
|
253
253
|
{
|
|
254
254
|
className: kr(Or),
|
|
255
255
|
variant: n,
|
|
@@ -257,32 +257,32 @@ const Nr = /* @__PURE__ */ $r(xr), O = {
|
|
|
257
257
|
"data-testid": t,
|
|
258
258
|
children: e
|
|
259
259
|
}
|
|
260
|
-
) : null,
|
|
260
|
+
) : null, zr = {
|
|
261
261
|
"purpur-card-content": "_purpur-card-content_2uc00_1"
|
|
262
|
-
},
|
|
262
|
+
}, Mr = l.bind(zr), Zr = "purpur-card-content", Er = ({
|
|
263
263
|
["data-testid"]: t = "purpur-card-content",
|
|
264
264
|
children: n
|
|
265
|
-
}) => /* @__PURE__ */ o("div", { className:
|
|
265
|
+
}) => /* @__PURE__ */ o("div", { className: Mr(Zr), "data-testid": t, children: n }), Pr = {
|
|
266
266
|
"purpur-card-content-container": "_purpur-card-content-container_dx1e4_1",
|
|
267
267
|
"purpur-card-content-container--footer": "_purpur-card-content-container--footer_dx1e4_7"
|
|
268
|
-
},
|
|
268
|
+
}, Rr = l.bind(Pr), z = "purpur-card-content-container", qr = ({
|
|
269
269
|
["data-testid"]: t = "purpur-card-content-container",
|
|
270
270
|
children: n,
|
|
271
271
|
isFooter: e = !1
|
|
272
272
|
}) => /* @__PURE__ */ o(
|
|
273
273
|
"div",
|
|
274
274
|
{
|
|
275
|
-
className:
|
|
276
|
-
|
|
275
|
+
className: Rr([
|
|
276
|
+
z,
|
|
277
277
|
{
|
|
278
|
-
[`${
|
|
278
|
+
[`${z}--footer`]: e
|
|
279
279
|
}
|
|
280
280
|
]),
|
|
281
281
|
"data-testid": t,
|
|
282
282
|
children: n
|
|
283
283
|
}
|
|
284
284
|
);
|
|
285
|
-
function
|
|
285
|
+
function Lr(t) {
|
|
286
286
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
287
287
|
}
|
|
288
288
|
var V = { exports: {} };
|
|
@@ -321,8 +321,8 @@ var V = { exports: {} };
|
|
|
321
321
|
t.exports ? (e.default = e, t.exports = e) : window.classNames = e;
|
|
322
322
|
})();
|
|
323
323
|
})(V);
|
|
324
|
-
var
|
|
325
|
-
const Hr = /* @__PURE__ */ Ir
|
|
324
|
+
var Ir = V.exports;
|
|
325
|
+
const Hr = /* @__PURE__ */ Lr(Ir), Br = {
|
|
326
326
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
327
327
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
328
328
|
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
@@ -356,7 +356,7 @@ const G = (t) => /* @__PURE__ */ o(
|
|
|
356
356
|
}
|
|
357
357
|
);
|
|
358
358
|
G.displayName = "IconCheckmark";
|
|
359
|
-
const Dr = Hr.bind(Br),
|
|
359
|
+
const Dr = Hr.bind(Br), M = "purpur-icon", Gr = "md", Fr = (t) => t.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), Ur = ({ content: t = "", title: n } = {}) => {
|
|
360
360
|
const e = [
|
|
361
361
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
362
362
|
{ name: "fill", value: "currentColor" },
|
|
@@ -375,7 +375,7 @@ const Dr = Hr.bind(Br), z = "purpur-icon", Gr = "md", Fr = (t) => t.filter((n) =
|
|
|
375
375
|
const a = Ur({
|
|
376
376
|
content: Wr(n.svg),
|
|
377
377
|
title: e
|
|
378
|
-
}), u = Dr(p,
|
|
378
|
+
}), u = Dr(p, M, `${M}--${i}`);
|
|
379
379
|
return /* @__PURE__ */ o(
|
|
380
380
|
"span",
|
|
381
381
|
{
|
|
@@ -480,7 +480,7 @@ const Kr = /* @__PURE__ */ Xr(Jr), m = {
|
|
|
480
480
|
}, Z = l.bind(Yr), E = "purpur-card-feature-list", rt = ({
|
|
481
481
|
["data-testid"]: t = "purpur-card-feature-list",
|
|
482
482
|
listItems: n
|
|
483
|
-
}) => n && n.length > 0 ? /* @__PURE__ */ o("ul", { className: Z(E), "data-testid": t, children: n.map((e) => /* @__PURE__ */
|
|
483
|
+
}) => n && n.length > 0 ? /* @__PURE__ */ o("ul", { className: Z(E), "data-testid": t, children: n.map((e) => /* @__PURE__ */ A(
|
|
484
484
|
"li",
|
|
485
485
|
{
|
|
486
486
|
className: Z(`${E}__list-item`),
|
|
@@ -532,7 +532,7 @@ var X = { exports: {} };
|
|
|
532
532
|
})();
|
|
533
533
|
})(X);
|
|
534
534
|
var et = X.exports;
|
|
535
|
-
const
|
|
535
|
+
const P = /* @__PURE__ */ tt(et), at = "_rotate_1xozj_1", nt = "_dash_1xozj_1", v = {
|
|
536
536
|
"purpur-spinner": "_purpur-spinner_1xozj_1",
|
|
537
537
|
rotate: at,
|
|
538
538
|
"purpur-spinner--xxs": "_purpur-spinner--xxs_1xozj_4",
|
|
@@ -559,13 +559,13 @@ const R = /* @__PURE__ */ tt(et), at = "_rotate_1xozj_1", nt = "_dash_1xozj_1",
|
|
|
559
559
|
}) => /* @__PURE__ */ o(
|
|
560
560
|
"div",
|
|
561
561
|
{
|
|
562
|
-
className:
|
|
562
|
+
className: P([v[w], v[`${w}--${p}`]]),
|
|
563
563
|
"data-testid": t,
|
|
564
564
|
...i,
|
|
565
565
|
children: /* @__PURE__ */ o("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ o(
|
|
566
566
|
"circle",
|
|
567
567
|
{
|
|
568
|
-
className:
|
|
568
|
+
className: P(v[`${w}__circle`], {
|
|
569
569
|
[v[`${w}__circle--disabled`]]: n,
|
|
570
570
|
[v[`${w}__circle--negative`]]: e
|
|
571
571
|
}),
|
|
@@ -649,23 +649,23 @@ const J = /* @__PURE__ */ $((t, n) => {
|
|
|
649
649
|
const { children: e, ...p } = t, i = y.toArray(e), r = i.find(wt);
|
|
650
650
|
if (r) {
|
|
651
651
|
const a = r.props.children, u = i.map((s) => s === r ? y.count(a) > 1 ? y.only(null) : /* @__PURE__ */ x(a) ? a.props.children : null : s);
|
|
652
|
-
return /* @__PURE__ */ b(
|
|
652
|
+
return /* @__PURE__ */ b(S, h({}, p, {
|
|
653
653
|
ref: n
|
|
654
|
-
}), /* @__PURE__ */ x(a) ? /* @__PURE__ */
|
|
654
|
+
}), /* @__PURE__ */ x(a) ? /* @__PURE__ */ I(a, void 0, u) : null);
|
|
655
655
|
}
|
|
656
|
-
return /* @__PURE__ */ b(
|
|
656
|
+
return /* @__PURE__ */ b(S, h({}, p, {
|
|
657
657
|
ref: n
|
|
658
658
|
}), e);
|
|
659
659
|
});
|
|
660
660
|
J.displayName = "Slot";
|
|
661
|
-
const
|
|
661
|
+
const S = /* @__PURE__ */ $((t, n) => {
|
|
662
662
|
const { children: e, ...p } = t;
|
|
663
|
-
return /* @__PURE__ */ x(e) ? /* @__PURE__ */
|
|
663
|
+
return /* @__PURE__ */ x(e) ? /* @__PURE__ */ I(e, {
|
|
664
664
|
...yt(p, e.props),
|
|
665
665
|
ref: n ? ft(n, e.ref) : e.ref
|
|
666
666
|
}) : y.count(e) > 1 ? y.only(null) : null;
|
|
667
667
|
});
|
|
668
|
-
|
|
668
|
+
S.displayName = "SlotClone";
|
|
669
669
|
const vt = ({ children: t }) => /* @__PURE__ */ b(er, null, t);
|
|
670
670
|
function wt(t) {
|
|
671
671
|
return /* @__PURE__ */ x(t) && t.type === vt;
|
|
@@ -737,12 +737,12 @@ const bt = [
|
|
|
737
737
|
wordWrap: "normal",
|
|
738
738
|
...t.style
|
|
739
739
|
}
|
|
740
|
-
}))), Nt = xt,
|
|
740
|
+
}))), Nt = xt, R = ({
|
|
741
741
|
asChild: t,
|
|
742
742
|
children: n,
|
|
743
743
|
className: e = "",
|
|
744
744
|
["data-testid"]: p
|
|
745
|
-
}) => /* @__PURE__ */ o(Nt, { asChild: t, "data-testid": p, className: e, children: n }), q = l.bind(ht), d = "purpur-card-trigger-item",
|
|
745
|
+
}) => /* @__PURE__ */ o(Nt, { asChild: t, "data-testid": p, className: e, children: n }), q = l.bind(ht), d = "purpur-card-trigger-item", Ct = ({
|
|
746
746
|
["data-testid"]: t = "purpur-card-trigger-item",
|
|
747
747
|
disabled: n = !1,
|
|
748
748
|
href: e,
|
|
@@ -767,7 +767,7 @@ const bt = [
|
|
|
767
767
|
"data-testid": t,
|
|
768
768
|
href: n ? void 0 : e,
|
|
769
769
|
tabIndex: n ? 0 : void 0,
|
|
770
|
-
children: /* @__PURE__ */ o(
|
|
770
|
+
children: /* @__PURE__ */ o(R, { children: i })
|
|
771
771
|
}
|
|
772
772
|
)
|
|
773
773
|
) : /* @__PURE__ */ o(
|
|
@@ -784,10 +784,10 @@ const bt = [
|
|
|
784
784
|
"data-testid": t,
|
|
785
785
|
type: "button",
|
|
786
786
|
onClick: r,
|
|
787
|
-
children: /* @__PURE__ */ o(
|
|
787
|
+
children: /* @__PURE__ */ o(R, { children: i })
|
|
788
788
|
}
|
|
789
789
|
);
|
|
790
|
-
},
|
|
790
|
+
}, St = l.bind(gt), N = "purpur-card-root", K = $(
|
|
791
791
|
({
|
|
792
792
|
["data-testid"]: t = "purpur-card-root",
|
|
793
793
|
children: n,
|
|
@@ -800,7 +800,7 @@ const bt = [
|
|
|
800
800
|
variant: s,
|
|
801
801
|
...Q
|
|
802
802
|
}, Y) => {
|
|
803
|
-
const rr =
|
|
803
|
+
const rr = St([
|
|
804
804
|
N,
|
|
805
805
|
e,
|
|
806
806
|
{
|
|
@@ -808,10 +808,10 @@ const bt = [
|
|
|
808
808
|
[`${N}--full-height`]: i
|
|
809
809
|
}
|
|
810
810
|
]);
|
|
811
|
-
return /* @__PURE__ */
|
|
811
|
+
return /* @__PURE__ */ A("div", { className: rr, "data-testid": t, ref: Y, ...Q, children: [
|
|
812
812
|
n,
|
|
813
813
|
(a || r) && u && /* @__PURE__ */ o(
|
|
814
|
-
|
|
814
|
+
Ct,
|
|
815
815
|
{
|
|
816
816
|
disabled: p,
|
|
817
817
|
href: r,
|
|
@@ -823,16 +823,16 @@ const bt = [
|
|
|
823
823
|
}
|
|
824
824
|
);
|
|
825
825
|
K.displayName = "CardRoot";
|
|
826
|
-
const
|
|
827
|
-
const p =
|
|
828
|
-
|
|
826
|
+
const L = l.bind(ur), C = "purpur-card", _ = ({ children: t, className: n, ...e }) => {
|
|
827
|
+
const p = L([
|
|
828
|
+
C,
|
|
829
829
|
n,
|
|
830
830
|
{
|
|
831
|
-
[`${
|
|
832
|
-
[`${
|
|
831
|
+
[`${C}--is-interactive`]: e.onClick || e.href,
|
|
832
|
+
[`${C}--disabled`]: e.disabled
|
|
833
833
|
}
|
|
834
834
|
]);
|
|
835
|
-
return /* @__PURE__ */ o(K, { className:
|
|
835
|
+
return /* @__PURE__ */ o(K, { className: L(p), ...e, children: t });
|
|
836
836
|
};
|
|
837
837
|
_.Badge = jr;
|
|
838
838
|
_.LinkArrow = st;
|