@ac-design/design-system 2.0.0 → 2.1.1

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 +20 -2
  82. package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +84 -26
  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,14 +1,13 @@
1
- import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, mergeModels as s, mergeProps as c, nextTick as l, normalizeClass as u, onMounted as d, openBlock as f, ref as p, toDisplayString as m, unref as h, useAttrs as g, useId as _, useModel as v, vModelText as y, watch as b, withDirectives as x } from "vue";
2
- import { CircleAlert as S } from "@lucide/vue";
1
+ import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, defineComponent as a, mergeModels as o, mergeProps as s, nextTick as c, normalizeClass as l, onMounted as u, openBlock as d, ref as f, toDisplayString as p, unref as m, useAttrs as h, useId as g, useModel as _, vModelText as v, watch as y, withDirectives as b } from "vue";
3
2
  //#region src/lib/components/AcTextarea.vue?vue&type=script&setup=true&lang.ts
4
- var C = ["for"], w = {
3
+ var x = ["for"], S = {
5
4
  key: 0,
6
- class: "font-normal text-muted"
7
- }, T = {
5
+ class: "text-muted"
6
+ }, C = {
8
7
  key: 1,
9
8
  class: "text-danger",
10
9
  "aria-hidden": "true"
11
- }, E = ["id"], D = [
10
+ }, w = ["id"], T = [
12
11
  "id",
13
12
  "name",
14
13
  "rows",
@@ -18,19 +17,19 @@ var C = ["for"], w = {
18
17
  "required",
19
18
  "aria-invalid",
20
19
  "aria-describedby"
21
- ], O = {
20
+ ], E = {
22
21
  key: 1,
23
- class: "mt-1.5 flex items-start gap-3"
24
- }, k = ["id"], A = {
22
+ class: "mt-1 flex items-start gap-3"
23
+ }, D = ["id"], O = {
25
24
  key: 1,
26
25
  class: "flex-1"
27
- }, j = ["id"], M = /*@__PURE__*/ o({
26
+ }, k = ["id"], A = /*@__PURE__*/ a({
28
27
  inheritAttrs: !1,
29
28
  __name: "AcTextarea",
30
- props: /*@__PURE__*/ s({
29
+ props: /*@__PURE__*/ o({
31
30
  label: {},
32
31
  name: { default: "" },
33
- rows: { default: 4 },
32
+ rows: { default: void 0 },
34
33
  autoResize: {
35
34
  type: Boolean,
36
35
  default: !1
@@ -60,86 +59,84 @@ var C = ["for"], w = {
60
59
  modelModifiers: {}
61
60
  }),
62
61
  emits: ["update:modelValue"],
63
- setup(o, { expose: s }) {
64
- let M = o, N = v(o, "modelValue"), P = _(), F = g(), I = e(() => ({
65
- class: F.class,
66
- style: F.style
67
- })), L = e(() => {
68
- let { class: e, style: t, ...n } = F;
62
+ setup(a, { expose: o }) {
63
+ let A = a, j = _(a, "modelValue"), M = g(), N = h(), P = e(() => ({
64
+ class: N.class,
65
+ style: N.style
66
+ })), F = e(() => {
67
+ let { class: e, style: t, ...n } = N;
69
68
  return n;
70
- }), R = p(null), z = p(!1), B = e(() => (N.value ?? "").length), V = e(() => M.maxlength !== void 0 && B.value >= M.maxlength), H = e(() => [
71
- M.hint && `${P}-hint`,
72
- M.errorMsg && `${P}-msg`,
73
- M.maxlength !== void 0 && `${P}-count`
69
+ }), I = f(null), L = f(!1), R = e(() => A.rows ?? 4), z = e(() => (j.value ?? "").length), B = e(() => A.maxlength !== void 0 && z.value >= A.maxlength), V = e(() => [
70
+ A.hint && `${M}-hint`,
71
+ A.errorMsg && `${M}-msg`,
72
+ A.maxlength !== void 0 && `${M}-count`
74
73
  ].filter(Boolean).join(" ") || void 0);
75
- function U() {
76
- let e = R.value;
77
- if (!e || !M.autoResize) return;
78
- let t = getComputedStyle(e), n = parseFloat(t.lineHeight) || 20, r = parseFloat(t.paddingTop) + parseFloat(t.paddingBottom) + parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth), i = M.rows * n + r, a = M.maxRows > 0 ? M.maxRows * n + r : Infinity;
74
+ function H() {
75
+ let e = I.value;
76
+ if (!e || !A.autoResize) return;
77
+ let t = getComputedStyle(e), n = parseFloat(t.lineHeight) || 20, r = parseFloat(t.paddingTop) + parseFloat(t.paddingBottom) + parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth), i = R.value * n + r, a = A.maxRows > 0 ? A.maxRows * n + r : Infinity;
79
78
  e.style.height = "auto";
80
79
  let o = e.scrollHeight + parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth);
81
- e.style.height = `${Math.min(Math.max(o, i), a)}px`, z.value = o > a;
80
+ e.style.height = `${Math.min(Math.max(o, i), a)}px`, L.value = o > a;
82
81
  }
83
- return b(N, () => l(U)), b(() => [
84
- M.autoResize,
85
- M.rows,
86
- M.maxRows
82
+ return y(j, () => c(H)), y(() => [
83
+ A.autoResize,
84
+ A.rows,
85
+ A.maxRows
87
86
  ], () => {
88
- !M.autoResize && R.value && (R.value.style.height = ""), l(U);
89
- }), d(U), s({ focus: () => R.value?.focus() }), (e, s) => (f(), n("div", c(I.value, {
90
- class: ["w-full", o.disabled && "opacity-50"],
87
+ !A.autoResize && I.value && (I.value.style.height = ""), c(H);
88
+ }), u(H), o({ focus: () => I.value?.focus() }), (e, o) => (d(), n("div", s(P.value, {
89
+ class: ["w-full", a.disabled && "opacity-50"],
91
90
  "data-ac-ds": "",
92
91
  "data-testid": "ac-textarea"
93
92
  }), [
94
93
  r("label", {
95
- for: h(P),
94
+ for: m(M),
96
95
  class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
97
96
  }, [
98
- r("span", null, m(o.label), 1),
99
- o.readonly ? (f(), n("span", w, "(read only)")) : t("", !0),
100
- o.required ? (f(), n("span", T, "*")) : t("", !0)
101
- ], 8, C),
102
- o.hint ? (f(), n("p", {
97
+ r("span", null, p(a.label), 1),
98
+ a.readonly ? (d(), n("span", S, "(read only)")) : t("", !0),
99
+ a.required ? (d(), n("span", C, "*")) : t("", !0)
100
+ ], 8, x),
101
+ a.hint ? (d(), n("p", {
103
102
  key: 0,
104
- id: `${h(P)}-hint`,
103
+ id: `${m(M)}-hint`,
105
104
  class: "mb-2 text-base text-muted"
106
- }, m(o.hint), 9, E)) : t("", !0),
107
- x(r("textarea", c({
108
- id: h(P),
105
+ }, p(a.hint), 9, w)) : t("", !0),
106
+ b(r("textarea", s({
107
+ id: m(M),
109
108
  ref_key: "field",
110
- ref: R
111
- }, L.value, {
112
- "onUpdate:modelValue": s[0] ||= (e) => N.value = e,
113
- name: o.name,
114
- rows: o.rows,
115
- maxlength: o.maxlength,
116
- disabled: o.disabled,
117
- readonly: o.readonly,
118
- required: o.required,
119
- "aria-invalid": !!o.errorMsg || void 0,
120
- "aria-describedby": H.value,
121
- class: ["block w-full rounded-10 border px-4 py-2.5 text-base font-normal text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none placeholder:text-muted/80 disabled:cursor-not-allowed", [
122
- o.readonly ? "bg-surface-muted" : "bg-background",
123
- o.mono && "font-mono text-xs leading-5",
124
- o.autoResize ? z.value ? "ac-scrollbar resize-none" : "resize-none overflow-hidden" : "ac-scrollbar resize-y",
125
- o.errorMsg ? "border-danger/60 focus:border-danger focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]" : ["border-border focus:focus-ring", !o.disabled && "hover:border-accent-active"]
109
+ ref: I
110
+ }, F.value, {
111
+ "onUpdate:modelValue": o[0] ||= (e) => j.value = e,
112
+ name: a.name,
113
+ rows: R.value,
114
+ maxlength: a.maxlength,
115
+ disabled: a.disabled,
116
+ readonly: a.readonly,
117
+ required: a.required,
118
+ "aria-invalid": !!a.errorMsg || void 0,
119
+ "aria-describedby": V.value,
120
+ class: ["block w-full rounded-10 border px-5 py-2.5 text-base text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none placeholder:text-muted/80 disabled:cursor-not-allowed", [
121
+ a.readonly ? "bg-surface-muted" : "bg-background",
122
+ a.rows === void 0 && "min-h-40",
123
+ a.mono ? "font-mono text-xs leading-5 font-normal" : "font-medium",
124
+ a.autoResize ? L.value ? "ac-scrollbar resize-none" : "resize-none overflow-hidden" : "ac-scrollbar resize-y",
125
+ a.errorMsg ? "border-danger/50 focus:border-danger focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]" : ["border-border focus:focus-ring", !a.disabled && "hover:border-accent-active"]
126
126
  ]]
127
- }), null, 16, D), [[y, N.value]]),
128
- o.errorMsg || o.maxlength !== void 0 ? (f(), n("div", O, [o.errorMsg ? (f(), n("p", {
127
+ }), null, 16, T), [[v, j.value]]),
128
+ a.errorMsg || a.maxlength !== void 0 ? (d(), n("div", E, [a.errorMsg ? (d(), n("p", {
129
129
  key: 0,
130
- id: `${h(P)}-msg`,
131
- class: "flex min-w-0 flex-1 items-center gap-1.5 text-base text-danger-strong",
130
+ id: `${m(M)}-msg`,
131
+ class: "min-w-0 flex-1 text-base text-danger-strong",
132
132
  role: "alert"
133
- }, [a(h(S), {
134
- class: "size-4 shrink-0",
135
- "aria-hidden": "true"
136
- }), i(" " + m(o.errorMsg), 1)], 8, k)) : (f(), n("span", A)), o.maxlength === void 0 ? t("", !0) : (f(), n("p", {
133
+ }, p(a.errorMsg), 9, D)) : (d(), n("span", O)), a.maxlength === void 0 ? t("", !0) : (d(), n("p", {
137
134
  key: 2,
138
- id: `${h(P)}-count`,
139
- class: u(["shrink-0 text-xs tabular-nums", V.value ? "font-medium text-danger-strong" : "text-muted"])
140
- }, [s[1] ||= r("span", { class: "sr-only" }, "Characters used: ", -1), i(m(B.value) + " / " + m(o.maxlength), 1)], 10, j))])) : t("", !0)
135
+ id: `${m(M)}-count`,
136
+ class: l(["shrink-0 text-xs tabular-nums", B.value ? "font-medium text-danger-strong" : "text-muted"])
137
+ }, [o[1] ||= r("span", { class: "sr-only" }, "Characters used: ", -1), i(p(z.value) + " / " + p(a.maxlength), 1)], 10, k))])) : t("", !0)
141
138
  ], 16));
142
139
  }
143
140
  });
144
141
  //#endregion
145
- export { M as default };
142
+ export { A as default };
@@ -2,15 +2,15 @@ import type { ColorMode } from "../composables/useColorMode";
2
2
  export interface Props {
3
3
  /** Used until the viewer picks a mode. */
4
4
  defaultMode?: ColorMode;
5
- /** `icons` is a compact 3-icon switch; `labels` adds the words, for menus and settings pages. */
6
- display?: "icons" | "labels";
5
+ /** `icons` is a compact 3-icon switch; `labels` adds the words, for menus and settings pages; `toggle` is cloud-ui's sun/moon switch for the navbar (64×32px), light or dark only. */
6
+ display?: "icons" | "labels" | "toggle";
7
7
  }
8
8
  declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
9
  "set:theme": (theme: "light" | "dark") => any;
10
10
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
11
11
  "onSet:theme"?: ((theme: "light" | "dark") => any) | undefined;
12
12
  }>, {
13
- display: "icons" | "labels";
13
+ display: "icons" | "labels" | "toggle";
14
14
  defaultMode: ColorMode;
15
15
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
16
  declare const _default: typeof __VLS_export;
@@ -1,60 +1,92 @@
1
1
  import { useColorMode as e } from "../composables/useColorMode.js";
2
- import { Fragment 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, resolveDynamicComponent as u, toDisplayString as d, unref as f } from "vue";
3
- import { Monitor as p, Moon as m, Sun as h } from "@lucide/vue";
2
+ import { Fragment as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, normalizeClass as c, onBeforeUnmount as l, openBlock as u, ref as d, renderList as f, resolveDynamicComponent as p, toDisplayString as m, unref as h, watch as g } from "vue";
3
+ import { Monitor as _, Moon as v, Sun as y } from "@lucide/vue";
4
4
  //#region src/lib/components/AcThemeMode.vue?vue&type=script&setup=true&lang.ts
5
- var g = {
5
+ var b = ["aria-checked", "title"], x = {
6
+ key: 1,
6
7
  role: "radiogroup",
7
8
  "aria-label": "Theme",
8
9
  class: "inline-flex items-center gap-1 rounded-10 bg-surface-sunken p-1",
9
10
  "data-ac-ds": "",
10
11
  "data-testid": "ac-theme-mode"
11
- }, _ = [
12
+ }, S = [
12
13
  "aria-checked",
13
14
  "aria-label",
14
15
  "title",
15
16
  "onClick"
16
- ], v = { key: 0 }, y = /*@__PURE__*/ o({
17
+ ], C = { key: 0 }, w = /*@__PURE__*/ s({
17
18
  __name: "AcThemeMode",
18
19
  props: {
19
20
  defaultMode: { default: "light" },
20
21
  display: { default: "icons" }
21
22
  },
22
23
  emits: ["set:theme"],
23
- setup(o, { emit: y }) {
24
- let b = o, x = y, S = [
24
+ setup(s, { emit: w }) {
25
+ let T = s, E = w, D = [
25
26
  {
26
27
  value: "light",
27
28
  label: "Light",
28
- icon: h
29
+ icon: y
29
30
  },
30
31
  {
31
32
  value: "dark",
32
33
  label: "Dark",
33
- icon: m
34
+ icon: v
34
35
  },
35
36
  {
36
37
  value: "system",
37
38
  label: "System",
38
- icon: p
39
+ icon: _
39
40
  }
40
- ], { mode: C, isDark: w, setMode: T } = e({ defaultMode: b.defaultMode });
41
- function E(e) {
42
- T(e), x("set:theme", w.value ? "dark" : "light");
41
+ ], { mode: O, isDark: k, setMode: A } = e({ defaultMode: T.defaultMode }), j = d(k.value), M;
42
+ function N(e) {
43
+ A(e), E("set:theme", k.value ? "dark" : "light");
43
44
  }
44
- return (e, p) => (c(), i("div", g, [(c(), i(t, null, l(S, (e) => a("button", {
45
+ function P() {
46
+ j.value = !j.value, clearTimeout(M), M = setTimeout(() => {
47
+ M = void 0, N(j.value ? "dark" : "light");
48
+ }, 200);
49
+ }
50
+ return g(k, (e) => {
51
+ M === void 0 && (j.value = e);
52
+ }), l(() => clearTimeout(M)), (e, l) => s.display === "toggle" ? (u(), i("button", {
53
+ key: 0,
54
+ type: "button",
55
+ role: "switch",
56
+ "aria-checked": j.value,
57
+ "aria-label": "Dark mode",
58
+ title: j.value ? "Switch to light mode" : "Switch to dark mode",
59
+ class: "relative inline-flex h-8 w-16 shrink-0 cursor-pointer items-center justify-center rounded-full border border-border focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none",
60
+ "data-ac-ds": "",
61
+ "data-testid": "ac-theme-mode",
62
+ onClick: P
63
+ }, [
64
+ a("span", {
65
+ class: c(["inline-flex transition-[translate,rotate,opacity] duration-500 ease-[cubic-bezier(0.26,2,0.46,0.71)] motion-reduce:transition-none", j.value ? "translate-x-[10px] rotate-0 opacity-0" : "translate-x-[3px] rotate-[15deg] opacity-100"]),
66
+ "aria-hidden": "true"
67
+ }, [o(h(y), { class: "size-[19px] text-theme-sun" })], 2),
68
+ a("span", {
69
+ class: c(["size-[21px] shrink-0 rounded-full inset-ring-2 transition-[translate,background-color] duration-500 ease-[cubic-bezier(0.26,2,0.46,0.71)] motion-reduce:transition-none", j.value ? "-translate-x-[14px] bg-theme-moon inset-ring-white" : "translate-x-4 bg-theme-sun-soft inset-ring-theme-sun"]),
70
+ "aria-hidden": "true"
71
+ }, null, 2),
72
+ a("span", {
73
+ class: c(["inline-flex transition-[translate,rotate,opacity] duration-500 ease-[cubic-bezier(0.26,2.5,0.46,0.71)] motion-reduce:transition-none", j.value ? "-translate-x-[3px] -rotate-[15deg] opacity-100" : "-translate-x-2 rotate-0 opacity-0"]),
74
+ "aria-hidden": "true"
75
+ }, [o(h(v), { class: "size-[21px] text-heading" })], 2)
76
+ ], 8, b)) : (u(), i("div", x, [(u(), i(t, null, f(D, (e) => a("button", {
45
77
  key: e.value,
46
78
  type: "button",
47
79
  role: "radio",
48
- "aria-checked": f(C) === e.value,
49
- "aria-label": o.display === "icons" ? `${e.label} theme` : void 0,
50
- title: o.display === "icons" ? `${e.label} theme` : void 0,
51
- class: s(["inline-flex h-7 cursor-pointer items-center justify-center gap-1.5 rounded-8 text-base font-medium transition-[background-color,color,box-shadow] duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset focus-visible:outline-none", [o.display === "icons" ? "w-7" : "px-3", f(C) === e.value ? "bg-surface text-heading shadow-sm" : "text-muted hover:text-heading"]]),
52
- onClick: (t) => E(e.value)
53
- }, [(c(), n(u(e.icon), {
80
+ "aria-checked": h(O) === e.value,
81
+ "aria-label": s.display === "icons" ? `${e.label} theme` : void 0,
82
+ title: s.display === "icons" ? `${e.label} theme` : void 0,
83
+ class: c(["inline-flex h-7 cursor-pointer items-center justify-center gap-1.5 rounded-8 text-base font-medium transition-[background-color,color,box-shadow] duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset focus-visible:outline-none", [s.display === "icons" ? "w-7" : "px-3", h(O) === e.value ? "bg-surface text-heading shadow-sm" : "text-muted hover:text-heading"]]),
84
+ onClick: (t) => N(e.value)
85
+ }, [(u(), n(p(e.icon), {
54
86
  class: "size-4",
55
87
  "aria-hidden": "true"
56
- })), o.display === "labels" ? (c(), i("span", v, d(e.label), 1)) : r("", !0)], 10, _)), 64))]));
88
+ })), s.display === "labels" ? (u(), i("span", C, m(e.label), 1)) : r("", !0)], 10, S)), 64))]));
57
89
  }
58
90
  });
59
91
  //#endregion
60
- export { y as default };
92
+ export { w as default };
@@ -23,7 +23,7 @@ export interface Props {
23
23
  errorMsg?: string;
24
24
  /** Help text between the label and the field. */
25
25
  hint?: string;
26
- /** `small` 36px or `normal` 40px tall. */
26
+ /** `small` 36px or `normal` 42px tall, the same as `AcInput`. */
27
27
  size?: "small" | "normal";
28
28
  /** Adds a hidden input with this name so plain form posts include the value. */
29
29
  name?: string;