@moontra/moonui 6.18.0 → 6.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2572,11 +2572,49 @@ var sliderRangeVariants = classVarianceAuthority.cva(
2572
2572
  variant: {
2573
2573
  default: "bg-foreground",
2574
2574
  primary: "bg-primary",
2575
- secondary: "bg-secondary",
2575
+ // #389 (#372'nin birebir ardılı): range `bg-secondary` idi — track'in
2576
+ // (`bg-secondary/20`) AYNI yüzey token'ına basıyordu; %20 alfa track ile
2577
+ // tam dolgu iki temada da ~1.0 oranında kalıyor, dolu kısım görünmüyordu
2578
+ // (light rgb(235,239,245) → 1.12 · dark rgb(2,8,23) → 1.01).
2579
+ // `bg-secondary-foreground` BİLEREK seçilmedi: light'ta --primary ile aynı
2580
+ // hue/sat'ta yalnız ΔL=%2 (fill↔fill 1.07), dark'ta birebir --primary
2581
+ // değeri (210 40% 98%) — secondary varyantı primary klonuna dönerdi.
2582
+ // `--secondary-500` (tokens.css slate skalası, RGB üçlüsü) iki temada da
2583
+ // track'e ≥3:1 (WCAG 1.4.11) veren TEK kademe: light 4.63, dark 4.23
2584
+ // (gerçek kart #111827 üstünde 3.83; 400 light'ta 2.50 ✗, 600 dark'ta
2585
+ // 2.66 ✗). Skala :root'ta tanımlı olduğundan tema değişiminde sabittir;
2586
+ // tüketici --secondary-500'ü ezerek özelleştirebilir.
2587
+ // Regresyon: __tests__/slider-secondary-contrast.test.ts
2588
+ secondary: "bg-[rgb(var(--secondary-500))]",
2576
2589
  accent: "bg-accent",
2577
2590
  success: "bg-success",
2578
- warning: "bg-warning",
2579
- error: "bg-error"
2591
+ // #442 (#424/PR #440'ın slider ikizi): range `bg-warning`/`bg-error` idi —
2592
+ // track (`bg-warning/20` · `bg-error/20`) AYNI token'ın alfalı hâli olduğundan
2593
+ // LIGHT temada ayrım kayboluyordu: warning 1.835 · error 2.893 (eşik 3:1,
2594
+ // WCAG 1.4.11 non-text). DARK tema zaten temizdi (warning 6.97 · error 4.46).
2595
+ //
2596
+ // KÖK NEDEN: `--warning` ve `--error` tokens.css'in `.dark` bloğunda
2597
+ // EZİLMİYOR — iki temada aynı renk. Kardeşleri tema-uyarlanabilir olduğu
2598
+ // için geçiyor (`--success` light %29 → dark %36; ölçüm: success A ekseni
2599
+ // light 3.73 / dark 4.83). Bu iki aile o uyarlamadan yoksun.
2600
+ //
2601
+ // ÇÖZÜM: eksik tema-uyarlamasını component düzeyinde ver — light'ta skalanın
2602
+ // -700 kademesine in, dark'ta semantik token'a DOKUNMA (dark render bit-bit
2603
+ // aynı kalır, regresyon yüzeyi sıfır). Tema-KÖR bir -700 ataması dark'ı
2604
+ // kırardı: gerçek docs kartı (#111827) üstünde warning 2.499 ✗ · error 2.232 ✗.
2605
+ // Tam skala taraması (11 kademe × 2 aile × 3 zemin × 2 tema) track `/20` iken
2606
+ // iki temayı birden geçen kademe kümesini BOŞ buluyor → `dark:` ayrımı ZORUNLU;
2607
+ // #389'un tek-orta-ton (`--secondary-500`) çözümü burada uygulanamaz, çünkü
2608
+ // orada `--secondary` temaya göre değişiyordu. Aynı `dark:` deseni badge.tsx:51-63
2609
+ // ve progress.tsx:110-111'de zaten kullanılıyor.
2610
+ // Ölçülen sonuç — warning: light 1.835 → 4.235 ✓ · error: light 2.893 → 4.950 ✓
2611
+ // (dark değişmedi: 6.97 / 4.46; docs kartı 5.77 / 3.82).
2612
+ // Skala token'ları RGB üçlüsüdür (semantiklerin HSL'inden farklı) →
2613
+ // `rgb(var(--x-700))` kompozisyonu; `bg-warning-700` YAZILMADI, preset bu
2614
+ // ailelere sayısal skala açmıyor (#307 ölü-sınıf tuzağı).
2615
+ // Regresyon: __tests__/slider-warning-error-contrast.test.ts
2616
+ warning: "bg-[rgb(var(--warning-700))] dark:bg-warning",
2617
+ error: "bg-[rgb(var(--error-700))] dark:bg-error"
2580
2618
  }
2581
2619
  },
