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.
- package/LICENSE +21 -21
- package/README.md +574 -575
- package/app/app.config.ts +25 -25
- package/app/assets/ads/checkbox-check.svg +5 -5
- package/app/assets/ads/checkbox-minus.svg +5 -5
- package/app/assets/brand/farmarcas.svg +6 -6
- package/app/assets/brand/radar-symbol.svg +9 -9
- package/app/assets/brand/radar.svg +9 -9
- package/app/assets/css/ads-colors.css +257 -257
- package/app/assets/css/component-tokens.css +6 -2
- package/app/assets/css/main.css +585 -585
- package/app/components/AdsBadge.vue +47 -47
- package/app/components/AdsBroadcast.vue +24 -24
- package/app/components/AdsButton.vue +547 -547
- package/app/components/AdsButtonGroup.vue +39 -39
- package/app/components/AdsButtonMenu.vue +48 -48
- package/app/components/AdsCard.vue +188 -188
- package/app/components/AdsCardHint.vue +56 -22
- package/app/components/AdsCardPeriod.vue +43 -43
- package/app/components/AdsCardVariation.vue +31 -31
- package/app/components/AdsCharttip.vue +79 -79
- package/app/components/AdsDatePicker.vue +509 -509
- package/app/components/AdsDropdownMenu.vue +30 -30
- package/app/components/AdsEmptyState.vue +61 -61
- package/app/components/AdsFeatureCard.vue +292 -210
- package/app/components/AdsFileCard.vue +98 -98
- package/app/components/AdsFooter.vue +25 -25
- package/app/components/AdsHeavyAccountCell.vue +59 -59
- package/app/components/AdsHeavyHeaderCell.vue +70 -70
- package/app/components/AdsHeavyTable.vue +135 -139
- package/app/components/AdsInput.vue +148 -148
- package/app/components/AdsLoading.vue +217 -217
- package/app/components/AdsMenuBar.vue +110 -110
- package/app/components/AdsMetricCard.vue +226 -216
- package/app/components/AdsModal.vue +160 -160
- package/app/components/AdsMonthPicker.vue +80 -80
- package/app/components/AdsNavbarApp.vue +67 -67
- package/app/components/AdsNavbarDesk.vue +67 -67
- package/app/components/AdsNotabilityPill.vue +24 -24
- package/app/components/AdsNumberInput.vue +173 -173
- package/app/components/AdsPanelCard.vue +99 -99
- package/app/components/AdsPill.vue +144 -144
- package/app/components/AdsProductTag.vue +80 -80
- package/app/components/AdsSearchInput.vue +122 -122
- package/app/components/AdsSegmentedTabs.vue +62 -62
- package/app/components/AdsSelect.vue +283 -283
- package/app/components/AdsSelectItem.vue +128 -128
- package/app/components/AdsSelectPanel.vue +221 -221
- package/app/components/AdsSideMenu.vue +101 -101
- package/app/components/AdsSmalltip.vue +44 -44
- package/app/components/AdsStepper.vue +222 -222
- package/app/components/AdsTable.vue +172 -176
- package/app/components/AdsTableHeaderCell.vue +80 -80
- package/app/components/AdsTableSkeleton.vue +113 -113
- package/app/components/AdsTableToolbar.vue +44 -44
- package/app/components/AdsTabs.vue +51 -51
- package/app/components/AdsTextarea.vue +116 -116
- package/app/components/AdsToast.vue +184 -184
- package/app/components/AdsTooltip.vue +73 -73
- package/app/components/OverlayLoading.vue +2 -17
- package/app/components/ProgressBarLoading.vue +235 -235
- package/app/composables/useOverlayLoading.ts +88 -88
- package/app/constants/ads-color-swatches.ts +240 -240
- package/app/locale/pt-br.ts +6 -6
- package/app/plugins/ads-toast.client.ts +24 -24
- package/app/theme/ads-theme.ts +374 -374
- package/app/theme/ads-tokens.ts +391 -391
- package/app/theme/component-tokens.json +6 -2
- package/app/theme/component-tokens.ts +6 -2
- package/app/types/overlay-loading.types.ts +32 -35
- package/app/utils/ads-filter-select.ts +191 -191
- package/app/utils/ads-table.ts +416 -398
- package/app/utils/calendar-date.ts +163 -163
- package/app/utils/category-role.ts +45 -45
- package/app/utils/money.ts +77 -77
- package/app/utils/notability.ts +8 -8
- package/app/utils/parser.ts +134 -134
- package/app/utils/percentage.ts +54 -54
- package/nuxt.config.ts +31 -31
- package/package.json +57 -56
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
AdsSelectItem — item da lista (Figma: _Dropdown Item). Peça interna do AdsSelect.
|
|
3
|
-
Seleção simples: selecionado ganha fundo azul claro e título em negrito.
|
|
4
|
-
Checkbox: caixa azul à esquerda; selecionado deixa o título em negrito.
|
|
5
|
-
-->
|
|
6
|
-
<template>
|
|
7
|
-
<button
|
|
8
|
-
type="button"
|
|
9
|
-
class="relative flex min-h-12 w-full items-center gap-3 p-[var(--ads-select-item-padding)] text-left transition-colors focus-visible:outline-none"
|
|
10
|
-
:class="[surfaceClass, divider ? dividerClass : '']"
|
|
11
|
-
:disabled="disabled"
|
|
12
|
-
:role="mode === 'checkbox' ? 'checkbox' : 'option'"
|
|
13
|
-
:aria-checked="checkedState"
|
|
14
|
-
:aria-selected="mode === 'radio' ? selected : undefined"
|
|
15
|
-
@click="emit('select')"
|
|
16
|
-
>
|
|
17
|
-
<span
|
|
18
|
-
v-if="mode === 'checkbox'"
|
|
19
|
-
class="flex size-4 shrink-0 items-center justify-center rounded-[var(--ads-radius-xsm)] border-2 border-[var(--ads-text-brand)]"
|
|
20
|
-
:class="[
|
|
21
|
-
selected || indeterminate ? 'bg-[var(--ads-surface-brand)]' : 'bg-[var(--ads-surface-card)]',
|
|
22
|
-
{ 'opacity-40': disabled },
|
|
23
|
-
]"
|
|
24
|
-
aria-hidden="true"
|
|
25
|
-
>
|
|
26
|
-
<UIcon v-if="indeterminate" name="i-lucide-minus" class="size-3 text-[var(--ads-text-contrast)]" />
|
|
27
|
-
<UIcon v-else-if="selected" name="i-lucide-check" class="size-3 text-[var(--ads-text-contrast)]" />
|
|
28
|
-
</span>
|
|
29
|
-
|
|
30
|
-
<span class="flex min-w-0 flex-1 flex-col gap-0.5">
|
|
31
|
-
<span
|
|
32
|
-
v-if="badge"
|
|
33
|
-
class="flex items-center gap-1 text-[length:var(--ads-font-size-xxxs)] font-bold leading-[1.2]"
|
|
34
|
-
:class="badgeClass"
|
|
35
|
-
>
|
|
36
|
-
<UIcon v-if="badgeIcon" :name="badgeIcon" class="size-3 shrink-0" aria-hidden="true" />
|
|
37
|
-
{{ badge.label }}
|
|
38
|
-
</span>
|
|
39
|
-
<AdsTooltip
|
|
40
|
-
:description="label"
|
|
41
|
-
:show-title="false"
|
|
42
|
-
:disabled="!needsTooltip"
|
|
43
|
-
wing="down"
|
|
44
|
-
align="start"
|
|
45
|
-
>
|
|
46
|
-
<span class="block min-w-0 truncate text-sm leading-[1.3]" :class="titleClass">
|
|
47
|
-
{{ displayLabel }}
|
|
48
|
-
</span>
|
|
49
|
-
</AdsTooltip>
|
|
50
|
-
<span
|
|
51
|
-
v-if="subtitle"
|
|
52
|
-
class="block min-w-0 truncate text-sm font-normal leading-[1.3]"
|
|
53
|
-
:class="disabled ? 'text-[var(--ads-text-tertiary)]' : 'text-[var(--ads-text-secondary)]'"
|
|
54
|
-
>
|
|
55
|
-
{{ subtitle }}
|
|
56
|
-
</span>
|
|
57
|
-
</span>
|
|
58
|
-
</button>
|
|
59
|
-
</template>
|
|
60
|
-
|
|
61
|
-
<script setup lang="ts">
|
|
62
|
-
import { computed } from "vue";
|
|
63
|
-
import AdsTooltip from "./AdsTooltip.vue";
|
|
64
|
-
import {
|
|
65
|
-
filterLabelNeedsTooltip,
|
|
66
|
-
truncateFilterLabel,
|
|
67
|
-
type AdsFilterOptionBadge,
|
|
68
|
-
} from "../utils/ads-filter-select";
|
|
69
|
-
|
|
70
|
-
const props = withDefaults(
|
|
71
|
-
defineProps<{
|
|
72
|
-
label: string;
|
|
73
|
-
/** radio: seleção simples. checkbox: seleção múltipla. */
|
|
74
|
-
mode: "checkbox" | "radio";
|
|
75
|
-
selected?: boolean;
|
|
76
|
-
indeterminate?: boolean;
|
|
77
|
-
disabled?: boolean;
|
|
78
|
-
/** Linha de apoio abaixo do título. */
|
|
79
|
-
subtitle?: string;
|
|
80
|
-
/** Texto curto acima do título, como "Novo!" (brand) ou "Sugestão Inteligente" (ai). */
|
|
81
|
-
badge?: AdsFilterOptionBadge;
|
|
82
|
-
/** Linha de 1px embaixo. O painel desliga no último item. */
|
|
83
|
-
divider?: boolean;
|
|
84
|
-
}>(),
|
|
85
|
-
{
|
|
86
|
-
selected: false,
|
|
87
|
-
indeterminate: false,
|
|
88
|
-
disabled: false,
|
|
89
|
-
subtitle: undefined,
|
|
90
|
-
badge: undefined,
|
|
91
|
-
divider: true,
|
|
92
|
-
},
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
const emit = defineEmits<{ select: [] }>();
|
|
96
|
-
|
|
97
|
-
const displayLabel = computed(() => truncateFilterLabel(props.label));
|
|
98
|
-
const needsTooltip = computed(() => filterLabelNeedsTooltip(props.label));
|
|
99
|
-
|
|
100
|
-
const checkedState = computed(() => {
|
|
101
|
-
if (props.mode !== "checkbox") return undefined;
|
|
102
|
-
if (props.indeterminate) return "mixed";
|
|
103
|
-
return props.selected;
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
const dividerClass =
|
|
107
|
-
"after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:h-px after:bg-[var(--ads-select-divider)]";
|
|
108
|
-
|
|
109
|
-
const surfaceClass = computed(() => {
|
|
110
|
-
if (props.disabled) return "cursor-not-allowed bg-[var(--ads-surface-card)]";
|
|
111
|
-
if (props.mode === "radio" && props.selected) return "bg-[var(--ads-select-item-selected)]";
|
|
112
|
-
return "bg-[var(--ads-surface-card)] hover:bg-[var(--ads-select-item-hover)] focus-visible:bg-[var(--ads-select-item-hover)]";
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
const titleClass = computed(() => {
|
|
116
|
-
if (props.disabled) return "font-medium text-[var(--ads-text-tertiary)]";
|
|
117
|
-
if (props.selected) return "font-bold text-[var(--ads-text-primary)]";
|
|
118
|
-
return "font-medium text-[var(--ads-text-secondary)]";
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
const badgeClass = computed(() => {
|
|
122
|
-
if (props.disabled) return "text-[var(--ads-text-tertiary)]";
|
|
123
|
-
return props.badge?.tone === "ai" ? "text-[var(--ads-select-badge-ai)]" : "text-[var(--ads-select-badge)]";
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
/** Selo de IA usa sparkles quando não vem ícone. */
|
|
127
|
-
const badgeIcon = computed(() => props.badge?.icon ?? (props.badge?.tone === "ai" ? "i-lucide-sparkles" : undefined));
|
|
128
|
-
</script>
|
|
1
|
+
<!--
|
|
2
|
+
AdsSelectItem — item da lista (Figma: _Dropdown Item). Peça interna do AdsSelect.
|
|
3
|
+
Seleção simples: selecionado ganha fundo azul claro e título em negrito.
|
|
4
|
+
Checkbox: caixa azul à esquerda; selecionado deixa o título em negrito.
|
|
5
|
+
-->
|
|
6
|
+
<template>
|
|
7
|
+
<button
|
|
8
|
+
type="button"
|
|
9
|
+
class="relative flex min-h-12 w-full items-center gap-3 p-[var(--ads-select-item-padding)] text-left transition-colors focus-visible:outline-none"
|
|
10
|
+
:class="[surfaceClass, divider ? dividerClass : '']"
|
|
11
|
+
:disabled="disabled"
|
|
12
|
+
:role="mode === 'checkbox' ? 'checkbox' : 'option'"
|
|
13
|
+
:aria-checked="checkedState"
|
|
14
|
+
:aria-selected="mode === 'radio' ? selected : undefined"
|
|
15
|
+
@click="emit('select')"
|
|
16
|
+
>
|
|
17
|
+
<span
|
|
18
|
+
v-if="mode === 'checkbox'"
|
|
19
|
+
class="flex size-4 shrink-0 items-center justify-center rounded-[var(--ads-radius-xsm)] border-2 border-[var(--ads-text-brand)]"
|
|
20
|
+
:class="[
|
|
21
|
+
selected || indeterminate ? 'bg-[var(--ads-surface-brand)]' : 'bg-[var(--ads-surface-card)]',
|
|
22
|
+
{ 'opacity-40': disabled },
|
|
23
|
+
]"
|
|
24
|
+
aria-hidden="true"
|
|
25
|
+
>
|
|
26
|
+
<UIcon v-if="indeterminate" name="i-lucide-minus" class="size-3 text-[var(--ads-text-contrast)]" />
|
|
27
|
+
<UIcon v-else-if="selected" name="i-lucide-check" class="size-3 text-[var(--ads-text-contrast)]" />
|
|
28
|
+
</span>
|
|
29
|
+
|
|
30
|
+
<span class="flex min-w-0 flex-1 flex-col gap-0.5">
|
|
31
|
+
<span
|
|
32
|
+
v-if="badge"
|
|
33
|
+
class="flex items-center gap-1 text-[length:var(--ads-font-size-xxxs)] font-bold leading-[1.2]"
|
|
34
|
+
:class="badgeClass"
|
|
35
|
+
>
|
|
36
|
+
<UIcon v-if="badgeIcon" :name="badgeIcon" class="size-3 shrink-0" aria-hidden="true" />
|
|
37
|
+
{{ badge.label }}
|
|
38
|
+
</span>
|
|
39
|
+
<AdsTooltip
|
|
40
|
+
:description="label"
|
|
41
|
+
:show-title="false"
|
|
42
|
+
:disabled="!needsTooltip"
|
|
43
|
+
wing="down"
|
|
44
|
+
align="start"
|
|
45
|
+
>
|
|
46
|
+
<span class="block min-w-0 truncate text-sm leading-[1.3]" :class="titleClass">
|
|
47
|
+
{{ displayLabel }}
|
|
48
|
+
</span>
|
|
49
|
+
</AdsTooltip>
|
|
50
|
+
<span
|
|
51
|
+
v-if="subtitle"
|
|
52
|
+
class="block min-w-0 truncate text-sm font-normal leading-[1.3]"
|
|
53
|
+
:class="disabled ? 'text-[var(--ads-text-tertiary)]' : 'text-[var(--ads-text-secondary)]'"
|
|
54
|
+
>
|
|
55
|
+
{{ subtitle }}
|
|
56
|
+
</span>
|
|
57
|
+
</span>
|
|
58
|
+
</button>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script setup lang="ts">
|
|
62
|
+
import { computed } from "vue";
|
|
63
|
+
import AdsTooltip from "./AdsTooltip.vue";
|
|
64
|
+
import {
|
|
65
|
+
filterLabelNeedsTooltip,
|
|
66
|
+
truncateFilterLabel,
|
|
67
|
+
type AdsFilterOptionBadge,
|
|
68
|
+
} from "../utils/ads-filter-select";
|
|
69
|
+
|
|
70
|
+
const props = withDefaults(
|
|
71
|
+
defineProps<{
|
|
72
|
+
label: string;
|
|
73
|
+
/** radio: seleção simples. checkbox: seleção múltipla. */
|
|
74
|
+
mode: "checkbox" | "radio";
|
|
75
|
+
selected?: boolean;
|
|
76
|
+
indeterminate?: boolean;
|
|
77
|
+
disabled?: boolean;
|
|
78
|
+
/** Linha de apoio abaixo do título. */
|
|
79
|
+
subtitle?: string;
|
|
80
|
+
/** Texto curto acima do título, como "Novo!" (brand) ou "Sugestão Inteligente" (ai). */
|
|
81
|
+
badge?: AdsFilterOptionBadge;
|
|
82
|
+
/** Linha de 1px embaixo. O painel desliga no último item. */
|
|
83
|
+
divider?: boolean;
|
|
84
|
+
}>(),
|
|
85
|
+
{
|
|
86
|
+
selected: false,
|
|
87
|
+
indeterminate: false,
|
|
88
|
+
disabled: false,
|
|
89
|
+
subtitle: undefined,
|
|
90
|
+
badge: undefined,
|
|
91
|
+
divider: true,
|
|
92
|
+
},
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const emit = defineEmits<{ select: [] }>();
|
|
96
|
+
|
|
97
|
+
const displayLabel = computed(() => truncateFilterLabel(props.label));
|
|
98
|
+
const needsTooltip = computed(() => filterLabelNeedsTooltip(props.label));
|
|
99
|
+
|
|
100
|
+
const checkedState = computed(() => {
|
|
101
|
+
if (props.mode !== "checkbox") return undefined;
|
|
102
|
+
if (props.indeterminate) return "mixed";
|
|
103
|
+
return props.selected;
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
const dividerClass =
|
|
107
|
+
"after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:h-px after:bg-[var(--ads-select-divider)]";
|
|
108
|
+
|
|
109
|
+
const surfaceClass = computed(() => {
|
|
110
|
+
if (props.disabled) return "cursor-not-allowed bg-[var(--ads-surface-card)]";
|
|
111
|
+
if (props.mode === "radio" && props.selected) return "bg-[var(--ads-select-item-selected)]";
|
|
112
|
+
return "bg-[var(--ads-surface-card)] hover:bg-[var(--ads-select-item-hover)] focus-visible:bg-[var(--ads-select-item-hover)]";
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
const titleClass = computed(() => {
|
|
116
|
+
if (props.disabled) return "font-medium text-[var(--ads-text-tertiary)]";
|
|
117
|
+
if (props.selected) return "font-bold text-[var(--ads-text-primary)]";
|
|
118
|
+
return "font-medium text-[var(--ads-text-secondary)]";
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
const badgeClass = computed(() => {
|
|
122
|
+
if (props.disabled) return "text-[var(--ads-text-tertiary)]";
|
|
123
|
+
return props.badge?.tone === "ai" ? "text-[var(--ads-select-badge-ai)]" : "text-[var(--ads-select-badge)]";
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
/** Selo de IA usa sparkles quando não vem ícone. */
|
|
127
|
+
const badgeIcon = computed(() => props.badge?.icon ?? (props.badge?.tone === "ai" ? "i-lucide-sparkles" : undefined));
|
|
128
|
+
</script>
|