@astryx-vue/core 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/dist/AppShell/index.js +1 -1
  2. package/dist/{AppShell-EiGyPFbA.js → AppShell-Cb41gIAj.js} +2 -2
  3. package/dist/Avatar/index.d.ts +1 -1
  4. package/dist/Avatar/index.js +1 -1
  5. package/dist/Avatar-jmHInHwj.js +244 -0
  6. package/dist/AvatarGroup/index.d.ts +1 -1
  7. package/dist/AvatarGroup/index.js +1 -1
  8. package/dist/{AvatarGroup-CZcgAMjM.js → AvatarGroup-QyzSrpYA.js} +8 -7
  9. package/dist/Badge/index.d.ts +2 -1
  10. package/dist/Badge/index.js +1 -1
  11. package/dist/Badge-CjDQPF5g.js +30 -0
  12. package/dist/Banner/index.d.ts +1 -1
  13. package/dist/Breadcrumbs/index.d.ts +2 -2
  14. package/dist/Breadcrumbs/index.js +1 -1
  15. package/dist/{Breadcrumbs-C3YZFQ9w.js → Breadcrumbs-CTQ7fjDn.js} +45 -11
  16. package/dist/ButtonGroup/index.d.ts +1 -1
  17. package/dist/Calendar/index.d.ts +2 -2
  18. package/dist/Calendar/index.js +1 -1
  19. package/dist/Calendar-BFaI5AMv.js +352 -0
  20. package/dist/Card/index.d.ts +1 -1
  21. package/dist/Carousel/index.js +1 -1
  22. package/dist/{Carousel-BTtHkKea.js → Carousel-X0cuQkvg.js} +2 -2
  23. package/dist/Chat/index.d.ts +2 -2
  24. package/dist/Chat/index.js +2 -2
  25. package/dist/Chat-M0tiGrNT.js +3148 -0
  26. package/dist/CheckboxInput/index.d.ts +1 -1
  27. package/dist/CheckboxList/index.d.ts +1 -1
  28. package/dist/CheckboxList/index.js +1 -1
  29. package/dist/Citation/index.js +1 -1
  30. package/dist/{Citation-DijdbUUu.js → Citation-C1veUk5p.js} +2 -2
  31. package/dist/ClickableCard/index.d.ts +1 -1
  32. package/dist/Code/index.js +1 -1
  33. package/dist/{CodeBlock-CxTb6j9_.js → CodeBlock-DesTJAkm.js} +1 -1
  34. package/dist/Collapsible/index.js +1 -1
  35. package/dist/{Collapsible-9MC08X39.js → Collapsible-BestK35V.js} +1 -1
  36. package/dist/CommandPalette/index.js +1 -1
  37. package/dist/{CommandPalette-BD2iODF5.js → CommandPalette-BArt97V8.js} +1 -1
  38. package/dist/ComplexSelector/index.d.ts +1 -1
  39. package/dist/ComplexSelector/index.js +1 -1
  40. package/dist/{ComplexSelector-D9iXd5cH.js → ComplexSelector-CAoig1RK.js} +2 -2
  41. package/dist/ContextMenu/index.d.ts +2 -2
  42. package/dist/ContextMenu/index.js +1 -1
  43. package/dist/{ContextMenu-HS_WqYIg.js → ContextMenu-9Im6i43E.js} +101 -63
  44. package/dist/DateInput/index.d.ts +2 -2
  45. package/dist/DateInput/index.js +1 -1
  46. package/dist/DateInput-BLocxqC3.js +376 -0
  47. package/dist/DateRangeInput/index.d.ts +1 -1
  48. package/dist/DateRangeInput/index.js +1 -1
  49. package/dist/{DateRangeInput-1bhPGG2s.js → DateRangeInput-DwDy3eRo.js} +2 -2
  50. package/dist/DateTimeInput/index.d.ts +1 -1
  51. package/dist/DateTimeInput/index.js +1 -1
  52. package/dist/{DateTimeInput-SnPdgk6P.js → DateTimeInput-BYiaC9bn.js} +5 -3
  53. package/dist/DropdownMenu/index.d.ts +3 -2
  54. package/dist/DropdownMenu/index.js +3 -2
  55. package/dist/DropdownMenu-Ddfr-aEC.js +164 -0
  56. package/dist/{DropdownMenu-UJGych6v.js → DropdownMenu-Dh-WAHKb.js} +63 -16
  57. package/dist/FileInput/index.d.ts +1 -1
  58. package/dist/FileInput/index.js +1 -1
  59. package/dist/{FileInput-BQiwE-GB.js → FileInput-DLO6V12n.js} +2 -2
  60. package/dist/Icon/index.d.ts +4 -3
  61. package/dist/Icon/index.js +3 -2
  62. package/dist/Icon/plugin.d.ts +45 -0
  63. package/dist/Icon/plugin.js +177 -0
  64. package/dist/Icon-CJKjdJy-.js +198 -0
  65. package/dist/Lightbox/index.js +1 -1
  66. package/dist/{Lightbox-CshKoB0r.js → Lightbox-CdFCS_EA.js} +2 -2
  67. package/dist/Link/index.d.ts +1 -1
  68. package/dist/Link/index.js +1 -1
  69. package/dist/Link-DqdQZ37C.js +141 -0
  70. package/dist/Markdown/index.js +1 -1
  71. package/dist/{Markdown-D-Ua055V.js → Markdown-BqKloI3w.js} +3 -3
  72. package/dist/MetadataList/index.js +1 -1
  73. package/dist/{MetadataList-sYph_d8Q.js → MetadataList-CvZkmisf.js} +1 -1
  74. package/dist/MobileNav/index.js +1 -1
  75. package/dist/{MobileNavToggle-DD9D01aj.js → MobileNavToggle-Bwi0qXXM.js} +1 -1
  76. package/dist/MoreMenu/index.d.ts +1 -1
  77. package/dist/MoreMenu/index.js +1 -1
  78. package/dist/{MoreMenu-BVrK5kkk.js → MoreMenu-BwJaJrkB.js} +2 -2
  79. package/dist/MultiSelector/index.js +1 -1
  80. package/dist/{MultiSelector-DiYov9sF.js → MultiSelector-C-ETfFy_.js} +2 -2
  81. package/dist/NumberInput/index.d.ts +2 -2
  82. package/dist/NumberInput/index.js +1 -1
  83. package/dist/NumberInput-DjetVB8O.js +210 -0
  84. package/dist/Outline/index.js +1 -1
  85. package/dist/{Outline-DQfEBxlc.js → Outline-Bz9c-u5y.js} +1 -1
  86. package/dist/OverflowList/index.d.ts +1 -1
  87. package/dist/OverflowList/index.js +1 -1
  88. package/dist/{OverflowList-BU5VCntl.js → OverflowList-ED-KN9Y5.js} +1 -1
  89. package/dist/Overlay/index.d.ts +1 -1
  90. package/dist/Pagination/index.d.ts +2 -2
  91. package/dist/Pagination/index.js +1 -1
  92. package/dist/{Pagination-HdhtykeF.js → Pagination-Cb66HMEf.js} +76 -22
  93. package/dist/PowerSearch/index.d.ts +2 -0
  94. package/dist/PowerSearch/index.js +2 -0
  95. package/dist/PowerSearch-CjU8y4mi.js +2386 -0
  96. package/dist/ProgressBar/index.d.ts +1 -1
  97. package/dist/ProgressBar/index.js +1 -1
  98. package/dist/{ProgressBar-ChDp-7oe.js → ProgressBar-DO9Chic6.js} +31 -11
  99. package/dist/Radio/index.d.ts +1 -1
  100. package/dist/RadioList/index.d.ts +1 -1
  101. package/dist/Resizable/index.d.ts +1 -1
  102. package/dist/Resizable/index.js +1 -1
  103. package/dist/{Resizable-BhSMfO5B.js → Resizable-D-TBCg0Y.js} +1 -1
  104. package/dist/ScrollableArea/index.d.ts +1 -1
  105. package/dist/SelectableCard/index.d.ts +1 -1
  106. package/dist/Selector/index.d.ts +2 -2
  107. package/dist/Selector/index.js +1 -1
  108. package/dist/Selector-DE2IEFML.js +468 -0
  109. package/dist/SideNav/index.d.ts +1 -1
  110. package/dist/SideNav/index.js +1 -1
  111. package/dist/{SideNav-B-Om6Bz3.js → SideNav-DonEfiAx.js} +17 -17
  112. package/dist/Stepper/index.js +1 -1
  113. package/dist/{Stepper-BZ_8SEZt.js → Stepper-D2ZIcUNx.js} +1 -1
  114. package/dist/Switch/index.d.ts +1 -1
  115. package/dist/TabList/index.d.ts +1 -1
  116. package/dist/TabList/index.js +1 -1
  117. package/dist/{TabList-Cnc2Hs1H.js → TabList-D3F-stq-.js} +10 -3
  118. package/dist/Table/index.d.ts +3 -3
  119. package/dist/Table/index.js +2 -2
  120. package/dist/Table-CrP2Uffq.js +1982 -0
  121. package/dist/TextArea/index.d.ts +1 -1
  122. package/dist/TextArea/index.js +1 -1
  123. package/dist/{TextArea-Cv9UVbzS.js → TextArea-CPwSytdO.js} +12 -6
  124. package/dist/TextInput/index.d.ts +1 -1
  125. package/dist/Thumbnail/index.js +1 -1
  126. package/dist/{Thumbnail-Dc1UpykG.js → Thumbnail-BC5JGPGZ.js} +11 -11
  127. package/dist/{TimeField-C7t9Knq9.js → TimeField-DpHFrNv0.js} +2 -2
  128. package/dist/TimeInput/index.d.ts +1 -1
  129. package/dist/TimeInput/index.js +1 -1
  130. package/dist/{TimeInput-BXxCOY98.js → TimeInput-DJLV0_4z.js} +1 -1
  131. package/dist/Timestamp/index.d.ts +1 -1
  132. package/dist/Timestamp/index.js +2 -1
  133. package/dist/{Timestamp-DlZSmgCJ.js → Timestamp-GKNjjt5g.js} +4 -121
  134. package/dist/Toast/index.d.ts +2 -2
  135. package/dist/Toast/index.js +1 -1
  136. package/dist/{Toast-BKXPvEMp.js → Toast-C2ML-bmi.js} +37 -7
  137. package/dist/ToggleButton/index.d.ts +1 -1
  138. package/dist/Token/index.js +1 -1
  139. package/dist/{Token-wt4e80IM.js → Token-Chu_eCVs.js} +1 -1
  140. package/dist/Tokenizer/index.js +1 -1
  141. package/dist/{Tokenizer-nmTqdS9n.js → Tokenizer-DRDpvQ_l.js} +3 -3
  142. package/dist/Toolbar/index.d.ts +1 -1
  143. package/dist/TopNav/index.d.ts +1 -1
  144. package/dist/TopNav/index.js +1 -1
  145. package/dist/{TopNav-notp-mJx.js → TopNav-CEyWddtA.js} +3 -3
  146. package/dist/TreeList/index.js +1 -1
  147. package/dist/{TreeList-s1xBQ0qq.js → TreeList-COS8US8e.js} +3 -3
  148. package/dist/Typeahead/index.js +1 -1
  149. package/dist/{Typeahead-VAuiCurV.js → Typeahead-P7cCqtaQ.js} +3 -3
  150. package/dist/{useTypeaheadMenu-Ba7XpcZl.js → TypeaheadMenu-CGvo0Tud.js} +107 -107
  151. package/dist/composables/index.d.ts +3 -3
  152. package/dist/{context-Dbo22sck.js → context-CiKncNSH.js} +184 -6
  153. package/dist/formatInstant-BDWUIxS7.js +119 -0
  154. package/dist/{index-SMh42NI8.d.ts → index-B1TG2GPS.d.ts} +2 -2
  155. package/dist/{index-DRmb-oUa.d.ts → index-B9WzWqzk.d.ts} +3 -29
  156. package/dist/{index-BuubzuE8.d.ts → index-BDZCJ9ri.d.ts} +2 -2
  157. package/dist/{index-z4p2k9VR.d.ts → index-Bgv4ZmBl.d.ts} +20 -2
  158. package/dist/{index-BoRIw-bP.d.ts → index-Bt7ewoz2.d.ts} +32 -2
  159. package/dist/{index-uQrLBZfF.d.ts → index-Bu3oXIIS.d.ts} +24 -0
  160. package/dist/index-CJlBAXwj.d.ts +100 -0
  161. package/dist/{index-DT9S92sh.d.ts → index-CNjbOgty.d.ts} +15 -0
  162. package/dist/{index-DXSs3rwa.d.ts → index-CngORuiq.d.ts} +137 -2
  163. package/dist/index-Cs5pcwY3.d.ts +416 -0
  164. package/dist/{index-NzLDrOkk.d.ts → index-D4I_obqR.d.ts} +14 -1
  165. package/dist/{index-BtPZKO20.d.ts → index-DGXviOlp.d.ts} +49 -7
  166. package/dist/{index-CTolyeii.d.ts → index-DN7MXPHM.d.ts} +15 -1
  167. package/dist/{index-C6iJwTL0.d.ts → index-DNRBbwp_.d.ts} +165 -55
  168. package/dist/{index-C59PdX9L.d.ts → index-DWH_HzXi.d.ts} +1 -1
  169. package/dist/{index-BfOtLyNH.d.ts → index-D_nYxnNv.d.ts} +1 -1
  170. package/dist/{index-Bn_odHQ9.d.ts → index-Dg3ZmwEg.d.ts} +12 -1
  171. package/dist/{index-BiMGXtD-.d.ts → index-DimuSES0.d.ts} +14 -1
  172. package/dist/{index-DEeJowZf.d.ts → index-cGagYM1g.d.ts} +15 -2
  173. package/dist/{index-Ck8qy6Rf.d.ts → index-c_TaW8mM.d.ts} +24 -2
  174. package/dist/index-kVhSuA9t.d.ts +902 -0
  175. package/dist/{index-1uRMrk63.d.ts → index-nCEmW6wa.d.ts} +1 -1
  176. package/dist/{index-DoFCm2Q2.d.ts → index-qiZtHnGK.d.ts} +26 -0
  177. package/dist/{index-Bainr_3n.d.ts → index-u5ozu0G7.d.ts} +2 -2
  178. package/dist/index.d.ts +79 -76
  179. package/dist/index.js +111 -100
  180. package/dist/locale/index.d.ts +1 -1
  181. package/dist/locale/index.js +1 -1
  182. package/dist/power-search-DrDfcoL1.d.ts +68 -0
  183. package/dist/registry-B1ObuP--.d.ts +45 -0
  184. package/dist/registry-C7OZb0PJ.js +135 -0
  185. package/dist/{types-JktRxujg.d.ts → types-Cp4liug-.d.ts} +66 -3
  186. package/dist/{index-B8MbfMwV.d.ts → types-DDAAT1Xd.d.ts} +36 -82
  187. package/dist/types-DIYwbkpe.d.ts +33 -0
  188. package/dist/{types-DZoEm_DG.d.ts → types-pnljWjEE.d.ts} +23 -6
  189. package/dist/{useResizable-CeESZS1v.d.ts → useResizable-CUoNPmUw.d.ts} +1 -1
  190. package/package.json +10 -1
  191. package/styles/avatar.css +14 -0
  192. package/styles/badge.css +8 -0
  193. package/styles/breadcrumbs.css +6 -1
  194. package/styles/button.css +13 -0
  195. package/styles/calendar.css +16 -0
  196. package/styles/card.css +2 -0
  197. package/styles/chat.css +474 -3
  198. package/styles/dropdown-menu.css +11 -0
  199. package/styles/icon.css +58 -8
  200. package/styles/link.css +5 -0
  201. package/styles/number-input.css +22 -0
  202. package/styles/pagination.css +45 -1
  203. package/styles/power-search.css +303 -0
  204. package/styles/progress-bar.css +4 -0
  205. package/styles/selector.css +58 -0
  206. package/styles/tab-list.css +15 -0
  207. package/styles/table.css +304 -1
  208. package/styles/text-area.css +17 -0
  209. package/styles/text-input.css +5 -0
  210. package/styles/toast.css +7 -0
  211. package/styles/toolbar.css +11 -0
  212. package/styles.css +1 -0
  213. package/dist/Avatar-5s3HSrtN.js +0 -136
  214. package/dist/Badge-Ba0EwsTj.js +0 -19
  215. package/dist/Calendar-BG7wEsro.js +0 -277
  216. package/dist/Chat-DjNxw5gv.js +0 -1051
  217. package/dist/DateInput-DE2TN1Rq.js +0 -250
  218. package/dist/Icon-Dfr4k6-S.js +0 -86
  219. package/dist/Link-CprjOuTI.js +0 -92
  220. package/dist/NumberInput-CTYiQxHq.js +0 -147
  221. package/dist/Selector-Da-2BO3q.js +0 -325
  222. package/dist/Table-D-LhAy_J.js +0 -967
  223. package/dist/index-DJo-BmXZ.d.ts +0 -431
  224. package/dist/index-DtjAdYEc.d.ts +0 -68
  225. package/dist/{CheckboxList-EsIEXjK_.js → CheckboxList-BbCPiend.js} +1 -1
