@vkzstudio/muza-ui 1.0.20 → 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.
Files changed (29) hide show
  1. package/dist/components/Dialog/Dialog.js +1 -1
  2. package/dist/components/FileUpload/FileUpload.d.ts +4 -0
  3. package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
  4. package/dist/components/FileUpload/FileUpload.js +74 -70
  5. package/dist/components/FileUpload/FileUpload.stories.d.ts.map +1 -1
  6. package/dist/components/FormField/FormField.d.ts +4 -0
  7. package/dist/components/FormField/FormField.d.ts.map +1 -1
  8. package/dist/components/FormField/FormField.js +62 -49
  9. package/dist/components/Input/Input.d.ts +4 -0
  10. package/dist/components/Input/Input.d.ts.map +1 -1
  11. package/dist/components/Input/Input.js +25 -21
  12. package/dist/components/Input/Input.stories.d.ts.map +1 -1
  13. package/dist/components/MultiSelect/MultiSelect.d.ts +4 -0
  14. package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
  15. package/dist/components/MultiSelect/MultiSelect.js +42 -38
  16. package/dist/components/MultiSelect/MultiSelect.stories.d.ts.map +1 -1
  17. package/dist/components/Select/Select.d.ts +4 -0
  18. package/dist/components/Select/Select.d.ts.map +1 -1
  19. package/dist/components/Select/Select.js +36 -32
  20. package/dist/components/Select/Select.stories.d.ts.map +1 -1
  21. package/dist/components/TextEditor/TextEditor.d.ts.map +1 -1
  22. package/dist/components/TextEditor/TextEditor.js +66 -71
  23. package/dist/components/TextEditor/ToolbarButton.js +6 -6
  24. package/dist/components/Textarea/Textarea.d.ts +7 -1
  25. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  26. package/dist/components/Textarea/Textarea.js +71 -38
  27. package/dist/components/Textarea/Textarea.stories.d.ts +1 -0
  28. package/dist/components/Textarea/Textarea.stories.d.ts.map +1 -1
  29. 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 { TooltipProvider as b, Tooltip as f, TooltipTrigger as x, TooltipContent as g } from "../Tooltip/Tooltip.js";
5
- import { cn as h } from "../../utils/cn.js";
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: h(v({ state: o ? "disabled" : e ? "active" : "default", className: s })),
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(b, { children: /* @__PURE__ */ m(f, { children: [
59
- /* @__PURE__ */ t(x, { asChild: !0, children: i }),
60
- /* @__PURE__ */ t(g, { children: d ?? r })
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,EAAE,KAAK,cAAc,EAA6B,MAAM,OAAO,CAAA;AA0CtE,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;CACrB;AAED,eAAO,MAAM,QAAQ,4HA8DpB,CAAA"}
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 s } from "react/jsx-runtime";
2
- import { forwardRef as z, useId as w, useRef as I } from "react";
3
- import { cva as k } from "class-variance-authority";
4
- import { FormField as R } from "../FormField/FormField.js";
5
- import { cn as F } from "../../utils/cn.js";
6
- import { typographyVariants as V } from "../Typography/Typography.js";
7
- const $ = k(
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
- V({
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
- ), N = z(
41
+ ), J = C(
42
42
  ({
43
- className: d,
44
- label: p,
45
- hint: c,
46
- id: u,
43
+ className: x,
44
+ label: b,
45
+ hint: g,
46
+ id: y,
47
47
  error: o,
48
- resize: m,
49
- autoResize: a,
50
- errorMessage: i,
48
+ resize: v,
49
+ autoResize: l,
50
+ errorMessage: s,
51
51
  required: r,
52
- disableRequiredAsterisk: f,
53
- ...h
54
- }, n) => {
55
- const x = w(), e = u ?? x, b = `${e}-hint`, y = `${e}-label`, g = I(null), l = (typeof n == "function" ? null : n) ?? g, v = () => {
56
- const t = l.current;
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
- return /* @__PURE__ */ s(
60
- R,
66
+ }, V = k && a.maxLength != null ? /* @__PURE__ */ A(
67
+ "span",
61
68
  {
62
- label: p,
63
- hint: o && i ? i : c,
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: f,
91
+ disableRequiredAsterisk: z,
67
92
  htmlFor: e,
68
- labelId: y,
69
- hintId: b,
70
- children: /* @__PURE__ */ s(
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: l,
102
+ ref: p,
75
103
  id: e,
76
104
  required: r,
77
105
  "aria-required": r,
78
- className: F(
79
- $({ error: o, resize: m, autoResize: a }),
80
- d
106
+ className: f(
107
+ E({ error: o, resize: v, autoResize: l }),
108
+ x
81
109
  ),
82
- ...h,
83
- onInput: a ? v : void 0
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
- N.displayName = "Textarea";
123
+ J.displayName = "Textarea";
91
124
  export {
92
- N as Textarea
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,CA8F/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,KAe9B,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,gBAAgB,EAAE,KAiB9B,CAAA"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkzstudio/muza-ui",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "React component library built with Vite, shadcn/ui, and Tailwind CSS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",