@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.
Files changed (34) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +1 -0
  2. package/dist/components/Button/IconSpinner.cjs +1 -1
  3. package/dist/components/Button/IconSpinner.js +72 -84
  4. package/dist/components/Button/index.cjs +1 -1
  5. package/dist/components/Button/index.js +220 -217
  6. package/dist/components/Checkbox/CheckIcon.cjs +1 -1
  7. package/dist/components/Checkbox/CheckIcon.js +17 -23
  8. package/dist/components/Checkbox/index.cjs +1 -2
  9. package/dist/components/Checkbox/index.js +87 -127
  10. package/dist/components/Input/index.cjs +1 -2
  11. package/dist/components/Input/index.js +130 -181
  12. package/dist/components/Radio/index.cjs +1 -1
  13. package/dist/components/Radio/index.js +143 -194
  14. package/dist/components/RadioGroup/index.cjs +1 -2
  15. package/dist/components/RadioGroup/index.js +43 -59
  16. package/dist/components/Select/IconCheck.cjs +1 -1
  17. package/dist/components/Select/IconCheck.js +18 -24
  18. package/dist/components/Select/index.cjs +1 -2
  19. package/dist/components/Select/index.js +215 -315
  20. package/dist/components/Stepper/IconMinus.cjs +1 -1
  21. package/dist/components/Stepper/IconMinus.js +18 -24
  22. package/dist/components/Stepper/IconPlus.cjs +1 -1
  23. package/dist/components/Stepper/IconPlus.js +17 -23
  24. package/dist/components/Stepper/index.cjs +1 -2
  25. package/dist/components/Stepper/index.js +98 -142
  26. package/dist/components/Textarea/index.cjs +1 -2
  27. package/dist/components/Textarea/index.js +85 -108
  28. package/dist/components/Toggle/index.cjs +1 -2
  29. package/dist/components/Toggle/index.js +71 -91
  30. package/dist/contexts/useSelect.cjs +1 -2
  31. package/dist/contexts/useSelect.js +9 -10
  32. package/dist/index.cjs +1 -1
  33. package/dist/index.js +11 -32
  34. package/package.json +11 -11
