@studiolxd/brand 49.18.0 → 49.20.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 +206 -0
- package/dist/_shared/tokens.js +59 -0
- package/dist/_types/atoms/Autocomplete/Autocomplete.d.ts +83 -0
- package/dist/_types/atoms/List/List.d.ts +20 -0
- package/dist/_types/atoms/NumberInput/NumberInput.d.ts +33 -2
- package/dist/_types/atoms/Text/Text.d.ts +12 -2
- package/dist/_types/molecules/AutocompleteField/AutocompleteField.d.ts +57 -0
- package/dist/_types/molecules/NumberInputField/NumberInputField.d.ts +14 -2
- package/dist/autocomplete-field.css +1 -0
- package/dist/autocomplete-field.js +58 -0
- package/dist/autocomplete.css +1 -0
- package/dist/autocomplete.js +145 -0
- package/dist/brand.css +122 -1
- package/dist/list.css +1 -1
- package/dist/list.js +39 -13
- package/dist/number-input-field.js +22 -19
- package/dist/number-input.css +1 -1
- package/dist/number-input.js +54 -44
- package/dist/text.css +1 -1
- package/dist/text.js +6 -5
- package/dist/toaster.js +23 -20
- package/dist/tokens.css +126 -1
- package/package.json +16 -2
- package/src/tokens/components/autocomplete.css +40 -0
- package/src/tokens/components/autocomplete.ts +7 -0
- package/src/tokens/components/number-input.css +5 -0
- package/src/tokens/components/number-input.ts +2 -2
- package/src/tokens/components/text-inline.css +3 -0
- package/src/tokens/components/text.css +9 -0
- package/src/tokens/index.css +2 -0
- package/src/tokens/molecules/autocomplete-field.css +17 -0
- package/src/tokens/molecules/autocomplete-field.ts +8 -0
- package/src/tokens/scss/_index.legacy.scss +2 -0
- package/src/tokens/scss/_index.scss +2 -0
- package/src/tokens/scss/components/_autocomplete.scss +37 -0
- package/src/tokens/scss/components/_number-input.scss +5 -0
- package/src/tokens/scss/components/_text-inline.scss +2 -0
- package/src/tokens/scss/components/_text.scss +7 -0
- package/src/tokens/scss/molecules/_autocomplete-field.scss +14 -0
- package/src/tokens/surface-dark-derived.css +12 -0
- package/src/tokens/surface-invert.css +15 -0
- package/src/tokens/surface-light.css +15 -0
- package/src/tokens/surface-public.css +7 -0
- package/src/tokens/tokens.json +59 -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,
|
|
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, compact: b, commitMode: x, error: S = !1, errorMessage: C, helperText: w, className: T, onChange: E, onEmpty: D, ...O }, k) {
|
|
12
|
+
let A = i(u), j = e(y), M = o(), N = a ?? M, P = C ? `${N}-error` : void 0, F = w ? `${N}-helper` : void 0, I = [P, F].filter(Boolean).join(" ") || void 0, L = S || !!C;
|
|
13
13
|
return /* @__PURE__ */ c("div", {
|
|
14
|
-
className: ["number-input-field",
|
|
14
|
+
className: ["number-input-field", T].filter(Boolean).join(" "),
|
|
15
15
|
children: [
|
|
16
16
|
/* @__PURE__ */ s(n, {
|
|
17
|
-
htmlFor:
|
|
18
|
-
hidden:
|
|
19
|
-
size:
|
|
17
|
+
htmlFor: N,
|
|
18
|
+
hidden: A,
|
|
19
|
+
size: j,
|
|
20
20
|
children: l
|
|
21
21
|
}),
|
|
22
22
|
/* @__PURE__ */ s(r, {
|
|
23
|
-
ref:
|
|
24
|
-
...
|
|
25
|
-
id:
|
|
23
|
+
ref: k,
|
|
24
|
+
...O,
|
|
25
|
+
id: N,
|
|
26
26
|
value: d,
|
|
27
27
|
defaultValue: f,
|
|
28
28
|
min: p,
|
|
@@ -31,19 +31,22 @@ 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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
size: j,
|
|
35
|
+
compact: b,
|
|
36
|
+
commitMode: x,
|
|
37
|
+
error: L,
|
|
38
|
+
"aria-describedby": I,
|
|
39
|
+
onChange: E,
|
|
40
|
+
onEmpty: D
|
|
38
41
|
}),
|
|
39
|
-
|
|
40
|
-
id:
|
|
41
|
-
children:
|
|
42
|
+
C && /* @__PURE__ */ s(t, {
|
|
43
|
+
id: P,
|
|
44
|
+
children: C
|
|
42
45
|
}),
|
|
43
|
-
|
|
44
|
-
id:
|
|
46
|
+
w && /* @__PURE__ */ s("span", {
|
|
47
|
+
id: F,
|
|
45
48
|
className: "number-input-field__helper",
|
|
46
|
-
children:
|
|
49
|
+
children: w
|
|
47
50
|
})
|
|
48
51
|
]
|
|
49
52
|
});
|
package/dist/number-input.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.number-input{min-block-size:var(--number-input-height);border-radius:var(--number-input-border-radius);border-width:var(--number-input-border-width);border-style:var(--number-input-border-style);border-color:var(--number-input-border-color);background-color:var(--number-input-bg);transition:border-color var(--number-input-transition-duration) var(--number-input-transition-easing);box-sizing:border-box;align-items:stretch;display:inline-flex;overflow:hidden}.number-input.number-input--focused{box-shadow:inset 0 0 0 calc(var(--number-input-focus-ring-width) + var(--number-input-focus-ring-inset-offset)) var(--number-input-focus-ring-color), inset 0 0 0 var(--number-input-focus-ring-inset-offset) var(--number-input-bg);border-color:var(--number-input-focus-border-color);outline:none}.number-input__field{min-width:0;padding-block:0;padding-inline:var(--number-input-padding-inline);color:var(--number-input-color);font-family:var(--number-input-font-family);font-size:var(--number-input-font-size);font-weight:var(--number-input-font-weight);line-height:var(--number-input-line-height);text-align:center;-moz-appearance:textfield;background-color:#0000;border:none;outline:none;flex:1}.number-input__field::-webkit-inner-spin-button{appearance:none;margin:0}.number-input__field::-webkit-outer-spin-button{appearance:none;margin:0}.number-input__btn{width:var(--number-input-btn-width);background-color:var(--number-input-btn-bg);color:var(--number-input-btn-color);cursor:pointer;transition:box-shadow var(--number-input-transition-duration) var(--number-input-transition-easing);border:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.number-input__btn:hover:not(:disabled){box-shadow:inset 0 calc(-1 * var(--number-input-btn-hover-line-width)) 0 0 var(--number-input-btn-hover-line-color)}.number-input__btn--decrement{border-inline-end-width:var(--number-input-border-width);border-inline-end-style:var(--number-input-border-style);border-inline-end-color:var(--number-input-btn-separator-color)}.number-input__btn--increment{border-inline-start-width:var(--number-input-border-width);border-inline-start-style:var(--number-input-border-style);border-inline-start-color:var(--number-input-btn-separator-color)}.number-input.number-input--error{border-color:var(--number-input-error-border-color);background-color:var(--number-input-error-bg)}.number-input.number-input--error .number-input__field{color:var(--number-input-error-color)}.number-input.number-input--error.number-input--focused{box-shadow:inset 0 0 0 calc(var(--number-input-focus-ring-width) + var(--number-input-focus-ring-inset-offset)) var(--number-input-error-focus-ring-color), inset 0 0 0 var(--number-input-focus-ring-inset-offset) var(--number-input-error-bg);border-color:var(--number-input-error-focus-border-color);outline:none}.number-input.number-input--disabled{cursor:var(--number-input-disabled-cursor);background-color:var(--number-input-disabled-bg);border-color:var(--number-input-disabled-border-color);pointer-events:none}.number-input.number-input--disabled .number-input__field{color:var(--number-input-disabled-color)}.number-input.number-input--disabled .number-input__btn{color:var(--number-input-disabled-btn-color)}.number-input.number-input--sm{--number-input-height:var(--number-input-sm-height);--number-input-padding-inline:var(--number-input-sm-padding-inline);--number-input-font-size:var(--number-input-sm-font-size)}.number-input.number-input--lg{--number-input-height:var(--number-input-lg-height);--number-input-padding-inline:var(--number-input-lg-padding-inline);--number-input-font-size:var(--number-input-lg-font-size)}
|
|
1
|
+
.number-input{min-block-size:var(--number-input-height);border-radius:var(--number-input-border-radius);border-width:var(--number-input-border-width);border-style:var(--number-input-border-style);border-color:var(--number-input-border-color);background-color:var(--number-input-bg);transition:border-color var(--number-input-transition-duration) var(--number-input-transition-easing);box-sizing:border-box;align-items:stretch;display:inline-flex;overflow:hidden}.number-input.number-input--focused{box-shadow:inset 0 0 0 calc(var(--number-input-focus-ring-width) + var(--number-input-focus-ring-inset-offset)) var(--number-input-focus-ring-color), inset 0 0 0 var(--number-input-focus-ring-inset-offset) var(--number-input-bg);border-color:var(--number-input-focus-border-color);outline:none}.number-input__field{min-width:0;padding-block:0;padding-inline:var(--number-input-padding-inline);color:var(--number-input-color);font-family:var(--number-input-font-family);font-size:var(--number-input-font-size);font-weight:var(--number-input-font-weight);line-height:var(--number-input-line-height);text-align:center;-moz-appearance:textfield;background-color:#0000;border:none;outline:none;flex:1}.number-input__field::-webkit-inner-spin-button{appearance:none;margin:0}.number-input__field::-webkit-outer-spin-button{appearance:none;margin:0}.number-input__btn{width:var(--number-input-btn-width);background-color:var(--number-input-btn-bg);color:var(--number-input-btn-color);cursor:pointer;transition:box-shadow var(--number-input-transition-duration) var(--number-input-transition-easing);border:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.number-input__btn:hover:not(:disabled){box-shadow:inset 0 calc(-1 * var(--number-input-btn-hover-line-width)) 0 0 var(--number-input-btn-hover-line-color)}.number-input__btn--decrement{border-inline-end-width:var(--number-input-border-width);border-inline-end-style:var(--number-input-border-style);border-inline-end-color:var(--number-input-btn-separator-color)}.number-input__btn--increment{border-inline-start-width:var(--number-input-border-width);border-inline-start-style:var(--number-input-border-style);border-inline-start-color:var(--number-input-btn-separator-color)}.number-input.number-input--error{border-color:var(--number-input-error-border-color);background-color:var(--number-input-error-bg)}.number-input.number-input--error .number-input__field{color:var(--number-input-error-color)}.number-input.number-input--error.number-input--focused{box-shadow:inset 0 0 0 calc(var(--number-input-focus-ring-width) + var(--number-input-focus-ring-inset-offset)) var(--number-input-error-focus-ring-color), inset 0 0 0 var(--number-input-focus-ring-inset-offset) var(--number-input-error-bg);border-color:var(--number-input-error-focus-border-color);outline:none}.number-input.number-input--disabled{cursor:var(--number-input-disabled-cursor);background-color:var(--number-input-disabled-bg);border-color:var(--number-input-disabled-border-color);pointer-events:none}.number-input.number-input--disabled .number-input__field{color:var(--number-input-disabled-color)}.number-input.number-input--disabled .number-input__btn{color:var(--number-input-disabled-btn-color)}.number-input.number-input--sm{--number-input-height:var(--number-input-sm-height);--number-input-padding-inline:var(--number-input-sm-padding-inline);--number-input-font-size:var(--number-input-sm-font-size)}.number-input.number-input--lg{--number-input-height:var(--number-input-lg-height);--number-input-padding-inline:var(--number-input-lg-padding-inline);--number-input-font-size:var(--number-input-lg-font-size)}.number-input.number-input--compact{--number-input-height:var(--number-input-compact-height);--number-input-padding-inline:var(--number-input-compact-padding-inline);--number-input-font-size:var(--number-input-compact-font-size);--number-input-btn-width:var(--number-input-compact-btn-width)}.number-input.number-input--compact .number-input__field{width:var(--number-input-compact-field-width);flex:none}
|
package/dist/number-input.js
CHANGED
|
@@ -5,47 +5,56 @@ 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",
|
|
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", compact: h = !1, commitMode: g = "change", error: _ = !1, id: v, name: y, describedBy: b, ariaLabel: x, decrementLabel: S, incrementLabel: C, className: w, onChange: T, onEmpty: E, onBlur: D, onFocus: O, onKeyDown: k, ...A }, j) {
|
|
9
|
+
let M = e("numberInput"), N = n !== void 0, [P, F] = i(s), [I, L] = i(!1), [R, z] = i(null), B = N ? n : P, V = R === null ? B === null ? "" : String(B) : R, H = B ?? 0, U = 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]), W = r((e) => {
|
|
13
|
+
let t = U(e);
|
|
14
|
+
N || F(t), T?.(t);
|
|
15
15
|
}, [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
]),
|
|
20
|
-
f || p || (
|
|
21
|
-
},
|
|
22
|
-
f || p || (
|
|
23
|
-
},
|
|
16
|
+
U,
|
|
17
|
+
N,
|
|
18
|
+
T
|
|
19
|
+
]), G = () => {
|
|
20
|
+
f || p || (z(null), W(H - u));
|
|
21
|
+
}, K = () => {
|
|
22
|
+
f || p || (z(null), W(H + u));
|
|
23
|
+
}, q = (e) => {
|
|
24
|
+
let t = d ? e.replace(",", ".") : e, n = parseFloat(t);
|
|
25
|
+
if (!isNaN(n)) {
|
|
26
|
+
if (g === "blur" && U(n) === B) return;
|
|
27
|
+
W(n);
|
|
28
|
+
} else if (E && e.trim() === "") {
|
|
29
|
+
if (g === "blur" && B === null) return;
|
|
30
|
+
N || F(null), E();
|
|
31
|
+
}
|
|
32
|
+
}, J = (e) => {
|
|
24
33
|
let t = e.target.value;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
},
|
|
34
|
+
z(t), g === "change" && q(t);
|
|
35
|
+
}, Y = (e) => {
|
|
36
|
+
k?.(e), !(e.defaultPrevented || g !== "blur" || R === null) && (e.key === "Enter" ? (q(R), z(null)) : e.key === "Escape" && (e.preventDefault(), z(null)));
|
|
37
|
+
}, X = (e) => {
|
|
38
|
+
L(!0), O?.(e);
|
|
39
|
+
}, Z = (e) => {
|
|
40
|
+
L(!1), g === "blur" && R !== null && q(R), z(null), D?.(e);
|
|
41
|
+
}, Q = [
|
|
33
42
|
"number-input",
|
|
34
|
-
m === "md" ? "" : `number-input--${m}`,
|
|
35
|
-
|
|
43
|
+
h ? "number-input--compact" : m === "md" ? "" : `number-input--${m}`,
|
|
44
|
+
_ ? "number-input--error" : "",
|
|
36
45
|
f ? "number-input--disabled" : "",
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
].filter(Boolean).join(" "),
|
|
46
|
+
I ? "number-input--focused" : "",
|
|
47
|
+
w ?? ""
|
|
48
|
+
].filter(Boolean).join(" "), $ = f || p || B !== null && c !== void 0 && B <= c, ee = f || p || B !== null && l !== void 0 && B >= l;
|
|
40
49
|
return /* @__PURE__ */ o("div", {
|
|
41
|
-
className:
|
|
50
|
+
className: Q,
|
|
42
51
|
children: [
|
|
43
52
|
/* @__PURE__ */ a("button", {
|
|
44
53
|
className: "number-input__btn number-input__btn--decrement",
|
|
45
54
|
type: "button",
|
|
46
|
-
onClick:
|
|
47
|
-
disabled:
|
|
48
|
-
"aria-label":
|
|
55
|
+
onClick: G,
|
|
56
|
+
disabled: $,
|
|
57
|
+
"aria-label": M("decrement", S),
|
|
49
58
|
tabIndex: -1,
|
|
50
59
|
children: /* @__PURE__ */ a(t, {
|
|
51
60
|
name: "minus",
|
|
@@ -53,30 +62,31 @@ var s = n(function({ value: n, defaultValue: s = 0, min: c, max: l, step: u = 1,
|
|
|
53
62
|
})
|
|
54
63
|
}),
|
|
55
64
|
/* @__PURE__ */ a("input", {
|
|
56
|
-
ref:
|
|
65
|
+
ref: j,
|
|
57
66
|
className: "number-input__field",
|
|
58
67
|
type: "text",
|
|
59
68
|
inputMode: d ? "decimal" : "numeric",
|
|
60
69
|
pattern: d ? "[0-9]*[.,]?[0-9]*" : "[0-9]*",
|
|
61
|
-
"aria-invalid":
|
|
62
|
-
"aria-describedby":
|
|
63
|
-
"aria-label":
|
|
64
|
-
...
|
|
65
|
-
id:
|
|
66
|
-
name:
|
|
67
|
-
value:
|
|
70
|
+
"aria-invalid": _ || void 0,
|
|
71
|
+
"aria-describedby": b,
|
|
72
|
+
"aria-label": x,
|
|
73
|
+
...A,
|
|
74
|
+
id: v,
|
|
75
|
+
name: y,
|
|
76
|
+
value: V,
|
|
68
77
|
disabled: f,
|
|
69
78
|
readOnly: p,
|
|
70
|
-
onChange:
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
onChange: J,
|
|
80
|
+
onKeyDown: Y,
|
|
81
|
+
onFocus: X,
|
|
82
|
+
onBlur: Z
|
|
73
83
|
}),
|
|
74
84
|
/* @__PURE__ */ a("button", {
|
|
75
85
|
className: "number-input__btn number-input__btn--increment",
|
|
76
86
|
type: "button",
|
|
77
|
-
onClick:
|
|
78
|
-
disabled:
|
|
79
|
-
"aria-label":
|
|
87
|
+
onClick: K,
|
|
88
|
+
disabled: ee,
|
|
89
|
+
"aria-label": M("increment", C),
|
|
80
90
|
tabIndex: -1,
|
|
81
91
|
children: /* @__PURE__ */ a(t, {
|
|
82
92
|
name: "plus",
|
package/dist/text.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.text{color:inherit;font:inherit}strong.text{font-weight:var(--text-inline-emphasis-font-weight)}.text.text--muted{color:var(--text-inline-muted-color)}.text.text--destructive{color:var(--text-inline-destructive-color)}.text.text--success{color:var(--text-inline-success-color)}
|
|
1
|
+
.text{color:inherit;font:inherit}strong.text{font-weight:var(--text-inline-emphasis-font-weight)}.text.text--strikethrough{color:var(--text-inline-strikethrough-color);text-decoration-line:line-through;text-decoration-thickness:var(--text-inline-strikethrough-thickness)}.text.text--muted{color:var(--text-inline-muted-color)}.text.text--destructive{color:var(--text-inline-destructive-color)}.text.text--success{color:var(--text-inline-success-color)}
|
package/dist/text.js
CHANGED
|
@@ -2,16 +2,17 @@ import './text.css';
|
|
|
2
2
|
import { forwardRef as e } from "react";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
4
|
//#region src/stories/atoms/Text/Text.tsx
|
|
5
|
-
var n = e(function({ as: e = "span", tone: n = "default",
|
|
5
|
+
var n = e(function({ as: e = "span", tone: n = "default", strikethrough: r = !1, className: i, children: a, ...o }, s) {
|
|
6
6
|
return /* @__PURE__ */ t(e, {
|
|
7
|
-
ref:
|
|
7
|
+
ref: s,
|
|
8
8
|
className: [
|
|
9
9
|
"text",
|
|
10
|
+
r || e === "del" || e === "s" ? "text--strikethrough" : "",
|
|
10
11
|
n === "default" ? "" : `text--${n}`,
|
|
11
|
-
|
|
12
|
+
i ?? ""
|
|
12
13
|
].filter(Boolean).join(" "),
|
|
13
|
-
...
|
|
14
|
-
children:
|
|
14
|
+
...o,
|
|
15
|
+
children: a
|
|
15
16
|
});
|
|
16
17
|
}), r = e(function({ className: e, ...n }, r) {
|
|
17
18
|
return /* @__PURE__ */ t("br", {
|
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 };
|