bonkers-ui 2.0.2 → 2.0.4
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/README.md +25 -40
- package/_types/colors.d.ts +2 -0
- package/_types/colors.js +1 -1
- package/_types/colors.js.map +1 -1
- package/assets/UiBerRank.css +1 -0
- package/assets/UiButton.css +0 -0
- package/assets/UiCheckbox.css +1 -0
- package/assets/UiInputRange.css +1 -0
- package/assets/UiRadio.css +1 -0
- package/assets/UiSelect.css +1 -0
- package/assets/UiToggle.css +1 -0
- package/bonkers.css +243 -0
- package/components/UiAccordion/UiAccordion.InfoDropdown.js +31 -0
- package/components/UiAccordion/UiAccordion.InfoDropdown.js.map +1 -0
- package/components/UiAccordion/UiAccordion.base.js +13 -0
- package/components/UiAccordion/UiAccordion.base.js.map +1 -0
- package/components/UiAccordion/UiAccordion.context.js +39 -0
- package/components/UiAccordion/UiAccordion.context.js.map +1 -0
- package/components/UiAccordion/UiAccordionItem.base.js +43 -0
- package/components/UiAccordion/UiAccordionItem.base.js.map +1 -0
- package/components/UiAccordion/_types.js +5 -0
- package/components/UiAccordion/_types.js.map +1 -0
- package/components/UiAccordion/index.d.ts +1 -0
- package/components/UiAccordion/index.js +13 -0
- package/{index.js.map → components/UiAccordion/index.js.map} +1 -1
- package/components/UiAlert/UiAlert.d.ts +1 -0
- package/components/UiAlert/UiAlert.js +12 -10
- package/components/UiAlert/UiAlert.js.map +1 -1
- package/components/UiBerRank/UiBerRank.d.ts +1 -0
- package/components/UiBerRank/UiBerRank.js +35 -31
- package/components/UiBerRank/UiBerRank.js.map +1 -1
- package/components/UiBerRank/_types.js +6 -5
- package/components/UiBerRank/_types.js.map +1 -1
- package/components/UiButton/UiButton.d.ts +1 -0
- package/components/UiButton/UiButton.js +260 -103
- package/components/UiButton/UiButton.js.map +1 -1
- package/components/UiButton/_types.d.ts +15 -9
- package/components/UiButton/_types.js +1 -1
- package/components/UiButton/_types.js.map +1 -1
- package/components/UiCheckbox/UiCheckbox.d.ts +1 -0
- package/components/UiCheckbox/UiCheckbox.js +48 -42
- package/components/UiCheckbox/UiCheckbox.js.map +1 -1
- package/components/UiCheckbox/index.d.ts +1 -0
- package/components/UiCheckbox/index.js +4 -2
- package/components/UiCheckbox/index.js.map +1 -1
- package/components/UiIcon/UiIcon.d.ts +1 -0
- package/components/UiIcon/UiIcon.js +10 -9
- package/components/UiIcon/UiIcon.js.map +1 -1
- package/components/UiIconBadge/UiIconBadge.d.ts +3 -0
- package/components/UiIconBadge/UiIconBadge.js +35 -0
- package/components/UiIconBadge/UiIconBadge.js.map +1 -0
- package/components/UiIconBadge/_types.d.ts +15 -0
- package/components/UiIconBadge/_types.js +5 -0
- package/components/UiIconBadge/_types.js.map +1 -0
- package/components/UiIconBadge/index.d.ts +2 -0
- package/components/UiIconBadge/index.js +7 -0
- package/components/UiIconBadge/index.js.map +1 -0
- package/components/UiInput/UiInput.base.d.ts +1 -0
- package/components/UiInput/UiInput.base.js +13 -12
- package/components/UiInput/UiInput.base.js.map +1 -1
- package/components/UiInputRange/UiInputRange.d.ts +1 -0
- package/components/UiInputRange/UiInputRange.js +31 -28
- package/components/UiInputRange/UiInputRange.js.map +1 -1
- package/components/UiList/UiList.d.ts +3 -1
- package/components/UiList/UiList.js +23 -18
- package/components/UiList/UiList.js.map +1 -1
- package/components/UiList/UiListItem.d.ts +1 -0
- package/components/UiList/UiListItem.js +6 -5
- package/components/UiList/UiListItem.js.map +1 -1
- package/components/UiList/_types.d.ts +4 -0
- package/components/UiList/_types.js +4 -3
- package/components/UiList/_types.js.map +1 -1
- package/components/UiNotificationBadge/UiNotificationBadge.d.ts +6 -5
- package/components/UiNotificationBadge/UiNotificationBadge.js +48 -83
- package/components/UiNotificationBadge/UiNotificationBadge.js.map +1 -1
- package/components/UiNotificationBadge/_types.d.ts +8 -0
- package/components/UiNotificationBadge/_types.js +4 -2
- package/components/UiNotificationBadge/_types.js.map +1 -1
- package/components/UiPills/UiPills.d.ts +1 -0
- package/components/UiPills/UiPills.js +16 -14
- package/components/UiPills/UiPills.js.map +1 -1
- package/components/UiPlainRadio/UiPlainRadio.d.ts +1 -0
- package/components/UiPlainRadio/UiPlainRadio.js +66 -51
- package/components/UiPlainRadio/UiPlainRadio.js.map +1 -1
- package/components/UiProductCard/UiProductCard.d.ts +1 -0
- package/components/UiProductCard/UiProductCard.js +24 -27
- package/components/UiProductCard/UiProductCard.js.map +1 -1
- package/components/UiProgress/UiProgress.d.ts +1 -0
- package/components/UiProgress/UiProgress.js +17 -15
- package/components/UiProgress/UiProgress.js.map +1 -1
- package/components/UiRadio/UiRadio.js +19 -13
- package/components/UiRadio/UiRadio.js.map +1 -1
- package/components/UiRadioFancy/UiRadioFancy.d.ts +9 -4
- package/components/UiRadioFancy/UiRadioFancy.js +41 -29
- package/components/UiRadioFancy/UiRadioFancy.js.map +1 -1
- package/components/UiRadioFancy/_types.d.ts +1 -1
- package/components/UiRadioFancy/_types.js +2 -2
- package/components/UiRadioFancy/_types.js.map +1 -1
- package/components/UiSelect/UiSelect.d.ts +1 -0
- package/components/UiSelect/UiSelect.js +99 -0
- package/components/UiSelect/UiSelect.js.map +1 -0
- package/components/UiSelect/index.js +5 -0
- package/components/UiSelect/index.js.map +1 -0
- package/components/UiSkeleton/UiSkeleton.d.ts +1 -0
- package/components/UiSkeleton/UiSkeleton.js +42 -41
- package/components/UiSkeleton/UiSkeleton.js.map +1 -1
- package/components/UiSnackbar/UiSnackbar.d.ts +10 -0
- package/components/UiSnackbar/UiSnackbar.js +67 -0
- package/components/UiSnackbar/UiSnackbar.js.map +1 -0
- package/components/UiSnackbar/_types.d.ts +7 -0
- package/components/UiSnackbar/_types.js +5 -0
- package/components/UiSnackbar/_types.js.map +1 -0
- package/components/UiSnackbar/index.d.ts +1 -0
- package/components/UiSnackbar/index.js +5 -0
- package/components/UiSnackbar/index.js.map +1 -0
- package/components/UiStars/UiStars.d.ts +18 -0
- package/components/UiStars/UiStars.js +57 -0
- package/components/UiStars/UiStars.js.map +1 -0
- package/components/UiStars/_types.d.ts +12 -0
- package/components/UiStars/_types.js +6 -0
- package/components/UiStars/_types.js.map +1 -0
- package/components/UiStars/index.d.ts +3 -0
- package/components/UiStars/index.js +7 -0
- package/components/UiStars/index.js.map +1 -0
- package/components/UiTable/UiTable.js +10 -9
- package/components/UiTable/UiTable.js.map +1 -1
- package/components/UiTable/UiTableCell.js +13 -12
- package/components/UiTable/UiTableCell.js.map +1 -1
- package/components/UiTable/UiTableRow.js +10 -9
- package/components/UiTable/UiTableRow.js.map +1 -1
- package/components/UiTabs/UiTabs.d.ts +1 -0
- package/components/UiTabs/UiTabs.js +21 -18
- package/components/UiTabs/UiTabs.js.map +1 -1
- package/components/UiToggle/UiToggle.d.ts +7 -4
- package/components/UiToggle/UiToggle.js +117 -91
- package/components/UiToggle/UiToggle.js.map +1 -1
- package/components/UiTypography/UiTypography.js +12 -10
- package/components/UiTypography/UiTypography.js.map +1 -1
- package/eslint.config.mjs +4 -3
- package/helper.d.ts +31 -0
- package/index.d.ts +24 -20
- package/package.json +43 -42
- package/stories/Colors/Colors.d.ts +2 -0
- package/stories/FontSizes/FontSizes.d.ts +2 -0
- package/stories/Spacings/Spacings.d.ts +2 -0
- package/bonkers-ui.css +0 -1
- package/bonkers-ui.umd.js +0 -103
- package/bonkers-ui.umd.js.map +0 -1
- package/components/UiBerRank/UiBerRank.module.css.js +0 -10
- package/components/UiBerRank/UiBerRank.module.css.js.map +0 -1
- package/components/UiButton/UiButton.module.css.js +0 -8
- package/components/UiButton/UiButton.module.css.js.map +0 -1
- package/components/UiCheckbox/UiCheckbox.module.css.js +0 -15
- package/components/UiCheckbox/UiCheckbox.module.css.js.map +0 -1
- package/components/UiInputRange/UiInputRange.module.css.js +0 -8
- package/components/UiInputRange/UiInputRange.module.css.js.map +0 -1
- package/components/UiRadio/UiRadio.module.css.js +0 -10
- package/components/UiRadio/UiRadio.module.css.js.map +0 -1
- package/index.js +0 -43
- package/plugin.ts +0 -160
- package/postcss.config.mjs +0 -9
- package/src/_styles/_backdropBlur.json +0 -10
- package/src/_styles/_colors.json +0 -81
- package/src/_styles/_fontSizes.json +0 -12
- package/src/_styles/_shadow.json +0 -8
- package/src/_styles/_spacing.json +0 -16
- package/tailwind.config.ts +0 -15
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { ERowKind as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
3
|
+
import { ERowKind as d } from "./_types.js";
|
|
4
|
+
import f from "classnames";
|
|
5
|
+
const a = ({ kind: t, children: r, className: o, ...e }) => /* @__PURE__ */ s(
|
|
6
6
|
"tr",
|
|
7
7
|
{
|
|
8
|
-
className:
|
|
8
|
+
className: f(
|
|
9
9
|
"text-center",
|
|
10
10
|
"[&>td:last-of-type]:rounded-r-xxs",
|
|
11
11
|
"[&>td:last-of-type]:text-right",
|
|
12
12
|
"[&>td:first-of-type]:text-left",
|
|
13
13
|
"[&>td:first-of-type]:rounded-l-xxs",
|
|
14
14
|
{
|
|
15
|
-
"bg-secondary-alt-200": t ===
|
|
16
|
-
}
|
|
15
|
+
"bg-secondary-alt-200": t === d.SECONDARY
|
|
16
|
+
},
|
|
17
|
+
o
|
|
17
18
|
),
|
|
18
|
-
...
|
|
19
|
+
...e,
|
|
19
20
|
children: r
|
|
20
21
|
}
|
|
21
22
|
);
|
|
22
23
|
export {
|
|
23
|
-
|
|
24
|
+
a as UiTableRow
|
|
24
25
|
};
|
|
25
26
|
//# sourceMappingURL=UiTableRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiTableRow.js","sources":["../../../src/components/UiTable/UiTableRow.tsx"],"sourcesContent":["import React from \"react\";\nimport { ERowKind } from \"./_types\";\nimport cn from \"classnames\";\n\ntype TRowProps = {\n\tkind?: ERowKind;\n} & React.HTMLAttributes<HTMLTableRowElement>;\n\nexport const UiTableRow: React.FC<TRowProps> = ({ kind, children, ...rest }) => {\n\treturn (\n\t\t<tr\n\t\t\tclassName={ cn(\n\t\t\t\t\"text-center\",\n\t\t\t\t\"[&>td:last-of-type]:rounded-r-xxs\",\n\t\t\t\t\"[&>td:last-of-type]:text-right\",\n\t\t\t\t\"[&>td:first-of-type]:text-left\",\n\t\t\t\t\"[&>td:first-of-type]:rounded-l-xxs\",\n\t\t\t\t{\n\t\t\t\t\t\"bg-secondary-alt-200\": kind === ERowKind.SECONDARY\n\t\t\t\t}\n\t\t\t)\n\t\t\t}\n\t\t\t{ ...rest }\n\t\t>\n\t\t\t{ children }\n\t\t</tr>\n\t);\n};\n"],"names":["UiTableRow","kind","children","rest","jsx","cn","ERowKind"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"UiTableRow.js","sources":["../../../src/components/UiTable/UiTableRow.tsx"],"sourcesContent":["import React from \"react\";\nimport { ERowKind } from \"./_types\";\nimport cn from \"classnames\";\n\ntype TRowProps = {\n\tkind?: ERowKind;\n} & React.HTMLAttributes<HTMLTableRowElement>;\n\nexport const UiTableRow: React.FC<TRowProps> = ({ kind, children, className, ...rest }) => {\n\treturn (\n\t\t<tr\n\t\t\tclassName={ cn(\n\t\t\t\t\"text-center\",\n\t\t\t\t\"[&>td:last-of-type]:rounded-r-xxs\",\n\t\t\t\t\"[&>td:last-of-type]:text-right\",\n\t\t\t\t\"[&>td:first-of-type]:text-left\",\n\t\t\t\t\"[&>td:first-of-type]:rounded-l-xxs\",\n\t\t\t\t{\n\t\t\t\t\t\"bg-secondary-alt-200\": kind === ERowKind.SECONDARY\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t)\n\t\t\t}\n\t\t\t{ ...rest }\n\t\t>\n\t\t\t{ children }\n\t\t</tr>\n\t);\n};\n"],"names":["UiTableRow","kind","children","className","rest","jsx","cn","ERowKind"],"mappings":";;;;AAQa,MAAAA,IAAkC,CAAC,EAAE,MAAAC,GAAM,UAAAC,GAAU,WAAAC,GAAW,GAAGC,QAE9E,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACA,WAAYC;AAAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,QACC,wBAAwBL,MAASM,EAAS;AAAA,MAC3C;AAAA,MACAJ;AAAA,IACD;AAAA,IAEE,GAAGC;AAAA,IAEH,UAAAF;AAAA,EAAA;AACH;"}
|
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
tabs:
|
|
6
|
-
tabsModel:
|
|
7
|
-
onTabChange:
|
|
8
|
-
|
|
3
|
+
import r from "classnames";
|
|
4
|
+
const p = ({
|
|
5
|
+
tabs: s,
|
|
6
|
+
tabsModel: l,
|
|
7
|
+
onTabChange: a,
|
|
8
|
+
className: c
|
|
9
|
+
}) => /* @__PURE__ */ o("ul", { className: r(
|
|
9
10
|
"ui-tabs",
|
|
10
11
|
"grid",
|
|
11
12
|
"grid-flow-col",
|
|
12
13
|
"rounded-full",
|
|
13
14
|
"bg-secondary-alt-200",
|
|
14
|
-
"p-[2px]"
|
|
15
|
-
|
|
15
|
+
"p-[2px]",
|
|
16
|
+
"text-secondary-400",
|
|
17
|
+
c
|
|
18
|
+
), children: s.map((e) => /* @__PURE__ */ o(
|
|
16
19
|
"li",
|
|
17
20
|
{
|
|
18
|
-
className:
|
|
21
|
+
className: r(
|
|
19
22
|
"rounded-full",
|
|
20
23
|
"text-center",
|
|
21
|
-
|
|
24
|
+
l === e && "bg-white border border-secondary-alt-600 text-secondary-500"
|
|
22
25
|
),
|
|
23
|
-
children: /* @__PURE__ */ n("label", { className:
|
|
26
|
+
children: /* @__PURE__ */ n("label", { className: r(
|
|
24
27
|
"block",
|
|
25
28
|
"cursor-pointer",
|
|
26
29
|
"px-md",
|
|
27
30
|
"py-xxs"
|
|
28
31
|
), children: [
|
|
29
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ o(
|
|
30
33
|
"input",
|
|
31
34
|
{
|
|
32
|
-
className:
|
|
35
|
+
className: r(
|
|
33
36
|
"absolute",
|
|
34
37
|
"appearance-none"
|
|
35
38
|
),
|
|
36
39
|
type: "radio",
|
|
37
40
|
value: e,
|
|
38
|
-
checked:
|
|
39
|
-
onChange: () =>
|
|
41
|
+
checked: l === e,
|
|
42
|
+
onChange: () => a(e)
|
|
40
43
|
}
|
|
41
44
|
),
|
|
42
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ o("span", { className: r(
|
|
43
46
|
"font-bold",
|
|
44
47
|
"text-xs"
|
|
45
48
|
), children: e })
|
|
@@ -48,6 +51,6 @@ const d = ({
|
|
|
48
51
|
e
|
|
49
52
|
)) });
|
|
50
53
|
export {
|
|
51
|
-
|
|
54
|
+
p as UiTabs
|
|
52
55
|
};
|
|
53
56
|
//# 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
|
|
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\"block\",\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,EACAF;AAEE,GAAA,UAAAH,EAAK,IAAI,CAACM,MACX,gBAAAF;AAAA,EAAC;AAAA,EAAA;AAAA,IAEA,WAAYC;AAAA,MACX;AAAA,MACA;AAAA,MACAJ,MAAcK,KAAO;AAAA,IAEtB;AAAA,IAEA,UAAA,gBAAAC,EAAC,WAAM,WAAYF;AAAA,MAClB;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,EA/BMA;AAkCP,CAAA,GACF;"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
title?: React.ReactNode;
|
|
2
|
+
type TUiToggleProps = {
|
|
4
3
|
children?: React.ReactNode;
|
|
5
4
|
disabled?: boolean;
|
|
6
5
|
invertOrder?: boolean;
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
defaultChecked?: boolean;
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
value?: boolean;
|
|
9
|
+
onChange?: (checked: boolean) => void;
|
|
10
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange">;
|
|
11
|
+
export declare const UiToggle: React.FC<TUiToggleProps>;
|
|
9
12
|
export {};
|
|
@@ -1,103 +1,129 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as T, useEffect as f } from "react";
|
|
3
|
+
import t from "classnames";
|
|
4
|
+
import '../../assets/UiToggle.css';const U = "_UiToggle__dot_1uov6_1", v = "_UiToggle__dot_checked_1uov6_13", k = "_UiToggle__icon_1uov6_17", w = "_UiToggle__icon_checked_1uov6_26", l = {
|
|
5
|
+
UiToggle__dot: U,
|
|
6
|
+
UiToggle__dot_checked: v,
|
|
7
|
+
UiToggle__icon: k,
|
|
8
|
+
UiToggle__icon_checked: w
|
|
9
|
+
}, N = ({
|
|
10
|
+
children: a,
|
|
11
|
+
disabled: e = !1,
|
|
12
|
+
invertOrder: d = !1,
|
|
13
|
+
checked: c,
|
|
14
|
+
value: i,
|
|
15
|
+
className: m,
|
|
16
|
+
defaultChecked: h,
|
|
17
|
+
onChange: s,
|
|
18
|
+
...p
|
|
9
19
|
}) => {
|
|
10
|
-
const [
|
|
11
|
-
|
|
20
|
+
const [_, g] = T(h ?? !1), o = i ?? c ?? _, u = () => {
|
|
21
|
+
i === void 0 && c === void 0 && g(!_), s == null || s(!o);
|
|
22
|
+
};
|
|
23
|
+
return f(() => {
|
|
24
|
+
c !== void 0 && g(c);
|
|
25
|
+
}, [c]), /* @__PURE__ */ r(
|
|
12
26
|
"div",
|
|
13
27
|
{
|
|
14
|
-
className:
|
|
15
|
-
"ui-toggle"
|
|
28
|
+
className: t(
|
|
29
|
+
"ui-toggle",
|
|
30
|
+
m
|
|
16
31
|
),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
children: /* @__PURE__ */ n("label", { className: t(
|
|
33
|
+
"flex",
|
|
34
|
+
"cursor-pointer",
|
|
35
|
+
"gap-sm",
|
|
36
|
+
"rounded-full",
|
|
37
|
+
"mt-sm",
|
|
38
|
+
"items-center",
|
|
39
|
+
"w-full",
|
|
40
|
+
"leading-normal",
|
|
41
|
+
"text-md",
|
|
42
|
+
{
|
|
43
|
+
"flex-row-reverse": d,
|
|
44
|
+
"pointer-events-none opacity-50": e
|
|
45
|
+
}
|
|
46
|
+
), children: [
|
|
47
|
+
/* @__PURE__ */ n("span", { className: t(
|
|
48
|
+
"relative",
|
|
49
|
+
"block",
|
|
50
|
+
"h-md"
|
|
35
51
|
), children: [
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
"
|
|
52
|
+
/* @__PURE__ */ r(
|
|
53
|
+
"input",
|
|
54
|
+
{
|
|
55
|
+
className: t(
|
|
56
|
+
"absolute",
|
|
57
|
+
"size-0",
|
|
58
|
+
"appearance-none",
|
|
59
|
+
"border-0"
|
|
60
|
+
),
|
|
61
|
+
type: "checkbox",
|
|
62
|
+
checked: o,
|
|
63
|
+
onChange: u,
|
|
64
|
+
disabled: e,
|
|
65
|
+
value: i,
|
|
66
|
+
...p
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ r("span", { className: t(
|
|
38
70
|
"block",
|
|
39
|
-
"h-md"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
) })
|
|
93
|
-
] }),
|
|
94
|
-
c
|
|
95
|
-
] })
|
|
96
|
-
]
|
|
71
|
+
"h-md",
|
|
72
|
+
"w-xl",
|
|
73
|
+
"rounded-full",
|
|
74
|
+
{
|
|
75
|
+
"bg-primary-600": o && !e,
|
|
76
|
+
"bg-secondary-alt-300": !o && e,
|
|
77
|
+
"bg-secondary-alt-600": !o && !e,
|
|
78
|
+
"bg-primary-300": o && e
|
|
79
|
+
}
|
|
80
|
+
) }),
|
|
81
|
+
/* @__PURE__ */ r("span", { className: t(
|
|
82
|
+
"absolute",
|
|
83
|
+
"top-[50%]",
|
|
84
|
+
"block",
|
|
85
|
+
"rounded-full",
|
|
86
|
+
"bg-white",
|
|
87
|
+
l.UiToggle__dot,
|
|
88
|
+
{
|
|
89
|
+
"hover:shadow-border-secondary": !o && !e,
|
|
90
|
+
"hover:shadow-border-primary": o && !e,
|
|
91
|
+
[l.UiToggle__dot_checked]: o
|
|
92
|
+
}
|
|
93
|
+
), children: /* @__PURE__ */ r(
|
|
94
|
+
"svg",
|
|
95
|
+
{
|
|
96
|
+
className: t(
|
|
97
|
+
l.UiToggle__icon,
|
|
98
|
+
"absolute",
|
|
99
|
+
e ? "text-primary-300" : "text-primary-600",
|
|
100
|
+
{
|
|
101
|
+
[l.UiToggle__icon_checked]: o
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
width: "16",
|
|
105
|
+
height: "16",
|
|
106
|
+
viewBox: "0 0 16 16",
|
|
107
|
+
fill: "none",
|
|
108
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
109
|
+
children: /* @__PURE__ */ r(
|
|
110
|
+
"path",
|
|
111
|
+
{
|
|
112
|
+
d: "M1 4.40106L6.60071 10.1135L15.1694 1.71245",
|
|
113
|
+
stroke: "currentColor",
|
|
114
|
+
"stroke-width": "1.6",
|
|
115
|
+
"stroke-linecap": "round"
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
) })
|
|
120
|
+
] }),
|
|
121
|
+
a
|
|
122
|
+
] })
|
|
97
123
|
}
|
|
98
124
|
);
|
|
99
125
|
};
|
|
100
126
|
export {
|
|
101
|
-
|
|
127
|
+
N as UiToggle
|
|
102
128
|
};
|
|
103
129
|
//# sourceMappingURL=UiToggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiToggle.js","sources":["../../../src/components/UiToggle/UiToggle.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport cx from \"classnames\";\n\
|
|
1
|
+
{"version":3,"file":"UiToggle.js","sources":["../../../src/components/UiToggle/UiToggle.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport cx from \"classnames\";\nimport styles from \"./UiToggle.module.css\";\n\ntype TUiToggleProps = {\n\tchildren?: React.ReactNode\n\tdisabled?: boolean\n\tinvertOrder?: boolean\n\tdefaultChecked?: boolean\n\tchecked?: boolean\n\tvalue?: boolean\n\tonChange?: (checked: boolean) => void\n} & Omit<React.InputHTMLAttributes<HTMLInputElement>, \"onChange\">;\n\nexport const UiToggle: React.FC<TUiToggleProps> = ({\n\tchildren,\n\tdisabled = false,\n\tinvertOrder = false,\n\tchecked,\n\tvalue,\n\tclassName,\n\tdefaultChecked,\n\tonChange,\n\t...rest\n}) => {\n\n\tconst [toggled, setIsToggled] = useState<boolean>(defaultChecked ?? false);\n\n\tconst isChecked = value ?? checked ?? toggled;\n\n\tconst handleChange = () => {\n\t\tif (value === undefined && checked === undefined) {\n\t\t\tsetIsToggled(!toggled);\n\t\t}\n\n\t\tonChange?.(!isChecked);\n\t};\n\n\tuseEffect(()=>{\n\t\tif ( checked !== undefined) {\n\t\t\tsetIsToggled(checked);\n\t\t}\n\t}, [checked]);\n\n\treturn (\n\t\t<div className={ cx(\n\t\t\t\"ui-toggle\",\n\t\t\tclassName\n\t\t) }\n\t\t>\n\n\t\t\t<label className={ cx(\n\t\t\t\t\"flex\",\n\t\t\t\t\"cursor-pointer\",\n\t\t\t\t\"gap-sm\",\n\t\t\t\t\"rounded-full\",\n\t\t\t\t\"mt-sm\",\n\t\t\t\t\"items-center\",\n\t\t\t\t\"w-full\",\n\t\t\t\t\"leading-normal\",\n\t\t\t\t\"text-md\",\n\t\t\t\t{\n\t\t\t\t\t\"flex-row-reverse\": invertOrder,\n\t\t\t\t\t\"pointer-events-none opacity-50\": disabled\n\t\t\t\t}\n\n\t\t\t) }>\n\t\t\t\t<span className={ cx(\n\t\t\t\t\t\"relative\",\n\t\t\t\t\t\"block\",\n\t\t\t\t\t\"h-md\"\n\t\t\t\t) }>\n\n\t\t\t\t\t<input className={ cx(\n\t\t\t\t\t\t\"absolute\",\n\t\t\t\t\t\t\"size-0\",\n\t\t\t\t\t\t\"appearance-none\",\n\t\t\t\t\t\t\"border-0\"\n\t\t\t\t\t) }\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\tchecked={ isChecked }\n\t\t\t\t\tonChange={ handleChange }\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\t{ ...rest }\n\t\t\t\t\t>\n\t\t\t\t\t</input>\n\n\t\t\t\t\t<span className={ cx(\n\t\t\t\t\t\t\"block\",\n\t\t\t\t\t\t\"h-md\",\n\t\t\t\t\t\t\"w-xl\",\n\t\t\t\t\t\t\"rounded-full\",\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"bg-primary-600\": isChecked && !disabled,\n\t\t\t\t\t\t\t\"bg-secondary-alt-300\": !isChecked && disabled,\n\t\t\t\t\t\t\t\"bg-secondary-alt-600\": !isChecked && !disabled,\n\t\t\t\t\t\t\t\"bg-primary-300\": isChecked && disabled\n\n\t\t\t\t\t\t}\n\t\t\t\t\t) }/>\n\n\t\t\t\t\t<span className={ cx(\n\t\t\t\t\t\t\"absolute\",\n\t\t\t\t\t\t\"top-[50%]\",\n\t\t\t\t\t\t\"block\",\n\t\t\t\t\t\t\"rounded-full\",\n\t\t\t\t\t\t\"bg-white\",\n\t\t\t\t\t\tstyles.UiToggle__dot,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"hover:shadow-border-secondary\": !isChecked && !disabled,\n\t\t\t\t\t\t\t\"hover:shadow-border-primary\": isChecked && !disabled,\n\t\t\t\t\t\t\t[styles.UiToggle__dot_checked]: isChecked\n\t\t\t\t\t\t},\n\n\t\t\t\t\t) }>\n\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\tstyles.UiToggle__icon,\n\t\t\t\t\t\t\t\t\"absolute\",\n\t\t\t\t\t\t\t\tdisabled ? \"text-primary-300\" : \"text-primary-600\",\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t[styles.UiToggle__icon_checked]: isChecked ,\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\twidth=\"16\"\n\t\t\t\t\t\t\theight=\"16\"\n\t\t\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\td=\"M1 4.40106L6.60071 10.1135L15.1694 1.71245\"\n\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\tstroke-width=\"1.6\"\n\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</svg>\n\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\n\t\t\t\t{ children }\n\n\t\t\t</label>\n\n\t\t</div>\n\t);\n};\n"],"names":["UiToggle","children","disabled","invertOrder","checked","value","className","defaultChecked","onChange","rest","toggled","setIsToggled","useState","isChecked","handleChange","useEffect","jsx","cx","jsxs","styles"],"mappings":";;;;;;;;GAcaA,IAAqC,CAAC;AAAA,EAClD,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,aAAAC,IAAc;AAAA,EACd,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACJ,MAAM;AAEL,QAAM,CAACC,GAASC,CAAY,IAAIC,EAAkBL,KAAmB,EAAK,GAEpEM,IAAYR,KAASD,KAAWM,GAEhCI,IAAe,MAAM;AACtB,IAAAT,MAAU,UAAaD,MAAY,UACtCO,EAAa,CAACD,CAAO,GAGtBF,KAAA,QAAAA,EAAW,CAACK;AAAA,EACb;AAEA,SAAAE,EAAU,MAAI;AACb,IAAKX,MAAY,UAChBO,EAAaP,CAAO;AAAA,EACrB,GACE,CAACA,CAAO,CAAC,GAGX,gBAAAY;AAAA,IAAC;AAAA,IAAA;AAAA,MAAI,WAAYC;AAAA,QAChB;AAAA,QACAX;AAAA,MACD;AAAA,MAGC,UAAA,gBAAAY,EAAC,WAAM,WAAYD;AAAA,QAClB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,UACC,oBAAoBd;AAAA,UACpB,kCAAkCD;AAAA,QAAA;AAAA,MAInC,GAAA,UAAA;AAAA,QAAA,gBAAAgB,EAAC,UAAK,WAAYD;AAAA,UACjB;AAAA,UACA;AAAA,UACA;AAAA,QAGA,GAAA,UAAA;AAAA,UAAA,gBAAAD;AAAA,YAAC;AAAA,YAAA;AAAA,cAAM,WAAYC;AAAA,gBAClB;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,cACD;AAAA,cACA,MAAK;AAAA,cACL,SAAUJ;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
|
2
|
-
import { ETypographySizes as e, ETextTransform as r, ETextAlign as
|
|
2
|
+
import { ETypographySizes as e, ETextTransform as r, ETextAlign as R, ETextWeight as a } from "./_types.js";
|
|
3
3
|
import { EColors as t } from "../../_types/colors.js";
|
|
4
4
|
import y from "classnames";
|
|
5
5
|
const m = {
|
|
@@ -19,9 +19,9 @@ const m = {
|
|
|
19
19
|
[r.NONE]: "normal-case",
|
|
20
20
|
[r.CAPITALIZE]: "capitalize"
|
|
21
21
|
}, L = {
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
22
|
+
[R.LEFT]: "text-left",
|
|
23
|
+
[R.RIGHT]: "text-right",
|
|
24
|
+
[R.CENTER]: "text-center"
|
|
25
25
|
}, Y = {
|
|
26
26
|
[a.LIGHT]: "font-light",
|
|
27
27
|
[a.REGULAR]: "font-medium",
|
|
@@ -69,6 +69,8 @@ const m = {
|
|
|
69
69
|
[t.SECONDARY_ALT_600]: "text-secondary-alt-600",
|
|
70
70
|
[t.SECONDARY_ALT_700]: "text-secondary-alt-700",
|
|
71
71
|
[t.ERROR]: "text-error",
|
|
72
|
+
[t.ERROR_100]: "text-error-100",
|
|
73
|
+
[t.ERROR_200]: "text-error-200",
|
|
72
74
|
[t.ERROR_300]: "text-error-300",
|
|
73
75
|
[t.ERROR_400]: "text-error-400",
|
|
74
76
|
[t.ERROR_500]: "text-error-500",
|
|
@@ -86,11 +88,11 @@ const m = {
|
|
|
86
88
|
[t.ACCENT_ALT_600]: "text-accent-alt-600",
|
|
87
89
|
[t.ACCENT_ALT_700]: "text-accent-alt-700"
|
|
88
90
|
}, d = ({
|
|
89
|
-
children:
|
|
90
|
-
tag:
|
|
91
|
+
children: o,
|
|
92
|
+
tag: s,
|
|
91
93
|
underline: E = !1,
|
|
92
94
|
lineHeight: l = !1,
|
|
93
|
-
size:
|
|
95
|
+
size: x,
|
|
94
96
|
textTransform: A,
|
|
95
97
|
align: _,
|
|
96
98
|
weight: n,
|
|
@@ -104,17 +106,17 @@ const m = {
|
|
|
104
106
|
underline: E
|
|
105
107
|
},
|
|
106
108
|
l ? "leading-normal" : "leading-none",
|
|
107
|
-
|
|
109
|
+
x && m[x],
|
|
108
110
|
A && p[A],
|
|
109
111
|
_ && L[_],
|
|
110
112
|
n && Y[n],
|
|
111
113
|
c && I[c],
|
|
112
114
|
C
|
|
113
115
|
);
|
|
114
|
-
return i.createElement(
|
|
116
|
+
return i.createElement(s || "p", {
|
|
115
117
|
className: N,
|
|
116
118
|
...T
|
|
117
|
-
},
|
|
119
|
+
}, o);
|
|
118
120
|
};
|
|
119
121
|
export {
|
|
120
122
|
d as UiTypography
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiTypography.js","sources":["../../../src/components/UiTypography/UiTypography.tsx"],"sourcesContent":["import React from \"react\";\nimport { ETextAlign, ETextTransform, ETextWeight, ETypographySizes } from \"./_types.ts\";\nimport { EColors } from \"../../_types/colors.ts\";\nimport cx from \"classnames\";\n\ntype TUiTypographyProps<T extends keyof React.JSX.IntrinsicElements> = {\n\ttag?: T;\n\tchildren?: React.ReactNode;\n\tunderline?: boolean;\n\tlineHeight?: boolean;\n\tsize?: ETypographySizes;\n\ttextTransform?: ETextTransform;\n\talign?: ETextAlign;\n\tweight?: ETextWeight;\n\tcolor?: EColors;\n} & Omit<React.JSX.IntrinsicElements[T], \"children\" | \"ref\">;\n\nconst sizeClasses = {\n\t[ETypographySizes.MD]: \"text-md\",\n\t[ETypographySizes.XXS]: \"text-xxs\",\n\t[ETypographySizes.XS]: \"text-xs\",\n\t[ETypographySizes.SM]: \"text-sm\",\n\t[ETypographySizes.LG]: \"text-lg\",\n\t[ETypographySizes.XL]: \"text-xl\",\n\t[ETypographySizes.XXL]: \"text-2xl\",\n\t[ETypographySizes.XXXL]: \"text-3xl\",\n\t[ETypographySizes.XXXXL]: \"text-4xl\",\n\t[ETypographySizes.XXXXXL]: \"text-5xl\",\n};\n\nconst textTransformClasses = {\n\t[ETextTransform.UPPERCASE]: \"uppercase\",\n\t[ETextTransform.LOWERCASE]: \"lowercase\",\n\t[ETextTransform.NONE]: \"normal-case\",\n\t[ETextTransform.CAPITALIZE]: \"capitalize\",\n};\n\nconst alignClasses = {\n\t[ETextAlign.LEFT]: \"text-left\",\n\t[ETextAlign.RIGHT]: \"text-right\",\n\t[ETextAlign.CENTER]: \"text-center\",\n};\n\nconst weightClasses = {\n\t[ETextWeight.LIGHT]: \"font-light\",\n\t[ETextWeight.REGULAR]: \"font-medium\",\n\t[ETextWeight.SEMI_BOLD]: \"font-bold\",\n\t[ETextWeight.BOLD]: \"font-black\",\n};\n\nconst colorClasses = {\n\t[EColors.WHITE]: \"text-white\",\n\t[EColors.BLACK]: \"text-black\",\n\t[EColors.TRANSPARENT]: \"text-transparent\",\n\t[EColors.CURRENT]: \"text-current\",\n\n\t[EColors.PRIMARY]: \"text-primary\",\n\t[EColors.PRIMARY_50]: \"text-primary-50\",\n\t[EColors.PRIMARY_100]: \"text-primary-100\",\n\t[EColors.PRIMARY_200]: \"text-primary-200\",\n\t[EColors.PRIMARY_300]: \"text-primary-300\",\n\t[EColors.PRIMARY_400]: \"text-primary-400\",\n\t[EColors.PRIMARY_500]: \"text-primary-500\",\n\t[EColors.PRIMARY_600]: \"text-primary-600\",\n\t[EColors.PRIMARY_700]: \"text-primary-700\",\n\t[EColors.PRIMARY_800]: \"text-primary-800\",\n\t[EColors.PRIMARY_900]: \"text-primary-900\",\n\n\t[EColors.PRIMARY_ALT]: \"text-primary-alt\",\n\t[EColors.PRIMARY_ALT_300]: \"text-primary-alt-300\",\n\t[EColors.PRIMARY_ALT_400]: \"text-primary-alt-400\",\n\t[EColors.PRIMARY_ALT_500]: \"text-primary-alt-500\",\n\t[EColors.PRIMARY_ALT_600]: \"text-primary-alt-600\",\n\t[EColors.PRIMARY_ALT_700]: \"text-primary-alt-700\",\n\n\t[EColors.WARNING]: \"text-warning\",\n\t[EColors.WARNING_300]: \"text-warning-300\",\n\t[EColors.WARNING_400]: \"text-warning-400\",\n\t[EColors.WARNING_500]: \"text-warning-500\",\n\t[EColors.WARNING_600]: \"text-warning-600\",\n\t[EColors.WARNING_700]: \"text-warning-700\",\n\n\t[EColors.SECONDARY]: \"text-secondary\",\n\t[EColors.SECONDARY_300]: \"text-secondary-300\",\n\t[EColors.SECONDARY_400]: \"text-secondary-400\",\n\t[EColors.SECONDARY_500]: \"text-secondary-500\",\n\t[EColors.SECONDARY_600]: \"text-secondary-600\",\n\t[EColors.SECONDARY_700]: \"text-secondary-700\",\n\n\t[EColors.SECONDARY_ALT]: \"text-secondary-alt\",\n\t[EColors.SECONDARY_ALT_200]: \"text-secondary-alt-200\",\n\t[EColors.SECONDARY_ALT_300]: \"text-secondary-alt-300\",\n\t[EColors.SECONDARY_ALT_400]: \"text-secondary-alt-400\",\n\t[EColors.SECONDARY_ALT_500]: \"text-secondary-alt-500\",\n\t[EColors.SECONDARY_ALT_600]: \"text-secondary-alt-600\",\n\t[EColors.SECONDARY_ALT_700]: \"text-secondary-alt-700\",\n\n\t[EColors.ERROR]: \"text-error\",\n\t[EColors.ERROR_300]: \"text-error-300\",\n\t[EColors.ERROR_400]: \"text-error-400\",\n\t[EColors.ERROR_500]: \"text-error-500\",\n\t[EColors.ERROR_600]: \"text-error-600\",\n\t[EColors.ERROR_700]: \"text-error-700\",\n\n\t[EColors.ACCENT]: \"text-accent\",\n\t[EColors.ACCENT_300]: \"text-accent-300\",\n\t[EColors.ACCENT_500]: \"text-accent-500\",\n\t[EColors.ACCENT_600]: \"text-accent-600\",\n\t[EColors.ACCENT_700]: \"text-accent-700\",\n\n\t[EColors.ACCENT_ALT]: \"text-accent-alt\",\n\t[EColors.ACCENT_ALT_300]: \"text-accent-alt-300\",\n\t[EColors.ACCENT_ALT_400]: \"text-accent-alt-400\",\n\t[EColors.ACCENT_ALT_500]: \"text-accent-alt-500\",\n\t[EColors.ACCENT_ALT_600]: \"text-accent-alt-600\",\n\t[EColors.ACCENT_ALT_700]: \"text-accent-alt-700\",\n};\n\nexport const UiTypography = <T extends keyof React.JSX.IntrinsicElements> (\n\t{\n\t\tchildren,\n\t\ttag,\n\t\tunderline = false,\n\t\tlineHeight = false,\n\t\tsize,\n\t\ttextTransform,\n\t\talign,\n\t\tweight,\n\t\tcolor,\n\t\tclassName,\n\t\t...rest\n\t}: TUiTypographyProps<T> ): React.JSX.Element => {\n\n\tconst classes = cx(\n\t\t\"ui-typography\",\n\t\t{\n\t\t\tunderline\n\t\t},\n\t\tlineHeight ? \"leading-normal\" : \"leading-none\",\n\t\tsize && sizeClasses[size],\n\t\ttextTransform && textTransformClasses[textTransform],\n\t\talign && alignClasses[align],\n\t\tweight && weightClasses[weight],\n\t\tcolor && colorClasses[color],\n\t\tclassName\n\t);\n\n\treturn React.createElement(tag || \"p\", {\n\t\tclassName: classes,\n\t\t...rest\n\t}, children);\n};\n"],"names":["sizeClasses","ETypographySizes","textTransformClasses","ETextTransform","alignClasses","ETextAlign","weightClasses","ETextWeight","colorClasses","EColors","UiTypography","children","tag","underline","lineHeight","size","textTransform","align","weight","color","className","rest","classes","cx","React"],"mappings":";;;;AAiBA,MAAMA,IAAc;AAAA,EACnB,CAACC,EAAiB,EAAE,GAAG;AAAA,EACvB,CAACA,EAAiB,GAAG,GAAG;AAAA,EACxB,CAACA,EAAiB,EAAE,GAAG;AAAA,EACvB,CAACA,EAAiB,EAAE,GAAG;AAAA,EACvB,CAACA,EAAiB,EAAE,GAAG;AAAA,EACvB,CAACA,EAAiB,EAAE,GAAG;AAAA,EACvB,CAACA,EAAiB,GAAG,GAAG;AAAA,EACxB,CAACA,EAAiB,IAAI,GAAG;AAAA,EACzB,CAACA,EAAiB,KAAK,GAAG;AAAA,EAC1B,CAACA,EAAiB,MAAM,GAAG;AAC5B,GAEMC,IAAuB;AAAA,EAC5B,CAACC,EAAe,SAAS,GAAG;AAAA,EAC5B,CAACA,EAAe,SAAS,GAAG;AAAA,EAC5B,CAACA,EAAe,IAAI,GAAG;AAAA,EACvB,C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AA,EAC1B,CAACA,EAAQ,cAAc,GAAG;AAC3B,GAEaC,IAAe,CAC3B;AAAA,EACC,UAAAC;AAAA,EACA,KAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,MAAAC;AAAA,EACA,eAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACJ,MAAiD;AAEjD,QAAMC,IAAUC;AAAA,IACf;AAAA,IACA;AAAA,MACC,WAAAV;AAAA,IACD;AAAA,IACAC,IAAa,mBAAmB;AAAA,IAChCC,KAAQf,EAAYe,CAAI;AAAA,IACxBC,KAAiBd,EAAqBc,CAAa;AAAA,IACnDC,KAASb,EAAaa,CAAK;AAAA,IAC3BC,KAAUZ,EAAcY,CAAM;AAAA,IAC9BC,KAASX,EAAaW,CAAK;AAAA,IAC3BC;AAAA,EACD;AAEO,SAAAI,EAAM,cAAcZ,KAAO,KAAK;AAAA,IACtC,WAAWU;AAAA,IACX,GAAGD;AAAA,KACDV,CAAQ;AACZ;"}
|
|
1
|
+
{"version":3,"file":"UiTypography.js","sources":["../../../src/components/UiTypography/UiTypography.tsx"],"sourcesContent":["import React from \"react\";\nimport { ETextAlign, ETextTransform, ETextWeight, ETypographySizes } from \"./_types.ts\";\nimport { EColors } from \"../../_types/colors.ts\";\nimport cx from \"classnames\";\n\ntype TUiTypographyProps<T extends keyof React.JSX.IntrinsicElements> = {\n\ttag?: T;\n\tchildren?: React.ReactNode;\n\tunderline?: boolean;\n\tlineHeight?: boolean;\n\tsize?: ETypographySizes;\n\ttextTransform?: ETextTransform;\n\talign?: ETextAlign;\n\tweight?: ETextWeight;\n\tcolor?: EColors;\n} & Omit<React.JSX.IntrinsicElements[T], \"children\" | \"ref\">;\n\nconst sizeClasses = {\n\t[ETypographySizes.MD]: \"text-md\",\n\t[ETypographySizes.XXS]: \"text-xxs\",\n\t[ETypographySizes.XS]: \"text-xs\",\n\t[ETypographySizes.SM]: \"text-sm\",\n\t[ETypographySizes.LG]: \"text-lg\",\n\t[ETypographySizes.XL]: \"text-xl\",\n\t[ETypographySizes.XXL]: \"text-2xl\",\n\t[ETypographySizes.XXXL]: \"text-3xl\",\n\t[ETypographySizes.XXXXL]: \"text-4xl\",\n\t[ETypographySizes.XXXXXL]: \"text-5xl\",\n};\n\nconst textTransformClasses = {\n\t[ETextTransform.UPPERCASE]: \"uppercase\",\n\t[ETextTransform.LOWERCASE]: \"lowercase\",\n\t[ETextTransform.NONE]: \"normal-case\",\n\t[ETextTransform.CAPITALIZE]: \"capitalize\",\n};\n\nconst alignClasses = {\n\t[ETextAlign.LEFT]: \"text-left\",\n\t[ETextAlign.RIGHT]: \"text-right\",\n\t[ETextAlign.CENTER]: \"text-center\",\n};\n\nconst weightClasses = {\n\t[ETextWeight.LIGHT]: \"font-light\",\n\t[ETextWeight.REGULAR]: \"font-medium\",\n\t[ETextWeight.SEMI_BOLD]: \"font-bold\",\n\t[ETextWeight.BOLD]: \"font-black\",\n};\n\nconst colorClasses = {\n\t[EColors.WHITE]: \"text-white\",\n\t[EColors.BLACK]: \"text-black\",\n\t[EColors.TRANSPARENT]: \"text-transparent\",\n\t[EColors.CURRENT]: \"text-current\",\n\n\t[EColors.PRIMARY]: \"text-primary\",\n\t[EColors.PRIMARY_50]: \"text-primary-50\",\n\t[EColors.PRIMARY_100]: \"text-primary-100\",\n\t[EColors.PRIMARY_200]: \"text-primary-200\",\n\t[EColors.PRIMARY_300]: \"text-primary-300\",\n\t[EColors.PRIMARY_400]: \"text-primary-400\",\n\t[EColors.PRIMARY_500]: \"text-primary-500\",\n\t[EColors.PRIMARY_600]: \"text-primary-600\",\n\t[EColors.PRIMARY_700]: \"text-primary-700\",\n\t[EColors.PRIMARY_800]: \"text-primary-800\",\n\t[EColors.PRIMARY_900]: \"text-primary-900\",\n\n\t[EColors.PRIMARY_ALT]: \"text-primary-alt\",\n\t[EColors.PRIMARY_ALT_300]: \"text-primary-alt-300\",\n\t[EColors.PRIMARY_ALT_400]: \"text-primary-alt-400\",\n\t[EColors.PRIMARY_ALT_500]: \"text-primary-alt-500\",\n\t[EColors.PRIMARY_ALT_600]: \"text-primary-alt-600\",\n\t[EColors.PRIMARY_ALT_700]: \"text-primary-alt-700\",\n\n\t[EColors.WARNING]: \"text-warning\",\n\t[EColors.WARNING_300]: \"text-warning-300\",\n\t[EColors.WARNING_400]: \"text-warning-400\",\n\t[EColors.WARNING_500]: \"text-warning-500\",\n\t[EColors.WARNING_600]: \"text-warning-600\",\n\t[EColors.WARNING_700]: \"text-warning-700\",\n\n\t[EColors.SECONDARY]: \"text-secondary\",\n\t[EColors.SECONDARY_300]: \"text-secondary-300\",\n\t[EColors.SECONDARY_400]: \"text-secondary-400\",\n\t[EColors.SECONDARY_500]: \"text-secondary-500\",\n\t[EColors.SECONDARY_600]: \"text-secondary-600\",\n\t[EColors.SECONDARY_700]: \"text-secondary-700\",\n\n\t[EColors.SECONDARY_ALT]: \"text-secondary-alt\",\n\t[EColors.SECONDARY_ALT_200]: \"text-secondary-alt-200\",\n\t[EColors.SECONDARY_ALT_300]: \"text-secondary-alt-300\",\n\t[EColors.SECONDARY_ALT_400]: \"text-secondary-alt-400\",\n\t[EColors.SECONDARY_ALT_500]: \"text-secondary-alt-500\",\n\t[EColors.SECONDARY_ALT_600]: \"text-secondary-alt-600\",\n\t[EColors.SECONDARY_ALT_700]: \"text-secondary-alt-700\",\n\n\t[EColors.ERROR]: \"text-error\",\n\t[EColors.ERROR_100]: \"text-error-100\",\n\t[EColors.ERROR_200]: \"text-error-200\",\n\t[EColors.ERROR_300]: \"text-error-300\",\n\t[EColors.ERROR_400]: \"text-error-400\",\n\t[EColors.ERROR_500]: \"text-error-500\",\n\t[EColors.ERROR_600]: \"text-error-600\",\n\t[EColors.ERROR_700]: \"text-error-700\",\n\n\t[EColors.ACCENT]: \"text-accent\",\n\t[EColors.ACCENT_300]: \"text-accent-300\",\n\t[EColors.ACCENT_500]: \"text-accent-500\",\n\t[EColors.ACCENT_600]: \"text-accent-600\",\n\t[EColors.ACCENT_700]: \"text-accent-700\",\n\n\t[EColors.ACCENT_ALT]: \"text-accent-alt\",\n\t[EColors.ACCENT_ALT_300]: \"text-accent-alt-300\",\n\t[EColors.ACCENT_ALT_400]: \"text-accent-alt-400\",\n\t[EColors.ACCENT_ALT_500]: \"text-accent-alt-500\",\n\t[EColors.ACCENT_ALT_600]: \"text-accent-alt-600\",\n\t[EColors.ACCENT_ALT_700]: \"text-accent-alt-700\",\n};\n\nexport const UiTypography = <T extends keyof React.JSX.IntrinsicElements> (\n\t{\n\t\tchildren,\n\t\ttag,\n\t\tunderline = false,\n\t\tlineHeight = false,\n\t\tsize,\n\t\ttextTransform,\n\t\talign,\n\t\tweight,\n\t\tcolor,\n\t\tclassName,\n\t\t...rest\n\t}: TUiTypographyProps<T> ): React.JSX.Element => {\n\n\tconst classes = cx(\n\t\t\"ui-typography\",\n\t\t{\n\t\t\tunderline\n\t\t},\n\t\tlineHeight ? \"leading-normal\" : \"leading-none\",\n\t\tsize && sizeClasses[size],\n\t\ttextTransform && textTransformClasses[textTransform],\n\t\talign && alignClasses[align],\n\t\tweight && weightClasses[weight],\n\t\tcolor && colorClasses[color],\n\t\tclassName\n\t);\n\n\treturn React.createElement(tag || \"p\", {\n\t\tclassName: classes,\n\t\t...rest\n\t}, children);\n};\n"],"names":["sizeClasses","ETypographySizes","textTransformClasses","ETextTransform","alignClasses","ETextAlign","weightClasses","ETextWeight","colorClasses","EColors","UiTypography","children","tag","underline","lineHeight","size","textTransform","align","weight","color","className","rest","classes","cx","React"],"mappings":";;;;AAiBA,MAAMA,IAAc;AAAA,EACnB,CAACC,EAAiB,EAAE,GAAG;AAAA,EACvB,CAACA,EAAiB,GAAG,GAAG;AAAA,EACxB,CAACA,EAAiB,EAAE,GAAG;AAAA,EACvB,CAACA,EAAiB,EAAE,GAAG;AAAA,EACvB,CAACA,EAAiB,EAAE,GAAG;AAA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CAACA,EAAQ,SAAS,GAAG;AAAA,EAErB,CAACA,EAAQ,MAAM,GAAG;AAAA,EAClB,CAACA,EAAQ,UAAU,GAAG;AAAA,EACtB,CAACA,EAAQ,UAAU,GAAG;AAAA,EACtB,CAACA,EAAQ,UAAU,GAAG;AAAA,EACtB,CAACA,EAAQ,UAAU,GAAG;AAAA,EAEtB,CAACA,EAAQ,UAAU,GAAG;AAAA,EACtB,CAACA,EAAQ,cAAc,GAAG;AAAA,EAC1B,CAACA,EAAQ,cAAc,GAAG;AAAA,EAC1B,CAACA,EAAQ,cAAc,GAAG;AAAA,EAC1B,CAACA,EAAQ,cAAc,GAAG;AAAA,EAC1B,CAACA,EAAQ,cAAc,GAAG;AAC3B,GAEaC,IAAe,CAC3B;AAAA,EACC,UAAAC;AAAA,EACA,KAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,MAAAC;AAAA,EACA,eAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACJ,MAAiD;AAEjD,QAAMC,IAAUC;AAAA,IACf;AAAA,IACA;AAAA,MACC,WAAAV;AAAA,IACD;AAAA,IACAC,IAAa,mBAAmB;AAAA,IAChCC,KAAQf,EAAYe,CAAI;AAAA,IACxBC,KAAiBd,EAAqBc,CAAa;AAAA,IACnDC,KAASb,EAAaa,CAAK;AAAA,IAC3BC,KAAUZ,EAAcY,CAAM;AAAA,IAC9BC,KAASX,EAAaW,CAAK;AAAA,IAC3BC;AAAA,EACD;AAEO,SAAAI,EAAM,cAAcZ,KAAO,KAAK;AAAA,IACtC,WAAWU;AAAA,IACX,GAAGD;AAAA,KACDV,CAAQ;AACZ;"}
|
package/eslint.config.mjs
CHANGED
|
@@ -2,7 +2,9 @@ import react from "eslint-plugin-react";
|
|
|
2
2
|
import tseslint from "typescript-eslint";
|
|
3
3
|
import stylisticPlugin from "@stylistic/eslint-plugin";
|
|
4
4
|
import storybook from "eslint-plugin-storybook";
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
// Not compatible with tailwind v4: https://github.com/francoismassart/eslint-plugin-tailwindcss/issues/325
|
|
7
|
+
// import pluginTailwind from "eslint-plugin-tailwindcss";
|
|
6
8
|
|
|
7
9
|
/** @type {import('eslint').Linter.Config[]} */
|
|
8
10
|
export default [
|
|
@@ -86,6 +88,5 @@ export default [
|
|
|
86
88
|
},
|
|
87
89
|
},
|
|
88
90
|
...tseslint.configs.recommended,
|
|
89
|
-
...storybook.configs["flat/recommended"]
|
|
90
|
-
...pluginTailwind.configs["flat/recommended"]
|
|
91
|
+
...storybook.configs["flat/recommended"]
|
|
91
92
|
];
|
package/helper.d.ts
CHANGED
|
@@ -1 +1,32 @@
|
|
|
1
|
+
export type TColor = {
|
|
2
|
+
name: string;
|
|
3
|
+
value: string;
|
|
4
|
+
};
|
|
5
|
+
export type TGroupedColor = {
|
|
6
|
+
groupTitle: string;
|
|
7
|
+
groupColors: {
|
|
8
|
+
shade: string;
|
|
9
|
+
value: string;
|
|
10
|
+
name: string;
|
|
11
|
+
}[];
|
|
12
|
+
};
|
|
1
13
|
export declare const getCssVariableValue: (variable: string) => string;
|
|
14
|
+
export declare const getBaseVariables: () => {
|
|
15
|
+
name: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}[];
|
|
18
|
+
export declare const getThemeTokens: () => {
|
|
19
|
+
fontSizes: {
|
|
20
|
+
name: string;
|
|
21
|
+
value: string;
|
|
22
|
+
}[];
|
|
23
|
+
spacings: {
|
|
24
|
+
name: string;
|
|
25
|
+
value: string;
|
|
26
|
+
}[];
|
|
27
|
+
groupedColors: TGroupedColor[];
|
|
28
|
+
baseColors: {
|
|
29
|
+
name: string;
|
|
30
|
+
value: string;
|
|
31
|
+
}[];
|
|
32
|
+
};
|