alif-ui 1.14.3 → 1.15.0
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,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,
|
|
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
|
|
2
|
+
import { useState as g } from "react";
|
|
3
3
|
import { classNames as n } from "../../utils/class-names.js";
|
|
4
|
-
import { getRatingStyles as
|
|
4
|
+
import { getRatingStyles as j } from "./Rating.utils.js";
|
|
5
5
|
import { SolidSystemStar as a } from "../../icons/components/SolidSystemStar.js";
|
|
6
|
-
import { OutlineSystemStar as
|
|
7
|
-
const
|
|
8
|
-
root:
|
|
9
|
-
stars:
|
|
10
|
-
star:
|
|
11
|
-
filled:
|
|
12
|
-
},
|
|
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] =
|
|
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:
|
|
27
|
-
children: /* @__PURE__ */ e("div", { className: s.stars, children:
|
|
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: () =>
|
|
36
|
-
onMouseLeave:
|
|
37
|
-
children:
|
|
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
|
-
|
|
47
|
+
F as Rating
|
|
47
48
|
};
|
|
@@ -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;
|
|
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"}
|