@@ -1,218 +1,221 @@
1
- import { jsx as a, jsxs as y } from "react/jsx-runtime";
2
- import { Button as F, Box as u, Center as c, css as E } from "@devup-ui/react";
3
- import { IconSpinner as g } from "./IconSpinner.js";
4
- function B({
5
- variant: r = "default",
6
- type: m = "button",
7
- colors: e,
8
- danger: o = !1,
9
- children: s,
10
- size: i = "md",
11
- className: n,
12
- icon: l,
13
- ellipsis: x = !1,
14
- typography: b,
15
- disabled: p,
16
- loading: t = !1,
17
- loadingSpinner: d = "whole",
18
- ...f
19
- }) {
20
- return /* @__PURE__ */ a(
21
- F,
22
- {
23
- _active: {
24
- primary: {
25
- bg: "color-mix(in srgb, var(--primary, #674DC7) 100%, #000 30%)"
26
- },
27
- default: {
28
- bg: {
29
- true: "var(--error, #D52B2E)",
30
- false: "color-mix(in srgb, var(--primary, #8163E1) 20%, #FFF 80%)"
31
- }[o.toString()],
32
- border: {
33
- true: "1px solid var(--error, #D52B2E)",
34
- false: "1px solid var(--primary, #8163E1)"
35
- }[o.toString()],
36
- color: "var(--text, #272727)"
37
- }
38
- }[r],
39
- _disabled: {
40
- primary: {
41
- color: "#D6D7DE",
42
- bgColor: "#F0F0F3",
43
- cursor: "not-allowed"
44
- },
45
- default: {
46
- color: "#D6D7DE",
47
- bgColor: "#F0F0F3",
48
- cursor: "not-allowed",
49
- borderColor: "var(--border, #E4E4E4)"
50
- }
51
- }[r],
52
- _focusVisible: {
53
- outline: "2px solid",
54
- outlineColor: {
55
- primary: "var(--primaryFocus, #9385D3)",
56
- default: {
57
- true: "var(--error, #FF5B5E)",
58
- false: "var(--primaryFocus, #9385D3)"
59
- }[o.toString()]
60
- }[r]
61
- },
62
- _hover: {
63
- primary: {
64
- bg: "color-mix(in srgb, var(--primary, #674DC7) 100%, #000 15%)"
65
- },
66
- default: {
67
- borderColor: {
68
- true: "var(--error, #D52B2E)",
69
- false: "var(--primary, #8163E1)"
70
- }[o.toString()],
71
- bg: !o && "color-mix(in srgb, var(--primary, #8163E1) 10%, #FFF 90%)"
72
- }
73
- }[r],
74
- _themeDark: {
75
- _active: {
76
- primary: {
77
- bg: "color-mix(in srgb, var(--primary, #8163E1) 100%, #FFF 30%);"
78
- },
79
- default: {
80
- bg: {
81
- true: "var(--error, #FF5B5E)",
82
- false: "var(--primary, #8163E1)"
83
- }[o.toString()],
84
- color: "var(--text, #F6F6F6)"
85
- }
86
- }[r],
87
- _disabled: {
88
- primary: {
89
- color: "#373737",
90
- bgColor: "#47474A",
91
- borderColor: "transparent"
92
- },
93
- default: {
94
- color: "#373737",
95
- bgColor: "#47474A",
96
- borderColor: "transparent"
97
- }
98
- }[r],
99
- _hover: {
100
- primary: {
101
- bg: "color-mix(in srgb, var(--primary, #8163E1) 100%, #FFF 15%);",
102
- outlineColor: "var(--primary, #674DC7)"
103
- },
104
- default: {
105
- borderColor: {
106
- true: "var(--error, #FF5B5E)",
107
- false: "var(--primary, #8163E1)"
108
- }[o.toString()],
109
- bg: !o && "color-mix(in srgb, var(--primary, #674DC7) 10%, var(--inputBackground, #2E2E2E) 90%)"
110
- }
111
- }[r],
112
- _focusVisible: {
113
- outlineColor: {
114
- primary: "var(--primaryFocus, #927CE4)",
115
- default: {
116
- true: "var(--error, #D52B2E)",
117
- false: "var(--primaryFocus, #927CE4)"
118
- }[o.toString()]
119
- }[r]
120
- },
121
- bg: {
122
- primary: "var(--primary, #8163E1)",
123
- default: "var(--inputBackground, #2E2E2E)"
124
- }[r]
125
- },
126
- "aria-disabled": p,
127
- "aria-label": "button",
128
- bg: {
129
- primary: "var(--primary, #8163E1)",
130
- default: "var(--inputBackground, #FFF)"
131
- }[r],
132
- border: {
133
- primary: "none",
134
- default: "1px solid var(--border, #E4E4E4)"
135
- }[r],
136
- borderRadius: {
137
- primary: "8px",
138
- default: "10px"
139
- }[r],
140
- boxSizing: "border-box",
141
- className: n,
142
- color: {
143
- primary: "#FFF",
144
- default: {
145
- true: "var(--error, #D52B2E)",
146
- false: "var(--text, #272727)"
147
- }[o.toString()]
148
- }[r],
149
- cursor: "pointer",
150
- disabled: p,
151
- fontSize: {
152
- default: ["14px", null, null, null, "15px"],
153
- primary: ["15px", null, null, null, "16px"]
154
- }[r],
155
- fontWeight: 700,
156
- letterSpacing: {
157
- default: ["-0.02em", null, null, null, "-0.03em"],
158
- primary: ["0px", null, null, null, "-0.01em"]
159
- }[r],
160
- outlineOffset: "2px",
161
- pos: "relative",
162
- px: {
163
- false: { sm: "12px", md: "16px", lg: "20px" }[i],
164
- true: { sm: "24px", md: "28px", lg: "32px" }[i]
165
- }[(!!(l || t)).toString()],
166
- py: { sm: "8px", md: "10px", lg: "12px" }[i],
167
- styleOrder: 1,
168
- styleVars: {
169
- primary: e?.primary,
170
- error: e?.error,
171
- text: e?.text,
172
- border: e?.border,
173
- inputBackground: e?.inputBackground,
174
- primaryFocus: e?.primaryFocus
175
- },
176
- transition: ".25s",
177
- type: m,
178
- typography: b,
179
- ...f,
180
- children: /* @__PURE__ */ y(u, { maxW: "100%", mx: "auto", pos: "relative", w: "fit-content", children: [
181
- (l || t) && /* @__PURE__ */ a(
182
- c,
183
- {
184
- boxSize: "24px",
185
- left: "4px",
186
- pos: "absolute",
187
- role: "presentation",
188
- selectors: {
189
- "&>svg": {
190
- color: "inherit"
191
- }
192
- },
193
- top: "50%",
194
- transform: "translate(-100%, -50%)",
195
- children: t ? /* @__PURE__ */ a(g, { type: d }) : l
196
- }
197
- ),
198
- /* @__PURE__ */ a(
199
- u,
200
- {
201
- className: x ? E({
202
- overflow: "hidden",
203
- textOverflow: "ellipsis",
204
- whiteSpace: "nowrap"
205
- }) : void 0,
206
- lineHeight: "1.2",
207
- minH: "1.2em",
208
- transform: !!(l || t) && "translateX(8px)",
209
- children: s
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
- export {
217
- B as Button
218
- };
220
+ //#endregion
221
+ export { s as Button };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");function n({color:t,...i}){return e.jsx("svg",{height:"10",viewBox:"0 0 12 10",width:"12",xmlns:"http://www.w3.org/2000/svg",...i,children: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=n;
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
- function t({ color: i, ...l }) {
3
- return /* @__PURE__ */ e(
4
- "svg",
5
- {
6
- height: "10",
7
- viewBox: "0 0 12 10",
8
- width: "12",
9
- xmlns: "http://www.w3.org/2000/svg",
10
- ...l,
11
- children: /* @__PURE__ */ e(
12
- "path",
13
- {
14
- clipRule: "evenodd",
15
- 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",
16
- fill: i,
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
- export {
24
- t as CheckIcon
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;