@telia/teddy 0.0.4 → 0.0.6
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/assets/badge.css +1 -1
- package/dist/assets/flex.css +1 -0
- package/dist/assets/grid.css +1 -1
- package/dist/assets/main.css +1 -1
- package/dist/assets/radio-group.css +1 -0
- package/dist/assets/spinner.css +1 -1
- package/dist/badge-tBBi5HpV.js +720 -0
- package/dist/components/accordion/accordion.d.ts +1 -0
- package/dist/components/accordion/accordion.js +6 -3
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/badge/badge.js +6 -3
- package/dist/components/badge/index.js +1 -1
- package/dist/components/box/box.d.ts +23 -0
- package/dist/components/box/box.js +13 -0
- package/dist/components/box/index.d.ts +2 -0
- package/dist/components/box/index.js +4 -0
- package/dist/components/card/card.d.ts +2 -2
- package/dist/components/card/card.js +6 -3
- package/dist/components/card/index.js +1 -1
- package/dist/components/flex/flex.d.ts +23 -0
- package/dist/components/flex/flex.js +16 -0
- package/dist/components/flex/index.d.ts +2 -0
- package/dist/components/flex/index.js +4 -0
- package/dist/components/grid/grid.d.ts +4 -58
- package/dist/components/grid/grid.js +12 -389
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +44 -38
- package/dist/components/input/input.d.ts +3 -0
- package/dist/components/input/input.js +50 -51
- package/dist/components/navigation-menu/index.js +1 -1
- package/dist/components/navigation-menu/navigation-menu.js +1033 -8
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/index.js +4 -0
- package/dist/components/radio-group/radio-group.d.ts +52 -0
- package/dist/components/radio-group/radio-group.js +9 -0
- package/dist/components/spinner/spinner.js +25 -25
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/switch/switch.js +6 -3
- package/dist/index-0Eg2mucA.js +305 -0
- package/dist/main.js +58 -52
- package/dist/radio-group-0Oc9WTDf.js +422 -0
- package/dist/utils/action.d.ts +1 -1
- package/dist/utils/layout.d.ts +141 -3
- package/dist/utils/layout.js +217 -7
- package/package.json +17 -16
- package/dist/badge-CbHdlkcM.js +0 -742
- package/dist/navigation-menu-BgN7IKev.js +0 -1334
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import '../../assets/input.css';
|
|
2
|
-
import { jsxs as y, jsx as
|
|
2
|
+
import { jsxs as y, jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import { c } from "../../clsx-DB4S2d7J.js";
|
|
4
|
-
import
|
|
4
|
+
import a from "react";
|
|
5
5
|
import "../../assets/5161b177f001ea1a.svg";
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { Spinner as
|
|
8
|
-
const
|
|
6
|
+
import { Icon as x } from "../icon/icon.js";
|
|
7
|
+
import { Spinner as A } from "../spinner/spinner.js";
|
|
8
|
+
const C = "_fadeInAnimation_1o9uu_1", G = "_scaleInAnimation_1o9uu_1", s = {
|
|
9
9
|
"teddy-input": "_teddy-input_1o9uu_17",
|
|
10
10
|
"teddy-input__frame": "_teddy-input__frame_1o9uu_24",
|
|
11
11
|
"teddy-input__input": "_teddy-input__input_1o9uu_31",
|
|
@@ -13,92 +13,91 @@ const x = "_fadeInAnimation_1o9uu_1", A = "_scaleInAnimation_1o9uu_1", a = {
|
|
|
13
13
|
"teddy-input__input--invalid": "_teddy-input__input--invalid_1o9uu_66",
|
|
14
14
|
"teddy-input__indicator": "_teddy-input__indicator_1o9uu_72",
|
|
15
15
|
"teddy-input__input--error": "_teddy-input__input--error_1o9uu_75",
|
|
16
|
-
fadeInAnimation:
|
|
17
|
-
scaleInAnimation:
|
|
16
|
+
fadeInAnimation: C,
|
|
17
|
+
scaleInAnimation: G
|
|
18
18
|
}, _ = "teddy-input";
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
19
|
+
function P(n) {
|
|
20
|
+
const i = n == null ? void 0 : n.target;
|
|
21
|
+
if (i.closest("input, button, a"))
|
|
22
22
|
return;
|
|
23
|
-
const t = [...
|
|
23
|
+
const t = [...n.currentTarget.getElementsByTagName("input")].find((d) => d);
|
|
24
24
|
if (!t)
|
|
25
25
|
return;
|
|
26
|
-
const
|
|
26
|
+
const u = (t.compareDocumentPosition(i) & Node.DOCUMENT_POSITION_PRECEDING) !== 0 ? 0 : t.value.length;
|
|
27
27
|
requestAnimationFrame(() => {
|
|
28
28
|
try {
|
|
29
|
-
t.setSelectionRange(
|
|
29
|
+
t.setSelectionRange(u, u);
|
|
30
30
|
} finally {
|
|
31
31
|
t.focus();
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
({ className:
|
|
37
|
-
const
|
|
38
|
-
return /* @__PURE__ */ y("div", { ...t, onPointerDown:
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
35
|
+
const v = a.createContext(void 0), p = a.forwardRef(
|
|
36
|
+
({ className: n, children: i, ...t }, e) => {
|
|
37
|
+
const o = c([s[`${_}`]], n);
|
|
38
|
+
return /* @__PURE__ */ y("div", { ...t, onPointerDown: P, ref: e, className: o, children: [
|
|
39
|
+
/* @__PURE__ */ r(v.Provider, { value: !0, children: i }),
|
|
40
|
+
/* @__PURE__ */ r("div", { className: s[`${_}__frame`] })
|
|
41
41
|
] });
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
44
|
p.displayName = "InputGroup";
|
|
45
|
-
const
|
|
46
|
-
({ className: i, isLoading:
|
|
47
|
-
const
|
|
45
|
+
const N = a.forwardRef(
|
|
46
|
+
({ className: n, onValueChange: i, isLoading: t, validationState: e, ...o }, u) => {
|
|
47
|
+
const d = a.useContext(v), m = c(
|
|
48
48
|
[
|
|
49
|
-
|
|
49
|
+
s[`${_}__input`],
|
|
50
50
|
{
|
|
51
|
-
[
|
|
52
|
-
[
|
|
51
|
+
[s[`${_}__input--valid`]]: e === "valid",
|
|
52
|
+
[s[`${_}__input--error`]]: e === "invalid"
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
|
-
|
|
56
|
-
),
|
|
57
|
-
function
|
|
58
|
-
|
|
59
|
-
(I = n.onValueChange) == null || I.call(n, f.target.value), n.onChange && n.onChange(f);
|
|
55
|
+
n
|
|
56
|
+
), g = d === !0;
|
|
57
|
+
function f(I) {
|
|
58
|
+
i == null || i(I.target.value), o.onChange && o.onChange(I);
|
|
60
59
|
}
|
|
61
|
-
return
|
|
60
|
+
return g ? /* @__PURE__ */ r(
|
|
62
61
|
"input",
|
|
63
62
|
{
|
|
64
|
-
"aria-invalid":
|
|
65
|
-
...
|
|
66
|
-
onChange:
|
|
67
|
-
className:
|
|
63
|
+
"aria-invalid": e === "invalid",
|
|
64
|
+
...o,
|
|
65
|
+
onChange: f,
|
|
66
|
+
className: m,
|
|
68
67
|
ref: u
|
|
69
68
|
}
|
|
70
69
|
) : /* @__PURE__ */ y(p, { children: [
|
|
71
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ r(
|
|
72
71
|
"input",
|
|
73
72
|
{
|
|
74
|
-
"aria-invalid":
|
|
75
|
-
...
|
|
76
|
-
onChange:
|
|
77
|
-
className:
|
|
73
|
+
"aria-invalid": e === "invalid",
|
|
74
|
+
...o,
|
|
75
|
+
onChange: f,
|
|
76
|
+
className: m,
|
|
78
77
|
ref: u
|
|
79
78
|
}
|
|
80
79
|
),
|
|
81
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ r(l, { isValid: e === "valid", isLoading: t })
|
|
82
81
|
] });
|
|
83
82
|
}
|
|
84
83
|
);
|
|
85
|
-
|
|
86
|
-
const l =
|
|
87
|
-
({ className:
|
|
88
|
-
if (!t && !
|
|
84
|
+
N.displayName = "Input";
|
|
85
|
+
const l = a.forwardRef(
|
|
86
|
+
({ className: n, isLoading: i, isValid: t, ...e }, o) => {
|
|
87
|
+
if (!t && !i)
|
|
89
88
|
return null;
|
|
90
|
-
if (!t &&
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
const
|
|
93
|
-
return /* @__PURE__ */
|
|
89
|
+
if (!t && i)
|
|
90
|
+
return /* @__PURE__ */ r(A, { className: n, size: "xs", ...e, ref: o });
|
|
91
|
+
const u = c([s[`${_}__indicator`]], n);
|
|
92
|
+
return /* @__PURE__ */ r(x, { ...e, size: "md", name: "check-circle-filled", className: u, ref: o });
|
|
94
93
|
}
|
|
95
94
|
);
|
|
96
95
|
l.displayName = "InputIndicator";
|
|
97
96
|
const T = Object.assign(p, {
|
|
98
|
-
Input:
|
|
97
|
+
Input: N,
|
|
99
98
|
Indicator: l
|
|
100
99
|
});
|
|
101
100
|
export {
|
|
102
|
-
|
|
101
|
+
N as Input,
|
|
103
102
|
T as InputGroup
|
|
104
103
|
};
|