@ac-design/design-system 2.0.0 → 2.1.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 (167) hide show
  1. package/dist/lib/charts/ChartFrame.vue.d.ts +2 -0
  2. package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +42 -37
  3. package/dist/lib/charts/cartesian.d.ts +324 -0
  4. package/dist/lib/charts/cartesian.js +137 -0
  5. package/dist/lib/charts/echarts.d.ts +86 -0
  6. package/dist/lib/charts/echarts.js +173 -0
  7. package/dist/lib/charts/graph.d.ts +77 -0
  8. package/dist/lib/charts/graph.js +155 -0
  9. package/dist/lib/charts/index.d.ts +4 -0
  10. package/dist/lib/charts/index.js +3 -1
  11. package/dist/lib/charts/shared.d.ts +0 -7
  12. package/dist/lib/charts/shared.js +1 -19
  13. package/dist/lib/charts/xy.d.ts +11 -7
  14. package/dist/lib/charts/xy.js +53 -72
  15. package/dist/lib/compat.css +1322 -278
  16. package/dist/lib/components/AcAlert.vue.d.ts +9 -0
  17. package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -21
  18. package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +1 -1
  19. package/dist/lib/components/AcAreaChart.vue.d.ts +3 -0
  20. package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +132 -142
  21. package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
  22. package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +59 -54
  23. package/dist/lib/components/AcBadge.vue.d.ts +7 -3
  24. package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +35 -28
  25. package/dist/lib/components/AcBarChart.vue.d.ts +3 -0
  26. package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +142 -146
  27. package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
  28. package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +18 -17
  29. package/dist/lib/components/AcBulkActionBar.vue.d.ts +2 -0
  30. package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +1 -1
  31. package/dist/lib/components/AcButton.vue.d.ts +12 -6
  32. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +85 -47
  33. package/dist/lib/components/AcCard.vue.d.ts +34 -3
  34. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +169 -34
  35. package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
  36. package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +171 -165
  37. package/dist/lib/components/AcCheckBox.vue.d.ts +1 -1
  38. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +58 -72
  39. package/dist/lib/components/AcCheckList.js +5 -0
  40. package/dist/lib/components/AcCheckList.vue.d.ts +45 -0
  41. package/dist/lib/components/AcCheckList.vue_vue_type_script_setup_true_lang.js +64 -0
  42. package/dist/lib/components/AcCheckRadio.vue.d.ts +30 -5
  43. package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +100 -36
  44. package/dist/lib/components/AcCircularProgress.vue.d.ts +4 -4
  45. package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +12 -9
  46. package/dist/lib/components/AcColorInput.vue.d.ts +5 -2
  47. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +127 -97
  48. package/dist/lib/components/AcCommandBlock.js +5 -0
  49. package/dist/lib/components/AcCommandBlock.vue.d.ts +34 -0
  50. package/dist/lib/components/AcCommandBlock.vue_vue_type_script_setup_true_lang.js +88 -0
  51. package/dist/lib/components/AcConfirmModal.vue.d.ts +1 -1
  52. package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +7 -3
  53. package/dist/lib/components/AcCopyButton.vue.d.ts +2 -2
  54. package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +4 -4
  55. package/dist/lib/components/AcCostSummary.js +5 -0
  56. package/dist/lib/components/AcCostSummary.vue.d.ts +102 -0
  57. package/dist/lib/components/AcCostSummary.vue_vue_type_script_setup_true_lang.js +179 -0
  58. package/dist/lib/components/AcDatePicker.vue.d.ts +3 -3
  59. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +606 -380
  60. package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +47 -41
  61. package/dist/lib/components/AcDonutChart.vue.d.ts +10 -0
  62. package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +116 -89
  63. package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
  64. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +88 -75
  65. package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
  66. package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
  67. package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +17 -17
  68. package/dist/lib/components/AcEmptyState.vue.d.ts +1 -1
  69. package/dist/lib/components/AcErrorState.js +5 -0
  70. package/dist/lib/components/AcErrorState.vue.d.ts +46 -0
  71. package/dist/lib/components/AcErrorState.vue_vue_type_script_setup_true_lang.js +66 -0
  72. package/dist/lib/components/AcFeatureCard.vue.d.ts +6 -0
  73. package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +136 -114
  74. package/dist/lib/components/AcFooter.vue.d.ts +1 -1
  75. package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +1 -1
  76. package/dist/lib/components/AcFormFooter.vue.d.ts +1 -1
  77. package/dist/lib/components/AcFormSection.vue.d.ts +1 -1
  78. package/dist/lib/components/AcGraphChart.js +5 -0
  79. package/dist/lib/components/AcGraphChart.vue.d.ts +124 -0
  80. package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +578 -0
  81. package/dist/lib/components/AcHeader.vue.d.ts +17 -2
  82. package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +79 -25
  83. package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
  84. package/dist/lib/components/AcInput.vue.d.ts +1 -1
  85. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +76 -79
  86. package/dist/lib/components/AcKeyValueInput.vue.d.ts +4 -4
  87. package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +199 -183
  88. package/dist/lib/components/AcLineChart.vue.d.ts +6 -0
  89. package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +113 -125
  90. package/dist/lib/components/AcLoader.js +5 -0
  91. package/dist/lib/components/AcLoader.vue.d.ts +15 -0
  92. package/dist/lib/components/AcLoader.vue_vue_type_script_setup_true_lang.js +66 -0
  93. package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +3 -1
  94. package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +44 -36
  95. package/dist/lib/components/AcMapChart.js +5 -0
  96. package/dist/lib/components/AcMapChart.vue.d.ts +136 -0
  97. package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +518 -0
  98. package/dist/lib/components/AcModal.vue.d.ts +6 -3
  99. package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +85 -61
  100. package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
  101. package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +25 -17
  102. package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
  103. package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +3 -4
  104. package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
  105. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +133 -168
  106. package/dist/lib/components/AcNumberInput.vue.d.ts +2 -2
  107. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +137 -147
  108. package/dist/lib/components/AcPage.vue.d.ts +2 -2
  109. package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +1 -1
  110. package/dist/lib/components/AcPagination.vue.d.ts +5 -5
  111. package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +59 -56
  112. package/dist/lib/components/AcPreloader.vue.d.ts +3 -3
  113. package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +15 -16
  114. package/dist/lib/components/AcProductHero.js +5 -0
  115. package/dist/lib/components/AcProductHero.vue.d.ts +56 -0
  116. package/dist/lib/components/AcProductHero.vue_vue_type_script_setup_true_lang.js +95 -0
  117. package/dist/lib/components/AcProgress.vue.d.ts +17 -2
  118. package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +83 -29
  119. package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
  120. package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +4 -4
  121. package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
  122. package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +8 -4
  123. package/dist/lib/components/AcSelect.vue.d.ts +3 -3
  124. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +232 -243
  125. package/dist/lib/components/AcSettingsRow.js +5 -0
  126. package/dist/lib/components/AcSettingsRow.vue.d.ts +29 -0
  127. package/dist/lib/components/AcSettingsRow.vue_vue_type_script_setup_true_lang.js +37 -0
  128. package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +5 -5
  129. package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
  130. package/dist/lib/components/AcSidebar.vue.d.ts +4 -1
  131. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +104 -94
  132. package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
  133. package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +42 -42
  134. package/dist/lib/components/AcSidebarSection.vue.d.ts +2 -2
  135. package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +23 -18
  136. package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +1 -1
  137. package/dist/lib/components/AcSwitch.vue.d.ts +3 -0
  138. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +46 -39
  139. package/dist/lib/components/AcSwitchCard.vue.d.ts +3 -3
  140. package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +9 -7
  141. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +65 -65
  142. package/dist/lib/components/AcTabs.vue.d.ts +9 -2
  143. package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +42 -27
  144. package/dist/lib/components/AcTag.vue.d.ts +1 -1
  145. package/dist/lib/components/AcTagInput.vue.d.ts +5 -5
  146. package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +140 -142
  147. package/dist/lib/components/AcTextarea.vue.d.ts +1 -1
  148. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +69 -72
  149. package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
  150. package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +54 -22
  151. package/dist/lib/components/AcTimePicker.vue.d.ts +1 -1
  152. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +177 -185
  153. package/dist/lib/components/AcToaster.vue.d.ts +6 -3
  154. package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +103 -64
  155. package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
  156. package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +184 -70
  157. package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
  158. package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +181 -138
  159. package/dist/lib/components/index.d.ts +7 -0
  160. package/dist/lib/components/status.d.ts +3 -1
  161. package/dist/lib/components/status.js +20 -5
  162. package/dist/lib/composables/useToast.d.ts +17 -1
  163. package/dist/lib/composables/useToast.js +10 -2
  164. package/dist/lib/index.d.ts +7 -3
  165. package/dist/lib/index.js +80 -73
  166. package/dist/lib/theme.css +39 -54
  167. package/package.json +12 -3
