@ac-design/design-system 1.0.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/README.md +27 -18
  2. package/dist/lib/charts/ChartFrame.js +5 -0
  3. package/dist/lib/charts/ChartFrame.vue.d.ts +69 -0
  4. package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +168 -0
  5. package/dist/lib/charts/index.d.ts +7 -0
  6. package/dist/lib/charts/index.js +5 -0
  7. package/dist/lib/charts/shared.d.ts +60 -0
  8. package/dist/lib/charts/shared.js +114 -0
  9. package/dist/lib/charts/xy.d.ts +65 -0
  10. package/dist/lib/charts/xy.js +92 -0
  11. package/dist/lib/compat.css +1707 -1042
  12. package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +2 -2
  13. package/dist/lib/components/AcAccordionItem.vue.d.ts +1 -1
  14. package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +5 -5
  15. package/dist/lib/components/AcAlert.vue.d.ts +1 -1
  16. package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +19 -25
  17. package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +19 -19
  18. package/dist/lib/components/AcAreaChart.js +5 -0
  19. package/dist/lib/components/AcAreaChart.vue.d.ts +44 -0
  20. package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +215 -0
  21. package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +8 -8
  22. package/dist/lib/components/AcBadge.vue.d.ts +16 -7
  23. package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +59 -43
  24. package/dist/lib/components/AcBanner.vue.d.ts +1 -1
  25. package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +30 -30
  26. package/dist/lib/components/AcBarChart.js +5 -0
  27. package/dist/lib/components/AcBarChart.vue.d.ts +43 -0
  28. package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +217 -0
  29. package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +27 -26
  30. package/dist/lib/components/AcBulkActionBar.js +5 -0
  31. package/dist/lib/components/AcBulkActionBar.vue.d.ts +43 -0
  32. package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +84 -0
  33. package/dist/lib/components/AcButton.vue.d.ts +3 -3
  34. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +42 -34
  35. package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +1 -1
  36. package/dist/lib/components/AcCard.vue.d.ts +10 -2
  37. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +37 -11
  38. package/dist/lib/components/AcCellValue.vue.d.ts +4 -1
  39. package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +214 -179
  40. package/dist/lib/components/AcCheckBox.vue.d.ts +17 -3
  41. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +126 -29
  42. package/dist/lib/components/AcCheckRadio.vue.d.ts +1 -1
  43. package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +33 -21
  44. package/dist/lib/components/AcCircularProgress.js +5 -0
  45. package/dist/lib/components/AcCircularProgress.vue.d.ts +44 -0
  46. package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +111 -0
  47. package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +142 -167
  48. package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +9 -9
  49. package/dist/lib/components/AcColorInput.js +5 -0
  50. package/dist/lib/components/AcColorInput.vue.d.ts +54 -0
  51. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +187 -0
  52. package/dist/lib/components/AcConfirmModal.js +5 -0
  53. package/dist/lib/components/AcConfirmModal.vue.d.ts +56 -0
  54. package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +92 -0
  55. package/dist/lib/components/AcContentHeader.vue.d.ts +1 -1
  56. package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +5 -4
  57. package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +2 -2
  58. package/dist/lib/components/AcCopyButton.js +5 -0
  59. package/dist/lib/components/AcCopyButton.vue.d.ts +43 -0
  60. package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +92 -0
  61. package/dist/lib/components/AcDatePicker.vue.d.ts +5 -5
  62. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +204 -213
  63. package/dist/lib/components/AcDeleteModal.vue.d.ts +4 -4
  64. package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +37 -46
  65. package/dist/lib/components/AcDonutChart.js +5 -0
  66. package/dist/lib/components/AcDonutChart.vue.d.ts +73 -0
  67. package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +210 -0
  68. package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
  69. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +9 -9
  70. package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +2 -2
  71. package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
  72. package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +3 -3
  73. package/dist/lib/components/AcEmptyState.vue.d.ts +4 -1
  74. package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +50 -39
  75. package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +14 -13
  76. package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +16 -16
  77. package/dist/lib/components/AcFileUpload.vue.d.ts +2 -2
  78. package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +55 -53
  79. package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +2 -2
  80. package/dist/lib/components/AcFooter.js +5 -0
  81. package/dist/lib/components/AcFooter.vue.d.ts +37 -0
  82. package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +107 -0
  83. package/dist/lib/components/AcForm.vue.d.ts +3 -0
  84. package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +4 -2
  85. package/dist/lib/components/AcFormArray.vue.d.ts +2 -2
  86. package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +149 -147
  87. package/dist/lib/components/AcFormFooter.vue.d.ts +2 -2
  88. package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +2 -2
  89. package/dist/lib/components/AcFormSection.vue.d.ts +7 -0
  90. package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +31 -21
  91. package/dist/lib/components/AcHeader.vue.d.ts +3 -3
  92. package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +22 -22
  93. package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +17 -13
  94. package/dist/lib/components/AcInput.vue.d.ts +3 -3
  95. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +98 -87
  96. package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +1 -1
  97. package/dist/lib/components/AcKeyValueInput.js +5 -0
  98. package/dist/lib/components/AcKeyValueInput.vue.d.ts +114 -0
  99. package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +320 -0
  100. package/dist/lib/components/AcLineChart.js +5 -0
  101. package/dist/lib/components/AcLineChart.vue.d.ts +38 -0
  102. package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +187 -0
  103. package/dist/lib/components/AcLocaleSwitcher.js +5 -0
  104. package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +46 -0
  105. package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +103 -0
  106. package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +23 -23
  107. package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +6 -6
  108. package/dist/lib/components/AcNavbarItem.vue.d.ts +1 -1
  109. package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +22 -22
  110. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +26 -26
  111. package/dist/lib/components/AcNumberInput.js +5 -0
  112. package/dist/lib/components/AcNumberInput.vue.d.ts +79 -0
  113. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +251 -0
  114. package/dist/lib/components/AcPage.vue.d.ts +2 -2
  115. package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +2 -2
  116. package/dist/lib/components/AcPagination.vue.d.ts +20 -3
  117. package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +81 -53
  118. package/dist/lib/components/AcPreloader.vue.d.ts +1 -1
  119. package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +3 -3
  120. package/dist/lib/components/AcProgress.vue.d.ts +2 -2
  121. package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +4 -4
  122. package/dist/lib/components/AcResourceCard.vue.d.ts +2 -2
  123. package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +13 -13
  124. package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
  125. package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +9 -8
  126. package/dist/lib/components/AcSectionContent.vue.d.ts +2 -2
  127. package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +8 -8
  128. package/dist/lib/components/AcSegmentedControl.vue.d.ts +1 -1
  129. package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +4 -4
  130. package/dist/lib/components/AcSelect.vue.d.ts +4 -4
  131. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +230 -227
  132. package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +31 -31
  133. package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
  134. package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +37 -37
  135. package/dist/lib/components/AcSidebar.vue.d.ts +3 -3
  136. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +75 -75
  137. package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +33 -32
  138. package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +6 -6
  139. package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +8 -8
  140. package/dist/lib/components/AcSlider.vue.d.ts +1 -1
  141. package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +174 -172
  142. package/dist/lib/components/AcStatCard.vue.d.ts +3 -3
  143. package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +90 -85
  144. package/dist/lib/components/AcStatusBar.vue.d.ts +1 -1
  145. package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +6 -6
  146. package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +28 -28
  147. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +39 -34
  148. package/dist/lib/components/AcSwitchCard.js +5 -0
  149. package/dist/lib/components/AcSwitchCard.vue.d.ts +59 -0
  150. package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +119 -0
  151. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +87 -87
  152. package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +4 -4
  153. package/dist/lib/components/AcTag.vue.d.ts +1 -1
  154. package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +22 -22
  155. package/dist/lib/components/AcTagInput.js +5 -0
  156. package/dist/lib/components/AcTagInput.vue.d.ts +74 -0
  157. package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +291 -0
  158. package/dist/lib/components/AcTextarea.vue.d.ts +3 -3
  159. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +89 -64
  160. package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +3 -3
  161. package/dist/lib/components/AcTimePicker.js +5 -0
  162. package/dist/lib/components/AcTimePicker.vue.d.ts +65 -0
  163. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +463 -0
  164. package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +65 -71
  165. package/dist/lib/components/AcTooltip.vue.d.ts +1 -1
  166. package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +77 -67
  167. package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +27 -27
  168. package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +111 -103
  169. package/dist/lib/components/index.d.ts +14 -2
  170. package/dist/lib/components/status.d.ts +26 -0
  171. package/dist/lib/components/status.js +110 -0
  172. package/dist/lib/composables/copyText.d.ts +2 -1
  173. package/dist/lib/composables/copyText.js +2 -2
  174. package/dist/lib/composables/useApiPagination.d.ts +55 -0
  175. package/dist/lib/composables/useApiPagination.js +58 -0
  176. package/dist/lib/composables/useBulkSelection.d.ts +44 -0
  177. package/dist/lib/composables/useBulkSelection.js +41 -0
  178. package/dist/lib/composables/useFormValidation.d.ts +65 -0
  179. package/dist/lib/composables/useFormValidation.js +148 -0
  180. package/dist/lib/composables/useTablePagination.d.ts +49 -0
  181. package/dist/lib/composables/useTablePagination.js +41 -0
  182. package/dist/lib/editor/theme.js +65 -62
  183. package/dist/lib/index.d.ts +14 -0
  184. package/dist/lib/index.js +95 -78
  185. package/dist/lib/theme.css +391 -272
  186. package/package.json +11 -4
