@ac-design/design-system 0.0.0-stage → 1.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 (247) hide show
  1. package/README.md +160 -2
  2. package/dist/lib/compat.css +4441 -0
  3. package/dist/lib/components/AcAccordion.js +5 -0
  4. package/dist/lib/components/AcAccordion.vue.d.ts +35 -0
  5. package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +61 -0
  6. package/dist/lib/components/AcAccordionItem.js +5 -0
  7. package/dist/lib/components/AcAccordionItem.vue.d.ts +49 -0
  8. package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +81 -0
  9. package/dist/lib/components/AcAlert.js +5 -0
  10. package/dist/lib/components/AcAlert.vue.d.ts +52 -0
  11. package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -0
  12. package/dist/lib/components/AcAppSwitcher.js +5 -0
  13. package/dist/lib/components/AcAppSwitcher.vue.d.ts +83 -0
  14. package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +303 -0
  15. package/dist/lib/components/AcAvatar.js +5 -0
  16. package/dist/lib/components/AcAvatar.vue.d.ts +27 -0
  17. package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +116 -0
  18. package/dist/lib/components/AcBadge.js +5 -0
  19. package/dist/lib/components/AcBadge.vue.d.ts +32 -0
  20. package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +88 -0
  21. package/dist/lib/components/AcBanner.js +5 -0
  22. package/dist/lib/components/AcBanner.vue.d.ts +57 -0
  23. package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +114 -0
  24. package/dist/lib/components/AcBreadcrumb.js +5 -0
  25. package/dist/lib/components/AcBreadcrumb.vue.d.ts +25 -0
  26. package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +88 -0
  27. package/dist/lib/components/AcButton.js +5 -0
  28. package/dist/lib/components/AcButton.vue.d.ts +49 -0
  29. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +103 -0
  30. package/dist/lib/components/AcButtons.js +5 -0
  31. package/dist/lib/components/AcButtons.vue.d.ts +31 -0
  32. package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +44 -0
  33. package/dist/lib/components/AcCard.js +5 -0
  34. package/dist/lib/components/AcCard.vue.d.ts +27 -0
  35. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +28 -0
  36. package/dist/lib/components/AcCellValue.js +5 -0
  37. package/dist/lib/components/AcCellValue.vue.d.ts +139 -0
  38. package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +386 -0
  39. package/dist/lib/components/AcCheckBox.js +5 -0
  40. package/dist/lib/components/AcCheckBox.vue.d.ts +31 -0
  41. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +49 -0
  42. package/dist/lib/components/AcCheckRadio.js +5 -0
  43. package/dist/lib/components/AcCheckRadio.vue.d.ts +35 -0
  44. package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +56 -0
  45. package/dist/lib/components/AcClusterSwitcher.js +5 -0
  46. package/dist/lib/components/AcClusterSwitcher.vue.d.ts +95 -0
  47. package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +416 -0
  48. package/dist/lib/components/AcCodeEditor.js +5 -0
  49. package/dist/lib/components/AcCodeEditor.vue.d.ts +88 -0
  50. package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +375 -0
  51. package/dist/lib/components/AcContentHeader.js +5 -0
  52. package/dist/lib/components/AcContentHeader.vue.d.ts +29 -0
  53. package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +31 -0
  54. package/dist/lib/components/AcContentLayout.js +5 -0
  55. package/dist/lib/components/AcContentLayout.vue.d.ts +21 -0
  56. package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +18 -0
  57. package/dist/lib/components/AcContentTable.js +5 -0
  58. package/dist/lib/components/AcContentTable.vue.d.ts +54 -0
  59. package/dist/lib/components/AcContentTable.vue_vue_type_script_setup_true_lang.js +67 -0
  60. package/dist/lib/components/AcDatePicker.js +5 -0
  61. package/dist/lib/components/AcDatePicker.vue.d.ts +88 -0
  62. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +794 -0
  63. package/dist/lib/components/AcDeleteModal.js +5 -0
  64. package/dist/lib/components/AcDeleteModal.vue.d.ts +51 -0
  65. package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +110 -0
  66. package/dist/lib/components/AcDivider.js +5 -0
  67. package/dist/lib/components/AcDivider.vue.d.ts +25 -0
  68. package/dist/lib/components/AcDivider.vue_vue_type_script_setup_true_lang.js +39 -0
  69. package/dist/lib/components/AcDropdown.js +5 -0
  70. package/dist/lib/components/AcDropdown.vue.d.ts +45 -0
  71. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +152 -0
  72. package/dist/lib/components/AcDropdownDivider.js +5 -0
  73. package/dist/lib/components/AcDropdownDivider.vue.d.ts +9 -0
  74. package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +20 -0
  75. package/dist/lib/components/AcDropdownItem.js +5 -0
  76. package/dist/lib/components/AcDropdownItem.vue.d.ts +50 -0
  77. package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +86 -0
  78. package/dist/lib/components/AcEmptyState.js +5 -0
  79. package/dist/lib/components/AcEmptyState.vue.d.ts +42 -0
  80. package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +81 -0
  81. package/dist/lib/components/AcFeatureCard.js +5 -0
  82. package/dist/lib/components/AcFeatureCard.vue.d.ts +84 -0
  83. package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +218 -0
  84. package/dist/lib/components/AcFileEditor.js +5 -0
  85. package/dist/lib/components/AcFileEditor.vue.d.ts +95 -0
  86. package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +556 -0
  87. package/dist/lib/components/AcFileUpload.js +5 -0
  88. package/dist/lib/components/AcFileUpload.vue.d.ts +67 -0
  89. package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +274 -0
  90. package/dist/lib/components/AcFontScale.js +5 -0
  91. package/dist/lib/components/AcFontScale.vue.d.ts +17 -0
  92. package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +65 -0
  93. package/dist/lib/components/AcForm.js +5 -0
  94. package/dist/lib/components/AcForm.vue.d.ts +31 -0
  95. package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +38 -0
  96. package/dist/lib/components/AcFormArray.js +5 -0
  97. package/dist/lib/components/AcFormArray.vue.d.ts +124 -0
  98. package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +485 -0
  99. package/dist/lib/components/AcFormFooter.js +5 -0
  100. package/dist/lib/components/AcFormFooter.vue.d.ts +48 -0
  101. package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +86 -0
  102. package/dist/lib/components/AcFormSection.js +5 -0
  103. package/dist/lib/components/AcFormSection.vue.d.ts +32 -0
  104. package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +38 -0
  105. package/dist/lib/components/AcHeader.js +5 -0
  106. package/dist/lib/components/AcHeader.vue.d.ts +46 -0
  107. package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +60 -0
  108. package/dist/lib/components/AcHeaderItem.js +5 -0
  109. package/dist/lib/components/AcHeaderItem.vue.d.ts +13 -0
  110. package/dist/lib/components/AcHeaderItem.vue_vue_type_script_setup_true_lang.js +14 -0
  111. package/dist/lib/components/AcHeaderItems.js +5 -0
  112. package/dist/lib/components/AcHeaderItems.vue.d.ts +13 -0
  113. package/dist/lib/components/AcHeaderItems.vue_vue_type_script_setup_true_lang.js +14 -0
  114. package/dist/lib/components/AcInfoTable.js +5 -0
  115. package/dist/lib/components/AcInfoTable.vue.d.ts +59 -0
  116. package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +125 -0
  117. package/dist/lib/components/AcInput.js +5 -0
  118. package/dist/lib/components/AcInput.vue.d.ts +68 -0
  119. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +143 -0
  120. package/dist/lib/components/AcKbd.js +5 -0
  121. package/dist/lib/components/AcKbd.vue.d.ts +25 -0
  122. package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +134 -0
  123. package/dist/lib/components/AcLogo.js +5 -0
  124. package/dist/lib/components/AcLogo.vue.d.ts +18 -0
  125. package/dist/lib/components/AcLogo.vue_vue_type_script_setup_true_lang.js +67 -0
  126. package/dist/lib/components/AcModal.js +5 -0
  127. package/dist/lib/components/AcModal.vue.d.ts +54 -0
  128. package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +125 -0
  129. package/dist/lib/components/AcNavbar.js +5 -0
  130. package/dist/lib/components/AcNavbar.vue.d.ts +41 -0
  131. package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +60 -0
  132. package/dist/lib/components/AcNavbarItem.js +5 -0
  133. package/dist/lib/components/AcNavbarItem.vue.d.ts +44 -0
  134. package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +65 -0
  135. package/dist/lib/components/AcNotificationMenu.js +5 -0
  136. package/dist/lib/components/AcNotificationMenu.vue.d.ts +90 -0
  137. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +345 -0
  138. package/dist/lib/components/AcPage.js +5 -0
  139. package/dist/lib/components/AcPage.vue.d.ts +25 -0
  140. package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +36 -0
  141. package/dist/lib/components/AcPagination.js +5 -0
  142. package/dist/lib/components/AcPagination.vue.d.ts +51 -0
  143. package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +160 -0
  144. package/dist/lib/components/AcPreloader.js +5 -0
  145. package/dist/lib/components/AcPreloader.vue.d.ts +28 -0
  146. package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +39 -0
  147. package/dist/lib/components/AcProgress.js +5 -0
  148. package/dist/lib/components/AcProgress.vue.d.ts +31 -0
  149. package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +76 -0
  150. package/dist/lib/components/AcResourceCard.js +5 -0
  151. package/dist/lib/components/AcResourceCard.vue.d.ts +106 -0
  152. package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +203 -0
  153. package/dist/lib/components/AcSearchBar.js +5 -0
  154. package/dist/lib/components/AcSearchBar.vue.d.ts +41 -0
  155. package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +76 -0
  156. package/dist/lib/components/AcSectionContent.js +5 -0
  157. package/dist/lib/components/AcSectionContent.vue.d.ts +55 -0
  158. package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +74 -0
  159. package/dist/lib/components/AcSegmentedControl.js +5 -0
  160. package/dist/lib/components/AcSegmentedControl.vue.d.ts +46 -0
  161. package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +104 -0
  162. package/dist/lib/components/AcSelect.js +5 -0
  163. package/dist/lib/components/AcSelect.vue.d.ts +78 -0
  164. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +441 -0
  165. package/dist/lib/components/AcSidePanel.js +5 -0
  166. package/dist/lib/components/AcSidePanel.vue.d.ts +57 -0
  167. package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +128 -0
  168. package/dist/lib/components/AcSideTabs.js +5 -0
  169. package/dist/lib/components/AcSideTabs.vue.d.ts +93 -0
  170. package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +373 -0
  171. package/dist/lib/components/AcSidebar.js +5 -0
  172. package/dist/lib/components/AcSidebar.vue.d.ts +63 -0
  173. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +221 -0
  174. package/dist/lib/components/AcSidebarItem.js +5 -0
  175. package/dist/lib/components/AcSidebarItem.vue.d.ts +55 -0
  176. package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +155 -0
  177. package/dist/lib/components/AcSidebarSection.js +5 -0
  178. package/dist/lib/components/AcSidebarSection.vue.d.ts +32 -0
  179. package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +48 -0
  180. package/dist/lib/components/AcSkeleton.js +5 -0
  181. package/dist/lib/components/AcSkeleton.vue.d.ts +27 -0
  182. package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +142 -0
  183. package/dist/lib/components/AcSlider.js +5 -0
  184. package/dist/lib/components/AcSlider.vue.d.ts +72 -0
  185. package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +327 -0
  186. package/dist/lib/components/AcSpinner.js +5 -0
  187. package/dist/lib/components/AcSpinner.vue.d.ts +12 -0
  188. package/dist/lib/components/AcSpinner.vue_vue_type_script_setup_true_lang.js +45 -0
  189. package/dist/lib/components/AcStatCard.js +5 -0
  190. package/dist/lib/components/AcStatCard.vue.d.ts +84 -0
  191. package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +225 -0
  192. package/dist/lib/components/AcStatusBar.js +5 -0
  193. package/dist/lib/components/AcStatusBar.vue.d.ts +66 -0
  194. package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +145 -0
  195. package/dist/lib/components/AcSteps.js +5 -0
  196. package/dist/lib/components/AcSteps.vue.d.ts +28 -0
  197. package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +91 -0
  198. package/dist/lib/components/AcSwitch.js +5 -0
  199. package/dist/lib/components/AcSwitch.vue.d.ts +44 -0
  200. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +67 -0
  201. package/dist/lib/components/AcTable.js +5 -0
  202. package/dist/lib/components/AcTable.vue.d.ts +98 -0
  203. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +272 -0
  204. package/dist/lib/components/AcTabs.js +5 -0
  205. package/dist/lib/components/AcTabs.vue.d.ts +40 -0
  206. package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +72 -0
  207. package/dist/lib/components/AcTag.js +5 -0
  208. package/dist/lib/components/AcTag.vue.d.ts +41 -0
  209. package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +99 -0
  210. package/dist/lib/components/AcTextarea.js +5 -0
  211. package/dist/lib/components/AcTextarea.vue.d.ts +53 -0
  212. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +120 -0
  213. package/dist/lib/components/AcThemeMode.js +5 -0
  214. package/dist/lib/components/AcThemeMode.vue.d.ts +17 -0
  215. package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +60 -0
  216. package/dist/lib/components/AcToaster.js +5 -0
  217. package/dist/lib/components/AcToaster.vue.d.ts +15 -0
  218. package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +166 -0
  219. package/dist/lib/components/AcTooltip.js +5 -0
  220. package/dist/lib/components/AcTooltip.vue.d.ts +30 -0
  221. package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +117 -0
  222. package/dist/lib/components/AcUsageCard.js +5 -0
  223. package/dist/lib/components/AcUsageCard.vue.d.ts +85 -0
  224. package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +230 -0
  225. package/dist/lib/components/AcUserMenu.js +5 -0
  226. package/dist/lib/components/AcUserMenu.vue.d.ts +77 -0
  227. package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +258 -0
  228. package/dist/lib/components/index.d.ts +76 -0
  229. package/dist/lib/components/types.d.ts +16 -0
  230. package/dist/lib/composables/useBrandColor.d.ts +53 -0
  231. package/dist/lib/composables/useBrandColor.js +148 -0
  232. package/dist/lib/composables/useColorMode.d.ts +12 -0
  233. package/dist/lib/composables/useColorMode.js +40 -0
  234. package/dist/lib/composables/useFontScale.d.ts +16 -0
  235. package/dist/lib/composables/useFontScale.js +43 -0
  236. package/dist/lib/composables/useToast.d.ts +68 -0
  237. package/dist/lib/composables/useToast.js +36 -0
  238. package/dist/lib/editor/index.d.ts +4 -0
  239. package/dist/lib/editor/index.js +3 -0
  240. package/dist/lib/editor/theme.d.ts +3 -0
  241. package/dist/lib/editor/theme.js +309 -0
  242. package/dist/lib/editor/validate.d.ts +19 -0
  243. package/dist/lib/editor/validate.js +127 -0
  244. package/dist/lib/index.d.ts +29 -0
  245. package/dist/lib/index.js +78 -0
  246. package/dist/lib/theme.css +556 -0
  247. package/package.json +82 -4
