@vkzstudio/muza-ui 1.0.1 → 1.0.3

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.
@@ -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,4CA0FhB,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;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,80 +1,80 @@
1
- import { jsxs as C, jsx as e } from "react/jsx-runtime";
2
- import * as c from "react";
3
- import { MagnifyingGlass as R } from "../Icons/CustomIcons.js";
1
+ import { jsxs as R, jsx as r } from "react/jsx-runtime";
2
+ import * as n from "react";
3
+ import { MagnifyingGlass as j } from "../Icons/CustomIcons.js";
4
4
  import { cn as a } from "../../utils/cn.js";
5
- import { CloseCircleBold as S } from "@solar-icons/react-perf";
6
- import { Input as j } from "../Input/Input.js";
5
+ import { CloseCircleBold as w } from "@solar-icons/react-perf";
6
+ import { Input as I } from "../Input/Input.js";
7
7
  const E = ({
8
- className: u,
9
- error: m = !1,
10
- showButtons: p = !0,
11
- clearButtonAriaLabel: x,
12
- searchButtonAriaLabel: d,
13
- disabled: t = !1,
8
+ className: m,
9
+ error: p = !1,
10
+ showButtons: x = !0,
11
+ clearButtonAriaLabel: d,
12
+ searchButtonAriaLabel: y,
13
+ disabled: e = !1,
14
14
  value: o,
15
- defaultValue: y,
16
- name: h,
17
- placeholder: k,
15
+ defaultValue: h,
16
+ name: k,
17
+ placeholder: v,
18
18
  onChange: s,
19
- onSubmit: v,
19
+ onSubmit: i,
20
20
  ...g
21
21
  }) => {
22
- const n = c.useRef(null), [l, i] = c.useState(
23
- o ?? y ?? ""
22
+ const f = n.useRef(null), [c, l] = n.useState(
23
+ o ?? h ?? ""
24
24
  );
25
- c.useEffect(() => {
26
- o !== void 0 && i(o);
25
+ n.useEffect(() => {
26
+ o !== void 0 && l(o);
27
27
  }, [o]);
28
- const N = (r) => {
29
- i(r.target.value), s && s(r);
30
- }, b = () => {
31
- var r, f;
32
- i(""), (f = (r = n.current) == null ? void 0 : r.querySelector("input")) == null || f.focus(), s && s({
28
+ const N = (t) => {
29
+ l(t.target.value), s && s(t);
30
+ }, z = () => {
31
+ var t, u;
32
+ l(""), (u = (t = f.current) == null ? void 0 : t.querySelector("input")) == null || u.focus(), s && s({
33
33
  target: { value: "" }
34
34
  });
35
- }, z = p ? /* @__PURE__ */ C("div", { className: "flex gap-sm", children: [
36
- /* @__PURE__ */ e(
35
+ }, C = x ? /* @__PURE__ */ R("div", { className: "flex gap-sm", children: [
36
+ /* @__PURE__ */ r(
37
37
  "button",
38
38
  {
39
39
  className: a(
40
40
  "flex shrink-0 cursor-pointer items-center focus-visible-default transition-opacity",
41
41
  {
42
- "opacity-0": !l,
43
- "cursor-not-allowed": t
42
+ "opacity-0": !c,
43
+ "cursor-not-allowed": e
44
44
  }
45
45
  ),
46
- "aria-label": x,
46
+ "aria-label": d,
47
47
  type: "button",
48
- onClick: b,
49
- children: /* @__PURE__ */ e(
50
- S,
48
+ onClick: z,
49
+ children: /* @__PURE__ */ r(
50
+ w,
51
51
  {
52
52
  className: a("size-icon-small text-icon-dark-secondary-def", {
53
- "text-text-dark-tertiary": t
53
+ "text-text-dark-tertiary": e
54
54
  })
55
55
  }
56
56
  )
57
57
  }
58
58
  ),
59
- /* @__PURE__ */ e(
59
+ /* @__PURE__ */ r(
60
60
  "button",
61
61
  {
62
62
  className: a(
63
63
  "flex shrink-0 cursor-pointer items-center focus-visible-default",
64
64
  {
65
- "cursor-not-allowed": t
65
+ "cursor-not-allowed": e
66
66
  }
67
67
  ),
68
- "aria-label": d,
68
+ "aria-label": y,
69
69
  type: "submit",
70
- children: /* @__PURE__ */ e(
71
- R,
70
+ children: /* @__PURE__ */ r(
71
+ j,
72
72
  {
73
73
  className: a(
74
74
  "size-icon-small text-icon-dark-primary-def transition-colors",
75
75
  {
76
- "text-text-dark-tertiary": t,
77
- "group-hover:text-icon-dark-primary-hover": !t
76
+ "text-text-dark-tertiary": e,
77
+ "group-hover:text-icon-dark-primary-hover": !e
78
78
  }
79
79
  )
80
80
  }
@@ -82,22 +82,32 @@ const E = ({
82
82
  }
83
83
  )
84
84
  ] }) : void 0;
85
- return /* @__PURE__ */ e("form", { ref: n, onSubmit: v, className: u, children: /* @__PURE__ */ e(
86
- j,
85
+ return /* @__PURE__ */ r(
86
+ "form",
87
87
  {
88
- suffix: z,
89
- type: "text",
90
- size: "sm",
91
- error: m,
92
- disabled: t,
93
- value: l,
94
- name: h,
95
- onChange: N,
96
- placeholder: k,
97
- className: "group",
98
- ...g
88
+ ref: f,
89
+ onSubmit: (t) => {
90
+ t.preventDefault(), c.length > 0 && (i == null || i(t));
91
+ },
92
+ className: m,
93
+ children: /* @__PURE__ */ r(
94
+ I,
95
+ {
96
+ suffix: C,
97
+ type: "text",
98
+ size: "sm",
99
+ error: p,
100
+ disabled: e,
101
+ value: c,
102
+ name: k,
103
+ onChange: N,
104
+ placeholder: v,
105
+ className: "group",
106
+ ...g
107
+ }
108
+ )
99
109
  }
100
- ) });
110
+ );
101
111
  };
102
112
  export {
103
113
  E as Searchbar
@@ -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,CAiEhC,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,CAiEhC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAA;AAEvC,eAAO,MAAM,OAAO,EAAE,KAkBrB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAkBpB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAmBtB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAmBnB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAmBrB,CAAA"}