@@ -0,0 +1,114 @@
1
+ import type { SelectOption } from "./types";
2
+ /** One row of the field. */
3
+ export interface KeyValueItem {
4
+ key: string;
5
+ value: string;
6
+ /** The third column's value, when `options` is set, e.g. a taint effect. */
7
+ option?: string;
8
+ }
9
+ /** Messages for one row, by cell. */
10
+ export interface KeyValueRowErrors {
11
+ key?: string;
12
+ value?: string;
13
+ }
14
+ export interface Props {
15
+ /** Label above the rows, e.g. “Labels” or “Taints”. Also names the group for screen readers. */
16
+ label?: string;
17
+ /** Help text between the label and the rows. */
18
+ hint?: string;
19
+ /** Error for the whole field under the rows, e.g. “Add at least one label”. */
20
+ errorMsg?: string;
21
+ /** Header of the key column. Each key field is named “<key-label> <row>” for screen readers, e.g. “Key 2”. */
22
+ keyLabel?: string;
23
+ /** Header of the value column, e.g. “Value” or “Value (optional)”. */
24
+ valueLabel?: string;
25
+ /** Example key shown in empty key fields, e.g. “e.g. app.kubernetes.io/name”. */
26
+ keyPlaceholder?: string;
27
+ /** Example value shown in empty value fields. */
28
+ valuePlaceholder?: string;
29
+ /** Singular name of one row, used in “Add <item-name>”, “Remove <item-name> app” and announcements. */
30
+ itemName?: string;
31
+ /** Text of the Add button. Defaults to “Add <item-name>”. */
32
+ addLabel?: string;
33
+ /** Choices for a third column, such as taint effects. Each row then gets a small select bound to `option`. */
34
+ options?: SelectOption<string>[];
35
+ /** Header of the third column, e.g. “Effect”. */
36
+ optionLabel?: string;
37
+ /** Option a new row starts with. Defaults to the first of `options`. */
38
+ defaultOption?: string;
39
+ /** Most rows allowed. The Add button disables at the limit and a count shows next to it. */
40
+ max?: number;
41
+ /** Checks a key. Return a message to show under it. Runs on every non-empty key. */
42
+ validateKey?: (key: string, index: number, items: KeyValueItem[]) => string | void | null | undefined;
43
+ /** Checks a value. Return a message to show under it. Runs on every row with a key or a value. */
44
+ validateValue?: (value: string, key: string, index: number, items: KeyValueItem[]) => string | void | null | undefined;
45
+ /** Lets the same key appear twice. Off by default: a repeated key (key and option, with `options`) shows an error. */
46
+ allowDuplicateKeys?: boolean;
47
+ /** Shows keys in the monospace font, for label keys and env var names. */
48
+ mono?: boolean;
49
+ /** `small` 36px or `normal` 40px fields. */
50
+ size?: "small" | "normal";
51
+ /** Marks the field required and adds a red asterisk. Pass `error-msg` when it's empty on submit. Was `is-required` in cloud-ui. */
52
+ required?: boolean;
53
+ /** Disables every field and button. Was `is-disabled` in cloud-ui. */
54
+ disabled?: boolean;
55
+ /** Shows the rows as read-only fields, without the Add and Remove buttons. */
56
+ readonly?: boolean;
57
+ }
58
+ type __VLS_Props = Props;
59
+ type __VLS_Slots = {
60
+ /** Content under the rows and above the Add button, e.g. a warning about `NoExecute` taints. */
61
+ footer?: () => unknown;
62
+ };
63
+ declare function add(): void;
64
+ type __VLS_ModelProps = {
65
+ /** The rows, empty ones included, in order. Replaced with a new array on every change; drop rows with an empty key before saving. */
66
+ modelValue?: KeyValueItem[];
67
+ };
68
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
69
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
70
+ /** Adds an empty row and focuses its key. */
71
+ add: typeof add;
72
+ /** Moves focus to the first key, or to the Add button when there are no rows. */
73
+ focus: () => void;
74
+ /** Whether any row shows an error (duplicate key, missing key, or a validator's message). Check it before saving. */
75
+ hasErrors: () => boolean;
76
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
77
+ "update:modelValue": (value: KeyValueItem[]) => any;
78
+ add: (index: number) => any;
79
+ remove: (item: KeyValueItem, index: number) => any;
80
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
81
+ "onUpdate:modelValue"?: ((value: KeyValueItem[]) => any) | undefined;
82
+ onAdd?: ((index: number) => any) | undefined;
83
+ onRemove?: ((item: KeyValueItem, index: number) => any) | undefined;
84
+ }>, {
85
+ required: boolean;
86
+ label: string;
87
+ disabled: boolean;
88
+ max: number;
89
+ size: "small" | "normal";
90
+ keyLabel: string;
91
+ valueLabel: string;
92
+ readonly: boolean;
93
+ options: SelectOption<string>[];
94
+ hint: string;
95
+ errorMsg: string;
96
+ mono: boolean;
97
+ itemName: string;
98
+ addLabel: string;
99
+ keyPlaceholder: string;
100
+ valuePlaceholder: string;
101
+ optionLabel: string;
102
+ defaultOption: string;
103
+ validateKey: (key: string, index: number, items: KeyValueItem[]) => string | void | null | undefined;
104
+ validateValue: (value: string, key: string, index: number, items: KeyValueItem[]) => string | void | null | undefined;
105
+ allowDuplicateKeys: boolean;
106
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
107
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
108
+ declare const _default: typeof __VLS_export;
109
+ export default _default;
110
+ type __VLS_WithSlots<T, S> = T & {
111
+ new (): {
112
+ $slots: S;
113
+ };
114
+ };
@@ -0,0 +1,320 @@
1
+ import e from "./AcButton.js";
2
+ import t from "./AcInput.js";
3
+ import n from "./AcSelect.js";
4
+ import { Fragment 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, nextTick as p, normalizeClass as m, openBlock as h, ref as g, renderList as ee, renderSlot as _, toDisplayString as v, unref as y, useId as b, useModel as x, watch as te, withCtx as ne, withKeys as S } from "vue";
5
+ import { CircleAlert as re, Plus as C, Trash2 as ie } from "@lucide/vue";
6
+ //#region src/lib/components/AcKeyValueInput.vue?vue&type=script&setup=true&lang.ts
7
+ var ae = [
8
+ "aria-labelledby",
9
+ "aria-label",
10
+ "aria-describedby"
11
+ ], oe = {
12
+ key: 0,
13
+ class: "font-normal text-muted"
14
+ }, se = {
15
+ key: 1,
16
+ class: "text-danger",
17
+ "aria-hidden": "true"
18
+ }, ce = {
19
+ class: "mb-1.5 hidden grid-cols-[minmax(0,1fr)_auto] gap-x-3 sm:grid",
20
+ "aria-hidden": "true"
21
+ }, le = { key: 0 }, ue = { class: "space-y-3" }, w = [
22
+ "data-row",
23
+ "onFocusin",
24
+ "onFocusout"
25
+ ], T = [
26
+ "aria-label",
27
+ "title",
28
+ "onClick"
29
+ ], E = {
30
+ key: 3,
31
+ class: "text-base text-muted"
32
+ }, de = {
33
+ class: "sr-only",
34
+ "aria-live": "polite"
35
+ }, D = /*@__PURE__*/ d({
36
+ __name: "AcKeyValueInput",
37
+ props: /*@__PURE__*/ f({
38
+ label: { default: "" },
39
+ hint: { default: "" },
40
+ errorMsg: { default: "" },
41
+ keyLabel: { default: "Key" },
42
+ valueLabel: { default: "Value" },
43
+ keyPlaceholder: { default: "" },
44
+ valuePlaceholder: { default: "" },
45
+ itemName: { default: "item" },
46
+ addLabel: { default: "" },
47
+ options: { default: void 0 },
48
+ optionLabel: { default: "Option" },
49
+ defaultOption: { default: void 0 },
50
+ max: { default: void 0 },
51
+ validateKey: {
52
+ type: Function,
53
+ default: void 0
54
+ },
55
+ validateValue: {
56
+ type: Function,
57
+ default: void 0
58
+ },
59
+ allowDuplicateKeys: {
60
+ type: Boolean,
61
+ default: !1
62
+ },
63
+ mono: {
64
+ type: Boolean,
65
+ default: !1
66
+ },
67
+ size: { default: "normal" },
68
+ required: {
69
+ type: Boolean,
70
+ default: !1
71
+ },
72
+ disabled: {
73
+ type: Boolean,
74
+ default: !1
75
+ },
76
+ readonly: {
77
+ type: Boolean,
78
+ default: !1
79
+ }
80
+ }, {
81
+ modelValue: { default: () => [] },
82
+ modelModifiers: {}
83
+ }),
84
+ emits: /*@__PURE__*/ f(["add", "remove"], ["update:modelValue"]),
85
+ setup(d, { expose: f, emit: D }) {
86
+ let O = d, k = x(d, "modelValue"), A = D, j = b(), M = `${j}-label`, N = `${j}-hint`, P = `${j}-msg`, F = g(null), I = 0, L = g([]), R = g(null), z = g(""), B = i(() => k.value ?? []), V = i(() => !!O.options?.length), H = i(() => !O.disabled && !O.readonly), U = i(() => O.max !== void 0 && B.value.length >= O.max), fe = i(() => O.addLabel || `Add ${O.itemName}`), pe = i(() => [O.hint && N, O.errorMsg && P].filter(Boolean).join(" ") || void 0), W = i(() => V.value ? "sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_220px]" : "sm:grid-cols-2"), me = i(() => O.size === "small" ? "size-9" : "size-10"), G = i(() => {
87
+ let e = /* @__PURE__ */ new Set();
88
+ return B.value.map((t, n) => {
89
+ let r = {}, i = t.key.trim();
90
+ if (i) {
91
+ let a = V.value ? `${i}\u0000${t.option ?? ""}` : i;
92
+ !O.allowDuplicateKeys && e.has(a) && (r.key = V.value && t.option ? `“${i}” with ${q(t.option)} is already used.` : `“${i}” is already used. Keys must be unique.`), e.add(a), r.key ||= O.validateKey?.(t.key, n, B.value) || void 0;
93
+ } else t.value && R.value !== L.value[n] && (r.key = `Enter a key, or remove this ${O.itemName}.`);
94
+ return (i || t.value) && (r.value = O.validateValue?.(t.value, t.key, n, B.value) || void 0), r;
95
+ });
96
+ }), K = i(() => G.value.some((e) => e.key || e.value));
97
+ function q(e) {
98
+ return O.options?.find((t) => t.value === e)?.label ?? e;
99
+ }
100
+ function J(e) {
101
+ let t = B.value[e]?.key.trim();
102
+ return t ? `${O.itemName} ${t}` : `${O.itemName} ${e + 1}`;
103
+ }
104
+ function Y(e) {
105
+ return e.charAt(0).toUpperCase() + e.slice(1);
106
+ }
107
+ function X(e) {
108
+ z.value = "", p(() => z.value = e);
109
+ }
110
+ function Z(e, t) {
111
+ p(() => {
112
+ ((F.value?.querySelector(`[data-row="${e}"]`))?.querySelector(t === "remove" ? "[data-action='remove']" : `[data-cell="${t}"]`) ?? F.value?.querySelector("[data-action='add']"))?.focus();
113
+ });
114
+ }
115
+ function Q(e, t) {
116
+ k.value = B.value.map((n, r) => r === e ? {
117
+ ...n,
118
+ ...t
119
+ } : n);
120
+ }
121
+ function $() {
122
+ if (!H.value || U.value) return;
123
+ let e = {
124
+ key: "",
125
+ value: ""
126
+ };
127
+ V.value && (e.option = O.defaultOption ?? O.options[0].value), L.value = [...L.value, I++], k.value = [...B.value, e];
128
+ let t = B.value.length;
129
+ A("add", t), X(`${Y(O.itemName)} ${t + 1} added.`), Z(t, "key");
130
+ }
131
+ function he(e) {
132
+ if (!H.value) return;
133
+ let t = B.value[e];
134
+ if (!t) return;
135
+ let n = J(e);
136
+ L.value = L.value.filter((t, n) => n !== e), k.value = B.value.filter((t, n) => n !== e), A("remove", t, e), X(`${Y(n)} removed.`);
137
+ let r = B.value.length;
138
+ r ? Z(Math.min(e, r - 1), "remove") : p(() => F.value?.querySelector("[data-action='add']")?.focus());
139
+ }
140
+ function ge(e, t) {
141
+ e.isComposing || (e.preventDefault(), Z(t, "value"));
142
+ }
143
+ function _e(e, t) {
144
+ e.isComposing || (e.preventDefault(), t < B.value.length - 1 ? Z(t + 1, "key") : U.value || $());
145
+ }
146
+ function ve(e, t) {
147
+ let n = e.currentTarget, r = e.relatedTarget;
148
+ r && (n.contains(r) || r instanceof Element && r.closest("[data-testid='ac-select-panel']")) || R.value === t && (R.value = null);
149
+ }
150
+ return te(() => B.value.length, (e) => {
151
+ L.value.length !== e && (L.value = Array.from({ length: e }, () => I++));
152
+ }, { immediate: !0 }), f({
153
+ add: $,
154
+ focus: () => Z(0, "key"),
155
+ hasErrors: () => K.value
156
+ }), (i, f) => (h(), s("div", {
157
+ ref_key: "root",
158
+ ref: F,
159
+ role: "group",
160
+ "aria-labelledby": d.label ? M : void 0,
161
+ "aria-label": d.label ? void 0 : `${Y(d.itemName)}s`,
162
+ "aria-describedby": pe.value,
163
+ class: m(d.disabled && "opacity-50"),
164
+ "data-ac-ds": "",
165
+ "data-testid": "ac-key-value-input"
166
+ }, [
167
+ d.label ? (h(), s("div", {
168
+ key: 0,
169
+ id: M,
170
+ class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
171
+ }, [
172
+ c("span", null, v(d.label), 1),
173
+ d.readonly ? (h(), s("span", oe, "(read only)")) : o("", !0),
174
+ d.required ? (h(), s("span", se, "*")) : o("", !0)
175
+ ])) : o("", !0),
176
+ d.hint ? (h(), s("p", {
177
+ key: 1,
178
+ id: N,
179
+ class: "mb-2 text-base text-muted"
180
+ }, v(d.hint), 1)) : o("", !0),
181
+ B.value.length ? (h(), s(r, { key: 2 }, [c("div", ce, [c("div", { class: m(["grid gap-x-3 text-base font-medium text-muted", W.value]) }, [
182
+ c("span", null, v(d.keyLabel), 1),
183
+ c("span", null, v(d.valueLabel), 1),
184
+ V.value ? (h(), s("span", le, v(d.optionLabel), 1)) : o("", !0)
185
+ ], 2), H.value ? (h(), s("span", {
186
+ key: 0,
187
+ class: m(d.size === "small" ? "w-9" : "w-10")
188
+ }, null, 2)) : o("", !0)]), c("div", ue, [(h(!0), s(r, null, ee(B.value, (e, r) => (h(), s("div", {
189
+ key: L.value[r] ?? r,
190
+ "data-row": r,
191
+ class: "grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-2 max-sm:rounded-10 max-sm:border max-sm:border-border max-sm:bg-surface max-sm:p-3 sm:gap-x-3",
192
+ onFocusin: (e) => R.value = L.value[r] ?? null,
193
+ onFocusout: (e) => ve(e, L.value[r] ?? -1)
194
+ }, [c("div", { class: m(["grid items-start gap-x-3 gap-y-3", W.value]) }, [
195
+ u(t, {
196
+ "data-cell": "key",
197
+ "model-value": e.key,
198
+ label: `${d.keyLabel} ${r + 1}`,
199
+ placeholder: d.keyPlaceholder,
200
+ size: d.size,
201
+ disabled: d.disabled,
202
+ readonly: d.readonly,
203
+ "error-msg": G.value[r]?.key,
204
+ autocomplete: "off",
205
+ spellcheck: "false",
206
+ class: m(["sm:[&>label:first-child]:sr-only", d.mono && "[&_input]:font-mono"]),
207
+ "onUpdate:modelValue": (e) => Q(r, { key: String(e) }),
208
+ onKeydown: S((e) => ge(e, r), ["enter"])
209
+ }, null, 8, [
210
+ "model-value",
211
+ "label",
212
+ "placeholder",
213
+ "size",
214
+ "disabled",
215
+ "readonly",
216
+ "error-msg",
217
+ "class",
218
+ "onUpdate:modelValue",
219
+ "onKeydown"
220
+ ]),
221
+ u(t, {
222
+ "data-cell": "value",
223
+ "model-value": e.value,
224
+ label: `${d.valueLabel} ${r + 1}`,
225
+ placeholder: d.valuePlaceholder,
226
+ size: d.size,
227
+ disabled: d.disabled,
228
+ readonly: d.readonly,
229
+ "error-msg": G.value[r]?.value,
230
+ autocomplete: "off",
231
+ spellcheck: "false",
232
+ class: "sm:[&>label:first-child]:sr-only",
233
+ "onUpdate:modelValue": (e) => Q(r, { value: String(e) }),
234
+ onKeydown: S((e) => _e(e, r), ["enter"])
235
+ }, null, 8, [
236
+ "model-value",
237
+ "label",
238
+ "placeholder",
239
+ "size",
240
+ "disabled",
241
+ "readonly",
242
+ "error-msg",
243
+ "onUpdate:modelValue",
244
+ "onKeydown"
245
+ ]),
246
+ V.value && d.readonly ? (h(), a(t, {
247
+ key: 0,
248
+ "data-cell": "option",
249
+ "model-value": e.option ? q(e.option) : "",
250
+ label: `${d.optionLabel} ${r + 1}`,
251
+ size: d.size,
252
+ readonly: "",
253
+ class: "sm:[&>label:first-child]:sr-only"
254
+ }, null, 8, [
255
+ "model-value",
256
+ "label",
257
+ "size"
258
+ ])) : V.value ? (h(), a(n, {
259
+ key: 1,
260
+ "data-cell": "option",
261
+ "model-value": e.option ?? null,
262
+ options: d.options,
263
+ label: `${d.optionLabel} ${r + 1}`,
264
+ size: d.size,
265
+ disabled: d.disabled,
266
+ class: "sm:[&>div:first-child]:sr-only",
267
+ "onUpdate:modelValue": (e) => Q(r, { option: e ?? void 0 })
268
+ }, null, 8, [
269
+ "model-value",
270
+ "options",
271
+ "label",
272
+ "size",
273
+ "disabled",
274
+ "onUpdate:modelValue"
275
+ ])) : o("", !0)
276
+ ], 2), H.value ? (h(), s("button", {
277
+ key: 0,
278
+ type: "button",
279
+ "data-action": "remove",
280
+ class: m(["inline-flex shrink-0 cursor-pointer items-center justify-center rounded-10 text-muted transition-colors duration-200 hover:bg-danger/10 hover:text-danger-strong focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none max-sm:mt-7", me.value]),
281
+ "aria-label": `Remove ${J(r)}`,
282
+ title: `Remove ${d.itemName}`,
283
+ onClick: (e) => he(r)
284
+ }, [u(y(ie), {
285
+ class: "size-4",
286
+ "aria-hidden": "true"
287
+ })], 10, T)) : o("", !0)], 40, w))), 128))])], 64)) : H.value ? o("", !0) : (h(), s("p", E, "No " + v(d.itemName) + "s.", 1)),
288
+ _(i.$slots, "footer"),
289
+ H.value ? (h(), s("div", {
290
+ key: 4,
291
+ class: m(["flex items-center gap-3", B.value.length || i.$slots.footer ? "mt-3" : ""])
292
+ }, [u(e, {
293
+ "data-action": "add",
294
+ title: fe.value,
295
+ size: "small",
296
+ variant: "light",
297
+ disabled: U.value,
298
+ onClick: $
299
+ }, {
300
+ icon: ne(() => [u(y(C), { "aria-hidden": "true" })]),
301
+ _: 1
302
+ }, 8, ["title", "disabled"]), d.max === void 0 ? o("", !0) : (h(), s("span", {
303
+ key: 0,
304
+ class: m(["text-xs text-muted tabular-nums", U.value && "font-medium text-heading"])
305
+ }, v(B.value.length) + " of " + v(d.max), 3))], 2)) : o("", !0),
306
+ d.errorMsg ? (h(), s("p", {
307
+ key: 5,
308
+ id: P,
309
+ class: "mt-1.5 flex items-center gap-1.5 text-base text-danger-strong",
310
+ role: "alert"
311
+ }, [u(y(re), {
312
+ class: "size-4 shrink-0",
313
+ "aria-hidden": "true"
314
+ }), l(" " + v(d.errorMsg), 1)])) : o("", !0),
315
+ c("p", de, v(z.value), 1)
316
+ ], 10, ae));
317
+ }
318
+ });
319
+ //#endregion
320
+ export { D as default };
@@ -0,0 +1,5 @@
1
+ import e from "./AcLineChart.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/lib/components/AcLineChart.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,38 @@
1
+ import type { ChartTooltipSlotProps } from "../charts/ChartFrame.vue";
2
+ import type { ChartCurve } from "../charts/shared";
3
+ import type { XYChartProps } from "../charts/xy";
4
+ export interface Props extends XYChartProps {
5
+ /** Shape between points: `linear`, `monotone` (smooth, never overshoots the data) or `step`. */
6
+ curve?: ChartCurve;
7
+ /** Line thickness in px. */
8
+ lineWidth?: number;
9
+ }
10
+ type __VLS_Slots = {
11
+ /** Replaces the tooltip body for the hovered row. */
12
+ tooltip?: (props: ChartTooltipSlotProps) => unknown;
13
+ };
14
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
15
+ legend: import("../charts/shared").ChartLegendPosition;
16
+ title: string;
17
+ description: string;
18
+ height: number;
19
+ loading: boolean;
20
+ tooltip: boolean;
21
+ emptyText: string;
22
+ lineWidth: number;
23
+ gridLines: boolean;
24
+ xFormatter: (value: Date | number | string) => string;
25
+ yFormatter: (value: number) => string;
26
+ xLabel: string;
27
+ yLabel: string;
28
+ yDomain: [number | undefined, number | undefined];
29
+ curve: ChartCurve;
30
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
32
+ declare const _default: typeof __VLS_export;
33
+ export default _default;
34
+ type __VLS_WithSlots<T, S> = T & {
35
+ new (): {
36
+ $slots: S;
37
+ };
38
+ };
@@ -0,0 +1,187 @@
1
+ import e from "../charts/ChartFrame.js";
2
+ import { CURVES as t, chartDuration as n } from "../charts/shared.js";
3
+ import { useXYChart as r } from "../charts/xy.js";
4
+ import { computed as i, createBlock as a, createCommentVNode as o, createSlots as s, createVNode as c, defineComponent as l, guardReactiveProps as u, isRef as d, normalizeProps as f, openBlock as p, ref as m, renderSlot as h, unref as g, withCtx as _ } from "vue";
5
+ import { ChartLine as v } from "@lucide/vue";
6
+ import { VisAxis as y, VisCrosshair as b, VisLine as x, VisXYContainer as S } from "@unovis/vue";
7
+ import { Scale as C } from "@unovis/ts";
8
+ //#region src/lib/components/AcLineChart.vue?vue&type=script&setup=true&lang.ts
9
+ var w = /*@__PURE__*/ l({
10
+ __name: "AcLineChart",
11
+ props: {
12
+ curve: { default: "monotone" },
13
+ lineWidth: { default: 2 },
14
+ data: {},
15
+ index: {},
16
+ categories: {},
17
+ height: { default: 280 },
18
+ xFormatter: {
19
+ type: Function,
20
+ default: void 0
21
+ },
22
+ yFormatter: {
23
+ type: Function,
24
+ default: void 0
25
+ },
26
+ xLabel: { default: "" },
27
+ yLabel: { default: "" },
28
+ legend: { default: "top" },
29
+ tooltip: {
30
+ type: Boolean,
31
+ default: !0
32
+ },
33
+ gridLines: {
34
+ type: Boolean,
35
+ default: !0
36
+ },
37
+ yDomain: { default: void 0 },
38
+ loading: {
39
+ type: Boolean,
40
+ default: !1
41
+ },
42
+ emptyText: { default: "No data to show yet" },
43
+ title: { default: "" },
44
+ description: { default: "" }
45
+ },
46
+ setup(l) {
47
+ let w = l, T = n(), { hidden: E, width: D, colors: O, legendItems: k, xKind: A, byPosition: j, x: M, yAccessors: N, xTickValues: P, maxXTicks: F, yTicks: I, xTickFormat: L, formatY: R, rowLabel: z, yDomain: B, tooltipItems: V, table: H, ariaLabel: U } = r(w, { stacked: () => !1 }), W = m(null), G = i(() => A.value === "time" && !j.value ? C.scaleTime() : void 0);
48
+ function K(e, t, n, r) {
49
+ if (!t || n === void 0 || !r || r.type === "wheel") {
50
+ W.value = null;
51
+ return;
52
+ }
53
+ W.value = {
54
+ clientX: r.clientX,
55
+ clientY: r.clientY,
56
+ title: z(n),
57
+ items: V(t),
58
+ datum: t,
59
+ index: n
60
+ };
61
+ }
62
+ return (n, r) => (p(), a(e, {
63
+ hidden: g(E),
64
+ "onUpdate:hidden": r[0] ||= (e) => d(E) ? E.value = e : null,
65
+ width: g(D),
66
+ "onUpdate:width": r[1] ||= (e) => d(D) ? D.value = e : null,
67
+ testid: "ac-line-chart",
68
+ height: l.height,
69
+ loading: l.loading,
70
+ empty: !l.data.length,
71
+ "empty-text": l.emptyText,
72
+ "empty-icon": g(v),
73
+ legend: l.legend,
74
+ "legend-items": g(k),
75
+ summary: g(U),
76
+ title: l.title,
77
+ description: l.description,
78
+ table: g(H),
79
+ tip: W.value,
80
+ tooltip: l.tooltip
81
+ }, s({
82
+ default: _(() => [c(g(S), {
83
+ data: l.data,
84
+ height: l.height,
85
+ duration: g(T),
86
+ "x-scale": G.value,
87
+ "y-domain": g(B),
88
+ padding: {
89
+ top: 8,
90
+ right: 8
91
+ }
92
+ }, {
93
+ default: _(() => [
94
+ c(g(x), {
95
+ x: g(M),
96
+ y: g(N),
97
+ color: g(O),
98
+ "curve-type": g(t)[l.curve],
99
+ "line-width": l.lineWidth
100
+ }, null, 8, [
101
+ "x",
102
+ "y",
103
+ "color",
104
+ "curve-type",
105
+ "line-width"
106
+ ]),
107
+ c(g(y), {
108
+ type: "x",
109
+ label: l.xLabel || void 0,
110
+ "tick-format": g(L),
111
+ "tick-values": g(P),
112
+ "num-ticks": g(F),
113
+ "min-max-ticks-only-when-width-is-less": 160,
114
+ "grid-line": !1,
115
+ "tick-line": !1,
116
+ "tick-text-hide-overlapping": !0
117
+ }, null, 8, [
118
+ "label",
119
+ "tick-format",
120
+ "tick-values",
121
+ "num-ticks"
122
+ ]),
123
+ c(g(y), {
124
+ type: "y",
125
+ label: l.yLabel || void 0,
126
+ "tick-format": g(R),
127
+ "num-ticks": g(I),
128
+ "grid-line": l.gridLines,
129
+ "tick-line": !1,
130
+ "domain-line": !1
131
+ }, null, 8, [
132
+ "label",
133
+ "tick-format",
134
+ "num-ticks",
135
+ "grid-line"
136
+ ]),
137
+ l.tooltip ? (p(), a(g(b), {
138
+ key: 0,
139
+ x: g(M),
140
+ y: g(N),
141
+ color: g(O),
142
+ circleRadius: 4,
143
+ strokeColor: "var(--color-surface)",
144
+ strokeWidth: 2,
145
+ hideWhenFarFromPointer: !1,
146
+ duration: 0,
147
+ onCrosshairMove: K
148
+ }, null, 8, [
149
+ "x",
150
+ "y",
151
+ "color"
152
+ ])) : o("", !0)
153
+ ]),
154
+ _: 1
155
+ }, 8, [
156
+ "data",
157
+ "height",
158
+ "duration",
159
+ "x-scale",
160
+ "y-domain"
161
+ ])]),
162
+ _: 2
163
+ }, [n.$slots.tooltip ? {
164
+ name: "tooltip",
165
+ fn: _((e) => [h(n.$slots, "tooltip", f(u(e)))]),
166
+ key: "0"
167
+ } : void 0]), 1032, [
168
+ "hidden",
169
+ "width",
170
+ "height",
171
+ "loading",
172
+ "empty",
173
+ "empty-text",
174
+ "empty-icon",
175
+ "legend",
176
+ "legend-items",
177
+ "summary",
178
+ "title",
179
+ "description",
180
+ "table",
181
+ "tip",
182
+ "tooltip"
183
+ ]));
184
+ }
185
+ });
186
+ //#endregion
187
+ export { w as default };
@@ -0,0 +1,5 @@
1
+ import e from "./AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/lib/components/AcLocaleSwitcher.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };