boottent-design 0.1.80 → 0.1.81
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 +0 -48
- package/dist/UrlFormField-DhBCWqhC.js +428 -0
- package/dist/UrlFormField-VFsBGIO2.cjs +1 -0
- package/dist/boottent-design.ads.cjs.js +1 -0
- package/dist/boottent-design.ads.es.js +10 -0
- package/dist/boottent-design.feature.cjs.js +1 -1
- package/dist/boottent-design.feature.es.js +10 -1
- package/dist/boottent-design.layout.cjs.js +1 -1
- package/dist/boottent-design.layout.es.js +3 -3
- package/dist/boottent-design.provider.cjs.js +1 -1
- package/dist/boottent-design.provider.es.js +25 -23
- package/dist/boottent-design.ui.cjs.js +1 -1
- package/dist/boottent-design.ui.es.js +228 -648
- package/dist/boottent-design.utils.cjs.js +1 -1
- package/dist/boottent-design.utils.es.js +7 -6
- package/dist/{index-Bf4XH3AK.cjs → index-B21JbtdU.cjs} +1 -1
- package/dist/{index-BIxKM0nQ.cjs → index-BYinJUBt.cjs} +1 -1
- package/dist/{index-WGpe0bEl.js → index-CQACG110.js} +116 -104
- package/dist/index-D57xhjM5.cjs +1 -0
- package/dist/index-fh7-GXvn.js +3199 -0
- package/dist/{index-7TdmKUbH.js → index-goQ6Sq3Z.js} +1 -1
- package/dist/portal-container-BIKqJnsO.js +56 -0
- package/dist/portal-container-BwvvRejy.cjs +1 -0
- package/dist/toggleButtonGroup-primitive-B5twgprT.cjs +52 -0
- package/dist/toggleButtonGroup-primitive-Bnq26qSE.js +6598 -0
- package/dist/types/ads.d.ts +577 -0
- package/dist/types/feature.d.ts +94 -0
- package/dist/types/ui.d.ts +9 -55
- package/dist/types/utils.d.ts +2 -0
- package/package.json +1 -1
- package/dist/toggleButtonGroup-primitive-CibJg54C.cjs +0 -52
- package/dist/toggleButtonGroup-primitive-ZAStZ2ee.js +0 -9820
package/README.md
CHANGED
|
@@ -15,7 +15,6 @@ React, Vite, TypeScript, TailwindCSS, Radix-UI를 사용해 만든 부트텐트
|
|
|
15
15
|
- [예제 3: 드롭다운](#예제-3-드롭다운)
|
|
16
16
|
- [예제 4: 토글 버튼 그룹](#예제-4-토글-버튼-그룹)
|
|
17
17
|
- [예제 5: 툴팁](#예제-5-툴팁)
|
|
18
|
-
- [컴포넌트 목록](#컴포넌트-목록)
|
|
19
18
|
- [제작 및 배포](#제작-및-배포)
|
|
20
19
|
|
|
21
20
|
## 소개
|
|
@@ -587,53 +586,6 @@ export const TooltipExamples = () => {
|
|
|
587
586
|
};
|
|
588
587
|
```
|
|
589
588
|
|
|
590
|
-
## 컴포넌트 목록
|
|
591
|
-
|
|
592
|
-
boottent-design 라이브러리는 다음과 같은 주요 컴포넌트를 제공합니다:
|
|
593
|
-
|
|
594
|
-
### UI 컴포넌트
|
|
595
|
-
|
|
596
|
-
• Accordion
|
|
597
|
-
• Button
|
|
598
|
-
• Input
|
|
599
|
-
• Icon
|
|
600
|
-
• Symbols
|
|
601
|
-
• Dropdown
|
|
602
|
-
• ToggleButtonGroup
|
|
603
|
-
• Tooltip
|
|
604
|
-
• Modal
|
|
605
|
-
• Alert
|
|
606
|
-
• Dialog
|
|
607
|
-
• Toast
|
|
608
|
-
• Dropdown
|
|
609
|
-
• Skeleton
|
|
610
|
-
• Image
|
|
611
|
-
• CalloutBox
|
|
612
|
-
• Tag
|
|
613
|
-
|
|
614
|
-
### 레이아웃 컴포넌트
|
|
615
|
-
|
|
616
|
-
• FlexBox
|
|
617
|
-
• GridBox
|
|
618
|
-
• Box
|
|
619
|
-
• AspectRatio
|
|
620
|
-
|
|
621
|
-
### 유틸리티
|
|
622
|
-
|
|
623
|
-
• cn (클래스 네임 병합 함수)
|
|
624
|
-
|
|
625
|
-
### 테마 및 색상
|
|
626
|
-
|
|
627
|
-
• colors (색상 팔레트)
|
|
628
|
-
|
|
629
|
-
### hooks
|
|
630
|
-
|
|
631
|
-
• usePortal (alert, modal, toast, dialog 등을 포함하는 포털을 생성)
|
|
632
|
-
|
|
633
|
-
### provider
|
|
634
|
-
|
|
635
|
-
• PortalProvider (포털 렌더링을 위한 프로바이더)
|
|
636
|
-
|
|
637
589
|
## 제작 및 배포
|
|
638
590
|
|
|
639
591
|
- 김동성 (Boottent Frontend-Developer)
|
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
import { jsx as e, jsxs as v, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import { u as V, F as S, a as k, c as I, d as y, C as G, L as z, e as R, B as D, T as K, f as P, R as T, g as $, h as A, i as M, I as W, j, k as _, l as q } from "./index-fh7-GXvn.js";
|
|
3
|
+
import { c as L } from "./index-CQACG110.js";
|
|
4
|
+
import { useState as H } from "react";
|
|
5
|
+
const Y = ({
|
|
6
|
+
name: l,
|
|
7
|
+
control: d,
|
|
8
|
+
heading: s,
|
|
9
|
+
label: n,
|
|
10
|
+
description: o,
|
|
11
|
+
required: x = !1,
|
|
12
|
+
text: m,
|
|
13
|
+
type: g,
|
|
14
|
+
errorMsg: F = !1,
|
|
15
|
+
onChange: h,
|
|
16
|
+
rules: w
|
|
17
|
+
}) => {
|
|
18
|
+
const {
|
|
19
|
+
field: i,
|
|
20
|
+
fieldState: { error: t }
|
|
21
|
+
} = V({
|
|
22
|
+
name: l,
|
|
23
|
+
control: d,
|
|
24
|
+
rules: w
|
|
25
|
+
}), u = n || s || o;
|
|
26
|
+
return /* @__PURE__ */ e(
|
|
27
|
+
S,
|
|
28
|
+
{
|
|
29
|
+
control: d,
|
|
30
|
+
name: l,
|
|
31
|
+
render: () => /* @__PURE__ */ v(k, { children: [
|
|
32
|
+
u && /* @__PURE__ */ e(I, { required: x, heading: s, label: n, description: o }),
|
|
33
|
+
/* @__PURE__ */ e(y, { children: /* @__PURE__ */ v("div", { className: "flex flex-row items-center gap-2", children: [
|
|
34
|
+
/* @__PURE__ */ e(
|
|
35
|
+
G,
|
|
36
|
+
{
|
|
37
|
+
...i,
|
|
38
|
+
id: l,
|
|
39
|
+
checked: g === "boolean" ? i.value : i.value === m,
|
|
40
|
+
onCheckedChange: (p) => {
|
|
41
|
+
i.onChange(g === "boolean" ? p : p ? m : ""), h && h();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
/* @__PURE__ */ e(z, { className: "cursor-pointer", htmlFor: l, children: m })
|
|
46
|
+
] }) }),
|
|
47
|
+
F && /* @__PURE__ */ e(R, { children: t == null ? void 0 : t.message })
|
|
48
|
+
] })
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}, Z = ({
|
|
52
|
+
name: l,
|
|
53
|
+
control: d,
|
|
54
|
+
heading: s,
|
|
55
|
+
label: n,
|
|
56
|
+
description: o,
|
|
57
|
+
options: x,
|
|
58
|
+
required: m = !1,
|
|
59
|
+
additional: g,
|
|
60
|
+
type: F = "checkbox",
|
|
61
|
+
onChange: h,
|
|
62
|
+
rules: w
|
|
63
|
+
}) => {
|
|
64
|
+
const {
|
|
65
|
+
field: i,
|
|
66
|
+
fieldState: { error: t }
|
|
67
|
+
} = V({
|
|
68
|
+
name: l,
|
|
69
|
+
control: d,
|
|
70
|
+
rules: w
|
|
71
|
+
}), u = (a, C) => {
|
|
72
|
+
var f;
|
|
73
|
+
i.onChange(C ? [...i.value || [], a] : (f = i.value) == null ? void 0 : f.filter((N) => N !== a)), h == null || h();
|
|
74
|
+
}, p = () => x.map((a) => {
|
|
75
|
+
var C;
|
|
76
|
+
return /* @__PURE__ */ v(k, { className: "flex flex-row items-center", children: [
|
|
77
|
+
/* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
|
|
78
|
+
G,
|
|
79
|
+
{
|
|
80
|
+
id: a.value + l,
|
|
81
|
+
checked: (C = i.value) == null ? void 0 : C.includes(a.value),
|
|
82
|
+
onCheckedChange: (f) => u(a.value, f)
|
|
83
|
+
}
|
|
84
|
+
) }),
|
|
85
|
+
/* @__PURE__ */ e(z, { htmlFor: a.value + l, className: "cursor-pointer", children: a.text })
|
|
86
|
+
] }, a.value);
|
|
87
|
+
}), r = () => x.map(({ value: a, text: C }) => {
|
|
88
|
+
var N;
|
|
89
|
+
const f = (N = i.value) == null ? void 0 : N.includes(a);
|
|
90
|
+
return /* @__PURE__ */ e(k, { className: "flex flex-row items-start gap-2", children: /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
|
|
91
|
+
D,
|
|
92
|
+
{
|
|
93
|
+
shape: "rounded",
|
|
94
|
+
size: "xs",
|
|
95
|
+
theme: f ? "primary" : "secondary",
|
|
96
|
+
variant: f ? "solid" : "outline",
|
|
97
|
+
onClick: (c) => {
|
|
98
|
+
c.preventDefault(), u(a, !f);
|
|
99
|
+
},
|
|
100
|
+
children: C
|
|
101
|
+
}
|
|
102
|
+
) }) }, a);
|
|
103
|
+
});
|
|
104
|
+
return /* @__PURE__ */ e(
|
|
105
|
+
S,
|
|
106
|
+
{
|
|
107
|
+
control: d,
|
|
108
|
+
name: l,
|
|
109
|
+
render: () => /* @__PURE__ */ v(k, { children: [
|
|
110
|
+
(n || s || o) && /* @__PURE__ */ e(I, { required: m, heading: s, label: n, description: o }),
|
|
111
|
+
/* @__PURE__ */ e(y, { children: F === "checkbox" ? /* @__PURE__ */ e("div", { className: "space-y-4", children: p() }) : /* @__PURE__ */ e("ul", { className: "flex w-full flex-wrap gap-2 text-regular14", children: r() }) }),
|
|
112
|
+
g,
|
|
113
|
+
/* @__PURE__ */ e(R, { children: t == null ? void 0 : t.message })
|
|
114
|
+
] })
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}, ee = ({
|
|
118
|
+
name: l,
|
|
119
|
+
control: d,
|
|
120
|
+
label: s,
|
|
121
|
+
description: n,
|
|
122
|
+
required: o = !1,
|
|
123
|
+
children: x,
|
|
124
|
+
className: m,
|
|
125
|
+
errorMsg: g = !0
|
|
126
|
+
}) => /* @__PURE__ */ e(
|
|
127
|
+
S,
|
|
128
|
+
{
|
|
129
|
+
control: d,
|
|
130
|
+
name: l,
|
|
131
|
+
render: () => /* @__PURE__ */ v(k, { children: [
|
|
132
|
+
s && /* @__PURE__ */ v(I, { required: o, children: [
|
|
133
|
+
/* @__PURE__ */ e(K, { children: s }),
|
|
134
|
+
n && /* @__PURE__ */ e(P, { children: n })
|
|
135
|
+
] }),
|
|
136
|
+
/* @__PURE__ */ e(y, { children: /* @__PURE__ */ e("div", { className: m, children: x }) }),
|
|
137
|
+
g && /* @__PURE__ */ e(R, {})
|
|
138
|
+
] })
|
|
139
|
+
}
|
|
140
|
+
), le = ({
|
|
141
|
+
name: l,
|
|
142
|
+
control: d,
|
|
143
|
+
heading: s,
|
|
144
|
+
label: n,
|
|
145
|
+
description: o,
|
|
146
|
+
options: x,
|
|
147
|
+
required: m = !1,
|
|
148
|
+
className: g,
|
|
149
|
+
additional: F,
|
|
150
|
+
direction: h = "vertical",
|
|
151
|
+
onChange: w,
|
|
152
|
+
rules: i
|
|
153
|
+
}) => {
|
|
154
|
+
const {
|
|
155
|
+
field: t,
|
|
156
|
+
fieldState: { error: u }
|
|
157
|
+
} = V({
|
|
158
|
+
name: l,
|
|
159
|
+
control: d,
|
|
160
|
+
rules: i
|
|
161
|
+
}), p = n || s || o;
|
|
162
|
+
return /* @__PURE__ */ e(
|
|
163
|
+
S,
|
|
164
|
+
{
|
|
165
|
+
control: d,
|
|
166
|
+
name: l,
|
|
167
|
+
render: () => /* @__PURE__ */ v(k, { className: "relative", children: [
|
|
168
|
+
p && /* @__PURE__ */ e(I, { required: m, heading: s, label: n, description: o }),
|
|
169
|
+
/* @__PURE__ */ e(y, { children: /* @__PURE__ */ v("div", { className: L("flex max-w-screen-sm items-center gap-2", g), children: [
|
|
170
|
+
/* @__PURE__ */ e(
|
|
171
|
+
T,
|
|
172
|
+
{
|
|
173
|
+
onValueChange: (r) => {
|
|
174
|
+
t.onChange(r), w && w();
|
|
175
|
+
},
|
|
176
|
+
value: t.value,
|
|
177
|
+
className: L(
|
|
178
|
+
h === "vertical" && "flex flex-col gap-4",
|
|
179
|
+
h === "horizontal" && "flex flex-wrap gap-8",
|
|
180
|
+
h === "grid" && "grid w-full grid-cols-2 gap-x-8 gap-y-4"
|
|
181
|
+
),
|
|
182
|
+
children: x.map((r) => /* @__PURE__ */ v(k, { className: "flex flex-row items-center", children: [
|
|
183
|
+
/* @__PURE__ */ e(y, { children: /* @__PURE__ */ e($, { value: r.value, id: r.text, checked: r.value === t.value }) }),
|
|
184
|
+
/* @__PURE__ */ e(z, { className: "cursor-pointer font-normal", htmlFor: r.text, children: r.text })
|
|
185
|
+
] }, r.key))
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
F && /* @__PURE__ */ e(E, { children: F })
|
|
189
|
+
] }) }),
|
|
190
|
+
/* @__PURE__ */ e(R, { children: u == null ? void 0 : u.message })
|
|
191
|
+
] })
|
|
192
|
+
}
|
|
193
|
+
);
|
|
194
|
+
}, ae = ({
|
|
195
|
+
required: l,
|
|
196
|
+
heading: d,
|
|
197
|
+
name: s,
|
|
198
|
+
label: n,
|
|
199
|
+
description: o,
|
|
200
|
+
placeholder: x,
|
|
201
|
+
control: m,
|
|
202
|
+
tagDirection: g = "flex-col",
|
|
203
|
+
tagSize: F = "md",
|
|
204
|
+
rules: h
|
|
205
|
+
}) => {
|
|
206
|
+
const { setValue: w, getValues: i } = A(), {
|
|
207
|
+
field: t,
|
|
208
|
+
fieldState: { error: u }
|
|
209
|
+
} = V({
|
|
210
|
+
name: s,
|
|
211
|
+
control: m,
|
|
212
|
+
defaultValue: [],
|
|
213
|
+
rules: h
|
|
214
|
+
}), [p, r] = H(""), a = () => {
|
|
215
|
+
if (p.trim() !== "") {
|
|
216
|
+
const c = i(s) || [];
|
|
217
|
+
w(s, [...c, p.trim()]), r("");
|
|
218
|
+
}
|
|
219
|
+
}, C = (c) => {
|
|
220
|
+
c.key === "Enter" && !c.nativeEvent.isComposing && (c.preventDefault(), a());
|
|
221
|
+
}, f = (c) => {
|
|
222
|
+
const b = i(s) || [];
|
|
223
|
+
b.splice(c, 1), w(s, b);
|
|
224
|
+
}, N = n || d || o;
|
|
225
|
+
return /* @__PURE__ */ e(
|
|
226
|
+
S,
|
|
227
|
+
{
|
|
228
|
+
control: m,
|
|
229
|
+
name: s,
|
|
230
|
+
render: () => /* @__PURE__ */ v(k, { children: [
|
|
231
|
+
N && /* @__PURE__ */ e(I, { required: l, heading: d, label: n, description: o }),
|
|
232
|
+
/* @__PURE__ */ e(y, { children: /* @__PURE__ */ v("div", { className: "flex flex-col gap-2", children: [
|
|
233
|
+
t.value && t.value.length > 0 && /* @__PURE__ */ e("ul", { className: L("flex flex-col flex-wrap gap-1", g), children: t.value.map((c, b) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
234
|
+
M,
|
|
235
|
+
{
|
|
236
|
+
size: F,
|
|
237
|
+
variant: "solid-secondary-100",
|
|
238
|
+
onClick: () => f(b),
|
|
239
|
+
icRight: /* @__PURE__ */ e(W.Cancel, { size: "10", className: "text-grey-600" }),
|
|
240
|
+
children: /* @__PURE__ */ e("span", { children: c })
|
|
241
|
+
}
|
|
242
|
+
) }, b)) }),
|
|
243
|
+
/* @__PURE__ */ v("div", { className: "flex items-center gap-2", children: [
|
|
244
|
+
/* @__PURE__ */ e(
|
|
245
|
+
j,
|
|
246
|
+
{
|
|
247
|
+
value: p,
|
|
248
|
+
onChange: (c) => r(c.target.value),
|
|
249
|
+
onKeyDown: C,
|
|
250
|
+
className: "max-w-screen-sm",
|
|
251
|
+
placeholder: x,
|
|
252
|
+
error: !!u
|
|
253
|
+
}
|
|
254
|
+
),
|
|
255
|
+
/* @__PURE__ */ e(
|
|
256
|
+
D,
|
|
257
|
+
{
|
|
258
|
+
size: "md",
|
|
259
|
+
variant: "outline",
|
|
260
|
+
disabled: !p.trim(),
|
|
261
|
+
theme: "secondary",
|
|
262
|
+
onClick: a,
|
|
263
|
+
className: "whitespace-nowrap",
|
|
264
|
+
children: "추가"
|
|
265
|
+
}
|
|
266
|
+
)
|
|
267
|
+
] })
|
|
268
|
+
] }) }),
|
|
269
|
+
/* @__PURE__ */ e(R, { children: u == null ? void 0 : u.message })
|
|
270
|
+
] })
|
|
271
|
+
}
|
|
272
|
+
);
|
|
273
|
+
}, se = ({
|
|
274
|
+
name: l,
|
|
275
|
+
control: d,
|
|
276
|
+
heading: s,
|
|
277
|
+
label: n,
|
|
278
|
+
description: o,
|
|
279
|
+
placeholder: x,
|
|
280
|
+
required: m = !1,
|
|
281
|
+
isTextArea: g = !1,
|
|
282
|
+
unitLabel: F,
|
|
283
|
+
unitLabelBefore: h,
|
|
284
|
+
inputType: w = "text",
|
|
285
|
+
className: i,
|
|
286
|
+
onChange: t,
|
|
287
|
+
onBlur: u,
|
|
288
|
+
icon: p,
|
|
289
|
+
disabled: r,
|
|
290
|
+
errorMsg: a = !0,
|
|
291
|
+
rules: C
|
|
292
|
+
}) => {
|
|
293
|
+
const {
|
|
294
|
+
field: f,
|
|
295
|
+
formState: { errors: N }
|
|
296
|
+
} = V({
|
|
297
|
+
name: l,
|
|
298
|
+
control: d,
|
|
299
|
+
rules: C
|
|
300
|
+
}), c = (U) => {
|
|
301
|
+
const B = w === "number" ? Number(U.target.value) : U.target.value;
|
|
302
|
+
f.onChange(B), t == null || t(B);
|
|
303
|
+
}, b = n || s || o;
|
|
304
|
+
return /* @__PURE__ */ e(
|
|
305
|
+
S,
|
|
306
|
+
{
|
|
307
|
+
control: d,
|
|
308
|
+
name: l,
|
|
309
|
+
render: () => /* @__PURE__ */ v(k, { children: [
|
|
310
|
+
b && /* @__PURE__ */ e(I, { required: m, heading: s, label: n, description: o }),
|
|
311
|
+
/* @__PURE__ */ e(y, { children: /* @__PURE__ */ v("div", { className: L("flex w-full max-w-screen-sm items-center gap-2", i), children: [
|
|
312
|
+
h && /* @__PURE__ */ e("div", { className: "whitespace-nowrap", children: h }),
|
|
313
|
+
g ? /* @__PURE__ */ e(
|
|
314
|
+
_,
|
|
315
|
+
{
|
|
316
|
+
...f,
|
|
317
|
+
placeholder: x,
|
|
318
|
+
className: "h-32",
|
|
319
|
+
disabled: r,
|
|
320
|
+
error: !!N[l],
|
|
321
|
+
onChange: c
|
|
322
|
+
}
|
|
323
|
+
) : /* @__PURE__ */ e(
|
|
324
|
+
j,
|
|
325
|
+
{
|
|
326
|
+
...f,
|
|
327
|
+
type: w,
|
|
328
|
+
placeholder: x,
|
|
329
|
+
disabled: r,
|
|
330
|
+
error: !!N[l],
|
|
331
|
+
onChange: c,
|
|
332
|
+
onBlur: u,
|
|
333
|
+
icon: p,
|
|
334
|
+
iconPosition: "right"
|
|
335
|
+
}
|
|
336
|
+
),
|
|
337
|
+
F && /* @__PURE__ */ e("div", { className: "whitespace-nowrap", children: F })
|
|
338
|
+
] }) }),
|
|
339
|
+
a && /* @__PURE__ */ e(R, {})
|
|
340
|
+
] })
|
|
341
|
+
}
|
|
342
|
+
);
|
|
343
|
+
}, re = ({
|
|
344
|
+
name: l,
|
|
345
|
+
control: d,
|
|
346
|
+
heading: s,
|
|
347
|
+
label: n,
|
|
348
|
+
description: o,
|
|
349
|
+
placeholder: x = "",
|
|
350
|
+
buttonLabel: m = "보기",
|
|
351
|
+
required: g,
|
|
352
|
+
onClick: F,
|
|
353
|
+
disabled: h = !1,
|
|
354
|
+
children: w,
|
|
355
|
+
urlTitle: i,
|
|
356
|
+
rules: t
|
|
357
|
+
}) => {
|
|
358
|
+
const { trigger: u, setValue: p } = A(), {
|
|
359
|
+
field: r,
|
|
360
|
+
fieldState: { error: a }
|
|
361
|
+
} = V({
|
|
362
|
+
name: l,
|
|
363
|
+
control: d,
|
|
364
|
+
rules: {
|
|
365
|
+
required: g ? "URL을 입력해주세요." : !1,
|
|
366
|
+
pattern: {
|
|
367
|
+
value: /^(https?:\/\/)?([\w-]+\.)+[\w-]{2,4}(\/.*)?$/,
|
|
368
|
+
message: "올바른 URL을 입력해주세요."
|
|
369
|
+
},
|
|
370
|
+
...t
|
|
371
|
+
}
|
|
372
|
+
}), C = (c) => {
|
|
373
|
+
r.onChange(c), p(l, c.target.value);
|
|
374
|
+
}, f = (c) => {
|
|
375
|
+
if (c.preventDefault(), F)
|
|
376
|
+
F(c);
|
|
377
|
+
else if (r.value && !a) {
|
|
378
|
+
const b = r.value.startsWith("http") ? r.value : `https://${r.value}`;
|
|
379
|
+
window.open(b, "_blank");
|
|
380
|
+
}
|
|
381
|
+
}, N = n || s || o;
|
|
382
|
+
return /* @__PURE__ */ e(
|
|
383
|
+
S,
|
|
384
|
+
{
|
|
385
|
+
control: d,
|
|
386
|
+
name: l,
|
|
387
|
+
render: () => /* @__PURE__ */ v(k, { children: [
|
|
388
|
+
N && /* @__PURE__ */ e(I, { required: g, heading: s, label: n, description: o }),
|
|
389
|
+
w,
|
|
390
|
+
/* @__PURE__ */ v("div", { className: "flex items-center gap-2", children: [
|
|
391
|
+
i && /* @__PURE__ */ e(q, { size: "sm", className: "flex w-32 justify-center truncate shadow-none", children: i }),
|
|
392
|
+
/* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
|
|
393
|
+
j,
|
|
394
|
+
{
|
|
395
|
+
...r,
|
|
396
|
+
onBlur: () => u(l),
|
|
397
|
+
onChange: C,
|
|
398
|
+
placeholder: x,
|
|
399
|
+
className: "w-auto grow",
|
|
400
|
+
error: !!a
|
|
401
|
+
}
|
|
402
|
+
) }),
|
|
403
|
+
/* @__PURE__ */ e(
|
|
404
|
+
D,
|
|
405
|
+
{
|
|
406
|
+
variant: "outline",
|
|
407
|
+
theme: "secondary",
|
|
408
|
+
size: "md",
|
|
409
|
+
disabled: h || !!a || !r.value,
|
|
410
|
+
onClick: f,
|
|
411
|
+
children: m
|
|
412
|
+
}
|
|
413
|
+
)
|
|
414
|
+
] }),
|
|
415
|
+
/* @__PURE__ */ e(R, { children: a == null ? void 0 : a.message })
|
|
416
|
+
] })
|
|
417
|
+
}
|
|
418
|
+
);
|
|
419
|
+
};
|
|
420
|
+
export {
|
|
421
|
+
Y as C,
|
|
422
|
+
ee as D,
|
|
423
|
+
le as R,
|
|
424
|
+
ae as S,
|
|
425
|
+
re as U,
|
|
426
|
+
Z as a,
|
|
427
|
+
se as b
|
|
428
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),s=require("./index-D57xhjM5.cjs"),b=require("./index-B21JbtdU.cjs"),L=require("react"),y=({name:r,control:d,heading:a,label:c,description:x,required:j=!1,text:h,type:f,errorMsg:g=!1,onChange:m,rules:C})=>{const{field:i,fieldState:{error:n}}=s.useController({name:r,control:d,rules:C}),u=c||a||x;return e.jsx(s.FormField,{control:d,name:r,render:()=>e.jsxs(s.FormItem,{children:[u&&e.jsx(s.FormLabel,{required:j,heading:a,label:c,description:x}),e.jsx(s.FormControl,{children:e.jsxs("div",{className:"flex flex-row items-center gap-2",children:[e.jsx(s.Checkbox,{...i,id:r,checked:f==="boolean"?i.value:i.value===h,onCheckedChange:v=>{i.onChange(f==="boolean"?v:v?h:""),m&&m()}}),e.jsx(s.Label,{className:"cursor-pointer",htmlFor:r,children:h})]})}),g&&e.jsx(s.FormMessage,{children:n==null?void 0:n.message})]})})},S=({name:r,control:d,heading:a,label:c,description:x,options:j,required:h=!1,additional:f,type:g="checkbox",onChange:m,rules:C})=>{const{field:i,fieldState:{error:n}}=s.useController({name:r,control:d,rules:C}),u=(l,p)=>{var F;i.onChange(p?[...i.value||[],l]:(F=i.value)==null?void 0:F.filter(w=>w!==l)),m==null||m()},v=()=>j.map(l=>{var p;return e.jsxs(s.FormItem,{className:"flex flex-row items-center",children:[e.jsx(s.FormControl,{children:e.jsx(s.Checkbox,{id:l.value+r,checked:(p=i.value)==null?void 0:p.includes(l.value),onCheckedChange:F=>u(l.value,F)})}),e.jsx(s.Label,{htmlFor:l.value+r,className:"cursor-pointer",children:l.text})]},l.value)}),t=()=>j.map(({value:l,text:p})=>{var w;const F=(w=i.value)==null?void 0:w.includes(l);return e.jsx(s.FormItem,{className:"flex flex-row items-start gap-2",children:e.jsx(s.FormControl,{children:e.jsx(s.Button,{shape:"rounded",size:"xs",theme:F?"primary":"secondary",variant:F?"solid":"outline",onClick:o=>{o.preventDefault(),u(l,!F)},children:p})})},l)});return e.jsx(s.FormField,{control:d,name:r,render:()=>e.jsxs(s.FormItem,{children:[(c||a||x)&&e.jsx(s.FormLabel,{required:h,heading:a,label:c,description:x}),e.jsx(s.FormControl,{children:g==="checkbox"?e.jsx("div",{className:"space-y-4",children:v()}):e.jsx("ul",{className:"flex w-full flex-wrap gap-2 text-regular14",children:t()})}),f,e.jsx(s.FormMessage,{children:n==null?void 0:n.message})]})})},R=({name:r,control:d,label:a,description:c,required:x=!1,children:j,className:h,errorMsg:f=!0})=>e.jsx(s.FormField,{control:d,name:r,render:()=>e.jsxs(s.FormItem,{children:[a&&e.jsxs(s.FormLabel,{required:x,children:[e.jsx(s.Text,{children:a}),c&&e.jsx(s.FormDescription,{children:c})]}),e.jsx(s.FormControl,{children:e.jsx("div",{className:h,children:j})}),f&&e.jsx(s.FormMessage,{})]})}),V=({name:r,control:d,heading:a,label:c,description:x,options:j,required:h=!1,className:f,additional:g,direction:m="vertical",onChange:C,rules:i})=>{const{field:n,fieldState:{error:u}}=s.useController({name:r,control:d,rules:i}),v=c||a||x;return e.jsx(s.FormField,{control:d,name:r,render:()=>e.jsxs(s.FormItem,{className:"relative",children:[v&&e.jsx(s.FormLabel,{required:h,heading:a,label:c,description:x}),e.jsx(s.FormControl,{children:e.jsxs("div",{className:b.cn("flex max-w-screen-sm items-center gap-2",f),children:[e.jsx(s.RadioGroup,{onValueChange:t=>{n.onChange(t),C&&C()},value:n.value,className:b.cn(m==="vertical"&&"flex flex-col gap-4",m==="horizontal"&&"flex flex-wrap gap-8",m==="grid"&&"grid w-full grid-cols-2 gap-x-8 gap-y-4"),children:j.map(t=>e.jsxs(s.FormItem,{className:"flex flex-row items-center",children:[e.jsx(s.FormControl,{children:e.jsx(s.RadioGroupItem,{value:t.value,id:t.text,checked:t.value===n.value})}),e.jsx(s.Label,{className:"cursor-pointer font-normal",htmlFor:t.text,children:t.text})]},t.key))}),g&&e.jsx(e.Fragment,{children:g})]})}),e.jsx(s.FormMessage,{children:u==null?void 0:u.message})]})})},z=({required:r,heading:d,name:a,label:c,description:x,placeholder:j,control:h,tagDirection:f="flex-col",tagSize:g="md",rules:m})=>{const{setValue:C,getValues:i}=s.useFormContext(),{field:n,fieldState:{error:u}}=s.useController({name:a,control:h,defaultValue:[],rules:m}),[v,t]=L.useState(""),l=()=>{if(v.trim()!==""){const o=i(a)||[];C(a,[...o,v.trim()]),t("")}},p=o=>{o.key==="Enter"&&!o.nativeEvent.isComposing&&(o.preventDefault(),l())},F=o=>{const N=i(a)||[];N.splice(o,1),C(a,N)},w=c||d||x;return e.jsx(s.FormField,{control:h,name:a,render:()=>e.jsxs(s.FormItem,{children:[w&&e.jsx(s.FormLabel,{required:r,heading:d,label:c,description:x}),e.jsx(s.FormControl,{children:e.jsxs("div",{className:"flex flex-col gap-2",children:[n.value&&n.value.length>0&&e.jsx("ul",{className:b.cn("flex flex-col flex-wrap gap-1",f),children:n.value.map((o,N)=>e.jsx("li",{children:e.jsx(s.Tag,{size:g,variant:"solid-secondary-100",onClick:()=>F(N),icRight:e.jsx(s.Icon.Cancel,{size:"10",className:"text-grey-600"}),children:e.jsx("span",{children:o})})},N))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(s.Input,{value:v,onChange:o=>t(o.target.value),onKeyDown:p,className:"max-w-screen-sm",placeholder:j,error:!!u}),e.jsx(s.Button,{size:"md",variant:"outline",disabled:!v.trim(),theme:"secondary",onClick:l,className:"whitespace-nowrap",children:"추가"})]})]})}),e.jsx(s.FormMessage,{children:u==null?void 0:u.message})]})})},D=({name:r,control:d,heading:a,label:c,description:x,placeholder:j,required:h=!1,isTextArea:f=!1,unitLabel:g,unitLabelBefore:m,inputType:C="text",className:i,onChange:n,onBlur:u,icon:v,disabled:t,errorMsg:l=!0,rules:p})=>{const{field:F,formState:{errors:w}}=s.useController({name:r,control:d,rules:p}),o=k=>{const I=C==="number"?Number(k.target.value):k.target.value;F.onChange(I),n==null||n(I)},N=c||a||x;return e.jsx(s.FormField,{control:d,name:r,render:()=>e.jsxs(s.FormItem,{children:[N&&e.jsx(s.FormLabel,{required:h,heading:a,label:c,description:x}),e.jsx(s.FormControl,{children:e.jsxs("div",{className:b.cn("flex w-full max-w-screen-sm items-center gap-2",i),children:[m&&e.jsx("div",{className:"whitespace-nowrap",children:m}),f?e.jsx(s.Textarea,{...F,placeholder:j,className:"h-32",disabled:t,error:!!w[r],onChange:o}):e.jsx(s.Input,{...F,type:C,placeholder:j,disabled:t,error:!!w[r],onChange:o,onBlur:u,icon:v,iconPosition:"right"}),g&&e.jsx("div",{className:"whitespace-nowrap",children:g})]})}),l&&e.jsx(s.FormMessage,{})]})})},M=({name:r,control:d,heading:a,label:c,description:x,placeholder:j="",buttonLabel:h="보기",required:f,onClick:g,disabled:m=!1,children:C,urlTitle:i,rules:n})=>{const{trigger:u,setValue:v}=s.useFormContext(),{field:t,fieldState:{error:l}}=s.useController({name:r,control:d,rules:{required:f?"URL을 입력해주세요.":!1,pattern:{value:/^(https?:\/\/)?([\w-]+\.)+[\w-]{2,4}(\/.*)?$/,message:"올바른 URL을 입력해주세요."},...n}}),p=o=>{t.onChange(o),v(r,o.target.value)},F=o=>{if(o.preventDefault(),g)g(o);else if(t.value&&!l){const N=t.value.startsWith("http")?t.value:`https://${t.value}`;window.open(N,"_blank")}},w=c||a||x;return e.jsx(s.FormField,{control:d,name:r,render:()=>e.jsxs(s.FormItem,{children:[w&&e.jsx(s.FormLabel,{required:f,heading:a,label:c,description:x}),C,e.jsxs("div",{className:"flex items-center gap-2",children:[i&&e.jsx(s.Callout,{size:"sm",className:"flex w-32 justify-center truncate shadow-none",children:i}),e.jsx(s.FormControl,{children:e.jsx(s.Input,{...t,onBlur:()=>u(r),onChange:p,placeholder:j,className:"w-auto grow",error:!!l})}),e.jsx(s.Button,{variant:"outline",theme:"secondary",size:"md",disabled:m||!!l||!t.value,onClick:F,children:h})]}),e.jsx(s.FormMessage,{children:l==null?void 0:l.message})]})})};exports.CheckboxBooleanFormField=y;exports.CheckboxGroupFormField=S;exports.DefaultFormField=R;exports.RadioFormField=V;exports.StringArrayFormField=z;exports.StringInputField=D;exports.UrlFormField=M;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require("react/jsx-runtime");require("./index-BYinJUBt.cjs");require("react");const e=require("./boottent-design.styles.cjs.js");require("./index-D57xhjM5.cjs");require("./toggleButtonGroup-primitive-B5twgprT.cjs");require("react-dom");e.colors.main[600],e.colors.main[100],e.colors.red[400],e.colors.yellow[300],e.colors.red[400],e.colors.yellow[400],e.colors.white,e.colors.grey[800];const{grey:t,main:a,green:l,red:o,orange:r,lime:u,brown:v,blue:c,pink:x,teal:d}=e.colors;t[500],t[50],a[600],a[50],l[500],l[50],o[400],o[50],r[500],r[50],c[500],c[100],x[500],x[50],d[500],d[50],v[500],v[50],u[500],u[50];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "./index-goQ6Sq3Z.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { colors as e } from "./boottent-design.styles.es.js";
|
|
5
|
+
import "./index-fh7-GXvn.js";
|
|
6
|
+
import "./toggleButtonGroup-primitive-Bnq26qSE.js";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
e.main[600], e.main[100], e.red[400], e.yellow[300], e.red[400], e.yellow[400], e.white, e.grey[800];
|
|
9
|
+
const { grey: t, main: a, green: l, red: o, orange: u, lime: r, brown: v, blue: x, pink: d, teal: c } = e;
|
|
10
|
+
t[500], t[50], a[600], a[50], l[500], l[50], o[400], o[50], u[500], u[50], x[500], x[100], d[500], d[50], c[500], c[50], v[500], v[50], r[500], r[50];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./UrlFormField-VFsBGIO2.cjs");exports.CheckboxBooleanFormField=e.CheckboxBooleanFormField;exports.CheckboxGroupFormField=e.CheckboxGroupFormField;exports.DefaultFormField=e.DefaultFormField;exports.RadioFormField=e.RadioFormField;exports.StringArrayFormField=e.StringArrayFormField;exports.StringInputField=e.StringInputField;exports.UrlFormField=e.UrlFormField;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { C as F, a, D as e, R as i, S as l, b as d, U as m } from "./UrlFormField-DhBCWqhC.js";
|
|
2
|
+
export {
|
|
3
|
+
F as CheckboxBooleanFormField,
|
|
4
|
+
a as CheckboxGroupFormField,
|
|
5
|
+
e as DefaultFormField,
|
|
6
|
+
i as RadioFormField,
|
|
7
|
+
l as StringArrayFormField,
|
|
8
|
+
d as StringInputField,
|
|
9
|
+
m as UrlFormField
|
|
10
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),s=require("./index-BYinJUBt.cjs"),n=require("react/jsx-runtime"),g=require("./index-B21JbtdU.cjs");function x(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(o,r,i.get?i:{enumerable:!0,get:()=>t[r]})}}return o.default=t,Object.freeze(o)}const v=x(f);var R="AspectRatio",c=v.forwardRef((t,o)=>{const{ratio:r=1/1,style:i,...a}=t;return n.jsx("div",{style:{position:"relative",width:"100%",paddingBottom:`${100/r}%`},"data-radix-aspect-ratio-wrapper":"",children:n.jsx(s.Primitive.div,{...a,ref:o,style:{...i,position:"absolute",top:0,right:0,bottom:0,left:0}})})});c.displayName=R;var b=c;const y=b,j=({className:t,columns:o,rows:r,gap:i,style:a,...d})=>{const l=e=>e?e>=1&&e<=12?`grid-cols-${e}`:"grid-cols-auto":"",u=e=>e?e>=1&&e<=12?`grid-rows-${e} grid-flow-col`:"grid-rows-auto":"",p=i!==void 0?`${i/4}rem`:void 0;return n.jsx(s.Box,{className:g.cn("grid",l(o),u(r),t),style:{gap:p,...a},...d})};exports.Box=s.Box;exports.FlexBox=s.FlexBox;exports.AspectRatio=y;exports.GridBox=j;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as f from "react";
|
|
2
|
-
import { P as m, B as g } from "./index-
|
|
3
|
-
import { F as C } from "./index-
|
|
2
|
+
import { P as m, B as g } from "./index-goQ6Sq3Z.js";
|
|
3
|
+
import { F as C } from "./index-goQ6Sq3Z.js";
|
|
4
4
|
import { jsx as s } from "react/jsx-runtime";
|
|
5
|
-
import { c as v } from "./index-
|
|
5
|
+
import { c as v } from "./index-CQACG110.js";
|
|
6
6
|
var u = "AspectRatio", d = f.forwardRef(
|
|
7
7
|
(o, i) => {
|
|
8
8
|
const { ratio: a = 1 / 1, style: t, ...e } = o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime");require("./index-D57xhjM5.cjs");const f=require("./portal-manager-9WO01tNb.cjs"),C=require("./index-B21JbtdU.cjs"),i=require("react"),a=require("./toggleButtonGroup-primitive-B5twgprT.cjs"),p=require("./portal-container-BwvvRejy.cjs"),m=()=>{const[r,l]=i.useState([]);i.useEffect(()=>{const e=f.portalManager.subscribe((s,u)=>{l(o=>{if(u){if(!o.find(t=>t.id===s.id))return[...o,{...s,isOpen:u}]}else return o.map(t=>t.id===s.id?{...t,isOpen:u}:t);return o})});return()=>{e()}},[]);const n=i.useCallback(e=>{f.portalManager.setPortalOpen(e,!1)},[]);i.useEffect(()=>{const e=[];return r.forEach(s=>{if(!s.isOpen){const u=setTimeout(()=>{l(o=>o.filter(t=>t.id!==s.id))},300);e.push(u)}}),()=>{e.forEach(s=>clearTimeout(s))}},[r]);const d=i.useCallback(e=>{const s=e.props;C.toast({title:s.title,description:s.description,action:s.action,closeButton:s.closeButton,variant:s.variant,position:s.position,size:s.size,className:s.className}),n(e.id)},[n]);return i.useEffect(()=>{r.forEach(e=>{e.type==="toast"&&e.isOpen&&d(e)})},[r,d]),c.jsxs(p.PortalContainer,{children:[c.jsx(p.Toaster,{}),r.map(e=>{var s;if(!e.isOpen)return null;switch(e.type){case"modal":return c.jsx(a.Modal,{...e.props,onClose:()=>{e.props.onClose&&e.props.onClose(),n(e.id)},description:(s=e.props.description)==null?void 0:s.toString()},e.id);case"alert":return c.jsx(a.Alert,{...e.props,onClose:()=>{e.props.onClose&&e.props.onClose(),n(e.id)}},e.id);case"dialog":return c.jsx(a.Dialog,{...e.props,onClose:()=>{e.props.onClose&&e.props.onClose(),n(e.id)}},e.id);case"toast":return null;default:return null}})]})};exports.PortalProvider=m;
|