@ac-design/design-system 2.0.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/dist/lib/charts/ChartFrame.vue.d.ts +2 -0
  2. package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +42 -37
  3. package/dist/lib/charts/cartesian.d.ts +324 -0
  4. package/dist/lib/charts/cartesian.js +137 -0
  5. package/dist/lib/charts/echarts.d.ts +86 -0
  6. package/dist/lib/charts/echarts.js +173 -0
  7. package/dist/lib/charts/graph.d.ts +77 -0
  8. package/dist/lib/charts/graph.js +155 -0
  9. package/dist/lib/charts/index.d.ts +4 -0
  10. package/dist/lib/charts/index.js +3 -1
  11. package/dist/lib/charts/shared.d.ts +0 -7
  12. package/dist/lib/charts/shared.js +1 -19
  13. package/dist/lib/charts/xy.d.ts +11 -7
  14. package/dist/lib/charts/xy.js +53 -72
  15. package/dist/lib/compat.css +1322 -278
  16. package/dist/lib/components/AcAlert.vue.d.ts +9 -0
  17. package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -21
  18. package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +1 -1
  19. package/dist/lib/components/AcAreaChart.vue.d.ts +3 -0
  20. package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +132 -142
  21. package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
  22. package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +59 -54
  23. package/dist/lib/components/AcBadge.vue.d.ts +7 -3
  24. package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +35 -28
  25. package/dist/lib/components/AcBarChart.vue.d.ts +3 -0
  26. package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +142 -146
  27. package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
  28. package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +18 -17
  29. package/dist/lib/components/AcBulkActionBar.vue.d.ts +2 -0
  30. package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +1 -1
  31. package/dist/lib/components/AcButton.vue.d.ts +12 -6
  32. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +85 -47
  33. package/dist/lib/components/AcCard.vue.d.ts +34 -3
  34. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +169 -34
  35. package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
  36. package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +171 -165
  37. package/dist/lib/components/AcCheckBox.vue.d.ts +1 -1
  38. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +58 -72
  39. package/dist/lib/components/AcCheckList.js +5 -0
  40. package/dist/lib/components/AcCheckList.vue.d.ts +45 -0
  41. package/dist/lib/components/AcCheckList.vue_vue_type_script_setup_true_lang.js +64 -0
  42. package/dist/lib/components/AcCheckRadio.vue.d.ts +30 -5
  43. package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +100 -36
  44. package/dist/lib/components/AcCircularProgress.vue.d.ts +4 -4
  45. package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +12 -9
  46. package/dist/lib/components/AcColorInput.vue.d.ts +5 -2
  47. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +127 -97
  48. package/dist/lib/components/AcCommandBlock.js +5 -0
  49. package/dist/lib/components/AcCommandBlock.vue.d.ts +34 -0
  50. package/dist/lib/components/AcCommandBlock.vue_vue_type_script_setup_true_lang.js +88 -0
  51. package/dist/lib/components/AcConfirmModal.vue.d.ts +1 -1
  52. package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +7 -3
  53. package/dist/lib/components/AcCopyButton.vue.d.ts +2 -2
  54. package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +4 -4
  55. package/dist/lib/components/AcCostSummary.js +5 -0
  56. package/dist/lib/components/AcCostSummary.vue.d.ts +102 -0
  57. package/dist/lib/components/AcCostSummary.vue_vue_type_script_setup_true_lang.js +179 -0
  58. package/dist/lib/components/AcDatePicker.vue.d.ts +3 -3
  59. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +606 -380
  60. package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +47 -41
  61. package/dist/lib/components/AcDonutChart.vue.d.ts +10 -0
  62. package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +116 -89
  63. package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
  64. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +88 -75
  65. package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
  66. package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
  67. package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +17 -17
  68. package/dist/lib/components/AcEmptyState.vue.d.ts +1 -1
  69. package/dist/lib/components/AcErrorState.js +5 -0
  70. package/dist/lib/components/AcErrorState.vue.d.ts +46 -0
  71. package/dist/lib/components/AcErrorState.vue_vue_type_script_setup_true_lang.js +66 -0
  72. package/dist/lib/components/AcFeatureCard.vue.d.ts +6 -0
  73. package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +136 -114
  74. package/dist/lib/components/AcFooter.vue.d.ts +1 -1
  75. package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +1 -1
  76. package/dist/lib/components/AcFormFooter.vue.d.ts +1 -1
  77. package/dist/lib/components/AcFormSection.vue.d.ts +1 -1
  78. package/dist/lib/components/AcGraphChart.js +5 -0
  79. package/dist/lib/components/AcGraphChart.vue.d.ts +124 -0
  80. package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +578 -0
  81. package/dist/lib/components/AcHeader.vue.d.ts +20 -2
  82. package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +84 -26
  83. package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
  84. package/dist/lib/components/AcInput.vue.d.ts +1 -1
  85. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +76 -79
  86. package/dist/lib/components/AcKeyValueInput.vue.d.ts +4 -4
  87. package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +199 -183
  88. package/dist/lib/components/AcLineChart.vue.d.ts +6 -0
  89. package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +113 -125
  90. package/dist/lib/components/AcLoader.js +5 -0
  91. package/dist/lib/components/AcLoader.vue.d.ts +15 -0
  92. package/dist/lib/components/AcLoader.vue_vue_type_script_setup_true_lang.js +66 -0
  93. package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +3 -1
  94. package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +44 -36
  95. package/dist/lib/components/AcMapChart.js +5 -0
  96. package/dist/lib/components/AcMapChart.vue.d.ts +136 -0
  97. package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +518 -0
  98. package/dist/lib/components/AcModal.vue.d.ts +6 -3
  99. package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +85 -61
  100. package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
  101. package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +25 -17
  102. package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
  103. package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +3 -4
  104. package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
  105. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +133 -168
  106. package/dist/lib/components/AcNumberInput.vue.d.ts +2 -2
  107. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +137 -147
  108. package/dist/lib/components/AcPage.vue.d.ts +2 -2
  109. package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +1 -1
  110. package/dist/lib/components/AcPagination.vue.d.ts +5 -5
  111. package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +59 -56
  112. package/dist/lib/components/AcPreloader.vue.d.ts +3 -3
  113. package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +15 -16
  114. package/dist/lib/components/AcProductHero.js +5 -0
  115. package/dist/lib/components/AcProductHero.vue.d.ts +56 -0
  116. package/dist/lib/components/AcProductHero.vue_vue_type_script_setup_true_lang.js +95 -0
  117. package/dist/lib/components/AcProgress.vue.d.ts +17 -2
  118. package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +83 -29
  119. package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
  120. package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +4 -4
  121. package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
  122. package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +8 -4
  123. package/dist/lib/components/AcSelect.vue.d.ts +3 -3
  124. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +232 -243
  125. package/dist/lib/components/AcSettingsRow.js +5 -0
  126. package/dist/lib/components/AcSettingsRow.vue.d.ts +29 -0
  127. package/dist/lib/components/AcSettingsRow.vue_vue_type_script_setup_true_lang.js +37 -0
  128. package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +5 -5
  129. package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
  130. package/dist/lib/components/AcSidebar.vue.d.ts +4 -1
  131. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +104 -94
  132. package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
  133. package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +42 -42
  134. package/dist/lib/components/AcSidebarSection.vue.d.ts +2 -2
  135. package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +23 -18
  136. package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +1 -1
  137. package/dist/lib/components/AcSwitch.vue.d.ts +3 -0
  138. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +46 -39
  139. package/dist/lib/components/AcSwitchCard.vue.d.ts +3 -3
  140. package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +9 -7
  141. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +65 -65
  142. package/dist/lib/components/AcTabs.vue.d.ts +9 -2
  143. package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +42 -27
  144. package/dist/lib/components/AcTag.vue.d.ts +1 -1
  145. package/dist/lib/components/AcTagInput.vue.d.ts +5 -5
  146. package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +140 -142
  147. package/dist/lib/components/AcTextarea.vue.d.ts +1 -1
  148. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +69 -72
  149. package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
  150. package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +54 -22
  151. package/dist/lib/components/AcTimePicker.vue.d.ts +1 -1
  152. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +177 -185
  153. package/dist/lib/components/AcToaster.vue.d.ts +6 -3
  154. package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +103 -64
  155. package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
  156. package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +184 -70
  157. package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
  158. package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +181 -138
  159. package/dist/lib/components/index.d.ts +7 -0
  160. package/dist/lib/components/status.d.ts +3 -1
  161. package/dist/lib/components/status.js +20 -5
  162. package/dist/lib/composables/useToast.d.ts +17 -1
  163. package/dist/lib/composables/useToast.js +10 -2
  164. package/dist/lib/index.d.ts +7 -3
  165. package/dist/lib/index.js +80 -73
  166. package/dist/lib/theme.css +39 -54
  167. package/package.json +12 -3
@@ -1,6 +1,6 @@
1
1
  import e from "./AcButton.js";
2
- import { Fragment as t, Teleport as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeModels as f, mergeProps as ee, nextTick as te, normalizeClass as p, normalizeStyle as ne, onBeforeUnmount as re, onMounted as ie, openBlock as m, reactive as ae, ref as h, renderList as g, resolveDynamicComponent as oe, toDisplayString as _, unref as v, useAttrs as se, useId as ce, useModel as le, watch as ue, withCtx as de } from "vue";
3
- import { Calendar as fe, CalendarRange as pe, ChevronLeft as me, ChevronRight as he, CircleAlert as ge, Timer as _e, X as ve } from "@lucide/vue";
2
+ import { Fragment as t, Teleport as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as ee, createVNode as l, defineComponent as u, mergeModels as d, mergeProps as te, nextTick as f, normalizeClass as p, normalizeStyle as ne, onBeforeUnmount as re, onMounted as ie, openBlock as m, reactive as ae, ref as h, renderList as g, resolveDynamicComponent as oe, toDisplayString as _, unref as v, useAttrs as se, useId as ce, useModel as le, watch as ue, withCtx as de } from "vue";
3
+ import { Calendar as fe, CalendarRange as pe, ChevronLeft as me, ChevronRight as he, Clock as ge, Timer as _e, X as ve } from "@lucide/vue";
4
4
  //#region src/lib/components/AcDatePicker.vue?vue&type=script&setup=true&lang.ts
