@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,21 +1,17 @@
1
1
  import e from "./AcSpinner.js";
2
2
  import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, defineComponent as a, normalizeClass as o, openBlock as s, renderSlot as c, resolveDynamicComponent as l, toDisplayString as u, withCtx as d } from "vue";
3
3
  //#region src/lib/components/AcButton.vue?vue&type=script&setup=true&lang.ts
4
- var f = {
5
- key: 1,
6
- class: "-ml-0.5 inline-flex shrink-0 items-center justify-center",
7
- "aria-hidden": "true"
8
- }, p = { key: 2 }, m = {
9
- key: 3,
10
- class: "-mr-0.5 inline-flex shrink-0 items-center justify-center",
11
- "aria-hidden": "true"
12
- }, h = /*@__PURE__*/ a({
4
+ var f = /*@__PURE__*/ a({
13
5
  __name: "AcButton",
14
6
  props: {
15
7
  title: { default: "" },
16
8
  color: { default: "primary" },
17
9
  variant: { default: "solid" },
18
10
  size: { default: "normal" },
11
+ iconOnly: {
12
+ type: Boolean,
13
+ default: !1
14
+ },
19
15
  loading: {
20
16
  type: Boolean,
21
17
  default: !1
@@ -25,76 +21,118 @@ var f = {
25
21
  default: !1
26
22
  },
27
23
  type: { default: "button" },
28
- href: { default: void 0 }
24
+ href: { default: void 0 },
25
+ rounded: {
26
+ type: Boolean,
27
+ default: !1
28
+ }
29
29
  },
30
30
  emits: ["click"],
31
- setup(a, { emit: h }) {
32
- let g = a, _ = h, v = {
31
+ setup(a, { emit: f }) {
32
+ let p = a, m = f, h = {
33
33
  primary: {
34
- solid: "border-transparent bg-primary text-white shadow-button hover:bg-primary-hover hover:shadow-md",
34
+ solid: "border-transparent bg-primary text-white shadow-button hover:bg-primary-hover hover:shadow-sm",
35
35
  light: "border-transparent bg-primary/12 text-primary-strong hover:bg-primary/18",
36
- outlined: "border-primary/40 bg-surface text-primary-strong hover:bg-primary/10"
36
+ outlined: "border-primary/35 bg-background text-primary-strong hover:bg-primary/10"
37
37
  },
38
38
  info: {
39
- solid: "border-transparent bg-info text-white shadow-button hover:bg-info-hover hover:shadow-md",
39
+ solid: "border-transparent bg-info text-white shadow-button hover:bg-info-hover hover:shadow-sm",
40
40
  light: "border-transparent bg-info/12 text-info-strong hover:bg-info/18",
41
- outlined: "border-info/40 bg-surface text-info-strong hover:bg-info/10"
41
+ outlined: "border-info/40 bg-background text-info-strong hover:bg-info/10"
42
42
  },
43
43
  success: {
44
- solid: "border-transparent bg-success text-white shadow-button hover:bg-success-hover hover:shadow-md",
44
+ solid: "border-transparent bg-success text-white shadow-button hover:bg-success-hover hover:shadow-sm",
45
45
  light: "border-transparent bg-success/12 text-success-strong hover:bg-success/18",
46
- outlined: "border-success/40 bg-surface text-success-strong hover:bg-success/10"
46
+ outlined: "border-success/40 bg-background text-success-strong hover:bg-success/10"
47
47
  },
48
48
  warning: {
49
- solid: "border-transparent bg-warning text-on-warning shadow-button hover:bg-warning-hover hover:shadow-md",
49
+ solid: "border-transparent bg-warning text-on-warning shadow-button hover:bg-warning-hover hover:shadow-sm",
50
50
  light: "border-transparent bg-warning/12 text-warning-strong hover:bg-warning/18",
51
- outlined: "border-warning/45 bg-surface text-warning-strong hover:bg-warning/10"
51
+ outlined: "border-warning/45 bg-background text-warning-strong hover:bg-warning/10"
52
52
  },
53
53
  danger: {
54
- solid: "border-transparent bg-danger text-white shadow-button hover:bg-danger-hover hover:shadow-md",
54
+ solid: "border-transparent bg-red-50 text-white shadow-button hover:bg-red-40 hover:shadow-sm",
55
55
  light: "border-transparent bg-danger/12 text-danger-strong hover:bg-danger/18",
56
- outlined: "border-danger/40 bg-surface text-danger-strong hover:bg-danger/10"
56
+ outlined: "border-danger/40 bg-background text-danger-strong hover:bg-danger/10"
57
+ }
58
+ }, g = {
59
+ primary: "text-primary-strong",
60
+ info: "text-info-strong",
61
+ success: "text-success-strong",
62
+ warning: "text-warning-strong",
63
+ danger: "text-danger-strong",
64
+ white: "text-muted hover:text-heading",
65
+ ghost: "text-muted hover:text-heading"
66
+ }, _ = t(() => p.variant === "link"), v = t(() => p.variant === "link" ? g[p.color] : p.color === "white" ? "border-border bg-background text-heading hover:bg-surface-sunken/70" : p.color === "ghost" ? "border-transparent bg-transparent text-heading hover:bg-surface-sunken" : h[p.color][p.variant]), y = {
67
+ xs: {
68
+ base: "h-7 gap-1.5 px-2 text-xs",
69
+ icon: "size-7 text-xs"
70
+ },
71
+ small: {
72
+ base: "h-9 gap-2 px-3 text-base",
73
+ icon: "size-8 text-base"
74
+ },
75
+ normal: {
76
+ base: "h-10.5 gap-2 px-4 text-base",
77
+ icon: "size-9 text-base"
78
+ },
79
+ medium: {
80
+ base: "h-10.5 gap-2 px-5 text-base md:h-11 md:text-lg",
81
+ icon: "size-11 text-lg"
57
82
  }
58
- }, y = {
59
- primary: "focus-visible:ring-ring",
60
- info: "focus-visible:ring-info",
61
- success: "focus-visible:ring-success",
62
- warning: "focus-visible:ring-warning",
63
- danger: "focus-visible:ring-danger",
64
- white: "focus-visible:ring-ring",
65
- ghost: "focus-visible:ring-ring"
66
- }, b = t(() => g.color === "white" ? "border-border bg-surface text-heading hover:bg-surface-sunken/70" : g.color === "ghost" ? "border-transparent bg-transparent text-heading hover:bg-surface-sunken" : v[g.color][g.variant]), x = t(() => ({
67
- small: "h-8 gap-1.5 px-3 text-base [&_svg]:size-4",
68
- normal: "h-10 gap-2 px-4 text-base [&_svg]:size-4",
69
- medium: "h-11 gap-2 px-5 text-lg [&_svg]:size-4"
70
- })[g.size]), S = (e) => {
71
- !g.disabled && !g.loading && _("click", e);
83
+ }, b = {
84
+ xs: "gap-1 text-xs [&_svg]:size-3.5",
85
+ small: "gap-1 text-base [&_svg]:size-4",
86
+ normal: "gap-1 text-base [&_svg]:size-4",
87
+ medium: "gap-1 text-base md:text-lg [&_svg]:size-4"
88
+ }, x = t(() => {
89
+ if (_.value) return [b[p.size], p.rounded ? "rounded-full" : "rounded-4"];
90
+ let e = y[p.size];
91
+ return p.iconOnly ? [`${e.icon} rounded-full`, "[&_svg]:size-4"] : [
92
+ e.base,
93
+ p.rounded ? "rounded-full" : "rounded-10",
94
+ "[&_svg]:size-4"
95
+ ];
96
+ }), S = t(() => _.value ? "group/ac-button underline-offset-4 hover:underline" : "justify-center border active:translate-y-px disabled:shadow-none disabled:active:translate-y-0 motion-reduce:active:translate-y-0"), C = (e) => {
97
+ !p.disabled && !p.loading && m("click", e);
72
98
  };
73
- return (t, h) => (s(), n(l(a.href ? "a" : "button"), {
99
+ return (t, f) => (s(), n(l(a.href ? "a" : "button"), {
74
100
  href: a.href && !a.disabled ? a.href : void 0,
75
101
  type: a.href ? void 0 : a.type,
76
102
  disabled: !a.href && a.disabled || void 0,
77
103
  "aria-disabled": a.href && a.disabled || void 0,
78
104
  "aria-busy": a.loading || void 0,
79
- class: o(["relative inline-flex cursor-pointer items-center justify-center rounded-10 border font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow,transform] duration-200 select-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none active:translate-y-px disabled:cursor-not-allowed disabled:opacity-50 disabled:shadow-none disabled:active:translate-y-0 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:active:translate-y-0", [
80
- b.value,
81
- y[a.color],
105
+ class: o(["relative inline-flex cursor-pointer items-center font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow,transform] duration-200 select-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50", [
106
+ S.value,
107
+ v.value,
108
+ "focus-visible:ring-ring",
82
109
  x.value,
83
110
  a.loading && "pointer-events-none"
84
111
  ]]),
85
112
  "data-ac-ds": "",
86
113
  "data-testid": "ac-button",
87
- onClick: S
114
+ onClick: C
88
115
  }, {
89
116
  default: d(() => [
90
117
  a.loading ? (s(), n(e, {
91
118
  key: 0,
92
- class: "-ml-0.5",
119
+ class: o(!a.iconOnly && !_.value && "-ml-0.5"),
93
120
  label: ""
94
- })) : t.$slots.icon ? (s(), i("span", f, [c(t.$slots, "icon")])) : r("", !0),
95
- a.title ? (s(), i("span", p, u(a.title), 1)) : r("", !0),
96
- c(t.$slots, "default"),
97
- t.$slots["icon-right"] ? (s(), i("span", m, [c(t.$slots, "icon-right")])) : r("", !0)
121
+ }, null, 8, ["class"])) : t.$slots.icon ? (s(), i("span", {
122
+ key: 1,
123
+ class: o([!a.iconOnly && !_.value && "-ml-0.5", "inline-flex shrink-0 items-center justify-center"]),
124
+ "aria-hidden": "true"
125
+ }, [c(t.$slots, "icon")], 2)) : r("", !0),
126
+ a.title ? (s(), i("span", {
127
+ key: 2,
128
+ class: o(a.iconOnly && "sr-only")
129
+ }, u(a.title), 3)) : r("", !0),
130
+ a.iconOnly && a.loading ? r("", !0) : c(t.$slots, "default", {}, void 0, void 0, 3),
131
+ t.$slots["icon-right"] ? (s(), i("span", {
132
+ key: 4,
133
+ class: o(["inline-flex shrink-0 items-center justify-center", _.value ? "transition-transform duration-200 group-hover/ac-button:translate-x-0.5 motion-reduce:transition-none motion-reduce:group-hover/ac-button:translate-x-0" : "-mr-0.5"]),
134
+ "aria-hidden": "true"
135
+ }, [c(t.$slots, "icon-right")], 2)) : r("", !0)
98
136
  ]),
99
137
  _: 3
100
138
  }, 8, [
@@ -108,4 +146,4 @@ var f = {
108
146
  }
109
147
  });
110
148
  //#endregion
111
- export { h as default };
149
+ export { f as default };
@@ -4,26 +4,57 @@ export interface Props {
4
4
  title?: string;
5
5
  /** Small line under the title. */
6
6
  subtitle?: string;
7
- /** A Lucide icon shown in a tinted 32px tile before the title. */
7
+ /** Same as `subtitle`, under cloud-ui's name. The `description` slot replaces it. */
8
+ description?: string;
9
+ /** A Lucide icon shown in a tinted 32px tile before the title (28px with `header-size="small"`). */
8
10
  icon?: Component;
9
- /** Adds 24px padding to the body. Turn off for flush tables; the body then clips to the card's rounded corners. */
11
+ /** Adds 24px padding to the body (20px with `header-size="small"`). Turn off for flush tables; the body then clips to the card's rounded corners. */
10
12
  padded?: boolean;
13
+ /** Padding on cloud-ui's scale, for body, header and footer alike: `none`, `xs` 12px, `sm` 16px, `md` 24px, `lg` 32px. Overrides `padded`. */
14
+ padding?: "none" | "xs" | "sm" | "md" | "lg";
15
+ /** `default` white card, `muted` a sunken 40% fill for secondary panels, `dashed` a transparent card with a dashed edge for placeholders, `danger` a red-tinted card for destructive settings such as a "Danger zone". */
16
+ variant?: "default" | "muted" | "dashed" | "danger";
17
+ /** Tints the header icon tile, the `accent` wash and the watermark: `primary` (green), `blue`, `violet`, `red` or `amber`. */
18
+ color?: "primary" | "blue" | "violet" | "red" | "amber";
19
+ /** `normal` header with a 16px title and a divider; `small` a compact header with a 28px icon tile, a 14px title and no divider, like cloud-ui's section cards. */
20
+ headerSize?: "normal" | "small";
21
+ /** Hover look for a card that acts as a link or button: a pointer, a primary-tinted edge and a light wash. */
22
+ hoverable?: boolean;
23
+ /** Rests the card on a faint shadow that deepens on hover; with `hoverable` the card also lifts 2px. */
24
+ shadow?: boolean;
25
+ /** A primary gradient wash behind the header, plus the `icon` as a large watermark on normal headers. */
26
+ accent?: boolean;
27
+ /** Root element, e.g. `a`, `button` or `router-link` for a card that opens something. Pass `href` or `to` as usual. */
28
+ as?: string;
11
29
  }
12
30
  type __VLS_Slots = {
13
- /** Card body. */
31
+ /** Card body. Leave it empty for a header-only card; the header then closes the card without a divider. */
14
32
  default?: () => unknown;
15
33
  /** Buttons on the right of the header. */
16
34
  actions?: () => unknown;
35
+ /** Replaces the `icon` tile's content, e.g. a logo image. */
36
+ icon?: () => unknown;
37
+ /** Replaces the line under the title, e.g. text with a link. */
38
+ description?: () => unknown;
17
39
  /** Badges or tags after the title. */
18
40
  badges?: () => unknown;
19
41
  /** A footer row under the body, e.g. a timestamp or a link. */
20
42
  footer?: () => unknown;
21
43
  };
22
44
  declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
45
+ variant: "default" | "muted" | "dashed" | "danger";
23
46
  title: string;
47
+ description: string;
24
48
  icon: Component;
49
+ color: "primary" | "blue" | "violet" | "red" | "amber";
25
50
  subtitle: string;
26
51
  padded: boolean;
52
+ padding: "none" | "xs" | "sm" | "md" | "lg";
53
+ headerSize: "normal" | "small";
54
+ hoverable: boolean;
55
+ shadow: boolean;
56
+ accent: boolean;
57
+ as: string;
27
58
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
59
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
60
  declare const _default: typeof __VLS_export;
@@ -1,54 +1,189 @@
1
- import { createBlock as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeClass as a, openBlock as o, renderSlot as s, resolveDynamicComponent as c, toDisplayString as l, useSlots as u } from "vue";
1
+ import { Comment as e, Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, normalizeClass as c, openBlock as l, renderSlot as u, resolveDynamicComponent as d, toDisplayString as f, useSlots as p, withCtx as m } from "vue";
2
2
  //#region src/lib/components/AcCard.vue?vue&type=script&setup=true&lang.ts
3
- var d = {
4
- class: "rounded-14 border border-border bg-surface text-body",
5
- "data-ac-ds": "",
6
- "data-testid": "ac-card"
7
- }, f = {
3
+ var h = {
8
4
  key: 0,
9
- class: "flex flex-wrap items-start justify-between gap-3 border-b border-border px-6 pt-5 pb-3"
10
- }, p = { class: "flex min-w-0 flex-1 items-center gap-3" }, m = {
11
- key: 0,
12
- class: "flex size-8 shrink-0 items-center justify-center rounded-10 border border-primary/25 bg-primary/10 text-primary-strong",
5
+ class: "pointer-events-none absolute inset-0 -z-10 overflow-hidden rounded-[inherit]",
13
6
  "aria-hidden": "true"
14
- }, h = { class: "min-w-0 flex-1" }, g = { class: "flex flex-wrap items-center gap-2" }, _ = {
15
- key: 0,
16
- class: "truncate font-heading text-lg leading-tight font-semibold tracking-tight text-heading"
17
- }, v = {
7
+ }, g = { class: "flex min-w-0 flex-1 items-center gap-3" }, _ = { class: "min-w-0 flex-1" }, v = { class: "flex flex-wrap items-center gap-2" }, y = {
18
8
  key: 0,
19
- class: "mt-0.5 text-xs text-muted"
20
- }, y = {
21
- key: 0,
22
- class: "flex shrink-0 flex-wrap items-center gap-2"
9
+ class: "mt-0.5 text-xs leading-4 text-muted"
23
10
  }, b = {
24
11
  key: 1,
25
- class: "flex flex-wrap items-center gap-3 border-t border-border px-6 py-3 text-base text-muted"
26
- }, x = /*@__PURE__*/ i({
12
+ class: "mt-0.5 text-xs leading-4 text-muted"
13
+ }, x = {
14
+ key: 1,
15
+ class: "flex shrink-0 flex-wrap items-center gap-2"
16
+ }, S = /*@__PURE__*/ s({
27
17
  __name: "AcCard",
28
18
  props: {
29
19
  title: { default: "" },
30
20
  subtitle: { default: "" },
21
+ description: { default: "" },
31
22
  icon: { default: void 0 },
32
23
  padded: {
33
24
  type: Boolean,
34
25
  default: !0
35
- }
26
+ },
27
+ padding: { default: void 0 },
28
+ variant: { default: "default" },
29
+ color: { default: "primary" },
30
+ headerSize: { default: "normal" },
31
+ hoverable: {
32
+ type: Boolean,
33
+ default: !1
34
+ },
35
+ shadow: {
36
+ type: Boolean,
37
+ default: !1
38
+ },
39
+ accent: {
40
+ type: Boolean,
41
+ default: !1
42
+ },
43
+ as: { default: "section" }
36
44
  },
37
- setup(i) {
38
- let x = i, S = u();
39
- function C() {
40
- return !!(x.title || x.icon || S.actions || S.badges);
45
+ setup(s) {
46
+ let S = s, C = p(), w = {
47
+ default: "border-border bg-surface",
48
+ muted: "border-border bg-surface-sunken/40",
49
+ dashed: "border-dashed border-border bg-transparent",
50
+ danger: "border-danger/30 bg-danger/5"
51
+ }, T = {
52
+ none: "",
53
+ xs: "p-3",
54
+ sm: "p-4",
55
+ md: "p-6",
56
+ lg: "p-8"
57
+ }, E = {
58
+ none: "px-4",
59
+ xs: "px-3",
60
+ sm: "px-4",
61
+ md: "px-6",
62
+ lg: "px-8"
63
+ }, D = {
64
+ none: "pt-4",
65
+ xs: "pt-3",
66
+ sm: "pt-4",
67
+ md: "pt-5",
68
+ lg: "pt-6"
69
+ }, O = {
70
+ none: "pb-4",
71
+ xs: "pb-3",
72
+ sm: "pb-4",
73
+ md: "pb-5",
74
+ lg: "pb-6"
75
+ }, k = {
76
+ primary: {
77
+ tile: "bg-primary/10 text-primary",
78
+ border: "border-primary/25",
79
+ ring: "ring-primary/20",
80
+ wash: "from-primary/10 via-primary/3",
81
+ washSm: "from-primary/[0.07]",
82
+ watermark: "text-primary/5"
83
+ },
84
+ blue: {
85
+ tile: "bg-info/10 text-info",
86
+ border: "border-info/25",
87
+ ring: "ring-info/20",
88
+ wash: "from-info/10 via-info/3",
89
+ washSm: "from-info/[0.07]",
90
+ watermark: "text-info/5"
91
+ },
92
+ violet: {
93
+ tile: "bg-pending/10 text-pending",
94
+ border: "border-pending/25",
95
+ ring: "ring-pending/20",
96
+ wash: "from-pending/10 via-pending/3",
97
+ washSm: "from-pending/[0.07]",
98
+ watermark: "text-pending/5"
99
+ },
100
+ red: {
101
+ tile: "bg-danger/10 text-danger",
102
+ border: "border-danger/25",
103
+ ring: "ring-danger/20",
104
+ wash: "from-danger/10 via-danger/3",
105
+ washSm: "from-danger/[0.07]",
106
+ watermark: "text-danger/5"
107
+ },
108
+ amber: {
109
+ tile: "bg-warning/10 text-warning",
110
+ border: "border-warning/25",
111
+ ring: "ring-warning/20",
112
+ wash: "from-warning/10 via-warning/3",
113
+ washSm: "from-warning/[0.07]",
114
+ watermark: "text-warning/5"
115
+ }
116
+ }, A = n(() => S.headerSize === "small"), j = n(() => k[S.color]), M = n(() => S.description || S.subtitle), N = n(() => [
117
+ w[S.variant],
118
+ S.as !== "section" && "w-full text-left no-underline outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
119
+ S.hoverable && "cursor-pointer hover:border-primary/30 hover:bg-accent-hover/60",
120
+ S.shadow && "shadow-xs hover:shadow-card",
121
+ S.hoverable && S.shadow && "hover:-translate-y-0.5 motion-reduce:hover:translate-y-0"
122
+ ]);
123
+ function P() {
124
+ return !!(S.title || S.icon || C.icon || C.actions || C.badges);
125
+ }
126
+ function F(n) {
127
+ return n.some((n) => n.type === e ? !1 : n.type !== t || F(n.children));
41
128
  }
42
- return (u, x) => (o(), n("section", d, [
43
- C() ? (o(), n("header", f, [r("div", p, [i.icon ? (o(), n("span", m, [(o(), e(c(i.icon), { class: "size-4" }))])) : t("", !0), r("div", h, [r("div", g, [i.title ? (o(), n("h3", _, l(i.title), 1)) : t("", !0), s(u.$slots, "badges")]), i.subtitle ? (o(), n("p", v, l(i.subtitle), 1)) : t("", !0)])]), u.$slots.actions ? (o(), n("div", y, [s(u.$slots, "actions")])) : t("", !0)])) : t("", !0),
44
- r("div", { class: a(i.padded ? "p-6" : [
129
+ function I() {
130
+ return F(C.default?.() ?? []);
131
+ }
132
+ function L() {
133
+ let e = I(), t = S.padding;
134
+ return [
135
+ t ? [
136
+ "items-start gap-3",
137
+ E[t],
138
+ D[t],
139
+ !A.value && "border-border/60"
140
+ ] : A.value ? "items-start gap-3 px-5 pt-5" : "items-start gap-3 border-border/60 px-6 pt-5",
141
+ !e && (t ? O[t] : "pb-5"),
142
+ e && !A.value && "border-b pb-3",
143
+ !e && !C.footer && "rounded-b-[calc(var(--radius-14)-1px)]",
144
+ S.accent && (A.value ? ["bg-linear-to-r to-transparent", j.value.washSm] : ["bg-linear-to-br to-transparent", j.value.wash])
145
+ ];
146
+ }
147
+ function R() {
148
+ return S.padding && S.padding !== "none" ? T[S.padding] : S.padded && S.padding !== "none" ? A.value ? "p-5" : "p-6" : [
45
149
  "overflow-hidden",
46
- !u.$slots.footer && "rounded-b-14",
47
- !C() && "rounded-t-14"
48
- ]) }, [s(u.$slots, "default")], 2),
49
- u.$slots.footer ? (o(), n("footer", b, [s(u.$slots, "footer")])) : t("", !0)
50
- ]));
150
+ !C.footer && "rounded-b-14",
151
+ !P() && "rounded-t-14"
152
+ ];
153
+ }
154
+ return (e, t) => (l(), r(d(s.as), {
155
+ class: c(["flex flex-col rounded-14 border text-body transition-[background-color,border-color,box-shadow,translate] duration-200 ease-out motion-reduce:transition-none", N.value]),
156
+ "data-ac-ds": "",
157
+ "data-testid": "ac-card"
158
+ }, {
159
+ default: m(() => [
160
+ P() ? (l(), a("header", {
161
+ key: 0,
162
+ class: c(["relative isolate flex flex-wrap justify-between rounded-t-[calc(var(--radius-14)-1px)]", L()])
163
+ }, [
164
+ s.accent && s.icon && !A.value ? (l(), a("div", h, [(l(), r(d(s.icon), { class: c(["absolute -top-4 -right-4 size-24", j.value.watermark]) }, null, 8, ["class"]))])) : i("", !0),
165
+ o("div", g, [s.icon || e.$slots.icon ? (l(), a("span", {
166
+ key: 0,
167
+ class: c(["flex shrink-0 items-center justify-center", [j.value.tile, A.value ? ["size-7 rounded-8 ring-1 ring-inset", j.value.ring] : ["size-8 rounded-10 border", j.value.border]]]),
168
+ "aria-hidden": "true"
169
+ }, [u(e.$slots, "icon", {}, () => [(l(), r(d(s.icon), { class: c(A.value ? "size-3.5" : "size-4") }, null, 8, ["class"]))])], 2)) : i("", !0), o("div", _, [o("div", v, [s.title ? (l(), a("h3", {
170
+ key: 0,
171
+ class: c(["truncate font-heading font-semibold tracking-tight text-heading", A.value ? "text-base" : "text-lg leading-tight"])
172
+ }, f(s.title), 3)) : i("", !0), u(e.$slots, "badges")]), e.$slots.description ? (l(), a("div", y, [u(e.$slots, "description")])) : M.value ? (l(), a("p", b, f(M.value), 1)) : i("", !0)])]),
173
+ e.$slots.actions ? (l(), a("div", x, [u(e.$slots, "actions")])) : i("", !0)
174
+ ], 2)) : i("", !0),
175
+ I() ? (l(), a("div", {
176
+ key: 1,
177
+ class: c(["flex-1", R()])
178
+ }, [u(e.$slots, "default")], 2)) : i("", !0),
179
+ e.$slots.footer ? (l(), a("footer", {
180
+ key: 2,
181
+ class: c(["flex flex-wrap items-center gap-3 border-t border-border py-3 text-base text-muted", s.padding ? E[s.padding] : A.value ? "px-5" : "px-6"])
182
+ }, [u(e.$slots, "footer")], 2)) : i("", !0)
183
+ ]),
184
+ _: 3
185
+ }, 8, ["class"]));
51
186
  }
52
187
  });
53
188
  //#endregion
54
- export { x as default };
189
+ export { S as default };
@@ -109,7 +109,7 @@ export interface Props {
109
109
  unit?: string;
110
110
  /** Shows dates as “3d ago” with the exact time on hover. Turn off to show the exact time. */
111
111
  relative?: boolean;
112
- /** Shown for null, empty text, empty lists and maps, and the server's `<none>` / `<unknown>`. */
112
+ /** Shown for null, empty text, empty lists and maps, and the server's `<none>` / `<unknown>`. With the default dash, a label column says "No labels" instead, like cloud-ui's "No tags". */
113
113
  emptyText?: string;
114
114
  /** Shows a placeholder bar while the value loads. */
115
115
  loading?: boolean;
@@ -129,14 +129,14 @@ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {},
129
129
  loading: boolean;
130
130
  align: "left" | "center" | "right";
131
131
  maxItems: number;
132
+ plain: boolean;
133
+ maxWidth: string;
132
134
  tooltip: string;
133
135
  column: ResourceColumn;
134
136
  emptyText: string;
135
137
  cell: ResourceCell;
136
138
  resolveLink: (link: string) => string;
137
139
  mono: boolean;
138
- maxWidth: string;
139
140
  unit: string;
140
141
  relative: boolean;
141
- plain: boolean;
142
142
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;