@studiolxd/brand 38.17.0 → 39.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.
- package/CHANGELOG.md +79 -0
- package/dist/_shared/tokens.js +4 -0
- package/dist/_types/atoms/StarRating/StarRating.d.ts +87 -30
- package/dist/_types/molecules/Card/Card.d.ts +12 -1
- package/dist/_types/molecules/ConfirmDialog/ConfirmDialog.d.ts +42 -2
- package/dist/brand.css +11 -2
- package/dist/card.js +1 -2
- package/dist/confirm-dialog.css +1 -1
- package/dist/confirm-dialog.js +65 -42
- package/dist/star-rating.css +1 -1
- package/dist/star-rating.js +44 -30
- package/dist/tokens.css +11 -2
- package/package.json +1 -1
- package/src/tokens/components/description-list.css +1 -1
- package/src/tokens/components/star-rating.css +5 -0
- package/src/tokens/molecules/confirm-dialog.css +1 -0
- package/src/tokens/scss/components/_description-list.scss +1 -1
- package/src/tokens/scss/components/_star-rating.scss +3 -0
- package/src/tokens/scss/molecules/_confirm-dialog.scss +1 -0
- package/src/tokens/surface-invert.css +2 -0
- package/src/tokens/surface-public.css +1 -0
- package/src/tokens/tokens.json +4 -0
package/dist/card.js
CHANGED
|
@@ -24,8 +24,7 @@ var l = s(function({ href: r, render: s, external: l = !1, title: u, description
|
|
|
24
24
|
}),
|
|
25
25
|
d && (typeof d == "string" ? /* @__PURE__ */ a("p", { children: d }) : d),
|
|
26
26
|
y,
|
|
27
|
-
f !== void 0 && /* @__PURE__ */ a(e, { children: f }),
|
|
28
|
-
/* @__PURE__ */ a(t, { size: "lg" })
|
|
27
|
+
f !== void 0 && /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(e, { children: f }), /* @__PURE__ */ a(t, { size: "lg" })] })
|
|
29
28
|
] }), w = h && /* @__PURE__ */ a("div", {
|
|
30
29
|
className: "card__media",
|
|
31
30
|
children: /* @__PURE__ */ a("img", {
|
package/dist/confirm-dialog.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.confirm-dialog__actions.modal__footer{margin-block-start:var(--confirm-dialog-actions-space-before)}
|
|
1
|
+
.confirm-dialog__actions.modal__footer{margin-block-start:var(--confirm-dialog-actions-space-before)}.confirm-dialog__phrase{margin-block-start:var(--confirm-dialog-phrase-space-before)}
|
package/dist/confirm-dialog.js
CHANGED
|
@@ -2,63 +2,86 @@
|
|
|
2
2
|
import './confirm-dialog.css';
|
|
3
3
|
import { Button as e } from "./button.js";
|
|
4
4
|
import { Modal as t } from "./modal.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { InputField as n } from "./input-field.js";
|
|
6
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
|
+
import { useEffect as o, useId as s, useRef as c, useState as l } from "react";
|
|
7
8
|
//#region src/stories/molecules/ConfirmDialog/ConfirmDialog.tsx
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}, [
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
if (
|
|
17
|
-
let e =
|
|
9
|
+
function u({ open: u, title: d, description: f, children: p, onConfirm: m, onCancel: h, onConfirmError: g, secondaryActionLabel: _, onSecondaryAction: v, destructive: y = !1, confirmLabel: b = "Confirmar", cancelLabel: x = "Cancelar", pendingLabel: S = "Confirmando…", closeLabel: C = "Cerrar", confirmPhrase: w, confirmPhraseLabel: T, confirmPhraseMismatch: E, container: D, className: O }) {
|
|
10
|
+
let k = c(null), A = c(null), j = s(), [M, N] = l(!1), [P, F] = l(""), [I, L] = l(!1), R = w === void 0 || P.trim() === w, z = I && !R;
|
|
11
|
+
o(() => {
|
|
12
|
+
u || (N(!1), F(""), L(!1));
|
|
13
|
+
}, [u]);
|
|
14
|
+
let B = () => {
|
|
15
|
+
M || h();
|
|
16
|
+
}, V = async () => {
|
|
17
|
+
if (M || !R) return;
|
|
18
|
+
let e = m();
|
|
18
19
|
if (e instanceof Promise) {
|
|
19
|
-
|
|
20
|
+
N(!0);
|
|
20
21
|
try {
|
|
21
22
|
await e;
|
|
22
23
|
} catch (e) {
|
|
23
|
-
|
|
24
|
+
g?.(e);
|
|
24
25
|
} finally {
|
|
25
|
-
|
|
26
|
+
N(!1);
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
open:
|
|
31
|
-
onClose:
|
|
32
|
-
title:
|
|
33
|
-
closeLabel:
|
|
34
|
-
container:
|
|
35
|
-
initialFocus: w,
|
|
36
|
-
...
|
|
37
|
-
footerClassName: ["confirm-dialog__actions",
|
|
38
|
-
footer: /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
ref:
|
|
30
|
+
return /* @__PURE__ */ a(t, {
|
|
31
|
+
open: u,
|
|
32
|
+
onClose: B,
|
|
33
|
+
title: d,
|
|
34
|
+
closeLabel: C,
|
|
35
|
+
container: D,
|
|
36
|
+
initialFocus: w === void 0 ? k : A,
|
|
37
|
+
...f == null ? {} : { description: f },
|
|
38
|
+
footerClassName: ["confirm-dialog__actions", O].filter(Boolean).join(" "),
|
|
39
|
+
footer: /* @__PURE__ */ a(r, { children: [
|
|
40
|
+
/* @__PURE__ */ i(e, {
|
|
41
|
+
ref: k,
|
|
41
42
|
variant: "outline",
|
|
42
|
-
onClick:
|
|
43
|
-
disabled:
|
|
44
|
-
children:
|
|
43
|
+
onClick: B,
|
|
44
|
+
disabled: M,
|
|
45
|
+
children: x
|
|
45
46
|
}),
|
|
46
|
-
|
|
47
|
+
_ && v && /* @__PURE__ */ i(e, {
|
|
47
48
|
variant: "outline",
|
|
48
|
-
onClick:
|
|
49
|
-
disabled:
|
|
50
|
-
children:
|
|
49
|
+
onClick: v,
|
|
50
|
+
disabled: M,
|
|
51
|
+
children: _
|
|
51
52
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
variant:
|
|
54
|
-
destructive:
|
|
55
|
-
onClick:
|
|
56
|
-
disabled:
|
|
57
|
-
children:
|
|
53
|
+
/* @__PURE__ */ i(e, {
|
|
54
|
+
variant: y ? "outline" : "primary",
|
|
55
|
+
destructive: y,
|
|
56
|
+
onClick: V,
|
|
57
|
+
disabled: M || !R,
|
|
58
|
+
children: M ? S : b
|
|
58
59
|
})
|
|
59
60
|
] }),
|
|
60
|
-
children:
|
|
61
|
+
children: [p, w !== void 0 && /* @__PURE__ */ i(n, {
|
|
62
|
+
ref: A,
|
|
63
|
+
id: `${j}-confirm-phrase`,
|
|
64
|
+
className: "confirm-dialog__phrase",
|
|
65
|
+
label: T ?? "",
|
|
66
|
+
value: P,
|
|
67
|
+
disabled: M,
|
|
68
|
+
autoComplete: "off",
|
|
69
|
+
autoCorrect: "off",
|
|
70
|
+
autoCapitalize: "none",
|
|
71
|
+
spellCheck: !1,
|
|
72
|
+
error: z,
|
|
73
|
+
...z ? { errorMessage: E } : {},
|
|
74
|
+
onChange: (e) => {
|
|
75
|
+
F(e.target.value), L(!1);
|
|
76
|
+
},
|
|
77
|
+
onBlur: () => {
|
|
78
|
+
P !== "" && L(!0);
|
|
79
|
+
},
|
|
80
|
+
onKeyDown: (e) => {
|
|
81
|
+
e.key === "Enter" && (e.preventDefault(), R ? V() : P !== "" && L(!0));
|
|
82
|
+
}
|
|
83
|
+
})]
|
|
61
84
|
});
|
|
62
85
|
}
|
|
63
86
|
//#endregion
|
|
64
|
-
export {
|
|
87
|
+
export { u as ConfirmDialog };
|
package/dist/star-rating.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.star-rating{align-items:center;gap:var(--star-rating-gap);color:var(--star-rating-track-color);display:inline-flex}.star-rating__star{display:inline-flex;position:relative}.star-rating__glyph{--icon-size:var(--star-rating-star-size)}.star-rating__glyph--fill{color:var(--star-rating-fill-color);fill:var(--star-rating-fill-color);transition:color var(--star-rating-transition-duration) var(--star-rating-transition-easing);position:absolute;inset-block-start:0;inset-inline-start:0}.star-rating__glyph--half{clip-path:inset(0 50% 0 0)}[dir=rtl] .star-rating__glyph--half{clip-path:inset(0 0 0 50%)}.star-rating__option{cursor:var(--star-rating-cursor);display:inline-flex}.star-rating__input:focus-visible+.star-rating__star{outline:var(--star-rating-focus-ring-width) solid var(--star-rating-focus-ring-color);outline-offset:var(--star-rating-focus-ring-offset)}.star-rating__input:disabled+.star-rating__star{opacity:var(--star-rating-disabled-opacity)}.star-rating__option:has(.star-rating__input:disabled){cursor:var(--star-rating-disabled-cursor)}.star-rating.star-rating--sm{--star-rating-star-size:var(--star-rating-sm-star-size)}.star-rating.star-rating--lg{--star-rating-star-size:var(--star-rating-lg-star-size)}
|
|
1
|
+
.star-rating{align-items:center;gap:var(--star-rating-count-gap);color:var(--star-rating-track-color);display:inline-flex}.star-rating__stars{align-items:center;gap:var(--star-rating-gap);display:inline-flex}.star-rating__count{color:var(--star-rating-count-color)}.star-rating__empty{color:var(--star-rating-empty-color)}.star-rating__star{display:inline-flex;position:relative}.star-rating__glyph{--icon-size:var(--star-rating-star-size)}.star-rating__glyph--fill{color:var(--star-rating-fill-color);fill:var(--star-rating-fill-color);transition:color var(--star-rating-transition-duration) var(--star-rating-transition-easing);position:absolute;inset-block-start:0;inset-inline-start:0}.star-rating__glyph--half{clip-path:inset(0 50% 0 0)}[dir=rtl] .star-rating__glyph--half{clip-path:inset(0 0 0 50%)}.star-rating.star-rating--input{gap:var(--star-rating-gap)}.star-rating__option{cursor:var(--star-rating-cursor);display:inline-flex}.star-rating__input:focus-visible+.star-rating__star{outline:var(--star-rating-focus-ring-width) solid var(--star-rating-focus-ring-color);outline-offset:var(--star-rating-focus-ring-offset)}.star-rating__input:disabled+.star-rating__star{opacity:var(--star-rating-disabled-opacity)}.star-rating__option:has(.star-rating__input:disabled){cursor:var(--star-rating-disabled-cursor)}.star-rating.star-rating--sm{--star-rating-star-size:var(--star-rating-sm-star-size)}.star-rating.star-rating--lg{--star-rating-star-size:var(--star-rating-lg-star-size)}
|
package/dist/star-rating.js
CHANGED
|
@@ -23,54 +23,68 @@ function c({ fill: t }) {
|
|
|
23
23
|
})]
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
function l(
|
|
27
|
-
let S = i(), [
|
|
26
|
+
function l(e) {
|
|
27
|
+
let { value: l, defaultValue: u, onValueChange: d, max: f = 5, reviewCount: p, readOnly: m = !0, disabled: h = !1, size: g = "md", name: _, valueLabel: v, optionLabel: y, groupLabel: b, countLabel: x, emptyLabel: S, className: C, ...w } = e, T = i(), [E, D] = a(u), [O, k] = a(void 0), A = l !== void 0, j = (A ? l : E) ?? 0, M = [
|
|
28
28
|
"star-rating",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
].filter(Boolean).join(" "),
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
g === "md" ? "" : `star-rating--${g}`,
|
|
30
|
+
m ? "" : "star-rating--input",
|
|
31
|
+
C ?? ""
|
|
32
|
+
].filter(Boolean).join(" "), N = Array.from({ length: f }, (e, t) => t);
|
|
33
|
+
if (m) {
|
|
34
|
+
if (l === null) return /* @__PURE__ */ n("div", {
|
|
35
|
+
className: M,
|
|
36
|
+
...w,
|
|
37
|
+
children: /* @__PURE__ */ n("span", {
|
|
38
|
+
className: "star-rating__empty",
|
|
39
|
+
children: S ?? ""
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
let e = o(j, f);
|
|
43
|
+
return /* @__PURE__ */ r("div", {
|
|
44
|
+
className: M,
|
|
37
45
|
role: "img",
|
|
38
|
-
"aria-label":
|
|
39
|
-
...
|
|
40
|
-
children:
|
|
46
|
+
"aria-label": v?.(e, f, p) ?? "",
|
|
47
|
+
...w,
|
|
48
|
+
children: [/* @__PURE__ */ n("span", {
|
|
49
|
+
className: "star-rating__stars",
|
|
50
|
+
children: N.map((t) => /* @__PURE__ */ n(c, { fill: s(t, e) }, t))
|
|
51
|
+
}), p !== void 0 && /* @__PURE__ */ n("span", {
|
|
52
|
+
className: "star-rating__count",
|
|
53
|
+
children: x?.(p) ?? ""
|
|
54
|
+
})]
|
|
41
55
|
});
|
|
42
56
|
}
|
|
43
|
-
function
|
|
44
|
-
|
|
57
|
+
function P(e) {
|
|
58
|
+
A || D(e), d?.(e);
|
|
45
59
|
}
|
|
46
|
-
let
|
|
60
|
+
let F = O ?? Math.round(j);
|
|
47
61
|
return /* @__PURE__ */ n("div", {
|
|
48
|
-
className:
|
|
62
|
+
className: M,
|
|
49
63
|
role: "radiogroup",
|
|
50
|
-
"aria-label":
|
|
51
|
-
onPointerLeave: () =>
|
|
52
|
-
...
|
|
53
|
-
children:
|
|
64
|
+
"aria-label": b ?? "",
|
|
65
|
+
onPointerLeave: () => k(void 0),
|
|
66
|
+
...w,
|
|
67
|
+
children: N.map((e) => {
|
|
54
68
|
let i = e + 1;
|
|
55
69
|
return /* @__PURE__ */ r("label", {
|
|
56
70
|
className: "star-rating__option",
|
|
57
71
|
onPointerEnter: () => {
|
|
58
|
-
|
|
72
|
+
h || k(i);
|
|
59
73
|
},
|
|
60
74
|
children: [
|
|
61
75
|
/* @__PURE__ */ n("input", {
|
|
62
76
|
className: "star-rating__input visually-hidden",
|
|
63
77
|
type: "radio",
|
|
64
|
-
name:
|
|
78
|
+
name: _ ?? T,
|
|
65
79
|
value: i,
|
|
66
|
-
checked: Math.round(
|
|
67
|
-
disabled:
|
|
68
|
-
onChange: () =>
|
|
69
|
-
onFocus: () =>
|
|
70
|
-
onBlur: () =>
|
|
80
|
+
checked: Math.round(j) === i,
|
|
81
|
+
disabled: h,
|
|
82
|
+
onChange: () => P(i),
|
|
83
|
+
onFocus: () => k(i),
|
|
84
|
+
onBlur: () => k(void 0)
|
|
71
85
|
}),
|
|
72
|
-
/* @__PURE__ */ n(c, { fill: i <=
|
|
73
|
-
/* @__PURE__ */ n(t, { children:
|
|
86
|
+
/* @__PURE__ */ n(c, { fill: i <= F ? "full" : "empty" }),
|
|
87
|
+
/* @__PURE__ */ n(t, { children: y?.(i, f) ?? "" })
|
|
74
88
|
]
|
|
75
89
|
}, i);
|
|
76
90
|
})
|