@vkzstudio/muza-ui 1.0.17 → 1.0.18

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 (49) hide show
  1. package/dist/components/Button/buttonVariants.js +1 -1
  2. package/dist/components/Checkbox/Checkbox.d.ts +4 -0
  3. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  4. package/dist/components/Checkbox/Checkbox.js +36 -29
  5. package/dist/components/Checkbox/Checkbox.stories.d.ts +1 -0
  6. package/dist/components/Checkbox/Checkbox.stories.d.ts.map +1 -1
  7. package/dist/components/DatePicker/DatePicker.d.ts +2 -0
  8. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  9. package/dist/components/DatePicker/DatePicker.js +33 -31
  10. package/dist/components/FileUpload/FileUpload.d.ts +6 -2
  11. package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
  12. package/dist/components/FileUpload/FileUpload.js +141 -135
  13. package/dist/components/FileUpload/FileUpload.stories.d.ts +2 -0
  14. package/dist/components/FileUpload/FileUpload.stories.d.ts.map +1 -1
  15. package/dist/components/Flex/Flex.d.ts +3 -1
  16. package/dist/components/Flex/Flex.d.ts.map +1 -1
  17. package/dist/components/Flex/Flex.js +33 -31
  18. package/dist/components/FormField/FormField.d.ts +30 -0
  19. package/dist/components/FormField/FormField.d.ts.map +1 -0
  20. package/dist/components/FormField/FormField.js +56 -0
  21. package/dist/components/FormField/InputHint.d.ts +13 -0
  22. package/dist/components/FormField/InputHint.d.ts.map +1 -0
  23. package/dist/components/FormField/InputHint.js +26 -0
  24. package/dist/components/FormField/InputLabel.d.ts +20 -0
  25. package/dist/components/FormField/InputLabel.d.ts.map +1 -0
  26. package/dist/components/FormField/InputLabel.js +27 -0
  27. package/dist/components/FormField/index.d.ts +4 -0
  28. package/dist/components/FormField/index.d.ts.map +1 -0
  29. package/dist/components/Input/Input.d.ts.map +1 -1
  30. package/dist/components/Input/Input.js +79 -94
  31. package/dist/components/MultiSelect/MultiSelect.d.ts +2 -0
  32. package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
  33. package/dist/components/MultiSelect/MultiSelect.js +125 -131
  34. package/dist/components/Radio/Radio.js +1 -1
  35. package/dist/components/Select/Select.d.ts +2 -0
  36. package/dist/components/Select/Select.d.ts.map +1 -1
  37. package/dist/components/Select/Select.js +126 -131
  38. package/dist/components/TextEditor/TextEditor.d.ts +4 -0
  39. package/dist/components/TextEditor/TextEditor.d.ts.map +1 -1
  40. package/dist/components/TextEditor/TextEditor.js +113 -135
  41. package/dist/components/Textarea/Textarea.d.ts +4 -0
  42. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  43. package/dist/components/Textarea/Textarea.js +52 -61
  44. package/dist/components/Textarea/Textarea.stories.d.ts +1 -0
  45. package/dist/components/Textarea/Textarea.stories.d.ts.map +1 -1
  46. package/dist/components/TimePicker/TimePicker.d.ts +2 -0
  47. package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
  48. package/dist/muza-ui.css +1 -1
  49. package/package.json +1 -1
