@vkzstudio/muza-ui 1.0.5 → 1.0.7

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 (90) hide show
  1. package/dist/components/Button/buttonVariants.d.ts +1 -1
  2. package/dist/components/Calendar/Calendar.d.ts +2 -2
  3. package/dist/components/Calendar/Calendar.d.ts.map +1 -1
  4. package/dist/components/Calendar/Calendar.js +158 -150
  5. package/dist/components/DataTable/DataTable.d.ts +17 -0
  6. package/dist/components/DataTable/DataTable.d.ts.map +1 -0
  7. package/dist/components/DataTable/DataTable.js +73 -0
  8. package/dist/components/DataTable/DataTable.stories.d.ts +10 -0
  9. package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -0
  10. package/dist/components/DataTable/index.d.ts +2 -0
  11. package/dist/components/DataTable/index.d.ts.map +1 -0
  12. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  13. package/dist/components/Dialog/Dialog.js +28 -26
  14. package/dist/components/ExpandableTable/Table.d.ts +1 -1
  15. package/dist/components/FileUpload/FileItem.d.ts.map +1 -1
  16. package/dist/components/FileUpload/FileItem.js +83 -78
  17. package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
  18. package/dist/components/FileUpload/FileUpload.js +98 -94
  19. package/dist/components/Flex/Flex.d.ts +1 -1
  20. package/dist/components/Icons/CustomIcons.d.ts +3 -0
  21. package/dist/components/Icons/CustomIcons.d.ts.map +1 -1
  22. package/dist/components/Icons/CustomIcons.js +90 -41
  23. package/dist/components/Icons/Icons.stories.d.ts.map +1 -1
  24. package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
  25. package/dist/components/MultiSelect/MultiSelect.js +51 -50
  26. package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts +19 -0
  27. package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts.map +1 -0
  28. package/dist/components/MuzaUIProvider/MuzaUIProvider.js +19 -0
  29. package/dist/components/MuzaUIProvider/MuzaUIProvider.stories.d.ts +10 -0
  30. package/dist/components/MuzaUIProvider/MuzaUIProvider.stories.d.ts.map +1 -0
  31. package/dist/components/MuzaUIProvider/index.d.ts +2 -0
  32. package/dist/components/MuzaUIProvider/index.d.ts.map +1 -0
  33. package/dist/components/Searchbar/Searchbar.d.ts +3 -2
  34. package/dist/components/Searchbar/Searchbar.d.ts.map +1 -1
  35. package/dist/components/Searchbar/Searchbar.js +56 -54
  36. package/dist/components/Searchbar/Searchbar.stories.d.ts +1 -0
  37. package/dist/components/Searchbar/Searchbar.stories.d.ts.map +1 -1
  38. package/dist/components/Select/Select.d.ts.map +1 -1
  39. package/dist/components/Select/Select.js +43 -42
  40. package/dist/components/Stepper/Stepper.d.ts +1 -1
  41. package/dist/components/Stepper/Stepper.d.ts.map +1 -1
  42. package/dist/components/Stepper/Stepper.js +43 -42
  43. package/dist/components/SwipeButton/SwipeButton.d.ts +1 -1
  44. package/dist/components/SwipeButton/SwipeButton.d.ts.map +1 -1
  45. package/dist/components/SwipeButton/SwipeButton.js +85 -84
  46. package/dist/components/SwipeButton/SwipeButton.stories.d.ts +1 -1
  47. package/dist/components/Typography/Typography.d.ts +1 -1
  48. package/dist/components/index.d.ts +3 -0
  49. package/dist/components/index.d.ts.map +1 -1
  50. package/dist/index.js +204 -186
  51. package/dist/muza-ui.css +1 -1
  52. package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
  53. package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
  54. package/dist/node_modules/date-fns/constants.js +4 -0
  55. package/dist/node_modules/date-fns/constructFrom.js +8 -0
  56. package/dist/node_modules/date-fns/isSameWeek.js +14 -0
  57. package/dist/node_modules/date-fns/locale/cs/_lib/formatDistance.js +275 -0
  58. package/dist/node_modules/date-fns/locale/cs/_lib/formatLong.js +33 -0
  59. package/dist/node_modules/date-fns/locale/cs/_lib/formatRelative.js +25 -0
  60. package/dist/node_modules/date-fns/locale/cs/_lib/localize.js +167 -0
  61. package/dist/node_modules/date-fns/locale/cs/_lib/match.js +109 -0
  62. package/dist/node_modules/date-fns/locale/cs.js +21 -0
  63. package/dist/node_modules/date-fns/locale/sk/_lib/formatDistance.js +158 -0
  64. package/dist/node_modules/date-fns/locale/sk/_lib/formatLong.js +33 -0
  65. package/dist/node_modules/date-fns/locale/sk/_lib/formatRelative.js +60 -0
  66. package/dist/node_modules/date-fns/locale/sk/_lib/localize.js +175 -0
  67. package/dist/node_modules/date-fns/locale/sk/_lib/match.js +111 -0
  68. package/dist/node_modules/date-fns/locale/sk.js +21 -0
  69. package/dist/node_modules/date-fns/startOfWeek.js +11 -0
  70. package/dist/node_modules/date-fns/toDate.js +8 -0
  71. package/dist/styles/token-colors.css +1206 -1199
  72. package/dist/styles/token-sizes.css +680 -680
  73. package/dist/styles/typography.css +84 -84
  74. package/dist/translations/TranslationContext.d.ts +61 -0
  75. package/dist/translations/TranslationContext.d.ts.map +1 -0
  76. package/dist/translations/TranslationContext.js +74 -0
  77. package/dist/translations/index.d.ts +6 -0
  78. package/dist/translations/index.d.ts.map +1 -0
  79. package/dist/translations/locales/cs.d.ts +3 -0
  80. package/dist/translations/locales/cs.d.ts.map +1 -0
  81. package/dist/translations/locales/cs.js +52 -0
  82. package/dist/translations/locales/en.d.ts +3 -0
  83. package/dist/translations/locales/en.d.ts.map +1 -0
  84. package/dist/translations/locales/en.js +52 -0
  85. package/dist/translations/locales/sk.d.ts +3 -0
  86. package/dist/translations/locales/sk.d.ts.map +1 -0
  87. package/dist/translations/locales/sk.js +52 -0
  88. package/dist/translations/types.d.ts +118 -0
  89. package/dist/translations/types.d.ts.map +1 -0
  90. package/package.json +1 -1
