ads-nuxt 0.1.5 → 0.2.0

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 (90) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +573 -577
  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 -0
  8. package/app/assets/brand/radar.svg +9 -9
  9. package/app/assets/css/ads-colors.css +257 -246
  10. package/app/assets/css/component-tokens.css +367 -403
  11. package/app/assets/css/main.css +624 -617
  12. package/app/components/AdsBadge.vue +47 -48
  13. package/app/components/AdsBroadcast.vue +24 -45
  14. package/app/components/AdsButton.vue +539 -569
  15. package/app/components/AdsButtonGroup.vue +39 -39
  16. package/app/components/AdsButtonMenu.vue +48 -48
  17. package/app/components/AdsCard.vue +188 -117
  18. package/app/components/AdsCardHint.vue +22 -0
  19. package/app/components/AdsCardPeriod.vue +43 -0
  20. package/app/components/AdsCardVariation.vue +31 -0
  21. package/app/components/AdsCharttip.vue +78 -78
  22. package/app/components/AdsCheckbox.vue +77 -77
  23. package/app/components/AdsDatePicker.vue +492 -491
  24. package/app/components/AdsDropdownMenu.vue +30 -19
  25. package/app/components/AdsEmptyState.vue +58 -58
  26. package/app/components/AdsFeatureCard.vue +210 -219
  27. package/app/components/AdsFileCard.vue +98 -101
  28. package/app/components/AdsFooter.vue +25 -25
  29. package/app/components/AdsHeavyAccountCell.vue +59 -0
  30. package/app/components/AdsHeavyHeaderCell.vue +70 -0
  31. package/app/components/AdsHeavyTable.vue +135 -0
  32. package/app/components/AdsInput.vue +147 -147
  33. package/app/components/AdsLoading.vue +217 -109
  34. package/app/components/AdsMenuBar.vue +103 -103
  35. package/app/components/AdsMetricCard.vue +216 -119
  36. package/app/components/AdsModal.vue +157 -157
  37. package/app/components/AdsMonthPicker.vue +80 -80
  38. package/app/components/AdsNavbarApp.vue +67 -67
  39. package/app/components/AdsNavbarDesk.vue +62 -62
  40. package/app/components/AdsNotabilityPill.vue +24 -27
  41. package/app/components/AdsNumberInput.vue +173 -173
  42. package/app/components/AdsPagination.vue +91 -91
  43. package/app/components/AdsPanelCard.vue +99 -0
  44. package/app/components/AdsPill.vue +144 -92
  45. package/app/components/AdsProductTag.vue +61 -61
  46. package/app/components/AdsRadio.vue +70 -70
  47. package/app/components/AdsSearchInput.vue +122 -122
  48. package/app/components/AdsSegmentedTabs.vue +62 -28
  49. package/app/components/{AdsFilterSelect.vue → AdsSelect.vue} +266 -210
  50. package/app/components/AdsSelectItem.vue +128 -0
  51. package/app/components/AdsSelectPanel.vue +150 -0
  52. package/app/components/AdsSideMenu.vue +101 -101
  53. package/app/components/AdsSmalltip.vue +44 -44
  54. package/app/components/AdsStepper.vue +222 -0
  55. package/app/components/AdsSteptip.vue +101 -101
  56. package/app/components/AdsSwitch.vue +59 -59
  57. package/app/components/AdsTable.vue +161 -100
  58. package/app/components/AdsTableHeaderCell.vue +80 -0
  59. package/app/components/AdsTableSkeleton.vue +113 -0
  60. package/app/components/AdsTableToolbar.vue +44 -44
  61. package/app/components/AdsTabs.vue +51 -51
  62. package/app/components/AdsTextarea.vue +116 -116
  63. package/app/components/AdsToast.vue +183 -181
  64. package/app/components/AdsTooltip.vue +73 -73
  65. package/app/components/OverlayLoading.vue +173 -173
  66. package/app/components/ProgressBarLoading.vue +235 -256
  67. package/app/composables/useOverlayLoading.ts +66 -66
  68. package/app/constants/ads-color-swatches.ts +240 -239
  69. package/app/locale/pt-br.ts +6 -6
  70. package/app/plugins/ads-toast.client.ts +24 -24
  71. package/app/theme/ads-theme.ts +374 -370
  72. package/app/theme/ads-tokens.ts +391 -379
  73. package/app/theme/component-tokens.json +366 -402
  74. package/app/theme/component-tokens.ts +807 -815
  75. package/app/types/overlay-loading.types.ts +26 -26
  76. package/app/utils/ads-filter-select.ts +191 -172
  77. package/app/utils/ads-table.ts +395 -204
  78. package/app/utils/calendar-date.ts +163 -163
  79. package/app/utils/category-role.ts +45 -45
  80. package/app/utils/money.ts +77 -77
  81. package/app/utils/notability.ts +8 -8
  82. package/app/utils/parser.ts +134 -134
  83. package/app/utils/percentage.ts +54 -54
  84. package/nuxt.config.ts +31 -31
  85. package/package.json +1 -1
  86. package/app/components/AdsFarmarcasPill.vue +0 -74
  87. package/app/components/AdsFilterDropdown.vue +0 -174
  88. package/app/components/AdsFilterOption.vue +0 -74
  89. package/app/components/AdsListDropdown.vue +0 -44
  90. package/app/components/AdsMiniPill.vue +0 -40
