@devslab/dds-react 0.21.1 → 0.22.0
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.ko.md +18 -0
- package/README.md +46 -0
- package/dist/calendar-view-I_sNlioP.js +145 -0
- package/dist/calendar-view-I_sNlioP.js.map +1 -0
- package/dist/calendar-view.d.ts +16 -0
- package/dist/calendar-view.d.ts.map +1 -0
- package/dist/calendar.d.ts +19 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +51 -0
- package/dist/calendar.js.map +1 -0
- package/dist/choice-B3vNMfKK.js +300 -0
- package/dist/choice-B3vNMfKK.js.map +1 -0
- package/dist/choice-types.d.ts +56 -0
- package/dist/choice-types.d.ts.map +1 -0
- package/dist/combobox.d.ts +4 -0
- package/dist/combobox.d.ts.map +1 -0
- package/dist/combobox.js +13 -0
- package/dist/combobox.js.map +1 -0
- package/dist/controls-BajigKUv.js +139 -0
- package/dist/controls-BajigKUv.js.map +1 -0
- package/dist/date-only.d.ts +36 -0
- package/dist/date-only.d.ts.map +1 -0
- package/dist/date-picker.d.ts +12 -1
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +198 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/dropdown-menu.d.ts +31 -0
- package/dist/dropdown-menu.d.ts.map +1 -0
- package/dist/dropdown-menu.js +73 -0
- package/dist/dropdown-menu.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +201 -454
- package/dist/index.js.map +1 -1
- package/dist/input.d.ts +22 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/input.js +92 -0
- package/dist/input.js.map +1 -0
- package/dist/internal/choice.d.ts +5 -0
- package/dist/internal/choice.d.ts.map +1 -0
- package/dist/popover.d.ts +21 -0
- package/dist/popover.d.ts.map +1 -0
- package/dist/popover.js +49 -0
- package/dist/popover.js.map +1 -0
- package/dist/select-picker.d.ts +4 -0
- package/dist/select-picker.d.ts.map +1 -0
- package/dist/select-picker.js +13 -0
- package/dist/select-picker.js.map +1 -0
- package/package.json +46 -10
- package/styles.css +10 -1
package/dist/index.js
CHANGED
|
@@ -1,167 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return /* @__PURE__ */ h("button", {
|
|
30
|
-
...s,
|
|
31
|
-
ref: c,
|
|
32
|
-
type: i,
|
|
33
|
-
disabled: r || n,
|
|
34
|
-
"aria-busy": n || void 0,
|
|
35
|
-
className: P("dds-iconbtn", e !== "ghost" && `dds-iconbtn--${e}`, t !== "md" && `dds-iconbtn--${t}`, a),
|
|
36
|
-
children: n ? /* @__PURE__ */ h("span", {
|
|
37
|
-
className: "dds-spinner",
|
|
38
|
-
"aria-hidden": !0
|
|
39
|
-
}) : o
|
|
40
|
-
});
|
|
41
|
-
}), L = t(function({ id: e, label: t, helpText: n, error: r, required: a, className: o, children: s, ...c }, u) {
|
|
42
|
-
let d = i(), f = e ?? `dds-field-${d}`, p = {
|
|
43
|
-
id: f,
|
|
44
|
-
"aria-describedby": [n && `${f}-help`, r && `${f}-error`].filter(Boolean).join(" ") || void 0,
|
|
45
|
-
"aria-invalid": r ? !0 : void 0,
|
|
46
|
-
"aria-required": a ? !0 : void 0
|
|
47
|
-
};
|
|
48
|
-
return /* @__PURE__ */ g(l.Root, {
|
|
49
|
-
...c,
|
|
50
|
-
ref: u,
|
|
51
|
-
invalid: !!r,
|
|
52
|
-
required: a,
|
|
53
|
-
id: f,
|
|
54
|
-
ids: {
|
|
55
|
-
control: `${f}-root`,
|
|
56
|
-
helperText: `${f}-help`,
|
|
57
|
-
errorText: `${f}-error`
|
|
58
|
-
},
|
|
59
|
-
className: P("dds-field", !!r && "dds-field--error", o),
|
|
60
|
-
children: [
|
|
61
|
-
/* @__PURE__ */ g(l.Label, {
|
|
62
|
-
htmlFor: f,
|
|
63
|
-
className: "dds-field__label",
|
|
64
|
-
children: [t, a && /* @__PURE__ */ h("span", {
|
|
65
|
-
"aria-hidden": !0,
|
|
66
|
-
children: " *"
|
|
67
|
-
})]
|
|
68
|
-
}),
|
|
69
|
-
typeof s == "function" ? s(p) : s,
|
|
70
|
-
n && /* @__PURE__ */ h(l.HelperText, {
|
|
71
|
-
className: "dds-field__help",
|
|
72
|
-
children: n
|
|
73
|
-
}),
|
|
74
|
-
r && /* @__PURE__ */ h(l.ErrorText, {
|
|
75
|
-
className: "dds-field__error",
|
|
76
|
-
role: "alert",
|
|
77
|
-
children: r
|
|
78
|
-
})
|
|
79
|
-
]
|
|
80
|
-
});
|
|
81
|
-
}), R = t(function({ invalid: e, wrapperClassName: t, className: n, children: r, ...i }, a) {
|
|
82
|
-
return /* @__PURE__ */ h("span", {
|
|
83
|
-
className: P("dds-select", t),
|
|
84
|
-
children: /* @__PURE__ */ h("select", {
|
|
85
|
-
...i,
|
|
86
|
-
ref: a,
|
|
87
|
-
className: P("dds-select__input", n),
|
|
88
|
-
"aria-invalid": e || i["aria-invalid"],
|
|
89
|
-
children: r
|
|
90
|
-
})
|
|
91
|
-
});
|
|
92
|
-
}), z = t(function({ kind: e, label: t, checked: n, defaultChecked: r, onCheckedChange: i, id: a, name: o, value: s, disabled: c, required: l, readOnly: u, form: f, className: m, inputClassName: _, onChange: v, ...y }, b) {
|
|
93
|
-
let x = e === "switch" ? p.Root : d.Root, S = e === "switch" ? p.Label : d.Label, C = e === "switch" ? p.Context : d.Context, w = e === "switch" ? "dds-switch" : "dds-check";
|
|
94
|
-
return /* @__PURE__ */ g(x, {
|
|
95
|
-
checked: n,
|
|
96
|
-
defaultChecked: r,
|
|
97
|
-
onCheckedChange: (e) => i?.(e.checked === !0),
|
|
98
|
-
ids: a ? { hiddenInput: a } : void 0,
|
|
99
|
-
name: o,
|
|
100
|
-
value: String(s ?? "on"),
|
|
101
|
-
disabled: c,
|
|
102
|
-
required: l,
|
|
103
|
-
readOnly: u,
|
|
104
|
-
form: f,
|
|
105
|
-
className: P(w, m),
|
|
106
|
-
children: [/* @__PURE__ */ h(C, { children: (t) => {
|
|
107
|
-
let { style: n, defaultChecked: r, ...i } = t.getHiddenInputProps();
|
|
108
|
-
return /* @__PURE__ */ h("input", {
|
|
109
|
-
...i,
|
|
110
|
-
...y,
|
|
111
|
-
ref: b,
|
|
112
|
-
checked: t.checked,
|
|
113
|
-
role: e === "switch" ? "switch" : void 0,
|
|
114
|
-
onChange: v ?? (() => {}),
|
|
115
|
-
onClick: (e) => {
|
|
116
|
-
y.onClick?.(e), e.defaultPrevented || i.onClick?.(e);
|
|
117
|
-
},
|
|
118
|
-
className: P(`${w}__input`, _)
|
|
119
|
-
});
|
|
120
|
-
} }), /* @__PURE__ */ h(S, { children: t })]
|
|
121
|
-
});
|
|
122
|
-
}), B = t((e, t) => /* @__PURE__ */ h(z, {
|
|
123
|
-
...e,
|
|
124
|
-
kind: "checkbox",
|
|
125
|
-
ref: t
|
|
126
|
-
})), V = t((e, t) => /* @__PURE__ */ h(z, {
|
|
127
|
-
...e,
|
|
128
|
-
kind: "switch",
|
|
129
|
-
ref: t
|
|
130
|
-
})), H = t(function({ label: e, className: t, inputClassName: n, onCheckedChange: r, onChange: i, ...a }, o) {
|
|
131
|
-
return /* @__PURE__ */ g("label", {
|
|
132
|
-
className: P("dds-check", t),
|
|
133
|
-
children: [/* @__PURE__ */ h("input", {
|
|
134
|
-
...a,
|
|
135
|
-
ref: o,
|
|
136
|
-
type: "radio",
|
|
137
|
-
className: P("dds-check__input", n),
|
|
138
|
-
onChange: (e) => {
|
|
139
|
-
i?.(e), e.defaultPrevented || r?.(e.currentTarget.checked);
|
|
140
|
-
}
|
|
141
|
-
}), /* @__PURE__ */ h("span", { children: e })]
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./controls-BajigKUv.js";
|
|
2
|
+
import { DatePicker as c } from "./date-picker.js";
|
|
3
|
+
import { Input as l, InputGroup as u } from "./input.js";
|
|
4
|
+
import { Combobox as d } from "./combobox.js";
|
|
5
|
+
import { SelectPicker as f } from "./select-picker.js";
|
|
6
|
+
import { DropdownMenu as p } from "./dropdown-menu.js";
|
|
7
|
+
import { Popover as m } from "./popover.js";
|
|
8
|
+
import { Calendar as h } from "./calendar.js";
|
|
9
|
+
import { createContext as g, forwardRef as _, useContext as v, useEffect as y, useId as b, useMemo as x, useRef as S, useState as C } from "react";
|
|
10
|
+
import { Field as w } from "@ark-ui/react/field";
|
|
11
|
+
import { Checkbox as T } from "@ark-ui/react/checkbox";
|
|
12
|
+
import { Switch as E } from "@ark-ui/react/switch";
|
|
13
|
+
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
14
|
+
import { Tabs as A, Tabs as j, useTabsContext as ee } from "@ark-ui/react/tabs";
|
|
15
|
+
import { RadioGroup as te, RadioGroup as M, useRadioGroupContext as N } from "@ark-ui/react/radio-group";
|
|
16
|
+
import { Dialog as P, Dialog as F } from "@ark-ui/react/dialog";
|
|
17
|
+
import { Tooltip as I, Tooltip as L } from "@ark-ui/react/tooltip";
|
|
18
|
+
import { Portal as R } from "@ark-ui/react/portal";
|
|
19
|
+
import { directionPolicy as z, icons as B } from "@devslab/dds-icons";
|
|
20
|
+
import { Toast as V, Toast as H, Toaster as U, createToaster as W } from "@ark-ui/react/toast";
|
|
21
|
+
import { DatePicker as G } from "@ark-ui/react/date-picker";
|
|
22
|
+
//#region src/selection.tsx
|
|
23
|
+
var K = _(function({ onValueChange: e, unstyled: n, className: r, ...i }, a) {
|
|
24
|
+
return /* @__PURE__ */ O(j.Root, {
|
|
25
|
+
...i,
|
|
26
|
+
ref: a,
|
|
27
|
+
onValueChange: (t) => e?.(t.value),
|
|
28
|
+
className: t(!n && "dds-tabs-root", r)
|
|
142
29
|
});
|
|
143
|
-
}),
|
|
144
|
-
return /* @__PURE__ */
|
|
30
|
+
}), q = _(function({ unstyled: e, className: n, ...r }, i) {
|
|
31
|
+
return /* @__PURE__ */ O(j.List, {
|
|
145
32
|
...r,
|
|
146
33
|
ref: i,
|
|
147
|
-
|
|
148
|
-
className: P(!t && "dds-tabs-root", n)
|
|
149
|
-
});
|
|
150
|
-
}), W = t(function({ unstyled: e, className: t, ...n }, r) {
|
|
151
|
-
return /* @__PURE__ */ h(v.List, {
|
|
152
|
-
...n,
|
|
153
|
-
ref: r,
|
|
154
|
-
className: P(!e && "dds-tabs", t)
|
|
34
|
+
className: t(!e && "dds-tabs", n)
|
|
155
35
|
});
|
|
156
|
-
}),
|
|
157
|
-
return /* @__PURE__ */
|
|
158
|
-
...
|
|
159
|
-
ref:
|
|
160
|
-
className:
|
|
36
|
+
}), J = _(function({ unstyled: e, className: n, ...r }, i) {
|
|
37
|
+
return /* @__PURE__ */ O(j.Trigger, {
|
|
38
|
+
...r,
|
|
39
|
+
ref: i,
|
|
40
|
+
className: t(!e && "dds-tab", n)
|
|
161
41
|
});
|
|
162
|
-
}),
|
|
163
|
-
let i =
|
|
164
|
-
return /* @__PURE__ */
|
|
42
|
+
}), Y = _(function({ value: e, style: t, ...n }, r) {
|
|
43
|
+
let i = ee().value !== e;
|
|
44
|
+
return /* @__PURE__ */ O(j.Content, {
|
|
165
45
|
...n,
|
|
166
46
|
value: e,
|
|
167
47
|
ref: r,
|
|
@@ -172,92 +52,92 @@ var P = (...e) => e.filter(Boolean).join(" "), F = t(function({ tone: e = "prima
|
|
|
172
52
|
} : t
|
|
173
53
|
});
|
|
174
54
|
});
|
|
175
|
-
function
|
|
176
|
-
let t =
|
|
177
|
-
return /* @__PURE__ */
|
|
55
|
+
function X({ option: e }) {
|
|
56
|
+
let t = N(), { style: n, defaultChecked: r, ...i } = t.getItemHiddenInputProps(e);
|
|
57
|
+
return /* @__PURE__ */ O("input", {
|
|
178
58
|
...i,
|
|
179
59
|
checked: t.value === e.value,
|
|
180
60
|
onChange: () => {},
|
|
181
61
|
className: "dds-check__input"
|
|
182
62
|
});
|
|
183
63
|
}
|
|
184
|
-
var
|
|
185
|
-
return /* @__PURE__ */
|
|
186
|
-
...
|
|
187
|
-
ref:
|
|
64
|
+
var Z = _(function({ options: e, label: n, onValueChange: r, className: i, children: a, ...o }, s) {
|
|
65
|
+
return /* @__PURE__ */ k(M.Root, {
|
|
66
|
+
...o,
|
|
67
|
+
ref: s,
|
|
188
68
|
onValueChange: (e) => {
|
|
189
|
-
e.value !== null &&
|
|
69
|
+
e.value !== null && r?.(e.value);
|
|
190
70
|
},
|
|
191
|
-
className:
|
|
71
|
+
className: t("dds-radio-group", i),
|
|
192
72
|
children: [
|
|
193
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ O(M.Label, {
|
|
194
74
|
className: "dds-field__label",
|
|
195
|
-
children:
|
|
75
|
+
children: n
|
|
196
76
|
}),
|
|
197
|
-
e.map((e) => /* @__PURE__ */
|
|
77
|
+
e.map((e) => /* @__PURE__ */ k(M.Item, {
|
|
198
78
|
value: e.value,
|
|
199
79
|
disabled: e.disabled,
|
|
200
80
|
className: "dds-check",
|
|
201
|
-
children: [/* @__PURE__ */
|
|
81
|
+
children: [/* @__PURE__ */ O(X, { option: e }), /* @__PURE__ */ O(M.ItemText, { children: e.label })]
|
|
202
82
|
}, e.value)),
|
|
203
|
-
|
|
83
|
+
a
|
|
204
84
|
]
|
|
205
85
|
});
|
|
206
|
-
}),
|
|
207
|
-
let
|
|
208
|
-
title: /* @__PURE__ */
|
|
209
|
-
className:
|
|
86
|
+
}), ne = _(function({ title: e, description: n, children: r, actions: i, onOpenChange: a, closeOnOutside: o, portal: s = !0, className: c, overlayClassName: l, contentProps: u, initialFocus: d, finalFocus: f, frame: p, unstyled: m, ...h }, g) {
|
|
87
|
+
let _ = {
|
|
88
|
+
title: /* @__PURE__ */ O(F.Title, {
|
|
89
|
+
className: m ? void 0 : "dds-dialog__title",
|
|
210
90
|
children: e
|
|
211
91
|
}),
|
|
212
|
-
description:
|
|
213
|
-
className:
|
|
214
|
-
children:
|
|
92
|
+
description: n && /* @__PURE__ */ O(F.Description, {
|
|
93
|
+
className: m ? void 0 : "dds-dialog__body",
|
|
94
|
+
children: n
|
|
215
95
|
}),
|
|
216
|
-
children:
|
|
217
|
-
actions:
|
|
218
|
-
className:
|
|
219
|
-
children:
|
|
96
|
+
children: r,
|
|
97
|
+
actions: i && /* @__PURE__ */ O("div", {
|
|
98
|
+
className: m ? void 0 : "dds-dialog__actions",
|
|
99
|
+
children: i
|
|
220
100
|
})
|
|
221
|
-
},
|
|
222
|
-
className:
|
|
223
|
-
children: /* @__PURE__ */
|
|
224
|
-
...
|
|
225
|
-
ref:
|
|
226
|
-
"aria-describedby":
|
|
227
|
-
className:
|
|
228
|
-
children:
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
101
|
+
}, v = /* @__PURE__ */ O(F.Positioner, {
|
|
102
|
+
className: t(!m && "dds-dialog-overlay", l),
|
|
103
|
+
children: /* @__PURE__ */ O(F.Content, {
|
|
104
|
+
...u,
|
|
105
|
+
ref: g,
|
|
106
|
+
"aria-describedby": n ? u?.["aria-describedby"] : void 0,
|
|
107
|
+
className: t(!m && "dds-dialog", c, u?.className),
|
|
108
|
+
children: p ? p(_) : /* @__PURE__ */ k(D, { children: [
|
|
109
|
+
_.title,
|
|
110
|
+
_.description,
|
|
111
|
+
r,
|
|
112
|
+
_.actions
|
|
233
113
|
] })
|
|
234
114
|
})
|
|
235
115
|
});
|
|
236
|
-
return /* @__PURE__ */
|
|
237
|
-
...
|
|
238
|
-
onOpenChange: (e) =>
|
|
239
|
-
closeOnInteractOutside:
|
|
240
|
-
initialFocusEl:
|
|
241
|
-
finalFocusEl:
|
|
116
|
+
return /* @__PURE__ */ O(F.Root, {
|
|
117
|
+
...h,
|
|
118
|
+
onOpenChange: (e) => a?.(e.open),
|
|
119
|
+
closeOnInteractOutside: o ?? h.closeOnInteractOutside,
|
|
120
|
+
initialFocusEl: d ? () => d() ?? null : h.initialFocusEl,
|
|
121
|
+
finalFocusEl: f ? () => f() ?? null : h.finalFocusEl,
|
|
242
122
|
lazyMount: !0,
|
|
243
123
|
unmountOnExit: !0,
|
|
244
|
-
children:
|
|
124
|
+
children: s ? /* @__PURE__ */ O(R, { children: v }) : v
|
|
245
125
|
});
|
|
246
126
|
});
|
|
247
|
-
function
|
|
248
|
-
return /* @__PURE__ */
|
|
127
|
+
function re({ content: e, children: n, onOpenChange: r, className: i, contentProps: a, ...o }) {
|
|
128
|
+
return /* @__PURE__ */ O(L.Root, {
|
|
249
129
|
openDelay: 0,
|
|
250
130
|
closeDelay: 0,
|
|
251
|
-
...
|
|
252
|
-
onOpenChange: (e) =>
|
|
253
|
-
children: /* @__PURE__ */
|
|
254
|
-
className:
|
|
255
|
-
children: [typeof
|
|
131
|
+
...o,
|
|
132
|
+
onOpenChange: (e) => r?.(e.open),
|
|
133
|
+
children: /* @__PURE__ */ k("span", {
|
|
134
|
+
className: t("dds-tooltip", i),
|
|
135
|
+
children: [typeof n == "function" ? /* @__PURE__ */ O(L.Context, { children: (e) => n(e.getTriggerProps()) }) : /* @__PURE__ */ O(L.Trigger, {
|
|
256
136
|
asChild: !0,
|
|
257
|
-
children:
|
|
258
|
-
}), /* @__PURE__ */
|
|
259
|
-
...
|
|
260
|
-
className:
|
|
137
|
+
children: n
|
|
138
|
+
}), /* @__PURE__ */ O(R, { children: /* @__PURE__ */ O(L.Positioner, { children: /* @__PURE__ */ O(L.Content, {
|
|
139
|
+
...a,
|
|
140
|
+
className: t("dds-tooltip__bubble", a?.className),
|
|
261
141
|
children: e
|
|
262
142
|
}) }) })]
|
|
263
143
|
})
|
|
@@ -265,71 +145,71 @@ function X({ content: e, children: t, onOpenChange: n, className: r, contentProp
|
|
|
265
145
|
}
|
|
266
146
|
//#endregion
|
|
267
147
|
//#region src/icon.tsx
|
|
268
|
-
var
|
|
269
|
-
let
|
|
270
|
-
return /* @__PURE__ */
|
|
271
|
-
...
|
|
272
|
-
ref:
|
|
273
|
-
viewBox:
|
|
274
|
-
width:
|
|
275
|
-
height:
|
|
148
|
+
var Q = _(function({ name: e, label: n, size: r = 24, directional: i, className: a, ...o }, s) {
|
|
149
|
+
let c = B[e];
|
|
150
|
+
return /* @__PURE__ */ k("svg", {
|
|
151
|
+
...o,
|
|
152
|
+
ref: s,
|
|
153
|
+
viewBox: c.viewBox,
|
|
154
|
+
width: r,
|
|
155
|
+
height: r,
|
|
276
156
|
fill: "none",
|
|
277
157
|
stroke: "currentColor",
|
|
278
|
-
strokeWidth:
|
|
158
|
+
strokeWidth: c.strokeWidth,
|
|
279
159
|
strokeLinecap: "round",
|
|
280
160
|
strokeLinejoin: "round",
|
|
281
|
-
role:
|
|
282
|
-
"aria-label":
|
|
283
|
-
"aria-hidden": !
|
|
284
|
-
className:
|
|
285
|
-
children: [
|
|
161
|
+
role: n ? "img" : void 0,
|
|
162
|
+
"aria-label": n,
|
|
163
|
+
"aria-hidden": !n || void 0,
|
|
164
|
+
className: t((i ?? z.mirrorInRtl.includes(e)) && z.cssClass, a),
|
|
165
|
+
children: [n && /* @__PURE__ */ O("title", { children: n }), /* @__PURE__ */ O("g", { dangerouslySetInnerHTML: { __html: c.body } })]
|
|
286
166
|
});
|
|
287
|
-
}),
|
|
288
|
-
function ie({ children: e, defaultDuration:
|
|
289
|
-
let
|
|
167
|
+
}), $ = g(null);
|
|
168
|
+
function ie({ children: e, defaultDuration: n = 5e3, dismissLabel: r, regionLabel: i, className: a }) {
|
|
169
|
+
let o = b(), s = S(0), c = x(() => W({
|
|
290
170
|
placement: "bottom-end",
|
|
291
171
|
overlap: !1,
|
|
292
172
|
gap: 8,
|
|
293
173
|
offsets: "var(--dds-space-16)",
|
|
294
174
|
removeDelay: 0,
|
|
295
175
|
hotkey: ["DDS_NO_HOTKEY"]
|
|
296
|
-
}), []),
|
|
176
|
+
}), []), l = x(() => ({
|
|
297
177
|
show(e) {
|
|
298
|
-
let
|
|
299
|
-
return
|
|
300
|
-
id:
|
|
178
|
+
let t = `dds-toast-${o}-${++s.current}`, r = e.duration ?? n;
|
|
179
|
+
return c.create({
|
|
180
|
+
id: t,
|
|
301
181
|
description: e.message,
|
|
302
182
|
type: e.tone === "danger" ? "error" : e.tone ?? "info",
|
|
303
183
|
duration: r > 0 ? r : Infinity,
|
|
304
184
|
meta: { dds: {
|
|
305
185
|
...e,
|
|
306
|
-
id:
|
|
186
|
+
id: t
|
|
307
187
|
} }
|
|
308
|
-
}),
|
|
188
|
+
}), t;
|
|
309
189
|
},
|
|
310
|
-
dismiss: (e) =>
|
|
311
|
-
clear: () =>
|
|
190
|
+
dismiss: (e) => c.remove(e),
|
|
191
|
+
clear: () => c.remove()
|
|
312
192
|
}), [
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
193
|
+
c,
|
|
194
|
+
o,
|
|
195
|
+
n
|
|
316
196
|
]);
|
|
317
|
-
return
|
|
318
|
-
value:
|
|
319
|
-
children: [e, /* @__PURE__ */
|
|
320
|
-
toaster:
|
|
321
|
-
label:
|
|
322
|
-
"aria-label":
|
|
323
|
-
role:
|
|
324
|
-
className:
|
|
197
|
+
return y(() => () => c.remove(), [c]), /* @__PURE__ */ k($.Provider, {
|
|
198
|
+
value: l,
|
|
199
|
+
children: [e, /* @__PURE__ */ O(U, {
|
|
200
|
+
toaster: c,
|
|
201
|
+
label: i ?? "",
|
|
202
|
+
"aria-label": i ?? "",
|
|
203
|
+
role: i ? "region" : "presentation",
|
|
204
|
+
className: t("dds-toast-region", a),
|
|
325
205
|
children: (e) => {
|
|
326
|
-
let
|
|
327
|
-
return /* @__PURE__ */
|
|
328
|
-
className:
|
|
329
|
-
role:
|
|
330
|
-
children: [/* @__PURE__ */
|
|
206
|
+
let n = e.meta?.dds;
|
|
207
|
+
return /* @__PURE__ */ k(V.Root, {
|
|
208
|
+
className: t("dds-toast", `dds-toast--${n.tone ?? "info"}`),
|
|
209
|
+
role: n.tone === "danger" ? "alert" : "status",
|
|
210
|
+
children: [/* @__PURE__ */ O(V.Description, { children: e.description }), r && /* @__PURE__ */ O(V.CloseTrigger, {
|
|
331
211
|
className: "dds-iconbtn dds-iconbtn--sm",
|
|
332
|
-
"aria-label": typeof
|
|
212
|
+
"aria-label": typeof r == "function" ? r(n) : r,
|
|
333
213
|
children: "×"
|
|
334
214
|
})]
|
|
335
215
|
});
|
|
@@ -338,7 +218,7 @@ function ie({ children: e, defaultDuration: t = 5e3, dismissLabel: n, regionLabe
|
|
|
338
218
|
});
|
|
339
219
|
}
|
|
340
220
|
function ae() {
|
|
341
|
-
let e =
|
|
221
|
+
let e = v($);
|
|
342
222
|
if (!e) throw Error("useToast must be called inside <ToastProvider>");
|
|
343
223
|
return e;
|
|
344
224
|
}
|
|
@@ -347,260 +227,127 @@ function ae() {
|
|
|
347
227
|
function oe(e, t) {
|
|
348
228
|
return t.active ?? (t.href.split("/").filter(Boolean).length <= 1 ? e === t.href : e === t.href || e.startsWith(`${t.href}/`));
|
|
349
229
|
}
|
|
350
|
-
var se =
|
|
351
|
-
let [
|
|
352
|
-
return
|
|
353
|
-
|
|
230
|
+
var se = _(function({ surface: e, activePath: n, brand: r, context: i, nav: a, labels: o, header: s, foot: c, children: l, className: u, ...d }, f) {
|
|
231
|
+
let [p, m] = C(!1), [h, g] = C(!1), _ = b(), v = `dds-console-rail-${_}`, x = `dds-console-main-${_}`;
|
|
232
|
+
return y(() => {
|
|
233
|
+
g(!0);
|
|
354
234
|
let e = (e) => {
|
|
355
|
-
e.key === "Escape" &&
|
|
235
|
+
e.key === "Escape" && m(!1);
|
|
356
236
|
};
|
|
357
237
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
358
|
-
}, []), /* @__PURE__ */
|
|
359
|
-
...
|
|
360
|
-
ref:
|
|
361
|
-
className:
|
|
238
|
+
}, []), /* @__PURE__ */ k("div", {
|
|
239
|
+
...d,
|
|
240
|
+
ref: f,
|
|
241
|
+
className: t("dds-console-shell", u),
|
|
362
242
|
"data-surface": e,
|
|
363
|
-
"data-hydrated":
|
|
243
|
+
"data-hydrated": h ? "true" : void 0,
|
|
364
244
|
children: [
|
|
365
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ O("a", {
|
|
366
246
|
className: "dds-console-skip dds-visually-hidden",
|
|
367
|
-
href: `#${
|
|
368
|
-
children:
|
|
247
|
+
href: `#${x}`,
|
|
248
|
+
children: o.skip
|
|
369
249
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ k("button", {
|
|
371
251
|
className: "dds-console-rail__toggle",
|
|
372
252
|
type: "button",
|
|
373
253
|
"data-action": "toggle-rail",
|
|
374
|
-
"aria-controls":
|
|
375
|
-
"aria-expanded":
|
|
376
|
-
onClick: () =>
|
|
377
|
-
children: [/* @__PURE__ */
|
|
254
|
+
"aria-controls": v,
|
|
255
|
+
"aria-expanded": p,
|
|
256
|
+
onClick: () => m(!p),
|
|
257
|
+
children: [/* @__PURE__ */ O("span", { "aria-hidden": !0 }), /* @__PURE__ */ O("span", {
|
|
378
258
|
className: "dds-visually-hidden",
|
|
379
|
-
children:
|
|
259
|
+
children: p ? o.menuClose : o.menuOpen
|
|
380
260
|
})]
|
|
381
261
|
}),
|
|
382
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ O("div", {
|
|
383
263
|
className: "dds-console-rail__scrim",
|
|
384
|
-
"data-open": String(
|
|
385
|
-
onClick: () =>
|
|
264
|
+
"data-open": String(p),
|
|
265
|
+
onClick: () => m(!1)
|
|
386
266
|
}),
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
id:
|
|
267
|
+
/* @__PURE__ */ k("aside", {
|
|
268
|
+
id: v,
|
|
389
269
|
className: "dds-console-rail",
|
|
390
|
-
"data-open": String(
|
|
270
|
+
"data-open": String(p),
|
|
391
271
|
children: [
|
|
392
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ k("a", {
|
|
393
273
|
className: "dds-console-rail__brand",
|
|
394
|
-
href:
|
|
395
|
-
children: [/* @__PURE__ */
|
|
396
|
-
src:
|
|
274
|
+
href: r.href,
|
|
275
|
+
children: [/* @__PURE__ */ O("img", {
|
|
276
|
+
src: r.mark,
|
|
397
277
|
alt: "",
|
|
398
278
|
width: 20,
|
|
399
279
|
height: 20
|
|
400
|
-
}), /* @__PURE__ */
|
|
280
|
+
}), /* @__PURE__ */ O("strong", { children: r.name })]
|
|
401
281
|
}),
|
|
402
|
-
|
|
282
|
+
i && i.length > 0 && /* @__PURE__ */ O("dl", {
|
|
403
283
|
className: "dds-console-rail__context",
|
|
404
|
-
children:
|
|
284
|
+
children: i.map((e, t) => /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("dt", { children: e.label }), /* @__PURE__ */ O("dd", { children: e.value })] }, t))
|
|
405
285
|
}),
|
|
406
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ O("nav", {
|
|
407
287
|
className: "dds-console-rail__nav",
|
|
408
|
-
"aria-label":
|
|
409
|
-
children:
|
|
288
|
+
"aria-label": o.nav,
|
|
289
|
+
children: a.map((t, r) => /* @__PURE__ */ k("section", {
|
|
410
290
|
className: "dds-console-rail__group",
|
|
411
|
-
"aria-labelledby": `${
|
|
412
|
-
children: [/* @__PURE__ */
|
|
413
|
-
id: `${
|
|
291
|
+
"aria-labelledby": `${_}-group-${r}`,
|
|
292
|
+
children: [/* @__PURE__ */ O("h2", {
|
|
293
|
+
id: `${_}-group-${r}`,
|
|
414
294
|
className: "dds-console-rail__group-label",
|
|
415
|
-
children:
|
|
416
|
-
}), /* @__PURE__ */
|
|
295
|
+
children: t.label
|
|
296
|
+
}), /* @__PURE__ */ O("ul", { children: t.items.map((t) => /* @__PURE__ */ O("li", { children: /* @__PURE__ */ k("a", {
|
|
417
297
|
className: "dds-console-rail__item",
|
|
418
|
-
"data-nav": `${e}.${
|
|
419
|
-
href:
|
|
420
|
-
"aria-current": oe(
|
|
421
|
-
onClick: () =>
|
|
422
|
-
children: [/* @__PURE__ */
|
|
298
|
+
"data-nav": `${e}.${t.id}`,
|
|
299
|
+
href: t.href,
|
|
300
|
+
"aria-current": oe(n, t) ? "page" : void 0,
|
|
301
|
+
onClick: () => m(!1),
|
|
302
|
+
children: [/* @__PURE__ */ O("span", { children: t.label }), t.badge !== void 0 && t.badge > 0 && /* @__PURE__ */ O("span", {
|
|
423
303
|
className: "dds-console-rail__badge",
|
|
424
|
-
"aria-label":
|
|
425
|
-
children:
|
|
304
|
+
"aria-label": o.badge.replace("{count}", () => String(t.badge)),
|
|
305
|
+
children: t.badge
|
|
426
306
|
})]
|
|
427
|
-
}) },
|
|
307
|
+
}) }, t.id)) })]
|
|
428
308
|
}, r))
|
|
429
309
|
}),
|
|
430
|
-
|
|
310
|
+
c && /* @__PURE__ */ O("div", {
|
|
431
311
|
className: "dds-console-rail__foot",
|
|
432
|
-
children:
|
|
312
|
+
children: c
|
|
433
313
|
})
|
|
434
314
|
]
|
|
435
315
|
}),
|
|
436
|
-
/* @__PURE__ */
|
|
437
|
-
id:
|
|
316
|
+
/* @__PURE__ */ k("main", {
|
|
317
|
+
id: x,
|
|
438
318
|
className: "dds-console-main",
|
|
439
319
|
tabIndex: -1,
|
|
440
|
-
children: [/* @__PURE__ */
|
|
320
|
+
children: [/* @__PURE__ */ k("header", {
|
|
441
321
|
className: "dds-console-page-header",
|
|
442
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ k("div", {
|
|
443
323
|
className: "dds-console-page-header__text",
|
|
444
|
-
children: [
|
|
324
|
+
children: [s.eyebrow && /* @__PURE__ */ O("p", {
|
|
445
325
|
className: "dds-console-page-eyebrow",
|
|
446
|
-
children:
|
|
447
|
-
}), /* @__PURE__ */
|
|
448
|
-
}),
|
|
326
|
+
children: s.eyebrow
|
|
327
|
+
}), /* @__PURE__ */ O("h1", { children: s.title })]
|
|
328
|
+
}), s.actions && /* @__PURE__ */ O("div", {
|
|
449
329
|
className: "dds-console-page-header__actions",
|
|
450
|
-
children:
|
|
330
|
+
children: s.actions
|
|
451
331
|
})]
|
|
452
|
-
}),
|
|
332
|
+
}), l]
|
|
453
333
|
})
|
|
454
334
|
]
|
|
455
335
|
});
|
|
456
336
|
});
|
|
457
337
|
//#endregion
|
|
458
|
-
//#region src/date-picker.tsx
|
|
459
|
-
function Q() {
|
|
460
|
-
return /* @__PURE__ */ g("svg", {
|
|
461
|
-
width: "20",
|
|
462
|
-
height: "20",
|
|
463
|
-
viewBox: "0 0 24 24",
|
|
464
|
-
fill: "none",
|
|
465
|
-
stroke: "currentColor",
|
|
466
|
-
strokeWidth: "1.5",
|
|
467
|
-
"aria-hidden": "true",
|
|
468
|
-
children: [/* @__PURE__ */ h("rect", {
|
|
469
|
-
x: "3.5",
|
|
470
|
-
y: "5.5",
|
|
471
|
-
width: "17",
|
|
472
|
-
height: "15",
|
|
473
|
-
rx: "2"
|
|
474
|
-
}), /* @__PURE__ */ h("path", { d: "M7.5 3v5M16.5 3v5M3.5 10.5h17" })]
|
|
475
|
-
});
|
|
476
|
-
}
|
|
477
|
-
function $({ next: e = !1 }) {
|
|
478
|
-
return /* @__PURE__ */ h("svg", {
|
|
479
|
-
width: "18",
|
|
480
|
-
height: "18",
|
|
481
|
-
viewBox: "0 0 24 24",
|
|
482
|
-
fill: "none",
|
|
483
|
-
stroke: "currentColor",
|
|
484
|
-
strokeWidth: "1.5",
|
|
485
|
-
"aria-hidden": "true",
|
|
486
|
-
children: /* @__PURE__ */ h("path", { d: e ? "m9 5 7 7-7 7" : "m15 5-7 7 7 7" })
|
|
487
|
-
});
|
|
488
|
-
}
|
|
489
|
-
function ce({ label: e, value: t, onChange: n, locale: r = "ko-KR", timeZone: i = "Asia/Seoul", disabled: a = !1, min: o, max: s }) {
|
|
490
|
-
return /* @__PURE__ */ h(L, {
|
|
491
|
-
label: e,
|
|
492
|
-
children: (c) => /* @__PURE__ */ g(M.Root, {
|
|
493
|
-
locale: r,
|
|
494
|
-
timeZone: i,
|
|
495
|
-
disabled: a,
|
|
496
|
-
min: o ? N(o) : void 0,
|
|
497
|
-
max: s ? N(s) : void 0,
|
|
498
|
-
startOfWeek: 0,
|
|
499
|
-
minView: "day",
|
|
500
|
-
maxView: "day",
|
|
501
|
-
fixedWeeks: !0,
|
|
502
|
-
translations: {
|
|
503
|
-
dayCell: (e) => `${e.valueText} 선택`,
|
|
504
|
-
clearTrigger: "선택 날짜 지우기"
|
|
505
|
-
},
|
|
506
|
-
value: t ? [N(t)] : [],
|
|
507
|
-
format: (e) => e.toString(),
|
|
508
|
-
onValueChange: (e) => n(e.valueAsString[0] || ""),
|
|
509
|
-
positioning: {
|
|
510
|
-
placement: "bottom-start",
|
|
511
|
-
gutter: 8
|
|
512
|
-
},
|
|
513
|
-
children: [/* @__PURE__ */ g(M.Control, {
|
|
514
|
-
className: "dds-date-picker-control",
|
|
515
|
-
children: [/* @__PURE__ */ h(M.Input, {
|
|
516
|
-
...c,
|
|
517
|
-
placeholder: "YYYY-MM-DD",
|
|
518
|
-
autoComplete: "off"
|
|
519
|
-
}), /* @__PURE__ */ h(M.Trigger, {
|
|
520
|
-
asChild: !0,
|
|
521
|
-
children: /* @__PURE__ */ h(F, {
|
|
522
|
-
type: "button",
|
|
523
|
-
tone: "secondary",
|
|
524
|
-
"aria-label": `${e} 달력 열기`,
|
|
525
|
-
children: /* @__PURE__ */ h(Q, {})
|
|
526
|
-
})
|
|
527
|
-
})]
|
|
528
|
-
}), /* @__PURE__ */ h(E, { children: /* @__PURE__ */ h(M.Positioner, {
|
|
529
|
-
className: "dds-date-picker-positioner",
|
|
530
|
-
children: /* @__PURE__ */ h(M.Content, {
|
|
531
|
-
className: "dds-date-picker-content",
|
|
532
|
-
"aria-label": `${e} 날짜 선택`,
|
|
533
|
-
children: /* @__PURE__ */ h(M.View, {
|
|
534
|
-
view: "day",
|
|
535
|
-
children: /* @__PURE__ */ h(M.Context, { children: (e) => /* @__PURE__ */ g(m, { children: [
|
|
536
|
-
/* @__PURE__ */ g(M.ViewControl, {
|
|
537
|
-
className: "dds-date-picker-header",
|
|
538
|
-
children: [
|
|
539
|
-
/* @__PURE__ */ h(M.PrevTrigger, {
|
|
540
|
-
asChild: !0,
|
|
541
|
-
children: /* @__PURE__ */ h(F, {
|
|
542
|
-
type: "button",
|
|
543
|
-
tone: "secondary",
|
|
544
|
-
"aria-label": "이전 달",
|
|
545
|
-
children: /* @__PURE__ */ h($, {})
|
|
546
|
-
})
|
|
547
|
-
}),
|
|
548
|
-
/* @__PURE__ */ h(M.RangeText, {}),
|
|
549
|
-
/* @__PURE__ */ h(M.NextTrigger, {
|
|
550
|
-
asChild: !0,
|
|
551
|
-
children: /* @__PURE__ */ h(F, {
|
|
552
|
-
type: "button",
|
|
553
|
-
tone: "secondary",
|
|
554
|
-
"aria-label": "다음 달",
|
|
555
|
-
children: /* @__PURE__ */ h($, { next: !0 })
|
|
556
|
-
})
|
|
557
|
-
})
|
|
558
|
-
]
|
|
559
|
-
}),
|
|
560
|
-
/* @__PURE__ */ g(M.Table, {
|
|
561
|
-
className: "dds-date-picker-table",
|
|
562
|
-
children: [/* @__PURE__ */ h(M.TableHead, { children: /* @__PURE__ */ h(M.TableRow, { children: e.weekDays.map((e, t) => /* @__PURE__ */ h(M.TableHeader, { children: e.short }, t)) }) }), /* @__PURE__ */ h(M.TableBody, { children: e.weeks.map((e, t) => /* @__PURE__ */ h(M.TableRow, { children: e.map((e) => /* @__PURE__ */ h(M.TableCell, {
|
|
563
|
-
value: e,
|
|
564
|
-
children: /* @__PURE__ */ h(M.TableCellTrigger, { children: e.day })
|
|
565
|
-
}, e.toString())) }, t)) })]
|
|
566
|
-
}),
|
|
567
|
-
/* @__PURE__ */ g("div", {
|
|
568
|
-
className: "dds-date-picker-footer",
|
|
569
|
-
children: [/* @__PURE__ */ h(F, {
|
|
570
|
-
type: "button",
|
|
571
|
-
tone: "secondary",
|
|
572
|
-
onClick: () => e.selectToday(),
|
|
573
|
-
children: "오늘"
|
|
574
|
-
}), /* @__PURE__ */ h(M.ClearTrigger, {
|
|
575
|
-
asChild: !0,
|
|
576
|
-
children: /* @__PURE__ */ h(F, {
|
|
577
|
-
type: "button",
|
|
578
|
-
tone: "secondary",
|
|
579
|
-
children: "지우기"
|
|
580
|
-
})
|
|
581
|
-
})]
|
|
582
|
-
})
|
|
583
|
-
] }) })
|
|
584
|
-
})
|
|
585
|
-
})
|
|
586
|
-
}) })]
|
|
587
|
-
})
|
|
588
|
-
});
|
|
589
|
-
}
|
|
590
|
-
//#endregion
|
|
591
338
|
//#region src/status-pill.tsx
|
|
592
|
-
function
|
|
339
|
+
function ce(e) {
|
|
593
340
|
let t = new Set(e.openDomains ?? []);
|
|
594
341
|
return function(n) {
|
|
595
342
|
let r = e.tones[n.domain]?.[n.value], i = e.label(n.domain, n.value, n.locale);
|
|
596
343
|
if (!r || !i) {
|
|
597
|
-
if (t.has(n.domain)) return /* @__PURE__ */
|
|
344
|
+
if (t.has(n.domain)) return /* @__PURE__ */ O("code", {
|
|
598
345
|
"data-status": `${n.domain}.${n.value}`,
|
|
599
346
|
children: n.value
|
|
600
347
|
});
|
|
601
348
|
throw Error(r ? `StatusPill: no label for ${n.domain}.${n.value}` : `StatusPill: no tone for ${n.domain}.${n.value}`);
|
|
602
349
|
}
|
|
603
|
-
return /* @__PURE__ */
|
|
350
|
+
return /* @__PURE__ */ O("span", {
|
|
604
351
|
className: r === "neutral" ? "dds-badge" : `dds-badge dds-badge--${r}`,
|
|
605
352
|
"data-status": `${n.domain}.${n.value}`,
|
|
606
353
|
"data-tone": r,
|
|
@@ -609,6 +356,6 @@ function le(e) {
|
|
|
609
356
|
};
|
|
610
357
|
}
|
|
611
358
|
//#endregion
|
|
612
|
-
export {
|
|
359
|
+
export { T as ArkCheckbox, G as ArkDatePicker, P as ArkDialog, w as ArkField, te as ArkRadioGroup, E as ArkSwitch, A as ArkTabs, H as ArkToast, I as ArkTooltip, s as Button, h as Calendar, r as Checkbox, d as Combobox, se as ConsoleShell, c as DatePicker, ne as Dialog, p as DropdownMenu, a as Field, Q as Icon, n as IconButton, l as Input, u as InputGroup, m as Popover, e as Radio, Z as RadioGroup, i as Select, f as SelectPicker, o as Switch, J as Tab, q as TabList, Y as TabPanel, K as Tabs, ie as ToastProvider, re as Tooltip, t as classes, ce as createStatusPill, ae as useToast };
|
|
613
360
|
|
|
614
361
|
//# sourceMappingURL=index.js.map
|