@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
@@ -1,49 +1,146 @@
1
- import { Fragment as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, mergeModels as o, normalizeClass as s, openBlock as c, renderList as l, toDisplayString as u, unref as d, useId as f, useModel as p, vModelCheckbox as m, withDirectives as h } from "vue";
2
- import { Check as g } from "@lucide/vue";
1
+ import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, mergeModels as c, mergeProps as l, nextTick as u, normalizeClass as d, openBlock as f, ref as p, renderList as m, toDisplayString as h, unref as g, useAttrs as _, useId as v, useModel as y, vModelCheckbox as b, withDirectives as x, withModifiers as S } from "vue";
2
+ import { Check as C, CircleAlert as w, Minus as T } from "@lucide/vue";
3
3
  //#region src/lib/components/AcCheckBox.vue?vue&type=script&setup=true&lang.ts
4
- var _ = {
5
- class: "flex flex-col gap-2.5",
6
- "data-ac-ds": "",
7
- "data-testid": "ac-checkbox"
8
- }, v = ["for"], y = { class: "relative inline-flex size-4 shrink-0" }, b = [
4
+ var E = ["for"], D = [
9
5
  "id",
10
6
  "name",
11
7
  "value",
12
8
  "disabled"
13
- ], x = {
9
+ ], O = { class: "flex min-w-0 flex-col gap-1" }, k = { class: "font-medium" }, A = {
14
10
  key: 0,
15
- class: "text-xs text-red-30"
16
- }, S = /*@__PURE__*/ a({
11
+ class: "text-xs text-muted"
12
+ }, j = {
13
+ key: 0,
14
+ class: "flex items-center gap-1.5 text-base text-danger-strong",
15
+ role: "alert"
16
+ }, M = [
17
+ "name",
18
+ "checked",
19
+ "indeterminate",
20
+ "disabled",
21
+ "aria-invalid",
22
+ "aria-describedby"
23
+ ], N = {
24
+ key: 0,
25
+ class: "flex min-w-0 flex-col gap-1"
26
+ }, P = {
27
+ key: 0,
28
+ class: "font-medium"
29
+ }, F = {
30
+ key: 1,
31
+ class: "text-xs text-muted"
32
+ }, I = ["id"], L = /*@__PURE__*/ s({
33
+ inheritAttrs: !1,
17
34
  __name: "AcCheckBox",
18
- props: /*@__PURE__*/ o({
19
- options: {},
35
+ props: /*@__PURE__*/ c({
36
+ options: { default: void 0 },
20
37
  name: { default: "checkbox" },
21
- errorMsg: { default: "" }
38
+ errorMsg: { default: "" },
39
+ label: { default: "" },
40
+ description: { default: "" },
41
+ disabled: {
42
+ type: Boolean,
43
+ default: !1
44
+ },
45
+ indeterminate: {
46
+ type: Boolean,
47
+ default: !1
48
+ },
49
+ size: { default: "normal" }
22
50
  }, {
23
51
  modelValue: { default: () => [] },
24
- modelModifiers: {}
52
+ modelModifiers: {},
53
+ checked: {
54
+ type: Boolean,
55
+ default: !1
56
+ },
57
+ checkedModifiers: {}
25
58
  }),
26
- emits: ["update:modelValue"],
27
- setup(a) {
28
- let o = p(a, "modelValue"), S = f();
29
- return (f, p) => (c(), n("div", _, [(c(!0), n(e, null, l(a.options, (e, t) => (c(), n("label", {
59
+ emits: ["update:modelValue", "update:checked"],
60
+ setup(s) {
61
+ let c = s, L = y(s, "modelValue"), R = y(s, "checked"), z = v(), B = _(), V = p(null), H = t(() => c.size === "small"), U = t(() => c.indeterminate && !R.value), W = t(() => c.options ? B : {
62
+ class: B.class,
63
+ style: B.style
64
+ }), G = t(() => {
65
+ let { class: e, style: t, ...n } = B;
66
+ return c.label || n["aria-label"] || n["aria-labelledby"] ? n : {
67
+ "aria-label": "Select",
68
+ ...n
69
+ };
70
+ }), K = t(() => ["peer cursor-pointer appearance-none rounded-4 border border-muted/70 bg-surface transition-colors duration-200 group-hover:border-muted checked:border-primary checked:bg-primary group-hover:checked:border-primary indeterminate:border-primary indeterminate:bg-primary group-hover:indeterminate:border-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none disabled:cursor-not-allowed disabled:bg-surface-sunken", H.value ? "size-4" : "size-5"]), q = t(() => ["pointer-events-none absolute inset-0 m-auto scale-75 text-white opacity-0 transition duration-150 motion-reduce:transition-none", H.value ? "size-3" : "size-4"]);
71
+ async function J(e) {
72
+ R.value = e.target.checked, await u(), V.value && (V.value.checked = R.value, V.value.indeterminate = U.value);
73
+ }
74
+ return (t, c) => s.options ? (f(), r("div", l({
75
+ key: 0,
76
+ class: "flex flex-col gap-3",
77
+ "data-ac-ds": "",
78
+ "data-testid": "ac-checkbox"
79
+ }, W.value), [(f(!0), r(e, null, m(s.options, (e, t) => (f(), r("label", {
30
80
  key: e.label,
31
- for: `${d(S)}-${t}`,
32
- class: s(["group inline-flex w-fit cursor-pointer items-center gap-2.5 text-base text-heading", e.disabled && "cursor-not-allowed opacity-50"])
33
- }, [r("span", y, [h(r("input", {
34
- id: `${d(S)}-${t}`,
35
- "onUpdate:modelValue": p[0] ||= (e) => o.value = e,
81
+ for: `${g(z)}-${t}`,
82
+ class: d(["group inline-flex w-fit cursor-pointer text-base text-heading select-none", [
83
+ e.description ? "items-start" : "items-center",
84
+ e.disabled && "cursor-not-allowed opacity-50",
85
+ H.value ? "gap-2.5" : "gap-3"
86
+ ]])
87
+ }, [i("span", { class: d(["relative inline-flex shrink-0", [H.value ? "size-4" : "size-5", e.description && (H.value ? "mt-0.5" : "mt-px")]]) }, [x(i("input", {
88
+ id: `${g(z)}-${t}`,
89
+ "onUpdate:modelValue": c[0] ||= (e) => L.value = e,
36
90
  type: "checkbox",
37
- name: a.name,
91
+ name: s.name,
38
92
  value: e.value,
39
93
  disabled: e.disabled,
40
- class: "peer size-4 cursor-pointer appearance-none rounded-4 border border-border-dark bg-surface shadow-xs transition-[background-color,border-color,box-shadow] duration-150 group-hover:border-slate-60 checked:border-primary checked:bg-primary checked:shadow-button focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring disabled:cursor-not-allowed"
41
- }, null, 8, b), [[m, o.value]]), i(d(g), {
42
- class: "pointer-events-none absolute inset-0 m-auto size-3 scale-75 text-white opacity-0 transition duration-150 peer-checked:scale-100 peer-checked:opacity-100",
94
+ class: d(K.value)
95
+ }, null, 10, D), [[b, L.value]]), o(g(C), {
96
+ class: d([q.value, "peer-checked:scale-100 peer-checked:opacity-100"]),
43
97
  "stroke-width": 3,
44
98
  "aria-hidden": "true"
45
- })]), r("span", null, u(e.label), 1)], 10, v))), 128)), a.errorMsg ? (c(), n("p", x, u(a.errorMsg), 1)) : t("", !0)]));
99
+ }, null, 8, ["class"])], 2), i("span", O, [i("span", k, h(e.label), 1), e.description ? (f(), r("span", A, h(e.description), 1)) : n("", !0)])], 10, E))), 128)), s.errorMsg ? (f(), r("p", j, [o(g(w), {
100
+ class: "size-4 shrink-0",
101
+ "aria-hidden": "true"
102
+ }), a(" " + h(s.errorMsg), 1)])) : n("", !0)], 16)) : (f(), r("div", l({
103
+ key: 1,
104
+ class: "inline-flex flex-col gap-1.5",
105
+ "data-ac-ds": "",
106
+ "data-testid": "ac-checkbox"
107
+ }, W.value, { onClick: c[1] ||= S(() => {}, ["stop"]) }), [i("label", { class: d(["group inline-flex w-fit cursor-pointer text-base text-heading select-none", [
108
+ s.description ? "items-start" : "items-center",
109
+ s.disabled && "cursor-not-allowed opacity-50",
110
+ H.value ? "gap-2.5" : "gap-3"
111
+ ]]) }, [i("span", { class: d(["relative inline-flex shrink-0", [H.value ? "size-4" : "size-5", s.description && s.label && (H.value ? "mt-0.5" : "mt-px")]]) }, [
112
+ i("input", l({
113
+ ref_key: "single",
114
+ ref: V,
115
+ type: "checkbox",
116
+ name: s.name,
117
+ checked: R.value,
118
+ indeterminate: U.value,
119
+ disabled: s.disabled,
120
+ "aria-invalid": s.errorMsg ? !0 : void 0,
121
+ "aria-describedby": s.errorMsg ? `${g(z)}-error` : void 0,
122
+ class: K.value
123
+ }, G.value, { onChange: J }), null, 16, M),
124
+ o(g(C), {
125
+ class: d([q.value, "peer-checked:scale-100 peer-checked:opacity-100"]),
126
+ "stroke-width": 3,
127
+ "aria-hidden": "true"
128
+ }, null, 8, ["class"]),
129
+ o(g(T), {
130
+ class: d([q.value, "peer-indeterminate:scale-100 peer-indeterminate:opacity-100"]),
131
+ "stroke-width": 3,
132
+ "aria-hidden": "true"
133
+ }, null, 8, ["class"])
134
+ ], 2), s.label || s.description ? (f(), r("span", N, [s.label ? (f(), r("span", P, h(s.label), 1)) : n("", !0), s.description ? (f(), r("span", F, h(s.description), 1)) : n("", !0)])) : n("", !0)], 2), s.errorMsg ? (f(), r("p", {
135
+ key: 0,
136
+ id: `${g(z)}-error`,
137
+ class: "flex items-center gap-1.5 text-base text-danger-strong",
138
+ role: "alert"
139
+ }, [o(g(w), {
140
+ class: "size-4 shrink-0",
141
+ "aria-hidden": "true"
142
+ }), a(" " + h(s.errorMsg), 1)], 8, I)) : n("", !0)], 16));
46
143
  }
47
144
  });
48
145
  //#endregion
49
- export { S as default };
146
+ export { L as default };
@@ -6,7 +6,7 @@ export interface Props<V> {
6
6
  name?: string;
7
7
  /** Lays the options out horizontally. */
8
8
  row?: boolean;
9
- /** Card style with each option's description, like the source's hasDescription. */
9
+ /** Shows each option as a card with its description underneath. */
10
10
  cards?: boolean;
11
11
  /** Error text under the group. */
12
12
  errorMsg?: string;
@@ -1,20 +1,22 @@
1
- import { Fragment as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, mergeModels as a, normalizeClass as o, openBlock as s, renderList as c, toDisplayString as l, unref as u, useId as d, useModel as f, vModelRadio as p, withDirectives as m } from "vue";
1
+ import { Fragment as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, mergeModels as s, normalizeClass as c, openBlock as l, renderList as u, toDisplayString as d, unref as f, useId as p, useModel as m, vModelRadio as h, withDirectives as g } from "vue";
2
+ import { CircleAlert as _ } from "@lucide/vue";
2
3
  //#region src/lib/components/AcCheckRadio.vue?vue&type=script&setup=true&lang.ts
3
- var h = {
4
+ var v = {
4
5
  role: "radiogroup",
5
6
  "data-ac-ds": "",
6
7
  "data-testid": "ac-check-radio"
7
- }, g = ["for"], _ = [
8
+ }, y = ["for"], b = [
8
9
  "id",
9
10
  "name",
10
11
  "value",
11
12
  "disabled"
12
- ], v = { class: "flex flex-col" }, y = ["title"], b = {
13
+ ], x = { class: "flex min-w-0 flex-col" }, S = ["title"], C = {
13
14
  key: 0,
14
- class: "mt-2 text-xs text-red-30"
15
- }, x = /*@__PURE__*/ i({
15
+ class: "mt-2 flex items-center gap-1.5 text-base text-danger-strong",
16
+ role: "alert"
17
+ }, w = /*@__PURE__*/ o({
16
18
  __name: "AcCheckRadio",
17
- props: /*@__PURE__*/ a({
19
+ props: /*@__PURE__*/ s({
18
20
  options: {},
19
21
  name: { default: "radio" },
20
22
  row: {
@@ -31,26 +33,36 @@ var h = {
31
33
  modelModifiers: {}
32
34
  }),
33
35
  emits: ["update:modelValue"],
34
- setup(i) {
35
- let a = f(i, "modelValue"), x = d();
36
- return (d, f) => (s(), n("div", h, [r("div", { class: o(i.cards ? "grid gap-3 sm:grid-cols-2" : i.row ? "flex flex-row flex-wrap gap-x-6 gap-y-2" : "flex flex-col gap-2.5") }, [(s(!0), n(e, null, c(i.options, (e, c) => (s(), n("label", {
36
+ setup(o) {
37
+ let s = m(o, "modelValue"), w = p();
38
+ return (p, m) => (l(), n("div", v, [r("div", { class: c(o.cards ? "grid gap-3 sm:grid-cols-2" : o.row ? "flex flex-row flex-wrap gap-x-6 gap-y-3" : "flex flex-col gap-3") }, [(l(!0), n(e, null, u(o.options, (e, i) => (l(), n("label", {
37
39
  key: e.label,
38
- for: `${u(x)}-${c}`,
39
- class: o(["group flex cursor-pointer gap-2.5 text-base text-heading", [e.disabled && "cursor-not-allowed opacity-50", i.cards && "rounded-10 border border-border bg-surface p-4 shadow-xs transition-[border-color,box-shadow,background-color] duration-150 hover:border-border-dark has-checked:border-primary has-checked:bg-primary-97/60 has-checked:shadow-[0_0_0_1px_var(--color-primary)] has-focus-visible:shadow-[0_0_0_3px_var(--color-ring)]"]])
40
- }, [m(r("input", {
41
- id: `${u(x)}-${c}`,
42
- "onUpdate:modelValue": f[0] ||= (e) => a.value = e,
40
+ for: `${f(w)}-${i}`,
41
+ class: c(["group flex cursor-pointer gap-3 text-base text-heading select-none", [
42
+ e.disabled && "cursor-not-allowed opacity-50",
43
+ o.cards ? "items-start rounded-14 border border-border bg-surface p-4 transition-[border-color,background-color,box-shadow] duration-200 has-checked:border-primary has-checked:bg-primary/5 has-checked:ring-1 has-checked:ring-primary/30 has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ring" : "w-fit items-center",
44
+ o.cards && !e.disabled && "hover:border-primary/40 hover:bg-accent-hover has-checked:hover:border-primary has-checked:hover:bg-primary/5"
45
+ ]])
46
+ }, [r("span", { class: c(["relative inline-flex size-5 shrink-0", o.cards && "mt-px"]) }, [g(r("input", {
47
+ id: `${f(w)}-${i}`,
48
+ "onUpdate:modelValue": m[0] ||= (e) => s.value = e,
43
49
  type: "radio",
44
- name: `${i.name}-${u(x)}`,
50
+ name: `${o.name}-${f(w)}`,
45
51
  value: e.value,
46
52
  disabled: e.disabled,
47
- class: "mt-0.5 size-4 shrink-0 cursor-pointer appearance-none rounded-full border border-border-dark bg-surface shadow-xs transition-[border-color,border-width] duration-150 group-hover:border-slate-60 checked:border-[5px] checked:border-primary focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring disabled:cursor-not-allowed"
48
- }, null, 8, _), [[p, a.value]]), r("span", v, [r("span", { class: o(i.cards && "font-medium") }, l(e.label), 3), i.cards && e.description ? (s(), n("span", {
53
+ class: c(["peer size-5 cursor-pointer appearance-none rounded-full border border-muted/70 bg-surface transition-colors duration-200 group-hover:border-muted checked:border-primary checked:bg-primary group-hover:checked:border-primary focus-visible:outline-none disabled:cursor-not-allowed disabled:bg-surface-sunken", !o.cards && "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface"])
54
+ }, null, 10, b), [[h, s.value]]), m[1] ||= r("span", {
55
+ class: "pointer-events-none absolute inset-0 m-auto size-2 scale-0 rounded-full bg-white transition-transform duration-200 peer-checked:scale-100 motion-reduce:transition-none",
56
+ "aria-hidden": "true"
57
+ }, null, -1)], 2), r("span", x, [r("span", { class: c(o.cards ? "font-semibold" : "font-medium") }, d(e.label), 3), o.cards && e.description ? (l(), n("span", {
49
58
  key: 0,
50
- class: "mt-0.5 line-clamp-2 text-xs text-muted",
59
+ class: "mt-0.5 line-clamp-2 text-xs leading-relaxed text-muted",
51
60
  title: e.description
52
- }, l(e.description), 9, y)) : t("", !0)])], 10, g))), 128))], 2), i.errorMsg ? (s(), n("p", b, l(i.errorMsg), 1)) : t("", !0)]));
61
+ }, d(e.description), 9, S)) : t("", !0)])], 10, y))), 128))], 2), o.errorMsg ? (l(), n("p", C, [a(f(_), {
62
+ class: "size-4 shrink-0",
63
+ "aria-hidden": "true"
64
+ }), i(" " + d(o.errorMsg), 1)])) : t("", !0)]));
53
65
  }
54
66
  });
55
67
  //#endregion
56
- export { x as default };
68
+ export { w as default };
@@ -0,0 +1,5 @@
1
+ import e from "./AcCircularProgress.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/lib/components/AcCircularProgress.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,44 @@
1
+ import type { Tone } from "./types";
2
+ export interface Props {
3
+ /** Current amount, from 0 to `max`. Values outside are clamped. Ignored while `indeterminate`. */
4
+ value?: number;
5
+ /** The amount that fills the ring. */
6
+ max?: number;
7
+ /** Diameter: `small` 32px, `normal` 48px, `large` 80px, or a number of pixels (cloud-ui's `size`, e.g. 44). */
8
+ size?: "small" | "normal" | "large" | number;
9
+ /** Ring thickness in pixels. Defaults to 3, 4 and 6 for the named sizes, and about a tenth of a numeric size. */
10
+ strokeWidth?: number;
11
+ /** Shows the percentage, or `valueText`, in the centre. Turn it off below 40px. */
12
+ showLabel?: boolean;
13
+ /** Replaces the percentage in the centre and for screen readers, e.g. "3/5". Keep it to 4 characters. */
14
+ valueText?: string;
15
+ /** Ring colour. `auto` is for quotas: primary, then warning from 80% and danger from 95%, as in AcProgress. */
16
+ color?: Tone | "auto";
17
+ /** The accessible name, e.g. "CPU usage" or "Image sync to nyc1". Without it the ring is read as "Progress". */
18
+ label?: string;
19
+ /** For work of unknown length: a spinning quarter ring with no value. */
20
+ indeterminate?: boolean;
21
+ }
22
+ type __VLS_Slots = {
23
+ /** Custom centre content instead of the percentage, e.g. a 16px icon. Also shown while `indeterminate`. Hidden from screen readers; set `valueText` for them. */
24
+ default?: () => unknown;
25
+ };
26
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
27
+ label: string;
28
+ value: number;
29
+ color: Tone | "auto";
30
+ max: number;
31
+ size: "small" | "normal" | "large" | number;
32
+ strokeWidth: number;
33
+ indeterminate: boolean;
34
+ showLabel: boolean;
35
+ valueText: 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,111 @@
1
+ import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, defineComponent as a, normalizeClass as o, normalizeStyle as s, openBlock as c, renderSlot as l, toDisplayString as u } from "vue";
2
+ //#region src/lib/components/AcCircularProgress.vue?vue&type=script&setup=true&lang.ts
3
+ var d = [
4
+ "aria-label",
5
+ "aria-valuemax",
6
+ "aria-valuenow",
7
+ "aria-valuetext",
8
+ "aria-busy"
9
+ ], f = ["viewBox"], p = [
10
+ "cx",
11
+ "cy",
12
+ "r",
13
+ "stroke-width"
14
+ ], m = [
15
+ "cx",
16
+ "cy",
17
+ "r",
18
+ "stroke-width",
19
+ "stroke-dashoffset"
20
+ ], h = /*@__PURE__*/ a({
21
+ __name: "AcCircularProgress",
22
+ props: {
23
+ value: { default: 0 },
24
+ max: { default: 100 },
25
+ size: { default: "normal" },
26
+ strokeWidth: { default: void 0 },
27
+ showLabel: {
28
+ type: Boolean,
29
+ default: !0
30
+ },
31
+ valueText: { default: "" },
32
+ color: { default: "primary" },
33
+ label: { default: "" },
34
+ indeterminate: {
35
+ type: Boolean,
36
+ default: !1
37
+ }
38
+ },
39
+ setup(a) {
40
+ let h = a, g = {
41
+ small: {
42
+ px: 32,
43
+ stroke: 3,
44
+ box: "size-8",
45
+ text: "text-[9px]"
46
+ },
47
+ normal: {
48
+ px: 48,
49
+ stroke: 4,
50
+ box: "size-12",
51
+ text: "text-xs"
52
+ },
53
+ large: {
54
+ px: 80,
55
+ stroke: 6,
56
+ box: "size-20",
57
+ text: "text-xl"
58
+ }
59
+ }, _ = {
60
+ primary: "text-primary",
61
+ info: "text-info",
62
+ success: "text-success",
63
+ warning: "text-warning",
64
+ danger: "text-danger"
65
+ }, v = e(() => typeof h.size == "number" ? null : g[h.size]), y = e(() => v.value?.px ?? Math.max(16, h.size)), b = e(() => h.strokeWidth ?? v.value?.stroke ?? Math.max(2, Math.round(y.value / 11))), x = e(() => (y.value - b.value) / 2), S = e(() => v.value ? void 0 : {
66
+ width: `${y.value}px`,
67
+ height: `${y.value}px`
68
+ }), C = e(() => v.value ? void 0 : { fontSize: `${Math.min(24, Math.max(9, Math.round(y.value * .23)))}px` }), w = e(() => h.max <= 0 ? 0 : Math.min(100, Math.max(0, h.value / h.max * 100))), T = e(() => h.color === "auto" ? w.value >= 95 ? "danger" : w.value >= 80 ? "warning" : "primary" : h.color), E = e(() => h.valueText || `${Math.round(w.value)}%`);
69
+ return (e, h) => (c(), n("div", {
70
+ role: "progressbar",
71
+ "aria-label": a.label || "Progress",
72
+ "aria-valuemin": "0",
73
+ "aria-valuemax": a.indeterminate ? void 0 : a.max,
74
+ "aria-valuenow": a.indeterminate ? void 0 : Math.min(a.max, Math.max(0, a.value)),
75
+ "aria-valuetext": a.indeterminate ? void 0 : E.value,
76
+ "aria-busy": a.indeterminate || void 0,
77
+ class: o(["relative inline-flex shrink-0 items-center justify-center", v.value?.box]),
78
+ style: s(S.value),
79
+ "data-ac-ds": "",
80
+ "data-testid": "ac-circular-progress"
81
+ }, [(c(), n("svg", {
82
+ class: o(["size-full -rotate-90", [_[T.value], a.indeterminate && "animate-spin motion-reduce:animate-none"]]),
83
+ viewBox: `0 0 ${y.value} ${y.value}`,
84
+ fill: "none",
85
+ "aria-hidden": "true"
86
+ }, [r("circle", {
87
+ cx: y.value / 2,
88
+ cy: y.value / 2,
89
+ r: x.value,
90
+ class: "stroke-muted/15",
91
+ "stroke-width": b.value
92
+ }, null, 8, p), r("circle", {
93
+ cx: y.value / 2,
94
+ cy: y.value / 2,
95
+ r: x.value,
96
+ class: o(["stroke-current transition-[stroke-dashoffset,color,opacity] duration-700 ease-out motion-reduce:transition-none", !a.indeterminate && w.value === 0 && "opacity-0"]),
97
+ "stroke-width": b.value,
98
+ "stroke-linecap": "round",
99
+ pathLength: "100",
100
+ "stroke-dasharray": "100",
101
+ "stroke-dashoffset": a.indeterminate ? 75 : 100 - w.value
102
+ }, null, 10, m)], 10, f)), e.$slots.default || a.showLabel && !a.indeterminate ? (c(), n("span", {
103
+ key: 0,
104
+ class: o(["pointer-events-none absolute inset-0 flex items-center justify-center leading-none font-semibold tracking-tight text-heading tabular-nums select-none", v.value?.text]),
105
+ style: s(C.value),
106
+ "aria-hidden": "true"
107
+ }, [l(e.$slots, "default", {}, () => [i(u(E.value), 1)])], 6)) : t("", !0)], 14, d));
108
+ }
109
+ });
110
+ //#endregion
111
+ export { h as default };