@iit/precision-ui 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ArticlePreviewTag.d.ts +11 -0
- package/dist/components/ArticlePreviewTag.d.ts.map +1 -0
- package/dist/components/cards/AdvantageWithAccordion.d.ts +12 -0
- package/dist/components/cards/AdvantageWithAccordion.d.ts.map +1 -0
- package/dist/components/cards/Connect.d.ts +19 -0
- package/dist/components/cards/Connect.d.ts.map +1 -0
- package/dist/components/cards/Doc.d.ts +11 -0
- package/dist/components/cards/Doc.d.ts.map +1 -0
- package/dist/components/cards/FAQ.d.ts +14 -0
- package/dist/components/cards/FAQ.d.ts.map +1 -0
- package/dist/components/cards/License.d.ts +10 -0
- package/dist/components/cards/License.d.ts.map +1 -0
- package/dist/components/cards/Package.d.ts +28 -0
- package/dist/components/cards/Package.d.ts.map +1 -0
- package/dist/components/pieces/ShowMoreAccordionTrigger.d.ts +8 -0
- package/dist/components/pieces/ShowMoreAccordionTrigger.d.ts.map +1 -0
- package/dist/components/ui/TagLink.d.ts +14 -0
- package/dist/components/ui/TagLink.d.ts.map +1 -0
- package/dist/components/ui/accordion.d.ts +15 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/icons/comet.svg +5 -0
- package/dist/index.d.ts +38 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +112 -63
- package/dist/index.es.js.map +1 -1
- package/dist/index.es10.js +1 -1
- package/dist/index.es11.js +1 -1
- package/dist/index.es12.js +1 -1
- package/dist/index.es13.js +79 -24
- package/dist/index.es13.js.map +1 -1
- package/dist/index.es14.js +83 -26
- package/dist/index.es14.js.map +1 -1
- package/dist/index.es15.js +19 -19
- package/dist/index.es15.js.map +1 -1
- package/dist/index.es16.js +28 -25
- package/dist/index.es16.js.map +1 -1
- package/dist/index.es17.js +24 -69
- package/dist/index.es17.js.map +1 -1
- package/dist/index.es18.js +22 -32
- package/dist/index.es18.js.map +1 -1
- package/dist/index.es19.js +72 -31
- package/dist/index.es19.js.map +1 -1
- package/dist/index.es2.js +1 -1
- package/dist/index.es20.js +24 -19
- package/dist/index.es20.js.map +1 -1
- package/dist/index.es21.js +30 -26
- package/dist/index.es21.js.map +1 -1
- package/dist/index.es22.js +25 -205
- package/dist/index.es22.js.map +1 -1
- package/dist/index.es23.js +17 -50
- package/dist/index.es23.js.map +1 -1
- package/dist/index.es24.js +40 -52
- package/dist/index.es24.js.map +1 -1
- package/dist/index.es25.js +30 -54
- package/dist/index.es25.js.map +1 -1
- package/dist/index.es26.js +52 -18
- package/dist/index.es26.js.map +1 -1
- package/dist/index.es27.js +14 -19
- package/dist/index.es27.js.map +1 -1
- package/dist/index.es28.js +6 -91
- package/dist/index.es28.js.map +1 -1
- package/dist/index.es29.js +53 -90
- package/dist/index.es29.js.map +1 -1
- package/dist/index.es3.js +2 -2
- package/dist/index.es30.js +25 -31
- package/dist/index.es30.js.map +1 -1
- package/dist/index.es31.js +97 -6
- package/dist/index.es31.js.map +1 -1
- package/dist/index.es32.js +55 -21
- package/dist/index.es32.js.map +1 -1
- package/dist/index.es33.js +90 -18
- package/dist/index.es33.js.map +1 -1
- package/dist/index.es34.js +96 -18
- package/dist/index.es34.js.map +1 -1
- package/dist/index.es35.js +11 -9
- package/dist/index.es35.js.map +1 -1
- package/dist/index.es36.js +42 -82
- package/dist/index.es36.js.map +1 -1
- package/dist/index.es37.js +23 -18
- package/dist/index.es37.js.map +1 -1
- package/dist/index.es38.js +36 -43
- package/dist/index.es38.js.map +1 -1
- package/dist/index.es39.js +24 -49
- package/dist/index.es39.js.map +1 -1
- package/dist/index.es4.js +1 -1
- package/dist/index.es40.js +205 -34
- package/dist/index.es40.js.map +1 -1
- package/dist/index.es41.js +46 -50
- package/dist/index.es41.js.map +1 -1
- package/dist/index.es42.js +47 -81
- package/dist/index.es42.js.map +1 -1
- package/dist/index.es43.js +60 -97
- package/dist/index.es43.js.map +1 -1
- package/dist/index.es44.js +19 -26
- package/dist/index.es44.js.map +1 -1
- package/dist/index.es45.js +17 -45
- package/dist/index.es45.js.map +1 -1
- package/dist/index.es46.js +75 -226
- package/dist/index.es46.js.map +1 -1
- package/dist/index.es47.js +90 -16
- package/dist/index.es47.js.map +1 -1
- package/dist/index.es48.js +33 -4
- package/dist/index.es48.js.map +1 -1
- package/dist/index.es49.js +80 -0
- package/dist/index.es49.js.map +1 -0
- package/dist/index.es5.js +1 -1
- package/dist/index.es50.js +46 -0
- package/dist/index.es50.js.map +1 -0
- package/dist/index.es51.js +14 -0
- package/dist/index.es51.js.map +1 -0
- package/dist/index.es52.js +9 -0
- package/dist/index.es52.js.map +1 -0
- package/dist/index.es53.js +25 -0
- package/dist/index.es53.js.map +1 -0
- package/dist/index.es54.js +23 -0
- package/dist/index.es54.js.map +1 -0
- package/dist/index.es55.js +23 -0
- package/dist/index.es55.js.map +1 -0
- package/dist/index.es56.js +50 -0
- package/dist/index.es56.js.map +1 -0
- package/dist/index.es57.js +30 -0
- package/dist/index.es57.js.map +1 -0
- package/dist/index.es58.js +19 -0
- package/dist/index.es58.js.map +1 -0
- package/dist/index.es59.js +245 -0
- package/dist/index.es59.js.map +1 -0
- package/dist/index.es6.js +1 -1
- package/dist/index.es60.js +7 -0
- package/dist/index.es60.js.map +1 -0
- package/dist/index.es7.js +1 -1
- package/dist/index.es8.js +1 -1
- package/dist/styles.css +206 -0
- package/package.json +5 -3
package/dist/index.es13.js
CHANGED
|
@@ -1,31 +1,86 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import e, { useState as v, useRef as b, useEffect as w } from "react";
|
|
2
|
+
import { Button as o } from "./index.es2.js";
|
|
3
|
+
import { Close16X16 as h } from "@iit/precision-ui-icons";
|
|
4
|
+
import { Input as d } from "./index.es11.js";
|
|
5
|
+
import { SearchIcon as g } from "lucide-react";
|
|
6
|
+
const x = ({
|
|
7
|
+
id: s,
|
|
8
|
+
placeholder: u,
|
|
9
|
+
className: c,
|
|
10
|
+
value: l = "",
|
|
11
|
+
onChange: t,
|
|
12
|
+
variant: y = "default",
|
|
13
|
+
...p
|
|
14
|
+
}) => {
|
|
15
|
+
const [a, n] = v(l), r = b(null);
|
|
16
|
+
w(() => {
|
|
17
|
+
n(l);
|
|
18
|
+
}, [l]);
|
|
19
|
+
const i = (f) => {
|
|
20
|
+
n(f.target.value), t && t(f);
|
|
21
|
+
}, m = () => {
|
|
22
|
+
n(""), r.current && r.current.focus(), t && t({
|
|
23
|
+
target: { value: "" }
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
return y === "white" ? /* @__PURE__ */ e.createElement("div", { className: "relative w-full max-w-md" }, /* @__PURE__ */ e.createElement(
|
|
27
|
+
o,
|
|
28
|
+
{
|
|
29
|
+
type: "button",
|
|
30
|
+
variant: "ghost",
|
|
31
|
+
size: "icon",
|
|
32
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2 h-10 w-10 text-muted-foreground bg-navy-opacity-8 p-3 rounded-full"
|
|
12
33
|
},
|
|
13
|
-
|
|
14
|
-
|
|
34
|
+
/* @__PURE__ */ e.createElement(g, { className: "" })
|
|
35
|
+
), /* @__PURE__ */ e.createElement(
|
|
36
|
+
d,
|
|
37
|
+
{
|
|
38
|
+
ref: r,
|
|
39
|
+
id: s,
|
|
40
|
+
placeholder: u,
|
|
41
|
+
className: `w-full pl-4 pr-16 ${c} bg-whitish rounded-full border-b-transparent h-14`,
|
|
42
|
+
value: a,
|
|
43
|
+
onChange: i,
|
|
44
|
+
...p
|
|
15
45
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
46
|
+
), /* @__PURE__ */ e.createElement(
|
|
47
|
+
o,
|
|
48
|
+
{
|
|
49
|
+
type: "button",
|
|
50
|
+
variant: "ghost",
|
|
51
|
+
size: "icon",
|
|
52
|
+
className: "absolute right-14 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground bg-navy-opacity-8 p-0 hover:bg-navy group",
|
|
53
|
+
onClick: m,
|
|
54
|
+
style: { display: a ? "block" : "none" }
|
|
55
|
+
},
|
|
56
|
+
/* @__PURE__ */ e.createElement(h, { className: "h-[10px] w-[10px] left-[5px] top-0 relative group-hover:text-whitish" }),
|
|
57
|
+
/* @__PURE__ */ e.createElement("span", { className: "sr-only" }, "Очистить")
|
|
58
|
+
)) : /* @__PURE__ */ e.createElement("div", { className: "relative w-full max-w-md" }, /* @__PURE__ */ e.createElement(g, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground" }), /* @__PURE__ */ e.createElement(
|
|
59
|
+
d,
|
|
20
60
|
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
61
|
+
ref: r,
|
|
62
|
+
id: s,
|
|
63
|
+
placeholder: u,
|
|
64
|
+
className: `w-full pl-10 pr-10 ${c}`,
|
|
65
|
+
value: a,
|
|
66
|
+
onChange: i,
|
|
67
|
+
...p
|
|
24
68
|
}
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
|
|
69
|
+
), /* @__PURE__ */ e.createElement(
|
|
70
|
+
o,
|
|
71
|
+
{
|
|
72
|
+
type: "button",
|
|
73
|
+
variant: "ghost",
|
|
74
|
+
size: "icon",
|
|
75
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground bg-navy-opacity-8 p-0 hover:bg-navy group",
|
|
76
|
+
onClick: m,
|
|
77
|
+
style: { display: a ? "block" : "none" }
|
|
78
|
+
},
|
|
79
|
+
/* @__PURE__ */ e.createElement(h, { className: "h-[10px] w-[10px] left-[5px] top-0 relative group-hover:text-whitish" }),
|
|
80
|
+
/* @__PURE__ */ e.createElement("span", { className: "sr-only" }, "Очистить")
|
|
81
|
+
));
|
|
82
|
+
}, S = x;
|
|
28
83
|
export {
|
|
29
|
-
|
|
84
|
+
S as default
|
|
30
85
|
};
|
|
31
86
|
//# sourceMappingURL=index.es13.js.map
|
package/dist/index.es13.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es13.js","sources":["../src/components/ui/
|
|
1
|
+
{"version":3,"file":"index.es13.js","sources":["../src/components/ui/input/SearchInput.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react'\r\n\r\nimport { Button } from '../button'\r\nimport { Close16X16 } from '@iit/precision-ui-icons'\r\nimport { Input } from '@/components/ui/input'\r\nimport { SearchIcon } from 'lucide-react'\r\n\r\ninterface SearchInputProps {\r\n id?: string\r\n placeholder?: string\r\n className?: string\r\n value?: string\r\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void\r\n variant?: 'default' | 'white'\r\n}\r\n\r\nconst SearchInput: React.FC<SearchInputProps> = ({\r\n id,\r\n placeholder,\r\n className,\r\n value = '',\r\n onChange,\r\n variant = 'default',\r\n ...props\r\n}) => {\r\n const [inputValue, setInputValue] = useState(value)\r\n const inputRef = useRef<HTMLInputElement>(null)\r\n\r\n useEffect(() => {\r\n setInputValue(value)\r\n }, [value])\r\n\r\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n setInputValue(event.target.value)\r\n if (onChange) {\r\n onChange(event)\r\n }\r\n }\r\n\r\n const handleClearClick = () => {\r\n setInputValue('')\r\n if (inputRef.current) {\r\n inputRef.current.focus()\r\n }\r\n if (onChange) {\r\n onChange({\r\n target: { value: '' },\r\n } as React.ChangeEvent<HTMLInputElement>)\r\n }\r\n }\r\n\r\n if (variant === 'white') {\r\n return (\r\n <div className=\"relative w-full max-w-md\">\r\n {/* TODO: replace with icon from icon lib */}\r\n {/* <div className=\"bg-navy-opacity-16 p-1 rounded-full\">\r\n <SearchIcon className=\"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground\" />\r\n </div> */}\r\n\r\n {/* <SearchIcon className=\"absolute right-3 top-1/2 -translate-y-1/2 h-10 w-10 text-muted-foreground bg-navy-opacity-8 p-3 rounded-full\" /> */}\r\n <Button\r\n type=\"button\"\r\n variant=\"ghost\"\r\n size=\"icon\"\r\n className=\"absolute right-2 top-1/2 -translate-y-1/2 h-10 w-10 text-muted-foreground bg-navy-opacity-8 p-3 rounded-full\"\r\n >\r\n <SearchIcon className=\"\" />\r\n </Button>\r\n <Input\r\n ref={inputRef}\r\n id={id}\r\n placeholder={placeholder}\r\n className={`w-full pl-4 pr-16 ${className} bg-whitish rounded-full border-b-transparent h-14`}\r\n value={inputValue}\r\n onChange={handleInputChange}\r\n {...props}\r\n />\r\n <Button\r\n type=\"button\"\r\n variant=\"ghost\"\r\n size=\"icon\"\r\n className=\"absolute right-14 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground bg-navy-opacity-8 p-0 hover:bg-navy group\"\r\n onClick={handleClearClick}\r\n style={{ display: inputValue ? 'block' : 'none' }}\r\n >\r\n {/* <XIcon className=\"h-4 w-4 left-[2px] top-0 relative group-hover:text-whitish\" /> */}\r\n <Close16X16 className=\"h-[10px] w-[10px] left-[5px] top-0 relative group-hover:text-whitish\" />\r\n <span className=\"sr-only\">Очистить</span>\r\n </Button>\r\n </div>\r\n )\r\n }\r\n\r\n return (\r\n <div className=\"relative w-full max-w-md\">\r\n {/* TODO: replace with icon from icon lib */}\r\n <SearchIcon className=\"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground\" />\r\n <Input\r\n ref={inputRef}\r\n id={id}\r\n placeholder={placeholder}\r\n className={`w-full pl-10 pr-10 ${className}`}\r\n value={inputValue}\r\n onChange={handleInputChange}\r\n {...props}\r\n />\r\n <Button\r\n type=\"button\"\r\n variant=\"ghost\"\r\n size=\"icon\"\r\n className=\"absolute right-3 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground bg-navy-opacity-8 p-0 hover:bg-navy group\"\r\n onClick={handleClearClick}\r\n style={{ display: inputValue ? 'block' : 'none' }}\r\n >\r\n {/* <XIcon className=\"h-4 w-4 left-[2px] top-0 relative group-hover:text-whitish\" /> */}\r\n <Close16X16 className=\"h-[10px] w-[10px] left-[5px] top-0 relative group-hover:text-whitish\" />\r\n <span className=\"sr-only\">Очистить</span>\r\n </Button>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SearchInput\r\n"],"names":["SearchInput","id","placeholder","className","value","onChange","variant","props","inputValue","setInputValue","useState","inputRef","useRef","useEffect","handleInputChange","event","handleClearClick","React","Button","SearchIcon","Input","Close16X16","SearchInput$1"],"mappings":";;;;;AAgBA,MAAMA,IAA0C,CAAC;AAAA,EAC/C,IAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,UAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAASN,CAAK,GAC5CO,IAAWC,EAAyB,IAAI;AAE9C,EAAAC,EAAU,MAAM;AACd,IAAAJ,EAAcL,CAAK;AAAA,EAAA,GAClB,CAACA,CAAK,CAAC;AAEJ,QAAAU,IAAoB,CAACC,MAA+C;AAC1D,IAAAN,EAAAM,EAAM,OAAO,KAAK,GAC5BV,KACFA,EAASU,CAAK;AAAA,EAChB,GAGIC,IAAmB,MAAM;AAC7B,IAAAP,EAAc,EAAE,GACZE,EAAS,WACXA,EAAS,QAAQ,SAEfN,KACOA,EAAA;AAAA,MACP,QAAQ,EAAE,OAAO,GAAG;AAAA,IAAA,CACkB;AAAA,EAC1C;AAGF,SAAIC,MAAY,UAEZW,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAU,2BAOb,GAAAA,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,WAAU;AAAA,IAAA;AAAA,IAEVD,gBAAAA,EAAA,cAACE,GAAW,EAAA,WAAU,GAAG,CAAA;AAAA,EAE3B,GAAAF,gBAAAA,EAAA;AAAA,IAACG;AAAA,IAAA;AAAA,MACC,KAAKT;AAAA,MACL,IAAAV;AAAA,MACA,aAAAC;AAAA,MACA,WAAW,qBAAqBC,CAAS;AAAA,MACzC,OAAOK;AAAA,MACP,UAAUM;AAAA,MACT,GAAGP;AAAA,IAAA;AAAA,EAEN,GAAAU,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,WAAU;AAAA,MACV,SAASF;AAAA,MACT,OAAO,EAAE,SAASR,IAAa,UAAU,OAAO;AAAA,IAAA;AAAA,IAGhDS,gBAAAA,EAAA,cAACI,GAAW,EAAA,WAAU,uEAAuE,CAAA;AAAA,IAC5FJ,gBAAAA,EAAA,cAAA,QAAA,EAAK,WAAU,UAAA,GAAU,UAAQ;AAAA,EAAA,CAEtC,IAKFA,gBAAAA,EAAA,cAAC,SAAI,WAAU,2BAAA,mCAEZE,GAAW,EAAA,WAAU,0EAAyE,GAC/FF,gBAAAA,EAAA;AAAA,IAACG;AAAA,IAAA;AAAA,MACC,KAAKT;AAAA,MACL,IAAAV;AAAA,MACA,aAAAC;AAAA,MACA,WAAW,sBAAsBC,CAAS;AAAA,MAC1C,OAAOK;AAAA,MACP,UAAUM;AAAA,MACT,GAAGP;AAAA,IAAA;AAAA,EAEN,GAAAU,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,WAAU;AAAA,MACV,SAASF;AAAA,MACT,OAAO,EAAE,SAASR,IAAa,UAAU,OAAO;AAAA,IAAA;AAAA,IAGhDS,gBAAAA,EAAA,cAACI,GAAW,EAAA,WAAU,uEAAuE,CAAA;AAAA,IAC5FJ,gBAAAA,EAAA,cAAA,QAAA,EAAK,WAAU,UAAA,GAAU,UAAQ;AAAA,EAAA,CAEtC;AAEJ,GAEAK,IAAetB;"}
|
package/dist/index.es14.js
CHANGED
|
@@ -1,31 +1,88 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import e, { useState as p, useRef as I, useEffect as N } from "react";
|
|
2
|
+
import { Button as m } from "./index.es2.js";
|
|
3
|
+
import { Close16X16 as S } from "@iit/precision-ui-icons";
|
|
4
|
+
import { Input as k } from "./index.es11.js";
|
|
5
|
+
import { SearchIcon as R } from "lucide-react";
|
|
6
|
+
import { cn as a } from "./index.es52.js";
|
|
7
|
+
const B = ({
|
|
8
|
+
id: h,
|
|
9
|
+
placeholder: f,
|
|
10
|
+
className: v,
|
|
11
|
+
containerClassName: b,
|
|
12
|
+
value: r = "",
|
|
13
|
+
onChange: t,
|
|
14
|
+
onKeyDown: d,
|
|
15
|
+
onClickSubmitButton: g,
|
|
16
|
+
onClickClearButton: l,
|
|
17
|
+
withoutBottomBorder: y,
|
|
18
|
+
...w
|
|
19
|
+
}) => {
|
|
20
|
+
const [o, s] = p(r), [i, u] = p(!1), n = I(null);
|
|
21
|
+
N(() => {
|
|
22
|
+
s(r);
|
|
23
|
+
}, [r]);
|
|
24
|
+
const x = (c) => {
|
|
25
|
+
s(c.target.value), t && t(c);
|
|
26
|
+
}, E = () => {
|
|
27
|
+
s(""), n.current && n.current.focus(), t && t({
|
|
28
|
+
target: { value: "" }
|
|
29
|
+
}), l && l();
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ e.createElement(
|
|
32
|
+
"div",
|
|
13
33
|
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
34
|
+
className: a("relative w-full max-w-2xl", b),
|
|
35
|
+
onMouseEnter: () => u(!0),
|
|
36
|
+
onMouseLeave: () => u(!1)
|
|
17
37
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
38
|
+
/* @__PURE__ */ e.createElement(
|
|
39
|
+
k,
|
|
40
|
+
{
|
|
41
|
+
ref: n,
|
|
42
|
+
id: h,
|
|
43
|
+
placeholder: f,
|
|
44
|
+
className: a(
|
|
45
|
+
"w-full pl-8 pr-20 hover:bg-navy-opacity-4-absolute rounded-full bg-whitish h-14",
|
|
46
|
+
v,
|
|
47
|
+
y && "border-b border-transparent"
|
|
48
|
+
),
|
|
49
|
+
value: o,
|
|
50
|
+
onChange: x,
|
|
51
|
+
onKeyDown: d,
|
|
52
|
+
...w
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ e.createElement(
|
|
56
|
+
m,
|
|
57
|
+
{
|
|
58
|
+
type: "button",
|
|
59
|
+
variant: "ghost",
|
|
60
|
+
size: "icon",
|
|
61
|
+
className: a(
|
|
62
|
+
"absolute right-14 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground p-0 hover:bg-navy group",
|
|
63
|
+
i ? "bg-white" : "bg-navy-opacity-8"
|
|
64
|
+
),
|
|
65
|
+
onClick: E,
|
|
66
|
+
style: { display: o ? "block" : "none" }
|
|
67
|
+
},
|
|
68
|
+
/* @__PURE__ */ e.createElement(S, { className: "h-[10px] w-[10px] left-[5px] top-0 relative text-navy group-hover:text-whitish" }),
|
|
69
|
+
/* @__PURE__ */ e.createElement("span", { className: "sr-only" }, "Очистить")
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ e.createElement(
|
|
72
|
+
m,
|
|
73
|
+
{
|
|
74
|
+
className: a(
|
|
75
|
+
"absolute right-2 top-1/2 -translate-y-1/2 text-navy h-10 w-10 hover:bg-navy group/submit disabled:pointer-events-auto active:transform active:scale-90",
|
|
76
|
+
i ? "bg-white" : "bg-navy-opacity-8"
|
|
77
|
+
),
|
|
78
|
+
disabled: !o,
|
|
79
|
+
onClick: g || void 0
|
|
80
|
+
},
|
|
81
|
+
/* @__PURE__ */ e.createElement(R, { className: "h-4 w-4 group-hover/submit:text-whitish" })
|
|
82
|
+
)
|
|
83
|
+
);
|
|
84
|
+
}, z = B;
|
|
28
85
|
export {
|
|
29
|
-
|
|
86
|
+
z as default
|
|
30
87
|
};
|
|
31
88
|
//# sourceMappingURL=index.es14.js.map
|
package/dist/index.es14.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es14.js","sources":["../src/components/ui/
|
|
1
|
+
{"version":3,"file":"index.es14.js","sources":["../src/components/ui/input/SearchInputWithButton.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\r\n\r\nimport { Button } from \"../button\";\r\nimport { Close16X16 } from \"@iit/precision-ui-icons\";\r\nimport { Input } from \"@/components/ui/input\";\r\nimport { SearchIcon } from \"lucide-react\";\r\nimport { cn } from \"@/lib/utils/cn\";\r\n\r\ninterface SearchInputWithButtonProps {\r\n id?: string;\r\n placeholder?: string;\r\n className?: string;\r\n containerClassName?: string;\r\n value?: string;\r\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\r\n onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\r\n onClickSubmitButton?: () => void;\r\n onClickClearButton?: () => void;\r\n withoutBottomBorder?: boolean;\r\n}\r\n\r\nconst SearchInputWithButton: React.FC<SearchInputWithButtonProps> = ({\r\n id,\r\n placeholder,\r\n className,\r\n containerClassName,\r\n value = \"\",\r\n onChange,\r\n onKeyDown,\r\n onClickSubmitButton,\r\n onClickClearButton,\r\n withoutBottomBorder,\r\n ...props\r\n}) => {\r\n const [inputValue, setInputValue] = useState(value);\r\n const [isHovered, setIsHovered] = useState(false); // Track hover state\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n\r\n useEffect(() => {\r\n setInputValue(value);\r\n }, [value]);\r\n\r\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n setInputValue(event.target.value);\r\n if (onChange) {\r\n onChange(event);\r\n }\r\n };\r\n\r\n const handleClearClick = () => {\r\n setInputValue(\"\");\r\n if (inputRef.current) {\r\n inputRef.current.focus();\r\n }\r\n if (onChange) {\r\n onChange({\r\n target: { value: \"\" },\r\n } as React.ChangeEvent<HTMLInputElement>);\r\n }\r\n if (onClickClearButton) {\r\n onClickClearButton();\r\n }\r\n };\r\n\r\n return (\r\n <div\r\n className={cn(\"relative w-full max-w-2xl\", containerClassName)}\r\n onMouseEnter={() => setIsHovered(true)}\r\n onMouseLeave={() => setIsHovered(false)}\r\n >\r\n <Input\r\n ref={inputRef}\r\n id={id}\r\n placeholder={placeholder}\r\n className={cn(\r\n \"w-full pl-8 pr-20 hover:bg-navy-opacity-4-absolute rounded-full bg-whitish h-14\",\r\n className,\r\n withoutBottomBorder && \"border-b border-transparent\"\r\n )}\r\n value={inputValue}\r\n onChange={handleInputChange}\r\n onKeyDown={onKeyDown}\r\n {...props}\r\n />\r\n <Button\r\n type=\"button\"\r\n variant=\"ghost\"\r\n size=\"icon\"\r\n className={cn(\r\n \"absolute right-14 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground p-0 hover:bg-navy group\",\r\n isHovered ? \"bg-white\" : \"bg-navy-opacity-8\"\r\n )}\r\n onClick={handleClearClick}\r\n style={{ display: inputValue ? \"block\" : \"none\" }}\r\n >\r\n <Close16X16 className=\"h-[10px] w-[10px] left-[5px] top-0 relative text-navy group-hover:text-whitish\" />\r\n <span className=\"sr-only\">Очистить</span>\r\n </Button>\r\n\r\n <Button\r\n className={cn(\r\n \"absolute right-2 top-1/2 -translate-y-1/2 text-navy h-10 w-10 hover:bg-navy group/submit disabled:pointer-events-auto active:transform active:scale-90\",\r\n isHovered ? \"bg-white\" : \"bg-navy-opacity-8\"\r\n )}\r\n disabled={!inputValue}\r\n onClick={onClickSubmitButton || undefined}\r\n >\r\n <SearchIcon className=\"h-4 w-4 group-hover/submit:text-whitish\" />\r\n </Button>\r\n </div>\r\n );\r\n};\r\n\r\nexport default SearchInputWithButton;\r\n"],"names":["SearchInputWithButton","id","placeholder","className","containerClassName","value","onChange","onKeyDown","onClickSubmitButton","onClickClearButton","withoutBottomBorder","props","inputValue","setInputValue","useState","isHovered","setIsHovered","inputRef","useRef","useEffect","handleInputChange","event","handleClearClick","React","cn","Input","Button","Close16X16","SearchIcon","SearchInputWithButton$1"],"mappings":";;;;;;AAqBA,MAAMA,IAA8D,CAAC;AAAA,EACnE,IAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAST,CAAK,GAC5C,CAACU,GAAWC,CAAY,IAAIF,EAAS,EAAK,GAC1CG,IAAWC,EAAyB,IAAI;AAE9C,EAAAC,EAAU,MAAM;AACd,IAAAN,EAAcR,CAAK;AAAA,EAAA,GAClB,CAACA,CAAK,CAAC;AAEJ,QAAAe,IAAoB,CAACC,MAA+C;AAC1D,IAAAR,EAAAQ,EAAM,OAAO,KAAK,GAC5Bf,KACFA,EAASe,CAAK;AAAA,EAChB,GAGIC,IAAmB,MAAM;AAC7B,IAAAT,EAAc,EAAE,GACZI,EAAS,WACXA,EAAS,QAAQ,SAEfX,KACOA,EAAA;AAAA,MACP,QAAQ,EAAE,OAAO,GAAG;AAAA,IAAA,CACkB,GAEtCG,KACiBA;EACrB;AAIA,SAAAc,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAG,6BAA6BpB,CAAkB;AAAA,MAC7D,cAAc,MAAMY,EAAa,EAAI;AAAA,MACrC,cAAc,MAAMA,EAAa,EAAK;AAAA,IAAA;AAAA,IAEtCO,gBAAAA,EAAA;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,KAAKR;AAAA,QACL,IAAAhB;AAAA,QACA,aAAAC;AAAA,QACA,WAAWsB;AAAA,UACT;AAAA,UACArB;AAAA,UACAO,KAAuB;AAAA,QACzB;AAAA,QACA,OAAOE;AAAA,QACP,UAAUQ;AAAA,QACV,WAAAb;AAAA,QACC,GAAGI;AAAA,MAAA;AAAA,IACN;AAAA,IACAY,gBAAAA,EAAA;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,WAAWF;AAAA,UACT;AAAA,UACAT,IAAY,aAAa;AAAA,QAC3B;AAAA,QACA,SAASO;AAAA,QACT,OAAO,EAAE,SAASV,IAAa,UAAU,OAAO;AAAA,MAAA;AAAA,MAEhDW,gBAAAA,EAAA,cAACI,GAAW,EAAA,WAAU,iFAAiF,CAAA;AAAA,MACtGJ,gBAAAA,EAAA,cAAA,QAAA,EAAK,WAAU,UAAA,GAAU,UAAQ;AAAA,IACpC;AAAA,IAEAA,gBAAAA,EAAA;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,WAAWF;AAAA,UACT;AAAA,UACAT,IAAY,aAAa;AAAA,QAC3B;AAAA,QACA,UAAU,CAACH;AAAA,QACX,SAASJ,KAAuB;AAAA,MAAA;AAAA,MAEhCe,gBAAAA,EAAA,cAACK,GAAW,EAAA,WAAU,0CAA0C,CAAA;AAAA,IAClE;AAAA,EAAA;AAGN,GAEAC,IAAe7B;"}
|
package/dist/index.es15.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"typo_variant_h6 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 duration-200",
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { cva as i } from "class-variance-authority";
|
|
3
|
+
import { cn as n } from "./index.es52.js";
|
|
4
|
+
const s = i(
|
|
5
|
+
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible0:ring-2 focus-visible0:ring-ring focus-visible0:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
7
6
|
{
|
|
8
7
|
variants: {
|
|
9
8
|
variant: {
|
|
10
|
-
default: "text-navy",
|
|
11
|
-
blue: "text-whitish"
|
|
9
|
+
default: "bg-navy-opacity-4 text-navy focus:border-navy hover:bg-navy-opacity-8 border-b-navy-opacity-32",
|
|
10
|
+
blue: "bg-whitish-opacity-8 text-white focus:border-white hover:bg-whitish-opacity-16 border-b-whitish-opacity-32"
|
|
12
11
|
}
|
|
13
12
|
},
|
|
14
13
|
defaultVariants: {
|
|
15
14
|
variant: "default"
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
|
-
),
|
|
19
|
-
t.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
), c = e.forwardRef(
|
|
18
|
+
({ className: t, variant: a, ...r }, o) => /* @__PURE__ */ e.createElement(
|
|
19
|
+
"textarea",
|
|
20
|
+
{
|
|
21
|
+
className: n(s({ variant: a, className: t })),
|
|
22
|
+
ref: o,
|
|
23
|
+
...r
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
);
|
|
27
|
+
c.displayName = "Textarea";
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
-
s as labelVariants
|
|
29
|
+
c as Textarea
|
|
30
30
|
};
|
|
31
31
|
//# sourceMappingURL=index.es15.js.map
|
package/dist/index.es15.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es15.js","sources":["../src/components/ui/
|
|
1
|
+
{"version":3,"file":"index.es15.js","sources":["../src/components/ui/textarea/Textarea.tsx"],"sourcesContent":["import * as React from 'react'\r\n\r\nimport { VariantProps, cva } from 'class-variance-authority'\r\n\r\nimport { cn } from '@/lib/utils/cn'\r\n\r\nconst textareaVariants = cva(\r\n 'flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible0:ring-2 focus-visible0:ring-ring focus-visible0:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',\r\n {\r\n variants: {\r\n variant: {\r\n default:\r\n 'bg-navy-opacity-4 text-navy focus:border-navy hover:bg-navy-opacity-8 border-b-navy-opacity-32',\r\n blue: 'bg-whitish-opacity-8 text-white focus:border-white hover:bg-whitish-opacity-16 border-b-whitish-opacity-32',\r\n },\r\n },\r\n defaultVariants: {\r\n variant: 'default',\r\n },\r\n }\r\n)\r\n\r\nexport interface TextareaProps\r\n extends React.TextareaHTMLAttributes<HTMLTextAreaElement>,\r\n VariantProps<typeof textareaVariants> {\r\n // className?: string\r\n}\r\n\r\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\r\n ({ className, variant, ...props }, ref) => {\r\n return (\r\n <textarea\r\n className={cn(textareaVariants({ variant, className }))}\r\n ref={ref}\r\n {...props}\r\n />\r\n )\r\n }\r\n)\r\nTextarea.displayName = 'Textarea'\r\n\r\nexport { Textarea }\r\n"],"names":["textareaVariants","cva","Textarea","React","className","variant","props","ref","cn"],"mappings":";;;AAMA,MAAMA,IAAmBC;AAAA,EACvB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IACX;AAAA,EACF;AACF,GAQMC,IAAWC,EAAM;AAAA,EACrB,CAAC,EAAE,WAAAC,GAAW,SAAAC,GAAS,GAAGC,EAAA,GAASC,MAE/B,gBAAAJ,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWK,EAAGR,EAAiB,EAAE,SAAAK,GAAS,WAAAD,EAAW,CAAA,CAAC;AAAA,MACtD,KAAAG;AAAA,MACC,GAAGD;AAAA,IAAA;AAAA,EAAA;AAIZ;AACAJ,EAAS,cAAc;"}
|
package/dist/index.es16.js
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { Label as i } from "./index.es17.js";
|
|
2
|
+
import { Textarea as n } from "./index.es15.js";
|
|
3
|
+
import { useId as m } from "react";
|
|
4
|
+
function p({
|
|
5
|
+
id: r,
|
|
6
|
+
variant: e = "default",
|
|
7
|
+
label: t,
|
|
8
|
+
className: c
|
|
9
|
+
}) {
|
|
10
|
+
const s = m(), a = r || s, o = e === "default" ? "group-focus-within:text-navy-opacity-40" : "group-focus-within:text-whitish-opacity-60";
|
|
11
|
+
return /* @__PURE__ */ React.createElement("div", { className: `grid w-full items-center gap-1 group ${c}` }, t && /* @__PURE__ */ React.createElement(
|
|
12
|
+
i,
|
|
13
|
+
{
|
|
14
|
+
variant: e,
|
|
15
|
+
htmlFor: a,
|
|
16
|
+
className: o
|
|
17
|
+
},
|
|
18
|
+
t
|
|
19
|
+
), /* @__PURE__ */ React.createElement(
|
|
20
|
+
n,
|
|
21
|
+
{
|
|
22
|
+
id: a,
|
|
23
|
+
variant: e,
|
|
24
|
+
className: `focus:outline-none '${o}'`
|
|
25
|
+
}
|
|
26
|
+
));
|
|
27
|
+
}
|
|
25
28
|
export {
|
|
26
|
-
|
|
29
|
+
p as TextareaWithLabel
|
|
27
30
|
};
|
|
28
31
|
//# sourceMappingURL=index.es16.js.map
|
package/dist/index.es16.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es16.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index.es16.js","sources":["../src/components/ui/textarea/TextareaWithLabel.tsx"],"sourcesContent":["import { InputVariant } from '../input/types'\r\nimport { Label } from '../label'\r\nimport { Textarea } from './Textarea'\r\nimport { useId } from 'react'\r\n\r\ninterface TextareaWithLabelProps {\r\n variant?: InputVariant\r\n label?: string\r\n id?: string\r\n className?: string\r\n}\r\n\r\nexport function TextareaWithLabel({\r\n id,\r\n variant = 'default',\r\n label,\r\n className,\r\n}: TextareaWithLabelProps) {\r\n const generatedId = useId()\r\n const textareaId = id || generatedId\r\n\r\n const textareaClasses =\r\n variant === 'default'\r\n ? 'group-focus-within:text-navy-opacity-40'\r\n : 'group-focus-within:text-whitish-opacity-60'\r\n\r\n return (\r\n <div className={`grid w-full items-center gap-1 group ${className}`}>\r\n {label && (\r\n <Label\r\n variant={variant}\r\n htmlFor={textareaId}\r\n className={textareaClasses}\r\n >\r\n {label}\r\n </Label>\r\n )}\r\n\r\n <Textarea\r\n id={textareaId}\r\n variant={variant}\r\n className={`focus:outline-none '${textareaClasses}'`}\r\n />\r\n\r\n {/* {desc && <p className=\"text-sm text-muted-foreground\">{desc}</p>} */}\r\n </div>\r\n )\r\n}\r\n"],"names":["TextareaWithLabel","id","variant","label","className","generatedId","useId","textareaId","textareaClasses","Label","Textarea"],"mappings":";;;AAYO,SAASA,EAAkB;AAAA,EAChC,IAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,OAAAC;AAAA,EACA,WAAAC;AACF,GAA2B;AACzB,QAAMC,IAAcC,KACdC,IAAaN,KAAMI,GAEnBG,IACJN,MAAY,YACR,4CACA;AAEN,6CACG,OAAI,EAAA,WAAW,wCAAwCE,CAAS,MAC9DD,KACC,sBAAA;AAAA,IAACM;AAAA,IAAA;AAAA,MACC,SAAAP;AAAA,MACA,SAASK;AAAA,MACT,WAAWC;AAAA,IAAA;AAAA,IAEVL;AAAA,EAIL,GAAA,sBAAA;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,IAAIH;AAAA,MACJ,SAAAL;AAAA,MACA,WAAW,uBAAuBM,CAAe;AAAA,IAAA;AAAA,EAAA,CAIrD;AAEJ;"}
|
package/dist/index.es17.js
CHANGED
|
@@ -1,76 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} else
|
|
13
|
-
!a.has(e) && !s.endsWith("/>") && r.push(e);
|
|
14
|
-
}
|
|
15
|
-
return r.length === 0;
|
|
16
|
-
}, m = (t) => {
|
|
17
|
-
const a = /<[a-z]+\s+([^>]+)>/gi, i = t.matchAll(a);
|
|
18
|
-
for (const [s, e] of i) {
|
|
19
|
-
const o = e.match(/\w+\s*=\s*(['"])(.*?)\1|\w+(?!=)/g) || [];
|
|
20
|
-
for (const n of o)
|
|
21
|
-
if (n.includes("=")) {
|
|
22
|
-
const [g, ...f] = n.split("="), c = f.join("=");
|
|
23
|
-
if (!(c.startsWith('"') && c.endsWith('"') || c.startsWith("'") && c.endsWith("'")))
|
|
24
|
-
return !1;
|
|
25
|
-
const d = c[0];
|
|
26
|
-
if (c.slice(1, -1).includes(d))
|
|
27
|
-
return !1;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
const r = /<[^>]*?['"][^'"]*>/g, l = t.match(r) || [];
|
|
31
|
-
for (const s of l) {
|
|
32
|
-
let e = !1, o = "";
|
|
33
|
-
for (let n = 0; n < s.length; n++)
|
|
34
|
-
(s[n] === "'" || s[n] === '"') && (e ? s[n] === o && (e = !1) : (e = !0, o = s[n]));
|
|
35
|
-
if (e)
|
|
36
|
-
return !1;
|
|
37
|
-
}
|
|
38
|
-
return !0;
|
|
39
|
-
}, v = (t) => {
|
|
40
|
-
const a = [...t.matchAll(/<([a-z]+)(\s[^>]*)\/>/gi)];
|
|
41
|
-
for (const [i, r, l] of a) {
|
|
42
|
-
const s = /(\w+)=["']([^"']*)["']/g, e = [...l.matchAll(s)];
|
|
43
|
-
for (const [g, f, c] of e)
|
|
44
|
-
if (!f || !c)
|
|
45
|
-
return !1;
|
|
46
|
-
const o = /(\w+)=["'][^"']*$/g;
|
|
47
|
-
if ([...l.matchAll(o)].length > 0)
|
|
48
|
-
return !1;
|
|
49
|
-
}
|
|
50
|
-
return !0;
|
|
51
|
-
}, p = (t) => {
|
|
52
|
-
const a = /style=["']([^"']*)["']/gi, i = [...t.matchAll(a)];
|
|
53
|
-
for (const [r, l] of i) {
|
|
54
|
-
const s = l.split(";");
|
|
55
|
-
for (const e of s)
|
|
56
|
-
if (e.trim()) {
|
|
57
|
-
const [o, n] = e.split(":");
|
|
58
|
-
if (!o || !n)
|
|
59
|
-
return !1;
|
|
1
|
+
import * as a from "react";
|
|
2
|
+
import * as t from "@radix-ui/react-label";
|
|
3
|
+
import { cva as l } from "class-variance-authority";
|
|
4
|
+
import { cn as n } from "./index.es52.js";
|
|
5
|
+
const s = l(
|
|
6
|
+
"typo_variant_h6 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 duration-200",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "text-navy",
|
|
11
|
+
blue: "text-whitish"
|
|
60
12
|
}
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
variant: "default"
|
|
16
|
+
}
|
|
61
17
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
html: t,
|
|
65
|
-
className: a
|
|
66
|
-
}) => T(t) ? /* @__PURE__ */ u.createElement(
|
|
67
|
-
"div",
|
|
18
|
+
), d = a.forwardRef(({ className: e, variant: r, ...o }, i) => /* @__PURE__ */ a.createElement(
|
|
19
|
+
t.Root,
|
|
68
20
|
{
|
|
69
|
-
|
|
70
|
-
|
|
21
|
+
ref: i,
|
|
22
|
+
className: n(s({ variant: r }), e),
|
|
23
|
+
...o
|
|
71
24
|
}
|
|
72
|
-
)
|
|
25
|
+
));
|
|
26
|
+
d.displayName = t.Root.displayName;
|
|
73
27
|
export {
|
|
74
|
-
|
|
28
|
+
d as Label,
|
|
29
|
+
s as labelVariants
|
|
75
30
|
};
|
|
76
31
|
//# sourceMappingURL=index.es17.js.map
|
package/dist/index.es17.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es17.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index.es17.js","sources":["../src/components/ui/label.tsx"],"sourcesContent":["import * as React from 'react'\r\nimport * as LabelPrimitive from '@radix-ui/react-label'\r\nimport { cva, type VariantProps } from 'class-variance-authority'\r\n\r\nimport { cn } from '@/lib/utils/cn'\r\n\r\nexport const labelVariants = cva(\r\n 'typo_variant_h6 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 duration-200',\r\n {\r\n variants: {\r\n variant: {\r\n default: 'text-navy',\r\n blue: 'text-whitish',\r\n },\r\n },\r\n defaultVariants: {\r\n variant: 'default',\r\n },\r\n }\r\n)\r\n\r\nconst Label = React.forwardRef<\r\n React.ElementRef<typeof LabelPrimitive.Root>,\r\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\r\n VariantProps<typeof labelVariants>\r\n>(({ className, variant, ...props }, ref) => (\r\n <LabelPrimitive.Root\r\n ref={ref}\r\n className={cn(labelVariants({ variant }), className)}\r\n {...props}\r\n />\r\n))\r\nLabel.displayName = LabelPrimitive.Root.displayName\r\n\r\nexport { Label }\r\n"],"names":["labelVariants","cva","Label","React","className","variant","props","ref","LabelPrimitive","cn"],"mappings":";;;;AAMO,MAAMA,IAAgBC;AAAA,EAC3B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IACX;AAAA,EACF;AACF,GAEMC,IAAQC,EAAM,WAIlB,CAAC,EAAE,WAAAC,GAAW,SAAAC,GAAS,GAAGC,EAAM,GAAGC,MACnC,gBAAAJ,EAAA;AAAA,EAACK,EAAe;AAAA,EAAf;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE,EAAGT,EAAc,EAAE,SAAAK,EAAS,CAAA,GAAGD,CAAS;AAAA,IAClD,GAAGE;AAAA,EAAA;AACN,CACD;AACDJ,EAAM,cAAcM,EAAe,KAAK;"}
|