@devslab/dds-react 0.0.0-stage → 0.21.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/LICENSE +74 -0
- package/README.ko.md +49 -0
- package/README.md +54 -2
- package/dist/console-shell.d.ts +44 -0
- package/dist/console-shell.d.ts.map +1 -0
- package/dist/controls.d.ts +45 -0
- package/dist/controls.d.ts.map +1 -0
- package/dist/date-picker.d.ts +13 -0
- package/dist/date-picker.d.ts.map +1 -0
- package/dist/icon.d.ts +10 -0
- package/dist/icon.d.ts.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +614 -0
- package/dist/index.js.map +1 -0
- package/dist/overlays.d.ts +36 -0
- package/dist/overlays.d.ts.map +1 -0
- package/dist/selection.d.ts +30 -0
- package/dist/selection.d.ts.map +1 -0
- package/dist/status-pill.d.ts +11 -0
- package/dist/status-pill.d.ts.map +1 -0
- package/dist/toast.d.ts +25 -0
- package/dist/toast.d.ts.map +1 -0
- package/package.json +75 -3
- package/styles.css +38 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,614 @@
|
|
|
1
|
+
import { createContext as e, forwardRef as t, useContext as n, useEffect as r, useId as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
2
|
+
import { Field as c, Field as l } from "@ark-ui/react/field";
|
|
3
|
+
import { Checkbox as u, Checkbox as d } from "@ark-ui/react/checkbox";
|
|
4
|
+
import { Switch as f, Switch as p } from "@ark-ui/react/switch";
|
|
5
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
6
|
+
import { Tabs as _, Tabs as v, useTabsContext as y } from "@ark-ui/react/tabs";
|
|
7
|
+
import { RadioGroup as b, RadioGroup as x, useRadioGroupContext as S } from "@ark-ui/react/radio-group";
|
|
8
|
+
import { Dialog as C, Dialog as w } from "@ark-ui/react/dialog";
|
|
9
|
+
import { Tooltip as ee, Tooltip as T } from "@ark-ui/react/tooltip";
|
|
10
|
+
import { Portal as E } from "@ark-ui/react/portal";
|
|
11
|
+
import { directionPolicy as D, icons as te } from "@devslab/dds-icons";
|
|
12
|
+
import { Toast as O, Toast as ne, Toaster as k, createToaster as A } from "@ark-ui/react/toast";
|
|
13
|
+
import { DatePicker as j, DatePicker as M, parseDate as N } from "@ark-ui/react/date-picker";
|
|
14
|
+
//#region src/controls.tsx
|
|
15
|
+
var P = (...e) => e.filter(Boolean).join(" "), F = t(function({ tone: e = "primary", size: t = "md", loading: n, disabled: r, type: i = "button", className: a, children: o, ...s }, c) {
|
|
16
|
+
return /* @__PURE__ */ g("button", {
|
|
17
|
+
...s,
|
|
18
|
+
ref: c,
|
|
19
|
+
type: i,
|
|
20
|
+
disabled: r || n,
|
|
21
|
+
"aria-busy": n || void 0,
|
|
22
|
+
className: P("dds-btn", `dds-btn--${e}`, t !== "md" && `dds-btn--${t}`, a),
|
|
23
|
+
children: [n && /* @__PURE__ */ h("span", {
|
|
24
|
+
className: "dds-spinner",
|
|
25
|
+
"aria-hidden": !0
|
|
26
|
+
}), o]
|
|
27
|
+
});
|
|
28
|
+
}), I = t(function({ tone: e = "ghost", size: t = "md", loading: n, disabled: r, type: i = "button", className: a, children: o, ...s }, c) {
|
|
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 })]
|
|
142
|
+
});
|
|
143
|
+
}), U = t(function({ onValueChange: e, unstyled: t, className: n, ...r }, i) {
|
|
144
|
+
return /* @__PURE__ */ h(v.Root, {
|
|
145
|
+
...r,
|
|
146
|
+
ref: i,
|
|
147
|
+
onValueChange: (t) => e?.(t.value),
|
|
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)
|
|
155
|
+
});
|
|
156
|
+
}), G = t(function({ unstyled: e, className: t, ...n }, r) {
|
|
157
|
+
return /* @__PURE__ */ h(v.Trigger, {
|
|
158
|
+
...n,
|
|
159
|
+
ref: r,
|
|
160
|
+
className: P(!e && "dds-tab", t)
|
|
161
|
+
});
|
|
162
|
+
}), K = t(function({ value: e, style: t, ...n }, r) {
|
|
163
|
+
let i = y().value !== e;
|
|
164
|
+
return /* @__PURE__ */ h(v.Content, {
|
|
165
|
+
...n,
|
|
166
|
+
value: e,
|
|
167
|
+
ref: r,
|
|
168
|
+
hidden: i,
|
|
169
|
+
style: i ? {
|
|
170
|
+
...t,
|
|
171
|
+
display: "none"
|
|
172
|
+
} : t
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
function q({ option: e }) {
|
|
176
|
+
let t = S(), { style: n, defaultChecked: r, ...i } = t.getItemHiddenInputProps(e);
|
|
177
|
+
return /* @__PURE__ */ h("input", {
|
|
178
|
+
...i,
|
|
179
|
+
checked: t.value === e.value,
|
|
180
|
+
onChange: () => {},
|
|
181
|
+
className: "dds-check__input"
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
var J = t(function({ options: e, label: t, onValueChange: n, className: r, children: i, ...a }, o) {
|
|
185
|
+
return /* @__PURE__ */ g(x.Root, {
|
|
186
|
+
...a,
|
|
187
|
+
ref: o,
|
|
188
|
+
onValueChange: (e) => {
|
|
189
|
+
e.value !== null && n?.(e.value);
|
|
190
|
+
},
|
|
191
|
+
className: P("dds-radio-group", r),
|
|
192
|
+
children: [
|
|
193
|
+
/* @__PURE__ */ h(x.Label, {
|
|
194
|
+
className: "dds-field__label",
|
|
195
|
+
children: t
|
|
196
|
+
}),
|
|
197
|
+
e.map((e) => /* @__PURE__ */ g(x.Item, {
|
|
198
|
+
value: e.value,
|
|
199
|
+
disabled: e.disabled,
|
|
200
|
+
className: "dds-check",
|
|
201
|
+
children: [/* @__PURE__ */ h(q, { option: e }), /* @__PURE__ */ h(x.ItemText, { children: e.label })]
|
|
202
|
+
}, e.value)),
|
|
203
|
+
i
|
|
204
|
+
]
|
|
205
|
+
});
|
|
206
|
+
}), Y = t(function({ title: e, description: t, children: n, actions: r, onOpenChange: i, closeOnOutside: a, portal: o = !0, className: s, overlayClassName: c, contentProps: l, initialFocus: u, finalFocus: d, frame: f, unstyled: p, ..._ }, v) {
|
|
207
|
+
let y = {
|
|
208
|
+
title: /* @__PURE__ */ h(w.Title, {
|
|
209
|
+
className: p ? void 0 : "dds-dialog__title",
|
|
210
|
+
children: e
|
|
211
|
+
}),
|
|
212
|
+
description: t && /* @__PURE__ */ h(w.Description, {
|
|
213
|
+
className: p ? void 0 : "dds-dialog__body",
|
|
214
|
+
children: t
|
|
215
|
+
}),
|
|
216
|
+
children: n,
|
|
217
|
+
actions: r && /* @__PURE__ */ h("div", {
|
|
218
|
+
className: p ? void 0 : "dds-dialog__actions",
|
|
219
|
+
children: r
|
|
220
|
+
})
|
|
221
|
+
}, b = /* @__PURE__ */ h(w.Positioner, {
|
|
222
|
+
className: P(!p && "dds-dialog-overlay", c),
|
|
223
|
+
children: /* @__PURE__ */ h(w.Content, {
|
|
224
|
+
...l,
|
|
225
|
+
ref: v,
|
|
226
|
+
"aria-describedby": t ? l?.["aria-describedby"] : void 0,
|
|
227
|
+
className: P(!p && "dds-dialog", s, l?.className),
|
|
228
|
+
children: f ? f(y) : /* @__PURE__ */ g(m, { children: [
|
|
229
|
+
y.title,
|
|
230
|
+
y.description,
|
|
231
|
+
n,
|
|
232
|
+
y.actions
|
|
233
|
+
] })
|
|
234
|
+
})
|
|
235
|
+
});
|
|
236
|
+
return /* @__PURE__ */ h(w.Root, {
|
|
237
|
+
..._,
|
|
238
|
+
onOpenChange: (e) => i?.(e.open),
|
|
239
|
+
closeOnInteractOutside: a ?? _.closeOnInteractOutside,
|
|
240
|
+
initialFocusEl: u ? () => u() ?? null : _.initialFocusEl,
|
|
241
|
+
finalFocusEl: d ? () => d() ?? null : _.finalFocusEl,
|
|
242
|
+
lazyMount: !0,
|
|
243
|
+
unmountOnExit: !0,
|
|
244
|
+
children: o ? /* @__PURE__ */ h(E, { children: b }) : b
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
function X({ content: e, children: t, onOpenChange: n, className: r, contentProps: i, ...a }) {
|
|
248
|
+
return /* @__PURE__ */ h(T.Root, {
|
|
249
|
+
openDelay: 0,
|
|
250
|
+
closeDelay: 0,
|
|
251
|
+
...a,
|
|
252
|
+
onOpenChange: (e) => n?.(e.open),
|
|
253
|
+
children: /* @__PURE__ */ g("span", {
|
|
254
|
+
className: P("dds-tooltip", r),
|
|
255
|
+
children: [typeof t == "function" ? /* @__PURE__ */ h(T.Context, { children: (e) => t(e.getTriggerProps()) }) : /* @__PURE__ */ h(T.Trigger, {
|
|
256
|
+
asChild: !0,
|
|
257
|
+
children: t
|
|
258
|
+
}), /* @__PURE__ */ h(E, { children: /* @__PURE__ */ h(T.Positioner, { children: /* @__PURE__ */ h(T.Content, {
|
|
259
|
+
...i,
|
|
260
|
+
className: P("dds-tooltip__bubble", i?.className),
|
|
261
|
+
children: e
|
|
262
|
+
}) }) })]
|
|
263
|
+
})
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region src/icon.tsx
|
|
268
|
+
var re = t(function({ name: e, label: t, size: n = 24, directional: r, className: i, ...a }, o) {
|
|
269
|
+
let s = te[e];
|
|
270
|
+
return /* @__PURE__ */ g("svg", {
|
|
271
|
+
...a,
|
|
272
|
+
ref: o,
|
|
273
|
+
viewBox: s.viewBox,
|
|
274
|
+
width: n,
|
|
275
|
+
height: n,
|
|
276
|
+
fill: "none",
|
|
277
|
+
stroke: "currentColor",
|
|
278
|
+
strokeWidth: s.strokeWidth,
|
|
279
|
+
strokeLinecap: "round",
|
|
280
|
+
strokeLinejoin: "round",
|
|
281
|
+
role: t ? "img" : void 0,
|
|
282
|
+
"aria-label": t,
|
|
283
|
+
"aria-hidden": !t || void 0,
|
|
284
|
+
className: P((r ?? D.mirrorInRtl.includes(e)) && D.cssClass, i),
|
|
285
|
+
children: [t && /* @__PURE__ */ h("title", { children: t }), /* @__PURE__ */ h("g", { dangerouslySetInnerHTML: { __html: s.body } })]
|
|
286
|
+
});
|
|
287
|
+
}), Z = e(null);
|
|
288
|
+
function ie({ children: e, defaultDuration: t = 5e3, dismissLabel: n, regionLabel: s, className: c }) {
|
|
289
|
+
let l = i(), u = o(0), d = a(() => A({
|
|
290
|
+
placement: "bottom-end",
|
|
291
|
+
overlap: !1,
|
|
292
|
+
gap: 8,
|
|
293
|
+
offsets: "var(--dds-space-16)",
|
|
294
|
+
removeDelay: 0,
|
|
295
|
+
hotkey: ["DDS_NO_HOTKEY"]
|
|
296
|
+
}), []), f = a(() => ({
|
|
297
|
+
show(e) {
|
|
298
|
+
let n = `dds-toast-${l}-${++u.current}`, r = e.duration ?? t;
|
|
299
|
+
return d.create({
|
|
300
|
+
id: n,
|
|
301
|
+
description: e.message,
|
|
302
|
+
type: e.tone === "danger" ? "error" : e.tone ?? "info",
|
|
303
|
+
duration: r > 0 ? r : Infinity,
|
|
304
|
+
meta: { dds: {
|
|
305
|
+
...e,
|
|
306
|
+
id: n
|
|
307
|
+
} }
|
|
308
|
+
}), n;
|
|
309
|
+
},
|
|
310
|
+
dismiss: (e) => d.remove(e),
|
|
311
|
+
clear: () => d.remove()
|
|
312
|
+
}), [
|
|
313
|
+
d,
|
|
314
|
+
l,
|
|
315
|
+
t
|
|
316
|
+
]);
|
|
317
|
+
return r(() => () => d.remove(), [d]), /* @__PURE__ */ g(Z.Provider, {
|
|
318
|
+
value: f,
|
|
319
|
+
children: [e, /* @__PURE__ */ h(k, {
|
|
320
|
+
toaster: d,
|
|
321
|
+
label: s ?? "",
|
|
322
|
+
"aria-label": s ?? "",
|
|
323
|
+
role: s ? "region" : "presentation",
|
|
324
|
+
className: P("dds-toast-region", c),
|
|
325
|
+
children: (e) => {
|
|
326
|
+
let t = e.meta?.dds;
|
|
327
|
+
return /* @__PURE__ */ g(O.Root, {
|
|
328
|
+
className: P("dds-toast", `dds-toast--${t.tone ?? "info"}`),
|
|
329
|
+
role: t.tone === "danger" ? "alert" : "status",
|
|
330
|
+
children: [/* @__PURE__ */ h(O.Description, { children: e.description }), n && /* @__PURE__ */ h(O.CloseTrigger, {
|
|
331
|
+
className: "dds-iconbtn dds-iconbtn--sm",
|
|
332
|
+
"aria-label": typeof n == "function" ? n(t) : n,
|
|
333
|
+
children: "×"
|
|
334
|
+
})]
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
})]
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
function ae() {
|
|
341
|
+
let e = n(Z);
|
|
342
|
+
if (!e) throw Error("useToast must be called inside <ToastProvider>");
|
|
343
|
+
return e;
|
|
344
|
+
}
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region src/console-shell.tsx
|
|
347
|
+
function oe(e, t) {
|
|
348
|
+
return t.active ?? (t.href.split("/").filter(Boolean).length <= 1 ? e === t.href : e === t.href || e.startsWith(`${t.href}/`));
|
|
349
|
+
}
|
|
350
|
+
var se = t(function({ surface: e, activePath: t, brand: n, context: a, nav: o, labels: c, header: l, foot: u, children: d, className: f, ...p }, m) {
|
|
351
|
+
let [_, v] = s(!1), [y, b] = s(!1), x = i(), S = `dds-console-rail-${x}`, C = `dds-console-main-${x}`;
|
|
352
|
+
return r(() => {
|
|
353
|
+
b(!0);
|
|
354
|
+
let e = (e) => {
|
|
355
|
+
e.key === "Escape" && v(!1);
|
|
356
|
+
};
|
|
357
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
358
|
+
}, []), /* @__PURE__ */ g("div", {
|
|
359
|
+
...p,
|
|
360
|
+
ref: m,
|
|
361
|
+
className: P("dds-console-shell", f),
|
|
362
|
+
"data-surface": e,
|
|
363
|
+
"data-hydrated": y ? "true" : void 0,
|
|
364
|
+
children: [
|
|
365
|
+
/* @__PURE__ */ h("a", {
|
|
366
|
+
className: "dds-console-skip dds-visually-hidden",
|
|
367
|
+
href: `#${C}`,
|
|
368
|
+
children: c.skip
|
|
369
|
+
}),
|
|
370
|
+
/* @__PURE__ */ g("button", {
|
|
371
|
+
className: "dds-console-rail__toggle",
|
|
372
|
+
type: "button",
|
|
373
|
+
"data-action": "toggle-rail",
|
|
374
|
+
"aria-controls": S,
|
|
375
|
+
"aria-expanded": _,
|
|
376
|
+
onClick: () => v(!_),
|
|
377
|
+
children: [/* @__PURE__ */ h("span", { "aria-hidden": !0 }), /* @__PURE__ */ h("span", {
|
|
378
|
+
className: "dds-visually-hidden",
|
|
379
|
+
children: _ ? c.menuClose : c.menuOpen
|
|
380
|
+
})]
|
|
381
|
+
}),
|
|
382
|
+
/* @__PURE__ */ h("div", {
|
|
383
|
+
className: "dds-console-rail__scrim",
|
|
384
|
+
"data-open": String(_),
|
|
385
|
+
onClick: () => v(!1)
|
|
386
|
+
}),
|
|
387
|
+
/* @__PURE__ */ g("aside", {
|
|
388
|
+
id: S,
|
|
389
|
+
className: "dds-console-rail",
|
|
390
|
+
"data-open": String(_),
|
|
391
|
+
children: [
|
|
392
|
+
/* @__PURE__ */ g("a", {
|
|
393
|
+
className: "dds-console-rail__brand",
|
|
394
|
+
href: n.href,
|
|
395
|
+
children: [/* @__PURE__ */ h("img", {
|
|
396
|
+
src: n.mark,
|
|
397
|
+
alt: "",
|
|
398
|
+
width: 20,
|
|
399
|
+
height: 20
|
|
400
|
+
}), /* @__PURE__ */ h("strong", { children: n.name })]
|
|
401
|
+
}),
|
|
402
|
+
a && a.length > 0 && /* @__PURE__ */ h("dl", {
|
|
403
|
+
className: "dds-console-rail__context",
|
|
404
|
+
children: a.map((e, t) => /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("dt", { children: e.label }), /* @__PURE__ */ h("dd", { children: e.value })] }, t))
|
|
405
|
+
}),
|
|
406
|
+
/* @__PURE__ */ h("nav", {
|
|
407
|
+
className: "dds-console-rail__nav",
|
|
408
|
+
"aria-label": c.nav,
|
|
409
|
+
children: o.map((n, r) => /* @__PURE__ */ g("section", {
|
|
410
|
+
className: "dds-console-rail__group",
|
|
411
|
+
"aria-labelledby": `${x}-group-${r}`,
|
|
412
|
+
children: [/* @__PURE__ */ h("h2", {
|
|
413
|
+
id: `${x}-group-${r}`,
|
|
414
|
+
className: "dds-console-rail__group-label",
|
|
415
|
+
children: n.label
|
|
416
|
+
}), /* @__PURE__ */ h("ul", { children: n.items.map((n) => /* @__PURE__ */ h("li", { children: /* @__PURE__ */ g("a", {
|
|
417
|
+
className: "dds-console-rail__item",
|
|
418
|
+
"data-nav": `${e}.${n.id}`,
|
|
419
|
+
href: n.href,
|
|
420
|
+
"aria-current": oe(t, n) ? "page" : void 0,
|
|
421
|
+
onClick: () => v(!1),
|
|
422
|
+
children: [/* @__PURE__ */ h("span", { children: n.label }), n.badge !== void 0 && n.badge > 0 && /* @__PURE__ */ h("span", {
|
|
423
|
+
className: "dds-console-rail__badge",
|
|
424
|
+
"aria-label": c.badge.replace("{count}", () => String(n.badge)),
|
|
425
|
+
children: n.badge
|
|
426
|
+
})]
|
|
427
|
+
}) }, n.id)) })]
|
|
428
|
+
}, r))
|
|
429
|
+
}),
|
|
430
|
+
u && /* @__PURE__ */ h("div", {
|
|
431
|
+
className: "dds-console-rail__foot",
|
|
432
|
+
children: u
|
|
433
|
+
})
|
|
434
|
+
]
|
|
435
|
+
}),
|
|
436
|
+
/* @__PURE__ */ g("main", {
|
|
437
|
+
id: C,
|
|
438
|
+
className: "dds-console-main",
|
|
439
|
+
tabIndex: -1,
|
|
440
|
+
children: [/* @__PURE__ */ g("header", {
|
|
441
|
+
className: "dds-console-page-header",
|
|
442
|
+
children: [/* @__PURE__ */ g("div", {
|
|
443
|
+
className: "dds-console-page-header__text",
|
|
444
|
+
children: [l.eyebrow && /* @__PURE__ */ h("p", {
|
|
445
|
+
className: "dds-console-page-eyebrow",
|
|
446
|
+
children: l.eyebrow
|
|
447
|
+
}), /* @__PURE__ */ h("h1", { children: l.title })]
|
|
448
|
+
}), l.actions && /* @__PURE__ */ h("div", {
|
|
449
|
+
className: "dds-console-page-header__actions",
|
|
450
|
+
children: l.actions
|
|
451
|
+
})]
|
|
452
|
+
}), d]
|
|
453
|
+
})
|
|
454
|
+
]
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
//#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
|
+
//#region src/status-pill.tsx
|
|
592
|
+
function le(e) {
|
|
593
|
+
let t = new Set(e.openDomains ?? []);
|
|
594
|
+
return function(n) {
|
|
595
|
+
let r = e.tones[n.domain]?.[n.value], i = e.label(n.domain, n.value, n.locale);
|
|
596
|
+
if (!r || !i) {
|
|
597
|
+
if (t.has(n.domain)) return /* @__PURE__ */ h("code", {
|
|
598
|
+
"data-status": `${n.domain}.${n.value}`,
|
|
599
|
+
children: n.value
|
|
600
|
+
});
|
|
601
|
+
throw Error(r ? `StatusPill: no label for ${n.domain}.${n.value}` : `StatusPill: no tone for ${n.domain}.${n.value}`);
|
|
602
|
+
}
|
|
603
|
+
return /* @__PURE__ */ h("span", {
|
|
604
|
+
className: r === "neutral" ? "dds-badge" : `dds-badge dds-badge--${r}`,
|
|
605
|
+
"data-status": `${n.domain}.${n.value}`,
|
|
606
|
+
"data-tone": r,
|
|
607
|
+
children: i
|
|
608
|
+
});
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
//#endregion
|
|
612
|
+
export { u as ArkCheckbox, j as ArkDatePicker, C as ArkDialog, c as ArkField, b as ArkRadioGroup, f as ArkSwitch, _ as ArkTabs, ne as ArkToast, ee as ArkTooltip, F as Button, B as Checkbox, se as ConsoleShell, ce as DatePicker, Y as Dialog, L as Field, re as Icon, I as IconButton, H as Radio, J as RadioGroup, R as Select, V as Switch, G as Tab, W as TabList, K as TabPanel, U as Tabs, ie as ToastProvider, X as Tooltip, P as classes, le as createStatusPill, ae as useToast };
|
|
613
|
+
|
|
614
|
+
//# sourceMappingURL=index.js.map
|