@devup-ui/components 0.1.9 → 0.1.11
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,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),v=require("react"),c=require("@devup-ui/react"),A=require("clsx"),S=require("../../contexts/useSelect.cjs"),j=require("../Button/index.cjs"),w=require("./IconCheck.cjs");function O({type:n="default",children:u,defaultValue:f,value:s,onChange:d,defaultOpen:g,open:b,onOpenChange:o,colors:e,typography:p,options:a,...m}){const i=v.useRef(null),[h,l]=v.useState(g??!1),[x,k]=v.useState(f??(n==="checkbox"?[]:""));v.useEffect(()=>{const r=y=>{i.current&&i.current.contains(y.target)||l(!1)};return document.addEventListener("click",r),()=>document.removeEventListener("click",r)},[h,l]);const F=r=>{o==null||o(r),l(r)},E=r=>{if(d==null||d(r),n!=="default"){if(n==="radio"){k(r);return}Array.isArray(x)&&x.includes(r)?k(x.filter(y=>y!==r)):k([...x,r])}};return t.jsx(S.SelectContext.Provider,{value:{open:b??h,setOpen:F,value:s??x,setValue:E,type:n,ref:i},children:t.jsx(c.Box,{ref:i,display:"inline-block",h:"fit-content",selectors:{"&, & *":{boxSizing:"border-box"}},styleOrder:1,styleVars:{primary:e==null?void 0:e.primary,border:e==null?void 0:e.border,inputBackground:e==null?void 0:e.inputBackground,base10:e==null?void 0:e.base10,title:e==null?void 0:e.title,selectDisabled:e==null?void 0:e.selectDisabled,primaryBg:e==null?void 0:e.primaryBg,inputDisabledBackground:e==null?void 0:e.inputDisabledBackground,inputDisabledText:e==null?void 0:e.inputDisabledText},typography:p,...m,children:a?t.jsxs(t.Fragment,{children:[t.jsx(B,{children:u}),t.jsx(D,{children:a==null?void 0:a.map(r=>v.createElement(C,{...r,key:"option-"+r.value},r.label??r.value))})]}):u})})}function B({className:n,children:u,asChild:f,...s}){const{open:d,setOpen:g}=S.useSelect(),b=()=>{g(!d)};if(f){const o=v.Children.only(u),e=o.type;return t.jsx(e,{"aria-expanded":d,"aria-label":"Select toggle",onClick:b,...o.props})}return t.jsx(j.Button,{"aria-expanded":d,"aria-label":"Select toggle",className:A(c.css({borderRadius:"8px",styleOrder:2}),n),onClick:b,...s,children:u})}function D({children:n,showConfirmButton:u,confirmButtonText:f="완료",x:s=0,y:d=0,...g}){const{open:b,setOpen:o,type:e,ref:p}=S.useSelect();return b?t.jsxs(c.VStack,{ref:a=>{if(!p.current||!a)return;const m=p.current,i=()=>{const{width:h,height:l,x,y:k,top:F,left:E}=m.getBoundingClientRect(),r=a.offsetHeight+F+window.scrollY+l+d>document.documentElement.scrollHeight,y=a.offsetWidth+E+window.scrollX+h+s>document.documentElement.scrollWidth;r?a.style.bottom=`${window.innerHeight-k+10}px`:a.style.top=`${k+l+10+d}px`,y?a.style.left=`${x-a.offsetWidth+m.offsetWidth+s}px`:a.style.left=`${x+s}px`};return i(),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)}},"aria-label":"Select container",bg:"var(--inputBg, light-dark(#FFF,#2E2E2E))",border:"1px solid var(--border, light-dark(#E4E4E4,#434343))",borderRadius:"8px",bottom:"-4px",boxShadow:"0 2px 2px 0 var(--base10, light-dark(#0000001A,#FFFFFF1A))",boxSize:"fit-content",gap:"6px",minW:"232px",p:"10px",pos:"fixed",styleOrder:1,userSelect:"none",zIndex:1,...g,children:[n,u&&e==="checkbox"&&t.jsx(c.Flex,{justifyContent:"end",w:"100%",children:t.jsx(j.Button,{"aria-label":"Select confirm button",className:c.css({textAlign:"end",bg:"var(--primary, light-dark(#674DC7, #8163E1))",borderRadius:"8px",w:"fit-content",px:"30px",py:"10px",color:"#FFF",typography:"buttonS"}),onClick:()=>o(!1),variant:"primary",children:f})})]}):null}function C({disabled:n,onClick:u,children:f,value:s,showCheck:d=!0,...g}){const{setOpen:b,setValue:o,value:e,type:p}=S.useSelect(),a=()=>{p!=="checkbox"&&b(!1)},m=(l,x)=>{if(u){u(l,x);return}typeof l=="string"&&o(l),a()},i={default:!1,radio:e===s,checkbox:Array.isArray(e)&&s&&e.includes(s)}[p],h=!n&&!(p==="radio"&&i);return t.jsxs(c.Flex,{_hover:h&&{bg:"var(--primaryBg, light-dark(#F4F3FA, #F4F3FA0D))"},alignItems:"center",borderRadius:"6px",color:n?"var(--selectDisabled, light-dark(#C4C5D1, #45464D))":i?"var(--primary, light-dark(#674DC7, #8163E1)":"var(--title, light-dark(#1A1A1A,#FAFAFA))",cursor:h?"pointer":"default","data-value":s,fontWeight:i?"700":"400",gap:{checkbox:"10px",radio:"6px",default:"0"}[p],h:"40px",onClick:n?void 0:l=>m(s,l),px:"10px",styleOrder:1,transition:"background-color 0.1s ease-in-out",...g,children:[d&&{checkbox:t.jsx(c.Box,{bg:n?"var(--inputDisabledBackground, light-dark(#F0F0F3, #414244))":i?"var(--primary, light-dark(#674DC7, #8163E1)":"var(--border, light-dark(#E4E4E4, #434343))",borderRadius:"4px",boxSize:"18px",pos:"relative",transition:"background-color 0.1s ease-in-out",children:i&&t.jsx(w.IconCheck,{className:c.css({color:n?"var(--inputDisabledText, light-dark(#E5E5E5, #373737))":"#FFF",position:"absolute",top:"55%",left:"50%",transform:"translate(-50%, -50%)"})})}),radio:t.jsx(t.Fragment,{children:i&&t.jsx(c.Box,{borderRadius:"4px",boxSize:"18px",pos:"relative",transition:"background-color 0.1s ease-in-out",children:t.jsx(w.IconCheck,{className:c.css({position:"absolute",top:"55%",left:"50%",transform:"translate(-50%, -50%)",color:"inherit"})})})}),default:null}[p],f]})}function R({...n}){return t.jsx(c.Box,{bg:"var(--border, light-dark(#E4E4E4,#434343)",h:"1px",styleOrder:1,w:"100%",...n})}exports.Select=O;exports.SelectContainer=D;exports.SelectDivider=R;exports.SelectOption=C;exports.SelectTrigger=B;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Select/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,oBAAoB,EAAgB,MAAM,iBAAiB,CAAA;AAE9E,OAAO,EAEL,cAAc,EAOf,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAGlC,UAAU,WAAY,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnE,YAAY,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAA;IACtC,KAAK,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAA;IAC/B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,eAAe,CAAC,EAAE,MAAM,CAAA;QACxB,uBAAuB,CAAC,EAAE,MAAM,CAAA;QAChC,iBAAiB,CAAC,EAAE,MAAM,CAAA;QAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAA;IACD,UAAU,CAAC,EAAE,MAAM,oBAAoB,CAAA;I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,CAAC,EAC3B,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,KAAK,EACL,SAAgB,EAChB,GAAG,KAAK,EACT,EAAE,iBAAiB,2CAwHnB;AAED,wBAAgB,aAAa,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,2CAUhE"}
|
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as a, jsxs as
|
|
3
|
-
import { useRef as R, useState as
|
|
4
|
-
import { Box as
|
|
2
|
+
import { jsx as a, jsxs as w, 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 v, VStack as H, Flex as C, css as y } 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 O } from "../Button/index.js";
|
|
8
|
+
import { IconCheck as A } from "./IconCheck.js";
|
|
9
9
|
function J({
|
|
10
|
-
type:
|
|
11
|
-
children:
|
|
10
|
+
type: i = "default",
|
|
11
|
+
children: o,
|
|
12
12
|
defaultValue: b,
|
|
13
13
|
value: d,
|
|
14
|
-
onChange:
|
|
15
|
-
defaultOpen:
|
|
14
|
+
onChange: l,
|
|
15
|
+
defaultOpen: m,
|
|
16
16
|
open: f,
|
|
17
|
-
onOpenChange:
|
|
17
|
+
onOpenChange: c,
|
|
18
18
|
colors: e,
|
|
19
|
-
typography:
|
|
19
|
+
typography: u,
|
|
20
20
|
options: n,
|
|
21
|
-
...
|
|
21
|
+
...h
|
|
22
22
|
}) {
|
|
23
|
-
const
|
|
24
|
-
b ?? (
|
|
23
|
+
const r = R(null), [x, s] = D(m ?? !1), [p, g] = D(
|
|
24
|
+
b ?? (i === "checkbox" ? [] : "")
|
|
25
25
|
);
|
|
26
26
|
z(() => {
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const t = (k) => {
|
|
28
|
+
r.current && r.current.contains(k.target) || s(!1);
|
|
29
29
|
};
|
|
30
|
-
return document.addEventListener("click",
|
|
31
|
-
}, [
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
if (
|
|
36
|
-
if (
|
|
37
|
-
|
|
30
|
+
return document.addEventListener("click", t), () => document.removeEventListener("click", t);
|
|
31
|
+
}, [x, s]);
|
|
32
|
+
const F = (t) => {
|
|
33
|
+
c == null || c(t), s(t);
|
|
34
|
+
}, E = (t) => {
|
|
35
|
+
if (l == null || l(t), i !== "default") {
|
|
36
|
+
if (i === "radio") {
|
|
37
|
+
g(t);
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
Array.isArray(
|
|
40
|
+
Array.isArray(p) && p.includes(t) ? g(p.filter((k) => k !== t)) : g([...p, t]);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
return /* @__PURE__ */ a(
|
|
44
44
|
T.Provider,
|
|
45
45
|
{
|
|
46
46
|
value: {
|
|
47
|
-
open: f ??
|
|
48
|
-
setOpen:
|
|
49
|
-
value: d ??
|
|
50
|
-
setValue:
|
|
51
|
-
type:
|
|
52
|
-
ref:
|
|
47
|
+
open: f ?? x,
|
|
48
|
+
setOpen: F,
|
|
49
|
+
value: d ?? p,
|
|
50
|
+
setValue: E,
|
|
51
|
+
type: i,
|
|
52
|
+
ref: r
|
|
53
53
|
},
|
|
54
54
|
children: /* @__PURE__ */ a(
|
|
55
|
-
|
|
55
|
+
v,
|
|
56
56
|
{
|
|
57
|
-
ref:
|
|
57
|
+
ref: r,
|
|
58
58
|
display: "inline-block",
|
|
59
59
|
h: "fit-content",
|
|
60
60
|
selectors: {
|
|
@@ -74,80 +74,83 @@ function J({
|
|
|
74
74
|
inputDisabledBackground: e == null ? void 0 : e.inputDisabledBackground,
|
|
75
75
|
inputDisabledText: e == null ? void 0 : e.inputDisabledText
|
|
76
76
|
},
|
|
77
|
-
typography:
|
|
78
|
-
...
|
|
79
|
-
children: n ? /* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */ a($, { children:
|
|
81
|
-
/* @__PURE__ */ a(j, { children: n == null ? void 0 : n.map((
|
|
82
|
-
] }) :
|
|
77
|
+
typography: u,
|
|
78
|
+
...h,
|
|
79
|
+
children: n ? /* @__PURE__ */ w(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
|
|
83
83
|
}
|
|
84
84
|
)
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
87
|
}
|
|
88
88
|
function $({
|
|
89
|
-
className:
|
|
90
|
-
children:
|
|
89
|
+
className: i,
|
|
90
|
+
children: o,
|
|
91
91
|
asChild: b,
|
|
92
92
|
...d
|
|
93
93
|
}) {
|
|
94
|
-
const { open:
|
|
95
|
-
|
|
94
|
+
const { open: l, setOpen: m } = S(), f = () => {
|
|
95
|
+
m(!l);
|
|
96
96
|
};
|
|
97
97
|
if (b) {
|
|
98
|
-
const
|
|
98
|
+
const c = W.only(o), e = c.type;
|
|
99
99
|
return /* @__PURE__ */ a(
|
|
100
100
|
e,
|
|
101
101
|
{
|
|
102
|
-
"aria-expanded":
|
|
102
|
+
"aria-expanded": l,
|
|
103
103
|
"aria-label": "Select toggle",
|
|
104
104
|
onClick: f,
|
|
105
|
-
...
|
|
105
|
+
...c.props
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
108
|
}
|
|
109
109
|
return /* @__PURE__ */ a(
|
|
110
|
-
|
|
110
|
+
O,
|
|
111
111
|
{
|
|
112
|
-
"aria-expanded":
|
|
112
|
+
"aria-expanded": l,
|
|
113
113
|
"aria-label": "Select toggle",
|
|
114
114
|
className: N(
|
|
115
|
-
|
|
115
|
+
y({
|
|
116
116
|
borderRadius: "8px",
|
|
117
117
|
styleOrder: 2
|
|
118
118
|
}),
|
|
119
|
-
|
|
119
|
+
i
|
|
120
120
|
),
|
|
121
121
|
onClick: f,
|
|
122
122
|
...d,
|
|
123
|
-
children:
|
|
123
|
+
children: o
|
|
124
124
|
}
|
|
125
125
|
);
|
|
126
126
|
}
|
|
127
127
|
function j({
|
|
128
|
-
children:
|
|
129
|
-
showConfirmButton:
|
|
128
|
+
children: i,
|
|
129
|
+
showConfirmButton: o,
|
|
130
130
|
confirmButtonText: b = "완료",
|
|
131
131
|
x: d = 0,
|
|
132
|
-
y:
|
|
133
|
-
...
|
|
132
|
+
y: l = 0,
|
|
133
|
+
...m
|
|
134
134
|
}) {
|
|
135
|
-
const { open: f, setOpen:
|
|
136
|
-
return f ? /* @__PURE__ */
|
|
135
|
+
const { open: f, setOpen: c, type: e, ref: u } = S();
|
|
136
|
+
return f ? /* @__PURE__ */ w(
|
|
137
137
|
H,
|
|
138
138
|
{
|
|
139
139
|
ref: (n) => {
|
|
140
|
-
if (!
|
|
141
|
-
const
|
|
140
|
+
if (!u.current || !n) return;
|
|
141
|
+
const h = u.current, r = () => {
|
|
142
142
|
const {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
143
|
+
width: x,
|
|
144
|
+
height: s,
|
|
145
|
+
x: p,
|
|
146
|
+
y: g,
|
|
147
|
+
top: F,
|
|
148
|
+
left: E
|
|
149
|
+
} = h.getBoundingClientRect(), t = n.offsetHeight + F + window.scrollY + s + l > document.documentElement.scrollHeight, k = n.offsetWidth + E + window.scrollX + x + d > document.documentElement.scrollWidth;
|
|
150
|
+
t ? n.style.bottom = `${window.innerHeight - g + 10}px` : n.style.top = `${g + s + 10 + l}px`, k ? n.style.left = `${p - n.offsetWidth + h.offsetWidth + d}px` : n.style.left = `${p + d}px`;
|
|
148
151
|
};
|
|
149
|
-
return
|
|
150
|
-
window.removeEventListener("scroll",
|
|
152
|
+
return r(), window.addEventListener("scroll", r, !0), window.addEventListener("resize", r), () => {
|
|
153
|
+
window.removeEventListener("scroll", r, !0), window.removeEventListener("resize", r);
|
|
151
154
|
};
|
|
152
155
|
},
|
|
153
156
|
"aria-label": "Select container",
|
|
@@ -164,14 +167,14 @@ function j({
|
|
|
164
167
|
styleOrder: 1,
|
|
165
168
|
userSelect: "none",
|
|
166
169
|
zIndex: 1,
|
|
167
|
-
...
|
|
170
|
+
...m,
|
|
168
171
|
children: [
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
+
i,
|
|
173
|
+
o && e === "checkbox" && /* @__PURE__ */ a(C, { justifyContent: "end", w: "100%", children: /* @__PURE__ */ a(
|
|
174
|
+
O,
|
|
172
175
|
{
|
|
173
176
|
"aria-label": "Select confirm button",
|
|
174
|
-
className:
|
|
177
|
+
className: y({
|
|
175
178
|
textAlign: "end",
|
|
176
179
|
bg: "var(--primary, light-dark(#674DC7, #8163E1))",
|
|
177
180
|
borderRadius: "8px",
|
|
@@ -181,7 +184,7 @@ function j({
|
|
|
181
184
|
color: "#FFF",
|
|
182
185
|
typography: "buttonS"
|
|
183
186
|
}),
|
|
184
|
-
onClick: () =>
|
|
187
|
+
onClick: () => c(!1),
|
|
185
188
|
variant: "primary",
|
|
186
189
|
children: b
|
|
187
190
|
}
|
|
@@ -191,64 +194,64 @@ function j({
|
|
|
191
194
|
) : null;
|
|
192
195
|
}
|
|
193
196
|
function I({
|
|
194
|
-
disabled:
|
|
195
|
-
onClick:
|
|
197
|
+
disabled: i,
|
|
198
|
+
onClick: o,
|
|
196
199
|
children: b,
|
|
197
200
|
value: d,
|
|
198
|
-
showCheck:
|
|
199
|
-
...
|
|
201
|
+
showCheck: l = !0,
|
|
202
|
+
...m
|
|
200
203
|
}) {
|
|
201
|
-
const { setOpen: f, setValue:
|
|
202
|
-
|
|
203
|
-
},
|
|
204
|
-
if (
|
|
205
|
-
|
|
204
|
+
const { setOpen: f, setValue: c, value: e, type: u } = S(), n = () => {
|
|
205
|
+
u !== "checkbox" && f(!1);
|
|
206
|
+
}, h = (s, p) => {
|
|
207
|
+
if (o) {
|
|
208
|
+
o(s, p);
|
|
206
209
|
return;
|
|
207
210
|
}
|
|
208
|
-
typeof
|
|
209
|
-
},
|
|
211
|
+
typeof s == "string" && c(s), n();
|
|
212
|
+
}, r = {
|
|
210
213
|
default: !1,
|
|
211
214
|
radio: e === d,
|
|
212
215
|
checkbox: Array.isArray(e) && d && e.includes(d)
|
|
213
|
-
}[
|
|
214
|
-
return /* @__PURE__ */
|
|
215
|
-
|
|
216
|
+
}[u], x = !i && !(u === "radio" && r);
|
|
217
|
+
return /* @__PURE__ */ w(
|
|
218
|
+
C,
|
|
216
219
|
{
|
|
217
|
-
_hover:
|
|
220
|
+
_hover: x && {
|
|
218
221
|
bg: "var(--primaryBg, light-dark(#F4F3FA, #F4F3FA0D))"
|
|
219
222
|
},
|
|
220
223
|
alignItems: "center",
|
|
221
224
|
borderRadius: "6px",
|
|
222
|
-
color:
|
|
223
|
-
cursor:
|
|
225
|
+
color: i ? "var(--selectDisabled, light-dark(#C4C5D1, #45464D))" : r ? "var(--primary, light-dark(#674DC7, #8163E1)" : "var(--title, light-dark(#1A1A1A,#FAFAFA))",
|
|
226
|
+
cursor: x ? "pointer" : "default",
|
|
224
227
|
"data-value": d,
|
|
225
|
-
fontWeight:
|
|
228
|
+
fontWeight: r ? "700" : "400",
|
|
226
229
|
gap: {
|
|
227
230
|
checkbox: "10px",
|
|
228
231
|
radio: "6px",
|
|
229
232
|
default: "0"
|
|
230
|
-
}[
|
|
233
|
+
}[u],
|
|
231
234
|
h: "40px",
|
|
232
|
-
onClick:
|
|
235
|
+
onClick: i ? void 0 : (s) => h(d, s),
|
|
233
236
|
px: "10px",
|
|
234
237
|
styleOrder: 1,
|
|
235
238
|
transition: "background-color 0.1s ease-in-out",
|
|
236
|
-
...
|
|
239
|
+
...m,
|
|
237
240
|
children: [
|
|
238
|
-
|
|
241
|
+
l && {
|
|
239
242
|
checkbox: /* @__PURE__ */ a(
|
|
240
|
-
|
|
243
|
+
v,
|
|
241
244
|
{
|
|
242
|
-
bg:
|
|
245
|
+
bg: i ? "var(--inputDisabledBackground, light-dark(#F0F0F3, #414244))" : r ? "var(--primary, light-dark(#674DC7, #8163E1)" : "var(--border, light-dark(#E4E4E4, #434343))",
|
|
243
246
|
borderRadius: "4px",
|
|
244
247
|
boxSize: "18px",
|
|
245
248
|
pos: "relative",
|
|
246
249
|
transition: "background-color 0.1s ease-in-out",
|
|
247
|
-
children:
|
|
248
|
-
|
|
250
|
+
children: r && /* @__PURE__ */ a(
|
|
251
|
+
A,
|
|
249
252
|
{
|
|
250
|
-
className:
|
|
251
|
-
color:
|
|
253
|
+
className: y({
|
|
254
|
+
color: i ? "var(--inputDisabledText, light-dark(#E5E5E5, #373737))" : "#FFF",
|
|
252
255
|
position: "absolute",
|
|
253
256
|
top: "55%",
|
|
254
257
|
left: "50%",
|
|
@@ -258,17 +261,17 @@ function I({
|
|
|
258
261
|
)
|
|
259
262
|
}
|
|
260
263
|
),
|
|
261
|
-
radio: /* @__PURE__ */ a(
|
|
262
|
-
|
|
264
|
+
radio: /* @__PURE__ */ a(B, { children: r && /* @__PURE__ */ a(
|
|
265
|
+
v,
|
|
263
266
|
{
|
|
264
267
|
borderRadius: "4px",
|
|
265
268
|
boxSize: "18px",
|
|
266
269
|
pos: "relative",
|
|
267
270
|
transition: "background-color 0.1s ease-in-out",
|
|
268
271
|
children: /* @__PURE__ */ a(
|
|
269
|
-
|
|
272
|
+
A,
|
|
270
273
|
{
|
|
271
|
-
className:
|
|
274
|
+
className: y({
|
|
272
275
|
position: "absolute",
|
|
273
276
|
top: "55%",
|
|
274
277
|
left: "50%",
|
|
@@ -280,21 +283,21 @@ function I({
|
|
|
280
283
|
}
|
|
281
284
|
) }),
|
|
282
285
|
default: null
|
|
283
|
-
}[
|
|
286
|
+
}[u],
|
|
284
287
|
b
|
|
285
288
|
]
|
|
286
289
|
}
|
|
287
290
|
);
|
|
288
291
|
}
|
|
289
|
-
function K({ ...
|
|
292
|
+
function K({ ...i }) {
|
|
290
293
|
return /* @__PURE__ */ a(
|
|
291
|
-
|
|
294
|
+
v,
|
|
292
295
|
{
|
|
293
296
|
bg: "var(--border, light-dark(#E4E4E4,#434343)",
|
|
294
297
|
h: "1px",
|
|
295
298
|
styleOrder: 1,
|
|
296
299
|
w: "100%",
|
|
297
|
-
...
|
|
300
|
+
...i
|
|
298
301
|
}
|
|
299
302
|
);
|
|
300
303
|
}
|
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.11",
|
|
20
20
|
"type": "module",
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"access": "public"
|
|
@@ -38,7 +38,7 @@
|
|
|
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.16"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@storybook/addon-docs": "^9.1.2",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"csstype": "*",
|
|
59
59
|
"react": "*",
|
|
60
|
-
"@devup-ui/react": "1.0.
|
|
60
|
+
"@devup-ui/react": "1.0.16"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"lint": "eslint",
|