2582
2620
  defaultVariants: {
@@ -2591,11 +2629,39 @@ var sliderThumbVariants = classVarianceAuthority.cva(
2591
2629
  variant: {
2592
2630
  default: "border-foreground bg-background",
2593
2631
  primary: "border-primary bg-background",
2594
- secondary: "border-secondary bg-background",
2632
+ // #407 (P2, #389'un range eksenine EK ayrı eksen): tutamacın kenarlığı
2633
+ // `border-secondary`, dolgusu `bg-background` idi. Bu bileşen↔sayfa-zemini
2634
+ // ekseni: `--secondary` light'ta neredeyse beyaz (rgb(235,239,245)), dark'ta
2635
+ // `--background` ile neredeyse aynı → kenarlık 1.15 (light) / 1.01 (dark)
2636
+ // oranında kalıyor, secondary slider'ın tutamacı zeminde kayboluyordu.
2637
+ // #389'da bilerek kapsam dışıydı (mevcut kusuru testle "doğru" ilan etmemek için).
2638
+ // Non-text UI bileşeni → WCAG 1.4.11 ≥3:1. Skala taraması bu eksende de TEK
2639
+ // kademe bırakıyor — `--secondary-500`: light 4.76, dark 4.23 (gerçek kart
2640
+ // #111827 üstünde 3.73); 400 light'ta 2.56 ✗, 600 dark'ta 2.66 ✗. Range ile
2641
+ // aynı kademe: tutamaç ve dolgu tek renkte okunur.
2642
+ // Regresyon: __tests__/slider-secondary-contrast.test.ts
2643
+ secondary: "border-[rgb(var(--secondary-500))] bg-background",
2595
2644
  accent: "border-accent bg-background",
2596
2645
  success: "border-success bg-background",
2597
- warning: "border-warning bg-background",
2598
- error: "border-error bg-background"
2646
+ // #442 EKSEN B (range'den FARKLI eksen: bileşen↔sayfa-zemini) — #407'de
2647
+ // `secondary` için açılan eksenin warning/error karşılığı. Tutamacın dolgusu
2648
+ // `bg-background`, yani zeminin kendisi; ayırt edilebilirliği YALNIZ kenarlık
2649
+ // taşır → non-text UI bileşeni, WCAG 1.4.11 ≥3:1.
2650
+ // ÖLÇÜLEN (eski değerler): warning light **2.133 ✗** · error light 3.781 ✓;
2651
+ // dark ikisi de rahat geçiyordu (9.45 / 5.33).
2652
+ //
2653
+ // `warning` KUSURLUYDU, düzeltildi. `error` bu eksende zaten geçiyordu ama
2654
+ // yine de aynı ifadeye çekildi: range light'ta -700'e indiği için kenarlık
2655
+ // `border-error`da bırakılsaydı LIGHT temada dolgu rgb(185,28,28), tutamaç
2656
+ // rgb(239,67,67) olurdu — düzeltmenin KENDİSİ iki-tonlu bir görünüm üretirdi.
2657
+ // #407'nin gerekçesi birebir geçerli: "tutamaç ve dolgu tek renkte okunur".
2658
+ // Değişim kontrastı düşürmüyor, artırıyor: error light 3.781 → 6.470.
2659
+ // Dark'ta `dark:border-*` semantik token'ı koruduğu için render bit-bit aynı.
2660
+ // Ölçülen sonuç — warning: light 2.133 → 4.923 ✓ · error: light 3.781 → 6.470 ✓
2661
+ // (dark değişmedi: 9.45 / 5.33; docs kartı 8.32 / 4.69).
2662
+ // Regresyon: __tests__/slider-warning-error-contrast.test.ts
2663
+ warning: "border-[rgb(var(--warning-700))] dark:border-warning bg-background",
2664
+ error: "border-[rgb(var(--error-700))] dark:border-error bg-background"
2599
2665
  },
2600
2666
  size: {
2601
2667
  sm: "h-3 w-3",
@@ -3787,6 +3853,8 @@ var CommandShortcut = ({
3787
3853
  };
3788
3854
  CommandShortcut.displayName = "CommandShortcut";
3789
3855
  var TableSortContext = React12__namespace.createContext(null);
3856
+ var TableStripedContext = React12__namespace.createContext(false);
3857
+ var STRIPED_ROW_CLASSES = "odd:bg-muted/50 hover:bg-accent";
3790
3858
  function nextSortDirection(current) {
3791
3859
  if (current === "asc")
3792
3860
  return "desc";
@@ -3839,6 +3907,7 @@ var Table = React12__namespace.forwardRef(({
3839
3907
  onRowSelectionChange: _onRowSelectionChange,
3840
3908
  disableRowSelection: _disableRowSelection,
3841
3909
  getRowId: _getRowId,
3910
+ children,
3842
3911
  ...props
3843
3912
  }, ref) => {
3844
3913
  const striped = variant === "striped";
@@ -3846,20 +3915,9 @@ var Table = React12__namespace.forwardRef(({
3846
3915
  () => ({ sortColumn, sortDirection, onSortChange }),
3847
3916
  [sortColumn, sortDirection, onSortChange]
3848
3917
  );
3849
- const childrenWithProps = React12__namespace.Children.map(props.children, (child) => {
3850
- if (React12__namespace.isValidElement(child)) {
3851
- if (child.type === "tbody") {
3852
- const tbodyProps = child.props;
3853
- return React12__namespace.cloneElement(child, {
3854
- className: cn(tbodyProps.className, striped && "even:[&>tr]:bg-muted/50")
3855
- });
3856
- }
3857
- }
3858
- return child;
3859
- });
3860
3918
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full overflow-auto", children: [
3861
3919
  loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-background/60 flex items-center justify-center z-10", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" }) }),
3862
- /* @__PURE__ */ jsxRuntime.jsx(TableSortContext.Provider, { value: sortContextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
3920
+ /* @__PURE__ */ jsxRuntime.jsx(TableSortContext.Provider, { value: sortContextValue, children: /* @__PURE__ */ jsxRuntime.jsx(TableStripedContext.Provider, { value: striped, children: /* @__PURE__ */ jsxRuntime.jsx(
3863
3921
  "table",
3864
3922
  {
3865
3923
  ref,
@@ -3869,13 +3927,13 @@ var Table = React12__namespace.forwardRef(({
3869
3927
  className
3870
3928
  ),
3871
3929
  ...props,
3872
- children: childrenWithProps
3930
+ children
3873
3931
  }
3874
- ) })
3932
+ ) }) })
3875
3933
  ] });
3876
3934
  });
3877
3935
  Table.displayName = "Table";
3878
- var TableHeader = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("moonui-theme", "[&_tr]:border-b", className), ...props }));
3936
+ var TableHeader = React12__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("moonui-theme", "[&_tr]:border-b", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(TableStripedContext.Provider, { value: false, children }) }));
3879
3937
  TableHeader.displayName = "TableHeader";
