@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
@@ -1,250 +0,0 @@
1
- import { a as useAstryxMessages } from "./context-Dbo22sck.js";
2
- import { t as _sfc_main$1 } from "./Calendar-BG7wEsro.js";
3
- import { t as _sfc_main$2 } from "./Popover-Crhk9PNP.js";
4
- import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderSlot, useId, useTemplateRef, watch, withCtx } from "vue";
5
- import "../styles/date-input.css";
6
- //#region src/DateInput/DateInput.vue
7
- const _hoisted_1 = ["data-disabled", "data-size"];
8
- const _hoisted_2 = {
9
- key: 0,
10
- class: "astryx-date-input-prefix"
11
- };
12
- const _hoisted_3 = ["disabled", "aria-label"];
13
- const _hoisted_4 = [
14
- "id",
15
- "value",
16
- "placeholder",
17
- "disabled",
18
- "aria-label",
19
- "aria-describedby",
20
- "aria-controls",
21
- "aria-expanded",
22
- "title"
23
- ];
24
- const _hoisted_5 = ["aria-label"];
25
- const _hoisted_6 = {
26
- key: 2,
27
- class: "astryx-date-input-suffix"
28
- };
29
- const _hoisted_7 = ["id"];
30
- const _hoisted_8 = ["name", "value"];
31
- const _sfc_main = /*@__PURE__*/ defineComponent({
32
- name: "AstryxDateInput",
33
- __name: "DateInput",
34
- props: {
35
- id: {},
36
- describedBy: {},
37
- modelValue: { default: null },
38
- placeholder: {},
39
- min: {},
40
- max: {},
41
- isDateDisabled: {},
42
- name: {},
43
- label: {},
44
- disabled: {
45
- type: Boolean,
46
- default: false
47
- },
48
- disabledReason: {},
49
- clearable: {
50
- type: Boolean,
51
- default: false
52
- },
53
- clearLabel: {},
54
- size: { default: "md" },
55
- status: { default: "default" }
56
- },
57
- emits: ["update:modelValue", "change"],
58
- setup(__props, { emit: __emit }) {
59
- const props = __props;
60
- const emit = __emit;
61
- const generatedId = `astryx-date-input-${useId()}`;
62
- const inputId = computed(() => props.id ?? generatedId);
63
- const popupId = computed(() => `${inputId.value}-popup`);
64
- const messages = useAstryxMessages();
65
- const resolvedPlaceholder = computed(() => props.placeholder ?? messages.value.dateInput.placeholder);
66
- const resolvedClearLabel = computed(() => props.clearLabel ?? messages.value.dateInput.clear(props.label));
67
- const dialogLabel = computed(() => props.label || messages.value.dateInput.dialogLabel);
68
- const inputRef = useTemplateRef("inputRef");
69
- const isOpen = ref(false);
70
- const toggleLabel = computed(() => isOpen.value ? messages.value.dateInput.closeCalendar : messages.value.dateInput.openCalendar);
71
- const inputValue = ref("");
72
- const modelValueRef = computed({
73
- get: () => props.modelValue,
74
- set: (value) => {
75
- emit("update:modelValue", value);
76
- emit("change", value);
77
- }
78
- });
79
- function formatDate(date) {
80
- if (!date) return "";
81
- return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
82
- }
83
- function parseDate(str) {
84
- if (!str.trim()) return null;
85
- const match = str.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);
86
- if (match) {
87
- const [, year, month, day] = match;
88
- const date = new Date(Number(year), Number(month) - 1, Number(day));
89
- if (!Number.isNaN(date.getTime())) return date;
90
- }
91
- return null;
92
- }
93
- function syncDisplayValue() {
94
- inputValue.value = formatDate(props.modelValue);
95
- }
96
- watch(() => props.modelValue, syncDisplayValue, { immediate: true });
97
- function onInput(event) {
98
- const value = event.target.value.trim();
99
- inputValue.value = value;
100
- const parsed = parseDate(value);
101
- if (parsed) modelValueRef.value = parsed;
102
- }
103
- function onOpenChange(open) {
104
- isOpen.value = open;
105
- }
106
- function openCalendar() {
107
- if (!props.disabled) isOpen.value = true;
108
- }
109
- function onInputKeyDown(event) {
110
- if (props.disabled || isOpen.value) return;
111
- if (event.key === "ArrowDown" || event.altKey && event.key === "ArrowDown") {
112
- event.preventDefault();
113
- openCalendar();
114
- }
115
- }
116
- function onCalendarChange(date) {
117
- modelValueRef.value = date;
118
- isOpen.value = false;
119
- inputRef.value?.blur();
120
- }
121
- function onClear(event) {
122
- event.stopPropagation();
123
- modelValueRef.value = null;
124
- inputValue.value = "";
125
- isOpen.value = false;
126
- }
127
- syncDisplayValue();
128
- return (_ctx, _cache) => {
129
- return openBlock(), createElementBlock("div", { class: normalizeClass(["astryx-date-input", [`size-${props.size}`, `status-${props.status}`]]) }, [createVNode(_sfc_main$2, {
130
- "is-open": isOpen.value,
131
- "is-enabled": !props.disabled,
132
- placement: "below",
133
- alignment: "start",
134
- padding: 0,
135
- width: 248,
136
- "has-close-button": false,
137
- "is-modal": false,
138
- "has-auto-focus": true,
139
- role: "dialog",
140
- label: dialogLabel.value,
141
- onOpenChange
142
- }, {
143
- content: withCtx(() => [createElementVNode("div", { id: popupId.value }, [createVNode(_sfc_main$1, {
144
- "model-value": props.modelValue,
145
- min: props.min,
146
- max: props.max,
147
- "is-date-disabled": props.isDateDisabled,
148
- "onUpdate:modelValue": onCalendarChange
149
- }, null, 8, [
150
- "model-value",
151
- "min",
152
- "max",
153
- "is-date-disabled"
154
- ])], 8, _hoisted_7)]),
155
- default: withCtx(() => [createElementVNode("div", {
156
- class: "astryx-date-input-wrapper",
157
- "data-disabled": props.disabled ? "true" : void 0,
158
- "data-size": props.size
159
- }, [
160
- _ctx.$slots.prefix ? (openBlock(), createElementBlock("span", _hoisted_2, [renderSlot(_ctx.$slots, "prefix")])) : createCommentVNode("v-if", true),
161
- createElementVNode("button", {
162
- type: "button",
163
- class: "astryx-date-input-toggle",
164
- disabled: props.disabled,
165
- "aria-label": toggleLabel.value
166
- }, [..._cache[0] || (_cache[0] = [createElementVNode("svg", {
167
- width: "16",
168
- height: "16",
169
- viewBox: "0 0 16 16",
170
- fill: "none",
171
- "aria-hidden": "true"
172
- }, [
173
- createElementVNode("rect", {
174
- x: "3",
175
- y: "4",
176
- width: "10",
177
- height: "9",
178
- rx: "1",
179
- stroke: "currentColor",
180
- "stroke-width": "1.5"
181
- }),
182
- createElementVNode("path", {
183
- d: "M3 6H13",
184
- stroke: "currentColor",
185
- "stroke-width": "1.5"
186
- }),
187
- createElementVNode("path", {
188
- d: "M5 3V5M11 3V5",
189
- stroke: "currentColor",
190
- "stroke-width": "1.5",
191
- "stroke-linecap": "round"
192
- })
193
- ], -1)])], 8, _hoisted_3),
194
- createElementVNode("input", {
195
- id: inputId.value,
196
- ref_key: "inputRef",
197
- ref: inputRef,
198
- type: "text",
199
- class: "astryx-date-input-field",
200
- role: "combobox",
201
- value: inputValue.value,
202
- placeholder: resolvedPlaceholder.value,
203
- disabled: props.disabled,
204
- "aria-label": props.label,
205
- "aria-describedby": props.describedBy,
206
- "aria-controls": popupId.value,
207
- "aria-expanded": isOpen.value,
208
- "aria-haspopup": "dialog",
209
- title: props.disabledReason,
210
- autocomplete: "off",
211
- onInput,
212
- onClick: openCalendar,
213
- onKeydown: onInputKeyDown
214
- }, null, 40, _hoisted_4),
215
- props.clearable && props.modelValue ? (openBlock(), createElementBlock("button", {
216
- key: 1,
217
- type: "button",
218
- class: "astryx-date-input-clear",
219
- "aria-label": resolvedClearLabel.value,
220
- tabindex: "-1",
221
- onClick: onClear
222
- }, [..._cache[1] || (_cache[1] = [createElementVNode("svg", {
223
- width: "16",
224
- height: "16",
225
- viewBox: "0 0 16 16",
226
- fill: "none",
227
- "aria-hidden": "true"
228
- }, [createElementVNode("path", {
229
- d: "M12 4L4 12M4 4L12 12",
230
- stroke: "currentColor",
231
- "stroke-width": "1.5",
232
- "stroke-linecap": "round"
233
- })], -1)])], 8, _hoisted_5)) : _ctx.$slots.suffix ? (openBlock(), createElementBlock("span", _hoisted_6, [renderSlot(_ctx.$slots, "suffix")])) : createCommentVNode("v-if", true)
234
- ], 8, _hoisted_1)]),
235
- _: 3
236
- }, 8, [
237
- "is-open",
238
- "is-enabled",
239
- "label"
240
- ]), props.name ? (openBlock(), createElementBlock("input", {
241
- key: 0,
242
- type: "hidden",
243
- name: props.name,
244
- value: formatDate(props.modelValue)
245
- }, null, 8, _hoisted_8)) : createCommentVNode("v-if", true)], 2);
246
- };
247
- }
248
- });
249
- //#endregion
250
- export { _sfc_main as t };
@@ -1,86 +0,0 @@
1
- import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, inject, mergeProps, normalizeClass, openBlock, renderSlot, resolveDynamicComponent, toValue } from "vue";
2
- import "../styles/icon.css";
3
- //#region src/Icon/context.ts
4
- /**
5
- * The size an owning component supplies to the icons in its slots.
6
- *
7
- * The value is stored as given, so a caller can pass a ref or a computed and
8
- * keep the default in step with its own props.
9
- */
10
- const ICON_DEFAULT_SIZE_KEY = Symbol("astryx-icon-default-size");
11
- /**
12
- * The size inherited from the nearest owner, or `undefined` when there is none.
13
- */
14
- function useIconDefaultSize() {
15
- const inherited = inject(ICON_DEFAULT_SIZE_KEY, void 0);
16
- return computed(() => inherited == null ? void 0 : toValue(inherited));
17
- }
18
- //#endregion
19
- //#region src/Icon/glyphs.ts
20
- /**
21
- * The artwork kept for the components' own chrome. Applications bring their own
22
- * icons; this list only has to cover what astryx-vue draws itself.
23
- */
24
- const ICON_GLYPHS = [
25
- "chevronDown",
26
- "chevronLeft",
27
- "chevronRight",
28
- "check",
29
- "moreHorizontal",
30
- "copy",
31
- "calendar",
32
- "clock",
33
- "upload",
34
- "arrowUp",
35
- "arrowDown",
36
- "close",
37
- "funnel",
38
- "image"
39
- ];
40
- function isIconGlyph(value) {
41
- return ICON_GLYPHS.includes(value);
42
- }
43
- /** The CSS-safe form of a name, used as the `astryx-icon--<slug>` class. */
44
- function iconGlyphSlug(name) {
45
- return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/:/g, "-").toLowerCase();
46
- }
47
- //#endregion
48
- //#region src/Icon/Icon.vue
49
- const _hoisted_1 = ["data-color", "data-size"];
50
- const _sfc_main = /*@__PURE__*/ defineComponent({
51
- name: "AstryxIcon",
52
- __name: "Icon",
53
- props: {
54
- icon: {},
55
- color: { default: "inherit" },
56
- size: {},
57
- label: {}
58
- },
59
- setup(__props) {
60
- const props = __props;
61
- const inheritedSize = useIconDefaultSize();
62
- const resolvedSize = computed(() => props.size ?? inheritedSize.value ?? "md");
63
- const glyphSlug = computed(() => typeof props.icon === "string" && isIconGlyph(props.icon) ? iconGlyphSlug(props.icon) : void 0);
64
- const providedClass = computed(() => typeof props.icon === "string" && !isIconGlyph(props.icon) ? props.icon : void 0);
65
- const iconComponent = computed(() => props.icon != null && typeof props.icon !== "string" ? props.icon : void 0);
66
- const a11yAttrs = computed(() => {
67
- const label = props.label;
68
- return label != null && label !== "" ? {
69
- "role": "img",
70
- "aria-label": label
71
- } : { "aria-hidden": "true" };
72
- });
73
- return (_ctx, _cache) => {
74
- return openBlock(), createElementBlock("span", mergeProps(a11yAttrs.value, {
75
- class: ["astryx-icon", providedClass.value],
76
- "data-color": __props.color,
77
- "data-size": resolvedSize.value
78
- }), [glyphSlug.value ? (openBlock(), createElementBlock("span", {
79
- key: 0,
80
- class: normalizeClass(["astryx-icon__glyph", `astryx-icon--${glyphSlug.value}`])
81
- }, null, 2)) : iconComponent.value ? (openBlock(), createBlock(resolveDynamicComponent(iconComponent.value), { key: 1 })) : !providedClass.value ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 2) : createCommentVNode("v-if", true)], 16, _hoisted_1);
82
- };
83
- }
84
- });
85
- //#endregion
86
- export { isIconGlyph as i, ICON_GLYPHS as n, iconGlyphSlug as r, _sfc_main as t };
@@ -1,92 +0,0 @@
1
- import { computed, createCommentVNode, createElementBlock, defineComponent, normalizeClass, openBlock, renderSlot, withModifiers } from "vue";
2
- import "../styles/link.css";
3
- //#region src/Link/Link.vue
4
- const _hoisted_1 = [
5
- "href",
6
- "target",
7
- "rel",
8
- "download"
9
- ];
10
- const _hoisted_2 = {
11
- key: 0,
12
- class: "astryx-link__external",
13
- "aria-hidden": "true"
14
- };
15
- const _hoisted_3 = ["disabled"];
16
- const _sfc_main = /*@__PURE__*/ defineComponent({
17
- __name: "Link",
18
- props: {
19
- href: {},
20
- isExternalLink: {
21
- type: Boolean,
22
- default: false
23
- },
24
- hasUnderline: {
25
- type: Boolean,
26
- default: false
27
- },
28
- color: { default: "accent" },
29
- isDisabled: {
30
- type: Boolean,
31
- default: false
32
- },
33
- target: {},
34
- rel: {},
35
- download: { type: [String, Boolean] }
36
- },
37
- emits: ["click"],
38
- setup(__props, { emit: __emit }) {
39
- const props = __props;
40
- const emit = __emit;
41
- const computedTarget = computed(() => {
42
- return props.isExternalLink ? "_blank" : props.target;
43
- });
44
- const computedRel = computed(() => {
45
- const parts = new Set((props.rel ?? "").split(" ").filter(Boolean));
46
- if (props.isExternalLink || computedTarget.value === "_blank") {
47
- parts.add("noopener");
48
- parts.add("noreferrer");
49
- }
50
- return parts.size > 0 ? Array.from(parts).join(" ") : void 0;
51
- });
52
- const classes = computed(() => [
53
- "astryx-link",
54
- `astryx-link--color-${props.color}`,
55
- props.hasUnderline && "astryx-link--underlined",
56
- props.isDisabled && "astryx-link--disabled",
57
- props.isExternalLink && "astryx-link--external"
58
- ]);
59
- function handleClick(event) {
60
- if (props.isDisabled) {
61
- event.preventDefault();
62
- return;
63
- }
64
- emit("click", event);
65
- }
66
- return (_ctx, _cache) => {
67
- return __props.href && !__props.isDisabled ? (openBlock(), createElementBlock("a", {
68
- key: 0,
69
- class: normalizeClass(["astryx-link", classes.value]),
70
- href: __props.href,
71
- target: computedTarget.value,
72
- rel: computedRel.value,
73
- download: __props.download,
74
- onClick: handleClick
75
- }, [renderSlot(_ctx.$slots, "default"), __props.isExternalLink ? (openBlock(), createElementBlock("span", _hoisted_2, "↗")) : createCommentVNode("v-if", true)], 10, _hoisted_1)) : __props.href && __props.isDisabled ? (openBlock(), createElementBlock("a", {
76
- key: 1,
77
- class: normalizeClass(["astryx-link", classes.value]),
78
- role: "link",
79
- "aria-disabled": "true",
80
- onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"]))
81
- }, [renderSlot(_ctx.$slots, "default")], 2)) : (openBlock(), createElementBlock("button", {
82
- key: 2,
83
- type: "button",
84
- class: normalizeClass(["astryx-link", classes.value]),
85
- disabled: __props.isDisabled,
86
- onClick: handleClick
87
- }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_3));
88
- };
89
- }
90
- });
91
- //#endregion
92
- export { _sfc_main as t };
@@ -1,147 +0,0 @@
1
- import { t as useNumberField } from "./useNumberField-DL-Radsp.js";
2
- import { a as useAstryxMessages } from "./context-Dbo22sck.js";
3
- import { computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent, normalizeClass, openBlock, ref, unref, useId } from "vue";
4
- import "../styles/number-input.css";
5
- //#region src/NumberInput/NumberInput.vue
6
- const _hoisted_1 = [
7
- "value",
8
- "placeholder",
9
- "disabled",
10
- "aria-label",
11
- "title"
12
- ];
13
- const _hoisted_2 = { class: "astryx-number-input-buttons" };
14
- const _hoisted_3 = ["disabled", "aria-label"];
15
- const _hoisted_4 = ["disabled", "aria-label"];
16
- const _hoisted_5 = ["name", "value"];
17
- const _sfc_main = /*@__PURE__*/ defineComponent({
18
- name: "AstryxNumberInput",
19
- __name: "NumberInput",
20
- props: {
21
- modelValue: { default: null },
22
- placeholder: { default: "" },
23
- min: {},
24
- max: {},
25
- step: { default: 1 },
26
- disabled: {
27
- type: Boolean,
28
- default: false
29
- },
30
- disabledReason: {},
31
- size: { default: "md" },
32
- label: {},
33
- name: {}
34
- },
35
- emits: ["update:modelValue", "change"],
36
- setup(__props, { emit: __emit }) {
37
- const props = __props;
38
- const emit = __emit;
39
- const inputId = `astryx-number-input-${useId()}`;
40
- const messages = useAstryxMessages();
41
- const incrementLabel = computed(() => messages.value.numberInput.increment(props.label));
42
- const decrementLabel = computed(() => messages.value.numberInput.decrement(props.label));
43
- const inputValue = ref("");
44
- const modelValueRef = computed({
45
- get: () => props.modelValue,
46
- set: (value) => {
47
- emit("update:modelValue", value);
48
- emit("change", value);
49
- }
50
- });
51
- const numberField = useNumberField({
52
- value: modelValueRef,
53
- min: props.min,
54
- max: props.max,
55
- step: props.step,
56
- disabled: computed(() => props.disabled),
57
- onChange: (value) => {
58
- modelValueRef.value = value;
59
- inputValue.value = value === null ? "" : String(value);
60
- }
61
- });
62
- function onInput(event) {
63
- const target = event.target;
64
- const value = target.value.trim();
65
- if (value === "") {
66
- numberField.setValue(null);
67
- return;
68
- }
69
- const parsed = Number.parseFloat(value);
70
- if (!Number.isNaN(parsed)) numberField.setValue(parsed);
71
- else target.value = inputValue.value;
72
- }
73
- function onKeyDown(event) {
74
- numberField.onKeyDown(event);
75
- }
76
- function syncDisplayValue() {
77
- inputValue.value = props.modelValue === null ? "" : String(props.modelValue);
78
- }
79
- syncDisplayValue();
80
- return (_ctx, _cache) => {
81
- return openBlock(), createElementBlock("div", { class: normalizeClass(["astryx-number-input", `size-${props.size}`]) }, [
82
- createElementVNode("input", {
83
- id: inputId,
84
- type: "text",
85
- inputmode: "decimal",
86
- class: "astryx-number-input-field",
87
- value: inputValue.value,
88
- placeholder: props.placeholder,
89
- disabled: props.disabled,
90
- "aria-label": props.label,
91
- title: props.disabledReason,
92
- onInput,
93
- onKeydown: onKeyDown
94
- }, null, 40, _hoisted_1),
95
- createElementVNode("div", _hoisted_2, [createElementVNode("button", {
96
- type: "button",
97
- class: "astryx-number-input-button increment",
98
- disabled: props.disabled,
99
- "aria-label": incrementLabel.value,
100
- tabindex: "-1",
101
- onClick: _cache[0] || (_cache[0] = (...args) => unref(numberField).increment && unref(numberField).increment(...args))
102
- }, [..._cache[2] || (_cache[2] = [createElementVNode("svg", {
103
- class: "astryx-number-input-chevron",
104
- viewBox: "0 0 12 8",
105
- width: "12",
106
- height: "8",
107
- "aria-hidden": "true",
108
- fill: "none"
109
- }, [createElementVNode("path", {
110
- d: "M1.5 1.75 6 6.25 10.5 1.75",
111
- stroke: "currentColor",
112
- "stroke-width": "1.5",
113
- "stroke-linecap": "round",
114
- "stroke-linejoin": "round"
115
- })], -1)])], 8, _hoisted_3), createElementVNode("button", {
116
- type: "button",
117
- class: "astryx-number-input-button decrement",
118
- disabled: props.disabled,
119
- "aria-label": decrementLabel.value,
120
- tabindex: "-1",
121
- onClick: _cache[1] || (_cache[1] = (...args) => unref(numberField).decrement && unref(numberField).decrement(...args))
122
- }, [..._cache[3] || (_cache[3] = [createElementVNode("svg", {
123
- class: "astryx-number-input-chevron",
124
- viewBox: "0 0 12 8",
125
- width: "12",
126
- height: "8",
127
- "aria-hidden": "true",
128
- fill: "none"
129
- }, [createElementVNode("path", {
130
- d: "M1.5 1.75 6 6.25 10.5 1.75",
131
- stroke: "currentColor",
132
- "stroke-width": "1.5",
133
- "stroke-linecap": "round",
134
- "stroke-linejoin": "round"
135
- })], -1)])], 8, _hoisted_4)]),
136
- props.name ? (openBlock(), createElementBlock("input", {
137
- key: 0,
138
- type: "hidden",
139
- name: props.name,
140
- value: props.modelValue ?? ""
141
- }, null, 8, _hoisted_5)) : createCommentVNode("v-if", true)
142
- ], 2);
143
- };
144
- }
145
- });
146
- //#endregion
147
- export { _sfc_main as t };