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,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
+