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