@kjun-ui/react 0.11.0 → 0.12.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/dist/index.cjs +769 -715
- package/dist/index.js +462 -408
- package/dist/styles.css +82 -0
- package/dist/types/packages/react/src/index.d.cts +1 -0
- package/dist/types/packages/react/src/index.d.ts +1 -0
- package/dist/types/packages/react/src/layout-primitives.d.cts +166 -0
- package/dist/types/packages/react/src/layout-primitives.d.ts +166 -0
- package/dist/types/shared/package-runtime/layout-primitives.d.cts +15 -0
- package/dist/types/shared/package-runtime/layout-primitives.d.ts +15 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1569,6 +1569,57 @@ function KjunSkeleton({
|
|
|
1569
1569
|
);
|
|
1570
1570
|
}
|
|
1571
1571
|
|
|
1572
|
+
// packages/react/src/layout-primitives.tsx
|
|
1573
|
+
import { createElement as createElement2 } from "react";
|
|
1574
|
+
|
|
1575
|
+
// shared/package-runtime/layout-primitives.ts
|
|
1576
|
+
var numeric = /^(number|display)/;
|
|
1577
|
+
var textTypeClass = (variant) => "kjun-type-" + variant.replace(/[A-Z]/g, (letter) => "-" + letter.toLowerCase());
|
|
1578
|
+
var defaultTextTag = (variant) => variant === "pageTitle" ? "h1" : variant === "sectionTitle" ? "h2" : variant === "cardTitle" ? "h3" : numeric.test(variant) ? "span" : "p";
|
|
1579
|
+
|
|
1580
|
+
// packages/react/src/layout-primitives.tsx
|
|
1581
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1582
|
+
var join = (...names) => names.filter(Boolean).join(" ");
|
|
1583
|
+
function KjunText({ variant = "body", tone = "default", as, align, maxLines, className, style, children, ...rest }) {
|
|
1584
|
+
const lines = maxLines && maxLines > 0 ? Math.floor(maxLines) : void 0;
|
|
1585
|
+
return createElement2(as != null ? as : defaultTextTag(variant), {
|
|
1586
|
+
...rest,
|
|
1587
|
+
className: join("kjun-text", textTypeClass(variant), className),
|
|
1588
|
+
// 안에 넣은 링크·강조 같은 앱 요소는 KJUN 리셋을 받지 않는다.
|
|
1589
|
+
"data-kjun-content": "",
|
|
1590
|
+
"data-tone": tone === "default" ? void 0 : tone,
|
|
1591
|
+
"data-align": align,
|
|
1592
|
+
"data-max-lines": lines,
|
|
1593
|
+
style: lines ? { ...style, ["--_kjun-text-lines"]: lines } : style
|
|
1594
|
+
}, children);
|
|
1595
|
+
}
|
|
1596
|
+
function KjunStack({ gap = "md", align = "stretch", as = "div", className, style, children, ...rest }) {
|
|
1597
|
+
return createElement2(as, {
|
|
1598
|
+
...rest,
|
|
1599
|
+
className: className || void 0,
|
|
1600
|
+
style,
|
|
1601
|
+
"data-kjun-stack": "",
|
|
1602
|
+
"data-gap": gap,
|
|
1603
|
+
"data-align": align
|
|
1604
|
+
}, children);
|
|
1605
|
+
}
|
|
1606
|
+
function KjunInline({ gap = "sm", align = "center", justify = "start", wrap = true, className, style, children, ...rest }) {
|
|
1607
|
+
return /* @__PURE__ */ jsx9(
|
|
1608
|
+
"div",
|
|
1609
|
+
{
|
|
1610
|
+
...rest,
|
|
1611
|
+
className: className || void 0,
|
|
1612
|
+
style,
|
|
1613
|
+
"data-kjun-inline": "",
|
|
1614
|
+
"data-gap": gap,
|
|
1615
|
+
"data-align": align,
|
|
1616
|
+
"data-justify": justify,
|
|
1617
|
+
"data-wrap": wrap ? void 0 : "false",
|
|
1618
|
+
children
|
|
1619
|
+
}
|
|
1620
|
+
);
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1572
1623
|
// shared/package-runtime/feedback-dialog.ts
|
|
1573
1624
|
import { useRef as useRef7, useState as useState7 } from "react";
|
|
1574
1625
|
function useFeedbackDialog(controller, request) {
|
|
@@ -1736,7 +1787,7 @@ function createToastLayout() {
|
|
|
1736
1787
|
|
|
1737
1788
|
// packages/react/src/toast.tsx
|
|
1738
1789
|
import { useEffect as useEffect3, useRef as useRef9 } from "react";
|
|
1739
|
-
import { jsx as
|
|
1790
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1740
1791
|
function ToastView({
|
|
1741
1792
|
toast,
|
|
1742
1793
|
controller
|
|
@@ -1778,18 +1829,18 @@ function ToastView({
|
|
|
1778
1829
|
controller.resumeToast(toast.id, reasons.focus);
|
|
1779
1830
|
},
|
|
1780
1831
|
children: [
|
|
1781
|
-
/* @__PURE__ */
|
|
1832
|
+
/* @__PURE__ */ jsx10(
|
|
1782
1833
|
"span",
|
|
1783
1834
|
{
|
|
1784
1835
|
className: "kjun-toast-icon",
|
|
1785
1836
|
style: { color: `var(--_kjun-color-${tone}-accent)` },
|
|
1786
|
-
children: /* @__PURE__ */
|
|
1837
|
+
children: /* @__PURE__ */ jsx10(KjunIcon, { name: icon })
|
|
1787
1838
|
}
|
|
1788
1839
|
),
|
|
1789
1840
|
/* @__PURE__ */ jsxs7("div", { className: "kjun-toast-content", children: [
|
|
1790
|
-
toast.title && /* @__PURE__ */
|
|
1791
|
-
/* @__PURE__ */
|
|
1792
|
-
toast.action && /* @__PURE__ */
|
|
1841
|
+
toast.title && /* @__PURE__ */ jsx10("strong", { children: toast.title }),
|
|
1842
|
+
/* @__PURE__ */ jsx10("span", { className: "kjun-toast-message", children: toast.message }),
|
|
1843
|
+
toast.action && /* @__PURE__ */ jsx10(
|
|
1793
1844
|
"button",
|
|
1794
1845
|
{
|
|
1795
1846
|
type: "button",
|
|
@@ -1806,17 +1857,17 @@ function ToastView({
|
|
|
1806
1857
|
}
|
|
1807
1858
|
)
|
|
1808
1859
|
] }),
|
|
1809
|
-
toast.closable !== false && /* @__PURE__ */
|
|
1860
|
+
toast.closable !== false && /* @__PURE__ */ jsx10(
|
|
1810
1861
|
"button",
|
|
1811
1862
|
{
|
|
1812
1863
|
type: "button",
|
|
1813
1864
|
className: "kjun-toast-close",
|
|
1814
1865
|
"aria-label": "\uC54C\uB9BC \uB2EB\uAE30",
|
|
1815
1866
|
onClick: () => dismiss(),
|
|
1816
|
-
children: /* @__PURE__ */
|
|
1867
|
+
children: /* @__PURE__ */ jsx10(KjunIcon, { name: "x" })
|
|
1817
1868
|
}
|
|
1818
1869
|
),
|
|
1819
|
-
toast.showProgress !== false && !!toast.duration && /* @__PURE__ */
|
|
1870
|
+
toast.showProgress !== false && !!toast.duration && /* @__PURE__ */ jsx10(
|
|
1820
1871
|
"div",
|
|
1821
1872
|
{
|
|
1822
1873
|
"aria-hidden": "true",
|
|
@@ -1836,7 +1887,7 @@ function ToastView({
|
|
|
1836
1887
|
}
|
|
1837
1888
|
|
|
1838
1889
|
// packages/react/src/toast-stack.tsx
|
|
1839
|
-
import { jsx as
|
|
1890
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1840
1891
|
function ToastSurface({ item, controller }) {
|
|
1841
1892
|
const ref = useRef10(null), reduced = useReducedMotion();
|
|
1842
1893
|
const current = useRef10(null);
|
|
@@ -1870,7 +1921,7 @@ function ToastSurface({ item, controller }) {
|
|
|
1870
1921
|
for (const animation of animations) animation.cancel();
|
|
1871
1922
|
};
|
|
1872
1923
|
}, [item.exiting, item.born, reduced]);
|
|
1873
|
-
return /* @__PURE__ */
|
|
1924
|
+
return /* @__PURE__ */ jsx11("div", { ref, inert: item.exiting, "aria-hidden": item.exiting || void 0, children: /* @__PURE__ */ jsx11(ToastView, { toast: item.toast, controller }) });
|
|
1874
1925
|
}
|
|
1875
1926
|
function ToastStack({ items, controller }) {
|
|
1876
1927
|
var _a;
|
|
@@ -1881,13 +1932,13 @@ function ToastStack({ items, controller }) {
|
|
|
1881
1932
|
if (root.current) layout.current.update(root.current, reduced);
|
|
1882
1933
|
});
|
|
1883
1934
|
useLayoutEffect8(() => () => layout.current.destroy(), []);
|
|
1884
|
-
return /* @__PURE__ */
|
|
1935
|
+
return /* @__PURE__ */ jsx11("div", { ref: root, className: "kjun-toast-stack", style: { zIndex: layers.zIndex((_a = layers.topWindow()) == null ? void 0 : _a.id, "toast") }, children: items.map((item) => /* @__PURE__ */ jsx11(
|
|
1885
1936
|
"div",
|
|
1886
1937
|
{
|
|
1887
1938
|
"data-toast-id": item.toast.id,
|
|
1888
1939
|
"data-exiting": item.exiting,
|
|
1889
1940
|
className: "kjun-toast-slot",
|
|
1890
|
-
children: /* @__PURE__ */
|
|
1941
|
+
children: /* @__PURE__ */ jsx11(ToastSurface, { item, controller })
|
|
1891
1942
|
},
|
|
1892
1943
|
item.toast.id
|
|
1893
1944
|
)) });
|
|
@@ -1904,7 +1955,7 @@ import {
|
|
|
1904
1955
|
useState as useState9,
|
|
1905
1956
|
useSyncExternalStore as useSyncExternalStore3
|
|
1906
1957
|
} from "react";
|
|
1907
|
-
import { jsx as
|
|
1958
|
+
import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1908
1959
|
function useKjunFeedback() {
|
|
1909
1960
|
const value = useOptionalKjunFeedback();
|
|
1910
1961
|
if (!value) throw Error("useKjunFeedback requires KjunFeedbackProvider.");
|
|
@@ -1934,8 +1985,8 @@ function FeedbackDialog({
|
|
|
1934
1985
|
onConfirm: submit,
|
|
1935
1986
|
confirmVariant: options.type === "danger" ? "danger" : "primary",
|
|
1936
1987
|
children: [
|
|
1937
|
-
options.message && /* @__PURE__ */
|
|
1938
|
-
request.kind === "prompt" && /* @__PURE__ */
|
|
1988
|
+
options.message && /* @__PURE__ */ jsx12("p", { children: options.message }),
|
|
1989
|
+
request.kind === "prompt" && /* @__PURE__ */ jsx12(
|
|
1939
1990
|
KjunInput,
|
|
1940
1991
|
{
|
|
1941
1992
|
autoFocus: true,
|
|
@@ -1977,15 +2028,15 @@ function KjunFeedbackProvider({ children }) {
|
|
|
1977
2028
|
return () => setLayers((current) => current.filter((value) => value.id !== id));
|
|
1978
2029
|
}, []);
|
|
1979
2030
|
const top = (_a = [...layers].sort((a, b) => a.order - b.order).at(-1)) == null ? void 0 : _a.id;
|
|
1980
|
-
const renderToasts = () => /* @__PURE__ */
|
|
1981
|
-
return /* @__PURE__ */
|
|
2031
|
+
const renderToasts = () => /* @__PURE__ */ jsx12(ToastStack, { items: toasts, controller });
|
|
2032
|
+
return /* @__PURE__ */ jsx12(KjunFeedbackContext.Provider, { value: controller.api, children: /* @__PURE__ */ jsxs8(
|
|
1982
2033
|
FeedbackOverlayContext.Provider,
|
|
1983
2034
|
{
|
|
1984
2035
|
value: { top, register, render: renderToasts },
|
|
1985
2036
|
children: [
|
|
1986
2037
|
children,
|
|
1987
2038
|
!layers.length && renderToasts(),
|
|
1988
|
-
dialog.request && /* @__PURE__ */
|
|
2039
|
+
dialog.request && /* @__PURE__ */ jsx12(
|
|
1989
2040
|
FeedbackDialog,
|
|
1990
2041
|
{
|
|
1991
2042
|
request: dialog.request,
|
|
@@ -2120,7 +2171,7 @@ function groupKeydown(event) {
|
|
|
2120
2171
|
}
|
|
2121
2172
|
|
|
2122
2173
|
// packages/react/src/controls.tsx
|
|
2123
|
-
import { jsx as
|
|
2174
|
+
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2124
2175
|
function KjunCheckbox({
|
|
2125
2176
|
value,
|
|
2126
2177
|
val,
|
|
@@ -2151,14 +2202,14 @@ function KjunCheckbox({
|
|
|
2151
2202
|
onChange == null ? void 0 : onChange(result);
|
|
2152
2203
|
},
|
|
2153
2204
|
children: [
|
|
2154
|
-
/* @__PURE__ */
|
|
2205
|
+
/* @__PURE__ */ jsx13(
|
|
2155
2206
|
"span",
|
|
2156
2207
|
{
|
|
2157
2208
|
className: `kjun-choice-control kjun-checkbox kjun-checkbox--${size}${checked ? " kjun-checkbox--checked" : ""}`,
|
|
2158
|
-
children: checked && /* @__PURE__ */
|
|
2209
|
+
children: checked && /* @__PURE__ */ jsx13(KjunIcon, { name: "check", size: tokens12.extensions.checkbox.iconSizes[size] })
|
|
2159
2210
|
}
|
|
2160
2211
|
),
|
|
2161
|
-
(children || label) && /* @__PURE__ */
|
|
2212
|
+
(children || label) && /* @__PURE__ */ jsx13("span", { className: "kjun-choice-label", children: children || label })
|
|
2162
2213
|
]
|
|
2163
2214
|
}
|
|
2164
2215
|
);
|
|
@@ -2196,14 +2247,14 @@ function KjunSwitch({
|
|
|
2196
2247
|
onChange == null ? void 0 : onChange(next);
|
|
2197
2248
|
},
|
|
2198
2249
|
children: [
|
|
2199
|
-
/* @__PURE__ */
|
|
2250
|
+
/* @__PURE__ */ jsx13(
|
|
2200
2251
|
"span",
|
|
2201
2252
|
{
|
|
2202
2253
|
className: `kjun-switch kjun-switch--${size}${value ? " kjun-switch--on" : ""}`,
|
|
2203
|
-
children: /* @__PURE__ */
|
|
2254
|
+
children: /* @__PURE__ */ jsx13("span", { className: "kjun-switch-thumb" })
|
|
2204
2255
|
}
|
|
2205
2256
|
),
|
|
2206
|
-
(children || label) && /* @__PURE__ */
|
|
2257
|
+
(children || label) && /* @__PURE__ */ jsx13("span", { className: "kjun-choice-label", children: children || label })
|
|
2207
2258
|
]
|
|
2208
2259
|
}
|
|
2209
2260
|
);
|
|
@@ -2222,7 +2273,7 @@ function KjunRadio({
|
|
|
2222
2273
|
}) {
|
|
2223
2274
|
const group = useContext9(RadioContext), selected = (group ? group.value : value) === val;
|
|
2224
2275
|
return /* @__PURE__ */ jsxs9("label", { className: "kjun-choice" + (disabled ? " kjun-choice--disabled" : ""), children: [
|
|
2225
|
-
/* @__PURE__ */
|
|
2276
|
+
/* @__PURE__ */ jsx13(
|
|
2226
2277
|
"input",
|
|
2227
2278
|
{
|
|
2228
2279
|
type: "radio",
|
|
@@ -2240,14 +2291,14 @@ function KjunRadio({
|
|
|
2240
2291
|
}
|
|
2241
2292
|
}
|
|
2242
2293
|
),
|
|
2243
|
-
/* @__PURE__ */
|
|
2294
|
+
/* @__PURE__ */ jsx13(
|
|
2244
2295
|
"span",
|
|
2245
2296
|
{
|
|
2246
2297
|
className: "kjun-choice-control kjun-radio" + (selected ? " kjun-radio--checked" : ""),
|
|
2247
|
-
children: selected && /* @__PURE__ */
|
|
2298
|
+
children: selected && /* @__PURE__ */ jsx13("span", { className: "kjun-radio-dot" })
|
|
2248
2299
|
}
|
|
2249
2300
|
),
|
|
2250
|
-
(children || label) && /* @__PURE__ */
|
|
2301
|
+
(children || label) && /* @__PURE__ */ jsx13("span", { className: "kjun-choice-label", children: children || label })
|
|
2251
2302
|
] });
|
|
2252
2303
|
}
|
|
2253
2304
|
function KjunRadioGroup({
|
|
@@ -2260,7 +2311,7 @@ function KjunRadioGroup({
|
|
|
2260
2311
|
onChange
|
|
2261
2312
|
}) {
|
|
2262
2313
|
const name = "kjun-" + useId5();
|
|
2263
|
-
return /* @__PURE__ */
|
|
2314
|
+
return /* @__PURE__ */ jsx13(
|
|
2264
2315
|
RadioContext.Provider,
|
|
2265
2316
|
{
|
|
2266
2317
|
value: {
|
|
@@ -2271,7 +2322,7 @@ function KjunRadioGroup({
|
|
|
2271
2322
|
onChange == null ? void 0 : onChange(next);
|
|
2272
2323
|
}
|
|
2273
2324
|
},
|
|
2274
|
-
children: /* @__PURE__ */
|
|
2325
|
+
children: /* @__PURE__ */ jsx13(
|
|
2275
2326
|
"div",
|
|
2276
2327
|
{
|
|
2277
2328
|
role: "radiogroup",
|
|
@@ -2283,7 +2334,7 @@ function KjunRadioGroup({
|
|
|
2283
2334
|
flexWrap: direction === "vertical" ? "nowrap" : "wrap",
|
|
2284
2335
|
gap: direction === "vertical" ? tokens12.dimension.value8 : tokens12.dimension.value16
|
|
2285
2336
|
},
|
|
2286
|
-
children: children || options.map((option) => /* @__PURE__ */
|
|
2337
|
+
children: children || options.map((option) => /* @__PURE__ */ jsx13(
|
|
2287
2338
|
KjunRadio,
|
|
2288
2339
|
{
|
|
2289
2340
|
val: option.value,
|
|
@@ -2314,7 +2365,7 @@ var KjunTextarea = forwardRef3(
|
|
|
2314
2365
|
var _a;
|
|
2315
2366
|
const field = useKjunField();
|
|
2316
2367
|
const spec = tokens12.input[size];
|
|
2317
|
-
return /* @__PURE__ */
|
|
2368
|
+
return /* @__PURE__ */ jsx13(
|
|
2318
2369
|
"textarea",
|
|
2319
2370
|
{
|
|
2320
2371
|
...props,
|
|
@@ -2371,7 +2422,7 @@ function KjunButtonGroup({
|
|
|
2371
2422
|
width: fullWidth ? "100%" : "fit-content"
|
|
2372
2423
|
},
|
|
2373
2424
|
children: [
|
|
2374
|
-
/* @__PURE__ */
|
|
2425
|
+
/* @__PURE__ */ jsx13(
|
|
2375
2426
|
"span",
|
|
2376
2427
|
{
|
|
2377
2428
|
ref: indicator,
|
|
@@ -2398,10 +2449,10 @@ function KjunButtonGroup({
|
|
|
2398
2449
|
onChange == null ? void 0 : onChange(option.value);
|
|
2399
2450
|
},
|
|
2400
2451
|
children: [
|
|
2401
|
-
option.icon && /* @__PURE__ */
|
|
2452
|
+
option.icon && /* @__PURE__ */ jsx13(KjunIcon, { name: option.icon, size: tokens12.extensions.selection.iconSize }),
|
|
2402
2453
|
/* @__PURE__ */ jsxs9("span", { className: "kjun-button-group-label", children: [
|
|
2403
|
-
/* @__PURE__ */
|
|
2404
|
-
/* @__PURE__ */
|
|
2454
|
+
/* @__PURE__ */ jsx13("span", { "aria-hidden": "true", style: typeStyle(tokens12.button.typography[size]), children: option.label }),
|
|
2455
|
+
/* @__PURE__ */ jsx13("span", { children: option.label })
|
|
2405
2456
|
] })
|
|
2406
2457
|
]
|
|
2407
2458
|
},
|
|
@@ -2423,7 +2474,7 @@ function KjunFilterGroup({
|
|
|
2423
2474
|
onChange
|
|
2424
2475
|
}) {
|
|
2425
2476
|
const selected = (v) => multiple ? Array.isArray(value) && (v === null ? value.length === 0 : value.includes(v)) : value === v;
|
|
2426
|
-
return /* @__PURE__ */
|
|
2477
|
+
return /* @__PURE__ */ jsx13(
|
|
2427
2478
|
"div",
|
|
2428
2479
|
{
|
|
2429
2480
|
role: "group",
|
|
@@ -2431,7 +2482,7 @@ function KjunFilterGroup({
|
|
|
2431
2482
|
className: "kjun-filter-group",
|
|
2432
2483
|
"data-scroll": scroll,
|
|
2433
2484
|
onKeyDown: groupKeydown,
|
|
2434
|
-
children: options.map((option) => /* @__PURE__ */
|
|
2485
|
+
children: options.map((option) => /* @__PURE__ */ jsx13(
|
|
2435
2486
|
"button",
|
|
2436
2487
|
{
|
|
2437
2488
|
type: "button",
|
|
@@ -2453,11 +2504,11 @@ function KjunFilterGroup({
|
|
|
2453
2504
|
...selectionTypeStyle(size, selected(option.value))
|
|
2454
2505
|
},
|
|
2455
2506
|
children: [
|
|
2456
|
-
option.dot && /* @__PURE__ */
|
|
2457
|
-
option.icon && /* @__PURE__ */
|
|
2507
|
+
option.dot && /* @__PURE__ */ jsx13("i", { style: { background: option.dot } }),
|
|
2508
|
+
option.icon && /* @__PURE__ */ jsx13(KjunIcon, { name: option.icon, size: tokens12.extensions.selection.iconSize }),
|
|
2458
2509
|
/* @__PURE__ */ jsxs9("span", { className: "kjun-filter-label", children: [
|
|
2459
|
-
/* @__PURE__ */
|
|
2460
|
-
/* @__PURE__ */
|
|
2510
|
+
/* @__PURE__ */ jsx13("span", { "aria-hidden": "true", style: typeStyle(tokens12.button.typography[size]), children: option.label }),
|
|
2511
|
+
/* @__PURE__ */ jsx13("span", { children: option.label })
|
|
2461
2512
|
] })
|
|
2462
2513
|
]
|
|
2463
2514
|
}
|
|
@@ -2473,7 +2524,7 @@ function KjunFilterGroup({
|
|
|
2473
2524
|
import { isComposingKey as isComposingKey3, tokens as tokens13 } from "@kjun-ui/tokens";
|
|
2474
2525
|
import { useEffect as useEffect5, useRef as useRef13 } from "react";
|
|
2475
2526
|
import { Popover as AriaPopover } from "react-aria-components";
|
|
2476
|
-
import { jsx as
|
|
2527
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
2477
2528
|
function FloatingPanel({
|
|
2478
2529
|
open,
|
|
2479
2530
|
onOpenChange,
|
|
@@ -2511,7 +2562,7 @@ function FloatingPanel({
|
|
|
2511
2562
|
return () => document2.removeEventListener("keydown", dismissBeforeFocus, true);
|
|
2512
2563
|
}, [open, nonModal, triggerRef, onOpenChange, layer.keyboardManaged]);
|
|
2513
2564
|
if (container === null || layer.blocked) return null;
|
|
2514
|
-
return /* @__PURE__ */
|
|
2565
|
+
return /* @__PURE__ */ jsx14(LayerScope.Provider, { value: layer.id, children: /* @__PURE__ */ jsx14(
|
|
2515
2566
|
AriaPopover,
|
|
2516
2567
|
{
|
|
2517
2568
|
ref: panel,
|
|
@@ -2606,7 +2657,7 @@ function installNonModalPopover({ panel, trigger, close }) {
|
|
|
2606
2657
|
}
|
|
2607
2658
|
|
|
2608
2659
|
// packages/react/src/popover.tsx
|
|
2609
|
-
import { Fragment as Fragment3, jsx as
|
|
2660
|
+
import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2610
2661
|
function KjunPopover({
|
|
2611
2662
|
noPadding = false,
|
|
2612
2663
|
open: controlled,
|
|
@@ -2652,9 +2703,9 @@ function KjunPopover({
|
|
|
2652
2703
|
}
|
|
2653
2704
|
});
|
|
2654
2705
|
});
|
|
2655
|
-
const content = /* @__PURE__ */
|
|
2706
|
+
const content = /* @__PURE__ */ jsx15("div", { className: "kjun-popover-content", "data-no-padding": noPadding, children: typeof children === "function" ? children(() => change(false)) : children });
|
|
2656
2707
|
return /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
2657
|
-
/* @__PURE__ */
|
|
2708
|
+
/* @__PURE__ */ jsx15(
|
|
2658
2709
|
"div",
|
|
2659
2710
|
{
|
|
2660
2711
|
ref,
|
|
@@ -2674,7 +2725,7 @@ function KjunPopover({
|
|
|
2674
2725
|
children: typeof trigger === "function" ? trigger(open) : trigger
|
|
2675
2726
|
}
|
|
2676
2727
|
),
|
|
2677
|
-
/* @__PURE__ */
|
|
2728
|
+
/* @__PURE__ */ jsx15(
|
|
2678
2729
|
FloatingPanel,
|
|
2679
2730
|
{
|
|
2680
2731
|
open,
|
|
@@ -2697,11 +2748,11 @@ function KjunPopover({
|
|
|
2697
2748
|
style: { maxHeight: maxHeight != null ? maxHeight : `min(60vh, ${tokens14.extensions.floating.maxHeight}px)`, overflowY: header != null ? void 0 : "auto" }
|
|
2698
2749
|
};
|
|
2699
2750
|
const body = /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
2700
|
-
header != null && /* @__PURE__ */
|
|
2701
|
-
header != null ? /* @__PURE__ */
|
|
2702
|
-
/* @__PURE__ */
|
|
2751
|
+
header != null && /* @__PURE__ */ jsx15("div", { id: id + "-header", className: "kjun-popover-header", children: header }),
|
|
2752
|
+
header != null ? /* @__PURE__ */ jsx15("div", { className: "kjun-popover-body", children: content }) : content,
|
|
2753
|
+
/* @__PURE__ */ jsx15(FeedbackLayerOutlet, {})
|
|
2703
2754
|
] });
|
|
2704
|
-
return modal ? /* @__PURE__ */
|
|
2755
|
+
return modal ? /* @__PURE__ */ jsx15(Dialog2, { ...dialogProps, ref: focusContent, children: body }) : /* @__PURE__ */ jsx15("section", { ...dialogProps, role: "dialog", tabIndex: -1, ref: focusContent, children: body });
|
|
2705
2756
|
})()
|
|
2706
2757
|
}
|
|
2707
2758
|
)
|
|
@@ -2723,7 +2774,7 @@ function KjunTooltip({
|
|
|
2723
2774
|
};
|
|
2724
2775
|
const layer = useLayer(open, open, "tooltip", () => setOpen(false));
|
|
2725
2776
|
return /* @__PURE__ */ jsxs10(TooltipTrigger, { isOpen: open && !layer.blocked, onOpenChange: setOpen, delay, closeDelay: 0, isDisabled: !content || !layer.scopeActive, children: [
|
|
2726
|
-
/* @__PURE__ */
|
|
2777
|
+
/* @__PURE__ */ jsx15(Focusable, { children }),
|
|
2727
2778
|
container !== null && /* @__PURE__ */ jsxs10(
|
|
2728
2779
|
Tooltip,
|
|
2729
2780
|
{
|
|
@@ -2733,7 +2784,7 @@ function KjunTooltip({
|
|
|
2733
2784
|
offset: tokens14.extensions.floating.anchorGap,
|
|
2734
2785
|
className: "kjun-scope kjun-tooltip",
|
|
2735
2786
|
children: [
|
|
2736
|
-
/* @__PURE__ */
|
|
2787
|
+
/* @__PURE__ */ jsx15(OverlayArrow, { children: /* @__PURE__ */ jsx15("svg", { width: tokens14.extensions.tooltip.arrowSize, height: tokens14.extensions.tooltip.arrowSize, viewBox: "0 0 8 8", children: /* @__PURE__ */ jsx15("path", { d: "M0 0L4 4L8 0", fill: "currentColor" }) }) }),
|
|
2737
2788
|
content
|
|
2738
2789
|
]
|
|
2739
2790
|
}
|
|
@@ -2745,7 +2796,7 @@ function KjunTooltip({
|
|
|
2745
2796
|
import { tokens as tokens15 } from "@kjun-ui/tokens";
|
|
2746
2797
|
import { cloneElement, createContext as createContext10, isValidElement as isValidElement2, useCallback as useCallback4, useContext as useContext10, useEffect as useEffect7, useId as useId7, useRef as useRef15, useState as useState11 } from "react";
|
|
2747
2798
|
import { Menu, MenuItem, Separator } from "react-aria-components";
|
|
2748
|
-
import { jsx as
|
|
2799
|
+
import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2749
2800
|
var DropdownContext = createContext10(null);
|
|
2750
2801
|
function KjunDropdown({
|
|
2751
2802
|
disabled = false,
|
|
@@ -2816,7 +2867,7 @@ function KjunDropdown({
|
|
|
2816
2867
|
if (unavailable) change(false);
|
|
2817
2868
|
}, [unavailable]);
|
|
2818
2869
|
return /* @__PURE__ */ jsxs11(DropdownContext.Provider, { value: () => change(false), children: [
|
|
2819
|
-
/* @__PURE__ */
|
|
2870
|
+
/* @__PURE__ */ jsx16(
|
|
2820
2871
|
"div",
|
|
2821
2872
|
{
|
|
2822
2873
|
ref,
|
|
@@ -2828,10 +2879,10 @@ function KjunDropdown({
|
|
|
2828
2879
|
change(true);
|
|
2829
2880
|
}
|
|
2830
2881
|
},
|
|
2831
|
-
children: /* @__PURE__ */
|
|
2882
|
+
children: /* @__PURE__ */ jsx16("span", { children: bindTrigger(trigger) })
|
|
2832
2883
|
}
|
|
2833
2884
|
),
|
|
2834
|
-
/* @__PURE__ */
|
|
2885
|
+
/* @__PURE__ */ jsx16(
|
|
2835
2886
|
FloatingPanel,
|
|
2836
2887
|
{
|
|
2837
2888
|
open,
|
|
@@ -2839,7 +2890,7 @@ function KjunDropdown({
|
|
|
2839
2890
|
triggerRef: ref,
|
|
2840
2891
|
placement,
|
|
2841
2892
|
className: "kjun-dropdown",
|
|
2842
|
-
children: /* @__PURE__ */
|
|
2893
|
+
children: /* @__PURE__ */ jsx16(
|
|
2843
2894
|
Menu,
|
|
2844
2895
|
{
|
|
2845
2896
|
ref: bindMenu,
|
|
@@ -2891,9 +2942,9 @@ function KjunDropdownItem({
|
|
|
2891
2942
|
close == null ? void 0 : close();
|
|
2892
2943
|
},
|
|
2893
2944
|
children: [
|
|
2894
|
-
icon && /* @__PURE__ */
|
|
2895
|
-
/* @__PURE__ */
|
|
2896
|
-
selected !== null && /* @__PURE__ */
|
|
2945
|
+
icon && /* @__PURE__ */ jsx16(KjunIcon, { name: icon, className: "kjun-menu-icon", size: tokens15.extensions.menu.iconSize }),
|
|
2946
|
+
/* @__PURE__ */ jsx16("span", { children }),
|
|
2947
|
+
selected !== null && /* @__PURE__ */ jsx16(
|
|
2897
2948
|
KjunIcon,
|
|
2898
2949
|
{
|
|
2899
2950
|
name: "check",
|
|
@@ -2907,7 +2958,7 @@ function KjunDropdownItem({
|
|
|
2907
2958
|
);
|
|
2908
2959
|
}
|
|
2909
2960
|
function KjunDropdownDivider() {
|
|
2910
|
-
return /* @__PURE__ */
|
|
2961
|
+
return /* @__PURE__ */ jsx16(Separator, { className: "kjun-menu-divider" });
|
|
2911
2962
|
}
|
|
2912
2963
|
function KjunMenuButton({
|
|
2913
2964
|
label,
|
|
@@ -2924,7 +2975,7 @@ function KjunMenuButton({
|
|
|
2924
2975
|
...props
|
|
2925
2976
|
}) {
|
|
2926
2977
|
const [open, setOpen] = useState11(false);
|
|
2927
|
-
const button = /* @__PURE__ */
|
|
2978
|
+
const button = /* @__PURE__ */ jsx16(
|
|
2928
2979
|
KjunButton,
|
|
2929
2980
|
{
|
|
2930
2981
|
className: "kjun-menu-button",
|
|
@@ -2938,7 +2989,7 @@ function KjunMenuButton({
|
|
|
2938
2989
|
children: compact ? void 0 : label
|
|
2939
2990
|
}
|
|
2940
2991
|
);
|
|
2941
|
-
return /* @__PURE__ */
|
|
2992
|
+
return /* @__PURE__ */ jsx16(
|
|
2942
2993
|
KjunDropdown,
|
|
2943
2994
|
{
|
|
2944
2995
|
...props,
|
|
@@ -2950,7 +3001,7 @@ function KjunMenuButton({
|
|
|
2950
3001
|
setOpen(false);
|
|
2951
3002
|
onClose == null ? void 0 : onClose();
|
|
2952
3003
|
},
|
|
2953
|
-
trigger: tooltip ? /* @__PURE__ */
|
|
3004
|
+
trigger: tooltip ? /* @__PURE__ */ jsx16(
|
|
2954
3005
|
KjunTooltip,
|
|
2955
3006
|
{
|
|
2956
3007
|
content: open ? "" : tooltip,
|
|
@@ -2977,7 +3028,7 @@ function drawerOverlayVars({ safeAreaTop = 0, safeAreaBottom = 0, maxHeight }) {
|
|
|
2977
3028
|
|
|
2978
3029
|
// packages/react/src/drawer.tsx
|
|
2979
3030
|
import { Dialog as Dialog3, Modal as Modal2, ModalOverlay as ModalOverlay2 } from "react-aria-components";
|
|
2980
|
-
import { jsx as
|
|
3031
|
+
import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2981
3032
|
function KjunDrawer({
|
|
2982
3033
|
open,
|
|
2983
3034
|
onOpenChange,
|
|
@@ -3008,7 +3059,7 @@ function KjunDrawer({
|
|
|
3008
3059
|
if (closeOnEsc) close();
|
|
3009
3060
|
});
|
|
3010
3061
|
if (container === null) return null;
|
|
3011
|
-
return /* @__PURE__ */
|
|
3062
|
+
return /* @__PURE__ */ jsx17(LayerScope.Provider, { value: layer.id, children: /* @__PURE__ */ jsx17(
|
|
3012
3063
|
ModalOverlay2,
|
|
3013
3064
|
{
|
|
3014
3065
|
style: { zIndex: layer.zIndex, ...drawerOverlayVars({ safeAreaTop, safeAreaBottom, maxHeight }) },
|
|
@@ -3025,7 +3076,7 @@ function KjunDrawer({
|
|
|
3025
3076
|
"data-motion-open": String(motion.active),
|
|
3026
3077
|
inert: !open || !layer.active,
|
|
3027
3078
|
"data-position": position,
|
|
3028
|
-
children: /* @__PURE__ */
|
|
3079
|
+
children: /* @__PURE__ */ jsx17(
|
|
3029
3080
|
Modal2,
|
|
3030
3081
|
{
|
|
3031
3082
|
className: "kjun-drawer",
|
|
@@ -3044,8 +3095,8 @@ function KjunDrawer({
|
|
|
3044
3095
|
},
|
|
3045
3096
|
children: [
|
|
3046
3097
|
(title || header || closable) && /* @__PURE__ */ jsxs12("div", { className: "kjun-drawer-header", children: [
|
|
3047
|
-
/* @__PURE__ */
|
|
3048
|
-
closable && /* @__PURE__ */
|
|
3098
|
+
/* @__PURE__ */ jsx17("div", { children: header || /* @__PURE__ */ jsx17("h2", { children: title }) }),
|
|
3099
|
+
closable && /* @__PURE__ */ jsx17(
|
|
3049
3100
|
KjunButton,
|
|
3050
3101
|
{
|
|
3051
3102
|
size: "sm",
|
|
@@ -3053,11 +3104,11 @@ function KjunDrawer({
|
|
|
3053
3104
|
ariaLabel: "\uB2EB\uAE30",
|
|
3054
3105
|
onClick: close,
|
|
3055
3106
|
style: { borderRadius: tokens16.extensions.drawer.closeRadius, width: tokens16.extensions.drawer.closeSize, height: tokens16.extensions.drawer.closeSize, padding: 0 },
|
|
3056
|
-
children: /* @__PURE__ */
|
|
3107
|
+
children: /* @__PURE__ */ jsx17(KjunIcon, { name: "x", size: tokens16.extensions.drawer.closeIconSize })
|
|
3057
3108
|
}
|
|
3058
3109
|
)
|
|
3059
3110
|
] }),
|
|
3060
|
-
/* @__PURE__ */
|
|
3111
|
+
/* @__PURE__ */ jsx17(
|
|
3061
3112
|
"div",
|
|
3062
3113
|
{
|
|
3063
3114
|
className: "kjun-drawer-body",
|
|
@@ -3065,8 +3116,8 @@ function KjunDrawer({
|
|
|
3065
3116
|
children
|
|
3066
3117
|
}
|
|
3067
3118
|
),
|
|
3068
|
-
footer && /* @__PURE__ */
|
|
3069
|
-
/* @__PURE__ */
|
|
3119
|
+
footer && /* @__PURE__ */ jsx17("div", { className: "kjun-drawer-footer", children: footer }),
|
|
3120
|
+
/* @__PURE__ */ jsx17(FeedbackLayerOutlet, {})
|
|
3070
3121
|
]
|
|
3071
3122
|
}
|
|
3072
3123
|
)
|
|
@@ -3196,7 +3247,7 @@ import {
|
|
|
3196
3247
|
useRef as useRef16,
|
|
3197
3248
|
useState as useState13
|
|
3198
3249
|
} from "react";
|
|
3199
|
-
import { Fragment as Fragment4, jsx as
|
|
3250
|
+
import { Fragment as Fragment4, jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3200
3251
|
function KjunCombobox({
|
|
3201
3252
|
value,
|
|
3202
3253
|
options = [],
|
|
@@ -3228,7 +3279,7 @@ function KjunCombobox({
|
|
|
3228
3279
|
onSearch,
|
|
3229
3280
|
onClear
|
|
3230
3281
|
});
|
|
3231
|
-
return /* @__PURE__ */
|
|
3282
|
+
return /* @__PURE__ */ jsx18(
|
|
3232
3283
|
SearchField,
|
|
3233
3284
|
{
|
|
3234
3285
|
error,
|
|
@@ -3302,7 +3353,7 @@ function SearchField({
|
|
|
3302
3353
|
(_a = ref.current) == null ? void 0 : _a.focus();
|
|
3303
3354
|
};
|
|
3304
3355
|
return /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
3305
|
-
/* @__PURE__ */
|
|
3356
|
+
/* @__PURE__ */ jsx18(
|
|
3306
3357
|
KjunInput,
|
|
3307
3358
|
{
|
|
3308
3359
|
error,
|
|
@@ -3377,7 +3428,7 @@ function SearchField({
|
|
|
3377
3428
|
}
|
|
3378
3429
|
}
|
|
3379
3430
|
),
|
|
3380
|
-
/* @__PURE__ */
|
|
3431
|
+
/* @__PURE__ */ jsx18(
|
|
3381
3432
|
FloatingPanel,
|
|
3382
3433
|
{
|
|
3383
3434
|
field: true,
|
|
@@ -3388,14 +3439,14 @@ function SearchField({
|
|
|
3388
3439
|
placement: "bottom-start",
|
|
3389
3440
|
matchTriggerWidth: true,
|
|
3390
3441
|
className: "kjun-select-panel",
|
|
3391
|
-
children: /* @__PURE__ */
|
|
3442
|
+
children: /* @__PURE__ */ jsx18(
|
|
3392
3443
|
"div",
|
|
3393
3444
|
{
|
|
3394
3445
|
id,
|
|
3395
3446
|
role: "listbox",
|
|
3396
3447
|
"aria-label": ariaLabel || placeholder,
|
|
3397
3448
|
onMouseDown: (e) => e.preventDefault(),
|
|
3398
|
-
children: loading ? /* @__PURE__ */
|
|
3449
|
+
children: loading ? /* @__PURE__ */ jsx18("div", { className: "kjun-select-empty", children: /* @__PURE__ */ jsx18(KjunSpinner, { size: "sm", text: "\uAC80\uC0C9 \uC911..." }) }) : failed ? /* @__PURE__ */ jsx18("div", { className: "kjun-select-empty", role: "alert", children: errorText }) : options.length ? options.map((o, i) => /* @__PURE__ */ jsx18(
|
|
3399
3450
|
"div",
|
|
3400
3451
|
{
|
|
3401
3452
|
id: id + "-" + i,
|
|
@@ -3413,7 +3464,7 @@ function SearchField({
|
|
|
3413
3464
|
children: (renderOption == null ? void 0 : renderOption(o)) || optionLabel(o, labelKey)
|
|
3414
3465
|
},
|
|
3415
3466
|
optionKey(o, itemKey, i)
|
|
3416
|
-
)) : /* @__PURE__ */
|
|
3467
|
+
)) : /* @__PURE__ */ jsx18("div", { className: "kjun-select-empty", children: emptyText })
|
|
3417
3468
|
}
|
|
3418
3469
|
)
|
|
3419
3470
|
}
|
|
@@ -3426,7 +3477,7 @@ import { tokens as tokens17 } from "@kjun-ui/tokens";
|
|
|
3426
3477
|
import {
|
|
3427
3478
|
useState as useState14
|
|
3428
3479
|
} from "react";
|
|
3429
|
-
import { jsx as
|
|
3480
|
+
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3430
3481
|
function KjunDatePicker({
|
|
3431
3482
|
value,
|
|
3432
3483
|
size = "md",
|
|
@@ -3447,7 +3498,7 @@ function KjunDatePicker({
|
|
|
3447
3498
|
["--_kjun-date-icon-inset"]: tokens17.input[size].padding + "px",
|
|
3448
3499
|
["--_kjun-date-icon-size"]: tokens17.input[size].iconSize + "px"
|
|
3449
3500
|
}, children: [
|
|
3450
|
-
/* @__PURE__ */
|
|
3501
|
+
/* @__PURE__ */ jsx19(
|
|
3451
3502
|
KjunInput,
|
|
3452
3503
|
{
|
|
3453
3504
|
...props,
|
|
@@ -3469,7 +3520,7 @@ function KjunDatePicker({
|
|
|
3469
3520
|
}
|
|
3470
3521
|
}
|
|
3471
3522
|
),
|
|
3472
|
-
!focus && /* @__PURE__ */
|
|
3523
|
+
!focus && /* @__PURE__ */ jsx19(
|
|
3473
3524
|
"span",
|
|
3474
3525
|
{
|
|
3475
3526
|
"aria-hidden": "true",
|
|
@@ -3578,7 +3629,7 @@ function useSearchInputModel({
|
|
|
3578
3629
|
}
|
|
3579
3630
|
|
|
3580
3631
|
// packages/react/src/search-input.tsx
|
|
3581
|
-
import { jsx as
|
|
3632
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
3582
3633
|
function KjunSearchInput({
|
|
3583
3634
|
value,
|
|
3584
3635
|
placeholder = "\uAC80\uC0C9...",
|
|
@@ -3614,7 +3665,7 @@ function KjunSearchInput({
|
|
|
3614
3665
|
onClear == null ? void 0 : onClear();
|
|
3615
3666
|
};
|
|
3616
3667
|
if (!loadOptions)
|
|
3617
|
-
return /* @__PURE__ */
|
|
3668
|
+
return /* @__PURE__ */ jsx20(
|
|
3618
3669
|
KjunInput,
|
|
3619
3670
|
{
|
|
3620
3671
|
error,
|
|
@@ -3630,7 +3681,7 @@ function KjunSearchInput({
|
|
|
3630
3681
|
onEnter
|
|
3631
3682
|
}
|
|
3632
3683
|
);
|
|
3633
|
-
return /* @__PURE__ */
|
|
3684
|
+
return /* @__PURE__ */ jsx20(
|
|
3634
3685
|
SearchField,
|
|
3635
3686
|
{
|
|
3636
3687
|
error,
|
|
@@ -3711,7 +3762,7 @@ import { createContext as createContext11 } from "react";
|
|
|
3711
3762
|
var CompoundControlContext = createContext11(null);
|
|
3712
3763
|
|
|
3713
3764
|
// packages/react/src/select-control.tsx
|
|
3714
|
-
import { Fragment as Fragment5, jsx as
|
|
3765
|
+
import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3715
3766
|
function KjunSelect({
|
|
3716
3767
|
value,
|
|
3717
3768
|
options = [],
|
|
@@ -3809,12 +3860,12 @@ function KjunSelect({
|
|
|
3809
3860
|
}
|
|
3810
3861
|
},
|
|
3811
3862
|
children: [
|
|
3812
|
-
/* @__PURE__ */
|
|
3813
|
-
/* @__PURE__ */
|
|
3863
|
+
/* @__PURE__ */ jsx21("span", { className: !label ? "kjun-placeholder" : void 0, style: { flex: 1, paddingRight: clearable && label ? spec.clearSize + spec.affixGap : void 0 }, children: (renderSelected == null ? void 0 : renderSelected(selectedOption)) || label || placeholder }),
|
|
3864
|
+
/* @__PURE__ */ jsx21(KjunIcon, { name: "chevron-down", className: "kjun-select-indicator", "data-open": expanded || void 0, size: segment ? tokens18.extensions.timePicker.iconSize : spec.iconSize, style: { flexShrink: 0, color: disabled ? "var(--_kjun-color-text-disabled)" : "var(--_kjun-color-text-tertiary)" } })
|
|
3814
3865
|
]
|
|
3815
3866
|
}
|
|
3816
3867
|
),
|
|
3817
|
-
clearable && !!label && /* @__PURE__ */
|
|
3868
|
+
clearable && !!label && /* @__PURE__ */ jsx21(
|
|
3818
3869
|
KjunButton,
|
|
3819
3870
|
{
|
|
3820
3871
|
size: "sm",
|
|
@@ -3836,11 +3887,11 @@ function KjunSelect({
|
|
|
3836
3887
|
onClear == null ? void 0 : onClear();
|
|
3837
3888
|
(_a = ref.current) == null ? void 0 : _a.focus();
|
|
3838
3889
|
},
|
|
3839
|
-
children: /* @__PURE__ */
|
|
3890
|
+
children: /* @__PURE__ */ jsx21(KjunIcon, { name: "x", size: spec.iconSize })
|
|
3840
3891
|
}
|
|
3841
3892
|
)
|
|
3842
3893
|
] }),
|
|
3843
|
-
/* @__PURE__ */
|
|
3894
|
+
/* @__PURE__ */ jsx21(
|
|
3844
3895
|
FloatingPanel,
|
|
3845
3896
|
{
|
|
3846
3897
|
field: true,
|
|
@@ -3850,9 +3901,9 @@ function KjunSelect({
|
|
|
3850
3901
|
placement: "bottom-start",
|
|
3851
3902
|
matchTriggerWidth: true,
|
|
3852
3903
|
className: "kjun-select-panel kjun-select-options-panel",
|
|
3853
|
-
children: /* @__PURE__ */
|
|
3854
|
-
menuHeader && /* @__PURE__ */
|
|
3855
|
-
searchable && /* @__PURE__ */
|
|
3904
|
+
children: /* @__PURE__ */ jsx21(FieldContext.Provider, { value: null, children: /* @__PURE__ */ jsxs15("div", { ref: menu, className: "kjun-select-content", children: [
|
|
3905
|
+
menuHeader && /* @__PURE__ */ jsx21("div", { className: "kjun-select-header", children: menuHeader }),
|
|
3906
|
+
searchable && /* @__PURE__ */ jsx21("div", { className: "kjun-select-search", children: /* @__PURE__ */ jsx21(
|
|
3856
3907
|
KjunInput,
|
|
3857
3908
|
{
|
|
3858
3909
|
autoFocus: true,
|
|
@@ -3883,8 +3934,8 @@ function KjunSelect({
|
|
|
3883
3934
|
}
|
|
3884
3935
|
}
|
|
3885
3936
|
) }),
|
|
3886
|
-
loading && /* @__PURE__ */
|
|
3887
|
-
/* @__PURE__ */
|
|
3937
|
+
loading && /* @__PURE__ */ jsx21("div", { className: "kjun-select-empty", children: /* @__PURE__ */ jsx21(KjunSpinner, { size: "sm", text: "\uAC80\uC0C9 \uC911..." }) }),
|
|
3938
|
+
/* @__PURE__ */ jsx21(
|
|
3888
3939
|
ListBox,
|
|
3889
3940
|
{
|
|
3890
3941
|
id,
|
|
@@ -3913,8 +3964,8 @@ function KjunSelect({
|
|
|
3913
3964
|
textValue: optionLabel(o, labelKey),
|
|
3914
3965
|
className: "kjun-option",
|
|
3915
3966
|
children: [
|
|
3916
|
-
(renderOption == null ? void 0 : renderOption(o, selected(o))) || /* @__PURE__ */
|
|
3917
|
-
selected(o) && /* @__PURE__ */
|
|
3967
|
+
(renderOption == null ? void 0 : renderOption(o, selected(o))) || /* @__PURE__ */ jsx21("span", { children: optionLabel(o, labelKey) }),
|
|
3968
|
+
selected(o) && /* @__PURE__ */ jsx21(KjunIcon, { name: "check", size: tokens18.extensions.menu.iconSize })
|
|
3918
3969
|
]
|
|
3919
3970
|
},
|
|
3920
3971
|
key
|
|
@@ -3922,8 +3973,8 @@ function KjunSelect({
|
|
|
3922
3973
|
},
|
|
3923
3974
|
session
|
|
3924
3975
|
),
|
|
3925
|
-
!loading && !matching.length && /* @__PURE__ */
|
|
3926
|
-
!loading && visible.length < matching.length && /* @__PURE__ */
|
|
3976
|
+
!loading && !matching.length && /* @__PURE__ */ jsx21("div", { className: "kjun-select-empty", children: "\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4" }),
|
|
3977
|
+
!loading && visible.length < matching.length && /* @__PURE__ */ jsx21(
|
|
3927
3978
|
KjunButton,
|
|
3928
3979
|
{
|
|
3929
3980
|
size: "sm",
|
|
@@ -3945,7 +3996,7 @@ import { tokens as tokens20 } from "@kjun-ui/tokens";
|
|
|
3945
3996
|
// packages/react/src/collapse.tsx
|
|
3946
3997
|
import { tokens as tokens19 } from "@kjun-ui/tokens";
|
|
3947
3998
|
import { useLayoutEffect as useLayoutEffect11, useRef as useRef20, useState as useState18 } from "react";
|
|
3948
|
-
import { jsx as
|
|
3999
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
3949
4000
|
function Collapse({ open, children }) {
|
|
3950
4001
|
const reduced = useReducedMotion();
|
|
3951
4002
|
const [retained, setRetained] = useState18(open);
|
|
@@ -4005,7 +4056,7 @@ function Collapse({ open, children }) {
|
|
|
4005
4056
|
}
|
|
4006
4057
|
};
|
|
4007
4058
|
}, [open, reduced, present]);
|
|
4008
|
-
return present ? /* @__PURE__ */
|
|
4059
|
+
return present ? /* @__PURE__ */ jsx22("div", { ref: root, className: "kjun-motion-collapse", inert: !open, "aria-hidden": !open || void 0, children: /* @__PURE__ */ jsx22("div", { ref: body, children }) }) : null;
|
|
4009
4060
|
}
|
|
4010
4061
|
|
|
4011
4062
|
// shared/package-runtime/navigation.ts
|
|
@@ -4121,7 +4172,7 @@ import {
|
|
|
4121
4172
|
useState as useState20
|
|
4122
4173
|
} from "react";
|
|
4123
4174
|
import { Tab, TabList, TabPanel, Tabs } from "react-aria-components";
|
|
4124
|
-
import { Fragment as Fragment7, jsx as
|
|
4175
|
+
import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4125
4176
|
function KjunTabs({
|
|
4126
4177
|
value,
|
|
4127
4178
|
items = [],
|
|
@@ -4181,7 +4232,7 @@ function KjunTabs({
|
|
|
4181
4232
|
children: [
|
|
4182
4233
|
/* @__PURE__ */ jsxs16("div", { className: "kjun-tabs-header", children: [
|
|
4183
4234
|
/* @__PURE__ */ jsxs16("div", { className: "kjun-tabs-track", ref: group, tabIndex: -1, children: [
|
|
4184
|
-
/* @__PURE__ */
|
|
4235
|
+
/* @__PURE__ */ jsx23(TabList, { "aria-label": ariaLabel, className: "kjun-tabs-list", children: tabs.map((tab) => /* @__PURE__ */ jsxs16(
|
|
4185
4236
|
Tab,
|
|
4186
4237
|
{
|
|
4187
4238
|
id: tab.name,
|
|
@@ -4221,10 +4272,10 @@ function KjunTabs({
|
|
|
4221
4272
|
onTouchEnd: clear,
|
|
4222
4273
|
onTouchCancel: clear,
|
|
4223
4274
|
children: [
|
|
4224
|
-
tab.icon && /* @__PURE__ */
|
|
4275
|
+
tab.icon && /* @__PURE__ */ jsx23(KjunIcon, { name: tab.icon, size: tokens20.extensions.tabs.iconSize }),
|
|
4225
4276
|
" ",
|
|
4226
|
-
/* @__PURE__ */
|
|
4227
|
-
tab.badge != null && /* @__PURE__ */
|
|
4277
|
+
/* @__PURE__ */ jsx23("span", { className: "kjun-motion-label", "data-label": tab.label, children: /* @__PURE__ */ jsx23("span", { children: tab.label }) }),
|
|
4278
|
+
tab.badge != null && /* @__PURE__ */ jsx23(
|
|
4228
4279
|
"span",
|
|
4229
4280
|
{
|
|
4230
4281
|
className: "kjun-tab-badge",
|
|
@@ -4238,17 +4289,17 @@ function KjunTabs({
|
|
|
4238
4289
|
},
|
|
4239
4290
|
tab.name
|
|
4240
4291
|
)) }),
|
|
4241
|
-
/* @__PURE__ */
|
|
4292
|
+
/* @__PURE__ */ jsx23("span", { ref: indicator, className: "kjun-tab-indicator", "aria-hidden": "true", hidden: true })
|
|
4242
4293
|
] }),
|
|
4243
4294
|
actions
|
|
4244
4295
|
] }),
|
|
4245
|
-
children && /* @__PURE__ */
|
|
4296
|
+
children && /* @__PURE__ */ jsx23("div", { className: "kjun-tab-content", children })
|
|
4246
4297
|
]
|
|
4247
4298
|
}
|
|
4248
4299
|
);
|
|
4249
4300
|
}
|
|
4250
4301
|
function KjunTabPane({ name, children }) {
|
|
4251
|
-
return /* @__PURE__ */
|
|
4302
|
+
return /* @__PURE__ */ jsx23(
|
|
4252
4303
|
TabPanel,
|
|
4253
4304
|
{
|
|
4254
4305
|
id: name,
|
|
@@ -4266,11 +4317,11 @@ function KjunAccordion({
|
|
|
4266
4317
|
children
|
|
4267
4318
|
}) {
|
|
4268
4319
|
const state = useAccordionState(multiple);
|
|
4269
|
-
return /* @__PURE__ */
|
|
4320
|
+
return /* @__PURE__ */ jsx23(
|
|
4270
4321
|
AccordionContext.Provider,
|
|
4271
4322
|
{
|
|
4272
4323
|
value: state,
|
|
4273
|
-
children: /* @__PURE__ */
|
|
4324
|
+
children: /* @__PURE__ */ jsx23("div", { className: "kjun-accordion", "data-tone": tone, children })
|
|
4274
4325
|
}
|
|
4275
4326
|
);
|
|
4276
4327
|
}
|
|
@@ -4297,8 +4348,8 @@ function KjunAccordionItem({
|
|
|
4297
4348
|
className: "kjun-accordion-trigger",
|
|
4298
4349
|
onClick: () => group ? group.toggle(id) : setOwn(!own),
|
|
4299
4350
|
children: [
|
|
4300
|
-
/* @__PURE__ */
|
|
4301
|
-
/* @__PURE__ */
|
|
4351
|
+
/* @__PURE__ */ jsx23("span", { className: "kjun-accordion-heading", children: header || title }),
|
|
4352
|
+
/* @__PURE__ */ jsx23(
|
|
4302
4353
|
KjunIcon,
|
|
4303
4354
|
{
|
|
4304
4355
|
name: "chevron-down",
|
|
@@ -4310,7 +4361,7 @@ function KjunAccordionItem({
|
|
|
4310
4361
|
]
|
|
4311
4362
|
}
|
|
4312
4363
|
),
|
|
4313
|
-
/* @__PURE__ */
|
|
4364
|
+
/* @__PURE__ */ jsx23(Collapse, { open, children: /* @__PURE__ */ jsx23(
|
|
4314
4365
|
"div",
|
|
4315
4366
|
{
|
|
4316
4367
|
role: "region",
|
|
@@ -4327,16 +4378,16 @@ function KjunBreadcrumb({
|
|
|
4327
4378
|
renderLink,
|
|
4328
4379
|
ariaLabel = "\uD604\uC7AC \uC704\uCE58"
|
|
4329
4380
|
}) {
|
|
4330
|
-
return /* @__PURE__ */
|
|
4381
|
+
return /* @__PURE__ */ jsx23("nav", { "aria-label": ariaLabel, className: "kjun-breadcrumb", children: items.map((item, i) => {
|
|
4331
4382
|
const label = /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
4332
|
-
item.icon && /* @__PURE__ */
|
|
4383
|
+
item.icon && /* @__PURE__ */ jsx23(KjunIcon, { name: item.icon, size: tokens20.extensions.breadcrumb.iconSize }),
|
|
4333
4384
|
" ",
|
|
4334
4385
|
item.label
|
|
4335
4386
|
] });
|
|
4336
4387
|
return /* @__PURE__ */ jsxs16(Fragment6, { children: [
|
|
4337
|
-
i > 0 && /* @__PURE__ */
|
|
4388
|
+
i > 0 && /* @__PURE__ */ jsx23(KjunIcon, { name: "chevron-right", size: tokens20.extensions.breadcrumb.separatorSize }),
|
|
4338
4389
|
" ",
|
|
4339
|
-
item.to && i < items.length - 1 ? (renderLink == null ? void 0 : renderLink(item, label)) || /* @__PURE__ */
|
|
4390
|
+
item.to && i < items.length - 1 ? (renderLink == null ? void 0 : renderLink(item, label)) || /* @__PURE__ */ jsx23("a", { href: item.to, children: label }) : /* @__PURE__ */ jsx23("span", { "aria-current": i === items.length - 1 ? "page" : void 0, children: label })
|
|
4340
4391
|
] }, i);
|
|
4341
4392
|
}) });
|
|
4342
4393
|
}
|
|
@@ -4373,14 +4424,14 @@ function KjunPagination({
|
|
|
4373
4424
|
).filter((v) => v >= 1 && v <= totalPages)
|
|
4374
4425
|
]);
|
|
4375
4426
|
const pages = [...visible].sort((a, b) => a - b).flatMap((v, i, all) => i && v - all[i - 1] > 1 ? ["...", v] : [v]);
|
|
4376
|
-
const button = (target, label, icon) => /* @__PURE__ */
|
|
4427
|
+
const button = (target, label, icon) => /* @__PURE__ */ jsx23(
|
|
4377
4428
|
"button",
|
|
4378
4429
|
{
|
|
4379
4430
|
type: "button",
|
|
4380
4431
|
"aria-label": label,
|
|
4381
4432
|
disabled: target < 1 || target > totalPages || target === current,
|
|
4382
4433
|
onClick: () => change(target),
|
|
4383
|
-
children: /* @__PURE__ */
|
|
4434
|
+
children: /* @__PURE__ */ jsx23(KjunIcon, { name: icon, size: tokens20.extensions.pagination.iconSize })
|
|
4384
4435
|
}
|
|
4385
4436
|
);
|
|
4386
4437
|
return /* @__PURE__ */ jsxs16("nav", { "aria-label": "\uD398\uC774\uC9C0 \uD0D0\uC0C9", className: "kjun-pagination", children: [
|
|
@@ -4392,9 +4443,9 @@ function KjunPagination({
|
|
|
4392
4443
|
" / ",
|
|
4393
4444
|
formatter(totalRows),
|
|
4394
4445
|
"\uAC1C"
|
|
4395
|
-
] }) : /* @__PURE__ */
|
|
4446
|
+
] }) : /* @__PURE__ */ jsx23("span", {}),
|
|
4396
4447
|
/* @__PURE__ */ jsxs16("div", { className: "kjun-pagination-controls", children: [
|
|
4397
|
-
showSizeSelector && /* @__PURE__ */
|
|
4448
|
+
showSizeSelector && /* @__PURE__ */ jsx23("div", { className: "kjun-pagination-size", children: /* @__PURE__ */ jsx23(
|
|
4398
4449
|
KjunSelect,
|
|
4399
4450
|
{
|
|
4400
4451
|
size: "sm",
|
|
@@ -4411,7 +4462,7 @@ function KjunPagination({
|
|
|
4411
4462
|
totalPages > 1 && /* @__PURE__ */ jsxs16("div", { className: "kjun-pagination-mobile", children: [
|
|
4412
4463
|
button(current - 1, "\uC774\uC804 \uD398\uC774\uC9C0", "chevron-left"),
|
|
4413
4464
|
/* @__PURE__ */ jsxs16("span", { children: [
|
|
4414
|
-
/* @__PURE__ */
|
|
4465
|
+
/* @__PURE__ */ jsx23("strong", { children: current }),
|
|
4415
4466
|
" / ",
|
|
4416
4467
|
totalPages
|
|
4417
4468
|
] }),
|
|
@@ -4421,7 +4472,7 @@ function KjunPagination({
|
|
|
4421
4472
|
showFirstLast && button(1, "\uCCAB \uD398\uC774\uC9C0", "chevrons-left"),
|
|
4422
4473
|
button(current - 1, "\uC774\uC804 \uD398\uC774\uC9C0", "chevron-left"),
|
|
4423
4474
|
pages.map(
|
|
4424
|
-
(n, i) => typeof n === "string" ? /* @__PURE__ */
|
|
4475
|
+
(n, i) => typeof n === "string" ? /* @__PURE__ */ jsx23("span", { children: "..." }, "dots" + i) : /* @__PURE__ */ jsx23(
|
|
4425
4476
|
"button",
|
|
4426
4477
|
{
|
|
4427
4478
|
type: "button",
|
|
@@ -4448,7 +4499,7 @@ import {
|
|
|
4448
4499
|
useRef as useRef23,
|
|
4449
4500
|
useState as useState21
|
|
4450
4501
|
} from "react";
|
|
4451
|
-
import { Fragment as Fragment8, jsx as
|
|
4502
|
+
import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4452
4503
|
function KjunIconToggle({
|
|
4453
4504
|
active = false,
|
|
4454
4505
|
activeIcon,
|
|
@@ -4468,7 +4519,7 @@ function KjunIconToggle({
|
|
|
4468
4519
|
}) {
|
|
4469
4520
|
var _a;
|
|
4470
4521
|
const navigation = useContext13(TopNavigationContext);
|
|
4471
|
-
return /* @__PURE__ */
|
|
4522
|
+
return /* @__PURE__ */ jsx24(KjunTooltip, { content: disabled || loading ? "" : tooltip != null ? tooltip : ariaLabel, placement: tooltipPlacement, delay: tooltipDelay, children: /* @__PURE__ */ jsx24(
|
|
4472
4523
|
"button",
|
|
4473
4524
|
{
|
|
4474
4525
|
type: "button",
|
|
@@ -4483,7 +4534,7 @@ function KjunIconToggle({
|
|
|
4483
4534
|
e.stopPropagation();
|
|
4484
4535
|
onToggle == null ? void 0 : onToggle();
|
|
4485
4536
|
},
|
|
4486
|
-
children: loading ? navigation ? /* @__PURE__ */
|
|
4537
|
+
children: loading ? navigation ? /* @__PURE__ */ jsx24(KjunIcon, { name: "loader-2", spin: true, size: navigation.iconSize }) : /* @__PURE__ */ jsx24(KjunSpinner, { size: "sm" }) : /* @__PURE__ */ jsx24(
|
|
4487
4538
|
KjunIcon,
|
|
4488
4539
|
{
|
|
4489
4540
|
name: active ? activeIcon : inactiveIcon || activeIcon,
|
|
@@ -4574,7 +4625,7 @@ function KjunCopyButton({
|
|
|
4574
4625
|
}
|
|
4575
4626
|
},
|
|
4576
4627
|
children: [
|
|
4577
|
-
/* @__PURE__ */
|
|
4628
|
+
/* @__PURE__ */ jsx24(
|
|
4578
4629
|
KjunIcon,
|
|
4579
4630
|
{
|
|
4580
4631
|
name: copied ? "check" : "copy",
|
|
@@ -4582,11 +4633,11 @@ function KjunCopyButton({
|
|
|
4582
4633
|
style: { color: copied ? "var(--_kjun-color-success)" : void 0 }
|
|
4583
4634
|
}
|
|
4584
4635
|
),
|
|
4585
|
-
text && !inline && /* @__PURE__ */
|
|
4636
|
+
text && !inline && /* @__PURE__ */ jsx24("span", { children: copied ? successText : text })
|
|
4586
4637
|
]
|
|
4587
4638
|
}
|
|
4588
4639
|
),
|
|
4589
|
-
/* @__PURE__ */
|
|
4640
|
+
/* @__PURE__ */ jsx24("span", { role: feedback ? void 0 : "status", "aria-hidden": feedback ? true : void 0, className: "kjun-sr-only", children: copied ? successText : failed ? "\uBCF5\uC0AC \uC2E4\uD328" : "" })
|
|
4590
4641
|
] });
|
|
4591
4642
|
}
|
|
4592
4643
|
function KjunRefreshButton({
|
|
@@ -4608,7 +4659,7 @@ function KjunRefreshButton({
|
|
|
4608
4659
|
const reduced = useReducedMotion();
|
|
4609
4660
|
const label = ariaLabel || [targetName, mode === "text" ? text : "\uC0C8\uB85C\uACE0\uCE68"].filter(Boolean).join(" ");
|
|
4610
4661
|
const hint = (_a = tooltip != null ? tooltip : title) != null ? _a : mode === "icon" ? label : "";
|
|
4611
|
-
return /* @__PURE__ */
|
|
4662
|
+
return /* @__PURE__ */ jsx24(KjunTooltip, { content: props.disabled || props.loading ? "" : hint, placement: tooltipPlacement, delay: tooltipDelay, children: /* @__PURE__ */ jsx24(
|
|
4612
4663
|
KjunButton,
|
|
4613
4664
|
{
|
|
4614
4665
|
...props,
|
|
@@ -4636,7 +4687,7 @@ function KjunExternalLink({
|
|
|
4636
4687
|
label,
|
|
4637
4688
|
children
|
|
4638
4689
|
}) {
|
|
4639
|
-
const url = safeExternalUrl(href), name = label || (mode === "icon" ? "\uC678\uBD80 \uB9C1\uD06C" : void 0), body = mode === "icon" ? /* @__PURE__ */
|
|
4690
|
+
const url = safeExternalUrl(href), name = label || (mode === "icon" ? "\uC678\uBD80 \uB9C1\uD06C" : void 0), body = mode === "icon" ? /* @__PURE__ */ jsx24(KjunIcon, { name: "external-link" }) : children;
|
|
4640
4691
|
return url ? /* @__PURE__ */ jsxs17(
|
|
4641
4692
|
"a",
|
|
4642
4693
|
{
|
|
@@ -4649,11 +4700,11 @@ function KjunExternalLink({
|
|
|
4649
4700
|
onClick: (e) => e.stopPropagation(),
|
|
4650
4701
|
children: [
|
|
4651
4702
|
body,
|
|
4652
|
-
mode === "text" && /* @__PURE__ */
|
|
4653
|
-
!name && /* @__PURE__ */
|
|
4703
|
+
mode === "text" && /* @__PURE__ */ jsx24(KjunIcon, { name: "external-link", size: tokens21.iconSizes.small, className: "kjun-external-link-icon" }),
|
|
4704
|
+
!name && /* @__PURE__ */ jsx24("span", { className: "kjun-sr-only", children: " (\uC0C8 \uCC3D)" })
|
|
4654
4705
|
]
|
|
4655
4706
|
}
|
|
4656
|
-
) : /* @__PURE__ */
|
|
4707
|
+
) : /* @__PURE__ */ jsx24("span", { "aria-label": name, children: body });
|
|
4657
4708
|
}
|
|
4658
4709
|
function KjunScrollFade({ children }) {
|
|
4659
4710
|
const ref = useRef23(null), [edges, setEdges] = useState21({ left: false, right: false });
|
|
@@ -4678,7 +4729,7 @@ function KjunScrollFade({ children }) {
|
|
|
4678
4729
|
return () => observer.disconnect();
|
|
4679
4730
|
}, [children]);
|
|
4680
4731
|
const mask = edges.left || edges.right ? `linear-gradient(to right, ${edges.left ? `transparent, currentColor ${tokens21.extensions.scrollFade.width}px` : "currentColor"}, ${edges.right ? `currentColor calc(100% - ${tokens21.extensions.scrollFade.width}px), transparent` : "currentColor"})` : void 0;
|
|
4681
|
-
return /* @__PURE__ */
|
|
4732
|
+
return /* @__PURE__ */ jsx24(
|
|
4682
4733
|
"div",
|
|
4683
4734
|
{
|
|
4684
4735
|
ref,
|
|
@@ -4713,7 +4764,7 @@ function useLoadingReveal(active, delay = 0) {
|
|
|
4713
4764
|
}
|
|
4714
4765
|
|
|
4715
4766
|
// packages/react/src/data-state.tsx
|
|
4716
|
-
import { jsx as
|
|
4767
|
+
import { jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4717
4768
|
function useQueryDisplay(props) {
|
|
4718
4769
|
var _a;
|
|
4719
4770
|
const [state, setState] = useState23(() => initialQueryDisplay(props));
|
|
@@ -4751,11 +4802,11 @@ function KjunDataState({
|
|
|
4751
4802
|
}) {
|
|
4752
4803
|
const state = useQueryDisplay(query2), blockingError = query2.error && !(state.usesQueryState && state.hasCurrentResult), visibleRefreshError = refreshError || (state.usesQueryState && state.hasCurrentResult ? query2.error : null), concealed = state.initialLoading || !!blockingError || empty, padding = tokens22.extensions.state.padding[size], revealed = useLoadingReveal(state.initialLoading, loadingDelay);
|
|
4753
4804
|
return /* @__PURE__ */ jsxs18("div", { className: "kjun-data-state", "aria-busy": !!query2.loading || refreshing, children: [
|
|
4754
|
-
/* @__PURE__ */
|
|
4755
|
-
/* @__PURE__ */
|
|
4756
|
-
/* @__PURE__ */
|
|
4805
|
+
/* @__PURE__ */ jsx25("div", { className: "kjun-data-status-slot", children: (refreshing || state.queryRefreshing) && /* @__PURE__ */ jsxs18("div", { className: "kjun-data-status", role: "status", children: [
|
|
4806
|
+
/* @__PURE__ */ jsx25(KjunSpinner, { size: "xs" }),
|
|
4807
|
+
/* @__PURE__ */ jsx25("span", { children: refreshingText })
|
|
4757
4808
|
] }) }),
|
|
4758
|
-
state.initialLoading ? /* @__PURE__ */
|
|
4809
|
+
state.initialLoading ? /* @__PURE__ */ jsx25(
|
|
4759
4810
|
"div",
|
|
4760
4811
|
{
|
|
4761
4812
|
className: "kjun-data-loading-block",
|
|
@@ -4763,13 +4814,13 @@ function KjunDataState({
|
|
|
4763
4814
|
"aria-label": revealed ? loadingText : void 0,
|
|
4764
4815
|
"aria-hidden": revealed ? void 0 : true,
|
|
4765
4816
|
style: { paddingBlock: loadingPadding === "none" ? 0 : padding, visibility: revealed ? void 0 : "hidden" },
|
|
4766
|
-
children: loadingContent || (skeleton ? /* @__PURE__ */
|
|
4767
|
-
/* @__PURE__ */
|
|
4768
|
-
/* @__PURE__ */
|
|
4817
|
+
children: loadingContent || (skeleton ? /* @__PURE__ */ jsx25("div", { style: { display: "grid", gap: tokens22.dimension.value12 }, children: Array.from({ length: skeletonCount }, (_, i) => /* @__PURE__ */ jsx25(KjunSkeleton, { type: skeletonType }, i)) }) : /* @__PURE__ */ jsxs18("div", { className: "kjun-data-loading", children: [
|
|
4818
|
+
/* @__PURE__ */ jsx25(KjunSpinner, { size: "md" }),
|
|
4819
|
+
/* @__PURE__ */ jsx25("p", { children: loadingText })
|
|
4769
4820
|
] }))
|
|
4770
4821
|
}
|
|
4771
|
-
) : blockingError ? /* @__PURE__ */
|
|
4772
|
-
(!concealed || preserveContent && state.hasQueryResult) && /* @__PURE__ */
|
|
4822
|
+
) : blockingError ? /* @__PURE__ */ jsx25("div", { className: "kjun-data-error kjun-state-actions", style: { paddingBlock: padding }, children: errorContent || /* @__PURE__ */ jsx25(KjunAlert, { type: "danger", title: "\uC624\uB958 \uBC1C\uC0DD", actions: onRetry && /* @__PURE__ */ jsx25(KjunButton, { variant: "secondary", onClick: onRetry, children: retryText }), children: query2.error }) }) : empty ? /* @__PURE__ */ jsx25("div", { className: "kjun-data-empty kjun-state-actions", style: { paddingBlock: padding }, children: emptyContent || /* @__PURE__ */ jsx25(KjunEmpty, { text: emptyText, icon: emptyIcon, children: emptyActionText && /* @__PURE__ */ jsx25(KjunButton, { onClick: onEmptyAction, children: emptyActionText }) }) }) : null,
|
|
4823
|
+
(!concealed || preserveContent && state.hasQueryResult) && /* @__PURE__ */ jsx25(
|
|
4773
4824
|
"div",
|
|
4774
4825
|
{
|
|
4775
4826
|
className: "kjun-data-content" + (concealed ? " kjun-data-concealed" : ""),
|
|
@@ -4782,7 +4833,7 @@ function KjunDataState({
|
|
|
4782
4833
|
},
|
|
4783
4834
|
"content"
|
|
4784
4835
|
),
|
|
4785
|
-
visibleRefreshError && !state.initialLoading && /* @__PURE__ */
|
|
4836
|
+
visibleRefreshError && !state.initialLoading && /* @__PURE__ */ jsx25("div", { className: "kjun-data-warning kjun-state-actions", children: /* @__PURE__ */ jsxs18(KjunAlert, { type: "warning", size: "sm", actions: onRetry && /* @__PURE__ */ jsx25(KjunButton, { variant: "secondary", onClick: onRetry, children: retryText }), children: [
|
|
4786
4837
|
visibleRefreshError,
|
|
4787
4838
|
" \xB7 \uC774\uC804 \uC870\uD68C \uACB0\uACFC\uB97C \uD45C\uC2DC\uD558\uACE0 \uC788\uC2B5\uB2C8\uB2E4."
|
|
4788
4839
|
] }) })
|
|
@@ -4802,9 +4853,9 @@ var KjunErrorBoundary = class extends Component {
|
|
|
4802
4853
|
}
|
|
4803
4854
|
render() {
|
|
4804
4855
|
return this.state.error ? this.props.fallback || /* @__PURE__ */ jsxs18("div", { className: "kjun-error-fallback", children: [
|
|
4805
|
-
/* @__PURE__ */
|
|
4806
|
-
/* @__PURE__ */
|
|
4807
|
-
/* @__PURE__ */
|
|
4856
|
+
/* @__PURE__ */ jsx25("h3", { children: this.props.fallbackMessage || "\uBB38\uC81C\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4" }),
|
|
4857
|
+
/* @__PURE__ */ jsx25("p", { children: "\uB2E4\uC2DC \uC2DC\uB3C4\uD558\uBA74 \uBB38\uC81C\uAC00 \uD574\uACB0\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4." }),
|
|
4858
|
+
/* @__PURE__ */ jsx25(
|
|
4808
4859
|
KjunButton,
|
|
4809
4860
|
{
|
|
4810
4861
|
onClick: () => {
|
|
@@ -4866,37 +4917,37 @@ function webMarketLayout(columns, showActions, widthClass) {
|
|
|
4866
4917
|
}
|
|
4867
4918
|
|
|
4868
4919
|
// packages/react/src/market-layout.tsx
|
|
4869
|
-
import { jsx as
|
|
4920
|
+
import { jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4870
4921
|
function MarketColumns({ columns, showActions, widthClass }) {
|
|
4871
4922
|
const layout = webMarketLayout(columns, showActions, widthClass);
|
|
4872
4923
|
return /* @__PURE__ */ jsxs19("colgroup", { children: [
|
|
4873
|
-
showActions && /* @__PURE__ */
|
|
4874
|
-
layout.columns.map((column, index) => /* @__PURE__ */
|
|
4924
|
+
showActions && /* @__PURE__ */ jsx26("col", { style: { width: marketGeometry.actionsWidth } }),
|
|
4925
|
+
layout.columns.map((column, index) => /* @__PURE__ */ jsx26("col", { ...column }, columns[index].key || index))
|
|
4875
4926
|
] });
|
|
4876
4927
|
}
|
|
4877
4928
|
|
|
4878
4929
|
// packages/react/src/market-skeleton.tsx
|
|
4879
|
-
import { jsx as
|
|
4930
|
+
import { jsx as jsx27, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4880
4931
|
function KjunMarketTableSkeleton({ columns = [], rows = 8, showActions = false, alignClass, widthClass }) {
|
|
4881
4932
|
const cols = normalizeMarketColumns(columns);
|
|
4882
|
-
return /* @__PURE__ */
|
|
4883
|
-
/* @__PURE__ */
|
|
4884
|
-
/* @__PURE__ */
|
|
4885
|
-
showActions && /* @__PURE__ */
|
|
4886
|
-
cols.map((col, i) => /* @__PURE__ */
|
|
4933
|
+
return /* @__PURE__ */ jsx27("div", { "aria-hidden": "true", className: "kjun-table-scroll", children: /* @__PURE__ */ jsxs20("table", { className: "kjun-market-table-grid", style: webMarketLayout(cols, showActions, widthClass).tableStyle, children: [
|
|
4934
|
+
/* @__PURE__ */ jsx27(MarketColumns, { columns: cols, showActions, widthClass }),
|
|
4935
|
+
/* @__PURE__ */ jsx27("thead", { children: /* @__PURE__ */ jsxs20("tr", { children: [
|
|
4936
|
+
showActions && /* @__PURE__ */ jsx27("th", { className: "kjun-market-actions", children: /* @__PURE__ */ jsx27("span", { className: "kjun-market-skeleton-value", children: /* @__PURE__ */ jsx27(KjunSkeleton, { type: "block", width: tokens24.extensions.marketTable.actionSkeletonWidth, height: tokens24.extensions.marketTable.headerSkeletonHeight }) }) }),
|
|
4937
|
+
cols.map((col, i) => /* @__PURE__ */ jsx27("th", { className: alignClass == null ? void 0 : alignClass(col.align), style: { textAlign: col.align }, children: col.label }, col.key || i))
|
|
4887
4938
|
] }) }),
|
|
4888
|
-
/* @__PURE__ */
|
|
4889
|
-
showActions && /* @__PURE__ */
|
|
4890
|
-
cols.map((col, i) => /* @__PURE__ */
|
|
4891
|
-
/* @__PURE__ */
|
|
4892
|
-
/* @__PURE__ */
|
|
4893
|
-
] }) : /* @__PURE__ */
|
|
4939
|
+
/* @__PURE__ */ jsx27("tbody", { children: Array.from({ length: Math.max(0, rows) }, (_, row) => /* @__PURE__ */ jsxs20("tr", { children: [
|
|
4940
|
+
showActions && /* @__PURE__ */ jsx27("td", { className: "kjun-market-actions", children: /* @__PURE__ */ jsx27("span", { className: "kjun-market-skeleton-value", children: /* @__PURE__ */ jsx27(KjunSkeleton, { type: "block", width: tokens24.extensions.marketTable.actionSkeletonWidth, height: tokens24.extensions.financial.priceSkeletonHeight }) }) }),
|
|
4941
|
+
cols.map((col, i) => /* @__PURE__ */ jsx27("td", { className: alignClass == null ? void 0 : alignClass(col.align), style: { textAlign: col.align }, children: isMarketIdentity(col.key) ? /* @__PURE__ */ jsxs20("div", { className: "kjun-market-skeleton-identity", children: [
|
|
4942
|
+
/* @__PURE__ */ jsx27(KjunSkeleton, { type: "block", width: "80%", height: tokens24.extensions.skeleton.lineHeights.md }),
|
|
4943
|
+
/* @__PURE__ */ jsx27(KjunSkeleton, { type: "block", width: "60%", height: tokens24.extensions.skeleton.lineHeights.sm })
|
|
4944
|
+
] }) : /* @__PURE__ */ jsx27("span", { className: "kjun-market-skeleton-value", children: /* @__PURE__ */ jsx27(KjunSkeleton, { type: "block", width: tokens24.extensions.financial.priceSkeletonWidth, height: tokens24.extensions.financial.priceSkeletonHeight }) }) }, col.key || i))
|
|
4894
4945
|
] }, row)) })
|
|
4895
4946
|
] }) });
|
|
4896
4947
|
}
|
|
4897
4948
|
|
|
4898
4949
|
// packages/react/src/skeletons.tsx
|
|
4899
|
-
import { Fragment as Fragment9, jsx as
|
|
4950
|
+
import { Fragment as Fragment9, jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4900
4951
|
function KjunListSkeleton({
|
|
4901
4952
|
rows = 8,
|
|
4902
4953
|
variant = "market",
|
|
@@ -4904,10 +4955,10 @@ function KjunListSkeleton({
|
|
|
4904
4955
|
avatarSize = tokens25.extensions.skeleton.listAvatarSize,
|
|
4905
4956
|
quote = true
|
|
4906
4957
|
}) {
|
|
4907
|
-
return /* @__PURE__ */
|
|
4908
|
-
avatar && /* @__PURE__ */
|
|
4958
|
+
return /* @__PURE__ */ jsx28("div", { "aria-hidden": "true", children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsxs21("div", { className: "kjun-list-skeleton-row", "data-variant": variant, children: [
|
|
4959
|
+
avatar && /* @__PURE__ */ jsx28(KjunSkeleton, { type: "avatar", width: avatarSize, height: avatarSize }),
|
|
4909
4960
|
/* @__PURE__ */ jsxs21("div", { className: "kjun-list-skeleton-label", children: [
|
|
4910
|
-
/* @__PURE__ */
|
|
4961
|
+
/* @__PURE__ */ jsx28(
|
|
4911
4962
|
KjunSkeleton,
|
|
4912
4963
|
{
|
|
4913
4964
|
type: "block",
|
|
@@ -4915,11 +4966,11 @@ function KjunListSkeleton({
|
|
|
4915
4966
|
width: i % 2 ? "80%" : "65%"
|
|
4916
4967
|
}
|
|
4917
4968
|
),
|
|
4918
|
-
/* @__PURE__ */
|
|
4969
|
+
/* @__PURE__ */ jsx28(KjunSkeleton, { type: "block", height: tokens25.extensions.skeleton.lineHeights.sm, width: "50%" })
|
|
4919
4970
|
] }),
|
|
4920
4971
|
quote && /* @__PURE__ */ jsxs21("div", { className: "kjun-list-skeleton-quote", children: [
|
|
4921
|
-
/* @__PURE__ */
|
|
4922
|
-
/* @__PURE__ */
|
|
4972
|
+
/* @__PURE__ */ jsx28(KjunSkeleton, { type: "block", height: tokens25.extensions.skeleton.quoteHeight, width: tokens25.extensions.skeleton.quoteWidth }),
|
|
4973
|
+
/* @__PURE__ */ jsx28(KjunSkeleton, { type: "block", height: tokens25.extensions.skeleton.lineHeights.sm, width: tokens25.extensions.skeleton.detailWidth })
|
|
4923
4974
|
] })
|
|
4924
4975
|
] }, i)) });
|
|
4925
4976
|
}
|
|
@@ -4929,7 +4980,7 @@ function KjunFormSkeleton({
|
|
|
4929
4980
|
multiline = false,
|
|
4930
4981
|
size = "md"
|
|
4931
4982
|
}) {
|
|
4932
|
-
return /* @__PURE__ */
|
|
4983
|
+
return /* @__PURE__ */ jsx28(
|
|
4933
4984
|
"div",
|
|
4934
4985
|
{
|
|
4935
4986
|
"aria-hidden": "true",
|
|
@@ -4937,11 +4988,11 @@ function KjunFormSkeleton({
|
|
|
4937
4988
|
"data-columns": columns,
|
|
4938
4989
|
style: { "--_kjun-form-skeleton-radius": `${tokens25.input[size].radius}px` },
|
|
4939
4990
|
children: fields.map((field, i) => /* @__PURE__ */ jsxs21("div", { children: [
|
|
4940
|
-
field ? /* @__PURE__ */
|
|
4991
|
+
field ? /* @__PURE__ */ jsx28("div", { className: "kjun-form-skeleton-label", children: typeof field === "string" ? field : field.label }) : (
|
|
4941
4992
|
// The bar sits in a label-line slot so the field starts where the real input will.
|
|
4942
|
-
/* @__PURE__ */
|
|
4993
|
+
/* @__PURE__ */ jsx28("div", { className: "kjun-form-skeleton-label-slot", children: /* @__PURE__ */ jsx28(KjunSkeleton, { type: "block", height: tokens25.extensions.skeleton.formLabelHeight, width: tokens25.extensions.skeleton.formLabelWidth }) })
|
|
4943
4994
|
),
|
|
4944
|
-
/* @__PURE__ */
|
|
4995
|
+
/* @__PURE__ */ jsx28(
|
|
4945
4996
|
KjunSkeleton,
|
|
4946
4997
|
{
|
|
4947
4998
|
type: "block",
|
|
@@ -4962,7 +5013,7 @@ function KjunChartSkeleton({
|
|
|
4962
5013
|
columns = 14
|
|
4963
5014
|
}) {
|
|
4964
5015
|
const kind = chartSkeletonKind(requestedKind), revealed = useLoadingReveal(true, loadingDelay), status = revealed && loadingText ? "status" : void 0, rowCount = chartSkeletonCount(rows), columnCount = chartSkeletonCount(columns);
|
|
4965
|
-
return /* @__PURE__ */
|
|
5016
|
+
return /* @__PURE__ */ jsx28(
|
|
4966
5017
|
"div",
|
|
4967
5018
|
{
|
|
4968
5019
|
className: "kjun-chart-skeleton",
|
|
@@ -4971,10 +5022,10 @@ function KjunChartSkeleton({
|
|
|
4971
5022
|
"aria-hidden": revealed ? void 0 : true,
|
|
4972
5023
|
style: { height, visibility: revealed ? void 0 : "hidden" },
|
|
4973
5024
|
children: !skeleton ? /* @__PURE__ */ jsxs21("div", { className: "kjun-data-loading", "data-kjun-chart-part": "loading", role: status, children: [
|
|
4974
|
-
/* @__PURE__ */
|
|
4975
|
-
loadingText && /* @__PURE__ */
|
|
5025
|
+
/* @__PURE__ */ jsx28("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx28(KjunSpinner, { size: "md" }) }),
|
|
5026
|
+
loadingText && /* @__PURE__ */ jsx28("p", { children: loadingText })
|
|
4976
5027
|
] }) : /* @__PURE__ */ jsxs21(Fragment9, { children: [
|
|
4977
|
-
kind === "donut" ? /* @__PURE__ */
|
|
5028
|
+
kind === "donut" ? /* @__PURE__ */ jsx28("div", { className: "kjun-chart-skeleton-donut", "data-kjun-chart-part": "donut", "aria-hidden": "true" }) : kind === "matrix" ? /* @__PURE__ */ jsx28(
|
|
4978
5029
|
"div",
|
|
4979
5030
|
{
|
|
4980
5031
|
className: "kjun-chart-skeleton-matrix",
|
|
@@ -4984,7 +5035,7 @@ function KjunChartSkeleton({
|
|
|
4984
5035
|
gridTemplateColumns: `repeat(${columnCount}, minmax(0, 1fr))`,
|
|
4985
5036
|
gridTemplateRows: `repeat(${rowCount}, minmax(0, 1fr))`
|
|
4986
5037
|
},
|
|
4987
|
-
children: Array.from({ length: rowCount * columnCount }, (_, i) => /* @__PURE__ */
|
|
5038
|
+
children: Array.from({ length: rowCount * columnCount }, (_, i) => /* @__PURE__ */ jsx28(
|
|
4988
5039
|
"div",
|
|
4989
5040
|
{
|
|
4990
5041
|
className: "kjun-chart-skeleton-cell",
|
|
@@ -4994,7 +5045,7 @@ function KjunChartSkeleton({
|
|
|
4994
5045
|
i
|
|
4995
5046
|
))
|
|
4996
5047
|
}
|
|
4997
|
-
) : /* @__PURE__ */
|
|
5048
|
+
) : /* @__PURE__ */ jsx28(
|
|
4998
5049
|
"svg",
|
|
4999
5050
|
{
|
|
5000
5051
|
viewBox: chartFrameViewBox,
|
|
@@ -5002,7 +5053,7 @@ function KjunChartSkeleton({
|
|
|
5002
5053
|
className: "kjun-chart-skeleton-plot",
|
|
5003
5054
|
"data-kjun-chart-part": "plot",
|
|
5004
5055
|
"aria-hidden": "true",
|
|
5005
|
-
children: /* @__PURE__ */
|
|
5056
|
+
children: /* @__PURE__ */ jsx28(
|
|
5006
5057
|
"path",
|
|
5007
5058
|
{
|
|
5008
5059
|
d: chartFramePath,
|
|
@@ -5014,7 +5065,7 @@ function KjunChartSkeleton({
|
|
|
5014
5065
|
)
|
|
5015
5066
|
}
|
|
5016
5067
|
),
|
|
5017
|
-
loadingText && /* @__PURE__ */
|
|
5068
|
+
loadingText && /* @__PURE__ */ jsx28("div", { className: "kjun-chart-skeleton-status", "data-kjun-chart-part": "status", role: status, children: /* @__PURE__ */ jsx28("span", { children: loadingText }) })
|
|
5018
5069
|
] })
|
|
5019
5070
|
}
|
|
5020
5071
|
);
|
|
@@ -5113,7 +5164,7 @@ function formatRelativeTime(value, now = Date.now()) {
|
|
|
5113
5164
|
}
|
|
5114
5165
|
|
|
5115
5166
|
// packages/react/src/number-display.tsx
|
|
5116
|
-
import { Fragment as Fragment10, jsx as
|
|
5167
|
+
import { Fragment as Fragment10, jsx as jsx29, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5117
5168
|
var finiteNumber = (value) => value == null || typeof value === "boolean" || typeof value === "string" && !value.trim() || !["number", "string"].includes(typeof value) || !Number.isFinite(Number(value)) ? null : Number(value) || 0;
|
|
5118
5169
|
var format = (value, decimals = 0) => new Intl.NumberFormat(void 0, {
|
|
5119
5170
|
minimumFractionDigits: Math.max(0, Math.min(20, decimals)),
|
|
@@ -5134,9 +5185,9 @@ function KjunAnimatedNumber({
|
|
|
5134
5185
|
}) {
|
|
5135
5186
|
const n = useCountUp(value, animated, fromPrevious);
|
|
5136
5187
|
return /* @__PURE__ */ jsxs22("span", { className: "kjun-animated-number " + className, children: [
|
|
5137
|
-
prefix && /* @__PURE__ */
|
|
5138
|
-
/* @__PURE__ */
|
|
5139
|
-
suffix && /* @__PURE__ */
|
|
5188
|
+
prefix && /* @__PURE__ */ jsx29("span", { className: "kjun-number-affix", "data-side": "prefix", children: prefix }),
|
|
5189
|
+
/* @__PURE__ */ jsx29("span", { children: typeof n === "string" ? n : formatter ? formatter(n) : format(n, decimals) }),
|
|
5190
|
+
suffix && /* @__PURE__ */ jsx29("span", { className: "kjun-number-affix", "data-side": "suffix", children: suffix })
|
|
5140
5191
|
] });
|
|
5141
5192
|
}
|
|
5142
5193
|
function KjunFreshness({
|
|
@@ -5145,11 +5196,11 @@ function KjunFreshness({
|
|
|
5145
5196
|
fetchedAt,
|
|
5146
5197
|
formatter
|
|
5147
5198
|
}) {
|
|
5148
|
-
return stale ? /* @__PURE__ */
|
|
5199
|
+
return stale ? /* @__PURE__ */ jsx29(
|
|
5149
5200
|
KjunTooltip,
|
|
5150
5201
|
{
|
|
5151
5202
|
content: (source === "close" ? "\uC2E4\uC2DC\uAC04 \uC2DC\uC138 \uC5C6\uC74C \xB7 \uCD5C\uADFC \uC885\uAC00 \uD45C\uC2DC" : "\uC2E4\uC2DC\uAC04 \uC2DC\uC138 \uC9C0\uC5F0") + (fetchedAt ? " \xB7 " + ((formatter == null ? void 0 : formatter(fetchedAt)) || formatRelativeTime(fetchedAt)) : ""),
|
|
5152
|
-
children: /* @__PURE__ */
|
|
5203
|
+
children: /* @__PURE__ */ jsx29("span", { tabIndex: 0, className: "kjun-freshness", children: /* @__PURE__ */ jsx29(KjunBadge, { variant: "warning", size: "xs", children: source === "close" ? "\uC885\uAC00" : "\uC9C0\uC5F0" }) })
|
|
5153
5204
|
}
|
|
5154
5205
|
) : null;
|
|
5155
5206
|
}
|
|
@@ -5163,14 +5214,14 @@ function KjunPriceCell({
|
|
|
5163
5214
|
flashClass = "",
|
|
5164
5215
|
fromPrevious = true
|
|
5165
5216
|
}) {
|
|
5166
|
-
return value == null ? /* @__PURE__ */
|
|
5167
|
-
/* @__PURE__ */
|
|
5217
|
+
return value == null ? /* @__PURE__ */ jsx29(KjunSkeleton, { type: "block", height: tokens27.extensions.financial.priceSkeletonHeight, width: tokens27.extensions.financial.priceSkeletonWidth }) : /* @__PURE__ */ jsxs22(Fragment10, { children: [
|
|
5218
|
+
/* @__PURE__ */ jsx29(
|
|
5168
5219
|
"span",
|
|
5169
5220
|
{
|
|
5170
5221
|
className: "kjun-price-cell " + flashClass,
|
|
5171
5222
|
ref: domainColorRef(/\bkjun-price-flash-(up|down)/.test(flashClass)),
|
|
5172
5223
|
style: { color: stale ? "var(--_kjun-color-text-tertiary)" : void 0 },
|
|
5173
|
-
children: /* @__PURE__ */
|
|
5224
|
+
children: /* @__PURE__ */ jsx29(
|
|
5174
5225
|
KjunAnimatedNumber,
|
|
5175
5226
|
{
|
|
5176
5227
|
value,
|
|
@@ -5180,7 +5231,7 @@ function KjunPriceCell({
|
|
|
5180
5231
|
)
|
|
5181
5232
|
}
|
|
5182
5233
|
),
|
|
5183
|
-
showFreshness && /* @__PURE__ */
|
|
5234
|
+
showFreshness && /* @__PURE__ */ jsx29(KjunFreshness, { stale, source, fetchedAt })
|
|
5184
5235
|
] });
|
|
5185
5236
|
}
|
|
5186
5237
|
function KjunSignedValue({
|
|
@@ -5211,15 +5262,15 @@ function KjunSignedValue({
|
|
|
5211
5262
|
background: tone === "pill" && !stale && n !== null ? `var(--_kjun-color-${role2}-bg)` : void 0
|
|
5212
5263
|
},
|
|
5213
5264
|
children: [
|
|
5214
|
-
loading ? /* @__PURE__ */
|
|
5215
|
-
!loading && showFreshness && stale && n !== null && /* @__PURE__ */
|
|
5265
|
+
loading ? /* @__PURE__ */ jsx29(KjunSkeleton, { type: "block", width: tokens27.extensions.financial.signedSkeletonWidth, height: "1lh" }) : display,
|
|
5266
|
+
!loading && showFreshness && stale && n !== null && /* @__PURE__ */ jsx29(KjunFreshness, { stale: true })
|
|
5216
5267
|
]
|
|
5217
5268
|
}
|
|
5218
5269
|
);
|
|
5219
5270
|
}
|
|
5220
5271
|
|
|
5221
5272
|
// packages/react/src/financial-display.tsx
|
|
5222
|
-
import { Fragment as Fragment11, jsx as
|
|
5273
|
+
import { Fragment as Fragment11, jsx as jsx30, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5223
5274
|
var deviationFill = { neutral: 1, low: tokens28.states.opacity.deviationLow, medium: tokens28.states.opacity.deviationMedium, strong: tokens28.states.opacity.deviationStrong };
|
|
5224
5275
|
function KjunDeviation({
|
|
5225
5276
|
value,
|
|
@@ -5230,11 +5281,11 @@ function KjunDeviation({
|
|
|
5230
5281
|
}) {
|
|
5231
5282
|
const n = finiteNumber(value);
|
|
5232
5283
|
if (n === null)
|
|
5233
|
-
return /* @__PURE__ */
|
|
5284
|
+
return /* @__PURE__ */ jsx30("span", { style: { color: "var(--_kjun-color-text-disabled)" }, children: "-" });
|
|
5234
5285
|
const abs = Math.abs(n), signal = abs >= signalThreshold, level = deviationLevel(n), neutral = level === "neutral", role2 = neutral ? "text-secondary" : n > 0 ? "price-up" : "price-down", label = formatter ? formatter(n) : (n > 0 ? "+" : "") + format(n, decimals) + "%";
|
|
5235
5286
|
if (variant === "badge")
|
|
5236
5287
|
return /* @__PURE__ */ jsxs23("span", { className: "kjun-deviation-badge", children: [
|
|
5237
|
-
/* @__PURE__ */
|
|
5288
|
+
/* @__PURE__ */ jsx30(
|
|
5238
5289
|
KjunBadge,
|
|
5239
5290
|
{
|
|
5240
5291
|
variant: neutral ? "secondary" : n > 0 ? "price-up" : "price-down",
|
|
@@ -5243,11 +5294,11 @@ function KjunDeviation({
|
|
|
5243
5294
|
children: label
|
|
5244
5295
|
}
|
|
5245
5296
|
),
|
|
5246
|
-
!signal ? /* @__PURE__ */
|
|
5297
|
+
!signal ? /* @__PURE__ */ jsx30("span", { className: "kjun-deviation-signal-slot", "aria-hidden": "true" }) : /* @__PURE__ */ jsx30(
|
|
5247
5298
|
KjunTooltip,
|
|
5248
5299
|
{
|
|
5249
5300
|
content: `\uAD34\uB9AC\uC728 ${signalThreshold}% \uCD08\uACFC \u2014 \uCC28\uC775\uAC70\uB798 \uAE30\uD68C \uAC00\uB2A5`,
|
|
5250
|
-
children: /* @__PURE__ */
|
|
5301
|
+
children: /* @__PURE__ */ jsx30("span", { tabIndex: 0, role: "img", "aria-label": "\uCC28\uC775\uAC70\uB798 \uAE30\uD68C", className: "kjun-deviation-signal", children: /* @__PURE__ */ jsx30(
|
|
5251
5302
|
KjunIcon,
|
|
5252
5303
|
{
|
|
5253
5304
|
name: "alert-triangle",
|
|
@@ -5266,7 +5317,7 @@ function KjunDeviation({
|
|
|
5266
5317
|
"data-variant": variant,
|
|
5267
5318
|
style: { color: `var(--_kjun-color-${role2})`, fontWeight: level === "strong" ? tokens28.typography.numberLg.fontWeight : tokens28.typography.control.fontWeight },
|
|
5268
5319
|
children: [
|
|
5269
|
-
variant === "pill" && /* @__PURE__ */
|
|
5320
|
+
variant === "pill" && /* @__PURE__ */ jsx30(
|
|
5270
5321
|
"span",
|
|
5271
5322
|
{
|
|
5272
5323
|
"aria-hidden": "true",
|
|
@@ -5277,7 +5328,7 @@ function KjunDeviation({
|
|
|
5277
5328
|
}
|
|
5278
5329
|
}
|
|
5279
5330
|
),
|
|
5280
|
-
/* @__PURE__ */
|
|
5331
|
+
/* @__PURE__ */ jsx30("span", { children: label })
|
|
5281
5332
|
]
|
|
5282
5333
|
}
|
|
5283
5334
|
);
|
|
@@ -5294,7 +5345,7 @@ function KjunHeatmapCell({
|
|
|
5294
5345
|
const role2 = mode === "price" ? ratio >= 0.5 ? "price-up" : "price-down" : mode === "diverging" ? ratio >= 0.5 ? "success" : "danger" : color;
|
|
5295
5346
|
const magnitude = mode === "sequential" ? ratio : Math.abs(ratio - 0.5) * 2, { heatMinimum, heatMaximum } = tokens28.states.opacity;
|
|
5296
5347
|
return /* @__PURE__ */ jsxs23("span", { className: "kjun-heat-cell", ref: domainColorRef(mode === "price"), children: [
|
|
5297
|
-
/* @__PURE__ */
|
|
5348
|
+
/* @__PURE__ */ jsx30(
|
|
5298
5349
|
"span",
|
|
5299
5350
|
{
|
|
5300
5351
|
"aria-hidden": "true",
|
|
@@ -5302,7 +5353,7 @@ function KjunHeatmapCell({
|
|
|
5302
5353
|
style: magnitude ? { background: `var(--_kjun-color-${role2})`, opacity: heatMinimum + (heatMaximum - heatMinimum) * magnitude } : { background: "var(--_kjun-color-secondary)" }
|
|
5303
5354
|
}
|
|
5304
5355
|
),
|
|
5305
|
-
/* @__PURE__ */
|
|
5356
|
+
/* @__PURE__ */ jsx30("span", { children: children != null ? children : value })
|
|
5306
5357
|
] });
|
|
5307
5358
|
}
|
|
5308
5359
|
function KjunProgressCell({
|
|
@@ -5315,7 +5366,7 @@ function KjunProgressCell({
|
|
|
5315
5366
|
}) {
|
|
5316
5367
|
const percent = max > 0 && Number.isFinite(value) ? Math.min(100, Math.max(0, value / max * 100)) : 0, role2 = color === "auto" ? percent < 30 ? "danger" : percent < 70 ? "warning" : "success" : color;
|
|
5317
5368
|
return /* @__PURE__ */ jsxs23("div", { className: "kjun-progress-cell", children: [
|
|
5318
|
-
/* @__PURE__ */
|
|
5369
|
+
/* @__PURE__ */ jsx30("div", { style: { height }, children: /* @__PURE__ */ jsx30(
|
|
5319
5370
|
"span",
|
|
5320
5371
|
{
|
|
5321
5372
|
style: {
|
|
@@ -5336,7 +5387,7 @@ function KjunCollectionMark({
|
|
|
5336
5387
|
size = "md"
|
|
5337
5388
|
}) {
|
|
5338
5389
|
const box = tokens28.extensions.financial.markSizes[size], glyph = kind === "interest" ? tokens28.extensions.financial.heartMarkSizes[size] : box;
|
|
5339
|
-
return /* @__PURE__ */
|
|
5390
|
+
return /* @__PURE__ */ jsx30(
|
|
5340
5391
|
KjunIcon,
|
|
5341
5392
|
{
|
|
5342
5393
|
ref: domainColorRef(active),
|
|
@@ -5366,7 +5417,7 @@ function KjunExecutionStatusBadge({
|
|
|
5366
5417
|
size = "md"
|
|
5367
5418
|
}) {
|
|
5368
5419
|
const state = status ? executionStates[status] : void 0;
|
|
5369
|
-
return /* @__PURE__ */
|
|
5420
|
+
return /* @__PURE__ */ jsx30(KjunBadge, { variant: (state == null ? void 0 : state[0]) || "secondary", size, dot: status === "running", children: label || (state == null ? void 0 : state[1]) || (status ? "\uC54C \uC218 \uC5C6\uC74C" : "\uC2E4\uD589 \uC774\uB825 \uC5C6\uC74C") });
|
|
5370
5421
|
}
|
|
5371
5422
|
function KjunSparkline({
|
|
5372
5423
|
data = [],
|
|
@@ -5396,11 +5447,11 @@ function KjunSparkline({
|
|
|
5396
5447
|
className: "kjun-sparkline",
|
|
5397
5448
|
children: [
|
|
5398
5449
|
fill && values.length > 1 && /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
5399
|
-
/* @__PURE__ */
|
|
5400
|
-
/* @__PURE__ */
|
|
5401
|
-
/* @__PURE__ */
|
|
5450
|
+
/* @__PURE__ */ jsx30("defs", { children: /* @__PURE__ */ jsxs23("linearGradient", { id, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
5451
|
+
/* @__PURE__ */ jsx30("stop", { offset: "0%", stopColor: line, stopOpacity: 0.3 }),
|
|
5452
|
+
/* @__PURE__ */ jsx30("stop", { offset: "100%", stopColor: line, stopOpacity: 0.05 })
|
|
5402
5453
|
] }) }),
|
|
5403
|
-
/* @__PURE__ */
|
|
5454
|
+
/* @__PURE__ */ jsx30(
|
|
5404
5455
|
"polygon",
|
|
5405
5456
|
{
|
|
5406
5457
|
points: `2,${height - 2} ${points} ${width - 2},${height - 2}`,
|
|
@@ -5408,7 +5459,7 @@ function KjunSparkline({
|
|
|
5408
5459
|
}
|
|
5409
5460
|
)
|
|
5410
5461
|
] }),
|
|
5411
|
-
values.length > 1 ? /* @__PURE__ */
|
|
5462
|
+
values.length > 1 ? /* @__PURE__ */ jsx30(
|
|
5412
5463
|
"polyline",
|
|
5413
5464
|
{
|
|
5414
5465
|
points,
|
|
@@ -5419,7 +5470,7 @@ function KjunSparkline({
|
|
|
5419
5470
|
strokeLinejoin: "round",
|
|
5420
5471
|
vectorEffect: stretch ? "non-scaling-stroke" : void 0
|
|
5421
5472
|
}
|
|
5422
|
-
) : values.length === 1 ? /* @__PURE__ */
|
|
5473
|
+
) : values.length === 1 ? /* @__PURE__ */ jsx30("circle", { cx: width / 2, cy: height / 2, r: 2, fill: line }) : null
|
|
5423
5474
|
]
|
|
5424
5475
|
}
|
|
5425
5476
|
);
|
|
@@ -5565,7 +5616,7 @@ function tableCellValue(props, column, row, index) {
|
|
|
5565
5616
|
|
|
5566
5617
|
// packages/react/src/table-toolbar.tsx
|
|
5567
5618
|
import { tokens as tokens29 } from "@kjun-ui/tokens";
|
|
5568
|
-
import { Fragment as Fragment12, jsx as
|
|
5619
|
+
import { Fragment as Fragment12, jsx as jsx31, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5569
5620
|
function TableToolbar({
|
|
5570
5621
|
selectable,
|
|
5571
5622
|
selected,
|
|
@@ -5590,8 +5641,8 @@ function TableToolbar({
|
|
|
5590
5641
|
selected.length,
|
|
5591
5642
|
"\uAC1C \uC120\uD0DD"
|
|
5592
5643
|
] }),
|
|
5593
|
-
/* @__PURE__ */
|
|
5594
|
-
/* @__PURE__ */
|
|
5644
|
+
/* @__PURE__ */ jsx31(KjunButton, { size: "xs", variant: "ghost", onClick: toggleAll, children: "\uC804\uCCB4 \uC120\uD0DD" }),
|
|
5645
|
+
/* @__PURE__ */ jsx31(
|
|
5595
5646
|
KjunButton,
|
|
5596
5647
|
{
|
|
5597
5648
|
size: "xs",
|
|
@@ -5605,7 +5656,7 @@ function TableToolbar({
|
|
|
5605
5656
|
}
|
|
5606
5657
|
),
|
|
5607
5658
|
(searchable || toolbar) && /* @__PURE__ */ jsxs24("div", { className: "kjun-table-toolbar", children: [
|
|
5608
|
-
searchable && /* @__PURE__ */
|
|
5659
|
+
searchable && /* @__PURE__ */ jsx31(
|
|
5609
5660
|
KjunInput,
|
|
5610
5661
|
{
|
|
5611
5662
|
size: "sm",
|
|
@@ -5637,22 +5688,22 @@ var componentIcons = { minus };
|
|
|
5637
5688
|
|
|
5638
5689
|
// packages/react/src/table-check.tsx
|
|
5639
5690
|
import { tokens as tokens30 } from "@kjun-ui/tokens";
|
|
5640
|
-
import { jsx as
|
|
5691
|
+
import { jsx as jsx32, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5641
5692
|
var TableCheck = forwardRef4(
|
|
5642
5693
|
function TableCheck2(props, ref) {
|
|
5643
5694
|
const size = tokens30.extensions.checkbox.iconSizes.sm;
|
|
5644
|
-
return /* @__PURE__ */
|
|
5645
|
-
/* @__PURE__ */
|
|
5646
|
-
/* @__PURE__ */
|
|
5647
|
-
/* @__PURE__ */
|
|
5695
|
+
return /* @__PURE__ */ jsx32(IconFallbacks, { icons: componentIcons, children: /* @__PURE__ */ jsxs25("span", { className: "kjun-table-check", children: [
|
|
5696
|
+
/* @__PURE__ */ jsx32("input", { ...props, ref, type: "checkbox" }),
|
|
5697
|
+
/* @__PURE__ */ jsx32(KjunIcon, { name: "check", size, className: "kjun-table-check-mark" }),
|
|
5698
|
+
/* @__PURE__ */ jsx32(KjunIcon, { name: "minus", size, className: "kjun-table-check-dash" })
|
|
5648
5699
|
] }) });
|
|
5649
5700
|
}
|
|
5650
5701
|
);
|
|
5651
5702
|
|
|
5652
5703
|
// packages/react/src/table-grid.tsx
|
|
5653
|
-
import { jsx as
|
|
5704
|
+
import { jsx as jsx33, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5654
5705
|
function TableGrid({ initialLoading, skeletonRows, skeletonHidden, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, visible, maxHeight, stickyHeader, sortable, compact, striped, hoverable, ariaLabel, customClass, rowKeyDown }) {
|
|
5655
|
-
return /* @__PURE__ */
|
|
5706
|
+
return /* @__PURE__ */ jsx33("div", { className: "kjun-table-scroll", style: { maxHeight, visibility: skeletonHidden ? "hidden" : void 0 }, "aria-hidden": skeletonHidden || void 0, children: /* @__PURE__ */ jsxs26(
|
|
5656
5707
|
"table",
|
|
5657
5708
|
{
|
|
5658
5709
|
className: "kjun-table",
|
|
@@ -5661,12 +5712,12 @@ function TableGrid({ initialLoading, skeletonRows, skeletonHidden, state, onRowC
|
|
|
5661
5712
|
"data-hoverable": hoverable,
|
|
5662
5713
|
"data-striped": striped,
|
|
5663
5714
|
children: [
|
|
5664
|
-
/* @__PURE__ */
|
|
5715
|
+
/* @__PURE__ */ jsx33(
|
|
5665
5716
|
"thead",
|
|
5666
5717
|
{
|
|
5667
5718
|
style: stickyHeader ? { position: "sticky", top: 0, zIndex: 2 } : void 0,
|
|
5668
5719
|
children: /* @__PURE__ */ jsxs26("tr", { children: [
|
|
5669
|
-
selectable && /* @__PURE__ */
|
|
5720
|
+
selectable && /* @__PURE__ */ jsx33("th", { scope: "col", className: "kjun-table-action-cell", children: /* @__PURE__ */ jsx33(
|
|
5670
5721
|
TableCheck,
|
|
5671
5722
|
{
|
|
5672
5723
|
"aria-label": "\uC804\uCCB4 \uC120\uD0DD",
|
|
@@ -5677,8 +5728,8 @@ function TableGrid({ initialLoading, skeletonRows, skeletonHidden, state, onRowC
|
|
|
5677
5728
|
onChange: state.toggleAll
|
|
5678
5729
|
}
|
|
5679
5730
|
) }),
|
|
5680
|
-
expandable && /* @__PURE__ */
|
|
5681
|
-
visible.map((col) => /* @__PURE__ */
|
|
5731
|
+
expandable && /* @__PURE__ */ jsx33("th", { scope: "col", className: "kjun-table-action-cell" }),
|
|
5732
|
+
visible.map((col) => /* @__PURE__ */ jsx33(
|
|
5682
5733
|
"th",
|
|
5683
5734
|
{
|
|
5684
5735
|
scope: "col",
|
|
@@ -5692,7 +5743,7 @@ function TableGrid({ initialLoading, skeletonRows, skeletonHidden, state, onRowC
|
|
|
5692
5743
|
onClick: () => state.sortColumn(col),
|
|
5693
5744
|
children: [
|
|
5694
5745
|
col.label,
|
|
5695
|
-
state.sort.key === col.key && /* @__PURE__ */
|
|
5746
|
+
state.sort.key === col.key && /* @__PURE__ */ jsx33(
|
|
5696
5747
|
KjunIcon,
|
|
5697
5748
|
{
|
|
5698
5749
|
name: state.sort.order === "asc" ? "sort-ascending" : "sort-descending",
|
|
@@ -5708,10 +5759,10 @@ function TableGrid({ initialLoading, skeletonRows, skeletonHidden, state, onRowC
|
|
|
5708
5759
|
] })
|
|
5709
5760
|
}
|
|
5710
5761
|
),
|
|
5711
|
-
/* @__PURE__ */
|
|
5712
|
-
selectable && /* @__PURE__ */
|
|
5713
|
-
expandable && /* @__PURE__ */
|
|
5714
|
-
visible.map((col) => /* @__PURE__ */
|
|
5762
|
+
/* @__PURE__ */ jsx33("tbody", { children: initialLoading ? Array.from({ length: skeletonRows }, (_, i) => /* @__PURE__ */ jsxs26("tr", { "aria-hidden": "true", children: [
|
|
5763
|
+
selectable && /* @__PURE__ */ jsx33("td", { className: "kjun-table-action-cell", children: /* @__PURE__ */ jsx33(KjunSkeleton, { type: "block", height: tokens31.table.selectionSize, width: tokens31.table.selectionSize }) }),
|
|
5764
|
+
expandable && /* @__PURE__ */ jsx33("td", { className: "kjun-table-action-cell" }),
|
|
5765
|
+
visible.map((col) => /* @__PURE__ */ jsx33("td", { children: /* @__PURE__ */ jsx33(
|
|
5715
5766
|
KjunSkeleton,
|
|
5716
5767
|
{
|
|
5717
5768
|
type: "block",
|
|
@@ -5719,7 +5770,7 @@ function TableGrid({ initialLoading, skeletonRows, skeletonHidden, state, onRowC
|
|
|
5719
5770
|
width: col.key === "actions" ? tokens31.table.actionColumnWidth : "75%"
|
|
5720
5771
|
}
|
|
5721
5772
|
) }, col.key))
|
|
5722
|
-
] }, i)) : !state.rows.length ? /* @__PURE__ */
|
|
5773
|
+
] }, i)) : !state.rows.length ? /* @__PURE__ */ jsx33("tr", { children: /* @__PURE__ */ jsx33(
|
|
5723
5774
|
"td",
|
|
5724
5775
|
{
|
|
5725
5776
|
colSpan: visible.length + Number(selectable) + Number(expandable),
|
|
@@ -5736,9 +5787,9 @@ function TableGrid({ initialLoading, skeletonRows, skeletonHidden, state, onRowC
|
|
|
5736
5787
|
"data-selected": state.selectedRow(row) || void 0,
|
|
5737
5788
|
onClick: () => onRowClick == null ? void 0 : onRowClick(row, i),
|
|
5738
5789
|
children: [
|
|
5739
|
-
selectable && /* @__PURE__ */
|
|
5740
|
-
expandable && /* @__PURE__ */
|
|
5741
|
-
visible.map((col) => /* @__PURE__ */
|
|
5790
|
+
selectable && /* @__PURE__ */ jsx33("td", { className: "kjun-table-action-cell", children: checkbox(row, i) }),
|
|
5791
|
+
expandable && /* @__PURE__ */ jsx33("td", { className: "kjun-table-action-cell", children: expand(row, i) }),
|
|
5792
|
+
visible.map((col) => /* @__PURE__ */ jsx33(
|
|
5742
5793
|
"td",
|
|
5743
5794
|
{
|
|
5744
5795
|
style: { textAlign: col.align },
|
|
@@ -5751,7 +5802,7 @@ function TableGrid({ initialLoading, skeletonRows, skeletonHidden, state, onRowC
|
|
|
5751
5802
|
]
|
|
5752
5803
|
}
|
|
5753
5804
|
),
|
|
5754
|
-
expandable && state.expanded.includes(state.key(row, i)) && /* @__PURE__ */
|
|
5805
|
+
expandable && state.expanded.includes(state.key(row, i)) && /* @__PURE__ */ jsx33("tr", { className: "kjun-table-expanded", children: /* @__PURE__ */ jsx33(
|
|
5755
5806
|
"td",
|
|
5756
5807
|
{
|
|
5757
5808
|
colSpan: visible.length + Number(selectable) + 1,
|
|
@@ -5765,7 +5816,7 @@ function TableGrid({ initialLoading, skeletonRows, skeletonHidden, state, onRowC
|
|
|
5765
5816
|
}
|
|
5766
5817
|
|
|
5767
5818
|
// packages/react/src/table-cards.tsx
|
|
5768
|
-
import { jsx as
|
|
5819
|
+
import { jsx as jsx34, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5769
5820
|
function TableCards({
|
|
5770
5821
|
initialLoading,
|
|
5771
5822
|
skeletonRows,
|
|
@@ -5795,7 +5846,7 @@ function TableCards({
|
|
|
5795
5846
|
style: skeletonHidden ? { visibility: "hidden" } : void 0,
|
|
5796
5847
|
"aria-hidden": skeletonHidden || void 0,
|
|
5797
5848
|
children: [
|
|
5798
|
-
initialLoading ? Array.from({ length: skeletonRows }, (_, i) => /* @__PURE__ */
|
|
5849
|
+
initialLoading ? Array.from({ length: skeletonRows }, (_, i) => /* @__PURE__ */ jsx34("div", { className: "kjun-table-card", children: /* @__PURE__ */ jsx34(KjunSkeleton, { type: "card" }) }, i)) : state.rows.map((row, i) => /* @__PURE__ */ jsxs27(
|
|
5799
5850
|
"div",
|
|
5800
5851
|
{
|
|
5801
5852
|
role: "listitem",
|
|
@@ -5807,15 +5858,15 @@ function TableCards({
|
|
|
5807
5858
|
/* @__PURE__ */ jsxs27("div", { className: "kjun-table-card-header", children: [
|
|
5808
5859
|
/* @__PURE__ */ jsxs27("div", { className: "kjun-table-card-header-left", children: [
|
|
5809
5860
|
selectable && checkbox(row, i),
|
|
5810
|
-
/* @__PURE__ */
|
|
5861
|
+
/* @__PURE__ */ jsx34("span", { className: "kjun-table-card-title", children: title && cell(title, row, i) })
|
|
5811
5862
|
] }),
|
|
5812
|
-
badges.length ? /* @__PURE__ */
|
|
5813
|
-
inline.length > 0 && /* @__PURE__ */
|
|
5863
|
+
badges.length ? /* @__PURE__ */ jsx34("div", { className: "kjun-table-card-badges", children: badges.map((col) => /* @__PURE__ */ jsx34("span", { children: cell(col, row, i) }, col.key)) }) : subtitle ? /* @__PURE__ */ jsx34("span", { className: "kjun-table-card-subtitle", children: cell(subtitle, row, i) }) : null,
|
|
5864
|
+
inline.length > 0 && /* @__PURE__ */ jsx34(
|
|
5814
5865
|
"div",
|
|
5815
5866
|
{
|
|
5816
5867
|
className: "kjun-table-card-header-actions",
|
|
5817
5868
|
onClick: (e) => e.stopPropagation(),
|
|
5818
|
-
children: inline.map((col) => /* @__PURE__ */
|
|
5869
|
+
children: inline.map((col) => /* @__PURE__ */ jsx34("span", { children: cell(col, row, i) }, col.key))
|
|
5819
5870
|
}
|
|
5820
5871
|
)
|
|
5821
5872
|
] }),
|
|
@@ -5826,8 +5877,8 @@ function TableCards({
|
|
|
5826
5877
|
{
|
|
5827
5878
|
className: "kjun-table-card-section",
|
|
5828
5879
|
children: [
|
|
5829
|
-
section.label && /* @__PURE__ */
|
|
5830
|
-
/* @__PURE__ */
|
|
5880
|
+
section.label && /* @__PURE__ */ jsx34("div", { className: "kjun-table-card-section-label", children: section.label }),
|
|
5881
|
+
/* @__PURE__ */ jsx34(
|
|
5831
5882
|
"div",
|
|
5832
5883
|
{
|
|
5833
5884
|
className: "kjun-table-card-body kjun-table-card-body--" + (section.layout || "grid"),
|
|
@@ -5836,8 +5887,8 @@ function TableCards({
|
|
|
5836
5887
|
{
|
|
5837
5888
|
className: "kjun-table-card-field" + (col.fullWidthInCard ? " kjun-table-card-field--full" : "") + (section.labelAlign === "right" ? " kjun-table-card-field--label-right" : ""),
|
|
5838
5889
|
children: [
|
|
5839
|
-
/* @__PURE__ */
|
|
5840
|
-
/* @__PURE__ */
|
|
5890
|
+
/* @__PURE__ */ jsx34("span", { className: "kjun-table-card-label", children: col.label }),
|
|
5891
|
+
/* @__PURE__ */ jsx34("span", { className: "kjun-table-card-value", children: cell(col, row, i) })
|
|
5841
5892
|
]
|
|
5842
5893
|
},
|
|
5843
5894
|
col.key
|
|
@@ -5849,9 +5900,9 @@ function TableCards({
|
|
|
5849
5900
|
section.key || index
|
|
5850
5901
|
) : null;
|
|
5851
5902
|
}),
|
|
5852
|
-
expandable && /* @__PURE__ */
|
|
5853
|
-
expandable && state.expanded.includes(state.key(row, i)) && /* @__PURE__ */
|
|
5854
|
-
actions && !actions.inlineInCard && /* @__PURE__ */
|
|
5903
|
+
expandable && /* @__PURE__ */ jsx34("div", { className: "kjun-table-card-expand-toggle", children: expand(row, i) }),
|
|
5904
|
+
expandable && state.expanded.includes(state.key(row, i)) && /* @__PURE__ */ jsx34("div", { className: "kjun-table-card-expand-content", children: renderExpand == null ? void 0 : renderExpand(row, i) }),
|
|
5905
|
+
actions && !actions.inlineInCard && /* @__PURE__ */ jsx34(
|
|
5855
5906
|
"div",
|
|
5856
5907
|
{
|
|
5857
5908
|
className: "kjun-table-card-actions",
|
|
@@ -5863,7 +5914,7 @@ function TableCards({
|
|
|
5863
5914
|
},
|
|
5864
5915
|
state.key(row, i)
|
|
5865
5916
|
)),
|
|
5866
|
-
!initialLoading && !state.rows.length && /* @__PURE__ */
|
|
5917
|
+
!initialLoading && !state.rows.length && /* @__PURE__ */ jsx34("div", { className: "kjun-table-card-empty", children: emptyContent || emptyText })
|
|
5867
5918
|
]
|
|
5868
5919
|
}
|
|
5869
5920
|
);
|
|
@@ -5872,7 +5923,7 @@ function TableCards({
|
|
|
5872
5923
|
// packages/react/src/table-view.tsx
|
|
5873
5924
|
import { useEffect as useEffect18, useState as useState26 } from "react";
|
|
5874
5925
|
import { isComposingKey as isComposingKey4, tokens as tokens32 } from "@kjun-ui/tokens";
|
|
5875
|
-
import { jsx as
|
|
5926
|
+
import { jsx as jsx35, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5876
5927
|
function KjunTable(props) {
|
|
5877
5928
|
const {
|
|
5878
5929
|
skeletonRows = 8,
|
|
@@ -5912,7 +5963,7 @@ function KjunTable(props) {
|
|
|
5912
5963
|
const { card, visible } = layout;
|
|
5913
5964
|
const cell = (col, row, index) => {
|
|
5914
5965
|
const { value, body } = tableCellValue(props, col, row, index);
|
|
5915
|
-
return col.pill ? /* @__PURE__ */
|
|
5966
|
+
return col.pill ? /* @__PURE__ */ jsx35(
|
|
5916
5967
|
"span",
|
|
5917
5968
|
{
|
|
5918
5969
|
className: "kjun-table-pill " + (Number(value) > 0 ? "kjun-table-pill-up" : Number(value) < 0 ? "kjun-table-pill-down" : ""),
|
|
@@ -5928,7 +5979,7 @@ function KjunTable(props) {
|
|
|
5928
5979
|
onRowClick(row, index);
|
|
5929
5980
|
}
|
|
5930
5981
|
};
|
|
5931
|
-
const checkbox = (row, i) => /* @__PURE__ */
|
|
5982
|
+
const checkbox = (row, i) => /* @__PURE__ */ jsx35(
|
|
5932
5983
|
TableCheck,
|
|
5933
5984
|
{
|
|
5934
5985
|
"aria-label": `\uD589 \uC120\uD0DD ${i + 1}`,
|
|
@@ -5937,7 +5988,7 @@ function KjunTable(props) {
|
|
|
5937
5988
|
onChange: () => state.toggleRow(row)
|
|
5938
5989
|
}
|
|
5939
5990
|
);
|
|
5940
|
-
const expand = (row, i) => /* @__PURE__ */
|
|
5991
|
+
const expand = (row, i) => /* @__PURE__ */ jsx35(
|
|
5941
5992
|
KjunButton,
|
|
5942
5993
|
{
|
|
5943
5994
|
variant: "ghost",
|
|
@@ -5956,7 +6007,7 @@ function KjunTable(props) {
|
|
|
5956
6007
|
"aria-busy": !!props.loading,
|
|
5957
6008
|
ref: domainColorRef(!query2.initialLoading && state.rows.length > 0 && props.columns.some((column) => column.pill)),
|
|
5958
6009
|
children: [
|
|
5959
|
-
/* @__PURE__ */
|
|
6010
|
+
/* @__PURE__ */ jsx35(
|
|
5960
6011
|
TableToolbar,
|
|
5961
6012
|
{
|
|
5962
6013
|
...{ selectable, selected, renderSelectionToolbar, searchable, searchPlaceholder, toolbar },
|
|
@@ -5983,8 +6034,8 @@ function KjunTable(props) {
|
|
|
5983
6034
|
loadingText,
|
|
5984
6035
|
loadingDelay: skeleton ? 0 : loadingDelay,
|
|
5985
6036
|
children: [
|
|
5986
|
-
card ? /* @__PURE__ */
|
|
5987
|
-
pagination && /* @__PURE__ */
|
|
6037
|
+
card ? /* @__PURE__ */ jsx35(TableCards, { ...{ initialLoading: query2.initialLoading, skeletonRows, skeletonHidden: query2.initialLoading && !revealed, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, layout, ariaLabel, customClass, rowKeyDown } }) : /* @__PURE__ */ jsx35(TableGrid, { ...{ initialLoading: query2.initialLoading, skeletonRows, skeletonHidden: query2.initialLoading && !revealed, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, visible, maxHeight, stickyHeader, compact, striped, hoverable, ariaLabel, customClass, rowKeyDown }, sortable: props.sortable }),
|
|
6038
|
+
pagination && /* @__PURE__ */ jsx35(
|
|
5988
6039
|
KjunPagination,
|
|
5989
6040
|
{
|
|
5990
6041
|
currentPage: pagination.page,
|
|
@@ -6007,7 +6058,7 @@ function KjunTable(props) {
|
|
|
6007
6058
|
|
|
6008
6059
|
// packages/react/src/kpi.tsx
|
|
6009
6060
|
import { tokens as tokens33 } from "@kjun-ui/tokens";
|
|
6010
|
-
import { Fragment as Fragment14, jsx as
|
|
6061
|
+
import { Fragment as Fragment14, jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
6011
6062
|
var kpiFormat = (item, value = item.value) => {
|
|
6012
6063
|
var _a, _b;
|
|
6013
6064
|
return typeof value === "string" ? value : item.formatter ? item.formatter(value) : (item.showSign && value > 0 ? "+" : item.semantic === "price" && value < 0 ? "\u2212" : "") + new Intl.NumberFormat(void 0, {
|
|
@@ -6041,12 +6092,12 @@ function KjunKpiHero(props) {
|
|
|
6041
6092
|
);
|
|
6042
6093
|
const delta = (v, kind) => deltaFormatter ? deltaFormatter(v, kind) : /* @__PURE__ */ jsxs29(Fragment14, { children: [
|
|
6043
6094
|
v > 0 ? "+" : v < 0 ? "\u2212" : "",
|
|
6044
|
-
kind === "absolute" && prefix && /* @__PURE__ */
|
|
6095
|
+
kind === "absolute" && prefix && /* @__PURE__ */ jsx36("span", { className: "kjun-number-affix", "data-side": "prefix", children: prefix }),
|
|
6045
6096
|
new Intl.NumberFormat(void 0, {
|
|
6046
6097
|
minimumFractionDigits: kind === "absolute" ? decimals : 1,
|
|
6047
6098
|
maximumFractionDigits: kind === "absolute" ? decimals : 1
|
|
6048
6099
|
}).format(Math.abs(v)),
|
|
6049
|
-
kind === "percent" && /* @__PURE__ */
|
|
6100
|
+
kind === "percent" && /* @__PURE__ */ jsx36("span", { className: "kjun-number-affix", "data-side": "suffix", children: "%" })
|
|
6050
6101
|
] });
|
|
6051
6102
|
return /* @__PURE__ */ jsxs29(
|
|
6052
6103
|
"div",
|
|
@@ -6058,10 +6109,10 @@ function KjunKpiHero(props) {
|
|
|
6058
6109
|
children: [
|
|
6059
6110
|
/* @__PURE__ */ jsxs29("div", { className: "kjun-kpi-hero__layout", children: [
|
|
6060
6111
|
/* @__PURE__ */ jsxs29("div", { className: "kjun-kpi-hero__main", children: [
|
|
6061
|
-
/* @__PURE__ */
|
|
6062
|
-
/* @__PURE__ */
|
|
6063
|
-
prefix && /* @__PURE__ */
|
|
6064
|
-
/* @__PURE__ */
|
|
6112
|
+
/* @__PURE__ */ jsx36("div", { className: "kjun-kpi-hero__label", children: label }),
|
|
6113
|
+
/* @__PURE__ */ jsx36("div", { className: "kjun-kpi-hero__value", children: loading ? /* @__PURE__ */ jsx36(KjunSkeleton, { type: "block", height: "1lh", width: "7ch" }) : /* @__PURE__ */ jsxs29(Fragment14, { children: [
|
|
6114
|
+
prefix && /* @__PURE__ */ jsx36("span", { className: "kjun-kpi-hero__affix", children: prefix }),
|
|
6115
|
+
/* @__PURE__ */ jsx36(
|
|
6065
6116
|
KjunAnimatedNumber,
|
|
6066
6117
|
{
|
|
6067
6118
|
value,
|
|
@@ -6070,13 +6121,13 @@ function KjunKpiHero(props) {
|
|
|
6070
6121
|
formatter
|
|
6071
6122
|
}
|
|
6072
6123
|
),
|
|
6073
|
-
suffix && /* @__PURE__ */
|
|
6124
|
+
suffix && /* @__PURE__ */ jsx36("span", { className: "kjun-kpi-hero__affix", children: suffix })
|
|
6074
6125
|
] }) }),
|
|
6075
|
-
showDelta && /* @__PURE__ */
|
|
6126
|
+
showDelta && /* @__PURE__ */ jsx36("div", { className: "kjun-kpi-hero__delta-line", children: loading ? (
|
|
6076
6127
|
// The placeholder takes the delta numbers' line height, like Vue, so the hero keeps its loaded height.
|
|
6077
|
-
/* @__PURE__ */
|
|
6128
|
+
/* @__PURE__ */ jsx36("span", { className: "kjun-kpi-hero__delta-abs", children: /* @__PURE__ */ jsx36(KjunSkeleton, { type: "block", height: "1lh", width: tokens33.extensions.kpiHero.deltaSkeletonWidth }) })
|
|
6078
6129
|
) : /* @__PURE__ */ jsxs29(Fragment14, { children: [
|
|
6079
|
-
deltaAbsolute !== null && /* @__PURE__ */
|
|
6130
|
+
deltaAbsolute !== null && /* @__PURE__ */ jsx36(
|
|
6080
6131
|
"span",
|
|
6081
6132
|
{
|
|
6082
6133
|
className: "kjun-kpi-hero__delta-abs",
|
|
@@ -6090,7 +6141,7 @@ function KjunKpiHero(props) {
|
|
|
6090
6141
|
children: delta(deltaAbsolute, "absolute")
|
|
6091
6142
|
}
|
|
6092
6143
|
),
|
|
6093
|
-
deltaPercent !== null && /* @__PURE__ */
|
|
6144
|
+
deltaPercent !== null && /* @__PURE__ */ jsx36(
|
|
6094
6145
|
"span",
|
|
6095
6146
|
{
|
|
6096
6147
|
className: "kjun-kpi-hero__delta-pct",
|
|
@@ -6100,31 +6151,31 @@ function KjunKpiHero(props) {
|
|
|
6100
6151
|
children: delta(deltaPercent, "percent")
|
|
6101
6152
|
}
|
|
6102
6153
|
),
|
|
6103
|
-
deltaDescription && /* @__PURE__ */
|
|
6154
|
+
deltaDescription && /* @__PURE__ */ jsx36("span", { className: "kjun-kpi-hero__delta-desc", children: deltaDescription })
|
|
6104
6155
|
] }) })
|
|
6105
6156
|
] }),
|
|
6106
|
-
aside && /* @__PURE__ */
|
|
6157
|
+
aside && /* @__PURE__ */ jsx36("div", { className: "kjun-kpi-hero__aside", children: aside })
|
|
6107
6158
|
] }),
|
|
6108
|
-
secondary.length > 0 && /* @__PURE__ */
|
|
6109
|
-
/* @__PURE__ */
|
|
6110
|
-
/* @__PURE__ */
|
|
6159
|
+
secondary.length > 0 && /* @__PURE__ */ jsx36("div", { className: "kjun-kpi-hero__secondary", children: secondary.map((item, i) => /* @__PURE__ */ jsxs29("div", { className: "kjun-kpi-hero__sec-item", children: [
|
|
6160
|
+
/* @__PURE__ */ jsx36("div", { className: "kjun-kpi-hero__sec-label", children: item.label }),
|
|
6161
|
+
/* @__PURE__ */ jsx36(
|
|
6111
6162
|
"div",
|
|
6112
6163
|
{
|
|
6113
6164
|
className: "kjun-kpi-hero__sec-value",
|
|
6114
6165
|
style: { color: kpiColor(item.value, item.semantic) },
|
|
6115
|
-
children: loading ? /* @__PURE__ */
|
|
6116
|
-
item.prefix && /* @__PURE__ */
|
|
6117
|
-
/* @__PURE__ */
|
|
6118
|
-
item.suffix && /* @__PURE__ */
|
|
6166
|
+
children: loading ? /* @__PURE__ */ jsx36(KjunSkeleton, { type: "block", height: "1lh", width: "5ch" }) : (renderSecondary == null ? void 0 : renderSecondary(item, i)) || /* @__PURE__ */ jsxs29(Fragment14, { children: [
|
|
6167
|
+
item.prefix && /* @__PURE__ */ jsx36("span", { className: "kjun-kpi-hero__sec-affix", children: item.prefix }),
|
|
6168
|
+
/* @__PURE__ */ jsx36("span", { children: kpiFormat(item) }),
|
|
6169
|
+
item.suffix && /* @__PURE__ */ jsx36("span", { className: "kjun-kpi-hero__sec-affix", children: item.suffix })
|
|
6119
6170
|
] })
|
|
6120
6171
|
}
|
|
6121
6172
|
),
|
|
6122
|
-
item.desc && /* @__PURE__ */
|
|
6173
|
+
item.desc && /* @__PURE__ */ jsx36(
|
|
6123
6174
|
"div",
|
|
6124
6175
|
{
|
|
6125
6176
|
className: "kjun-kpi-hero__sec-desc " + (item.descClass || ""),
|
|
6126
6177
|
style: { color: "var(--_kjun-color-text-tertiary)" },
|
|
6127
|
-
children: loading ? /* @__PURE__ */
|
|
6178
|
+
children: loading ? /* @__PURE__ */ jsx36(KjunSkeleton, { type: "block", width: "7ch", height: "1lh" }) : item.desc
|
|
6128
6179
|
}
|
|
6129
6180
|
)
|
|
6130
6181
|
] }, i)) })
|
|
@@ -6163,7 +6214,7 @@ function KjunKpiRow({
|
|
|
6163
6214
|
background: `var(--_kjun-color-${v === "neutral" ? "secondary" : v === "info" ? "info-bg" : v + "-bg"})`
|
|
6164
6215
|
},
|
|
6165
6216
|
children: [
|
|
6166
|
-
dot && /* @__PURE__ */
|
|
6217
|
+
dot && /* @__PURE__ */ jsx36(
|
|
6167
6218
|
"span",
|
|
6168
6219
|
{
|
|
6169
6220
|
className: "kjun-kpi-row__badge-dot",
|
|
@@ -6175,7 +6226,7 @@ function KjunKpiRow({
|
|
|
6175
6226
|
}
|
|
6176
6227
|
);
|
|
6177
6228
|
};
|
|
6178
|
-
return /* @__PURE__ */
|
|
6229
|
+
return /* @__PURE__ */ jsx36(
|
|
6179
6230
|
"div",
|
|
6180
6231
|
{
|
|
6181
6232
|
className: "kjun-kpi-row" + (size === "sm" ? " kjun-kpi-row--sm" : "") + (((_a = items[0]) == null ? void 0 : _a.mobileFull) ? " kjun-kpi-row--hero-first" : "") + (mobileSummary && size !== "sm" ? " kjun-kpi-row--mobile-summary" : ""),
|
|
@@ -6206,11 +6257,11 @@ function KjunKpiRow({
|
|
|
6206
6257
|
},
|
|
6207
6258
|
children: [
|
|
6208
6259
|
/* @__PURE__ */ jsxs29("div", { className: "kjun-kpi-row__label-row", children: [
|
|
6209
|
-
/* @__PURE__ */
|
|
6260
|
+
/* @__PURE__ */ jsx36("div", { className: "kjun-kpi-row__label", children: busy && !item.label ? /* @__PURE__ */ jsx36(KjunSkeleton, { type: "block", width: tokens33.extensions.kpiRow.labelSkeletonWidth, height: tokens33.extensions.kpiRow.labelSkeletonHeight }) : item.label }),
|
|
6210
6261
|
!busy && item.badgePlacement !== "value" && badge(item)
|
|
6211
6262
|
] }),
|
|
6212
6263
|
/* @__PURE__ */ jsxs29("div", { className: "kjun-kpi-row__value-row", children: [
|
|
6213
|
-
/* @__PURE__ */
|
|
6264
|
+
/* @__PURE__ */ jsx36(
|
|
6214
6265
|
"div",
|
|
6215
6266
|
{
|
|
6216
6267
|
className: "kjun-kpi-row__value " + (item.valueClass || "") + (item.valueKind === "text" ? " kjun-kpi-row__value--text" : "") + (item.mobileNeutral ? " kjun-kpi-row__value--mobile-neutral" : ""),
|
|
@@ -6223,14 +6274,14 @@ function KjunKpiRow({
|
|
|
6223
6274
|
{
|
|
6224
6275
|
className: (seg.class || "") + (seg.label ? " kjun-kpi-row__segment--labeled" : "") + (seg.separator ? " kjun-kpi-row__segment--separator" : ""),
|
|
6225
6276
|
children: [
|
|
6226
|
-
seg.label && /* @__PURE__ */
|
|
6227
|
-
busy && !seg.separator ? /* @__PURE__ */
|
|
6277
|
+
seg.label && /* @__PURE__ */ jsx36("span", { className: "kjun-kpi-row__segment-label", children: seg.label }),
|
|
6278
|
+
busy && !seg.separator ? /* @__PURE__ */ jsx36(KjunSkeleton, { type: "block", height: "1lh", width: "3ch" }) : seg.text
|
|
6228
6279
|
]
|
|
6229
6280
|
},
|
|
6230
6281
|
j
|
|
6231
|
-
)) : busy ? /* @__PURE__ */
|
|
6232
|
-
item.prefix && /* @__PURE__ */
|
|
6233
|
-
item.animated && typeof item.value === "number" ? /* @__PURE__ */
|
|
6282
|
+
)) : busy ? /* @__PURE__ */ jsx36(KjunSkeleton, { type: "block", height: "1lh", width: "5ch" }) : (renderValue == null ? void 0 : renderValue(item, i)) || /* @__PURE__ */ jsxs29(Fragment14, { children: [
|
|
6283
|
+
item.prefix && /* @__PURE__ */ jsx36("span", { className: "kjun-kpi-row__affix", children: item.prefix }),
|
|
6284
|
+
item.animated && typeof item.value === "number" ? /* @__PURE__ */ jsx36(
|
|
6234
6285
|
KjunAnimatedNumber,
|
|
6235
6286
|
{
|
|
6236
6287
|
fromPrevious: true,
|
|
@@ -6238,20 +6289,20 @@ function KjunKpiRow({
|
|
|
6238
6289
|
formatter: (v) => kpiFormat(item, v)
|
|
6239
6290
|
}
|
|
6240
6291
|
) : kpiFormat(item),
|
|
6241
|
-
item.suffix && /* @__PURE__ */
|
|
6292
|
+
item.suffix && /* @__PURE__ */ jsx36("span", { className: "kjun-kpi-row__affix", children: item.suffix })
|
|
6242
6293
|
] })
|
|
6243
6294
|
}
|
|
6244
6295
|
),
|
|
6245
6296
|
!busy && item.badgePlacement === "value" && badge(item)
|
|
6246
6297
|
] }),
|
|
6247
|
-
item.desc && /* @__PURE__ */
|
|
6298
|
+
item.desc && /* @__PURE__ */ jsx36(
|
|
6248
6299
|
"div",
|
|
6249
6300
|
{
|
|
6250
6301
|
className: "kjun-kpi-row__desc " + (item.descClass || ""),
|
|
6251
6302
|
style: {
|
|
6252
6303
|
color: item.descClass ? void 0 : kpiColor(item.value, item.semantic, "text-secondary")
|
|
6253
6304
|
},
|
|
6254
|
-
children: busy ? /* @__PURE__ */
|
|
6305
|
+
children: busy ? /* @__PURE__ */ jsx36(KjunSkeleton, { type: "block", height: "1lh", width: "7ch" }) : item.desc
|
|
6255
6306
|
}
|
|
6256
6307
|
)
|
|
6257
6308
|
]
|
|
@@ -6329,7 +6380,7 @@ function useMarketCards(props) {
|
|
|
6329
6380
|
}
|
|
6330
6381
|
|
|
6331
6382
|
// packages/react/src/market-parts.tsx
|
|
6332
|
-
import { Fragment as Fragment15, jsx as
|
|
6383
|
+
import { Fragment as Fragment15, jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6333
6384
|
function MarketIdentity({
|
|
6334
6385
|
row,
|
|
6335
6386
|
props
|
|
@@ -6340,15 +6391,15 @@ function MarketIdentity({
|
|
|
6340
6391
|
(_e = props.renderNamePrefix) == null ? void 0 : _e.call(props, row),
|
|
6341
6392
|
/* @__PURE__ */ jsxs30("div", { className: "kjun-market-identity-text", children: [
|
|
6342
6393
|
/* @__PURE__ */ jsxs30("div", { className: "kjun-market-name", children: [
|
|
6343
|
-
/* @__PURE__ */
|
|
6344
|
-
((_f = props.interestKeys) == null ? void 0 : _f.has(id)) && /* @__PURE__ */
|
|
6345
|
-
((_g = props.favoriteKeys) == null ? void 0 : _g.has(id)) && /* @__PURE__ */
|
|
6394
|
+
/* @__PURE__ */ jsx37("span", { title: label, children: label }),
|
|
6395
|
+
((_f = props.interestKeys) == null ? void 0 : _f.has(id)) && /* @__PURE__ */ jsx37(KjunCollectionMark, { kind: "interest", size: "sm", active: true }),
|
|
6396
|
+
((_g = props.favoriteKeys) == null ? void 0 : _g.has(id)) && /* @__PURE__ */ jsx37(KjunCollectionMark, { kind: "favorite", size: "sm", active: true }),
|
|
6346
6397
|
(_h = props.renderNameSuffix) == null ? void 0 : _h.call(props, row)
|
|
6347
6398
|
] }),
|
|
6348
|
-
(meta || props.renderSubMeta) && /* @__PURE__ */
|
|
6399
|
+
(meta || props.renderSubMeta) && /* @__PURE__ */ jsx37("div", { className: "kjun-market-meta", children: ((_i = props.renderSubMeta) == null ? void 0 : _i.call(props, row)) || meta })
|
|
6349
6400
|
] })
|
|
6350
6401
|
] });
|
|
6351
|
-
return /* @__PURE__ */
|
|
6402
|
+
return /* @__PURE__ */ jsx37("div", { className: "kjun-market-identity", children: ((_j = props.renderIdentity) == null ? void 0 : _j.call(props, row, body)) || body });
|
|
6352
6403
|
}
|
|
6353
6404
|
function MarketFooter({
|
|
6354
6405
|
props
|
|
@@ -6364,7 +6415,7 @@ function MarketFooter({
|
|
|
6364
6415
|
unitLabel = "\uAC1C"
|
|
6365
6416
|
} = props;
|
|
6366
6417
|
return /* @__PURE__ */ jsxs30(Fragment15, { children: [
|
|
6367
|
-
pagination && /* @__PURE__ */
|
|
6418
|
+
pagination && /* @__PURE__ */ jsx37(
|
|
6368
6419
|
KjunPagination,
|
|
6369
6420
|
{
|
|
6370
6421
|
currentPage: pagination.page,
|
|
@@ -6377,7 +6428,7 @@ function MarketFooter({
|
|
|
6377
6428
|
),
|
|
6378
6429
|
" ",
|
|
6379
6430
|
showFooter && !state.initialLoading && rows.length > 0 && /* @__PURE__ */ jsxs30("div", { className: "kjun-market-footer", children: [
|
|
6380
|
-
/* @__PURE__ */
|
|
6431
|
+
/* @__PURE__ */ jsx37("span", { children: calculatedAt ? "\uB9C8\uC9C0\uB9C9 \uC5C5\uB370\uC774\uD2B8: " + (((_a = props.formatDate) == null ? void 0 : _a.call(props, calculatedAt)) || calculatedAt) : footerNote }),
|
|
6381
6432
|
/* @__PURE__ */ jsxs30("span", { children: [
|
|
6382
6433
|
"\uCD1D ",
|
|
6383
6434
|
totalCount,
|
|
@@ -6388,7 +6439,7 @@ function MarketFooter({
|
|
|
6388
6439
|
}
|
|
6389
6440
|
|
|
6390
6441
|
// packages/react/src/market-cards.tsx
|
|
6391
|
-
import { Fragment as Fragment16, jsx as
|
|
6442
|
+
import { Fragment as Fragment16, jsx as jsx38, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
6392
6443
|
function KjunMarketCards(props) {
|
|
6393
6444
|
const {
|
|
6394
6445
|
rows = [],
|
|
@@ -6414,7 +6465,7 @@ function KjunMarketCards(props) {
|
|
|
6414
6465
|
}) : value == null ? "-" : String(value);
|
|
6415
6466
|
};
|
|
6416
6467
|
return /* @__PURE__ */ jsxs31("div", { className: "kjun-market-cards", children: [
|
|
6417
|
-
/* @__PURE__ */
|
|
6468
|
+
/* @__PURE__ */ jsx38("div", { className: "kjun-metric-pills", role: "group", "aria-label": "\uD45C\uC2DC \uC9C0\uD45C", children: state.pills.map((pill) => /* @__PURE__ */ jsxs31(
|
|
6418
6469
|
"button",
|
|
6419
6470
|
{
|
|
6420
6471
|
type: "button",
|
|
@@ -6429,7 +6480,7 @@ function KjunMarketCards(props) {
|
|
|
6429
6480
|
},
|
|
6430
6481
|
children: [
|
|
6431
6482
|
pill.label,
|
|
6432
|
-
state.key === pill.key && pill.sortKey && (emitSortOnMount || pill.sortKey === sortKey) && /* @__PURE__ */
|
|
6483
|
+
state.key === pill.key && pill.sortKey && (emitSortOnMount || pill.sortKey === sortKey) && /* @__PURE__ */ jsx38("span", { children: sortOrder === "desc" ? "\u2193" : "\u2191" })
|
|
6433
6484
|
]
|
|
6434
6485
|
},
|
|
6435
6486
|
pill.key
|
|
@@ -6439,16 +6490,16 @@ function KjunMarketCards(props) {
|
|
|
6439
6490
|
selectedPill: state.pill,
|
|
6440
6491
|
metricDisplay: display
|
|
6441
6492
|
}) : /* @__PURE__ */ jsxs31(Fragment16, { children: [
|
|
6442
|
-
/* @__PURE__ */
|
|
6493
|
+
/* @__PURE__ */ jsx38(
|
|
6443
6494
|
KjunDataState,
|
|
6444
6495
|
{
|
|
6445
6496
|
...props,
|
|
6446
6497
|
loadingPadding: "none",
|
|
6447
6498
|
empty: !rows.length,
|
|
6448
|
-
loadingContent: props.skeleton === false ? void 0 : /* @__PURE__ */
|
|
6449
|
-
emptyContent: /* @__PURE__ */
|
|
6499
|
+
loadingContent: props.skeleton === false ? void 0 : /* @__PURE__ */ jsx38(KjunListSkeleton, { variant: "compact" }),
|
|
6500
|
+
emptyContent: /* @__PURE__ */ jsx38(KjunEmpty, { text: emptyMessage, description: emptySubMessage }),
|
|
6450
6501
|
children: /* @__PURE__ */ jsxs31("div", { children: [
|
|
6451
|
-
state.pill && /* @__PURE__ */
|
|
6502
|
+
state.pill && /* @__PURE__ */ jsx38("div", { className: "kjun-market-column-label", children: state.pill.label }),
|
|
6452
6503
|
rows.map((row, i) => {
|
|
6453
6504
|
var _a, _b, _c;
|
|
6454
6505
|
return /* @__PURE__ */ jsxs31(
|
|
@@ -6469,15 +6520,15 @@ function KjunMarketCards(props) {
|
|
|
6469
6520
|
}
|
|
6470
6521
|
},
|
|
6471
6522
|
children: [
|
|
6472
|
-
/* @__PURE__ */
|
|
6473
|
-
/* @__PURE__ */
|
|
6523
|
+
/* @__PURE__ */ jsx38(MarketIdentity, { row, props }),
|
|
6524
|
+
/* @__PURE__ */ jsx38("div", { className: "kjun-market-quote", children: ((_b = state.pill) == null ? void 0 : _b.format) === "sparkline" ? /* @__PURE__ */ jsx38(
|
|
6474
6525
|
KjunSparkline,
|
|
6475
6526
|
{
|
|
6476
6527
|
data: getValue(row, state.key) || [],
|
|
6477
6528
|
width: tokens34.extensions.marketTable.sparklineWidth,
|
|
6478
6529
|
height: tokens34.extensions.marketTable.sparklineHeight
|
|
6479
6530
|
}
|
|
6480
|
-
) : state.pill ? /* @__PURE__ */
|
|
6531
|
+
) : state.pill ? /* @__PURE__ */ jsx38(Fragment16, { children: metricLoading(row, state.key) ? /* @__PURE__ */ jsx38(KjunSkeleton, { type: "block", height: tokens34.extensions.marketTable.valueSkeletonHeight, width: tokens34.extensions.marketTable.valueSkeletonWidth }) : isChange && getValue(row, state.key) != null ? /* @__PURE__ */ jsx38(
|
|
6481
6532
|
KjunSignedValue,
|
|
6482
6533
|
{
|
|
6483
6534
|
value: finiteNumber(getValue(row, state.key)),
|
|
@@ -6485,7 +6536,7 @@ function KjunMarketCards(props) {
|
|
|
6485
6536
|
stale: !!getValue(row, "stale"),
|
|
6486
6537
|
tone: "pill"
|
|
6487
6538
|
}
|
|
6488
|
-
) : isPrice && getValue(row, state.key) == null ? /* @__PURE__ */
|
|
6539
|
+
) : isPrice && getValue(row, state.key) == null ? /* @__PURE__ */ jsx38(KjunSkeleton, { type: "block", height: tokens34.extensions.financial.priceSkeletonHeight, width: tokens34.extensions.financial.priceSkeletonWidth }) : /* @__PURE__ */ jsxs31("div", { className: "kjun-market-metric", children: [
|
|
6489
6540
|
(_c = props.renderMetricPrefix) == null ? void 0 : _c.call(
|
|
6490
6541
|
props,
|
|
6491
6542
|
row,
|
|
@@ -6502,14 +6553,14 @@ function KjunMarketCards(props) {
|
|
|
6502
6553
|
] })
|
|
6503
6554
|
}
|
|
6504
6555
|
),
|
|
6505
|
-
/* @__PURE__ */
|
|
6556
|
+
/* @__PURE__ */ jsx38(MarketFooter, { props })
|
|
6506
6557
|
] })
|
|
6507
6558
|
] });
|
|
6508
6559
|
}
|
|
6509
6560
|
|
|
6510
6561
|
// packages/react/src/market-list.tsx
|
|
6511
6562
|
import { tokens as tokens35 } from "@kjun-ui/tokens";
|
|
6512
|
-
import { jsx as
|
|
6563
|
+
import { jsx as jsx39, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
6513
6564
|
function KjunMarketSimpleList(props) {
|
|
6514
6565
|
const {
|
|
6515
6566
|
rows = [],
|
|
@@ -6523,16 +6574,16 @@ function KjunMarketSimpleList(props) {
|
|
|
6523
6574
|
emptySubMessage = ""
|
|
6524
6575
|
} = props;
|
|
6525
6576
|
return /* @__PURE__ */ jsxs32("div", { className: "kjun-market-simple-list", children: [
|
|
6526
|
-
/* @__PURE__ */
|
|
6577
|
+
/* @__PURE__ */ jsx39(
|
|
6527
6578
|
KjunDataState,
|
|
6528
6579
|
{
|
|
6529
6580
|
...props,
|
|
6530
6581
|
loadingPadding: "none",
|
|
6531
6582
|
empty: !rows.length,
|
|
6532
6583
|
emptyText: emptyMessage,
|
|
6533
|
-
loadingContent: props.skeleton === false ? void 0 : /* @__PURE__ */
|
|
6534
|
-
emptyContent: /* @__PURE__ */
|
|
6535
|
-
children: /* @__PURE__ */
|
|
6584
|
+
loadingContent: props.skeleton === false ? void 0 : /* @__PURE__ */ jsx39(KjunListSkeleton, {}),
|
|
6585
|
+
emptyContent: /* @__PURE__ */ jsx39(KjunEmpty, { text: emptyMessage, description: emptySubMessage }),
|
|
6586
|
+
children: /* @__PURE__ */ jsx39("div", { children: rows.map((row, i) => {
|
|
6536
6587
|
var _a, _b;
|
|
6537
6588
|
const price = priceValue(row), change = changeValue(row), stale = !!getValue(row, "stale"), source = String(getValue(row, "source") || ""), fetchedAt = String(getValue(row, "fetched_at") || "");
|
|
6538
6589
|
return /* @__PURE__ */ jsxs32(
|
|
@@ -6553,9 +6604,9 @@ function KjunMarketSimpleList(props) {
|
|
|
6553
6604
|
}
|
|
6554
6605
|
},
|
|
6555
6606
|
children: [
|
|
6556
|
-
/* @__PURE__ */
|
|
6607
|
+
/* @__PURE__ */ jsx39(MarketIdentity, { row, props }),
|
|
6557
6608
|
/* @__PURE__ */ jsxs32("div", { className: "kjun-market-quote", children: [
|
|
6558
|
-
/* @__PURE__ */
|
|
6609
|
+
/* @__PURE__ */ jsx39("div", { className: "kjun-market-price", children: /* @__PURE__ */ jsx39(
|
|
6559
6610
|
KjunPriceCell,
|
|
6560
6611
|
{
|
|
6561
6612
|
value: price,
|
|
@@ -6566,7 +6617,7 @@ function KjunMarketSimpleList(props) {
|
|
|
6566
6617
|
) }),
|
|
6567
6618
|
/* @__PURE__ */ jsxs32("div", { className: "kjun-market-change", children: [
|
|
6568
6619
|
price !== null && ((_b = props.renderPricePrefix) == null ? void 0 : _b.call(props, row)),
|
|
6569
|
-
(finiteNumber(price) !== null || !changeLoading(row) && finiteNumber(change) !== null) && (closingPrice && !stale ? /* @__PURE__ */
|
|
6620
|
+
(finiteNumber(price) !== null || !changeLoading(row) && finiteNumber(change) !== null) && (closingPrice && !stale ? /* @__PURE__ */ jsx39(KjunBadge, { variant: "secondary", size: "xs", children: "\uC885\uAC00" }) : /* @__PURE__ */ jsx39(
|
|
6570
6621
|
KjunFreshness,
|
|
6571
6622
|
{
|
|
6572
6623
|
stale,
|
|
@@ -6574,7 +6625,7 @@ function KjunMarketSimpleList(props) {
|
|
|
6574
6625
|
fetchedAt
|
|
6575
6626
|
}
|
|
6576
6627
|
)),
|
|
6577
|
-
changeLoading(row) ? /* @__PURE__ */
|
|
6628
|
+
changeLoading(row) ? /* @__PURE__ */ jsx39(KjunSkeleton, { type: "block", height: tokens35.extensions.marketList.changeSkeletonHeight, width: tokens35.extensions.marketList.changeSkeletonWidth }) : change !== null ? /* @__PURE__ */ jsx39(
|
|
6578
6629
|
KjunSignedValue,
|
|
6579
6630
|
{
|
|
6580
6631
|
value: change,
|
|
@@ -6583,7 +6634,7 @@ function KjunMarketSimpleList(props) {
|
|
|
6583
6634
|
format: "percent",
|
|
6584
6635
|
isRaw: true
|
|
6585
6636
|
}
|
|
6586
|
-
) : /* @__PURE__ */
|
|
6637
|
+
) : /* @__PURE__ */ jsx39("span", { children: "-" })
|
|
6587
6638
|
] })
|
|
6588
6639
|
] })
|
|
6589
6640
|
]
|
|
@@ -6593,20 +6644,20 @@ function KjunMarketSimpleList(props) {
|
|
|
6593
6644
|
}) })
|
|
6594
6645
|
}
|
|
6595
6646
|
),
|
|
6596
|
-
/* @__PURE__ */
|
|
6647
|
+
/* @__PURE__ */ jsx39(MarketFooter, { props })
|
|
6597
6648
|
] });
|
|
6598
6649
|
}
|
|
6599
6650
|
|
|
6600
6651
|
// packages/react/src/market-panel.tsx
|
|
6601
6652
|
import { tokens as tokens36 } from "@kjun-ui/tokens";
|
|
6602
|
-
import { jsx as
|
|
6653
|
+
import { jsx as jsx40, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
6603
6654
|
function KjunMarketListPanel({
|
|
6604
6655
|
controls,
|
|
6605
6656
|
children
|
|
6606
6657
|
}) {
|
|
6607
6658
|
return /* @__PURE__ */ jsxs33(KjunCard, { children: [
|
|
6608
|
-
/* @__PURE__ */
|
|
6609
|
-
/* @__PURE__ */
|
|
6659
|
+
/* @__PURE__ */ jsx40("div", { children: controls }),
|
|
6660
|
+
/* @__PURE__ */ jsx40("div", { style: { marginTop: tokens36.dimension.value16, borderTop: `${tokens36.border.defaultWidth}px solid var(--_kjun-color-border)` }, children })
|
|
6610
6661
|
] });
|
|
6611
6662
|
}
|
|
6612
6663
|
|
|
@@ -6629,7 +6680,7 @@ function watchTrailingOverflow(element, onChange) {
|
|
|
6629
6680
|
|
|
6630
6681
|
// packages/react/src/market-table.tsx
|
|
6631
6682
|
import { useEffect as useEffect20, useRef as useRef27, useState as useState28 } from "react";
|
|
6632
|
-
import { jsx as
|
|
6683
|
+
import { jsx as jsx41, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
6633
6684
|
function KjunMarketTable(props) {
|
|
6634
6685
|
const {
|
|
6635
6686
|
rows = [],
|
|
@@ -6654,12 +6705,12 @@ function KjunMarketTable(props) {
|
|
|
6654
6705
|
const render = (row, col) => {
|
|
6655
6706
|
const value = getValue(row, col.key), stale = !!getValue(row, "stale");
|
|
6656
6707
|
if (cellLoading(row, col))
|
|
6657
|
-
return /* @__PURE__ */
|
|
6708
|
+
return /* @__PURE__ */ jsx41(KjunSkeleton, { type: "block", height: tokens37.extensions.marketTable.valueSkeletonHeight, width: tokens37.extensions.marketTable.valueSkeletonWidth });
|
|
6658
6709
|
if (renderCell) return renderCell(row, col);
|
|
6659
6710
|
if (["stock_name", "name", "symbol"].includes(col.key))
|
|
6660
|
-
return /* @__PURE__ */
|
|
6711
|
+
return /* @__PURE__ */ jsx41(MarketIdentity, { row, props });
|
|
6661
6712
|
if (col.type === "sparkline")
|
|
6662
|
-
return /* @__PURE__ */
|
|
6713
|
+
return /* @__PURE__ */ jsx41(
|
|
6663
6714
|
KjunSparkline,
|
|
6664
6715
|
{
|
|
6665
6716
|
data: Array.isArray(value) ? value : [],
|
|
@@ -6668,7 +6719,7 @@ function KjunMarketTable(props) {
|
|
|
6668
6719
|
}
|
|
6669
6720
|
);
|
|
6670
6721
|
if (col.type === "price")
|
|
6671
|
-
return /* @__PURE__ */
|
|
6722
|
+
return /* @__PURE__ */ jsx41(
|
|
6672
6723
|
KjunPriceCell,
|
|
6673
6724
|
{
|
|
6674
6725
|
value: finiteNumber(value),
|
|
@@ -6678,7 +6729,7 @@ function KjunMarketTable(props) {
|
|
|
6678
6729
|
}
|
|
6679
6730
|
);
|
|
6680
6731
|
if (col.type === "percent")
|
|
6681
|
-
return value == null ? "-" : /* @__PURE__ */
|
|
6732
|
+
return value == null ? "-" : /* @__PURE__ */ jsx41(
|
|
6682
6733
|
KjunSignedValue,
|
|
6683
6734
|
{
|
|
6684
6735
|
value: finiteNumber(value),
|
|
@@ -6694,7 +6745,7 @@ function KjunMarketTable(props) {
|
|
|
6694
6745
|
}
|
|
6695
6746
|
);
|
|
6696
6747
|
const text = formatMetric ? formatMetric(value, col.type || "text", { currency, row, column: col }) : value == null ? "-" : String(value);
|
|
6697
|
-
return ["investor", "net_amount", "net_volume"].includes(col.type || "") ? /* @__PURE__ */
|
|
6748
|
+
return ["investor", "net_amount", "net_volume"].includes(col.type || "") ? /* @__PURE__ */ jsx41(
|
|
6698
6749
|
KjunSignedValue,
|
|
6699
6750
|
{
|
|
6700
6751
|
value: finiteNumber(value),
|
|
@@ -6711,23 +6762,23 @@ function KjunMarketTable(props) {
|
|
|
6711
6762
|
"data-embedded": embedded,
|
|
6712
6763
|
ref: domainColorRef(showActions && rows.length > 0 && !props.loading),
|
|
6713
6764
|
children: [
|
|
6714
|
-
/* @__PURE__ */
|
|
6765
|
+
/* @__PURE__ */ jsx41(
|
|
6715
6766
|
KjunDataState,
|
|
6716
6767
|
{
|
|
6717
6768
|
...props,
|
|
6718
6769
|
loadingPadding: "none",
|
|
6719
6770
|
empty: !rows.length,
|
|
6720
6771
|
emptyText: emptyMessage,
|
|
6721
|
-
loadingContent: props.skeleton === false ? void 0 : /* @__PURE__ */
|
|
6722
|
-
emptyContent: /* @__PURE__ */
|
|
6723
|
-
children: /* @__PURE__ */
|
|
6724
|
-
/* @__PURE__ */
|
|
6725
|
-
/* @__PURE__ */
|
|
6772
|
+
loadingContent: props.skeleton === false ? void 0 : /* @__PURE__ */ jsx41(KjunMarketTableSkeleton, { columns, showActions }),
|
|
6773
|
+
emptyContent: /* @__PURE__ */ jsx41(KjunEmpty, { text: emptyMessage, description: emptySubMessage }),
|
|
6774
|
+
children: /* @__PURE__ */ jsx41("div", { className: "kjun-table-scroll", ref: scroller, "data-fade-end": fadeEnd || void 0, children: /* @__PURE__ */ jsxs34("table", { "aria-label": "\uC2DC\uC7A5 \uB370\uC774\uD130", className: "kjun-market-table-grid", style: webMarketLayout(columns, showActions).tableStyle, children: [
|
|
6775
|
+
/* @__PURE__ */ jsx41(MarketColumns, { columns, showActions }),
|
|
6776
|
+
/* @__PURE__ */ jsx41("thead", { children: /* @__PURE__ */ jsxs34("tr", { children: [
|
|
6726
6777
|
showActions && /* @__PURE__ */ jsxs34("th", { className: "kjun-market-actions", children: [
|
|
6727
|
-
/* @__PURE__ */
|
|
6728
|
-
/* @__PURE__ */
|
|
6778
|
+
/* @__PURE__ */ jsx41("span", { className: "kjun-market-actions-mark", children: /* @__PURE__ */ jsx41(KjunCollectionMark, { kind: "interest", size: "md" }) }),
|
|
6779
|
+
/* @__PURE__ */ jsx41("span", { className: "kjun-market-actions-mark", children: /* @__PURE__ */ jsx41(KjunCollectionMark, { kind: "favorite", size: "md" }) })
|
|
6729
6780
|
] }),
|
|
6730
|
-
columns.map((col) => /* @__PURE__ */
|
|
6781
|
+
columns.map((col) => /* @__PURE__ */ jsx41(
|
|
6731
6782
|
"th",
|
|
6732
6783
|
{
|
|
6733
6784
|
style: { textAlign: col.align },
|
|
@@ -6742,7 +6793,7 @@ function KjunMarketTable(props) {
|
|
|
6742
6793
|
},
|
|
6743
6794
|
children: [
|
|
6744
6795
|
col.label,
|
|
6745
|
-
/* @__PURE__ */
|
|
6796
|
+
/* @__PURE__ */ jsx41(
|
|
6746
6797
|
KjunIcon,
|
|
6747
6798
|
{
|
|
6748
6799
|
name: sortKey === col.key ? sortOrder === "asc" ? "sort-ascending" : "sort-descending" : "arrows-sort",
|
|
@@ -6756,7 +6807,7 @@ function KjunMarketTable(props) {
|
|
|
6756
6807
|
col.key
|
|
6757
6808
|
))
|
|
6758
6809
|
] }) }),
|
|
6759
|
-
/* @__PURE__ */
|
|
6810
|
+
/* @__PURE__ */ jsx41("tbody", { children: rows.map((row, i) => {
|
|
6760
6811
|
var _a, _b, _c, _d, _e, _f;
|
|
6761
6812
|
const id = getValue(row, rowKey), priceCol = columns.find(
|
|
6762
6813
|
(c) => c.type === "price" && !cellLoading(row, c) && getValue(row, c.key) != null
|
|
@@ -6770,7 +6821,7 @@ function KjunMarketTable(props) {
|
|
|
6770
6821
|
},
|
|
6771
6822
|
children: [
|
|
6772
6823
|
showActions && /* @__PURE__ */ jsxs34("td", { className: "kjun-market-actions", children: [
|
|
6773
|
-
/* @__PURE__ */
|
|
6824
|
+
/* @__PURE__ */ jsx41(
|
|
6774
6825
|
KjunIconToggle,
|
|
6775
6826
|
{
|
|
6776
6827
|
size: "xs",
|
|
@@ -6789,7 +6840,7 @@ function KjunMarketTable(props) {
|
|
|
6789
6840
|
}
|
|
6790
6841
|
}
|
|
6791
6842
|
),
|
|
6792
|
-
/* @__PURE__ */
|
|
6843
|
+
/* @__PURE__ */ jsx41(
|
|
6793
6844
|
KjunIconToggle,
|
|
6794
6845
|
{
|
|
6795
6846
|
size: "xs",
|
|
@@ -6818,7 +6869,7 @@ function KjunMarketTable(props) {
|
|
|
6818
6869
|
},
|
|
6819
6870
|
children: [
|
|
6820
6871
|
render(row, col),
|
|
6821
|
-
col.key === (priceCol == null ? void 0 : priceCol.key) && /* @__PURE__ */
|
|
6872
|
+
col.key === (priceCol == null ? void 0 : priceCol.key) && /* @__PURE__ */ jsx41(
|
|
6822
6873
|
KjunFreshness,
|
|
6823
6874
|
{
|
|
6824
6875
|
stale: !!getValue(row, "stale"),
|
|
@@ -6840,7 +6891,7 @@ function KjunMarketTable(props) {
|
|
|
6840
6891
|
] }) })
|
|
6841
6892
|
}
|
|
6842
6893
|
),
|
|
6843
|
-
/* @__PURE__ */
|
|
6894
|
+
/* @__PURE__ */ jsx41(MarketFooter, { props })
|
|
6844
6895
|
]
|
|
6845
6896
|
}
|
|
6846
6897
|
);
|
|
@@ -6848,20 +6899,20 @@ function KjunMarketTable(props) {
|
|
|
6848
6899
|
|
|
6849
6900
|
// packages/react/src/list.tsx
|
|
6850
6901
|
import { useId as useId12 } from "react";
|
|
6851
|
-
import { Fragment as Fragment17, jsx as
|
|
6902
|
+
import { Fragment as Fragment17, jsx as jsx42, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
6852
6903
|
function KjunListRow({ title, description, leading, trailing, actions, href, disabled = false, onClick }) {
|
|
6853
6904
|
const contents = /* @__PURE__ */ jsxs35(Fragment17, { children: [
|
|
6854
|
-
leading && /* @__PURE__ */
|
|
6905
|
+
leading && /* @__PURE__ */ jsx42("span", { className: "kjun-list-leading", children: leading }),
|
|
6855
6906
|
/* @__PURE__ */ jsxs35("span", { className: "kjun-list-body", children: [
|
|
6856
|
-
/* @__PURE__ */
|
|
6857
|
-
description && /* @__PURE__ */
|
|
6907
|
+
/* @__PURE__ */ jsx42("span", { className: "kjun-list-title", children: title }),
|
|
6908
|
+
description && /* @__PURE__ */ jsx42("span", { className: "kjun-list-description", children: description })
|
|
6858
6909
|
] }),
|
|
6859
|
-
trailing && /* @__PURE__ */
|
|
6910
|
+
trailing && /* @__PURE__ */ jsx42("span", { className: "kjun-list-trailing", children: trailing })
|
|
6860
6911
|
] });
|
|
6861
|
-
const main = href ? /* @__PURE__ */
|
|
6912
|
+
const main = href ? /* @__PURE__ */ jsx42("a", { className: "kjun-list-main", href: disabled ? void 0 : href, "aria-disabled": disabled || void 0, onClick: disabled ? (e) => e.preventDefault() : onClick, children: contents }) : onClick ? /* @__PURE__ */ jsx42("button", { className: "kjun-list-main", type: "button", disabled, onClick, children: contents }) : /* @__PURE__ */ jsx42("div", { className: "kjun-list-main", children: contents });
|
|
6862
6913
|
return /* @__PURE__ */ jsxs35("li", { className: "kjun-list-row", children: [
|
|
6863
6914
|
main,
|
|
6864
|
-
actions && /* @__PURE__ */
|
|
6915
|
+
actions && /* @__PURE__ */ jsx42("div", { className: "kjun-list-actions", "data-disabled": disabled || void 0, inert: disabled || void 0, children: actions })
|
|
6865
6916
|
] });
|
|
6866
6917
|
}
|
|
6867
6918
|
function KjunListSection({ title, description, actions, children, ariaLabel }) {
|
|
@@ -6869,39 +6920,39 @@ function KjunListSection({ title, description, actions, children, ariaLabel }) {
|
|
|
6869
6920
|
return /* @__PURE__ */ jsxs35("section", { className: "kjun-list-section", "aria-labelledby": title ? id : void 0, "aria-label": title ? void 0 : ariaLabel, children: [
|
|
6870
6921
|
(title || description || actions) && /* @__PURE__ */ jsxs35("div", { className: "kjun-list-heading", children: [
|
|
6871
6922
|
/* @__PURE__ */ jsxs35("div", { children: [
|
|
6872
|
-
title && /* @__PURE__ */
|
|
6873
|
-
description && /* @__PURE__ */
|
|
6923
|
+
title && /* @__PURE__ */ jsx42("h3", { id, children: title }),
|
|
6924
|
+
description && /* @__PURE__ */ jsx42("p", { children: description })
|
|
6874
6925
|
] }),
|
|
6875
6926
|
actions
|
|
6876
6927
|
] }),
|
|
6877
|
-
/* @__PURE__ */
|
|
6928
|
+
/* @__PURE__ */ jsx42("ul", { className: "kjun-list", "aria-label": ariaLabel || title, children })
|
|
6878
6929
|
] });
|
|
6879
6930
|
}
|
|
6880
6931
|
|
|
6881
6932
|
// packages/react/src/app-navigation.tsx
|
|
6882
6933
|
import { tokens as tokens38 } from "@kjun-ui/tokens";
|
|
6883
|
-
import { jsx as
|
|
6934
|
+
import { jsx as jsx43, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
6884
6935
|
function KjunTopNavigation({ title, description, leading, actions, safeAreaTop = 0 }) {
|
|
6885
|
-
return /* @__PURE__ */
|
|
6886
|
-
leading && /* @__PURE__ */
|
|
6936
|
+
return /* @__PURE__ */ jsx43(TopNavigationContext.Provider, { value: tokens38.extensions.topNavigation, children: /* @__PURE__ */ jsx43("header", { className: "kjun-top-navigation", style: { paddingTop: Math.max(0, safeAreaTop) }, children: /* @__PURE__ */ jsxs36("div", { className: "kjun-navigation-content", children: [
|
|
6937
|
+
leading && /* @__PURE__ */ jsx43("div", { className: "kjun-navigation-leading", children: leading }),
|
|
6887
6938
|
/* @__PURE__ */ jsxs36("div", { className: "kjun-navigation-title", children: [
|
|
6888
|
-
/* @__PURE__ */
|
|
6889
|
-
description && /* @__PURE__ */
|
|
6939
|
+
/* @__PURE__ */ jsx43("strong", { children: title }),
|
|
6940
|
+
description && /* @__PURE__ */ jsx43("p", { children: description })
|
|
6890
6941
|
] }),
|
|
6891
|
-
actions && /* @__PURE__ */
|
|
6942
|
+
actions && /* @__PURE__ */ jsx43("div", { className: "kjun-navigation-actions", children: actions })
|
|
6892
6943
|
] }) }) });
|
|
6893
6944
|
}
|
|
6894
6945
|
function KjunBottomNavigation({ items, value, ariaLabel = "\uC8FC\uC694 \uD0D0\uC0C9", safeAreaBottom = 0, keyboardVisible = false, hideOnKeyboard = true, onNavigate }) {
|
|
6895
6946
|
const hasIcons = items.some((item) => item.icon);
|
|
6896
6947
|
if (keyboardVisible && hideOnKeyboard) return null;
|
|
6897
|
-
return /* @__PURE__ */
|
|
6898
|
-
const badge = item.badge != null && /* @__PURE__ */
|
|
6948
|
+
return /* @__PURE__ */ jsx43("nav", { className: "kjun-bottom-navigation", "data-icons": hasIcons || void 0, "aria-label": ariaLabel, style: { paddingBottom: Math.max(0, safeAreaBottom) }, children: items.map((item) => {
|
|
6949
|
+
const badge = item.badge != null && /* @__PURE__ */ jsx43("span", { className: "kjun-navigation-badge", "aria-hidden": "true", children: item.badge });
|
|
6899
6950
|
return /* @__PURE__ */ jsxs36("a", { href: item.disabled ? void 0 : item.href, "aria-label": item.label + (item.badge != null ? ", " + item.badge : ""), "aria-disabled": item.disabled || void 0, "aria-current": value === item.key ? "page" : void 0, onClick: (event) => {
|
|
6900
6951
|
if (item.disabled) event.preventDefault();
|
|
6901
6952
|
else onNavigate == null ? void 0 : onNavigate(item.key, event);
|
|
6902
6953
|
}, children: [
|
|
6903
6954
|
hasIcons && /* @__PURE__ */ jsxs36("span", { className: "kjun-navigation-icon", children: [
|
|
6904
|
-
item.icon && /* @__PURE__ */
|
|
6955
|
+
item.icon && /* @__PURE__ */ jsx43(KjunIcon, { name: item.icon, size: tokens38.extensions.bottomNavigation.iconSize }),
|
|
6905
6956
|
badge
|
|
6906
6957
|
] }),
|
|
6907
6958
|
/* @__PURE__ */ jsxs36("span", { className: "kjun-navigation-label", children: [
|
|
@@ -6913,16 +6964,16 @@ function KjunBottomNavigation({ items, value, ariaLabel = "\uC8FC\uC694 \uD0D0\u
|
|
|
6913
6964
|
}
|
|
6914
6965
|
function KjunBottomActionBar({ description, children, safeAreaBottom = 0, keyboardVisible = false, hideOnKeyboard = false }) {
|
|
6915
6966
|
if (keyboardVisible && hideOnKeyboard) return null;
|
|
6916
|
-
return /* @__PURE__ */
|
|
6917
|
-
description && /* @__PURE__ */
|
|
6918
|
-
/* @__PURE__ */
|
|
6967
|
+
return /* @__PURE__ */ jsx43("div", { className: "kjun-bottom-action-bar", style: { paddingBottom: tokens38.extensions.navigation.padding + Math.max(0, safeAreaBottom) }, children: /* @__PURE__ */ jsxs36("div", { className: "kjun-bottom-action-content", children: [
|
|
6968
|
+
description && /* @__PURE__ */ jsx43("p", { children: description }),
|
|
6969
|
+
/* @__PURE__ */ jsx43("div", { className: "kjun-navigation-actions", children })
|
|
6919
6970
|
] }) });
|
|
6920
6971
|
}
|
|
6921
6972
|
|
|
6922
6973
|
// packages/react/src/media.tsx
|
|
6923
6974
|
import { useRef as useRef28, useState as useState29 } from "react";
|
|
6924
6975
|
import { tokens as tokens39 } from "@kjun-ui/tokens";
|
|
6925
|
-
import { jsx as
|
|
6976
|
+
import { jsx as jsx44, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
6926
6977
|
function KjunImage({ src, alt, decorative = false, aspectRatio = 1, fit = "cover", fallback: fallback2, lazy = true, onLoad, onError }) {
|
|
6927
6978
|
const current = useRef28({ src, version: 0 });
|
|
6928
6979
|
if (current.current.src !== src) current.current = { src, version: current.current.version + 1 };
|
|
@@ -6931,7 +6982,7 @@ function KjunImage({ src, alt, decorative = false, aspectRatio = 1, fit = "cover
|
|
|
6931
6982
|
const state = result.version === version ? result.state : "loading";
|
|
6932
6983
|
const failed = !src || state === "error";
|
|
6933
6984
|
return /* @__PURE__ */ jsxs37("span", { className: "kjun-image", style: { aspectRatio: aspectRatio > 0 ? aspectRatio : 1 }, "data-state": failed ? "error" : state, children: [
|
|
6934
|
-
!failed && /* @__PURE__ */
|
|
6985
|
+
!failed && /* @__PURE__ */ jsx44("img", { src, alt: decorative ? "" : alt, loading: lazy ? "lazy" : "eager", style: { objectFit: fit }, onLoad: () => {
|
|
6935
6986
|
if (current.current.version !== version) return;
|
|
6936
6987
|
setResult({ version, state: "loaded" });
|
|
6937
6988
|
onLoad == null ? void 0 : onLoad();
|
|
@@ -6940,21 +6991,21 @@ function KjunImage({ src, alt, decorative = false, aspectRatio = 1, fit = "cover
|
|
|
6940
6991
|
setResult({ version, state: "error" });
|
|
6941
6992
|
onError == null ? void 0 : onError();
|
|
6942
6993
|
} }, version),
|
|
6943
|
-
failed && /* @__PURE__ */
|
|
6994
|
+
failed && /* @__PURE__ */ jsx44("span", { className: "kjun-image-fallback", role: decorative ? void 0 : "img", "aria-label": decorative ? void 0 : alt, "aria-hidden": decorative || void 0, children: fallback2 != null ? fallback2 : /* @__PURE__ */ jsx44(KjunIcon, { name: "image", size: tokens39.extensions.image.fallbackIconSize }) })
|
|
6944
6995
|
] });
|
|
6945
6996
|
}
|
|
6946
6997
|
function KjunAvatar({ src, name = "", alt, decorative = false, size = "md", shape = "circle", fallback: fallback2, onLoad, onError }) {
|
|
6947
|
-
return /* @__PURE__ */
|
|
6998
|
+
return /* @__PURE__ */ jsx44("span", { className: "kjun-avatar", "data-shape": shape, "data-size": size, style: { width: tokens39.extensions.avatar[size], height: tokens39.extensions.avatar[size] }, children: /* @__PURE__ */ jsx44(KjunImage, { src, alt: alt || name || "\uC0AC\uC6A9\uC790", decorative, fallback: fallback2 != null ? fallback2 : Array.from(name.trim())[0] || /* @__PURE__ */ jsx44(KjunIcon, { name: "user", size: tokens39.extensions.avatar.fallbackIconSizes[size] }), onLoad, onError }) });
|
|
6948
6999
|
}
|
|
6949
7000
|
|
|
6950
7001
|
// packages/react/src/chip.tsx
|
|
6951
7002
|
import { tokens as tokens40 } from "@kjun-ui/tokens";
|
|
6952
|
-
import { jsx as
|
|
7003
|
+
import { jsx as jsx45, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
6953
7004
|
function KjunChip({ label, icon, removable = false, disabled = false, size = "md", removeLabel, onRemove }) {
|
|
6954
7005
|
return /* @__PURE__ */ jsxs38("span", { className: "kjun-chip", "data-size": size, "data-disabled": disabled, "data-removable": removable, children: [
|
|
6955
|
-
icon && /* @__PURE__ */
|
|
6956
|
-
/* @__PURE__ */
|
|
6957
|
-
removable && /* @__PURE__ */
|
|
7006
|
+
icon && /* @__PURE__ */ jsx45(KjunIcon, { name: icon, size: tokens40.extensions.chip.iconSizes[size] }),
|
|
7007
|
+
/* @__PURE__ */ jsx45("span", { children: label }),
|
|
7008
|
+
removable && /* @__PURE__ */ jsx45("button", { type: "button", "aria-label": removeLabel || label + " \uC0AD\uC81C", disabled, onClick: onRemove, children: /* @__PURE__ */ jsx45(KjunIcon, { name: "x", size: tokens40.extensions.chip.removeIconSizes[size] }) })
|
|
6958
7009
|
] });
|
|
6959
7010
|
}
|
|
6960
7011
|
|
|
@@ -6962,7 +7013,7 @@ function KjunChip({ label, icon, removable = false, disabled = false, size = "md
|
|
|
6962
7013
|
import { useEffect as useEffect21, useRef as useRef29 } from "react";
|
|
6963
7014
|
import { Slider, SliderTrack, SliderThumb, Label, SliderOutput } from "react-aria-components";
|
|
6964
7015
|
import { createSliderDomain } from "@kjun-ui/tokens";
|
|
6965
|
-
import { Fragment as Fragment18, jsx as
|
|
7016
|
+
import { Fragment as Fragment18, jsx as jsx46, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
6966
7017
|
function RangeInput({ value, min = 0, max = 100, step = 1, disabled = false, label, ariaLabel, onValueChange, onChangeCommit, ...rest }) {
|
|
6967
7018
|
const thumbLabels = "thumbLabels" in rest ? rest.thumbLabels || ["\uCD5C\uC19F\uAC12", "\uCD5C\uB313\uAC12"] : ["\uCD5C\uC19F\uAC12", "\uCD5C\uB313\uAC12"];
|
|
6968
7019
|
const domain = createSliderDomain(min, max, step);
|
|
@@ -6990,27 +7041,27 @@ function RangeInput({ value, min = 0, max = 100, step = 1, disabled = false, lab
|
|
|
6990
7041
|
}
|
|
6991
7042
|
}, children: [
|
|
6992
7043
|
/* @__PURE__ */ jsxs39("div", { className: "kjun-slider-caption", children: [
|
|
6993
|
-
label && /* @__PURE__ */
|
|
6994
|
-
/* @__PURE__ */
|
|
7044
|
+
label && /* @__PURE__ */ jsx46(Label, { className: "kjun-slider-label", children: label }),
|
|
7045
|
+
/* @__PURE__ */ jsx46(SliderOutput, { className: "kjun-slider-value", children: ({ state }) => state.values.join(" \u2013 ") })
|
|
6995
7046
|
] }),
|
|
6996
|
-
/* @__PURE__ */
|
|
6997
|
-
/* @__PURE__ */
|
|
6998
|
-
/* @__PURE__ */
|
|
6999
|
-
list.map((_, i) => /* @__PURE__ */
|
|
7047
|
+
/* @__PURE__ */ jsx46(SliderTrack, { className: "kjun-slider-track", children: ({ state }) => /* @__PURE__ */ jsxs39(Fragment18, { children: [
|
|
7048
|
+
/* @__PURE__ */ jsx46("div", { className: "kjun-slider-rail" }),
|
|
7049
|
+
/* @__PURE__ */ jsx46("div", { className: "kjun-slider-fill", style: { left: (list.length === 2 ? state.getThumbPercent(0) * 100 : 0) + "%", width: (state.getThumbPercent(list.length - 1) - (list.length === 2 ? state.getThumbPercent(0) : 0)) * 100 + "%" } }),
|
|
7050
|
+
list.map((_, i) => /* @__PURE__ */ jsx46(SliderThumb, { index: i, className: "kjun-slider-thumb", "aria-label": list.length === 2 ? thumbLabels[i] : ariaLabel || label || "\uAC12" }, i))
|
|
7000
7051
|
] }) })
|
|
7001
7052
|
] });
|
|
7002
7053
|
}
|
|
7003
7054
|
function KjunSlider(props) {
|
|
7004
|
-
return /* @__PURE__ */
|
|
7055
|
+
return /* @__PURE__ */ jsx46(RangeInput, { ...props });
|
|
7005
7056
|
}
|
|
7006
7057
|
function KjunRangeSlider(props) {
|
|
7007
|
-
return /* @__PURE__ */
|
|
7058
|
+
return /* @__PURE__ */ jsx46(RangeInput, { ...props });
|
|
7008
7059
|
}
|
|
7009
7060
|
|
|
7010
7061
|
// packages/react/src/quantity-stepper.tsx
|
|
7011
7062
|
import { useEffect as useEffect22, useRef as useRef30, useState as useState30 } from "react";
|
|
7012
7063
|
import { createNumberDomain, quantityKeyAction, tokens as tokens41 } from "@kjun-ui/tokens";
|
|
7013
|
-
import { jsx as
|
|
7064
|
+
import { jsx as jsx47, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
7014
7065
|
function KjunQuantityStepper({ value, min = 0, max, step = 1, precision = 0, disabled = false, error = false, size = "md", block = false, id, ariaLabel, onValueChange, onChangeCommit, onInvalidInput }) {
|
|
7015
7066
|
const geometry = tokens41.extensions.compound;
|
|
7016
7067
|
const buttonStyle = { width: tokens41.input[size].height, padding: 0 };
|
|
@@ -7058,9 +7109,9 @@ function KjunQuantityStepper({ value, min = 0, max, step = 1, precision = 0, dis
|
|
|
7058
7109
|
} else if (action === "commit") commit();
|
|
7059
7110
|
else move(action === "increment" ? 1 : -1);
|
|
7060
7111
|
};
|
|
7061
|
-
return /* @__PURE__ */
|
|
7062
|
-
/* @__PURE__ */
|
|
7063
|
-
/* @__PURE__ */
|
|
7112
|
+
return /* @__PURE__ */ jsx47(IconFallbacks, { icons: componentIcons, children: /* @__PURE__ */ jsxs40("div", { className: "kjun-quantity", "data-size": size, "data-block": block, "data-error": error || !!(field == null ? void 0 : field.error), children: [
|
|
7113
|
+
/* @__PURE__ */ jsx47(KjunButton, { size, style: buttonStyle, variant: "ghost", ariaLabel: "\uC218\uB7C9 \uC904\uC774\uAE30", disabled: blocked || value <= min, onMouseDown: (e) => e.preventDefault(), onClick: () => move(-1), prefixIcon: "minus" }),
|
|
7114
|
+
/* @__PURE__ */ jsx47(
|
|
7064
7115
|
"input",
|
|
7065
7116
|
{
|
|
7066
7117
|
className: "kjun-input",
|
|
@@ -7094,14 +7145,14 @@ function KjunQuantityStepper({ value, min = 0, max, step = 1, precision = 0, dis
|
|
|
7094
7145
|
"aria-required": (field == null ? void 0 : field.required) || void 0
|
|
7095
7146
|
}
|
|
7096
7147
|
),
|
|
7097
|
-
/* @__PURE__ */
|
|
7148
|
+
/* @__PURE__ */ jsx47(KjunButton, { size, style: buttonStyle, variant: "ghost", ariaLabel: "\uC218\uB7C9 \uB298\uB9AC\uAE30", disabled: blocked || max !== void 0 && value >= max, onMouseDown: (e) => e.preventDefault(), onClick: () => move(1), prefixIcon: "plus" })
|
|
7098
7149
|
] }) });
|
|
7099
7150
|
}
|
|
7100
7151
|
|
|
7101
7152
|
// packages/react/src/time-picker.tsx
|
|
7102
7153
|
import { Fragment as Fragment19, useEffect as useEffect23, useId as useId13, useMemo as useMemo2, useRef as useRef31 } from "react";
|
|
7103
7154
|
import { createTimeDomain } from "@kjun-ui/tokens";
|
|
7104
|
-
import { jsx as
|
|
7155
|
+
import { jsx as jsx48, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
7105
7156
|
function KjunTimePicker({ value, precision = "minute", min, max, minuteStep = 1, secondStep = 1, disabled = false, error = false, clearable = true, size = "md", ariaLabel = "\uC2DC\uAC04", onValueChange, onChangeCommit }) {
|
|
7106
7157
|
const root = useRef31(null);
|
|
7107
7158
|
const field = useKjunField(), uid = useId13();
|
|
@@ -7119,14 +7170,14 @@ function KjunTimePicker({ value, precision = "minute", min, max, minuteStep = 1,
|
|
|
7119
7170
|
};
|
|
7120
7171
|
const time = value === null ? null : domain.parse(value);
|
|
7121
7172
|
return /* @__PURE__ */ jsxs41("div", { ref: root, className: "kjun-time-picker", "data-size": size, "data-error": error || !!(field == null ? void 0 : field.error), "data-disabled": disabled || !valid, role: "group", "aria-label": ariaLabel, "aria-labelledby": field == null ? void 0 : field.labelId, "aria-describedby": field == null ? void 0 : field.describedBy, children: [
|
|
7122
|
-
/* @__PURE__ */
|
|
7173
|
+
/* @__PURE__ */ jsx48(CompoundControlContext.Provider, { value: size, children: /* @__PURE__ */ jsx48("div", { className: "kjun-time-segments", children: ["\uC2DC", "\uBD84", "\uCD08"].slice(0, precision === "second" ? 3 : 2).map((label, index) => {
|
|
7123
7174
|
const segmentId = index === 0 ? fieldId : `${fieldId}-${index}`;
|
|
7124
7175
|
const labelId = `${fieldId}-segment-${index}`;
|
|
7125
7176
|
return /* @__PURE__ */ jsxs41(Fragment19, { children: [
|
|
7126
|
-
index > 0 && /* @__PURE__ */
|
|
7127
|
-
/* @__PURE__ */
|
|
7128
|
-
/* @__PURE__ */
|
|
7129
|
-
/* @__PURE__ */
|
|
7177
|
+
index > 0 && /* @__PURE__ */ jsx48("span", { className: "kjun-time-separator", "aria-hidden": true, children: ":" }),
|
|
7178
|
+
/* @__PURE__ */ jsx48(FieldContext.Provider, { value: { ...field, id: segmentId, labelId: (field == null ? void 0 : field.labelId) ? `${field.labelId} ${labelId}` : void 0 }, children: /* @__PURE__ */ jsxs41("div", { className: "kjun-time-segment", children: [
|
|
7179
|
+
/* @__PURE__ */ jsx48("span", { id: labelId, className: "kjun-sr-only", "aria-hidden": true, children: label }),
|
|
7180
|
+
/* @__PURE__ */ jsx48(
|
|
7130
7181
|
KjunSelect,
|
|
7131
7182
|
{
|
|
7132
7183
|
value: time === null ? null : domain.part(time, index),
|
|
@@ -7146,7 +7197,7 @@ function KjunTimePicker({ value, precision = "minute", min, max, minuteStep = 1,
|
|
|
7146
7197
|
] }) })
|
|
7147
7198
|
] }, label);
|
|
7148
7199
|
}) }) }),
|
|
7149
|
-
clearable && value !== null && /* @__PURE__ */
|
|
7200
|
+
clearable && value !== null && /* @__PURE__ */ jsx48(KjunButton, { className: "kjun-time-clear", size, variant: "ghost", prefixIcon: "x", ariaLabel: ariaLabel + " \uC9C0\uC6B0\uAE30", disabled: disabled || !valid, onClick: () => {
|
|
7150
7201
|
var _a, _b;
|
|
7151
7202
|
change(null);
|
|
7152
7203
|
(_b = (_a = root.current) == null ? void 0 : _a.querySelector(".kjun-select-trigger")) == null ? void 0 : _b.focus();
|
|
@@ -7193,6 +7244,7 @@ export {
|
|
|
7193
7244
|
KjunIcon,
|
|
7194
7245
|
KjunIconToggle,
|
|
7195
7246
|
KjunImage,
|
|
7247
|
+
KjunInline,
|
|
7196
7248
|
KjunInput,
|
|
7197
7249
|
KjunKpiHero,
|
|
7198
7250
|
KjunKpiRow,
|
|
@@ -7225,10 +7277,12 @@ export {
|
|
|
7225
7277
|
KjunSlider,
|
|
7226
7278
|
KjunSparkline,
|
|
7227
7279
|
KjunSpinner,
|
|
7280
|
+
KjunStack,
|
|
7228
7281
|
KjunSwitch,
|
|
7229
7282
|
KjunTabPane,
|
|
7230
7283
|
KjunTable,
|
|
7231
7284
|
KjunTabs,
|
|
7285
|
+
KjunText,
|
|
7232
7286
|
KjunTextarea,
|
|
7233
7287
|
KjunTimePicker,
|
|
7234
7288
|
KjunTooltip,
|