alif-ui 1.14.3 → 1.15.1

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":"FileUploader.d.ts","sourceRoot":"","sources":["../../../src/lib/components/FileUploader/FileUploader.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAQzD,eAAO,MAAM,YAAY,gHAyKxB,CAAC"}
1
+ {"version":3,"file":"FileUploader.d.ts","sourceRoot":"","sources":["../../../src/lib/components/FileUploader/FileUploader.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAQzD,eAAO,MAAM,YAAY,gHA0KxB,CAAC"}
@@ -1,6 +1,6 @@
1
- import { jsx as l, jsxs as m, Fragment as q } from "react/jsx-runtime";
1
+ import { jsx as l, jsxs as u, Fragment as q } from "react/jsx-runtime";
2
2
  import { forwardRef as G, useState as F, useRef as J, useImperativeHandle as K } from "react";
3
- import { classNames as u } from "../../utils/class-names.js";
3
+ import { classNames as m } from "../../utils/class-names.js";
4
4
  import { isValidFileCount as Q, ERROR_TEXT as g, isValidFileSize as W, isValidFileType as Y } from "./FileUploader.utils.js";
5
5
  import { useLocale as Z } from "../../providers/hooks/useLocale/useLocale.js";
6
6
  import { OutlineSystemUploadCloud as $ } from "../../icons/components/OutlineSystemUploadCloud.js";
@@ -37,7 +37,7 @@ const te = "_root_1vel9_1", re = "_uploader_1vel9_27", oe = "_error_1vel9_38", l
37
37
  }, j) => {
38
38
  const { locale: c } = Z(), [w, d] = F(!1), [p, n] = F(""), f = J(null);
39
39
  K(j, () => f.current);
40
- const a = L === "mobile", x = E || p || S, A = u(
40
+ const a = L === "mobile", x = E || p || S, A = m(
41
41
  t.uploader,
42
42
  w && !o && t.dragOver,
43
43
  (R || p) && t.error,
@@ -49,7 +49,7 @@ const te = "_root_1vel9_1", re = "_uploader_1vel9_27", oe = "_error_1vel9_38", l
49
49
  if (e.preventDefault(), e.stopPropagation(), o) return;
50
50
  d(!1);
51
51
  const r = e.dataTransfer.files;
52
- r && D(r);
52
+ r && y(r);
53
53
  }, H = (e) => {
54
54
  e.preventDefault(), d(!0);
55
55
  }, P = () => {
@@ -57,26 +57,26 @@ const te = "_root_1vel9_1", re = "_uploader_1vel9_27", oe = "_error_1vel9_38", l
57
57
  }, X = (e) => {
58
58
  if (o) return;
59
59
  const r = e.target.files;
60
- r && (D(r), e.target.value = "");
61
- }, D = (e) => {
60
+ r && (y(r), e.target.value = "");
61
+ }, y = (e) => {
62
62
  const r = _.length + e.length;
63
63
  if (!Q(r, b)) {
64
64
  n(g.maxCountText[c](b));
65
65
  return;
66
66
  }
67
67
  const s = Array.from(e).filter((i) => {
68
- const T = W(i, h), y = Y(
68
+ const D = W(i, h), T = Y(
69
69
  i,
70
70
  M,
71
71
  z
72
72
  );
73
- return T || n(
73
+ return D || n(
74
74
  g.maxFileSizeText[c](i.name, h)
75
- ), y || n(g.extText[c](i.name)), T && y;
75
+ ), T || n(g.extText[c](i.name)), D && T;
76
76
  });
77
77
  s.length && U(s);
78
78
  };
79
- return /* @__PURE__ */ l("div", { className: u(t.root, I), style: { width: N }, children: /* @__PURE__ */ m(
79
+ return /* @__PURE__ */ l("div", { className: m(t.root, I), style: { width: N }, children: /* @__PURE__ */ u(
80
80
  "div",
81
81
  {
82
82
  className: a ? "" : A,
@@ -100,8 +100,8 @@ const te = "_root_1vel9_1", re = "_uploader_1vel9_27", oe = "_error_1vel9_38", l
100
100
  disabled: o
101
101
  }
102
102
  ),
103
- /* @__PURE__ */ m("div", { className: t.text, children: [
104
- !a && /* @__PURE__ */ m(q, { children: [
103
+ /* @__PURE__ */ u("div", { className: t.text, children: [
104
+ !a && /* @__PURE__ */ u(q, { children: [
105
105
  /* @__PURE__ */ l($, {}),
106
106
  /* @__PURE__ */ l(
107
107
  O,
@@ -118,7 +118,7 @@ const te = "_root_1vel9_1", re = "_uploader_1vel9_27", oe = "_error_1vel9_38", l
118
118
  {
119
119
  category: "body",
120
120
  proportions: "m",
121
- className: u(
121
+ className: m(
122
122
  t.labelDescription,
123
123
  p && t.error,
124
124
  o && t.disabled
@@ -133,6 +133,7 @@ const te = "_root_1vel9_1", re = "_uploader_1vel9_27", oe = "_error_1vel9_38", l
133
133
  variant: "outline",
134
134
  className: a ? t.btnMobile : "",
135
135
  disabled: o,
136
+ type: "button",
136
137
  children: k
137
138
  }
138
139
  )
@@ -1,3 +1,3 @@
1
1
  import { RatingProps } from './Rating.types';
2
- export declare const Rating: ({ size, variant, value, onChange, className, filledIcon, defaultIcon, }: RatingProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Rating: ({ size, variant, value, onChange, className, filledIcon, defaultIcon, max, }: RatingProps) => import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=Rating.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Rating.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Rating/Rating.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,eAAO,MAAM,MAAM,4EAQhB,WAAW,4CA4Cb,CAAC"}
1
+ {"version":3,"file":"Rating.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Rating/Rating.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,eAAO,MAAM,MAAM,iFAShB,WAAW,4CA4Cb,CAAC"}
@@ -1,30 +1,31 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { useState as y } from "react";
2
+ import { useState as g } from "react";
3
3
  import { classNames as n } from "../../utils/class-names.js";
4
- import { getRatingStyles as g } from "./Rating.utils.js";
4
+ import { getRatingStyles as j } from "./Rating.utils.js";
5
5
  import { SolidSystemStar as a } from "../../icons/components/SolidSystemStar.js";
6
- import { OutlineSystemStar as j } from "../../icons/components/OutlineSystemStar.js";
7
- const M = "_root_dej42_1", N = "_stars_dej42_23", x = "_star_dej42_23", E = "_filled_dej42_54", s = {
8
- root: M,
9
- stars: N,
10
- star: x,
11
- filled: E
12
- }, C = ({
6
+ import { OutlineSystemStar as M } from "../../icons/components/OutlineSystemStar.js";
7
+ const N = "_root_dej42_1", x = "_stars_dej42_23", E = "_star_dej42_23", L = "_filled_dej42_54", s = {
8
+ root: N,
9
+ stars: x,
10
+ star: E,
11
+ filled: L
12
+ }, F = ({
13
13
  size: i = "s",
14
14
  variant: d = "solid",
15
15
  value: c,
16
16
  onChange: m,
17
17
  className: u,
18
18
  filledIcon: _,
19
- defaultIcon: f
19
+ defaultIcon: f,
20
+ max: p = 5
20
21
  }) => {
21
- const [r, l] = y(null), p = Array.from({ length: 5 }, (t, o) => o + 1), S = (t) => l(t), h = () => l(null), v = (t) => t ? _ || /* @__PURE__ */ e(a, {}) : f || (d === "solid" ? /* @__PURE__ */ e(a, {}) : /* @__PURE__ */ e(j, {}));
22
+ const [r, l] = g(null), S = Array.from({ length: p }, (t, o) => o + 1), h = (t) => l(t), v = () => l(null), y = (t) => t ? _ || /* @__PURE__ */ e(a, {}) : f || (d === "solid" ? /* @__PURE__ */ e(a, {}) : /* @__PURE__ */ e(M, {}));
22
23
  return /* @__PURE__ */ e(
23
24
  "div",
24
25
  {
25
26
  className: n(s.root, u),
26
- style: g(i),
27
- children: /* @__PURE__ */ e("div", { className: s.stars, children: p.map((t) => {
27
+ style: j(i),
28
+ children: /* @__PURE__ */ e("div", { className: s.stars, children: S.map((t) => {
28
29
  const o = r !== null ? t <= r : t <= c;
29
30
  return /* @__PURE__ */ e(
30
31
  "div",
@@ -32,9 +33,9 @@ const M = "_root_dej42_1", N = "_stars_dej42_23", x = "_star_dej42_23", E = "_fi
32
33
  role: "button",
33
34
  className: n(s.star, o && s.filled),
34
35
  onClick: () => m(t),
35
- onMouseEnter: () => S(t),
36
- onMouseLeave: h,
37
- children: v(o)
36
+ onMouseEnter: () => h(t),
37
+ onMouseLeave: v,
38
+ children: y(o)
38
39
  },
39
40
  t
40
41
  );
@@ -43,5 +44,5 @@ const M = "_root_dej42_1", N = "_stars_dej42_23", x = "_star_dej42_23", E = "_fi
43
44
  );
44
45
  };
45
46
  export {
46
- C as Rating
47
+ F as Rating
47
48
  };
@@ -33,5 +33,9 @@ export interface RatingProps {
33
33
  * Custom icons for different states of the stars
34
34
  */
35
35
  defaultIcon?: ReactNode;
36
+ /**
37
+ * Custom maximum rating value. Default is 5.
38
+ */
39
+ max?: number;
36
40
  }
37
41
  //# sourceMappingURL=Rating.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Rating.types.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Rating/Rating.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAC1C,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAE1C,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;CACxB"}
1
+ {"version":3,"file":"Rating.types.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Rating/Rating.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAC1C,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAE1C,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACb"}
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "license": "ISC",
23
23
  "private": false,
24
- "version": "1.14.3",
24
+ "version": "1.15.1",
25
25
  "type": "module",
26
26
  "files": [
27
27
  "dist"