ads-nuxt 0.1.1 → 0.1.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 (74) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +567 -546
  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.svg +9 -9
  8. package/app/assets/css/component-tokens.css +403 -403
  9. package/app/assets/css/main.css +617 -617
  10. package/app/components/AdsBadge.vue +48 -48
  11. package/app/components/AdsBroadcast.vue +45 -45
  12. package/app/components/AdsButton.vue +569 -569
  13. package/app/components/AdsButtonGroup.vue +39 -39
  14. package/app/components/AdsButtonMenu.vue +48 -48
  15. package/app/components/AdsCard.vue +117 -117
  16. package/app/components/AdsCharttip.vue +78 -78
  17. package/app/components/AdsCheckbox.vue +77 -77
  18. package/app/components/AdsDatePicker.vue +473 -473
  19. package/app/components/AdsDropdownMenu.vue +19 -19
  20. package/app/components/AdsEmptyState.vue +58 -58
  21. package/app/components/AdsFarmarcasPill.vue +74 -74
  22. package/app/components/AdsFeatureCard.vue +217 -217
  23. package/app/components/AdsFileCard.vue +101 -101
  24. package/app/components/AdsFilterDropdown.vue +174 -174
  25. package/app/components/AdsFilterOption.vue +72 -72
  26. package/app/components/AdsFilterSelect.vue +202 -202
  27. package/app/components/AdsFooter.vue +25 -25
  28. package/app/components/AdsInput.vue +143 -143
  29. package/app/components/AdsListDropdown.vue +44 -44
  30. package/app/components/AdsLoading.vue +109 -109
  31. package/app/components/AdsMenuBar.vue +103 -103
  32. package/app/components/AdsMetricCard.vue +119 -119
  33. package/app/components/AdsMiniPill.vue +40 -40
  34. package/app/components/AdsModal.vue +157 -157
  35. package/app/components/AdsMonthPicker.vue +80 -80
  36. package/app/components/AdsNavbarApp.vue +67 -67
  37. package/app/components/AdsNavbarDesk.vue +62 -62
  38. package/app/components/AdsNotabilityPill.vue +27 -27
  39. package/app/components/AdsNumberInput.vue +166 -166
  40. package/app/components/AdsPagination.vue +91 -91
  41. package/app/components/AdsProductTag.vue +61 -61
  42. package/app/components/AdsRadio.vue +70 -70
  43. package/app/components/AdsSearchInput.vue +113 -113
  44. package/app/components/AdsSegmentedTabs.vue +28 -28
  45. package/app/components/AdsSideMenu.vue +101 -101
  46. package/app/components/AdsSmalltip.vue +44 -44
  47. package/app/components/AdsSteptip.vue +101 -101
  48. package/app/components/AdsSwitch.vue +59 -59
  49. package/app/components/AdsTable.vue +100 -100
  50. package/app/components/AdsTableToolbar.vue +44 -44
  51. package/app/components/AdsTabs.vue +51 -51
  52. package/app/components/AdsTextarea.vue +109 -109
  53. package/app/components/AdsToast.vue +181 -181
  54. package/app/components/AdsTooltip.vue +66 -66
  55. package/app/components/InvertedTooltip.vue +40 -40
  56. package/app/components/OverlayLoading.vue +173 -173
  57. package/app/components/ProgressBarLoading.vue +256 -256
  58. package/app/composables/useOverlayLoading.ts +66 -66
  59. package/app/locale/pt-br.ts +6 -6
  60. package/app/plugins/ads-toast.client.ts +24 -24
  61. package/app/theme/ads-theme.ts +370 -370
  62. package/app/theme/component-tokens.json +402 -402
  63. package/app/theme/component-tokens.ts +815 -815
  64. package/app/types/overlay-loading.types.ts +26 -26
  65. package/app/utils/ads-filter-select.ts +172 -172
  66. package/app/utils/ads-table.ts +204 -204
  67. package/app/utils/calendar-date.ts +128 -128
  68. package/app/utils/category-role.ts +45 -45
  69. package/app/utils/money.ts +77 -77
  70. package/app/utils/notability.ts +8 -8
  71. package/app/utils/parser.ts +134 -134
  72. package/app/utils/percentage.ts +54 -54
  73. package/nuxt.config.ts +31 -32
  74. package/package.json +48 -46
