@devup-ui/components 0.1.21 → 0.1.23
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/README.md +43 -34
- package/dist/components/Button/index.cjs +1 -1
- package/dist/components/Button/index.js +62 -62
- package/dist/components/Checkbox/index.cjs +1 -1
- package/dist/components/Checkbox/index.js +45 -45
- package/dist/components/Input/index.cjs +1 -1
- package/dist/components/Input/index.js +63 -63
- package/dist/components/Radio/index.cjs +1 -1
- package/dist/components/Radio/index.js +85 -85
- package/dist/components/RadioGroup/index.cjs +1 -1
- package/dist/components/RadioGroup/index.js +48 -48
- package/dist/components/Select/index.cjs +1 -1
- package/dist/components/Select/index.js +129 -129
- package/dist/components/Toggle/index.cjs +1 -1
- package/dist/components/Toggle/index.js +52 -52
- package/package.json +12 -12
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useRef as R, useState as
|
|
4
|
-
import { Box as k, VStack as H, Flex as
|
|
2
|
+
import { jsx as i, jsxs as C, Fragment as O } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as R, useState as w, useEffect as z, createElement as L, Children as W } from "react";
|
|
4
|
+
import { Box as k, VStack as H, Flex as A, css as v } from "@devup-ui/react";
|
|
5
5
|
import N from "clsx";
|
|
6
|
-
import { SelectContext as T, useSelect as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { IconCheck as
|
|
6
|
+
import { SelectContext as T, useSelect as S } from "../../contexts/useSelect.js";
|
|
7
|
+
import { Button as B } from "../Button/index.js";
|
|
8
|
+
import { IconCheck as D } from "./IconCheck.js";
|
|
9
9
|
function G({
|
|
10
|
-
type:
|
|
11
|
-
children:
|
|
12
|
-
defaultValue:
|
|
13
|
-
value:
|
|
14
|
-
onChange:
|
|
15
|
-
defaultOpen:
|
|
16
|
-
open:
|
|
17
|
-
onOpenChange:
|
|
18
|
-
colors:
|
|
19
|
-
typography:
|
|
20
|
-
options:
|
|
21
|
-
...
|
|
10
|
+
type: n = "default",
|
|
11
|
+
children: s,
|
|
12
|
+
defaultValue: h,
|
|
13
|
+
value: o,
|
|
14
|
+
onChange: c,
|
|
15
|
+
defaultOpen: g,
|
|
16
|
+
open: p,
|
|
17
|
+
onOpenChange: f,
|
|
18
|
+
colors: t,
|
|
19
|
+
typography: d,
|
|
20
|
+
options: a,
|
|
21
|
+
...m
|
|
22
22
|
}) {
|
|
23
|
-
const r = R(null), [b,
|
|
24
|
-
|
|
23
|
+
const r = R(null), [b, l] = w(g ?? !1), [u, x] = w(
|
|
24
|
+
h ?? (n === "checkbox" ? [] : "")
|
|
25
25
|
);
|
|
26
26
|
z(() => {
|
|
27
|
-
const
|
|
28
|
-
r.current && r.current.contains(E.target) ||
|
|
27
|
+
const e = (E) => {
|
|
28
|
+
r.current && r.current.contains(E.target) || l(!1);
|
|
29
29
|
};
|
|
30
|
-
return document.addEventListener("click",
|
|
31
|
-
}, [b,
|
|
32
|
-
const y = (
|
|
33
|
-
|
|
34
|
-
}, F = (
|
|
35
|
-
if (
|
|
36
|
-
if (
|
|
37
|
-
|
|
30
|
+
return document.addEventListener("click", e), () => document.removeEventListener("click", e);
|
|
31
|
+
}, [b, l]);
|
|
32
|
+
const y = (e) => {
|
|
33
|
+
f?.(e), l(e);
|
|
34
|
+
}, F = (e) => {
|
|
35
|
+
if (c?.(e), n !== "default") {
|
|
36
|
+
if (n === "radio") {
|
|
37
|
+
x(e);
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
Array.isArray(
|
|
40
|
+
Array.isArray(u) && u.includes(e) ? x(u.filter((E) => E !== e)) : x([...u, e]);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ i(
|
|
44
44
|
T.Provider,
|
|
45
45
|
{
|
|
46
46
|
value: {
|
|
47
|
-
open:
|
|
47
|
+
open: p ?? b,
|
|
48
48
|
setOpen: y,
|
|
49
|
-
value:
|
|
49
|
+
value: o ?? u,
|
|
50
50
|
setValue: F,
|
|
51
|
-
type:
|
|
51
|
+
type: n,
|
|
52
52
|
ref: r
|
|
53
53
|
},
|
|
54
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ i(
|
|
55
55
|
k,
|
|
56
56
|
{
|
|
57
57
|
ref: r,
|
|
@@ -64,89 +64,89 @@ function G({
|
|
|
64
64
|
},
|
|
65
65
|
styleOrder: 1,
|
|
66
66
|
styleVars: {
|
|
67
|
-
primary:
|
|
68
|
-
border:
|
|
69
|
-
inputBackground:
|
|
70
|
-
base10:
|
|
71
|
-
title:
|
|
72
|
-
selectDisabled:
|
|
73
|
-
primaryBg:
|
|
74
|
-
inputDisabledBackground:
|
|
75
|
-
inputDisabledText:
|
|
67
|
+
primary: t?.primary,
|
|
68
|
+
border: t?.border,
|
|
69
|
+
inputBackground: t?.inputBackground,
|
|
70
|
+
base10: t?.base10,
|
|
71
|
+
title: t?.title,
|
|
72
|
+
selectDisabled: t?.selectDisabled,
|
|
73
|
+
primaryBg: t?.primaryBg,
|
|
74
|
+
inputDisabledBackground: t?.inputDisabledBackground,
|
|
75
|
+
inputDisabledText: t?.inputDisabledText
|
|
76
76
|
},
|
|
77
|
-
typography:
|
|
78
|
-
...
|
|
79
|
-
children:
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
] }) :
|
|
77
|
+
typography: d,
|
|
78
|
+
...m,
|
|
79
|
+
children: a ? /* @__PURE__ */ C(O, { children: [
|
|
80
|
+
/* @__PURE__ */ i($, { children: s }),
|
|
81
|
+
/* @__PURE__ */ i(j, { children: a?.map((e) => /* @__PURE__ */ L(I, { ...e, key: "option-" + e.value }, e.label ?? e.value)) })
|
|
82
|
+
] }) : s
|
|
83
83
|
}
|
|
84
84
|
)
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
87
|
}
|
|
88
88
|
function $({
|
|
89
|
-
className:
|
|
90
|
-
children:
|
|
91
|
-
asChild:
|
|
92
|
-
...
|
|
89
|
+
className: n,
|
|
90
|
+
children: s,
|
|
91
|
+
asChild: h,
|
|
92
|
+
...o
|
|
93
93
|
}) {
|
|
94
|
-
const { open:
|
|
95
|
-
|
|
94
|
+
const { open: c, setOpen: g } = S(), p = () => {
|
|
95
|
+
g(!c);
|
|
96
96
|
};
|
|
97
|
-
if (
|
|
98
|
-
const
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
|
|
97
|
+
if (h) {
|
|
98
|
+
const f = W.only(s), t = f.type;
|
|
99
|
+
return /* @__PURE__ */ i(
|
|
100
|
+
t,
|
|
101
101
|
{
|
|
102
|
-
"aria-expanded":
|
|
102
|
+
"aria-expanded": c,
|
|
103
103
|
"aria-label": "Select toggle",
|
|
104
|
-
onClick:
|
|
105
|
-
...
|
|
104
|
+
onClick: p,
|
|
105
|
+
...f.props
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
108
|
}
|
|
109
|
-
return /* @__PURE__ */
|
|
110
|
-
|
|
109
|
+
return /* @__PURE__ */ i(
|
|
110
|
+
B,
|
|
111
111
|
{
|
|
112
|
-
"aria-expanded":
|
|
112
|
+
"aria-expanded": c,
|
|
113
113
|
"aria-label": "Select toggle",
|
|
114
114
|
className: N(
|
|
115
115
|
v({
|
|
116
116
|
borderRadius: "8px",
|
|
117
117
|
styleOrder: 2
|
|
118
118
|
}),
|
|
119
|
-
|
|
119
|
+
n
|
|
120
120
|
),
|
|
121
|
-
onClick:
|
|
122
|
-
...
|
|
123
|
-
children:
|
|
121
|
+
onClick: p,
|
|
122
|
+
...o,
|
|
123
|
+
children: s
|
|
124
124
|
}
|
|
125
125
|
);
|
|
126
126
|
}
|
|
127
127
|
function j({
|
|
128
|
-
children:
|
|
129
|
-
showConfirmButton:
|
|
130
|
-
confirmButtonText:
|
|
131
|
-
x:
|
|
132
|
-
y:
|
|
133
|
-
...
|
|
128
|
+
children: n,
|
|
129
|
+
showConfirmButton: s,
|
|
130
|
+
confirmButtonText: h = "완료",
|
|
131
|
+
x: o = 0,
|
|
132
|
+
y: c = 0,
|
|
133
|
+
...g
|
|
134
134
|
}) {
|
|
135
|
-
const { open:
|
|
136
|
-
return
|
|
135
|
+
const { open: p, setOpen: f, type: t, ref: d } = S();
|
|
136
|
+
return p ? /* @__PURE__ */ C(
|
|
137
137
|
H,
|
|
138
138
|
{
|
|
139
|
-
ref: (
|
|
140
|
-
if (!
|
|
141
|
-
const
|
|
139
|
+
ref: (a) => {
|
|
140
|
+
if (!d.current || !a) return;
|
|
141
|
+
const m = d.current, r = () => {
|
|
142
142
|
const {
|
|
143
143
|
height: b,
|
|
144
|
-
x:
|
|
145
|
-
y:
|
|
146
|
-
top:
|
|
144
|
+
x: l,
|
|
145
|
+
y: u,
|
|
146
|
+
top: x,
|
|
147
147
|
left: y
|
|
148
|
-
} =
|
|
149
|
-
F ?
|
|
148
|
+
} = m.getBoundingClientRect(), F = a.offsetHeight + x + window.scrollY + b + c > document.documentElement.scrollHeight, e = a.offsetWidth + y + window.scrollX + o > document.documentElement.scrollWidth;
|
|
149
|
+
F ? a.style.bottom = `${window.innerHeight - u + 10}px` : a.style.top = `${u + b + 10 + c}px`, e ? a.style.left = `${Math.max(l - a.offsetWidth + m.offsetWidth, 0) + o}px` : a.style.left = `${l + o}px`;
|
|
150
150
|
};
|
|
151
151
|
return r(), window.addEventListener("scroll", r, !0), window.addEventListener("resize", r), () => {
|
|
152
152
|
window.removeEventListener("scroll", r, !0), window.removeEventListener("resize", r);
|
|
@@ -166,11 +166,11 @@ function j({
|
|
|
166
166
|
styleOrder: 1,
|
|
167
167
|
userSelect: "none",
|
|
168
168
|
zIndex: 1,
|
|
169
|
-
...
|
|
169
|
+
...g,
|
|
170
170
|
children: [
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
n,
|
|
172
|
+
s && t === "checkbox" && /* @__PURE__ */ i(A, { justifyContent: "end", w: "100%", children: /* @__PURE__ */ i(
|
|
173
|
+
B,
|
|
174
174
|
{
|
|
175
175
|
"aria-label": "Select confirm button",
|
|
176
176
|
className: v({
|
|
@@ -183,9 +183,9 @@ function j({
|
|
|
183
183
|
color: "#FFF",
|
|
184
184
|
typography: "buttonS"
|
|
185
185
|
}),
|
|
186
|
-
onClick: () =>
|
|
186
|
+
onClick: () => f(!1),
|
|
187
187
|
variant: "primary",
|
|
188
|
-
children:
|
|
188
|
+
children: h
|
|
189
189
|
}
|
|
190
190
|
) })
|
|
191
191
|
]
|
|
@@ -193,64 +193,64 @@ function j({
|
|
|
193
193
|
) : null;
|
|
194
194
|
}
|
|
195
195
|
function I({
|
|
196
|
-
disabled:
|
|
197
|
-
onClick:
|
|
198
|
-
children:
|
|
199
|
-
value:
|
|
200
|
-
showCheck:
|
|
201
|
-
...
|
|
196
|
+
disabled: n,
|
|
197
|
+
onClick: s,
|
|
198
|
+
children: h,
|
|
199
|
+
value: o,
|
|
200
|
+
showCheck: c = !0,
|
|
201
|
+
...g
|
|
202
202
|
}) {
|
|
203
|
-
const { setOpen:
|
|
204
|
-
|
|
205
|
-
},
|
|
206
|
-
if (
|
|
207
|
-
|
|
203
|
+
const { setOpen: p, setValue: f, value: t, type: d } = S(), a = () => {
|
|
204
|
+
d !== "checkbox" && p(!1);
|
|
205
|
+
}, m = (l, u) => {
|
|
206
|
+
if (s) {
|
|
207
|
+
s(l, u);
|
|
208
208
|
return;
|
|
209
209
|
}
|
|
210
|
-
typeof
|
|
210
|
+
typeof l == "string" && f(l), a();
|
|
211
211
|
}, r = {
|
|
212
212
|
default: !1,
|
|
213
|
-
radio:
|
|
214
|
-
checkbox: Array.isArray(
|
|
215
|
-
}[
|
|
216
|
-
return /* @__PURE__ */
|
|
217
|
-
|
|
213
|
+
radio: t === o,
|
|
214
|
+
checkbox: Array.isArray(t) && o && t.includes(o)
|
|
215
|
+
}[d], b = !n && !(d === "radio" && r);
|
|
216
|
+
return /* @__PURE__ */ C(
|
|
217
|
+
A,
|
|
218
218
|
{
|
|
219
219
|
_hover: b && {
|
|
220
220
|
bg: "var(--primaryBg, light-dark(#F4F3FA, #F4F3FA0D))"
|
|
221
221
|
},
|
|
222
222
|
alignItems: "center",
|
|
223
223
|
borderRadius: "6px",
|
|
224
|
-
color:
|
|
224
|
+
color: n ? "var(--selectDisabled, light-dark(#C4C5D1, #45464D))" : r ? "var(--primary, light-dark(#674DC7, #8163E1)" : "var(--title, light-dark(#1A1A1A,#FAFAFA))",
|
|
225
225
|
cursor: b ? "pointer" : "default",
|
|
226
|
-
"data-value":
|
|
226
|
+
"data-value": o,
|
|
227
227
|
fontWeight: r ? "700" : "400",
|
|
228
228
|
gap: {
|
|
229
229
|
checkbox: "10px",
|
|
230
230
|
radio: "6px",
|
|
231
231
|
default: "0"
|
|
232
|
-
}[
|
|
232
|
+
}[d],
|
|
233
233
|
h: "40px",
|
|
234
|
-
onClick:
|
|
234
|
+
onClick: n ? void 0 : (l) => m(o, l),
|
|
235
235
|
px: "10px",
|
|
236
236
|
styleOrder: 1,
|
|
237
237
|
transition: "background-color 0.1s ease-in-out",
|
|
238
|
-
...
|
|
238
|
+
...g,
|
|
239
239
|
children: [
|
|
240
|
-
|
|
241
|
-
checkbox: /* @__PURE__ */
|
|
240
|
+
c && {
|
|
241
|
+
checkbox: /* @__PURE__ */ i(
|
|
242
242
|
k,
|
|
243
243
|
{
|
|
244
|
-
bg:
|
|
244
|
+
bg: n ? "var(--inputDisabledBackground, light-dark(#F0F0F3, #414244))" : r ? "var(--primary, light-dark(#674DC7, #8163E1)" : "var(--border, light-dark(#E4E4E4, #434343))",
|
|
245
245
|
borderRadius: "4px",
|
|
246
246
|
boxSize: "18px",
|
|
247
247
|
pos: "relative",
|
|
248
248
|
transition: "background-color 0.1s ease-in-out",
|
|
249
|
-
children: r && /* @__PURE__ */
|
|
250
|
-
|
|
249
|
+
children: r && /* @__PURE__ */ i(
|
|
250
|
+
D,
|
|
251
251
|
{
|
|
252
252
|
className: v({
|
|
253
|
-
color:
|
|
253
|
+
color: n ? "var(--inputDisabledText, light-dark(#E5E5E5, #373737))" : "#FFF",
|
|
254
254
|
position: "absolute",
|
|
255
255
|
top: "55%",
|
|
256
256
|
left: "50%",
|
|
@@ -260,15 +260,15 @@ function I({
|
|
|
260
260
|
)
|
|
261
261
|
}
|
|
262
262
|
),
|
|
263
|
-
radio: /* @__PURE__ */
|
|
263
|
+
radio: /* @__PURE__ */ i(O, { children: r && /* @__PURE__ */ i(
|
|
264
264
|
k,
|
|
265
265
|
{
|
|
266
266
|
borderRadius: "4px",
|
|
267
267
|
boxSize: "18px",
|
|
268
268
|
pos: "relative",
|
|
269
269
|
transition: "background-color 0.1s ease-in-out",
|
|
270
|
-
children: /* @__PURE__ */
|
|
271
|
-
|
|
270
|
+
children: /* @__PURE__ */ i(
|
|
271
|
+
D,
|
|
272
272
|
{
|
|
273
273
|
className: v({
|
|
274
274
|
position: "absolute",
|
|
@@ -282,21 +282,21 @@ function I({
|
|
|
282
282
|
}
|
|
283
283
|
) }),
|
|
284
284
|
default: null
|
|
285
|
-
}[
|
|
286
|
-
|
|
285
|
+
}[d],
|
|
286
|
+
h
|
|
287
287
|
]
|
|
288
288
|
}
|
|
289
289
|
);
|
|
290
290
|
}
|
|
291
|
-
function J({ ...
|
|
292
|
-
return /* @__PURE__ */
|
|
291
|
+
function J({ ...n }) {
|
|
292
|
+
return /* @__PURE__ */ i(
|
|
293
293
|
k,
|
|
294
294
|
{
|
|
295
295
|
bg: "var(--border, light-dark(#E4E4E4,#434343)",
|
|
296
296
|
h: "1px",
|
|
297
297
|
styleOrder: 1,
|
|
298
298
|
w: "100%",
|
|
299
|
-
...
|
|
299
|
+
...n
|
|
300
300
|
}
|
|
301
301
|
);
|
|
302
302
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),t=require("@devup-ui/react"),y=require("react");function f({defaultValue:l=null,value:o=null,onChange:s,disabled:n,className:g,style:p,variant:d="default",colors:r,classNames:u,styles:x}){const[b,v]=y.useState(o??l??!1),e=o??b;function c(h){s?.(!h),v(m=>!m)}const a=d==="default";return i.jsxs(i.Fragment,{children:[i.jsx(t.Box,{"aria-disabled":n,bg:e?"var(--primary)":"var(--bg, light-dark(#E4E4E4, #383838))",borderRadius:"500px",boxSizing:"border-box",className:g,cursor:"pointer",h:a?"28px":"8px",justifyContent:e&&"flex-end",onClick:()=>!n&&c(e),p:a&&1,position:"relative",role:"group",selectors:{"&[aria-disabled=true]":{cursor:"not-allowed",bg:"var(--disabledBg, light-dark(#D6D7DE, #373737))"},"&:hover:not([aria-disabled=true]):not(:disabled)":{bg:e?"var(--primaryHoverBg, light-dark(color-mix(in srgb, var(--primary) 100%, #000 15%), color-mix(in srgb, var(--primary) 100%, #FFF 15%)))":"var(--hoverBg, light-dark(#C3C2C8, #696A6F))"}},style:p,styleVars:{primary:r?.primary,bg:r?.bg,primaryHoverBg:r?.primaryHoverBg,hoverBg:r?.hoverBg,disabledBg:r?.disabledBg},"test-id":"toggle-wrapper",transition:".25s",w:a?"50px":"40px",children:i.jsx(t.Box,{_groupHover:!a&&{outline:"4px solid",outlineColor:"var(--switchHoverOutline, light-dark(color-mix(in srgb, var(--primary) 20%, transparent), color-mix(in srgb, var(--primary) 50%, transparent)))"},backgroundColor:"#fff",borderRadius:"100%",boxSize:"20px",className:u?.toggle,filter:!a&&"drop-shadow(0px 0px 3px var(--switchShadow, rgba(0, 0, 0, 0.10)));",outline:"4px",pos:"absolute",style:x?.toggle,styleVars:{primary:r?.primary,primaryHoverBg:r?.primaryHoverBg,switchShadow:r?.switchShadow,switchHoverOutline:r?.switchHoverOutline},top:!a&&"-6px",transform:e&&"translateX(calc(100% + 2px))",transition:".25s"})}),i.jsx(t.Input,{type:"hidden",value:String(e)})]})}exports.Toggle=f;
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { Box as
|
|
4
|
-
import { useState as
|
|
5
|
-
function
|
|
6
|
-
defaultValue:
|
|
7
|
-
value:
|
|
8
|
-
onChange:
|
|
9
|
-
disabled:
|
|
10
|
-
className:
|
|
11
|
-
style:
|
|
12
|
-
variant:
|
|
13
|
-
colors:
|
|
14
|
-
classNames:
|
|
15
|
-
styles:
|
|
2
|
+
import { jsxs as c, Fragment as f, jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import { Box as n, Input as w } from "@devup-ui/react";
|
|
4
|
+
import { useState as B } from "react";
|
|
5
|
+
function S({
|
|
6
|
+
defaultValue: l = null,
|
|
7
|
+
value: t = null,
|
|
8
|
+
onChange: s,
|
|
9
|
+
disabled: o,
|
|
10
|
+
className: p,
|
|
11
|
+
style: g,
|
|
12
|
+
variant: d = "default",
|
|
13
|
+
colors: r,
|
|
14
|
+
classNames: u,
|
|
15
|
+
styles: m
|
|
16
16
|
}) {
|
|
17
|
-
const [
|
|
18
|
-
|
|
19
|
-
),
|
|
20
|
-
function
|
|
21
|
-
|
|
17
|
+
const [b, v] = B(
|
|
18
|
+
t ?? l ?? !1
|
|
19
|
+
), a = t ?? b;
|
|
20
|
+
function x(h) {
|
|
21
|
+
s?.(!h), v((y) => !y);
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
23
|
+
const e = d === "default";
|
|
24
|
+
return /* @__PURE__ */ c(f, { children: [
|
|
25
|
+
/* @__PURE__ */ i(
|
|
26
|
+
n,
|
|
27
27
|
{
|
|
28
|
-
"aria-disabled":
|
|
29
|
-
bg:
|
|
28
|
+
"aria-disabled": o,
|
|
29
|
+
bg: a ? "var(--primary)" : "var(--bg, light-dark(#E4E4E4, #383838))",
|
|
30
30
|
borderRadius: "500px",
|
|
31
31
|
boxSizing: "border-box",
|
|
32
|
-
className:
|
|
32
|
+
className: p,
|
|
33
33
|
cursor: "pointer",
|
|
34
|
-
h:
|
|
35
|
-
justifyContent:
|
|
36
|
-
onClick: () => !
|
|
37
|
-
p:
|
|
34
|
+
h: e ? "28px" : "8px",
|
|
35
|
+
justifyContent: a && "flex-end",
|
|
36
|
+
onClick: () => !o && x(a),
|
|
37
|
+
p: e && 1,
|
|
38
38
|
position: "relative",
|
|
39
39
|
role: "group",
|
|
40
40
|
selectors: {
|
|
@@ -43,51 +43,51 @@ function E({
|
|
|
43
43
|
bg: "var(--disabledBg, light-dark(#D6D7DE, #373737))"
|
|
44
44
|
},
|
|
45
45
|
"&:hover:not([aria-disabled=true]):not(:disabled)": {
|
|
46
|
-
bg:
|
|
46
|
+
bg: a ? "var(--primaryHoverBg, light-dark(color-mix(in srgb, var(--primary) 100%, #000 15%), color-mix(in srgb, var(--primary) 100%, #FFF 15%)))" : "var(--hoverBg, light-dark(#C3C2C8, #696A6F))"
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
|
-
style:
|
|
49
|
+
style: g,
|
|
50
50
|
styleVars: {
|
|
51
|
-
primary:
|
|
52
|
-
bg:
|
|
53
|
-
primaryHoverBg:
|
|
54
|
-
hoverBg:
|
|
55
|
-
disabledBg:
|
|
51
|
+
primary: r?.primary,
|
|
52
|
+
bg: r?.bg,
|
|
53
|
+
primaryHoverBg: r?.primaryHoverBg,
|
|
54
|
+
hoverBg: r?.hoverBg,
|
|
55
|
+
disabledBg: r?.disabledBg
|
|
56
56
|
},
|
|
57
57
|
"test-id": "toggle-wrapper",
|
|
58
58
|
transition: ".25s",
|
|
59
|
-
w:
|
|
60
|
-
children: /* @__PURE__ */
|
|
61
|
-
|
|
59
|
+
w: e ? "50px" : "40px",
|
|
60
|
+
children: /* @__PURE__ */ i(
|
|
61
|
+
n,
|
|
62
62
|
{
|
|
63
|
-
_groupHover: !
|
|
63
|
+
_groupHover: !e && {
|
|
64
64
|
outline: "4px solid",
|
|
65
65
|
outlineColor: "var(--switchHoverOutline, light-dark(color-mix(in srgb, var(--primary) 20%, transparent), color-mix(in srgb, var(--primary) 50%, transparent)))"
|
|
66
66
|
},
|
|
67
67
|
backgroundColor: "#fff",
|
|
68
68
|
borderRadius: "100%",
|
|
69
69
|
boxSize: "20px",
|
|
70
|
-
className:
|
|
71
|
-
filter: !
|
|
70
|
+
className: u?.toggle,
|
|
71
|
+
filter: !e && "drop-shadow(0px 0px 3px var(--switchShadow, rgba(0, 0, 0, 0.10)));",
|
|
72
72
|
outline: "4px",
|
|
73
73
|
pos: "absolute",
|
|
74
|
-
style:
|
|
74
|
+
style: m?.toggle,
|
|
75
75
|
styleVars: {
|
|
76
|
-
primary:
|
|
77
|
-
primaryHoverBg:
|
|
78
|
-
switchShadow:
|
|
79
|
-
switchHoverOutline:
|
|
76
|
+
primary: r?.primary,
|
|
77
|
+
primaryHoverBg: r?.primaryHoverBg,
|
|
78
|
+
switchShadow: r?.switchShadow,
|
|
79
|
+
switchHoverOutline: r?.switchHoverOutline
|
|
80
80
|
},
|
|
81
|
-
top: !
|
|
82
|
-
transform:
|
|
81
|
+
top: !e && "-6px",
|
|
82
|
+
transform: a && "translateX(calc(100% + 2px))",
|
|
83
83
|
transition: ".25s"
|
|
84
84
|
}
|
|
85
85
|
)
|
|
86
86
|
}
|
|
87
87
|
),
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ i(w, { type: "hidden", value: String(a) })
|
|
89
89
|
] });
|
|
90
90
|
}
|
|
91
91
|
export {
|
|
92
|
-
|
|
92
|
+
S as Toggle
|
|
93
93
|
};
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"css-in-js-framework",
|
|
17
17
|
"react"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.1.
|
|
19
|
+
"version": "0.1.23",
|
|
20
20
|
"type": "module",
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"access": "public"
|
|
@@ -38,26 +38,26 @@
|
|
|
38
38
|
"csstype": "^3.1.3",
|
|
39
39
|
"react": "^19.1.1",
|
|
40
40
|
"clsx": "^2.1",
|
|
41
|
-
"@devup-ui/react": "1.0.
|
|
41
|
+
"@devup-ui/react": "1.0.20"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@storybook/addon-docs": "^9.1.
|
|
45
|
-
"@storybook/addon-onboarding": "^9.1.
|
|
46
|
-
"@storybook/react-vite": "^9.1.
|
|
47
|
-
"@types/react": "^19.1.
|
|
48
|
-
"eslint-plugin-storybook": "^9.1.
|
|
44
|
+
"@storybook/addon-docs": "^9.1.10",
|
|
45
|
+
"@storybook/addon-onboarding": "^9.1.10",
|
|
46
|
+
"@storybook/react-vite": "^9.1.10",
|
|
47
|
+
"@types/react": "^19.1.16",
|
|
48
|
+
"eslint-plugin-storybook": "^9.1.10",
|
|
49
49
|
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
50
|
-
"storybook": "^9.1.
|
|
51
|
-
"typescript": "^5.9.
|
|
52
|
-
"vite": "^7.1.
|
|
50
|
+
"storybook": "^9.1.10",
|
|
51
|
+
"typescript": "^5.9.3",
|
|
52
|
+
"vite": "^7.1.7",
|
|
53
53
|
"vite-plugin-dts": "^4.5.4",
|
|
54
54
|
"vitest": "^3.2.4",
|
|
55
|
-
"@devup-ui/vite-plugin": "1.0.
|
|
55
|
+
"@devup-ui/vite-plugin": "1.0.44"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"csstype": "*",
|
|
59
59
|
"react": "*",
|
|
60
|
-
"@devup-ui/react": "1.0.
|
|
60
|
+
"@devup-ui/react": "1.0.20"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"lint": "eslint",
|