@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
package/README.md CHANGED
@@ -14,7 +14,7 @@ npm run dev # docs site at http://localhost:5173
14
14
  | | |
15
15
  | --- | --- |
16
16
  | **Theme** | `src/lib/theme.css`: colour scales, semantic tokens (text, borders, surfaces), type scale, radii, shadows and a full dark theme, as a Tailwind `@theme`. |
17
- | **Components** | 73 Vue components (counting sub-parts) in eight groups, listed below. |
17
+ | **Components** | 85 Vue components plus 2 editors and 4 charts (counting sub-parts) in eight groups, listed below. |
18
18
  | **Editors** | `AcCodeEditor` and `AcFileEditor` on CodeMirror 6, in a separate entry so other apps don't bundle CodeMirror. |
19
19
  | **Composables** | `useColorMode()` (light/dark/system), `useToast()` (notifications), `useBrandColor()` (re-hue the brand at runtime). |
20
20
  | **Logo** | `AcLogo`: the AppsCode logo and mark as inline SVG that follows dark mode. |
@@ -24,29 +24,36 @@ npm run dev # docs site at http://localhost:5173
24
24
 
25
25
  | Group | Components |
26
26
  | --- | --- |
27
- | Element | Button, Button Group, Badge, Tag, Avatar, Alert, Banner, Card, Divider, Kbd |
28
- | Feedback | Spinner, Preloader, Skeleton, Progress, Toast, Empty State |
29
- | Form | Input, Textarea, Code Editor, File Editor, Select, CheckBox, CheckRadio, Switch, Search Bar, File Upload, Slider, Date Picker, Form, Form Array, Theme Mode |
30
- | Overlay | Modal, Delete Modal, Side Panel, Dropdown, Tooltip |
31
- | Layout | Sidebar, Navbar, Header, Content Table, Section, Accordion, Status Bar |
32
- | Navigation | Breadcrumb, Tabs, Steps, Pagination, Side Tabs, App Switcher, Cluster Switcher, Notifications |
33
- | Data | Table, Info Table, Cell Value |
27
+ | Element | Button, Button Group, Badge, Tag, Avatar, Alert, Banner, Card, Divider, Kbd, Copy Button |
28
+ | Feedback | Spinner, Preloader, Skeleton, Progress, Circular Progress, Toast, Empty State |
29
+ | Form | Input, Number Input, Tag Input, Key-Value Input, Textarea, Code Editor, File Editor, Select, CheckBox, CheckRadio, Switch, Switch Card, Search Bar, File Upload, Slider, Date Picker, Time Picker, Color Input, Form, Form Array, Theme Mode |
30
+ | Overlay | Modal, Confirm Modal, Delete Modal, Side Panel, Dropdown, Tooltip |
31
+ | Layout | Sidebar, Navbar, Header, Content Table, Section, Accordion, Status Bar, Footer |
32
+ | Navigation | Breadcrumb, Tabs, Steps, Pagination, Side Tabs, App Switcher, Cluster Switcher, Notifications, Locale Switcher |
33
+ | Data | Table, Bulk Action Bar, Info Table, Cell Value |
34
34
  | Cards | Stat Card, Feature Card, Resource Card, Usage Card |
35
+ | Charts (`/charts`) | Line Chart, Area Chart, Bar Chart, Donut Chart |
35
36
 
36
37
  Example pages put them together: a database list, a database detail page, a create wizard, settings, empty and error states, and a full app shell.
37
38
 
38
39
  ## Look and feel
39
40
 
40
- - **Type:** Geist for the interface and Geist Mono for code and resource names, on a 13px base.
41
- - **Colour:** the AppsCode green brand scale and slate neutrals. Status colours are green, blue, yellow and red.
42
- - **Shape:** 6px radius on controls and 10px on surfaces, with soft layered shadows from `shadow-xs` to `shadow-xl`.
43
- - **Focus:** a `focus-ring` utility (primary border and a soft halo) on form fields.
41
+ The look and voice are the AppsCode Cloud console's (`cloud-ui`), so the system fits cloud-ui, kubedb-ui, cluster-ui and platform-ui alike.
42
+
43
+ - **Type:** Roboto for the interface, Google Sans Flex for headings and JetBrains Mono for code and resource names, on a 14px base.
44
+ - **Colour:** white cards on a `#f9fafb` page, neutral greys (`#252525` text, `#5c5c5c` descriptions, one `#ebebeb` border), the `#00a651` brand green, and success, info, warning, danger and pending statuses, each with an AA `-strong` text colour.
45
+ - **Shape:** 40px controls with a 10px radius, 14px cards and 16px dialogs. Cards rest on a border; shadows mark only what floats.
46
+ - **Focus:** a `focus-ring` utility (primary border and a 2px halo) on form fields, and a 2px offset ring on buttons.
44
47
  - **Dark mode:** class-based. Every token has a dark value, so components need no dark-specific code.
