@vkzstudio/muza-ui 1.0.21 → 1.0.22
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/components/Dialog/Dialog.js +8 -8
- package/dist/components/FileUpload/FileItem.js +1 -1
- package/dist/components/FileUpload/FileUpload.d.ts +5 -1
- package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/components/FileUpload/FileUpload.js +152 -121
- package/dist/components/FileUpload/FileUpload.stories.d.ts +2 -0
- package/dist/components/FileUpload/FileUpload.stories.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +85 -65
- package/dist/muza-ui.css +1 -1
- package/dist/translations/locales/cs.d.ts.map +1 -1
- package/dist/translations/locales/cs.js +1 -0
- package/dist/translations/locales/en.d.ts.map +1 -1
- package/dist/translations/locales/en.js +1 -0
- package/dist/translations/locales/sk.d.ts.map +1 -1
- package/dist/translations/locales/sk.js +1 -0
- package/dist/translations/types.d.ts +2 -0
- package/dist/translations/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cva as
|
|
1
|
+
import { jsxs as G, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as H, useId as U, useRef as W, useState as B } from "react";
|
|
3
|
+
import { cva as h } from "class-variance-authority";
|
|
4
4
|
import { FormField as D } from "../FormField/FormField.js";
|
|
5
|
-
import { cn as
|
|
6
|
-
import { typographyVariants as
|
|
7
|
-
const E =
|
|
5
|
+
import { cn as x } from "../../utils/cn.js";
|
|
6
|
+
import { typographyVariants as b } from "../Typography/Typography.js";
|
|
7
|
+
const E = h(
|
|
8
8
|
[
|
|
9
|
-
|
|
9
|
+
b({
|
|
10
10
|
variant: "body",
|
|
11
11
|
weight: "medium",
|
|
12
12
|
size: "base"
|
|
13
13
|
}),
|
|
14
|
-
"w-full
|
|
14
|
+
"w-full font-text text-comp-input-text-primary transition-colors outline-none",
|
|
15
15
|
"placeholder:font-regular placeholder:text-comp-input-text-placeholder",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"disabled:cursor-not-allowed disabled:border-comp-input-stroke-disabled disabled:bg-comp-input-fill-disabled",
|
|
19
|
-
"outline-none focus:border-comp-input-stroke-focused"
|
|
16
|
+
"mr-[calc(var(--spacing-xl)/2)] pt-xl pr-[calc(var(--spacing-comp-input-p-hor)-var(--spacing-xl)/2)] pb-[calc(var(--spacing-xl)/2)] pl-comp-input-p-hor",
|
|
17
|
+
"disabled:cursor-not-allowed"
|
|
20
18
|
],
|
|
21
19
|
{
|
|
22
20
|
variants: {
|
|
@@ -38,36 +36,57 @@ const E = B(
|
|
|
38
36
|
resize: "none"
|
|
39
37
|
}
|
|
40
38
|
}
|
|
41
|
-
), J =
|
|
39
|
+
), J = h(
|
|
40
|
+
[
|
|
41
|
+
"overflow-hidden rounded-xl border border-comp-input-stroke-def bg-comp-input-fill-def transition-colors",
|
|
42
|
+
"focus-within:border-comp-texteditor-stroke-focused",
|
|
43
|
+
"pb-[calc(var(--spacing-xl)/2)]",
|
|
44
|
+
// Offset scrollbar to make resize handle visible
|
|
45
|
+
"flex"
|
|
46
|
+
],
|
|
47
|
+
{
|
|
48
|
+
variants: {
|
|
49
|
+
state: {
|
|
50
|
+
default: "border-comp-texteditor-stroke-def hover:border-comp-texteditor-stroke-hover",
|
|
51
|
+
disabled: "cursor-not-allowed border-comp-input-stroke-disabled bg-comp-input-fill-disabled",
|
|
52
|
+
error: "border-comp-texteditor-stroke-error"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
defaultVariants: {
|
|
56
|
+
state: "default"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
), K = H(
|
|
42
60
|
({
|
|
43
|
-
className:
|
|
44
|
-
label:
|
|
45
|
-
hint:
|
|
46
|
-
id:
|
|
47
|
-
error:
|
|
48
|
-
resize:
|
|
49
|
-
autoResize:
|
|
50
|
-
errorMessage:
|
|
51
|
-
required:
|
|
52
|
-
disableRequiredAsterisk:
|
|
53
|
-
labelExtra:
|
|
54
|
-
infoTooltip:
|
|
55
|
-
showCharacterCount:
|
|
56
|
-
value:
|
|
61
|
+
className: g,
|
|
62
|
+
label: v,
|
|
63
|
+
hint: y,
|
|
64
|
+
id: w,
|
|
65
|
+
error: e,
|
|
66
|
+
resize: z,
|
|
67
|
+
autoResize: s,
|
|
68
|
+
errorMessage: c,
|
|
69
|
+
required: o,
|
|
70
|
+
disableRequiredAsterisk: k,
|
|
71
|
+
labelExtra: I,
|
|
72
|
+
infoTooltip: N,
|
|
73
|
+
showCharacterCount: R,
|
|
74
|
+
value: a,
|
|
57
75
|
defaultValue: d,
|
|
58
|
-
onChange:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
76
|
+
onChange: n,
|
|
77
|
+
disabled: p,
|
|
78
|
+
...i
|
|
79
|
+
}, u) => {
|
|
80
|
+
const V = U(), r = w ?? V, F = `${r}-hint`, S = `${r}-label`, $ = W(null), m = (typeof u == "function" ? null : u) ?? $, f = a !== void 0, [j, A] = B(
|
|
62
81
|
() => String(d ?? "").length
|
|
63
|
-
), L =
|
|
64
|
-
const t =
|
|
65
|
-
t && (t.style.height = "auto", t.style.height = `${t.scrollHeight
|
|
66
|
-
},
|
|
82
|
+
), L = f ? String(a).length : j, T = () => {
|
|
83
|
+
const t = m.current;
|
|
84
|
+
t && (t.style.height = "auto", t.style.height = `${t.scrollHeight}px`);
|
|
85
|
+
}, C = R && i.maxLength != null ? /* @__PURE__ */ G(
|
|
67
86
|
"span",
|
|
68
87
|
{
|
|
69
|
-
className:
|
|
70
|
-
|
|
88
|
+
className: x(
|
|
89
|
+
b({
|
|
71
90
|
variant: "body",
|
|
72
91
|
weight: "regular",
|
|
73
92
|
size: "sm"
|
|
@@ -77,50 +96,51 @@ const E = B(
|
|
|
77
96
|
children: [
|
|
78
97
|
L,
|
|
79
98
|
"/",
|
|
80
|
-
|
|
99
|
+
i.maxLength
|
|
81
100
|
]
|
|
82
101
|
}
|
|
83
102
|
) : void 0;
|
|
84
|
-
return /* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ l(
|
|
85
104
|
D,
|
|
86
105
|
{
|
|
87
|
-
label:
|
|
88
|
-
hint:
|
|
89
|
-
error:
|
|
90
|
-
required:
|
|
91
|
-
disableRequiredAsterisk:
|
|
92
|
-
htmlFor:
|
|
93
|
-
labelId:
|
|
94
|
-
hintId:
|
|
95
|
-
labelExtra:
|
|
96
|
-
infoTooltip:
|
|
97
|
-
labelRight:
|
|
98
|
-
children: /* @__PURE__ */
|
|
106
|
+
label: v,
|
|
107
|
+
hint: e && c ? c : y,
|
|
108
|
+
error: e,
|
|
109
|
+
required: o,
|
|
110
|
+
disableRequiredAsterisk: k,
|
|
111
|
+
htmlFor: r,
|
|
112
|
+
labelId: S,
|
|
113
|
+
hintId: F,
|
|
114
|
+
labelExtra: I,
|
|
115
|
+
infoTooltip: N,
|
|
116
|
+
labelRight: C,
|
|
117
|
+
children: /* @__PURE__ */ l("div", { className: J({ state: p ? "disabled" : e ? "error" : "default" }), children: /* @__PURE__ */ l(
|
|
99
118
|
"textarea",
|
|
100
119
|
{
|
|
101
120
|
"data-slot": "textarea",
|
|
102
|
-
ref:
|
|
103
|
-
id:
|
|
104
|
-
required:
|
|
105
|
-
"aria-required":
|
|
106
|
-
className:
|
|
107
|
-
E({ error:
|
|
108
|
-
|
|
121
|
+
ref: m,
|
|
122
|
+
id: r,
|
|
123
|
+
required: o,
|
|
124
|
+
"aria-required": o,
|
|
125
|
+
className: x(
|
|
126
|
+
E({ error: e, resize: z, autoResize: s }),
|
|
127
|
+
g
|
|
109
128
|
),
|
|
110
|
-
value:
|
|
129
|
+
value: a,
|
|
111
130
|
defaultValue: d,
|
|
112
131
|
onChange: (t) => {
|
|
113
|
-
|
|
132
|
+
f || A(t.target.value.length), n == null || n(t);
|
|
114
133
|
},
|
|
115
|
-
|
|
116
|
-
|
|
134
|
+
disabled: p,
|
|
135
|
+
...i,
|
|
136
|
+
onInput: s ? T : void 0
|
|
117
137
|
}
|
|
118
|
-
)
|
|
138
|
+
) })
|
|
119
139
|
}
|
|
120
140
|
);
|
|
121
141
|
}
|
|
122
142
|
);
|
|
123
|
-
|
|
143
|
+
K.displayName = "Textarea";
|
|
124
144
|
export {
|
|
125
|
-
|
|
145
|
+
K as Textarea
|
|
126
146
|
};
|