@expcat/tigercat-core 1.3.4 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/{datepicker-DXzS_8l8.d.cts → datepicker-gSOJN_pQ.d.cts} +1 -1
  2. package/dist/{datepicker-DXzS_8l8.d.ts → datepicker-gSOJN_pQ.d.ts} +1 -1
  3. package/dist/datepicker-locales/ar-SA.d.cts +1 -1
  4. package/dist/datepicker-locales/ar-SA.d.ts +1 -1
  5. package/dist/datepicker-locales/de-DE.d.cts +1 -1
  6. package/dist/datepicker-locales/de-DE.d.ts +1 -1
  7. package/dist/datepicker-locales/en-US.d.cts +1 -1
  8. package/dist/datepicker-locales/en-US.d.ts +1 -1
  9. package/dist/datepicker-locales/es-ES.d.cts +1 -1
  10. package/dist/datepicker-locales/es-ES.d.ts +1 -1
  11. package/dist/datepicker-locales/fr-FR.d.cts +1 -1
  12. package/dist/datepicker-locales/fr-FR.d.ts +1 -1
  13. package/dist/datepicker-locales/id-ID.d.cts +1 -1
  14. package/dist/datepicker-locales/id-ID.d.ts +1 -1
  15. package/dist/datepicker-locales/ja-JP.d.cts +1 -1
  16. package/dist/datepicker-locales/ja-JP.d.ts +1 -1
  17. package/dist/datepicker-locales/ko-KR.d.cts +1 -1
  18. package/dist/datepicker-locales/ko-KR.d.ts +1 -1
  19. package/dist/datepicker-locales/pt-BR.d.cts +1 -1
  20. package/dist/datepicker-locales/pt-BR.d.ts +1 -1
  21. package/dist/datepicker-locales/th-TH.d.cts +1 -1
  22. package/dist/datepicker-locales/th-TH.d.ts +1 -1
  23. package/dist/datepicker-locales/vi-VN.d.cts +1 -1
  24. package/dist/datepicker-locales/vi-VN.d.ts +1 -1
  25. package/dist/datepicker-locales/zh-CN.d.cts +1 -1
  26. package/dist/datepicker-locales/zh-CN.d.ts +1 -1
  27. package/dist/datepicker-locales/zh-TW.d.cts +1 -1
  28. package/dist/datepicker-locales/zh-TW.d.ts +1 -1
  29. package/dist/icons/registry.cjs +1 -3
  30. package/dist/icons/registry.js +1 -3
  31. package/dist/index.cjs +2094 -715
  32. package/dist/index.d.cts +811 -319
  33. package/dist/index.d.ts +811 -319
  34. package/dist/index.js +2023 -712
  35. package/dist/locale-BTAo7XO1.d.cts +392 -0
  36. package/dist/locale-hhhI2kH6.d.ts +392 -0
  37. package/dist/locales/ar-SA.cjs +357 -4
  38. package/dist/locales/ar-SA.d.cts +2 -2
  39. package/dist/locales/ar-SA.d.ts +2 -2
  40. package/dist/locales/ar-SA.js +357 -4
  41. package/dist/locales/de-DE.cjs +357 -4
  42. package/dist/locales/de-DE.d.cts +2 -2
  43. package/dist/locales/de-DE.d.ts +2 -2
  44. package/dist/locales/de-DE.js +357 -4
  45. package/dist/locales/en-US.cjs +159 -2
  46. package/dist/locales/en-US.d.cts +2 -2
  47. package/dist/locales/en-US.d.ts +2 -2
  48. package/dist/locales/en-US.js +157 -2
  49. package/dist/locales/es-ES.cjs +357 -4
  50. package/dist/locales/es-ES.d.cts +2 -2
  51. package/dist/locales/es-ES.d.ts +2 -2
  52. package/dist/locales/es-ES.js +357 -4
  53. package/dist/locales/fr-FR.cjs +357 -4
  54. package/dist/locales/fr-FR.d.cts +2 -2
  55. package/dist/locales/fr-FR.d.ts +2 -2
  56. package/dist/locales/fr-FR.js +357 -4
  57. package/dist/locales/id-ID.cjs +445 -3
  58. package/dist/locales/id-ID.d.cts +2 -2
  59. package/dist/locales/id-ID.d.ts +2 -2
  60. package/dist/locales/id-ID.js +443 -3
  61. package/dist/locales/ja-JP.cjs +445 -3
  62. package/dist/locales/ja-JP.d.cts +2 -2
  63. package/dist/locales/ja-JP.d.ts +2 -2
  64. package/dist/locales/ja-JP.js +443 -3
  65. package/dist/locales/ko-KR.cjs +445 -3
  66. package/dist/locales/ko-KR.d.cts +2 -2
  67. package/dist/locales/ko-KR.d.ts +2 -2
  68. package/dist/locales/ko-KR.js +443 -3
  69. package/dist/locales/pt-BR.cjs +357 -4
  70. package/dist/locales/pt-BR.d.cts +2 -2
  71. package/dist/locales/pt-BR.d.ts +2 -2
  72. package/dist/locales/pt-BR.js +357 -4
  73. package/dist/locales/th-TH.cjs +445 -3
  74. package/dist/locales/th-TH.d.cts +2 -2
  75. package/dist/locales/th-TH.d.ts +2 -2
  76. package/dist/locales/th-TH.js +443 -3
  77. package/dist/locales/vi-VN.cjs +445 -3
  78. package/dist/locales/vi-VN.d.cts +2 -2
  79. package/dist/locales/vi-VN.d.ts +2 -2
  80. package/dist/locales/vi-VN.js +443 -3
  81. package/dist/locales/zh-CN.cjs +159 -2
  82. package/dist/locales/zh-CN.d.cts +2 -2
  83. package/dist/locales/zh-CN.d.ts +2 -2
  84. package/dist/locales/zh-CN.js +157 -2
  85. package/dist/locales/zh-TW.cjs +445 -3
  86. package/dist/locales/zh-TW.d.cts +2 -2
  87. package/dist/locales/zh-TW.d.ts +2 -2
  88. package/dist/locales/zh-TW.js +443 -3
  89. package/dist/{table-export-CZ7wtGf4.d.ts → table-export-CfdzU6Y5.d.ts} +2 -2
  90. package/dist/{table-export-DOqFkseW.d.cts → table-export-vfyBzKui.d.cts} +2 -2
  91. package/dist/tailwind/modern.cjs +76 -81
  92. package/dist/tailwind/modern.d.cts +2 -3
  93. package/dist/tailwind/modern.d.ts +2 -3
  94. package/dist/tailwind/modern.js +76 -81
  95. package/dist/{tailwind-entry-D4_sseNi.d.ts → tailwind-entry-CNBAH7iv.d.cts} +7 -41
  96. package/dist/{tailwind-entry-DUchHtjs.d.cts → tailwind-entry-CNBAH7iv.d.ts} +7 -41
  97. package/dist/tailwind.cjs +123 -70
  98. package/dist/tailwind.d.cts +2 -3
  99. package/dist/tailwind.d.ts +2 -3
  100. package/dist/tailwind.js +123 -70
  101. package/dist/utils/table-export.cjs +7 -0
  102. package/dist/utils/table-export.d.cts +3 -3
  103. package/dist/utils/table-export.d.ts +3 -3
  104. package/dist/utils/table-export.js +7 -0
  105. package/package.json +5 -12
  106. package/dist/locale-BuZwW3Ok.d.ts +0 -135
  107. package/dist/locale-DDFn0b6z.d.cts +0 -135
  108. package/dist/types-CJYAW1ql.d-DDBFn6KB.d.cts +0 -126
  109. package/dist/types-CJYAW1ql.d-DDBFn6KB.d.ts +0 -126
package/dist/index.js CHANGED
@@ -472,37 +472,65 @@ function getPieDrawAnimationStyle(circumference, targetOffset, durationMs = 800)
472
472
 
473
473
  // src/utils/helpers/slider-utils.ts
474
474
  function sliderNormalizeValue(value, min, max, step = 1) {
475
- const clamped = Math.min(Math.max(value, min), max);
476
- const stepped = Math.round((clamped - min) / step) * step + min;
477
- return Math.min(stepped, max);
475
+ const safeMin = Number.isFinite(min) ? min : 0;
476
+ const safeMax = Number.isFinite(max) ? max : safeMin;
477
+ const lower = Math.min(safeMin, safeMax);
478
+ const upper = Math.max(safeMin, safeMax);
479
+ const safeStep = Number.isFinite(step) && step > 0 ? step : 1;
480
+ const safeValue = Number.isFinite(value) ? value : lower;
481
+ const clamped = Math.min(Math.max(safeValue, lower), upper);
482
+ const stepped = Math.round((clamped - lower) / safeStep) * safeStep + lower;
483
+ return Math.min(Math.max(stepped, lower), upper);
484
+ }
485
+ function sliderResolveMarks(marks, min, max) {
486
+ if (!marks) return {};
487
+ if (typeof marks === "object") return marks;
488
+ const safeMin = Number.isFinite(min) ? min : 0;
489
+ const safeMax = Number.isFinite(max) ? max : safeMin;
490
+ const lower = Math.min(safeMin, safeMax);
491
+ const upper = Math.max(safeMin, safeMax);
492
+ if (lower === upper) return { [lower]: String(lower) };
493
+ return { [lower]: String(lower), [upper]: String(upper) };
478
494
  }
479
495
  function sliderGetPercentage(value, min, max) {
480
- if (max === min) return 0;
481
- return (value - min) / (max - min) * 100;
496
+ const safeMin = Number.isFinite(min) ? min : 0;
497
+ const safeMax = Number.isFinite(max) ? max : safeMin;
498
+ const lower = Math.min(safeMin, safeMax);
499
+ const upper = Math.max(safeMin, safeMax);
500
+ if (upper === lower) return 0;
501
+ const safeValue = Number.isFinite(value) ? value : lower;
502
+ return (Math.min(Math.max(safeValue, lower), upper) - lower) / (upper - lower) * 100;
482
503
  }
483
504
  function sliderGetValueFromPosition(position, trackWidth, min, max, step = 1) {
484
- if (trackWidth === 0) return min;
485
- const ratio = position / trackWidth;
486
- const rawValue = ratio * (max - min) + min;
487
- return sliderNormalizeValue(rawValue, min, max, step);
505
+ const safeMin = Number.isFinite(min) ? min : 0;
506
+ const safeMax = Number.isFinite(max) ? max : safeMin;
507
+ const lower = Math.min(safeMin, safeMax);
508
+ const upper = Math.max(safeMin, safeMax);
509
+ if (!Number.isFinite(trackWidth) || trackWidth <= 0) return lower;
510
+ const safePosition = Number.isFinite(position) ? Math.min(Math.max(position, 0), trackWidth) : 0;
511
+ const ratio = safePosition / trackWidth;
512
+ const rawValue = ratio * (upper - lower) + lower;
513
+ return sliderNormalizeValue(rawValue, lower, upper, step);
488
514
  }
489
515
  function sliderGetKeyboardValue(key, currentValue, min, max, step = 1, largeStep) {
490
- const bigStep = largeStep ?? step * 10;
516
+ const safeStep = Number.isFinite(step) && step > 0 ? step : 1;
517
+ const bigStep = Number.isFinite(largeStep) && largeStep > 0 ? largeStep : safeStep * 10;
518
+ const safeCurrent = sliderNormalizeValue(currentValue, min, max, safeStep);
491
519
  switch (key) {
492
520
  case "ArrowRight":
493
521
  case "ArrowUp":
494
- return sliderNormalizeValue(currentValue + step, min, max, step);
522
+ return sliderNormalizeValue(safeCurrent + safeStep, min, max, safeStep);
495
523
  case "ArrowLeft":
496
524
  case "ArrowDown":
497
- return sliderNormalizeValue(currentValue - step, min, max, step);
525
+ return sliderNormalizeValue(safeCurrent - safeStep, min, max, safeStep);
498
526
  case "PageUp":
499
- return sliderNormalizeValue(currentValue + bigStep, min, max, step);
527
+ return sliderNormalizeValue(safeCurrent + bigStep, min, max, safeStep);
500
528
  case "PageDown":
501
- return sliderNormalizeValue(currentValue - bigStep, min, max, step);
529
+ return sliderNormalizeValue(safeCurrent - bigStep, min, max, safeStep);
502
530
  case "Home":
503
- return min;
531
+ return sliderNormalizeValue(min, min, max, safeStep);
504
532
  case "End":
505
- return max;
533
+ return sliderNormalizeValue(max, min, max, safeStep);
506
534
  default:
507
535
  return null;
508
536
  }
@@ -585,6 +613,10 @@ function normalizeStringOption(options, key) {
585
613
  }
586
614
  return options;
587
615
  }
616
+ function createInstanceCounter() {
617
+ let counter = 0;
618
+ return () => ++counter;
619
+ }
588
620
 
589
621
  // src/utils/icons/common.ts
590
622
  var closeIconViewBox = "0 0 24 24";