@@ -0,0 +1,44 @@
1
+ export interface Props {
2
+ /** Label shown to the left of the switch. */
3
+ label?: string;
4
+ /** Native `name` attribute. */
5
+ name?: string;
6
+ /** Disables the switch. */
7
+ disabled?: boolean;
8
+ /** Error text under the switch. */
9
+ errorMsg?: string;
10
+ }
11
+ type __VLS_Props = Props;
12
+ type __VLS_Slots = {
13
+ /** Content before the label. */
14
+ left?: () => unknown;
15
+ /** Content between the label and the switch, e.g. an info icon. */
16
+ middle?: () => unknown;
17
+ /** Content after the switch, e.g. a status badge. */
18
+ right?: () => unknown;
19
+ };
20
+ type __VLS_ModelProps = {
21
+ modelValue?: boolean;
22
+ };
23
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
24
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
25
+ /** Moves focus to the switch. */
26
+ focus: () => void | undefined;
27
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
+ "update:modelValue": (value: boolean) => any;
29
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
30
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
31
+ }>, {
32
+ label: string;
33
+ disabled: boolean;
34
+ name: string;
35
+ errorMsg: string;
36
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
37
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
38
+ declare const _default: typeof __VLS_export;
39
+ export default _default;
40
+ type __VLS_WithSlots<T, S> = T & {
41
+ new (): {
42
+ $slots: S;
43
+ };
44
+ };
@@ -0,0 +1,67 @@
1
+ import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, mergeModels as a, mergeProps as o, normalizeClass as s, openBlock as c, ref as l, renderSlot as u, toDisplayString as d, unref as f, useAttrs as p, useId as m, useModel as h } from "vue";
2
+ //#region src/lib/components/AcSwitch.vue?vue&type=script&setup=true&lang.ts
3
+ var g = { class: "flex items-center gap-2" }, _ = ["for"], v = [
4
+ "id",
5
+ "name",
6
+ "aria-checked",
7
+ "disabled"
8
+ ], y = {
9
+ key: 0,
10
+ class: "mt-1.5 text-xs text-red-30"
11
+ }, b = /*@__PURE__*/ i({
12
+ inheritAttrs: !1,
13
+ __name: "AcSwitch",
14
+ props: /*@__PURE__*/ a({
15
+ label: { default: "" },
16
+ name: { default: "" },
17
+ disabled: {
18
+ type: Boolean,
19
+ default: !1
20
+ },
21
+ errorMsg: { default: "" }
22
+ }, {
23
+ modelValue: {
24
+ type: Boolean,
25
+ default: !1
26
+ },
27
+ modelModifiers: {}
28
+ }),
29
+ emits: ["update:modelValue"],
30
+ setup(i, { expose: a }) {
31
+ let b = h(i, "modelValue"), x = m(), S = p(), C = e(() => ({
32
+ class: S.class,
33
+ style: S.style
34
+ })), w = e(() => {
35
+ let { class: e, style: t, ...n } = S;
36
+ return n;
37
+ }), T = l(null);
38
+ return a({ focus: () => T.value?.focus() }), (e, a) => (c(), n("div", o(C.value, {
39
+ "data-ac-ds": "",
40
+ "data-testid": "ac-switch"
41
+ }), [r("div", g, [
42
+ u(e.$slots, "left"),
43
+ i.label ? (c(), n("label", {
44
+ key: 0,
45
+ for: f(x),
46
+ class: "cursor-pointer text-base text-heading"
47
+ }, d(i.label), 9, _)) : t("", !0),
48
+ u(e.$slots, "middle"),
49
+ r("button", o({
50
+ id: f(x),
51
+ ref_key: "button",
52
+ ref: T
53
+ }, w.value, {
54
+ type: "button",
55
+ role: "switch",
56
+ name: i.name,
57
+ "aria-checked": b.value,
58
+ disabled: i.disabled,
59
+ class: ["relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-50 p-0.5 inset-shadow-xs transition-colors duration-200 ease-out focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", b.value ? "bg-primary" : "bg-slate-70 hover:bg-slate-60"],
60
+ onClick: a[0] ||= (e) => b.value = !b.value
61
+ }), [r("span", { class: s(["inline-block size-4 rounded-full bg-white shadow-md ring-1 ring-black/5 transition-transform duration-200 ease-out-soft", b.value ? "translate-x-4" : "translate-x-0"]) }, null, 2)], 16, v),
62
+ u(e.$slots, "right")
63
+ ]), i.errorMsg ? (c(), n("p", y, d(i.errorMsg), 1)) : t("", !0)], 16));
64
+ }
65
+ });
66
+ //#endregion
67
+ export { b as default };
@@ -0,0 +1,5 @@
1
+ import e from "./AcTable.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/lib/components/AcTable.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,98 @@
1
+ import type { CellType, ResourceColumn } from "./AcCellValue.vue";
2
+ export interface Column {
3
+ key: string;
4
+ label: string;
5
+ sortable?: boolean;
6
+ align?: "left" | "center" | "right";
7
+ width?: string;
8
+ /** Shows values with AcCellValue as this type (`auto`, `date`, `labels`, `status`…): dashes for empty values, relative dates, label chips. */
9
+ type?: CellType;
10
+ /** A server-side column descriptor. Shows values with AcCellValue; a row value may be a server cell `{ data, link, color }`. */
11
+ descriptor?: ResourceColumn;
12
+ }
13
+ export interface Props<R> {
14
+ /** Column definitions: `{ key, label, sortable?, align?, width?, type?, descriptor? }`. `type` or `descriptor` shows values with AcCellValue. */
15
+ columns: Column[];
16
+ /** Row objects. Each column's `key` is read from the row. */
17
+ rows: R[];
18
+ /** Row property used as the Vue `key`. */
19
+ rowKey?: string;
20
+ /** Shows skeleton rows instead of data. */
21
+ loading?: boolean;
22
+ /** Number of skeleton rows while loading. */
23
+ loaderRows?: number;
24
+ /** Text shown when `rows` is empty (or use the `empty` slot). */
25
+ emptyText?: string;
26
+ /** Adds a pointer cursor and emits `row-click`. */
27
+ clickable?: boolean;
28
+ /** Adds a checkbox column for choosing rows, e.g. for bulk delete. Bind the chosen rows' `rowKey` values with `v-model:selected`. */
29
+ selectable?: boolean;
30
+ /** Adds an arrow column that opens a detail area under each row. Fill it with the `expanded` slot, and bind the open rows' `rowKey` values with `v-model:expanded`. */
31
+ expandable?: boolean;
32
+ /** With `expandable`, decides per row whether it can open. Rows that can't show no arrow. */
33
+ canExpand?: (row: R) => boolean;
34
+ /** Marks the current row, e.g. the one chosen in a picker: tinted with a primary outline and `aria-current`. Not the checkbox selection, which is `selectable`. */
35
+ rowActive?: (row: R) => boolean;
36
+ /** Greys a row out: it ignores clicks and its checkbox is disabled. */
37
+ rowDisabled?: (row: R) => boolean;
38
+ /** The table doesn't reorder rows itself: sort the whole list outside (all pages, or on the server) when `sort` fires or `v-model:sortBy` changes. Headers still show the arrow. */
39
+ manualSort?: boolean;
40
+ /** Drops the table's own frame (border, rounded corners, shadow) so it sits flush inside a card or section that already has one. Without it a table in a card draws a second box. */
41
+ flat?: boolean;
42
+ /** Turns a server cell's link template into a URL, e.g. to fill `${username}` and `${clustername}` from the current route. */
43
+ resolveLink?: (link: string) => string;
44
+ }
45
+ declare const __VLS_export: <Row extends Record<string, unknown>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
46
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<(Props<Row> & {
47
+ /** `rowKey` values of the chosen rows. Bind with `v-model:selected`. Rows that leave `rows` (another page, a search) stay chosen. */
48
+ selected?: unknown[];
49
+ /** `rowKey` values of the rows that are open. Bind with `v-model:expanded`. */
50
+ expanded?: unknown[];
51
+ /** The sorted column and direction, or `null`. Bind with `v-model:sortBy` to set it from outside, e.g. to keep it across pages or in the URL. */
52
+ sortBy?: {
53
+ key: string;
54
+ mode: "asc" | "desc";
55
+ } | null;
56
+ }) & {
57
+ onSort?: ((key: string, mode: "desc" | "asc") => any) | undefined;
58
+ "onRow-click"?: ((row: Row) => any) | undefined;
59
+ "onUpdate:selected"?: ((value: unknown[]) => any) | undefined;
60
+ "onUpdate:expanded"?: ((value: unknown[]) => any) | undefined;
61
+ "onUpdate:sortBy"?: ((value: {
62
+ key: string;
63
+ mode: "asc" | "desc";
64
+ } | null) => any) | undefined;
65
+ }> & (typeof globalThis extends {
66
+ __VLS_PROPS_FALLBACK: infer P;
67
+ } ? P : {});
68
+ expose: (exposed: {}) => void;
69
+ attrs: any;
70
+ slots: {
71
+ [key: `cell-${string}`]: (props: {
72
+ row: Row;
73
+ value: unknown;
74
+ }) => unknown;
75
+ [key: `header-${string}`]: (props: {
76
+ column: Column;
77
+ }) => unknown;
78
+ /** Detail area under an open row, for tables with `expandable`: `#expanded="{ row }"`. */
79
+ expanded?: (props: {
80
+ row: Row;
81
+ }) => unknown;
82
+ /** Content shown when `rows` is empty. */
83
+ empty?: () => unknown;
84
+ };
85
+ emit: (((evt: "sort", key: string, mode: "desc" | "asc") => void) & ((evt: "row-click", row: Row) => void)) & (((event: "update:selected", value: unknown[]) => void) & ((event: "update:expanded", value: unknown[]) => void) & ((event: "update:sortBy", value: {
86
+ key: string;
87
+ mode: "asc" | "desc";
88
+ } | null) => void));
89
+ }>) => import("vue").VNode & {
90
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
91
+ };
92
+ declare const _default: typeof __VLS_export;
93
+ export default _default;
94
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
95
+ [K in keyof T]: T[K];
96
+ } : {
97
+ [K in keyof T as K]: T[K];
98
+ }) & {};
@@ -0,0 +1,272 @@
1
+ import e from "./AcCellValue.js";
2
+ import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, mergeModels as u, normalizeClass as d, normalizeStyle as f, openBlock as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, useId as ee, useModel as y, withModifiers as b } from "vue";
3
+ import { ArrowUp as te, Check as x, ChevronRight as S, ChevronsUpDown as C, Minus as w } from "@lucide/vue";
4
+ //#region src/lib/components/AcTable.vue?vue&type=script&setup=true&lang.ts
5
+ var T = { class: "ac-scrollbar" }, ne = { class: "w-full border-separate border-spacing-0 text-base" }, re = { class: "relative flex size-4" }, ie = [
6
+ "checked",
7
+ "indeterminate",
8
+ "disabled"
9
+ ], ae = ["aria-sort", "onClick"], E = {
10
+ key: 0,
11
+ class: "h-12 border-b border-border-light pl-3 [tr:last-child_&]:border-0"
12
+ }, oe = {
13
+ key: 1,
14
+ class: "h-12 border-b border-border-light pl-4 [tr:last-child_&]:border-0"
15
+ }, se = [
16
+ "aria-current",
17
+ "aria-disabled",
18
+ "onClick"
19
+ ], D = [
20
+ "aria-expanded",
21
+ "aria-controls",
22
+ "aria-label",
23
+ "onClick"
24
+ ], ce = { class: "relative flex size-4" }, le = [
25
+ "checked",
26
+ "disabled",
27
+ "aria-label",
28
+ "onChange"
29
+ ], ue = {
30
+ key: 0,
31
+ class: "group",
32
+ "data-testid": "ac-table-detail"
33
+ }, O = ["colspan"], de = ["id", "aria-label"], fe = {
34
+ key: 0,
35
+ class: "px-4 py-12 text-center text-muted"
36
+ }, k = "peer size-4 cursor-pointer appearance-none rounded-4 border border-border-dark bg-surface align-middle shadow-xs transition-[background-color,border-color,box-shadow] duration-150 hover:border-slate-60 checked:border-primary checked:bg-primary checked:shadow-button indeterminate:border-primary indeterminate:bg-primary focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", A = /*@__PURE__*/ l({
37
+ __name: "AcTable",
38
+ props: /*@__PURE__*/ u({
39
+ columns: {},
40
+ rows: {},
41
+ rowKey: { default: "id" },
42
+ loading: {
43
+ type: Boolean,
44
+ default: !1
45
+ },
46
+ loaderRows: { default: 3 },
47
+ emptyText: { default: "No data found" },
48
+ clickable: {
49
+ type: Boolean,
50
+ default: !1
51
+ },
52
+ selectable: {
53
+ type: Boolean,
54
+ default: !1
55
+ },
56
+ expandable: {
57
+ type: Boolean,
58
+ default: !1
59
+ },
60
+ canExpand: {
61
+ type: Function,
62
+ default: void 0
63
+ },
64
+ rowActive: {
65
+ type: Function,
66
+ default: void 0
67
+ },
68
+ rowDisabled: {
69
+ type: Function,
70
+ default: void 0
71
+ },
72
+ manualSort: {
73
+ type: Boolean,
74
+ default: !1
75
+ },
76
+ flat: {
77
+ type: Boolean,
78
+ default: !1
79
+ },
80
+ resolveLink: {
81
+ type: Function,
82
+ default: void 0
83
+ }
84
+ }, {
85
+ selected: { default: () => [] },
86
+ selectedModifiers: {},
87
+ expanded: { default: () => [] },
88
+ expandedModifiers: {},
89
+ sortBy: { default: null },
90
+ sortByModifiers: {}
91
+ }),
92
+ emits: /*@__PURE__*/ u(["row-click", "sort"], [
93
+ "update:selected",
94
+ "update:expanded",
95
+ "update:sortBy"
96
+ ]),
97
+ setup(l, { emit: u }) {
98
+ let A = l, j = y(l, "selected"), M = y(l, "expanded"), N = u, P = ee(), F = y(l, "sortBy"), I = n(() => F.value?.key ?? ""), L = n(() => F.value?.mode ?? "asc"), R = (e) => {
99
+ if (!e.sortable) return;
100
+ let t = I.value === e.key && L.value === "asc" ? "desc" : "asc";
101
+ F.value = {
102
+ key: e.key,
103
+ mode: t
104
+ }, N("sort", e.key, t);
105
+ }, z = n(() => {
106
+ if (!I.value || A.manualSort) return A.rows;
107
+ let e = I.value, t = L.value === "asc" ? 1 : -1;
108
+ return [...A.rows].sort((n, r) => String(V(n[e]) ?? "").localeCompare(String(V(r[e]) ?? ""), void 0, { numeric: !0 }) * t);
109
+ });
110
+ function B(e) {
111
+ return typeof e == "object" && !!e && !Array.isArray(e) && "data" in e;
112
+ }
113
+ function V(e) {
114
+ return B(e) ? e.sort ?? e.data : e;
115
+ }
116
+ let H = (e) => !!A.rowDisabled?.(e), U = n(() => A.rows.filter((e) => !H(e)).map((e) => e[A.rowKey])), W = n(() => new Set(j.value)), G = n(() => U.value.length > 0 && U.value.every((e) => W.value.has(e))), K = n(() => !G.value && U.value.some((e) => W.value.has(e)));
117
+ function pe() {
118
+ let e = new Set(U.value);
119
+ j.value = G.value ? j.value.filter((t) => !e.has(t)) : [...j.value, ...U.value.filter((e) => !W.value.has(e))];
120
+ }
121
+ function me(e) {
122
+ let t = e[A.rowKey];
123
+ j.value = W.value.has(t) ? j.value.filter((e) => e !== t) : [...j.value, t];
124
+ }
125
+ let q = n(() => new Set(M.value)), J = (e) => A.expandable && q.value.has(e[A.rowKey]), Y = (e) => !A.canExpand || A.canExpand(e), X = (e) => `${P}-detail-${String(e[A.rowKey])}`, he = n(() => A.columns.length + +!!A.selectable + +!!A.expandable);
126
+ function ge(e) {
127
+ let t = e[A.rowKey];
128
+ M.value = q.value.has(t) ? M.value.filter((e) => e !== t) : [...M.value, t];
129
+ }
130
+ function Z(e) {
131
+ let t = e[A.columns[0]?.key ?? ""], n = B(t) ? t.data : t;
132
+ return typeof n == "string" || typeof n == "number" ? n : String(e[A.rowKey]);
133
+ }
134
+ let Q = n(() => A.flat ? "border-border-light" : "border-border"), $ = (e) => ({
135
+ left: "text-left",
136
+ center: "text-center",
137
+ right: "text-right"
138
+ })[e.align ?? "left"];
139
+ return (n, u) => (p(), a("div", {
140
+ class: d(["w-full overflow-hidden bg-surface", !l.flat && "rounded-10 border border-border shadow-xs"]),
141
+ "data-ac-ds": "",
142
+ "data-testid": "ac-table"
143
+ }, [o("div", T, [o("table", ne, [o("thead", null, [o("tr", null, [
144
+ l.expandable ? (p(), a("th", {
145
+ key: 0,
146
+ scope: "col",
147
+ class: d(["h-9 w-10 border-b bg-surface-muted pr-0 pl-3", [Q.value, !l.flat && "first:rounded-tl-10"]])
148
+ }, [...u[2] ||= [o("span", { class: "sr-only" }, "Expand", -1)]], 2)) : i("", !0),
149
+ l.selectable ? (p(), a("th", {
150
+ key: 1,
151
+ scope: "col",
152
+ class: d(["h-9 w-10 border-b bg-surface-muted pr-0 pl-4", [Q.value, !l.flat && "first:rounded-tl-10"]])
153
+ }, [o("span", re, [o("input", {
154
+ type: "checkbox",
155
+ class: d(k),
156
+ checked: G.value,
157
+ indeterminate: K.value,
158
+ disabled: l.loading || !l.rows.length,
159
+ "aria-label": "Select all rows",
160
+ onChange: pe
161
+ }, null, 40, ie), (p(), r(g(K.value ? v(w) : v(x)), {
162
+ class: "pointer-events-none absolute inset-0 m-auto size-3 text-white opacity-0 peer-checked:opacity-100 peer-indeterminate:opacity-100",
163
+ "stroke-width": 3,
164
+ "aria-hidden": "true"
165
+ }))])], 2)) : i("", !0),
166
+ (p(!0), a(t, null, m(l.columns, (e) => (p(), a("th", {
167
+ key: e.key,
168
+ scope: "col",
169
+ class: d(["h-9 border-b bg-surface-muted px-4 text-xs font-medium whitespace-nowrap text-label", [
170
+ Q.value,
171
+ !l.flat && "first:rounded-tl-10 last:rounded-tr-10",
172
+ $(e),
173
+ e.sortable && "cursor-pointer select-none transition-colors hover:text-heading"
174
+ ]]),
175
+ style: f(e.width ? { width: e.width } : void 0),
176
+ "aria-sort": I.value === e.key ? L.value === "asc" ? "ascending" : "descending" : void 0,
177
+ onClick: (t) => R(e)
178
+ }, [o("span", { class: d(["inline-flex items-center gap-1", I.value === e.key && "text-heading"]) }, [h(n.$slots, `header-${e.key}`, { column: e }, () => [s(_(e.label), 1)]), e.sortable ? (p(), r(g(I.value === e.key ? v(te) : v(C)), {
179
+ key: 0,
180
+ class: d(["size-3 transition-transform", [I.value === e.key ? "text-primary" : "text-slate-60", I.value === e.key && L.value === "desc" && "rotate-180"]]),
181
+ "aria-hidden": "true"
182
+ }, null, 8, ["class"])) : i("", !0)], 2)], 14, ae))), 128))
183
+ ])]), o("tbody", null, [l.loading ? (p(!0), a(t, { key: 0 }, m(l.loaderRows, (e) => (p(), a("tr", { key: `loader-${e}` }, [
184
+ l.expandable ? (p(), a("td", E)) : i("", !0),
185
+ l.selectable ? (p(), a("td", oe)) : i("", !0),
186
+ (p(!0), a(t, null, m(l.columns, (t, n) => (p(), a("td", {
187
+ key: t.key,
188
+ class: "h-12 border-b border-border-light px-4 [tr:last-child_&]:border-0"
189
+ }, [o("span", {
190
+ class: "block h-2.5 animate-pulse rounded-full bg-surface-sunken",
191
+ style: f({ width: `${50 + (e * 17 + n * 23) % 40}%` })
192
+ }, null, 4)]))), 128))
193
+ ]))), 128)) : (p(!0), a(t, { key: 1 }, m(z.value, (f, g) => (p(), a(t, { key: String(f[l.rowKey] ?? g) }, [o("tr", {
194
+ "data-testid": "ac-table-row",
195
+ class: d(["group transition-colors duration-100 hover:bg-surface-muted/70", [
196
+ l.clickable && "cursor-pointer",
197
+ (l.rowActive?.(f) || l.selectable && W.value.has(f[l.rowKey])) && "bg-primary-97",
198
+ l.rowActive?.(f) && "shadow-[inset_0_0_0_1px_var(--color-primary)]",
199
+ H(f) && "pointer-events-none cursor-not-allowed opacity-50"
200
+ ]]),
201
+ "aria-current": l.rowActive?.(f) ? "true" : void 0,
202
+ "aria-disabled": H(f) || void 0,
203
+ onClick: (e) => l.clickable && !H(f) && N("row-click", f)
204
+ }, [
205
+ l.expandable ? (p(), a("td", {
206
+ key: 0,
207
+ class: "h-12 w-10 border-b border-border-light pr-0 pl-3 group-last:border-0",
208
+ onClick: u[0] ||= b(() => {}, ["stop"])
209
+ }, [Y(f) ? (p(), a("button", {
210
+ key: 0,
211
+ type: "button",
212
+ class: "inline-flex size-7 cursor-pointer items-center justify-center rounded-6 text-muted transition-colors hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
213
+ "aria-expanded": J(f),
214
+ "aria-controls": X(f),
215
+ "aria-label": `${J(f) ? "Collapse" : "Expand"} ${Z(f)}`,
216
+ "data-testid": "ac-table-expand",
217
+ onClick: (e) => ge(f)
218
+ }, [c(v(S), {
219
+ class: d(["size-4 transition-transform duration-150 motion-reduce:transition-none", J(f) && "rotate-90"]),
220
+ "aria-hidden": "true"
221
+ }, null, 8, ["class"])], 8, D)) : i("", !0)])) : i("", !0),
222
+ l.selectable ? (p(), a("td", {
223
+ key: 1,
224
+ class: "h-12 w-10 border-b border-border-light pr-0 pl-4 group-last:border-0",
225
+ onClick: u[1] ||= b(() => {}, ["stop"])
226
+ }, [o("span", ce, [o("input", {
227
+ type: "checkbox",
228
+ class: d(k),
229
+ checked: W.value.has(f[l.rowKey]),
230
+ disabled: H(f),
231
+ "aria-label": `Select ${Z(f)}`,
232
+ onChange: (e) => me(f)
233
+ }, null, 40, le), c(v(x), {
234
+ class: "pointer-events-none absolute inset-0 m-auto size-3 text-white opacity-0 peer-checked:opacity-100",
235
+ "stroke-width": 3,
236
+ "aria-hidden": "true"
237
+ })])])) : i("", !0),
238
+ (p(!0), a(t, null, m(l.columns, (i) => (p(), a("td", {
239
+ key: i.key,
240
+ class: d(["h-12 border-b border-border-light px-4 whitespace-nowrap text-body tabular-nums group-last:border-0", $(i)])
241
+ }, [h(n.$slots, `cell-${i.key}`, {
242
+ row: f,
243
+ value: f[i.key]
244
+ }, () => [i.type || i.descriptor ? (p(), r(e, {
245
+ key: 0,
246
+ value: B(f[i.key]) ? void 0 : f[i.key],
247
+ cell: B(f[i.key]) ? f[i.key] : void 0,
248
+ column: i.descriptor,
249
+ type: i.type,
250
+ title: i.label,
251
+ "resolve-link": l.resolveLink
252
+ }, null, 8, [
253
+ "value",
254
+ "cell",
255
+ "column",
256
+ "type",
257
+ "title",
258
+ "resolve-link"
259
+ ])) : (p(), a(t, { key: 1 }, [s(_(f[i.key]), 1)], 64))])], 2))), 128))
260
+ ], 10, se), J(f) && Y(f) ? (p(), a("tr", ue, [o("td", {
261
+ colspan: he.value,
262
+ class: "border-b border-border-light bg-surface-muted/50 p-0 group-last:border-0"
263
+ }, [o("div", {
264
+ id: X(f),
265
+ role: "region",
266
+ "aria-label": `Details for ${Z(f)}`,
267
+ class: "px-4 py-3 text-body"
268
+ }, [h(n.$slots, "expanded", { row: f })], 8, de)], 8, O)])) : i("", !0)], 64))), 128))])])]), !l.loading && !l.rows.length ? (p(), a("div", fe, [h(n.$slots, "empty", {}, () => [s(_(l.emptyText), 1)])])) : i("", !0)], 2));
269
+ }
270
+ });
271
+ //#endregion
272
+ export { A as default };
@@ -0,0 +1,5 @@
1
+ import e from "./AcTabs.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/lib/components/AcTabs.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,40 @@
1
+ export interface TabItem {
2
+ key: string;
3
+ label: string;
4
+ count?: number;
5
+ disabled?: boolean;
6
+ /** Makes the tab a `RouterLink` to this route (needs vue-router in the app). The tab for the current route becomes active by itself. */
7
+ to?: string | Record<string, unknown>;
8
+ /** Plain link, when there's no router. */
9
+ href?: string;
10
+ /** Sets `data-testid` on the tab, e.g. for Cypress. */
11
+ testid?: string;
12
+ }
13
+ export interface Props {
14
+ /** The tabs: `{ key, label, count?, disabled?, to?, href?, testid? }`. `v-model` holds the active `key`. With `to`, it follows the current route. */
15
+ items: TabItem[];
16
+ }
17
+ type __VLS_Props = Props;
18
+ type __VLS_Slots = {
19
+ /** Panel content, rendered under the tab list. Receives the active key. */
20
+ default?: (props: {
21
+ active: string;
22
+ }) => unknown;
23
+ };
24
+ type __VLS_ModelProps = {
25
+ modelValue?: string;
26
+ };
27
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
28
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
29
+ "update:modelValue": (value: string) => any;
30
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
31
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
32
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
34
+ declare const _default: typeof __VLS_export;
35
+ export default _default;
36
+ type __VLS_WithSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -0,0 +1,72 @@
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, defineComponent as s, getCurrentInstance as c, mergeModels as l, mergeProps as u, normalizeClass as d, openBlock as f, renderList as p, renderSlot as m, resolveDynamicComponent as h, toDisplayString as g, useModel as _, watch as v, withCtx as y } from "vue";
2
+ //#region src/lib/components/AcTabs.vue?vue&type=script&setup=true&lang.ts
3
+ var b = {
4
+ "data-ac-ds": "",
5
+ "data-testid": "ac-tabs"
6
+ }, x = {
7
+ role: "tablist",
8
+ class: "flex gap-5 overflow-x-auto overflow-y-hidden border-b border-border-light [scrollbar-width:none]"
9
+ }, S = {
10
+ key: 0,
11
+ role: "tabpanel",
12
+ class: "pt-5"
13
+ }, C = /*@__PURE__*/ s({
14
+ __name: "AcTabs",
15
+ props: /*@__PURE__*/ l({ items: {} }, {
16
+ modelValue: { default: "" },
17
+ modelModifiers: {}
18
+ }),
19
+ emits: ["update:modelValue"],
20
+ setup(s) {
21
+ let l = s, C = _(s, "modelValue"), w = c()?.appContext, T = w?.components.RouterLink, E = w?.config.globalProperties.$router, D = t(() => {
22
+ if (!E) return "";
23
+ let e = E.currentRoute.value.path, t = "", n = -1;
24
+ for (let r of l.items) {
25
+ if (r.to === void 0 || r.disabled) continue;
26
+ let i;
27
+ try {
28
+ i = E.resolve(r.to).path;
29
+ } catch {
30
+ continue;
31
+ }
32
+ if (i === e) return r.key;
33
+ let a = i.endsWith("/") ? i : `${i}/`;
34
+ e.startsWith(a) && i.length > n && (t = r.key, n = i.length);
35
+ }
36
+ return t;
37
+ });
38
+ v(D, (e) => e && (C.value = e), { immediate: !0 });
39
+ function O(e) {
40
+ return e.to !== void 0 && T && !e.disabled ? T : e.href || typeof e.to == "string" ? "a" : "button";
41
+ }
42
+ function k(e) {
43
+ let t = O(e), n = { "data-testid": e.testid };
44
+ return t === T ? n.to = e.to : t === "a" ? e.disabled ? n["aria-disabled"] = "true" : n.href = e.href ?? e.to : (n.type = "button", n.disabled = e.disabled || void 0), n;
45
+ }
46
+ function A(e, t) {
47
+ if (e.disabled) {
48
+ t.preventDefault();
49
+ return;
50
+ }
51
+ C.value = e.key;
52
+ }
53
+ return (t, c) => (f(), i("div", b, [a("div", x, [(f(!0), i(e, null, p(s.items, (e) => (f(), n(h(O(e)), u({ key: e.key }, { ref_for: !0 }, k(e), {
54
+ role: "tab",
55
+ "aria-selected": C.value === e.key,
56
+ class: ["relative -mb-px inline-flex h-10 cursor-pointer items-center gap-2 border-b-2 text-base font-medium whitespace-nowrap transition-colors duration-150 focus-visible:rounded-4 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring no-underline disabled:cursor-not-allowed disabled:opacity-40 aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-40", C.value === e.key ? "border-primary text-heading" : "border-transparent text-muted hover:border-border-dark hover:text-heading"],
57
+ onClick: (t) => A(e, t)
58
+ }), {
59
+ default: y(() => [o(g(e.label) + " ", 1), e.count === void 0 ? r("", !0) : (f(), i("span", {
60
+ key: 0,
61
+ class: d(["inline-flex h-4.5 min-w-4.5 items-center justify-center rounded-50 px-1.5 text-sm leading-none tabular-nums", C.value === e.key ? "bg-primary-95 text-primary-10" : "bg-surface-sunken text-label"])
62
+ }, g(e.count), 3))]),
63
+ _: 2
64
+ }, 1040, [
65
+ "aria-selected",
66
+ "class",
67
+ "onClick"
68
+ ]))), 128))]), t.$slots.default ? (f(), i("div", S, [m(t.$slots, "default", { active: C.value })])) : r("", !0)]));
69
+ }
70
+ });
71
+ //#endregion
72
+ export { C as default };
@@ -0,0 +1,5 @@
1
+ import e from "./AcTag.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/lib/components/AcTag.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,41 @@
1
+ import type { Tone } from "./types";
2
+ export interface Props {
3
+ /** Text of the tag. The default slot overrides it. */
4
+ label?: string;
5
+ /** `neutral` for most labels; a tone to group filters by kind, e.g. environment or region. */
6
+ color?: Tone | "neutral";
7
+ /** Pill shape (`rounded-50`) instead of the 6px control radius. */
8
+ rounded?: boolean;
9
+ /** Shows a remove button that emits `remove`. */
10
+ removable?: boolean;
11
+ /** Key of a key–value tag such as a Kubernetes label (`app=postgres`). Setting it switches to the two-part style. */
12
+ keyLabel?: string;
13
+ /** Value of a key–value tag. Shown after `keyLabel`, tinted with `color`. */
14
+ valueLabel?: string;
15
+ }
16
+ type __VLS_Slots = {
17
+ /** Tag content. Replaces `label`, or the value in key–value mode. */
18
+ default?: () => unknown;
19
+ /** A 14px icon before the text, e.g. a cloud provider or resource kind. */
20
+ icon?: () => unknown;
21
+ };
22
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
+ remove: () => any;
24
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
25
+ onRemove?: (() => any) | undefined;
26
+ }>, {
27
+ label: string;
28
+ color: Tone | "neutral";
29
+ rounded: boolean;
30
+ removable: boolean;
31
+ keyLabel: string;
32
+ valueLabel: string;
33
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
34
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
35
+ declare const _default: typeof __VLS_export;
36
+ export default _default;
37
+ type __VLS_WithSlots<T, S> = T & {
38
+ new (): {
39
+ $slots: S;
40
+ };
41
+ };