@vkzstudio/muza-ui 1.0.19 → 1.0.21
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 +1 -1
- package/dist/components/FileUpload/FileUpload.d.ts +4 -0
- package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/components/FileUpload/FileUpload.js +74 -70
- package/dist/components/FileUpload/FileUpload.stories.d.ts.map +1 -1
- package/dist/components/FormField/FormField.d.ts +4 -0
- package/dist/components/FormField/FormField.d.ts.map +1 -1
- package/dist/components/FormField/FormField.js +62 -49
- package/dist/components/Input/Input.d.ts +4 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.js +25 -21
- package/dist/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +4 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +42 -38
- package/dist/components/MultiSelect/MultiSelect.stories.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +4 -0
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +36 -32
- package/dist/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/components/TextEditor/TextEditor.d.ts.map +1 -1
- package/dist/components/TextEditor/TextEditor.js +66 -71
- package/dist/components/TextEditor/ToolbarButton.js +6 -6
- package/dist/components/Textarea/Textarea.d.ts +7 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +71 -38
- package/dist/components/Textarea/Textarea.stories.d.ts +1 -0
- package/dist/components/Textarea/Textarea.stories.d.ts.map +1 -1
- package/dist/muza-ui.css +1 -1
- package/dist/styles/primitives.css +2 -0
- package/dist/styles/token-colors.css +10 -4
- package/dist/styles/token-sizes.css +201 -17
- package/dist/styles/white-label.css +1 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as p } from "react";
|
|
3
3
|
import { cva as u } from "class-variance-authority";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { cn as b } from "../../utils/cn.js";
|
|
5
|
+
import { TooltipProvider as f, Tooltip as x, TooltipTrigger as g, TooltipContent as h } from "../Tooltip/Tooltip.js";
|
|
6
6
|
const v = u(
|
|
7
7
|
[
|
|
8
8
|
"flex shrink-0 items-center justify-center",
|
|
@@ -46,7 +46,7 @@ const v = u(
|
|
|
46
46
|
{
|
|
47
47
|
type: "button",
|
|
48
48
|
ref: l,
|
|
49
|
-
className:
|
|
49
|
+
className: b(v({ state: o ? "disabled" : e ? "active" : "default", className: s })),
|
|
50
50
|
disabled: o,
|
|
51
51
|
"aria-label": r,
|
|
52
52
|
"aria-pressed": e,
|
|
@@ -55,9 +55,9 @@ const v = u(
|
|
|
55
55
|
children: a
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
|
-
return c ? /* @__PURE__ */ t(
|
|
59
|
-
/* @__PURE__ */ t(
|
|
60
|
-
/* @__PURE__ */ t(
|
|
58
|
+
return c ? /* @__PURE__ */ t(f, { children: /* @__PURE__ */ m(x, { children: [
|
|
59
|
+
/* @__PURE__ */ t(g, { asChild: !0, children: i }),
|
|
60
|
+
/* @__PURE__ */ t(h, { children: d ?? r })
|
|
61
61
|
] }) }) : i;
|
|
62
62
|
}
|
|
63
63
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
/** Props for the Textarea component. */
|
|
3
3
|
export interface TextareaProps extends ComponentProps<'textarea'> {
|
|
4
4
|
/** Controls manual resize behavior via drag handle. @default 'none' */
|
|
@@ -19,6 +19,12 @@ export interface TextareaProps extends ComponentProps<'textarea'> {
|
|
|
19
19
|
name?: string;
|
|
20
20
|
/** Automatically grows textarea height to fit content. @default false */
|
|
21
21
|
autoResize?: boolean;
|
|
22
|
+
/** Extra content rendered inline next to the label (e.g. a tooltip icon). */
|
|
23
|
+
labelExtra?: ReactNode;
|
|
24
|
+
/** Tooltip content shown in an info icon next to the label. Overridden by `labelExtra` if both are provided. */
|
|
25
|
+
infoTooltip?: string;
|
|
26
|
+
/** Displays a character counter (currentCount/maxLength) in the label row. Requires `maxLength` to be set. @default false */
|
|
27
|
+
showCharacterCount?: boolean;
|
|
22
28
|
}
|
|
23
29
|
export declare const Textarea: import('react').ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
24
30
|
//# sourceMappingURL=Textarea.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAA;AA0Cd,wCAAwC;AACxC,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,UAAU,CAAC;IAC/D,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,YAAY,GAAG,MAAM,CAAA;IACpD,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6FAA6F;IAC7F,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,mDAAmD;IACnD,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,sFAAsF;IACtF,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gGAAgG;IAChG,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,+EAA+E;IAC/E,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,yEAAyE;IACzE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,gHAAgH;IAChH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,6HAA6H;IAC7H,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED,eAAO,MAAM,QAAQ,4HAqGpB,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { FormField as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { typographyVariants as
|
|
7
|
-
const
|
|
1
|
+
import { jsxs as A, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as C, useId as G, useRef as H, useState as U } from "react";
|
|
3
|
+
import { cva as B } from "class-variance-authority";
|
|
4
|
+
import { FormField as D } from "../FormField/FormField.js";
|
|
5
|
+
import { cn as f } from "../../utils/cn.js";
|
|
6
|
+
import { typographyVariants as h } from "../Typography/Typography.js";
|
|
7
|
+
const E = B(
|
|
8
8
|
[
|
|
9
|
-
|
|
9
|
+
h({
|
|
10
10
|
variant: "body",
|
|
11
11
|
weight: "medium",
|
|
12
12
|
size: "base"
|
|
@@ -38,56 +38,89 @@ const $ = k(
|
|
|
38
38
|
resize: "none"
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
),
|
|
41
|
+
), J = C(
|
|
42
42
|
({
|
|
43
|
-
className:
|
|
44
|
-
label:
|
|
45
|
-
hint:
|
|
46
|
-
id:
|
|
43
|
+
className: x,
|
|
44
|
+
label: b,
|
|
45
|
+
hint: g,
|
|
46
|
+
id: y,
|
|
47
47
|
error: o,
|
|
48
|
-
resize:
|
|
49
|
-
autoResize:
|
|
50
|
-
errorMessage:
|
|
48
|
+
resize: v,
|
|
49
|
+
autoResize: l,
|
|
50
|
+
errorMessage: s,
|
|
51
51
|
required: r,
|
|
52
|
-
disableRequiredAsterisk:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
disableRequiredAsterisk: z,
|
|
53
|
+
labelExtra: w,
|
|
54
|
+
infoTooltip: I,
|
|
55
|
+
showCharacterCount: k,
|
|
56
|
+
value: n,
|
|
57
|
+
defaultValue: d,
|
|
58
|
+
onChange: i,
|
|
59
|
+
...a
|
|
60
|
+
}, c) => {
|
|
61
|
+
const R = G(), e = y ?? R, N = `${e}-hint`, F = `${e}-label`, S = H(null), p = (typeof c == "function" ? null : c) ?? S, u = n !== void 0, [$, j] = U(
|
|
62
|
+
() => String(d ?? "").length
|
|
63
|
+
), L = u ? String(n).length : $, T = () => {
|
|
64
|
+
const t = p.current;
|
|
57
65
|
t && (t.style.height = "auto", t.style.height = `${t.scrollHeight + 2}px`);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
R,
|
|
66
|
+
}, V = k && a.maxLength != null ? /* @__PURE__ */ A(
|
|
67
|
+
"span",
|
|
61
68
|
{
|
|
62
|
-
|
|
63
|
-
|
|
69
|
+
className: f(
|
|
70
|
+
h({
|
|
71
|
+
variant: "body",
|
|
72
|
+
weight: "regular",
|
|
73
|
+
size: "sm"
|
|
74
|
+
}),
|
|
75
|
+
"text-comp-input-text-secondary"
|
|
76
|
+
),
|
|
77
|
+
children: [
|
|
78
|
+
L,
|
|
79
|
+
"/",
|
|
80
|
+
a.maxLength
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
) : void 0;
|
|
84
|
+
return /* @__PURE__ */ m(
|
|
85
|
+
D,
|
|
86
|
+
{
|
|
87
|
+
label: b,
|
|
88
|
+
hint: o && s ? s : g,
|
|
64
89
|
error: o,
|
|
65
90
|
required: r,
|
|
66
|
-
disableRequiredAsterisk:
|
|
91
|
+
disableRequiredAsterisk: z,
|
|
67
92
|
htmlFor: e,
|
|
68
|
-
labelId:
|
|
69
|
-
hintId:
|
|
70
|
-
|
|
93
|
+
labelId: F,
|
|
94
|
+
hintId: N,
|
|
95
|
+
labelExtra: w,
|
|
96
|
+
infoTooltip: I,
|
|
97
|
+
labelRight: V,
|
|
98
|
+
children: /* @__PURE__ */ m(
|
|
71
99
|
"textarea",
|
|
72
100
|
{
|
|
73
101
|
"data-slot": "textarea",
|
|
74
|
-
ref:
|
|
102
|
+
ref: p,
|
|
75
103
|
id: e,
|
|
76
104
|
required: r,
|
|
77
105
|
"aria-required": r,
|
|
78
|
-
className:
|
|
79
|
-
|
|
80
|
-
|
|
106
|
+
className: f(
|
|
107
|
+
E({ error: o, resize: v, autoResize: l }),
|
|
108
|
+
x
|
|
81
109
|
),
|
|
82
|
-
|
|
83
|
-
|
|
110
|
+
value: n,
|
|
111
|
+
defaultValue: d,
|
|
112
|
+
onChange: (t) => {
|
|
113
|
+
u || j(t.target.value.length), i == null || i(t);
|
|
114
|
+
},
|
|
115
|
+
...a,
|
|
116
|
+
onInput: l ? T : void 0
|
|
84
117
|
}
|
|
85
118
|
)
|
|
86
119
|
}
|
|
87
120
|
);
|
|
88
121
|
}
|
|
89
122
|
);
|
|
90
|
-
|
|
123
|
+
J.displayName = "Textarea";
|
|
91
124
|
export {
|
|
92
|
-
|
|
125
|
+
J as Textarea
|
|
93
126
|
};
|
|
@@ -10,5 +10,6 @@ export declare const Error: Story;
|
|
|
10
10
|
export declare const Disabled: Story;
|
|
11
11
|
export declare const Required: Story;
|
|
12
12
|
export declare const AutoResize: Story;
|
|
13
|
+
export declare const WithCharacterCounter: Story;
|
|
13
14
|
export declare const ResizableHandles: Story;
|
|
14
15
|
//# sourceMappingURL=Textarea.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Textarea/Textarea.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,
|
|
1
|
+
{"version":3,"file":"Textarea.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Textarea/Textarea.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CAyG/B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,QAAQ,CAAC,CAAA;AAEtC,eAAO,MAAM,OAAO,EAAE,KAcrB,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAgB9B,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAgBpB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAiBnB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAgBtB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAgBtB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAiBxB,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,KAiBlC,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAiB9B,CAAA"}
|