ads-nuxt 0.1.4 → 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 -479
  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 -143
  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 -166
  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 -113
  48. package/app/components/AdsSegmentedTabs.vue +62 -28
  49. package/app/components/{AdsFilterSelect.vue → AdsSelect.vue} +266 -203
  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 -109
  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,173 +1,173 @@
1
- <template>
2
- <UModal
3
- :model-value="true"
4
- :dismissible="false"
5
- :close="isClosable ? { onClick: handleClose } : false"
6
- :ui="{
7
- overlay: 'backdrop-blur-lg',
8
- content: 'bg-transparent shadow-none ring-0',
9
- }"
10
- >
11
- <template #description>
12
- <div class="sr-only">
13
- {{ description }}
14
- </div>
15
- </template>
16
-
17
- <template #title>
18
- <div class="sr-only">
19
- {{ title }}
20
- </div>
21
- </template>
22
-
23
- <template #content>
24
- <div class="text-center">
25
- <div class="mb-4 flex justify-center">
26
- <div
27
- class="flex aspect-square h-20 items-center justify-center rounded-full"
28
- :class="iconWrapperClass"
29
- >
30
- <img :src="animationSrc" :alt="variant" class="w-full">
31
- </div>
32
- </div>
33
-
34
- <h3 class="mb-2 text-lg font-semibold" :class="titleColorClass">
35
- {{ title }}
36
- </h3>
37
-
38
- <p
39
- class="mb-4 text-sm tabular-nums"
40
- :class="descriptionColorClass"
41
- role="status"
42
- aria-live="polite"
43
- >
44
- {{ description }}
45
- </p>
46
-
47
- <UProgress
48
- v-if="showProgress"
49
- :model-value="progress"
50
- :max="100"
51
- size="sm"
52
- class="mx-auto mb-4 max-w-xs"
53
- />
54
-
55
- <p
56
- v-if="hint"
57
- class="mb-4 text-xs tabular-nums text-neutral-500"
58
- aria-live="polite"
59
- >
60
- {{ hint }}
61
- </p>
62
-
63
- <AdsButton
64
- v-if="actionLabel"
65
- leading
66
- icon="i-lucide-refresh-cw"
67
- :label="actionLabel"
68
- @click="onAction?.()"
69
- />
70
-
71
- <slot />
72
- </div>
73
- </template>
74
- </UModal>
75
- </template>
76
-
77
- <script setup lang="ts">
78
- import { computed } from "vue";
79
- import type { OverlayLoadingProps } from "../types/overlay-loading.types";
80
- import ErrorGif from "../assets/animations/Error.gif";
81
- import LoadingGif from "../assets/animations/Loading.gif";
82
- import SearchGif from "../assets/animations/Search.gif";
83
- import SuccessGif from "../assets/animations/Success.gif";
84
- import AdsButton from "./AdsButton.vue";
85
-
86
- const emit = defineEmits<{
87
- close: [];
88
- }>();
89
-
90
- const props = withDefaults(defineProps<OverlayLoadingProps>(), {
91
- title: "Carregando...",
92
- description: "Aguarde enquanto processamos as informações.",
93
- hint: "",
94
- showProgress: false,
95
- progress: 0,
96
- variant: "loading",
97
- iconSrc: "",
98
- actionLabel: "",
99
- onAction: undefined,
100
- onUserClose: undefined,
101
- closableVariants: () => ["success", "error"],
102
- });
103
-
104
- const isClosable = computed(() =>
105
- props.closableVariants.includes(
106
- props.variant as "success" | "error"
107
- )
108
- );
109
-
110
- const iconWrapperClass = computed(() => {
111
- switch (props.variant) {
112
- case "success":
113
- return "bg-success-100";
114
- case "error":
115
- return "bg-error-100";
116
- case "info":
117
- return "bg-primary-100";
118
- default:
119
- return "bg-neutral-100";
120
- }
121
- });
122
-
123
- const titleColorClass = computed(() => {
124
- switch (props.variant) {
125
- case "success":
126
- return "text-emerald-800";
127
- case "error":
128
- return "text-red-800";
129
- case "info":
130
- return "text-blue-800";
131
- default:
132
- return "text-gray-900";
133
- }
134
- });
135
-
136
- const descriptionColorClass = computed(() => {
137
- switch (props.variant) {
138
- case "success":
139
- return "text-success-700";
140
- case "error":
141
- return "text-error-700";
142
- case "info":
143
- return "text-primary-700";
144
- default:
145
- return "text-neutral-600";
146
- }
147
- });
148
-
149
- const animationSrc = computed(() => {
150
- if (props.iconSrc) {
151
- return props.iconSrc;
152
- }
153
-
154
- switch (props.variant) {
155
- case "success":
156
- return SuccessGif;
157
- case "error":
158
- return ErrorGif;
159
- case "search":
160
- return SearchGif;
161
- case "loading":
162
- case "info":
163
- default:
164
- return LoadingGif;
165
- }
166
- });
167
-
168
- const handleClose = () => {
169
- props.onUserClose?.();
170
- emit("close");
171
- };
172
- </script>
173
-
1
+ <template>
2
+ <UModal
3
+ :model-value="true"
4
+ :dismissible="false"
5
+ :close="isClosable ? { onClick: handleClose } : false"
6
+ :ui="{
7
+ overlay: 'backdrop-blur-lg',
8
+ content: 'bg-transparent shadow-none ring-0',
9
+ }"
10
+ >
11
+ <template #description>
12
+ <div class="sr-only">
13
+ {{ description }}
14
+ </div>
15
+ </template>
16
+
17
+ <template #title>
18
+ <div class="sr-only">
19
+ {{ title }}
20
+ </div>
21
+ </template>
22
+
23
+ <template #content>
24
+ <div class="text-center">
25
+ <div class="mb-4 flex justify-center">
26
+ <div
27
+ class="flex aspect-square h-20 items-center justify-center rounded-full"
28
+ :class="iconWrapperClass"
29
+ >
30
+ <img :src="animationSrc" :alt="variant" class="w-full">
31
+ </div>
32
+ </div>
33
+
34
+ <h3 class="mb-2 text-lg font-semibold" :class="titleColorClass">
35
+ {{ title }}
36
+ </h3>
37
+
38
+ <p
39
+ class="mb-4 text-sm tabular-nums"
40
+ :class="descriptionColorClass"
41
+ role="status"
42
+ aria-live="polite"
43
+ >
44
+ {{ description }}
45
+ </p>
46
+
47
+ <UProgress
48
+ v-if="showProgress"
49
+ :model-value="progress"
50
+ :max="100"
51
+ size="sm"
52
+ class="mx-auto mb-4 max-w-xs"
53
+ />
54
+
55
+ <p
56
+ v-if="hint"
57
+ class="mb-4 text-xs tabular-nums text-neutral-500"
58
+ aria-live="polite"
59
+ >
60
+ {{ hint }}
61
+ </p>
62
+
63
+ <AdsButton
64
+ v-if="actionLabel"
65
+ leading
66
+ icon="i-lucide-refresh-cw"
67
+ :label="actionLabel"
68
+ @click="onAction?.()"
69
+ />
70
+
71
+ <slot />
72
+ </div>
73
+ </template>
74
+ </UModal>
75
+ </template>
76
+
77
+ <script setup lang="ts">
78
+ import { computed } from "vue";
79
+ import type { OverlayLoadingProps } from "../types/overlay-loading.types";
80
+ import ErrorGif from "../assets/animations/Error.gif";
81
+ import LoadingGif from "../assets/animations/Loading.gif";
82
+ import SearchGif from "../assets/animations/Search.gif";
83
+ import SuccessGif from "../assets/animations/Success.gif";
84
+ import AdsButton from "./AdsButton.vue";
85
+
86
+ const emit = defineEmits<{
87
+ close: [];
88
+ }>();
89
+
90
+ const props = withDefaults(defineProps<OverlayLoadingProps>(), {
91
+ title: "Carregando...",
92
+ description: "Aguarde enquanto processamos as informações.",
93
+ hint: "",
94
+ showProgress: false,
95
+ progress: 0,
96
+ variant: "loading",
97
+ iconSrc: "",
98
+ actionLabel: "",
99
+ onAction: undefined,
100
+ onUserClose: undefined,
101
+ closableVariants: () => ["success", "error"],
102
+ });
103
+
104
+ const isClosable = computed(() =>
105
+ props.closableVariants.includes(
106
+ props.variant as "success" | "error"
107
+ )
108
+ );
109
+
110
+ const iconWrapperClass = computed(() => {
111
+ switch (props.variant) {
112
+ case "success":
113
+ return "bg-success-100";
114
+ case "error":
115
+ return "bg-error-100";
116
+ case "info":
117
+ return "bg-primary-100";
118
+ default:
119
+ return "bg-neutral-100";
120
+ }
121
+ });
122
+
123
+ const titleColorClass = computed(() => {
124
+ switch (props.variant) {
125
+ case "success":
126
+ return "text-emerald-800";
127
+ case "error":
128
+ return "text-red-800";
129
+ case "info":
130
+ return "text-blue-800";
131
+ default:
132
+ return "text-gray-900";
133
+ }
134
+ });
135
+
136
+ const descriptionColorClass = computed(() => {
137
+ switch (props.variant) {
138
+ case "success":
139
+ return "text-success-700";
140
+ case "error":
141
+ return "text-error-700";
142
+ case "info":
143
+ return "text-primary-700";
144
+ default:
145
+ return "text-neutral-600";
146
+ }
147
+ });
148
+
149
+ const animationSrc = computed(() => {
150
+ if (props.iconSrc) {
151
+ return props.iconSrc;
152
+ }
153
+
154
+ switch (props.variant) {
155
+ case "success":
156
+ return SuccessGif;
157
+ case "error":
158
+ return ErrorGif;
159
+ case "search":
160
+ return SearchGif;
161
+ case "loading":
162
+ case "info":
163
+ default:
164
+ return LoadingGif;
165
+ }
166
+ });
167
+
168
+ const handleClose = () => {
169
+ props.onUserClose?.();
170
+ emit("close");
171
+ };
172
+ </script>
173
+