@devup-ui/components 0.1.22 → 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.
@@ -1,57 +1,57 @@
1
1
  "use client";
2
- import { jsx as a, jsxs as S, Fragment as B } from "react/jsx-runtime";
3
- import { useRef as R, useState as D, useEffect as z, createElement as L, Children as W } from "react";
4
- import { Box as k, VStack as H, Flex as C, css as v } from "@devup-ui/react";
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 w } from "../../contexts/useSelect.js";
7
- import { Button as O } from "../Button/index.js";
8
- import { IconCheck as A } from "./IconCheck.js";
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: i = "default",
11
- children: o,
12
- defaultValue: m,
13
- value: d,
14
- onChange: l,
15
- defaultOpen: x,
16
- open: f,
17
- onOpenChange: c,
18
- colors: e,
19
- typography: u,
20
- options: n,
21
- ...h
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, s] = D(x ?? !1), [p, g] = D(
24
- m ?? (i === "checkbox" ? [] : "")
23
+ const r = R(null), [b, l] = w(g ?? !1), [u, x] = w(
24
+ h ?? (n === "checkbox" ? [] : "")
25
25
  );
26
26
  z(() => {
27
- const t = (E) => {
28
- r.current && r.current.contains(E.target) || s(!1);
27
+ const e = (E) => {
28
+ r.current && r.current.contains(E.target) || l(!1);
29
29
  };
30
- return document.addEventListener("click", t), () => document.removeEventListener("click", t);
31
- }, [b, s]);
32
- const y = (t) => {
33
- c == null || c(t), s(t);
34
- }, F = (t) => {
35
- if (l == null || l(t), i !== "default") {
36
- if (i === "radio") {
37
- g(t);
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(p) && p.includes(t) ? g(p.filter((E) => E !== t)) : g([...p, t]);
40
+ Array.isArray(u) && u.includes(e) ? x(u.filter((E) => E !== e)) : x([...u, e]);
41
41
  }
42
42
  };
43
- return /* @__PURE__ */ a(
43
+ return /* @__PURE__ */ i(
44
44
  T.Provider,
45
45
  {
46
46
  value: {
47
- open: f ?? b,
47
+ open: p ?? b,
48
48
  setOpen: y,
49
- value: d ?? p,
49
+ value: o ?? u,
50
50
  setValue: F,
51
- type: i,
51
+ type: n,
52
52
  ref: r
53
53
  },
54
- children: /* @__PURE__ */ a(
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: e == null ? void 0 : e.primary,
68
- border: e == null ? void 0 : e.border,
69
- inputBackground: e == null ? void 0 : e.inputBackground,
70
- base10: e == null ? void 0 : e.base10,
71
- title: e == null ? void 0 : e.title,
72
- selectDisabled: e == null ? void 0 : e.selectDisabled,
73
- primaryBg: e == null ? void 0 : e.primaryBg,
74
- inputDisabledBackground: e == null ? void 0 : e.inputDisabledBackground,
75
- inputDisabledText: e == null ? void 0 : e.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: u,
78
- ...h,
79
- children: n ? /* @__PURE__ */ S(B, { children: [
80
- /* @__PURE__ */ a($, { children: o }),
81
- /* @__PURE__ */ a(j, { children: n == null ? void 0 : n.map((t) => /* @__PURE__ */ L(I, { ...t, key: "option-" + t.value }, t.label ?? t.value)) })
82
- ] }) : o
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: i,
90
- children: o,
91
- asChild: m,
92
- ...d
89
+ className: n,
90
+ children: s,
91
+ asChild: h,
92
+ ...o
93
93
  }) {
94
- const { open: l, setOpen: x } = w(), f = () => {
95
- x(!l);
94
+ const { open: c, setOpen: g } = S(), p = () => {
95
+ g(!c);
96
96
  };
97
- if (m) {
98
- const c = W.only(o), e = c.type;
99
- return /* @__PURE__ */ a(
100
- e,
97
+ if (h) {
98
+ const f = W.only(s), t = f.type;
99
+ return /* @__PURE__ */ i(
100
+ t,
101
101
  {
102
- "aria-expanded": l,
102
+ "aria-expanded": c,
103
103
  "aria-label": "Select toggle",
104
- onClick: f,
105
- ...c.props
104
+ onClick: p,
105
+ ...f.props
106
106
  }
107
107
  );
108
108
  }
109
- return /* @__PURE__ */ a(
110
- O,
109
+ return /* @__PURE__ */ i(
110
+ B,
111
111
  {
112
- "aria-expanded": l,
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
- i
119
+ n
120
120
  ),
121
- onClick: f,
122
- ...d,
123
- children: o
121
+ onClick: p,
122
+ ...o,
123
+ children: s
124
124
  }
125
125
  );
126
126
  }
127
127
  function j({
128
- children: i,
129
- showConfirmButton: o,
130
- confirmButtonText: m = "완료",
131
- x: d = 0,
132
- y: l = 0,
133
- ...x
128
+ children: n,
129
+ showConfirmButton: s,
130
+ confirmButtonText: h = "완료",
131
+ x: o = 0,
132
+ y: c = 0,
133
+ ...g
134
134
  }) {
135
- const { open: f, setOpen: c, type: e, ref: u } = w();
136
- return f ? /* @__PURE__ */ S(
135
+ const { open: p, setOpen: f, type: t, ref: d } = S();
136
+ return p ? /* @__PURE__ */ C(
137
137
  H,
138
138
  {
139
- ref: (n) => {
140
- if (!u.current || !n) return;
141
- const h = u.current, r = () => {
139
+ ref: (a) => {
140
+ if (!d.current || !a) return;
141
+ const m = d.current, r = () => {
142
142
  const {
143
143
  height: b,
144
- x: s,
145
- y: p,
146
- top: g,
144
+ x: l,
145
+ y: u,
146
+ top: x,
147
147
  left: y
148
- } = h.getBoundingClientRect(), F = n.offsetHeight + g + window.scrollY + b + l > document.documentElement.scrollHeight, t = n.offsetWidth + y + window.scrollX + d > document.documentElement.scrollWidth;
149
- F ? n.style.bottom = `${window.innerHeight - p + 10}px` : n.style.top = `${p + b + 10 + l}px`, t ? n.style.left = `${Math.max(s - n.offsetWidth + h.offsetWidth, 0) + d}px` : n.style.left = `${s + d}px`;
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
- ...x,
169
+ ...g,
170
170
  children: [
171
- i,
172
- o && e === "checkbox" && /* @__PURE__ */ a(C, { justifyContent: "end", w: "100%", children: /* @__PURE__ */ a(
173
- O,
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: () => c(!1),
186
+ onClick: () => f(!1),
187
187
  variant: "primary",
188
- children: m
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: i,
197
- onClick: o,
198
- children: m,
199
- value: d,
200
- showCheck: l = !0,
201
- ...x
196
+ disabled: n,
197
+ onClick: s,
198
+ children: h,
199
+ value: o,
200
+ showCheck: c = !0,
201
+ ...g
202
202
  }) {
203
- const { setOpen: f, setValue: c, value: e, type: u } = w(), n = () => {
204
- u !== "checkbox" && f(!1);
205
- }, h = (s, p) => {
206
- if (o) {
207
- o(s, p);
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 s == "string" && c(s), n();
210
+ typeof l == "string" && f(l), a();
211
211
  }, r = {
212
212
  default: !1,
213
- radio: e === d,
214
- checkbox: Array.isArray(e) && d && e.includes(d)
215
- }[u], b = !i && !(u === "radio" && r);
216
- return /* @__PURE__ */ S(
217
- C,
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: i ? "var(--selectDisabled, light-dark(#C4C5D1, #45464D))" : r ? "var(--primary, light-dark(#674DC7, #8163E1)" : "var(--title, light-dark(#1A1A1A,#FAFAFA))",
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": d,
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
- }[u],
232
+ }[d],
233
233
  h: "40px",
234
- onClick: i ? void 0 : (s) => h(d, s),
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
- ...x,
238
+ ...g,
239
239
  children: [
240
- l && {
241
- checkbox: /* @__PURE__ */ a(
240
+ c && {
241
+ checkbox: /* @__PURE__ */ i(
242
242
  k,
243
243
  {
244
- bg: i ? "var(--inputDisabledBackground, light-dark(#F0F0F3, #414244))" : r ? "var(--primary, light-dark(#674DC7, #8163E1)" : "var(--border, light-dark(#E4E4E4, #434343))",
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__ */ a(
250
- A,
249
+ children: r && /* @__PURE__ */ i(
250
+ D,
251
251
  {
252
252
  className: v({
253
- color: i ? "var(--inputDisabledText, light-dark(#E5E5E5, #373737))" : "#FFF",
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__ */ a(B, { children: r && /* @__PURE__ */ a(
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__ */ a(
271
- A,
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
- }[u],
286
- m
285
+ }[d],
286
+ h
287
287
  ]
288
288
  }
289
289
  );
290
290
  }
291
- function J({ ...i }) {
292
- return /* @__PURE__ */ a(
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
- ...i
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 t=require("react/jsx-runtime"),p=require("@devup-ui/react"),l=require("react");function H({defaultValue:x=null,value:d=null,onChange:a,disabled:u,className:b,style:v,variant:h="default",colors:e,classNames:n,styles:g}){const[m,y]=l.useState(d??x??!1),r=d??m;function f(w){a==null||a(!w),y(B=>!B)}const i=h==="default";return t.jsxs(t.Fragment,{children:[t.jsx(p.Box,{"aria-disabled":u,bg:r?"var(--primary)":"var(--bg, light-dark(#E4E4E4, #383838))",borderRadius:"500px",boxSizing:"border-box",className:b,cursor:"pointer",h:i?"28px":"8px",justifyContent:r&&"flex-end",onClick:()=>!u&&f(r),p:i&&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:r?"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:v,styleVars:{primary:e==null?void 0:e.primary,bg:e==null?void 0:e.bg,primaryHoverBg:e==null?void 0:e.primaryHoverBg,hoverBg:e==null?void 0:e.hoverBg,disabledBg:e==null?void 0:e.disabledBg},"test-id":"toggle-wrapper",transition:".25s",w:i?"50px":"40px",children:t.jsx(p.Box,{_groupHover:!i&&{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:n==null?void 0:n.toggle,filter:!i&&"drop-shadow(0px 0px 3px var(--switchShadow, rgba(0, 0, 0, 0.10)));",outline:"4px",pos:"absolute",style:g==null?void 0:g.toggle,styleVars:{primary:e==null?void 0:e.primary,primaryHoverBg:e==null?void 0:e.primaryHoverBg,switchShadow:e==null?void 0:e.switchShadow,switchHoverOutline:e==null?void 0:e.switchHoverOutline},top:!i&&"-6px",transform:r&&"translateX(calc(100% + 2px))",transition:".25s"})}),t.jsx(p.Input,{type:"hidden",value:String(r)})]})}exports.Toggle=H;
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 H, Fragment as k, jsx as n } from "react/jsx-runtime";
3
- import { Box as u, Input as l } from "@devup-ui/react";
4
- import { useState as S } from "react";
5
- function E({
6
- defaultValue: b = null,
7
- value: d = null,
8
- onChange: a,
9
- disabled: g,
10
- className: v,
11
- style: x,
12
- variant: m = "default",
13
- colors: i,
14
- classNames: e,
15
- styles: p
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 [h, f] = S(
18
- d ?? b ?? !1
19
- ), r = d ?? h;
20
- function y(w) {
21
- a == null || a(!w), f((B) => !B);
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 t = m === "default";
24
- return /* @__PURE__ */ H(k, { children: [
25
- /* @__PURE__ */ n(
26
- u,
23
+ const e = d === "default";
24
+ return /* @__PURE__ */ c(f, { children: [
25
+ /* @__PURE__ */ i(
26
+ n,
27
27
  {
28
- "aria-disabled": g,
29
- bg: r ? "var(--primary)" : "var(--bg, light-dark(#E4E4E4, #383838))",
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: v,
32
+ className: p,
33
33
  cursor: "pointer",
34
- h: t ? "28px" : "8px",
35
- justifyContent: r && "flex-end",
36
- onClick: () => !g && y(r),
37
- p: t && 1,
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: r ? "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))"
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: x,
49
+ style: g,
50
50
  styleVars: {
51
- primary: i == null ? void 0 : i.primary,
52
- bg: i == null ? void 0 : i.bg,
53
- primaryHoverBg: i == null ? void 0 : i.primaryHoverBg,
54
- hoverBg: i == null ? void 0 : i.hoverBg,
55
- disabledBg: i == null ? void 0 : i.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: t ? "50px" : "40px",
60
- children: /* @__PURE__ */ n(
61
- u,
59
+ w: e ? "50px" : "40px",
60
+ children: /* @__PURE__ */ i(
61
+ n,
62
62
  {
63
- _groupHover: !t && {
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: e == null ? void 0 : e.toggle,
71
- filter: !t && "drop-shadow(0px 0px 3px var(--switchShadow, rgba(0, 0, 0, 0.10)));",
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: p == null ? void 0 : p.toggle,
74
+ style: m?.toggle,
75
75
  styleVars: {
76
- primary: i == null ? void 0 : i.primary,
77
- primaryHoverBg: i == null ? void 0 : i.primaryHoverBg,
78
- switchShadow: i == null ? void 0 : i.switchShadow,
79
- switchHoverOutline: i == null ? void 0 : i.switchHoverOutline
76
+ primary: r?.primary,
77
+ primaryHoverBg: r?.primaryHoverBg,
78
+ switchShadow: r?.switchShadow,
79
+ switchHoverOutline: r?.switchHoverOutline
80
80
  },
81
- top: !t && "-6px",
82
- transform: r && "translateX(calc(100% + 2px))",
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__ */ n(l, { type: "hidden", value: String(r) })
88
+ /* @__PURE__ */ i(w, { type: "hidden", value: String(a) })
89
89
  ] });
90
90
  }
91
91
  export {
92
- E as Toggle
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.22",
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.19"
41
+ "@devup-ui/react": "1.0.20"
42
42
  },
43
43
  "devDependencies": {
44
- "@storybook/addon-docs": "^9.1.7",
45
- "@storybook/addon-onboarding": "^9.1.7",
46
- "@storybook/react-vite": "^9.1.7",
47
- "@types/react": "^19.1.13",
48
- "eslint-plugin-storybook": "^9.1.7",
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.7",
51
- "typescript": "^5.9.2",
52
- "vite": "^7.1.6",
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.41"
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.19"
60
+ "@devup-ui/react": "1.0.20"
61
61
  },
62
62
  "scripts": {
63
63
  "lint": "eslint",