@@ -1,43 +1,44 @@
1
1
  import { jsx as t, jsxs as i } from "react/jsx-runtime";
2
- import p, { forwardRef as O, useMemo as R, useRef as j, useEffect as k } from "react";
3
- import { triggerWrapperVariants as A } from "../Select/utils.js";
4
- import { Typography as u } from "../Typography/Typography.js";
2
+ import u, { forwardRef as k, useMemo as R, useRef as A, useEffect as I } from "react";
3
+ import { triggerWrapperVariants as V } from "../Select/utils.js";
4
+ import { useMuzaTranslations as E } from "../../translations/TranslationContext.js";
5
+ import { Typography as f } from "../Typography/Typography.js";
5
6
  import { Tag as h } from "../Tag/Tag.js";
6
- import { DropdownMenu as I, DropdownMenuTrigger as V, DropdownMenuContent as E, DropdownMenuCheckboxItem as _ } from "../DropdownMenu/DropdownMenu.js";
7
- import { AltArrowUpOutline as B } from "@solar-icons/react-perf";
8
- import { cn as F } from "../../utils/cn.js";
9
- const L = O(
7
+ import { DropdownMenu as _, DropdownMenuTrigger as B, DropdownMenuContent as F, DropdownMenuCheckboxItem as L } from "../DropdownMenu/DropdownMenu.js";
8
+ import { AltArrowUpOutline as P } from "@solar-icons/react-perf";
9
+ import { cn as U } from "../../utils/cn.js";
10
+ const $ = k(
10
11
  (T, x) => {
11
- const {
12
+ const z = E(), {
12
13
  label: g,
13
14
  hint: b,
14
15
  error: w,
15
16
  options: o,
16
- onChange: l,
17
+ onChange: s,
17
18
  value: r,
18
- disabled: m,
19
- prefix: d,
19
+ disabled: d,
20
+ prefix: m,
20
21
  maxNumberOfVisibleTags: c = 2,
21
- size: z,
22
- placeholder: N = "Select..."
23
- } = T, v = R(() => new Map(o.map((e) => [e.value, e.label])), [o]), S = R(() => {
24
- const e = r && r.map((s) => v.get(s));
25
- return e != null && e.length ? e.length <= c ? /* @__PURE__ */ t("div", { className: "flex flex-1 items-start justify-start gap-xs", children: e.map((s, a) => /* @__PURE__ */ t(h, { variant: "info", className: "max-w-[72px]", children: s }, a)) }) : /* @__PURE__ */ t("div", { className: "flex flex-1 items-center gap-xs", children: [
26
- ...e.slice(0, c).map((s, a) => /* @__PURE__ */ t(
22
+ size: D,
23
+ placeholder: S
24
+ } = T, N = S ?? z.select.placeholder, v = R(() => new Map(o.map((e) => [e.value, e.label])), [o]), W = R(() => {
25
+ const e = r && r.map((l) => v.get(l));
26
+ return e != null && e.length ? e.length <= c ? /* @__PURE__ */ t("div", { className: "flex flex-1 items-start justify-start gap-xs", children: e.map((l, n) => /* @__PURE__ */ t(h, { variant: "info", className: "max-w-[72px]", children: l }, n)) }) : /* @__PURE__ */ t("div", { className: "flex flex-1 items-center gap-xs", children: [
27
+ ...e.slice(0, c).map((l, n) => /* @__PURE__ */ t(
27
28
  h,
28
29
  {
29
30
  variant: "info",
30
31
  className: "max-w-[72px] overflow-hidden",
31
- children: /* @__PURE__ */ t("span", { className: "truncate", children: s })
32
+ children: /* @__PURE__ */ t("span", { className: "truncate", children: l })
32
33
  },
33
- a
34
+ n
34
35
  )),
35
36
  /* @__PURE__ */ i(h, { variant: "info", children: [
36
37
  e.length - c,
37
38
  "+"
38
39
  ] }, "more")
39
40
  ] }) : /* @__PURE__ */ t(
40
- u,
41
+ f,
41
42
  {
42
43
  size: "input",
43
44
  className: "grow-1 fix-y-text truncate text-left text-comp-select-text-placeholder",
@@ -46,19 +47,19 @@ const L = O(
46
47
  children: N
47
48
  }
48
49
  );
49
- }, [r, N, c, v]), [y, D] = p.useState(!1), [M, W] = p.useState(0), f = p.useRef(!1), C = j(null), n = (typeof x == "function" ? null : x) ?? C;
50
- return k(() => {
50
+ }, [r, N, c, v]), [y, C] = u.useState(!1), [M, O] = u.useState(0), p = u.useRef(!1), j = A(null), a = (typeof x == "function" ? null : x) ?? j;
51
+ return I(() => {
51
52
  const e = () => {
52
- n.current && W(n.current.offsetWidth);
53
+ a.current && O(a.current.offsetWidth);
53
54
  };
54
55
  e();
55
- const s = new ResizeObserver(e);
56
- return n.current && s.observe(n.current), () => {
57
- s.disconnect();
56
+ const l = new ResizeObserver(e);
57
+ return a.current && l.observe(a.current), () => {
58
+ l.disconnect();
58
59
  };
59
- }, [n]), /* @__PURE__ */ i("div", { className: "flex flex-col gap-sm", children: [
60
+ }, [a]), /* @__PURE__ */ i("div", { className: "flex flex-col gap-sm", children: [
60
61
  g && /* @__PURE__ */ t(
61
- u,
62
+ f,
62
63
  {
63
64
  component: "label",
64
65
  size: "sm",
@@ -68,39 +69,39 @@ const L = O(
68
69
  }
69
70
  ),
70
71
  /* @__PURE__ */ i(
71
- I,
72
+ _,
72
73
  {
73
74
  onOpenChange: (e) => {
74
- D(e);
75
+ C(e);
75
76
  },
76
77
  children: [
77
- /* @__PURE__ */ t(V, { disabled: m, asChild: !0, children: /* @__PURE__ */ t(
78
+ /* @__PURE__ */ t(B, { disabled: d, asChild: !0, children: /* @__PURE__ */ t(
78
79
  "button",
79
80
  {
80
- ref: n,
81
+ ref: a,
81
82
  type: "button",
82
83
  role: "input",
83
84
  tabIndex: 0,
84
- disabled: m,
85
- className: A({
86
- size: z,
85
+ disabled: d,
86
+ className: V({
87
+ size: D,
87
88
  error: w,
88
89
  expanded: y,
89
- hasIcon: !!d || (r == null ? void 0 : r.length) === 0
90
+ hasIcon: !!m || (r == null ? void 0 : r.length) === 0
90
91
  }),
91
92
  children: /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 items-center gap-sm", children: [
92
- d && /* @__PURE__ */ t(
93
+ m && /* @__PURE__ */ t(
93
94
  "span",
94
95
  {
95
- className: m ? "text-comp-select-icon-disabled" : "text-comp-select-icon-brand-def",
96
- children: d
96
+ className: d ? "text-comp-select-icon-disabled" : "text-comp-select-icon-brand-def",
97
+ children: m
97
98
  }
98
99
  ),
99
- S,
100
+ W,
100
101
  /* @__PURE__ */ t(
101
- B,
102
+ P,
102
103
  {
103
- className: F(
104
+ className: U(
104
105
  "transition-transform duration-200",
105
106
  y ? "rotate-0" : "rotate-180"
106
107
  )
@@ -110,23 +111,23 @@ const L = O(
110
111
  }
111
112
  ) }),
112
113
  /* @__PURE__ */ t(
113
- E,
114
+ F,
114
115
  {
115
116
  className: "mt-1",
116
117
  style: {
117
118
  width: M > 0 ? `${M}px` : void 0
118
119
  },
119
120
  onCloseAutoFocus: (e) => {
120
- f.current || e.preventDefault(), f.current = !1;
121
+ p.current || e.preventDefault(), p.current = !1;
121
122
  },
122
123
  children: o.map((e) => /* @__PURE__ */ t(
123
- _,
124
+ L,
124
125
  {
125
126
  checked: r == null ? void 0 : r.includes(e.value),
126
127
  disabled: e.disabled,
127
128
  icon: e.icon,
128
- onCheckedChange: (s) => {
129
- s ? l == null || l([...r || [], e.value]) : l == null || l((r || []).filter((a) => a !== e.value)), f.current = !0;
129
+ onCheckedChange: (l) => {
130
+ l ? s == null || s([...r || [], e.value]) : s == null || s((r || []).filter((n) => n !== e.value)), p.current = !0;
130
131
  },
131
132
  children: e.label
132
133
  },
@@ -138,7 +139,7 @@ const L = O(
138
139
  }
139
140
  ),
140
141
  b && /* @__PURE__ */ t(
141
- u,
142
+ f,
142
143
  {
143
144
  component: "p",
144
145
  size: "sm",
@@ -150,7 +151,7 @@ const L = O(
150
151
  ] });
151
152
  }
152
153
  );
153
- L.displayName = "MultiSelect";
154
+ $.displayName = "MultiSelect";
154
155
  export {
155
- L as MultiSelect
156
+ $ as MultiSelect
156
157
  };
@@ -0,0 +1,19 @@
1
+ import { ToasterProps } from 'sonner';
2
+ import { TranslationConfig } from '../../translations/index';
3
+ import { TooltipProvider } from '../Tooltip';
4
+ import * as React from 'react';
5
+ export type MuzaTooltipConfig = Omit<React.ComponentPropsWithoutRef<typeof TooltipProvider>, 'children'>;
6
+ export type MuzaToastConfig = Omit<ToasterProps, 'children'>;
7
+ export interface MuzaUIProviderProps {
8
+ children: React.ReactNode;
9
+ tooltipConfig?: MuzaTooltipConfig;
10
+ toastConfig?: MuzaToastConfig;
11
+ /** Translation configuration for locale and custom translations */
12
+ translationConfig?: TranslationConfig;
13
+ }
14
+ declare const MuzaUIProvider: {
15
+ ({ children, tooltipConfig, toastConfig, translationConfig, }: MuzaUIProviderProps): import("react/jsx-runtime").JSX.Element;
16
+ displayName: string;
17
+ };
18
+ export { MuzaUIProvider };
19
+ //# sourceMappingURL=MuzaUIProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MuzaUIProvider.d.ts","sourceRoot":"","sources":["../../../src/components/MuzaUIProvider/MuzaUIProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,EACtD,UAAU,CACX,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAA;AAE5D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,aAAa,CAAC,EAAE,iBAAiB,CAAA;IACjC,WAAW,CAAC,EAAE,eAAe,CAAA;IAC7B,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;CACtC;AAED,QAAA,MAAM,cAAc;mEAKjB,mBAAmB;;CASrB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,19 @@
1
+ import { jsx as r, jsxs as e } from "react/jsx-runtime";
2
+ import "react";
3
+ import "sonner";
4
+ import { TranslationProvider as p } from "../../translations/TranslationContext.js";
5
+ import { TooltipProvider as a } from "../Tooltip/Tooltip.js";
6
+ import { ToastContainer as n } from "../Toast/ToastContainer.js";
7
+ const d = ({
8
+ children: o,
9
+ tooltipConfig: i = {},
10
+ toastConfig: t = {},
11
+ translationConfig: m = {}
12
+ }) => /* @__PURE__ */ r(p, { ...m, children: /* @__PURE__ */ e(a, { ...i, children: [
13
+ o,
14
+ /* @__PURE__ */ r(n, { ...t })
15
+ ] }) });
16
+ d.displayName = "MuzaUIProvider";
17
+ export {
18
+ d as MuzaUIProvider
19
+ };
@@ -0,0 +1,10 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { MuzaUIProvider } from './MuzaUIProvider';
3
+ declare const meta: Meta<typeof MuzaUIProvider>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MuzaUIProvider>;
6
+ export declare const Default: Story;
7
+ export declare const CustomTooltipDelay: Story;
8
+ export declare const CustomToastPosition: Story;
9
+ export declare const LanguageProviderShowcase: Story;
10
+ //# sourceMappingURL=MuzaUIProvider.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MuzaUIProvider.stories.d.ts","sourceRoot":"","sources":["../../../src/components/MuzaUIProvider/MuzaUIProvider.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAQ3D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CA0ErC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,cAAc,CAAC,CAAA;AAE5C,eAAO,MAAM,OAAO,EAAE,KAoCrB,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KAsBhC,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAwBjC,CAAA;AAED,eAAO,MAAM,wBAAwB,EAAE,KA+CtC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './MuzaUIProvider';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MuzaUIProvider/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
@@ -1,13 +1,14 @@
1
1
  import { InputProps } from '../Input';
2
2
  import * as React from 'react';
3
- export interface SearchbarProps extends Omit<InputProps, 'size' | 'type' | 'onSubmit' | 'value' | 'defaultValue' | 'suffix' | 'value' | 'defaultValue'> {
3
+ export interface SearchbarProps extends Omit<InputProps, 'type' | 'onSubmit' | 'value' | 'defaultValue' | 'suffix'> {
4
4
  value?: string;
5
5
  defaultValue?: string;
6
+ size?: 'sm' | 'base' | 'lg';
6
7
  showButtons?: boolean;
7
8
  clearButtonAriaLabel?: string;
8
9
  searchButtonAriaLabel?: string;
9
10
  onSubmit?: (e: React.FormEvent<HTMLFormElement>) => void;
10
11
  }
11
- declare const Searchbar: ({ className, error, showButtons, clearButtonAriaLabel, searchButtonAriaLabel, disabled, value, defaultValue, name, placeholder, onChange, onSubmit, ...props }: SearchbarProps) => import("react/jsx-runtime").JSX.Element;
12
+ declare const Searchbar: ({ className, error, size, showButtons, clearButtonAriaLabel: clearButtonAriaLabelProp, searchButtonAriaLabel: searchButtonAriaLabelProp, disabled, value, defaultValue, name, placeholder, onChange, onSubmit, ...props }: SearchbarProps) => import("react/jsx-runtime").JSX.Element;
12
13
  export { Searchbar };
13
14
  //# sourceMappingURL=Searchbar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Searchbar.d.ts","sourceRoot":"","sources":["../../../src/components/Searchbar/Searchbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAEjD,MAAM,WAAW,cACf,SAAQ,IAAI,CACV,UAAU,EACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,GACP,cAAc,GACd,QAAQ,GACR,OAAO,GACP,cAAc,CACjB;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,IAAI,CAAA;CACzD;AAED,QAAA,MAAM,SAAS,GAAI,gKAchB,cAAc,4CAiGhB,CAAA;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
1
+ {"version":3,"file":"Searchbar.d.ts","sourceRoot":"","sources":["../../../src/components/Searchbar/Searchbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAEjD,MAAM,WAAW,cACf,SAAQ,IAAI,CACV,UAAU,EACV,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,QAAQ,CAC1D;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,IAAI,CAAA;CACzD;AAED,QAAA,MAAM,SAAS,GAAI,2NAehB,cAAc,4CAuGhB,CAAA;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -1,80 +1,82 @@
1
- import { jsxs as R, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as R, jsx as e } from "react/jsx-runtime";
2
2
  import * as n from "react";
3
- import { MagnifyingGlass as j } from "../Icons/CustomIcons.js";
4
- import { cn as a } from "../../utils/cn.js";
5
- import { CloseCircleBold as w } from "@solar-icons/react-perf";
6
- import { Input as I } from "../Input/Input.js";
7
- const E = ({
8
- className: m,
9
- error: p = !1,
10
- showButtons: x = !0,
11
- clearButtonAriaLabel: d,
12
- searchButtonAriaLabel: y,
13
- disabled: e = !1,
14
- value: o,
15
- defaultValue: h,
16
- name: k,
17
- placeholder: v,
18
- onChange: s,
3
+ import { useMuzaTranslations as j } from "../../translations/TranslationContext.js";
4
+ import { MagnifyingGlass as w } from "../Icons/CustomIcons.js";
5
+ import { cn as s } from "../../utils/cn.js";
6
+ import { CloseCircleBold as I } from "@solar-icons/react-perf";
7
+ import { Input as M } from "../Input/Input.js";
8
+ const F = ({
9
+ className: p,
10
+ error: h = !1,
11
+ size: x = "sm",
12
+ showButtons: d = !0,
13
+ clearButtonAriaLabel: y,
14
+ searchButtonAriaLabel: b,
15
+ disabled: r = !1,
16
+ value: a,
17
+ defaultValue: k,
18
+ name: v,
19
+ placeholder: g,
20
+ onChange: o,
19
21
  onSubmit: i,
20
- ...g
22
+ ...B
21
23
  }) => {
22
- const f = n.useRef(null), [c, l] = n.useState(
23
- o ?? h ?? ""
24
+ const u = j(), A = y ?? u.searchbar.clearButtonAriaLabel, L = b ?? u.searchbar.searchButtonAriaLabel, f = n.useRef(null), [c, l] = n.useState(
25
+ a ?? k ?? ""
24
26
  );
25
27
  n.useEffect(() => {
26
- o !== void 0 && l(o);
27
- }, [o]);
28
+ a !== void 0 && l(a);
29
+ }, [a]);
28
30
  const N = (t) => {
29
- l(t.target.value), s && s(t);
31
+ l(t.target.value), o && o(t);
30
32
  }, z = () => {
31
- var t, u;
32
- l(""), (u = (t = f.current) == null ? void 0 : t.querySelector("input")) == null || u.focus(), s && s({
33
+ var t, m;
34
+ l(""), (m = (t = f.current) == null ? void 0 : t.querySelector("input")) == null || m.focus(), o && o({
33
35
  target: { value: "" }
34
36
  });
35
- }, C = x ? /* @__PURE__ */ R("div", { className: "flex gap-sm", children: [
36
- /* @__PURE__ */ r(
37
+ }, C = d ? /* @__PURE__ */ R("div", { className: "flex gap-sm", children: [
38
+ /* @__PURE__ */ e(
37
39
  "button",
38
40
  {
39
- className: a(
41
+ className: s(
40
42
  "flex shrink-0 cursor-pointer items-center focus-visible-default transition-opacity",
41
43
  {
42
44
  "opacity-0": !c,
43
- "cursor-not-allowed": e
45
+ "cursor-not-allowed": r
44
46
  }
45
47
  ),
46
- "aria-label": d,
48
+ "aria-label": A,
47
49
  type: "button",
48
50
  onClick: z,
49
- children: /* @__PURE__ */ r(
50
- w,
51
+ children: /* @__PURE__ */ e(
52
+ I,
51
53
  {
52
- className: a("size-icon-small text-icon-dark-secondary-def", {
53
- "text-text-dark-tertiary": e
54
+ className: s("size-icon-small text-icon-dark-secondary-def", {
55
+ "text-text-dark-tertiary": r
54
56
  })
55
57
  }
56
58
  )
57
59
  }
58
60
  ),
59
- /* @__PURE__ */ r(
61
+ /* @__PURE__ */ e(
60
62
  "button",
61
63
  {
62
- className: a(
64
+ className: s(
63
65
  "flex shrink-0 cursor-pointer items-center focus-visible-default",
64
66
  {
65
- "cursor-not-allowed": e
67
+ "cursor-not-allowed": r
66
68
  }
67
69
  ),
68
- "aria-label": y,
70
+ "aria-label": L,
69
71
  type: "submit",
70
- children: /* @__PURE__ */ r(
71
- j,
72
+ children: /* @__PURE__ */ e(
73
+ w,
72
74
  {
73
- className: a(
75
+ className: s(
74
76
  "size-icon-small text-icon-dark-primary-def transition-colors",
75
77
  {
76
- "text-text-dark-tertiary": e,
77
- "group-hover:text-icon-dark-primary-hover": !e
78
+ "text-text-dark-tertiary": r,
79
+ "group-hover:text-icon-dark-primary-hover": !r
78
80
  }
79
81
  )
80
82
  }
@@ -82,33 +84,33 @@ const E = ({
82
84
  }
83
85
  )
84
86
  ] }) : void 0;
85
- return /* @__PURE__ */ r(
87
+ return /* @__PURE__ */ e(
86
88
  "form",
87
89
  {
88
90
  ref: f,
89
91
  onSubmit: (t) => {
90
92
  t.preventDefault(), c.length > 0 && (i == null || i(t));
91
93
  },
92
- className: m,
93
- children: /* @__PURE__ */ r(
94
- I,
94
+ className: p,
95
+ children: /* @__PURE__ */ e(
96
+ M,
95
97
  {
96
98
  suffix: C,
97
99
  type: "text",
98
- size: "sm",
99
- error: p,
100
- disabled: e,
100
+ size: x,
101
+ error: h,
102
+ disabled: r,
101
103
  value: c,
102
- name: k,
104
+ name: v,
103
105
  onChange: N,
104
- placeholder: v,
106
+ placeholder: g,
105
107
  className: "group",
106
- ...g
108
+ ...B
107
109
  }
108
110
  )
109
111
  }
110
112
  );
111
113
  };
112
114
  export {
113
- E as Searchbar
115
+ F as Searchbar
114
116
  };
@@ -8,4 +8,5 @@ export declare const Filled: Story;
8
8
  export declare const Disabled: Story;
9
9
  export declare const Error: Story;
10
10
  export declare const NoIcons: Story;
11
+ export declare const AllSizes: Story;
11
12
  //# sourceMappingURL=Searchbar.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Searchbar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Searchbar/Searchbar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAwHhC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAA;AAEvC,eAAO,MAAM,OAAO,EAAE,KAmBrB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAmBpB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAoBtB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAoBnB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAoBrB,CAAA"}
1
+ {"version":3,"file":"Searchbar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Searchbar/Searchbar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAkIhC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,O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