klun-ui 0.1.23 → 0.2.2
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/CHANGELOG.md +109 -0
- package/README.md +41 -15
- package/dist/{chunk-UMR3IWCQ.cjs → chunk-T7O3RMWL.cjs} +501 -497
- package/dist/chunk-T7O3RMWL.cjs.map +1 -0
- package/dist/{chunk-T3IFNMYU.js → chunk-UJOMGMCV.js} +502 -498
- package/dist/chunk-UJOMGMCV.js.map +1 -0
- package/dist/index.cjs +158 -158
- package/dist/index.d.cts +217 -205
- package/dist/index.d.ts +217 -205
- package/dist/index.js +1 -1
- package/dist/styles.css +240 -98
- package/dist/templates/index.cjs +2583 -94
- package/dist/templates/index.cjs.map +1 -1
- package/dist/templates/index.d.cts +142 -1
- package/dist/templates/index.d.ts +142 -1
- package/dist/templates/index.js +2480 -13
- package/dist/templates/index.js.map +1 -1
- package/package.json +3 -2
- package/dist/chunk-T3IFNMYU.js.map +0 -1
- package/dist/chunk-UMR3IWCQ.cjs.map +0 -1
|
@@ -1792,6 +1792,7 @@ var DEFAULT_CONFIG = {
|
|
|
1792
1792
|
theme: void 0,
|
|
1793
1793
|
accent: void 0,
|
|
1794
1794
|
radius: void 0,
|
|
1795
|
+
density: void 0,
|
|
1795
1796
|
primaryColor: void 0
|
|
1796
1797
|
};
|
|
1797
1798
|
function hexToRgb(hex) {
|
|
@@ -1831,6 +1832,7 @@ function ConfigProvider({
|
|
|
1831
1832
|
theme,
|
|
1832
1833
|
accent,
|
|
1833
1834
|
radius,
|
|
1835
|
+
density,
|
|
1834
1836
|
primaryColor,
|
|
1835
1837
|
children
|
|
1836
1838
|
}) {
|
|
@@ -1843,9 +1845,10 @@ function ConfigProvider({
|
|
|
1843
1845
|
theme: theme ?? parent.theme,
|
|
1844
1846
|
accent: accent ?? parent.accent,
|
|
1845
1847
|
radius: radius ?? parent.radius,
|
|
1848
|
+
density: density ?? parent.density,
|
|
1846
1849
|
primaryColor: primaryColor ?? parent.primaryColor
|
|
1847
1850
|
}),
|
|
1848
|
-
[locale, size, dir, theme, accent, radius, primaryColor, parent]
|
|
1851
|
+
[locale, size, dir, theme, accent, radius, density, primaryColor, parent]
|
|
1849
1852
|
);
|
|
1850
1853
|
const style = react.useMemo(() => {
|
|
1851
1854
|
const s = { display: "contents" };
|
|
@@ -1860,6 +1863,7 @@ function ConfigProvider({
|
|
|
1860
1863
|
"data-theme": value.theme,
|
|
1861
1864
|
"data-mode": value.accent,
|
|
1862
1865
|
"data-radius": value.radius && value.radius !== "default" ? value.radius : void 0,
|
|
1866
|
+
"data-density": value.density,
|
|
1863
1867
|
style,
|
|
1864
1868
|
children
|
|
1865
1869
|
}
|
|
@@ -2535,6 +2539,151 @@ var Chip = react.forwardRef(function Chip2({ children, color = "gray", selected
|
|
|
2535
2539
|
);
|
|
2536
2540
|
});
|
|
2537
2541
|
Chip.displayName = "Chip";
|
|
2542
|
+
var CodeViewer = react.forwardRef(function CodeViewer2({
|
|
2543
|
+
code = "",
|
|
2544
|
+
title,
|
|
2545
|
+
language,
|
|
2546
|
+
lineNumbers = false,
|
|
2547
|
+
wrap = false,
|
|
2548
|
+
maxHeight = 320,
|
|
2549
|
+
dark = true,
|
|
2550
|
+
onCopied,
|
|
2551
|
+
className,
|
|
2552
|
+
...props
|
|
2553
|
+
}, ref) {
|
|
2554
|
+
const lines = String(code).replace(/\n$/, "").split("\n");
|
|
2555
|
+
const hasHeader = title != null || language != null;
|
|
2556
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2557
|
+
"div",
|
|
2558
|
+
{
|
|
2559
|
+
ref,
|
|
2560
|
+
className: chunkTPGAXYFU_cjs.cx("klun-code-viewer", dark && "klun-code-viewer--dark", className),
|
|
2561
|
+
...props,
|
|
2562
|
+
children: [
|
|
2563
|
+
hasHeader ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "klun-code-viewer__header", children: [
|
|
2564
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-code-viewer__title", children: title ?? language }),
|
|
2565
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2566
|
+
CopyButton,
|
|
2567
|
+
{
|
|
2568
|
+
value: code,
|
|
2569
|
+
onCopied,
|
|
2570
|
+
variant: "ghost",
|
|
2571
|
+
size: "sm",
|
|
2572
|
+
className: "klun-code-viewer__copy"
|
|
2573
|
+
}
|
|
2574
|
+
)
|
|
2575
|
+
] }) : null,
|
|
2576
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2577
|
+
"div",
|
|
2578
|
+
{
|
|
2579
|
+
className: "klun-code-viewer__scroll",
|
|
2580
|
+
style: { ["--klun-code-viewer-max-height"]: `${maxHeight}px` },
|
|
2581
|
+
children: [
|
|
2582
|
+
!hasHeader ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-code-viewer__copy-float", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2583
|
+
CopyButton,
|
|
2584
|
+
{
|
|
2585
|
+
value: code,
|
|
2586
|
+
onCopied,
|
|
2587
|
+
variant: "ghost",
|
|
2588
|
+
size: "sm",
|
|
2589
|
+
className: "klun-code-viewer__copy klun-code-viewer__copy--float"
|
|
2590
|
+
}
|
|
2591
|
+
) }) : null,
|
|
2592
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2593
|
+
"pre",
|
|
2594
|
+
{
|
|
2595
|
+
className: chunkTPGAXYFU_cjs.cx(
|
|
2596
|
+
"klun-code-viewer__pre",
|
|
2597
|
+
wrap && "klun-code-viewer__pre--wrap"
|
|
2598
|
+
),
|
|
2599
|
+
children: lineNumbers ? /* @__PURE__ */ jsxRuntime.jsx("code", { className: "klun-code-viewer__code klun-code-viewer__code--numbered", children: lines.map((ln, i) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "klun-code-viewer__row", children: [
|
|
2600
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-code-viewer__gutter", children: i + 1 }),
|
|
2601
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-code-viewer__line", children: ln || " " })
|
|
2602
|
+
] }, i)) }) : /* @__PURE__ */ jsxRuntime.jsx("code", { className: "klun-code-viewer__code", children: code })
|
|
2603
|
+
}
|
|
2604
|
+
)
|
|
2605
|
+
]
|
|
2606
|
+
}
|
|
2607
|
+
)
|
|
2608
|
+
]
|
|
2609
|
+
}
|
|
2610
|
+
);
|
|
2611
|
+
});
|
|
2612
|
+
CodeViewer.displayName = "CodeViewer";
|
|
2613
|
+
var KNOWN_LEVELS = /* @__PURE__ */ new Set([
|
|
2614
|
+
"error",
|
|
2615
|
+
"warn",
|
|
2616
|
+
"warning",
|
|
2617
|
+
"info",
|
|
2618
|
+
"debug",
|
|
2619
|
+
"success"
|
|
2620
|
+
]);
|
|
2621
|
+
var LogViewer = react.forwardRef(function LogViewer2({
|
|
2622
|
+
lines = [],
|
|
2623
|
+
maxHeight = 360,
|
|
2624
|
+
showTimestamp = true,
|
|
2625
|
+
dark = true,
|
|
2626
|
+
onCopied,
|
|
2627
|
+
className,
|
|
2628
|
+
style,
|
|
2629
|
+
...props
|
|
2630
|
+
}, ref) {
|
|
2631
|
+
const norm2 = lines.map(
|
|
2632
|
+
(l) => typeof l === "string" ? { text: l } : l
|
|
2633
|
+
);
|
|
2634
|
+
const raw = norm2.map((l) => [l.ts, l.level && `[${l.level}]`, l.text].filter(Boolean).join(" ")).join("\n");
|
|
2635
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2636
|
+
"div",
|
|
2637
|
+
{
|
|
2638
|
+
ref,
|
|
2639
|
+
className: chunkTPGAXYFU_cjs.cx("klun-log-viewer", dark && "klun-log-viewer--dark", className),
|
|
2640
|
+
style: { ["--klun-code-viewer-max-height"]: `${maxHeight}px`, ...style },
|
|
2641
|
+
...props,
|
|
2642
|
+
children: [
|
|
2643
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-log-viewer__copy-float", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2644
|
+
CopyButton,
|
|
2645
|
+
{
|
|
2646
|
+
value: raw,
|
|
2647
|
+
onCopied,
|
|
2648
|
+
variant: "ghost",
|
|
2649
|
+
size: "sm",
|
|
2650
|
+
className: "klun-log-viewer__copy klun-log-viewer__copy--float"
|
|
2651
|
+
}
|
|
2652
|
+
) }),
|
|
2653
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-log-viewer__body", children: norm2.map((l, i) => {
|
|
2654
|
+
const level = l.level ? String(l.level).toLowerCase() : void 0;
|
|
2655
|
+
const levelClass = level && KNOWN_LEVELS.has(level) ? `klun-log-viewer__level--${level}` : void 0;
|
|
2656
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "klun-log-viewer__row", children: [
|
|
2657
|
+
showTimestamp && l.ts ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-log-viewer__ts", children: l.ts }) : null,
|
|
2658
|
+
l.level ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkTPGAXYFU_cjs.cx("klun-log-viewer__level", levelClass), children: l.level }) : null,
|
|
2659
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-log-viewer__text", children: l.text })
|
|
2660
|
+
] }, i);
|
|
2661
|
+
}) })
|
|
2662
|
+
]
|
|
2663
|
+
}
|
|
2664
|
+
);
|
|
2665
|
+
});
|
|
2666
|
+
LogViewer.displayName = "LogViewer";
|
|
2667
|
+
var ContentLabel = react.forwardRef(function ContentLabel2({ children, icon, color = "gray", size = "md", className, ...props }, ref) {
|
|
2668
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2669
|
+
"span",
|
|
2670
|
+
{
|
|
2671
|
+
ref,
|
|
2672
|
+
className: chunkTPGAXYFU_cjs.cx(
|
|
2673
|
+
"klun-content-label",
|
|
2674
|
+
`klun-content-label--${color}`,
|
|
2675
|
+
`klun-content-label--${size}`,
|
|
2676
|
+
className
|
|
2677
|
+
),
|
|
2678
|
+
...props,
|
|
2679
|
+
children: [
|
|
2680
|
+
icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-content-label__icon", children: icon }) : null,
|
|
2681
|
+
children
|
|
2682
|
+
]
|
|
2683
|
+
}
|
|
2684
|
+
);
|
|
2685
|
+
});
|
|
2686
|
+
ContentLabel.displayName = "ContentLabel";
|
|
2538
2687
|
var TONE_COLOR = {
|
|
2539
2688
|
ok: "green",
|
|
2540
2689
|
warn: "orange",
|
|
@@ -2882,151 +3031,6 @@ var CrossRefBadge = react.forwardRef(
|
|
|
2882
3031
|
}
|
|
2883
3032
|
);
|
|
2884
3033
|
CrossRefBadge.displayName = "CrossRefBadge";
|
|
2885
|
-
var CodeViewer = react.forwardRef(function CodeViewer2({
|
|
2886
|
-
code = "",
|
|
2887
|
-
title,
|
|
2888
|
-
language,
|
|
2889
|
-
lineNumbers = false,
|
|
2890
|
-
wrap = false,
|
|
2891
|
-
maxHeight = 320,
|
|
2892
|
-
dark = true,
|
|
2893
|
-
onCopied,
|
|
2894
|
-
className,
|
|
2895
|
-
...props
|
|
2896
|
-
}, ref) {
|
|
2897
|
-
const lines = String(code).replace(/\n$/, "").split("\n");
|
|
2898
|
-
const hasHeader = title != null || language != null;
|
|
2899
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2900
|
-
"div",
|
|
2901
|
-
{
|
|
2902
|
-
ref,
|
|
2903
|
-
className: chunkTPGAXYFU_cjs.cx("klun-code-viewer", dark && "klun-code-viewer--dark", className),
|
|
2904
|
-
...props,
|
|
2905
|
-
children: [
|
|
2906
|
-
hasHeader ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "klun-code-viewer__header", children: [
|
|
2907
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-code-viewer__title", children: title ?? language }),
|
|
2908
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2909
|
-
CopyButton,
|
|
2910
|
-
{
|
|
2911
|
-
value: code,
|
|
2912
|
-
onCopied,
|
|
2913
|
-
variant: "ghost",
|
|
2914
|
-
size: "sm",
|
|
2915
|
-
className: "klun-code-viewer__copy"
|
|
2916
|
-
}
|
|
2917
|
-
)
|
|
2918
|
-
] }) : null,
|
|
2919
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2920
|
-
"div",
|
|
2921
|
-
{
|
|
2922
|
-
className: "klun-code-viewer__scroll",
|
|
2923
|
-
style: { ["--klun-code-viewer-max-height"]: `${maxHeight}px` },
|
|
2924
|
-
children: [
|
|
2925
|
-
!hasHeader ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-code-viewer__copy-float", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2926
|
-
CopyButton,
|
|
2927
|
-
{
|
|
2928
|
-
value: code,
|
|
2929
|
-
onCopied,
|
|
2930
|
-
variant: "ghost",
|
|
2931
|
-
size: "sm",
|
|
2932
|
-
className: "klun-code-viewer__copy klun-code-viewer__copy--float"
|
|
2933
|
-
}
|
|
2934
|
-
) }) : null,
|
|
2935
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2936
|
-
"pre",
|
|
2937
|
-
{
|
|
2938
|
-
className: chunkTPGAXYFU_cjs.cx(
|
|
2939
|
-
"klun-code-viewer__pre",
|
|
2940
|
-
wrap && "klun-code-viewer__pre--wrap"
|
|
2941
|
-
),
|
|
2942
|
-
children: lineNumbers ? /* @__PURE__ */ jsxRuntime.jsx("code", { className: "klun-code-viewer__code klun-code-viewer__code--numbered", children: lines.map((ln, i) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "klun-code-viewer__row", children: [
|
|
2943
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-code-viewer__gutter", children: i + 1 }),
|
|
2944
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-code-viewer__line", children: ln || " " })
|
|
2945
|
-
] }, i)) }) : /* @__PURE__ */ jsxRuntime.jsx("code", { className: "klun-code-viewer__code", children: code })
|
|
2946
|
-
}
|
|
2947
|
-
)
|
|
2948
|
-
]
|
|
2949
|
-
}
|
|
2950
|
-
)
|
|
2951
|
-
]
|
|
2952
|
-
}
|
|
2953
|
-
);
|
|
2954
|
-
});
|
|
2955
|
-
CodeViewer.displayName = "CodeViewer";
|
|
2956
|
-
var KNOWN_LEVELS = /* @__PURE__ */ new Set([
|
|
2957
|
-
"error",
|
|
2958
|
-
"warn",
|
|
2959
|
-
"warning",
|
|
2960
|
-
"info",
|
|
2961
|
-
"debug",
|
|
2962
|
-
"success"
|
|
2963
|
-
]);
|
|
2964
|
-
var LogViewer = react.forwardRef(function LogViewer2({
|
|
2965
|
-
lines = [],
|
|
2966
|
-
maxHeight = 360,
|
|
2967
|
-
showTimestamp = true,
|
|
2968
|
-
dark = true,
|
|
2969
|
-
onCopied,
|
|
2970
|
-
className,
|
|
2971
|
-
style,
|
|
2972
|
-
...props
|
|
2973
|
-
}, ref) {
|
|
2974
|
-
const norm2 = lines.map(
|
|
2975
|
-
(l) => typeof l === "string" ? { text: l } : l
|
|
2976
|
-
);
|
|
2977
|
-
const raw = norm2.map((l) => [l.ts, l.level && `[${l.level}]`, l.text].filter(Boolean).join(" ")).join("\n");
|
|
2978
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2979
|
-
"div",
|
|
2980
|
-
{
|
|
2981
|
-
ref,
|
|
2982
|
-
className: chunkTPGAXYFU_cjs.cx("klun-log-viewer", dark && "klun-log-viewer--dark", className),
|
|
2983
|
-
style: { ["--klun-code-viewer-max-height"]: `${maxHeight}px`, ...style },
|
|
2984
|
-
...props,
|
|
2985
|
-
children: [
|
|
2986
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-log-viewer__copy-float", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2987
|
-
CopyButton,
|
|
2988
|
-
{
|
|
2989
|
-
value: raw,
|
|
2990
|
-
onCopied,
|
|
2991
|
-
variant: "ghost",
|
|
2992
|
-
size: "sm",
|
|
2993
|
-
className: "klun-log-viewer__copy klun-log-viewer__copy--float"
|
|
2994
|
-
}
|
|
2995
|
-
) }),
|
|
2996
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-log-viewer__body", children: norm2.map((l, i) => {
|
|
2997
|
-
const level = l.level ? String(l.level).toLowerCase() : void 0;
|
|
2998
|
-
const levelClass = level && KNOWN_LEVELS.has(level) ? `klun-log-viewer__level--${level}` : void 0;
|
|
2999
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "klun-log-viewer__row", children: [
|
|
3000
|
-
showTimestamp && l.ts ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-log-viewer__ts", children: l.ts }) : null,
|
|
3001
|
-
l.level ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkTPGAXYFU_cjs.cx("klun-log-viewer__level", levelClass), children: l.level }) : null,
|
|
3002
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-log-viewer__text", children: l.text })
|
|
3003
|
-
] }, i);
|
|
3004
|
-
}) })
|
|
3005
|
-
]
|
|
3006
|
-
}
|
|
3007
|
-
);
|
|
3008
|
-
});
|
|
3009
|
-
LogViewer.displayName = "LogViewer";
|
|
3010
|
-
var ContentLabel = react.forwardRef(function ContentLabel2({ children, icon, color = "gray", size = "md", className, ...props }, ref) {
|
|
3011
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3012
|
-
"span",
|
|
3013
|
-
{
|
|
3014
|
-
ref,
|
|
3015
|
-
className: chunkTPGAXYFU_cjs.cx(
|
|
3016
|
-
"klun-content-label",
|
|
3017
|
-
`klun-content-label--${color}`,
|
|
3018
|
-
`klun-content-label--${size}`,
|
|
3019
|
-
className
|
|
3020
|
-
),
|
|
3021
|
-
...props,
|
|
3022
|
-
children: [
|
|
3023
|
-
icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-content-label__icon", children: icon }) : null,
|
|
3024
|
-
children
|
|
3025
|
-
]
|
|
3026
|
-
}
|
|
3027
|
-
);
|
|
3028
|
-
});
|
|
3029
|
-
ContentLabel.displayName = "ContentLabel";
|
|
3030
3034
|
var Descriptions = react.forwardRef(
|
|
3031
3035
|
function Descriptions2({
|
|
3032
3036
|
title,
|
|
@@ -3748,6 +3752,30 @@ var Rating = react.forwardRef(function Rating2({ value = 0, max = 5, onChange, r
|
|
|
3748
3752
|
)) });
|
|
3749
3753
|
});
|
|
3750
3754
|
Rating.displayName = "Rating";
|
|
3755
|
+
var StatCard = react.forwardRef(function StatCard2({ label, value, delta, trend = "up", icon, tint = "feature", className, ...props }, ref) {
|
|
3756
|
+
const up = trend === "up";
|
|
3757
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: chunkTPGAXYFU_cjs.cx("klun-stat-card", `klun-stat-card--${tint}`, className), ...props, children: [
|
|
3758
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "klun-stat-card__head", children: [
|
|
3759
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-stat-card__icon", children: icon }),
|
|
3760
|
+
delta != null ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3761
|
+
"span",
|
|
3762
|
+
{
|
|
3763
|
+
className: chunkTPGAXYFU_cjs.cx(
|
|
3764
|
+
"klun-stat-card__delta",
|
|
3765
|
+
up ? "klun-stat-card__delta--up" : "klun-stat-card__delta--down"
|
|
3766
|
+
),
|
|
3767
|
+
children: [
|
|
3768
|
+
/* @__PURE__ */ jsxRuntime.jsx("i", { className: up ? "ri-arrow-up-line" : "ri-arrow-down-line" }),
|
|
3769
|
+
delta
|
|
3770
|
+
]
|
|
3771
|
+
}
|
|
3772
|
+
) : null
|
|
3773
|
+
] }),
|
|
3774
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-stat-card__label", children: label }),
|
|
3775
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-stat-card__value", children: value })
|
|
3776
|
+
] });
|
|
3777
|
+
});
|
|
3778
|
+
StatCard.displayName = "StatCard";
|
|
3751
3779
|
var TREND_ICONS = {
|
|
3752
3780
|
up: "ri-arrow-up-line",
|
|
3753
3781
|
down: "ri-arrow-down-line",
|
|
@@ -3775,30 +3803,6 @@ var Statistic = react.forwardRef(function Statistic2({ label, value, prefix, suf
|
|
|
3775
3803
|
] });
|
|
3776
3804
|
});
|
|
3777
3805
|
Statistic.displayName = "Statistic";
|
|
3778
|
-
var StatCard = react.forwardRef(function StatCard2({ label, value, delta, trend = "up", icon, tint = "feature", className, ...props }, ref) {
|
|
3779
|
-
const up = trend === "up";
|
|
3780
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: chunkTPGAXYFU_cjs.cx("klun-stat-card", `klun-stat-card--${tint}`, className), ...props, children: [
|
|
3781
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "klun-stat-card__head", children: [
|
|
3782
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-stat-card__icon", children: icon }),
|
|
3783
|
-
delta != null ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3784
|
-
"span",
|
|
3785
|
-
{
|
|
3786
|
-
className: chunkTPGAXYFU_cjs.cx(
|
|
3787
|
-
"klun-stat-card__delta",
|
|
3788
|
-
up ? "klun-stat-card__delta--up" : "klun-stat-card__delta--down"
|
|
3789
|
-
),
|
|
3790
|
-
children: [
|
|
3791
|
-
/* @__PURE__ */ jsxRuntime.jsx("i", { className: up ? "ri-arrow-up-line" : "ri-arrow-down-line" }),
|
|
3792
|
-
delta
|
|
3793
|
-
]
|
|
3794
|
-
}
|
|
3795
|
-
) : null
|
|
3796
|
-
] }),
|
|
3797
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-stat-card__label", children: label }),
|
|
3798
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-stat-card__value", children: value })
|
|
3799
|
-
] });
|
|
3800
|
-
});
|
|
3801
|
-
StatCard.displayName = "StatCard";
|
|
3802
3806
|
var SIZES2 = { xs: 6, sm: 8, md: 10, lg: 12 };
|
|
3803
3807
|
var StatusDot = react.forwardRef(function StatusDot2({ tone = "neutral", size = "sm", pulse = false, label, className, style, ...props }, ref) {
|
|
3804
3808
|
const sizeStyle = { ["--klun-status-dot-size"]: `${SIZES2[size] ?? SIZES2.sm}px` };
|
|
@@ -5762,43 +5766,6 @@ var Alert = react.forwardRef(function Alert2({ status = "information", variant =
|
|
|
5762
5766
|
);
|
|
5763
5767
|
});
|
|
5764
5768
|
Alert.displayName = "Alert";
|
|
5765
|
-
var EmptyState = react.forwardRef(function EmptyState2({ icon, title, description, action, className, ...props }, ref) {
|
|
5766
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: chunkTPGAXYFU_cjs.cx("klun-empty-state", className), ...props, children: [
|
|
5767
|
-
icon ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-empty-state__icon", children: icon }) : null,
|
|
5768
|
-
title ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-empty-state__title", children: title }) : null,
|
|
5769
|
-
description ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-empty-state__desc", children: description }) : null,
|
|
5770
|
-
action ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-empty-state__action", children: action }) : null
|
|
5771
|
-
] });
|
|
5772
|
-
});
|
|
5773
|
-
EmptyState.displayName = "EmptyState";
|
|
5774
|
-
var PRESET_ICON = {
|
|
5775
|
-
success: "ri-checkbox-circle-fill",
|
|
5776
|
-
error: "ri-close-circle-fill",
|
|
5777
|
-
warning: "ri-alert-fill",
|
|
5778
|
-
info: "ri-information-fill",
|
|
5779
|
-
"404": "ri-compass-3-line",
|
|
5780
|
-
"403": "ri-lock-2-line",
|
|
5781
|
-
"500": "ri-server-line"
|
|
5782
|
-
};
|
|
5783
|
-
var Result = react.forwardRef(function Result2({ status = "info", icon, title, subtitle, extra, children, className, ...props }, ref) {
|
|
5784
|
-
const big = status === "404" || status === "403" || status === "500";
|
|
5785
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5786
|
-
"div",
|
|
5787
|
-
{
|
|
5788
|
-
ref,
|
|
5789
|
-
className: chunkTPGAXYFU_cjs.cx("klun-result", `klun-result--${status}`, big && "klun-result--big", className),
|
|
5790
|
-
...props,
|
|
5791
|
-
children: [
|
|
5792
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-result__icon", children: icon || /* @__PURE__ */ jsxRuntime.jsx("i", { className: PRESET_ICON[status] }) }),
|
|
5793
|
-
title ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-result__title", children: title }) : null,
|
|
5794
|
-
subtitle ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-result__subtitle", children: subtitle }) : null,
|
|
5795
|
-
extra ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-result__extra", children: extra }) : null,
|
|
5796
|
-
children ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-result__content", children }) : null
|
|
5797
|
-
]
|
|
5798
|
-
}
|
|
5799
|
-
);
|
|
5800
|
-
});
|
|
5801
|
-
Result.displayName = "Result";
|
|
5802
5769
|
var Banner = react.forwardRef(function Banner2({ status = "information", variant = "filled", icon, action, onClose, className, children, ...props }, ref) {
|
|
5803
5770
|
const { banner } = useLocale();
|
|
5804
5771
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5882,6 +5849,15 @@ var CircularProgress = react.forwardRef(
|
|
|
5882
5849
|
}
|
|
5883
5850
|
);
|
|
5884
5851
|
CircularProgress.displayName = "CircularProgress";
|
|
5852
|
+
var EmptyState = react.forwardRef(function EmptyState2({ icon, title, description, action, className, ...props }, ref) {
|
|
5853
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: chunkTPGAXYFU_cjs.cx("klun-empty-state", className), ...props, children: [
|
|
5854
|
+
icon ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-empty-state__icon", children: icon }) : null,
|
|
5855
|
+
title ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-empty-state__title", children: title }) : null,
|
|
5856
|
+
description ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-empty-state__desc", children: description }) : null,
|
|
5857
|
+
action ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-empty-state__action", children: action }) : null
|
|
5858
|
+
] });
|
|
5859
|
+
});
|
|
5860
|
+
EmptyState.displayName = "EmptyState";
|
|
5885
5861
|
var GaugeBar = react.forwardRef(function GaugeBar2({
|
|
5886
5862
|
value = 0,
|
|
5887
5863
|
max = 100,
|
|
@@ -6150,6 +6126,34 @@ var ProgressBar = react.forwardRef(function ProgressBar2({ value = 0, max = 100,
|
|
|
6150
6126
|
);
|
|
6151
6127
|
});
|
|
6152
6128
|
ProgressBar.displayName = "ProgressBar";
|
|
6129
|
+
var PRESET_ICON = {
|
|
6130
|
+
success: "ri-checkbox-circle-fill",
|
|
6131
|
+
error: "ri-close-circle-fill",
|
|
6132
|
+
warning: "ri-alert-fill",
|
|
6133
|
+
info: "ri-information-fill",
|
|
6134
|
+
"404": "ri-compass-3-line",
|
|
6135
|
+
"403": "ri-lock-2-line",
|
|
6136
|
+
"500": "ri-server-line"
|
|
6137
|
+
};
|
|
6138
|
+
var Result = react.forwardRef(function Result2({ status = "info", icon, title, subtitle, extra, children, className, ...props }, ref) {
|
|
6139
|
+
const big = status === "404" || status === "403" || status === "500";
|
|
6140
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6141
|
+
"div",
|
|
6142
|
+
{
|
|
6143
|
+
ref,
|
|
6144
|
+
className: chunkTPGAXYFU_cjs.cx("klun-result", `klun-result--${status}`, big && "klun-result--big", className),
|
|
6145
|
+
...props,
|
|
6146
|
+
children: [
|
|
6147
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-result__icon", children: icon || /* @__PURE__ */ jsxRuntime.jsx("i", { className: PRESET_ICON[status] }) }),
|
|
6148
|
+
title ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-result__title", children: title }) : null,
|
|
6149
|
+
subtitle ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-result__subtitle", children: subtitle }) : null,
|
|
6150
|
+
extra ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-result__extra", children: extra }) : null,
|
|
6151
|
+
children ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-result__content", children }) : null
|
|
6152
|
+
]
|
|
6153
|
+
}
|
|
6154
|
+
);
|
|
6155
|
+
});
|
|
6156
|
+
Result.displayName = "Result";
|
|
6153
6157
|
var SegmentedProgress = react.forwardRef(
|
|
6154
6158
|
function SegmentedProgress2({ value = 0, segments = 4, color = "primary", className, ...props }, ref) {
|
|
6155
6159
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6740,59 +6744,20 @@ var Checkbox = react.forwardRef(function Checkbox2({ indeterminate = false, disa
|
|
|
6740
6744
|
className: "klun-checkbox__input",
|
|
6741
6745
|
disabled,
|
|
6742
6746
|
"aria-invalid": error || void 0,
|
|
6743
|
-
onChange: (e) => onChange?.(e.target.checked),
|
|
6744
|
-
...props
|
|
6745
|
-
}
|
|
6746
|
-
),
|
|
6747
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "klun-checkbox__box", "aria-hidden": true, children: [
|
|
6748
|
-
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: "klun-checkbox__check", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3.5 8.5l3 3 6-6.5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
6749
|
-
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: "klun-checkbox__dash", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3.5 8h9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })
|
|
6750
|
-
] }),
|
|
6751
|
-
children != null && children !== false && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-checkbox__label", children })
|
|
6752
|
-
]
|
|
6753
|
-
}
|
|
6754
|
-
);
|
|
6755
|
-
});
|
|
6756
|
-
Checkbox.displayName = "Checkbox";
|
|
6757
|
-
var CheckboxGroup = react.forwardRef(function CheckboxGroup2({ options, value, defaultValue, onChange, disabled = false, size, name, direction = "horizontal", className, style, children }, ref) {
|
|
6758
|
-
const [internal, setInternal] = react.useState(defaultValue ?? []);
|
|
6759
|
-
const controlled = value != null;
|
|
6760
|
-
const current = controlled ? value : internal;
|
|
6761
|
-
const toggle = (val, checked) => {
|
|
6762
|
-
const next = checked ? [...current, val] : current.filter((v) => v !== val);
|
|
6763
|
-
if (!controlled) setInternal(next);
|
|
6764
|
-
onChange?.(next);
|
|
6765
|
-
};
|
|
6766
|
-
const norm2 = (options ?? []).map(
|
|
6767
|
-
(o) => typeof o === "string" ? { label: o, value: o } : o
|
|
6768
|
-
);
|
|
6769
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6770
|
-
"div",
|
|
6771
|
-
{
|
|
6772
|
-
ref,
|
|
6773
|
-
role: "group",
|
|
6774
|
-
className: chunkTPGAXYFU_cjs.cx("klun-checkbox-group", `klun-checkbox-group--${direction}`, className),
|
|
6775
|
-
style,
|
|
6776
|
-
children: [
|
|
6777
|
-
norm2.map((o) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6778
|
-
Checkbox,
|
|
6779
|
-
{
|
|
6780
|
-
name,
|
|
6781
|
-
size,
|
|
6782
|
-
value: o.value,
|
|
6783
|
-
checked: current.includes(o.value),
|
|
6784
|
-
disabled: disabled || o.disabled,
|
|
6785
|
-
onChange: (checked) => toggle(o.value, checked),
|
|
6786
|
-
children: o.label
|
|
6787
|
-
},
|
|
6788
|
-
o.value
|
|
6789
|
-
)),
|
|
6790
|
-
children
|
|
6747
|
+
onChange: (e) => onChange?.(e.target.checked),
|
|
6748
|
+
...props
|
|
6749
|
+
}
|
|
6750
|
+
),
|
|
6751
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "klun-checkbox__box", "aria-hidden": true, children: [
|
|
6752
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: "klun-checkbox__check", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3.5 8.5l3 3 6-6.5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
6753
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: "klun-checkbox__dash", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3.5 8h9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })
|
|
6754
|
+
] }),
|
|
6755
|
+
children != null && children !== false && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-checkbox__label", children })
|
|
6791
6756
|
]
|
|
6792
6757
|
}
|
|
6793
6758
|
);
|
|
6794
6759
|
});
|
|
6795
|
-
|
|
6760
|
+
Checkbox.displayName = "Checkbox";
|
|
6796
6761
|
var CheckboxCard = react.forwardRef(
|
|
6797
6762
|
function CheckboxCard2({
|
|
6798
6763
|
title,
|
|
@@ -6862,6 +6827,45 @@ var CheckboxCard = react.forwardRef(
|
|
|
6862
6827
|
}
|
|
6863
6828
|
);
|
|
6864
6829
|
CheckboxCard.displayName = "CheckboxCard";
|
|
6830
|
+
var CheckboxGroup = react.forwardRef(function CheckboxGroup2({ options, value, defaultValue, onChange, disabled = false, size, name, direction = "horizontal", className, style, children }, ref) {
|
|
6831
|
+
const [internal, setInternal] = react.useState(defaultValue ?? []);
|
|
6832
|
+
const controlled = value != null;
|
|
6833
|
+
const current = controlled ? value : internal;
|
|
6834
|
+
const toggle = (val, checked) => {
|
|
6835
|
+
const next = checked ? [...current, val] : current.filter((v) => v !== val);
|
|
6836
|
+
if (!controlled) setInternal(next);
|
|
6837
|
+
onChange?.(next);
|
|
6838
|
+
};
|
|
6839
|
+
const norm2 = (options ?? []).map(
|
|
6840
|
+
(o) => typeof o === "string" ? { label: o, value: o } : o
|
|
6841
|
+
);
|
|
6842
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6843
|
+
"div",
|
|
6844
|
+
{
|
|
6845
|
+
ref,
|
|
6846
|
+
role: "group",
|
|
6847
|
+
className: chunkTPGAXYFU_cjs.cx("klun-checkbox-group", `klun-checkbox-group--${direction}`, className),
|
|
6848
|
+
style,
|
|
6849
|
+
children: [
|
|
6850
|
+
norm2.map((o) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6851
|
+
Checkbox,
|
|
6852
|
+
{
|
|
6853
|
+
name,
|
|
6854
|
+
size,
|
|
6855
|
+
value: o.value,
|
|
6856
|
+
checked: current.includes(o.value),
|
|
6857
|
+
disabled: disabled || o.disabled,
|
|
6858
|
+
onChange: (checked) => toggle(o.value, checked),
|
|
6859
|
+
children: o.label
|
|
6860
|
+
},
|
|
6861
|
+
o.value
|
|
6862
|
+
)),
|
|
6863
|
+
children
|
|
6864
|
+
]
|
|
6865
|
+
}
|
|
6866
|
+
);
|
|
6867
|
+
});
|
|
6868
|
+
CheckboxGroup.displayName = "CheckboxGroup";
|
|
6865
6869
|
var ColorDot = react.forwardRef(function ColorDot2({
|
|
6866
6870
|
color = "var(--klun-primary-base)",
|
|
6867
6871
|
selected = false,
|
|
@@ -7787,6 +7791,116 @@ var DatePicker = react.forwardRef(
|
|
|
7787
7791
|
}
|
|
7788
7792
|
);
|
|
7789
7793
|
DatePicker.displayName = "DatePicker";
|
|
7794
|
+
var norm = (d) => d && new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();
|
|
7795
|
+
var DEFAULT_FORMAT2 = { month: "short", day: "numeric" };
|
|
7796
|
+
var RangeCalendar = react.forwardRef(function RangeCalendar2({ start, end, onPick, className, style }, ref) {
|
|
7797
|
+
const { datePicker } = useLocale();
|
|
7798
|
+
const base = start ? new Date(start) : /* @__PURE__ */ new Date();
|
|
7799
|
+
const [view, setView] = react.useState(new Date(base.getFullYear(), base.getMonth(), 1));
|
|
7800
|
+
const s = start ? new Date(start) : null;
|
|
7801
|
+
const e = end ? new Date(end) : null;
|
|
7802
|
+
const y = view.getFullYear();
|
|
7803
|
+
const m = view.getMonth();
|
|
7804
|
+
const firstDay = (new Date(y, m, 1).getDay() + 6) % 7;
|
|
7805
|
+
const daysInMonth = new Date(y, m + 1, 0).getDate();
|
|
7806
|
+
const cells = [];
|
|
7807
|
+
for (let i = 0; i < firstDay; i++) cells.push(null);
|
|
7808
|
+
for (let d = 1; d <= daysInMonth; d++) cells.push(new Date(y, m, d));
|
|
7809
|
+
const pick = (d) => {
|
|
7810
|
+
if (!s || s && e) return onPick({ start: d, end: null });
|
|
7811
|
+
if (norm(d) < norm(s)) return onPick({ start: d, end: s });
|
|
7812
|
+
onPick({ start: s, end: d });
|
|
7813
|
+
};
|
|
7814
|
+
const inRange = (d) => !!s && !!e && norm(d) > norm(s) && norm(d) < norm(e);
|
|
7815
|
+
const isStart = (d) => !!s && norm(d) === norm(s);
|
|
7816
|
+
const isEnd = (d) => !!e && norm(d) === norm(e);
|
|
7817
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: chunkTPGAXYFU_cjs.cx("klun-date-range-picker", className), style, children: [
|
|
7818
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "klun-date-range-picker__header", children: [
|
|
7819
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "klun-date-range-picker__nav", onClick: () => setView(new Date(y, m - 1, 1)), children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 6l-4 4 4 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
|
|
7820
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-date-range-picker__title", children: fmt(datePicker.title, { month: datePicker.months[m], year: y }) }),
|
|
7821
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "klun-date-range-picker__nav", onClick: () => setView(new Date(y, m + 1, 1)), children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 6l4 4-4 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
|
|
7822
|
+
] }),
|
|
7823
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "klun-date-range-picker__grid", children: [
|
|
7824
|
+
datePicker.weekdaysShort.map((d, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-date-range-picker__weekday", children: d }, i)),
|
|
7825
|
+
cells.map((date, i) => {
|
|
7826
|
+
if (!date) return /* @__PURE__ */ jsxRuntime.jsx("span", {}, i);
|
|
7827
|
+
const mid = inRange(date);
|
|
7828
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7829
|
+
"div",
|
|
7830
|
+
{
|
|
7831
|
+
className: "klun-date-range-picker__cell",
|
|
7832
|
+
"data-in-range": mid || void 0,
|
|
7833
|
+
"data-range-edge": isStart(date) || isEnd(date) || void 0,
|
|
7834
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7835
|
+
"button",
|
|
7836
|
+
{
|
|
7837
|
+
type: "button",
|
|
7838
|
+
className: "klun-date-range-picker__day",
|
|
7839
|
+
"data-range-start": isStart(date) || void 0,
|
|
7840
|
+
"data-range-end": isEnd(date) || void 0,
|
|
7841
|
+
"data-in-range": mid || void 0,
|
|
7842
|
+
onClick: () => pick(date),
|
|
7843
|
+
children: date.getDate()
|
|
7844
|
+
}
|
|
7845
|
+
)
|
|
7846
|
+
},
|
|
7847
|
+
i
|
|
7848
|
+
);
|
|
7849
|
+
})
|
|
7850
|
+
] })
|
|
7851
|
+
] });
|
|
7852
|
+
});
|
|
7853
|
+
var DateRangePicker = react.forwardRef(
|
|
7854
|
+
function DateRangePicker2({ start, end, onChange, inline: inline2, placeholder, format = DEFAULT_FORMAT2, align = "left", disabled, className, style, ...props }, ref) {
|
|
7855
|
+
if (inline2) {
|
|
7856
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7857
|
+
RangeCalendar,
|
|
7858
|
+
{
|
|
7859
|
+
ref,
|
|
7860
|
+
start,
|
|
7861
|
+
end,
|
|
7862
|
+
onPick: (r) => onChange?.(r),
|
|
7863
|
+
className,
|
|
7864
|
+
style
|
|
7865
|
+
}
|
|
7866
|
+
);
|
|
7867
|
+
}
|
|
7868
|
+
const f = (d) => d ? new Date(d).toLocaleDateString(void 0, format) : "";
|
|
7869
|
+
const label = start || end ? `${f(start)} \u2013 ${f(end)}` : "";
|
|
7870
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: chunkTPGAXYFU_cjs.cx("klun-date-range-field", className), style, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7871
|
+
Popover,
|
|
7872
|
+
{
|
|
7873
|
+
align,
|
|
7874
|
+
width: 300,
|
|
7875
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7876
|
+
Input,
|
|
7877
|
+
{
|
|
7878
|
+
readOnly: true,
|
|
7879
|
+
disabled,
|
|
7880
|
+
value: label,
|
|
7881
|
+
placeholder: placeholder ?? "Select range",
|
|
7882
|
+
leadingIcon: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "ri-calendar-2-line" }),
|
|
7883
|
+
trailingIcon: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "ri-arrow-down-s-line" }),
|
|
7884
|
+
style: { width: "100%", cursor: "pointer" }
|
|
7885
|
+
}
|
|
7886
|
+
),
|
|
7887
|
+
children: (close) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7888
|
+
RangeCalendar,
|
|
7889
|
+
{
|
|
7890
|
+
className: "klun-date-range-picker--bare",
|
|
7891
|
+
start,
|
|
7892
|
+
end,
|
|
7893
|
+
onPick: (r) => {
|
|
7894
|
+
onChange?.(r);
|
|
7895
|
+
if (r.start && r.end) close();
|
|
7896
|
+
}
|
|
7897
|
+
}
|
|
7898
|
+
)
|
|
7899
|
+
}
|
|
7900
|
+
) });
|
|
7901
|
+
}
|
|
7902
|
+
);
|
|
7903
|
+
DateRangePicker.displayName = "DateRangePicker";
|
|
7790
7904
|
var pad = (n) => String(n).padStart(2, "0");
|
|
7791
7905
|
var TimePicker = react.forwardRef(
|
|
7792
7906
|
function TimePicker2({ value = "09:00", onChange, className, style, ...props }, ref) {
|
|
@@ -7988,7 +8102,7 @@ function TimeColumn({
|
|
|
7988
8102
|
}
|
|
7989
8103
|
TimePicker.displayName = "TimePicker";
|
|
7990
8104
|
var pad2 = (n) => String(n).padStart(2, "0");
|
|
7991
|
-
var
|
|
8105
|
+
var DEFAULT_FORMAT3 = {
|
|
7992
8106
|
year: "numeric",
|
|
7993
8107
|
month: "short",
|
|
7994
8108
|
day: "numeric",
|
|
@@ -8015,112 +8129,13 @@ function DateTimePanel({ value, onChange }) {
|
|
|
8015
8129
|
] });
|
|
8016
8130
|
}
|
|
8017
8131
|
var DateTimePicker = react.forwardRef(
|
|
8018
|
-
function DateTimePicker2({ value, onChange, inline: inline2, placeholder, format =
|
|
8132
|
+
function DateTimePicker2({ value, onChange, inline: inline2, placeholder, format = DEFAULT_FORMAT3, align = "left", disabled, className, style, ...props }, ref) {
|
|
8019
8133
|
const date = value ? new Date(value) : null;
|
|
8020
8134
|
if (inline2) {
|
|
8021
8135
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: chunkTPGAXYFU_cjs.cx("klun-date-time-picker", className), style, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(DateTimePanel, { value: date, onChange: (d) => onChange?.(d) }) });
|
|
8022
8136
|
}
|
|
8023
8137
|
const label = date ? date.toLocaleString(void 0, format) : "";
|
|
8024
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: chunkTPGAXYFU_cjs.cx("klun-date-time-field", className), style, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8025
|
-
Popover,
|
|
8026
|
-
{
|
|
8027
|
-
align,
|
|
8028
|
-
width: 300,
|
|
8029
|
-
trigger: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8030
|
-
Input,
|
|
8031
|
-
{
|
|
8032
|
-
readOnly: true,
|
|
8033
|
-
disabled,
|
|
8034
|
-
value: label,
|
|
8035
|
-
placeholder: placeholder ?? "Select date & time",
|
|
8036
|
-
leadingIcon: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "ri-calendar-2-line" }),
|
|
8037
|
-
trailingIcon: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "ri-arrow-down-s-line" }),
|
|
8038
|
-
style: { width: "100%", cursor: "pointer" }
|
|
8039
|
-
}
|
|
8040
|
-
),
|
|
8041
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(DateTimePanel, { value: date, onChange: (d) => onChange?.(d) })
|
|
8042
|
-
}
|
|
8043
|
-
) });
|
|
8044
|
-
}
|
|
8045
|
-
);
|
|
8046
|
-
DateTimePicker.displayName = "DateTimePicker";
|
|
8047
|
-
var norm = (d) => d && new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();
|
|
8048
|
-
var DEFAULT_FORMAT3 = { month: "short", day: "numeric" };
|
|
8049
|
-
var RangeCalendar = react.forwardRef(function RangeCalendar2({ start, end, onPick, className, style }, ref) {
|
|
8050
|
-
const { datePicker } = useLocale();
|
|
8051
|
-
const base = start ? new Date(start) : /* @__PURE__ */ new Date();
|
|
8052
|
-
const [view, setView] = react.useState(new Date(base.getFullYear(), base.getMonth(), 1));
|
|
8053
|
-
const s = start ? new Date(start) : null;
|
|
8054
|
-
const e = end ? new Date(end) : null;
|
|
8055
|
-
const y = view.getFullYear();
|
|
8056
|
-
const m = view.getMonth();
|
|
8057
|
-
const firstDay = (new Date(y, m, 1).getDay() + 6) % 7;
|
|
8058
|
-
const daysInMonth = new Date(y, m + 1, 0).getDate();
|
|
8059
|
-
const cells = [];
|
|
8060
|
-
for (let i = 0; i < firstDay; i++) cells.push(null);
|
|
8061
|
-
for (let d = 1; d <= daysInMonth; d++) cells.push(new Date(y, m, d));
|
|
8062
|
-
const pick = (d) => {
|
|
8063
|
-
if (!s || s && e) return onPick({ start: d, end: null });
|
|
8064
|
-
if (norm(d) < norm(s)) return onPick({ start: d, end: s });
|
|
8065
|
-
onPick({ start: s, end: d });
|
|
8066
|
-
};
|
|
8067
|
-
const inRange = (d) => !!s && !!e && norm(d) > norm(s) && norm(d) < norm(e);
|
|
8068
|
-
const isStart = (d) => !!s && norm(d) === norm(s);
|
|
8069
|
-
const isEnd = (d) => !!e && norm(d) === norm(e);
|
|
8070
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: chunkTPGAXYFU_cjs.cx("klun-date-range-picker", className), style, children: [
|
|
8071
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "klun-date-range-picker__header", children: [
|
|
8072
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "klun-date-range-picker__nav", onClick: () => setView(new Date(y, m - 1, 1)), children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 6l-4 4 4 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
|
|
8073
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-date-range-picker__title", children: fmt(datePicker.title, { month: datePicker.months[m], year: y }) }),
|
|
8074
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "klun-date-range-picker__nav", onClick: () => setView(new Date(y, m + 1, 1)), children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 6l4 4-4 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
|
|
8075
|
-
] }),
|
|
8076
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "klun-date-range-picker__grid", children: [
|
|
8077
|
-
datePicker.weekdaysShort.map((d, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-date-range-picker__weekday", children: d }, i)),
|
|
8078
|
-
cells.map((date, i) => {
|
|
8079
|
-
if (!date) return /* @__PURE__ */ jsxRuntime.jsx("span", {}, i);
|
|
8080
|
-
const mid = inRange(date);
|
|
8081
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8082
|
-
"div",
|
|
8083
|
-
{
|
|
8084
|
-
className: "klun-date-range-picker__cell",
|
|
8085
|
-
"data-in-range": mid || void 0,
|
|
8086
|
-
"data-range-edge": isStart(date) || isEnd(date) || void 0,
|
|
8087
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8088
|
-
"button",
|
|
8089
|
-
{
|
|
8090
|
-
type: "button",
|
|
8091
|
-
className: "klun-date-range-picker__day",
|
|
8092
|
-
"data-range-start": isStart(date) || void 0,
|
|
8093
|
-
"data-range-end": isEnd(date) || void 0,
|
|
8094
|
-
"data-in-range": mid || void 0,
|
|
8095
|
-
onClick: () => pick(date),
|
|
8096
|
-
children: date.getDate()
|
|
8097
|
-
}
|
|
8098
|
-
)
|
|
8099
|
-
},
|
|
8100
|
-
i
|
|
8101
|
-
);
|
|
8102
|
-
})
|
|
8103
|
-
] })
|
|
8104
|
-
] });
|
|
8105
|
-
});
|
|
8106
|
-
var DateRangePicker = react.forwardRef(
|
|
8107
|
-
function DateRangePicker2({ start, end, onChange, inline: inline2, placeholder, format = DEFAULT_FORMAT3, align = "left", disabled, className, style, ...props }, ref) {
|
|
8108
|
-
if (inline2) {
|
|
8109
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8110
|
-
RangeCalendar,
|
|
8111
|
-
{
|
|
8112
|
-
ref,
|
|
8113
|
-
start,
|
|
8114
|
-
end,
|
|
8115
|
-
onPick: (r) => onChange?.(r),
|
|
8116
|
-
className,
|
|
8117
|
-
style
|
|
8118
|
-
}
|
|
8119
|
-
);
|
|
8120
|
-
}
|
|
8121
|
-
const f = (d) => d ? new Date(d).toLocaleDateString(void 0, format) : "";
|
|
8122
|
-
const label = start || end ? `${f(start)} \u2013 ${f(end)}` : "";
|
|
8123
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: chunkTPGAXYFU_cjs.cx("klun-date-range-field", className), style, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8138
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: chunkTPGAXYFU_cjs.cx("klun-date-time-field", className), style, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8124
8139
|
Popover,
|
|
8125
8140
|
{
|
|
8126
8141
|
align,
|
|
@@ -8131,29 +8146,18 @@ var DateRangePicker = react.forwardRef(
|
|
|
8131
8146
|
readOnly: true,
|
|
8132
8147
|
disabled,
|
|
8133
8148
|
value: label,
|
|
8134
|
-
placeholder: placeholder ?? "Select
|
|
8149
|
+
placeholder: placeholder ?? "Select date & time",
|
|
8135
8150
|
leadingIcon: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "ri-calendar-2-line" }),
|
|
8136
8151
|
trailingIcon: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "ri-arrow-down-s-line" }),
|
|
8137
8152
|
style: { width: "100%", cursor: "pointer" }
|
|
8138
8153
|
}
|
|
8139
8154
|
),
|
|
8140
|
-
children:
|
|
8141
|
-
RangeCalendar,
|
|
8142
|
-
{
|
|
8143
|
-
className: "klun-date-range-picker--bare",
|
|
8144
|
-
start,
|
|
8145
|
-
end,
|
|
8146
|
-
onPick: (r) => {
|
|
8147
|
-
onChange?.(r);
|
|
8148
|
-
if (r.start && r.end) close();
|
|
8149
|
-
}
|
|
8150
|
-
}
|
|
8151
|
-
)
|
|
8155
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(DateTimePanel, { value: date, onChange: (d) => onChange?.(d) })
|
|
8152
8156
|
}
|
|
8153
8157
|
) });
|
|
8154
8158
|
}
|
|
8155
8159
|
);
|
|
8156
|
-
|
|
8160
|
+
DateTimePicker.displayName = "DateTimePicker";
|
|
8157
8161
|
var DigitInput = react.forwardRef(function DigitInput2({ length = 4, value = "", onChange, error = false, disabled = false, size: sizeProp, className, style, ...props }, ref) {
|
|
8158
8162
|
const size = useSize(sizeProp);
|
|
8159
8163
|
const refs = react.useRef([]);
|
|
@@ -9410,6 +9414,25 @@ var Card = react.forwardRef(function Card2({ variant = "stroke", padding, classN
|
|
|
9410
9414
|
);
|
|
9411
9415
|
});
|
|
9412
9416
|
Card.displayName = "Card";
|
|
9417
|
+
var GAP_PRESET = { small: 8, middle: 16, large: 24 };
|
|
9418
|
+
var resolveGap = (g) => g == null ? void 0 : typeof g === "string" && g in GAP_PRESET ? GAP_PRESET[g] : g;
|
|
9419
|
+
var Flex = react.forwardRef(function Flex2({ vertical = false, wrap, justify, align, flex, gap, component = "div", children, className, style, ...props }, ref) {
|
|
9420
|
+
const mergedStyle = {
|
|
9421
|
+
flexDirection: vertical ? "column" : "row",
|
|
9422
|
+
flexWrap: typeof wrap === "boolean" ? wrap ? "wrap" : "nowrap" : wrap,
|
|
9423
|
+
justifyContent: justify,
|
|
9424
|
+
alignItems: align,
|
|
9425
|
+
flex,
|
|
9426
|
+
gap: resolveGap(gap),
|
|
9427
|
+
...style
|
|
9428
|
+
};
|
|
9429
|
+
return react.createElement(
|
|
9430
|
+
component,
|
|
9431
|
+
{ ref, className: chunkTPGAXYFU_cjs.cx("klun-flex", className), style: mergedStyle, ...props },
|
|
9432
|
+
children
|
|
9433
|
+
);
|
|
9434
|
+
});
|
|
9435
|
+
Flex.displayName = "Flex";
|
|
9413
9436
|
var MIN_WIDTH = [
|
|
9414
9437
|
["xxl", 1600],
|
|
9415
9438
|
["xl", 1200],
|
|
@@ -9801,11 +9824,11 @@ function Masonry({
|
|
|
9801
9824
|
}
|
|
9802
9825
|
Masonry.displayName = "Masonry";
|
|
9803
9826
|
var GAP2 = { none: 0, xs: 4, sm: 8, md: 12, lg: 16, xl: 24, "2xl": 32 };
|
|
9804
|
-
function
|
|
9827
|
+
function resolveGap2(g) {
|
|
9805
9828
|
return typeof g === "number" ? g : GAP2[g] ?? GAP2.md;
|
|
9806
9829
|
}
|
|
9807
9830
|
var Space = react.forwardRef(function Space2({ direction = "row", size = "md", align, justify, wrap = true, split, children, className, style, ...props }, ref) {
|
|
9808
|
-
const gap =
|
|
9831
|
+
const gap = resolveGap2(size);
|
|
9809
9832
|
const items2 = react.Children.toArray(children);
|
|
9810
9833
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9811
9834
|
"div",
|
|
@@ -9829,25 +9852,6 @@ var Space = react.forwardRef(function Space2({ direction = "row", size = "md", a
|
|
|
9829
9852
|
);
|
|
9830
9853
|
});
|
|
9831
9854
|
Space.displayName = "Space";
|
|
9832
|
-
var GAP_PRESET = { small: 8, middle: 16, large: 24 };
|
|
9833
|
-
var resolveGap2 = (g) => g == null ? void 0 : typeof g === "string" && g in GAP_PRESET ? GAP_PRESET[g] : g;
|
|
9834
|
-
var Flex = react.forwardRef(function Flex2({ vertical = false, wrap, justify, align, flex, gap, component = "div", children, className, style, ...props }, ref) {
|
|
9835
|
-
const mergedStyle = {
|
|
9836
|
-
flexDirection: vertical ? "column" : "row",
|
|
9837
|
-
flexWrap: typeof wrap === "boolean" ? wrap ? "wrap" : "nowrap" : wrap,
|
|
9838
|
-
justifyContent: justify,
|
|
9839
|
-
alignItems: align,
|
|
9840
|
-
flex,
|
|
9841
|
-
gap: resolveGap2(gap),
|
|
9842
|
-
...style
|
|
9843
|
-
};
|
|
9844
|
-
return react.createElement(
|
|
9845
|
-
component,
|
|
9846
|
-
{ ref, className: chunkTPGAXYFU_cjs.cx("klun-flex", className), style: mergedStyle, ...props },
|
|
9847
|
-
children
|
|
9848
|
-
);
|
|
9849
|
-
});
|
|
9850
|
-
Flex.displayName = "Flex";
|
|
9851
9855
|
var SplitterPanel = react.forwardRef(
|
|
9852
9856
|
function SplitterPanel2({ className, children, ...props }, ref) {
|
|
9853
9857
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: chunkTPGAXYFU_cjs.cx("klun-splitter__panel", className), ...props, children });
|
|
@@ -10169,108 +10173,6 @@ var Breadcrumb = react.forwardRef(function Breadcrumb2({ items: items2 = [], cla
|
|
|
10169
10173
|
}) });
|
|
10170
10174
|
});
|
|
10171
10175
|
Breadcrumb.displayName = "Breadcrumb";
|
|
10172
|
-
var Tabs = react.forwardRef(function Tabs2({ items: items2 = [], value, onChange, variant = "underline", className, ...props }, ref) {
|
|
10173
|
-
const active = value ?? items2[0]?.value;
|
|
10174
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10175
|
-
"div",
|
|
10176
|
-
{
|
|
10177
|
-
ref,
|
|
10178
|
-
role: "tablist",
|
|
10179
|
-
className: chunkTPGAXYFU_cjs.cx("klun-tabs", `klun-tabs--${variant}`, className),
|
|
10180
|
-
...props,
|
|
10181
|
-
children: items2.map((it) => {
|
|
10182
|
-
const on = it.value === active;
|
|
10183
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10184
|
-
"button",
|
|
10185
|
-
{
|
|
10186
|
-
type: "button",
|
|
10187
|
-
role: "tab",
|
|
10188
|
-
"aria-selected": on,
|
|
10189
|
-
"data-active": on ? "true" : void 0,
|
|
10190
|
-
onClick: () => onChange?.(it.value),
|
|
10191
|
-
className: "klun-tabs__tab",
|
|
10192
|
-
children: [
|
|
10193
|
-
it.icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-tabs__icon", children: it.icon }) : null,
|
|
10194
|
-
it.label,
|
|
10195
|
-
it.badge != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-tabs__badge", children: it.badge }) : null
|
|
10196
|
-
]
|
|
10197
|
-
},
|
|
10198
|
-
it.value
|
|
10199
|
-
);
|
|
10200
|
-
})
|
|
10201
|
-
}
|
|
10202
|
-
);
|
|
10203
|
-
});
|
|
10204
|
-
Tabs.displayName = "Tabs";
|
|
10205
|
-
var PageHeader = react.forwardRef(function PageHeader2({
|
|
10206
|
-
title,
|
|
10207
|
-
avatar,
|
|
10208
|
-
tags,
|
|
10209
|
-
subtitle,
|
|
10210
|
-
breadcrumb,
|
|
10211
|
-
onBack,
|
|
10212
|
-
extra,
|
|
10213
|
-
tabs,
|
|
10214
|
-
activeTab,
|
|
10215
|
-
onTabChange,
|
|
10216
|
-
sticky = false,
|
|
10217
|
-
bordered = true,
|
|
10218
|
-
className,
|
|
10219
|
-
children,
|
|
10220
|
-
...props
|
|
10221
|
-
}, ref) {
|
|
10222
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10223
|
-
"header",
|
|
10224
|
-
{
|
|
10225
|
-
ref,
|
|
10226
|
-
className: chunkTPGAXYFU_cjs.cx(
|
|
10227
|
-
"klun-page-header",
|
|
10228
|
-
sticky && "klun-page-header--sticky",
|
|
10229
|
-
bordered && "klun-page-header--bordered",
|
|
10230
|
-
className
|
|
10231
|
-
),
|
|
10232
|
-
...props,
|
|
10233
|
-
children: [
|
|
10234
|
-
breadcrumb ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-page-header__breadcrumb", children: breadcrumb }) : null,
|
|
10235
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "klun-page-header__bar", children: [
|
|
10236
|
-
onBack ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10237
|
-
Button,
|
|
10238
|
-
{
|
|
10239
|
-
iconOnly: true,
|
|
10240
|
-
appearance: "ghost",
|
|
10241
|
-
variant: "neutral",
|
|
10242
|
-
size: "small",
|
|
10243
|
-
"aria-label": "Back",
|
|
10244
|
-
className: "klun-page-header__back",
|
|
10245
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "ri-arrow-left-line", "aria-hidden": true }),
|
|
10246
|
-
onClick: onBack
|
|
10247
|
-
}
|
|
10248
|
-
) : null,
|
|
10249
|
-
avatar ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-page-header__avatar", children: avatar }) : null,
|
|
10250
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "klun-page-header__heading", children: [
|
|
10251
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "klun-page-header__title-row", children: [
|
|
10252
|
-
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "klun-page-header__title", children: title }),
|
|
10253
|
-
tags ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-page-header__tags", children: tags }) : null
|
|
10254
|
-
] }),
|
|
10255
|
-
subtitle ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-page-header__subtitle", children: subtitle }) : null
|
|
10256
|
-
] }),
|
|
10257
|
-
extra ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-page-header__extra", children: extra }) : null
|
|
10258
|
-
] }),
|
|
10259
|
-
children ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-page-header__content", children }) : null,
|
|
10260
|
-
tabs && tabs.length ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10261
|
-
Tabs,
|
|
10262
|
-
{
|
|
10263
|
-
className: "klun-page-header__tabs",
|
|
10264
|
-
items: tabs.map((t) => ({ value: t.key, label: t.label })),
|
|
10265
|
-
value: activeTab,
|
|
10266
|
-
onChange: onTabChange
|
|
10267
|
-
}
|
|
10268
|
-
) : null
|
|
10269
|
-
]
|
|
10270
|
-
}
|
|
10271
|
-
);
|
|
10272
|
-
});
|
|
10273
|
-
PageHeader.displayName = "PageHeader";
|
|
10274
10176
|
var Divider = react.forwardRef(function Divider2({ variant = "line", className, children, ...props }, ref) {
|
|
10275
10177
|
if (variant !== "line" && children != null) {
|
|
10276
10178
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -10399,6 +10301,108 @@ var Menu = react.forwardRef(function Menu2({ items: items2 = [], selectedKey, on
|
|
|
10399
10301
|
);
|
|
10400
10302
|
});
|
|
10401
10303
|
Menu.displayName = "Menu";
|
|
10304
|
+
var Tabs = react.forwardRef(function Tabs2({ items: items2 = [], value, onChange, variant = "underline", className, ...props }, ref) {
|
|
10305
|
+
const active = value ?? items2[0]?.value;
|
|
10306
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10307
|
+
"div",
|
|
10308
|
+
{
|
|
10309
|
+
ref,
|
|
10310
|
+
role: "tablist",
|
|
10311
|
+
className: chunkTPGAXYFU_cjs.cx("klun-tabs", `klun-tabs--${variant}`, className),
|
|
10312
|
+
...props,
|
|
10313
|
+
children: items2.map((it) => {
|
|
10314
|
+
const on = it.value === active;
|
|
10315
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10316
|
+
"button",
|
|
10317
|
+
{
|
|
10318
|
+
type: "button",
|
|
10319
|
+
role: "tab",
|
|
10320
|
+
"aria-selected": on,
|
|
10321
|
+
"data-active": on ? "true" : void 0,
|
|
10322
|
+
onClick: () => onChange?.(it.value),
|
|
10323
|
+
className: "klun-tabs__tab",
|
|
10324
|
+
children: [
|
|
10325
|
+
it.icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-tabs__icon", children: it.icon }) : null,
|
|
10326
|
+
it.label,
|
|
10327
|
+
it.badge != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-tabs__badge", children: it.badge }) : null
|
|
10328
|
+
]
|
|
10329
|
+
},
|
|
10330
|
+
it.value
|
|
10331
|
+
);
|
|
10332
|
+
})
|
|
10333
|
+
}
|
|
10334
|
+
);
|
|
10335
|
+
});
|
|
10336
|
+
Tabs.displayName = "Tabs";
|
|
10337
|
+
var PageHeader = react.forwardRef(function PageHeader2({
|
|
10338
|
+
title,
|
|
10339
|
+
avatar,
|
|
10340
|
+
tags,
|
|
10341
|
+
subtitle,
|
|
10342
|
+
breadcrumb,
|
|
10343
|
+
onBack,
|
|
10344
|
+
extra,
|
|
10345
|
+
tabs,
|
|
10346
|
+
activeTab,
|
|
10347
|
+
onTabChange,
|
|
10348
|
+
sticky = false,
|
|
10349
|
+
bordered = true,
|
|
10350
|
+
className,
|
|
10351
|
+
children,
|
|
10352
|
+
...props
|
|
10353
|
+
}, ref) {
|
|
10354
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10355
|
+
"header",
|
|
10356
|
+
{
|
|
10357
|
+
ref,
|
|
10358
|
+
className: chunkTPGAXYFU_cjs.cx(
|
|
10359
|
+
"klun-page-header",
|
|
10360
|
+
sticky && "klun-page-header--sticky",
|
|
10361
|
+
bordered && "klun-page-header--bordered",
|
|
10362
|
+
className
|
|
10363
|
+
),
|
|
10364
|
+
...props,
|
|
10365
|
+
children: [
|
|
10366
|
+
breadcrumb ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-page-header__breadcrumb", children: breadcrumb }) : null,
|
|
10367
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "klun-page-header__bar", children: [
|
|
10368
|
+
onBack ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10369
|
+
Button,
|
|
10370
|
+
{
|
|
10371
|
+
iconOnly: true,
|
|
10372
|
+
appearance: "ghost",
|
|
10373
|
+
variant: "neutral",
|
|
10374
|
+
size: "small",
|
|
10375
|
+
"aria-label": "Back",
|
|
10376
|
+
className: "klun-page-header__back",
|
|
10377
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "ri-arrow-left-line", "aria-hidden": true }),
|
|
10378
|
+
onClick: onBack
|
|
10379
|
+
}
|
|
10380
|
+
) : null,
|
|
10381
|
+
avatar ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-page-header__avatar", children: avatar }) : null,
|
|
10382
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "klun-page-header__heading", children: [
|
|
10383
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "klun-page-header__title-row", children: [
|
|
10384
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "klun-page-header__title", children: title }),
|
|
10385
|
+
tags ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-page-header__tags", children: tags }) : null
|
|
10386
|
+
] }),
|
|
10387
|
+
subtitle ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-page-header__subtitle", children: subtitle }) : null
|
|
10388
|
+
] }),
|
|
10389
|
+
extra ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-page-header__extra", children: extra }) : null
|
|
10390
|
+
] }),
|
|
10391
|
+
children ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-page-header__content", children }) : null,
|
|
10392
|
+
tabs && tabs.length ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10393
|
+
Tabs,
|
|
10394
|
+
{
|
|
10395
|
+
className: "klun-page-header__tabs",
|
|
10396
|
+
items: tabs.map((t) => ({ value: t.key, label: t.label })),
|
|
10397
|
+
value: activeTab,
|
|
10398
|
+
onChange: onTabChange
|
|
10399
|
+
}
|
|
10400
|
+
) : null
|
|
10401
|
+
]
|
|
10402
|
+
}
|
|
10403
|
+
);
|
|
10404
|
+
});
|
|
10405
|
+
PageHeader.displayName = "PageHeader";
|
|
10402
10406
|
function Cell({ children, active, disabled, onClick, aria }) {
|
|
10403
10407
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10404
10408
|
"button",
|
|
@@ -11755,5 +11759,5 @@ exports.useSize = useSize;
|
|
|
11755
11759
|
exports.viVN = viVN;
|
|
11756
11760
|
exports.zhCN = zhCN;
|
|
11757
11761
|
exports.zhTW = zhTW;
|
|
11758
|
-
//# sourceMappingURL=chunk-
|
|
11759
|
-
//# sourceMappingURL=chunk-
|
|
11762
|
+
//# sourceMappingURL=chunk-T7O3RMWL.cjs.map
|
|
11763
|
+
//# sourceMappingURL=chunk-T7O3RMWL.cjs.map
|