@@ -1,11 +1,12 @@
1
- import { jsxs as v, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as w, useId as I, useRef as k } from "react";
3
- import { cva as N } from "class-variance-authority";
4
- import { Typography as d, typographyVariants as R } from "../Typography/Typography.js";
5
- import { cn as c } from "../../utils/cn.js";
6
- const T = N(
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(
7
8
  [
8
- R({
9
+ V({
9
10
  variant: "body",
10
11
  weight: "medium",
11
12
  size: "base"
@@ -37,66 +38,56 @@ const T = N(
37
38
  resize: "none"
38
39
  }
39
40
  }
40
- ), V = w(
41
+ ), N = z(
41
42
  ({
42
- className: m,
43
- label: a,
44
- hint: i,
43
+ className: d,
44
+ label: p,
45
+ hint: c,
45
46
  id: u,
46
47
  error: o,
47
- resize: x,
48
- autoResize: n,
49
- errorMessage: s,
50
- ...f
51
- }, l) => {
52
- const h = I(), e = u ?? h, b = `${e}-hint`, g = `${e}-label`, y = k(null), p = (typeof l == "function" ? null : l) ?? y, z = () => {
53
- const t = p.current;
48
+ resize: m,
49
+ autoResize: a,
50
+ errorMessage: i,
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;
54
57
  t && (t.style.height = "auto", t.style.height = `${t.scrollHeight + 2}px`);
55
58
  };
56
- return /* @__PURE__ */ v("div", { className: "flex flex-col gap-comp-input-gap", children: [
57
- a && /* @__PURE__ */ r(
58
- d,
59
- {
60
- component: "label",
61
- weight: "regular",
62
- size: "sm",
63
- htmlFor: e,
64
- id: g,
65
- className: "text-comp-input-text-primary",
66
- children: a
67
- }
68
- ),
69
- /* @__PURE__ */ r(
70
- "textarea",
71
- {
72
- "data-slot": "textarea",
73
- ref: p,
74
- id: e,
75
- className: c(
76
- T({ error: o, resize: x, autoResize: n }),
77
- m
78
- ),
79
- ...f,
80
- onInput: n ? z : void 0
81
- }
82
- ),
83
- i && /* @__PURE__ */ r(
84
- d,
85
- {
86
- component: "span",
87
- size: "sm",
88
- weight: "regular",
89
- className: c("text-comp-input-text-secondary", {
90
- "text-comp-input-text-error": o
91
- }),
92
- id: b,
93
- children: o && s ? s : i
94
- }
95
- )
96
- ] });
59
+ return /* @__PURE__ */ s(
60
+ R,
61
+ {
62
+ label: p,
63
+ hint: o && i ? i : c,
64
+ error: o,
65
+ required: r,
66
+ disableRequiredAsterisk: f,
67
+ htmlFor: e,
68
+ labelId: y,
69
+ hintId: b,
70
+ children: /* @__PURE__ */ s(
71
+ "textarea",
72
+ {
73
+ "data-slot": "textarea",
74
+ ref: l,
75
+ id: e,
76
+ required: r,
77
+ "aria-required": r,
78
+ className: F(
79
+ $({ error: o, resize: m, autoResize: a }),
80
+ d
81
+ ),
82
+ ...h,
83
+ onInput: a ? v : void 0
84
+ }
85
+ )
86
+ }
87
+ );
97
88
  }
98
89
  );
99
- V.displayName = "Textarea";
90
+ N.displayName = "Textarea";
100
91
  export {
101
- V as Textarea
92
+ N as Textarea
102
93
  };
@@ -8,6 +8,7 @@ export declare const WithTitleAndHint: Story;
8
8
  export declare const Filled: Story;
9
9
  export declare const Error: Story;
10
10
  export declare const Disabled: Story;
11
+ export declare const Required: Story;
11
12
  export declare const AutoResize: Story;
12
13
  export declare const ResizableHandles: Story;
13
14
  //# 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,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,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"}
@@ -20,6 +20,8 @@ export interface TimePickerProps extends Omit<InputProps, 'type' | 'suffix'> {
20
20
  readOnly?: boolean;
21
21
  /** Marks the field as required in form validation. */
22
22
  required?: boolean;
23
+ /** Hides the required asterisk even when `required` is true. @default false */
24
+ disableRequiredAsterisk?: boolean;
23
25
  }
24
26
  declare const TimePicker: ({ placeholder, ...props }: TimePickerProps) => import("react/jsx-runtime").JSX.Element;
25
27
  export { TimePicker };
@@ -1 +1 @@
1
- {"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../../src/components/TimePicker/TimePicker.tsx"],"names":[],"mappings":"AACA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAEjD;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1E,0FAA0F;IAC1F,WAAW,CAAC,EAAE,MAAM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