45
48
  - **Icons:** [Lucide](https://lucide.dev) (`@lucide/vue`). Components never draw their own SVG icons.
46
49
 
47
50
  ## Using it in an app
48
51
 
49
- The package is `@ac-design/design-system` **1.0.0**. `npm run build:lib` writes it to `dist/lib`, and `npm pack` makes an installable tarball.
52
+ The package is `@ac-design/design-system` **2.0.0**. `npm run build:lib` writes it to `dist/lib`, and `npm pack` makes an installable tarball.
53
+
54
+ ## Styling rule
55
+
56
+ Style with **Tailwind utility classes and the design tokens**. Don't write custom CSS: no `<style>` blocks in components and no one-off class rules. Use arbitrary values (`max-w-[320px]`, `bg-[color-mix(in_srgb,var(--color-primary)_6%,var(--color-surface))]`) for exact values, and arbitrary variants (`[&_.cm-content]:p-2`) for markup you don't own. If something truly can't be a utility, add a token or `@utility` to `theme.css`. The full rule is in `CLAUDE.md`.
50
57
 
51
58
  There are two ways to load the styles:
52
59
 
@@ -61,14 +68,15 @@ The docs page **Getting Started → Existing Apps** has the full guide. In short
61
68
 
62
69
  ```sh
63
70
  # installed next to the old 2.x package, under a second name
64
- npm install @appscode/ds-next@npm:@ac-design/design-system@1.0.0 @lucide/vue
71
+ npm install @appscode/ds-next@npm:@ac-design/design-system@2.0.0 @lucide/vue
65
72
  ```
66
73
 
67
74
  ```ts
68
75
  // main.ts (Vite), or the `css` list in nuxt.config.ts: after the old styles
69
76
  import "./assets/styles/scss/main.scss";
70
- import "@fontsource-variable/geist";
71
- import "@fontsource-variable/geist-mono";
77
+ import "@fontsource-variable/roboto";
78
+ import "@fontsource-variable/google-sans-flex/opsz.css";
79
+ import "@fontsource-variable/jetbrains-mono";
72
80
  import "@appscode/ds-next/compat.css";
73
81
  ```
74
82
 
@@ -79,8 +87,9 @@ import "@appscode/ds-next/compat.css";
79
87
 
80
88
  ```ts
81
89
  // main.ts: fonts once
82
- import "@fontsource-variable/geist";
83
- import "@fontsource-variable/geist-mono";
90
+ import "@fontsource-variable/roboto";
91
+ import "@fontsource-variable/google-sans-flex/opsz.css";
92
+ import "@fontsource-variable/jetbrains-mono";
84
93
  ```
85
94
 
86
95
  ```css
@@ -0,0 +1,5 @@
1
+ import e from "./ChartFrame.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/lib/charts/ChartFrame.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,69 @@
1
+ import type { Component } from "vue";
2
+ import type { ChartDatum, ChartLegendItem, ChartTable, ChartTooltipItem } from "./shared";
3
+ export interface ChartTooltipState {
4
+ /** Pointer position in viewport px. */
5
+ clientX: number;
6
+ clientY: number;
7
+ title: string;
8
+ items: ChartTooltipItem[];
9
+ /** Sum of the items, shown for stacked charts. */
10
+ total?: string;
11
+ datum: ChartDatum;
12
+ index: number;
13
+ }
14
+ export interface ChartTooltipSlotProps {
15
+ /** The hovered row. */
16
+ datum: ChartDatum;
17
+ /** Its index in `data`. */
18
+ index: number;
19
+ /** The formatted x value or segment name. */
20
+ title: string;
21
+ /** One entry per visible series: name, colour, value and formatted value. */
22
+ items: ChartTooltipItem[];
23
+ }
24
+ type __VLS_Props = {
25
+ testid: string;
26
+ height: number;
27
+ loading: boolean;
28
+ empty: boolean;
29
+ emptyText: string;
30
+ emptyIcon: Component;
31
+ legend: "top" | "bottom" | "right" | "none";
32
+ legendItems: ChartLegendItem[];
33
+ /** Centres a top or bottom legend under a round plot. */
34
+ legendCentered?: boolean;
35
+ summary: string;
36
+ title?: string;
37
+ description?: string;
38
+ table: ChartTable;
39
+ tip: ChartTooltipState | null;
40
+ tooltip: boolean;
41
+ };
42
+ type __VLS_Slots = {
43
+ default?: () => unknown;
44
+ tooltip?: (props: ChartTooltipSlotProps) => unknown;
45
+ };
46
+ type __VLS_ModelProps = {
47
+ "hidden": string[];
48
+ "width"?: number;
49
+ };
50
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
51
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
52
+ "update:hidden": (value: string[]) => any;
53
+ "update:width": (value: number) => any;
54
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
55
+ "onUpdate:hidden"?: ((value: string[]) => any) | undefined;
56
+ "onUpdate:width"?: ((value: number) => any) | undefined;
57
+ }>, {
58
+ title: string;
59
+ description: string;
60
+ legendCentered: boolean;
61
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
62
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
63
+ declare const _default: typeof __VLS_export;
64
+ export default _default;
65
+ type __VLS_WithSlots<T, S> = T & {
66
+ new (): {
67
+ $slots: S;
68
+ };
69
+ };
@@ -0,0 +1,168 @@
1
+ import e from "../components/AcSkeleton.js";
2
+ import t from "../components/AcEmptyState.js";
3
+ import { Fragment as n, Teleport as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, mergeModels as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as p, onMounted as m, openBlock as h, ref as g, renderList as _, renderSlot as v, toDisplayString as y, useModel as b, watch as x } from "vue";
4
+ //#region src/lib/charts/ChartFrame.vue?vue&type=script&setup=true&lang.ts
5
+ var S = ["data-testid"], C = ["aria-pressed", "onClick"], w = { class: "truncate" }, T = {
6
+ key: 0,
7
+ class: "ml-auto pl-3 font-medium text-heading tabular-nums"
8
+ }, E = ["aria-label"], D = {
9
+ key: 4,
10
+ class: "sr-only"
11
+ }, O = {
12
+ key: 5,
13
+ class: "sr-only"
14
+ }, k = {
15
+ scope: "row",
16
+ class: "text-left"
17
+ }, A = {
18
+ key: 0,
19
+ class: "mb-1.5 font-medium text-heading"
20
+ }, j = { class: "m-0 flex list-none flex-col gap-1 p-0" }, M = { class: "min-w-0 flex-1 truncate text-muted" }, N = { class: "pl-4 font-medium text-heading tabular-nums" }, P = {
21
+ key: 1,
22
+ class: "mt-1.5 flex justify-between gap-4 border-t border-border pt-1.5"
23
+ }, F = { class: "font-medium text-heading tabular-nums" }, I = 14, L = 300, R = 200, z = /*@__PURE__*/ l({
24
+ __name: "ChartFrame",
25
+ props: /*@__PURE__*/ u({
26
+ testid: {},
27
+ height: {},
28
+ loading: { type: Boolean },
29
+ empty: { type: Boolean },
30
+ emptyText: {},
31
+ emptyIcon: {},
32
+ legend: {},
33
+ legendItems: {},
34
+ legendCentered: {
35
+ type: Boolean,
36
+ default: !1
37
+ },
38
+ summary: {},
39
+ title: { default: "" },
40
+ description: { default: "" },
41
+ table: {},
42
+ tip: {},
43
+ tooltip: { type: Boolean }
44
+ }, {
45
+ hidden: { required: !0 },
46
+ hiddenModifiers: {},
47
+ width: { default: 0 },
48
+ widthModifiers: {}
49
+ }),
50
+ emits: ["update:hidden", "update:width"],
51
+ setup(l) {
52
+ let u = l, z = b(l, "hidden"), B = b(l, "width"), V = g(), H;
53
+ function U(e) {
54
+ let t = z.value.includes(e);
55
+ !t && u.legendItems.length - z.value.length <= 1 || (z.value = t ? z.value.filter((t) => t !== e) : [...z.value, e]);
56
+ }
57
+ function W(e) {
58
+ let t = e.clientX > window.innerWidth - L, n = e.clientY > window.innerHeight - R;
59
+ return {
60
+ left: t ? void 0 : `${e.clientX + I}px`,
61
+ right: t ? `${window.innerWidth - e.clientX + I}px` : void 0,
62
+ top: n ? void 0 : `${e.clientY + I}px`,
63
+ bottom: n ? `${window.innerHeight - e.clientY + I}px` : void 0
64
+ };
65
+ }
66
+ function G() {
67
+ H?.disconnect(), V.value && typeof ResizeObserver < "u" && (H = new ResizeObserver(([e]) => {
68
+ e && (B.value = Math.round(e.contentRect.width));
69
+ }), H.observe(V.value));
70
+ }
71
+ return x(V, G), m(G), p(() => H?.disconnect()), (u, p) => (h(), o("figure", {
72
+ class: d(["m-0 flex w-full min-w-0 gap-3", l.legend === "right" ? "flex-wrap items-center justify-center gap-x-10" : "flex-col"]),
73
+ "data-ac-ds": "",
74
+ "data-ac-chart": "",
75
+ "data-testid": l.testid
76
+ }, [
77
+ l.legend !== "none" && l.legendItems.length > 1 && !l.loading && !l.empty ? (h(), o("ul", {
78
+ key: 0,
79
+ class: d(["m-0 flex list-none flex-wrap gap-x-4 gap-y-1.5 p-0", [
80
+ l.legend === "bottom" && "order-last",
81
+ l.legend === "right" && "order-last max-w-[320px] min-w-[180px] flex-1 flex-col gap-y-2",
82
+ l.legendCentered && l.legend !== "right" && "justify-center"
83
+ ]]),
84
+ "aria-label": "Legend"
85
+ }, [(h(!0), o(n, null, _(l.legendItems, (e) => (h(), o("li", {
86
+ key: e.key,
87
+ class: "flex"
88
+ }, [s("button", {
89
+ type: "button",
90
+ class: d(["inline-flex min-w-0 cursor-pointer items-center gap-2 rounded-6 text-xs transition-colors duration-200 hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface motion-reduce:transition-none", [z.value.includes(e.key) ? "text-muted/60 line-through" : "text-muted", l.legend === "right" && "w-full"]]),
91
+ "aria-pressed": !z.value.includes(e.key),
92
+ onClick: (t) => U(e.key)
93
+ }, [
94
+ s("span", {
95
+ class: d(["size-2.5 shrink-0 rounded-full transition-opacity duration-200 motion-reduce:transition-none", z.value.includes(e.key) && "opacity-30"]),
96
+ style: f({ backgroundColor: e.color }),
97
+ "aria-hidden": "true"
98
+ }, null, 6),
99
+ s("span", w, y(e.name), 1),
100
+ e.value ? (h(), o("span", T, y(e.value), 1)) : a("", !0)
101
+ ], 10, C)]))), 128))], 2)) : a("", !0),
102
+ l.loading ? (h(), i(e, {
103
+ key: 1,
104
+ shape: "rect",
105
+ height: `${l.height}px`,
106
+ label: "Loading chart"
107
+ }, null, 8, ["height"])) : l.empty ? (h(), o("div", {
108
+ key: 2,
109
+ class: "flex w-full items-center justify-center overflow-hidden",
110
+ style: f({ height: `${l.height}px` })
111
+ }, [c(t, {
112
+ size: "small",
113
+ icon: l.emptyIcon,
114
+ title: l.emptyText
115
+ }, null, 8, ["icon", "title"])], 4)) : (h(), o("div", {
116
+ key: 3,
117
+ ref_key: "plot",
118
+ ref: V,
119
+ class: d(["relative min-w-0", l.legend === "right" ? "max-w-full shrink-0" : "w-full"]),
120
+ style: f(l.legend === "right" ? {
121
+ height: `${l.height}px`,
122
+ width: `${l.height}px`
123
+ } : { height: `${l.height}px` }),
124
+ role: "img",
125
+ "aria-label": l.summary
126
+ }, [v(u.$slots, "default")], 14, E)),
127
+ l.title || l.description ? (h(), o("figcaption", D, y([l.title, l.description].filter(Boolean).join(". ")), 1)) : a("", !0),
128
+ !l.loading && !l.empty ? (h(), o("table", O, [
129
+ s("caption", null, y(l.title ? `${l.title}: data` : "Chart data"), 1),
130
+ s("thead", null, [s("tr", null, [(h(!0), o(n, null, _(l.table.columns, (e, t) => (h(), o("th", {
131
+ key: t,
132
+ scope: "col",
133
+ class: "text-left"
134
+ }, y(e), 1))), 128))])]),
135
+ s("tbody", null, [(h(!0), o(n, null, _(l.table.rows, (e, t) => (h(), o("tr", { key: t }, [s("th", k, y(e[0]), 1), (h(!0), o(n, null, _(e.slice(1), (e, t) => (h(), o("td", { key: t }, y(e), 1))), 128))]))), 128))])
136
+ ])) : a("", !0),
137
+ (h(), i(r, { to: "body" }, [l.tooltip && l.tip && !l.loading && !l.empty ? (h(), o("div", {
138
+ key: 0,
139
+ class: "pointer-events-none fixed z-[100] w-max max-w-[280px] min-w-[160px] rounded-10 border border-border bg-surface px-3 py-2.5 text-xs text-body shadow-lg",
140
+ style: f(W(l.tip)),
141
+ "aria-hidden": "true",
142
+ "data-ac-ds": "",
143
+ "data-testid": "ac-chart-tooltip"
144
+ }, [v(u.$slots, "tooltip", {
145
+ datum: l.tip.datum,
146
+ index: l.tip.index,
147
+ title: l.tip.title,
148
+ items: l.tip.items
149
+ }, () => [
150
+ l.tip.title ? (h(), o("p", A, y(l.tip.title), 1)) : a("", !0),
151
+ s("ul", j, [(h(!0), o(n, null, _(l.tip.items, (e) => (h(), o("li", {
152
+ key: e.key,
153
+ class: "flex items-center gap-2"
154
+ }, [
155
+ s("span", {
156
+ class: "size-2 shrink-0 rounded-full",
157
+ style: f({ backgroundColor: e.color })
158
+ }, null, 4),
159
+ s("span", M, y(e.name), 1),
160
+ s("span", N, y(e.formatted), 1)
161
+ ]))), 128))]),
162
+ l.tip.total ? (h(), o("p", P, [p[0] ||= s("span", { class: "text-muted" }, "Total", -1), s("span", F, y(l.tip.total), 1)])) : a("", !0)
163
+ ])], 4)) : a("", !0)]))
164
+ ], 10, S));
165
+ }
166
+ });
167
+ //#endregion
168
+ export { z as default };
@@ -0,0 +1,7 @@
1
+ export { default as AcLineChart } from "../components/AcLineChart.vue";
2
+ export { default as AcAreaChart } from "../components/AcAreaChart.vue";
3
+ export { default as AcBarChart } from "../components/AcBarChart.vue";
4
+ export { default as AcDonutChart } from "../components/AcDonutChart.vue";
5
+ export type { ChartAccessor, ChartCategory, ChartColor, ChartCurve, ChartDatum, ChartLegendPosition, ChartTooltipItem, } from "./shared";
6
+ export type { ChartTooltipSlotProps } from "./ChartFrame.vue";
7
+ export type { XYChartProps } from "./xy";
@@ -0,0 +1,5 @@
1
+ import e from "../components/AcLineChart.js";
2
+ import t from "../components/AcAreaChart.js";
3
+ import n from "../components/AcBarChart.js";
4
+ import r from "../components/AcDonutChart.js";
5
+ export { t as AcAreaChart, n as AcBarChart, r as AcDonutChart, e as AcLineChart };
@@ -0,0 +1,60 @@
1
+ import type { Tone } from "../components/types";
2
+ /** A chart palette slot (`chart-1` … `chart-8`), a status tone, or `pending` (violet). */
3
+ export type ChartColor = "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5" | "chart-6" | "chart-7" | "chart-8" | Tone | "pending";
4
+ /** One series (line, area, bar) or one donut segment. */
5
+ export interface ChartCategory {
6
+ /** Label in the legend, tooltip and data table. */
7
+ name: string;
8
+ /** Colour slot. Defaults to `chart-1`, `chart-2`… in the order the categories are listed. */
9
+ color?: ChartColor;
10
+ }
11
+ export type ChartDatum = Record<string, any>;
12
+ /** A key of each row, or a function that reads the value from a row. */
13
+ export type ChartAccessor<T = unknown> = string | ((d: ChartDatum, i: number) => T);
14
+ /** Where the legend sits. */
15
+ export type ChartLegendPosition = "top" | "bottom" | "none";
16
+ /** The shape between points: straight, smooth (monotone, never overshoots) or stepped. */
17
+ export type ChartCurve = "linear" | "monotone" | "step";
18
+ /** What the tooltip shows for one series at the hovered point. */
19
+ export interface ChartTooltipItem {
20
+ key: string;
21
+ name: string;
22
+ /** A CSS colour, e.g. `var(--color-chart-1)`. */
23
+ color: string;
24
+ value: number | null;
25
+ /** `value` run through `yFormatter`. */
26
+ formatted: string;
27
+ }
28
+ export interface ChartLegendItem {
29
+ key: string;
30
+ name: string;
31
+ color: string;
32
+ /** Shown after the name, e.g. a donut segment's value. */
33
+ value?: string;
34
+ }
35
+ export interface ChartTable {
36
+ columns: string[];
37
+ rows: string[][];
38
+ }
39
+ /** CSS colour for a category; colour follows the category's position in the full list, so hiding one never repaints the rest. */
40
+ export declare function chartColor(color: ChartColor | undefined, position: number): string;
41
+ export declare function readValue<T = unknown>(d: ChartDatum, i: number, accessor: ChartAccessor<T>): T;
42
+ export declare function readNumber(d: ChartDatum, key: string): number | null;
43
+ /** The default value formatter: 1.2K, 3.4M. */
44
+ export declare function formatCompact(value: number): string;
45
+ /** How the x values are placed: on a time scale, a number scale, or evenly as categories. */
46
+ export type XKind = "time" | "number" | "category";
47
+ export declare function detectXKind(values: unknown[]): XKind;
48
+ export declare function toTimestamp(v: unknown): number;
49
+ /** Default labels for time values, like d3's multi-scale format: `14:00` within a day, `Oct 10` at midnight, `Oct` (or `Oct 2026`) at a month start on a long span. */
50
+ export declare function timeFormatters(values: number[]): {
51
+ tick: (t: number) => string;
52
+ title: (t: number) => string;
53
+ };
54
+ /** Rounds an axis maximum up to a tidy step, like d3's `nice()`. */
55
+ export declare function niceMax(max: number, ticks?: number): number;
56
+ /** Every k-th index so at most `max` category ticks are drawn. */
57
+ export declare function categoryTicks(count: number, max: number): number[];
58
+ /** Unovis animation length; 0 when the viewer asks for reduced motion. */
59
+ export declare function chartDuration(): number;
60
+ export declare const CURVES: Record<ChartCurve, string>;
@@ -0,0 +1,114 @@
1
+ //#region src/lib/charts/shared.ts
2
+ var e = {
3
+ "chart-1": "var(--color-chart-1)",
4
+ "chart-2": "var(--color-chart-2)",
5
+ "chart-3": "var(--color-chart-3)",
6
+ "chart-4": "var(--color-chart-4)",
7
+ "chart-5": "var(--color-chart-5)",
8
+ "chart-6": "var(--color-chart-6)",
9
+ "chart-7": "var(--color-chart-7)",
10
+ "chart-8": "var(--color-chart-8)",
11
+ primary: "var(--color-primary)",
12
+ info: "var(--color-info)",
13
+ success: "var(--color-success)",
14
+ warning: "var(--color-warning)",
15
+ danger: "var(--color-danger)",
16
+ pending: "var(--color-pending)"
17
+ }, t = [
18
+ "chart-1",
19
+ "chart-2",
20
+ "chart-3",
21
+ "chart-4",
22
+ "chart-5",
23
+ "chart-6",
24
+ "chart-7",
25
+ "chart-8"
26
+ ];
27
+ function n(n, r) {
28
+ return e[n ?? t[r % t.length]];
29
+ }
30
+ function r(e, t, n) {
31
+ return typeof n == "function" ? n(e, t) : e[n];
32
+ }
33
+ function i(e, t) {
34
+ let n = e[t];
35
+ if (n == null || n === "") return null;
36
+ let r = Number(n);
37
+ return Number.isFinite(r) ? r : null;
38
+ }
39
+ var a = new Intl.NumberFormat(void 0, {
40
+ notation: "compact",
41
+ maximumFractionDigits: 1
42
+ });
43
+ function o(e) {
44
+ return a.format(e);
45
+ }
46
+ var s = /^\d{4}-\d{2}-\d{2}/, c = 1e11;
47
+ function l(e) {
48
+ return e.length ? e.every((e) => e instanceof Date || typeof e == "string" && s.test(e)) ? "time" : e.every((e) => typeof e == "number" && Number.isFinite(e)) ? e.every((e) => e >= c) ? "time" : "number" : "category" : "category";
49
+ }
50
+ var u = /^(\d{4})-(\d{2})-(\d{2})$/;
51
+ function d(e) {
52
+ if (e instanceof Date) return e.getTime();
53
+ if (typeof e == "number") return e;
54
+ let t = u.exec(String(e));
55
+ return t ? new Date(+t[1], t[2] - 1, +t[3]).getTime() : Date.parse(String(e));
56
+ }
57
+ var f = 864e5;
58
+ function p(e) {
59
+ let t = new Date(e);
60
+ return t.getHours() === 0 && t.getMinutes() === 0;
61
+ }
62
+ function m(e) {
63
+ return p(e) && new Date(e).getDate() === 1;
64
+ }
65
+ function h(e) {
66
+ let t = e.length ? Math.max(...e) - Math.min(...e) : 0, n = e.length > 0 && e.every(m), r = e.length > 0 && e.every(p), i = new Intl.DateTimeFormat(void 0, {
67
+ hour: "2-digit",
68
+ minute: "2-digit",
69
+ hourCycle: "h23"
70
+ }), a = new Intl.DateTimeFormat(void 0, {
71
+ month: "short",
72
+ day: "numeric"
73
+ }), o = new Intl.DateTimeFormat(void 0, { month: "short" }), s = new Intl.DateTimeFormat(void 0, {
74
+ month: "short",
75
+ year: "numeric"
76
+ }), c = new Intl.DateTimeFormat(void 0, {
77
+ month: "short",
78
+ day: "numeric",
79
+ hour: "2-digit",
80
+ minute: "2-digit",
81
+ hourCycle: "h23"
82
+ }), l = new Intl.DateTimeFormat(void 0, {
83
+ year: "numeric",
84
+ month: "short",
85
+ day: "numeric"
86
+ }), u = new Intl.DateTimeFormat(void 0, {
87
+ month: "long",
88
+ year: "numeric"
89
+ });
90
+ return {
91
+ tick: (e) => p(e) ? t > 60 * f && m(e) ? (t > 365 * f ? s : o).format(e) : a.format(e) : i.format(e),
92
+ title: (e) => n ? u.format(e) : r ? l.format(e) : c.format(e)
93
+ };
94
+ }
95
+ function g(e, t = 5) {
96
+ if (!(e > 0)) return e;
97
+ let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r;
98
+ return r *= i >= 7.5 ? 10 : i >= 3.5 ? 5 : i >= 1.5 ? 2 : 1, Math.ceil(e / r) * r;
99
+ }
100
+ function _(e, t) {
101
+ let n = Math.max(1, Math.ceil(e / Math.max(1, t))), r = [];
102
+ for (let t = 0; t < e; t += n) r.push(t);
103
+ return r;
104
+ }
105
+ function v() {
106
+ return typeof window > "u" || !window.matchMedia ? 300 : window.matchMedia("(prefers-reduced-motion: reduce)").matches ? 0 : 300;
107
+ }
108
+ var y = {
109
+ linear: "linear",
110
+ monotone: "monotoneX",
111
+ step: "step"
112
+ };
113
+ //#endregion
114
+ export { y as CURVES, _ as categoryTicks, n as chartColor, v as chartDuration, l as detectXKind, o as formatCompact, g as niceMax, i as readNumber, r as readValue, h as timeFormatters, d as toTimestamp };
@@ -0,0 +1,65 @@
1
+ import type { ChartAccessor, ChartCategory, ChartDatum, ChartLegendItem, ChartLegendPosition, ChartTable, ChartTooltipItem } from "./shared";
2
+ export interface XYChartProps {
3
+ /** Rows to plot, one per x value, e.g. `{ time: "2026-10-10T14:00:00Z", cpu: 42, memory: 61 }`. */
4
+ data: ChartDatum[];
5
+ /** The x value of each row: a key or a function. `Date`s, ISO date strings and millisecond timestamps go on a time axis, other numbers on a number axis, and strings are spaced evenly. */
6
+ index: ChartAccessor;
7
+ /** The series to draw, keyed by the row field that holds each value: `{ cpu: { name: "CPU", color: "chart-1" } }`. Colours default to `chart-1`, `chart-2`… in this order. */
8
+ categories: Record<string, ChartCategory>;
9
+ /** Plot height in px. The width fills the container. */
10
+ height?: number;
11
+ /** Formats x values on the axis, in the tooltip title and in the data table. Receives a `Date` on a time axis. Defaults to times (`14:00`), days (`Oct 10`) or months (`Oct`) by the span of the data. */
12
+ xFormatter?: (value: Date | number | string) => string;
13
+ /** Formats values on the axis, in the tooltip and in the data table. Defaults to compact numbers: `1.2K`, `3.4M`. */
14
+ yFormatter?: (value: number) => string;
15
+ /** Title under the x axis, e.g. "Time (UTC)". Also heads the first column of the screen-reader table. */
16
+ xLabel?: string;
17
+ /** Title beside the y axis, e.g. "CPU (%)". */
18
+ yLabel?: string;
19
+ /** Legend above or below the plot, or `none`. Hidden anyway for a single series; clicking an entry hides or shows that series. */
20
+ legend?: ChartLegendPosition;
21
+ /** Shows a tooltip with every series' value on hover. Customise it with the `tooltip` slot. */
22
+ tooltip?: boolean;
23
+ /** Draws grid lines across the plot at each value tick. */
24
+ gridLines?: boolean;
25
+ /** Fixes the value axis range, e.g. `[0, 100]` for percentages. Leave an end `undefined` to fit the data. Defaults to starting at 0 and rounding the top up. */
26
+ yDomain?: [number | undefined, number | undefined];
27
+ /** Shows a skeleton of the same height while data loads. */
28
+ loading?: boolean;
29
+ /** Short heading shown in place of the plot when `data` is empty, e.g. "No metrics for demo-redis yet". */
30
+ emptyText?: string;
31
+ /** Accessible name, e.g. "CPU and memory of demo-postgres". Show the visible title in the surrounding card. */
32
+ title?: string;
33
+ /** A sentence for screen readers on what the chart shows. Defaults to the series names and the x range. */
34
+ description?: string;
35
+ }
36
+ export type XYChartDefaults = Required<Pick<XYChartProps, "height" | "legend" | "tooltip" | "gridLines" | "loading" | "emptyText">>;
37
+ /** `positions` places x by index (bars); otherwise time and number x values keep their real spacing. */
38
+ export declare function useXYChart(props: XYChartProps, options: {
39
+ stacked: () => boolean;
40
+ positions?: boolean;
41
+ horizontal?: () => boolean;
42
+ }): {
43
+ hidden: import("vue").Ref<string[], string[]>;
44
+ width: import("vue").Ref<number, number>;
45
+ keys: import("vue").ComputedRef<string[]>;
46
+ visibleKeys: import("vue").ComputedRef<string[]>;
47
+ colorOf: import("vue").ComputedRef<Record<string, string>>;
48
+ colors: import("vue").ComputedRef<string[]>;
49
+ legendItems: import("vue").ComputedRef<ChartLegendItem[]>;
50
+ xKind: import("vue").ComputedRef<import("./shared").XKind>;
51
+ byPosition: import("vue").ComputedRef<boolean>;
52
+ x: (_d: ChartDatum, i: number) => number;
53
+ yAccessors: import("vue").ComputedRef<((d: ChartDatum) => number | null)[]>;
54
+ xTickValues: import("vue").ComputedRef<number[] | undefined>;
55
+ maxXTicks: import("vue").ComputedRef<number>;
56
+ yTicks: import("vue").ComputedRef<number>;
57
+ xTickFormat: (tick: number | Date) => string;
58
+ formatY: (v: number | null) => string;
59
+ rowLabel: (i: number) => string;
60
+ yDomain: import("vue").ComputedRef<[number | undefined, number | undefined]>;
61
+ tooltipItems: (d: ChartDatum) => ChartTooltipItem[];
62
+ tooltipTotal: (d: ChartDatum) => string;
63
+ table: import("vue").ComputedRef<ChartTable>;
64
+ ariaLabel: import("vue").ComputedRef<string>;
65
+ };