bonkers-ui 2.0.15 → 2.0.17
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/_types/sizing.d.ts +4 -0
- package/_types/sizing.js +1 -1
- package/_types/sizing.js.map +1 -1
- package/assets/UiNavigationSteps.css +1 -1
- package/bonkers.css +2 -2
- package/components/UiAlert/UiAlert.d.ts +1 -0
- package/components/UiAlert/UiAlert.js +31 -21
- package/components/UiAlert/UiAlert.js.map +1 -1
- package/components/UiIcon/UiIcon.js +5 -5
- package/components/UiIcon/UiIcon.js.map +1 -1
- package/components/UiIconBadge/UiIconBadge.js +29 -26
- package/components/UiIconBadge/UiIconBadge.js.map +1 -1
- package/components/UiIconBadge/_types.d.ts +3 -3
- package/components/UiIconBadge/_types.js +1 -1
- package/components/UiIconBadge/_types.js.map +1 -1
- package/components/UiInput/UiInput.base.d.ts +10 -2
- package/components/UiInput/UiInput.base.js +48 -44
- package/components/UiInput/UiInput.base.js.map +1 -1
- package/components/UiInput/UiInputText.d.ts +10 -6
- package/components/UiInput/UiInputText.js +23 -16
- package/components/UiInput/UiInputText.js.map +1 -1
- package/components/UiInput/_types.d.ts +4 -0
- package/components/UiInput/_types.js +3 -2
- package/components/UiInput/_types.js.map +1 -1
- package/components/UiInput/index.d.ts +1 -2
- package/components/UiInput/index.js +11 -12
- package/components/UiInput/index.js.map +1 -1
- package/components/{UiInput → UiInputTextArea}/UiInputTextArea.d.ts +1 -1
- package/components/{UiInput → UiInputTextArea}/UiInputTextArea.js +7 -7
- package/components/UiInputTextArea/UiInputTextArea.js.map +1 -0
- package/components/UiInputTextArea/index.d.ts +1 -0
- package/components/UiInputTextArea/index.js +5 -0
- package/components/UiInputTextArea/index.js.map +1 -0
- package/components/UiList/UiList.js +18 -17
- package/components/UiList/UiList.js.map +1 -1
- package/components/UiList/UiListItem.js +12 -12
- package/components/UiList/UiListItem.js.map +1 -1
- package/components/UiList/_types.d.ts +1 -0
- package/components/UiList/_types.js +1 -1
- package/components/UiList/_types.js.map +1 -1
- package/components/UiPills/UiPills.d.ts +2 -1
- package/components/UiPills/UiPills.js +37 -25
- package/components/UiPills/UiPills.js.map +1 -1
- package/components/UiSelect/UiSelect.d.ts +2 -0
- package/components/UiSelect/UiSelect.js +68 -61
- package/components/UiSelect/UiSelect.js.map +1 -1
- package/components/UiSelect/_types.d.ts +4 -0
- package/components/UiSelect/_types.js +5 -0
- package/components/UiSelect/_types.js.map +1 -0
- package/components/UiSelect/index.d.ts +1 -0
- package/components/UiSelect/index.js +2 -0
- package/components/UiSelect/index.js.map +1 -1
- package/components/UiStars/index.d.ts +1 -1
- package/components/UiStars/index.js +3 -2
- package/components/UiToggle/UiToggle.js +13 -13
- package/components/UiToggle/UiToggle.js.map +1 -1
- package/components/UiTypography/UiTypography.d.ts +2 -1
- package/components/UiTypography/UiTypography.js +53 -47
- package/components/UiTypography/UiTypography.js.map +1 -1
- package/components/UiTypography/_types.d.ts +2 -2
- package/components/UiTypography/_types.js.map +1 -1
- package/index.d.ts +1 -0
- package/package.json +34 -34
- package/components/UiInput/UiInputTextArea.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as _, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as U, useEffect as v } from "react";
|
|
3
|
-
import
|
|
3
|
+
import s from "classnames";
|
|
4
4
|
import { EJustify as t } from "../../_types/align.js";
|
|
5
5
|
import '../../assets/UiToggle.css';const k = "_UiToggle__dot_1uov6_1", w = "_UiToggle__dot_checked_1uov6_13", x = "_UiToggle__icon_1uov6_17", N = "_UiToggle__icon_checked_1uov6_26", n = {
|
|
6
6
|
UiToggle__dot: k,
|
|
@@ -12,19 +12,19 @@ import '../../assets/UiToggle.css';const k = "_UiToggle__dot_1uov6_1", w = "_UiT
|
|
|
12
12
|
disabled: o = !1,
|
|
13
13
|
invertOrder: d = !1,
|
|
14
14
|
justify: u = t.START,
|
|
15
|
-
checked:
|
|
15
|
+
checked: i,
|
|
16
16
|
value: c,
|
|
17
17
|
className: h,
|
|
18
18
|
defaultChecked: f,
|
|
19
19
|
onChange: m,
|
|
20
20
|
...p
|
|
21
21
|
}) => {
|
|
22
|
-
const [l, g] = U(f ?? !1), e = c ??
|
|
23
|
-
c === void 0 &&
|
|
22
|
+
const [l, g] = U(f ?? !1), e = c ?? i ?? l, T = () => {
|
|
23
|
+
c === void 0 && i === void 0 && g(!l), m?.(!e);
|
|
24
24
|
};
|
|
25
25
|
v(() => {
|
|
26
|
-
|
|
27
|
-
}, [
|
|
26
|
+
i !== void 0 && g(i);
|
|
27
|
+
}, [i]);
|
|
28
28
|
const y = {
|
|
29
29
|
[t.START]: "justify-start",
|
|
30
30
|
[t.END]: "justify-end",
|
|
@@ -33,7 +33,7 @@ import '../../assets/UiToggle.css';const k = "_UiToggle__dot_1uov6_1", w = "_UiT
|
|
|
33
33
|
[t.AROUND]: "justify-around",
|
|
34
34
|
[t.EVENLY]: "justify-evenly"
|
|
35
35
|
};
|
|
36
|
-
return /* @__PURE__ */ _("label", { className:
|
|
36
|
+
return /* @__PURE__ */ _("label", { className: s(
|
|
37
37
|
"ui-toggle",
|
|
38
38
|
"flex",
|
|
39
39
|
"cursor-pointer",
|
|
@@ -45,12 +45,12 @@ import '../../assets/UiToggle.css';const k = "_UiToggle__dot_1uov6_1", w = "_UiT
|
|
|
45
45
|
"text-md",
|
|
46
46
|
{
|
|
47
47
|
"flex-row-reverse": d,
|
|
48
|
-
"pointer-events-none opacity-50": o
|
|
48
|
+
"pointer-events-none opacity-50 grayscale": o
|
|
49
49
|
},
|
|
50
50
|
y[u],
|
|
51
51
|
h
|
|
52
52
|
), children: [
|
|
53
|
-
/* @__PURE__ */ _("span", { className:
|
|
53
|
+
/* @__PURE__ */ _("span", { className: s(
|
|
54
54
|
"relative",
|
|
55
55
|
"block",
|
|
56
56
|
"h-md"
|
|
@@ -58,7 +58,7 @@ import '../../assets/UiToggle.css';const k = "_UiToggle__dot_1uov6_1", w = "_UiT
|
|
|
58
58
|
/* @__PURE__ */ r(
|
|
59
59
|
"input",
|
|
60
60
|
{
|
|
61
|
-
className:
|
|
61
|
+
className: s(
|
|
62
62
|
"absolute",
|
|
63
63
|
"size-0",
|
|
64
64
|
"appearance-none",
|
|
@@ -72,7 +72,7 @@ import '../../assets/UiToggle.css';const k = "_UiToggle__dot_1uov6_1", w = "_UiT
|
|
|
72
72
|
...p
|
|
73
73
|
}
|
|
74
74
|
),
|
|
75
|
-
/* @__PURE__ */ r("span", { className:
|
|
75
|
+
/* @__PURE__ */ r("span", { className: s(
|
|
76
76
|
"block",
|
|
77
77
|
"h-md",
|
|
78
78
|
"w-xl",
|
|
@@ -84,7 +84,7 @@ import '../../assets/UiToggle.css';const k = "_UiToggle__dot_1uov6_1", w = "_UiT
|
|
|
84
84
|
"bg-primary-300": e && o
|
|
85
85
|
}
|
|
86
86
|
) }),
|
|
87
|
-
/* @__PURE__ */ r("span", { className:
|
|
87
|
+
/* @__PURE__ */ r("span", { className: s(
|
|
88
88
|
"absolute",
|
|
89
89
|
"top-[50%]",
|
|
90
90
|
"block",
|
|
@@ -99,7 +99,7 @@ import '../../assets/UiToggle.css';const k = "_UiToggle__dot_1uov6_1", w = "_UiT
|
|
|
99
99
|
), children: /* @__PURE__ */ r(
|
|
100
100
|
"svg",
|
|
101
101
|
{
|
|
102
|
-
className:
|
|
102
|
+
className: s(
|
|
103
103
|
n.UiToggle__icon,
|
|
104
104
|
"absolute",
|
|
105
105
|
o ? "text-primary-300" : "text-primary-600",
|
|
@@ -1 +1 @@
|
|
|
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\";\nimport { EJustify } from \"../../_types/align\";\n\ntype TUiToggleProps = {\n\tchildren?: React.ReactNode\n\tdisabled?: boolean\n\tinvertOrder?: boolean\n\tjustify?: EJustify;\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\tjustify = EJustify.START,\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\tconst justificationClasses = {\n\t\t[EJustify.START]: \"justify-start\",\n\t\t[EJustify.END]: \"justify-end\",\n\t\t[EJustify.CENTER]: \"justify-center\",\n\t\t[EJustify.BETWEEN]: \"justify-between\",\n\t\t[EJustify.AROUND]: \"justify-around\",\n\t\t[EJustify.EVENLY]: \"justify-evenly\"\n\t};\n\n\treturn (\n\t\t<label className={ cx(\n\t\t\t\"ui-toggle\",\n\t\t\t\"flex\",\n\t\t\t\"cursor-pointer\",\n\t\t\t\"gap-sm\",\n\t\t\t\"rounded-full\",\n\t\t\t\"items-center\",\n\t\t\t\"w-full\",\n\t\t\t\"leading-normal\",\n\t\t\t\"text-md\",\n\t\t\t{\n\t\t\t\t\"flex-row-reverse\": invertOrder,\n\t\t\t\t\"pointer-events-none opacity-50\": disabled\n\t\t\t},\n\t\t\tjustificationClasses[justify],\n\t\t\tclassName\n\t\t) }>\n\t\t\t<span className={ cx(\n\t\t\t\t\"relative\",\n\t\t\t\t\"block\",\n\t\t\t\t\"h-md\"\n\t\t\t) }>\n\n\t\t\t\t<input className={ cx(\n\t\t\t\t\t\"absolute\",\n\t\t\t\t\t\"size-0\",\n\t\t\t\t\t\"appearance-none\",\n\t\t\t\t\t\"border-0\"\n\t\t\t\t) }\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\tchecked={ isChecked }\n\t\t\t\tonChange={ handleChange }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tvalue={ value }\n\t\t\t\t{ ...rest }\n\t\t\t\t>\n\t\t\t\t</input>\n\n\t\t\t\t<span className={ cx(\n\t\t\t\t\t\"block\",\n\t\t\t\t\t\"h-md\",\n\t\t\t\t\t\"w-xl\",\n\t\t\t\t\t\"rounded-full\",\n\t\t\t\t\t{\n\t\t\t\t\t\t\"bg-primary-600\": isChecked && !disabled,\n\t\t\t\t\t\t\"bg-secondary-alt-300\": !isChecked && disabled,\n\t\t\t\t\t\t\"bg-secondary-alt-600\": !isChecked && !disabled,\n\t\t\t\t\t\t\"bg-primary-300\": isChecked && disabled\n\n\t\t\t\t\t}\n\t\t\t\t) }/>\n\n\t\t\t\t<span className={ cx(\n\t\t\t\t\t\"absolute\",\n\t\t\t\t\t\"top-[50%]\",\n\t\t\t\t\t\"block\",\n\t\t\t\t\t\"rounded-full\",\n\t\t\t\t\t\"bg-white\",\n\t\t\t\t\tstyles.UiToggle__dot,\n\t\t\t\t\t{\n\t\t\t\t\t\t\"hover:shadow-border-secondary\": !isChecked && !disabled,\n\t\t\t\t\t\t\"hover:shadow-border-primary\": isChecked && !disabled,\n\t\t\t\t\t\t[styles.UiToggle__dot_checked]: isChecked\n\t\t\t\t\t},\n\n\t\t\t\t) }>\n\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclassName={ cx(\n\t\t\t\t\t\t\tstyles.UiToggle__icon,\n\t\t\t\t\t\t\t\"absolute\",\n\t\t\t\t\t\t\tdisabled\n\t\t\t\t\t\t\t\t? \"text-primary-300\"\n\t\t\t\t\t\t\t\t: \"text-primary-600\",\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t[styles.UiToggle__icon_checked]: isChecked ,\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t) }\n\t\t\t\t\t\twidth=\"16\"\n\t\t\t\t\t\theight=\"16\"\n\t\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path\n\t\t\t\t\t\t\td=\"M1 4.40106L6.60071 10.1135L15.1694 1.71245\"\n\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\tstrokeWidth=\"1.6\"\n\t\t\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</svg>\n\n\t\t\t\t</span>\n\t\t\t</span>\n\n\t\t\t{ children }\n\n\t\t</label>\n\n\t);\n};\n"],"names":["UiToggle","children","disabled","invertOrder","justify","EJustify","checked","value","className","defaultChecked","onChange","rest","toggled","setIsToggled","useState","isChecked","handleChange","useEffect","justificationClasses","jsxs","cx","jsx","styles"],"mappings":";;;;;;;;;GAgBaA,IAAqC,CAAC;AAAA,EAClD,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,aAAAC,IAAc;AAAA,EACd,SAAAC,IAAUC,EAAS;AAAA,EACnB,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;AAC1B,IAAIT,MAAU,UAAaD,MAAY,UACtCO,EAAa,CAACD,CAAO,GAGtBF,IAAW,CAACK,CAAS;AAAA,EACtB;AAEA,EAAAE,EAAU,MAAI;AACb,IAAKX,MAAY,UAChBO,EAAaP,CAAO;AAAA,EAEtB,GAAG,CAACA,CAAO,CAAC;AAEZ,QAAMY,IAAuB;AAAA,IAC5B,CAACb,EAAS,KAAK,GAAG;AAAA,IAClB,CAACA,EAAS,GAAG,GAAG;AAAA,IAChB,CAACA,EAAS,MAAM,GAAG;AAAA,IACnB,CAACA,EAAS,OAAO,GAAG;AAAA,IACpB,CAACA,EAAS,MAAM,GAAG;AAAA,IACnB,CAACA,EAAS,MAAM,GAAG;AAAA,EAAA;AAGpB,SACC,gBAAAc,EAAC,WAAM,WAAYC;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACC,oBAAoBjB;AAAA,MACpB,
|
|
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\";\nimport { EJustify } from \"../../_types/align\";\n\ntype TUiToggleProps = {\n\tchildren?: React.ReactNode\n\tdisabled?: boolean\n\tinvertOrder?: boolean\n\tjustify?: EJustify;\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\tjustify = EJustify.START,\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\tconst justificationClasses = {\n\t\t[EJustify.START]: \"justify-start\",\n\t\t[EJustify.END]: \"justify-end\",\n\t\t[EJustify.CENTER]: \"justify-center\",\n\t\t[EJustify.BETWEEN]: \"justify-between\",\n\t\t[EJustify.AROUND]: \"justify-around\",\n\t\t[EJustify.EVENLY]: \"justify-evenly\"\n\t};\n\n\treturn (\n\t\t<label className={ cx(\n\t\t\t\"ui-toggle\",\n\t\t\t\"flex\",\n\t\t\t\"cursor-pointer\",\n\t\t\t\"gap-sm\",\n\t\t\t\"rounded-full\",\n\t\t\t\"items-center\",\n\t\t\t\"w-full\",\n\t\t\t\"leading-normal\",\n\t\t\t\"text-md\",\n\t\t\t{\n\t\t\t\t\"flex-row-reverse\": invertOrder,\n\t\t\t\t\"pointer-events-none opacity-50 grayscale\": disabled\n\t\t\t},\n\t\t\tjustificationClasses[justify],\n\t\t\tclassName\n\t\t) }>\n\t\t\t<span className={ cx(\n\t\t\t\t\"relative\",\n\t\t\t\t\"block\",\n\t\t\t\t\"h-md\"\n\t\t\t) }>\n\n\t\t\t\t<input className={ cx(\n\t\t\t\t\t\"absolute\",\n\t\t\t\t\t\"size-0\",\n\t\t\t\t\t\"appearance-none\",\n\t\t\t\t\t\"border-0\"\n\t\t\t\t) }\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\tchecked={ isChecked }\n\t\t\t\tonChange={ handleChange }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tvalue={ value }\n\t\t\t\t{ ...rest }\n\t\t\t\t>\n\t\t\t\t</input>\n\n\t\t\t\t<span className={ cx(\n\t\t\t\t\t\"block\",\n\t\t\t\t\t\"h-md\",\n\t\t\t\t\t\"w-xl\",\n\t\t\t\t\t\"rounded-full\",\n\t\t\t\t\t{\n\t\t\t\t\t\t\"bg-primary-600\": isChecked && !disabled,\n\t\t\t\t\t\t\"bg-secondary-alt-300\": !isChecked && disabled,\n\t\t\t\t\t\t\"bg-secondary-alt-600\": !isChecked && !disabled,\n\t\t\t\t\t\t\"bg-primary-300\": isChecked && disabled\n\n\t\t\t\t\t}\n\t\t\t\t) }/>\n\n\t\t\t\t<span className={ cx(\n\t\t\t\t\t\"absolute\",\n\t\t\t\t\t\"top-[50%]\",\n\t\t\t\t\t\"block\",\n\t\t\t\t\t\"rounded-full\",\n\t\t\t\t\t\"bg-white\",\n\t\t\t\t\tstyles.UiToggle__dot,\n\t\t\t\t\t{\n\t\t\t\t\t\t\"hover:shadow-border-secondary\": !isChecked && !disabled,\n\t\t\t\t\t\t\"hover:shadow-border-primary\": isChecked && !disabled,\n\t\t\t\t\t\t[styles.UiToggle__dot_checked]: isChecked\n\t\t\t\t\t},\n\n\t\t\t\t) }>\n\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclassName={ cx(\n\t\t\t\t\t\t\tstyles.UiToggle__icon,\n\t\t\t\t\t\t\t\"absolute\",\n\t\t\t\t\t\t\tdisabled\n\t\t\t\t\t\t\t\t? \"text-primary-300\"\n\t\t\t\t\t\t\t\t: \"text-primary-600\",\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t[styles.UiToggle__icon_checked]: isChecked ,\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t) }\n\t\t\t\t\t\twidth=\"16\"\n\t\t\t\t\t\theight=\"16\"\n\t\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path\n\t\t\t\t\t\t\td=\"M1 4.40106L6.60071 10.1135L15.1694 1.71245\"\n\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\tstrokeWidth=\"1.6\"\n\t\t\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</svg>\n\n\t\t\t\t</span>\n\t\t\t</span>\n\n\t\t\t{ children }\n\n\t\t</label>\n\n\t);\n};\n"],"names":["UiToggle","children","disabled","invertOrder","justify","EJustify","checked","value","className","defaultChecked","onChange","rest","toggled","setIsToggled","useState","isChecked","handleChange","useEffect","justificationClasses","jsxs","cx","jsx","styles"],"mappings":";;;;;;;;;GAgBaA,IAAqC,CAAC;AAAA,EAClD,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,aAAAC,IAAc;AAAA,EACd,SAAAC,IAAUC,EAAS;AAAA,EACnB,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;AAC1B,IAAIT,MAAU,UAAaD,MAAY,UACtCO,EAAa,CAACD,CAAO,GAGtBF,IAAW,CAACK,CAAS;AAAA,EACtB;AAEA,EAAAE,EAAU,MAAI;AACb,IAAKX,MAAY,UAChBO,EAAaP,CAAO;AAAA,EAEtB,GAAG,CAACA,CAAO,CAAC;AAEZ,QAAMY,IAAuB;AAAA,IAC5B,CAACb,EAAS,KAAK,GAAG;AAAA,IAClB,CAACA,EAAS,GAAG,GAAG;AAAA,IAChB,CAACA,EAAS,MAAM,GAAG;AAAA,IACnB,CAACA,EAAS,OAAO,GAAG;AAAA,IACpB,CAACA,EAAS,MAAM,GAAG;AAAA,IACnB,CAACA,EAAS,MAAM,GAAG;AAAA,EAAA;AAGpB,SACC,gBAAAc,EAAC,WAAM,WAAYC;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACC,oBAAoBjB;AAAA,MACpB,4CAA4CD;AAAA,IAAA;AAAA,IAE7CgB,EAAqBd,CAAO;AAAA,IAC5BI;AAAA,EAAA,GAEA,UAAA;AAAA,IAAA,gBAAAW,EAAC,UAAK,WAAYC;AAAA,M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A,UAAA;AAAA,QACf;AAAA,MAAA,EACD,CAED;AAAA,IAAA,GACD;AAAA,IAEEpB;AAAA,EAAA,GAEH;AAGF;"}
|
|
@@ -6,11 +6,12 @@ type TUiTypographyProps<T extends keyof React.JSX.IntrinsicElements> = {
|
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
underline?: boolean;
|
|
8
8
|
lineHeight?: boolean;
|
|
9
|
+
lineHeightLegacy?: boolean;
|
|
9
10
|
size?: ETypographySizes;
|
|
10
11
|
textTransform?: ETextTransform;
|
|
11
12
|
align?: ETextAlign;
|
|
12
13
|
weight?: ETextWeight;
|
|
13
14
|
color?: EColors;
|
|
14
15
|
} & Omit<React.JSX.IntrinsicElements[T], "children" | "ref">;
|
|
15
|
-
export declare const UiTypography: <T extends keyof React.JSX.IntrinsicElements>({ children, tag, underline, lineHeight, size, textTransform, align, weight, color, className, ...rest }: TUiTypographyProps<T>) => React.JSX.Element;
|
|
16
|
+
export declare const UiTypography: <T extends keyof React.JSX.IntrinsicElements>({ children, tag, underline, lineHeight, size, textTransform, align, weight, color, className, lineHeightLegacy, ...rest }: TUiTypographyProps<T>) => React.JSX.Element;
|
|
16
17
|
export {};
|
|
@@ -1,33 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ETypographySizes as e, ETextTransform as
|
|
1
|
+
import L from "react";
|
|
2
|
+
import { ETypographySizes as e, ETextTransform as a, ETextAlign as x, ETextWeight as r } from "./_types.js";
|
|
3
3
|
import { EColors as t } from "../../_types/colors.js";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
[e.MD]: "text-md",
|
|
4
|
+
import X from "classnames";
|
|
5
|
+
const y = {
|
|
7
6
|
[e.XXS]: "text-xxs",
|
|
8
7
|
[e.XS]: "text-xs",
|
|
9
8
|
[e.SM]: "text-sm",
|
|
9
|
+
[e.MD]: "text-md",
|
|
10
10
|
[e.LG]: "text-lg",
|
|
11
11
|
[e.XL]: "text-xl",
|
|
12
12
|
[e.XXL]: "text-2xl",
|
|
13
13
|
[e.XXXL]: "text-3xl",
|
|
14
14
|
[e.XXXXL]: "text-4xl",
|
|
15
15
|
[e.XXXXXL]: "text-5xl"
|
|
16
|
-
},
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
16
|
+
}, m = {
|
|
17
|
+
[e.XXS]: "leading-normal",
|
|
18
|
+
[e.XS]: "leading-[150%]",
|
|
19
|
+
[e.SM]: "leading-[145%]",
|
|
20
|
+
[e.MD]: "leading-[150%]",
|
|
21
|
+
[e.LG]: "leading-[155%]",
|
|
22
|
+
[e.XL]: "leading-[140%]",
|
|
23
|
+
[e.XXL]: "leading-[135%]",
|
|
24
|
+
[e.XXXL]: "leading-[142%]",
|
|
25
|
+
[e.XXXXL]: "leading-[125%]",
|
|
26
|
+
[e.XXXXXL]: "leading-[140%]"
|
|
21
27
|
}, p = {
|
|
22
|
-
[a.
|
|
23
|
-
[a.
|
|
24
|
-
[a.
|
|
25
|
-
|
|
26
|
-
[R.LIGHT]: "font-light",
|
|
27
|
-
[R.REGULAR]: "font-medium",
|
|
28
|
-
[R.SEMI_BOLD]: "font-bold",
|
|
29
|
-
[R.BOLD]: "font-black"
|
|
28
|
+
[a.UPPERCASE]: "uppercase",
|
|
29
|
+
[a.LOWERCASE]: "lowercase",
|
|
30
|
+
[a.NONE]: "normal-case",
|
|
31
|
+
[a.CAPITALIZE]: "capitalize"
|
|
30
32
|
}, Y = {
|
|
33
|
+
[x.LEFT]: "text-left",
|
|
34
|
+
[x.RIGHT]: "text-right",
|
|
35
|
+
[x.CENTER]: "text-center"
|
|
36
|
+
}, d = {
|
|
37
|
+
[r.LIGHT]: "font-light",
|
|
38
|
+
[r.REGULAR]: "font-medium",
|
|
39
|
+
[r.SEMI_BOLD]: "font-bold",
|
|
40
|
+
[r.BOLD]: "font-black"
|
|
41
|
+
}, I = {
|
|
31
42
|
[t.WHITE]: "text-white",
|
|
32
43
|
[t.BLACK]: "text-black",
|
|
33
44
|
[t.TRANSPARENT]: "text-transparent",
|
|
@@ -86,46 +97,41 @@ const m = {
|
|
|
86
97
|
[t.ACCENT_ALT_400]: "text-accent-alt-400",
|
|
87
98
|
[t.ACCENT_ALT_500]: "text-accent-alt-500",
|
|
88
99
|
[t.ACCENT_ALT_600]: "text-accent-alt-600",
|
|
89
|
-
[t.ACCENT_ALT_700]: "text-accent-alt-700"
|
|
90
|
-
|
|
91
|
-
[t.BER_MID_GREEN]: "text-ber-mid-green",
|
|
92
|
-
[t.BER_BRIGHT_GREEN]: "text-ber-bright-green",
|
|
93
|
-
[t.BER_YELLOW]: "text-ber-yellow",
|
|
94
|
-
[t.BER_MID_ORANGE]: "text-ber-mid-orange",
|
|
95
|
-
[t.BER_DARK_ORANGE]: "text-ber-dark-orange",
|
|
96
|
-
[t.BER_RED]: "text-ber-red"
|
|
97
|
-
}, D = ({
|
|
100
|
+
[t.ACCENT_ALT_700]: "text-accent-alt-700"
|
|
101
|
+
}, P = ({
|
|
98
102
|
children: c,
|
|
99
103
|
tag: o,
|
|
100
104
|
underline: s = !1,
|
|
101
|
-
lineHeight:
|
|
102
|
-
size:
|
|
103
|
-
textTransform:
|
|
104
|
-
align:
|
|
105
|
-
weight:
|
|
106
|
-
color:
|
|
107
|
-
className:
|
|
108
|
-
|
|
105
|
+
lineHeight: i = !1,
|
|
106
|
+
size: R,
|
|
107
|
+
textTransform: n,
|
|
108
|
+
align: A,
|
|
109
|
+
weight: _,
|
|
110
|
+
color: l,
|
|
111
|
+
className: E,
|
|
112
|
+
lineHeightLegacy: C,
|
|
113
|
+
...T
|
|
109
114
|
}) => {
|
|
110
|
-
const
|
|
115
|
+
const N = X(
|
|
111
116
|
"ui-typography",
|
|
112
117
|
{
|
|
113
118
|
underline: s
|
|
114
119
|
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
C ? "leading-normal" : "leading-none",
|
|
121
|
+
i ? m[R || e.XXS] : "leading-none",
|
|
122
|
+
R && y[R],
|
|
123
|
+
n && p[n],
|
|
124
|
+
A && Y[A],
|
|
125
|
+
_ && d[_],
|
|
126
|
+
l && I[l],
|
|
127
|
+
E
|
|
122
128
|
);
|
|
123
|
-
return
|
|
124
|
-
className:
|
|
125
|
-
...
|
|
129
|
+
return L.createElement(o || "p", {
|
|
130
|
+
className: N,
|
|
131
|
+
...T
|
|
126
132
|
}, c);
|
|
127
133
|
};
|
|
128
134
|
export {
|
|
129
|
-
|
|
135
|
+
P as UiTypography
|
|
130
136
|
};
|
|
131
137
|
//# sourceMappingURL=UiTypography.js.map
|
|
@@ -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_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\t[EColors.BER_DARK_GREEN]: \"text-ber-dark-green\",\n\t[EColors.BER_MID_GREEN]: \"text-ber-mid-green\",\n\t[EColors.BER_BRIGHT_GREEN]: \"text-ber-bright-green\",\n\t[EColors.BER_YELLOW]: \"text-ber-yellow\",\n\t[EColors.BER_MID_ORANGE]: \"text-ber-mid-orange\",\n\t[EColors.BER_DARK_ORANGE]: \"text-ber-dark-orange\",\n\t[EColors.BER_RED]: \"text-ber-red\",\n\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\n\t\t\t? \"leading-normal\"\n\t\t\t: \"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,GA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AcY,CAAM;AAAA,IAC9BC,KAASX,EAAaW,CAAK;AAAA,IAC3BC;AAAA,EAAA;AAGD,SAAOI,EAAM,cAAcZ,KAAO,KAAK;AAAA,IACtC,WAAWU;AAAA,IACX,GAAGD;AAAA,EAAA,GACDV,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\tlineHeightLegacy?: 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.XXS]: \"text-xxs\",\n\t[ETypographySizes.XS]: \"text-xs\",\n\t[ETypographySizes.SM]: \"text-sm\",\n\t[ETypographySizes.MD]: \"text-md\",\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 lineHeightClasses = {\n\t[ETypographySizes.XXS]: \"leading-normal\",\n\t[ETypographySizes.XS]: \"leading-[150%]\",\n\t[ETypographySizes.SM]: \"leading-[145%]\",\n\t[ETypographySizes.MD]: \"leading-[150%]\",\n\t[ETypographySizes.LG]: \"leading-[155%]\",\n\t[ETypographySizes.XL]: \"leading-[140%]\",\n\t[ETypographySizes.XXL]: \"leading-[135%]\",\n\t[ETypographySizes.XXXL]: \"leading-[142%]\",\n\t[ETypographySizes.XXXXL]: \"leading-[125%]\",\n\t[ETypographySizes.XXXXXL]: \"leading-[140%]\",\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\tlineHeightLegacy,\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\tlineHeightLegacy\n\t\t\t? \"leading-normal\"\n\t\t\t: \"leading-none\",\n\t\tlineHeight\n\t\t\t? lineHeightClasses[size || ETypographySizes.XXS]\n\t\t\t: \"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","lineHeightClasses","textTransformClasses","ETextTransform","alignClasses","ETextAlign","weightClasses","ETextWeight","colorClasses","EColors","UiTypography","children","tag","underline","lineHeight","size","textTransform","align","weight","color","className","lineHeightLegacy","rest","classes","cx","React"],"mappings":";;;;AAkBA,MAAMA,IAAc;AAAA,EACnB,CAACC,EAAiB,GAAG,GAAG;AAAA,EACxB,CAACA,EAAiB,EAAE,GAAG;AAAA,EACvB,CAACA,EAAiB,EAAE,GAAG;AAAA,EACvB,CAACA,EAAiB,EAAE,GAAG;AAAA,EACvB,CAACA,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AA,IACHP,IACGb,EAAkBc,KAAQf,EAAiB,GAAG,IAC9C;AAAA,IACHe,KAAQhB,EAAYgB,CAAI;AAAA,IACxBC,KAAiBd,EAAqBc,CAAa;AAAA,IACnDC,KAASb,EAAaa,CAAK;AAAA,IAC3BC,KAAUZ,EAAcY,CAAM;AAAA,IAC9BC,KAASX,EAAaW,CAAK;AAAA,IAC3BC;AAAA,EAAA;AAGD,SAAOK,EAAM,cAAcb,KAAO,KAAK;AAAA,IACtC,WAAWW;AAAA,IACX,GAAGD;AAAA,EAAA,GACDX,CAAQ;AACZ;"}
|
|
@@ -24,7 +24,7 @@ export declare enum ETypographySizes {
|
|
|
24
24
|
*/
|
|
25
25
|
XL = "xl",
|
|
26
26
|
/**
|
|
27
|
-
* 24px
|
|
27
|
+
* @deprecated 24px - use XXXL instead
|
|
28
28
|
*/
|
|
29
29
|
XXL = "2xl",
|
|
30
30
|
/**
|
|
@@ -32,7 +32,7 @@ export declare enum ETypographySizes {
|
|
|
32
32
|
*/
|
|
33
33
|
XXXL = "3xl",
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* 32px
|
|
36
36
|
*/
|
|
37
37
|
XXXXL = "4xl",
|
|
38
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_types.js","sources":["../../../src/components/UiTypography/_types.ts"],"sourcesContent":["export enum ETypographySizes {\n\t/**\n\t * 10px\n\t */\n\tXXS = \"xxs\",\n\t/**\n\t * 12px\n\t */\n\tXS = \"xs\",\n\t/**\n\t * 14px\n\t */\n\tSM = \"sm\",\n\t/**\n\t * 16px\n\t */\n\tMD = \"md\",\n\t/**\n\t * 18px\n\t */\n\tLG = \"lg\",\n\t/**\n\t * 20px\n\t */\n\tXL = \"xl\",\n\t/**\n\t * 24px\n\t */\n\tXXL = \"2xl\",\n\t/**\n\t * 28px\n\t */\n\tXXXL = \"3xl\",\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"_types.js","sources":["../../../src/components/UiTypography/_types.ts"],"sourcesContent":["export enum ETypographySizes {\n\t/**\n\t * 10px\n\t */\n\tXXS = \"xxs\",\n\t/**\n\t * 12px\n\t */\n\tXS = \"xs\",\n\t/**\n\t * 14px\n\t */\n\tSM = \"sm\",\n\t/**\n\t * 16px\n\t */\n\tMD = \"md\",\n\t/**\n\t * 18px\n\t */\n\tLG = \"lg\",\n\t/**\n\t * 20px\n\t */\n\tXL = \"xl\",\n\t/**\n\t * @deprecated 24px - use XXXL instead\n\t */\n\tXXL = \"2xl\",\n\t/**\n\t * 28px\n\t */\n\tXXXL = \"3xl\",\n\t/**\n\t * 32px\n\t */\n\tXXXXL = \"4xl\",\n\t/**\n\t * 40px\n\t */\n\tXXXXXL = \"5xl\",\n}\n\nexport enum ETextWeight {\n\t/**\n\t * 300\n\t */\n\tLIGHT = \"light\",\n\t/**\n\t * 500\n\t */\n\tREGULAR = \"regular\",\n\t/**\n\t * 700\n\t */\n\tSEMI_BOLD = \"semi_bold\",\n\t/**\n\t * 900\n\t */\n\tBOLD = \"bold\",\n}\n\nexport enum ETextAlign {\n\tLEFT = \"left\",\n\tCENTER = \"center\",\n\tRIGHT = \"right\",\n}\n\nexport enum ETextTransform {\n\tLOWERCASE = \"lowercase\",\n\tUPPERCASE = \"uppercase\",\n\tCAPITALIZE = \"capitalize\",\n\tNONE = \"none\",\n}\n"],"names":["ETypographySizes","ETextWeight","ETextAlign","ETextTransform"],"mappings":"AAAO,IAAKA,sBAAAA,OAIXA,EAAA,MAAM,OAINA,EAAA,KAAK,MAILA,EAAA,KAAK,MAILA,EAAA,KAAK,MAILA,EAAA,KAAK,MAILA,EAAA,KAAK,MAILA,EAAA,MAAM,OAINA,EAAA,OAAO,OAIPA,EAAA,QAAQ,OAIRA,EAAA,SAAS,OAxCEA,IAAAA,KAAA,CAAA,CAAA,GA2CAC,sBAAAA,OAIXA,EAAA,QAAQ,SAIRA,EAAA,UAAU,WAIVA,EAAA,YAAY,aAIZA,EAAA,OAAO,QAhBIA,IAAAA,KAAA,CAAA,CAAA,GAmBAC,sBAAAA,OACXA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAHGA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACXA,EAAA,YAAY,aACZA,EAAA,YAAY,aACZA,EAAA,aAAa,cACbA,EAAA,OAAO,QAJIA,IAAAA,KAAA,CAAA,CAAA;"}
|
package/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './components/UiCheckbox';
|
|
|
6
6
|
export * from './components/UiIcon';
|
|
7
7
|
export * from './components/UiIconBadge';
|
|
8
8
|
export * from './components/UiInput';
|
|
9
|
+
export * from './components/UiInputTextArea';
|
|
9
10
|
export * from './components/UiInputRange';
|
|
10
11
|
export * from './components/UiList';
|
|
11
12
|
export * from './components/UiNotificationBadge';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bonkers-ui",
|
|
3
|
-
"version": "v2.0.
|
|
3
|
+
"version": "v2.0.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Bonkers ui library",
|
|
6
6
|
"author": "cc6.magister@gmail.com",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"deploy": "gh-pages -d storybook-static",
|
|
10
10
|
"lint": "eslint --fix './src/**/*.{ts,tsx}'",
|
|
11
11
|
"lint:style": "bun run prettier './src/**/*.{css,scss}' --check",
|
|
12
|
-
"upgrade": "bun
|
|
12
|
+
"upgrade": "bun update --interactive",
|
|
13
13
|
"build-storybook": "storybook build",
|
|
14
14
|
"build": "tsc && vite build",
|
|
15
15
|
"typecheck": "tsc --noEmit",
|
|
@@ -18,51 +18,51 @@
|
|
|
18
18
|
"prepare": "husky"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@tailwindcss/vite": "^4.1.
|
|
22
|
-
"ajv": "^8.17.1",
|
|
21
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
23
22
|
"classnames": "^2.5.1",
|
|
24
23
|
"postcss": "^8.5.6",
|
|
25
|
-
"
|
|
26
|
-
"react": "^19.2.
|
|
27
|
-
"
|
|
28
|
-
"tailwindcss": "^4.1.
|
|
29
|
-
"
|
|
24
|
+
"react": "^19.2.3",
|
|
25
|
+
"react-dom": "^19.2.3",
|
|
26
|
+
"storybook": "^10.1.11",
|
|
27
|
+
"tailwindcss": "^4.1.18",
|
|
28
|
+
"typescript": "^5.9.3",
|
|
29
|
+
"ajv": "^8.17.1",
|
|
30
|
+
"vite": "^7.3.1"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
|
-
"
|
|
33
|
-
"@storybook
|
|
34
|
-
"
|
|
35
|
-
"@storybook/
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@types/
|
|
40
|
-
"@
|
|
41
|
-
"
|
|
42
|
-
"
|
|
33
|
+
"vite-tsconfig-paths": "^6.0.3",
|
|
34
|
+
"@chromatic-com/storybook": "^4.1.3",
|
|
35
|
+
"prettier": "^3.7.4",
|
|
36
|
+
"@storybook/addon-docs": "^10.1.11",
|
|
37
|
+
"@storybook/addon-onboarding": "^10.1.11",
|
|
38
|
+
"@storybook/react-vite": "^10.1.11",
|
|
39
|
+
"@stylistic/eslint-plugin": "^5.6.1",
|
|
40
|
+
"@types/bun": "1.3.5",
|
|
41
|
+
"@types/react": "^19.2.7",
|
|
42
|
+
"@types/react-dom": "^19.2.3",
|
|
43
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
44
|
+
"eslint": "^9.39.2",
|
|
45
|
+
"eslint-plugin-better-tailwindcss": "^3.8.0",
|
|
43
46
|
"eslint-plugin-react": "^7.37.5",
|
|
44
|
-
"eslint-plugin-storybook": "^
|
|
47
|
+
"eslint-plugin-storybook": "^10.1.11",
|
|
45
48
|
"eslint-plugin-tailwindcss": "^3.18.2",
|
|
46
49
|
"gh-pages": "^6.3.0",
|
|
47
50
|
"husky": "^9.1.7",
|
|
48
|
-
"lint-staged": "^16.2.
|
|
49
|
-
"
|
|
50
|
-
"typescript": "^5.9.3",
|
|
51
|
-
"typescript-eslint": "^8.46.1",
|
|
52
|
-
"vite": "^7.1.11",
|
|
51
|
+
"lint-staged": "^16.2.7",
|
|
52
|
+
"typescript-eslint": "^8.52.0",
|
|
53
53
|
"vite-plugin-dts": "^4.5.4",
|
|
54
54
|
"vite-plugin-lib-inject-css": "^2.2.2"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@fortawesome/fontawesome-svg-core": "^
|
|
58
|
-
"@fortawesome/free-brands-svg-icons": "^
|
|
59
|
-
"@fortawesome/free-regular-svg-icons": "^
|
|
60
|
-
"@fortawesome/free-solid-svg-icons": "^
|
|
61
|
-
"@fortawesome/react-fontawesome": "^0.2.
|
|
57
|
+
"@fortawesome/fontawesome-svg-core": "^7.1.0",
|
|
58
|
+
"@fortawesome/free-brands-svg-icons": "^7.1.0",
|
|
59
|
+
"@fortawesome/free-regular-svg-icons": "^7.1.0",
|
|
60
|
+
"@fortawesome/free-solid-svg-icons": "^7.1.0",
|
|
61
|
+
"@fortawesome/react-fontawesome": "^0.2.6",
|
|
62
62
|
"classnames": "^2",
|
|
63
|
-
"react": "^
|
|
64
|
-
"react-dom": "^
|
|
65
|
-
"tailwindcss": "^4"
|
|
63
|
+
"react": "^19.2.3",
|
|
64
|
+
"react-dom": "^19.2.3",
|
|
65
|
+
"tailwindcss": "^4.1.18"
|
|
66
66
|
},
|
|
67
67
|
"lint-staged": {
|
|
68
68
|
"./src/**/*.css": [
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UiInputTextArea.js","sources":["../../../src/components/UiInput/UiInputTextArea.tsx"],"sourcesContent":["import { UiTypography } from \"../UiTypography\";\nimport { EInputKind } from \"./_types\";\nimport cx from \"classnames\";\nimport { UiInputStatusMessage } from \"./UiInputStatusMessage\";\nimport type { FC, ReactNode, TextareaHTMLAttributes } from \"react\";\n\ntype TUiInputTextAreaProps = {\n\tid: string;\n\tkind?: EInputKind;\n\tstatusMessage?: ReactNode;\n\tpostIcon?: ReactNode;\n\tpreIcon?: ReactNode;\n\tclassName?: string;\n} & TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nconst stateClasses = {\n\t[EInputKind.DEFAULT]: \"border-secondary-alt-600\",\n\t[EInputKind.ERROR]: \"border-error\",\n\t[EInputKind.SUCCESS]: \"border-primary-600\",\n\t[EInputKind.WARNING]: \"border-warning-600\"\n};\n\nexport const UiInputTextArea: FC<TUiInputTextAreaProps> = ({\n\tid,\n\tplaceholder,\n\tclassName,\n\tkind,\n\tpreIcon,\n\tpostIcon,\n\tstatusMessage,\n\t...rest\n}) => {\n\treturn (\n\t\t<>\n\t\t\t<UiTypography\n\t\t\t\ttag=\"label\"\n\t\t\t\thtmlFor={ id }\n\t\t\t\tclassName={\n\t\t\t\t\tcx(\n\t\t\t\t\t\t\"ui-text-area-wrapper\",\n\t\t\t\t\t\t\"flex flex-row items-center gap-sm rounded-xl border p-xs\",\n\t\t\t\t\t\t\"hover:border-secondary-alt-700\",\n\t\t\t\t\t\t\"focus-within:outline-4\",\n\t\t\t\t\t\t\"focus-within:outline-primary-300\",\n\t\t\t\t\t\t\"focus-within:ring-secondary-alt-700 active:ring\",\n\t\t\t\t\t\tkind && stateClasses[kind],\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"bg-white\": !rest.disabled,\n\t\t\t\t\t\t\t\"border-secondary-alt-300 bg-secondary-alt-200\": rest.disabled,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{ preIcon\n\t\t\t\t\t? preIcon\n\t\t\t\t\t: null }\n\t\t\t\t<textarea\n\t\t\t\t\tid={ id }\n\t\t\t\t\tclassName={ cx(`\n min-h-xxl\n w-full\n resize-y\n `) }\n\t\t\t\t\trows={ 3 }\n\t\t\t\t\tonKeyDown={ (e) => {\n\t\t\t\t\t\tif (e.key === \"Enter\") {\n\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\t{ ...rest }\n\t\t\t\t/>\n\t\t\t\t{ postIcon\n\t\t\t\t\t? postIcon\n\t\t\t\t\t: null }\n\t\t\t</UiTypography>\n\t\t\t{\n\t\t\t\tstatusMessage\n\t\t\t\t\t? (\n\t\t\t\t\t\t<UiInputStatusMessage\n\t\t\t\t\t\t\tkind={ kind }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ statusMessage }\n\t\t\t\t\t\t</UiInputStatusMessage>\n\t\t\t\t\t)\n\t\t\t\t\t: null\n\t\t\t}\n\t\t</>\n\t);\n};\n"],"names":["stateClasses","EInputKind","UiInputTextArea","id","placeholder","className","kind","preIcon","postIcon","statusMessage","rest","jsxs","Fragment","UiTypography","cx","jsx","e","UiInputStatusMessage"],"mappings":";;;;;AAeA,MAAMA,IAAe;AAAA,EACpB,CAACC,EAAW,OAAO,GAAG;AAAA,EACtB,CAACA,EAAW,KAAK,GAAG;AAAA,EACpB,CAACA,EAAW,OAAO,GAAG;AAAA,EACtB,CAACA,EAAW,OAAO,GAAG;AACvB,GAEaC,IAA6C,CAAC;AAAA,EAC1D,IAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAGC;AACJ,MAEE,gBAAAC,EAAAC,GAAA,EACC,UAAA;AAAA,EAAA,gBAAAD;AAAA,IAACE;AAAA,IAAA;AAAA,MACA,KAAI;AAAA,MACJ,SAAUV;AAAA,MACV,WACCW;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACAR,KAAQN,EAAaM,CAAI;AAAA,QACzB;AAAA,UACC,YAAY,CA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