ads-nuxt 0.4.0 → 0.4.2

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 (80) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +574 -575
  3. package/app/app.config.ts +25 -25
  4. package/app/assets/ads/checkbox-check.svg +5 -5
  5. package/app/assets/ads/checkbox-minus.svg +5 -5
  6. package/app/assets/brand/farmarcas.svg +6 -6
  7. package/app/assets/brand/radar-symbol.svg +9 -9
  8. package/app/assets/brand/radar.svg +9 -9
  9. package/app/assets/css/ads-colors.css +257 -257
  10. package/app/assets/css/component-tokens.css +6 -2
  11. package/app/assets/css/main.css +585 -585
  12. package/app/components/AdsBadge.vue +47 -47
  13. package/app/components/AdsBroadcast.vue +24 -24
  14. package/app/components/AdsButton.vue +547 -547
  15. package/app/components/AdsButtonGroup.vue +39 -39
  16. package/app/components/AdsButtonMenu.vue +48 -48
  17. package/app/components/AdsCard.vue +188 -188
  18. package/app/components/AdsCardHint.vue +56 -22
  19. package/app/components/AdsCardPeriod.vue +43 -43
  20. package/app/components/AdsCardVariation.vue +31 -31
  21. package/app/components/AdsCharttip.vue +79 -79
  22. package/app/components/AdsDatePicker.vue +509 -509
  23. package/app/components/AdsDropdownMenu.vue +30 -30
  24. package/app/components/AdsEmptyState.vue +61 -61
  25. package/app/components/AdsFeatureCard.vue +292 -210
  26. package/app/components/AdsFileCard.vue +98 -98
  27. package/app/components/AdsFooter.vue +25 -25
  28. package/app/components/AdsHeavyAccountCell.vue +59 -59
  29. package/app/components/AdsHeavyHeaderCell.vue +70 -70
  30. package/app/components/AdsHeavyTable.vue +135 -139
  31. package/app/components/AdsInput.vue +148 -148
  32. package/app/components/AdsLoading.vue +217 -217
  33. package/app/components/AdsMenuBar.vue +110 -110
  34. package/app/components/AdsMetricCard.vue +226 -216
  35. package/app/components/AdsModal.vue +160 -160
  36. package/app/components/AdsMonthPicker.vue +80 -80
  37. package/app/components/AdsNavbarApp.vue +67 -67
  38. package/app/components/AdsNavbarDesk.vue +67 -67
  39. package/app/components/AdsNotabilityPill.vue +24 -24
  40. package/app/components/AdsNumberInput.vue +173 -173
  41. package/app/components/AdsPanelCard.vue +99 -99
  42. package/app/components/AdsPill.vue +144 -144
  43. package/app/components/AdsProductTag.vue +80 -80
  44. package/app/components/AdsSearchInput.vue +122 -122
  45. package/app/components/AdsSegmentedTabs.vue +62 -62
  46. package/app/components/AdsSelect.vue +283 -283
  47. package/app/components/AdsSelectItem.vue +128 -128
  48. package/app/components/AdsSelectPanel.vue +221 -221
  49. package/app/components/AdsSideMenu.vue +101 -101
  50. package/app/components/AdsSmalltip.vue +44 -44
  51. package/app/components/AdsStepper.vue +222 -222
  52. package/app/components/AdsTable.vue +172 -176
  53. package/app/components/AdsTableHeaderCell.vue +80 -80
  54. package/app/components/AdsTableSkeleton.vue +113 -113
  55. package/app/components/AdsTableToolbar.vue +44 -44
  56. package/app/components/AdsTabs.vue +51 -51
  57. package/app/components/AdsTextarea.vue +116 -116
  58. package/app/components/AdsToast.vue +184 -184
  59. package/app/components/AdsTooltip.vue +73 -73
  60. package/app/components/OverlayLoading.vue +2 -17
  61. package/app/components/ProgressBarLoading.vue +235 -235
  62. package/app/composables/useOverlayLoading.ts +88 -88
  63. package/app/constants/ads-color-swatches.ts +240 -240
  64. package/app/locale/pt-br.ts +6 -6
  65. package/app/plugins/ads-toast.client.ts +24 -24
  66. package/app/theme/ads-theme.ts +374 -374
  67. package/app/theme/ads-tokens.ts +391 -391
  68. package/app/theme/component-tokens.json +6 -2
  69. package/app/theme/component-tokens.ts +6 -2
  70. package/app/types/overlay-loading.types.ts +32 -35
  71. package/app/utils/ads-filter-select.ts +191 -191
  72. package/app/utils/ads-table.ts +416 -398
  73. package/app/utils/calendar-date.ts +163 -163
  74. package/app/utils/category-role.ts +45 -45
  75. package/app/utils/money.ts +77 -77
  76. package/app/utils/notability.ts +8 -8
  77. package/app/utils/parser.ts +134 -134
  78. package/app/utils/percentage.ts +54 -54
  79. package/nuxt.config.ts +31 -31
  80. package/package.json +57 -56