@@ -1,38 +1,38 @@
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";
1
+ import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, mergeModels as s, mergeProps as c, nextTick as l, normalizeClass as u, openBlock as d, ref as f, renderList as p, toDisplayString as m, unref as h, useAttrs as g, useId as _, useModel as v, vModelCheckbox as y, withDirectives as b, withModifiers as x } from "vue";
2
+ import { Check as S, Minus as C } from "@lucide/vue";
3
3
  //#region src/lib/components/AcCheckBox.vue?vue&type=script&setup=true&lang.ts
4
- var E = ["for"], D = [
4
+ var w = { class: "flex flex-col gap-3" }, T = ["for"], E = [
5
5
  "id",
6
6
  "name",
7
7
  "value",
8
8
  "disabled"
9
- ], O = { class: "flex min-w-0 flex-col gap-1" }, k = { class: "font-medium" }, A = {
9
+ ], D = { class: "flex min-w-0 flex-col gap-1" }, O = { class: "font-medium" }, k = {
10
10
  key: 0,
11
11
  class: "text-xs text-muted"
12
- }, j = {
12
+ }, A = {
13
13
  key: 0,
14
- class: "flex items-center gap-1.5 text-base text-danger-strong",
14
+ class: "mt-1 text-base text-danger-strong",
15
15
  role: "alert"
16
- }, M = [
16
+ }, j = [
17
17
  "name",
18
18
  "checked",
19
19
  "indeterminate",
20
20
  "disabled",
21
21
  "aria-invalid",
22
22
  "aria-describedby"
23
- ], N = {
23
+ ], M = {
24
24
  key: 0,
25
25
  class: "flex min-w-0 flex-col gap-1"
26
- }, P = {
26
+ }, N = {
27
27
  key: 0,
28
28
  class: "font-medium"
29
- }, F = {
29
+ }, P = {
30
30
  key: 1,
31
31
  class: "text-xs text-muted"
32
- }, I = ["id"], L = /*@__PURE__*/ s({
32
+ }, F = ["id"], I = /*@__PURE__*/ o({
33
33
  inheritAttrs: !1,
34
34
  __name: "AcCheckBox",
35
- props: /*@__PURE__*/ c({
35
+ props: /*@__PURE__*/ s({
36
36
  options: { default: void 0 },
37
37
  name: { default: "checkbox" },
38
38
  errorMsg: { default: "" },
@@ -57,90 +57,76 @@ var E = ["for"], D = [
57
57
  checkedModifiers: {}
58
58
  }),
59
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 : {
60
+ setup(o) {
61
+ let s = o, I = v(o, "modelValue"), L = v(o, "checked"), R = _(), z = g(), B = f(null), V = t(() => s.size === "small"), H = t(() => s.indeterminate && !L.value), U = t(() => s.options ? z : {
62
+ class: z.class,
63
+ style: z.style
64
+ }), W = t(() => {
65
+ let { class: e, style: t, ...n } = z;
66
+ return s.label || n["aria-label"] || n["aria-labelledby"] ? n : {
67
67
  "aria-label": "Select",
68
68
  ...n
69
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);
70
+ }), G = t(() => V.value ? "size-[18px]" : "size-6"), K = t(() => [
71
+ "peer cursor-pointer appearance-none rounded-4 border border-muted/70 transition-colors duration-200 group-hover:enabled:not-checked:not-indeterminate:border-primary/60 checked:border-primary checked:bg-primary indeterminate:border-primary indeterminate:bg-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",
72
+ G.value,
73
+ V.value ? "bg-background" : "bg-transparent"
74
+ ]), q = t(() => ["pointer-events-none absolute inset-0 m-auto text-white opacity-0 transition-opacity duration-150 motion-reduce:transition-none", V.value ? "size-3.5" : "size-5"]), J = t(() => ["cursor-not-allowed", V.value ? "opacity-40" : "opacity-50"]);
75
+ async function Y(e) {
76
+ L.value = e.target.checked, await l(), B.value && (B.value.checked = L.value, B.value.indeterminate = H.value);
73
77
  }
74
- return (t, c) => s.options ? (f(), r("div", l({
78
+ return (t, s) => o.options ? (d(), r("div", c({
75
79
  key: 0,
76
- class: "flex flex-col gap-3",
77
80
  "data-ac-ds": "",
78
81
  "data-testid": "ac-checkbox"
79
- }, W.value), [(f(!0), r(e, null, m(s.options, (e, t) => (f(), r("label", {
82
+ }, U.value), [i("div", w, [(d(!0), r(e, null, p(o.options, (e, t) => (d(), r("label", {
80
83
  key: e.label,
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,
84
+ for: `${h(R)}-${t}`,
85
+ class: u(["group inline-flex w-fit cursor-pointer items-start text-base text-heading select-none", [e.disabled && J.value, V.value ? "gap-2.5" : "gap-3"]])
86
+ }, [i("span", { class: u(["relative inline-flex shrink-0", G.value]) }, [b(i("input", {
87
+ id: `${h(R)}-${t}`,
88
+ "onUpdate:modelValue": s[0] ||= (e) => I.value = e,
90
89
  type: "checkbox",
91
- name: s.name,
90
+ name: o.name,
92
91
  value: e.value,
93
92
  disabled: e.disabled,
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"]),
97
- "stroke-width": 3,
93
+ class: u(K.value)
94
+ }, null, 10, E), [[y, I.value]]), a(h(S), {
95
+ class: u([q.value, "peer-checked:opacity-100"]),
98
96
  "aria-hidden": "true"
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({
97
+ }, null, 8, ["class"])], 2), i("span", D, [i("span", O, m(e.label), 1), e.description ? (d(), r("span", k, m(e.description), 1)) : n("", !0)])], 10, T))), 128))]), o.errorMsg ? (d(), r("p", A, m(o.errorMsg), 1)) : n("", !0)], 16)) : (d(), r("div", c({
103
98
  key: 1,
104
- class: "inline-flex flex-col gap-1.5",
99
+ class: "inline-flex flex-col",
105
100
  "data-ac-ds": "",
106
101
  "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({
102
+ }, U.value, { onClick: s[1] ||= x(() => {}, ["stop"]) }), [i("label", { class: u(["group inline-flex w-fit cursor-pointer items-start text-base text-heading select-none", [o.disabled && J.value, V.value ? "gap-2.5" : "gap-3"]]) }, [i("span", { class: u(["relative inline-flex shrink-0", G.value]) }, [
103
+ i("input", c({
113
104
  ref_key: "single",
114
- ref: V,
105
+ ref: B,
115
106
  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,
107
+ name: o.name,
108
+ checked: L.value,
109
+ indeterminate: H.value,
110
+ disabled: o.disabled,
111
+ "aria-invalid": o.errorMsg ? !0 : void 0,
112
+ "aria-describedby": o.errorMsg ? `${h(R)}-error` : void 0,
122
113
  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,
114
+ }, W.value, { onChange: Y }), null, 16, j),
115
+ a(h(S), {
116
+ class: u([q.value, "peer-checked:opacity-100"]),
127
117
  "aria-hidden": "true"
128
118
  }, null, 8, ["class"]),
129
- o(g(T), {
130
- class: d([q.value, "peer-indeterminate:scale-100 peer-indeterminate:opacity-100"]),
131
- "stroke-width": 3,
119
+ a(h(C), {
120
+ class: u([q.value, "peer-indeterminate:opacity-100"]),
132
121
  "aria-hidden": "true"
133
122
  }, 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", {
123
+ ], 2), o.label || o.description ? (d(), r("span", M, [o.label ? (d(), r("span", N, m(o.label), 1)) : n("", !0), o.description ? (d(), r("span", P, m(o.description), 1)) : n("", !0)])) : n("", !0)], 2), o.errorMsg ? (d(), r("p", {
135
124
  key: 0,
136
- id: `${g(z)}-error`,
137
- class: "flex items-center gap-1.5 text-base text-danger-strong",
125
+ id: `${h(R)}-error`,
126
+ class: "mt-1 text-base text-danger-strong",
138
127
  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));
128
+ }, m(o.errorMsg), 9, F)) : n("", !0)], 16));
143
129
  }
144
130
  });
145
131
  //#endregion
146
- export { L as default };
132
+ export { I as default };
@@ -0,0 +1,5 @@
1
+ import e from "./AcCheckList.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/lib/components/AcCheckList.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,45 @@
1
+ import type { Component } from "vue";
2
+ import type { Tone } from "./types";
3
+ export interface CheckListItem {
4
+ /** The benefit or feature, in sentence case. */
5
+ label: string;
6
+ /** A line of muted text under the label. */
7
+ description?: string;
8
+ }
9
+ export interface Props {
10
+ /** The lines to show. Pass strings, or `{ label, description }` for a line with a muted second line. */
11
+ items?: (string | CheckListItem)[];
12
+ /** A Lucide icon before each line. Defaults to `CircleCheck`, as cloud-ui's landing heroes; pass `Check` for the plain tick of the Create database card. */
13
+ icon?: Component;
14
+ /** Colour of the icon. `muted` is a grey tick for neutral lists. */
15
+ color?: Tone | "muted";
16
+ /** `normal` 14px text with 16px icons and 10px between lines; `small` 12px text with 14px icons and 6px between lines. */
17
+ size?: "small" | "normal";
18
+ /** Lays the lines out in two columns from 640px. Below that they stack in one. */
19
+ columns?: 1 | 2;
20
+ /** Sets the text in the muted grey, as on cloud-ui's landing heroes. Set `false` for the heading colour, as on the Create database card. */
21
+ muted?: boolean;
22
+ }
23
+ type __VLS_Slots = {
24
+ /** Replaces the text of each line; the icon stays. Gets `item` (always an object) and `index`. */
25
+ default?: (props: {
26
+ item: CheckListItem;
27
+ index: number;
28
+ }) => unknown;
29
+ };
30
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
31
+ icon: Component;
32
+ color: Tone | "muted";
33
+ size: "small" | "normal";
34
+ items: (string | CheckListItem)[];
35
+ muted: boolean;
36
+ columns: 1 | 2;
37
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
39
+ declare const _default: typeof __VLS_export;
40
+ export default _default;
41
+ type __VLS_WithSlots<T, S> = T & {
42
+ new (): {
43
+ $slots: S;
44
+ };
45
+ };
@@ -0,0 +1,64 @@
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, renderList as l, renderSlot as u, resolveDynamicComponent as d, toDisplayString as f, unref as p } from "vue";
2
+ import { CircleCheck as m } from "@lucide/vue";
3
+ //#region src/lib/components/AcCheckList.vue?vue&type=script&setup=true&lang.ts
4
+ var h = { class: "min-w-0" }, g = /*@__PURE__*/ o({
5
+ __name: "AcCheckList",
6
+ props: {
7
+ items: { default: () => [] },
8
+ icon: { default: void 0 },
9
+ color: { default: "primary" },
10
+ size: { default: "normal" },
11
+ columns: { default: 1 },
12
+ muted: {
13
+ type: Boolean,
14
+ default: !0
15
+ }
16
+ },
17
+ setup(o) {
18
+ let g = o, _ = {
19
+ primary: "text-primary",
20
+ info: "text-info",
21
+ success: "text-success",
22
+ warning: "text-warning",
23
+ danger: "text-danger",
24
+ muted: "text-muted"
25
+ }, v = {
26
+ normal: {
27
+ list: "gap-y-2.5 text-base",
28
+ icon: "mt-0.5 size-4",
29
+ item: "gap-2.5",
30
+ description: "text-base"
31
+ },
32
+ small: {
33
+ list: "gap-y-1.5 text-xs",
34
+ icon: "mt-[3px] size-3.5",
35
+ item: "gap-2",
36
+ description: "text-xs"
37
+ }
38
+ }, y = t(() => g.items.map((e) => typeof e == "string" ? { label: e } : e)), b = t(() => v[g.size]);
39
+ return (t, g) => (c(), i("ul", {
40
+ role: "list",
41
+ class: s(["m-0 grid list-none p-0 leading-relaxed", [
42
+ b.value.list,
43
+ o.columns === 2 && "gap-x-6 sm:grid-cols-2",
44
+ o.muted ? "text-muted" : "text-heading"
45
+ ]]),
46
+ "data-ac-ds": "",
47
+ "data-testid": "ac-check-list"
48
+ }, [(c(!0), i(e, null, l(y.value, (e, l) => (c(), i("li", {
49
+ key: `${l}-${e.label}`,
50
+ class: s(["flex min-w-0 items-start text-left", b.value.item])
51
+ }, [(c(), n(d(o.icon ?? p(m)), {
52
+ class: s(["shrink-0", [b.value.icon, _[o.color]]]),
53
+ "aria-hidden": "true"
54
+ }, null, 8, ["class"])), a("span", h, [u(t.$slots, "default", {
55
+ item: e,
56
+ index: l
57
+ }, () => [a("span", { class: s(e.description && "font-medium text-heading") }, f(e.label), 3), e.description ? (c(), i("span", {
58
+ key: 0,
59
+ class: s(["block text-muted", b.value.description])
60
+ }, f(e.description), 3)) : r("", !0)])])], 2))), 128))], 2));
61
+ }
62
+ });
63
+ //#endregion
64
+ export { g as default };
@@ -1,13 +1,27 @@
1
- import type { Option } from "./types";
1
+ import type { Component } from "vue";
2
+ import type { Option, Tone } from "./types";
3
+ /** A radio option with an optional icon or logo tile and a pill next to its label. */
4
+ export interface CheckRadioOption<V = unknown> extends Option<V> {
5
+ /** Lucide icon shown in a 32px tile before the label. */
6
+ icon?: Component;
7
+ /** Image URL shown in a 32px tile before the label, e.g. an engine logo. Used when there's no `icon`. */
8
+ logo?: string;
9
+ /** Short pill after the label, e.g. "Recommended" or "Coming soon". */
10
+ badge?: string;
11
+ /** Pill colour. `neutral` is grey, for "Coming soon". Defaults to `primary`. */
12
+ badgeColor?: Tone | "neutral";
13
+ }
2
14
  export interface Props<V> {
3
- /** The radios to render: `{ value, label, description?, disabled? }`. */
4
- options: Option<V>[];
15
+ /** The radios to render: `{ value, label, description?, disabled?, icon?, logo?, badge?, badgeColor? }`. */
16
+ options: CheckRadioOption<V>[];
5
17
  /** Base `name` for the radio group. */
6
18
  name?: string;
7
19
  /** Lays the options out horizontally. */
8
20
  row?: boolean;
9
- /** Shows each option as a card with its description underneath. */
21
+ /** Shows each option as a card with its description underneath. The selected card gets a primary border and a check badge in its corner. */
10
22
  cards?: boolean;
23
+ /** Cards only: shows an 18px radio before each card's label instead of the check badge. Old cloud-ui RadioCard `is-radio-show`. */
24
+ showRadio?: boolean;
11
25
  /** Error text under the group. */
12
26
  errorMsg?: string;
13
27
  }
@@ -21,7 +35,18 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
21
35
  } ? P : {});
22
36
  expose: (exposed: {}) => void;
23
37
  attrs: any;
24
- slots: {};
38
+ slots: {
39
+ /** Replaces an option's icon, label, badge and description. Clicking it still selects the option. */
40
+ option?: (props: {
41
+ option: CheckRadioOption<T>;
42
+ checked: boolean;
43
+ }) => unknown;
44
+ /** Content on the right of an option, e.g. a version select. Clicks and keys inside it don't select the option. Cards with it stack in one column and drop the check badge, so pair it with `show-radio`. */
45
+ "option-extra"?: (props: {
46
+ option: CheckRadioOption<T>;
47
+ checked: boolean;
48
+ }) => unknown;
49
+ };
25
50
  emit: (event: "update:modelValue", value: T | undefined) => void;
26
51
  }>) => import("vue").VNode & {
27
52
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
@@ -1,22 +1,39 @@
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";
1
+ import { Fragment as e, Transition as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, mergeModels as l, normalizeClass as u, openBlock as d, renderList as f, renderSlot as p, resolveDynamicComponent as m, toDisplayString as h, unref as g, useId as _, useModel as v, useSlots as y, vModelRadio as b, withCtx as x, withDirectives as S } from "vue";
2
+ import { Check as C } from "@lucide/vue";
3
3
  //#region src/lib/components/AcCheckRadio.vue?vue&type=script&setup=true&lang.ts
4
- var v = {
4
+ var w = {
5
5
  role: "radiogroup",
6
6
  "data-ac-ds": "",
7
7
  "data-testid": "ac-check-radio"
8
- }, y = ["for"], b = [
8
+ }, T = [
9
9
  "id",
10
10
  "name",
11
11
  "value",
12
12
  "disabled"
13
- ], x = { class: "flex min-w-0 flex-col" }, S = ["title"], C = {
13
+ ], E = {
14
14
  key: 0,
15
- class: "mt-2 flex items-center gap-1.5 text-base text-danger-strong",
15
+ class: "flex size-8 shrink-0 items-center justify-center rounded-10 border border-primary/20 bg-primary/10 text-primary-strong",
16
+ "aria-hidden": "true"
17
+ }, D = ["src"], O = { class: "flex min-w-0 flex-col" }, k = {
18
+ key: 0,
19
+ class: "flex flex-wrap items-center gap-x-2 gap-y-1"
20
+ }, A = {
21
+ key: 2,
22
+ class: "mt-0.5 text-xs leading-relaxed text-muted"
23
+ }, j = {
24
+ key: 0,
25
+ class: "relative shrink-0 cursor-auto"
26
+ }, M = {
27
+ key: 0,
28
+ class: "absolute top-2 right-2 flex size-4 items-center justify-center rounded-full bg-primary text-white shadow-sm",
29
+ "aria-hidden": "true"
30
+ }, N = {
31
+ key: 0,
32
+ class: "mt-1 text-base text-danger-strong",
16
33
  role: "alert"
17
- }, w = /*@__PURE__*/ o({
34
+ }, P = /*@__PURE__*/ c({
18
35
  __name: "AcCheckRadio",
19
- props: /*@__PURE__*/ s({
36
+ props: /*@__PURE__*/ l({
20
37
  options: {},
21
38
  name: { default: "radio" },
22
39
  row: {
@@ -27,42 +44,89 @@ var v = {
27
44
  type: Boolean,
28
45
  default: !1
29
46
  },
47
+ showRadio: {
48
+ type: Boolean,
49
+ default: !1
50
+ },
30
51
  errorMsg: { default: "" }
31
52
  }, {
32
53
  modelValue: {},
33
54
  modelModifiers: {}
34
55
  }),
35
56
  emits: ["update:modelValue"],
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", {
57
+ setup(c) {
58
+ let l = v(c, "modelValue"), P = {
59
+ primary: "bg-primary/10 text-primary-strong",
60
+ info: "bg-info/10 text-info-strong",
61
+ success: "bg-success/10 text-success-strong",
62
+ warning: "bg-warning/10 text-warning-strong",
63
+ danger: "bg-danger/10 text-danger-strong",
64
+ neutral: "bg-surface-sunken text-muted"
65
+ }, F = y(), I = _(), L = n(() => !!F["option-extra"]);
66
+ return (n, _) => (d(), a("div", w, [o("div", { class: u(c.cards ? ["grid gap-3", !L.value && "sm:grid-cols-2"] : c.row ? "flex flex-row flex-wrap gap-x-6 gap-y-3" : "flex flex-col gap-3") }, [(d(!0), a(e, null, f(c.options, (e, f) => (d(), r(m(L.value ? "div" : "label"), {
39
67
  key: e.label,
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"
68
+ for: L.value ? void 0 : `${g(I)}-${f}`,
69
+ class: u(["group flex cursor-pointer gap-3 text-base text-heading select-none", [
70
+ c.cards ? "relative items-start rounded-14 border border-border bg-surface p-3 transition-[border-color,background-color,box-shadow] duration-200 ease-out has-checked:border-primary has-checked:bg-primary/5 has-checked:shadow-[inset_0_0_0_1px_var(--color-primary)] has-focus-visible:ring-2 has-focus-visible:ring-ring has-focus-visible:ring-offset-2 has-focus-visible:ring-offset-background motion-reduce:transition-none" : L.value ? "relative items-center" : "w-fit items-center",
71
+ e.disabled && ["cursor-not-allowed", c.cards ? "opacity-60" : "opacity-50"],
72
+ L.value && "flex-wrap",
73
+ c.cards && !e.disabled && "hover:border-primary/40 hover:bg-accent-hover has-checked:hover:border-primary has-checked:hover:bg-primary/5"
45
74
  ]])
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,
49
- type: "radio",
50
- name: `${o.name}-${f(w)}`,
51
- value: e.value,
52
- disabled: e.disabled,
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", {
58
- key: 0,
59
- class: "mt-0.5 line-clamp-2 text-xs leading-relaxed text-muted",
60
- title: e.description
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)]));
75
+ }, {
76
+ default: x(() => [
77
+ (d(), r(m(L.value ? "label" : "span"), {
78
+ for: L.value ? `${g(I)}-${f}` : void 0,
79
+ class: u(L.value ? [
80
+ "flex min-w-0 flex-1 basis-[240px] gap-3 after:absolute after:inset-0",
81
+ c.cards ? "items-start" : "items-center",
82
+ e.disabled ? "cursor-not-allowed" : "cursor-pointer"
83
+ ] : "contents")
84
+ }, {
85
+ default: x(() => [o("span", { class: u(c.cards && !c.showRadio ? "sr-only" : ["relative inline-flex size-[18px] shrink-0", c.cards && "mt-0.5"]) }, [S(o("input", {
86
+ id: `${g(I)}-${f}`,
87
+ "onUpdate:modelValue": _[0] ||= (e) => l.value = e,
88
+ type: "radio",
89
+ name: `${c.name}-${g(I)}`,
90
+ value: e.value,
91
+ disabled: e.disabled,
92
+ class: u(["peer size-[18px] cursor-pointer appearance-none rounded-full border border-muted/70 bg-background transition-colors duration-200 group-hover:enabled:not-checked:border-primary/60 checked:border-primary checked:bg-primary focus-visible:outline-none disabled:cursor-not-allowed disabled:bg-surface-sunken motion-reduce:transition-none", !c.cards && "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface"])
93
+ }, null, 10, T), [[b, l.value]]), _[1] ||= o("span", {
94
+ class: "pointer-events-none absolute inset-0 m-auto size-1.5 scale-0 rounded-full bg-white transition-transform duration-200 peer-checked:scale-100 motion-reduce:transition-none",
95
+ "aria-hidden": "true"
96
+ }, null, -1)], 2), p(n.$slots, "option", {
97
+ option: e,
98
+ checked: l.value === e.value
99
+ }, () => [e.icon ? (d(), a("span", E, [(d(), r(m(e.icon), { class: "size-5" }))])) : e.logo ? (d(), a("img", {
100
+ key: 1,
101
+ src: e.logo,
102
+ alt: "",
103
+ class: "size-8 shrink-0 rounded-10 border border-border bg-surface object-contain p-1"
104
+ }, null, 8, D)) : i("", !0), o("span", O, [e.badge ? (d(), a("span", k, [o("span", { class: u(c.cards ? "font-semibold" : "font-medium") }, h(e.label), 3), o("span", { class: u(["rounded-full px-2 py-0.5 text-xs font-medium", P[e.badgeColor ?? "primary"]]) }, h(e.badge), 3)])) : (d(), a("span", {
105
+ key: 1,
106
+ class: u(c.cards ? "font-semibold" : "font-medium")
107
+ }, h(e.label), 3)), c.cards && e.description ? (d(), a("span", A, h(e.description), 1)) : i("", !0)])])]),
108
+ _: 2
109
+ }, 1032, ["for", "class"])),
110
+ L.value ? (d(), a("div", j, [p(n.$slots, "option-extra", {
111
+ option: e,
112
+ checked: l.value === e.value
113
+ })])) : i("", !0),
114
+ s(t, {
115
+ "enter-active-class": "transition duration-150 ease-out motion-reduce:transition-none",
116
+ "enter-from-class": "scale-50 opacity-0",
117
+ "leave-active-class": "transition duration-100 ease-in motion-reduce:transition-none",
118
+ "leave-to-class": "scale-50 opacity-0"
119
+ }, {
120
+ default: x(() => [c.cards && !c.showRadio && !L.value && l.value === e.value ? (d(), a("span", M, [s(g(C), {
121
+ class: "size-2.5",
122
+ "stroke-width": 3.5
123
+ })])) : i("", !0)]),
124
+ _: 2
125
+ }, 1024)
126
+ ]),
127
+ _: 2
128
+ }, 1032, ["for", "class"]))), 128))], 2), c.errorMsg ? (d(), a("p", N, h(c.errorMsg), 1)) : i("", !0)]));
65
129
  }
66
130
  });
67
131
  //#endregion
68
- export { w as default };
132
+ export { P as default };
@@ -4,7 +4,7 @@ export interface Props {
4
4
  value?: number;
5
5
  /** The amount that fills the ring. */
6
6
  max?: number;
7
- /** Diameter: `small` 32px, `normal` 48px, `large` 80px, or a number of pixels (cloud-ui's `size`, e.g. 44). */
7
+ /** Diameter: `small` 32px, `normal` 44px (cloud-ui's default), `large` 80px, or a number of pixels. */
8
8
  size?: "small" | "normal" | "large" | number;
9
9
  /** Ring thickness in pixels. Defaults to 3, 4 and 6 for the named sizes, and about a tenth of a numeric size. */
10
10
  strokeWidth?: number;
@@ -12,8 +12,8 @@ export interface Props {
12
12
  showLabel?: boolean;
13
13
  /** Replaces the percentage in the centre and for screen readers, e.g. "3/5". Keep it to 4 characters. */
14
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";
15
+ /** Ring colour. `progress` follows the value as in cloud-ui: danger below 30%, warning to 59%, info to 99%, success at 100%. `auto` is for quotas: primary, then warning from 80% and danger from 95%, as in AcProgress. */
16
+ color?: Tone | "auto" | "progress";
17
17
  /** The accessible name, e.g. "CPU usage" or "Image sync to nyc1". Without it the ring is read as "Progress". */
18
18
  label?: string;
19
19
  /** For work of unknown length: a spinning quarter ring with no value. */
@@ -26,7 +26,7 @@ type __VLS_Slots = {
26
26
  declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
27
27
  label: string;
28
28
  value: number;
29
- color: Tone | "auto";
29
+ color: Tone | "auto" | "progress";
30
30
  max: number;
31
31
  size: "small" | "normal" | "large" | number;
32
32
  strokeWidth: number;
@@ -29,7 +29,7 @@ var d = [
29
29
  default: !0
30
30
  },
31
31
  valueText: { default: "" },
32
- color: { default: "primary" },
32
+ color: { default: "progress" },
33
33
  label: { default: "" },
34
34
  indeterminate: {
35
35
  type: Boolean,
@@ -45,10 +45,10 @@ var d = [
45
45
  text: "text-[9px]"
46
46
  },
47
47
  normal: {
48
- px: 48,
48
+ px: 44,
49
49
  stroke: 4,
50
- box: "size-12",
51
- text: "text-xs"
50
+ box: "size-11",
51
+ text: "text-xm"
52
52
  },
53
53
  large: {
54
54
  px: 80,
@@ -65,7 +65,10 @@ var d = [
65
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
66
  width: `${y.value}px`,
67
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)}%`);
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 === "progress" ? D() : h.color === "auto" ? w.value >= 95 ? "danger" : w.value >= 80 ? "warning" : "primary" : h.color), E = e(() => h.valueText || `${Math.round(w.value)}%`);
69
+ function D() {
70
+ return h.indeterminate ? "primary" : w.value >= 100 ? "success" : w.value >= 60 ? "info" : w.value >= 30 ? "warning" : "danger";
71
+ }
69
72
  return (e, h) => (c(), n("div", {
70
73
  role: "progressbar",
71
74
  "aria-label": a.label || "Progress",
@@ -87,21 +90,21 @@ var d = [
87
90
  cx: y.value / 2,
88
91
  cy: y.value / 2,
89
92
  r: x.value,
90
- class: "stroke-muted/15",
93
+ class: "stroke-border",
91
94
  "stroke-width": b.value
92
95
  }, null, 8, p), r("circle", {
93
96
  cx: y.value / 2,
94
97
  cy: y.value / 2,
95
98
  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,
99
+ class: o(["stroke-current transition-[stroke-dashoffset,color,opacity] duration-[800ms] ease-[cubic-bezier(0.4,0,0.2,1)] motion-reduce:transition-none", !a.indeterminate && w.value === 0 && "opacity-0"]),
100
+ "stroke-width": b.value + .5,
98
101
  "stroke-linecap": "round",
99
102
  pathLength: "100",
100
103
  "stroke-dasharray": "100",
101
104
  "stroke-dashoffset": a.indeterminate ? 75 : 100 - w.value
102
105
  }, null, 10, m)], 10, f)), e.$slots.default || a.showLabel && !a.indeterminate ? (c(), n("span", {
103
106
  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]),
107
+ class: o(["pointer-events-none absolute inset-0 flex items-center justify-center leading-none font-bold tracking-[-0.03em] text-heading tabular-nums select-none", v.value?.text]),
105
108
  style: s(C.value),
106
109
  "aria-hidden": "true"
107
110
  }, [l(e.$slots, "default", {}, () => [i(u(E.value), 1)])], 6)) : t("", !0)], 14, d));