@@ -659,9 +691,7 @@ var iconRegistry = {
659
691
  "arrow-right": stroke24("M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"),
660
692
  "arrow-up": stroke24("M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18"),
661
693
  "arrow-down": stroke24("M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"),
662
- search: stroke24(
663
- "m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"
664
- ),
694
+ search: stroke24("m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"),
665
695
  plus: stroke24("M12 4.5v15m7.5-7.5h-15"),
666
696
  minus: stroke24("M5 12h14"),
667
697
  edit: stroke24(
@@ -838,6 +868,14 @@ function getFocusableElements(container) {
838
868
  );
839
869
  }
840
870
  function createFocusTrap(container, options = {}) {
871
+ if (!isBrowser()) {
872
+ return {
873
+ activate() {
874
+ },
875
+ deactivate() {
876
+ }
877
+ };
878
+ }
841
879
  const {
842
880
  initialFocus = null,
843
881
  returnFocusOnDeactivate = true,
@@ -920,6 +958,7 @@ function getOrCreateLiveRegion(level) {
920
958
  return el;
921
959
  }
922
960
  function announceToScreenReader(message, level = "polite") {
961
+ if (!isBrowser()) return;
923
962
  const region = getOrCreateLiveRegion(level);
924
963
  region.textContent = "";
925
964
  requestAnimationFrame(() => {
@@ -927,6 +966,16 @@ function announceToScreenReader(message, level = "polite") {
927
966
  });
928
967
  }
929
968
  function manageLiveRegion(level = "polite") {
969
+ if (!isBrowser()) {
970
+ return {
971
+ announce() {
972
+ },
973
+ clear() {
974
+ },
975
+ destroy() {
976
+ }
977
+ };
978
+ }
930
979
  const region = getOrCreateLiveRegion(level);
931
980
  return {
932
981
  announce(message) {
@@ -953,8 +1002,8 @@ function getActiveElement(doc) {
953
1002
  const active = doc?.activeElement;
954
1003
  return isHTMLElement(active) ? active : null;
955
1004
  }
956
- function captureActiveElement(doc = document) {
957
- return getActiveElement(doc);
1005
+ function captureActiveElement(doc) {
1006
+ return getActiveElement(doc ?? (isBrowser() ? document : void 0));
958
1007
  }
959
1008
  function focusElement(element, options) {
960
1009
  if (!element) return false;
@@ -985,7 +1034,8 @@ function getMenuItems(container) {
985
1034
  function handleMenuNavigation(container, event) {
986
1035
  const items = getMenuItems(container);
987
1036
  if (items.length === 0) return false;
988
- const currentIndex = items.indexOf(document.activeElement);
1037
+ const activeElement = container.ownerDocument?.activeElement ?? (isBrowser() ? document.activeElement : null);
1038
+ const currentIndex = items.indexOf(activeElement);
989
1039
  let nextIndex = -1;
990
1040
  switch (event.key) {
991
1041
  case "ArrowDown":
@@ -1129,14 +1179,25 @@ var TIGER_LOCALE_KEYS = [
1129
1179
  "locale",
1130
1180
  "direction",
1131
1181
  "common",
1182
+ "empty",
1132
1183
  "modal",
1133
1184
  "drawer",
1185
+ "qrcode",
1186
+ "timeline",
1134
1187
  "upload",
1135
1188
  "pagination",
1136
1189
  "table",
1137
1190
  "datePicker",
1191
+ "timePicker",
1138
1192
  "formWizard",
1139
- "taskBoard"
1193
+ "tour",
1194
+ "calendar",
1195
+ "fileManager",
1196
+ "imageViewer",
1197
+ "imageEditor",
1198
+ "status",
1199
+ "taskBoard",
1200
+ "formValidation"
1140
1201
  ];
1141
1202
  function isRecord3(value) {
1142
1203
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -1176,14 +1237,25 @@ function mergeTigerLocale(base, override) {
1176
1237
  locale: override?.locale ?? base?.locale,
1177
1238
  direction: override?.direction ?? base?.direction,
1178
1239
  common: { ...base?.common, ...override?.common },
1240
+ empty: { ...base?.empty, ...override?.empty },
1179
1241
  modal: { ...base?.modal, ...override?.modal },
1180
1242
  drawer: { ...base?.drawer, ...override?.drawer },
1243
+ qrcode: { ...base?.qrcode, ...override?.qrcode },
1244
+ timeline: { ...base?.timeline, ...override?.timeline },
1181
1245
  upload: { ...base?.upload, ...override?.upload },
1182
1246
  pagination: { ...base?.pagination, ...override?.pagination },
1183
1247
  table: { ...base?.table, ...override?.table },
1184
1248
  datePicker: { ...base?.datePicker, ...override?.datePicker },
1249
+ timePicker: { ...base?.timePicker, ...override?.timePicker },
1185
1250
  formWizard: { ...base?.formWizard, ...override?.formWizard },
1186
- taskBoard: { ...base?.taskBoard, ...override?.taskBoard }
1251
+ tour: { ...base?.tour, ...override?.tour },
1252
+ calendar: { ...base?.calendar, ...override?.calendar },
1253
+ fileManager: { ...base?.fileManager, ...override?.fileManager },
1254
+ imageViewer: { ...base?.imageViewer, ...override?.imageViewer },
1255
+ imageEditor: { ...base?.imageEditor, ...override?.imageEditor },
1256
+ status: { ...base?.status, ...override?.status },
1257
+ taskBoard: { ...base?.taskBoard, ...override?.taskBoard },
1258
+ formValidation: { ...base?.formValidation, ...override?.formValidation }
1187
1259
  };
1188
1260
  }
1189
1261
  var RTL_LANGUAGE_CODES = /* @__PURE__ */ new Set(["ar", "fa", "he", "iw", "ps", "ur"]);
@@ -1244,6 +1316,59 @@ var ZH_CN_FORM_WIZARD_LABELS = {
1244
1316
  nextText: "\u4E0B\u4E00\u6B65",
1245
1317
  finishText: "\u5B8C\u6210"
1246
1318
  };
1319
+ var DEFAULT_TOUR_LABELS = {
1320
+ prevText: "Previous",
1321
+ nextText: "Next",
1322
+ finishText: "Finish",
1323
+ closeAriaLabel: "Close tour"
1324
+ };
1325
+ var ZH_CN_TOUR_LABELS = {
1326
+ prevText: "\u4E0A\u4E00\u6B65",
1327
+ nextText: "\u4E0B\u4E00\u6B65",
1328
+ finishText: "\u5B8C\u6210",
1329
+ closeAriaLabel: "\u5173\u95ED\u5BFC\u89C8"
1330
+ };
1331
+ function getTourLabels(locale, overrides) {
1332
+ const isZh = locale?.locale?.startsWith("zh");
1333
+ const defaultLabels = isZh ? ZH_CN_TOUR_LABELS : DEFAULT_TOUR_LABELS;
1334
+ return {
1335
+ prevText: overrides?.prevText ?? locale?.tour?.prevText ?? locale?.formWizard?.prevText ?? defaultLabels.prevText,
1336
+ nextText: overrides?.nextText ?? locale?.tour?.nextText ?? locale?.formWizard?.nextText ?? defaultLabels.nextText,
1337
+ finishText: overrides?.finishText ?? locale?.tour?.finishText ?? locale?.formWizard?.finishText ?? defaultLabels.finishText,
1338
+ closeAriaLabel: overrides?.closeAriaLabel ?? locale?.tour?.closeAriaLabel ?? locale?.common?.closeText ?? defaultLabels.closeAriaLabel
1339
+ };
1340
+ }
1341
+ var DEFAULT_CALENDAR_LABELS = {
1342
+ previousMonth: "Previous month",
1343
+ nextMonth: "Next month",
1344
+ previousYear: "Previous year",
1345
+ nextYear: "Next year",
1346
+ yearSelectAriaLabel: "Year",
1347
+ monthSelectAriaLabel: "Month",
1348
+ daySelectAriaLabel: "Day"
1349
+ };
1350
+ var ZH_CN_CALENDAR_LABELS = {
1351
+ previousMonth: "\u4E0A\u4E2A\u6708",
1352
+ nextMonth: "\u4E0B\u4E2A\u6708",
1353
+ previousYear: "\u4E0A\u4E00\u5E74",
1354
+ nextYear: "\u4E0B\u4E00\u5E74",
1355
+ yearSelectAriaLabel: "\u5E74\u4EFD",
1356
+ monthSelectAriaLabel: "\u6708\u4EFD",
1357
+ daySelectAriaLabel: "\u65E5\u671F"
1358
+ };
1359
+ function getCalendarLabels(locale) {
1360
+ const isZh = locale?.locale?.startsWith("zh");
1361
+ const defaultLabels = isZh ? ZH_CN_CALENDAR_LABELS : DEFAULT_CALENDAR_LABELS;
1362
+ return {
1363
+ previousMonth: locale?.calendar?.previousMonth ?? defaultLabels.previousMonth,
1364
+ nextMonth: locale?.calendar?.nextMonth ?? defaultLabels.nextMonth,
1365
+ previousYear: locale?.calendar?.previousYear ?? defaultLabels.previousYear,
1366
+ nextYear: locale?.calendar?.nextYear ?? defaultLabels.nextYear,
1367
+ yearSelectAriaLabel: locale?.calendar?.yearSelectAriaLabel ?? defaultLabels.yearSelectAriaLabel,
1368
+ monthSelectAriaLabel: locale?.calendar?.monthSelectAriaLabel ?? defaultLabels.monthSelectAriaLabel,
1369
+ daySelectAriaLabel: locale?.calendar?.daySelectAriaLabel ?? defaultLabels.daySelectAriaLabel
1370
+ };
1371
+ }
1247
1372
  function getFormWizardLabels(locale, overrides) {
1248
1373
  const isZh = locale?.locale?.startsWith("zh");
1249
1374
  const defaultLabels = isZh ? ZH_CN_FORM_WIZARD_LABELS : DEFAULT_FORM_WIZARD_LABELS;
@@ -1294,7 +1419,15 @@ var DEFAULT_TABLE_LABELS = {
1294
1419
  columnSettingsText: "Column settings",
1295
1420
  columnSettingsAriaLabel: "Column settings",
1296
1421
  lockColumnAriaLabel: "Lock column {column}",
1297
- unlockColumnAriaLabel: "Unlock column {column}"
1422
+ unlockColumnAriaLabel: "Unlock column {column}",
1423
+ allText: "All",
1424
+ filterPlaceholder: "Filter...",
1425
+ exportCsvText: "Export CSV",
1426
+ exportExcelText: "Export Excel",
1427
+ exportCsvAriaLabel: "Export to CSV",
1428
+ exportExcelAriaLabel: "Export to Excel",
1429
+ expandRowAriaLabel: "Expand row",
1430
+ collapseRowAriaLabel: "Collapse row"
1298
1431
  };
1299
1432
  var ZH_CN_TABLE_LABELS = {
1300
1433
  emptyText: "\u6682\u65E0\u6570\u636E",
@@ -1313,7 +1446,15 @@ var ZH_CN_TABLE_LABELS = {
1313
1446
  columnSettingsText: "\u5217\u8BBE\u7F6E",
1314
1447
  columnSettingsAriaLabel: "\u5217\u8BBE\u7F6E",
1315
1448
  lockColumnAriaLabel: "\u9501\u5B9A{column}\u5217",
1316
- unlockColumnAriaLabel: "\u53D6\u6D88\u9501\u5B9A{column}\u5217"
1449
+ unlockColumnAriaLabel: "\u53D6\u6D88\u9501\u5B9A{column}\u5217",
1450
+ allText: "\u5168\u90E8",
1451
+ filterPlaceholder: "\u7B5B\u9009...",
1452
+ exportCsvText: "\u5BFC\u51FA CSV",
1453
+ exportExcelText: "\u5BFC\u51FA Excel",
1454
+ exportCsvAriaLabel: "\u5BFC\u51FA\u4E3A CSV",
1455
+ exportExcelAriaLabel: "\u5BFC\u51FA\u4E3A Excel",
1456
+ expandRowAriaLabel: "\u5C55\u5F00\u884C",
1457
+ collapseRowAriaLabel: "\u6536\u8D77\u884C"
1317
1458
  };
1318
1459
  function getTableLabels(locale, overrides) {
1319
1460
  const isZh = !!locale?.locale?.startsWith("zh") || locale?.common?.emptyText === "\u6682\u65E0\u6570\u636E" || locale?.table?.searchButtonText === "\u641C\u7D22";
@@ -1335,7 +1476,15 @@ function getTableLabels(locale, overrides) {
1335
1476
  columnSettingsText: overrides?.columnSettingsText ?? locale?.table?.columnSettingsText ?? defaultLabels.columnSettingsText,
1336
1477
  columnSettingsAriaLabel: overrides?.columnSettingsAriaLabel ?? locale?.table?.columnSettingsAriaLabel ?? defaultLabels.columnSettingsAriaLabel,
1337
1478
  lockColumnAriaLabel: overrides?.lockColumnAriaLabel ?? locale?.table?.lockColumnAriaLabel ?? defaultLabels.lockColumnAriaLabel,
1338
- unlockColumnAriaLabel: overrides?.unlockColumnAriaLabel ?? locale?.table?.unlockColumnAriaLabel ?? defaultLabels.unlockColumnAriaLabel
1479
+ unlockColumnAriaLabel: overrides?.unlockColumnAriaLabel ?? locale?.table?.unlockColumnAriaLabel ?? defaultLabels.unlockColumnAriaLabel,
1480
+ allText: overrides?.allText ?? locale?.table?.allText ?? defaultLabels.allText,
1481
+ filterPlaceholder: overrides?.filterPlaceholder ?? locale?.table?.filterPlaceholder ?? defaultLabels.filterPlaceholder,
1482
+ exportCsvText: overrides?.exportCsvText ?? locale?.table?.exportCsvText ?? defaultLabels.exportCsvText,
1483
+ exportExcelText: overrides?.exportExcelText ?? locale?.table?.exportExcelText ?? defaultLabels.exportExcelText,
1484
+ exportCsvAriaLabel: overrides?.exportCsvAriaLabel ?? locale?.table?.exportCsvAriaLabel ?? defaultLabels.exportCsvAriaLabel,
1485
+ exportExcelAriaLabel: overrides?.exportExcelAriaLabel ?? locale?.table?.exportExcelAriaLabel ?? defaultLabels.exportExcelAriaLabel,
1486
+ expandRowAriaLabel: overrides?.expandRowAriaLabel ?? locale?.table?.expandRowAriaLabel ?? defaultLabels.expandRowAriaLabel,
1487
+ collapseRowAriaLabel: overrides?.collapseRowAriaLabel ?? locale?.table?.collapseRowAriaLabel ?? defaultLabels.collapseRowAriaLabel
1339
1488
  };
1340
1489
  }
1341
1490
  function formatTableSelectRowAriaLabel(template, row, locale) {
@@ -1347,6 +1496,7 @@ function formatTableSortByText(template, column) {
1347
1496
  var DEFAULT_TASK_BOARD_LABELS = {
1348
1497
  emptyColumnText: "No tasks",
1349
1498
  addCardText: "Add task",
1499
+ addColumnText: "Add column",
1350
1500
  wipLimitText: "WIP limit: {limit}",
1351
1501
  dragHintText: "Drag to move",
1352
1502
  boardAriaLabel: "Task Board"
@@ -1354,6 +1504,7 @@ var DEFAULT_TASK_BOARD_LABELS = {
1354
1504
  var ZH_CN_TASK_BOARD_LABELS = {
1355
1505
  emptyColumnText: "\u6682\u65E0\u4EFB\u52A1",
1356
1506
  addCardText: "\u6DFB\u52A0\u4EFB\u52A1",
1507
+ addColumnText: "\u6DFB\u52A0\u5217",
1357
1508
  wipLimitText: "WIP \u9650\u5236: {limit}",
1358
1509
  dragHintText: "\u62D6\u62FD\u4EE5\u79FB\u52A8",
1359
1510
  boardAriaLabel: "\u4EFB\u52A1\u770B\u677F"
@@ -1364,13 +1515,295 @@ function getTaskBoardLabels(locale, overrides) {
1364
1515
  return {
1365
1516
  emptyColumnText: overrides?.emptyColumnText ?? locale?.taskBoard?.emptyColumnText ?? defaultLabels.emptyColumnText,
1366
1517
  addCardText: overrides?.addCardText ?? locale?.taskBoard?.addCardText ?? defaultLabels.addCardText,
1518
+ addColumnText: overrides?.addColumnText ?? locale?.taskBoard?.addColumnText ?? defaultLabels.addColumnText,
1367
1519
  wipLimitText: overrides?.wipLimitText ?? locale?.taskBoard?.wipLimitText ?? defaultLabels.wipLimitText,
1368
1520
  dragHintText: overrides?.dragHintText ?? locale?.taskBoard?.dragHintText ?? defaultLabels.dragHintText,
1369
1521
  boardAriaLabel: overrides?.boardAriaLabel ?? locale?.taskBoard?.boardAriaLabel ?? defaultLabels.boardAriaLabel
1370
1522
  };
1371
1523
  }
1524
+ var DEFAULT_FILE_MANAGER_LABELS = {
1525
+ rootText: "Root"
1526
+ };
1527
+ var ZH_CN_FILE_MANAGER_LABELS = {
1528
+ rootText: "\u6839\u76EE\u5F55"
1529
+ };
1530
+ function getFileManagerLabels(locale) {
1531
+ const defaultLabels = locale?.locale?.startsWith("zh") ? ZH_CN_FILE_MANAGER_LABELS : DEFAULT_FILE_MANAGER_LABELS;
1532
+ return {
1533
+ rootText: locale?.fileManager?.rootText ?? defaultLabels.rootText
1534
+ };
1535
+ }
1536
+ var DEFAULT_IMAGE_VIEWER_LABELS = {
1537
+ dialogAriaLabel: "Image viewer",
1538
+ previewDialogAriaLabel: "Image preview",
1539
+ closeAriaLabel: "Close",
1540
+ closePreviewAriaLabel: "Close preview",
1541
+ previousImageAriaLabel: "Previous image",
1542
+ nextImageAriaLabel: "Next image",
1543
+ zoomOutAriaLabel: "Zoom out",
1544
+ resetAriaLabel: "Reset",
1545
+ zoomInAriaLabel: "Zoom in",
1546
+ rotateLeftAriaLabel: "Rotate left",
1547
+ rotateRightAriaLabel: "Rotate right"
1548
+ };
1549
+ var ZH_CN_IMAGE_VIEWER_LABELS = {
1550
+ dialogAriaLabel: "\u56FE\u7247\u67E5\u770B\u5668",
1551
+ previewDialogAriaLabel: "\u56FE\u7247\u9884\u89C8",
1552
+ closeAriaLabel: "\u5173\u95ED",
1553
+ closePreviewAriaLabel: "\u5173\u95ED\u9884\u89C8",
1554
+ previousImageAriaLabel: "\u4E0A\u4E00\u5F20\u56FE\u7247",
1555
+ nextImageAriaLabel: "\u4E0B\u4E00\u5F20\u56FE\u7247",
1556
+ zoomOutAriaLabel: "\u7F29\u5C0F",
1557
+ resetAriaLabel: "\u91CD\u7F6E",
1558
+ zoomInAriaLabel: "\u653E\u5927",
1559
+ rotateLeftAriaLabel: "\u5411\u5DE6\u65CB\u8F6C",
1560
+ rotateRightAriaLabel: "\u5411\u53F3\u65CB\u8F6C"
1561
+ };
1562
+ function getImageViewerLabels(locale) {
1563
+ const defaultLabels = locale?.locale?.startsWith("zh") ? ZH_CN_IMAGE_VIEWER_LABELS : DEFAULT_IMAGE_VIEWER_LABELS;
1564
+ return {
1565
+ dialogAriaLabel: locale?.imageViewer?.dialogAriaLabel ?? defaultLabels.dialogAriaLabel,
1566
+ previewDialogAriaLabel: locale?.imageViewer?.previewDialogAriaLabel ?? defaultLabels.previewDialogAriaLabel,
1567
+ closeAriaLabel: locale?.imageViewer?.closeAriaLabel ?? locale?.common?.closeText ?? defaultLabels.closeAriaLabel,
1568
+ closePreviewAriaLabel: locale?.imageViewer?.closePreviewAriaLabel ?? defaultLabels.closePreviewAriaLabel,
1569
+ previousImageAriaLabel: locale?.imageViewer?.previousImageAriaLabel ?? defaultLabels.previousImageAriaLabel,
1570
+ nextImageAriaLabel: locale?.imageViewer?.nextImageAriaLabel ?? defaultLabels.nextImageAriaLabel,
1571
+ zoomOutAriaLabel: locale?.imageViewer?.zoomOutAriaLabel ?? defaultLabels.zoomOutAriaLabel,
1572
+ resetAriaLabel: locale?.imageViewer?.resetAriaLabel ?? defaultLabels.resetAriaLabel,
1573
+ zoomInAriaLabel: locale?.imageViewer?.zoomInAriaLabel ?? defaultLabels.zoomInAriaLabel,
1574
+ rotateLeftAriaLabel: locale?.imageViewer?.rotateLeftAriaLabel ?? defaultLabels.rotateLeftAriaLabel,
1575
+ rotateRightAriaLabel: locale?.imageViewer?.rotateRightAriaLabel ?? defaultLabels.rotateRightAriaLabel
1576
+ };
1577
+ }
1578
+ var DEFAULT_IMAGE_EDITOR_LABELS = {
1579
+ selectImageText: "Select image",
1580
+ selectImageAriaLabel: "Select image to crop and upload",
1581
+ cropModalTitle: "Crop image",
1582
+ cropCancelText: "Cancel",
1583
+ cropConfirmText: "Confirm crop",
1584
+ cropperDialogAriaLabel: "Image cropper",
1585
+ imageToCropAriaLabel: "Image to crop",
1586
+ moveCropAreaAriaLabel: "Move crop area",
1587
+ resizeCropAreaAriaLabel: "Resize crop area {handle}",
1588
+ loadingCropImageAriaLabel: "Loading image for cropping",
1589
+ annotationToolbarAriaLabel: "Annotation tools",
1590
+ annotationEditorAriaLabel: "Image annotation editor",
1591
+ annotationCanvasAriaLabel: "Image annotation canvas",
1592
+ loadingAnnotationImageAriaLabel: "Loading image for annotation",
1593
+ selectToolText: "Select",
1594
+ rectangleToolText: "Rectangle",
1595
+ ellipseToolText: "Ellipse",
1596
+ polygonToolText: "Polygon",
1597
+ freehandToolText: "Freehand",
1598
+ deleteText: "Delete"
1599
+ };
1600
+ var ZH_CN_IMAGE_EDITOR_LABELS = {
1601
+ selectImageText: "\u9009\u62E9\u56FE\u7247",
1602
+ selectImageAriaLabel: "\u9009\u62E9\u56FE\u7247\u8FDB\u884C\u88C1\u526A\u5E76\u4E0A\u4F20",
1603
+ cropModalTitle: "\u88C1\u526A\u56FE\u7247",
1604
+ cropCancelText: "\u53D6\u6D88",
1605
+ cropConfirmText: "\u786E\u8BA4\u88C1\u526A",
1606
+ cropperDialogAriaLabel: "\u56FE\u7247\u88C1\u526A\u5668",
1607
+ imageToCropAriaLabel: "\u5F85\u88C1\u526A\u56FE\u7247",
1608
+ moveCropAreaAriaLabel: "\u79FB\u52A8\u88C1\u526A\u533A\u57DF",
1609
+ resizeCropAreaAriaLabel: "\u8C03\u6574\u88C1\u526A\u533A\u57DF {handle}",
1610
+ loadingCropImageAriaLabel: "\u6B63\u5728\u52A0\u8F7D\u5F85\u88C1\u526A\u56FE\u7247",
1611
+ annotationToolbarAriaLabel: "\u6807\u6CE8\u5DE5\u5177",
1612
+ annotationEditorAriaLabel: "\u56FE\u7247\u6807\u6CE8\u7F16\u8F91\u5668",
1613
+ annotationCanvasAriaLabel: "\u56FE\u7247\u6807\u6CE8\u753B\u5E03",
1614
+ loadingAnnotationImageAriaLabel: "\u6B63\u5728\u52A0\u8F7D\u5F85\u6807\u6CE8\u56FE\u7247",
1615
+ selectToolText: "\u9009\u62E9",
1616
+ rectangleToolText: "\u77E9\u5F62",
1617
+ ellipseToolText: "\u692D\u5706",
1618
+ polygonToolText: "\u591A\u8FB9\u5F62",
1619
+ freehandToolText: "\u81EA\u7531\u7ED8\u5236",
1620
+ deleteText: "\u5220\u9664"
1621
+ };
1622
+ function getImageEditorLabels(locale) {
1623
+ const defaultLabels = locale?.locale?.startsWith("zh") ? ZH_CN_IMAGE_EDITOR_LABELS : DEFAULT_IMAGE_EDITOR_LABELS;
1624
+ return {
1625
+ selectImageText: locale?.imageEditor?.selectImageText ?? defaultLabels.selectImageText,
1626
+ selectImageAriaLabel: locale?.imageEditor?.selectImageAriaLabel ?? defaultLabels.selectImageAriaLabel,
1627
+ cropModalTitle: locale?.imageEditor?.cropModalTitle ?? defaultLabels.cropModalTitle,
1628
+ cropCancelText: locale?.imageEditor?.cropCancelText ?? locale?.common?.cancelText ?? defaultLabels.cropCancelText,
1629
+ cropConfirmText: locale?.imageEditor?.cropConfirmText ?? locale?.common?.okText ?? defaultLabels.cropConfirmText,
1630
+ cropperDialogAriaLabel: locale?.imageEditor?.cropperDialogAriaLabel ?? defaultLabels.cropperDialogAriaLabel,
1631
+ imageToCropAriaLabel: locale?.imageEditor?.imageToCropAriaLabel ?? defaultLabels.imageToCropAriaLabel,
1632
+ moveCropAreaAriaLabel: locale?.imageEditor?.moveCropAreaAriaLabel ?? defaultLabels.moveCropAreaAriaLabel,
1633
+ resizeCropAreaAriaLabel: locale?.imageEditor?.resizeCropAreaAriaLabel ?? defaultLabels.resizeCropAreaAriaLabel,
1634
+ loadingCropImageAriaLabel: locale?.imageEditor?.loadingCropImageAriaLabel ?? defaultLabels.loadingCropImageAriaLabel,
1635
+ annotationToolbarAriaLabel: locale?.imageEditor?.annotationToolbarAriaLabel ?? defaultLabels.annotationToolbarAriaLabel,
1636
+ annotationEditorAriaLabel: locale?.imageEditor?.annotationEditorAriaLabel ?? defaultLabels.annotationEditorAriaLabel,
1637
+ annotationCanvasAriaLabel: locale?.imageEditor?.annotationCanvasAriaLabel ?? defaultLabels.annotationCanvasAriaLabel,
1638
+ loadingAnnotationImageAriaLabel: locale?.imageEditor?.loadingAnnotationImageAriaLabel ?? defaultLabels.loadingAnnotationImageAriaLabel,
1639
+ selectToolText: locale?.imageEditor?.selectToolText ?? defaultLabels.selectToolText,
1640
+ rectangleToolText: locale?.imageEditor?.rectangleToolText ?? defaultLabels.rectangleToolText,
1641
+ ellipseToolText: locale?.imageEditor?.ellipseToolText ?? defaultLabels.ellipseToolText,
1642
+ polygonToolText: locale?.imageEditor?.polygonToolText ?? defaultLabels.polygonToolText,
1643
+ freehandToolText: locale?.imageEditor?.freehandToolText ?? defaultLabels.freehandToolText,
1644
+ deleteText: locale?.imageEditor?.deleteText ?? defaultLabels.deleteText
1645
+ };
1646
+ }
1647
+ var DEFAULT_STATUS_LABELS = {
1648
+ tagCloseAriaLabel: "Close tag",
1649
+ badgeLabel: "notification",
1650
+ badgeCountLabel: "{count} notifications"
1651
+ };
1652
+ var ZH_CN_STATUS_LABELS = {
1653
+ tagCloseAriaLabel: "\u5173\u95ED\u6807\u7B7E",
1654
+ badgeLabel: "\u901A\u77E5",
1655
+ badgeCountLabel: "{count} \u6761\u901A\u77E5"
1656
+ };
1657
+ function getStatusLabels(locale) {
1658
+ const defaultLabels = locale?.locale?.startsWith("zh") ? ZH_CN_STATUS_LABELS : DEFAULT_STATUS_LABELS;
1659
+ return {
1660
+ tagCloseAriaLabel: locale?.status?.tagCloseAriaLabel ?? defaultLabels.tagCloseAriaLabel,
1661
+ badgeLabel: locale?.status?.badgeLabel ?? defaultLabels.badgeLabel,
1662
+ badgeCountLabel: locale?.status?.badgeCountLabel ?? defaultLabels.badgeCountLabel
1663
+ };
1664
+ }
1665
+ var DEFAULT_FORM_VALIDATION_LABELS = {
1666
+ required: "This field is required",
1667
+ typeString: "Value must be a string",
1668
+ typeNumber: "Value must be a number",
1669
+ typeBoolean: "Value must be a boolean",
1670
+ typeArray: "Value must be an array",
1671
+ typeObject: "Value must be an object",
1672
+ email: "Please enter a valid email address",
1673
+ phone: "Please enter a valid phone number",
1674
+ url: "Please enter a valid URL",
1675
+ date: "Please enter a valid date",
1676
+ idCard: "Please enter a valid ID card number",
1677
+ minLength: "Minimum length is {min} characters",
1678
+ maxLength: "Maximum length is {max} characters",
1679
+ minValue: "Minimum value is {min}",
1680
+ maxValue: "Maximum value is {max}",
1681
+ minItems: "Minimum {min} items required",
1682
+ maxItems: "Maximum {max} items allowed",
1683
+ patternMismatch: "Value does not match the required pattern",
1684
+ validatorFailed: "Validation failed",
1685
+ validatorError: "Validation error occurred"
1686
+ };
1687
+ var ZH_CN_FORM_VALIDATION_LABELS = {
1688
+ required: "\u6B64\u5B57\u6BB5\u4E3A\u5FC5\u586B\u9879",
1689
+ typeString: "\u503C\u5FC5\u987B\u662F\u5B57\u7B26\u4E32",
1690
+ typeNumber: "\u503C\u5FC5\u987B\u662F\u6570\u5B57",
1691
+ typeBoolean: "\u503C\u5FC5\u987B\u662F\u5E03\u5C14\u503C",
1692
+ typeArray: "\u503C\u5FC5\u987B\u662F\u6570\u7EC4",
1693
+ typeObject: "\u503C\u5FC5\u987B\u662F\u5BF9\u8C61",
1694
+ email: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u90AE\u7BB1\u5730\u5740",
1695
+ phone: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u7535\u8BDD\u53F7\u7801",
1696
+ url: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u7F51\u5740",
1697
+ date: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u65E5\u671F",
1698
+ idCard: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u8EAB\u4EFD\u8BC1\u53F7\u7801",
1699
+ minLength: "\u957F\u5EA6\u4E0D\u80FD\u5C11\u4E8E {min} \u4E2A\u5B57\u7B26",
1700
+ maxLength: "\u957F\u5EA6\u4E0D\u80FD\u8D85\u8FC7 {max} \u4E2A\u5B57\u7B26",
1701
+ minValue: "\u6570\u503C\u4E0D\u80FD\u5C0F\u4E8E {min}",
1702
+ maxValue: "\u6570\u503C\u4E0D\u80FD\u5927\u4E8E {max}",
1703
+ minItems: "\u81F3\u5C11\u9700\u8981 {min} \u9879",
1704
+ maxItems: "\u6700\u591A\u5141\u8BB8 {max} \u9879",
1705
+ patternMismatch: "\u683C\u5F0F\u4E0D\u6B63\u786E",
1706
+ validatorFailed: "\u6821\u9A8C\u672A\u901A\u8FC7",
1707
+ validatorError: "\u6821\u9A8C\u65F6\u53D1\u751F\u9519\u8BEF"
1708
+ };
1709
+ function getFormValidationLabels(locale, overrides) {
1710
+ const isZh = !!locale?.locale?.startsWith("zh");
1711
+ const defaultLabels = isZh ? ZH_CN_FORM_VALIDATION_LABELS : DEFAULT_FORM_VALIDATION_LABELS;
1712
+ const fv = locale?.formValidation;
1713
+ const resolved = {};
1714
+ for (const key of Object.keys(defaultLabels)) {
1715
+ resolved[key] = overrides?.[key] ?? fv?.[key] ?? defaultLabels[key];
1716
+ }
1717
+ return resolved;
1718
+ }
1719
+ var DEFAULT_TIME_PICKER_LABELS = {
1720
+ hour: "Hour",
1721
+ minute: "Min",
1722
+ second: "Sec",
1723
+ now: "Now",
1724
+ ok: "OK",
1725
+ start: "Start",
1726
+ end: "End",
1727
+ clear: "Clear time",
1728
+ toggle: "Toggle time picker",
1729
+ dialog: "Time picker",
1730
+ selectTime: "Select time",
1731
+ selectTimeRange: "Select time range"
1732
+ };
1733
+ var ZH_CN_TIME_PICKER_LABELS = {
1734
+ hour: "\u65F6",
1735
+ minute: "\u5206",
1736
+ second: "\u79D2",
1737
+ now: "\u73B0\u5728",
1738
+ ok: "\u786E\u5B9A",
1739
+ start: "\u5F00\u59CB",
1740
+ end: "\u7ED3\u675F",
1741
+ clear: "\u6E05\u9664\u65F6\u95F4",
1742
+ toggle: "\u6253\u5F00\u65F6\u95F4\u9009\u62E9\u5668",
1743
+ dialog: "\u65F6\u95F4\u9009\u62E9\u5668",
1744
+ selectTime: "\u8BF7\u9009\u62E9\u65F6\u95F4",
1745
+ selectTimeRange: "\u8BF7\u9009\u62E9\u65F6\u95F4\u8303\u56F4"
1746
+ };
1747
+ var DEFAULT_UPLOAD_LABELS = {
1748
+ dragAreaAriaLabel: "Upload file by clicking or dragging",
1749
+ buttonAriaLabel: "Upload file",
1750
+ clickToUploadText: "Click to upload",
1751
+ dragAndDropText: "or drag and drop",
1752
+ acceptInfoText: "Accepted: {accept}",
1753
+ maxSizeInfoText: "Max size: {maxSize}",
1754
+ selectFileText: "Select File",
1755
+ uploadedFilesAriaLabel: "Uploaded files",
1756
+ successAriaLabel: "Success",
1757
+ errorAriaLabel: "Error",
1758
+ uploadingAriaLabel: "Uploading",
1759
+ removeFileAriaLabel: "Remove {fileName}",
1760
+ previewFileAriaLabel: "Preview {fileName}"
1761
+ };
1762
+ var ZH_CN_UPLOAD_LABELS = {
1763
+ dragAreaAriaLabel: "\u70B9\u51FB\u6216\u62D6\u62FD\u4E0A\u4F20\u6587\u4EF6",
1764
+ buttonAriaLabel: "\u4E0A\u4F20\u6587\u4EF6",
1765
+ clickToUploadText: "\u70B9\u51FB\u4E0A\u4F20",
1766
+ dragAndDropText: "\u6216\u62D6\u62FD\u5230\u6B64\u5904",
1767
+ acceptInfoText: "\u652F\u6301\uFF1A{accept}",
1768
+ maxSizeInfoText: "\u6700\u5927\u5927\u5C0F\uFF1A{maxSize}",
1769
+ selectFileText: "\u9009\u62E9\u6587\u4EF6",
1770
+ uploadedFilesAriaLabel: "\u5DF2\u4E0A\u4F20\u6587\u4EF6",
1771
+ successAriaLabel: "\u6210\u529F",
1772
+ errorAriaLabel: "\u9519\u8BEF",
1773
+ uploadingAriaLabel: "\u4E0A\u4F20\u4E2D",
1774
+ removeFileAriaLabel: "\u79FB\u9664 {fileName}",
1775
+ previewFileAriaLabel: "\u9884\u89C8 {fileName}"
1776
+ };
1372
1777
 
1373
- // src/utils/datepicker-i18n.ts
1778
+ // src/utils/i18n/datepicker-locales/ar-SA.ts
1779
+ var AR_SA_DATEPICKER_LOCALE = {
1780
+ locale: "ar-SA",
1781
+ labels: {
1782
+ today: "\u0627\u0644\u064A\u0648\u0645",
1783
+ ok: "\u0645\u0648\u0627\u0641\u0642",
1784
+ calendar: "\u0627\u0644\u062A\u0642\u0648\u064A\u0645",
1785
+ toggleCalendar: "\u0641\u062A\u062D \u0627\u0644\u062A\u0642\u0648\u064A\u0645",
1786
+ clearDate: "\u0645\u0633\u062D \u0627\u0644\u062A\u0627\u0631\u064A\u062E",
1787
+ previousMonth: "\u0627\u0644\u0634\u0647\u0631 \u0627\u0644\u0633\u0627\u0628\u0642",
1788
+ nextMonth: "\u0627\u0644\u0634\u0647\u0631 \u0627\u0644\u062A\u0627\u0644\u064A"
1789
+ }
1790
+ };
1791
+
1792
+ // src/utils/i18n/datepicker-locales/de-DE.ts
1793
+ var DE_DE_DATEPICKER_LOCALE = {
1794
+ locale: "de-DE",
1795
+ labels: {
1796
+ today: "Heute",
1797
+ ok: "OK",
1798
+ calendar: "Kalender",
1799
+ toggleCalendar: "Kalender \xF6ffnen",
1800
+ clearDate: "Datum l\xF6schen",
1801
+ previousMonth: "Vorheriger Monat",
1802
+ nextMonth: "N\xE4chster Monat"
1803
+ }
1804
+ };
1805
+
1806
+ // src/utils/i18n/datepicker-locales/en-US.ts
1374
1807
  var EN_US_DATEPICKER_LOCALE = {
1375
1808
  locale: "en-US",
1376
1809
  labels: {
@@ -1383,22 +1816,11 @@ var EN_US_DATEPICKER_LOCALE = {
1383
1816
  nextMonth: "Next month"
1384
1817
  }
1385
1818
  };
1386
- var ZH_CN_DATEPICKER_LOCALE = {
1387
- locale: "zh-CN",
1819
+
1820
+ // src/utils/i18n/datepicker-locales/es-ES.ts
1821
+ var ES_ES_DATEPICKER_LOCALE = {
1822
+ locale: "es-ES",
1388
1823
  labels: {
1389
- today: "\u4ECA\u5929",
1390
- ok: "\u786E\u5B9A",
1391
- calendar: "\u65E5\u5386",
1392
- toggleCalendar: "\u6253\u5F00\u65E5\u5386",
1393
- clearDate: "\u6E05\u9664\u65E5\u671F",
1394
- previousMonth: "\u4E0A\u4E2A\u6708",
1395
- nextMonth: "\u4E0B\u4E2A\u6708"
1396
- }
1397
- };
1398
- var DATEPICKER_LABELS_BY_LANGUAGE = {
1399
- en: EN_US_DATEPICKER_LOCALE.labels,
1400
- zh: ZH_CN_DATEPICKER_LOCALE.labels,
1401
- es: {
1402
1824
  today: "Hoy",
1403
1825
  ok: "Aceptar",
1404
1826
  calendar: "Calendario",
@@ -1406,8 +1828,13 @@ var DATEPICKER_LABELS_BY_LANGUAGE = {
1406
1828
  clearDate: "Borrar fecha",
1407
1829
  previousMonth: "Mes anterior",
1408
1830
  nextMonth: "Mes siguiente"
1409
- },
1410
- fr: {
1831
+ }
1832
+ };
1833
+
1834
+ // src/utils/i18n/datepicker-locales/fr-FR.ts
1835
+ var FR_FR_DATEPICKER_LOCALE = {
1836
+ locale: "fr-FR",
1837
+ labels: {
1411
1838
  today: "Aujourd'hui",
1412
1839
  ok: "OK",
1413
1840
  calendar: "Calendrier",
@@ -1415,17 +1842,55 @@ var DATEPICKER_LABELS_BY_LANGUAGE = {
1415
1842
  clearDate: "Effacer la date",
1416
1843
  previousMonth: "Mois pr\xE9c\xE9dent",
1417
1844
  nextMonth: "Mois suivant"
1418
- },
1419
- de: {
1420
- today: "Heute",
1845
+ }
1846
+ };
1847
+
1848
+ // src/utils/i18n/datepicker-locales/id-ID.ts
1849
+ var ID_ID_DATEPICKER_LOCALE = {
1850
+ locale: "id-ID",
1851
+ labels: {
1852
+ today: "Hari ini",
1421
1853
  ok: "OK",
1422
1854
  calendar: "Kalender",
1423
- toggleCalendar: "Kalender \xF6ffnen",
1424
- clearDate: "Datum l\xF6schen",
1425
- previousMonth: "Vorheriger Monat",
1426
- nextMonth: "N\xE4chster Monat"
1427
- },
1428
- pt: {
1855
+ toggleCalendar: "Buka kalender",
1856
+ clearDate: "Hapus tanggal",
1857
+ previousMonth: "Bulan sebelumnya",
1858
+ nextMonth: "Bulan berikutnya"
1859
+ }
1860
+ };
1861
+
1862
+ // src/utils/i18n/datepicker-locales/ja-JP.ts
1863
+ var JA_JP_DATEPICKER_LOCALE = {
1864
+ locale: "ja-JP",
1865
+ labels: {
1866
+ today: "\u4ECA\u65E5",
1867
+ ok: "OK",
1868
+ calendar: "\u30AB\u30EC\u30F3\u30C0\u30FC",
1869
+ toggleCalendar: "\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u958B\u304F",
1870
+ clearDate: "\u65E5\u4ED8\u3092\u30AF\u30EA\u30A2",
1871
+ previousMonth: "\u524D\u306E\u6708",
1872
+ nextMonth: "\u6B21\u306E\u6708"
1873
+ }
1874
+ };
1875
+
1876
+ // src/utils/i18n/datepicker-locales/ko-KR.ts
1877
+ var KO_KR_DATEPICKER_LOCALE = {
1878
+ locale: "ko-KR",
1879
+ labels: {
1880
+ today: "\uC624\uB298",
1881
+ ok: "\uD655\uC778",
1882
+ calendar: "\uB2EC\uB825",
1883
+ toggleCalendar: "\uB2EC\uB825 \uC5F4\uAE30",
1884
+ clearDate: "\uB0A0\uC9DC \uC9C0\uC6B0\uAE30",
1885
+ previousMonth: "\uC774\uC804 \uB2EC",
1886
+ nextMonth: "\uB2E4\uC74C \uB2EC"
1887
+ }
1888
+ };
1889
+
1890
+ // src/utils/i18n/datepicker-locales/pt-BR.ts
1891
+ var PT_BR_DATEPICKER_LOCALE = {
1892
+ locale: "pt-BR",
1893
+ labels: {
1429
1894
  today: "Hoje",
1430
1895
  ok: "OK",
1431
1896
  calendar: "Calend\xE1rio",
@@ -1433,17 +1898,93 @@ var DATEPICKER_LABELS_BY_LANGUAGE = {
1433
1898
  clearDate: "Limpar data",
1434
1899
  previousMonth: "M\xEAs anterior",
1435
1900
  nextMonth: "Pr\xF3ximo m\xEAs"
1436
- },
1437
- ar: {
1438
- today: "\u0627\u0644\u064A\u0648\u0645",
1439
- ok: "\u0645\u0648\u0627\u0641\u0642",
1440
- calendar: "\u0627\u0644\u062A\u0642\u0648\u064A\u0645",
1441
- toggleCalendar: "\u0641\u062A\u062D \u0627\u0644\u062A\u0642\u0648\u064A\u0645",
1442
- clearDate: "\u0645\u0633\u062D \u0627\u0644\u062A\u0627\u0631\u064A\u062E",
1443
- previousMonth: "\u0627\u0644\u0634\u0647\u0631 \u0627\u0644\u0633\u0627\u0628\u0642",
1444
- nextMonth: "\u0627\u0644\u0634\u0647\u0631 \u0627\u0644\u062A\u0627\u0644\u064A"
1445
1901
  }
1446
1902
  };
1903
+
1904
+ // src/utils/i18n/datepicker-locales/th-TH.ts
1905
+ var TH_TH_DATEPICKER_LOCALE = {
1906
+ locale: "th-TH",
1907
+ labels: {
1908
+ today: "\u0E27\u0E31\u0E19\u0E19\u0E35\u0E49",
1909
+ ok: "\u0E15\u0E01\u0E25\u0E07",
1910
+ calendar: "\u0E1B\u0E0F\u0E34\u0E17\u0E34\u0E19",
1911
+ toggleCalendar: "\u0E40\u0E1B\u0E34\u0E14\u0E1B\u0E0F\u0E34\u0E17\u0E34\u0E19",
1912
+ clearDate: "\u0E25\u0E49\u0E32\u0E07\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
1913
+ previousMonth: "\u0E40\u0E14\u0E37\u0E2D\u0E19\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",
1914
+ nextMonth: "\u0E40\u0E14\u0E37\u0E2D\u0E19\u0E16\u0E31\u0E14\u0E44\u0E1B"
1915
+ }
1916
+ };
1917
+
1918
+ // src/utils/i18n/datepicker-locales/vi-VN.ts
1919
+ var VI_VN_DATEPICKER_LOCALE = {
1920
+ locale: "vi-VN",
1921
+ labels: {
1922
+ today: "H\xF4m nay",
1923
+ ok: "OK",
1924
+ calendar: "L\u1ECBch",
1925
+ toggleCalendar: "M\u1EDF l\u1ECBch",
1926
+ clearDate: "X\xF3a ng\xE0y",
1927
+ previousMonth: "Th\xE1ng tr\u01B0\u1EDBc",
1928
+ nextMonth: "Th\xE1ng sau"
1929
+ }
1930
+ };
1931
+
1932
+ // src/utils/i18n/datepicker-locales/zh-CN.ts
1933
+ var ZH_CN_DATEPICKER_LOCALE = {
1934
+ locale: "zh-CN",
1935
+ labels: {
1936
+ today: "\u4ECA\u5929",
1937
+ ok: "\u786E\u5B9A",
1938
+ calendar: "\u65E5\u5386",
1939
+ toggleCalendar: "\u6253\u5F00\u65E5\u5386",
1940
+ clearDate: "\u6E05\u9664\u65E5\u671F",
1941
+ previousMonth: "\u4E0A\u4E2A\u6708",
1942
+ nextMonth: "\u4E0B\u4E2A\u6708"
1943
+ }
1944
+ };
1945
+
1946
+ // src/utils/i18n/datepicker-locales/zh-TW.ts
1947
+ var ZH_TW_DATEPICKER_LOCALE = {
1948
+ locale: "zh-TW",
1949
+ labels: {
1950
+ today: "\u4ECA\u5929",
1951
+ ok: "\u78BA\u5B9A",
1952
+ calendar: "\u65E5\u66C6",
1953
+ toggleCalendar: "\u958B\u555F\u65E5\u66C6",
1954
+ clearDate: "\u6E05\u9664\u65E5\u671F",
1955
+ previousMonth: "\u4E0A\u500B\u6708",
1956
+ nextMonth: "\u4E0B\u500B\u6708"
1957
+ }
1958
+ };
1959
+
1960
+ // src/utils/datepicker-i18n.ts
1961
+ var EN_US_DATEPICKER_LOCALE2 = EN_US_DATEPICKER_LOCALE;
1962
+ var ZH_CN_DATEPICKER_LOCALE2 = ZH_CN_DATEPICKER_LOCALE;
1963
+ var DATEPICKER_LOCALES = [
1964
+ EN_US_DATEPICKER_LOCALE,
1965
+ ZH_CN_DATEPICKER_LOCALE,
1966
+ ZH_TW_DATEPICKER_LOCALE,
1967
+ JA_JP_DATEPICKER_LOCALE,
1968
+ KO_KR_DATEPICKER_LOCALE,
1969
+ TH_TH_DATEPICKER_LOCALE,
1970
+ VI_VN_DATEPICKER_LOCALE,
1971
+ ID_ID_DATEPICKER_LOCALE,
1972
+ ES_ES_DATEPICKER_LOCALE,
1973
+ FR_FR_DATEPICKER_LOCALE,
1974
+ DE_DE_DATEPICKER_LOCALE,
1975
+ PT_BR_DATEPICKER_LOCALE,
1976
+ AR_SA_DATEPICKER_LOCALE
1977
+ ];
1978
+ var DATEPICKER_LOCALE_BY_ID = new Map(
1979
+ DATEPICKER_LOCALES.map((preset) => [preset.locale.toLowerCase(), preset])
1980
+ );
1981
+ var DATEPICKER_LOCALE_BY_LANGUAGE = /* @__PURE__ */ new Map();
1982
+ for (const preset of DATEPICKER_LOCALES) {
1983
+ const language = preset.locale.split("-")[0]?.toLowerCase();
1984
+ if (language && !DATEPICKER_LOCALE_BY_LANGUAGE.has(language)) {
1985
+ DATEPICKER_LOCALE_BY_LANGUAGE.set(language, preset);
1986
+ }
1987
+ }
1447
1988
  function isDatePickerLocaleConfig(value) {
1448
1989
  return Boolean(value && typeof value === "object" && "datePicker" in value);
1449
1990
  }
@@ -1459,7 +2000,7 @@ function getDatePickerLocaleCode(locale) {
1459
2000
  function getDefaultDatePickerLabels(locale) {
1460
2001
  const lc = (getDatePickerLocaleCode(locale) ?? "").toLowerCase();
1461
2002
  const language = lc.split("-")[0];
1462
- return DATEPICKER_LABELS_BY_LANGUAGE[language] ?? EN_US_DATEPICKER_LOCALE.labels;
2003
+ return DATEPICKER_LOCALE_BY_ID.get(lc)?.labels ?? DATEPICKER_LOCALE_BY_LANGUAGE.get(language)?.labels ?? EN_US_DATEPICKER_LOCALE2.labels;
1463
2004
  }
1464
2005
  function getDatePickerLabels(locale, overrides) {
1465
2006
  return {
@@ -1469,35 +2010,104 @@ function getDatePickerLabels(locale, overrides) {
1469
2010
  };
1470
2011
  }
1471
2012
 
2013
+ // src/utils/picker-utils.ts
2014
+ var defaultIsDisabled = (item) => !!item?.disabled;
2015
+ function findFirstEnabledIndex(items, isDisabled = defaultIsDisabled) {
2016
+ for (let i = 0; i < items.length; i++) {
2017
+ if (!isDisabled(items[i])) return i;
2018
+ }
2019
+ return -1;
2020
+ }
2021
+ function findLastEnabledIndex(items, isDisabled = defaultIsDisabled) {
2022
+ for (let i = items.length - 1; i >= 0; i--) {
2023
+ if (!isDisabled(items[i])) return i;
2024
+ }
2025
+ return -1;
2026
+ }
2027
+ function findNextEnabledIndex(items, current, direction, isDisabled = defaultIsDisabled) {
2028
+ if (items.length === 0) return -1;
2029
+ const start = current < 0 ? direction === 1 ? 0 : items.length - 1 : current + direction;
2030
+ for (let i = start; i >= 0 && i < items.length; i += direction) {
2031
+ if (!isDisabled(items[i])) return i;
2032
+ }
2033
+ return current;
2034
+ }
2035
+ function getCyclicIndex(length, current, direction) {
2036
+ if (length <= 0) return -1;
2037
+ return (current + direction + length) % length;
2038
+ }
2039
+ function getInitialPickerActiveIndex(items, activeFirst, isDisabled = defaultIsDisabled) {
2040
+ return activeFirst ? findFirstEnabledIndex(items, isDisabled) : -1;
2041
+ }
2042
+ function getPickerNavigationIndex(items, current, key, isDisabled = defaultIsDisabled) {
2043
+ switch (key) {
2044
+ case "ArrowDown":
2045
+ return findNextEnabledIndex(items, current, 1, isDisabled);
2046
+ case "ArrowUp":
2047
+ return findNextEnabledIndex(items, current, -1, isDisabled);
2048
+ case "Home":
2049
+ return findFirstEnabledIndex(items, isDisabled);
2050
+ case "End":
2051
+ return findLastEnabledIndex(items, isDisabled);
2052
+ default:
2053
+ return current;
2054
+ }
2055
+ }
2056
+ function getPickerOptionId(listboxId, index) {
2057
+ return `${listboxId}-option-${index}`;
2058
+ }
2059
+ function getDisclosureStateAttr(open) {
2060
+ return { "data-state": open ? "open" : "closed" };
2061
+ }
2062
+ function getPickerComboboxAria({
2063
+ expanded,
2064
+ listboxId,
2065
+ activeIndex = -1,
2066
+ activeOptionId
2067
+ }) {
2068
+ return {
2069
+ role: "combobox",
2070
+ "aria-expanded": expanded,
2071
+ "aria-haspopup": "listbox",
2072
+ "aria-controls": expanded ? listboxId : void 0,
2073
+ "aria-activedescendant": expanded ? activeOptionId ?? (activeIndex >= 0 ? getPickerOptionId(listboxId, activeIndex) : void 0) : void 0,
2074
+ "data-state": expanded ? "open" : "closed"
2075
+ };
2076
+ }
2077
+ function getPickerListboxAria({ id, label } = {}) {
2078
+ return {
2079
+ id,
2080
+ role: "listbox",
2081
+ "aria-label": label
2082
+ };
2083
+ }
2084
+ function getPickerOptionAria({
2085
+ selected = false,
2086
+ disabled = false
2087
+ }) {
2088
+ return {
2089
+ role: "option",
2090
+ "aria-selected": selected,
2091
+ "aria-disabled": disabled || void 0
2092
+ };
2093
+ }
2094
+ function getPickerTriggerKeyAction(key, expanded) {
2095
+ switch (key) {
2096
+ case "Enter":
2097
+ case " ":
2098
+ return "toggle";
2099
+ case "ArrowDown":
2100
+ return expanded ? "none" : "open";
2101
+ case "Escape":
2102
+ return expanded ? "close" : "none";
2103
+ default:
2104
+ return "none";
2105
+ }
2106
+ }
2107
+
1472
2108
  // src/utils/timepicker-utils.ts
1473
- var ZH_LABELS = {
1474
- hour: "\u65F6",
1475
- minute: "\u5206",
1476
- second: "\u79D2",
1477
- now: "\u73B0\u5728",
1478
- ok: "\u786E\u5B9A",
1479
- start: "\u5F00\u59CB",
1480
- end: "\u7ED3\u675F",
1481
- clear: "\u6E05\u9664\u65F6\u95F4",
1482
- toggle: "\u6253\u5F00\u65F6\u95F4\u9009\u62E9\u5668",
1483
- dialog: "\u65F6\u95F4\u9009\u62E9\u5668",
1484
- selectTime: "\u8BF7\u9009\u62E9\u65F6\u95F4",
1485
- selectTimeRange: "\u8BF7\u9009\u62E9\u65F6\u95F4\u8303\u56F4"
1486
- };
1487
- var EN_LABELS = {
1488
- hour: "Hour",
1489
- minute: "Min",
1490
- second: "Sec",
1491
- now: "Now",
1492
- ok: "OK",
1493
- start: "Start",
1494
- end: "End",
1495
- clear: "Clear time",
1496
- toggle: "Toggle time picker",
1497
- dialog: "Time picker",
1498
- selectTime: "Select time",
1499
- selectTimeRange: "Select time range"
1500
- };
2109
+ var EN_LABELS = DEFAULT_TIME_PICKER_LABELS;
2110
+ var ZH_LABELS = ZH_CN_TIME_PICKER_LABELS;
1501
2111
  var TIME_PICKER_LABELS_BY_LANGUAGE = {
1502
2112
  en: EN_LABELS,
1503
2113
  zh: ZH_LABELS,
@@ -1572,26 +2182,59 @@ var TIME_PICKER_LABELS_BY_LANGUAGE = {
1572
2182
  selectTimeRange: "\u0627\u062E\u062A\u0631 \u0646\u0637\u0627\u0642 \u0627\u0644\u0648\u0642\u062A"
1573
2183
  }
1574
2184
  };
2185
+ function getTimePickerLocaleCode(locale) {
2186
+ return typeof locale === "string" ? locale : locale?.locale;
2187
+ }
1575
2188
  function isZhLocale(locale) {
1576
- return (locale ?? "").toLowerCase().startsWith("zh");
2189
+ return (getTimePickerLocaleCode(locale) ?? "").toLowerCase().startsWith("zh");
1577
2190
  }
1578
2191
  function getTimePickerLabels(locale, overrides) {
1579
- const language = (locale ?? "").split("-")[0]?.toLowerCase();
2192
+ const localeCode = getTimePickerLocaleCode(locale);
2193
+ const language = (localeCode ?? "").split("-")[0]?.toLowerCase();
1580
2194
  const base = language ? TIME_PICKER_LABELS_BY_LANGUAGE[language] ?? EN_LABELS : EN_LABELS;
1581
- return { ...base, ...overrides ?? {} };
2195
+ const localeLabels = typeof locale === "string" ? void 0 : locale?.timePicker;
2196
+ return { ...base, ...localeLabels ?? {}, ...overrides ?? {} };
1582
2197
  }
1583
2198
  function pluralizeEn(value, singular) {
1584
2199
  return getIntlPluralCategory(value, "en") === "one" ? singular : `${singular}s`;
1585
2200
  }
1586
2201
  function getTimePickerOptionAriaLabel(value, unit, locale, labelOverrides) {
1587
2202
  const labels = getTimePickerLabels(locale, labelOverrides);
2203
+ const localeCode = getTimePickerLocaleCode(locale);
1588
2204
  const unitLabel = unit === "hour" ? labels.hour : unit === "minute" ? labels.minute : labels.second;
1589
- if (isZhLocale(locale)) return `${formatIntlNumber(value, locale)}${unitLabel}`;
1590
- const lc = (locale ?? "").toLowerCase();
2205
+ if (isZhLocale(locale)) return `${formatIntlNumber(value, localeCode)}${unitLabel}`;
2206
+ const lc = (localeCode ?? "").toLowerCase();
1591
2207
  if (lc.startsWith("en") || !lc && !labelOverrides) {
1592
- return `${formatIntlNumber(value, locale)} ${pluralizeEn(value, unit)}`;
2208
+ return `${formatIntlNumber(value, localeCode)} ${pluralizeEn(value, unit)}`;
2209
+ }
2210
+ return `${formatIntlNumber(value, localeCode)} ${unitLabel}`;
2211
+ }
2212
+ function focusTimePickerOption(panel, unit, action) {
2213
+ if (!panel) return;
2214
+ const nodes = Array.from(
2215
+ panel.querySelectorAll(`button[data-tiger-timepicker-unit="${unit}"]`)
2216
+ ).filter((button) => !button.disabled);
2217
+ if (nodes.length === 0) return;
2218
+ const active = panel.ownerDocument.activeElement;
2219
+ const activeIndex = active ? nodes.indexOf(active) : -1;
2220
+ const selectedIndex = nodes.findIndex((button) => button.getAttribute("aria-selected") === "true");
2221
+ const baseIndex = activeIndex >= 0 ? activeIndex : Math.max(0, selectedIndex);
2222
+ let nextIndex = baseIndex;
2223
+ switch (action) {
2224
+ case "prev":
2225
+ nextIndex = findNextEnabledIndex(nodes, baseIndex, -1);
2226
+ break;
2227
+ case "next":
2228
+ nextIndex = findNextEnabledIndex(nodes, baseIndex, 1);
2229
+ break;
2230
+ case "first":
2231
+ nextIndex = findFirstEnabledIndex(nodes);
2232
+ break;
2233
+ case "last":
2234
+ nextIndex = findLastEnabledIndex(nodes);
2235
+ break;
1593
2236
  }
1594
- return `${formatIntlNumber(value, locale)} ${unitLabel}`;
2237
+ nodes[nextIndex]?.focus();
1595
2238
  }
1596
2239
  var timePickerBaseClasses = "relative inline-block w-full max-w-xs";
1597
2240
  var timePickerInputWrapperClasses = "relative flex items-center";
@@ -1728,67 +2371,67 @@ function interpolateUploadLabel(template, params) {
1728
2371
  function getUploadLabels(locale, overrides) {
1729
2372
  return {
1730
2373
  dragAreaAriaLabel: resolveLocaleText(
1731
- "Upload file by clicking or dragging",
2374
+ DEFAULT_UPLOAD_LABELS.dragAreaAriaLabel,
1732
2375
  overrides?.dragAreaAriaLabel,
1733
2376
  locale?.upload?.dragAreaAriaLabel
1734
2377
  ),
1735
2378
  buttonAriaLabel: resolveLocaleText(
1736
- "Upload file",
2379
+ DEFAULT_UPLOAD_LABELS.buttonAriaLabel,
1737
2380
  overrides?.buttonAriaLabel,
1738
2381
  locale?.upload?.buttonAriaLabel
1739
2382
  ),
1740
2383
  clickToUploadText: resolveLocaleText(
1741
- "Click to upload",
2384
+ DEFAULT_UPLOAD_LABELS.clickToUploadText,
1742
2385
  overrides?.clickToUploadText,
1743
2386
  locale?.upload?.clickToUploadText
1744
2387
  ),
1745
2388
  dragAndDropText: resolveLocaleText(
1746
- "or drag and drop",
2389
+ DEFAULT_UPLOAD_LABELS.dragAndDropText,
1747
2390
  overrides?.dragAndDropText,
1748
2391
  locale?.upload?.dragAndDropText
1749
2392
  ),
1750
2393
  acceptInfoText: resolveLocaleText(
1751
- "Accepted: {accept}",
2394
+ DEFAULT_UPLOAD_LABELS.acceptInfoText,
1752
2395
  overrides?.acceptInfoText,
1753
2396
  locale?.upload?.acceptInfoText
1754
2397
  ),
1755
2398
  maxSizeInfoText: resolveLocaleText(
1756
- "Max size: {maxSize}",
2399
+ DEFAULT_UPLOAD_LABELS.maxSizeInfoText,
1757
2400
  overrides?.maxSizeInfoText,
1758
2401
  locale?.upload?.maxSizeInfoText
1759
2402
  ),
1760
2403
  selectFileText: resolveLocaleText(
1761
- "Select File",
2404
+ DEFAULT_UPLOAD_LABELS.selectFileText,
1762
2405
  overrides?.selectFileText,
1763
2406
  locale?.upload?.selectFileText
1764
2407
  ),
1765
2408
  uploadedFilesAriaLabel: resolveLocaleText(
1766
- "Uploaded files",
2409
+ DEFAULT_UPLOAD_LABELS.uploadedFilesAriaLabel,
1767
2410
  overrides?.uploadedFilesAriaLabel,
1768
2411
  locale?.upload?.uploadedFilesAriaLabel
1769
2412
  ),
1770
2413
  successAriaLabel: resolveLocaleText(
1771
- "Success",
2414
+ DEFAULT_UPLOAD_LABELS.successAriaLabel,
1772
2415
  overrides?.successAriaLabel,
1773
2416
  locale?.upload?.successAriaLabel
1774
2417
  ),
1775
2418
  errorAriaLabel: resolveLocaleText(
1776
- "Error",
2419
+ DEFAULT_UPLOAD_LABELS.errorAriaLabel,
1777
2420
  overrides?.errorAriaLabel,
1778
2421
  locale?.upload?.errorAriaLabel
1779
2422
  ),
1780
2423
  uploadingAriaLabel: resolveLocaleText(
1781
- "Uploading",
2424
+ DEFAULT_UPLOAD_LABELS.uploadingAriaLabel,
1782
2425
  overrides?.uploadingAriaLabel,
1783
2426
  locale?.upload?.uploadingAriaLabel
1784
2427
  ),
1785
2428
  removeFileAriaLabel: resolveLocaleText(
1786
- "Remove {fileName}",
2429
+ DEFAULT_UPLOAD_LABELS.removeFileAriaLabel,
1787
2430
  overrides?.removeFileAriaLabel,
1788
2431
  locale?.upload?.removeFileAriaLabel
1789
2432
  ),
1790
2433
  previewFileAriaLabel: resolveLocaleText(
1791
- "Preview {fileName}",
2434
+ DEFAULT_UPLOAD_LABELS.previewFileAriaLabel,
1792
2435
  overrides?.previewFileAriaLabel,
1793
2436
  locale?.upload?.previewFileAriaLabel
1794
2437
  )
@@ -1804,7 +2447,16 @@ var enUS = {
1804
2447
  cancelText: "Cancel",
1805
2448
  closeText: "Close",
1806
2449
  loadingText: "Loading...",
1807
- emptyText: "No data"
2450
+ emptyText: "No data",
2451
+ noMoreText: "No more data",
2452
+ searchPlaceholder: "Search",
2453
+ clearText: "Clear"
2454
+ },
2455
+ empty: {
2456
+ noData: "No data",
2457
+ noDataAvailable: "No data available",
2458
+ noResults: "No results found",
2459
+ error: "Something went wrong"
1808
2460
  },
1809
2461
  modal: {
1810
2462
  closeAriaLabel: "Close",
@@ -1814,6 +2466,16 @@ var enUS = {
1814
2466
  drawer: {
1815
2467
  closeAriaLabel: "Close"
1816
2468
  },
2469
+ qrcode: {
2470
+ ariaLabel: "QR Code",
2471
+ expiredText: "QR code expired",
2472
+ refreshText: "Refresh",
2473
+ loadingText: "Loading..."
2474
+ },
2475
+ timeline: {
2476
+ pendingText: "Loading..."
2477
+ },
2478
+ upload: DEFAULT_UPLOAD_LABELS,
1817
2479
  pagination: {
1818
2480
  totalText: "Total {total} items",
1819
2481
  itemsPerPageText: "/ page",
@@ -1841,23 +2503,132 @@ var enUS = {
1841
2503
  columnSettingsText: "Column settings",
1842
2504
  columnSettingsAriaLabel: "Column settings",
1843
2505
  lockColumnAriaLabel: "Lock column {column}",
1844
- unlockColumnAriaLabel: "Unlock column {column}"
2506
+ unlockColumnAriaLabel: "Unlock column {column}",
2507
+ allText: "All",
2508
+ filterPlaceholder: "Filter...",
2509
+ exportCsvText: "Export CSV",
2510
+ exportExcelText: "Export Excel",
2511
+ exportCsvAriaLabel: "Export to CSV",
2512
+ exportExcelAriaLabel: "Export to Excel",
2513
+ expandRowAriaLabel: "Expand row",
2514
+ collapseRowAriaLabel: "Collapse row"
1845
2515
  },
2516
+ datePicker: EN_US_DATEPICKER_LOCALE,
2517
+ timePicker: DEFAULT_TIME_PICKER_LABELS,
1846
2518
  formWizard: {
1847
2519
  prevText: "Previous",
1848
2520
  nextText: "Next",
1849
2521
  finishText: "Finish"
1850
2522
  },
2523
+ tour: {
2524
+ prevText: "Previous",
2525
+ nextText: "Next",
2526
+ finishText: "Finish",
2527
+ closeAriaLabel: "Close tour"
2528
+ },
2529
+ calendar: {
2530
+ previousMonth: "Previous month",
2531
+ nextMonth: "Next month",
2532
+ previousYear: "Previous year",
2533
+ nextYear: "Next year",
2534
+ yearSelectAriaLabel: "Year",
2535
+ monthSelectAriaLabel: "Month",
2536
+ daySelectAriaLabel: "Day"
2537
+ },
2538
+ fileManager: {
2539
+ rootText: "Root"
2540
+ },
2541
+ imageViewer: {
2542
+ dialogAriaLabel: "Image viewer",
2543
+ previewDialogAriaLabel: "Image preview",
2544
+ closeAriaLabel: "Close",
2545
+ closePreviewAriaLabel: "Close preview",
2546
+ previousImageAriaLabel: "Previous image",
2547
+ nextImageAriaLabel: "Next image",
2548
+ zoomOutAriaLabel: "Zoom out",
2549
+ resetAriaLabel: "Reset",
2550
+ zoomInAriaLabel: "Zoom in",
2551
+ rotateLeftAriaLabel: "Rotate left",
2552
+ rotateRightAriaLabel: "Rotate right"
2553
+ },
2554
+ imageEditor: {
2555
+ selectImageText: "Select image",
2556
+ selectImageAriaLabel: "Select image to crop and upload",
2557
+ cropModalTitle: "Crop image",
2558
+ cropCancelText: "Cancel",
2559
+ cropConfirmText: "Confirm crop",
2560
+ cropperDialogAriaLabel: "Image cropper",
2561
+ imageToCropAriaLabel: "Image to crop",
2562
+ moveCropAreaAriaLabel: "Move crop area",
2563
+ resizeCropAreaAriaLabel: "Resize crop area {handle}",
2564
+ loadingCropImageAriaLabel: "Loading image for cropping",
2565
+ annotationToolbarAriaLabel: "Annotation tools",
2566
+ annotationEditorAriaLabel: "Image annotation editor",
2567
+ annotationCanvasAriaLabel: "Image annotation canvas",
2568
+ loadingAnnotationImageAriaLabel: "Loading image for annotation",
2569
+ selectToolText: "Select",
2570
+ rectangleToolText: "Rectangle",
2571
+ ellipseToolText: "Ellipse",
2572
+ polygonToolText: "Polygon",
2573
+ freehandToolText: "Freehand",
2574
+ deleteText: "Delete"
2575
+ },
2576
+ status: {
2577
+ tagCloseAriaLabel: "Close tag",
2578
+ badgeLabel: "notification",
2579
+ badgeCountLabel: "{count} notifications"
2580
+ },
1851
2581
  taskBoard: {
1852
2582
  emptyColumnText: "No tasks",
1853
2583
  addCardText: "Add task",
2584
+ addColumnText: "Add column",
1854
2585
  wipLimitText: "WIP limit: {limit}",
1855
2586
  dragHintText: "Drag to move",
1856
2587
  boardAriaLabel: "Task Board"
2588
+ },
2589
+ formValidation: {
2590
+ required: "This field is required",
2591
+ typeString: "Value must be a string",
2592
+ typeNumber: "Value must be a number",
2593
+ typeBoolean: "Value must be a boolean",
2594
+ typeArray: "Value must be an array",
2595
+ typeObject: "Value must be an object",
2596
+ email: "Please enter a valid email address",
2597
+ phone: "Please enter a valid phone number",
2598
+ url: "Please enter a valid URL",
2599
+ date: "Please enter a valid date",
2600
+ idCard: "Please enter a valid ID card number",
2601
+ minLength: "Minimum length is {min} characters",
2602
+ maxLength: "Maximum length is {max} characters",
2603
+ minValue: "Minimum value is {min}",
2604
+ maxValue: "Maximum value is {max}",
2605
+ minItems: "Minimum {min} items required",
2606
+ maxItems: "Maximum {max} items allowed",
2607
+ patternMismatch: "Value does not match the required pattern",
2608
+ validatorFailed: "Validation failed",
2609
+ validatorError: "Validation error occurred"
1857
2610
  }
1858
2611
  };
1859
2612
 
1860
2613
  // src/utils/i18n/define-locale.ts
2614
+ var DATEPICKER_LOCALES2 = [
2615
+ EN_US_DATEPICKER_LOCALE,
2616
+ ZH_CN_DATEPICKER_LOCALE,
2617
+ ZH_TW_DATEPICKER_LOCALE,
2618
+ JA_JP_DATEPICKER_LOCALE,
2619
+ KO_KR_DATEPICKER_LOCALE,
2620
+ TH_TH_DATEPICKER_LOCALE,
2621
+ VI_VN_DATEPICKER_LOCALE,
2622
+ ID_ID_DATEPICKER_LOCALE,
2623
+ ES_ES_DATEPICKER_LOCALE,
2624
+ FR_FR_DATEPICKER_LOCALE,
2625
+ DE_DE_DATEPICKER_LOCALE,
2626
+ PT_BR_DATEPICKER_LOCALE,
2627
+ AR_SA_DATEPICKER_LOCALE
2628
+ ];
2629
+ var DATEPICKER_LOCALE_BY_ID2 = new Map(
2630
+ DATEPICKER_LOCALES2.map((locale) => [locale.locale, locale])
2631
+ );
1861
2632
  function isPlainObject(value) {
1862
2633
  if (value === null || typeof value !== "object") return false;
1863
2634
  const proto = Object.getPrototypeOf(value);
@@ -1879,7 +2650,9 @@ function deepMerge(base, override) {
1879
2650
  return out;
1880
2651
  }
1881
2652
  function defineLocale(overrides = {}) {
1882
- return deepMerge(enUS, overrides);
2653
+ const locale = overrides.locale ? DATEPICKER_LOCALE_BY_ID2.get(overrides.locale) : void 0;
2654
+ const normalizedOverrides = locale && !overrides.datePicker ? { ...overrides, datePicker: locale } : overrides;
2655
+ return deepMerge(enUS, normalizedOverrides);
1883
2656
  }
1884
2657
  function defineText(text = {}) {
1885
2658
  return defineLocale(text);
@@ -2106,6 +2879,18 @@ function isAtMax(value, max = Infinity) {
2106
2879
  if (value === null || value === void 0) return false;
2107
2880
  return value >= max;
2108
2881
  }
2882
+ function formatInputNumberDisplay(value, options = {}) {
2883
+ if (value === null || value === void 0) return "";
2884
+ if (options.formatter) return options.formatter(value);
2885
+ if (options.precision !== void 0) return value.toFixed(options.precision);
2886
+ return String(value);
2887
+ }
2888
+ function parseInputNumberValue(str, options = {}) {
2889
+ if (str === "" || str === "-") return null;
2890
+ if (options.parser) return options.parser(str);
2891
+ const num = Number(str);
2892
+ return Number.isNaN(num) ? null : num;
2893
+ }
2109
2894
 
2110
2895
  // src/utils/form-item-styles.ts
2111
2896
  var FORM_ITEM_SPACING = {
@@ -2239,6 +3024,14 @@ var SELECT_SIZE_CLASSES = {
2239
3024
  md: "text-base py-2",
2240
3025
  lg: "text-lg py-2.5"
2241
3026
  };
3027
+ var SELECT_VIRTUAL_ITEM_HEIGHT = {
3028
+ sm: 32,
3029
+ md: 40,
3030
+ lg: 48
3031
+ };
3032
+ function getSelectVirtualItemHeight(size = "md") {
3033
+ return SELECT_VIRTUAL_ITEM_HEIGHT[size] ?? SELECT_VIRTUAL_ITEM_HEIGHT.md;
3034
+ }
2242
3035
  function getSelectSizeClasses(size) {
2243
3036
  return SELECT_SIZE_CLASSES[size];
2244
3037
  }
@@ -2500,128 +3293,128 @@ function isEmpty(value) {
2500
3293
  }
2501
3294
  return false;
2502
3295
  }
2503
- function validateType(value, type, customMessage) {
3296
+ function validateType(value, type, customMessage, messages = DEFAULT_FORM_VALIDATION_LABELS) {
2504
3297
  switch (type) {
2505
3298
  case "string":
2506
3299
  if (typeof value !== "string") {
2507
- return customMessage || "Value must be a string";
3300
+ return customMessage || messages.typeString;
2508
3301
  }
2509
3302
  break;
2510
3303
  case "number":
2511
3304
  if (typeof value !== "number" && isNaN(Number(value))) {
2512
- return customMessage || "Value must be a number";
3305
+ return customMessage || messages.typeNumber;
2513
3306
  }
2514
3307
  break;
2515
3308
  case "boolean":
2516
3309
  if (typeof value !== "boolean") {
2517
- return customMessage || "Value must be a boolean";
3310
+ return customMessage || messages.typeBoolean;
2518
3311
  }
2519
3312
  break;
2520
3313
  case "array":
2521
3314
  if (!Array.isArray(value)) {
2522
- return customMessage || "Value must be an array";
3315
+ return customMessage || messages.typeArray;
2523
3316
  }
2524
3317
  break;
2525
3318
  case "object":
2526
3319
  if (typeof value !== "object" || Array.isArray(value)) {
2527
- return customMessage || "Value must be an object";
3320
+ return customMessage || messages.typeObject;
2528
3321
  }
2529
3322
  break;
2530
3323
  case "email":
2531
3324
  if (typeof value === "string" && !EMAIL_PATTERN.test(value)) {
2532
- return customMessage || "Please enter a valid email address";
3325
+ return customMessage || messages.email;
2533
3326
  }
2534
3327
  break;
2535
3328
  case "phone":
2536
3329
  if (typeof value === "string") {
2537
3330
  const digits = value.replace(/\D/g, "");
2538
3331
  if (!PHONE_PATTERN.test(value) || digits.length < 7) {
2539
- return customMessage || "Please enter a valid phone number";
3332
+ return customMessage || messages.phone;
2540
3333
  }
2541
3334
  }
2542
3335
  break;
2543
3336
  case "url":
2544
3337
  if (typeof value === "string" && !URL_PATTERN.test(value)) {
2545
- return customMessage || "Please enter a valid URL";
3338
+ return customMessage || messages.url;
2546
3339
  }
2547
3340
  break;
2548
3341
  case "date":
2549
3342
  if (!(value instanceof Date) && isNaN(Date.parse(String(value)))) {
2550
- return customMessage || "Please enter a valid date";
3343
+ return customMessage || messages.date;
2551
3344
  }
2552
3345
  break;
2553
3346
  case "id-card":
2554
3347
  if (typeof value === "string" && !ID_CARD_PATTERN.test(value)) {
2555
- return customMessage || "Please enter a valid ID card number";
3348
+ return customMessage || messages.idCard;
2556
3349
  }
2557
3350
  break;
2558
3351
  }
2559
3352
  return null;
2560
3353
  }
2561
- function validateRange(value, min, max, customMessage) {
3354
+ function validateRange(value, min, max, customMessage, messages = DEFAULT_FORM_VALIDATION_LABELS) {
2562
3355
  if (typeof value === "string") {
2563
3356
  if (min !== void 0 && value.length < min) {
2564
- return customMessage || `Minimum length is ${min} characters`;
3357
+ return customMessage || messages.minLength.replace("{min}", String(min));
2565
3358
  }
2566
3359
  if (max !== void 0 && value.length > max) {
2567
- return customMessage || `Maximum length is ${max} characters`;
3360
+ return customMessage || messages.maxLength.replace("{max}", String(max));
2568
3361
  }
2569
3362
  }
2570
3363
  if (typeof value === "number") {
2571
3364
  if (min !== void 0 && value < min) {
2572
- return customMessage || `Minimum value is ${min}`;
3365
+ return customMessage || messages.minValue.replace("{min}", String(min));
2573
3366
  }
2574
3367
  if (max !== void 0 && value > max) {
2575
- return customMessage || `Maximum value is ${max}`;
3368
+ return customMessage || messages.maxValue.replace("{max}", String(max));
2576
3369
  }
2577
3370
  }
2578
3371
  if (Array.isArray(value)) {
2579
3372
  if (min !== void 0 && value.length < min) {
2580
- return customMessage || `Minimum ${min} items required`;
3373
+ return customMessage || messages.minItems.replace("{min}", String(min));
2581
3374
  }
2582
3375
  if (max !== void 0 && value.length > max) {
2583
- return customMessage || `Maximum ${max} items allowed`;
3376
+ return customMessage || messages.maxItems.replace("{max}", String(max));
2584
3377
  }
2585
3378
  }
2586
3379
  return null;
2587
3380
  }
2588
- async function validateRule(value, rule, allValues) {
3381
+ async function validateRule(value, rule, allValues, messages = DEFAULT_FORM_VALIDATION_LABELS) {
2589
3382
  if (!rule.required && isEmpty(value)) {
2590
3383
  return null;
2591
3384
  }
2592
3385
  const transformedValue = rule.transform ? rule.transform(value) : value;
2593
3386
  if (rule.required && isEmpty(transformedValue)) {
2594
- return rule.message || "This field is required";
3387
+ return rule.message || messages.required;
2595
3388
  }
2596
3389
  if (rule.type && !isEmpty(transformedValue)) {
2597
- const typeError = validateType(transformedValue, rule.type, rule.message);
3390
+ const typeError = validateType(transformedValue, rule.type, rule.message, messages);
2598
3391
  if (typeError) return typeError;
2599
3392
  }
2600
3393
  if (!isEmpty(transformedValue)) {
2601
- const rangeError = validateRange(transformedValue, rule.min, rule.max, rule.message);
3394
+ const rangeError = validateRange(transformedValue, rule.min, rule.max, rule.message, messages);
2602
3395
  if (rangeError) return rangeError;
2603
3396
  }
2604
3397
  if (rule.pattern && typeof transformedValue === "string") {
2605
3398
  if (!rule.pattern.test(transformedValue)) {
2606
- return rule.message || "Value does not match the required pattern";
3399
+ return rule.message || messages.patternMismatch;
2607
3400
  }
2608
3401
  }
2609
3402
  if (rule.validator) {
2610
3403
  try {
2611
3404
  const result = await rule.validator(transformedValue, allValues);
2612
3405
  if (result === false) {
2613
- return rule.message || "Validation failed";
3406
+ return rule.message || messages.validatorFailed;
2614
3407
  }
2615
3408
  if (typeof result === "string") {
2616
3409
  return result;
2617
3410
  }
2618
3411
  } catch {
2619
- return rule.message || "Validation error occurred";
3412
+ return rule.message || messages.validatorError;
2620
3413
  }
2621
3414
  }
2622
3415
  return null;
2623
3416
  }
2624
- async function validateField(fieldName, value, rules, allValues, trigger) {
3417
+ async function validateField(fieldName, value, rules, allValues, trigger, messages = DEFAULT_FORM_VALIDATION_LABELS) {
2625
3418
  if (!rules) {
2626
3419
  return null;
2627
3420
  }
@@ -2634,18 +3427,18 @@ async function validateField(fieldName, value, rules, allValues, trigger) {
2634
3427
  continue;
2635
3428
  }
2636
3429
  }
2637
- const error = await validateRule(value, rule, allValues);
3430
+ const error = await validateRule(value, rule, allValues, messages);
2638
3431
  if (error) {
2639
3432
  return error;
2640
3433
  }
2641
3434
  }
2642
3435
  return null;
2643
3436
  }
2644
- async function validateForm(values, rules) {
3437
+ async function validateForm(values, rules, messages = DEFAULT_FORM_VALIDATION_LABELS) {
2645
3438
  const errors = [];
2646
3439
  for (const [fieldName, fieldRules] of Object.entries(rules)) {
2647
3440
  const value = getValueByPath(values, fieldName);
2648
- const error = await validateField(fieldName, value, fieldRules, values);
3441
+ const error = await validateField(fieldName, value, fieldRules, values, void 0, messages);
2649
3442
  if (error) {
2650
3443
  errors.push({
2651
3444
  field: fieldName,
@@ -2658,14 +3451,14 @@ async function validateForm(values, rules) {
2658
3451
  errors
2659
3452
  };
2660
3453
  }
2661
- async function validateFormFields(values, rules, fieldNames, trigger) {
3454
+ async function validateFormFields(values, rules, fieldNames, trigger, messages = DEFAULT_FORM_VALIDATION_LABELS) {
2662
3455
  const errors = [];
2663
3456
  const uniqueFieldNames = Array.from(new Set(fieldNames));
2664
3457
  for (const fieldName of uniqueFieldNames) {
2665
3458
  const fieldRules = rules[fieldName];
2666
3459
  if (!fieldRules) continue;
2667
3460
  const value = getValueByPath(values, fieldName);
2668
- const error = await validateField(fieldName, value, fieldRules, values, trigger);
3461
+ const error = await validateField(fieldName, value, fieldRules, values, trigger, messages);
2669
3462
  if (error) {
2670
3463
  errors.push({ field: fieldName, message: error });
2671
3464
  }
@@ -2763,23 +3556,28 @@ function parseDate(value) {
2763
3556
  const parsed = new Date(value);
2764
3557
  return isNaN(parsed.getTime()) ? null : parsed;
2765
3558
  }
2766
- function getIntlOptionsFromDateFormat(format) {
3559
+ var defaultDateFormatOptions = {
3560
+ year: "numeric",
3561
+ month: "2-digit",
3562
+ day: "2-digit"
3563
+ };
3564
+ function getDateFormatParts(format) {
2767
3565
  switch (format) {
2768
- case "yyyy-MM-dd":
2769
- case "yyyy/MM/dd":
2770
- return { year: "numeric", month: "2-digit", day: "2-digit" };
2771
3566
  case "MM/dd/yyyy":
2772
- return { year: "numeric", month: "2-digit", day: "2-digit" };
3567
+ return ["month", "/", "day", "/", "year"];
2773
3568
  case "dd/MM/yyyy":
2774
- return { year: "numeric", month: "2-digit", day: "2-digit" };
3569
+ return ["day", "/", "month", "/", "year"];
3570
+ case "yyyy/MM/dd":
3571
+ return ["year", "/", "month", "/", "day"];
3572
+ case "yyyy-MM-dd":
2775
3573
  default:
2776
- return { year: "numeric", month: "2-digit", day: "2-digit" };
3574
+ return ["year", "-", "month", "-", "day"];
2777
3575
  }
2778
3576
  }
2779
3577
  function formatDate(date, format = "yyyy-MM-dd", locale) {
2780
3578
  if (!date || isNaN(date.getTime())) return "";
2781
3579
  if (locale) {
2782
- const localized = safeIntlFormat(locale, getIntlOptionsFromDateFormat(format), date);
3580
+ const localized = safeIntlFormatDateParts(locale, format, date);
2783
3581
  if (localized) return localized;
2784
3582
  }
2785
3583
  const year = date.getFullYear();
@@ -2798,7 +3596,7 @@ function formatDate(date, format = "yyyy-MM-dd", locale) {
2798
3596
  return `${year}-${month}-${day}`;
2799
3597
  }
2800
3598
  }
2801
- function formatDateWithLocale(date, locale, options = { year: "numeric", month: "2-digit", day: "2-digit" }) {
3599
+ function formatDateWithLocale(date, locale, options = defaultDateFormatOptions) {
2802
3600
  if (!date || isNaN(date.getTime())) return "";
2803
3601
  if (!locale) return formatDate(date);
2804
3602
  const localized = safeIntlFormat(locale, options, date);
@@ -2808,10 +3606,27 @@ function isSameDay(date1, date2) {
2808
3606
  if (!date1 || !date2) return false;
2809
3607
  return date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate();
2810
3608
  }
2811
- function normalizeDate(date) {
2812
- const normalized = new Date(date);
2813
- normalized.setHours(0, 0, 0, 0);
2814
- return normalized;
3609
+ function normalizeDate(date) {
3610
+ const normalized = new Date(date);
3611
+ normalized.setHours(0, 0, 0, 0);
3612
+ return normalized;
3613
+ }
3614
+ function addDays(date, days) {
3615
+ const next = new Date(date);
3616
+ next.setDate(next.getDate() + days);
3617
+ return next;
3618
+ }
3619
+ function addMonths(date, months) {
3620
+ const next = new Date(date);
3621
+ const day = next.getDate();
3622
+ next.setDate(1);
3623
+ next.setMonth(next.getMonth() + months);
3624
+ const maxDay = getDaysInMonth(next.getFullYear(), next.getMonth());
3625
+ next.setDate(Math.min(day, maxDay));
3626
+ return next;
3627
+ }
3628
+ function addYears(date, years) {
3629
+ return addMonths(date, years * 12);
2815
3630
  }
2816
3631
  function isDateInRange(date, minDate, maxDate) {
2817
3632
  if (isNaN(date.getTime())) return false;
@@ -2894,6 +3709,30 @@ function safeIntlFormat(locale, options, date) {
2894
3709
  return "";
2895
3710
  }
2896
3711
  }
3712
+ function safeIntlFormatDateParts(locale, format, date) {
3713
+ try {
3714
+ const key = `${locale}_${JSON.stringify(defaultDateFormatOptions)}_parts`;
3715
+ let fmt = intlCache.get(key);
3716
+ if (!fmt) {
3717
+ fmt = new Intl.DateTimeFormat(locale, defaultDateFormatOptions);
3718
+ intlCache.set(key, fmt);
3719
+ }
3720
+ const parts = fmt.formatToParts(date);
3721
+ const partMap = new Map(parts.map((part) => [part.type, part.value]));
3722
+ const year = partMap.get("year");
3723
+ const month = partMap.get("month");
3724
+ const day = partMap.get("day");
3725
+ if (!year || !month || !day) return "";
3726
+ return getDateFormatParts(format).map((part) => {
3727
+ if (part === "year") return year;
3728
+ if (part === "month") return month;
3729
+ if (part === "day") return day;
3730
+ return part;
3731
+ }).join("");
3732
+ } catch {
3733
+ return "";
3734
+ }
3735
+ }
2897
3736
  function formatMonthYear(year, month, locale) {
2898
3737
  if (locale) {
2899
3738
  const text = safeIntlFormat(
@@ -2982,6 +3821,32 @@ function isToday(date) {
2982
3821
  const today = /* @__PURE__ */ new Date();
2983
3822
  return isSameDay(date, today);
2984
3823
  }
3824
+ function getDatePickerCalendarCellState(input) {
3825
+ const { date, selectedDate = null, selectedRange = [null, null], isRangeMode = false } = input;
3826
+ const [rangeStart, rangeEnd] = selectedRange;
3827
+ const normDate = normalizeDate(date);
3828
+ const normStart = rangeStart ? normalizeDate(rangeStart) : null;
3829
+ const normEnd = rangeEnd ? normalizeDate(rangeEnd) : null;
3830
+ const isSelectingEnd = isRangeMode && Boolean(rangeStart) && !rangeEnd;
3831
+ const isRangeStart = isRangeMode && rangeStart ? isSameDay(date, rangeStart) : false;
3832
+ const isRangeEnd = isRangeMode && rangeEnd ? isSameDay(date, rangeEnd) : false;
3833
+ const isInRange = Boolean(
3834
+ isRangeMode && normStart && normEnd && normDate >= normStart && normDate <= normEnd
3835
+ );
3836
+ const isSelected = !isRangeMode ? selectedDate ? isSameDay(date, selectedDate) : false : isRangeStart || isRangeEnd;
3837
+ const isBeforeRangeStart = Boolean(isSelectingEnd && normStart && normDate < normStart);
3838
+ const isDisabled = Boolean(input.isDateDisabled?.(date)) || isBeforeRangeStart;
3839
+ return {
3840
+ iso: formatDate(date, "yyyy-MM-dd"),
3841
+ isCurrentMonthDay: input.isCurrentMonth?.(date) ?? true,
3842
+ isSelected,
3843
+ isTodayDay: isToday(date),
3844
+ isDisabled,
3845
+ isInRange,
3846
+ isRangeStart,
3847
+ isRangeEnd
3848
+ };
3849
+ }
2985
3850
 
2986
3851
  // src/utils/datepicker-styles.ts
2987
3852
  var datePickerBaseClasses = "relative inline-block w-full";
@@ -3238,20 +4103,20 @@ function formatTimeDisplayWithLocale(hours, minutes, seconds = 0, format = "24",
3238
4103
  const suffix = period === "AM" ? labels.am : labels.pm;
3239
4104
  return `${timeStr} ${suffix}`;
3240
4105
  }
3241
- function isTimeInRange(hours, minutes, minTime, maxTime) {
3242
- const currentMinutes = hours * 60 + minutes;
4106
+ function isTimeInRange(hours, minutes, minTime, maxTime, seconds = 0) {
4107
+ const currentSeconds = hours * 3600 + minutes * 60 + seconds;
3243
4108
  if (minTime) {
3244
4109
  const min = parseTime(minTime);
3245
4110
  if (min) {
3246
- const minMinutes = min.hours * 60 + min.minutes;
3247
- if (currentMinutes < minMinutes) return false;
4111
+ const minSeconds = min.hours * 3600 + min.minutes * 60 + min.seconds;
4112
+ if (currentSeconds < minSeconds) return false;
3248
4113
  }
3249
4114
  }
3250
4115
  if (maxTime) {
3251
4116
  const max = parseTime(maxTime);
3252
4117
  if (max) {
3253
- const maxMinutes = max.hours * 60 + max.minutes;
3254
- if (currentMinutes > maxMinutes) return false;
4118
+ const maxSeconds = max.hours * 3600 + max.minutes * 60 + max.seconds;
4119
+ if (currentSeconds > maxSeconds) return false;
3255
4120
  }
3256
4121
  }
3257
4122
  return true;
@@ -3285,6 +4150,26 @@ function getCurrentTime(showSeconds = false) {
3285
4150
  return formatTime(now.getHours(), now.getMinutes(), now.getSeconds(), showSeconds);
3286
4151
  }
3287
4152
 
4153
+ // src/utils/file-utils.ts
4154
+ function formatBytes(bytes, options = {}) {
4155
+ if (bytes === void 0 || bytes === null) return options.emptyText ?? "";
4156
+ const safeBytes = Number.isFinite(bytes) ? Math.max(0, bytes) : 0;
4157
+ if (safeBytes === 0) return "0 B";
4158
+ const units = ["B", "KB", "MB", "GB", "TB"];
4159
+ const k = 1024;
4160
+ const index = Math.min(units.length - 1, Math.floor(Math.log(safeBytes) / Math.log(k)));
4161
+ const size = safeBytes / Math.pow(k, index);
4162
+ const precision = Math.max(0, Math.floor(options.precision ?? 2));
4163
+ const text = size.toFixed(precision);
4164
+ return `${options.trimTrailingZeros ? text.replace(/\.0+$/, "").replace(/(\.\d*?)0+$/, "$1") : text} ${units[index]}`;
4165
+ }
4166
+ function getFileExtensionName(name, options) {
4167
+ const dot = name.lastIndexOf(".");
4168
+ if (dot <= 0 || dot === name.length - 1) return "";
4169
+ const extension = name.slice(dot + 1).toLowerCase();
4170
+ return options?.includeDot ? `.${extension}` : extension;
4171
+ }
4172
+
3288
4173
  // src/utils/upload-utils.ts
3289
4174
  var DEFAULT_UPLOAD_CHUNK_SIZE = 1024 * 1024;
3290
4175
  var uploadStatusIconSizeClasses = {
@@ -3406,8 +4291,7 @@ function generateFileId() {
3406
4291
  return `upload-${Date.now()}-${Math.random().toString(36).substring(2, 11)}`;
3407
4292
  }
3408
4293
  function getFileExtension(fileName) {
3409
- if (!fileName.includes(".")) return "";
3410
- return `.${fileName.split(".").pop()?.toLowerCase() || ""}`;
4294
+ return getFileExtensionName(fileName, { includeDot: true });
3411
4295
  }
3412
4296
  function fileToUploadFile(file) {
3413
4297
  return {
@@ -3492,11 +4376,7 @@ function validateFileSize(file, maxSize) {
3492
4376
  return file.size <= maxSize;
3493
4377
  }
3494
4378
  function formatFileSize(bytes) {
3495
- if (bytes === 0) return "0 B";
3496
- const units = ["B", "KB", "MB", "GB", "TB"];
3497
- const k = 1024;
3498
- const i = Math.floor(Math.log(bytes) / Math.log(k));
3499
- return `${(bytes / Math.pow(k, i)).toFixed(2)} ${units[i]}`;
4379
+ return formatBytes(bytes, { precision: 2 });
3500
4380
  }
3501
4381
  function getUploadButtonClasses(disabled) {
3502
4382
  const baseClasses2 = [
@@ -4027,6 +4907,34 @@ function getTableColgroup(options) {
4027
4907
  }
4028
4908
  return entries;
4029
4909
  }
4910
+ function hasTableSelectionColumn(rowSelection) {
4911
+ return !!rowSelection && rowSelection.showCheckbox !== false;
4912
+ }
4913
+ function getTableSelectionState(input) {
4914
+ const selectedSet = new Set(input.selectedRowKeys);
4915
+ const selectableRowKeys = input.rowKeys.filter((key, index) => {
4916
+ const record = input.records[index];
4917
+ return !input.getCheckboxProps?.(record)?.disabled;
4918
+ });
4919
+ const allSelected = selectableRowKeys.length > 0 && selectableRowKeys.every((key) => selectedSet.has(key));
4920
+ const someSelected = selectableRowKeys.some((key) => selectedSet.has(key)) && !allSelected;
4921
+ return { selectableRowKeys, allSelected, someSelected };
4922
+ }
4923
+ function getNextTableSelectAllKeys(selectedRowKeys, selectableRowKeys, checked) {
4924
+ const selectableSet = new Set(selectableRowKeys);
4925
+ if (!checked) {
4926
+ return selectedRowKeys.filter((key) => !selectableSet.has(key));
4927
+ }
4928
+ const next = [...selectedRowKeys];
4929
+ const nextSet = new Set(next);
4930
+ for (const key of selectableRowKeys) {
4931
+ if (!nextSet.has(key)) {
4932
+ next.push(key);
4933
+ nextSet.add(key);
4934
+ }
4935
+ }
4936
+ return next;
4937
+ }
4030
4938
  function freezeTableColumnWidths(columns, measuredWidths = {}, previousFrozen = {}) {
4031
4939
  const next = {};
4032
4940
  for (const column of columns) {
@@ -4290,6 +5198,48 @@ function filterData(data, filters) {
4290
5198
  });
4291
5199
  });
4292
5200
  }
5201
+ function filterTableData(data, columns, filters) {
5202
+ if (!filters || Object.keys(filters).length === 0) {
5203
+ return data;
5204
+ }
5205
+ const filterFnByKey = /* @__PURE__ */ new Map();
5206
+ for (const column of columns) {
5207
+ if (column.filter?.filterFn) {
5208
+ filterFnByKey.set(column.key, column.filter.filterFn);
5209
+ }
5210
+ }
5211
+ return data.filter((record) => {
5212
+ return Object.entries(filters).every(([key, filterValue]) => {
5213
+ if (filterValue === "" || filterValue === null || filterValue === void 0) {
5214
+ return true;
5215
+ }
5216
+ const cellValue = record[key];
5217
+ const customFn = filterFnByKey.get(key);
5218
+ if (customFn) {
5219
+ return customFn(cellValue, filterValue);
5220
+ }
5221
+ if (typeof filterValue === "string") {
5222
+ return String(cellValue).toLowerCase().includes(filterValue.toLowerCase());
5223
+ }
5224
+ return cellValue === filterValue;
5225
+ });
5226
+ });
5227
+ }
5228
+ function getTableVirtualWindow(scrollTop, viewportHeight, itemHeight, rowCount, overscan = 5) {
5229
+ if (rowCount <= 0 || itemHeight <= 0) {
5230
+ return { startIndex: 0, endIndex: -1, topPad: 0, bottomPad: 0 };
5231
+ }
5232
+ const safeScrollTop = Math.max(0, Number.isFinite(scrollTop) ? scrollTop : 0);
5233
+ const startIndex = Math.max(0, Math.floor(safeScrollTop / itemHeight) - overscan);
5234
+ const visibleCount = Math.ceil(Math.max(0, viewportHeight) / itemHeight) + overscan * 2;
5235
+ const endIndex = Math.min(rowCount - 1, startIndex + visibleCount);
5236
+ return {
5237
+ startIndex,
5238
+ endIndex,
5239
+ topPad: startIndex * itemHeight,
5240
+ bottomPad: Math.max(0, (rowCount - 1 - endIndex) * itemHeight)
5241
+ };
5242
+ }
4293
5243
  function paginateData(data, current, pageSize) {
4294
5244
  const startIndex = (current - 1) * pageSize;
4295
5245
  const endIndex = startIndex + pageSize;
@@ -4591,6 +5541,94 @@ var listItemTitleClasses = "font-medium text-[var(--tiger-text,#111827)] truncat
4591
5541
  var listItemDescriptionClasses = "text-sm text-[var(--tiger-text-muted,#6b7280)] mt-1";
4592
5542
  var listItemExtraClasses = "flex-shrink-0 ml-4";
4593
5543
  var listGridContainerClasses = "grid gap-4";
5544
+ var GRID_COLUMNS = {
5545
+ 1: "grid-cols-1",
5546
+ 2: "grid-cols-2",
5547
+ 3: "grid-cols-3",
5548
+ 4: "grid-cols-4",
5549
+ 5: "grid-cols-5",
5550
+ 6: "grid-cols-6",
5551
+ 7: "grid-cols-7",
5552
+ 8: "grid-cols-8",
5553
+ 9: "grid-cols-9",
5554
+ 10: "grid-cols-10",
5555
+ 11: "grid-cols-11",
5556
+ 12: "grid-cols-12"
5557
+ };
5558
+ var SM_GRID_COLUMNS = {
5559
+ 1: "sm:grid-cols-1",
5560
+ 2: "sm:grid-cols-2",
5561
+ 3: "sm:grid-cols-3",
5562
+ 4: "sm:grid-cols-4",
5563
+ 5: "sm:grid-cols-5",
5564
+ 6: "sm:grid-cols-6",
5565
+ 7: "sm:grid-cols-7",
5566
+ 8: "sm:grid-cols-8",
5567
+ 9: "sm:grid-cols-9",
5568
+ 10: "sm:grid-cols-10",
5569
+ 11: "sm:grid-cols-11",
5570
+ 12: "sm:grid-cols-12"
5571
+ };
5572
+ var MD_GRID_COLUMNS = {
5573
+ 1: "md:grid-cols-1",
5574
+ 2: "md:grid-cols-2",
5575
+ 3: "md:grid-cols-3",
5576
+ 4: "md:grid-cols-4",
5577
+ 5: "md:grid-cols-5",
5578
+ 6: "md:grid-cols-6",
5579
+ 7: "md:grid-cols-7",
5580
+ 8: "md:grid-cols-8",
5581
+ 9: "md:grid-cols-9",
5582
+ 10: "md:grid-cols-10",
5583
+ 11: "md:grid-cols-11",
5584
+ 12: "md:grid-cols-12"
5585
+ };
5586
+ var LG_GRID_COLUMNS = {
5587
+ 1: "lg:grid-cols-1",
5588
+ 2: "lg:grid-cols-2",
5589
+ 3: "lg:grid-cols-3",
5590
+ 4: "lg:grid-cols-4",
5591
+ 5: "lg:grid-cols-5",
5592
+ 6: "lg:grid-cols-6",
5593
+ 7: "lg:grid-cols-7",
5594
+ 8: "lg:grid-cols-8",
5595
+ 9: "lg:grid-cols-9",
5596
+ 10: "lg:grid-cols-10",
5597
+ 11: "lg:grid-cols-11",
5598
+ 12: "lg:grid-cols-12"
5599
+ };
5600
+ var XL_GRID_COLUMNS = {
5601
+ 1: "xl:grid-cols-1",
5602
+ 2: "xl:grid-cols-2",
5603
+ 3: "xl:grid-cols-3",
5604
+ 4: "xl:grid-cols-4",
5605
+ 5: "xl:grid-cols-5",
5606
+ 6: "xl:grid-cols-6",
5607
+ 7: "xl:grid-cols-7",
5608
+ 8: "xl:grid-cols-8",
5609
+ 9: "xl:grid-cols-9",
5610
+ 10: "xl:grid-cols-10",
5611
+ 11: "xl:grid-cols-11",
5612
+ 12: "xl:grid-cols-12"
5613
+ };
5614
+ var XXL_GRID_COLUMNS = {
5615
+ 1: "2xl:grid-cols-1",
5616
+ 2: "2xl:grid-cols-2",
5617
+ 3: "2xl:grid-cols-3",
5618
+ 4: "2xl:grid-cols-4",
5619
+ 5: "2xl:grid-cols-5",
5620
+ 6: "2xl:grid-cols-6",
5621
+ 7: "2xl:grid-cols-7",
5622
+ 8: "2xl:grid-cols-8",
5623
+ 9: "2xl:grid-cols-9",
5624
+ 10: "2xl:grid-cols-10",
5625
+ 11: "2xl:grid-cols-11",
5626
+ 12: "2xl:grid-cols-12"
5627
+ };
5628
+ function getColumnClass(map, value) {
5629
+ if (!value || !Number.isFinite(value)) return void 0;
5630
+ return map[Math.floor(value)];
5631
+ }
4594
5632
  function getListClasses(bordered) {
4595
5633
  const classes = [listBaseClasses, listBorderClasses[bordered]];
4596
5634
  return classes.filter(Boolean).join(" ");
@@ -4614,27 +5652,18 @@ function getListHeaderFooterClasses(size, isFooter = false) {
4614
5652
  }
4615
5653
  function getGridColumnClasses(column, xs, sm, md, lg, xl, xxl) {
4616
5654
  const classes = [];
4617
- if (column) {
4618
- classes.push(`grid-cols-${column}`);
4619
- }
4620
- if (xs) {
4621
- classes.push(`grid-cols-${xs}`);
4622
- }
4623
- if (sm) {
4624
- classes.push(`sm:grid-cols-${sm}`);
4625
- }
4626
- if (md) {
4627
- classes.push(`md:grid-cols-${md}`);
4628
- }
4629
- if (lg) {
4630
- classes.push(`lg:grid-cols-${lg}`);
4631
- }
4632
- if (xl) {
4633
- classes.push(`xl:grid-cols-${xl}`);
4634
- }
4635
- if (xxl) {
4636
- classes.push(`2xl:grid-cols-${xxl}`);
4637
- }
5655
+ const baseClass = getColumnClass(GRID_COLUMNS, xs ?? column);
5656
+ if (baseClass) classes.push(baseClass);
5657
+ const smClass = getColumnClass(SM_GRID_COLUMNS, sm);
5658
+ if (smClass) classes.push(smClass);
5659
+ const mdClass = getColumnClass(MD_GRID_COLUMNS, md);
5660
+ if (mdClass) classes.push(mdClass);
5661
+ const lgClass = getColumnClass(LG_GRID_COLUMNS, lg);
5662
+ if (lgClass) classes.push(lgClass);
5663
+ const xlClass = getColumnClass(XL_GRID_COLUMNS, xl);
5664
+ if (xlClass) classes.push(xlClass);
5665
+ const xxlClass = getColumnClass(XXL_GRID_COLUMNS, xxl);
5666
+ if (xxlClass) classes.push(xxlClass);
4638
5667
  return classes.join(" ");
4639
5668
  }
4640
5669
 
@@ -4794,6 +5823,75 @@ function getVisibleTreeItems(treeData, expandedKeys = /* @__PURE__ */ new Set(),
4794
5823
  traverse(treeData, 1);
4795
5824
  return result;
4796
5825
  }
5826
+ function getFirstVisibleChildKey(visibleItems, parentKey) {
5827
+ const index = visibleItems.findIndex((item) => item.key === parentKey);
5828
+ if (index < 0) return void 0;
5829
+ const base = visibleItems[index];
5830
+ for (let i = index + 1; i < visibleItems.length; i++) {
5831
+ const item = visibleItems[i];
5832
+ if (item.level <= base.level) break;
5833
+ if (item.parentKey === parentKey && !item.node.disabled) return item.key;
5834
+ }
5835
+ return void 0;
5836
+ }
5837
+ function getTreeKeyboardAction(ctx) {
5838
+ const {
5839
+ key,
5840
+ nodeKey,
5841
+ currentKey,
5842
+ focusableKeys,
5843
+ parentKey,
5844
+ firstChildKey,
5845
+ isExpandable,
5846
+ isExpanded,
5847
+ isParentExpanded,
5848
+ isChecked,
5849
+ selectable,
5850
+ checkable
5851
+ } = ctx;
5852
+ const currentIndex = focusableKeys.findIndex((k) => k === currentKey);
5853
+ const focusAt = (index) => ({
5854
+ type: "focus",
5855
+ key: focusableKeys[index] ?? currentKey
5856
+ });
5857
+ switch (key) {
5858
+ case "ArrowDown":
5859
+ return focusAt(currentIndex + 1);
5860
+ case "ArrowUp":
5861
+ return focusAt(currentIndex - 1);
5862
+ case "Home":
5863
+ return focusAt(0);
5864
+ case "End":
5865
+ return focusAt(focusableKeys.length - 1);
5866
+ case "ArrowRight":
5867
+ if (isExpandable && !isExpanded) return { type: "toggleExpand", key: nodeKey };
5868
+ if (isExpandable && isExpanded) return { type: "focus", key: firstChildKey ?? currentKey };
5869
+ return { type: "none" };
5870
+ case "ArrowLeft":
5871
+ if (isExpandable && isExpanded) return { type: "toggleExpand", key: nodeKey };
5872
+ return { type: "focus", key: parentKey ?? currentKey };
5873
+ case "Escape":
5874
+ if (isExpandable && isExpanded) return { type: "toggleExpand", key: nodeKey };
5875
+ if (parentKey !== void 0) {
5876
+ return {
5877
+ type: "collapseAndFocus",
5878
+ collapseKey: isParentExpanded ? parentKey : void 0,
5879
+ focusKey: parentKey
5880
+ };
5881
+ }
5882
+ return { type: "none" };
5883
+ case "Enter":
5884
+ if (selectable) return { type: "select", key: nodeKey };
5885
+ if (isExpandable) return { type: "toggleExpand", key: nodeKey };
5886
+ return { type: "none" };
5887
+ case " ":
5888
+ if (checkable) return { type: "check", key: nodeKey, checked: !isChecked };
5889
+ if (isExpandable) return { type: "toggleExpand", key: nodeKey };
5890
+ return { type: "none" };
5891
+ default:
5892
+ return null;
5893
+ }
5894
+ }
4797
5895
  var treeBaseClasses = "w-full bg-white rounded-[var(--tiger-radius-md,0.5rem)]";
4798
5896
  var treeNodeWrapperClasses = "select-none";
4799
5897
  var treeNodeContentClasses = "flex items-center px-2 py-1.5 cursor-pointer rounded transition-colors duration-200";
@@ -5551,6 +6649,10 @@ function createSubmenuHeightTransitionController(element, options) {
5551
6649
  }
5552
6650
  };
5553
6651
  }
6652
+ function getMenuNavigationKeys(mode, isRoot) {
6653
+ const isHorizontalRoot = isRoot && mode === "horizontal";
6654
+ return isHorizontalRoot ? { nextKey: "ArrowRight", prevKey: "ArrowLeft" } : { nextKey: "ArrowDown", prevKey: "ArrowUp" };
6655
+ }
5554
6656
  function getMenuButtons(container) {
5555
6657
  return Array.from(
5556
6658
  container.querySelectorAll('button[data-tiger-menuitem="true"]')
@@ -5818,6 +6920,9 @@ function getBreadcrumbCollapsedItems(totalItems, maxItems) {
5818
6920
 
5819
6921
  // src/utils/steps-utils.ts
5820
6922
  var stepFinishChar = "\u2713";
6923
+ var stepFinishIconViewBox = "0 0 24 24";
6924
+ var stepFinishIconStrokeWidth = "3";
6925
+ var stepFinishIconPathD = "M4.5 12.75l6 6 9-13.5";
5821
6926
  function getStepsContainerClasses(direction) {
5822
6927
  const baseClasses2 = "tiger-steps w-full list-none m-0 p-0";
5823
6928
  if (direction === "vertical") {
@@ -7076,7 +8181,7 @@ function getCodeBlockCopyButtonClasses(isCopied, ...classes) {
7076
8181
  );
7077
8182
  }
7078
8183
 
7079
- // src/theme/colors.ts
8184
+ // src/theme-runtime/colors.ts
7080
8185
  var defaultThemeColors = {
7081
8186
  primary: {
7082
8187
  bg: "bg-[var(--tiger-primary,#2563eb)]",
@@ -7554,6 +8659,9 @@ function getInitialCropRect(imageWidth, imageHeight, aspectRatio) {
7554
8659
  };
7555
8660
  }
7556
8661
  function cropCanvas(image, cropRect, displayWidth, displayHeight, outputType = "image/png", quality = 0.92) {
8662
+ if (!isBrowser()) {
8663
+ throw new Error("Image canvas cropping is only available in the browser");
8664
+ }
7557
8665
  const scaleX = image.naturalWidth / displayWidth;
7558
8666
  const scaleY = image.naturalHeight / displayHeight;
7559
8667
  const sx = cropRect.x * scaleX;
@@ -7894,6 +9002,9 @@ function getAnchorLinkClasses(active, className) {
7894
9002
  return [anchorLinkBaseClasses, active && anchorLinkActiveClasses, className].filter(Boolean).join(" ");
7895
9003
  }
7896
9004
  function getAnchorTargetElement(href) {
9005
+ if (!isBrowser()) {
9006
+ return null;
9007
+ }
7897
9008
  if (!href || !href.startsWith("#")) {
7898
9009
  return null;
7899
9010
  }
@@ -7904,18 +9015,27 @@ function getAnchorTargetElement(href) {
7904
9015
  return document.getElementById(id);
7905
9016
  }
7906
9017
  function getContainerScrollTop(container) {
9018
+ if (!isBrowser()) {
9019
+ return container?.scrollTop ?? 0;
9020
+ }
7907
9021
  if (container === window) {
7908
9022
  return window.scrollY || document.documentElement.scrollTop;
7909
9023
  }
7910
9024
  return container.scrollTop;
7911
9025
  }
7912
9026
  function getContainerHeight(container) {
9027
+ if (!isBrowser()) {
9028
+ return container?.clientHeight ?? 0;
9029
+ }
7913
9030
  if (container === window) {
7914
9031
  return window.innerHeight;
7915
9032
  }
7916
9033
  return container.clientHeight;
7917
9034
  }
7918
9035
  function getElementOffsetTop(element, container) {
9036
+ if (!isBrowser()) {
9037
+ return 0;
9038
+ }
7919
9039
  if (container === window) {
7920
9040
  const rect = element.getBoundingClientRect();
7921
9041
  return rect.top + window.scrollY;
@@ -7935,6 +9055,9 @@ function getElementOffsetTop(element, container) {
7935
9055
  return offset2;
7936
9056
  }
7937
9057
  function scrollToAnchor(href, container, targetOffset = 0) {
9058
+ if (!isBrowser()) {
9059
+ return;
9060
+ }
7938
9061
  const element = getAnchorTargetElement(href);
7939
9062
  if (!element) {
7940
9063
  return;
@@ -7947,6 +9070,9 @@ function findActiveAnchor(links, container, bounds = 5, targetOffset = 0) {
7947
9070
  if (links.length === 0) {
7948
9071
  return "";
7949
9072
  }
9073
+ if (!isBrowser()) {
9074
+ return links[0] || "";
9075
+ }
7950
9076
  const scrollTop = getContainerScrollTop(container);
7951
9077
  for (let i = links.length - 1; i >= 0; i--) {
7952
9078
  const href = links[i];
@@ -7961,11 +9087,11 @@ function findActiveAnchor(links, container, bounds = 5, targetOffset = 0) {
7961
9087
  return links[0] || "";
7962
9088
  }
7963
9089
  function createAnchorObserver(links, options) {
9090
+ if (!isBrowser()) return () => {
9091
+ };
7964
9092
  if (typeof IntersectionObserver === "undefined") return () => {
7965
9093
  };
7966
9094
  const { offsetTop = 0, root = null, onChange } = options;
7967
- if (!isBrowser()) return () => {
7968
- };
7969
9095
  const targets = /* @__PURE__ */ new Map();
7970
9096
  for (const href of links) {
7971
9097
  const el = getAnchorTargetElement(href);
@@ -8056,6 +9182,8 @@ function getScatterHoverSize(baseSize) {
8056
9182
  }
8057
9183
  var SCATTER_ENTRANCE_KEYFRAMES = `@keyframes tiger-scatter-entrance{from{opacity:0;transform:scale(0)}60%{transform:scale(1.15)}to{opacity:1;transform:scale(1)}}@media (prefers-reduced-motion: reduce){.tiger-scatter-entrance{animation-duration:0ms;animation-delay:0ms}}`;
8058
9184
  var SCATTER_ENTRANCE_CLASS = "tiger-scatter-entrance";
9185
+ var DONUT_ENTRANCE_KEYFRAMES = `@keyframes tiger-donut-entrance{from{opacity:0;transform:scale(0.9)}to{opacity:1;transform:scale(1)}}.tiger-donut-entrance{transform-origin:center;animation:tiger-donut-entrance var(--tiger-motion-duration-slow,500ms) var(--tiger-motion-ease-spring,cubic-bezier(.34,1.56,.64,1)) both}@media (prefers-reduced-motion: reduce){.tiger-donut-entrance{animation-duration:0ms}}`;
9186
+ var DONUT_ENTRANCE_CLASS = "tiger-donut-entrance";
8059
9187
 
8060
9188
  // src/utils/chart/scale.ts
8061
9189
  var clampNumber = (value, min, max) => Math.min(max, Math.max(min, value));
@@ -8946,6 +10074,57 @@ function resolveChartTooltipContent(hoveredIndex, data, formatter, defaultFormat
8946
10074
  function getChartTooltipTransform(position) {
8947
10075
  return `translate3d(${position.x}px, ${position.y}px, 0)`;
8948
10076
  }
10077
+ function resolveChartTooltipPosition(input) {
10078
+ const offsetX = input.offsetX ?? 12;
10079
+ const offsetY = input.offsetY ?? -8;
10080
+ const padding = input.padding ?? 8;
10081
+ const anchorX = Number.isFinite(input.x) ? input.x : 0;
10082
+ const anchorY = Number.isFinite(input.y) ? input.y : 0;
10083
+ const rectWidth = Number.isFinite(input.rect.width) ? Math.max(0, input.rect.width) : 0;
10084
+ const rectHeight = Number.isFinite(input.rect.height) ? Math.max(0, input.rect.height) : 0;
10085
+ const viewportWidth = Number.isFinite(input.viewport.width) ? Math.max(0, input.viewport.width) : 0;
10086
+ const viewportHeight = Number.isFinite(input.viewport.height) ? Math.max(0, input.viewport.height) : 0;
10087
+ let nextX = anchorX + offsetX;
10088
+ let nextY = anchorY + offsetY;
10089
+ if (nextX + rectWidth > viewportWidth - padding) {
10090
+ nextX = anchorX - rectWidth - offsetX;
10091
+ }
10092
+ if (nextY + rectHeight > viewportHeight - padding) {
10093
+ nextY = anchorY - rectHeight - Math.abs(offsetY);
10094
+ }
10095
+ return {
10096
+ x: Math.max(padding, nextX),
10097
+ y: Math.max(padding, nextY)
10098
+ };
10099
+ }
10100
+ function downsampleSeriesData(data, threshold, getValue = (_item, index) => index) {
10101
+ const safeThreshold = Math.max(0, Math.floor(Number.isFinite(threshold) ? threshold : 0));
10102
+ if (safeThreshold === 0 || data.length <= safeThreshold) {
10103
+ return data.map((item, index) => ({ item, index }));
10104
+ }
10105
+ if (safeThreshold === 1) {
10106
+ return [{ item: data[0], index: 0 }];
10107
+ }
10108
+ const result = [{ item: data[0], index: 0 }];
10109
+ const bucketSize = (data.length - 2) / Math.max(1, safeThreshold - 2);
10110
+ for (let bucket = 0; bucket < safeThreshold - 2; bucket++) {
10111
+ const start = Math.floor(1 + bucket * bucketSize);
10112
+ const end = Math.min(data.length - 1, Math.floor(1 + (bucket + 1) * bucketSize));
10113
+ let selectedIndex = start;
10114
+ let selectedValue = Number.NEGATIVE_INFINITY;
10115
+ for (let index = start; index < end; index++) {
10116
+ const rawValue = getValue(data[index], index);
10117
+ const value = Math.abs(Number.isFinite(rawValue) ? rawValue : 0);
10118
+ if (value > selectedValue) {
10119
+ selectedValue = value;
10120
+ selectedIndex = index;
10121
+ }
10122
+ }
10123
+ result.push({ item: data[selectedIndex], index: selectedIndex });
10124
+ }
10125
+ result.push({ item: data[data.length - 1], index: data.length - 1 });
10126
+ return result;
10127
+ }
8949
10128
  function resolveMultiSeriesTooltipContent(hoveredPoint, series, formatter, defaultFormatter) {
8950
10129
  if (!hoveredPoint) return "";
8951
10130
  const { seriesIndex, pointIndex } = hoveredPoint;
@@ -8981,19 +10160,25 @@ function defaultRadarTooltipFormatter(datum, seriesIndex, _pointIndex, series) {
8981
10160
  function computeFunnelSegments(data, opts) {
8982
10161
  if (data.length === 0) return [];
8983
10162
  const { width, height, gap = 2, pinch = false, colors } = opts;
10163
+ const safeWidth = Number.isFinite(width) ? Math.max(0, width) : 0;
10164
+ const safeHeight = Number.isFinite(height) ? Math.max(0, height) : 0;
10165
+ const safeGap = Number.isFinite(gap) ? Math.max(0, gap) : 0;
10166
+ if (safeWidth <= 0 || safeHeight <= 0) return [];
8984
10167
  const palette = colors ?? DEFAULT_CHART_COLORS;
8985
- const maxValue = Math.max(...data.map((d) => d.value));
8986
- if (maxValue === 0) return [];
8987
- const totalGap = gap * (data.length - 1);
8988
- const segH = (height - totalGap) / data.length;
8989
- const halfW = width / 2;
10168
+ const values = data.map((d) => Number.isFinite(d.value) ? Math.max(0, d.value) : 0);
10169
+ const maxValue = Math.max(...values);
10170
+ if (maxValue <= 0) return [];
10171
+ const totalGap = Math.min(safeHeight, safeGap * (data.length - 1));
10172
+ const segH = Math.max(0, (safeHeight - totalGap) / data.length);
10173
+ const halfW = safeWidth / 2;
8990
10174
  return data.map((d, i) => {
8991
- const topRatio = d.value / maxValue;
8992
- const nextVal = i < data.length - 1 ? data[i + 1].value : pinch ? 0 : d.value;
10175
+ const value = values[i];
10176
+ const topRatio = value / maxValue;
10177
+ const nextVal = i < data.length - 1 ? values[i + 1] : pinch ? 0 : value;
8993
10178
  const bottomRatio = nextVal / maxValue;
8994
- const tw = width * topRatio;
8995
- const bw = width * bottomRatio;
8996
- const y = i * (segH + gap);
10179
+ const tw = safeWidth * topRatio;
10180
+ const bw = safeWidth * bottomRatio;
10181
+ const y = i * (segH + safeGap);
8997
10182
  const cx = halfW;
8998
10183
  const cy = y + segH / 2;
8999
10184
  const x1 = cx - tw / 2;
@@ -9004,7 +10189,7 @@ function computeFunnelSegments(data, opts) {
9004
10189
  return {
9005
10190
  index: i,
9006
10191
  label: d.label ?? `Stage ${i + 1}`,
9007
- value: d.value,
10192
+ value,
9008
10193
  color: d.color ?? palette[i % palette.length],
9009
10194
  path,
9010
10195
  cx,
@@ -9059,9 +10244,13 @@ function createGaugeAnimation(options) {
9059
10244
  function degToRad(deg) {
9060
10245
  return deg * Math.PI / 180;
9061
10246
  }
10247
+ function safeNumber(value, fallback = 0) {
10248
+ return Number.isFinite(value) ? value : fallback;
10249
+ }
9062
10250
  function createGaugeArcPath(cx, cy, radius, startDeg, endDeg, arcWidth) {
9063
- const outerR = radius;
9064
- const innerR = radius - arcWidth;
10251
+ const outerR = Math.max(0, safeNumber(radius));
10252
+ const safeArcWidth = Math.max(0, safeNumber(arcWidth));
10253
+ const innerR = Math.max(0, outerR - safeArcWidth);
9065
10254
  const startRad = degToRad(startDeg - 90);
9066
10255
  const endRad = degToRad(endDeg - 90);
9067
10256
  const outerStart = {
@@ -9091,8 +10280,9 @@ function createGaugeArcPath(cx, cy, radius, startDeg, endDeg, arcWidth) {
9091
10280
  }
9092
10281
  function createGaugeNeedlePath(cx, cy, length, angleDeg, needleWidth = 4) {
9093
10282
  const rad = degToRad(angleDeg - 90);
9094
- const tipX = cx + length * Math.cos(rad);
9095
- const tipY = cy + length * Math.sin(rad);
10283
+ const safeLength = Math.max(0, safeNumber(length));
10284
+ const tipX = cx + safeLength * Math.cos(rad);
10285
+ const tipY = cy + safeLength * Math.sin(rad);
9096
10286
  const perpRad = rad + Math.PI / 2;
9097
10287
  const halfW = needleWidth / 2;
9098
10288
  const bx1 = cx + halfW * Math.cos(perpRad);
@@ -9102,20 +10292,32 @@ function createGaugeNeedlePath(cx, cy, length, angleDeg, needleWidth = 4) {
9102
10292
  return `M${bx1},${by1} L${tipX},${tipY} L${bx2},${by2} Z`;
9103
10293
  }
9104
10294
  function valueToGaugeAngle(value, min, max, startAngle, endAngle) {
9105
- const ratio = Math.max(0, Math.min(1, (value - min) / (max - min)));
9106
- return startAngle + ratio * (endAngle - startAngle);
10295
+ const safeStart = safeNumber(startAngle);
10296
+ const safeEnd = safeNumber(endAngle, safeStart);
10297
+ const safeMin = safeNumber(min);
10298
+ const safeMax = safeNumber(max, safeMin);
10299
+ if (safeMax <= safeMin) return safeStart;
10300
+ const ratio = Math.max(0, Math.min(1, (safeNumber(value, safeMin) - safeMin) / (safeMax - safeMin)));
10301
+ return safeStart + ratio * (safeEnd - safeStart);
9107
10302
  }
9108
10303
  function computeGaugeTicks(cx, cy, radius, min, max, startAngle, endAngle, tickCount) {
9109
10304
  const ticks = [];
9110
- for (let i = 0; i <= tickCount; i++) {
9111
- const ratio = i / tickCount;
9112
- const val = min + ratio * (max - min);
9113
- const angle = startAngle + ratio * (endAngle - startAngle);
10305
+ const safeTickCount = Math.max(1, Math.floor(safeNumber(tickCount, 1)));
10306
+ const safeRadius = Math.max(0, safeNumber(radius));
10307
+ const safeMin = safeNumber(min);
10308
+ const safeMax = safeNumber(max, safeMin);
10309
+ const safeStart = safeNumber(startAngle);
10310
+ const safeEnd = safeNumber(endAngle, safeStart);
10311
+ for (let i = 0; i <= safeTickCount; i++) {
10312
+ const ratio = i / safeTickCount;
10313
+ const val = safeMax <= safeMin ? safeMin : safeMin + ratio * (safeMax - safeMin);
10314
+ const angle = safeStart + ratio * (safeEnd - safeStart);
9114
10315
  const rad = degToRad(angle - 90);
9115
- const outerX = cx + radius * Math.cos(rad);
9116
- const outerY = cy + radius * Math.sin(rad);
9117
- const innerX = cx + (radius - 8) * Math.cos(rad);
9118
- const innerY = cy + (radius - 8) * Math.sin(rad);
10316
+ const innerRadius = Math.max(0, safeRadius - 8);
10317
+ const outerX = cx + safeRadius * Math.cos(rad);
10318
+ const outerY = cy + safeRadius * Math.sin(rad);
10319
+ const innerX = cx + innerRadius * Math.cos(rad);
10320
+ const innerY = cy + innerRadius * Math.sin(rad);
9119
10321
  ticks.push({
9120
10322
  x1: innerX,
9121
10323
  y1: innerY,
@@ -9154,9 +10356,14 @@ function getHeatmapCellIndexAtPoint(cells, x, y) {
9154
10356
  return index >= 0 ? index : null;
9155
10357
  }
9156
10358
  function interpolateColor(minColor, maxColor, t) {
10359
+ const clamped = Number.isFinite(t) ? Math.max(0, Math.min(1, t)) : 0;
9157
10360
  const [r1, g1, b1] = hexToRgb(minColor);
9158
10361
  const [r2, g2, b2] = hexToRgb(maxColor);
9159
- return rgbToHex(r1 + (r2 - r1) * t, g1 + (g2 - g1) * t, b1 + (b2 - b1) * t);
10362
+ return rgbToHex(
10363
+ r1 + (r2 - r1) * clamped,
10364
+ g1 + (g2 - g1) * clamped,
10365
+ b1 + (b2 - b1) * clamped
10366
+ );
9160
10367
  }
9161
10368
  function interpolateColorOklch(minColor, maxColor, t) {
9162
10369
  const clamped = Math.max(0, Math.min(1, t));
@@ -9176,30 +10383,36 @@ function computeHeatmapCells(data, opts) {
9176
10383
  } = opts;
9177
10384
  const cols = xLabels.length;
9178
10385
  const rows = yLabels.length;
9179
- if (cols === 0 || rows === 0) return [];
9180
- const cellW = (width - cellGap * (cols - 1)) / cols;
9181
- const cellH = (height - cellGap * (rows - 1)) / rows;
10386
+ const safeWidth = Number.isFinite(width) ? Math.max(0, width) : 0;
10387
+ const safeHeight = Number.isFinite(height) ? Math.max(0, height) : 0;
10388
+ const safeCellGap = Number.isFinite(cellGap) ? Math.max(0, cellGap) : 0;
10389
+ if (cols === 0 || rows === 0 || safeWidth <= 0 || safeHeight <= 0) return [];
10390
+ const totalGapX = Math.min(safeWidth, safeCellGap * (cols - 1));
10391
+ const totalGapY = Math.min(safeHeight, safeCellGap * (rows - 1));
10392
+ const cellW = Math.max(0, (safeWidth - totalGapX) / cols);
10393
+ const cellH = Math.max(0, (safeHeight - totalGapY) / rows);
9182
10394
  const valMap = /* @__PURE__ */ new Map();
9183
10395
  for (const d of data) {
9184
- valMap.set(`${d.x}|${d.y}`, d.value);
10396
+ valMap.set(`${d.x}|${d.y}`, Number.isFinite(d.value) ? d.value : 0);
9185
10397
  }
9186
- let minVal = Infinity;
9187
- let maxVal = -Infinity;
9188
- for (const d of data) {
9189
- if (d.value < minVal) minVal = d.value;
9190
- if (d.value > maxVal) maxVal = d.value;
10398
+ const finiteValues = Array.from(valMap.values());
10399
+ let minVal = 0;
10400
+ let maxVal = 0;
10401
+ if (finiteValues.length > 0) {
10402
+ minVal = Math.min(...finiteValues, 0);
10403
+ maxVal = Math.max(...finiteValues, 0);
9191
10404
  }
9192
10405
  if (minVal === maxVal) maxVal = minVal + 1;
9193
10406
  const cells = [];
9194
10407
  for (let r = 0; r < rows; r++) {
9195
10408
  for (let c = 0; c < cols; c++) {
9196
10409
  const val = valMap.get(`${xLabels[c]}|${yLabels[r]}`) ?? 0;
9197
- const heat = (val - minVal) / (maxVal - minVal);
10410
+ const heat = Math.max(0, Math.min(1, (val - minVal) / (maxVal - minVal)));
9198
10411
  cells.push({
9199
10412
  row: r,
9200
10413
  col: c,
9201
- x: c * (cellW + cellGap),
9202
- y: r * (cellH + cellGap),
10414
+ x: c * (cellW + safeCellGap),
10415
+ y: r * (cellH + safeCellGap),
9203
10416
  w: cellW,
9204
10417
  h: cellH,
9205
10418
  heat,
@@ -9214,66 +10427,35 @@ function computeHeatmapCells(data, opts) {
9214
10427
  }
9215
10428
 
9216
10429
  // src/utils/treemap-chart-utils.ts
9217
- var flattenCache = /* @__PURE__ */ new WeakMap();
9218
10430
  function flattenData(data, depth = 0) {
9219
- if (depth === 0) {
9220
- const cached = flattenCache.get(data);
9221
- if (cached) return cached;
9222
- }
9223
10431
  const result = [];
9224
10432
  for (const d of data) {
9225
10433
  if (d.children && d.children.length > 0) {
9226
10434
  result.push(...flattenData(d.children, depth + 1));
9227
10435
  } else {
9228
- result.push({ label: d.label, value: d.value, depth, color: d.color });
10436
+ result.push({
10437
+ label: d.label,
10438
+ value: Number.isFinite(d.value) ? Math.max(0, d.value) : 0,
10439
+ depth,
10440
+ color: d.color
10441
+ });
9229
10442
  }
9230
10443
  }
9231
- if (depth === 0) {
9232
- flattenCache.set(data, result);
9233
- }
9234
10444
  return result;
9235
10445
  }
9236
- var _tmLastData = null;
9237
- var _tmLastW = 0;
9238
- var _tmLastH = 0;
9239
- var _tmLastGap = 0;
9240
- var _tmLastColors = null;
9241
- var _tmLastResult = [];
9242
10446
  function computeTreeMapNodes(data, opts) {
9243
10447
  const { width, height, gap = 2, colors } = opts;
10448
+ const safeWidth = Number.isFinite(width) ? Math.max(0, width) : 0;
10449
+ const safeHeight = Number.isFinite(height) ? Math.max(0, height) : 0;
10450
+ const safeGap = Number.isFinite(gap) ? Math.max(0, gap) : 0;
9244
10451
  const palette = colors ?? DEFAULT_CHART_COLORS;
9245
- if (data === _tmLastData && width === _tmLastW && height === _tmLastH && gap === _tmLastGap && palette === _tmLastColors) {
9246
- return _tmLastResult;
9247
- }
9248
10452
  const flat = flattenData(data);
9249
- if (flat.length === 0) {
9250
- _tmLastData = data;
9251
- _tmLastW = width;
9252
- _tmLastH = height;
9253
- _tmLastGap = gap;
9254
- _tmLastColors = palette;
9255
- _tmLastResult = [];
9256
- return _tmLastResult;
9257
- }
10453
+ if (flat.length === 0 || safeWidth <= 0 || safeHeight <= 0) return [];
9258
10454
  const totalValue = flat.reduce((s, d) => s + d.value, 0);
9259
- if (totalValue === 0) {
9260
- _tmLastData = data;
9261
- _tmLastW = width;
9262
- _tmLastH = height;
9263
- _tmLastGap = gap;
9264
- _tmLastColors = palette;
9265
- _tmLastResult = [];
9266
- return _tmLastResult;
9267
- }
10455
+ if (totalValue <= 0) return [];
9268
10456
  const sorted = flat.map((d, i) => ({ ...d, originalIndex: i })).sort((a, b) => b.value - a.value);
9269
10457
  const nodes = [];
9270
- layoutRect(sorted, 0, 0, width, height, gap, palette, nodes);
9271
- _tmLastData = data;
9272
- _tmLastW = width;
9273
- _tmLastH = height;
9274
- _tmLastGap = gap;
9275
- _tmLastColors = palette;
9276
- _tmLastResult = nodes;
10458
+ layoutRect(sorted, 0, 0, safeWidth, safeHeight, safeGap, palette, nodes);
9277
10459
  return nodes;
9278
10460
  }
9279
10461
  function layoutRect(items, x, y, w, h, gap, palette, out) {
@@ -9320,41 +10502,22 @@ function layoutRect(items, x, y, w, h, gap, palette, out) {
9320
10502
  }
9321
10503
 
9322
10504
  // src/utils/sunburst-chart-utils.ts
9323
- var sumCache = /* @__PURE__ */ new WeakMap();
9324
10505
  function sumValue(d) {
9325
- const cached = sumCache.get(d);
9326
- if (cached !== void 0) return cached;
9327
10506
  let v;
9328
10507
  if (d.children && d.children.length > 0) {
9329
10508
  v = d.children.reduce((s, c) => s + sumValue(c), 0);
9330
10509
  } else {
9331
10510
  v = d.value;
9332
10511
  }
9333
- sumCache.set(d, v);
9334
- return v;
9335
- }
9336
- function precomputeSums(items) {
9337
- for (const item of items) {
9338
- if (item.children && item.children.length > 0) {
9339
- precomputeSums(item.children);
9340
- }
9341
- sumValue(item);
9342
- }
10512
+ return Number.isFinite(v) ? Math.max(0, v) : 0;
9343
10513
  }
9344
- var _sbLastData = null;
9345
- var _sbLastCx = 0;
9346
- var _sbLastCy = 0;
9347
- var _sbLastIR = 0;
9348
- var _sbLastOR = 0;
9349
- var _sbLastColors = null;
9350
- var _sbLastResult = [];
9351
10514
  function computeSunburstArcs(data, opts) {
9352
- const { cx, cy, innerRadius, outerRadius, colors } = opts;
10515
+ const { innerRadius, outerRadius, colors } = opts;
10516
+ const cx = Number.isFinite(opts.cx) ? opts.cx : 0;
10517
+ const cy = Number.isFinite(opts.cy) ? opts.cy : 0;
10518
+ const safeInnerRadius = Number.isFinite(innerRadius) ? Math.max(0, innerRadius) : 0;
10519
+ const safeOuterRadius = Number.isFinite(outerRadius) ? Math.max(safeInnerRadius, outerRadius) : safeInnerRadius;
9353
10520
  const palette = colors ?? DEFAULT_CHART_COLORS;
9354
- if (data === _sbLastData && cx === _sbLastCx && cy === _sbLastCy && innerRadius === _sbLastIR && outerRadius === _sbLastOR && palette === _sbLastColors) {
9355
- return _sbLastResult;
9356
- }
9357
- precomputeSums(data);
9358
10521
  function maxDepth(items, d) {
9359
10522
  let m = d;
9360
10523
  for (const item of items) {
@@ -9365,7 +10528,7 @@ function computeSunburstArcs(data, opts) {
9365
10528
  return m;
9366
10529
  }
9367
10530
  const depth = maxDepth(data, 0);
9368
- const ringWidth = depth > 0 ? (outerRadius - innerRadius) / (depth + 1) : outerRadius - innerRadius;
10531
+ const ringWidth = depth > 0 ? (safeOuterRadius - safeInnerRadius) / (depth + 1) : safeOuterRadius - safeInnerRadius;
9369
10532
  const arcs = [];
9370
10533
  let flatIndex = 0;
9371
10534
  function layoutLevel(items, startAngle, endAngle, level, parentColorIdx) {
@@ -9377,8 +10540,8 @@ function computeSunburstArcs(data, opts) {
9377
10540
  const sweep = (endAngle - startAngle) * val / total;
9378
10541
  const sa = angle;
9379
10542
  const ea = angle + sweep;
9380
- const iR = innerRadius + level * ringWidth;
9381
- const oR = iR + ringWidth - 1;
10543
+ const iR = safeInnerRadius + level * ringWidth;
10544
+ const oR = Math.max(iR, iR + ringWidth - 1);
9382
10545
  const colorIdx = level === 0 ? i : parentColorIdx;
9383
10546
  const color = item.color ?? palette[colorIdx % palette.length];
9384
10547
  const path = createPieArcPath({
@@ -9392,7 +10555,7 @@ function computeSunburstArcs(data, opts) {
9392
10555
  arcs.push({
9393
10556
  index: flatIndex++,
9394
10557
  label: item.label,
9395
- value: item.value,
10558
+ value: val,
9396
10559
  depth: level,
9397
10560
  startAngle: sa,
9398
10561
  endAngle: ea,
@@ -9407,13 +10570,6 @@ function computeSunburstArcs(data, opts) {
9407
10570
  });
9408
10571
  }
9409
10572
  layoutLevel(data, -Math.PI / 2, 3 * Math.PI / 2, 0, 0);
9410
- _sbLastData = data;
9411
- _sbLastCx = cx;
9412
- _sbLastCy = cy;
9413
- _sbLastIR = innerRadius;
9414
- _sbLastOR = outerRadius;
9415
- _sbLastColors = palette;
9416
- _sbLastResult = arcs;
9417
10573
  return arcs;
9418
10574
  }
9419
10575
 
@@ -9476,13 +10632,12 @@ var resultIconPaths = {
9476
10632
  function getResultIconPath(status) {
9477
10633
  return resultIconPaths[status];
9478
10634
  }
9479
- var httpStatusLabels = {
9480
- "404": "404",
9481
- "403": "403",
9482
- "500": "500"
9483
- };
10635
+ var HTTP_RESULT_STATUSES = /* @__PURE__ */ new Set(["404", "403", "500"]);
10636
+ function isHttpResultStatus(status) {
10637
+ return HTTP_RESULT_STATUSES.has(status);
10638
+ }
9484
10639
  function getResultHttpLabel(status) {
9485
- return httpStatusLabels[status];
10640
+ return isHttpResultStatus(status) ? status : void 0;
9486
10641
  }
9487
10642
 
9488
10643
  // src/utils/empty-utils.ts
@@ -9497,8 +10652,19 @@ var presetDescriptions = {
9497
10652
  "no-results": "No results found",
9498
10653
  error: "Something went wrong"
9499
10654
  };
9500
- function getEmptyDescription(preset) {
9501
- return presetDescriptions[preset];
10655
+ function getEmptyDescription(preset, locale) {
10656
+ switch (preset) {
10657
+ case "no-data":
10658
+ return locale?.empty?.noDataAvailable ?? presetDescriptions[preset];
10659
+ case "no-results":
10660
+ return locale?.empty?.noResults ?? presetDescriptions[preset];
10661
+ case "error":
10662
+ return locale?.empty?.error ?? presetDescriptions[preset];
10663
+ case "default":
10664
+ case "simple":
10665
+ default:
10666
+ return locale?.empty?.noData ?? locale?.common?.emptyText ?? presetDescriptions[preset];
10667
+ }
9502
10668
  }
9503
10669
  var emptyIllustrationViewBox = "0 0 64 41";
9504
10670
  var emptyIllustrationPaths = [
@@ -10266,6 +11432,18 @@ var defaultChatMessageStatusInfo = {
10266
11432
  function getChatMessageStatusInfo(status, statusMap = defaultChatMessageStatusInfo) {
10267
11433
  return statusMap[status] || defaultChatMessageStatusInfo[status];
10268
11434
  }
11435
+ var chatStatusBarBaseClasses = "px-5 py-2 border-t border-[var(--tiger-border,#e5e7eb)] text-xs italic bg-[var(--tiger-surface-muted,#f9fafb)]";
11436
+ var chatStatusBarVariantText = {
11437
+ default: "text-[var(--tiger-text-muted,#6b7280)]",
11438
+ primary: "text-[var(--tiger-primary,#2563eb)]",
11439
+ success: "text-[var(--tiger-success,#22c55e)]",
11440
+ warning: "text-[var(--tiger-warning,#f59e0b)]",
11441
+ danger: "text-[var(--tiger-danger,#ef4444)]",
11442
+ info: "text-[var(--tiger-info,#3b82f6)]"
11443
+ };
11444
+ function getChatStatusBarClasses(variant = "info") {
11445
+ return `${chatStatusBarBaseClasses} ${chatStatusBarVariantText[variant] ?? chatStatusBarVariantText.info}`;
11446
+ }
10269
11447
 
10270
11448
  // src/utils/activity-feed-utils.ts
10271
11449
  var activityItemClasses = "tiger-activity-item";
@@ -10995,13 +12173,14 @@ function isCascaderOptionExpandable(option) {
10995
12173
  if (option.isLeaf) return false;
10996
12174
  return !!(option.children && option.children.length > 0);
10997
12175
  }
10998
- function flattenCascaderOptions(options, parentPath = [], parentValuePath = []) {
12176
+ function flattenCascaderOptions(options, parentPath = [], parentValuePath = [], changeOnSelect = false) {
10999
12177
  const result = [];
11000
12178
  for (const option of options) {
11001
12179
  const currentPath = [...parentPath, option];
11002
12180
  const currentValuePath = [...parentValuePath, option.value];
11003
12181
  const isDisabled = currentPath.some((o) => o.disabled);
11004
- if (!option.children || option.children.length === 0 || option.isLeaf) {
12182
+ const isLeaf = !option.children || option.children.length === 0 || !!option.isLeaf;
12183
+ if (isLeaf || changeOnSelect) {
11005
12184
  result.push({
11006
12185
  path: currentPath,
11007
12186
  valuePath: currentValuePath,
@@ -11010,7 +12189,9 @@ function flattenCascaderOptions(options, parentPath = [], parentValuePath = [])
11010
12189
  });
11011
12190
  }
11012
12191
  if (option.children && option.children.length > 0) {
11013
- result.push(...flattenCascaderOptions(option.children, currentPath, currentValuePath));
12192
+ result.push(
12193
+ ...flattenCascaderOptions(option.children, currentPath, currentValuePath, changeOnSelect)
12194
+ );
11014
12195
  }
11015
12196
  }
11016
12197
  return result;
@@ -11395,142 +12576,51 @@ function validateCronExpression(expression) {
11395
12576
  function validateCronField(value, meta) {
11396
12577
  const trimmed = value.trim();
11397
12578
  if (!trimmed) return `${meta.label} is required`;
11398
- return trimmed.split(",").map((part) => validateCronFieldPart(part, meta)).find((message) => message !== null) ?? null;
11399
- }
11400
- function getCronFieldIssue(result, field) {
11401
- return result.issues.find((issue) => issue.field === field);
11402
- }
11403
- function getSafeCronExpressionParts(expression) {
11404
- const parts = getCronExpressionParts(expression);
11405
- if (parts.length === cronFieldMetas.length) return parts;
11406
- return getCronExpressionParts(defaultCronExpression);
11407
- }
11408
- function getCronFieldIndex(field) {
11409
- return cronFieldMetas.findIndex((meta) => meta.key === field);
11410
- }
11411
- function validateCronFieldPart(part, meta) {
11412
- const [rangePart, stepPart] = part.split("/");
11413
- if (part.split("/").length > 2) return `${meta.label} has an invalid step expression`;
11414
- if (stepPart !== void 0 && !isCronIntegerInRange(stepPart, 1, meta.max)) {
11415
- return `${meta.label} step must be between 1 and ${meta.max}`;
11416
- }
11417
- if (rangePart === "*") return null;
11418
- const rangeMatch = rangePart.match(/^(\d+)-(\d+)$/);
11419
- if (rangeMatch) {
11420
- const start = Number(rangeMatch[1]);
11421
- const end = Number(rangeMatch[2]);
11422
- if (!isNumberInRange(start, meta.min, meta.max) || !isNumberInRange(end, meta.min, meta.max)) {
11423
- return `${meta.label} must be between ${meta.min} and ${meta.max}`;
11424
- }
11425
- if (start > end) return `${meta.label} range start must be less than or equal to end`;
11426
- return null;
11427
- }
11428
- if (/^\d+$/.test(rangePart)) {
11429
- return isCronIntegerInRange(rangePart, meta.min, meta.max) ? null : `${meta.label} must be between ${meta.min} and ${meta.max}`;
11430
- }
11431
- return `${meta.label} must be *, a number, a range, a step, or a comma list`;
11432
- }
11433
- function isCronIntegerInRange(value, min, max) {
11434
- if (!/^\d+$/.test(value)) return false;
11435
- return isNumberInRange(Number(value), min, max);
11436
- }
11437
- function isNumberInRange(value, min, max) {
11438
- return Number.isInteger(value) && value >= min && value <= max;
11439
- }
11440
- function clampCronNumber(value, min, max) {
11441
- if (!Number.isFinite(value)) return min;
11442
- return Math.max(min, Math.min(max, Math.round(value)));
11443
- }
11444
-
11445
- // src/utils/picker-utils.ts
11446
- var defaultIsDisabled = (item) => !!item?.disabled;
11447
- function findFirstEnabledIndex(items, isDisabled = defaultIsDisabled) {
11448
- for (let i = 0; i < items.length; i++) {
11449
- if (!isDisabled(items[i])) return i;
11450
- }
11451
- return -1;
11452
- }
11453
- function findLastEnabledIndex(items, isDisabled = defaultIsDisabled) {
11454
- for (let i = items.length - 1; i >= 0; i--) {
11455
- if (!isDisabled(items[i])) return i;
11456
- }
11457
- return -1;
11458
- }
11459
- function findNextEnabledIndex(items, current, direction, isDisabled = defaultIsDisabled) {
11460
- if (items.length === 0) return -1;
11461
- const start = current < 0 ? direction === 1 ? 0 : items.length - 1 : current + direction;
11462
- for (let i = start; i >= 0 && i < items.length; i += direction) {
11463
- if (!isDisabled(items[i])) return i;
11464
- }
11465
- return current;
11466
- }
11467
- function getInitialPickerActiveIndex(items, activeFirst, isDisabled = defaultIsDisabled) {
11468
- return activeFirst ? findFirstEnabledIndex(items, isDisabled) : -1;
11469
- }
11470
- function getPickerNavigationIndex(items, current, key, isDisabled = defaultIsDisabled) {
11471
- switch (key) {
11472
- case "ArrowDown":
11473
- return findNextEnabledIndex(items, current, 1, isDisabled);
11474
- case "ArrowUp":
11475
- return findNextEnabledIndex(items, current, -1, isDisabled);
11476
- case "Home":
11477
- return findFirstEnabledIndex(items, isDisabled);
11478
- case "End":
11479
- return findLastEnabledIndex(items, isDisabled);
11480
- default:
11481
- return current;
11482
- }
11483
- }
11484
- function getPickerOptionId(listboxId, index) {
11485
- return `${listboxId}-option-${index}`;
11486
- }
11487
- function getDisclosureStateAttr(open) {
11488
- return { "data-state": open ? "open" : "closed" };
11489
- }
11490
- function getPickerComboboxAria({
11491
- expanded,
11492
- listboxId,
11493
- activeIndex = -1,
11494
- activeOptionId
11495
- }) {
11496
- return {
11497
- role: "combobox",
11498
- "aria-expanded": expanded,
11499
- "aria-haspopup": "listbox",
11500
- "aria-controls": expanded ? listboxId : void 0,
11501
- "aria-activedescendant": expanded ? activeOptionId ?? (activeIndex >= 0 ? getPickerOptionId(listboxId, activeIndex) : void 0) : void 0,
11502
- "data-state": expanded ? "open" : "closed"
11503
- };
12579
+ return trimmed.split(",").map((part) => validateCronFieldPart(part, meta)).find((message) => message !== null) ?? null;
11504
12580
  }
11505
- function getPickerListboxAria({ id, label } = {}) {
11506
- return {
11507
- id,
11508
- role: "listbox",
11509
- "aria-label": label
11510
- };
12581
+ function getCronFieldIssue(result, field) {
12582
+ return result.issues.find((issue) => issue.field === field);
11511
12583
  }
11512
- function getPickerOptionAria({
11513
- selected = false,
11514
- disabled = false
11515
- }) {
11516
- return {
11517
- role: "option",
11518
- "aria-selected": selected,
11519
- "aria-disabled": disabled || void 0
11520
- };
12584
+ function getSafeCronExpressionParts(expression) {
12585
+ const parts = getCronExpressionParts(expression);
12586
+ if (parts.length === cronFieldMetas.length) return parts;
12587
+ return getCronExpressionParts(defaultCronExpression);
11521
12588
  }
11522
- function getPickerTriggerKeyAction(key, expanded) {
11523
- switch (key) {
11524
- case "Enter":
11525
- case " ":
11526
- return "toggle";
11527
- case "ArrowDown":
11528
- return expanded ? "none" : "open";
11529
- case "Escape":
11530
- return expanded ? "close" : "none";
11531
- default:
11532
- return "none";
12589
+ function getCronFieldIndex(field) {
12590
+ return cronFieldMetas.findIndex((meta) => meta.key === field);
12591
+ }
12592
+ function validateCronFieldPart(part, meta) {
12593
+ const [rangePart, stepPart] = part.split("/");
12594
+ if (part.split("/").length > 2) return `${meta.label} has an invalid step expression`;
12595
+ if (stepPart !== void 0 && !isCronIntegerInRange(stepPart, 1, meta.max)) {
12596
+ return `${meta.label} step must be between 1 and ${meta.max}`;
12597
+ }
12598
+ if (rangePart === "*") return null;
12599
+ const rangeMatch = rangePart.match(/^(\d+)-(\d+)$/);
12600
+ if (rangeMatch) {
12601
+ const start = Number(rangeMatch[1]);
12602
+ const end = Number(rangeMatch[2]);
12603
+ if (!isNumberInRange(start, meta.min, meta.max) || !isNumberInRange(end, meta.min, meta.max)) {
12604
+ return `${meta.label} must be between ${meta.min} and ${meta.max}`;
12605
+ }
12606
+ if (start > end) return `${meta.label} range start must be less than or equal to end`;
12607
+ return null;
11533
12608
  }
12609
+ if (/^\d+$/.test(rangePart)) {
12610
+ return isCronIntegerInRange(rangePart, meta.min, meta.max) ? null : `${meta.label} must be between ${meta.min} and ${meta.max}`;
12611
+ }
12612
+ return `${meta.label} must be *, a number, a range, a step, or a comma list`;
12613
+ }
12614
+ function isCronIntegerInRange(value, min, max) {
12615
+ if (!/^\d+$/.test(value)) return false;
12616
+ return isNumberInRange(Number(value), min, max);
12617
+ }
12618
+ function isNumberInRange(value, min, max) {
12619
+ return Number.isInteger(value) && value >= min && value <= max;
12620
+ }
12621
+ function clampCronNumber(value, min, max) {
12622
+ if (!Number.isFinite(value)) return min;
12623
+ return Math.max(min, Math.min(max, Math.round(value)));
11534
12624
  }
11535
12625
 
11536
12626
  // src/utils/spotlight-utils.ts
@@ -11773,6 +12863,19 @@ function splitTransferData(dataSource, targetKeys) {
11773
12863
  }
11774
12864
  return { sourceItems, targetItems };
11775
12865
  }
12866
+ function moveTransferItems(direction, targetKeys, selectedKeys, dataSource) {
12867
+ const disabledKeys = /* @__PURE__ */ new Set();
12868
+ for (const item of dataSource) {
12869
+ if (item.disabled) disabledKeys.add(item.key);
12870
+ }
12871
+ const dataKeys = new Set(dataSource.map((item) => item.key));
12872
+ const movedKeys = [...selectedKeys].filter((key) => dataKeys.has(key) && !disabledKeys.has(key));
12873
+ if (direction === "right") {
12874
+ return { targetKeys: [...targetKeys, ...movedKeys], movedKeys };
12875
+ }
12876
+ const movedSet = new Set(movedKeys);
12877
+ return { targetKeys: targetKeys.filter((key) => !movedSet.has(key)), movedKeys };
12878
+ }
11776
12879
  function filterTransferItems(items, query, filterFn) {
11777
12880
  if (!query) return items;
11778
12881
  const fn = filterFn ?? defaultTransferFilter;
@@ -12404,9 +13507,14 @@ var minusPathD = "M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z";
12404
13507
  var plusPathD = "M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z";
12405
13508
  var stepperIconViewBox = "0 0 20 20";
12406
13509
  function clampStepperValue(value, min, max, precision) {
12407
- let v = Math.max(min, Math.min(max, value));
12408
- if (precision !== void 0) {
12409
- v = Number(v.toFixed(precision));
13510
+ const safeMin = Number.isFinite(min) || min === Number.NEGATIVE_INFINITY ? min : 0;
13511
+ const safeMax = Number.isFinite(max) || max === Number.POSITIVE_INFINITY ? max : safeMin;
13512
+ const lower = Math.min(safeMin, safeMax);
13513
+ const upper = Math.max(safeMin, safeMax);
13514
+ const fallback = Number.isFinite(lower) ? lower : 0;
13515
+ let v = Math.max(lower, Math.min(upper, Number.isFinite(value) ? value : fallback));
13516
+ if (precision !== void 0 && Number.isFinite(precision) && precision >= 0) {
13517
+ v = Number(v.toFixed(Math.floor(precision)));
12410
13518
  }
12411
13519
  return v;
12412
13520
  }
@@ -12783,6 +13891,7 @@ function exportTableToExcel(columns, data) {
12783
13891
  return `<!doctype html><html><head><meta charset="utf-8"></head><body><table><thead><tr>${headerCells}</tr></thead><tbody>${bodyRows}</tbody></table></body></html>`;
12784
13892
  }
12785
13893
  function downloadCsv(csvContent, filename = "export") {
13894
+ if (!isBrowser()) return;
12786
13895
  const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8;" });
12787
13896
  const url = URL.createObjectURL(blob);
12788
13897
  const link = document.createElement("a");
@@ -12795,6 +13904,7 @@ function downloadCsv(csvContent, filename = "export") {
12795
13904
  URL.revokeObjectURL(url);
12796
13905
  }
12797
13906
  function downloadExcel(excelContent, filename = "export") {
13907
+ if (!isBrowser()) return;
12798
13908
  const blob = new Blob([excelContent], { type: "application/vnd.ms-excel;charset=utf-8;" });
12799
13909
  const url = URL.createObjectURL(blob);
12800
13910
  const link = document.createElement("a");
@@ -13442,6 +14552,26 @@ function calculateResizeDelta(handle, mouseDeltaX, mouseDeltaY, axis) {
13442
14552
  }
13443
14553
  return { deltaWidth, deltaHeight };
13444
14554
  }
14555
+ var RESIZE_KEYBOARD_STEP = 10;
14556
+ function getResizeKeyboardDelta(key, step = RESIZE_KEYBOARD_STEP) {
14557
+ switch (key) {
14558
+ case "ArrowRight":
14559
+ return { deltaX: step, deltaY: 0 };
14560
+ case "ArrowLeft":
14561
+ return { deltaX: -step, deltaY: 0 };
14562
+ case "ArrowDown":
14563
+ return { deltaX: 0, deltaY: step };
14564
+ case "ArrowUp":
14565
+ return { deltaX: 0, deltaY: -step };
14566
+ default:
14567
+ return null;
14568
+ }
14569
+ }
14570
+ function getResizeHandleOrientation(handle) {
14571
+ if (handle === "left" || handle === "right") return "vertical";
14572
+ if (handle === "top" || handle === "bottom") return "horizontal";
14573
+ return void 0;
14574
+ }
13445
14575
  function clampDimensions(width, height, minWidth, minHeight, maxWidth, maxHeight) {
13446
14576
  let w = Math.max(width, minWidth);
13447
14577
  let h = Math.max(height, minHeight);
@@ -13465,6 +14595,19 @@ var codeEditorHighlightClasses = "p-3 font-mono text-sm leading-relaxed whitespa
13465
14595
  var codeEditorLineNumberClasses = "select-none text-right pr-3 pl-2 border-r min-w-[3rem] flex-shrink-0";
13466
14596
  var codeEditorLineNumberLightClasses = "bg-gray-50 border-gray-200 text-gray-400";
13467
14597
  var codeEditorLineNumberDarkClasses = "bg-gray-800 border-gray-700 text-gray-500";
14598
+ var codeEditorActiveLineLightClasses = "bg-gray-100";
14599
+ var codeEditorActiveLineDarkClasses = "bg-gray-800/60";
14600
+ function getCodeEditorActiveLineClasses(theme) {
14601
+ return theme === "dark" ? codeEditorActiveLineDarkClasses : codeEditorActiveLineLightClasses;
14602
+ }
14603
+ function getActiveLineIndex(value, caretPosition) {
14604
+ const clamped = Math.max(0, Math.min(caretPosition, value.length));
14605
+ let line = 0;
14606
+ for (let i = 0; i < clamped; i++) {
14607
+ if (value[i] === "\n") line++;
14608
+ }
14609
+ return line;
14610
+ }
13468
14611
  var tokenClassesLight = {
13469
14612
  keyword: "text-purple-600 font-semibold",
13470
14613
  string: "text-green-600",
@@ -13858,6 +15001,66 @@ function isContentEmpty(html) {
13858
15001
  const stripped = html.replace(/<br\s*\/?>/gi, "").replace(/<\/?[^>]*>/g, "").replace(/&nbsp;/gi, "").trim();
13859
15002
  return stripped.length === 0;
13860
15003
  }
15004
+ function escapeHtml(value) {
15005
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
15006
+ }
15007
+ function decodeHtmlEntities(value) {
15008
+ return value.replace(/&nbsp;/gi, " ").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">").replace(/&quot;/gi, '"').replace(/&#39;/gi, "'").replace(/&amp;/gi, "&");
15009
+ }
15010
+ function inlineMarkdownToHtml(value) {
15011
+ return escapeHtml(value).replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(/\*([^*]+)\*/g, "<em>$1</em>").replace(/`([^`]+)`/g, "<code>$1</code>");
15012
+ }
15013
+ function richTextModeToHtml(value, mode = "html") {
15014
+ if (mode === "html") return sanitizeHtml(value);
15015
+ if (mode === "plain") {
15016
+ return escapeHtml(value).split(/\r?\n/).map((line) => line ? `<p>${line}</p>` : "<p><br></p>").join("");
15017
+ }
15018
+ const lines = value.split(/\r?\n/);
15019
+ const html = [];
15020
+ let listItems = [];
15021
+ const flushList = () => {
15022
+ if (listItems.length === 0) return;
15023
+ html.push(
15024
+ `<ul>${listItems.map((item) => `<li>${inlineMarkdownToHtml(item)}</li>`).join("")}</ul>`
15025
+ );
15026
+ listItems = [];
15027
+ };
15028
+ for (const line of lines) {
15029
+ const trimmed = line.trim();
15030
+ const bullet = /^[-*]\s+(.+)$/.exec(trimmed);
15031
+ if (bullet) {
15032
+ listItems.push(bullet[1]);
15033
+ continue;
15034
+ }
15035
+ flushList();
15036
+ if (!trimmed) {
15037
+ html.push("<p><br></p>");
15038
+ } else if (trimmed.startsWith("### ")) {
15039
+ html.push(`<h3>${inlineMarkdownToHtml(trimmed.slice(4))}</h3>`);
15040
+ } else if (trimmed.startsWith("## ")) {
15041
+ html.push(`<h2>${inlineMarkdownToHtml(trimmed.slice(3))}</h2>`);
15042
+ } else if (trimmed.startsWith("# ")) {
15043
+ html.push(`<h1>${inlineMarkdownToHtml(trimmed.slice(2))}</h1>`);
15044
+ } else {
15045
+ html.push(`<p>${inlineMarkdownToHtml(trimmed)}</p>`);
15046
+ }
15047
+ }
15048
+ flushList();
15049
+ return sanitizeHtml(html.join(""));
15050
+ }
15051
+ function htmlToText(value) {
15052
+ return decodeHtmlEntities(
15053
+ sanitizeHtml(value).replace(/<\/(h[1-6]|p|div|li)>/gi, "\n").replace(/<br\s*\/?>/gi, "\n").replace(/<\/ul>/gi, "\n").replace(/<[^>]+>/g, "")
15054
+ ).replace(/\n{3,}/g, "\n\n").trim();
15055
+ }
15056
+ function richTextHtmlToMode(html, mode = "html") {
15057
+ const sanitized = sanitizeHtml(html);
15058
+ if (mode === "html") return sanitized;
15059
+ if (mode === "plain") return htmlToText(sanitized);
15060
+ return decodeHtmlEntities(
15061
+ sanitized.replace(/<h1[^>]*>([\s\S]*?)<\/h1>/gi, "# $1\n\n").replace(/<h2[^>]*>([\s\S]*?)<\/h2>/gi, "## $1\n\n").replace(/<h3[^>]*>([\s\S]*?)<\/h3>/gi, "### $1\n\n").replace(/<li[^>]*>([\s\S]*?)<\/li>/gi, "- $1\n").replace(/<\/ul>/gi, "\n").replace(/<strong[^>]*>([\s\S]*?)<\/strong>/gi, "**$1**").replace(/<b[^>]*>([\s\S]*?)<\/b>/gi, "**$1**").replace(/<em[^>]*>([\s\S]*?)<\/em>/gi, "*$1*").replace(/<i[^>]*>([\s\S]*?)<\/i>/gi, "*$1*").replace(/<code[^>]*>([\s\S]*?)<\/code>/gi, "`$1`").replace(/<\/(p|div)>/gi, "\n\n").replace(/<br\s*\/?>/gi, "\n").replace(/<[^>]+>/g, "")
15062
+ ).replace(/\n{3,}/g, "\n\n").trim();
15063
+ }
13861
15064
  function parseHeight(height) {
13862
15065
  if (height === void 0) return void 0;
13863
15066
  if (typeof height === "number") return `${height}px`;
@@ -14151,15 +15354,15 @@ function createBuiltinRichTextEngine() {
14151
15354
  name: "builtin",
14152
15355
  create(ctx) {
14153
15356
  const { element } = ctx;
15357
+ const mode = ctx.mode ?? "html";
14154
15358
  let readOnly = ctx.readOnly;
14155
15359
  let disabled = ctx.disabled;
14156
15360
  element.contentEditable = String(!(readOnly || disabled));
14157
- const initial = sanitizeHtml(ctx.initialValue);
15361
+ const initial = richTextModeToHtml(ctx.initialValue, mode);
14158
15362
  if (initial) element.innerHTML = initial;
14159
15363
  const handleInput = () => {
14160
15364
  const html = element.innerHTML;
14161
- const sanitized = sanitizeHtml(html);
14162
- ctx.notifyChange(sanitized);
15365
+ ctx.notifyChange(richTextHtmlToMode(html, mode));
14163
15366
  };
14164
15367
  const refreshActiveFormats = () => {
14165
15368
  if (!isBrowser()) return;
@@ -14223,11 +15426,11 @@ function createBuiltinRichTextEngine() {
14223
15426
  };
14224
15427
  return {
14225
15428
  setValue(html) {
14226
- const sanitized = sanitizeHtml(html);
15429
+ const sanitized = richTextModeToHtml(html, mode);
14227
15430
  if (element.innerHTML !== sanitized) element.innerHTML = sanitized;
14228
15431
  },
14229
15432
  getValue() {
14230
- return sanitizeHtml(element.innerHTML);
15433
+ return richTextHtmlToMode(element.innerHTML, mode);
14231
15434
  },
14232
15435
  exec,
14233
15436
  refreshActiveFormats,
@@ -14256,7 +15459,6 @@ var kanbanSwimlaneDotClasses = "w-2.5 h-2.5 rounded-full shrink-0";
14256
15459
  var kanbanSwimlaneCollapsedClasses = "hidden";
14257
15460
  var kanbanFilterHighlightClasses = "bg-[var(--tiger-warning,#fbbf24)]/20";
14258
15461
  var kanbanAddColumnClasses = "flex items-center justify-center shrink-0 w-76 min-h-[120px] rounded-[var(--tiger-radius-lg,0.75rem)] border-2 border-dashed border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface-muted,#f9fafb)]/40 text-sm font-medium text-[var(--tiger-text-muted,#6b7280)] hover:border-[var(--tiger-primary,#2563eb)]/80 hover:text-[var(--tiger-primary,#2563eb)] hover:bg-[var(--tiger-surface,#ffffff)] hover:shadow-sm cursor-pointer transition-all duration-300 active:scale-98";
14259
- var kanbanAddCardClasses = taskBoardAddCardClasses;
14260
15462
  function filterCards(cards, filterText) {
14261
15463
  if (!filterText.trim()) return cards;
14262
15464
  const lower = filterText.toLowerCase();
@@ -14327,17 +15529,54 @@ var virtualTableBorderedClasses = "[&_td]:border-r [&_th]:border-r [&_td:last-ch
14327
15529
  var virtualTableEmptyClasses = "flex items-center justify-center py-12 text-sm text-[var(--tiger-text-muted,#9ca3af)]";
14328
15530
  var virtualTableLoadingClasses = "absolute inset-0 flex items-center justify-center bg-[var(--tiger-table-bg,var(--tiger-component-table-bg,var(--tiger-bg,var(--tiger-surface,#ffffff))))]/60 z-20";
14329
15531
  function calculateVirtualRange(scrollTop, viewportHeight, totalRows, rowHeight, overscan = 5) {
14330
- if (totalRows === 0 || rowHeight <= 0) {
15532
+ const safeTotalRows = Number.isFinite(totalRows) ? Math.max(0, Math.floor(totalRows)) : 0;
15533
+ const safeRowHeight = Number.isFinite(rowHeight) ? rowHeight : 0;
15534
+ const safeViewportHeight = Number.isFinite(viewportHeight) ? Math.max(0, viewportHeight) : 0;
15535
+ const safeScrollTop = Number.isFinite(scrollTop) ? Math.max(0, scrollTop) : 0;
15536
+ const safeOverscan = Number.isFinite(overscan) ? Math.max(0, Math.floor(overscan)) : 0;
15537
+ if (safeTotalRows === 0 || safeRowHeight <= 0 || safeViewportHeight <= 0) {
14331
15538
  return { start: 0, end: 0, offsetTop: 0, totalHeight: 0 };
14332
15539
  }
14333
- const totalHeight = totalRows * rowHeight;
14334
- const startRaw = Math.floor(scrollTop / rowHeight);
14335
- const visibleCount = Math.ceil(viewportHeight / rowHeight);
14336
- const start = Math.max(0, startRaw - overscan);
14337
- const end = Math.min(totalRows, startRaw + visibleCount + overscan);
14338
- const offsetTop = start * rowHeight;
15540
+ const totalHeight = safeTotalRows * safeRowHeight;
15541
+ const startRaw = Math.floor(safeScrollTop / safeRowHeight);
15542
+ const visibleCount = Math.ceil(safeViewportHeight / safeRowHeight);
15543
+ const start = Math.max(0, Math.min(safeTotalRows, startRaw - safeOverscan));
15544
+ const end = Math.max(start, Math.min(safeTotalRows, startRaw + visibleCount + safeOverscan));
15545
+ const offsetTop = start * safeRowHeight;
14339
15546
  return { start, end, offsetTop, totalHeight };
14340
15547
  }
15548
+ function calculateVirtualColumnRange(scrollLeft, viewportWidth, columnWidths, overscan = 2) {
15549
+ const count = columnWidths.length;
15550
+ if (count === 0 || viewportWidth <= 0) {
15551
+ return { start: 0, end: count, leftPad: 0, rightPad: 0 };
15552
+ }
15553
+ const safeScrollLeft = Math.max(0, Number.isFinite(scrollLeft) ? scrollLeft : 0);
15554
+ const safeOverscan = Math.max(0, Math.floor(overscan));
15555
+ let acc = 0;
15556
+ let rawStart = 0;
15557
+ for (let i = 0; i < count; i++) {
15558
+ if (acc + columnWidths[i] > safeScrollLeft) {
15559
+ rawStart = i;
15560
+ break;
15561
+ }
15562
+ acc += columnWidths[i];
15563
+ if (i === count - 1) rawStart = count - 1;
15564
+ }
15565
+ const viewEnd = safeScrollLeft + viewportWidth;
15566
+ let endExclusive = rawStart;
15567
+ let endAcc = acc;
15568
+ while (endExclusive < count && endAcc < viewEnd) {
15569
+ endAcc += columnWidths[endExclusive];
15570
+ endExclusive++;
15571
+ }
15572
+ const start = Math.max(0, rawStart - safeOverscan);
15573
+ const end = Math.min(count, endExclusive + safeOverscan);
15574
+ let leftPad = 0;
15575
+ for (let i = 0; i < start; i++) leftPad += columnWidths[i];
15576
+ let rightPad = 0;
15577
+ for (let i = end; i < count; i++) rightPad += columnWidths[i];
15578
+ return { start, end, leftPad, rightPad };
15579
+ }
14341
15580
  function getVirtualRowKey(row, index, rowKey) {
14342
15581
  if (!rowKey) return index;
14343
15582
  if (typeof rowKey === "function") return rowKey(row, index);
@@ -14424,8 +15663,14 @@ function shouldLoadMore(el, threshold, direction = "vertical", inverse = false)
14424
15663
  }
14425
15664
  function createInfiniteScrollObserver(sentinel, options) {
14426
15665
  if (typeof IntersectionObserver === "undefined") return null;
14427
- const { threshold = 100, direction = "vertical", root = null, onLoadMore } = options;
14428
- const rootMargin = direction === "horizontal" ? `0px ${threshold}px 0px 0px` : `0px 0px ${threshold}px 0px`;
15666
+ const {
15667
+ threshold = 100,
15668
+ direction = "vertical",
15669
+ root = null,
15670
+ inverse = false,
15671
+ onLoadMore
15672
+ } = options;
15673
+ const rootMargin = direction === "horizontal" ? inverse ? `0px 0px 0px ${threshold}px` : `0px ${threshold}px 0px 0px` : inverse ? `${threshold}px 0px 0px 0px` : `0px 0px ${threshold}px 0px`;
14429
15674
  const observer = new IntersectionObserver(
14430
15675
  (entries) => {
14431
15676
  const entry = entries[entries.length - 1];
@@ -14448,7 +15693,7 @@ function getInfiniteScrollContainerClasses(direction, className) {
14448
15693
  }
14449
15694
 
14450
15695
  // src/utils/file-manager-utils.ts
14451
- var fileManagerContainerClasses = "tiger-file-manager flex flex-col border border-[var(--tiger-border,#e5e7eb)] rounded-[var(--tiger-radius-md,0.5rem)] bg-[var(--tiger-bg,#ffffff)] overflow-hidden";
15696
+ var fileManagerContainerClasses = "tiger-file-manager relative flex flex-col border border-[var(--tiger-border,#e5e7eb)] rounded-[var(--tiger-radius-md,0.5rem)] bg-[var(--tiger-bg,#ffffff)] overflow-hidden";
14452
15697
  var fileManagerToolbarClasses = "flex items-center gap-2 px-3 py-2 border-b border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-bg-secondary,#f9fafb)]";
14453
15698
  var fileManagerBreadcrumbClasses = "flex items-center gap-1 text-sm text-[var(--tiger-text-secondary,#6b7280)]";
14454
15699
  var fileManagerBreadcrumbItemClasses = "cursor-pointer hover:text-[var(--tiger-primary,#2563eb)] transition-colors";
@@ -14498,18 +15743,10 @@ function filterHiddenFiles(items, showHidden) {
14498
15743
  return items.filter((item) => !item.name.startsWith("."));
14499
15744
  }
14500
15745
  function formatFileSizeLabel(bytes) {
14501
- if (bytes === void 0 || bytes === null) return "";
14502
- if (bytes === 0) return "0 B";
14503
- const units = ["B", "KB", "MB", "GB", "TB"];
14504
- const k = 1024;
14505
- const i = Math.floor(Math.log(bytes) / Math.log(k));
14506
- const size = bytes / Math.pow(k, i);
14507
- return `${size % 1 === 0 ? size : size.toFixed(1)} ${units[i]}`;
15746
+ return formatBytes(bytes, { precision: 1, trimTrailingZeros: true });
14508
15747
  }
14509
15748
  function getFileExtension2(name) {
14510
- const dot = name.lastIndexOf(".");
14511
- if (dot <= 0) return "";
14512
- return name.slice(dot + 1).toLowerCase();
15749
+ return getFileExtensionName(name);
14513
15750
  }
14514
15751
  function navigateToFolder(files, path) {
14515
15752
  let current = files;
@@ -14861,8 +16098,10 @@ function normalizeGanttDate(value) {
14861
16098
  return time;
14862
16099
  }
14863
16100
  function getGanttTaskAriaLabel(task) {
14864
- const start = formatGanttDate(new Date(normalizeGanttDate(task.start)), "day");
14865
- const end = formatGanttDate(new Date(normalizeGanttDate(task.end)), "day");
16101
+ const startMs = normalizeGanttDate(task.start);
16102
+ const endMs = normalizeGanttDate(task.end);
16103
+ const start = Number.isFinite(startMs) ? formatGanttDate(new Date(startMs), "day") : "unknown";
16104
+ const end = Number.isFinite(endMs) ? formatGanttDate(new Date(endMs), "day") : "unknown";
14866
16105
  const progress = typeof task.progress === "number" ? `, ${clampProgress(task.progress)}%` : "";
14867
16106
  return `${task.label}, ${start} to ${end}${progress}`;
14868
16107
  }
@@ -14875,19 +16114,28 @@ function getGanttDependencyPath(dependency) {
14875
16114
  }
14876
16115
  function computeGanttLayout(data, options = {}) {
14877
16116
  const {
14878
- width = 720,
14879
- rowHeight = 40,
14880
- barHeight = 18,
14881
- taskLabelWidth = 140,
14882
- timelineHeight = 36,
14883
- minBarWidth = 6,
16117
+ width: rawWidth = 720,
16118
+ rowHeight: rawRowHeight = 40,
16119
+ barHeight: rawBarHeight = 18,
16120
+ taskLabelWidth: rawTaskLabelWidth = 140,
16121
+ timelineHeight: rawTimelineHeight = 36,
16122
+ minBarWidth: rawMinBarWidth = 6,
14884
16123
  scale = "week",
14885
16124
  colors = DEFAULT_CHART_COLORS,
14886
16125
  dateFormatter
14887
16126
  } = options;
16127
+ const width = Number.isFinite(rawWidth) ? Math.max(0, rawWidth) : 0;
16128
+ const rowHeight = Number.isFinite(rawRowHeight) ? Math.max(0, rawRowHeight) : 0;
16129
+ const barHeight = Number.isFinite(rawBarHeight) ? Math.max(0, rawBarHeight) : 0;
16130
+ const taskLabelWidth = Number.isFinite(rawTaskLabelWidth) ? Math.max(0, rawTaskLabelWidth) : 0;
16131
+ const timelineHeight = Number.isFinite(rawTimelineHeight) ? Math.max(0, rawTimelineHeight) : 0;
16132
+ const minBarWidth = Number.isFinite(rawMinBarWidth) ? Math.max(0, rawMinBarWidth) : 0;
14888
16133
  if (data.length === 0) {
14889
- const minMs2 = normalizeGanttDate(options.minDate ?? Date.now());
14890
- const maxMs2 = normalizeGanttDate(options.maxDate ?? minMs2 + DAY_MS);
16134
+ const fallbackMin = Date.now();
16135
+ const rawMinMs2 = normalizeGanttDate(options.minDate ?? fallbackMin);
16136
+ const minMs2 = Number.isFinite(rawMinMs2) ? rawMinMs2 : fallbackMin;
16137
+ const rawMaxMs2 = normalizeGanttDate(options.maxDate ?? minMs2 + DAY_MS);
16138
+ const maxMs2 = Number.isFinite(rawMaxMs2) && rawMaxMs2 > minMs2 ? rawMaxMs2 : minMs2 + DAY_MS;
14891
16139
  return {
14892
16140
  tasks: [],
14893
16141
  dependencies: [],
@@ -14903,24 +16151,28 @@ function computeGanttLayout(data, options = {}) {
14903
16151
  const taskRanges = data.map((task) => {
14904
16152
  const rawStart = normalizeGanttDate(task.start);
14905
16153
  const rawEnd = normalizeGanttDate(task.end);
14906
- const startMs = Math.min(rawStart, rawEnd);
14907
- const endMs = Math.max(rawStart, rawEnd);
16154
+ const startFallback = Number.isFinite(rawEnd) ? rawEnd : Date.now();
16155
+ const endFallback = Number.isFinite(rawStart) ? rawStart : startFallback + DAY_MS;
16156
+ const safeStart = Number.isFinite(rawStart) ? rawStart : startFallback;
16157
+ const safeEnd = Number.isFinite(rawEnd) ? rawEnd : endFallback;
16158
+ const startMs = Math.min(safeStart, safeEnd);
16159
+ const endMs = Math.max(safeStart, safeEnd);
14908
16160
  return { task, startMs, endMs: endMs === startMs ? endMs + DAY_MS : endMs };
14909
16161
  });
14910
- const minMs = normalizeGanttDate(
14911
- options.minDate ?? Math.min(...taskRanges.map((item) => item.startMs))
14912
- );
14913
- const maxMs = normalizeGanttDate(
14914
- options.maxDate ?? Math.max(...taskRanges.map((item) => item.endMs))
14915
- );
16162
+ const inferredMinMs = Math.min(...taskRanges.map((item) => item.startMs));
16163
+ const inferredMaxMs = Math.max(...taskRanges.map((item) => item.endMs));
16164
+ const rawMinMs = normalizeGanttDate(options.minDate ?? inferredMinMs);
16165
+ const rawMaxMs = normalizeGanttDate(options.maxDate ?? inferredMaxMs);
16166
+ const minMs = Number.isFinite(rawMinMs) ? rawMinMs : inferredMinMs;
16167
+ const maxMs = Number.isFinite(rawMaxMs) ? rawMaxMs : inferredMaxMs;
14916
16168
  const safeMaxMs = maxMs > minMs ? maxMs : minMs + DAY_MS;
14917
16169
  const timelineWidth = Math.max(0, width - taskLabelWidth);
14918
16170
  const rangeMs = safeMaxMs - minMs;
14919
16171
  const xForTime = (time) => taskLabelWidth + (time - minMs) / rangeMs * timelineWidth;
14920
16172
  const tasks = taskRanges.map(({ task, startMs, endMs }, index) => {
14921
16173
  const x = xForTime(startMs);
14922
- const rawWidth = xForTime(endMs) - x;
14923
- const barWidth = Math.max(minBarWidth, rawWidth);
16174
+ const rawWidth2 = xForTime(endMs) - x;
16175
+ const barWidth = Math.max(minBarWidth, rawWidth2);
14924
16176
  return {
14925
16177
  id: task.id,
14926
16178
  task,
@@ -14973,15 +16225,19 @@ function computeGanttLayout(data, options = {}) {
14973
16225
  };
14974
16226
  }
14975
16227
  function createGanttTimelineTicks(minMs, maxMs, timelineWidth, taskLabelWidth, scale, formatter = formatGanttDate) {
16228
+ const safeMinMs = Number.isFinite(minMs) ? minMs : Date.now();
16229
+ const safeMaxMs = Number.isFinite(maxMs) && maxMs > safeMinMs ? maxMs : safeMinMs + DAY_MS;
16230
+ const safeTimelineWidth = Number.isFinite(timelineWidth) ? Math.max(0, timelineWidth) : 0;
16231
+ const safeTaskLabelWidth = Number.isFinite(taskLabelWidth) ? Math.max(0, taskLabelWidth) : 0;
14976
16232
  const ticks = [];
14977
- const rangeMs = Math.max(DAY_MS, maxMs - minMs);
14978
- let current = startOfTick(new Date(minMs), scale);
14979
- while (current.getTime() <= maxMs) {
16233
+ const rangeMs = Math.max(DAY_MS, safeMaxMs - safeMinMs);
16234
+ let current = startOfTick(new Date(safeMinMs), scale);
16235
+ while (current.getTime() <= safeMaxMs) {
14980
16236
  const currentMs = current.getTime();
14981
- if (currentMs >= minMs) {
16237
+ if (currentMs >= safeMinMs) {
14982
16238
  ticks.push({
14983
16239
  value: new Date(currentMs),
14984
- x: taskLabelWidth + (currentMs - minMs) / rangeMs * timelineWidth,
16240
+ x: safeTaskLabelWidth + (currentMs - safeMinMs) / rangeMs * safeTimelineWidth,
14985
16241
  label: formatter(new Date(currentMs), scale)
14986
16242
  });
14987
16243
  }
@@ -14989,8 +16245,8 @@ function createGanttTimelineTicks(minMs, maxMs, timelineWidth, taskLabelWidth, s
14989
16245
  if (ticks.length > 64) break;
14990
16246
  }
14991
16247
  if (ticks.length === 0) {
14992
- const date = new Date(minMs);
14993
- ticks.push({ value: date, x: taskLabelWidth, label: formatter(date, scale) });
16248
+ const date = new Date(safeMinMs);
16249
+ ticks.push({ value: date, x: safeTaskLabelWidth, label: formatter(date, scale) });
14994
16250
  }
14995
16251
  return ticks;
14996
16252
  }
@@ -15277,6 +16533,7 @@ function getChartSvgDataUrl(svg) {
15277
16533
  return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(serializeChartSvg(svg))}`;
15278
16534
  }
15279
16535
  function downloadChartSvg(svg, filename = "chart") {
16536
+ if (!isBrowser()) return;
15280
16537
  downloadChartBlob(
15281
16538
  new Blob([serializeChartSvg(svg)], { type: "image/svg+xml;charset=utf-8" }),
15282
16539
  `${filename}.svg`
@@ -15316,6 +16573,7 @@ async function exportChartPng(svg, options = {}) {
15316
16573
  });
15317
16574
  }
15318
16575
  async function downloadChartPng(svg, options = {}) {
16576
+ if (!isBrowser()) return;
15319
16577
  const blob = await exportChartPng(svg, options);
15320
16578
  downloadChartBlob(blob, `${options.filename ?? "chart"}.png`);
15321
16579
  }
@@ -15386,16 +16644,16 @@ var imageViewerNavBtnClasses = "fixed top-1/2 -translate-y-1/2 z-50 p-3 text-whi
15386
16644
  var imageViewerCloseBtnClasses = "fixed top-4 right-4 z-50 p-2 text-white hover:bg-white/20 rounded-[var(--tiger-radius-md,0.5rem)] transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white";
15387
16645
  var imageViewerCounterClasses = "fixed top-4 left-1/2 -translate-x-1/2 z-50 text-white text-sm bg-[var(--tiger-surface,rgba(0,0,0,0.4))] rounded-full px-3 py-1";
15388
16646
  var imageViewerIcons = {
15389
- zoomIn: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v6m3-3H7",
15390
- zoomOut: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM13 10H7",
16647
+ zoomIn: zoomInIconPath,
16648
+ zoomOut: zoomOutIconPath,
15391
16649
  rotateLeft: "M3 10h7V3M21 14h-7v7M16.7 7.3A8 8 0 004.1 9.9M7.3 16.7A8 8 0 0019.9 14.1",
15392
16650
  rotateRight: "M14 10h7V3M10 14H3v7M7.3 7.3A8 8 0 0119.9 9.9M16.7 16.7A8 8 0 014.1 14.1",
15393
- close: "M6 18L18 6M6 6l12 12",
15394
- prev: "M15 19l-7-7 7-7",
15395
- next: "M9 5l7 7-7 7"
16651
+ close: previewCloseIconPath,
16652
+ prev: prevIconPath,
16653
+ next: nextIconPath
15396
16654
  };
15397
16655
  function clampZoom(zoom, min, max) {
15398
- return Math.min(max, Math.max(min, zoom));
16656
+ return clampScale(zoom, min, max);
15399
16657
  }
15400
16658
  function normalizeRotation(rotation) {
15401
16659
  return (rotation % 360 + 360) % 360;
@@ -15429,24 +16687,19 @@ function movePan(pan, clientX, clientY) {
15429
16687
  translateY: pan.startTranslateY + (clientY - pan.startY)
15430
16688
  };
15431
16689
  }
15432
- function touchDistance(t1, t2) {
15433
- const dx = t1.clientX - t2.clientX;
15434
- const dy = t1.clientY - t2.clientY;
15435
- return Math.sqrt(dx * dx + dy * dy);
15436
- }
15437
16690
  function createPinchState() {
15438
16691
  return { isPinching: false, initialDistance: 0, initialScale: 1 };
15439
16692
  }
15440
16693
  function startPinch(t1, t2, currentScale) {
15441
16694
  return {
15442
16695
  isPinching: true,
15443
- initialDistance: touchDistance(t1, t2),
16696
+ initialDistance: getTouchDistance(t1, t2),
15444
16697
  initialScale: currentScale
15445
16698
  };
15446
16699
  }
15447
16700
  function movePinch(pinch, t1, t2, minZoom, maxZoom) {
15448
16701
  if (pinch.initialDistance === 0) return pinch.initialScale;
15449
- const currentDistance = touchDistance(t1, t2);
16702
+ const currentDistance = getTouchDistance(t1, t2);
15450
16703
  const ratio = currentDistance / pinch.initialDistance;
15451
16704
  return clampZoom(pinch.initialScale * ratio, minZoom, maxZoom);
15452
16705
  }
@@ -15492,7 +16745,7 @@ async function getCropperResult(cropper) {
15492
16745
  return await cropper.getCropResult();
15493
16746
  }
15494
16747
 
15495
- // src/theme/checkbox.ts
16748
+ // src/theme-runtime/checkbox.ts
15496
16749
  var checkboxSizeClasses2 = {
15497
16750
  sm: "w-4 h-4",
15498
16751
  md: "w-5 h-5",
@@ -15517,7 +16770,7 @@ function getCheckboxLabelClasses(size = "md", disabled = false) {
15517
16770
  return [baseClasses2, sizeClass, disabledClasses].filter(Boolean).join(" ");
15518
16771
  }
15519
16772
 
15520
- // src/theme/switch.ts
16773
+ // src/theme-runtime/switch.ts
15521
16774
  var switchBaseClasses = "relative inline-flex items-center rounded-full transition-all duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--tiger-focus-ring,var(--tiger-primary,#2563eb))] active:scale-[0.98]";
15522
16775
  var switchSizeClasses = {
15523
16776
  sm: "h-5 w-9",
@@ -15552,7 +16805,7 @@ function getSwitchThumbClasses(size = "md", checked = false) {
15552
16805
  return classNames(baseClasses2, sizeClass, translateClass);
15553
16806
  }
15554
16807
 
15555
- // src/theme/slider.ts
16808
+ // src/theme-runtime/slider.ts
15556
16809
  var sliderBaseClasses = "relative w-full";
15557
16810
  var sliderTrackClasses = "bg-[var(--tiger-border,#e5e7eb)] rounded-full";
15558
16811
  var sliderRangeClasses = "bg-[var(--tiger-primary,#2563eb)] rounded-full absolute h-full";
@@ -15591,7 +16844,7 @@ function getSliderTooltipClasses(size = "md") {
15591
16844
  return [sliderTooltipClasses, sizeClass].filter(Boolean).join(" ");
15592
16845
  }
15593
16846
 
15594
- // src/theme/index.ts
16847
+ // src/theme-runtime/index.ts
15595
16848
  var THEME_CSS_VARS = {
15596
16849
  // Primary colors
15597
16850
  primary: "--tiger-primary",
@@ -15829,78 +17082,108 @@ var MODERN_REDUCED_MOTION_TOKENS = {
15829
17082
  "--tiger-transition-emphasized": "transform 0ms linear"
15830
17083
  };
15831
17084
 
15832
- // src/tailwind-plugin.ts
15833
- var tigercatTheme = {
15834
- // Primary
15835
- "--tiger-primary": "#2563eb",
15836
- "--tiger-primary-hover": "#1d4ed8",
15837
- "--tiger-primary-active": "#1e40af",
15838
- "--tiger-primary-disabled": "#93c5fd",
15839
- // Secondary
15840
- "--tiger-secondary": "#4b5563",
15841
- "--tiger-secondary-hover": "#374151",
15842
- "--tiger-secondary-active": "#1f2937",
15843
- "--tiger-secondary-disabled": "#9ca3af",
15844
- // Background hover states
15845
- "--tiger-outline-bg-hover": "#eff6ff",
15846
- "--tiger-ghost-bg-hover": "#eff6ff",
15847
- // Interaction
15848
- "--tiger-focus-ring": "#2563eb",
15849
- // Surface & background
15850
- "--tiger-surface": "#ffffff",
15851
- "--tiger-surface-muted": "#f9fafb",
15852
- "--tiger-surface-raised": "#ffffff",
15853
- // Text
15854
- "--tiger-text": "#111827",
15855
- "--tiger-text-secondary": "#6b7280",
15856
- "--tiger-text-disabled": "#d1d5db",
15857
- // Border
15858
- "--tiger-border": "#e5e7eb",
15859
- "--tiger-border-strong": "#9ca3af",
15860
- // Status
15861
- "--tiger-success": "#16a34a",
15862
- "--tiger-warning": "#d97706",
15863
- "--tiger-error": "#dc2626",
15864
- "--tiger-info": "#3b82f6",
15865
- // Chart palette
15866
- "--tiger-chart-1": "#2563eb",
15867
- "--tiger-chart-2": "#16a34a",
15868
- "--tiger-chart-3": "#d97706",
15869
- "--tiger-chart-4": "#a855f7",
15870
- "--tiger-chart-5": "#0ea5e9",
15871
- "--tiger-chart-6": "#ef4444"
17085
+ // src/themes/default/theme.ts
17086
+ var defaultThemeLightColors = {
17087
+ primary: "#2563eb",
17088
+ primaryHover: "#1d4ed8",
17089
+ primaryActive: "#1e40af",
17090
+ primaryDisabled: "#93c5fd",
17091
+ secondary: "#4b5563",
17092
+ secondaryHover: "#374151",
17093
+ secondaryActive: "#1f2937",
17094
+ secondaryDisabled: "#9ca3af",
17095
+ outlineBgHover: "#eff6ff",
17096
+ ghostBgHover: "#eff6ff",
17097
+ focusRing: "#2563eb",
17098
+ surface: "#ffffff",
17099
+ surfaceMuted: "#f9fafb",
17100
+ surfaceRaised: "#ffffff",
17101
+ text: "#111827",
17102
+ textSecondary: "#6b7280",
17103
+ textDisabled: "#d1d5db",
17104
+ border: "#e5e7eb",
17105
+ borderStrong: "#9ca3af",
17106
+ success: "#16a34a",
17107
+ warning: "#d97706",
17108
+ error: "#dc2626",
17109
+ info: "#3b82f6",
17110
+ chart1: "#2563eb",
17111
+ chart2: "#16a34a",
17112
+ chart3: "#d97706",
17113
+ chart4: "#a855f7",
17114
+ chart5: "#0ea5e9",
17115
+ chart6: "#ef4444"
15872
17116
  };
15873
- var tigercatDarkTheme = {
15874
- "--tiger-primary": "#60a5fa",
15875
- "--tiger-primary-hover": "#93c5fd",
15876
- "--tiger-primary-active": "#bfdbfe",
15877
- "--tiger-primary-disabled": "#1e40af",
15878
- "--tiger-secondary": "#9ca3af",
15879
- "--tiger-secondary-hover": "#d1d5db",
15880
- "--tiger-secondary-active": "#e5e7eb",
15881
- "--tiger-secondary-disabled": "#4b5563",
15882
- "--tiger-outline-bg-hover": "#1e3a5f",
15883
- "--tiger-ghost-bg-hover": "#1e3a5f",
15884
- "--tiger-focus-ring": "#60a5fa",
15885
- "--tiger-surface": "#111827",
15886
- "--tiger-surface-muted": "#1f2937",
15887
- "--tiger-surface-raised": "#1f2937",
15888
- "--tiger-text": "#f9fafb",
15889
- "--tiger-text-secondary": "#d1d5db",
15890
- "--tiger-text-disabled": "#4b5563",
15891
- "--tiger-border": "#374151",
15892
- "--tiger-border-strong": "#6b7280",
15893
- "--tiger-success": "#4ade80",
15894
- "--tiger-warning": "#fbbf24",
15895
- "--tiger-error": "#f87171",
15896
- "--tiger-info": "#60a5fa",
15897
- "--tiger-chart-1": "#60a5fa",
15898
- "--tiger-chart-2": "#4ade80",
15899
- "--tiger-chart-3": "#fbbf24",
15900
- "--tiger-chart-4": "#c084fc",
15901
- "--tiger-chart-5": "#38bdf8",
15902
- "--tiger-chart-6": "#f87171"
17117
+ var defaultThemeDarkColors = {
17118
+ primary: "#60a5fa",
17119
+ primaryHover: "#93c5fd",
17120
+ primaryActive: "#bfdbfe",
17121
+ primaryDisabled: "#1e40af",
17122
+ secondary: "#9ca3af",
17123
+ secondaryHover: "#d1d5db",
17124
+ secondaryActive: "#e5e7eb",
17125
+ secondaryDisabled: "#4b5563",
17126
+ outlineBgHover: "#1e3a5f",
17127
+ ghostBgHover: "#1e3a5f",
17128
+ focusRing: "#60a5fa",
17129
+ surface: "#111827",
17130
+ surfaceMuted: "#1f2937",
17131
+ surfaceRaised: "#1f2937",
17132
+ text: "#f9fafb",
17133
+ textSecondary: "#d1d5db",
17134
+ textDisabled: "#4b5563",
17135
+ border: "#374151",
17136
+ borderStrong: "#6b7280",
17137
+ success: "#4ade80",
17138
+ warning: "#fbbf24",
17139
+ error: "#f87171",
17140
+ info: "#60a5fa",
17141
+ chart1: "#60a5fa",
17142
+ chart2: "#4ade80",
17143
+ chart3: "#fbbf24",
17144
+ chart4: "#c084fc",
17145
+ chart5: "#38bdf8",
17146
+ chart6: "#f87171"
17147
+ };
17148
+ var defaultTheme = {
17149
+ name: "default",
17150
+ label: "Default",
17151
+ light: {
17152
+ colors: defaultThemeLightColors,
17153
+ radius: { sm: "4px", md: "6px", lg: "10px", xl: "14px", none: "0", full: "9999px" },
17154
+ shadows: {
17155
+ xs: "0 1px 2px 0 rgba(0,0,0,0.05)",
17156
+ sm: "0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",
17157
+ md: "0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",
17158
+ lg: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",
17159
+ xl: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
17160
+ }
17161
+ },
17162
+ dark: {
17163
+ colors: defaultThemeDarkColors,
17164
+ shadows: {
17165
+ xs: "0 1px 2px 0 rgba(0,0,0,0.2)",
17166
+ sm: "0 1px 3px 0 rgba(0,0,0,0.3), 0 1px 2px -1px rgba(0,0,0,0.25)",
17167
+ md: "0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.25)",
17168
+ lg: "0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -4px rgba(0,0,0,0.25)",
17169
+ xl: "0 20px 25px -5px rgba(0,0,0,0.3), 0 8px 10px -6px rgba(0,0,0,0.25)"
17170
+ }
17171
+ }
15903
17172
  };
17173
+
17174
+ // src/tailwind-plugin.ts
17175
+ function presetToVars(colors) {
17176
+ const vars = {};
17177
+ for (const [key, value] of Object.entries(colors)) {
17178
+ const varName = THEME_CSS_VARS[key];
17179
+ if (varName && value) {
17180
+ vars[varName] = value;
17181
+ }
17182
+ }
17183
+ return vars;
17184
+ }
17185
+ var tigercatTheme = presetToVars(defaultThemeLightColors);
17186
+ var tigercatDarkTheme = presetToVars(defaultThemeDarkColors);
15904
17187
  var tigercatDirectionBase = {
15905
17188
  '[dir="rtl"] .tiger-rtl-mirror, [data-tiger-dir="rtl"] .tiger-rtl-mirror': {
15906
17189
  transform: "scaleX(-1)"
@@ -15939,16 +17222,6 @@ var tigercatPlugin = plugin(function({ addBase }) {
15939
17222
  ...tigercatReducedMotionBase
15940
17223
  });
15941
17224
  });
15942
- function presetToVars(colors) {
15943
- const vars = {};
15944
- for (const [key, value] of Object.entries(colors)) {
15945
- const varName = THEME_CSS_VARS[key];
15946
- if (varName && value) {
15947
- vars[varName] = value;
15948
- }
15949
- }
15950
- return vars;
15951
- }
15952
17225
  function createTigercatPlugin(options = {}) {
15953
17226
  return plugin(function({ addBase }) {
15954
17227
  const preset = options.preset;
@@ -15973,18 +17246,77 @@ function createTigercatPlugin(options = {}) {
15973
17246
  }
15974
17247
 
15975
17248
  // src/themes/manager.ts
15976
- function applyColors(colors, target) {
17249
+ var THEME_CONFIG_CSS_VARS = {
17250
+ typography: {
17251
+ fontFamily: "--tiger-font-family",
17252
+ fontFamilyMono: "--tiger-font-family-mono",
17253
+ fontSizeBase: "--tiger-font-size-base",
17254
+ fontSizeSm: "--tiger-font-size-sm",
17255
+ fontSizeLg: "--tiger-font-size-lg",
17256
+ fontWeightNormal: "--tiger-font-weight-normal",
17257
+ fontWeightMedium: "--tiger-font-weight-medium",
17258
+ fontWeightSemibold: "--tiger-font-weight-semibold",
17259
+ fontWeightBold: "--tiger-font-weight-bold",
17260
+ lineHeightNormal: "--tiger-line-height-normal",
17261
+ lineHeightTight: "--tiger-line-height-tight"
17262
+ },
17263
+ radius: {
17264
+ none: "--tiger-radius-none",
17265
+ sm: "--tiger-radius-sm",
17266
+ md: "--tiger-radius-md",
17267
+ lg: "--tiger-radius-lg",
17268
+ xl: "--tiger-radius-xl",
17269
+ full: "--tiger-radius-full"
17270
+ },
17271
+ shadows: {
17272
+ xs: "--tiger-shadow-xs",
17273
+ sm: "--tiger-shadow-sm",
17274
+ md: "--tiger-shadow-md",
17275
+ lg: "--tiger-shadow-lg",
17276
+ xl: "--tiger-shadow-xl"
17277
+ },
17278
+ spacing: {
17279
+ xs: "--tiger-spacing-xs",
17280
+ sm: "--tiger-spacing-sm",
17281
+ md: "--tiger-spacing-md",
17282
+ lg: "--tiger-spacing-lg",
17283
+ xl: "--tiger-spacing-xl"
17284
+ },
17285
+ motion: {
17286
+ durationFast: "--tiger-duration-fast",
17287
+ durationBase: "--tiger-duration-base",
17288
+ durationSlow: "--tiger-duration-slow",
17289
+ easing: "--tiger-easing"
17290
+ }
17291
+ };
17292
+ function themeConfigToCssVars(config) {
15977
17293
  const vars = {};
15978
- for (const [key, value] of Object.entries(colors)) {
15979
- const varName = THEME_CSS_VARS[key];
15980
- if (varName && value) {
15981
- vars[varName] = value;
17294
+ if (config.colors) {
17295
+ for (const [key, value] of Object.entries(config.colors)) {
17296
+ const varName = THEME_CSS_VARS[key];
17297
+ if (varName && value) vars[varName] = value;
15982
17298
  }
15983
17299
  }
15984
- setCssVarsCached(target, vars);
17300
+ for (const section of ["typography", "radius", "shadows", "spacing", "motion"]) {
17301
+ const values = config[section];
17302
+ if (!values) continue;
17303
+ const varNames = THEME_CONFIG_CSS_VARS[section];
17304
+ for (const [key, value] of Object.entries(values)) {
17305
+ const varName = varNames[key];
17306
+ if (varName && value) vars[varName] = value;
17307
+ }
17308
+ }
17309
+ return vars;
15985
17310
  }
15986
- function clearColors(target) {
15987
- removeCssVarsCached(target, Object.values(THEME_CSS_VARS));
17311
+ function clearThemeConfig(target) {
17312
+ removeCssVarsCached(target, [
17313
+ ...Object.values(THEME_CSS_VARS),
17314
+ ...Object.values(THEME_CONFIG_CSS_VARS.typography),
17315
+ ...Object.values(THEME_CONFIG_CSS_VARS.radius),
17316
+ ...Object.values(THEME_CONFIG_CSS_VARS.shadows),
17317
+ ...Object.values(THEME_CONFIG_CSS_VARS.spacing),
17318
+ ...Object.values(THEME_CONFIG_CSS_VARS.motion)
17319
+ ]);
15988
17320
  }
15989
17321
  function resolveSystemDark() {
15990
17322
  if (!isBrowser()) return false;
@@ -16081,12 +17413,10 @@ var ThemeManagerImpl = class {
16081
17413
  if (!isBrowser()) return;
16082
17414
  const root = document.documentElement;
16083
17415
  const preset = this.presets.get(this.currentThemeName);
16084
- clearColors(root);
17416
+ clearThemeConfig(root);
16085
17417
  if (preset) {
16086
17418
  const config = this.resolvedDark ? preset.dark : preset.light;
16087
- if (config.colors) {
16088
- applyColors(config.colors, root);
16089
- }
17419
+ setCssVarsCached(root, themeConfigToCssVars(config));
16090
17420
  }
16091
17421
  if (this.resolvedDark) {
16092
17422
  root.classList.add("dark");
@@ -16125,93 +17455,6 @@ var ThemeManagerImpl = class {
16125
17455
  };
16126
17456
  var ThemeManager = new ThemeManagerImpl();
16127
17457
 
16128
- // src/themes/default/theme.ts
16129
- var defaultTheme = {
16130
- name: "default",
16131
- label: "Default",
16132
- light: {
16133
- colors: {
16134
- primary: "#2563eb",
16135
- primaryHover: "#1d4ed8",
16136
- primaryActive: "#1e40af",
16137
- primaryDisabled: "#93c5fd",
16138
- secondary: "#4b5563",
16139
- secondaryHover: "#374151",
16140
- secondaryActive: "#1f2937",
16141
- secondaryDisabled: "#9ca3af",
16142
- outlineBgHover: "#eff6ff",
16143
- ghostBgHover: "#eff6ff",
16144
- focusRing: "#2563eb",
16145
- surface: "#ffffff",
16146
- surfaceMuted: "#f9fafb",
16147
- surfaceRaised: "#ffffff",
16148
- text: "#111827",
16149
- textSecondary: "#6b7280",
16150
- textDisabled: "#d1d5db",
16151
- border: "#e5e7eb",
16152
- borderStrong: "#9ca3af",
16153
- success: "#16a34a",
16154
- warning: "#d97706",
16155
- error: "#dc2626",
16156
- info: "#3b82f6",
16157
- chart1: "#2563eb",
16158
- chart2: "#16a34a",
16159
- chart3: "#d97706",
16160
- chart4: "#a855f7",
16161
- chart5: "#0ea5e9",
16162
- chart6: "#ef4444"
16163
- },
16164
- radius: { sm: "4px", md: "6px", lg: "10px", xl: "14px", none: "0", full: "9999px" },
16165
- shadows: {
16166
- xs: "0 1px 2px 0 rgba(0,0,0,0.05)",
16167
- sm: "0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",
16168
- md: "0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",
16169
- lg: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",
16170
- xl: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
16171
- }
16172
- },
16173
- dark: {
16174
- colors: {
16175
- primary: "#60a5fa",
16176
- primaryHover: "#93c5fd",
16177
- primaryActive: "#bfdbfe",
16178
- primaryDisabled: "#1e40af",
16179
- secondary: "#9ca3af",
16180
- secondaryHover: "#d1d5db",
16181
- secondaryActive: "#e5e7eb",
16182
- secondaryDisabled: "#4b5563",
16183
- outlineBgHover: "#1e3a5f",
16184
- ghostBgHover: "#1e3a5f",
16185
- focusRing: "#60a5fa",
16186
- surface: "#111827",
16187
- surfaceMuted: "#1f2937",
16188
- surfaceRaised: "#1f2937",
16189
- text: "#f9fafb",
16190
- textSecondary: "#d1d5db",
16191
- textDisabled: "#4b5563",
16192
- border: "#374151",
16193
- borderStrong: "#6b7280",
16194
- success: "#4ade80",
16195
- warning: "#fbbf24",
16196
- error: "#f87171",
16197
- info: "#60a5fa",
16198
- chart1: "#60a5fa",
16199
- chart2: "#4ade80",
16200
- chart3: "#fbbf24",
16201
- chart4: "#c084fc",
16202
- chart5: "#38bdf8",
16203
- chart6: "#f87171"
16204
- },
16205
- shadows: {
16206
- xs: "0 1px 2px 0 rgba(0,0,0,0.2)",
16207
- sm: "0 1px 3px 0 rgba(0,0,0,0.3), 0 1px 2px -1px rgba(0,0,0,0.25)",
16208
- md: "0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.25)",
16209
- lg: "0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -4px rgba(0,0,0,0.25)",
16210
- xl: "0 20px 25px -5px rgba(0,0,0,0.3), 0 8px 10px -6px rgba(0,0,0,0.25)"
16211
- }
16212
- }
16213
- };
16214
-
16215
17458
  // src/themes/vibrant/theme.ts
16216
17459
  var vibrantTheme = {
16217
17460
  name: "vibrant",
@@ -17154,7 +18397,7 @@ var designTokens = {
17154
18397
  };
17155
18398
 
17156
18399
  // src/index.ts
17157
- var version = "1.2.0";
18400
+ var version = "1.5.0";
17158
18401
  export {
17159
18402
  ANIMATION_DURATION_FAST_MS,
17160
18403
  ANIMATION_DURATION_MS,
@@ -17168,15 +18411,26 @@ export {
17168
18411
  ChevronRightIconPath,
17169
18412
  ClockIconPath,
17170
18413
  CloseIconPath,
18414
+ DEFAULT_CALENDAR_LABELS,
17171
18415
  DEFAULT_CHART_COLORS,
18416
+ DEFAULT_FILE_MANAGER_LABELS,
18417
+ DEFAULT_FORM_VALIDATION_LABELS,
17172
18418
  DEFAULT_FORM_WIZARD_LABELS,
17173
18419
  DEFAULT_HEATMAP_CANVAS_THRESHOLD,
18420
+ DEFAULT_IMAGE_EDITOR_LABELS,
18421
+ DEFAULT_IMAGE_VIEWER_LABELS,
17174
18422
  DEFAULT_PAGINATION_LABELS,
18423
+ DEFAULT_STATUS_LABELS,
17175
18424
  DEFAULT_TABLE_LABELS,
17176
18425
  DEFAULT_TASK_BOARD_LABELS,
18426
+ DEFAULT_TIME_PICKER_LABELS,
18427
+ DEFAULT_TOUR_LABELS,
17177
18428
  DEFAULT_UPLOAD_CHUNK_SIZE,
18429
+ DEFAULT_UPLOAD_LABELS,
17178
18430
  DONUT_BASE_SHADOW,
17179
18431
  DONUT_EMPHASIS_SHADOW,
18432
+ DONUT_ENTRANCE_CLASS,
18433
+ DONUT_ENTRANCE_KEYFRAMES,
17180
18434
  DROPDOWN_CHEVRON_PATH,
17181
18435
  DROPDOWN_ENTER_CLASS,
17182
18436
  DURATION_CLASS,
@@ -17187,7 +18441,7 @@ export {
17187
18441
  EASING_LEAVE,
17188
18442
  EASING_SMOOTH,
17189
18443
  EASING_SPRING,
17190
- EN_US_DATEPICKER_LOCALE,
18444
+ EN_US_DATEPICKER_LOCALE2 as EN_US_DATEPICKER_LOCALE,
17191
18445
  FLOATING_OVERLAY_Z_INDEX,
17192
18446
  FORM_VALIDATION_PRESETS,
17193
18447
  GAUGE_ANIMATION_DURATION_MS,
@@ -17206,6 +18460,7 @@ export {
17206
18460
  POPOVER_TEXT_CLASSES,
17207
18461
  POPOVER_TITLE_CLASSES,
17208
18462
  RADAR_SPLIT_AREA_COLORS,
18463
+ RESIZE_KEYBOARD_STEP,
17209
18464
  SCATTER_ENTRANCE_CLASS,
17210
18465
  SCATTER_ENTRANCE_KEYFRAMES,
17211
18466
  SHAKE_CLASS,
@@ -17220,6 +18475,7 @@ export {
17220
18475
  SVG_PATH_ANIMATION_CSS,
17221
18476
  TABLE_AUTO_VIRTUAL_THRESHOLD,
17222
18477
  TABLE_VIRTUAL_RECOMMENDATION_THRESHOLD,
18478
+ THEME_CONFIG_CSS_VARS,
17223
18479
  THEME_CSS_VARS,
17224
18480
  TIGER_BREAKPOINT_CSS_VALUES,
17225
18481
  TIGER_VIEWPORT_BREAKPOINTS,
@@ -17231,11 +18487,20 @@ export {
17231
18487
  TimePickerCloseIconPath,
17232
18488
  VIEW_TRANSITION_CSS,
17233
18489
  WEEKDAYS,
17234
- ZH_CN_DATEPICKER_LOCALE,
18490
+ ZH_CN_CALENDAR_LABELS,
18491
+ ZH_CN_DATEPICKER_LOCALE2 as ZH_CN_DATEPICKER_LOCALE,
18492
+ ZH_CN_FILE_MANAGER_LABELS,
18493
+ ZH_CN_FORM_VALIDATION_LABELS,
17235
18494
  ZH_CN_FORM_WIZARD_LABELS,
18495
+ ZH_CN_IMAGE_EDITOR_LABELS,
18496
+ ZH_CN_IMAGE_VIEWER_LABELS,
17236
18497
  ZH_CN_PAGINATION_LABELS,
18498
+ ZH_CN_STATUS_LABELS,
17237
18499
  ZH_CN_TABLE_LABELS,
17238
18500
  ZH_CN_TASK_BOARD_LABELS,
18501
+ ZH_CN_TIME_PICKER_LABELS,
18502
+ ZH_CN_TOUR_LABELS,
18503
+ ZH_CN_UPLOAD_LABELS,
17239
18504
  activeOpacityClasses,
17240
18505
  activePressClasses,
17241
18506
  activityItemActionsClasses,
@@ -17245,6 +18510,9 @@ export {
17245
18510
  activityItemHeaderClasses,
17246
18511
  activityItemLayoutClasses,
17247
18512
  activityItemTitleGroupClasses,
18513
+ addDays,
18514
+ addMonths,
18515
+ addYears,
17248
18516
  affixWrapperClasses,
17249
18517
  alertBannerClasses,
17250
18518
  alertBaseClasses,
@@ -17341,6 +18609,7 @@ export {
17341
18609
  calculateResizeDelta,
17342
18610
  calculateStepStatus,
17343
18611
  calculateTransform,
18612
+ calculateVirtualColumnRange,
17344
18613
  calculateVirtualRange,
17345
18614
  calendarHeaderClasses,
17346
18615
  calendarNavButtonClasses,
@@ -17392,6 +18661,7 @@ export {
17392
18661
  chartCanvasBaseClasses,
17393
18662
  chartGridLineClasses,
17394
18663
  chartInteractiveClasses,
18664
+ chatStatusBarBaseClasses,
17395
18665
  checkSolidIcon20PathD,
17396
18666
  checkboxLabelSizeClasses,
17397
18667
  checkboxSizeClasses2 as checkboxSizeClasses,
@@ -17430,6 +18700,8 @@ export {
17430
18700
  codeBlockCopyButtonBaseClasses,
17431
18701
  codeBlockCopyButtonCopiedClasses,
17432
18702
  codeBlockPreClasses,
18703
+ codeEditorActiveLineDarkClasses,
18704
+ codeEditorActiveLineLightClasses,
17433
18705
  codeEditorBaseClasses,
17434
18706
  codeEditorDarkClasses,
17435
18707
  codeEditorDisabledClasses,
@@ -17524,6 +18796,7 @@ export {
17524
18796
  createImageAnnotationBox,
17525
18797
  createImageAnnotationPath,
17526
18798
  createInfiniteScrollObserver,
18799
+ createInstanceCounter,
17527
18800
  createLinePath,
17528
18801
  createLinearScale,
17529
18802
  createLongPressController,
@@ -17634,6 +18907,7 @@ export {
17634
18907
  downloadCsv,
17635
18908
  downloadExcel,
17636
18909
  downloadTableExport,
18910
+ downsampleSeriesData,
17637
18911
  drawSignatureStrokes,
17638
18912
  dynamicSizeStrategy,
17639
18913
  easeOutCubic2 as easeOutCubic,
@@ -17684,6 +18958,7 @@ export {
17684
18958
  filterHiddenFiles,
17685
18959
  filterMenuItems,
17686
18960
  filterOptions,
18961
+ filterTableData,
17687
18962
  filterTransferItems,
17688
18963
  filterTreeNodes,
17689
18964
  filterTreeSelectNodes,
@@ -17719,8 +18994,10 @@ export {
17719
18994
  focusMenuEdge,
17720
18995
  focusRingClasses,
17721
18996
  focusRingInsetClasses,
18997
+ focusTimePickerOption,
17722
18998
  formatActivityTime,
17723
18999
  formatBadgeContent,
19000
+ formatBytes,
17724
19001
  formatChatTime,
17725
19002
  formatColorString,
17726
19003
  formatCommentTime,
@@ -17730,6 +19007,7 @@ export {
17730
19007
  formatFileSize,
17731
19008
  formatFileSizeLabel,
17732
19009
  formatGanttDate,
19010
+ formatInputNumberDisplay,
17733
19011
  formatIntlNumber,
17734
19012
  formatMonthYear,
17735
19013
  formatPageAriaLabel,
@@ -17761,6 +19039,7 @@ export {
17761
19039
  getAccessibleTransitionClasses,
17762
19040
  getActiveElement,
17763
19041
  getActiveIndex,
19042
+ getActiveLineIndex,
17764
19043
  getActiveTourStepPosition,
17765
19044
  getActiveTourSteps,
17766
19045
  getAlertIconPath,
@@ -17798,6 +19077,7 @@ export {
17798
19077
  getCalendarContainerClasses,
17799
19078
  getCalendarDayClasses,
17800
19079
  getCalendarDays,
19080
+ getCalendarLabels,
17801
19081
  getCalendarMonthClasses,
17802
19082
  getCalendarMonthDaysCacheSize,
17803
19083
  getCardClasses,
@@ -17824,6 +19104,7 @@ export {
17824
19104
  getChartSvgDataUrl,
17825
19105
  getChartTooltipTransform,
17826
19106
  getChatMessageStatusInfo,
19107
+ getChatStatusBarClasses,
17827
19108
  getCheckboxCellClasses,
17828
19109
  getCheckboxClasses,
17829
19110
  getCheckboxLabelClasses,
@@ -17831,6 +19112,7 @@ export {
17831
19112
  getCircleSize,
17832
19113
  getCodeBlockContainerClasses,
17833
19114
  getCodeBlockCopyButtonClasses,
19115
+ getCodeEditorActiveLineClasses,
17834
19116
  getCodeEditorContainerClasses,
17835
19117
  getColGutterClasses,
17836
19118
  getColMergedStyleVars,
@@ -17865,6 +19147,8 @@ export {
17865
19147
  getCropperResult,
17866
19148
  getCurrentActiveTourStep,
17867
19149
  getCurrentTime,
19150
+ getCyclicIndex,
19151
+ getDatePickerCalendarCellState,
17868
19152
  getDatePickerDayCellClasses,
17869
19153
  getDatePickerIconButtonClasses,
17870
19154
  getDatePickerInputClasses,
@@ -17912,10 +19196,13 @@ export {
17912
19196
  getFieldDependencies,
17913
19197
  getFieldError,
17914
19198
  getFileExtension2 as getFileExtension,
19199
+ getFileExtensionName,
17915
19200
  getFileItemClasses,
17916
19201
  getFileListItemClasses,
17917
19202
  getFileManagerContainerClasses,
19203
+ getFileManagerLabels,
17918
19204
  getFirstDayOfMonth,
19205
+ getFirstVisibleChildKey,
17919
19206
  getFixedColumnOffsets,
17920
19207
  getFixedColumnPosition,
17921
19208
  getFixedColumnStyle,
@@ -17931,6 +19218,7 @@ export {
17931
19218
  getFormItemErrorClasses,
17932
19219
  getFormItemFieldClasses,
17933
19220
  getFormItemLabelClasses,
19221
+ getFormValidationLabels,
17934
19222
  getFormWizardLabels,
17935
19223
  getFunnelGradientPrefix,
17936
19224
  getGanttDependencyPath,
@@ -17951,9 +19239,11 @@ export {
17951
19239
  getImageAnnotationStrokeColor,
17952
19240
  getImageAnnotationToolButtonClasses,
17953
19241
  getImageAnnotationToolLabel,
19242
+ getImageEditorLabels,
17954
19243
  getImageGroupClasses,
17955
19244
  getImageImgClasses,
17956
19245
  getImageTransformStyle,
19246
+ getImageViewerLabels,
17957
19247
  getImmediateTigerLocale,
17958
19248
  getInfiniteScrollContainerClasses,
17959
19249
  getInitialCollapseContentStyle,
@@ -18010,6 +19300,7 @@ export {
18010
19300
  getMenuItemClasses,
18011
19301
  getMenuItemIndent,
18012
19302
  getMenuItems,
19303
+ getMenuNavigationKeys,
18013
19304
  getMessageIconPath,
18014
19305
  getMessageTypeClasses,
18015
19306
  getModalContainerClasses,
@@ -18020,6 +19311,7 @@ export {
18020
19311
  getNextColorSwatchIndex,
18021
19312
  getNextImageAnnotationTool,
18022
19313
  getNextSlideIndex,
19314
+ getNextTableSelectAllKeys,
18023
19315
  getNotificationIconPath,
18024
19316
  getNotificationTypeClasses,
18025
19317
  getNumberExtent,
@@ -18092,6 +19384,8 @@ export {
18092
19384
  getRadioVisualClasses,
18093
19385
  getRateStarClasses,
18094
19386
  getResizableHandleClasses,
19387
+ getResizeHandleOrientation,
19388
+ getResizeKeyboardDelta,
18095
19389
  getResultColorScheme,
18096
19390
  getResultHttpLabel,
18097
19391
  getResultIconPath,
@@ -18121,6 +19415,7 @@ export {
18121
19415
  getSelectOptionClasses,
18122
19416
  getSelectSizeClasses,
18123
19417
  getSelectTriggerClasses,
19418
+ getSelectVirtualItemHeight,
18124
19419
  getSeparatorContent,
18125
19420
  getShortDayNames,
18126
19421
  getShortMonthNames,
@@ -18159,6 +19454,7 @@ export {
18159
19454
  getStaggeredMotionStyle,
18160
19455
  getStatisticTitleClasses,
18161
19456
  getStatisticValueClasses,
19457
+ getStatusLabels,
18162
19458
  getStatusVariant,
18163
19459
  getStepContentClasses,
18164
19460
  getStepDescriptionClasses,
@@ -18194,7 +19490,9 @@ export {
18194
19490
  getTableResponsiveCardListClasses,
18195
19491
  getTableResponsiveTableClasses,
18196
19492
  getTableRowClasses,
19493
+ getTableSelectionState,
18197
19494
  getTableVirtualRecommendation,
19495
+ getTableVirtualWindow,
18198
19496
  getTableWrapperClasses,
18199
19497
  getTabsContainerClasses,
18200
19498
  getTagVariantClasses,
@@ -18224,6 +19522,7 @@ export {
18224
19522
  getTotalPages,
18225
19523
  getTotalTextClasses,
18226
19524
  getTouchDistance,
19525
+ getTourLabels,
18227
19526
  getTourPopoverPosition,
18228
19527
  getTourSpotlightStyle,
18229
19528
  getTourTargetRect,
@@ -18232,6 +19531,7 @@ export {
18232
19531
  getTransferItemClasses,
18233
19532
  getTransformOrigin,
18234
19533
  getTransitionClasses,
19534
+ getTreeKeyboardAction,
18235
19535
  getTreeMapGradientPrefix,
18236
19536
  getTreeNodeClasses,
18237
19537
  getTreeNodeExpandIconClasses,
@@ -18281,6 +19581,7 @@ export {
18281
19581
  handleUploadDrop,
18282
19582
  hasErrors,
18283
19583
  hasGutter,
19584
+ hasTableSelectionColumn,
18284
19585
  hexToRgb2 as hexToRgb,
18285
19586
  highContrastTheme,
18286
19587
  hsvToRgb,
@@ -18376,6 +19677,7 @@ export {
18376
19677
  isEscapeKey,
18377
19678
  isEventOutside,
18378
19679
  isHTMLElement,
19680
+ isHttpResultStatus,
18379
19681
  isImageAnnotationPathClosed,
18380
19682
  isImageAnnotationShapeTool,
18381
19683
  isInlineFormat,
@@ -18406,7 +19708,6 @@ export {
18406
19708
  isValidHex,
18407
19709
  isValidUrl,
18408
19710
  isWipExceeded,
18409
- kanbanAddCardClasses,
18410
19711
  kanbanAddColumnClasses,
18411
19712
  kanbanCardCountClasses,
18412
19713
  kanbanFilterHighlightClasses,
@@ -18528,6 +19829,7 @@ export {
18528
19829
  moveItemBetweenContainers,
18529
19830
  movePan,
18530
19831
  movePinch,
19832
+ moveTransferItems,
18531
19833
  naturalTheme,
18532
19834
  navigateToFolder,
18533
19835
  nextIconPath,
@@ -18579,6 +19881,7 @@ export {
18579
19881
  parseDragData,
18580
19882
  parseHeight,
18581
19883
  parseHotkey,
19884
+ parseInputNumberValue,
18582
19885
  parseInputValue,
18583
19886
  parseHeight as parseMarkdownHeight,
18584
19887
  parsePaneSize,
@@ -18682,6 +19985,7 @@ export {
18682
19985
  resolveCarouselSwipeDirection,
18683
19986
  resolveChartPalette,
18684
19987
  resolveChartTooltipContent,
19988
+ resolveChartTooltipPosition,
18685
19989
  resolveConditionalFormRules,
18686
19990
  resolveCreatableSelectOption,
18687
19991
  resolveDragConfig,
@@ -18716,6 +20020,8 @@ export {
18716
20020
  richTextContainerDisabled,
18717
20021
  richTextEditorAreaBase,
18718
20022
  richTextEditorAreaReadOnly,
20023
+ richTextHtmlToMode,
20024
+ richTextModeToHtml,
18719
20025
  richTextPlaceholderClasses,
18720
20026
  richTextToolbarButtonActive,
18721
20027
  richTextToolbarButtonBase,
@@ -18777,6 +20083,7 @@ export {
18777
20083
  sliderGetValueFromPosition,
18778
20084
  sliderNormalizeValue,
18779
20085
  sliderRangeClasses,
20086
+ sliderResolveMarks,
18780
20087
  sliderSizeClasses,
18781
20088
  sliderThumbClasses,
18782
20089
  sliderTooltipClasses,
@@ -18826,6 +20133,9 @@ export {
18826
20133
  statusSuccessIconPath,
18827
20134
  statusWarningIconPath,
18828
20135
  stepFinishChar,
20136
+ stepFinishIconPathD,
20137
+ stepFinishIconStrokeWidth,
20138
+ stepFinishIconViewBox,
18829
20139
  stepValue,
18830
20140
  stepperBaseClasses,
18831
20141
  stepperIconViewBox,
@@ -18912,6 +20222,7 @@ export {
18912
20222
  textDecorationClasses,
18913
20223
  textSizeClasses,
18914
20224
  textWeightClasses,
20225
+ themeConfigToCssVars,
18915
20226
  tigercatDarkTheme,
18916
20227
  tigercatPlugin,
18917
20228
  tigercatTheme,