@@ -1,19 +1,19 @@
1
- <template>
2
- <UDropdownMenu :items="items" :content="content" :ui="adsDropdownMenuUi">
3
- <slot />
4
- </UDropdownMenu>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import type { DropdownMenuItem } from "@nuxt/ui";
9
- import { adsDropdownMenuUi } from "../theme/ads-theme";
10
-
11
- defineProps<{
12
- items: DropdownMenuItem[] | DropdownMenuItem[][];
13
- content?: {
14
- side?: "top" | "right" | "bottom" | "left";
15
- align?: "start" | "center" | "end";
16
- sideOffset?: number;
17
- };
18
- }>();
19
- </script>
1
+ <template>
2
+ <UDropdownMenu :items="items" :content="content" :ui="adsDropdownMenuUi">
3
+ <slot />
4
+ </UDropdownMenu>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import type { DropdownMenuItem } from "@nuxt/ui";
9
+ import { adsDropdownMenuUi } from "../theme/ads-theme";
10
+
11
+ defineProps<{
12
+ items: DropdownMenuItem[] | DropdownMenuItem[][];
13
+ content?: {
14
+ side?: "top" | "right" | "bottom" | "left";
15
+ align?: "start" | "center" | "end";
16
+ sideOffset?: number;
17
+ };
18
+ }>();
19
+ </script>
@@ -1,58 +1,58 @@
1
- <template>
2
- <div
3
- class="flex flex-col items-center text-center"
4
- :class="small ? 'gap-[var(--ads-empty-gap-sm)]' : 'gap-[var(--ads-empty-gap)]'"
5
- >
6
- <svg
7
- viewBox="0 0 24 24"
8
- fill="none"
9
- aria-hidden="true"
10
- class="text-[var(--ads-empty-icon-color)]"
11
- :class="small ? 'size-[var(--ads-empty-icon-sm)]' : 'size-[var(--ads-empty-icon)]'"
12
- >
13
- <circle cx="12" cy="12" r="9" stroke="currentColor" stroke-width="1.6" />
14
- <path d="M9 9l6 6M15 9l-6 6" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" />
15
- </svg>
16
- <div class="flex max-w-xs flex-col items-center gap-[var(--ads-empty-text-gap)]">
17
- <p
18
- class="font-bold leading-[1.3] text-[var(--ads-text-primary)]"
19
- :class="small ? 'text-[length:var(--ads-empty-title-size-sm)]' : 'text-[length:var(--ads-empty-title-size)]'"
20
- >
21
- {{ title }}
22
- </p>
23
- <p v-if="subtitle" class="text-[length:var(--ads-empty-subtitle-size)] leading-[1.2] text-[var(--ads-text-secondary)]">
24
- {{ subtitle }}
25
- </p>
26
- </div>
27
- <div v-if="showActions" class="flex flex-col items-center gap-2">
28
- <slot>
29
- <AdsButton :label="primaryLabel" leading trailing />
30
- <AdsButton type="unfilled" :label="secondaryLabel" leading trailing />
31
- </slot>
32
- </div>
33
- </div>
34
- </template>
35
-
36
- <script setup lang="ts">
37
- import AdsButton from "./AdsButton.vue";
38
-
39
- withDefaults(
40
- defineProps<{
41
- title?: string;
42
- subtitle?: string;
43
- /** Figma `Small=Yes`. */
44
- small?: boolean;
45
- showActions?: boolean;
46
- primaryLabel?: string;
47
- secondaryLabel?: string;
48
- }>(),
49
- {
50
- title: "Título do empty state",
51
- subtitle: "Coloque aqui um texto explicando e direcionando o usuário. Uso opcional.",
52
- small: false,
53
- showActions: true,
54
- primaryLabel: "Button Test",
55
- secondaryLabel: "Button Test",
56
- },
57
- );
58
- </script>
1
+ <template>
2
+ <div
3
+ class="flex flex-col items-center text-center"
4
+ :class="small ? 'gap-[var(--ads-empty-gap-sm)]' : 'gap-[var(--ads-empty-gap)]'"
5
+ >
6
+ <svg
7
+ viewBox="0 0 24 24"
8
+ fill="none"
9
+ aria-hidden="true"
10
+ class="text-[var(--ads-empty-icon-color)]"
11
+ :class="small ? 'size-[var(--ads-empty-icon-sm)]' : 'size-[var(--ads-empty-icon)]'"
12
+ >
13
+ <circle cx="12" cy="12" r="9" stroke="currentColor" stroke-width="1.6" />
14
+ <path d="M9 9l6 6M15 9l-6 6" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" />
15
+ </svg>
16
+ <div class="flex max-w-xs flex-col items-center gap-[var(--ads-empty-text-gap)]">
17
+ <p
18
+ class="font-bold leading-[1.3] text-[var(--ads-text-primary)]"
19
+ :class="small ? 'text-[length:var(--ads-empty-title-size-sm)]' : 'text-[length:var(--ads-empty-title-size)]'"
20
+ >
21
+ {{ title }}
22
+ </p>
23
+ <p v-if="subtitle" class="text-[length:var(--ads-empty-subtitle-size)] leading-[1.2] text-[var(--ads-text-secondary)]">
24
+ {{ subtitle }}
25
+ </p>
26
+ </div>
27
+ <div v-if="showActions" class="flex flex-col items-center gap-2">
28
+ <slot>
29
+ <AdsButton :label="primaryLabel" leading trailing />
30
+ <AdsButton type="unfilled" :label="secondaryLabel" leading trailing />
31
+ </slot>
32
+ </div>
33
+ </div>
34
+ </template>
35
+
36
+ <script setup lang="ts">
37
+ import AdsButton from "./AdsButton.vue";
38
+
39
+ withDefaults(
40
+ defineProps<{
41
+ title?: string;
42
+ subtitle?: string;
43
+ /** Figma `Small=Yes`. */
44
+ small?: boolean;
45
+ showActions?: boolean;
46
+ primaryLabel?: string;
47
+ secondaryLabel?: string;
48
+ }>(),
49
+ {
50
+ title: "Título do empty state",
51
+ subtitle: "Coloque aqui um texto explicando e direcionando o usuário. Uso opcional.",
52
+ small: false,
53
+ showActions: true,
54
+ primaryLabel: "Button Test",
55
+ secondaryLabel: "Button Test",
56
+ },
57
+ );
58
+ </script>
@@ -1,74 +1,74 @@
1
- <template>
2
- <span
3
- class="inline-flex h-[var(--ads-farmarcas-height)] min-w-[var(--ads-farmarcas-min-width)] items-center justify-center rounded-full px-2 text-[length:var(--ads-farmarcas-font-size)] leading-[1.2] font-bold whitespace-nowrap"
4
- :style="{
5
- background: `var(--ads-farmarcas-${token}-bg)`,
6
- color: `var(--ads-farmarcas-${token}-text)`,
7
- }"
8
- >
9
- {{ label || labels[department] }}
10
- </span>
11
- </template>
12
-
13
- <script setup lang="ts">
14
- import { computed } from "vue";
15
-
16
- /** Departamentos do Farmarcas Pill. As cores não existem na escala semântica do ADS. */
17
- export type AdsFarmarcasDepartment =
18
- | "expansao"
19
- | "eventos"
20
- | "adm-digital"
21
- | "sucesso"
22
- | "trade"
23
- | "dev"
24
- | "ti"
25
- | "padronizacao"
26
- | "diretoria"
27
- | "comercial"
28
- | "inovacao"
29
- | "patrimonio"
30
- | "presidencia"
31
- | "marketing"
32
- | "gg"
33
- | "bi"
34
- | "financeiro"
35
- | "juridico"
36
- | "capacitacao"
37
- | "produto";
38
-
39
- const props = withDefaults(
40
- defineProps<{
41
- department?: AdsFarmarcasDepartment;
42
- label?: string;
43
- }>(),
44
- {
45
- department: "expansao",
46
- label: "",
47
- },
48
- );
49
-
50
- const labels: Record<AdsFarmarcasDepartment, string> = {
51
- expansao: "Expansão",
52
- eventos: "Eventos",
53
- "adm-digital": "ADM digital",
54
- sucesso: "Sucesso",
55
- trade: "Trade",
56
- dev: "Dev",
57
- ti: "TI",
58
- padronizacao: "Padronização",
59
- diretoria: "Diretoria",
60
- comercial: "Comercial",
61
- inovacao: "Inovação",
62
- patrimonio: "Patrimônio",
63
- presidencia: "Presidência",
64
- marketing: "Marketing",
65
- gg: "G&G",
66
- bi: "BI",
67
- financeiro: "Financeiro",
68
- juridico: "Jurídico",
69
- capacitacao: "Capacitação",
70
- produto: "produto",
71
- };
72
-
73
- const token = computed(() => props.department);
74
- </script>
1
+ <template>
2
+ <span
3
+ class="inline-flex h-[var(--ads-farmarcas-height)] min-w-[var(--ads-farmarcas-min-width)] items-center justify-center rounded-full px-2 text-[length:var(--ads-farmarcas-font-size)] leading-[1.2] font-bold whitespace-nowrap"
4
+ :style="{
5
+ background: `var(--ads-farmarcas-${token}-bg)`,
6
+ color: `var(--ads-farmarcas-${token}-text)`,
7
+ }"
8
+ >
9
+ {{ label || labels[department] }}
10
+ </span>
11
+ </template>
12
+
13
+ <script setup lang="ts">
14
+ import { computed } from "vue";
15
+
16
+ /** Departamentos do Farmarcas Pill. As cores não existem na escala semântica do ADS. */
17
+ export type AdsFarmarcasDepartment =
18
+ | "expansao"
19
+ | "eventos"
20
+ | "adm-digital"
21
+ | "sucesso"
22
+ | "trade"
23
+ | "dev"
24
+ | "ti"
25
+ | "padronizacao"
26
+ | "diretoria"
27
+ | "comercial"
28
+ | "inovacao"
29
+ | "patrimonio"
30
+ | "presidencia"
31
+ | "marketing"
32
+ | "gg"
33
+ | "bi"
34
+ | "financeiro"
35
+ | "juridico"
36
+ | "capacitacao"
37
+ | "produto";
38
+
39
+ const props = withDefaults(
40
+ defineProps<{
41
+ department?: AdsFarmarcasDepartment;
42
+ label?: string;
43
+ }>(),
44
+ {
45
+ department: "expansao",
46
+ label: "",
47
+ },
48
+ );
49
+
50
+ const labels: Record<AdsFarmarcasDepartment, string> = {
51
+ expansao: "Expansão",
52
+ eventos: "Eventos",
53
+ "adm-digital": "ADM digital",
54
+ sucesso: "Sucesso",
55
+ trade: "Trade",
56
+ dev: "Dev",
57
+ ti: "TI",
58
+ padronizacao: "Padronização",
59
+ diretoria: "Diretoria",
60
+ comercial: "Comercial",
61
+ inovacao: "Inovação",
62
+ patrimonio: "Patrimônio",
63
+ presidencia: "Presidência",
64
+ marketing: "Marketing",
65
+ gg: "G&G",
66
+ bi: "BI",
67
+ financeiro: "Financeiro",
68
+ juridico: "Jurídico",
69
+ capacitacao: "Capacitação",
70
+ produto: "produto",
71
+ };
72
+
73
+ const token = computed(() => props.department);
74
+ </script>