@studiolxd/brand 49.17.0 → 49.19.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 +149 -0
- package/README.md +4 -4
- package/dist/_shared/tokens.js +7 -0
- package/dist/_types/atoms/List/List.d.ts +20 -0
- package/dist/_types/atoms/NumberInput/NumberInput.d.ts +14 -2
- package/dist/_types/molecules/NumberInputField/NumberInputField.d.ts +5 -2
- package/dist/_types/molecules/RecoveryCodes/RecoveryCodes.d.ts +6 -0
- package/dist/brand.css +15 -1
- package/dist/list.css +1 -1
- package/dist/list.js +39 -13
- package/dist/number-input-field.js +15 -14
- package/dist/number-input.js +34 -34
- package/dist/recovery-codes.js +1 -0
- package/dist/toaster.js +23 -20
- package/dist/tokens.css +15 -1
- package/package.json +9 -2
- package/src/tokens/components/text.css +9 -0
- package/src/tokens/scss/components/_text.scss +7 -0
- package/src/tokens/surface-invert.css +2 -0
- package/src/tokens/surface-light.css +2 -0
- package/src/tokens/surface-public.css +1 -0
- package/src/tokens/tokens.json +7 -0
package/dist/list.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.list{font-family:var(--text-list-font-family);font-size:var(--text-list-font-size);font-weight:var(--text-list-font-weight);line-height:var(--text-list-line-height);color:var(--text-list-color);letter-spacing:var(--text-list-letter-spacing);margin-block:0;margin-inline:0;padding-inline-start:var(--text-list-padding-inline-start)}.list>li+li,.list>.list__item+.list__item{margin-block-start:var(--text-list-gap)}.list.list--unordered{list-style-type:disc}.list.list--ordered{list-style-type:decimal}.list.list--plain{padding-inline-start:0;list-style-type:none}
|
|
1
|
+
.list{font-family:var(--text-list-font-family);font-size:var(--text-list-font-size);font-weight:var(--text-list-font-weight);line-height:var(--text-list-line-height);color:var(--text-list-color);letter-spacing:var(--text-list-letter-spacing);margin-block:0;margin-inline:0;padding-inline-start:var(--text-list-padding-inline-start)}.list>li+li,.list>.list__item+.list__item{margin-block-start:var(--text-list-gap)}.list.list--unordered{list-style-type:disc}.list.list--ordered{list-style-type:decimal}.list.list--plain{padding-inline-start:0;list-style-type:none}.list.list--separated>li+li,.list.list--separated>.list__item+.list__item{border-block-start:var(--text-list-separator-thickness) solid var(--text-list-separator-color);margin-block-start:var(--text-list-separator-spacing);padding-block-start:var(--text-list-separator-spacing)}.list__item-row{align-items:center;column-gap:var(--text-list-item-gap);display:flex}.list__item-main{flex:auto;min-inline-size:0}.list__item-secondary{font-size:var(--text-list-secondary-font-size);line-height:var(--text-list-secondary-line-height);color:var(--text-list-secondary-color)}.list__item-leading,.list__item-trailing{flex:none;align-items:center;display:flex}
|
package/dist/list.js
CHANGED
|
@@ -1,25 +1,51 @@
|
|
|
1
1
|
import './list.css';
|
|
2
2
|
import { forwardRef as e } from "react";
|
|
3
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
4
|
//#region src/stories/atoms/List/List.tsx
|
|
5
|
-
var
|
|
5
|
+
var r = e(function({ type: e = "unordered", showSeparators: n = !1, className: r, children: i, ...a }, o) {
|
|
6
6
|
return /* @__PURE__ */ t(e === "ordered" ? "ol" : "ul", {
|
|
7
|
-
ref:
|
|
7
|
+
ref: o,
|
|
8
8
|
className: [
|
|
9
9
|
"list",
|
|
10
10
|
`list--${e}`,
|
|
11
|
-
n
|
|
11
|
+
n ? "list--separated" : "",
|
|
12
|
+
r ?? ""
|
|
12
13
|
].filter(Boolean).join(" "),
|
|
13
|
-
...
|
|
14
|
-
children:
|
|
14
|
+
...a,
|
|
15
|
+
children: i
|
|
15
16
|
});
|
|
16
|
-
}),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
}), i = e(function({ as: e = "li", leading: r, secondary: i, trailing: a, className: o, children: s, ...c }, l) {
|
|
18
|
+
let u = ["list__item", o ?? ""].filter(Boolean).join(" "), d = i != null && i !== !1, f = r != null && r !== !1, p = a != null && a !== !1;
|
|
19
|
+
return !d && !p && !f ? /* @__PURE__ */ t(e, {
|
|
20
|
+
ref: l,
|
|
21
|
+
className: u,
|
|
22
|
+
...c,
|
|
23
|
+
children: s
|
|
24
|
+
}) : /* @__PURE__ */ t(e, {
|
|
25
|
+
ref: l,
|
|
26
|
+
className: u,
|
|
27
|
+
...c,
|
|
28
|
+
children: /* @__PURE__ */ n("div", {
|
|
29
|
+
className: "list__item-row",
|
|
30
|
+
children: [
|
|
31
|
+
f && /* @__PURE__ */ t("div", {
|
|
32
|
+
className: "list__item-leading",
|
|
33
|
+
children: r
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ n("div", {
|
|
36
|
+
className: "list__item-main",
|
|
37
|
+
children: [s, d && /* @__PURE__ */ t("div", {
|
|
38
|
+
className: "list__item-secondary",
|
|
39
|
+
children: i
|
|
40
|
+
})]
|
|
41
|
+
}),
|
|
42
|
+
p && /* @__PURE__ */ t("div", {
|
|
43
|
+
className: "list__item-trailing",
|
|
44
|
+
children: a
|
|
45
|
+
})
|
|
46
|
+
]
|
|
47
|
+
})
|
|
22
48
|
});
|
|
23
49
|
});
|
|
24
50
|
//#endregion
|
|
25
|
-
export {
|
|
51
|
+
export { r as List, i as ListItem };
|
|
@@ -8,21 +8,21 @@ import { n as i } from "./_shared/field-labels.js";
|
|
|
8
8
|
import { forwardRef as a, useId as o } from "react";
|
|
9
9
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
10
10
|
//#region src/stories/molecules/NumberInputField/NumberInputField.tsx
|
|
11
|
-
var l = a(function({ id: a, label: l, labelHidden: u, value: d, defaultValue: f, min: p, max: m, step: h = 1, decimal: g, disabled: _, readOnly: v, size: y, error: b = !1, errorMessage: x, helperText: S, className: C, onChange: w,
|
|
12
|
-
let
|
|
11
|
+
var l = a(function({ id: a, label: l, labelHidden: u, value: d, defaultValue: f, min: p, max: m, step: h = 1, decimal: g, disabled: _, readOnly: v, size: y, error: b = !1, errorMessage: x, helperText: S, className: C, onChange: w, onEmpty: T, ...E }, D) {
|
|
12
|
+
let O = i(u), k = e(y), A = o(), j = a ?? A, M = x ? `${j}-error` : void 0, N = S ? `${j}-helper` : void 0, P = [M, N].filter(Boolean).join(" ") || void 0, F = b || !!x;
|
|
13
13
|
return /* @__PURE__ */ c("div", {
|
|
14
14
|
className: ["number-input-field", C].filter(Boolean).join(" "),
|
|
15
15
|
children: [
|
|
16
16
|
/* @__PURE__ */ s(n, {
|
|
17
|
-
htmlFor:
|
|
18
|
-
hidden:
|
|
19
|
-
size:
|
|
17
|
+
htmlFor: j,
|
|
18
|
+
hidden: O,
|
|
19
|
+
size: k,
|
|
20
20
|
children: l
|
|
21
21
|
}),
|
|
22
22
|
/* @__PURE__ */ s(r, {
|
|
23
|
-
ref:
|
|
24
|
-
...
|
|
25
|
-
id:
|
|
23
|
+
ref: D,
|
|
24
|
+
...E,
|
|
25
|
+
id: j,
|
|
26
26
|
value: d,
|
|
27
27
|
defaultValue: f,
|
|
28
28
|
min: p,
|
|
@@ -31,17 +31,18 @@ var l = a(function({ id: a, label: l, labelHidden: u, value: d, defaultValue: f,
|
|
|
31
31
|
decimal: g,
|
|
32
32
|
disabled: _,
|
|
33
33
|
readOnly: v,
|
|
34
|
-
size:
|
|
35
|
-
error:
|
|
36
|
-
"aria-describedby":
|
|
37
|
-
onChange: w
|
|
34
|
+
size: k,
|
|
35
|
+
error: F,
|
|
36
|
+
"aria-describedby": P,
|
|
37
|
+
onChange: w,
|
|
38
|
+
onEmpty: T
|
|
38
39
|
}),
|
|
39
40
|
x && /* @__PURE__ */ s(t, {
|
|
40
|
-
id:
|
|
41
|
+
id: M,
|
|
41
42
|
children: x
|
|
42
43
|
}),
|
|
43
44
|
S && /* @__PURE__ */ s("span", {
|
|
44
|
-
id:
|
|
45
|
+
id: N,
|
|
45
46
|
className: "number-input-field__helper",
|
|
46
47
|
children: S
|
|
47
48
|
})
|
package/dist/number-input.js
CHANGED
|
@@ -5,47 +5,47 @@ import { Icon as t } from "./icon.js";
|
|
|
5
5
|
import { forwardRef as n, useCallback as r, useState as i } from "react";
|
|
6
6
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
7
|
//#region src/stories/atoms/NumberInput/NumberInput.tsx
|
|
8
|
-
var s = n(function({ value: n, defaultValue: s = 0, min: c, max: l, step: u = 1, decimal: d = !1, disabled: f = !1, readOnly: p = !1, size: m = "md", error: h = !1, id: g, name: _, describedBy: v, ariaLabel: y, decrementLabel: b, incrementLabel: x, className: S, onChange: C,
|
|
9
|
-
let
|
|
8
|
+
var s = n(function({ value: n, defaultValue: s = 0, min: c, max: l, step: u = 1, decimal: d = !1, disabled: f = !1, readOnly: p = !1, size: m = "md", error: h = !1, id: g, name: _, describedBy: v, ariaLabel: y, decrementLabel: b, incrementLabel: x, className: S, onChange: C, onEmpty: w, onBlur: T, onFocus: E, ...D }, O) {
|
|
9
|
+
let k = e("numberInput"), A = n !== void 0, [j, M] = i(s), [N, P] = i(!1), [F, I] = i(null), L = A ? n : j, R = F === null ? L === null ? "" : String(L) : F, z = L ?? 0, B = r((e) => {
|
|
10
10
|
let t = e;
|
|
11
11
|
return c !== void 0 && (t = Math.max(c, t)), l !== void 0 && (t = Math.min(l, t)), t;
|
|
12
|
-
}, [c, l]),
|
|
13
|
-
let t =
|
|
14
|
-
|
|
12
|
+
}, [c, l]), V = r((e) => {
|
|
13
|
+
let t = B(e);
|
|
14
|
+
A || M(t), C?.(t);
|
|
15
15
|
}, [
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
B,
|
|
17
|
+
A,
|
|
18
18
|
C
|
|
19
|
-
]),
|
|
20
|
-
f || p || (
|
|
21
|
-
},
|
|
22
|
-
f || p || (
|
|
23
|
-
},
|
|
19
|
+
]), H = () => {
|
|
20
|
+
f || p || (I(null), V(z - u));
|
|
21
|
+
}, U = () => {
|
|
22
|
+
f || p || (I(null), V(z + u));
|
|
23
|
+
}, W = (e) => {
|
|
24
24
|
let t = e.target.value;
|
|
25
|
-
|
|
25
|
+
I(t);
|
|
26
26
|
let n = d ? t.replace(",", ".") : t, r = parseFloat(n);
|
|
27
|
-
isNaN(r) ||
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
},
|
|
27
|
+
isNaN(r) ? w && t.trim() === "" && (A || M(null), w()) : V(r);
|
|
28
|
+
}, G = (e) => {
|
|
29
|
+
P(!0), E?.(e);
|
|
30
|
+
}, K = (e) => {
|
|
31
|
+
P(!1), I(null), T?.(e);
|
|
32
|
+
}, q = [
|
|
33
33
|
"number-input",
|
|
34
34
|
m === "md" ? "" : `number-input--${m}`,
|
|
35
35
|
h ? "number-input--error" : "",
|
|
36
36
|
f ? "number-input--disabled" : "",
|
|
37
|
-
|
|
37
|
+
N ? "number-input--focused" : "",
|
|
38
38
|
S ?? ""
|
|
39
|
-
].filter(Boolean).join(" "),
|
|
39
|
+
].filter(Boolean).join(" "), J = f || p || L !== null && c !== void 0 && L <= c, Y = f || p || L !== null && l !== void 0 && L >= l;
|
|
40
40
|
return /* @__PURE__ */ o("div", {
|
|
41
|
-
className:
|
|
41
|
+
className: q,
|
|
42
42
|
children: [
|
|
43
43
|
/* @__PURE__ */ a("button", {
|
|
44
44
|
className: "number-input__btn number-input__btn--decrement",
|
|
45
45
|
type: "button",
|
|
46
|
-
onClick:
|
|
47
|
-
disabled:
|
|
48
|
-
"aria-label":
|
|
46
|
+
onClick: H,
|
|
47
|
+
disabled: J,
|
|
48
|
+
"aria-label": k("decrement", b),
|
|
49
49
|
tabIndex: -1,
|
|
50
50
|
children: /* @__PURE__ */ a(t, {
|
|
51
51
|
name: "minus",
|
|
@@ -53,7 +53,7 @@ var s = n(function({ value: n, defaultValue: s = 0, min: c, max: l, step: u = 1,
|
|
|
53
53
|
})
|
|
54
54
|
}),
|
|
55
55
|
/* @__PURE__ */ a("input", {
|
|
56
|
-
ref:
|
|
56
|
+
ref: O,
|
|
57
57
|
className: "number-input__field",
|
|
58
58
|
type: "text",
|
|
59
59
|
inputMode: d ? "decimal" : "numeric",
|
|
@@ -61,22 +61,22 @@ var s = n(function({ value: n, defaultValue: s = 0, min: c, max: l, step: u = 1,
|
|
|
61
61
|
"aria-invalid": h || void 0,
|
|
62
62
|
"aria-describedby": v,
|
|
63
63
|
"aria-label": y,
|
|
64
|
-
...
|
|
64
|
+
...D,
|
|
65
65
|
id: g,
|
|
66
66
|
name: _,
|
|
67
|
-
value:
|
|
67
|
+
value: R,
|
|
68
68
|
disabled: f,
|
|
69
69
|
readOnly: p,
|
|
70
|
-
onChange:
|
|
71
|
-
onFocus:
|
|
72
|
-
onBlur:
|
|
70
|
+
onChange: W,
|
|
71
|
+
onFocus: G,
|
|
72
|
+
onBlur: K
|
|
73
73
|
}),
|
|
74
74
|
/* @__PURE__ */ a("button", {
|
|
75
75
|
className: "number-input__btn number-input__btn--increment",
|
|
76
76
|
type: "button",
|
|
77
|
-
onClick:
|
|
78
|
-
disabled:
|
|
79
|
-
"aria-label":
|
|
77
|
+
onClick: U,
|
|
78
|
+
disabled: Y,
|
|
79
|
+
"aria-label": k("increment", x),
|
|
80
80
|
tabIndex: -1,
|
|
81
81
|
children: /* @__PURE__ */ a(t, {
|
|
82
82
|
name: "plus",
|
package/dist/recovery-codes.js
CHANGED
package/dist/toaster.js
CHANGED
|
@@ -19,33 +19,36 @@ function h(e, t) {
|
|
|
19
19
|
return [
|
|
20
20
|
"alert",
|
|
21
21
|
m[e ?? ""] ?? "",
|
|
22
|
-
e === "
|
|
22
|
+
e === "success" || e === "error" ? "surface-dark" : "",
|
|
23
23
|
t ? "alert--dismissible" : "",
|
|
24
24
|
"toast"
|
|
25
25
|
].filter(Boolean).join(" ");
|
|
26
26
|
}
|
|
27
|
-
function g(
|
|
28
|
-
|
|
27
|
+
function g(e) {
|
|
28
|
+
return e === "success" || e === "error" ? "" : e === "warning" ? " surface-light" : " surface-invert";
|
|
29
|
+
}
|
|
30
|
+
function _({ position: a, containerAriaLabel: o, closeLabel: c, closeButton: p, gap: m, expand: _ }) {
|
|
31
|
+
let v = e("toaster"), { toasts: y } = f.useToastManager(), [b, x] = a.split("-"), S = y.map((e) => e.id).join(",");
|
|
29
32
|
l(() => {
|
|
30
|
-
s(
|
|
31
|
-
}, [
|
|
32
|
-
let
|
|
33
|
+
s(S ? S.split(",") : []);
|
|
34
|
+
}, [S]);
|
|
35
|
+
let C = i({ "--toast-gap": `${m}px` }), w = t(void 0), T = [
|
|
33
36
|
"toaster",
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
b === "top" ? "toaster--top" : "",
|
|
38
|
+
x === "right" ? "" : `toaster--${x}`,
|
|
39
|
+
_ ? "toaster--expanded" : ""
|
|
37
40
|
].filter(Boolean).join(" ");
|
|
38
41
|
return /* @__PURE__ */ u(f.Portal, {
|
|
39
|
-
container:
|
|
42
|
+
container: w,
|
|
40
43
|
children: /* @__PURE__ */ u(f.Viewport, {
|
|
41
|
-
ref:
|
|
42
|
-
className:
|
|
43
|
-
"aria-label":
|
|
44
|
-
children:
|
|
44
|
+
ref: C,
|
|
45
|
+
className: T,
|
|
46
|
+
"aria-label": v("container", o),
|
|
47
|
+
children: y.map((e) => /* @__PURE__ */ d(f.Root, {
|
|
45
48
|
toast: e,
|
|
46
49
|
className: h(e.type, p),
|
|
47
50
|
children: [/* @__PURE__ */ d("div", {
|
|
48
|
-
className:
|
|
51
|
+
className: `alert__content${g(e.type)}`,
|
|
49
52
|
children: [
|
|
50
53
|
/* @__PURE__ */ u(f.Title, { className: "alert__title" }),
|
|
51
54
|
/* @__PURE__ */ u(f.Description, { className: "alert__description" }),
|
|
@@ -58,20 +61,20 @@ function g({ position: a, containerAriaLabel: o, closeLabel: c, closeButton: p,
|
|
|
58
61
|
})
|
|
59
62
|
]
|
|
60
63
|
}), p && /* @__PURE__ */ u(f.Close, {
|
|
61
|
-
className:
|
|
62
|
-
render: /* @__PURE__ */ u(r, { label:
|
|
64
|
+
className: `alert__close${g(e.type)}`,
|
|
65
|
+
render: /* @__PURE__ */ u(r, { label: v("close", c) })
|
|
63
66
|
})]
|
|
64
67
|
}, e.id))
|
|
65
68
|
})
|
|
66
69
|
});
|
|
67
70
|
}
|
|
68
|
-
function
|
|
71
|
+
function v({ position: e = "bottom-right", containerAriaLabel: t, closeLabel: n, closeButton: r = !0, duration: i = a, gap: s = p, visibleToasts: d = 3, expand: m = !1 }) {
|
|
69
72
|
let h = Number.isFinite(i) ? i : 0;
|
|
70
73
|
return l(() => o(h), [h]), /* @__PURE__ */ u(f.Provider, {
|
|
71
74
|
toastManager: c,
|
|
72
75
|
timeout: h,
|
|
73
76
|
limit: d,
|
|
74
|
-
children: /* @__PURE__ */ u(
|
|
77
|
+
children: /* @__PURE__ */ u(_, {
|
|
75
78
|
position: e,
|
|
76
79
|
containerAriaLabel: t,
|
|
77
80
|
closeLabel: n,
|
|
@@ -82,4 +85,4 @@ function _({ position: e = "bottom-right", containerAriaLabel: t, closeLabel: n,
|
|
|
82
85
|
});
|
|
83
86
|
}
|
|
84
87
|
//#endregion
|
|
85
|
-
export {
|
|
88
|
+
export { v as Toaster };
|