@@ -0,0 +1,352 @@
1
+ import { t as useGridRovingFocus } from "./useGridRovingFocus-DQQAOYH5.js";
2
+ import { a as useAstryxMessages, i as useAstryxLocale } from "./context-CiKncNSH.js";
3
+ import { n as weekdayNames, t as formatCalendarMonth } from "./locale-Cpk_nrLA.js";
4
+ import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent, normalizeClass, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useId, withKeys } from "vue";
5
+ import { CalendarDate, getLocalTimeZone, today } from "@internationalized/date";
6
+ import "../styles/calendar.css";
7
+ //#region src/composables/useCalendar.ts
8
+ function calendarDateToJSDate(date) {
9
+ return new Date(date.year, date.month - 1, date.day);
10
+ }
11
+ function jsDateToCalendarDate(date) {
12
+ return new CalendarDate(date.getFullYear(), date.getMonth() + 1, date.getDate());
13
+ }
14
+ /**
15
+ * 日历逻辑:日期计算、月份导航、日期选择。
16
+ */
17
+ function useCalendar(options) {
18
+ const { value, min, max, isDateDisabled, onChange, initialDate } = options;
19
+ const timeZone = getLocalTimeZone();
20
+ const focusedDate = ref(initialDate ? jsDateToCalendarDate(initialDate) : value.value ? jsDateToCalendarDate(value.value) : today(timeZone));
21
+ function datesFor(month) {
22
+ const firstDay = new CalendarDate(month.year, month.month, 1);
23
+ const firstDayOfWeek = firstDay.toDate(timeZone).getDay();
24
+ const startDate = firstDay.subtract({ days: firstDayOfWeek });
25
+ const weeks = [];
26
+ let currentDate = startDate;
27
+ for (let week = 0; week < 6; week++) {
28
+ const weekDates = [];
29
+ for (let day = 0; day < 7; day++) {
30
+ weekDates.push(currentDate);
31
+ currentDate = currentDate.add({ days: 1 });
32
+ }
33
+ weeks.push(weekDates);
34
+ }
35
+ return weeks;
36
+ }
37
+ const dates = computed(() => datesFor(focusedDate.value));
38
+ function select(date) {
39
+ if (isDisabled(date)) return;
40
+ onChange(calendarDateToJSDate(date));
41
+ }
42
+ function previousMonth() {
43
+ focusedDate.value = focusedDate.value.subtract({ months: 1 });
44
+ }
45
+ function nextMonth() {
46
+ focusedDate.value = focusedDate.value.add({ months: 1 });
47
+ }
48
+ function isSelected(date) {
49
+ if (!value.value) return false;
50
+ const selected = jsDateToCalendarDate(value.value);
51
+ return date.compare(selected) === 0;
52
+ }
53
+ function isDisabled(date) {
54
+ const jsDate = calendarDateToJSDate(date);
55
+ if (min && jsDate < min) return true;
56
+ if (max && jsDate > max) return true;
57
+ if (isDateDisabled?.(jsDate)) return true;
58
+ return false;
59
+ }
60
+ function isInMonth(date) {
61
+ return date.month === focusedDate.value.month;
62
+ }
63
+ return {
64
+ focusedDate,
65
+ dates,
66
+ datesFor,
67
+ select,
68
+ previousMonth,
69
+ nextMonth,
70
+ isSelected,
71
+ isDisabled,
72
+ isInMonth
73
+ };
74
+ }
75
+ //#endregion
76
+ //#region src/Calendar/Calendar.vue
77
+ const _hoisted_1 = ["data-months", "aria-label"];
78
+ const _hoisted_2 = { class: "astryx-calendar-header" };
79
+ const _hoisted_3 = ["disabled", "aria-label"];
80
+ const _hoisted_4 = { class: "astryx-calendar-month-year" };
81
+ const _hoisted_5 = ["disabled", "aria-label"];
82
+ const _hoisted_6 = { class: "astryx-calendar-month-year" };
83
+ const _hoisted_7 = ["disabled", "aria-label"];
84
+ const _hoisted_8 = {
85
+ class: "astryx-calendar-weekdays",
86
+ role: "row"
87
+ };
88
+ const _hoisted_9 = ["aria-label"];
89
+ const _hoisted_10 = ["aria-activedescendant", "onKeydown"];
90
+ const _hoisted_11 = [
91
+ "id",
92
+ "aria-selected",
93
+ "aria-disabled",
94
+ "aria-current",
95
+ "onClick",
96
+ "onKeydown"
97
+ ];
98
+ const _hoisted_12 = { class: "astryx-calendar-day" };
99
+ const _sfc_main = /*@__PURE__*/ defineComponent({
100
+ name: "AstryxCalendar",
101
+ __name: "Calendar",
102
+ props: {
103
+ modelValue: { default: null },
104
+ mode: { default: "single" },
105
+ range: { default: null },
106
+ numberOfMonths: { default: 1 },
107
+ focusDate: {},
108
+ min: {},
109
+ max: {},
110
+ isDateDisabled: {},
111
+ label: {},
112
+ disabled: {
113
+ type: Boolean,
114
+ default: false
115
+ }
116
+ },
117
+ emits: [
118
+ "update:modelValue",
119
+ "update:range",
120
+ "change"
121
+ ],
122
+ setup(__props, { emit: __emit }) {
123
+ const props = __props;
124
+ const emit = __emit;
125
+ const calendarId = `astryx-calendar-${useId()}`;
126
+ const locale = useAstryxLocale();
127
+ const messages = useAstryxMessages();
128
+ const resolvedLabel = computed(() => props.label ?? messages.value.calendar.label);
129
+ const weekDays = computed(() => weekdayNames(locale.value, "narrow"));
130
+ const weekDayLabels = computed(() => weekdayNames(locale.value, "long"));
131
+ const modelValueRef = computed({
132
+ get: () => props.modelValue,
133
+ set: (value) => {
134
+ emit("update:modelValue", value);
135
+ emit("change", value);
136
+ }
137
+ });
138
+ const calendar = useCalendar({
139
+ value: modelValueRef,
140
+ initialDate: props.focusDate,
141
+ min: props.min,
142
+ max: props.max,
143
+ isDateDisabled: props.isDateDisabled,
144
+ onChange: (value) => {
145
+ modelValueRef.value = value;
146
+ }
147
+ });
148
+ const months = computed(() => {
149
+ const first = calendar.focusedDate.value;
150
+ return props.numberOfMonths === 2 ? [first, first.add({ months: 1 })] : [first];
151
+ });
152
+ const timeZone = getLocalTimeZone();
153
+ const todayDate = today(timeZone);
154
+ const activeIndex = ref(0);
155
+ const isEnabled = computed(() => !props.disabled);
156
+ const grid = useGridRovingFocus({
157
+ rows: computed(() => 6),
158
+ columns: computed(() => 7),
159
+ activeIndex,
160
+ isEnabled,
161
+ isDisabled: (row, col) => {
162
+ const dateIndex = row * 7 + col;
163
+ const date = calendar.dates.value.flat()[dateIndex];
164
+ return date ? calendar.isDisabled(date) : true;
165
+ },
166
+ onChange: (index) => {
167
+ activeIndex.value = index;
168
+ }
169
+ });
170
+ function getCellId(rowIndex, colIndex) {
171
+ return `${calendarId}-cell-${rowIndex}-${colIndex}`;
172
+ }
173
+ function isToday(date) {
174
+ return date.compare(todayDate) === 0;
175
+ }
176
+ function sameDay(date, day) {
177
+ return !!date && date.getFullYear() === day.year && date.getMonth() + 1 === day.month && date.getDate() === day.day;
178
+ }
179
+ function isRangeStart(date) {
180
+ return props.mode === "range" && sameDay(props.range?.start ?? null, date);
181
+ }
182
+ function isRangeEnd(date) {
183
+ return props.mode === "range" && sameDay(props.range?.end ?? null, date);
184
+ }
185
+ function isInRange(date) {
186
+ if (props.mode !== "range") return false;
187
+ const start = props.range?.start;
188
+ const end = props.range?.end;
189
+ if (!start || !end) return false;
190
+ const day = new Date(date.year, date.month - 1, date.day);
191
+ return day > (start < end ? start : end) && day < (start < end ? end : start);
192
+ }
193
+ function selectRange(date) {
194
+ const day = new Date(date.year, date.month - 1, date.day);
195
+ const start = props.range?.start ?? null;
196
+ const end = props.range?.end ?? null;
197
+ emit("update:range", !start || end ? {
198
+ start: day,
199
+ end: null
200
+ } : day < start ? {
201
+ start: day,
202
+ end: start
203
+ } : {
204
+ start,
205
+ end: day
206
+ });
207
+ emit("change", day);
208
+ }
209
+ function onDateClick(date, rowIndex, colIndex) {
210
+ if (props.disabled || calendar.isDisabled(date)) return;
211
+ activeIndex.value = rowIndex * 7 + colIndex;
212
+ if (props.mode === "range") {
213
+ selectRange(date);
214
+ return;
215
+ }
216
+ calendar.select(date);
217
+ }
218
+ function onKeyDown(event) {
219
+ if (props.disabled) return;
220
+ grid.onKeyDown(event);
221
+ if (event.key === "Enter" || event.key === " ") {
222
+ event.preventDefault();
223
+ const date = calendar.dates.value.flat()[activeIndex.value];
224
+ if (date && !calendar.isDisabled(date)) calendar.select(date);
225
+ }
226
+ }
227
+ return (_ctx, _cache) => {
228
+ return openBlock(), createElementBlock("div", {
229
+ id: calendarId,
230
+ class: normalizeClass(["astryx-calendar", { "is-disabled": props.disabled }]),
231
+ "data-months": props.numberOfMonths,
232
+ role: "application",
233
+ "aria-label": resolvedLabel.value
234
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(months.value, (month, monthIndex) => {
235
+ return openBlock(), createElementBlock("div", {
236
+ key: `${month.year}-${month.month}`,
237
+ class: "astryx-calendar-month"
238
+ }, [
239
+ createElementVNode("div", _hoisted_2, [monthIndex === 0 ? renderSlot(_ctx.$slots, "header", {}, () => [
240
+ createElementVNode("button", {
241
+ type: "button",
242
+ class: "astryx-calendar-nav-button",
243
+ disabled: props.disabled,
244
+ "aria-label": unref(messages).calendar.previousMonth,
245
+ onClick: _cache[0] || (_cache[0] = (...args) => unref(calendar).previousMonth && unref(calendar).previousMonth(...args))
246
+ }, [..._cache[3] || (_cache[3] = [createElementVNode("svg", {
247
+ width: "16",
248
+ height: "16",
249
+ viewBox: "0 0 16 16",
250
+ fill: "none"
251
+ }, [createElementVNode("path", {
252
+ d: "M10 12L6 8L10 4",
253
+ stroke: "currentColor",
254
+ "stroke-width": "1.5",
255
+ "stroke-linecap": "round",
256
+ "stroke-linejoin": "round"
257
+ })], -1)])], 8, _hoisted_3),
258
+ createElementVNode("span", _hoisted_4, toDisplayString(unref(formatCalendarMonth)(month.year, month.month, unref(locale))), 1),
259
+ props.numberOfMonths === 1 ? (openBlock(), createElementBlock("button", {
260
+ key: 0,
261
+ type: "button",
262
+ class: "astryx-calendar-nav-button",
263
+ disabled: props.disabled,
264
+ "aria-label": unref(messages).calendar.nextMonth,
265
+ onClick: _cache[1] || (_cache[1] = (...args) => unref(calendar).nextMonth && unref(calendar).nextMonth(...args))
266
+ }, [..._cache[4] || (_cache[4] = [createElementVNode("svg", {
267
+ width: "16",
268
+ height: "16",
269
+ viewBox: "0 0 16 16",
270
+ fill: "none"
271
+ }, [createElementVNode("path", {
272
+ d: "M6 4L10 8L6 12",
273
+ stroke: "currentColor",
274
+ "stroke-width": "1.5",
275
+ "stroke-linecap": "round",
276
+ "stroke-linejoin": "round"
277
+ })], -1)])], 8, _hoisted_5)) : createCommentVNode("v-if", true)
278
+ ], void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("span", _hoisted_6, toDisplayString(unref(formatCalendarMonth)(month.year, month.month, unref(locale))), 1), createElementVNode("button", {
279
+ type: "button",
280
+ class: "astryx-calendar-nav-button",
281
+ disabled: props.disabled,
282
+ "aria-label": unref(messages).calendar.nextMonth,
283
+ onClick: _cache[2] || (_cache[2] = (...args) => unref(calendar).nextMonth && unref(calendar).nextMonth(...args))
284
+ }, [..._cache[5] || (_cache[5] = [createElementVNode("svg", {
285
+ width: "16",
286
+ height: "16",
287
+ viewBox: "0 0 16 16",
288
+ fill: "none"
289
+ }, [createElementVNode("path", {
290
+ d: "M6 4L10 8L6 12",
291
+ stroke: "currentColor",
292
+ "stroke-width": "1.5",
293
+ "stroke-linecap": "round",
294
+ "stroke-linejoin": "round"
295
+ })], -1)])], 8, _hoisted_7)], 64))]),
296
+ createElementVNode("div", _hoisted_8, [(openBlock(true), createElementBlock(Fragment, null, renderList(weekDays.value, (day, index) => {
297
+ return openBlock(), createElementBlock("div", {
298
+ key: index,
299
+ class: "astryx-calendar-weekday",
300
+ role: "columnheader",
301
+ "aria-label": weekDayLabels.value[index]
302
+ }, toDisplayString(day), 9, _hoisted_9);
303
+ }), 128))]),
304
+ createElementVNode("div", {
305
+ class: "astryx-calendar-grid",
306
+ role: "grid",
307
+ "aria-labelledby": calendarId,
308
+ "aria-activedescendant": monthIndex === 0 ? getCellId(unref(grid).row.value, unref(grid).column.value) : void 0,
309
+ tabindex: "0",
310
+ onKeydown: ($event) => monthIndex === 0 ? onKeyDown($event) : void 0
311
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(calendar).datesFor(month), (week, rowIndex) => {
312
+ return openBlock(), createElementBlock("div", {
313
+ key: rowIndex,
314
+ class: "astryx-calendar-row",
315
+ role: "row"
316
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(week, (date, colIndex) => {
317
+ return openBlock(), createElementBlock("div", {
318
+ id: monthIndex === 0 ? getCellId(rowIndex, colIndex) : void 0,
319
+ key: colIndex,
320
+ class: normalizeClass(["astryx-calendar-cell", {
321
+ "is-selected": props.mode === "range" ? isRangeStart(date) || isRangeEnd(date) : unref(calendar).isSelected(date),
322
+ "is-range-start": isRangeStart(date),
323
+ "is-range-end": isRangeEnd(date),
324
+ "is-in-range": isInRange(date),
325
+ "is-disabled": unref(calendar).isDisabled(date),
326
+ "is-today": isToday(date),
327
+ "is-other-month": date.month !== month.month || date.year !== month.year,
328
+ "is-active": monthIndex === 0 && activeIndex.value === rowIndex * 7 + colIndex
329
+ }]),
330
+ role: "gridcell",
331
+ "aria-selected": props.mode === "range" ? isRangeStart(date) || isRangeEnd(date) : unref(calendar).isSelected(date),
332
+ "aria-disabled": unref(calendar).isDisabled(date),
333
+ "aria-current": isToday(date) ? "date" : void 0,
334
+ tabindex: "-1",
335
+ onClick: ($event) => onDateClick(date, rowIndex, colIndex),
336
+ onKeydown: withKeys(($event) => onDateClick(date, rowIndex, colIndex), ["enter"])
337
+ }, [renderSlot(_ctx.$slots, "day", {
338
+ date,
339
+ isSelected: props.mode === "range" ? isRangeStart(date) || isRangeEnd(date) : unref(calendar).isSelected(date),
340
+ isDisabled: unref(calendar).isDisabled(date),
341
+ isToday: isToday(date),
342
+ isInMonth: date.month === month.month && date.year === month.year
343
+ }, () => [createElementVNode("span", _hoisted_12, toDisplayString(date.day), 1)])], 42, _hoisted_11);
344
+ }), 128))]);
345
+ }), 128))], 40, _hoisted_10)
346
+ ]);
347
+ }), 128))], 10, _hoisted_1);
348
+ };
349
+ }
350
+ });
351
+ //#endregion
352
+ export { _sfc_main as t };
@@ -1,2 +1,2 @@
1
- import { a as CardSlots, i as CardSizeValue, n as CardElevation, o as CardVariant, r as CardProps, t as _default } from "../index-BfOtLyNH.js";
1
+ import { a as CardSlots, i as CardSizeValue, n as CardElevation, o as CardVariant, r as CardProps, t as _default } from "../index-D_nYxnNv.js";
2
2
  export { _default as Card, type CardElevation, type CardProps, type CardSizeValue, type CardSlots, type CardVariant };
