@studiolxd/brand 49.19.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 +77 -0
- package/dist/_shared/tokens.js +52 -0
- package/dist/_types/atoms/Autocomplete/Autocomplete.d.ts +83 -0
- package/dist/_types/atoms/NumberInput/NumberInput.d.ts +19 -0
- 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 +9 -0
- 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 +108 -1
- package/dist/number-input-field.js +22 -20
- 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/tokens.css +112 -1
- package/package.json +11 -1
- 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/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/molecules/_autocomplete-field.scss +14 -0
- package/src/tokens/surface-dark-derived.css +12 -0
- package/src/tokens/surface-invert.css +13 -0
- package/src/tokens/surface-light.css +13 -0
- package/src/tokens/surface-public.css +6 -0
- package/src/tokens/tokens.json +52 -0
|
@@ -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,20 +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
|
-
|
|
38
|
-
|
|
34
|
+
size: j,
|
|
35
|
+
compact: b,
|
|
36
|
+
commitMode: x,
|
|
37
|
+
error: L,
|
|
38
|
+
"aria-describedby": I,
|
|
39
|
+
onChange: E,
|
|
40
|
+
onEmpty: D
|
|
39
41
|
}),
|
|
40
|
-
|
|
41
|
-
id:
|
|
42
|
-
children:
|
|
42
|
+
C && /* @__PURE__ */ s(t, {
|
|
43
|
+
id: P,
|
|
44
|
+
children: C
|
|
43
45
|
}),
|
|
44
|
-
|
|
45
|
-
id:
|
|
46
|
+
w && /* @__PURE__ */ s("span", {
|
|
47
|
+
id: F,
|
|
46
48
|
className: "number-input-field__helper",
|
|
47
|
-
children:
|
|
49
|
+
children: w
|
|
48
50
|
})
|
|
49
51
|
]
|
|
50
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", {
|