@devup-ui/components 0.1.43 → 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 -11
|
@@ -1,218 +1,221 @@
|
|
|
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
|
-
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
1
|
+
import { IconSpinner as e } from "./IconSpinner.js";
|
|
2
|
+
import { Box as t, Button as n, Center as r, css as i } from "@devup-ui/react";
|
|
3
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Button/index.tsx
|
|
5
|
+
function s({ variant: s = "default", type: c = "button", colors: l, danger: u = !1, children: d, size: f = "md", className: p, icon: m, ellipsis: h = !1, typography: g, disabled: _, loading: v = !1, loadingSpinner: y = "whole", ...b }) {
|
|
6
|
+
return /* @__PURE__ */ a(n, {
|
|
7
|
+
_active: {
|
|
8
|
+
primary: { bg: "color-mix(in srgb, var(--primary, #674DC7) 100%, #000 30%)" },
|
|
9
|
+
default: {
|
|
10
|
+
bg: {
|
|
11
|
+
true: "var(--error, #D52B2E)",
|
|
12
|
+
false: "color-mix(in srgb, var(--primary, #8163E1) 20%, #FFF 80%)"
|
|
13
|
+
}[u.toString()],
|
|
14
|
+
border: {
|
|
15
|
+
true: "1px solid var(--error, #D52B2E)",
|
|
16
|
+
false: "1px solid var(--primary, #8163E1)"
|
|
17
|
+
}[u.toString()],
|
|
18
|
+
color: "var(--text, #272727)"
|
|
19
|
+
}
|
|
20
|
+
}[s],
|
|
21
|
+
_disabled: {
|
|
22
|
+
primary: {
|
|
23
|
+
color: "#D6D7DE",
|
|
24
|
+
bgColor: "#F0F0F3",
|
|
25
|
+
cursor: "not-allowed"
|
|
26
|
+
},
|
|
27
|
+
default: {
|
|
28
|
+
color: "#D6D7DE",
|
|
29
|
+
bgColor: "#F0F0F3",
|
|
30
|
+
cursor: "not-allowed",
|
|
31
|
+
borderColor: "var(--border, #E4E4E4)"
|
|
32
|
+
}
|
|
33
|
+
}[s],
|
|
34
|
+
_focusVisible: {
|
|
35
|
+
outline: "2px solid",
|
|
36
|
+
outlineColor: {
|
|
37
|
+
primary: "var(--primaryFocus, #9385D3)",
|
|
38
|
+
default: {
|
|
39
|
+
true: "var(--error, #FF5B5E)",
|
|
40
|
+
false: "var(--primaryFocus, #9385D3)"
|
|
41
|
+
}[u.toString()]
|
|
42
|
+
}[s]
|
|
43
|
+
},
|
|
44
|
+
_hover: {
|
|
45
|
+
primary: { bg: "color-mix(in srgb, var(--primary, #674DC7) 100%, #000 15%)" },
|
|
46
|
+
default: {
|
|
47
|
+
borderColor: {
|
|
48
|
+
true: "var(--error, #D52B2E)",
|
|
49
|
+
false: "var(--primary, #8163E1)"
|
|
50
|
+
}[u.toString()],
|
|
51
|
+
bg: !u && "color-mix(in srgb, var(--primary, #8163E1) 10%, #FFF 90%)"
|
|
52
|
+
}
|
|
53
|
+
}[s],
|
|
54
|
+
_themeDark: {
|
|
55
|
+
_active: {
|
|
56
|
+
primary: { bg: "color-mix(in srgb, var(--primary, #8163E1) 100%, #FFF 30%);" },
|
|
57
|
+
default: {
|
|
58
|
+
bg: {
|
|
59
|
+
true: "var(--error, #FF5B5E)",
|
|
60
|
+
false: "var(--primary, #8163E1)"
|
|
61
|
+
}[u.toString()],
|
|
62
|
+
color: "var(--text, #F6F6F6)"
|
|
63
|
+
}
|
|
64
|
+
}[s],
|
|
65
|
+
_disabled: {
|
|
66
|
+
primary: {
|
|
67
|
+
color: "#373737",
|
|
68
|
+
bgColor: "#47474A",
|
|
69
|
+
borderColor: "transparent"
|
|
70
|
+
},
|
|
71
|
+
default: {
|
|
72
|
+
color: "#373737",
|
|
73
|
+
bgColor: "#47474A",
|
|
74
|
+
borderColor: "transparent"
|
|
75
|
+
}
|
|
76
|
+
}[s],
|
|
77
|
+
_hover: {
|
|
78
|
+
primary: {
|
|
79
|
+
bg: "color-mix(in srgb, var(--primary, #8163E1) 100%, #FFF 15%);",
|
|
80
|
+
outlineColor: "var(--primary, #674DC7)"
|
|
81
|
+
},
|
|
82
|
+
default: {
|
|
83
|
+
borderColor: {
|
|
84
|
+
true: "var(--error, #FF5B5E)",
|
|
85
|
+
false: "var(--primary, #8163E1)"
|
|
86
|
+
}[u.toString()],
|
|
87
|
+
bg: !u && "color-mix(in srgb, var(--primary, #674DC7) 10%, var(--inputBackground, #2E2E2E) 90%)"
|
|
88
|
+
}
|
|
89
|
+
}[s],
|
|
90
|
+
_focusVisible: { outlineColor: {
|
|
91
|
+
primary: "var(--primaryFocus, #927CE4)",
|
|
92
|
+
default: {
|
|
93
|
+
true: "var(--error, #D52B2E)",
|
|
94
|
+
false: "var(--primaryFocus, #927CE4)"
|
|
95
|
+
}[u.toString()]
|
|
96
|
+
}[s] },
|
|
97
|
+
bg: {
|
|
98
|
+
primary: "var(--primary, #8163E1)",
|
|
99
|
+
default: "var(--inputBackground, #2E2E2E)"
|
|
100
|
+
}[s]
|
|
101
|
+
},
|
|
102
|
+
"aria-disabled": _,
|
|
103
|
+
"aria-label": "button",
|
|
104
|
+
bg: {
|
|
105
|
+
primary: "var(--primary, #8163E1)",
|
|
106
|
+
default: "var(--inputBackground, #FFF)"
|
|
107
|
+
}[s],
|
|
108
|
+
border: {
|
|
109
|
+
primary: "none",
|
|
110
|
+
default: "1px solid var(--border, #E4E4E4)"
|
|
111
|
+
}[s],
|
|
112
|
+
borderRadius: {
|
|
113
|
+
primary: "8px",
|
|
114
|
+
default: "10px"
|
|
115
|
+
}[s],
|
|
116
|
+
boxSizing: "border-box",
|
|
117
|
+
className: p,
|
|
118
|
+
color: {
|
|
119
|
+
primary: "#FFF",
|
|
120
|
+
default: {
|
|
121
|
+
true: "var(--error, #D52B2E)",
|
|
122
|
+
false: "var(--text, #272727)"
|
|
123
|
+
}[u.toString()]
|
|
124
|
+
}[s],
|
|
125
|
+
cursor: "pointer",
|
|
126
|
+
disabled: _,
|
|
127
|
+
fontSize: {
|
|
128
|
+
default: [
|
|
129
|
+
"14px",
|
|
130
|
+
null,
|
|
131
|
+
null,
|
|
132
|
+
null,
|
|
133
|
+
"15px"
|
|
134
|
+
],
|
|
135
|
+
primary: [
|
|
136
|
+
"15px",
|
|
137
|
+
null,
|
|
138
|
+
null,
|
|
139
|
+
null,
|
|
140
|
+
"16px"
|
|
141
|
+
]
|
|
142
|
+
}[s],
|
|
143
|
+
fontWeight: 700,
|
|
144
|
+
letterSpacing: {
|
|
145
|
+
default: [
|
|
146
|
+
"-0.02em",
|
|
147
|
+
null,
|
|
148
|
+
null,
|
|
149
|
+
null,
|
|
150
|
+
"-0.03em"
|
|
151
|
+
],
|
|
152
|
+
primary: [
|
|
153
|
+
"0px",
|
|
154
|
+
null,
|
|
155
|
+
null,
|
|
156
|
+
null,
|
|
157
|
+
"-0.01em"
|
|
158
|
+
]
|
|
159
|
+
}[s],
|
|
160
|
+
outlineOffset: "2px",
|
|
161
|
+
pos: "relative",
|
|
162
|
+
px: {
|
|
163
|
+
false: {
|
|
164
|
+
sm: "12px",
|
|
165
|
+
md: "16px",
|
|
166
|
+
lg: "20px"
|
|
167
|
+
}[f],
|
|
168
|
+
true: {
|
|
169
|
+
sm: "24px",
|
|
170
|
+
md: "28px",
|
|
171
|
+
lg: "32px"
|
|
172
|
+
}[f]
|
|
173
|
+
}[(!!(m || v)).toString()],
|
|
174
|
+
py: {
|
|
175
|
+
sm: "8px",
|
|
176
|
+
md: "10px",
|
|
177
|
+
lg: "12px"
|
|
178
|
+
}[f],
|
|
179
|
+
styleOrder: 1,
|
|
180
|
+
styleVars: {
|
|
181
|
+
primary: l?.primary,
|
|
182
|
+
error: l?.error,
|
|
183
|
+
text: l?.text,
|
|
184
|
+
border: l?.border,
|
|
185
|
+
inputBackground: l?.inputBackground,
|
|
186
|
+
primaryFocus: l?.primaryFocus
|
|
187
|
+
},
|
|
188
|
+
transition: ".25s",
|
|
189
|
+
type: c,
|
|
190
|
+
typography: g,
|
|
191
|
+
...b,
|
|
192
|
+
children: /* @__PURE__ */ o(t, {
|
|
193
|
+
maxW: "100%",
|
|
194
|
+
mx: "auto",
|
|
195
|
+
pos: "relative",
|
|
196
|
+
w: "fit-content",
|
|
197
|
+
children: [(m || v) && /* @__PURE__ */ a(r, {
|
|
198
|
+
boxSize: "24px",
|
|
199
|
+
left: "4px",
|
|
200
|
+
pos: "absolute",
|
|
201
|
+
role: "presentation",
|
|
202
|
+
selectors: { "&>svg": { color: "inherit" } },
|
|
203
|
+
top: "50%",
|
|
204
|
+
transform: "translate(-100%, -50%)",
|
|
205
|
+
children: v ? /* @__PURE__ */ a(e, { type: y }) : m
|
|
206
|
+
}), /* @__PURE__ */ a(t, {
|
|
207
|
+
className: h ? i({
|
|
208
|
+
overflow: "hidden",
|
|
209
|
+
textOverflow: "ellipsis",
|
|
210
|
+
whiteSpace: "nowrap"
|
|
211
|
+
}) : void 0,
|
|
212
|
+
lineHeight: "1.2",
|
|
213
|
+
minH: "1.2em",
|
|
214
|
+
transform: !!(m || v) && "translateX(8px)",
|
|
215
|
+
children: d
|
|
216
|
+
})]
|
|
217
|
+
})
|
|
218
|
+
});
|
|
215
219
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
};
|
|
220
|
+
//#endregion
|
|
221
|
+
export { s as Button };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`react/jsx-runtime`);function t({color:t,...n}){return(0,e.jsx)(`svg`,{height:`10`,viewBox:`0 0 12 10`,width:`12`,xmlns:`http://www.w3.org/2000/svg`,...n,children:(0,e.jsx)(`path`,{clipRule:`evenodd`,d:`M11.6474 0.807113C12.0992 1.23373 12.1195 1.94575 11.6929 2.39745L5.31789 9.14745C5.10214 9.37589 4.80069 9.50369 4.48649 9.49992C4.1723 9.49615 3.874 9.36114 3.6638 9.12759L0.288803 5.37759C-0.126837 4.91576 -0.0893993 4.20444 0.372424 3.7888C0.834247 3.37315 1.54557 3.41059 1.96121 3.87242L4.51994 6.71544L10.0571 0.852551C10.4837 0.400843 11.1957 0.3805 11.6474 0.807113Z`,fill:t,fillRule:`evenodd`})})}exports.CheckIcon=t;
|
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
fillRule: "evenodd"
|
|
18
|
-
}
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
);
|
|
2
|
+
//#region src/components/Checkbox/CheckIcon.tsx
|
|
3
|
+
function t({ color: t, ...n }) {
|
|
4
|
+
return /* @__PURE__ */ e("svg", {
|
|
5
|
+
height: "10",
|
|
6
|
+
viewBox: "0 0 12 10",
|
|
7
|
+
width: "12",
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
...n,
|
|
10
|
+
children: /* @__PURE__ */ e("path", {
|
|
11
|
+
clipRule: "evenodd",
|
|
12
|
+
d: "M11.6474 0.807113C12.0992 1.23373 12.1195 1.94575 11.6929 2.39745L5.31789 9.14745C5.10214 9.37589 4.80069 9.50369 4.48649 9.49992C4.1723 9.49615 3.874 9.36114 3.6638 9.12759L0.288803 5.37759C-0.126837 4.91576 -0.0893993 4.20444 0.372424 3.7888C0.834247 3.37315 1.54557 3.41059 1.96121 3.87242L4.51994 6.71544L10.0571 0.852551C10.4837 0.400843 11.1957 0.3805 11.6474 0.807113Z",
|
|
13
|
+
fill: t,
|
|
14
|
+
fillRule: "evenodd"
|
|
15
|
+
})
|
|
16
|
+
});
|
|
22
17
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { t as CheckIcon };
|
|
@@ -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"),s=require("react"),k=require("./CheckIcon.cjs");function m({children:i,disabled:r,checked:l,defaultChecked:p=!1,colors:o,onChange:g,...h}){const a=s.useId(),[F,d]=s.useState(p),c=l??F,x=n=>{d(n),g?.(n)};return e.jsxs(t.Flex,{alignItems:"center",gap:"8px",children:[e.jsxs("label",{className:t.css({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",cursor:r?"not-allowed":"pointer"}),htmlFor:a,children:[e.jsx(t.Input,{_active:!r&&{bg:"light-dark(color-mix(in srgb, var(--primary, #6159D4) 20%, #FFF 80%), color-mix(in srgb, var(--primary, #6670F9) 30%, #000 70%))"},_checked:{bg:"var(--primary, light-dark(#6159D4, #6670F9))",border:"none",_hover:!r&&{bg:"light-dark(color-mix(in srgb, var(--primary, #6159D4) 100%, #000 15%), color-mix(in srgb, var(--primary, #6670F9) 100%, #FFF 15%))"},_disabled:{bg:"light-dark(#F0F0F3, #47474A)"}},_disabled:{bg:"light-dark( #F0F0F3, #47474A)"},_hover:!r&&{bg:"light-dark(color-mix(in srgb, var(--primary, #6159D4) 10%, #FFF 90%), color-mix(in srgb, var(--primary, #6670F9) 20%, #000 80%))",border:"1px solid var(--primary, light-dark(#6159D4, #6670F9))"},accentColor:"var(--primary, light-dark(#6159D4, #6670F9))",appearance:"none",bg:"var(--inputBg, light-dark(#FFF, #2E2E2E))",border:"1px solid var(--border, light-dark(#E0E0E0, #333333))",borderRadius:"2px",checked:c,cursor:r?"not-allowed":"pointer",disabled:r,display:"block",height:"100%",id:a,left:0,m:"0",onChange:r?void 0:n=>x(n.target.checked),opacity:1,pointerEvents:"none",pos:"absolute",styleOrder:1,styleVars:{primary:o?.primary,border:o?.border,inputBg:o?.inputBg},top:0,type:"checkbox",width:"100%",zIndex:0,...h}),c&&e.jsx(t.Box,{as:k.CheckIcon,opacity:"1",pointerEvents:"none",props:{color:r?"light-dark(#D6D7DE, #47474A)":"var(--checkIcon, #FFF)"},styleVars:{checkIcon:o?.checkIcon},zIndex:"1"})]}),e.jsx("label",{className:t.css({cursor:r?"not-allowed":"pointer"}),htmlFor:a,children:typeof i=="string"?e.jsx(t.Text,{color:r?"light-dark(#D6D7DE, #6F6E6E)":"var(--text, light-dark(#2F2F2F, #EDEDED))",fontSize:"14px",styleVars:{text:o?.text},userSelect:"none",children:i}):i})]})}exports.Checkbox=m;
|
|
1
|
+
"use client";"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`./CheckIcon.cjs`);let t=require(`@devup-ui/react`),n=require(`react/jsx-runtime`),r=require(`react`);function i({children:i,disabled:a,checked:o,defaultChecked:s=!1,colors:c,onChange:l,...u}){let d=(0,r.useId)(),[f,p]=(0,r.useState)(s),m=o??f,h=e=>{p(e),l?.(e)};return(0,n.jsxs)(t.Flex,{alignItems:`center`,gap:`8px`,children:[(0,n.jsxs)(`label`,{className:(0,t.css)({position:`relative`,display:`flex`,alignItems:`center`,justifyContent:`center`,width:`16px`,height:`16px`,cursor:a?`not-allowed`:`pointer`}),htmlFor:d,children:[(0,n.jsx)(t.Input,{_active:!a&&{bg:`light-dark(color-mix(in srgb, var(--primary, #6159D4) 20%, #FFF 80%), color-mix(in srgb, var(--primary, #6670F9) 30%, #000 70%))`},_checked:{bg:`var(--primary, light-dark(#6159D4, #6670F9))`,border:`none`,_hover:!a&&{bg:`light-dark(color-mix(in srgb, var(--primary, #6159D4) 100%, #000 15%), color-mix(in srgb, var(--primary, #6670F9) 100%, #FFF 15%))`},_disabled:{bg:`light-dark(#F0F0F3, #47474A)`}},_disabled:{bg:`light-dark( #F0F0F3, #47474A)`},_hover:!a&&{bg:`light-dark(color-mix(in srgb, var(--primary, #6159D4) 10%, #FFF 90%), color-mix(in srgb, var(--primary, #6670F9) 20%, #000 80%))`,border:`1px solid var(--primary, light-dark(#6159D4, #6670F9))`},accentColor:`var(--primary, light-dark(#6159D4, #6670F9))`,appearance:`none`,bg:`var(--inputBg, light-dark(#FFF, #2E2E2E))`,border:`1px solid var(--border, light-dark(#E0E0E0, #333333))`,borderRadius:`2px`,checked:m,cursor:a?`not-allowed`:`pointer`,disabled:a,display:`block`,height:`100%`,id:d,left:0,m:`0`,onChange:a?void 0:e=>h(e.target.checked),opacity:1,pointerEvents:`none`,pos:`absolute`,styleOrder:1,styleVars:{primary:c?.primary,border:c?.border,inputBg:c?.inputBg},top:0,type:`checkbox`,width:`100%`,zIndex:0,...u}),m&&(0,n.jsx)(t.Box,{as:e.CheckIcon,opacity:`1`,pointerEvents:`none`,props:{color:a?`light-dark(#D6D7DE, #47474A)`:`var(--checkIcon, #FFF)`},styleVars:{checkIcon:c?.checkIcon},zIndex:`1`})]}),(0,n.jsx)(`label`,{className:(0,t.css)({cursor:a?`not-allowed`:`pointer`}),htmlFor:d,children:typeof i==`string`?(0,n.jsx)(t.Text,{color:a?`light-dark(#D6D7DE, #6F6E6E)`:`var(--text, light-dark(#2F2F2F, #EDEDED))`,fontSize:`14px`,styleVars:{text:c?.text},userSelect:`none`,children:i}):i})]})}exports.Checkbox=i;
|