ads-nuxt 0.1.1 → 0.1.3
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 +577 -546
- 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.svg +9 -9
- package/app/assets/css/component-tokens.css +403 -403
- package/app/assets/css/main.css +617 -617
- package/app/components/AdsBadge.vue +48 -48
- package/app/components/AdsBroadcast.vue +45 -45
- package/app/components/AdsButton.vue +569 -569
- package/app/components/AdsButtonGroup.vue +39 -39
- package/app/components/AdsButtonMenu.vue +48 -48
- package/app/components/AdsCard.vue +117 -117
- package/app/components/AdsCharttip.vue +78 -78
- package/app/components/AdsCheckbox.vue +77 -77
- package/app/components/AdsDatePicker.vue +473 -473
- package/app/components/AdsDropdownMenu.vue +19 -19
- package/app/components/AdsEmptyState.vue +58 -58
- package/app/components/AdsFarmarcasPill.vue +74 -74
- package/app/components/AdsFeatureCard.vue +217 -217
- package/app/components/AdsFileCard.vue +101 -101
- package/app/components/AdsFilterDropdown.vue +174 -174
- package/app/components/AdsFilterOption.vue +72 -72
- package/app/components/AdsFilterSelect.vue +202 -202
- package/app/components/AdsFooter.vue +25 -25
- package/app/components/AdsInput.vue +143 -143
- package/app/components/AdsListDropdown.vue +44 -44
- package/app/components/AdsLoading.vue +109 -109
- package/app/components/AdsMenuBar.vue +103 -103
- package/app/components/AdsMetricCard.vue +119 -119
- package/app/components/AdsMiniPill.vue +40 -40
- package/app/components/AdsModal.vue +157 -157
- package/app/components/AdsMonthPicker.vue +80 -80
- package/app/components/AdsNavbarApp.vue +67 -67
- package/app/components/AdsNavbarDesk.vue +62 -62
- package/app/components/AdsNotabilityPill.vue +27 -27
- package/app/components/AdsNumberInput.vue +166 -166
- package/app/components/AdsPagination.vue +91 -91
- package/app/components/AdsProductTag.vue +61 -61
- package/app/components/AdsRadio.vue +70 -70
- package/app/components/AdsSearchInput.vue +113 -113
- package/app/components/AdsSegmentedTabs.vue +28 -28
- package/app/components/AdsSideMenu.vue +101 -101
- package/app/components/AdsSmalltip.vue +44 -44
- package/app/components/AdsSteptip.vue +101 -101
- package/app/components/AdsSwitch.vue +59 -59
- package/app/components/AdsTable.vue +100 -100
- package/app/components/AdsTableToolbar.vue +44 -44
- package/app/components/AdsTabs.vue +51 -51
- package/app/components/AdsTextarea.vue +109 -109
- package/app/components/AdsToast.vue +181 -181
- package/app/components/AdsTooltip.vue +66 -66
- package/app/components/InvertedTooltip.vue +40 -40
- package/app/components/OverlayLoading.vue +173 -173
- package/app/components/ProgressBarLoading.vue +256 -256
- package/app/composables/useOverlayLoading.ts +66 -66
- package/app/locale/pt-br.ts +6 -6
- package/app/plugins/ads-toast.client.ts +24 -24
- package/app/theme/ads-theme.ts +370 -370
- package/app/theme/component-tokens.json +402 -402
- package/app/theme/component-tokens.ts +815 -815
- package/app/types/overlay-loading.types.ts +26 -26
- package/app/utils/ads-filter-select.ts +172 -172
- package/app/utils/ads-table.ts +204 -204
- package/app/utils/calendar-date.ts +128 -128
- 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 -32
- package/package.json +55 -46
|
@@ -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>
|