bonkers-ui 2.0.7 → 2.0.8
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.
- package/bonkers.css +329 -225
- package/components/UiInputRange/UiInputRange.js +45 -46
- package/components/UiInputRange/UiInputRange.js.map +1 -1
- package/components/UiSkeleton/UiSkeleton.js +130 -207
- package/components/UiSkeleton/UiSkeleton.js.map +1 -1
- package/components/UiSkeleton/index.d.ts +1 -0
- package/components/UiSkeleton/index.js +2 -0
- package/components/UiSkeleton/index.js.map +1 -1
- package/components/UiStars/UiStars.js +22 -22
- package/components/UiStars/UiStars.js.map +1 -1
- package/components/UiTabs/UiTabs.js +22 -17
- package/components/UiTabs/UiTabs.js.map +1 -1
- package/helper.d.ts +6 -14
- package/package.json +17 -24
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import
|
|
4
|
-
import { EStarColors as r, EStarsSize as
|
|
3
|
+
import C from "classnames";
|
|
4
|
+
import { EStarColors as r, EStarsSize as s } from "./_types.js";
|
|
5
5
|
const L = {
|
|
6
6
|
[r.DEFAULT]: "text-accent-alt-600",
|
|
7
7
|
[r.PRIMARY]: "text-primary",
|
|
@@ -9,33 +9,33 @@ const L = {
|
|
|
9
9
|
[r.BLACK]: "text-black",
|
|
10
10
|
[r.CURRENT]: "text-current"
|
|
11
11
|
}, x = {
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
},
|
|
16
|
-
starsFilled:
|
|
17
|
-
size:
|
|
12
|
+
[s.SM]: "w-sm h-sm",
|
|
13
|
+
[s.MD]: "w-md h-md",
|
|
14
|
+
[s.LG]: "w-lg h-lg"
|
|
15
|
+
}, u = ({
|
|
16
|
+
starsFilled: f = 0,
|
|
17
|
+
size: d = s.MD,
|
|
18
18
|
count: i = 5,
|
|
19
|
-
className:
|
|
20
|
-
color:
|
|
21
|
-
name:
|
|
19
|
+
className: h,
|
|
20
|
+
color: p = r.DEFAULT,
|
|
21
|
+
name: c = "stars"
|
|
22
22
|
}) => {
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */ t("div", { className:
|
|
23
|
+
const e = Math.min(Math.max(f, 0), i);
|
|
24
|
+
return /* @__PURE__ */ t("div", { className: C("flex", h), children: Array.from({
|
|
25
25
|
length: i
|
|
26
26
|
}, (M, l) => {
|
|
27
|
-
const
|
|
27
|
+
const n = l < Math.floor(e), o = !n && l === Math.floor(e);
|
|
28
28
|
let a = 0;
|
|
29
|
-
return o && (a =
|
|
29
|
+
return o && (a = e % 1 * 100), /* @__PURE__ */ t("div", { className: "relative", children: /* @__PURE__ */ m(
|
|
30
30
|
"svg",
|
|
31
31
|
{
|
|
32
|
-
className:
|
|
33
|
-
x[
|
|
34
|
-
L[
|
|
32
|
+
className: C(
|
|
33
|
+
x[d],
|
|
34
|
+
L[p]
|
|
35
35
|
),
|
|
36
36
|
viewBox: "0 0 25 23",
|
|
37
37
|
children: [
|
|
38
|
-
o && /* @__PURE__ */ t("defs", { children: /* @__PURE__ */
|
|
38
|
+
o && /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ m("linearGradient", { id: `${c}-star-fill-${l}`, x1: "0", x2: "1", y1: "0", y2: "0", children: [
|
|
39
39
|
/* @__PURE__ */ t("stop", { offset: `${a}%`, stopColor: "currentColor" }),
|
|
40
40
|
/* @__PURE__ */ t("stop", { offset: `${a}%`, stopColor: "transparent" })
|
|
41
41
|
] }) }),
|
|
@@ -43,7 +43,7 @@ const L = {
|
|
|
43
43
|
"path",
|
|
44
44
|
{
|
|
45
45
|
d: "M11.474 1.68128C11.8026 0.912241 12.8927 0.912241 13.2213 1.68128L15.5868 7.21835C15.7989 7.71478 16.2692 8.0523 16.8074 8.09431L22.8886 8.56895C23.738 8.63525 24.0774 9.69994 23.4231 10.2457L18.8377 14.0697C18.4124 14.4244 18.2263 14.9904 18.3581 15.5283L19.7672 21.2797C19.9677 22.0979 19.083 22.7529 18.3589 22.3223L13.0888 19.1884C12.632 18.9167 12.0633 18.9167 11.6065 19.1884L6.33637 22.3223C5.61231 22.7529 4.72763 22.0979 4.9281 21.2797L6.33724 15.5283C6.46904 14.9904 6.28291 14.4244 5.85758 14.0697L1.27223 10.2457C0.617879 9.69994 0.957297 8.63525 1.80676 8.56895L7.88795 8.09431C8.42615 8.0523 8.89645 7.71478 9.10853 7.21835L11.474 1.68128Z",
|
|
46
|
-
fill:
|
|
46
|
+
fill: n ? "currentColor" : o ? `url(#${c}-star-fill-${l})` : "transparent"
|
|
47
47
|
}
|
|
48
48
|
)
|
|
49
49
|
]
|
|
@@ -52,7 +52,7 @@ const L = {
|
|
|
52
52
|
}) });
|
|
53
53
|
};
|
|
54
54
|
export {
|
|
55
|
-
|
|
55
|
+
u as UiStars,
|
|
56
56
|
L as colorClasses
|
|
57
57
|
};
|
|
58
58
|
//# sourceMappingURL=UiStars.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiStars.js","sources":["../../../src/components/UiStars/UiStars.tsx"],"sourcesContent":["import React from \"react\";\nimport cx from \"classnames\";\nimport { EStarsSize, EStarColors } from \"./_types\";\n\nexport const colorClasses = {\n\t[EStarColors.DEFAULT]: \"text-accent-alt-600\",\n\t[EStarColors.PRIMARY]: \"text-primary\",\n\t[EStarColors.WHITE]: \"text-white\",\n\t[EStarColors.BLACK]: \"text-black\",\n\t[EStarColors.CURRENT]: \"text-current\",\n};\n\ninterface IUiStars {\n\tstarsFilled?: number\n\tsize?: EStarsSize\n\tcount?: number\n\tcolor?: EStarColors\n\tname?: string\n\tclassName?: string\n}\n\nconst sizeClasses = {\n\t[EStarsSize.SM]: \"w-sm h-sm\",\n\t[EStarsSize.MD]: \"w-md h-md\",\n\t[EStarsSize.LG]: \"w-lg h-lg\"\n};\n\nexport const UiStars = ({\n\tstarsFilled = 0,\n\tsize = EStarsSize.MD,\n\tcount = 5,\n\tclassName,\n\tcolor = EStarColors.DEFAULT,\n\tname = \"stars\"\n}: IUiStars) => {\n\tconst filledStars = Math.min(Math.max(starsFilled, 0), count);\n\n\treturn (\n\t\t<div className={ cx(\"flex\", className) }>\n\t\t\t{ Array.from({\n\t\t\t\tlength: count\n\t\t\t}, (_, index) => {\n\t\t\t\tconst isCompletelyFilled = index < Math.floor(filledStars);\n\t\t\t\tconst isPartiallyFilled = !isCompletelyFilled && index === Math.floor(filledStars);\n\n\t\t\t\tlet filledPercentage = 0;\n\n\t\t\t\tif (isPartiallyFilled) {\n\t\t\t\t\tconst decimal = filledStars % 1;\n\t\t\t\t\tfilledPercentage = decimal * 100;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<div key={ index } className=\"relative\">\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\tclassName={ cx(\n\t\t\t\t\t\t\t\tsizeClasses[size],\n\t\t\t\t\t\t\t\tcolorClasses[color]\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tviewBox=\"0 0 25 23\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ isPartiallyFilled && (\n\t\t\t\t\t\t\t\t<defs>\n\t\t\t\t\t\t\t\t\t<linearGradient id={ `${name}-star-fill-${index}` } x1=\"0\" x2=\"1\" y1=\"0\" y2=\"0\">\n\t\t\t\t\t\t\t\t\t\t<stop offset={ `${filledPercentage}%` } stopColor=\"currentColor\" />\n\t\t\t\t\t\t\t\t\t\t<stop offset={ `${filledPercentage}%` } stopColor=\"transparent\" />\n\t\t\t\t\t\t\t\t\t</linearGradient>\n\t\t\t\t\t\t\t\t</defs>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\td=\"M11.474 1.68128C11.8026 0.912241 12.8927 0.912241 13.2213 1.68128L15.5868 7.21835C15.7989 7.71478 16.2692 8.0523 16.8074 8.09431L22.8886 8.56895C23.738 8.63525 24.0774 9.69994 23.4231 10.2457L18.8377 14.0697C18.4124 14.4244 18.2263 14.9904 18.3581 15.5283L19.7672 21.2797C19.9677 22.0979 19.083 22.7529 18.3589 22.3223L13.0888 19.1884C12.632 18.9167 12.0633 18.9167 11.6065 19.1884L6.33637 22.3223C5.61231 22.7529 4.72763 22.0979 4.9281 21.2797L6.33724 15.5283C6.46904 14.9904 6.28291 14.4244 5.85758 14.0697L1.27223 10.2457C0.617879 9.69994 0.957297 8.63525 1.80676 8.56895L7.88795 8.09431C8.42615 8.0523 8.89645 7.71478 9.10853 7.21835L11.474 1.68128Z\"\n\t\t\t\t\t\t\t\tfill={ isCompletelyFilled\n\t\t\t\t\t\t\t\t\t? \"currentColor\"\n\t\t\t\t\t\t\t\t\t: (isPartiallyFilled\n\t\t\t\t\t\t\t\t\t\t? `url(
|
|
1
|
+
{"version":3,"file":"UiStars.js","sources":["../../../src/components/UiStars/UiStars.tsx"],"sourcesContent":["import React from \"react\";\nimport cx from \"classnames\";\nimport { EStarsSize, EStarColors } from \"./_types\";\n\nexport const colorClasses = {\n\t[EStarColors.DEFAULT]: \"text-accent-alt-600\",\n\t[EStarColors.PRIMARY]: \"text-primary\",\n\t[EStarColors.WHITE]: \"text-white\",\n\t[EStarColors.BLACK]: \"text-black\",\n\t[EStarColors.CURRENT]: \"text-current\",\n};\n\ninterface IUiStars {\n\tstarsFilled?: number\n\tsize?: EStarsSize\n\tcount?: number\n\tcolor?: EStarColors\n\tname?: string\n\tclassName?: string\n}\n\nconst sizeClasses = {\n\t[EStarsSize.SM]: \"w-sm h-sm\",\n\t[EStarsSize.MD]: \"w-md h-md\",\n\t[EStarsSize.LG]: \"w-lg h-lg\"\n};\n\nexport const UiStars = ({\n\tstarsFilled = 0,\n\tsize = EStarsSize.MD,\n\tcount = 5,\n\tclassName,\n\tcolor = EStarColors.DEFAULT,\n\tname = \"stars\"\n}: IUiStars) => {\n\tconst filledStars = Math.min(Math.max(starsFilled, 0), count);\n\n\treturn (\n\t\t<div className={ cx(\"flex\", className) }>\n\t\t\t{ Array.from({\n\t\t\t\tlength: count\n\t\t\t}, (_, index) => {\n\t\t\t\tconst isCompletelyFilled = index < Math.floor(filledStars);\n\t\t\t\tconst isPartiallyFilled = !isCompletelyFilled && index === Math.floor(filledStars);\n\n\t\t\t\tlet filledPercentage = 0;\n\n\t\t\t\tif (isPartiallyFilled) {\n\t\t\t\t\tconst decimal = filledStars % 1;\n\t\t\t\t\tfilledPercentage = decimal * 100;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<div key={ index } className=\"relative\">\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\tclassName={ cx(\n\t\t\t\t\t\t\t\tsizeClasses[size],\n\t\t\t\t\t\t\t\tcolorClasses[color]\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tviewBox=\"0 0 25 23\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ isPartiallyFilled && (\n\t\t\t\t\t\t\t\t<defs>\n\t\t\t\t\t\t\t\t\t<linearGradient id={ `${name}-star-fill-${index}` } x1=\"0\" x2=\"1\" y1=\"0\" y2=\"0\">\n\t\t\t\t\t\t\t\t\t\t<stop offset={ `${filledPercentage}%` } stopColor=\"currentColor\" />\n\t\t\t\t\t\t\t\t\t\t<stop offset={ `${filledPercentage}%` } stopColor=\"transparent\" />\n\t\t\t\t\t\t\t\t\t</linearGradient>\n\t\t\t\t\t\t\t\t</defs>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\td=\"M11.474 1.68128C11.8026 0.912241 12.8927 0.912241 13.2213 1.68128L15.5868 7.21835C15.7989 7.71478 16.2692 8.0523 16.8074 8.09431L22.8886 8.56895C23.738 8.63525 24.0774 9.69994 23.4231 10.2457L18.8377 14.0697C18.4124 14.4244 18.2263 14.9904 18.3581 15.5283L19.7672 21.2797C19.9677 22.0979 19.083 22.7529 18.3589 22.3223L13.0888 19.1884C12.632 18.9167 12.0633 18.9167 11.6065 19.1884L6.33637 22.3223C5.61231 22.7529 4.72763 22.0979 4.9281 21.2797L6.33724 15.5283C6.46904 14.9904 6.28291 14.4244 5.85758 14.0697L1.27223 10.2457C0.617879 9.69994 0.957297 8.63525 1.80676 8.56895L7.88795 8.09431C8.42615 8.0523 8.89645 7.71478 9.10853 7.21835L11.474 1.68128Z\"\n\t\t\t\t\t\t\t\tfill={ isCompletelyFilled\n\t\t\t\t\t\t\t\t\t? \"currentColor\"\n\t\t\t\t\t\t\t\t\t: (isPartiallyFilled\n\t\t\t\t\t\t\t\t\t\t? `url(#${name}-star-fill-${index})`\n\t\t\t\t\t\t\t\t\t\t: \"transparent\") }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t}) }\n\t\t</div>\n\t);\n};\n"],"names":["colorClasses","EStarColors","sizeClasses","EStarsSize","UiStars","starsFilled","size","count","className","color","name","filledStars","jsx","cx","_","index","isCompletelyFilled","isPartiallyFilled","filledPercentage","jsxs"],"mappings":";;;;AAIO,MAAMA,IAAe;AAAA,EAC3B,CAACC,EAAY,OAAO,GAAG;AAAA,EACvB,CAACA,EAAY,OAAO,GAAG;AAAA,EACvB,CAACA,EAAY,KAAK,GAAG;AAAA,EACrB,CAACA,EAAY,KAAK,GAAG;AAAA,EACrB,CAACA,EAAY,OAAO,GAAG;AACxB,GAWMC,IAAc;AAAA,EACnB,CAACC,EAAW,EAAE,GAAG;AAAA,EACjB,CAACA,EAAW,EAAE,GAAG;AAAA,EACjB,CAACA,EAAW,EAAE,GAAG;AAClB,GAEaC,IAAU,CAAC;AAAA,EACvB,aAAAC,IAAc;AAAA,EACd,MAAAC,IAAOH,EAAW;AAAA,EAClB,OAAAI,IAAQ;AAAA,EACR,WAAAC;AAAA,EACA,OAAAC,IAAQR,EAAY;AAAA,EACpB,MAAAS,IAAO;AACR,MAAgB;AACT,QAAAC,IAAc,KAAK,IAAI,KAAK,IAAIN,GAAa,CAAC,GAAGE,CAAK;AAG3D,SAAA,gBAAAK,EAAC,SAAI,WAAYC,EAAG,QAAQL,CAAS,GAClC,gBAAM,KAAK;AAAA,IACZ,QAAQD;AAAA,EAAA,GACN,CAACO,GAAGC,MAAU;AAChB,UAAMC,IAAqBD,IAAQ,KAAK,MAAMJ,CAAW,GACnDM,IAAoB,CAACD,KAAsBD,MAAU,KAAK,MAAMJ,CAAW;AAEjF,QAAIO,IAAmB;AAEvB,WAAID,MAEHC,IADgBP,IAAc,IACD,MAI7B,gBAAAC,EAAC,OAAkB,EAAA,WAAU,YAC5B,UAAA,gBAAAO;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,WAAYN;AAAA,UACXX,EAAYI,CAAI;AAAA,UAChBN,EAAaS,CAAK;AAAA,QACnB;AAAA,QACA,SAAQ;AAAA,QAEN,UAAA;AAAA,UAAAQ,uBACA,QACA,EAAA,UAAA,gBAAAE,EAAC,kBAAe,EAAA,IAAK,GAAGT,CAAI,cAAcK,CAAK,IAAK,IAAG,KAAI,IAAG,KAAI,IAAG,KAAI,IAAG,KAC3E,UAAA;AAAA,YAAA,gBAAAH,EAAC,UAAK,QAAS,GAAGM,CAAgB,KAAM,WAAU,gBAAe;AAAA,8BAChE,QAAK,EAAA,QAAS,GAAGA,CAAgB,KAAM,WAAU,cAAc,CAAA;AAAA,UAAA,EAAA,CACjE,EACD,CAAA;AAAA,UAED,gBAAAN;AAAA,YAAC;AAAA,YAAA;AAAA,cACA,GAAE;AAAA,cACF,MAAOI,IACJ,iBACCC,IACA,QAAQP,CAAI,cAAcK,CAAK,MAC/B;AAAA,YAAA;AAAA,UAAA;AAAA,QACL;AAAA,MAAA;AAAA,SAvBSA,CAyBX;AAAA,EAED,CAAA,GACF;AAEF;"}
|
|
@@ -1,35 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as s, jsxs as o } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import r from "classnames";
|
|
4
|
-
const
|
|
5
|
-
tabs:
|
|
6
|
-
tabsModel:
|
|
7
|
-
onTabChange:
|
|
8
|
-
className:
|
|
9
|
-
}) => /* @__PURE__ */
|
|
4
|
+
const m = ({
|
|
5
|
+
tabs: c,
|
|
6
|
+
tabsModel: t,
|
|
7
|
+
onTabChange: l,
|
|
8
|
+
className: n
|
|
9
|
+
}) => /* @__PURE__ */ s("ul", { className: r(
|
|
10
10
|
"ui-tabs",
|
|
11
11
|
"grid",
|
|
12
12
|
"grid-flow-col",
|
|
13
|
+
"items-stretch",
|
|
13
14
|
"rounded-full",
|
|
14
15
|
"bg-secondary-alt-200",
|
|
15
16
|
"p-[2px]",
|
|
16
17
|
"text-secondary-400",
|
|
17
|
-
|
|
18
|
-
), children:
|
|
18
|
+
n
|
|
19
|
+
), children: c.map((e) => /* @__PURE__ */ s(
|
|
19
20
|
"li",
|
|
20
21
|
{
|
|
21
22
|
className: r(
|
|
23
|
+
"flex",
|
|
24
|
+
"items-center",
|
|
25
|
+
"justify-center",
|
|
22
26
|
"rounded-full",
|
|
23
27
|
"text-center",
|
|
24
|
-
|
|
28
|
+
t === e && "bg-white border border-secondary-alt-600 text-secondary-500"
|
|
25
29
|
),
|
|
26
|
-
children: /* @__PURE__ */
|
|
27
|
-
"
|
|
30
|
+
children: /* @__PURE__ */ o("label", { className: r(
|
|
31
|
+
"flex",
|
|
32
|
+
"items-center",
|
|
28
33
|
"cursor-pointer",
|
|
29
34
|
"px-md",
|
|
30
35
|
"py-xxs"
|
|
31
36
|
), children: [
|
|
32
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ s(
|
|
33
38
|
"input",
|
|
34
39
|
{
|
|
35
40
|
className: r(
|
|
@@ -38,11 +43,11 @@ const p = ({
|
|
|
38
43
|
),
|
|
39
44
|
type: "radio",
|
|
40
45
|
value: e,
|
|
41
|
-
checked:
|
|
42
|
-
onChange: () =>
|
|
46
|
+
checked: t === e,
|
|
47
|
+
onChange: () => l(e)
|
|
43
48
|
}
|
|
44
49
|
),
|
|
45
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ s("span", { className: r(
|
|
46
51
|
"font-bold",
|
|
47
52
|
"text-xs"
|
|
48
53
|
), children: e })
|
|
@@ -51,6 +56,6 @@ const p = ({
|
|
|
51
56
|
e
|
|
52
57
|
)) });
|
|
53
58
|
export {
|
|
54
|
-
|
|
59
|
+
m as UiTabs
|
|
55
60
|
};
|
|
56
61
|
//# sourceMappingURL=UiTabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiTabs.js","sources":["../../../src/components/UiTabs/UiTabs.tsx"],"sourcesContent":["import React from \"react\";\nimport cx from \"classnames\";\n\ntype UiTabsProps = {\n\ttabs: string[]\n\ttabsModel: string,\n\tclassName: string\n\tonTabChange: (val: string) => void\n}\n\nexport const UiTabs: React.FC<UiTabsProps> = ({\n\ttabs,\n\ttabsModel,\n\tonTabChange,\n\tclassName\n}) => {\n\n\treturn (\n\t\t<ul className={ cx(\n\t\t\t\"ui-tabs\",\n\t\t\t\"grid\",\n\t\t\t\"grid-flow-col\",\n\t\t\t\"rounded-full\",\n\t\t\t\"bg-secondary-alt-200\",\n\t\t\t\"p-[2px]\",\n\t\t\t\"text-secondary-400\",\n\t\t\tclassName\n\t\t) }>\n\t\t\t{ tabs.map((tab) => (\n\t\t\t\t<li\n\t\t\t\t\tkey={ tab }\n\t\t\t\t\tclassName={ cx(\n\t\t\t\t\t\t\"rounded-full\",\n\t\t\t\t\t\t\"text-center\",\n\t\t\t\t\t\ttabsModel === tab && \"bg-white border border-secondary-alt-600 text-secondary-500\",\n\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<label className={ cx(\n\t\t\t\t\t\t\"
|
|
1
|
+
{"version":3,"file":"UiTabs.js","sources":["../../../src/components/UiTabs/UiTabs.tsx"],"sourcesContent":["import React from \"react\";\nimport cx from \"classnames\";\n\ntype UiTabsProps = {\n\ttabs: string[]\n\ttabsModel: string,\n\tclassName: string\n\tonTabChange: (val: string) => void\n}\n\nexport const UiTabs: React.FC<UiTabsProps> = ({\n\ttabs,\n\ttabsModel,\n\tonTabChange,\n\tclassName\n}) => {\n\n\treturn (\n\t\t<ul className={ cx(\n\t\t\t\"ui-tabs\",\n\t\t\t\"grid\",\n\t\t\t\"grid-flow-col\",\n\t\t\t\"items-stretch\",\n\t\t\t\"rounded-full\",\n\t\t\t\"bg-secondary-alt-200\",\n\t\t\t\"p-[2px]\",\n\t\t\t\"text-secondary-400\",\n\t\t\tclassName\n\t\t) }>\n\t\t\t{ tabs.map((tab) => (\n\t\t\t\t<li\n\t\t\t\t\tkey={ tab }\n\t\t\t\t\tclassName={ cx(\n\t\t\t\t\t\t\"flex\",\n\t\t\t\t\t\t\"items-center\",\n\t\t\t\t\t\t\"justify-center\",\n\t\t\t\t\t\t\"rounded-full\",\n\t\t\t\t\t\t\"text-center\",\n\t\t\t\t\t\ttabsModel === tab && \"bg-white border border-secondary-alt-600 text-secondary-500\",\n\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<label className={ cx(\n\t\t\t\t\t\t\"flex\",\n\t\t\t\t\t\t\"items-center\",\n\t\t\t\t\t\t\"cursor-pointer\",\n\t\t\t\t\t\t\"px-md\",\n\t\t\t\t\t\t\"py-xxs\"\n\t\t\t\t\t) }>\n\t\t\t\t\t\t<input className={ cx(\n\t\t\t\t\t\t\t\"absolute\",\n\t\t\t\t\t\t\t\"appearance-none\"\n\t\t\t\t\t\t) }\n\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\tvalue={ tab }\n\t\t\t\t\t\tchecked={ tabsModel === tab }\n\t\t\t\t\t\tonChange={ ()=> onTabChange(tab) }>\n\t\t\t\t\t\t</input>\n\n\t\t\t\t\t\t<span className={ cx(\n\t\t\t\t\t\t\t\"font-bold\",\n\t\t\t\t\t\t\t\"text-xs\"\n\t\t\t\t\t\t) }>\n\t\t\t\t\t\t\t{ tab }\n\t\t\t\t\t\t</span>\n\n\t\t\t\t\t</label>\n\n\t\t\t\t</li>\n\t\t\t)) }\n\t\t</ul>\n\t);\n};\n"],"names":["UiTabs","tabs","tabsModel","onTabChange","className","jsx","cx","tab","jsxs"],"mappings":";;;AAUO,MAAMA,IAAgC,CAAC;AAAA,EAC7C,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AACD,MAGE,gBAAAC,EAAC,QAAG,WAAYC;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACAF;AAEE,GAAA,UAAAH,EAAK,IAAI,CAACM,MACX,gBAAAF;AAAA,EAAC;AAAA,EAAA;AAAA,IAEA,WAAYC;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACAJ,MAAcK,KAAO;AAAA,IAEtB;AAAA,IAEA,UAAA,gBAAAC,EAAC,WAAM,WAAYF;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAEA,GAAA,UAAA;AAAA,MAAA,gBAAAD;AAAA,QAAC;AAAA,QAAA;AAAA,UAAM,WAAYC;AAAA,YAClB;AAAA,YACA;AAAA,UACD;AAAA,UACA,MAAK;AAAA,UACL,OAAQC;AAAA,UACR,SAAUL,MAAcK;AAAA,UACxB,UAAW,MAAKJ,EAAYI,CAAG;AAAA,QAAA;AAAA,MAC/B;AAAA,MAEA,gBAAAF,EAAC,UAAK,WAAYC;AAAA,QACjB;AAAA,QACA;AAAA,MAAA,GAEE,UACHC,EAAA,CAAA;AAAA,IAAA,EAED,CAAA;AAAA,EAAA;AAAA,EAnCMA;AAsCP,CAAA,GACF;"}
|
package/helper.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type TToken = {
|
|
2
2
|
name: string;
|
|
3
3
|
value: string;
|
|
4
4
|
};
|
|
@@ -15,18 +15,10 @@ export declare const getBaseVariables: () => {
|
|
|
15
15
|
name: string;
|
|
16
16
|
value: string;
|
|
17
17
|
}[];
|
|
18
|
-
export declare const getThemeTokens: () => {
|
|
19
|
-
fontSizes:
|
|
20
|
-
|
|
21
|
-
value: string;
|
|
22
|
-
}[];
|
|
23
|
-
spacings: {
|
|
24
|
-
name: string;
|
|
25
|
-
value: string;
|
|
26
|
-
}[];
|
|
18
|
+
export declare const getThemeTokens: (variables: TToken[]) => {
|
|
19
|
+
fontSizes: TToken[];
|
|
20
|
+
spacings: TToken[];
|
|
27
21
|
groupedColors: TGroupedColor[];
|
|
28
|
-
baseColors:
|
|
29
|
-
name: string;
|
|
30
|
-
value: string;
|
|
31
|
-
}[];
|
|
22
|
+
baseColors: TToken[];
|
|
32
23
|
};
|
|
24
|
+
export declare function getCSSVariables(): TToken[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bonkers-ui",
|
|
3
|
-
"version": "v2.0.
|
|
3
|
+
"version": "v2.0.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Bonkers ui library",
|
|
6
6
|
"author": "cc6.magister@gmail.com",
|
|
@@ -18,43 +18,36 @@
|
|
|
18
18
|
"prepare": "husky"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@tailwindcss/vite": "^4.1.
|
|
21
|
+
"@tailwindcss/vite": "^4.1.10",
|
|
22
22
|
"ajv": "^8.17.1",
|
|
23
23
|
"classnames": "^2.5.1",
|
|
24
|
-
"postcss": "^8.5.
|
|
24
|
+
"postcss": "^8.5.6",
|
|
25
25
|
"prettier": "^3.5.3",
|
|
26
26
|
"react": "^19.1.0",
|
|
27
27
|
"react-dom": "^19.1.0",
|
|
28
|
-
"tailwindcss": "^4.1.
|
|
28
|
+
"tailwindcss": "^4.1.10",
|
|
29
29
|
"vite-tsconfig-paths": "^5.1.4"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@chromatic-com/storybook": "^
|
|
33
|
-
"@storybook/addon-
|
|
34
|
-
"@storybook/addon-
|
|
35
|
-
"@storybook/
|
|
36
|
-
"@
|
|
37
|
-
"@storybook/manager-api": "^8.6.14",
|
|
38
|
-
"@storybook/preview-api": "^8.6.14",
|
|
39
|
-
"@storybook/react": "^8.6.14",
|
|
40
|
-
"@storybook/react-vite": "^8.6.14",
|
|
41
|
-
"@storybook/test": "^8.6.14",
|
|
42
|
-
"@stylistic/eslint-plugin": "^4.2.0",
|
|
32
|
+
"@chromatic-com/storybook": "^4.0.0",
|
|
33
|
+
"@storybook/addon-docs": "^9.0.12",
|
|
34
|
+
"@storybook/addon-onboarding": "^9.0.12",
|
|
35
|
+
"@storybook/react-vite": "^9.0.12",
|
|
36
|
+
"@stylistic/eslint-plugin": "^4.4.1",
|
|
43
37
|
"@types/bun": "latest",
|
|
44
|
-
"@types/react": "^19.1.
|
|
45
|
-
"@types/react-dom": "^19.1.
|
|
46
|
-
"@vitejs/plugin-react": "^4.
|
|
47
|
-
"eslint": "^9.
|
|
38
|
+
"@types/react": "^19.1.8",
|
|
39
|
+
"@types/react-dom": "^19.1.6",
|
|
40
|
+
"@vitejs/plugin-react": "^4.5.2",
|
|
41
|
+
"eslint": "^9.29.0",
|
|
48
42
|
"eslint-plugin-react": "^7.37.5",
|
|
49
|
-
"eslint-plugin-storybook": "^0.12
|
|
43
|
+
"eslint-plugin-storybook": "^9.0.12",
|
|
50
44
|
"eslint-plugin-tailwindcss": "^3.18.0",
|
|
51
45
|
"gh-pages": "^6.3.0",
|
|
52
46
|
"husky": "^9.1.7",
|
|
53
|
-
"lint-staged": "^16.
|
|
54
|
-
"storybook": "^
|
|
55
|
-
"storybook-dark-mode": "^4.0.2",
|
|
47
|
+
"lint-staged": "^16.1.2",
|
|
48
|
+
"storybook": "^9.0.12",
|
|
56
49
|
"typescript": "^5.8.3",
|
|
57
|
-
"typescript-eslint": "^8.
|
|
50
|
+
"typescript-eslint": "^8.34.1",
|
|
58
51
|
"vite": "^6.3.5",
|
|
59
52
|
"vite-plugin-dts": "^4.5.4",
|
|
60
53
|
"vite-plugin-lib-inject-css": "^2.2.2"
|