@@ -1,210 +1,292 @@
1
- <!--
2
- AdsFeatureCard — atalho de módulo sobre o AdsCard. A casca (borda, raio, fundo, hover, foco)
3
- é a do AdsCard; aqui só muda o conteúdo: ícone, título, descrição, seta e rodapé.
4
- -->
5
- <template>
6
- <AdsCard
7
- :as="to ? NuxtLink : 'button'"
8
- v-bind="rootAttrs"
9
- :disabled="disabled"
10
- :hoverable="hoverable"
11
- class="group w-[var(--ads-feature-width)] max-w-full"
12
- :style="cardStyle"
13
- @click="onClick"
14
- >
15
- <span class="flex h-full w-full flex-col gap-[var(--ads-feature-gap)]">
16
- <span class="flex items-start gap-3">
17
- <span
18
- class="grid size-[var(--ads-feature-icon-box)] shrink-0 place-items-center rounded-[var(--ads-radius-sm)]"
19
- :class="iconBoxClass"
20
- >
21
- <UIcon :name="icon" class="size-6" />
22
- </span>
23
- <span class="min-w-0 flex-1">
24
- <span class="block text-[length:var(--ads-feature-title-size)] font-bold leading-[1.3]" :class="titleClass">
25
- {{ title }}
26
- </span>
27
- <AdsTooltip
28
- :description="description"
29
- :show-title="false"
30
- :disabled="!isDescriptionTruncated"
31
- align="start"
32
- >
33
- <span
34
- ref="descriptionEl"
35
- class="mt-1 block line-clamp-2 text-[length:var(--ads-feature-body-size)] leading-relaxed"
36
- :class="descriptionClass"
37
- >
38
- {{ description }}
39
- </span>
40
- </AdsTooltip>
41
- </span>
42
- <UIcon
43
- v-if="!disabled"
44
- name="i-lucide-arrow-right"
45
- class="size-5 shrink-0 text-[var(--ads-border-icon-support)] transition-colors duration-150 ease-out"
46
- :class="{ 'group-hover:text-[var(--ads-text-secondary)] group-focus-visible:text-[var(--ads-text-secondary)]': hoverable }"
47
- />
48
- </span>
49
-
50
- <AdsPill
51
- v-if="disabled"
52
- class="mt-auto self-start"
53
- tone="secondary"
54
- status="blocked"
55
- label="Em breve"
56
- />
57
- <span v-else-if="hasFooter" class="mt-auto flex flex-wrap items-center gap-2">
58
- <AdsPill
59
- v-for="badge in badges"
60
- :key="badge.label"
61
- :tone="badge.tone ?? 'secondary'"
62
- :status="badge.status ?? 'default'"
63
- :label="badge.label"
64
- />
65
- <span
66
- v-if="footerText"
67
- class="inline-flex items-center gap-1 text-xs text-[var(--ads-text-secondary)]"
68
- >
69
- <UIcon v-if="footerIcon" :name="footerIcon" class="size-3.5" />
70
- {{ footerText }}
71
- </span>
72
- </span>
73
- </span>
74
- </AdsCard>
75
- </template>
76
-
77
- <script setup lang="ts">
78
- import { computed, nextTick, onMounted, ref, watch } from "vue";
79
- import type { RouteLocationRaw } from "vue-router";
80
- import { useResizeObserver } from "@vueuse/core";
81
- import { NuxtLink } from "#components";
82
- import AdsCard from "./AdsCard.vue";
83
- import AdsPill from "./AdsPill.vue";
84
- import type { AdsPillStatus, AdsPillTone } from "./AdsPill.vue";
85
- import AdsTooltip from "./AdsTooltip.vue";
86
-
87
- export interface AdsFeatureCardBadge {
88
- label: string;
89
- tone?: AdsPillTone;
90
- status?: AdsPillStatus;
91
- }
92
-
93
- /** Fundo e texto do AdsPill secondary. Primary segue o ícone do próprio card no catálogo. */
94
- export type AdsFeatureCardColor =
95
- | "primary"
96
- | "success"
97
- | "attention"
98
- | "warning"
99
- | "new"
100
- | "blocked"
101
- | "ai";
102
-
103
- const iconBoxByColor: Record<AdsFeatureCardColor, string> = {
104
- primary: "bg-[var(--ads-button-secondary)] text-[var(--ads-text-brand)]",
105
- success: "bg-[var(--ads-status-success-100)] text-[var(--ads-status-success-800)]",
106
- attention: "bg-[var(--ads-status-attention-100)] text-[var(--ads-status-attention-800)]",
107
- warning: "bg-[var(--ads-status-warning-100)] text-[var(--ads-status-warning-800)]",
108
- new: "bg-[var(--ads-status-new-100)] text-[var(--ads-status-new-800)]",
109
- blocked: "bg-[var(--ads-status-void-100)] text-[var(--ads-status-void-800)]",
110
- ai: "bg-[var(--ads-surface-ai)] text-[var(--ads-text-ai)]",
111
- };
112
-
113
-
114
- const props = withDefaults(
115
- defineProps<{
116
- title: string;
117
- description: string;
118
- icon: string;
119
- /** Cor da caixa do ícone. O hover é o padrão dos cards, igual para todas as cores. */
120
- color?: AdsFeatureCardColor;
121
- /** Vira link. Sem valor, continua botão. */
122
- to?: RouteLocationRaw;
123
- disabled?: boolean;
124
- /** Hover padrão dos cards (borda e sombra neutras; a seta escurece). false desliga. */
125
- hoverable?: boolean;
126
- badges?: AdsFeatureCardBadge[];
127
- footerIcon?: string;
128
- footerText?: string;
129
- }>(),
130
- {
131
- color: "primary",
132
- to: undefined,
133
- disabled: false,
134
- hoverable: true,
135
- badges: undefined,
136
- footerIcon: undefined,
137
- footerText: undefined,
138
- },
139
- );
140
-
141
- const emit = defineEmits<{
142
- click: [event: MouseEvent];
143
- }>();
144
-
145
- const hasFooter = computed(
146
- () => (props.badges?.length ?? 0) > 0 || Boolean(props.footerText),
147
- );
148
-
149
- const descriptionEl = ref<HTMLElement | null>(null);
150
- const isDescriptionTruncated = ref(false);
151
-
152
- const syncDescriptionTruncation = () => {
153
- const element = descriptionEl.value;
154
- if (!element) {
155
- isDescriptionTruncated.value = false;
156
- return;
157
- }
158
- isDescriptionTruncated.value = element.scrollHeight - element.clientHeight > 1;
159
- };
160
-
161
- useResizeObserver(descriptionEl, syncDescriptionTruncation);
162
-
163
- onMounted(() => {
164
- void nextTick(syncDescriptionTruncation);
165
- });
166
-
167
- watch(
168
- () => props.description,
169
- () => {
170
- void nextTick(syncDescriptionTruncation);
171
- },
172
- );
173
-
174
- /** O link não tem disabled nativo: sai da ordem do Tab e avisa por aria-disabled. */
175
- const rootAttrs = computed(() =>
176
- props.to
177
- ? { to: props.to, tabindex: props.disabled ? -1 : undefined, "aria-disabled": props.disabled || undefined }
178
- : {},
179
- );
180
-
181
- /**
182
- * A casca e o hover são os do AdsCard. Aqui só entra o desabilitado sem opacidade,
183
- * porque o conteúdo já troca para as cores terciárias.
184
- */
185
- const cardStyle = computed(() => ({
186
- "--ads-card-disabled-opacity": "1",
187
- }));
188
-
189
- const iconBoxClass = computed(() =>
190
- props.disabled
191
- ? "bg-[var(--ads-button-secondary-disabled)] text-[var(--ads-text-tertiary)]"
192
- : iconBoxByColor[props.color],
193
- );
194
-
195
- const titleClass = computed(() =>
196
- props.disabled ? "text-[var(--ads-text-tertiary)]" : "text-[var(--ads-feature-title)]",
197
- );
198
-
199
- const descriptionClass = computed(() =>
200
- props.disabled ? "text-[var(--ads-text-tertiary)]" : "text-[var(--ads-feature-body)]",
201
- );
202
-
203
- const onClick = (event: MouseEvent) => {
204
- if (!props.disabled) {
205
- emit("click", event);
206
- return;
207
- }
208
- event.preventDefault();
209
- };
210
- </script>
1
+ <!--
2
+ AdsFeatureCard — atalho de módulo sobre o AdsCard. A casca (borda, raio, fundo, foco)
3
+ é a do AdsCard. O hover é próprio: título e seta vão para a cor da variação e o fundo
4
+ da pílula escurece. O conteúdo é pílula, título, descrição, seta e ações.
5
+ -->
6
+ <template>
7
+ <AdsCard
8
+ :as="shellIsButton ? (to ? NuxtLink : 'button') : 'div'"
9
+ v-bind="shellIsButton ? interactiveAttrs : {}"
10
+ :disabled="shellIsButton ? disabled : undefined"
11
+ :hoverable="false"
12
+ class="group w-[var(--ads-feature-width)] max-w-full"
13
+ :style="cardStyle"
14
+ @click="onShellClick"
15
+ >
16
+ <span class="flex h-full w-full flex-col gap-[var(--ads-feature-gap)]">
17
+ <component
18
+ :is="mainTag"
19
+ v-bind="hasActions ? interactiveAttrs : {}"
20
+ :type="mainTag === 'button' ? 'button' : undefined"
21
+ :disabled="mainTag === 'button' ? disabled : undefined"
22
+ class="flex w-full min-w-0 items-start gap-3 text-left"
23
+ :class="hasActions ? mainControlClass : undefined"
24
+ @click="onMainClick"
25
+ >
26
+ <span
27
+ class="grid size-[var(--ads-feature-icon-box)] shrink-0 place-items-center rounded-[var(--ads-radius-sm)]"
28
+ :class="iconBoxClass"
29
+ >
30
+ <UIcon :name="icon" class="size-5" />
31
+ </span>
32
+ <span class="min-w-0 flex-1">
33
+ <span class="block text-[length:var(--ads-feature-title-size)] font-bold leading-[1.3]" :class="titleClass">
34
+ {{ title }}
35
+ </span>
36
+ <AdsTooltip
37
+ :description="description"
38
+ :show-title="false"
39
+ :disabled="!isDescriptionTruncated"
40
+ align="start"
41
+ >
42
+ <span
43
+ ref="descriptionEl"
44
+ class="mt-1 block line-clamp-2 text-[length:var(--ads-feature-body-size)] leading-relaxed"
45
+ :class="descriptionClass"
46
+ >
47
+ {{ description }}
48
+ </span>
49
+ </AdsTooltip>
50
+ </span>
51
+ <UIcon
52
+ v-if="!disabled"
53
+ name="i-lucide-arrow-right"
54
+ class="size-5 shrink-0 text-[var(--ads-border-icon-support)] transition-colors duration-150 ease-out"
55
+ :class="accentHoverClass"
56
+ />
57
+ </component>
58
+
59
+ <AdsPill
60
+ v-if="disabled"
61
+ class="mt-auto self-start"
62
+ tone="secondary"
63
+ status="blocked"
64
+ label="Em breve"
65
+ />
66
+ <span v-else-if="hasActions" class="mt-auto flex flex-wrap items-center gap-x-[var(--ads-space-xs)] gap-y-2">
67
+ <component
68
+ :is="action.to ? NuxtLink : 'button'"
69
+ v-for="(action, index) in actions"
70
+ :key="`${action.label}-${index}`"
71
+ :to="action.to"
72
+ :type="action.to ? undefined : 'button'"
73
+ class="inline-flex items-center gap-1 rounded-[var(--ads-radius-xsm)] bg-[var(--ads-surface-main)] px-[var(--ads-space-nano)] py-[var(--ads-space-quark)] text-[length:var(--ads-font-size-xxxs)] font-medium leading-[1.2] text-[var(--ads-text-secondary)] transition-colors hover:text-[var(--ads-text-primary)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ads-border-focused)]"
74
+ @click="onActionClick($event, action)"
75
+ >
76
+ <UIcon v-if="action.icon" :name="action.icon" class="size-3.5 shrink-0" />
77
+ {{ action.label }}
78
+ </component>
79
+ </span>
80
+ <span v-else-if="hasFooter" class="mt-auto flex flex-wrap items-center gap-2">
81
+ <AdsPill
82
+ v-for="badge in badges"
83
+ :key="badge.label"
84
+ :tone="badge.tone ?? 'secondary'"
85
+ :status="badge.status ?? 'default'"
86
+ :label="badge.label"
87
+ />
88
+ <span
89
+ v-if="footerText"
90
+ class="inline-flex items-center gap-1 text-xs text-[var(--ads-text-secondary)]"
91
+ >
92
+ <UIcon v-if="footerIcon" :name="footerIcon" class="size-3.5" />
93
+ {{ footerText }}
94
+ </span>
95
+ </span>
96
+ </span>
97
+ </AdsCard>
98
+ </template>
99
+
100
+ <script setup lang="ts">
101
+ import { computed, nextTick, onMounted, ref, watch } from "vue";
102
+ import type { RouteLocationRaw } from "vue-router";
103
+ import { useResizeObserver } from "@vueuse/core";
104
+ import { NuxtLink } from "#components";
105
+ import AdsCard from "./AdsCard.vue";
106
+ import AdsPill from "./AdsPill.vue";
107
+ import type { AdsPillStatus, AdsPillTone } from "./AdsPill.vue";
108
+ import AdsTooltip from "./AdsTooltip.vue";
109
+
110
+ export interface AdsFeatureCardBadge {
111
+ label: string;
112
+ tone?: AdsPillTone;
113
+ status?: AdsPillStatus;
114
+ }
115
+
116
+ /** Ação do rodapé. Com `to`, vira link; sem ele, continua botão. */
117
+ export interface AdsFeatureCardAction {
118
+ label: string;
119
+ icon?: string;
120
+ to?: RouteLocationRaw;
121
+ }
122
+
123
+ /**
124
+ * Cor da pílula do ícone.
125
+ * primary: fundo `--ads-feature-accent-blue`, ícone da marca.
126
+ * success: fundo `--ads-feature-accent-green`, ícone `--ads-feature-accent-green-icon`.
127
+ */
128
+ export type AdsFeatureCardColor =
129
+ | "primary"
130
+ | "success"
131
+ | "attention"
132
+ | "warning"
133
+ | "new"
134
+ | "blocked"
135
+ | "ai";
136
+
137
+ /** Fundo e cor da variação. O hover do título e da seta usa `fg`; o fundo da pílula mistura os dois. */
138
+ const iconTone: Record<AdsFeatureCardColor, { bg: string; fg: string }> = {
139
+ primary: { bg: "var(--ads-feature-accent-blue)", fg: "var(--ads-text-brand)" },
140
+ success: { bg: "var(--ads-feature-accent-green)", fg: "var(--ads-feature-accent-green-icon)" },
141
+ attention: { bg: "var(--ads-status-attention-100)", fg: "var(--ads-status-attention-800)" },
142
+ warning: { bg: "var(--ads-status-warning-100)", fg: "var(--ads-status-warning-800)" },
143
+ new: { bg: "var(--ads-status-new-100)", fg: "var(--ads-status-new-800)" },
144
+ blocked: { bg: "var(--ads-status-void-100)", fg: "var(--ads-status-void-800)" },
145
+ ai: { bg: "var(--ads-surface-ai)", fg: "var(--ads-text-ai)" },
146
+ };
147
+
148
+
149
+ const props = withDefaults(
150
+ defineProps<{
151
+ title: string;
152
+ description: string;
153
+ icon: string;
154
+ /** Cor da pílula. No hover, título e seta usam essa cor e o fundo da pílula escurece. */
155
+ color?: AdsFeatureCardColor;
156
+ /** Vira link. Sem valor, continua botão. */
157
+ to?: RouteLocationRaw;
158
+ disabled?: boolean;
159
+ /** Hover colore título e seta e escurece a pílula. false desliga. */
160
+ hoverable?: boolean;
161
+ /** Ações do rodapé, cada uma com o próprio clique. A casca deixa de ser o botão. */
162
+ actions?: AdsFeatureCardAction[];
163
+ badges?: AdsFeatureCardBadge[];
164
+ footerIcon?: string;
165
+ footerText?: string;
166
+ }>(),
167
+ {
168
+ color: "primary",
169
+ to: undefined,
170
+ disabled: false,
171
+ hoverable: true,
172
+ actions: undefined,
173
+ badges: undefined,
174
+ footerIcon: undefined,
175
+ footerText: undefined,
176
+ },
177
+ );
178
+
179
+ const emit = defineEmits<{
180
+ click: [event: MouseEvent];
181
+ action: [action: AdsFeatureCardAction, event: MouseEvent];
182
+ }>();
183
+
184
+ const hasActions = computed(() => (props.actions?.length ?? 0) > 0);
185
+ /** Sem ações, o cartão inteiro é o botão. Com ações, só o miolo é, para o rodapé ter cliques próprios. */
186
+ const shellIsButton = computed(() => !hasActions.value);
187
+
188
+ const hasFooter = computed(
189
+ () => (props.badges?.length ?? 0) > 0 || Boolean(props.footerText),
190
+ );
191
+
192
+ const descriptionEl = ref<HTMLElement | null>(null);
193
+ const isDescriptionTruncated = ref(false);
194
+
195
+ const syncDescriptionTruncation = () => {
196
+ const element = descriptionEl.value;
197
+ if (!element) {
198
+ isDescriptionTruncated.value = false;
199
+ return;
200
+ }
201
+ isDescriptionTruncated.value = element.scrollHeight - element.clientHeight > 1;
202
+ };
203
+
204
+ useResizeObserver(descriptionEl, syncDescriptionTruncation);
205
+
206
+ onMounted(() => {
207
+ void nextTick(syncDescriptionTruncation);
208
+ });
209
+
210
+ watch(
211
+ () => props.description,
212
+ () => {
213
+ void nextTick(syncDescriptionTruncation);
214
+ },
215
+ );
216
+
217
+ /** O link não tem disabled nativo: sai da ordem do Tab e avisa por aria-disabled. */
218
+ const interactiveAttrs = computed(() =>
219
+ props.to
220
+ ? { to: props.to, tabindex: props.disabled ? -1 : undefined, "aria-disabled": props.disabled || undefined }
221
+ : {},
222
+ );
223
+
224
+ const mainTag = computed(() => (hasActions.value ? (props.to ? NuxtLink : "button") : "span"));
225
+
226
+ const mainControlClass =
227
+ "cursor-pointer rounded-[var(--ads-radius-xsm)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ads-border-focused)] disabled:cursor-not-allowed aria-disabled:cursor-not-allowed";
228
+
229
+ /** Título e seta. O foco do cartão e o do miolo disparam o mesmo estado. */
230
+ const accentHoverClass = computed(() =>
231
+ props.hoverable && !props.disabled
232
+ ? "group-hover:text-[var(--ads-feature-icon-fg)] group-focus-visible:text-[var(--ads-feature-icon-fg)] group-has-[:focus-visible]:text-[var(--ads-feature-icon-fg)]"
233
+ : "",
234
+ );
235
+
236
+ /**
237
+ * O AdsCard não aplica o hover de borda. Aqui ficam o padding, as cores da variação
238
+ * e o desabilitado sem opacidade, porque o conteúdo já troca para as cores terciárias.
239
+ */
240
+ const cardStyle = computed(() => ({
241
+ "--ads-card-disabled-opacity": "1",
242
+ "--ads-feature-icon-bg": iconTone[props.color].bg,
243
+ "--ads-feature-icon-fg": iconTone[props.color].fg,
244
+ padding: "var(--ads-feature-padding)",
245
+ }));
246
+
247
+ const iconBoxClass = computed(() =>
248
+ props.disabled
249
+ ? "bg-[var(--ads-button-secondary-disabled)] text-[var(--ads-text-tertiary)]"
250
+ : [
251
+ "bg-[var(--ads-feature-icon-bg)] text-[var(--ads-feature-icon-fg)] transition-colors duration-150 ease-out",
252
+ props.hoverable
253
+ ? "group-hover:bg-[color-mix(in_srgb,var(--ads-feature-icon-bg)_82%,var(--ads-feature-icon-fg))] group-focus-visible:bg-[color-mix(in_srgb,var(--ads-feature-icon-bg)_82%,var(--ads-feature-icon-fg))] group-has-[:focus-visible]:bg-[color-mix(in_srgb,var(--ads-feature-icon-bg)_82%,var(--ads-feature-icon-fg))]"
254
+ : "",
255
+ ],
256
+ );
257
+
258
+ const titleClass = computed(() =>
259
+ props.disabled
260
+ ? "text-[var(--ads-text-tertiary)]"
261
+ : ["text-[var(--ads-feature-title)] transition-colors duration-150 ease-out", accentHoverClass.value],
262
+ );
263
+
264
+ const descriptionClass = computed(() =>
265
+ props.disabled ? "text-[var(--ads-text-tertiary)]" : "text-[var(--ads-feature-body)]",
266
+ );
267
+
268
+ const onClick = (event: MouseEvent) => {
269
+ if (!props.disabled) {
270
+ emit("click", event);
271
+ return;
272
+ }
273
+ event.preventDefault();
274
+ };
275
+
276
+ const onShellClick = (event: MouseEvent) => {
277
+ if (shellIsButton.value) onClick(event);
278
+ };
279
+
280
+ const onMainClick = (event: MouseEvent) => {
281
+ if (hasActions.value) onClick(event);
282
+ };
283
+
284
+ const onActionClick = (event: MouseEvent, action: AdsFeatureCardAction) => {
285
+ event.stopPropagation();
286
+ if (props.disabled) {
287
+ event.preventDefault();
288
+ return;
289
+ }
290
+ emit("action", action, event);
291
+ };
292
+ </script>