@@ -1,78 +1,78 @@
1
- <template>
2
- <DefinePanel>
3
- <div class="flex min-w-[var(--ads-charttip-min-width)] flex-col gap-4 rounded-[var(--ads-tooltip-radius)] bg-[var(--ads-tooltip-bg)] p-4 text-[var(--ads-tooltip-title)] shadow-[var(--ads-shadow-level-1)]">
4
- <p v-if="title" class="text-center text-base leading-[1.3] font-bold">{{ title }}</p>
5
- <ul class="flex flex-col gap-2">
6
- <li v-for="(row, index) in rows" :key="index" class="flex items-center gap-2 text-sm leading-[1.3]">
7
- <span class="size-[var(--ads-charttip-swatch)] shrink-0 rounded-[var(--ads-radius-xsm)]" :class="row.colorClass" :style="row.color ? { background: row.color } : undefined" />
8
- <span class="min-w-0 flex-1">{{ row.label }}</span>
9
- <span>{{ row.value }}</span>
10
- </li>
11
- </ul>
12
- </div>
13
- </DefinePanel>
14
-
15
- <UTooltip
16
- v-if="hasTrigger"
17
- :delay-duration="delayDuration"
18
- :content="{ side, align: 'center', sideOffset: 8 }"
19
- :ui="tooltipUi"
20
- >
21
- <slot />
22
- <template #content>
23
- <ReusePanel />
24
- </template>
25
- </UTooltip>
26
- <ReusePanel v-else />
27
- </template>
28
-
29
- <script setup lang="ts">
30
- import { computed, useSlots } from "vue";
31
- import { createReusableTemplate } from "@vueuse/core";
32
-
33
- export type AdsCharttipRow = {
34
- label: string;
35
- value: string;
36
- /** Classe de fundo, como `bg-ads-grafico-c1-400`. */
37
- colorClass?: string;
38
- /** Cor sem token. Preferir `colorClass`. */
39
- color?: string;
40
- };
41
-
42
- const props = withDefaults(
43
- defineProps<{
44
- title?: string;
45
- rows?: AdsCharttipRow[];
46
- /** Figma `Property 1`. Com slot, escolhe o lado em que o painel abre, como no AdsTooltip. A seta não é desenhada. */
47
- wing?: "up" | "down" | "left" | "right";
48
- delayDuration?: number;
49
- }>(),
50
- {
51
- title: "Título",
52
- rows: () => [
53
- { label: "Série 1", value: "12", colorClass: "bg-ads-grafico-c1-400" },
54
- { label: "Série 2", value: "8", colorClass: "bg-ads-innovation-500" },
55
- { label: "Série 3", value: "5", colorClass: "bg-ads-grafico-c3-400" },
56
- ],
57
- wing: "down",
58
- delayDuration: 150,
59
- },
60
- );
61
-
62
- const [DefinePanel, ReusePanel] = createReusableTemplate();
63
-
64
- const slots = useSlots();
65
- const hasTrigger = computed(() => Boolean(slots.default));
66
-
67
- const side = computed(() => {
68
- if (props.wing === "down") return "bottom" as const;
69
- if (props.wing === "left") return "left" as const;
70
- if (props.wing === "right") return "right" as const;
71
- return "top" as const;
72
- });
73
-
74
- /** O painel já tem fundo, raio e sombra: o conteúdo do UTooltip só posiciona. */
75
- const tooltipUi = {
76
- content: "z-[70] h-auto rounded-none bg-transparent p-0 shadow-none ring-0",
77
- };
78
- </script>
1
+ <template>
2
+ <DefinePanel>
3
+ <div class="flex min-w-[var(--ads-charttip-min-width)] flex-col gap-4 rounded-[var(--ads-tooltip-radius)] bg-[var(--ads-tooltip-bg)] p-4 text-[var(--ads-tooltip-title)] shadow-[var(--ads-shadow-level-1)]">
4
+ <p v-if="title" class="text-center text-base leading-[1.3] font-bold">{{ title }}</p>
5
+ <ul class="flex flex-col gap-2">
6
+ <li v-for="(row, index) in rows" :key="index" class="flex items-center gap-2 text-sm leading-[1.3]">
7
+ <span class="size-[var(--ads-charttip-swatch)] shrink-0 rounded-[var(--ads-radius-xsm)]" :class="row.colorClass" :style="row.color ? { background: row.color } : undefined" />
8
+ <span class="min-w-0 flex-1">{{ row.label }}</span>
9
+ <span>{{ row.value }}</span>
10
+ </li>
11
+ </ul>
12
+ </div>
13
+ </DefinePanel>
14
+
15
+ <UTooltip
16
+ v-if="hasTrigger"
17
+ :delay-duration="delayDuration"
18
+ :content="{ side, align: 'center', sideOffset: 8 }"
19
+ :ui="tooltipUi"
20
+ >
21
+ <slot />
22
+ <template #content>
23
+ <ReusePanel />
24
+ </template>
25
+ </UTooltip>
26
+ <ReusePanel v-else />
27
+ </template>
28
+
29
+ <script setup lang="ts">
30
+ import { computed, useSlots } from "vue";
31
+ import { createReusableTemplate } from "@vueuse/core";
32
+
33
+ export type AdsCharttipRow = {
34
+ label: string;
35
+ value: string;
36
+ /** Classe de fundo, como `bg-ads-grafico-c1-400`. */
37
+ colorClass?: string;
38
+ /** Cor sem token. Preferir `colorClass`. */
39
+ color?: string;
40
+ };
41
+
42
+ const props = withDefaults(
43
+ defineProps<{
44
+ title?: string;
45
+ rows?: AdsCharttipRow[];
46
+ /** Figma `Property 1`. Com slot, escolhe o lado em que o painel abre, como no AdsTooltip. A seta não é desenhada. */
47
+ wing?: "up" | "down" | "left" | "right";
48
+ delayDuration?: number;
49
+ }>(),
50
+ {
51
+ title: "Título",
52
+ rows: () => [
53
+ { label: "Série 1", value: "12", colorClass: "bg-ads-grafico-c1-400" },
54
+ { label: "Série 2", value: "8", colorClass: "bg-ads-innovation-500" },
55
+ { label: "Série 3", value: "5", colorClass: "bg-ads-grafico-c3-400" },
56
+ ],
57
+ wing: "down",
58
+ delayDuration: 150,
59
+ },
60
+ );
61
+
62
+ const [DefinePanel, ReusePanel] = createReusableTemplate();
63
+
64
+ const slots = useSlots();
65
+ const hasTrigger = computed(() => Boolean(slots.default));
66
+
67
+ const side = computed(() => {
68
+ if (props.wing === "down") return "bottom" as const;
69
+ if (props.wing === "left") return "left" as const;
70
+ if (props.wing === "right") return "right" as const;
71
+ return "top" as const;
72
+ });
73
+
74
+ /** O painel já tem fundo, raio e sombra: o conteúdo do UTooltip só posiciona. */
75
+ const tooltipUi = {
76
+ content: "z-[70] h-auto rounded-none bg-transparent p-0 shadow-none ring-0",
77
+ };
78
+ </script>
@@ -1,77 +1,77 @@
1
- <template>
2
- <label
3
- class="inline-flex items-center gap-[var(--ads-checkbox-gap)]"
4
- :class="isDisabled ? 'cursor-not-allowed' : 'cursor-pointer'"
5
- >
6
- <span class="relative grid size-[var(--ads-checkbox-size)] shrink-0 place-items-center">
7
- <input
8
- v-bind="attrs"
9
- type="checkbox"
10
- class="peer col-start-1 row-start-1 size-[var(--ads-checkbox-size)] appearance-none rounded-[var(--ads-checkbox-radius)] border-[length:var(--ads-checkbox-border-width)] bg-[var(--ads-checkbox-background)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ads-text-brand)] disabled:cursor-not-allowed"
11
- :class="isDisabled
12
- ? 'border-[var(--ads-checkbox-disabled)] checked:bg-[var(--ads-checkbox-disabled)] indeterminate:border-[var(--ads-checkbox-disabled)] indeterminate:bg-[var(--ads-checkbox-disabled)]'
13
- : 'border-[var(--ads-checkbox-border)] checked:border-[var(--ads-checkbox-checked)] checked:bg-[var(--ads-checkbox-checked)] indeterminate:border-[var(--ads-checkbox-checked)] indeterminate:bg-[var(--ads-checkbox-checked)]'"
14
- :checked="model"
15
- :indeterminate="showIndeterminate"
16
- :disabled="isDisabled"
17
- @change="onChange"
18
- >
19
- <img
20
- :src="checkUrl"
21
- width="12"
22
- height="12"
23
- alt=""
24
- class="pointer-events-none col-start-1 row-start-1 opacity-0 peer-checked:opacity-100 peer-indeterminate:opacity-0"
25
- >
26
- <img
27
- :src="minusUrl"
28
- width="12"
29
- height="12"
30
- alt=""
31
- class="pointer-events-none col-start-1 row-start-1 opacity-0 peer-indeterminate:opacity-100"
32
- >
33
- </span>
34
- <span
35
- v-if="hasLabel"
36
- class="text-[length:var(--ads-checkbox-label-size)] font-normal leading-[1.3]"
37
- :class="isDisabled ? 'text-[var(--ads-text-tertiary)]' : 'text-[var(--ads-checkbox-label)]'"
38
- >
39
- <slot>{{ label }}</slot>
40
- </span>
41
- </label>
42
- </template>
43
-
44
- <script setup lang="ts">
45
- import { computed, useAttrs, useSlots } from "vue";
46
- import checkUrl from "../assets/ads/checkbox-check.svg";
47
- import minusUrl from "../assets/ads/checkbox-minus.svg";
48
-
49
- defineOptions({ inheritAttrs: false });
50
-
51
- const props = withDefaults(
52
- defineProps<{
53
- label?: string;
54
- disabled?: boolean;
55
- }>(),
56
- {
57
- label: "",
58
- disabled: false,
59
- },
60
- );
61
-
62
- const model = defineModel<boolean>({ default: false });
63
- const indeterminate = defineModel<boolean>("indeterminate", { default: false });
64
- const attrs = useAttrs();
65
- const slots = useSlots();
66
-
67
- const hasLabel = computed(() => props.label.length > 0 || Boolean(slots.default));
68
- const isDisabled = computed(() => props.disabled);
69
- const showIndeterminate = computed(() => indeterminate.value && !model.value);
70
-
71
- const onChange = (event: Event) => {
72
- const input = event.target;
73
- if (!(input instanceof HTMLInputElement) || isDisabled.value) return;
74
- model.value = input.checked;
75
- indeterminate.value = false;
76
- };
77
- </script>
1
+ <template>
2
+ <label
3
+ class="inline-flex items-center gap-[var(--ads-checkbox-gap)]"
4
+ :class="isDisabled ? 'cursor-not-allowed' : 'cursor-pointer'"
5
+ >
6
+ <span class="relative grid size-[var(--ads-checkbox-size)] shrink-0 place-items-center">
7
+ <input
8
+ v-bind="attrs"
9
+ type="checkbox"
10
+ class="peer col-start-1 row-start-1 size-[var(--ads-checkbox-size)] appearance-none rounded-[var(--ads-checkbox-radius)] border-[length:var(--ads-checkbox-border-width)] bg-[var(--ads-checkbox-background)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ads-text-brand)] disabled:cursor-not-allowed"
11
+ :class="isDisabled
12
+ ? 'border-[var(--ads-checkbox-disabled)] checked:bg-[var(--ads-checkbox-disabled)] indeterminate:border-[var(--ads-checkbox-disabled)] indeterminate:bg-[var(--ads-checkbox-disabled)]'
13
+ : 'border-[var(--ads-checkbox-border)] checked:border-[var(--ads-checkbox-checked)] checked:bg-[var(--ads-checkbox-checked)] indeterminate:border-[var(--ads-checkbox-checked)] indeterminate:bg-[var(--ads-checkbox-checked)]'"
14
+ :checked="model"
15
+ :indeterminate="showIndeterminate"
16
+ :disabled="isDisabled"
17
+ @change="onChange"
18
+ >
19
+ <img
20
+ :src="checkUrl"
21
+ width="12"
22
+ height="12"
23
+ alt=""
24
+ class="pointer-events-none col-start-1 row-start-1 opacity-0 peer-checked:opacity-100 peer-indeterminate:opacity-0"
25
+ >
26
+ <img
27
+ :src="minusUrl"
28
+ width="12"
29
+ height="12"
30
+ alt=""
31
+ class="pointer-events-none col-start-1 row-start-1 opacity-0 peer-indeterminate:opacity-100"
32
+ >
33
+ </span>
34
+ <span
35
+ v-if="hasLabel"
36
+ class="text-[length:var(--ads-checkbox-label-size)] font-normal leading-[1.3]"
37
+ :class="isDisabled ? 'text-[var(--ads-text-tertiary)]' : 'text-[var(--ads-checkbox-label)]'"
38
+ >
39
+ <slot>{{ label }}</slot>
40
+ </span>
41
+ </label>
42
+ </template>
43
+
44
+ <script setup lang="ts">
45
+ import { computed, useAttrs, useSlots } from "vue";
46
+ import checkUrl from "../assets/ads/checkbox-check.svg";
47
+ import minusUrl from "../assets/ads/checkbox-minus.svg";
48
+
49
+ defineOptions({ inheritAttrs: false });
50
+
51
+ const props = withDefaults(
52
+ defineProps<{
53
+ label?: string;
54
+ disabled?: boolean;
55
+ }>(),
56
+ {
57
+ label: "",
58
+ disabled: false,
59
+ },
60
+ );
61
+
62
+ const model = defineModel<boolean>({ default: false });
63
+ const indeterminate = defineModel<boolean>("indeterminate", { default: false });
64
+ const attrs = useAttrs();
65
+ const slots = useSlots();
66
+
67
+ const hasLabel = computed(() => props.label.length > 0 || Boolean(slots.default));
68
+ const isDisabled = computed(() => props.disabled);
69
+ const showIndeterminate = computed(() => indeterminate.value && !model.value);
70
+
71
+ const onChange = (event: Event) => {
72
+ const input = event.target;
73
+ if (!(input instanceof HTMLInputElement) || isDisabled.value) return;
74
+ model.value = input.checked;
75
+ indeterminate.value = false;
76
+ };
77
+ </script>