3880
3938
  var TableBody = React12__namespace.forwardRef(({ className, emptyContent, emptyMessage = "No data available", children, ...props }, ref) => {
3881
3939
  const hasChildren = React12__namespace.Children.count(children) > 0;
@@ -3890,26 +3948,31 @@ var TableBody = React12__namespace.forwardRef(({ className, emptyContent, emptyM
3890
3948
  );
3891
3949
  });
3892
3950
  TableBody.displayName = "TableBody";
3893
- var TableFooter = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
3951
+ var TableFooter = React12__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
3894
3952
  "tfoot",
3895
3953
  {
3896
3954
  ref,
3897
3955
  className: cn("moonui-theme", "bg-primary text-primary-foreground font-medium", className),
3898
- ...props
3956
+ ...props,
3957
+ children: /* @__PURE__ */ jsxRuntime.jsx(TableStripedContext.Provider, { value: false, children })
3899
3958
  }
3900
3959
  ));
3901
3960
  TableFooter.displayName = "TableFooter";
3902
- var TableRow = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
3903
- "tr",
3904
- {
3905
- ref,
3906
- className: cn(
3907
- "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
3908
- className
3909
- ),
3910
- ...props
3911
- }
3912
- ));
3961
+ var TableRow = React12__namespace.forwardRef(({ className, ...props }, ref) => {
3962
+ const striped = React12__namespace.useContext(TableStripedContext);
3963
+ return /* @__PURE__ */ jsxRuntime.jsx(
3964
+ "tr",
3965
+ {
3966
+ ref,
3967
+ className: cn(
3968
+ "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
3969
+ striped && STRIPED_ROW_CLASSES,
3970
+ className
3971
+ ),
3972
+ ...props
3973
+ }
3974
+ );
3975
+ });
3913
3976
  TableRow.displayName = "TableRow";