5
5
  var ye = ["for"], be = {
6
6
  key: 0,
@@ -14,18 +14,18 @@ var ye = ["for"], be = {
14
14
  "aria-describedby",
15
15
  "aria-invalid",
16
16
  "aria-required"
17
- ], Ce = { class: "pointer-events-none absolute inset-y-0 right-1.5 flex items-center gap-0.5 text-muted" }, we = ["aria-label"], Te = ["name", "value"], Ee = ["aria-label"], De = {
17
+ ], Ce = ["aria-label"], we = ["name", "value"], Te = ["aria-label"], Ee = {
18
18
  key: 0,
19
19
  class: "flex shrink-0 flex-wrap gap-1 border-b border-border p-2 sm:w-44 sm:flex-col sm:flex-nowrap sm:border-r sm:border-b-0",
20
20
  role: "group",
21
21
  "aria-label": "Presets"
22
- }, Oe = ["onClick"], ke = {
22
+ }, De = ["onClick"], Oe = {
23
23
  key: 0,
24
24
  class: "p-4"
25
- }, Ae = { class: "text-base font-medium text-heading" }, je = {
25
+ }, ke = { class: "text-base font-medium text-heading" }, Ae = {
26
26
  class: "text-xs text-muted tabular-nums",
27
27
  "aria-live": "polite"
28
- }, Me = { class: "mt-3 grid grid-cols-3 gap-2" }, Ne = { class: "mb-1.5 block text-xs font-medium text-heading" }, Pe = [
28
+ }, je = { class: "mt-3 grid grid-cols-3 gap-2" }, Me = { class: "mb-1.5 block text-xs font-medium text-heading" }, Ne = [
29
29
  "value",
30
30
  "aria-valuenow",
31
31
  "aria-valuemin",
@@ -33,10 +33,22 @@ var ye = ["for"], be = {
33
33
  "onKeydown",
34
34
  "onInput",
35
35
  "onBlur"
36
- ], Fe = {
36
+ ], Pe = [
37
+ "id",
38
+ "data-tab",
39
+ "aria-selected",
40
+ "aria-controls",
41
+ "tabindex",
42
+ "onClick"
43
+ ], Fe = [
44
+ "id",
45
+ "role",
46
+ "aria-labelledby"
47
+ ], Ie = { class: "mb-2 flex items-center justify-between gap-2" }, Le = ["aria-label"], Re = ["aria-label"], ze = {
37
48
  key: 1,
38
- class: "p-3"
39
- }, Ie = { class: "mb-2 flex items-center justify-between gap-2" }, Le = ["abbr"], Re = ["aria-selected"], ze = [
49
+ class: "rounded-10 bg-accent px-4 py-2 text-base font-semibold text-heading tabular-nums",
50
+ "aria-hidden": "true"
51
+ }, Be = ["aria-label"], Ve = ["abbr"], He = ["aria-selected"], Ue = [
40
52
  "data-day",
41
53
  "tabindex",
42
54
  "aria-label",
@@ -44,33 +56,47 @@ var ye = ["for"], be = {
44
56
  "aria-current",
45
57
  "onClick",
46
58
  "onMouseenter"
47
- ], Be = {
59
+ ], We = ["aria-label"], Ge = [
60
+ "data-pick",
61
+ "tabindex",
62
+ "aria-label",
63
+ "aria-selected",
64
+ "aria-disabled",
65
+ "onClick",
66
+ "onFocus"
67
+ ], Ke = { class: "flex justify-center gap-3" }, qe = {
68
+ key: 0,
69
+ class: "mt-6 h-32 w-px shrink-0 self-center bg-border",
70
+ "aria-hidden": "true"
71
+ }, Je = ["aria-label"], Ye = {
48
72
  key: 0,
49
- class: "mt-2 space-y-2 border-t border-border pt-3"
50
- }, Ve = ["aria-label"], He = { class: "text-xs font-medium text-heading" }, Ue = { class: "flex items-center gap-1" }, We = {
73
+ class: "mb-1 text-center text-xs font-medium text-heading"
74
+ }, Xe = { class: "flex h-48 items-stretch justify-center gap-1" }, Ze = {
51
75
  key: 0,
52
- class: "text-muted",
76
+ class: "mt-6 self-center font-bold text-heading/50",
53
77
  "aria-hidden": "true"
54
- }, Ge = [
55
- "value",
78
+ }, Qe = { class: "flex h-full min-w-10 flex-1 flex-col items-center" }, $e = {
79
+ class: "mb-2 text-xm font-bold tracking-wider text-heading/50 uppercase",
80
+ "aria-hidden": "true"
81
+ }, et = [
56
82
  "aria-label",
57
- "aria-valuenow",
58
- "aria-valuemin",
59
- "aria-valuemax",
60
- "onKeydown",
61
- "onInput",
62
- "onBlur"
63
- ], Ke = { class: "text-xs text-muted" }, qe = {
83
+ "data-time-list",
84
+ "onKeydown"
85
+ ], tt = { class: "flex w-full flex-col items-center py-20" }, nt = [
86
+ "tabindex",
87
+ "aria-selected",
88
+ "onClick"
89
+ ], rt = { class: "mt-3 text-center text-xs text-muted" }, it = {
64
90
  key: 2,
65
91
  class: "flex flex-wrap items-center gap-2 border-t border-border px-3 py-3"
66
- }, Je = ["disabled"], Ye = {
92
+ }, at = ["disabled"], ot = {
67
93
  key: 1,
68
94
  class: "basis-full text-xs text-danger-strong",
69
95
  role: "alert"
70
- }, y = /*@__PURE__*/ d({
96
+ }, y = /*@__PURE__*/ u({
71
97
  inheritAttrs: !1,
72
98
  __name: "AcDatePicker",
73
- props: /*@__PURE__*/ f({
99
+ props: /*@__PURE__*/ d({
74
100
  label: { default: "" },
75
101
  placeholder: { default: "" },
76
102
  mode: { default: "date" },
@@ -118,8 +144,8 @@ var ye = ["for"], be = {
118
144
  openModifiers: {}
119
145
  }),
120
146
  emits: ["update:modelValue", "update:open"],
121
- setup(d, { expose: f }) {
122
- let y = d, Xe = le(d, "modelValue"), b = le(d, "open"), Ze = /^\d{4}-\d{2}-\d{2}$/, Qe = /^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/, $e = {
147
+ setup(u, { expose: d }) {
148
+ let y = u, st = le(u, "modelValue"), b = le(u, "open"), ct = /^\d{4}-\d{2}-\d{2}$/, lt = /^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/, ut = {
123
149
  w: 604800,
124
150
  d: 86400,
125
151
  h: 3600,
@@ -129,33 +155,46 @@ var ye = ["for"], be = {
129
155
  us: 1e-6,
130
156
  µs: 1e-6,
131
157
  ns: 1e-9
132
- }, et = Date.UTC(2023, 0, 1), x = ce(), tt = se(), nt = i(() => ({
133
- class: tt.class,
134
- style: tt.style
135
- })), rt = i(() => {
136
- let { class: e, style: t, ...n } = tt;
158
+ }, dt = Date.UTC(2023, 0, 1), ft = {
159
+ h: "Hrs",
160
+ m: "Min",
161
+ s: "Sec"
162
+ }, pt = [{
163
+ key: "date",
164
+ label: "Date",
165
+ icon: fe
166
+ }, {
167
+ key: "time",
168
+ label: "Time",
169
+ icon: ge
170
+ }], x = ce(), mt = se(), ht = i(() => ({
171
+ class: mt.class,
172
+ style: mt.style
173
+ })), gt = i(() => {
174
+ let { class: e, style: t, ...n } = mt;
137
175
  return n;
138
- }), it = `${x}-label`, at = `${x}-value`, ot = `${x}-month`, st = `${x}-msg`, ct = `${x}-hint`, lt = /* @__PURE__ */ new Map(), ut = h(null), S = h(null), C = h(null), w = h({
176
+ }), _t = `${x}-label`, vt = `${x}-value`, yt = `${x}-month`, bt = `${x}-msg`, xt = `${x}-hint`, St = /* @__PURE__ */ new Map(), Ct = h(null), wt = h(null), S = h(null), C = h({
139
177
  left: 0,
140
- maxHeight: 480
141
- }), T = h("2026-01-01"), E = h("2026-01-01"), D = h(null), O = h(null), k = h(null), A = ae({
178
+ maxHeight: 480,
179
+ minWidth: 0
180
+ }), w = h("2026-01-01"), T = h("days"), E = h(2020), D = h(0), O = h("date"), k = h("2026-01-01"), A = h(null), j = h(null), M = h(null), N = ae({
142
181
  h: 0,
143
182
  m: 0,
144
183
  s: 0
145
- }), j = ae({
184
+ }), P = ae({
146
185
  h: 23,
147
186
  m: 59,
148
187
  s: 59
149
- }), M = ae({
188
+ }), F = ae({
150
189
  d: 0,
151
190
  h: 0,
152
191
  m: 0
153
- }), N = i(() => y.timeZone || Intl.DateTimeFormat().resolvedOptions().timeZone), P = i(() => y.range && y.mode !== "duration"), F = i(() => y.mode === "datetime"), dt = i(() => y.weekStartsOn ?? Bt()), ft = i(() => new Intl.DateTimeFormat(y.locale, {
192
+ }), I = i(() => y.timeZone || Intl.DateTimeFormat().resolvedOptions().timeZone), L = i(() => y.range && y.mode !== "duration"), R = i(() => y.mode === "datetime"), Tt = i(() => y.weekStartsOn ?? un()), Et = i(() => new Intl.DateTimeFormat(y.locale, {
154
193
  year: "numeric",
155
194
  month: "short",
156
195
  day: "numeric",
157
196
  timeZone: "UTC"
158
- })), I = i(() => new Intl.DateTimeFormat(y.locale, {
197
+ })), Dt = i(() => new Intl.DateTimeFormat(y.locale, {
159
198
  year: "numeric",
160
199
  month: "short",
161
200
  day: "numeric",
@@ -163,22 +202,22 @@ var ye = ["for"], be = {
163
202
  minute: "2-digit",
164
203
  second: y.showSeconds ? "2-digit" : void 0,
165
204
  hourCycle: "h23",
166
- timeZone: N.value,
205
+ timeZone: I.value,
167
206
  timeZoneName: "short"
168
- })), pt = i(() => new Intl.DateTimeFormat(y.locale, {
207
+ })), Ot = i(() => new Intl.DateTimeFormat(y.locale, {
169
208
  month: "long",
170
209
  year: "numeric",
171
210
  timeZone: "UTC"
172
- })), mt = i(() => new Intl.DateTimeFormat(y.locale, {
211
+ })), kt = i(() => new Intl.DateTimeFormat(y.locale, {
173
212
  weekday: "long",
174
213
  year: "numeric",
175
214
  month: "long",
176
215
  day: "numeric",
177
216
  timeZone: "UTC"
178
- })), ht = i(() => new Intl.DateTimeFormat(y.locale, {
217
+ })), At = i(() => new Intl.DateTimeFormat(y.locale, {
179
218
  day: "numeric",
180
219
  timeZone: "UTC"
181
- })), gt = i(() => {
220
+ })), jt = i(() => {
182
221
  let e = new Intl.DateTimeFormat(y.locale, {
183
222
  weekday: "short",
184
223
  timeZone: "UTC"
@@ -187,73 +226,105 @@ var ye = ["for"], be = {
187
226
  timeZone: "UTC"
188
227
  });
189
228
  return Array.from({ length: 7 }, (n, r) => {
190
- let i = new Date(et + (dt.value + r) % 7 * 864e5);
229
+ let i = new Date(dt + (Tt.value + r) % 7 * 864e5);
191
230
  return {
192
231
  short: e.format(i),
193
232
  long: t.format(i)
194
233
  };
195
234
  });
196
- }), _t = i(() => new Intl.DateTimeFormat(y.locale, {
197
- timeZone: N.value,
235
+ }), Mt = i(() => new Intl.DateTimeFormat(y.locale, {
236
+ timeZone: I.value,
198
237
  timeZoneName: "short"
199
- }).formatToParts(Date.now()).find((e) => e.type === "timeZoneName")?.value ?? N.value), L = i(() => K(Date.now()).day), R = i(() => y.minDate ? Y(y.minDate) : null), z = i(() => y.maxDate ? Y(y.maxDate) : null), vt = i(() => y.minDate ? J(y.minDate) : null), yt = i(() => y.maxDate ? Ze.test(y.maxDate) ? q(W(y.maxDate, 1), 0, 0, 0) - 1e3 : J(y.maxDate) : null), B = i(() => {
200
- let e = Xe.value;
201
- return P.value ? Array.isArray(e) ? [e[0] || null, e[1] || null] : [null, null] : [typeof e == "string" && e ? e : null];
202
- }), bt = i(() => B.value.some(Boolean)), xt = i(() => {
203
- let [e, t] = B.value;
238
+ }).formatToParts(Date.now()).find((e) => e.type === "timeZoneName")?.value ?? I.value), Nt = i(() => X(Date.now()).day), z = i(() => y.minDate ? Q(y.minDate) : null), B = i(() => y.maxDate ? Q(y.maxDate) : null), Pt = i(() => y.minDate ? Z(y.minDate) : null), Ft = i(() => y.maxDate ? ct.test(y.maxDate) ? fn(J(y.maxDate, 1), 0, 0, 0) - 1e3 : Z(y.maxDate) : null), V = i(() => {
239
+ let e = st.value;
240
+ return L.value ? Array.isArray(e) ? [e[0] || null, e[1] || null] : [null, null] : [typeof e == "string" && e ? e : null];
241
+ }), It = i(() => V.value.some(Boolean)), Lt = i(() => {
242
+ let [e, t] = V.value;
204
243
  if (!e) return "";
205
244
  if (y.mode === "duration") {
206
- let t = Ht(e);
207
- return t === null ? e : Wt(t);
245
+ let t = mn(e);
246
+ return t === null ? e : gn(t);
208
247
  }
209
248
  if (y.mode === "date") {
210
- let n = Y(e), r = t ? Y(t) : null;
211
- return n ? P.value ? r ? ft.value.formatRange(U(n), U(r)) : `${ft.value.format(U(n))} –` : ft.value.format(U(n)) : e;
249
+ let n = Q(e), r = t ? Q(t) : null;
250
+ return n ? L.value ? r ? Et.value.formatRange(q(n), q(r)) : `${Et.value.format(q(n))} –` : Et.value.format(q(n)) : e;
212
251
  }
213
- let n = J(e), r = t ? J(t) : null;
214
- return n === null ? e : P.value ? r === null ? `${I.value.format(n)} –` : I.value.formatRange(n, r) : I.value.format(n);
215
- }), St = i(() => B.value.filter(Boolean).join("/")), Ct = i(() => {
216
- let e = (zt(T.value) - dt.value + 7) % 7, t = W(T.value, -e);
217
- return Array.from({ length: 6 }, (e, n) => Array.from({ length: 7 }, (e, r) => W(t, n * 7 + r)));
218
- }), wt = i(() => !P.value || !O.value ? null : k.value ?? D.value ?? null), V = i(() => O.value ? q(O.value, A.h, A.m, A.s) : null), Tt = i(() => k.value ? q(k.value, j.h, j.m, j.s) : null), Et = i(() => {
219
- if (!F.value) return "";
220
- let e = P.value ? [V.value, Tt.value] : [V.value];
252
+ let n = Z(e), r = t ? Z(t) : null;
253
+ return n === null ? e : L.value ? r === null ? `${Dt.value.format(n)} –` : Dt.value.formatRange(n, r) : Dt.value.format(n);
254
+ }), Rt = i(() => V.value.filter(Boolean).join("/")), zt = i(() => {
255
+ let e = (ln(w.value) - Tt.value + 7) % 7, t = J(w.value, -e), n = Math.ceil((e + cn(w.value)) / 7);
256
+ return Array.from({ length: n }, (e, n) => Array.from({ length: 7 }, (e, r) => J(t, n * 7 + r)));
257
+ }), H = i(() => K(w.value).y), Bt = i(() => K(w.value).m - 1), Vt = i(() => {
258
+ let e = new Intl.DateTimeFormat(y.locale, {
259
+ month: "short",
260
+ timeZone: "UTC"
261
+ }), t = new Intl.DateTimeFormat(y.locale, {
262
+ month: "long",
263
+ year: "numeric",
264
+ timeZone: "UTC"
265
+ });
266
+ return Array.from({ length: 12 }, (n, r) => {
267
+ let i = G(H.value, r + 1, 1);
268
+ return {
269
+ value: r,
270
+ text: e.format(q(i)),
271
+ label: t.format(q(i)),
272
+ disabled: vn(i, G(H.value, r + 2, 0)),
273
+ selected: r === Bt.value
274
+ };
275
+ });
276
+ }), Ht = i(() => Array.from({ length: 12 }, (e, t) => {
277
+ let n = E.value + t;
278
+ return {
279
+ value: n,
280
+ text: String(n),
281
+ label: String(n),
282
+ disabled: vn(G(n, 1, 1), G(n, 12, 31)),
283
+ selected: n === H.value
284
+ };
285
+ })), Ut = i(() => T.value === "months" ? Vt.value : Ht.value), Wt = i(() => [
286
+ 0,
287
+ 4,
288
+ 8
289
+ ].map((e) => Ut.value.slice(e, e + 4))), Gt = i(() => Ut.value.some((e) => e.value === D.value) ? D.value : Ut.value[0].value), U = i(() => T.value === "days" ? Ot.value.format(q(w.value)) : T.value === "months" ? String(H.value) : `${E.value}–${E.value + 9}`), Kt = i(() => T.value === "days" ? ["Previous month", "Next month"] : T.value === "months" ? ["Previous year", "Next year"] : ["Previous years", "Next years"]), qt = i(() => !L.value || !j.value ? null : M.value ?? A.value ?? null), W = i(() => j.value ? fn(j.value, N.h, N.m, N.s) : null), Jt = i(() => M.value ? fn(M.value, P.h, P.m, P.s) : null), Yt = i(() => {
290
+ if (!R.value) return "";
291
+ let e = L.value ? [W.value, Jt.value] : [W.value];
221
292
  for (let t of e) if (t !== null) {
222
- if (vt.value !== null && t < vt.value) return `Choose a time from ${I.value.format(vt.value)}`;
223
- if (yt.value !== null && t > yt.value) return `Choose a time up to ${I.value.format(yt.value)}`;
293
+ if (Pt.value !== null && t < Pt.value) return `Choose a time from ${Dt.value.format(Pt.value)}`;
294
+ if (Ft.value !== null && t > Ft.value) return `Choose a time up to ${Dt.value.format(Ft.value)}`;
224
295
  }
225
- return P.value && V.value !== null && Tt.value !== null && Tt.value < V.value ? "The end must be after the start" : "";
226
- }), Dt = i(() => y.mode === "duration" ? !0 : !O.value || P.value && !k.value ? !1 : !Et.value), Ot = i(() => M.d * 86400 + M.h * 3600 + M.m * 60), kt = i(() => {
296
+ return L.value && W.value !== null && Jt.value !== null && Jt.value < W.value ? "The end must be after the start" : "";
297
+ }), Xt = i(() => y.mode === "duration" ? !0 : !j.value || L.value && !M.value ? !1 : !Yt.value), Zt = i(() => F.d * 86400 + F.h * 3600 + F.m * 60), Qt = i(() => {
227
298
  let e = [{
228
299
  key: "start",
229
- label: P.value ? "Start" : "Time",
230
- clock: A
300
+ label: L.value ? "Start" : "Time",
301
+ clock: N
231
302
  }];
232
- return P.value && e.push({
303
+ return L.value && e.push({
233
304
  key: "end",
234
305
  label: "End",
235
- clock: j
306
+ clock: P
236
307
  }), e.map((e) => ({
237
308
  ...e,
238
- spinners: Yt(e.clock, e.label)
309
+ spinners: Cn(e.clock, e.label)
239
310
  }));
240
- }), At = i(() => [
241
- Z("d", "Days", 0, 999, !1, !1, () => M.d, (e) => M.d = e),
242
- Z("h", "Hours", 0, 23, !1, !1, () => M.h, (e) => M.h = e),
243
- Z("m", "Minutes", 0, 59, !1, !1, () => M.m, (e) => M.m = e)
244
- ]), jt = h(!1), Mt = i(() => b.value || jt.value), Nt = i(() => [y.hint && ct, y.errorMsg && st].filter(Boolean).join(" ") || void 0), Pt = i(() => {
311
+ }), $t = i(() => [
312
+ Sn("d", "Days", 0, 999, !1, !1, () => F.d, (e) => F.d = e),
313
+ Sn("h", "Hours", 0, 23, !1, !1, () => F.h, (e) => F.h = e),
314
+ Sn("m", "Minutes", 0, 59, !1, !1, () => F.m, (e) => F.m = e)
315
+ ]), en = h(!1), tn = i(() => b.value || en.value), nn = i(() => [y.hint && xt, y.errorMsg && bt].filter(Boolean).join(" ") || void 0), rn = i(() => {
245
316
  if (y.mode === "duration") return y.label || "Choose duration";
246
- let e = P.value ? "date range" : F.value ? "date and time" : "date";
317
+ let e = L.value ? "date range" : R.value ? "date and time" : "date";
247
318
  return y.label ? `${y.label}: choose ${e}` : `Choose ${e}`;
248
- }), Ft = i(() => y.mode === "duration" ? _e : P.value ? pe : fe);
249
- function It(e) {
319
+ }), an = i(() => y.mode === "duration" ? _e : L.value ? pe : fe);
320
+ function on(e) {
250
321
  return String(e).padStart(2, "0");
251
322
  }
252
- function Lt(e, t, n) {
323
+ function G(e, t, n) {
253
324
  let r = new Date(Date.UTC(e, t - 1, n));
254
- return `${r.getUTCFullYear()}-${It(r.getUTCMonth() + 1)}-${It(r.getUTCDate())}`;
325
+ return `${r.getUTCFullYear()}-${on(r.getUTCMonth() + 1)}-${on(r.getUTCDate())}`;
255
326
  }
256
- function H(e) {
327
+ function K(e) {
257
328
  let [t, n, r] = e.split("-").map(Number);
258
329
  return {
259
330
  y: t,
@@ -261,35 +332,39 @@ var ye = ["for"], be = {
261
332
  d: r
262
333
  };
263
334
  }
264
- function U(e) {
265
- let { y: t, m: n, d: r } = H(e);
335
+ function q(e) {
336
+ let { y: t, m: n, d: r } = K(e);
266
337
  return new Date(Date.UTC(t, n - 1, r));
267
338
  }
268
- function W(e, t) {
269
- let { y: n, m: r, d: i } = H(e);
270
- return Lt(n, r, i + t);
339
+ function J(e, t) {
340
+ let { y: n, m: r, d: i } = K(e);
341
+ return G(n, r, i + t);
271
342
  }
272
- function Rt(e, t) {
273
- let { y: n, m: r, d: i } = H(e), a = new Date(Date.UTC(n, r - 1 + t + 1, 0)).getUTCDate();
274
- return Lt(n, r + t, Math.min(i, a));
343
+ function sn(e, t) {
344
+ let { y: n, m: r, d: i } = K(e), a = new Date(Date.UTC(n, r - 1 + t + 1, 0)).getUTCDate();
345
+ return G(n, r + t, Math.min(i, a));
275
346
  }
276
- function G(e) {
347
+ function Y(e) {
277
348
  return `${e.slice(0, 7)}-01`;
278
349
  }
279
- function zt(e) {
280
- return U(e).getUTCDay();
350
+ function cn(e) {
351
+ let { y: t, m: n } = K(e);
352
+ return new Date(Date.UTC(t, n, 0)).getUTCDate();
353
+ }
354
+ function ln(e) {
355
+ return q(e).getUTCDay();
281
356
  }
282
- function Bt() {
357
+ function un() {
283
358
  try {
284
359
  let e = new Intl.Locale(y.locale ?? navigator.language), t = (e.getWeekInfo?.() ?? e.weekInfo)?.firstDay;
285
360
  if (t) return t % 7;
286
361
  } catch {}
287
362
  return 0;
288
363
  }
289
- function K(e) {
290
- let t = lt.get(N.value);
364
+ function X(e) {
365
+ let t = St.get(I.value);
291
366
  t || (t = new Intl.DateTimeFormat("en-US", {
292
- timeZone: N.value,
367
+ timeZone: I.value,
293
368
  hourCycle: "h23",
294
369
  year: "numeric",
295
370
  month: "2-digit",
@@ -297,53 +372,53 @@ var ye = ["for"], be = {
297
372
  hour: "2-digit",
298
373
  minute: "2-digit",
299
374
  second: "2-digit"
300
- }), lt.set(N.value, t));
375
+ }), St.set(I.value, t));
301
376
  let n = {};
302
377
  for (let { type: r, value: i } of t.formatToParts(e)) r !== "literal" && (n[r] = Number(i));
303
378
  return {
304
- day: Lt(n.year, n.month, n.day),
379
+ day: G(n.year, n.month, n.day),
305
380
  h: n.hour % 24,
306
381
  m: n.minute,
307
382
  s: n.second
308
383
  };
309
384
  }
310
- function Vt(e) {
311
- let t = K(e), { y: n, m: r, d: i } = H(t.day);
385
+ function dn(e) {
386
+ let t = X(e), { y: n, m: r, d: i } = K(t.day);
312
387
  return Date.UTC(n, r - 1, i, t.h, t.m, t.s) - Math.floor(e / 1e3) * 1e3;
313
388
  }
314
- function q(e, t, n, r) {
315
- let { y: i, m: a, d: o } = H(e), s = Date.UTC(i, a - 1, o, t, n, r), c = Vt(s), l = s - c, u = Vt(l);
316
- return u === c ? l : s - u;
389
+ function fn(e, t, n, r) {
390
+ let { y: i, m: a, d: o } = K(e), s = Date.UTC(i, a - 1, o, t, n, r), c = dn(s), ee = s - c, l = dn(ee);
391
+ return l === c ? ee : s - l;
317
392
  }
318
- function J(e) {
319
- let t = Qe.exec(e);
320
- if (t) return q(t[1], Number(t[2]), Number(t[3]), Number(t[4] ?? 0));
321
- if (Ze.test(e)) return q(e, 0, 0, 0);
393
+ function Z(e) {
394
+ let t = lt.exec(e);
395
+ if (t) return fn(t[1], Number(t[2]), Number(t[3]), Number(t[4] ?? 0));
396
+ if (ct.test(e)) return fn(e, 0, 0, 0);
322
397
  let n = Date.parse(e);
323
398
  return Number.isNaN(n) ? null : n;
324
399
  }
325
- function Y(e) {
326
- if (Ze.test(e)) return e;
327
- let t = J(e);
328
- return t === null ? null : K(t).day;
400
+ function Q(e) {
401
+ if (ct.test(e)) return e;
402
+ let t = Z(e);
403
+ return t === null ? null : X(t).day;
329
404
  }
330
- function X(e) {
405
+ function pn(e) {
331
406
  return new Date(e).toISOString().replace(/\.000Z$/, "Z");
332
407
  }
333
- function Ht(e) {
408
+ function mn(e) {
334
409
  let t = e.replace(/\s+/g, "");
335
410
  if (!t) return null;
336
411
  if (t === "0") return 0;
337
412
  let n = /(\d+(?:\.\d+)?)(ns|us|µs|ms|w|d|h|m|s)/y, r = 0, i = 0, a;
338
- for (; a = n.exec(t);) r += Number(a[1]) * $e[a[2]], i = n.lastIndex;
413
+ for (; a = n.exec(t);) r += Number(a[1]) * ut[a[2]], i = n.lastIndex;
339
414
  return i === t.length ? r : null;
340
415
  }
341
- function Ut(e) {
416
+ function hn(e) {
342
417
  if (e <= 0) return null;
343
418
  let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), r = Math.round(e % 60);
344
419
  return `${t ? `${t}h` : ""}${n ? `${n}m` : ""}${r ? `${r}s` : ""}` || null;
345
420
  }
346
- function Wt(e) {
421
+ function gn(e) {
347
422
  let t = Math.floor(e / 86400), n = Math.floor(e % 86400 / 3600), r = Math.floor(e % 3600 / 60), i = Math.round(e % 60);
348
423
  return [
349
424
  t && `${t}d`,
@@ -352,23 +427,26 @@ var ye = ["for"], be = {
352
427
  i && `${i}s`
353
428
  ].filter(Boolean).join(" ") || "0m";
354
429
  }
355
- function Gt(e) {
356
- return R.value && e < R.value || z.value && e > z.value ? !0 : y.isDateDisabled?.(e) ?? !1;
430
+ function _n(e) {
431
+ return z.value && e < z.value || B.value && e > B.value ? !0 : y.isDateDisabled?.(e) ?? !1;
357
432
  }
358
- function Kt(e) {
359
- return e === O.value || P.value && e === (k.value ?? wt.value);
433
+ function vn(e, t) {
434
+ return !!z.value && t < z.value || !!B.value && e > B.value;
360
435
  }
361
- function qt(e) {
362
- let t = O.value, n = wt.value;
436
+ function yn(e) {
437
+ return e === j.value || L.value && e === (M.value ?? qt.value);
438
+ }
439
+ function bn(e) {
440
+ let t = j.value, n = qt.value;
363
441
  if (!t || !n) return !1;
364
442
  let [r, i] = t <= n ? [t, n] : [n, t];
365
443
  return e >= r && e <= i;
366
444
  }
367
- function Jt(e) {
368
- let t = O.value, n = wt.value, [r, i] = t <= n ? [t, n] : [n, t];
445
+ function xn(e) {
446
+ let t = j.value, n = qt.value, [r, i] = t <= n ? [t, n] : [n, t];
369
447
  return [e === r && "rounded-l-8", e === i && "rounded-r-8"];
370
448
  }
371
- function Z(e, t, n, r, i, a, o, s) {
449
+ function Sn(e, t, n, r, i, a, o, s) {
372
450
  return {
373
451
  key: e,
374
452
  label: t,
@@ -380,257 +458,356 @@ var ye = ["for"], be = {
380
458
  set: s
381
459
  };
382
460
  }
383
- function Yt(e, t) {
384
- let n = [Z("h", `${t} hours`, 0, 23, !0, !0, () => e.h, (t) => e.h = t), Z("m", `${t} minutes`, 0, 59, !0, !0, () => e.m, (t) => e.m = t)];
385
- return y.showSeconds && n.push(Z("s", `${t} seconds`, 0, 59, !0, !0, () => e.s, (t) => e.s = t)), n;
461
+ function Cn(e, t) {
462
+ let n = [Sn("h", `${t} hours`, 0, 23, !0, !0, () => e.h, (t) => e.h = t), Sn("m", `${t} minutes`, 0, 59, !0, !0, () => e.m, (t) => e.m = t)];
463
+ return y.showSeconds && n.push(Sn("s", `${t} seconds`, 0, 59, !0, !0, () => e.s, (t) => e.s = t)), n;
386
464
  }
387
- function Xt(e) {
388
- return e.padded ? It(e.get()) : String(e.get());
465
+ function wn(e) {
466
+ return e.padded ? on(e.get()) : String(e.get());
389
467
  }
390
- function Zt(e, t) {
468
+ function Tn(e, t) {
391
469
  let n = t.get(), r = t.max - t.min + 1, i = null;
392
- e.key === "ArrowUp" ? i = n + 1 : e.key === "ArrowDown" ? i = n - 1 : e.key === "PageUp" ? i = n + 10 : e.key === "PageDown" ? i = n - 10 : e.key === "Home" ? i = t.min : e.key === "End" && (i = t.max), i !== null && (e.preventDefault(), i = t.wrap ? ((i - t.min) % r + r) % r + t.min : Math.min(t.max, Math.max(t.min, i)), t.set(i), e.target.value = Xt(t));
470
+ e.key === "ArrowUp" ? i = n + 1 : e.key === "ArrowDown" ? i = n - 1 : e.key === "PageUp" ? i = n + 10 : e.key === "PageDown" ? i = n - 10 : e.key === "Home" ? i = t.min : e.key === "End" && (i = t.max), i !== null && (e.preventDefault(), i = t.wrap ? ((i - t.min) % r + r) % r + t.min : Math.min(t.max, Math.max(t.min, i)), t.set(i), e.target.value = wn(t));
393
471
  }
394
- function Qt(e, t) {
472
+ function En(e, t) {
395
473
  let n = e.target, r = n.value.replace(/\D/g, "").slice(0, String(t.max).length);
396
474
  if (n.value = r, !r) return;
397
475
  let i = Number(r);
398
476
  i > t.max && (i = Number(r.slice(-1))), t.set(Math.max(t.min, i));
399
477
  }
400
- function $t(e, t) {
401
- e.target.value = Xt(t);
478
+ function Dn(e, t) {
479
+ e.target.value = wn(t);
402
480
  }
403
- function en() {
404
- if (D.value = null, y.mode === "duration") {
405
- let e = B.value[0] ? Ht(B.value[0]) ?? 0 : 0;
406
- M.d = Math.floor(e / 86400), M.h = Math.floor(e % 86400 / 3600), M.m = Math.floor(e % 3600 / 60);
481
+ function On() {
482
+ if (A.value = null, T.value = "days", O.value = "date", y.mode === "duration") {
483
+ let e = V.value[0] ? mn(V.value[0]) ?? 0 : 0;
484
+ F.d = Math.floor(e / 86400), F.h = Math.floor(e % 86400 / 3600), F.m = Math.floor(e % 3600 / 60);
407
485
  return;
408
486
  }
409
- let [e, t] = B.value;
410
- if (O.value = null, k.value = null, Object.assign(A, {
487
+ let [e, t] = V.value;
488
+ if (j.value = null, M.value = null, Object.assign(N, {
411
489
  h: 0,
412
490
  m: 0,
413
491
  s: 0
414
- }), Object.assign(j, {
492
+ }), Object.assign(P, {
415
493
  h: 23,
416
494
  m: 59,
417
495
  s: y.showSeconds ? 59 : 0
418
- }), F.value) {
419
- let n = e ? J(e) : null, r = t ? J(t) : null;
496
+ }), R.value) {
497
+ let n = e ? Z(e) : null, r = t ? Z(t) : null;
420
498
  if (n !== null) {
421
- let e = K(n);
422
- O.value = e.day, Object.assign(A, {
499
+ let e = X(n);
500
+ j.value = e.day, Object.assign(N, {
423
501
  h: e.h,
424
502
  m: e.m,
425
503
  s: e.s
426
504
  });
427
505
  }
428
506
  if (r !== null) {
429
- let e = K(r);
430
- k.value = e.day, Object.assign(j, {
507
+ let e = X(r);
508
+ M.value = e.day, Object.assign(P, {
431
509
  h: e.h,
432
510
  m: e.m,
433
511
  s: e.s
434
512
  });
435
513
  }
436
- } else O.value = e ? Y(e) : null, k.value = t ? Y(t) : null;
437
- let n = O.value ?? L.value;
438
- !O.value && R.value && n < R.value && (n = R.value), !O.value && z.value && n > z.value && (n = z.value), E.value = n, T.value = G(n);
514
+ } else j.value = e ? Q(e) : null, M.value = t ? Q(t) : null;
515
+ let n = j.value ?? Nt.value;
516
+ !j.value && z.value && n < z.value && (n = z.value), !j.value && B.value && n > B.value && (n = B.value), k.value = n, w.value = Y(n);
439
517
  }
440
- function tn() {
441
- let e = S.value;
518
+ function kn() {
519
+ let e = wt.value;
442
520
  if (!e) return;
443
- let t = e.getBoundingClientRect(), n = C.value?.offsetWidth ?? 300, r = C.value?.offsetHeight ?? 380, i = window.innerHeight - t.bottom - 6 - 8, a = t.top - 6 - 8, o = i < r && a > i, s = Math.max(8, Math.min(t.left, window.innerWidth - n - 8));
444
- w.value = o ? {
521
+ let t = e.getBoundingClientRect(), n = S.value?.offsetWidth ?? 300, r = S.value?.offsetHeight ?? 380, i = window.innerHeight - t.bottom - 6 - 8, a = t.top - 6 - 8, o = i < r && a > i, s = Math.max(8, Math.min(t.left, window.innerWidth - n - 8)), c = Math.min(t.width, 448);
522
+ C.value = o ? {
445
523
  bottom: window.innerHeight - t.top + 6,
446
524
  left: s,
447
- maxHeight: Math.max(200, a)
525
+ maxHeight: Math.max(200, a),
526
+ minWidth: c
448
527
  } : {
449
528
  top: t.bottom + 6,
450
529
  left: s,
451
- maxHeight: Math.max(200, i)
530
+ maxHeight: Math.max(200, i),
531
+ minWidth: c
452
532
  };
453
533
  }
454
- function nn() {
534
+ function An() {
455
535
  y.disabled || b.value || (b.value = !0);
456
536
  }
457
- function Q(e = !0) {
458
- b.value && (b.value = !1, e && S.value?.focus());
537
+ function jn(e = !0) {
538
+ b.value && (b.value = !1, e && wt.value?.focus());
459
539
  }
460
- async function rn() {
461
- en(), tn(), vn(), await te(), tn(), y.mode === "duration" ? C.value?.querySelector("input")?.focus() : an();
540
+ async function Mn() {
541
+ On(), kn(), ar(), await f(), kn(), y.mode === "duration" ? S.value?.querySelector("input")?.focus() : Nn();
462
542
  }
463
- function an() {
464
- te(() => C.value?.querySelector(`[data-day="${E.value}"]`)?.focus());
543
+ function Nn() {
544
+ f(() => S.value?.querySelector(`[data-day="${k.value}"]`)?.focus());
465
545
  }
466
546
  function $(e) {
467
- Xe.value = e, Q();
547
+ st.value = e, jn();
468
548
  }
469
- function on(e) {
470
- if (!Gt(e)) {
471
- if (E.value = e, G(e) !== T.value && (T.value = G(e), an()), !P.value) {
472
- O.value = e, F.value || $(e);
549
+ function Pn(e) {
550
+ if (!_n(e)) {
551
+ if (k.value = e, Y(e) !== w.value && (w.value = Y(e), Nn()), !L.value) {
552
+ j.value = e, R.value || $(e);
473
553
  return;
474
554
  }
475
- if (!O.value || k.value) {
476
- O.value = e, k.value = null;
555
+ if (!j.value || M.value) {
556
+ j.value = e, M.value = null;
477
557
  return;
478
558
  }
479
- e < O.value ? (k.value = O.value, O.value = e) : k.value = e, D.value = null, F.value || $([O.value, k.value]);
559
+ e < j.value ? (M.value = j.value, j.value = e) : M.value = e, A.value = null, R.value || $([j.value, M.value]);
480
560
  }
481
561
  }
482
- function sn() {
483
- if (Dt.value) {
484
- if (y.mode === "duration") return $(Ut(Ot.value));
485
- if (!F.value) return $(P.value ? [O.value, k.value] : O.value);
486
- $(P.value ? [X(V.value), X(Tt.value)] : X(V.value));
562
+ function Fn() {
563
+ if (Xt.value) {
564
+ if (y.mode === "duration") return $(hn(Zt.value));
565
+ if (!R.value) return $(L.value ? [j.value, M.value] : j.value);
566
+ $(L.value ? [pn(W.value), pn(Jt.value)] : pn(W.value));
487
567
  }
488
568
  }
489
- function cn() {
490
- let e = K(Date.now());
491
- O.value = e.day, Object.assign(A, {
569
+ function In() {
570
+ let e = X(Date.now());
571
+ j.value = e.day, Object.assign(N, {
492
572
  h: e.h,
493
573
  m: e.m,
494
574
  s: y.showSeconds ? e.s : 0
495
- }), E.value = e.day, T.value = G(e.day);
575
+ }), k.value = e.day, w.value = Y(e.day), T.value = "days", O.value === "time" && f(() => Xn("smooth"));
496
576
  }
497
- function ln() {
498
- on(L.value);
577
+ function Ln() {
578
+ Pn(Nt.value);
499
579
  }
500
- function un(e) {
580
+ function Rn(e) {
501
581
  if (e.value) return $(e.value());
502
582
  if (!e.duration) return;
503
- if (y.mode === "duration") return $(Ut(Ht(e.duration) ?? 0));
504
- let t = Math.floor(Date.now() / 1e3) * 1e3, n = t - (Ht(e.duration) ?? 0) * 1e3;
505
- if (y.mode === "date") return $(P.value ? [K(n).day, K(t).day] : K(n).day);
506
- $(P.value ? [X(n), X(t)] : X(n));
583
+ if (y.mode === "duration") return $(hn(mn(e.duration) ?? 0));
584
+ let t = Math.floor(Date.now() / 1e3) * 1e3, n = t - (mn(e.duration) ?? 0) * 1e3;
585
+ if (y.mode === "date") return $(L.value ? [X(n).day, X(t).day] : X(n).day);
586
+ $(L.value ? [pn(n), pn(t)] : pn(n));
507
587
  }
508
- function dn() {
509
- Xe.value = null, S.value?.focus();
588
+ function zn() {
589
+ st.value = null, wt.value?.focus();
510
590
  }
511
- function fn(e) {
512
- T.value = Rt(T.value, e), E.value = Rt(E.value, e);
591
+ function Bn(e) {
592
+ w.value = sn(w.value, e), k.value = sn(k.value, e);
513
593
  }
514
- function pn(e) {
515
- let t = E.value, n = (zt(t) - dt.value + 7) % 7, r = {
516
- ArrowLeft: () => W(t, -1),
517
- ArrowRight: () => W(t, 1),
518
- ArrowUp: () => W(t, -7),
519
- ArrowDown: () => W(t, 7),
520
- Home: () => W(t, -n),
521
- End: () => W(t, 6 - n),
522
- PageUp: () => Rt(t, e.shiftKey ? -12 : -1),
523
- PageDown: () => Rt(t, e.shiftKey ? 12 : 1)
594
+ function Vn(e) {
595
+ T.value === "days" ? Bn(e) : T.value === "months" ? w.value = sn(w.value, 12 * e) : E.value += 10 * e;
596
+ }
597
+ function Hn() {
598
+ T.value = "months", D.value = Bt.value, Wn();
599
+ }
600
+ function Un() {
601
+ T.value = "years", E.value = Math.floor(H.value / 10) * 10, D.value = H.value, Wn();
602
+ }
603
+ function Wn() {
604
+ f(() => S.value?.querySelector(`[data-pick="${Gt.value}"]`)?.focus());
605
+ }
606
+ function Gn(e) {
607
+ if (!e.disabled) {
608
+ if (T.value === "years") {
609
+ w.value = G(e.value, Bt.value + 1, 1), Hn();
610
+ return;
611
+ }
612
+ w.value = G(H.value, e.value + 1, 1), k.value = G(H.value, e.value + 1, Math.min(K(k.value).d, cn(w.value))), T.value = "days", Nn();
613
+ }
614
+ }
615
+ function Kn(e) {
616
+ if (e.key === "Escape") {
617
+ e.preventDefault(), e.stopPropagation(), T.value === "years" ? Hn() : (T.value = "days", Nn());
618
+ return;
619
+ }
620
+ if (e.key === "Enter" || e.key === " ") {
621
+ e.preventDefault();
622
+ let t = Ut.value.find((e) => e.value === D.value);
623
+ t && Gn(t);
624
+ return;
625
+ }
626
+ let t = T.value === "years", n = t ? E.value : 0, r = {
627
+ ArrowLeft: -1,
628
+ ArrowRight: 1,
629
+ ArrowUp: -4,
630
+ ArrowDown: 4
631
+ }, i;
632
+ if (e.key in r) i = D.value + r[e.key];
633
+ else if (e.key === "Home") i = n;
634
+ else if (e.key === "End") i = n + 11;
635
+ else if (e.key === "PageUp" || e.key === "PageDown") {
636
+ e.preventDefault(), Vn(e.key === "PageUp" ? -1 : 1), t && (D.value += e.key === "PageUp" ? -10 : 10), Wn();
637
+ return;
638
+ } else return;
639
+ e.preventDefault(), t ? i < E.value ? E.value -= 10 : i > E.value + 11 && (E.value += 10) : i = Math.max(0, Math.min(11, i)), D.value = i, Wn();
640
+ }
641
+ function qn(e) {
642
+ O.value = e, e === "time" && f(() => Xn("instant"));
643
+ }
644
+ function Jn(e) {
645
+ if (![
646
+ "ArrowLeft",
647
+ "ArrowRight",
648
+ "Home",
649
+ "End"
650
+ ].includes(e.key)) return;
651
+ e.preventDefault();
652
+ let t = e.key === "Home" ? "date" : e.key === "End" || O.value === "date" ? "time" : "date";
653
+ qn(t), f(() => S.value?.querySelector(`[data-tab="${t}"]`)?.focus());
654
+ }
655
+ function Yn(e) {
656
+ return Array.from({ length: e.max - e.min + 1 }, (t, n) => e.min + n);
657
+ }
658
+ function Xn(e) {
659
+ let t = e === "smooth" && !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
660
+ S.value?.querySelectorAll("[data-time-list]").forEach((e) => {
661
+ let n = e.querySelector("[aria-selected=true]");
662
+ n && e.scrollTo({
663
+ top: n.offsetTop - (e.clientHeight - n.offsetHeight) / 2,
664
+ behavior: t ? "smooth" : "instant"
665
+ });
666
+ });
667
+ }
668
+ function Zn(e) {
669
+ S.value?.querySelector(`[data-time-list="${e}"] [aria-selected=true]`)?.focus({ preventScroll: !0 });
670
+ }
671
+ function Qn(e, t, n) {
672
+ e.set(t), f(() => {
673
+ Xn("smooth"), Zn(n);
674
+ });
675
+ }
676
+ function $n(e, t, n) {
677
+ if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
678
+ e.preventDefault();
679
+ let t = [...S.value?.querySelectorAll("[data-time-list]") ?? []].map((e) => e.dataset.timeList), r = t[t.indexOf(n) + (e.key === "ArrowRight" ? 1 : -1)];
680
+ r && Zn(r);
681
+ return;
682
+ }
683
+ let r = t.get(), i = {
684
+ ArrowUp: r - 1,
685
+ ArrowDown: r + 1,
686
+ PageUp: r - 5,
687
+ PageDown: r + 5,
688
+ Home: t.min,
689
+ End: t.max
690
+ };
691
+ e.key in i && (e.preventDefault(), Qn(t, Math.min(t.max, Math.max(t.min, i[e.key])), n));
692
+ }
693
+ function er(e) {
694
+ let t = k.value, n = (ln(t) - Tt.value + 7) % 7, r = {
695
+ ArrowLeft: () => J(t, -1),
696
+ ArrowRight: () => J(t, 1),
697
+ ArrowUp: () => J(t, -7),
698
+ ArrowDown: () => J(t, 7),
699
+ Home: () => J(t, -n),
700
+ End: () => J(t, 6 - n),
701
+ PageUp: () => sn(t, e.shiftKey ? -12 : -1),
702
+ PageDown: () => sn(t, e.shiftKey ? 12 : 1)
524
703
  };
525
704
  if (e.key === "Enter" || e.key === " ") {
526
- e.preventDefault(), on(t);
705
+ e.preventDefault(), Pn(t);
527
706
  return;
528
707
  }
529
708
  let i = r[e.key];
530
- i && (e.preventDefault(), E.value = i(), T.value = G(E.value), P.value && O.value && !k.value && (D.value = E.value), an());
709
+ i && (e.preventDefault(), k.value = i(), w.value = Y(k.value), L.value && j.value && !M.value && (A.value = k.value), Nn());
531
710
  }
532
- function mn(e) {
711
+ function tr(e) {
533
712
  if (e.key === "Escape") {
534
- e.preventDefault(), e.stopPropagation(), Q();
713
+ e.preventDefault(), e.stopPropagation(), jn();
535
714
  return;
536
715
  }
537
- if (e.key !== "Tab" || !C.value) return;
538
- let t = [...C.value.querySelectorAll("button:not([disabled]), input:not([disabled])")].filter((e) => e.tabIndex >= 0);
716
+ if (e.key !== "Tab" || !S.value) return;
717
+ let t = [...S.value.querySelectorAll("button:not([disabled]), input:not([disabled])")].filter((e) => e.tabIndex >= 0);
539
718
  if (!t.length) return;
540
719
  let n = t[0], r = t[t.length - 1];
541
720
  e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
542
721
  }
543
- function hn(e) {
544
- (e.key === "ArrowDown" || e.key === "ArrowUp" && e.altKey) && (e.preventDefault(), nn());
722
+ function nr(e) {
723
+ (e.key === "ArrowDown" || e.key === "ArrowUp" && e.altKey) && (e.preventDefault(), An());
545
724
  }
546
- function gn(e) {
725
+ function rr(e) {
547
726
  let t = e.target;
548
- ut.value?.contains(t) || C.value?.contains(t) || Q(!1);
727
+ Ct.value?.contains(t) || S.value?.contains(t) || jn(!1);
549
728
  }
550
- function _n(e) {
551
- e?.target instanceof Node && C.value?.contains(e.target) || tn();
729
+ function ir(e) {
730
+ e?.target instanceof Node && S.value?.contains(e.target) || kn();
552
731
  }
553
- function vn() {
554
- document.addEventListener("pointerdown", gn, !0), window.addEventListener("scroll", _n, !0), window.addEventListener("resize", _n);
732
+ function ar() {
733
+ document.addEventListener("pointerdown", rr, !0), window.addEventListener("scroll", ir, !0), window.addEventListener("resize", ir);
555
734
  }
556
- function yn() {
557
- document.removeEventListener("pointerdown", gn, !0), window.removeEventListener("scroll", _n, !0), window.removeEventListener("resize", _n);
735
+ function or() {
736
+ document.removeEventListener("pointerdown", rr, !0), window.removeEventListener("scroll", ir, !0), window.removeEventListener("resize", ir);
558
737
  }
559
- return ue(b, (e) => e ? rn() : yn()), ie(() => {
560
- b.value && rn();
561
- }), re(yn), f({ focus: () => S.value?.focus() }), (i, f) => (m(), s("div", ee({
738
+ return ue(b, (e) => e ? Mn() : or()), ie(() => {
739
+ b.value && Mn();
740
+ }), re(or), d({ focus: () => wt.value?.focus() }), (i, d) => (m(), s("div", te({
562
741
  ref_key: "root",
563
- ref: ut
564
- }, nt.value, {
565
- class: ["w-full", d.disabled && "opacity-50"],
742
+ ref: Ct
743
+ }, ht.value, {
744
+ class: ["w-full", u.disabled && "opacity-50"],
566
745
  "data-ac-ds": "",
567
746
  "data-testid": "ac-date-picker"
568
747
  }), [
569
- d.label ? (m(), s("label", {
748
+ u.label ? (m(), s("label", {
570
749
  key: 0,
571
- id: it,
750
+ id: _t,
572
751
  for: `${v(x)}-trigger`,
573
752
  class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
574
- }, [c("span", null, _(d.label), 1), d.required ? (m(), s("span", be, "*")) : o("", !0)], 8, ye)) : o("", !0),
575
- d.hint ? (m(), s("p", {
753
+ }, [c("span", null, _(u.label), 1), u.required ? (m(), s("span", be, "*")) : o("", !0)], 8, ye)) : o("", !0),
754
+ u.hint ? (m(), s("p", {
576
755
  key: 1,
577
- id: ct,
756
+ id: xt,
578
757
  class: "mb-2 text-base text-muted"
579
- }, _(d.hint), 1)) : o("", !0),
580
- c("div", xe, [c("button", ee({
758
+ }, _(u.hint), 1)) : o("", !0),
759
+ c("div", xe, [c("button", te({
581
760
  id: `${v(x)}-trigger`,
582
761
  ref_key: "trigger",
583
- ref: S
584
- }, rt.value, {
762
+ ref: wt
763
+ }, gt.value, {
585
764
  type: "button",
586
- disabled: d.disabled,
765
+ disabled: u.disabled,
587
766
  "aria-haspopup": "dialog",
588
767
  "aria-expanded": b.value,
589
- "aria-labelledby": d.label ? `${it} ${at}` : at,
590
- "aria-describedby": Nt.value,
591
- "aria-invalid": !!d.errorMsg || void 0,
592
- "aria-required": d.required || void 0,
593
- class: ["flex w-full items-center rounded-10 border bg-background pr-16 text-left text-base font-normal text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none disabled:cursor-not-allowed", [
594
- d.size === "small" ? "h-9 pl-3" : "h-10 pl-4",
595
- d.disabled ? "" : "cursor-pointer",
596
- d.errorMsg ? ["border-danger/60", Mt.value && "border-danger shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]"] : Mt.value ? "focus-ring" : ["border-border", !d.disabled && "hover:border-accent-active"]
768
+ "aria-labelledby": u.label ? `${_t} ${vt}` : vt,
769
+ "aria-describedby": nn.value,
770
+ "aria-invalid": !!u.errorMsg || void 0,
771
+ "aria-required": u.required || void 0,
772
+ class: ["flex w-full items-center rounded-10 border bg-background text-left text-base font-normal text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none disabled:cursor-not-allowed", [
773
+ u.size === "small" ? "h-9 pl-3" : "h-10.5 pl-4",
774
+ u.clearable && It.value && !u.disabled ? "pr-20" : "pr-10",
775
+ u.disabled ? "" : "cursor-pointer hover:bg-accent-hover",
776
+ u.errorMsg ? ["border-danger/60", tn.value && "border-danger shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]"] : tn.value ? "focus-ring" : ["border-border", !u.disabled && "hover:border-accent-active"]
597
777
  ]],
598
- onClick: f[0] ||= (e) => b.value ? Q() : nn(),
599
- onKeydown: hn,
600
- onFocus: f[1] ||= (e) => jt.value = !0,
601
- onBlur: f[2] ||= (e) => jt.value = !1
778
+ onClick: d[0] ||= (e) => b.value ? jn() : An(),
779
+ onKeydown: nr,
780
+ onFocus: d[1] ||= (e) => en.value = !0,
781
+ onBlur: d[2] ||= (e) => en.value = !1
602
782
  }), [c("span", {
603
- id: at,
604
- class: p(["truncate tabular-nums", !xt.value && "text-muted/80"])
605
- }, _(xt.value || d.placeholder || (d.mode === "duration" ? "Choose duration" : "Choose date")), 3)], 16, Se), c("span", Ce, [d.clearable && bt.value && !d.disabled ? (m(), s("button", {
783
+ id: vt,
784
+ class: p(["truncate tabular-nums", !Lt.value && "text-muted/80"])
785
+ }, _(Lt.value || u.placeholder || (u.mode === "duration" ? "Choose duration" : "Choose date")), 3)], 16, Se), c("span", { class: p(["pointer-events-none absolute inset-y-0 flex items-center gap-4 text-muted", u.size === "small" ? "right-3" : "right-4"]) }, [u.clearable && It.value && !u.disabled ? (m(), s("button", {
606
786
  key: 0,
607
787
  type: "button",
608
- class: "pointer-events-auto inline-flex size-7 cursor-pointer items-center justify-center rounded-8 transition-colors duration-200 hover:bg-surface-sunken hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
609
- "aria-label": d.label ? `Clear ${d.label}` : "Clear",
610
- onClick: dn
611
- }, [u(v(ve), {
788
+ class: "pointer-events-auto inline-flex cursor-pointer items-center justify-center rounded-full p-1 transition-colors duration-200 hover:bg-accent-hover hover:text-primary active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
789
+ "aria-label": u.label ? `Clear ${u.label}` : "Clear",
790
+ onClick: zn
791
+ }, [l(v(ve), {
612
792
  class: "size-4",
613
793
  "aria-hidden": "true"
614
- })], 8, we)) : o("", !0), (m(), a(oe(Ft.value), {
615
- class: p(["mx-1.5 size-4", b.value && "text-heading"]),
794
+ })], 8, Ce)) : o("", !0), (m(), a(oe(an.value), {
795
+ class: p(["size-4", b.value && "text-heading"]),
616
796
  "aria-hidden": "true"
617
- }, null, 8, ["class"]))])]),
618
- d.errorMsg ? (m(), s("p", {
797
+ }, null, 8, ["class"]))], 2)]),
798
+ u.errorMsg ? (m(), s("p", {
619
799
  key: 2,
620
- id: st,
621
- class: "mt-1.5 flex items-center gap-1.5 text-base text-danger-strong",
800
+ id: bt,
801
+ class: "mt-1 text-base text-danger-strong",
622
802
  role: "alert"
623
- }, [u(v(ge), {
624
- class: "size-4 shrink-0",
625
- "aria-hidden": "true"
626
- }), l(" " + _(d.errorMsg), 1)])) : o("", !0),
627
- d.name ? (m(), s("input", {
803
+ }, _(u.errorMsg), 1)) : o("", !0),
804
+ u.name ? (m(), s("input", {
628
805
  key: 3,
629
806
  type: "hidden",
630
- name: d.name,
631
- value: St.value
632
- }, null, 8, Te)) : o("", !0),
633
- (m(), a(n, { to: "body" }, [u(r, {
807
+ name: u.name,
808
+ value: Rt.value
809
+ }, null, 8, we)) : o("", !0),
810
+ (m(), a(n, { to: "body" }, [l(r, {
634
811
  "enter-active-class": "transition duration-150 ease-out motion-reduce:transition-opacity",
635
812
  "enter-from-class": "opacity-0 scale-95",
636
813
  "leave-active-class": "transition duration-100 ease-in",
@@ -639,143 +816,192 @@ var ye = ["for"], be = {
639
816
  default: de(() => [b.value ? (m(), s("div", {
640
817
  key: 0,
641
818
  ref_key: "panel",
642
- ref: C,
819
+ ref: S,
643
820
  role: "dialog",
644
821
  "aria-modal": "true",
645
- "aria-label": Pt.value,
646
- class: "ac-scrollbar fixed z-[90] flex max-w-[calc(100vw-16px)] flex-col rounded-14 border border-border bg-surface shadow-lg sm:flex-row",
822
+ "aria-label": rn.value,
823
+ class: "ac-scrollbar fixed z-[90] flex max-w-[calc(100vw-16px)] flex-col rounded-10 border border-border bg-surface shadow-sm sm:flex-row",
647
824
  style: ne({
648
- top: w.value.top === void 0 ? void 0 : `${w.value.top}px`,
649
- bottom: w.value.bottom === void 0 ? void 0 : `${w.value.bottom}px`,
650
- left: `${w.value.left}px`,
651
- maxHeight: `${w.value.maxHeight}px`
825
+ top: C.value.top === void 0 ? void 0 : `${C.value.top}px`,
826
+ bottom: C.value.bottom === void 0 ? void 0 : `${C.value.bottom}px`,
827
+ left: `${C.value.left}px`,
828
+ maxHeight: `${C.value.maxHeight}px`,
829
+ minWidth: `${C.value.minWidth}px`
652
830
  }),
653
831
  "data-ac-ds": "",
654
832
  "data-testid": "ac-date-picker-panel",
655
- onKeydown: mn
656
- }, [d.presets.length ? (m(), s("div", De, [(m(!0), s(t, null, g(d.presets, (e) => (m(), s("button", {
833
+ onKeydown: tr
834
+ }, [u.presets.length ? (m(), s("div", Ee, [(m(!0), s(t, null, g(u.presets, (e) => (m(), s("button", {
657
835
  key: e.label,
658
836
  type: "button",
659
837
  class: "cursor-pointer rounded-8 px-3 py-2 text-left text-base text-heading transition-colors duration-200 hover:bg-accent-hover active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset max-sm:rounded-full max-sm:border max-sm:border-border max-sm:px-2.5 max-sm:py-1 max-sm:text-xs",
660
- onClick: (t) => un(e)
661
- }, _(e.label), 9, Oe))), 128))])) : o("", !0), c("div", { class: p(["max-w-full min-w-0", d.mode === "duration" ? "w-72" : "w-[calc(276px*var(--ac-scale))]"]) }, [d.mode === "duration" ? (m(), s("div", ke, [
662
- c("p", Ae, _(d.label || "Duration"), 1),
663
- c("p", je, _(Wt(Ot.value)), 1),
664
- c("div", Me, [(m(!0), s(t, null, g(At.value, (e) => (m(), s("label", {
838
+ onClick: (t) => Rn(e)
839
+ }, _(e.label), 9, De))), 128))])) : o("", !0), c("div", { class: p(["max-w-full min-w-0 flex-auto max-sm:w-auto", u.mode === "duration" ? "w-72" : "w-[calc(328px*var(--ac-scale))]"]) }, [u.mode === "duration" ? (m(), s("div", Oe, [
840
+ c("p", ke, _(u.label || "Duration"), 1),
841
+ c("p", Ae, _(gn(Zt.value)), 1),
842
+ c("div", je, [(m(!0), s(t, null, g($t.value, (e) => (m(), s("label", {
665
843
  key: e.key,
666
844
  class: "block"
667
- }, [c("span", Ne, _(e.label), 1), c("input", {
845
+ }, [c("span", Me, _(e.label), 1), c("input", {
668
846
  type: "text",
669
847
  inputmode: "numeric",
670
848
  role: "spinbutton",
671
849
  autocomplete: "off",
672
- value: Xt(e),
850
+ value: wn(e),
673
851
  "aria-valuenow": e.get(),
674
852
  "aria-valuemin": e.min,
675
853
  "aria-valuemax": e.max,
676
854
  class: "h-10 w-full rounded-10 border border-border bg-background px-2.5 text-center text-base text-heading tabular-nums transition-[border-color,box-shadow] duration-200 outline-none hover:border-accent-active focus:focus-ring",
677
- onKeydown: (t) => Zt(t, e),
678
- onInput: (t) => Qt(t, e),
679
- onBlur: (t) => $t(t, e),
680
- onFocus: f[3] ||= (e) => e.target.select()
681
- }, null, 40, Pe)]))), 128))]),
682
- f[10] ||= c("p", { class: "mt-2 text-xs text-muted" }, "↑ ↓ to adjust, or type a number.", -1)
683
- ])) : (m(), s("div", Fe, [
684
- c("div", Ie, [
685
- c("button", {
686
- type: "button",
687
- class: "inline-flex size-8 cursor-pointer items-center justify-center rounded-8 text-muted transition-colors duration-200 hover:bg-accent-hover hover:text-heading active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
688
- "aria-label": "Previous month",
689
- onClick: f[4] ||= (e) => fn(-1)
690
- }, [u(v(me), {
691
- class: "size-4",
692
- "aria-hidden": "true"
693
- })]),
694
- c("p", {
695
- id: ot,
696
- class: "text-base font-semibold tracking-tight text-heading",
697
- "aria-live": "polite"
698
- }, _(pt.value.format(U(T.value))), 1),
699
- c("button", {
700
- type: "button",
701
- class: "inline-flex size-8 cursor-pointer items-center justify-center rounded-8 text-muted transition-colors duration-200 hover:bg-accent-hover hover:text-heading active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
702
- "aria-label": "Next month",
703
- onClick: f[5] ||= (e) => fn(1)
704
- }, [u(v(he), {
705
- class: "size-4",
706
- "aria-hidden": "true"
707
- })])
708
- ]),
709
- c("table", {
710
- role: "grid",
711
- "aria-labelledby": ot,
712
- class: "border-collapse",
713
- onKeydown: pn
714
- }, [c("thead", null, [c("tr", null, [(m(!0), s(t, null, g(gt.value, (e) => (m(), s("th", {
715
- key: e.long,
716
- scope: "col",
717
- abbr: e.long,
718
- class: "h-8 w-9 text-center text-xs font-medium text-muted"
719
- }, _(e.short.slice(0, 2)), 9, Le))), 128))])]), c("tbody", { onMouseleave: f[6] ||= (e) => D.value = null }, [(m(!0), s(t, null, g(Ct.value, (e, n) => (m(), s("tr", { key: n }, [(m(!0), s(t, null, g(e, (e) => (m(), s("td", {
720
- key: e,
721
- role: "gridcell",
722
- "aria-selected": Kt(e) || qt(e),
723
- class: "p-0 py-0.5"
724
- }, [c("div", { class: p(qt(e) && ["bg-primary/10", ...Jt(e)]) }, [c("button", {
855
+ onKeydown: (t) => Tn(t, e),
856
+ onInput: (t) => En(t, e),
857
+ onBlur: (t) => Dn(t, e),
858
+ onFocus: d[3] ||= (e) => e.target.select()
859
+ }, null, 40, Ne)]))), 128))]),
860
+ d[10] ||= c("p", { class: "mt-2 text-xs text-muted" }, "↑ ↓ to adjust, or type a number.", -1)
861
+ ])) : (m(), s(t, { key: 1 }, [R.value ? (m(), s("div", {
862
+ key: 0,
863
+ role: "tablist",
864
+ "aria-label": "Date or time",
865
+ class: "flex border-b border-border",
866
+ onKeydown: Jn
867
+ }, [(m(), s(t, null, g(pt, (e) => c("button", {
868
+ id: `${v(x)}-tab-${e.key}`,
869
+ key: e.key,
870
+ type: "button",
871
+ role: "tab",
872
+ "data-tab": e.key,
873
+ "aria-selected": O.value === e.key,
874
+ "aria-controls": `${v(x)}-tabpanel`,
875
+ tabindex: O.value === e.key ? 0 : -1,
876
+ class: p(["flex flex-1 cursor-pointer items-center justify-center gap-2 px-4 py-2 text-base font-medium transition-colors duration-200 focus-visible:ring-2 focus-visible:outline-none focus-visible:ring-inset", O.value === e.key ? "bg-primary text-white focus-visible:ring-white/70" : "text-heading hover:bg-accent-hover focus-visible:ring-ring active:bg-accent-active"]),
877
+ onClick: (t) => qn(e.key)
878
+ }, [(m(), a(oe(e.icon), {
879
+ class: "size-4",
880
+ "aria-hidden": "true"
881
+ })), ee(" " + _(e.label), 1)], 10, Pe)), 64))], 32)) : o("", !0), c("div", {
882
+ id: `${v(x)}-tabpanel`,
883
+ class: "p-3",
884
+ role: R.value ? "tabpanel" : void 0,
885
+ "aria-labelledby": R.value ? `${v(x)}-tab-${O.value}` : void 0
886
+ }, [O.value === "date" ? (m(), s(t, { key: 0 }, [c("div", Ie, [
887
+ c("button", {
725
888
  type: "button",
726
- "data-day": e,
727
- tabindex: e === E.value ? 0 : -1,
728
- "aria-label": mt.value.format(U(e)),
729
- "aria-disabled": Gt(e) || void 0,
730
- "aria-current": e === L.value ? "date" : void 0,
731
- class: p(["relative inline-flex size-9 items-center justify-center rounded-8 text-base tabular-nums transition-colors duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface", [Gt(e) ? "cursor-not-allowed text-muted/50 line-through" : Kt(e) ? "cursor-pointer bg-primary font-semibold text-white shadow-button" : ["cursor-pointer hover:bg-accent-hover active:bg-accent-active", e === L.value ? "font-semibold text-primary-strong ring-1 ring-primary/40 ring-inset" : G(e) === T.value ? "text-heading" : "text-muted/70"]]]),
732
- onClick: (t) => on(e),
733
- onMouseenter: (t) => P.value && O.value && !k.value && (D.value = e)
734
- }, _(ht.value.format(U(e))), 43, ze)], 2)], 8, Re))), 128))]))), 128))], 32)], 32),
735
- F.value ? (m(), s("div", Be, [(m(!0), s(t, null, g(kt.value, (e) => (m(), s("div", {
736
- key: e.key,
737
- class: "flex items-center justify-between gap-3",
738
- role: "group",
739
- "aria-label": `${e.label} time`
740
- }, [c("span", He, _(e.label), 1), c("span", Ue, [(m(!0), s(t, null, g(e.spinners, (e, n) => (m(), s(t, { key: e.key }, [n > 0 ? (m(), s("span", We, ":")) : o("", !0), c("input", {
741
- type: "text",
742
- inputmode: "numeric",
743
- role: "spinbutton",
744
- autocomplete: "off",
745
- maxlength: "2",
746
- value: Xt(e),
747
- "aria-label": e.label,
748
- "aria-valuenow": e.get(),
749
- "aria-valuemin": e.min,
750
- "aria-valuemax": e.max,
751
- class: "h-8 w-11 rounded-8 border border-border bg-background text-center text-base text-heading tabular-nums transition-[border-color,box-shadow] duration-200 outline-none hover:border-accent-active focus:focus-ring",
752
- onKeydown: (t) => Zt(t, e),
753
- onInput: (t) => Qt(t, e),
754
- onBlur: (t) => $t(t, e),
755
- onFocus: f[7] ||= (e) => e.target.select()
756
- }, null, 40, Ge)], 64))), 128))])], 8, Ve))), 128)), c("p", Ke, [l("Times in " + _(_t.value), 1), _t.value === N.value ? o("", !0) : (m(), s(t, { key: 0 }, [l(" (" + _(N.value) + ")", 1)], 64))])])) : o("", !0)
757
- ])), F.value || d.mode === "duration" || !P.value ? (m(), s("div", qe, [
758
- d.mode !== "duration" && !P.value ? (m(), s("button", {
889
+ class: "inline-flex cursor-pointer items-center justify-center rounded-8 p-2 text-muted transition-colors duration-200 hover:bg-accent-hover hover:text-heading active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
890
+ "aria-label": Kt.value[0],
891
+ onClick: d[4] ||= (e) => Vn(-1)
892
+ }, [l(v(me), {
893
+ class: "size-4",
894
+ "aria-hidden": "true"
895
+ })], 8, Le),
896
+ c("span", {
897
+ id: yt,
898
+ class: "sr-only",
899
+ "aria-live": "polite"
900
+ }, _(U.value), 1),
901
+ T.value === "years" ? (m(), s("span", ze, _(U.value), 1)) : (m(), s("button", {
902
+ key: 0,
903
+ type: "button",
904
+ class: "cursor-pointer rounded-10 bg-accent px-4 py-2 text-base font-semibold text-heading tabular-nums transition-colors duration-200 hover:bg-accent-hover active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
905
+ "aria-label": T.value === "days" ? `${U.value}, choose month` : `${U.value}, choose year`,
906
+ onClick: d[5] ||= (e) => T.value === "days" ? Hn() : Un()
907
+ }, _(U.value), 9, Re)),
908
+ c("button", {
909
+ type: "button",
910
+ class: "inline-flex cursor-pointer items-center justify-center rounded-8 p-2 text-muted transition-colors duration-200 hover:bg-accent-hover hover:text-heading active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
911
+ "aria-label": Kt.value[1],
912
+ onClick: d[6] ||= (e) => Vn(1)
913
+ }, [l(v(he), {
914
+ class: "size-4",
915
+ "aria-hidden": "true"
916
+ })], 8, Be)
917
+ ]), T.value === "days" ? (m(), s("table", {
918
+ key: 0,
919
+ role: "grid",
920
+ "aria-labelledby": yt,
921
+ class: "w-full table-fixed border-collapse",
922
+ onKeydown: er
923
+ }, [c("thead", null, [c("tr", null, [(m(!0), s(t, null, g(jt.value, (e) => (m(), s("th", {
924
+ key: e.long,
925
+ scope: "col",
926
+ abbr: e.long,
927
+ class: "pt-2 pb-2 text-center text-xs font-medium text-heading"
928
+ }, _(e.short.slice(0, 2)), 9, Ve))), 128))])]), c("tbody", { onMouseleave: d[7] ||= (e) => A.value = null }, [(m(!0), s(t, null, g(zt.value, (e, n) => (m(), s("tr", { key: n }, [(m(!0), s(t, null, g(e, (e) => (m(), s("td", {
929
+ key: e,
930
+ role: "gridcell",
931
+ "aria-selected": yn(e) || bn(e),
932
+ class: "p-0 py-0.5"
933
+ }, [c("div", { class: p(["px-0.5", bn(e) && Y(e) === w.value && ["bg-primary/10", ...xn(e)]]) }, [c("button", {
934
+ type: "button",
935
+ "data-day": e,
936
+ tabindex: e === k.value ? 0 : -1,
937
+ "aria-label": kt.value.format(q(e)),
938
+ "aria-disabled": _n(e) || void 0,
939
+ "aria-current": e === Nt.value ? "date" : void 0,
940
+ class: p(["relative flex aspect-square w-full items-center justify-center rounded-8 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface motion-reduce:transition-none", [Y(e) !== w.value && "invisible", _n(e) ? "cursor-not-allowed text-muted/50 line-through" : yn(e) ? "cursor-pointer bg-primary font-semibold text-white" : e === Nt.value ? "cursor-pointer bg-accent font-medium text-heading hover:bg-accent-hover active:bg-accent-active" : "cursor-pointer text-heading hover:bg-accent-hover hover:font-semibold active:bg-accent-active"]]),
941
+ onClick: (t) => Pn(e),
942
+ onMouseenter: (t) => L.value && j.value && !M.value && (A.value = e)
943
+ }, _(At.value.format(q(e))), 43, Ue)], 2)], 8, He))), 128))]))), 128))], 32)], 32)) : (m(), s("div", {
944
+ key: 1,
945
+ role: "grid",
946
+ "aria-label": T.value === "months" ? `Months of ${U.value}` : `Years ${U.value}`,
947
+ class: "grid gap-2",
948
+ onKeydown: Kn
949
+ }, [(m(!0), s(t, null, g(Wt.value, (e, n) => (m(), s("div", {
950
+ key: n,
951
+ role: "row",
952
+ class: "grid grid-cols-4 gap-2"
953
+ }, [(m(!0), s(t, null, g(e, (e) => (m(), s("button", {
954
+ key: e.value,
955
+ type: "button",
956
+ role: "gridcell",
957
+ "data-pick": e.value,
958
+ tabindex: e.value === Gt.value ? 0 : -1,
959
+ "aria-label": e.label,
960
+ "aria-selected": e.selected,
961
+ "aria-disabled": e.disabled || void 0,
962
+ class: p(["rounded-8 px-4 py-3 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface motion-reduce:transition-none", e.disabled ? "cursor-not-allowed text-muted/50 line-through" : e.selected ? "cursor-pointer bg-primary font-semibold text-white" : "cursor-pointer text-heading hover:bg-accent-hover hover:font-semibold active:bg-accent-active"]),
963
+ onClick: (t) => Gn(e),
964
+ onFocus: (t) => D.value = e.value
965
+ }, _(e.text), 43, Ge))), 128))]))), 128))], 40, We))], 64)) : (m(), s(t, { key: 1 }, [c("div", Ke, [(m(!0), s(t, null, g(Qt.value, (e, n) => (m(), s(t, { key: e.key }, [n > 0 ? (m(), s("span", qe)) : o("", !0), c("div", {
966
+ class: "flex min-w-0 flex-1 flex-col",
967
+ role: "group",
968
+ "aria-label": `${e.label} time`
969
+ }, [L.value ? (m(), s("p", Ye, _(e.label), 1)) : o("", !0), c("div", Xe, [(m(!0), s(t, null, g(e.spinners, (n, r) => (m(), s(t, { key: n.key }, [r > 0 ? (m(), s("span", Ze, ":")) : o("", !0), c("div", Qe, [c("span", $e, _(ft[n.key]), 1), c("div", {
970
+ role: "listbox",
971
+ "aria-label": n.label,
972
+ "data-time-list": `${e.key}-${n.key}`,
973
+ class: "relative min-h-0 w-full flex-1 scroll-smooth overflow-x-hidden overflow-y-auto [scrollbar-width:none] motion-reduce:scroll-auto [&::-webkit-scrollbar]:hidden",
974
+ onKeydown: (t) => $n(t, n, `${e.key}-${n.key}`)
975
+ }, [c("div", tt, [(m(!0), s(t, null, g(Yn(n), (t) => (m(), s("button", {
976
+ key: t,
977
+ type: "button",
978
+ role: "option",
979
+ tabindex: t === n.get() ? 0 : -1,
980
+ "aria-selected": t === n.get(),
981
+ class: p(["inline-flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-8 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset motion-reduce:transition-none", t === n.get() ? "scale-110 bg-primary font-bold text-white" : "text-heading hover:bg-accent-hover hover:font-bold active:bg-accent-active"]),
982
+ onClick: (r) => Qn(n, t, `${e.key}-${n.key}`)
983
+ }, _(on(t)), 11, nt))), 128))])], 40, et)])], 64))), 128))])], 8, Je)], 64))), 128))]), c("p", rt, [ee("Times in " + _(Mt.value), 1), Mt.value === I.value ? o("", !0) : (m(), s(t, { key: 0 }, [ee(" (" + _(I.value) + ")", 1)], 64))])], 64))], 8, Fe)], 64)), R.value || u.mode === "duration" || !L.value ? (m(), s("div", it, [
984
+ u.mode !== "duration" && !L.value ? (m(), s("button", {
759
985
  key: 0,
760
986
  type: "button",
761
- class: "inline-flex h-8 cursor-pointer items-center rounded-8 px-2.5 text-base font-medium text-primary-strong transition-colors duration-200 hover:bg-primary/10 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
762
- disabled: Gt(L.value),
763
- onClick: f[8] ||= (e) => F.value ? cn() : ln()
764
- }, _(F.value ? "Now" : "Today"), 9, Je)) : o("", !0),
765
- Et.value ? (m(), s("p", Ye, _(Et.value), 1)) : o("", !0),
766
- f[11] ||= c("span", { class: "flex-1" }, null, -1),
767
- F.value || d.mode === "duration" ? (m(), s(t, { key: 2 }, [u(e, {
987
+ class: "cursor-pointer rounded-8 bg-accent px-3 py-1.5 text-xs font-medium text-heading transition-colors duration-200 hover:bg-accent-hover active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
988
+ disabled: _n(Nt.value),
989
+ onClick: d[8] ||= (e) => R.value ? In() : Ln()
990
+ }, _(R.value ? "Now" : "Today"), 9, at)) : o("", !0),
991
+ Yt.value ? (m(), s("p", ot, _(Yt.value), 1)) : o("", !0),
992
+ d[11] ||= c("span", { class: "flex-1" }, null, -1),
993
+ R.value || u.mode === "duration" ? (m(), s(t, { key: 2 }, [l(e, {
768
994
  title: "Cancel",
769
995
  color: "white",
770
996
  size: "small",
771
- onClick: f[9] ||= (e) => Q()
772
- }), u(e, {
997
+ onClick: d[9] ||= (e) => jn()
998
+ }), l(e, {
773
999
  title: "Apply",
774
1000
  size: "small",
775
- disabled: !Dt.value,
776
- onClick: sn
1001
+ disabled: !Xt.value,
1002
+ onClick: Fn
777
1003
  }, null, 8, ["disabled"])], 64)) : o("", !0)
778
- ])) : o("", !0)], 2)], 44, Ee)) : o("", !0)]),
1004
+ ])) : o("", !0)], 2)], 44, Te)) : o("", !0)]),
779
1005
  _: 1
780
1006
  })]))
781
1007
  ], 16));