haze-ui 1.30.0 → 1.31.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 (124) hide show
  1. package/README.md +35 -1
  2. package/dist/components/ActivityRail/ActivityRail.js +76 -0
  3. package/dist/components/ActivityRail/index.js +3 -0
  4. package/dist/components/BottomSheet/BottomSheet.js +12 -26
  5. package/dist/components/ConversationList/ConversationList.js +16 -7
  6. package/dist/components/List/List.js +14 -10
  7. package/dist/components/LocaleProvider/ar-sa.js +7 -0
  8. package/dist/components/LocaleProvider/de-de.js +7 -0
  9. package/dist/components/LocaleProvider/es-es.js +7 -0
  10. package/dist/components/LocaleProvider/fr-fr.js +7 -0
  11. package/dist/components/LocaleProvider/it-it.js +7 -0
  12. package/dist/components/LocaleProvider/ja-jp.js +7 -0
  13. package/dist/components/LocaleProvider/ko-kr.js +7 -0
  14. package/dist/components/LocaleProvider/locale.js +7 -0
  15. package/dist/components/LocaleProvider/pt-br.js +7 -0
  16. package/dist/components/LocaleProvider/ru-ru.js +7 -0
  17. package/dist/components/LocaleProvider/zh-cn.js +7 -0
  18. package/dist/components/LogViewer/LogViewer.js +45 -38
  19. package/dist/components/OTPInput/OTPInputCore.js +1 -0
  20. package/dist/components/Resizable/Resizable.js +266 -36
  21. package/dist/components/Sparkline/Sparkline.js +45 -0
  22. package/dist/components/Sparkline/index.js +3 -0
  23. package/dist/components/Sparkline/sparkline-styles.js +18 -0
  24. package/dist/components/StatusBar/StatusBar.js +47 -0
  25. package/dist/components/StatusBar/index.js +3 -0
  26. package/dist/components/TabBar/TabBar.js +60 -0
  27. package/dist/components/TabBar/index.js +3 -0
  28. package/dist/components/Tabs/SortableTabList.js +116 -0
  29. package/dist/components/Tabs/Tab.js +83 -16
  30. package/dist/components/Tabs/TabList.js +94 -38
  31. package/dist/components/Tabs/edge-scroll.js +6 -0
  32. package/dist/components/Tabs/index.js +4 -3
  33. package/dist/components/Tabs/tab-metas.js +24 -0
  34. package/dist/components/TagInput/SortableTagInputCore.js +11 -11
  35. package/dist/components/Toast/ToastContainer.js +1 -1
  36. package/dist/components/Toast/index.js +1 -1
  37. package/dist/components/Toast/{toast2.js → toast-channel.js} +1 -1
  38. package/dist/components/Toast/useToast.js +1 -1
  39. package/dist/components/Tree/SortableTree.js +39 -39
  40. package/dist/components/VirtualList/VirtualList.js +133 -121
  41. package/dist/components/Workbench/Workbench.js +144 -0
  42. package/dist/components/Workbench/index.js +3 -0
  43. package/dist/css/activity-rail.css +2 -0
  44. package/dist/css/app-shell.css +1 -1
  45. package/dist/css/breadcrumb.css +1 -1
  46. package/dist/css/checkbox.css +1 -1
  47. package/dist/css/command.css +1 -1
  48. package/dist/css/context-menu.css +1 -1
  49. package/dist/css/date-range-picker.css +1 -1
  50. package/dist/css/drawer.css +1 -1
  51. package/dist/css/dropdown-menu.css +2 -2
  52. package/dist/css/hover-card.css +1 -1
  53. package/dist/css/list.css +1 -1
  54. package/dist/css/menu.css +2 -2
  55. package/dist/css/popover.css +1 -1
  56. package/dist/css/radio.css +1 -1
  57. package/dist/css/resizable.css +1 -1
  58. package/dist/css/segmented.css +1 -1
  59. package/dist/css/sidebar.css +1 -1
  60. package/dist/css/slider.css +1 -1
  61. package/dist/css/sparkline.css +2 -0
  62. package/dist/css/status-bar.css +2 -0
  63. package/dist/css/switch.css +1 -1
  64. package/dist/css/tab-bar.css +2 -0
  65. package/dist/css/tabs.css +3 -2
  66. package/dist/css/tag.css +1 -1
  67. package/dist/css/tree.css +1 -1
  68. package/dist/css/workbench.css +2 -0
  69. package/dist/css-manifest.json +16 -0
  70. package/dist/dates/adapter.js +9 -1
  71. package/dist/dates/buddhist.js +43 -0
  72. package/dist/dates/ethiopic.js +67 -0
  73. package/dist/dates/hebrew.js +95 -0
  74. package/dist/dates/japanese.js +41 -0
  75. package/dist/dates/persian.js +121 -0
  76. package/dist/dates/registry.js +14 -4
  77. package/dist/haze-ui.css +30 -24
  78. package/dist/index.js +253 -241
  79. package/dist/mcp-docs.json +555 -10
  80. package/dist/registry.json +115 -5
  81. package/dist/types/components/ActivityRail/ActivityRail.d.ts +30 -0
  82. package/dist/types/components/ActivityRail/index.d.ts +4 -0
  83. package/dist/types/components/ConversationList/ConversationList.d.ts +10 -1
  84. package/dist/types/components/List/List.d.ts +10 -1
  85. package/dist/types/components/LocaleProvider/locale.d.ts +7 -0
  86. package/dist/types/components/LogViewer/LogViewer.d.ts +10 -1
  87. package/dist/types/components/Resizable/Resizable.d.ts +24 -7
  88. package/dist/types/components/Resizable/index.d.ts +1 -1
  89. package/dist/types/components/Sparkline/Sparkline.d.ts +31 -0
  90. package/dist/types/components/Sparkline/index.d.ts +3 -0
  91. package/dist/types/components/Sparkline/sparkline-styles.d.ts +26 -0
  92. package/dist/types/components/StatusBar/StatusBar.d.ts +18 -0
  93. package/dist/types/components/StatusBar/index.d.ts +3 -0
  94. package/dist/types/components/TabBar/TabBar.d.ts +23 -0
  95. package/dist/types/components/TabBar/index.d.ts +4 -0
  96. package/dist/types/components/Tabs/SortableTabList.d.ts +46 -0
  97. package/dist/types/components/Tabs/Tab.d.ts +54 -3
  98. package/dist/types/components/Tabs/TabList.d.ts +26 -2
  99. package/dist/types/components/Tabs/edge-scroll.d.ts +17 -0
  100. package/dist/types/components/Tabs/index.d.ts +3 -1
  101. package/dist/types/components/Tabs/tab-metas.d.ts +20 -0
  102. package/dist/types/components/Toast/index.d.ts +2 -2
  103. package/dist/types/components/Toast/useToast.d.ts +1 -1
  104. package/dist/types/components/VirtualList/VirtualList.d.ts +20 -1
  105. package/dist/types/components/Workbench/Workbench.d.ts +50 -0
  106. package/dist/types/components/Workbench/index.d.ts +2 -0
  107. package/dist/types/dates/adapter.d.ts +33 -6
  108. package/dist/types/dates/buddhist.d.ts +14 -0
  109. package/dist/types/dates/ethiopic.d.ts +15 -0
  110. package/dist/types/dates/hebrew.d.ts +19 -0
  111. package/dist/types/dates/index.d.ts +5 -0
  112. package/dist/types/dates/japanese.d.ts +16 -0
  113. package/dist/types/dates/persian.d.ts +18 -0
  114. package/dist/types/dates/registry.d.ts +1 -1
  115. package/dist/types/index.d.ts +13 -3
  116. package/dist/types/utils/sortable.d.ts +8 -1
  117. package/dist/types/utils/use-end-reached.d.ts +56 -0
  118. package/dist/types/utils/viewport.d.ts +12 -0
  119. package/dist/utils/sortable-shared.js +3 -3
  120. package/dist/utils/sortable.js +15 -14
  121. package/dist/utils/use-end-reached.js +46 -0
  122. package/dist/utils/viewport.js +20 -0
  123. package/package.json +12 -4
  124. /package/dist/types/components/Toast/{toast.d.ts → toast-channel.d.ts} +0 -0
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import { addMonths as e, getDaysInMonth as t } from "../components/Calendar/date.js";
3
+ import { eraOfDate as n, localMidnightOf as r, utcCivilMs as i } from "./adapter.js";
4
+ //#region src/lib/dates/japanese.ts
5
+ var a = 5, o = 1, s = {
6
+ identifier: "japanese",
7
+ fromGregorian(e) {
8
+ return {
9
+ year: e.getFullYear(),
10
+ month: e.getMonth(),
11
+ day: e.getDate()
12
+ };
13
+ },
14
+ toGregorian(n) {
15
+ let a = e(n.year, n.month, 0);
16
+ if (n.day < 1 || n.day > t(a.year, a.month)) throw RangeError(`Not a japanese date: ${n.year}-${n.month + 1}-${n.day}`);
17
+ return r(i(a.year, a.month, n.day));
18
+ },
19
+ getDaysInMonth: t,
20
+ addMonths(n, r) {
21
+ let i = e(n.year, n.month, r), a = t(i.year, i.month);
22
+ return {
23
+ year: i.year,
24
+ month: i.month,
25
+ day: Math.min(n.day, a)
26
+ };
27
+ },
28
+ monthNames(e = "en", t = "long") {
29
+ let n = new Intl.DateTimeFormat(e, {
30
+ calendar: "japanese",
31
+ month: t,
32
+ timeZone: "UTC"
33
+ });
34
+ return Array.from({ length: 12 }, (e, t) => n.format(new Date(Date.UTC(2026, t, 15))));
35
+ },
36
+ era(e, t = "en") {
37
+ return n(new Date(i(e, a, o)), "japanese", t);
38
+ }
39
+ };
40
+ //#endregion
41
+ export { s as japaneseAdapter };
@@ -0,0 +1,121 @@
1
+ "use client";
2
+ import { addMonths as e } from "../components/Calendar/date.js";
3
+ import { eraOfDate as t, localMidnightOf as n, utcCivilMs as r } from "./adapter.js";
4
+ //#region src/lib/dates/persian.ts
5
+ var i = 864e5, a = 2440588, o = [
6
+ -61,
7
+ 9,
8
+ 38,
9
+ 199,
10
+ 426,
11
+ 686,
12
+ 756,
13
+ 818,
14
+ 1111,
15
+ 1181,
16
+ 1210,
17
+ 1635,
18
+ 2060,
19
+ 2097,
20
+ 2192,
21
+ 2262,
22
+ 2324,
23
+ 2394,
24
+ 2456,
25
+ 3178
26
+ ], s = (e, t) => Math.trunc(e / t), c = (e, t) => e - Math.trunc(e / t) * t;
27
+ function l(e) {
28
+ let t = o[0] ?? -61, n = o[o.length - 1] ?? 3178;
29
+ if (e < t || e >= n) throw RangeError(`Not a persian year: ${e}`);
30
+ let r = e + 621, i = -14, a = t, l = 0;
31
+ for (let n of o) if (n !== t) {
32
+ if (l = n - a, e < n) break;
33
+ i += s(l, 33) * 8 + s(c(l, 33), 4), a = n;
34
+ }
35
+ let u = e - a;
36
+ i += s(u, 33) * 8 + s(c(u, 33) + 3, 4), c(l, 33) === 4 && l - u === 4 && (i += 1);
37
+ let d = s(r, 4) - s((s(r, 100) + 1) * 3, 4) - 150, f = 20 + i - d;
38
+ l - u < 6 && (u = u - l + s(l + 4, 33) * 33);
39
+ let p = c(c(u + 1, 33) - 1, 4);
40
+ return p === -1 && (p = 4), {
41
+ gy: r,
42
+ march: f,
43
+ leap: p
44
+ };
45
+ }
46
+ function u(e, t, n) {
47
+ let r = s((e + s(t - 8, 6) + 100100) * 1461, 4) + s(153 * c(t + 9, 12) + 2, 5) + n - 34840408;
48
+ return r = r - s(s(e + 100100 + s(t - 8, 6), 100) * 3, 4) + 752, r;
49
+ }
50
+ function d(e) {
51
+ let t = 4 * e + 139361631;
52
+ t = t + s(s(4 * e + 183187720, 146097) * 3, 4) * 4 - 3908;
53
+ let n = s(c(t, 1461), 4) * 5 + 308, r = s(c(n, 153), 5) + 1, i = c(s(n, 153), 12) + 1;
54
+ return {
55
+ year: s(t, 1461) - 100100 + s(8 - i, 6),
56
+ month: i,
57
+ day: r
58
+ };
59
+ }
60
+ function f(e, t, n) {
61
+ let { gy: r, march: i } = l(e);
62
+ return u(r, 3, i) + (t - 1) * 31 - s(t, 7) * (t - 7) + n - 1;
63
+ }
64
+ function p(e) {
65
+ let t = d(e).year, n = t - 621, { march: r, leap: i } = l(n), a = e - u(t, 3, r);
66
+ if (a >= 0) {
67
+ if (a <= 185) return {
68
+ year: n,
69
+ month: s(a, 31),
70
+ day: c(a, 31) + 1
71
+ };
72
+ a -= 186;
73
+ } else --n, a += 179, i === 1 && (a += 1);
74
+ return {
75
+ year: n,
76
+ month: 6 + s(a, 30),
77
+ day: c(a, 30) + 1
78
+ };
79
+ }
80
+ function m(e, t) {
81
+ return t < 6 ? 31 : t < 11 ? 30 : f(e + 1, 1, 1) - f(e, 12, 1);
82
+ }
83
+ var h = 1404, g = {
84
+ identifier: "persian",
85
+ fromGregorian(e) {
86
+ let t = r(e.getFullYear(), e.getMonth(), e.getDate());
87
+ return p(Math.floor(t / i) + a);
88
+ },
89
+ toGregorian(t) {
90
+ let i = e(t.year, t.month, 0);
91
+ if (t.day < 1 || t.day > m(i.year, i.month)) throw RangeError(`Not a persian date: ${t.year}-${t.month + 1}-${t.day}`);
92
+ let a = d(f(i.year, i.month + 1, t.day));
93
+ return n(r(a.year, a.month - 1, a.day));
94
+ },
95
+ getDaysInMonth(t, n) {
96
+ let r = e(t, n, 0);
97
+ return m(r.year, r.month);
98
+ },
99
+ addMonths(t, n) {
100
+ let r = e(t.year, t.month, n);
101
+ return {
102
+ year: r.year,
103
+ month: r.month,
104
+ day: Math.min(t.day, m(r.year, r.month))
105
+ };
106
+ },
107
+ monthNames(e = "en", t = "long") {
108
+ let n = new Intl.DateTimeFormat(e, {
109
+ calendar: "persian",
110
+ month: t,
111
+ timeZone: "UTC"
112
+ });
113
+ return Array.from({ length: 12 }, (e, t) => n.format(/* @__PURE__ */ new Date((f(h, t + 1, 15) - a) * i)));
114
+ },
115
+ era(e, n = "en") {
116
+ let r = (f(e, 1, 1) - a) * i;
117
+ return t(new Date(r), "persian", n);
118
+ }
119
+ };
120
+ //#endregion
121
+ export { g as persianAdapter };
@@ -1,13 +1,23 @@
1
1
  "use client";
2
2
  import { gregoryAdapter as e } from "./gregory.js";
3
3
  import { islamicUmalquraAdapter as t } from "./islamic.js";
4
+ import { persianAdapter as n } from "./persian.js";
5
+ import { hebrewAdapter as r } from "./hebrew.js";
6
+ import { japaneseAdapter as i } from "./japanese.js";
7
+ import { buddhistAdapter as a } from "./buddhist.js";
8
+ import { ethiopicAdapter as o } from "./ethiopic.js";
4
9
  //#region src/lib/dates/registry.ts
5
- function n(n) {
6
- switch (n) {
10
+ function s(s) {
11
+ switch (s) {
7
12
  case "gregory": return e;
8
13
  case "islamic-umalqura": return t;
9
- default: throw RangeError(`Unknown calendar identifier: ${String(n)}`);
14
+ case "persian": return n;
15
+ case "hebrew": return r;
16
+ case "japanese": return i;
17
+ case "buddhist": return a;
18
+ case "ethiopic": return o;
19
+ default: throw RangeError(`Unknown calendar identifier: ${String(s)}`);
10
20
  }
11
21
  }
12
22
  //#endregion
13
- export { n as getAdapter };
23
+ export { s as getAdapter };