@devup-ui/components 0.1.42 → 0.1.44
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/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/components/Button/IconSpinner.cjs +1 -1
- package/dist/components/Button/IconSpinner.js +72 -84
- package/dist/components/Button/index.cjs +1 -1
- package/dist/components/Button/index.js +220 -217
- package/dist/components/Checkbox/CheckIcon.cjs +1 -1
- package/dist/components/Checkbox/CheckIcon.js +17 -23
- package/dist/components/Checkbox/index.cjs +1 -2
- package/dist/components/Checkbox/index.js +87 -127
- package/dist/components/Input/index.cjs +1 -2
- package/dist/components/Input/index.js +130 -181
- package/dist/components/Radio/index.cjs +1 -1
- package/dist/components/Radio/index.js +143 -194
- package/dist/components/RadioGroup/index.cjs +1 -2
- package/dist/components/RadioGroup/index.js +43 -59
- package/dist/components/Select/IconCheck.cjs +1 -1
- package/dist/components/Select/IconCheck.js +18 -24
- package/dist/components/Select/index.cjs +1 -2
- package/dist/components/Select/index.js +215 -315
- package/dist/components/Stepper/IconMinus.cjs +1 -1
- package/dist/components/Stepper/IconMinus.js +18 -24
- package/dist/components/Stepper/IconPlus.cjs +1 -1
- package/dist/components/Stepper/IconPlus.js +17 -23
- package/dist/components/Stepper/index.cjs +1 -2
- package/dist/components/Stepper/index.js +98 -142
- package/dist/components/Textarea/index.cjs +1 -2
- package/dist/components/Textarea/index.js +85 -108
- package/dist/components/Toggle/index.cjs +1 -2
- package/dist/components/Toggle/index.js +71 -91
- package/dist/contexts/useSelect.cjs +1 -2
- package/dist/contexts/useSelect.js +9 -10
- package/dist/index.cjs +1 -1
- package/dist/index.js +11 -32
- package/package.json +11 -14
|
@@ -1,129 +1,89 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
y,
|
|
88
|
-
{
|
|
89
|
-
as: E,
|
|
90
|
-
opacity: "1",
|
|
91
|
-
pointerEvents: "none",
|
|
92
|
-
props: {
|
|
93
|
-
color: r ? "light-dark(#D6D7DE, #47474A)" : "var(--checkIcon, #FFF)"
|
|
94
|
-
},
|
|
95
|
-
styleVars: {
|
|
96
|
-
checkIcon: e?.checkIcon
|
|
97
|
-
},
|
|
98
|
-
zIndex: "1"
|
|
99
|
-
}
|
|
100
|
-
)
|
|
101
|
-
]
|
|
102
|
-
}
|
|
103
|
-
),
|
|
104
|
-
/* @__PURE__ */ o(
|
|
105
|
-
"label",
|
|
106
|
-
{
|
|
107
|
-
className: p({
|
|
108
|
-
cursor: r ? "not-allowed" : "pointer"
|
|
109
|
-
}),
|
|
110
|
-
htmlFor: n,
|
|
111
|
-
children: typeof i == "string" ? /* @__PURE__ */ o(
|
|
112
|
-
b,
|
|
113
|
-
{
|
|
114
|
-
color: r ? "light-dark(#D6D7DE, #6F6E6E)" : "var(--text, light-dark(#2F2F2F, #EDEDED))",
|
|
115
|
-
fontSize: "14px",
|
|
116
|
-
styleVars: {
|
|
117
|
-
text: e?.text
|
|
118
|
-
},
|
|
119
|
-
userSelect: "none",
|
|
120
|
-
children: i
|
|
121
|
-
}
|
|
122
|
-
) : i
|
|
123
|
-
}
|
|
124
|
-
)
|
|
125
|
-
] });
|
|
2
|
+
"use client";
|
|
3
|
+
import { CheckIcon as e } from "./CheckIcon.js";
|
|
4
|
+
import { Box as t, Flex as n, Input as r, Text as i, css as a } from "@devup-ui/react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import { useId as c, useState as l } from "react";
|
|
7
|
+
//#region src/components/Checkbox/index.tsx
|
|
8
|
+
function u({ children: u, disabled: d, checked: f, defaultChecked: p = !1, colors: m, onChange: h, ...g }) {
|
|
9
|
+
let _ = c(), [v, y] = l(p), b = f ?? v, x = (e) => {
|
|
10
|
+
y(e), h?.(e);
|
|
11
|
+
};
|
|
12
|
+
return /* @__PURE__ */ s(n, {
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
gap: "8px",
|
|
15
|
+
children: [/* @__PURE__ */ s("label", {
|
|
16
|
+
className: a({
|
|
17
|
+
position: "relative",
|
|
18
|
+
display: "flex",
|
|
19
|
+
alignItems: "center",
|
|
20
|
+
justifyContent: "center",
|
|
21
|
+
width: "16px",
|
|
22
|
+
height: "16px",
|
|
23
|
+
cursor: d ? "not-allowed" : "pointer"
|
|
24
|
+
}),
|
|
25
|
+
htmlFor: _,
|
|
26
|
+
children: [/* @__PURE__ */ o(r, {
|
|
27
|
+
_active: !d && { bg: "light-dark(color-mix(in srgb, var(--primary, #6159D4) 20%, #FFF 80%), color-mix(in srgb, var(--primary, #6670F9) 30%, #000 70%))" },
|
|
28
|
+
_checked: {
|
|
29
|
+
bg: "var(--primary, light-dark(#6159D4, #6670F9))",
|
|
30
|
+
border: "none",
|
|
31
|
+
_hover: !d && { bg: "light-dark(color-mix(in srgb, var(--primary, #6159D4) 100%, #000 15%), color-mix(in srgb, var(--primary, #6670F9) 100%, #FFF 15%))" },
|
|
32
|
+
_disabled: { bg: "light-dark(#F0F0F3, #47474A)" }
|
|
33
|
+
},
|
|
34
|
+
_disabled: { bg: "light-dark( #F0F0F3, #47474A)" },
|
|
35
|
+
_hover: !d && {
|
|
36
|
+
bg: "light-dark(color-mix(in srgb, var(--primary, #6159D4) 10%, #FFF 90%), color-mix(in srgb, var(--primary, #6670F9) 20%, #000 80%))",
|
|
37
|
+
border: "1px solid var(--primary, light-dark(#6159D4, #6670F9))"
|
|
38
|
+
},
|
|
39
|
+
accentColor: "var(--primary, light-dark(#6159D4, #6670F9))",
|
|
40
|
+
appearance: "none",
|
|
41
|
+
bg: "var(--inputBg, light-dark(#FFF, #2E2E2E))",
|
|
42
|
+
border: "1px solid var(--border, light-dark(#E0E0E0, #333333))",
|
|
43
|
+
borderRadius: "2px",
|
|
44
|
+
checked: b,
|
|
45
|
+
cursor: d ? "not-allowed" : "pointer",
|
|
46
|
+
disabled: d,
|
|
47
|
+
display: "block",
|
|
48
|
+
height: "100%",
|
|
49
|
+
id: _,
|
|
50
|
+
left: 0,
|
|
51
|
+
m: "0",
|
|
52
|
+
onChange: d ? void 0 : (e) => x(e.target.checked),
|
|
53
|
+
opacity: 1,
|
|
54
|
+
pointerEvents: "none",
|
|
55
|
+
pos: "absolute",
|
|
56
|
+
styleOrder: 1,
|
|
57
|
+
styleVars: {
|
|
58
|
+
primary: m?.primary,
|
|
59
|
+
border: m?.border,
|
|
60
|
+
inputBg: m?.inputBg
|
|
61
|
+
},
|
|
62
|
+
top: 0,
|
|
63
|
+
type: "checkbox",
|
|
64
|
+
width: "100%",
|
|
65
|
+
zIndex: 0,
|
|
66
|
+
...g
|
|
67
|
+
}), b && /* @__PURE__ */ o(t, {
|
|
68
|
+
as: e,
|
|
69
|
+
opacity: "1",
|
|
70
|
+
pointerEvents: "none",
|
|
71
|
+
props: { color: d ? "light-dark(#D6D7DE, #47474A)" : "var(--checkIcon, #FFF)" },
|
|
72
|
+
styleVars: { checkIcon: m?.checkIcon },
|
|
73
|
+
zIndex: "1"
|
|
74
|
+
})]
|
|
75
|
+
}), /* @__PURE__ */ o("label", {
|
|
76
|
+
className: a({ cursor: d ? "not-allowed" : "pointer" }),
|
|
77
|
+
htmlFor: _,
|
|
78
|
+
children: typeof u == "string" ? /* @__PURE__ */ o(i, {
|
|
79
|
+
color: d ? "light-dark(#D6D7DE, #6F6E6E)" : "var(--text, light-dark(#2F2F2F, #EDEDED))",
|
|
80
|
+
fontSize: "14px",
|
|
81
|
+
styleVars: { text: m?.text },
|
|
82
|
+
userSelect: "none",
|
|
83
|
+
children: u
|
|
84
|
+
}) : u
|
|
85
|
+
})]
|
|
86
|
+
});
|
|
126
87
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
};
|
|
88
|
+
//#endregion
|
|
89
|
+
export { u as Checkbox };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("@devup-ui/react"),C=require("react");function j({defaultValue:o="",value:h,onChange:l,typography:x,error:s=!1,errorMessage:d,allowClear:p=!0,icon:i,colors:r,disabled:n,className:v,classNames:a,readOnly:k,onClear:F,...y}){const[B,u]=C.useState(o),D=g=>{u(g.target.value),l?.(g)},m=()=>{u(""),l?.({target:{value:""}}),F?.()},c=h??B,E=!!c&&!n&&p&&!k;return e.jsxs(t.Box,{className:a?.container,display:"inline-block",pos:"relative",selectors:{"&, & *":{boxSizing:"border-box"}},children:[i&&e.jsx(t.Center,{"aria-label":"icon",boxSize:"24px",className:a?.icon,color:n?"var(--inputDisabledText, light-dark(#D6D7DE, #373737))":"var(--iconBold, light-dark(#8D8C9A, #666577))",left:"12px",pos:"absolute",styleOrder:1,top:"50%",transform:"translateY(-50%)",children:i}),e.jsx(t.Input,{_disabled:{_placeholder:{color:"var(--inputDisabledText, light-dark(#D6D7DE, #373737))"},bg:"var(--inputDisabledBg, light-dark(#F0F0F3, #414244))",border:"1px solid var(--border, light-dark(#E4E4E4, #434343))",color:"var(--inputDisabledText, light-dark(#D6D7DE, #373737))"},_focus:{bg:"var(--primaryBg, light-dark(#F4F3FA, #F4F3FA0D))",border:"1px solid var(--primary, light-dark(#674DC7, #8163E1))",outline:"none"},_hover:{border:"1px solid var(--primary, light-dark(#674DC7, #8163E1))"},_placeholder:{color:"var(--inputPlaceholder, light-dark(#A9A8AB, #CBCBCB))"},"aria-label":"input",bg:"var(--inputBg, light-dark(#FFFFFF, #2E2E2E))",borderColor:s?"var(--error, light-dark(#D52B2E, #FF5B5E))":"var(--border, light-dark(#E4E4E4, #434343))",borderRadius:"8px",borderStyle:"solid",borderWidth:"1px",className:`${v||""} ${a?.input||""}`.trim(),disabled:n,onChange:D,pl:i?"36px":"12px",pr:p?"36px":"12px",py:"12px",styleOrder:1,styleVars:{primary:r?.primary,error:r?.error,text:r?.text,base:r?.base,iconBold:r?.iconBold,border:r?.border,inputBackground:r?.inputBackground,primaryFocus:r?.primaryFocus,negative20:r?.negative20},transition:"all 0.1s ease-in-out",typography:x,value:c,...y}),E&&e.jsx(b,{onClick:m}),s&&d&&e.jsx(t.Text,{"aria-label":"error-message",bottom:"-8px",className:a?.errorMessage,color:"var(--error, light-dark(#D52B2E, #FF5B5E))",left:"0",pos:"absolute",styleOrder:1,transform:"translateY(100%)",typography:"inputPlaceholder",children:d})]})}function b(o){return e.jsx(t.Button,{alignItems:"center","aria-label":"clear-button",bg:"var(--negative20, light-dark(#0003, #FFF6))",border:"none",borderRadius:"50%",boxSize:"20px",color:"var(--base, light-dark(#FFF, #000))",cursor:"pointer",display:"flex",justifyContent:"center",p:"2px",pos:"absolute",right:"12px",styleOrder:1,top:"50%",transform:"translateY(-50%)",type:"button",...o,children:e.jsxs("svg",{fill:"none",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M18 6L6 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"}),e.jsx("path",{d:"M6 6L18 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})})}exports.ClearButton=b;exports.Input=j;
|
|
1
|
+
"use client";"use client";require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`@devup-ui/react`),t=require(`react/jsx-runtime`),n=require(`react`);function r({defaultValue:r=``,value:a,onChange:o,typography:s,error:c=!1,errorMessage:l,allowClear:u=!0,icon:d,colors:f,disabled:p,className:m,classNames:h,readOnly:g,onClear:_,...v}){let[y,b]=(0,n.useState)(r),x=e=>{b(e.target.value),o?.(e)},S=()=>{b(``),o?.({target:{value:``}}),_?.()},C=a??y,w=!!C&&!p&&u&&!g;return(0,t.jsxs)(e.Box,{className:h?.container,display:`inline-block`,pos:`relative`,selectors:{"&, & *":{boxSizing:`border-box`}},children:[d&&(0,t.jsx)(e.Center,{"aria-label":`icon`,boxSize:`24px`,className:h?.icon,color:p?`var(--inputDisabledText, light-dark(#D6D7DE, #373737))`:`var(--iconBold, light-dark(#8D8C9A, #666577))`,left:`12px`,pos:`absolute`,styleOrder:1,top:`50%`,transform:`translateY(-50%)`,children:d}),(0,t.jsx)(e.Input,{_disabled:{_placeholder:{color:`var(--inputDisabledText, light-dark(#D6D7DE, #373737))`},bg:`var(--inputDisabledBg, light-dark(#F0F0F3, #414244))`,border:`1px solid var(--border, light-dark(#E4E4E4, #434343))`,color:`var(--inputDisabledText, light-dark(#D6D7DE, #373737))`},_focus:{bg:`var(--primaryBg, light-dark(#F4F3FA, #F4F3FA0D))`,border:`1px solid var(--primary, light-dark(#674DC7, #8163E1))`,outline:`none`},_hover:{border:`1px solid var(--primary, light-dark(#674DC7, #8163E1))`},_placeholder:{color:`var(--inputPlaceholder, light-dark(#A9A8AB, #CBCBCB))`},"aria-label":`input`,bg:`var(--inputBg, light-dark(#FFFFFF, #2E2E2E))`,borderColor:c?`var(--error, light-dark(#D52B2E, #FF5B5E))`:`var(--border, light-dark(#E4E4E4, #434343))`,borderRadius:`8px`,borderStyle:`solid`,borderWidth:`1px`,className:`${m||``} ${h?.input||``}`.trim(),disabled:p,onChange:x,pl:d?`36px`:`12px`,pr:u?`36px`:`12px`,py:`12px`,styleOrder:1,styleVars:{primary:f?.primary,error:f?.error,text:f?.text,base:f?.base,iconBold:f?.iconBold,border:f?.border,inputBackground:f?.inputBackground,primaryFocus:f?.primaryFocus,negative20:f?.negative20},transition:`all 0.1s ease-in-out`,typography:s,value:C,...v}),w&&(0,t.jsx)(i,{onClick:S}),c&&l&&(0,t.jsx)(e.Text,{"aria-label":`error-message`,bottom:`-8px`,className:h?.errorMessage,color:`var(--error, light-dark(#D52B2E, #FF5B5E))`,left:`0`,pos:`absolute`,styleOrder:1,transform:`translateY(100%)`,typography:`inputPlaceholder`,children:l})]})}function i(n){return(0,t.jsx)(e.Button,{alignItems:`center`,"aria-label":`clear-button`,bg:`var(--negative20, light-dark(#0003, #FFF6))`,border:`none`,borderRadius:`50%`,boxSize:`20px`,color:`var(--base, light-dark(#FFF, #000))`,cursor:`pointer`,display:`flex`,justifyContent:`center`,p:`2px`,pos:`absolute`,right:`12px`,styleOrder:1,top:`50%`,transform:`translateY(-50%)`,type:`button`,...n,children:(0,t.jsxs)(`svg`,{fill:`none`,height:`24`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,t.jsx)(`path`,{d:`M18 6L6 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`}),(0,t.jsx)(`path`,{d:`M6 6L18 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`})]})})}exports.Input=r;
|
|
@@ -1,184 +1,133 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import { Box as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
error: r?.error,
|
|
90
|
-
text: r?.text,
|
|
91
|
-
base: r?.base,
|
|
92
|
-
iconBold: r?.iconBold,
|
|
93
|
-
border: r?.border,
|
|
94
|
-
inputBackground: r?.inputBackground,
|
|
95
|
-
primaryFocus: r?.primaryFocus,
|
|
96
|
-
negative20: r?.negative20
|
|
97
|
-
},
|
|
98
|
-
transition: "all 0.1s ease-in-out",
|
|
99
|
-
typography: c,
|
|
100
|
-
value: u,
|
|
101
|
-
...F
|
|
102
|
-
}
|
|
103
|
-
),
|
|
104
|
-
D && /* @__PURE__ */ e(w, { onClick: y }),
|
|
105
|
-
l && d && /* @__PURE__ */ e(
|
|
106
|
-
A,
|
|
107
|
-
{
|
|
108
|
-
"aria-label": "error-message",
|
|
109
|
-
bottom: "-8px",
|
|
110
|
-
className: t?.errorMessage,
|
|
111
|
-
color: "var(--error, light-dark(#D52B2E, #FF5B5E))",
|
|
112
|
-
left: "0",
|
|
113
|
-
pos: "absolute",
|
|
114
|
-
styleOrder: 1,
|
|
115
|
-
transform: "translateY(100%)",
|
|
116
|
-
typography: "inputPlaceholder",
|
|
117
|
-
children: d
|
|
118
|
-
}
|
|
119
|
-
)
|
|
120
|
-
]
|
|
121
|
-
}
|
|
122
|
-
);
|
|
2
|
+
"use client";
|
|
3
|
+
import { Box as e, Button as t, Center as n, Input as r, Text as i } from "@devup-ui/react";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
import { useState as s } from "react";
|
|
6
|
+
//#region src/components/Input/index.tsx
|
|
7
|
+
function c({ defaultValue: t = "", value: c, onChange: u, typography: d, error: f = !1, errorMessage: p, allowClear: m = !0, icon: h, colors: g, disabled: _, className: v, classNames: y, readOnly: b, onClear: x, ...S }) {
|
|
8
|
+
let [C, w] = s(t), T = (e) => {
|
|
9
|
+
w(e.target.value), u?.(e);
|
|
10
|
+
}, E = () => {
|
|
11
|
+
w(""), u?.({ target: { value: "" } }), x?.();
|
|
12
|
+
}, D = c ?? C, O = !!D && !_ && m && !b;
|
|
13
|
+
return /* @__PURE__ */ o(e, {
|
|
14
|
+
className: y?.container,
|
|
15
|
+
display: "inline-block",
|
|
16
|
+
pos: "relative",
|
|
17
|
+
selectors: { "&, & *": { boxSizing: "border-box" } },
|
|
18
|
+
children: [
|
|
19
|
+
h && /* @__PURE__ */ a(n, {
|
|
20
|
+
"aria-label": "icon",
|
|
21
|
+
boxSize: "24px",
|
|
22
|
+
className: y?.icon,
|
|
23
|
+
color: _ ? "var(--inputDisabledText, light-dark(#D6D7DE, #373737))" : "var(--iconBold, light-dark(#8D8C9A, #666577))",
|
|
24
|
+
left: "12px",
|
|
25
|
+
pos: "absolute",
|
|
26
|
+
styleOrder: 1,
|
|
27
|
+
top: "50%",
|
|
28
|
+
transform: "translateY(-50%)",
|
|
29
|
+
children: h
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ a(r, {
|
|
32
|
+
_disabled: {
|
|
33
|
+
_placeholder: { color: "var(--inputDisabledText, light-dark(#D6D7DE, #373737))" },
|
|
34
|
+
bg: "var(--inputDisabledBg, light-dark(#F0F0F3, #414244))",
|
|
35
|
+
border: "1px solid var(--border, light-dark(#E4E4E4, #434343))",
|
|
36
|
+
color: "var(--inputDisabledText, light-dark(#D6D7DE, #373737))"
|
|
37
|
+
},
|
|
38
|
+
_focus: {
|
|
39
|
+
bg: "var(--primaryBg, light-dark(#F4F3FA, #F4F3FA0D))",
|
|
40
|
+
border: "1px solid var(--primary, light-dark(#674DC7, #8163E1))",
|
|
41
|
+
outline: "none"
|
|
42
|
+
},
|
|
43
|
+
_hover: { border: "1px solid var(--primary, light-dark(#674DC7, #8163E1))" },
|
|
44
|
+
_placeholder: { color: "var(--inputPlaceholder, light-dark(#A9A8AB, #CBCBCB))" },
|
|
45
|
+
"aria-label": "input",
|
|
46
|
+
bg: "var(--inputBg, light-dark(#FFFFFF, #2E2E2E))",
|
|
47
|
+
borderColor: f ? "var(--error, light-dark(#D52B2E, #FF5B5E))" : "var(--border, light-dark(#E4E4E4, #434343))",
|
|
48
|
+
borderRadius: "8px",
|
|
49
|
+
borderStyle: "solid",
|
|
50
|
+
borderWidth: "1px",
|
|
51
|
+
className: `${v || ""} ${y?.input || ""}`.trim(),
|
|
52
|
+
disabled: _,
|
|
53
|
+
onChange: T,
|
|
54
|
+
pl: h ? "36px" : "12px",
|
|
55
|
+
pr: m ? "36px" : "12px",
|
|
56
|
+
py: "12px",
|
|
57
|
+
styleOrder: 1,
|
|
58
|
+
styleVars: {
|
|
59
|
+
primary: g?.primary,
|
|
60
|
+
error: g?.error,
|
|
61
|
+
text: g?.text,
|
|
62
|
+
base: g?.base,
|
|
63
|
+
iconBold: g?.iconBold,
|
|
64
|
+
border: g?.border,
|
|
65
|
+
inputBackground: g?.inputBackground,
|
|
66
|
+
primaryFocus: g?.primaryFocus,
|
|
67
|
+
negative20: g?.negative20
|
|
68
|
+
},
|
|
69
|
+
transition: "all 0.1s ease-in-out",
|
|
70
|
+
typography: d,
|
|
71
|
+
value: D,
|
|
72
|
+
...S
|
|
73
|
+
}),
|
|
74
|
+
O && /* @__PURE__ */ a(l, { onClick: E }),
|
|
75
|
+
f && p && /* @__PURE__ */ a(i, {
|
|
76
|
+
"aria-label": "error-message",
|
|
77
|
+
bottom: "-8px",
|
|
78
|
+
className: y?.errorMessage,
|
|
79
|
+
color: "var(--error, light-dark(#D52B2E, #FF5B5E))",
|
|
80
|
+
left: "0",
|
|
81
|
+
pos: "absolute",
|
|
82
|
+
styleOrder: 1,
|
|
83
|
+
transform: "translateY(100%)",
|
|
84
|
+
typography: "inputPlaceholder",
|
|
85
|
+
children: p
|
|
86
|
+
})
|
|
87
|
+
]
|
|
88
|
+
});
|
|
123
89
|
}
|
|
124
|
-
function
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
/* @__PURE__ */ e(
|
|
166
|
-
"path",
|
|
167
|
-
{
|
|
168
|
-
d: "M6 6L18 18",
|
|
169
|
-
stroke: "currentColor",
|
|
170
|
-
strokeLinecap: "round",
|
|
171
|
-
strokeLinejoin: "round",
|
|
172
|
-
strokeWidth: "2"
|
|
173
|
-
}
|
|
174
|
-
)
|
|
175
|
-
]
|
|
176
|
-
}
|
|
177
|
-
)
|
|
178
|
-
}
|
|
179
|
-
);
|
|
90
|
+
function l(e) {
|
|
91
|
+
return /* @__PURE__ */ a(t, {
|
|
92
|
+
alignItems: "center",
|
|
93
|
+
"aria-label": "clear-button",
|
|
94
|
+
bg: "var(--negative20, light-dark(#0003, #FFF6))",
|
|
95
|
+
border: "none",
|
|
96
|
+
borderRadius: "50%",
|
|
97
|
+
boxSize: "20px",
|
|
98
|
+
color: "var(--base, light-dark(#FFF, #000))",
|
|
99
|
+
cursor: "pointer",
|
|
100
|
+
display: "flex",
|
|
101
|
+
justifyContent: "center",
|
|
102
|
+
p: "2px",
|
|
103
|
+
pos: "absolute",
|
|
104
|
+
right: "12px",
|
|
105
|
+
styleOrder: 1,
|
|
106
|
+
top: "50%",
|
|
107
|
+
transform: "translateY(-50%)",
|
|
108
|
+
type: "button",
|
|
109
|
+
...e,
|
|
110
|
+
children: /* @__PURE__ */ o("svg", {
|
|
111
|
+
fill: "none",
|
|
112
|
+
height: "24",
|
|
113
|
+
viewBox: "0 0 24 24",
|
|
114
|
+
width: "24",
|
|
115
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
116
|
+
children: [/* @__PURE__ */ a("path", {
|
|
117
|
+
d: "M18 6L6 18",
|
|
118
|
+
stroke: "currentColor",
|
|
119
|
+
strokeLinecap: "round",
|
|
120
|
+
strokeLinejoin: "round",
|
|
121
|
+
strokeWidth: "2"
|
|
122
|
+
}), /* @__PURE__ */ a("path", {
|
|
123
|
+
d: "M6 6L18 18",
|
|
124
|
+
stroke: "currentColor",
|
|
125
|
+
strokeLinecap: "round",
|
|
126
|
+
strokeLinejoin: "round",
|
|
127
|
+
strokeWidth: "2"
|
|
128
|
+
})]
|
|
129
|
+
})
|
|
130
|
+
});
|
|
180
131
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
O as Input
|
|
184
|
-
};
|
|
132
|
+
//#endregion
|
|
133
|
+
export { c as Input };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`@devup-ui/react`),t=require(`react/jsx-runtime`);function n({className:n,disabled:r,children:i,variant:a=`default`,checked:o,classNames:s,styles:c,style:l,firstButton:u,lastButton:d,colors:f,...p}){let m=a===`button`;return(0,t.jsxs)(e.Box,{alignItems:m?void 0:`center`,"aria-disabled":r,as:`label`,cursor:m?void 0:`pointer`,display:m?void 0:`inline-flex`,gap:m?void 0:2,selectors:{"&[aria-disabled=true]":{cursor:`default`}},children:[m?(0,t.jsx)(e.Input,{checked:o,className:n,"data-radio-input":!0,disabled:r,display:`none`,opacity:0,styleOrder:1,type:`radio`,...p}):(0,t.jsx)(e.Input,{_focus:{outline:`1px sold var(--border, var(--primary))`},appearance:`none`,bg:`light-dark(#fff, #2E2E2E)`,border:`1px solid`,borderColor:`$border`,borderRadius:`100%`,checked:o,className:n,"data-radio-input":!0,disabled:r,height:`18px`,m:0,selectors:{"&:checked:not(:disabled)":{bg:`var(--checkedBg, var(--primary, light-dark(#fff, #2E2E2E)))`,border:`3px solid`,borderColor:`var(--checkedBg, light-dark(#fff, #2E2E2E))`,boxShadow:`0 0 0 1px var(--checkedBorder, var(--primary))`},"&:hover:not(:disabled,:checked)":{border:`1px solid var(--hoverBorder, var(--primary))`,bg:`var(--hoverBg, light-dark(color-mix(in srgb, var(--primary) 10%, white 90%), color-mix(in srgb, var(--primary) 10%, black 90%)))`},"&:is(:disabled, [aria-disabled=true])":{bgColor:`var(--disabledBg, light-dark(#F0F0F3, #47474A))`}},styleOrder:1,styleVars:{primary:f?.primary,border:f?.border,text:f?.text,bg:f?.bg,hoverBg:f?.hoverBg,hoverBorder:f?.hoverBorder,hoverColor:f?.hoverColor,checkedBg:f?.checkedBg,checkedBorder:f?.checkedBorder,checkedColor:f?.checkedColor,disabledBg:f?.disabledBg,disabledColor:f?.disabledColor},transition:`.25s`,type:`radio`,width:`18px`,...p}),a===`button`?(0,t.jsx)(e.Box,{_disabled:{cursor:`not-allowed`},"aria-disabled":r,bg:`var(--bg, light-dark(#fff, #2E2E2E))`,border:`1px solid`,borderColor:`$border`,borderRadius:u?`8px 0 0 8px`:d?`0 8px 8px 0`:void 0,className:n,color:`var(--text, light-dark(#000, #fff))`,cursor:`pointer`,"data-radio-button":!0,display:`flex`,px:8,py:3,selectors:{"[data-radio-input]:checked + &:not([aria-disabled=true])":{fontWeight:600,bg:`var(--checkedBg, light-dark(color-mix(in srgb, var(--primary) 10%, white 80%), color-mix(in srgb, var(--primary) 10%, black 80%)))`,borderColor:`var(--checkedBorder, var(--primary))`,color:`var(--checkedColor, var(--primary))`},"&:hover:not([aria-disabled=true])":{bg:`var(--hoverBg, light-dark(color-mix(in srgb, var(--primary) 10%, white 90%), color-mix(in srgb, var(--primary) 10%, black 90%)))`,borderColor:`var(--hoverBorder, var(--primary))`},"[data-radio-input]:disabled + &":{bg:`var(--disabledBg, light-dark(#F0F0F3, #47474A))`,color:`var(--disabledColor, light-dark(#D6D7DE, #373737))`}},style:l,styleOrder:1,styleVars:{primary:f?.primary,border:f?.border,text:f?.text,bg:f?.bg,hoverBg:f?.hoverBg,hoverBorder:f?.hoverBorder,hoverColor:f?.hoverColor,checkedBg:f?.checkedBg,checkedBorder:f?.checkedBorder,checkedColor:f?.checkedColor,disabledBg:f?.disabledBg,disabledColor:f?.disabledColor},transition:`background-color 0.25s, border-color 0.25s`,w:`fit-content`,children:i}):(0,t.jsx)(e.Text,{"aria-disabled":r,className:s?.label,color:`var(--text, light-dark(#000, #fff))`,selectors:{"&[aria-disabled=true]":{color:`var(--disabledColor, light-dark(#D6D7DE, #373737))`}},style:l,styleOrder:1,styleVars:{primary:f?.primary,border:f?.border,text:f?.text,bg:f?.bg,hoverBg:f?.hoverBg,hoverBorder:f?.hoverBorder,hoverColor:f?.hoverColor,checkedBg:f?.checkedBg,checkedBorder:f?.checkedBorder,checkedColor:f?.checkedColor,disabledBg:f?.disabledBg,disabledColor:f?.disabledColor},children:i})]})}exports.Radio=n;
|