3914
3977
  var TableHead = React12__namespace.forwardRef(
3915
3978
  ({ className, sortable, sorted, onSort, columnId, align = "left", children, ...props }, ref) => {
@@ -4924,8 +4987,31 @@ var progressIndicatorVariants = classVarianceAuthority.cva(
4924
4987
  // Regresyon: __tests__/progress-secondary-contrast.test.ts
4925
4988
  secondary: "bg-[rgb(var(--secondary-500))]",
4926
4989
  success: "bg-success",
4927
- warning: "bg-warning",
4928
- error: "bg-error"
4990
+ // #424 (#372'nin kardeşi): dolgu `bg-warning`/`bg-error` idi — track
4991
+ // (`bg-warning/20` · `bg-error/20`) AYNI token'ın alfalı hâli olduğundan
4992
+ // LIGHT temada ayrım kayboluyordu: warning 1.83 · error 2.89 (eşik 3:1,
4993
+ // WCAG 1.4.11). DARK tema zaten temizdi (warning 6.97 · error 4.46).
4994
+ //
4995
+ // KÖK NEDEN: `--warning` ve `--error` tokens.css'te `.dark` bloğunda
4996
+ // EZİLMİYOR — iki temada aynı renk. Kardeşleri `--success` (light 29% →
4997
+ // dark 36%) ve `--primary` tema-uyarlanabilir olduğu için eşiği geçiyor;
4998
+ // bu iki aile o uyarlamadan yoksun kaldığı için light'ta kalıyor.
4999
+ //
5000
+ // ÇÖZÜM: eksik tema-uyarlamasını component düzeyinde ver — light'ta
5001
+ // skalanın -700 kademesine in, dark'ta semantik token'a DOKUNMA.
5002
+ // Tema-KÖR bir -700 ataması dark'ı kırardı (docs kartında warning 2.50 ✗
5003
+ // · error 2.23 ✗); `dark:` ayrımı tam olarak bunu önler ve dark render'ı
5004
+ // bit-bit aynı bırakır. Aynı desen badge.tsx:51-63'te zaten kullanılıyor.
5005
+ // Track alfaları BİLEREK `/20` kaldı: altı varyantın tamamı o konvansiyonu
5006
+ // paylaşıyor ve alfayı düşürmek track↔zemin ayrımını zayıflatırdı
5007
+ // (warning 1.162 → 1.081). Ölçülen sonuç — warning: light 4.24 ✓ /
5008
+ // dark 6.97 ✓ (docs kartı #111827: 5.77) · error: light 4.95 ✓ /
5009
+ // dark 4.46 ✓ (docs kartı 3.82). Skala token'ları RGB üçlüsüdür
5010
+ // (semantiklerin HSL'inden farklı) → `rgb(var(--x-700))` kompozisyonu;
5011
+ // `bg-warning-700` YAZILMADI, preset o sınıfı üretmez (#307 ölü-sınıf).
5012
+ // Regresyon: __tests__/progress-warning-error-contrast.test.ts
5013
+ warning: "bg-[rgb(var(--warning-700))] dark:bg-warning",
5014
+ error: "bg-[rgb(var(--error-700))] dark:bg-error"
4929
5015
  },
4930
5016
  animation: {
4931
5017
  default: "transition-all duration-500",