@@ -1,2 +1,2 @@
1
- import { t as _sfc_main } from "../Carousel-BTtHkKea.js";
1
+ import { t as _sfc_main } from "../Carousel-X0cuQkvg.js";
2
2
  export { _sfc_main as Carousel };
@@ -1,6 +1,6 @@
1
- import { a as useAstryxMessages } from "./context-Dbo22sck.js";
1
+ import { a as useAstryxMessages } from "./context-CiKncNSH.js";
2
2
  import { t as _sfc_main$1 } from "./IconButton-BNQuz9W_.js";
3
- import { t as _sfc_main$2 } from "./Icon-Dfr4k6-S.js";
3
+ import { t as _sfc_main$2 } from "./Icon-CJKjdJy-.js";
4
4
  import { Comment, Fragment, Text, computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, unref, useSlots, watch, withCtx } from "vue";
5
5
  import "../styles/carousel.css";
6
6
  //#region src/Carousel/slides.ts
@@ -1,2 +1,2 @@
1
- import { A as ChatMessageSender, B as ChatToolCallStatus, C as ChatMessageBubbleSlots, D as ChatMessageMetadataProps, E as ChatMessageListSlots, F as ChatReasoningSlots, G as ChatUnreadDividerProps, H as ChatToolCallsProps, I as ChatSystemMessageProps, L as ChatSystemMessageSlots, M as ChatMessageStatus, N as ChatReasoningEmits, O as ChatMessageMetadataSlots, P as ChatReasoningProps, R as ChatSystemMessageVariant, S as ChatMessageBubbleProps, T as ChatMessageListProps, U as ChatToolCallsSlots, V as ChatToolCallsEmits, W as ChatTypingIndicatorProps, _ as ChatLayoutScrollButtonEmits, a as _default$9, b as ChatLayoutSlots, c as _default$6, d as _default$3, f as _default$2, g as ChatLayoutProps, h as ChatDensity, i as _default$10, j as ChatMessageSlots, k as ChatMessageProps, l as _default$5, m as _default, n as useChatListContext, o as _default$8, p as _default$1, r as useChatMessageContext, s as _default$7, t as useChatLayoutContext, u as _default$4, v as ChatLayoutScrollButtonProps, w as ChatMessageBubbleVariant, x as ChatMessageBubbleGroup, y as ChatLayoutScrollSlotProps, z as ChatToolCallItem } from "../index-DJo-BmXZ.js";
2
- export { type ChatDensity, _default as ChatLayout, type ChatLayoutProps, _default$1 as ChatLayoutScrollButton, type ChatLayoutScrollButtonEmits, type ChatLayoutScrollButtonProps, type ChatLayoutScrollSlotProps, type ChatLayoutSlots, _default$2 as ChatMessage, _default$3 as ChatMessageBubble, type ChatMessageBubbleGroup, type ChatMessageBubbleProps, type ChatMessageBubbleSlots, type ChatMessageBubbleVariant, _default$4 as ChatMessageList, type ChatMessageListProps, type ChatMessageListSlots, _default$5 as ChatMessageMetadata, type ChatMessageMetadataProps, type ChatMessageMetadataSlots, type ChatMessageProps, type ChatMessageSender, type ChatMessageSlots, type ChatMessageStatus, _default$6 as ChatReasoning, type ChatReasoningEmits, type ChatReasoningProps, type ChatReasoningSlots, _default$7 as ChatSystemMessage, type ChatSystemMessageProps, type ChatSystemMessageSlots, type ChatSystemMessageVariant, type ChatToolCallItem, type ChatToolCallStatus, _default$8 as ChatToolCalls, type ChatToolCallsEmits, type ChatToolCallsProps, type ChatToolCallsSlots, _default$9 as ChatTypingIndicator, type ChatTypingIndicatorProps, _default$10 as ChatUnreadDivider, type ChatUnreadDividerProps, useChatLayoutContext, useChatListContext, useChatMessageContext };
1
+ import { $ as ChatComposerTokenBadge, A as _default$8, At as ChatSystemMessageSlots, B as ChatComposerDrawerEmits, C as _default$15, Ct as ChatReasoningEmits, D as _default$11, Dt as ChatSendButtonProps, E as _default$12, Et as ChatSendButtonEmits, F as _default$3, Ft as ChatToolCallsEmits, G as ChatComposerInputControl, H as ChatComposerDrawerSlots, I as _default$2, It as ChatToolCallsProps, J as ChatComposerInputProps, K as ChatComposerInputEmits, L as _default$1, Lt as ChatToolCallsSlots, M as _default$6, Mt as ChatTokenizedTextProps, N as _default$5, Nt as ChatToolCallItem, O as _default$10, Ot as ChatSendButtonSlots, P as _default$4, Pt as ChatToolCallStatus, Q as ChatComposerToken, R as _default, Rt as ChatTypingIndicatorProps, S as _default$16, St as ChatMessageStatus, T as _default$13, Tt as ChatReasoningSlots, U as ChatComposerElevation, V as ChatComposerDrawerProps, W as ChatComposerEmits, X as ChatComposerSlots, Y as ChatComposerProps, Z as ChatComposerStatus, _ as useChatComposerContext, _t as ChatMessageMetadataProps, a as useChatPasteAsToken, at as ChatDictationButtonProps, b as useChatMessageContext, bt as ChatMessageSender, c as SpeechRecognitionError, ct as ChatLayoutScrollButtonProps, d as useSpeechRecognition, dt as ChatMessageBubbleGroup, et as ChatComposerTokenCustom, f as TokenPortal, ft as ChatMessageBubbleProps, g as ChatComposerContextValue, gt as ChatMessageListSlots, h as useChatComposerTokens, ht as ChatMessageListProps, i as pastedTextLabel, it as ChatDensity, j as _default$7, jt as ChatSystemMessageVariant, k as _default$9, kt as ChatSystemMessageProps, l as UseSpeechRecognitionOptions, lt as ChatLayoutScrollSlotProps, m as UseChatComposerTokensReturn, mt as ChatMessageBubbleVariant, n as UseChatPasteAsTokenOptions, nt as ChatComposerTrigger, o as UseChatDictationOptions, ot as ChatLayoutProps, p as UseChatComposerTokensOptions, pt as ChatMessageBubbleSlots, q as ChatComposerInputHandle, r as UseChatPasteAsTokenReturn, rt as ChatComposerTriggerItem, s as useChatDictation, st as ChatLayoutScrollButtonEmits, t as PASTE_TOKEN_THRESHOLD, tt as ChatComposerTokenElementProps, u as UseSpeechRecognitionReturn, ut as ChatLayoutSlots, v as useChatLayoutContext, vt as ChatMessageMetadataSlots, w as _default$14, wt as ChatReasoningProps, x as _default$17, xt as ChatMessageSlots, y as useChatListContext, yt as ChatMessageProps, z as ChatComposerDensity, zt as ChatUnreadDividerProps } from "../index-kVhSuA9t.js";
2
+ export { _default as ChatComposer, type ChatComposerContextValue, type ChatComposerDensity, _default$1 as ChatComposerDrawer, type ChatComposerDrawerEmits, type ChatComposerDrawerProps, type ChatComposerDrawerSlots, type ChatComposerElevation, type ChatComposerEmits, _default$2 as ChatComposerInput, type ChatComposerInputControl, type ChatComposerInputEmits, type ChatComposerInputHandle, type ChatComposerInputProps, type ChatComposerProps, type ChatComposerSlots, type ChatComposerStatus, type ChatComposerToken, type ChatComposerTokenBadge, type ChatComposerTokenCustom, _default$3 as ChatComposerTokenElement, type ChatComposerTokenElementProps, type ChatComposerTrigger, type ChatComposerTriggerItem, type ChatDensity, _default$4 as ChatDictationButton, type ChatDictationButtonProps, _default$5 as ChatLayout, type ChatLayoutProps, _default$6 as ChatLayoutScrollButton, type ChatLayoutScrollButtonEmits, type ChatLayoutScrollButtonProps, type ChatLayoutScrollSlotProps, type ChatLayoutSlots, _default$7 as ChatMessage, _default$8 as ChatMessageBubble, type ChatMessageBubbleGroup, type ChatMessageBubbleProps, type ChatMessageBubbleSlots, type ChatMessageBubbleVariant, _default$9 as ChatMessageList, type ChatMessageListProps, type ChatMessageListSlots, _default$10 as ChatMessageMetadata, type ChatMessageMetadataProps, type ChatMessageMetadataSlots, type ChatMessageProps, type ChatMessageSender, type ChatMessageSlots, type ChatMessageStatus, _default$11 as ChatReasoning, type ChatReasoningEmits, type ChatReasoningProps, type ChatReasoningSlots, _default$12 as ChatSendButton, type ChatSendButtonEmits, type ChatSendButtonProps, type ChatSendButtonSlots, _default$13 as ChatSystemMessage, type ChatSystemMessageProps, type ChatSystemMessageSlots, type ChatSystemMessageVariant, _default$14 as ChatTokenizedText, type ChatTokenizedTextProps, type ChatToolCallItem, type ChatToolCallStatus, _default$15 as ChatToolCalls, type ChatToolCallsEmits, type ChatToolCallsProps, type ChatToolCallsSlots, _default$16 as ChatTypingIndicator, type ChatTypingIndicatorProps, _default$17 as ChatUnreadDivider, type ChatUnreadDividerProps, PASTE_TOKEN_THRESHOLD, type SpeechRecognitionError, type TokenPortal, type UseChatComposerTokensOptions, type UseChatComposerTokensReturn, type UseChatDictationOptions, type UseChatPasteAsTokenOptions, type UseChatPasteAsTokenReturn, type UseSpeechRecognitionOptions, type UseSpeechRecognitionReturn, pastedTextLabel, useChatComposerContext, useChatComposerTokens, useChatDictation, useChatLayoutContext, useChatListContext, useChatMessageContext, useChatPasteAsToken, useSpeechRecognition };
@@ -1,2 +1,2 @@
1
- import { a as _sfc_main$6, c as _sfc_main$3, d as useChatLayoutContext, f as useChatListContext, i as _sfc_main$7, l as _sfc_main$2, m as _sfc_main$1, n as _sfc_main$9, o as _sfc_main$5, p as useChatMessageContext, r as _sfc_main$8, s as _sfc_main$4, t as _sfc_main$10, u as _sfc_main } from "../Chat-DjNxw5gv.js";
2
- export { _sfc_main as ChatLayout, _sfc_main$1 as ChatLayoutScrollButton, _sfc_main$2 as ChatMessage, _sfc_main$3 as ChatMessageBubble, _sfc_main$4 as ChatMessageList, _sfc_main$5 as ChatMessageMetadata, _sfc_main$6 as ChatReasoning, _sfc_main$7 as ChatSystemMessage, _sfc_main$8 as ChatToolCalls, _sfc_main$9 as ChatTypingIndicator, _sfc_main$10 as ChatUnreadDivider, useChatLayoutContext, useChatListContext, useChatMessageContext };
1
+ import { C as useChatLayoutContext, D as pastedTextLabel, E as PASTE_TOKEN_THRESHOLD, O as useChatPasteAsToken, S as useChatComposerContext, T as useChatMessageContext, _ as _sfc_main$1, a as _sfc_main$15, b as _sfc_main$2, c as _sfc_main$11, d as _sfc_main$8, f as _sfc_main$7, g as _sfc_main$3, h as _sfc_main$4, i as _sfc_main$16, l as _sfc_main$10, m as _sfc_main$6, n as useSpeechRecognition, o as _sfc_main$14, p as _sfc_main$5, r as _sfc_main$17, s as _sfc_main$13, t as useChatDictation, u as _sfc_main$9, v as _sfc_main, w as useChatListContext, x as useChatComposerTokens, y as _sfc_main$12 } from "../Chat-M0tiGrNT.js";
2
+ export { _sfc_main as ChatComposer, _sfc_main$1 as ChatComposerDrawer, _sfc_main$2 as ChatComposerInput, _sfc_main$3 as ChatComposerTokenElement, _sfc_main$4 as ChatDictationButton, _sfc_main$5 as ChatLayout, _sfc_main$6 as ChatLayoutScrollButton, _sfc_main$7 as ChatMessage, _sfc_main$8 as ChatMessageBubble, _sfc_main$9 as ChatMessageList, _sfc_main$10 as ChatMessageMetadata, _sfc_main$11 as ChatReasoning, _sfc_main$12 as ChatSendButton, _sfc_main$13 as ChatSystemMessage, _sfc_main$14 as ChatTokenizedText, _sfc_main$15 as ChatToolCalls, _sfc_main$16 as ChatTypingIndicator, _sfc_main$17 as ChatUnreadDivider, PASTE_TOKEN_THRESHOLD, pastedTextLabel, useChatComposerContext, useChatComposerTokens, useChatDictation, useChatLayoutContext, useChatListContext, useChatMessageContext, useChatPasteAsToken, useSpeechRecognition };