ads-nuxt 0.2.0 → 0.4.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.
- package/README.md +6 -4
- package/app/assets/css/component-tokens.css +369 -367
- package/app/assets/css/main.css +26 -65
- package/app/components/AdsBadge.vue +3 -3
- package/app/components/AdsBroadcast.vue +1 -1
- package/app/components/AdsButton.vue +13 -5
- package/app/components/AdsButtonMenu.vue +2 -2
- package/app/components/AdsCharttip.vue +3 -2
- package/app/components/AdsCheckbox.vue +77 -77
- package/app/components/AdsDatePicker.vue +23 -6
- package/app/components/AdsEmptyState.vue +6 -3
- package/app/components/AdsHeavyTable.vue +4 -0
- package/app/components/AdsInput.vue +3 -2
- package/app/components/AdsMenuBar.vue +8 -1
- package/app/components/AdsMetricCard.vue +1 -1
- package/app/components/AdsModal.vue +7 -4
- package/app/components/AdsNavbarApp.vue +1 -1
- package/app/components/AdsNavbarDesk.vue +14 -9
- package/app/components/AdsNumberInput.vue +8 -8
- package/app/components/AdsPagination.vue +91 -91
- package/app/components/AdsPill.vue +1 -1
- package/app/components/AdsProductTag.vue +21 -2
- package/app/components/AdsRadio.vue +70 -70
- package/app/components/AdsSearchInput.vue +2 -2
- package/app/components/AdsSelect.vue +18 -1
- package/app/components/AdsSelectPanel.vue +103 -32
- package/app/components/AdsSteptip.vue +104 -101
- package/app/components/AdsSwitch.vue +59 -59
- package/app/components/AdsTable.vue +16 -1
- package/app/components/AdsTextarea.vue +2 -2
- package/app/components/AdsToast.vue +6 -5
- package/app/components/AdsTooltip.vue +2 -2
- package/app/components/OverlayLoading.vue +313 -173
- package/app/composables/useOverlayLoading.ts +31 -9
- package/app/theme/ads-theme.ts +1 -1
- package/app/theme/component-tokens.json +368 -366
- package/app/theme/component-tokens.ts +809 -807
- package/app/types/overlay-loading.types.ts +11 -2
- package/app/utils/ads-table.ts +3 -0
- package/package.json +56 -55
- package/app/assets/animations/Error.gif +0 -0
- package/app/assets/animations/Loading.gif +0 -0
- package/app/assets/animations/Search.gif +0 -0
- package/app/assets/animations/Success.gif +0 -0
|
@@ -1,173 +1,313 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<UModal
|
|
3
|
-
:model-value="true"
|
|
4
|
-
:dismissible="false"
|
|
5
|
-
:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
class="mb-4 text-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<UModal
|
|
3
|
+
:model-value="true"
|
|
4
|
+
:dismissible="false"
|
|
5
|
+
:ui="{
|
|
6
|
+
overlay: 'backdrop-blur-lg',
|
|
7
|
+
content: 'bg-transparent shadow-none ring-0',
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<template #description>
|
|
11
|
+
<div class="sr-only">
|
|
12
|
+
{{ description }}
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<template #title>
|
|
17
|
+
<div class="sr-only">
|
|
18
|
+
{{ title }}
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<template #content>
|
|
23
|
+
<div class="relative px-10 pt-2 text-center">
|
|
24
|
+
<!-- O slot #content substitui o cabeçalho do UModal, então o X fica aqui. -->
|
|
25
|
+
<button
|
|
26
|
+
v-if="isClosable"
|
|
27
|
+
type="button"
|
|
28
|
+
class="absolute top-0 right-0 flex size-8 items-center justify-center rounded-[var(--ads-radius-xsm)] text-[var(--ads-text-secondary)] hover:bg-black/5 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ads-text-brand)]"
|
|
29
|
+
aria-label="Fechar"
|
|
30
|
+
@click="handleClose"
|
|
31
|
+
>
|
|
32
|
+
<UIcon name="i-lucide-x" class="size-5" />
|
|
33
|
+
</button>
|
|
34
|
+
<div class="mb-4 flex justify-center">
|
|
35
|
+
<div
|
|
36
|
+
class="flex aspect-square h-20 items-center justify-center rounded-full"
|
|
37
|
+
:class="feedback.surface"
|
|
38
|
+
>
|
|
39
|
+
<img v-if="iconSrc" :src="iconSrc" alt="" class="w-full">
|
|
40
|
+
<UIcon
|
|
41
|
+
v-else
|
|
42
|
+
:key="variant"
|
|
43
|
+
:name="feedback.icon"
|
|
44
|
+
mode="svg"
|
|
45
|
+
class="ads-overlay-icon size-10"
|
|
46
|
+
:class="[feedback.color, feedback.animation]"
|
|
47
|
+
aria-hidden="true"
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<h3 class="mb-2 text-lg leading-[1.3] font-bold" :class="feedback.title">
|
|
53
|
+
{{ title }}
|
|
54
|
+
</h3>
|
|
55
|
+
|
|
56
|
+
<p
|
|
57
|
+
class="mb-4 text-sm leading-[1.3] tabular-nums"
|
|
58
|
+
:class="feedback.description"
|
|
59
|
+
role="status"
|
|
60
|
+
aria-live="polite"
|
|
61
|
+
>
|
|
62
|
+
{{ description }}
|
|
63
|
+
</p>
|
|
64
|
+
|
|
65
|
+
<UProgress
|
|
66
|
+
v-if="showProgress"
|
|
67
|
+
:model-value="progress"
|
|
68
|
+
:max="100"
|
|
69
|
+
size="sm"
|
|
70
|
+
class="mx-auto mb-4 max-w-xs"
|
|
71
|
+
/>
|
|
72
|
+
|
|
73
|
+
<p
|
|
74
|
+
v-if="hint"
|
|
75
|
+
class="mb-4 text-xs tabular-nums text-[var(--ads-text-tertiary)]"
|
|
76
|
+
aria-live="polite"
|
|
77
|
+
>
|
|
78
|
+
{{ hint }}
|
|
79
|
+
</p>
|
|
80
|
+
|
|
81
|
+
<div
|
|
82
|
+
v-if="actionLabel || secondaryActionLabel"
|
|
83
|
+
class="flex flex-wrap items-center justify-center gap-2"
|
|
84
|
+
>
|
|
85
|
+
<AdsButton
|
|
86
|
+
v-if="actionLabel"
|
|
87
|
+
:leading="Boolean(resolvedActionIcon)"
|
|
88
|
+
:icon="resolvedActionIcon"
|
|
89
|
+
:label="actionLabel"
|
|
90
|
+
@click="onAction?.()"
|
|
91
|
+
/>
|
|
92
|
+
<AdsButton
|
|
93
|
+
v-if="secondaryActionLabel"
|
|
94
|
+
type="unfilled"
|
|
95
|
+
:leading="Boolean(secondaryActionIcon)"
|
|
96
|
+
:icon="secondaryActionIcon"
|
|
97
|
+
:label="secondaryActionLabel"
|
|
98
|
+
@click="onSecondaryClick"
|
|
99
|
+
/>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<slot />
|
|
103
|
+
</div>
|
|
104
|
+
</template>
|
|
105
|
+
</UModal>
|
|
106
|
+
</template>
|
|
107
|
+
|
|
108
|
+
<script setup lang="ts">
|
|
109
|
+
import { computed } from "vue";
|
|
110
|
+
import type { OverlayLoadingProps, OverlayVariant } from "../types/overlay-loading.types";
|
|
111
|
+
import AdsButton from "./AdsButton.vue";
|
|
112
|
+
|
|
113
|
+
const emit = defineEmits<{
|
|
114
|
+
close: [];
|
|
115
|
+
}>();
|
|
116
|
+
|
|
117
|
+
const props = withDefaults(defineProps<OverlayLoadingProps>(), {
|
|
118
|
+
title: "Carregando...",
|
|
119
|
+
description: "Aguarde enquanto processamos as informações.",
|
|
120
|
+
hint: "",
|
|
121
|
+
showProgress: false,
|
|
122
|
+
progress: 0,
|
|
123
|
+
variant: "loading",
|
|
124
|
+
iconSrc: "",
|
|
125
|
+
actionLabel: "",
|
|
126
|
+
actionIcon: undefined,
|
|
127
|
+
onAction: undefined,
|
|
128
|
+
secondaryActionLabel: "",
|
|
129
|
+
secondaryActionIcon: undefined,
|
|
130
|
+
onSecondaryAction: undefined,
|
|
131
|
+
onUserClose: undefined,
|
|
132
|
+
closableVariants: () => ["info", "success", "error", "warning"],
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
const isClosable = computed(() =>
|
|
136
|
+
(props.closableVariants as OverlayVariant[]).includes(props.variant),
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
type Feedback = {
|
|
140
|
+
icon: string;
|
|
141
|
+
animation: string;
|
|
142
|
+
surface: string;
|
|
143
|
+
color: string;
|
|
144
|
+
title: string;
|
|
145
|
+
description: string;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const neutralText = {
|
|
149
|
+
title: "text-[var(--ads-text-primary)]",
|
|
150
|
+
description: "text-[var(--ads-text-secondary)]",
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Cada estado usa um ícone Lucide em SVG inline (o traço pode ser animado) e as cores de status do ADS.
|
|
155
|
+
* - loading: loader-circle girando.
|
|
156
|
+
* - search: lupa percorrendo um pequeno círculo.
|
|
157
|
+
* - info: info pulsando.
|
|
158
|
+
* - success: traço desenhado e um pulo no fim.
|
|
159
|
+
* - error (status/warning, vermelho): traço desenhado e tremida.
|
|
160
|
+
* - warning (status/attention, amarelo): triângulo desenhado e balanço.
|
|
161
|
+
* Com movimento reduzido no sistema, os ícones aparecem parados.
|
|
162
|
+
*/
|
|
163
|
+
const feedbacks: Record<OverlayVariant, Feedback> = {
|
|
164
|
+
loading: {
|
|
165
|
+
icon: "i-lucide-loader-circle",
|
|
166
|
+
animation: "ads-overlay-icon--loading",
|
|
167
|
+
surface: "bg-ads-radar-25",
|
|
168
|
+
color: "text-[var(--ads-text-brand)]",
|
|
169
|
+
...neutralText,
|
|
170
|
+
},
|
|
171
|
+
search: {
|
|
172
|
+
icon: "i-lucide-search",
|
|
173
|
+
animation: "ads-overlay-icon--search",
|
|
174
|
+
surface: "bg-ads-radar-25",
|
|
175
|
+
color: "text-[var(--ads-text-brand)]",
|
|
176
|
+
...neutralText,
|
|
177
|
+
},
|
|
178
|
+
info: {
|
|
179
|
+
icon: "i-lucide-info",
|
|
180
|
+
animation: "ads-overlay-icon--info",
|
|
181
|
+
surface: "bg-ads-radar-25",
|
|
182
|
+
color: "text-[var(--ads-text-brand)]",
|
|
183
|
+
...neutralText,
|
|
184
|
+
},
|
|
185
|
+
success: {
|
|
186
|
+
icon: "i-lucide-circle-check",
|
|
187
|
+
animation: "ads-overlay-icon--draw ads-overlay-icon--success",
|
|
188
|
+
surface: "bg-ads-status-success-100",
|
|
189
|
+
color: "text-ads-status-success-700",
|
|
190
|
+
title: "text-ads-status-success-800",
|
|
191
|
+
description: "text-ads-status-success-700",
|
|
192
|
+
},
|
|
193
|
+
error: {
|
|
194
|
+
icon: "i-lucide-circle-x",
|
|
195
|
+
animation: "ads-overlay-icon--draw ads-overlay-icon--error",
|
|
196
|
+
surface: "bg-ads-status-warning-100",
|
|
197
|
+
color: "text-ads-status-warning-700",
|
|
198
|
+
title: "text-ads-status-warning-800",
|
|
199
|
+
description: "text-ads-status-warning-700",
|
|
200
|
+
},
|
|
201
|
+
warning: {
|
|
202
|
+
icon: "i-lucide-triangle-alert",
|
|
203
|
+
animation: "ads-overlay-icon--draw ads-overlay-icon--warning",
|
|
204
|
+
surface: "bg-ads-status-attention-100",
|
|
205
|
+
color: "text-ads-status-attention-700",
|
|
206
|
+
title: "text-ads-status-attention-800",
|
|
207
|
+
description: "text-ads-status-attention-700",
|
|
208
|
+
},
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
const feedback = computed(() => feedbacks[props.variant] ?? feedbacks.loading);
|
|
212
|
+
|
|
213
|
+
/** Sem actionIcon, só o erro ganha o ícone de tentar de novo. */
|
|
214
|
+
const resolvedActionIcon = computed(() =>
|
|
215
|
+
props.actionIcon ?? (props.variant === "error" ? "i-lucide-refresh-cw" : undefined),
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
const handleClose = () => {
|
|
219
|
+
props.onUserClose?.();
|
|
220
|
+
emit("close");
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
/** Sem onSecondaryAction, a ação secundária fecha o overlay (ex.: "Fechar" ao lado de "Tentar novamente"). */
|
|
224
|
+
const onSecondaryClick = () => {
|
|
225
|
+
if (props.onSecondaryAction) props.onSecondaryAction();
|
|
226
|
+
else handleClose();
|
|
227
|
+
};
|
|
228
|
+
</script>
|
|
229
|
+
|
|
230
|
+
<style>
|
|
231
|
+
.ads-overlay-icon--loading {
|
|
232
|
+
animation: ads-overlay-spin 0.9s linear infinite;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.ads-overlay-icon--search {
|
|
236
|
+
animation: ads-overlay-search 1.6s ease-in-out infinite;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.ads-overlay-icon--info {
|
|
240
|
+
animation: ads-overlay-pulse 1.6s ease-in-out infinite;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.ads-overlay-icon--success {
|
|
244
|
+
animation: ads-overlay-pop 0.45s ease-out 0.75s both;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.ads-overlay-icon--error {
|
|
248
|
+
animation: ads-overlay-shake 0.45s ease-in-out 0.75s both;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.ads-overlay-icon--warning {
|
|
252
|
+
transform-origin: 50% 85%;
|
|
253
|
+
animation: ads-overlay-swing 0.7s ease-in-out 0.75s both;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.ads-overlay-icon--draw :is(path, circle, line, polyline) {
|
|
257
|
+
stroke-dasharray: 80;
|
|
258
|
+
stroke-dashoffset: 80;
|
|
259
|
+
animation: ads-overlay-draw 0.5s ease-out forwards;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.ads-overlay-icon--draw :is(path, circle, line, polyline):not(:first-child) {
|
|
263
|
+
animation-delay: 0.35s;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
@keyframes ads-overlay-spin {
|
|
267
|
+
to { transform: rotate(360deg); }
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
@keyframes ads-overlay-search {
|
|
271
|
+
0%, 100% { transform: translate(-3px, 0); }
|
|
272
|
+
25% { transform: translate(0, -3px); }
|
|
273
|
+
50% { transform: translate(3px, 0); }
|
|
274
|
+
75% { transform: translate(0, 3px); }
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
@keyframes ads-overlay-pulse {
|
|
278
|
+
0%, 100% { transform: scale(1); opacity: 1; }
|
|
279
|
+
50% { transform: scale(1.1); opacity: 0.75; }
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
@keyframes ads-overlay-draw {
|
|
283
|
+
to { stroke-dashoffset: 0; }
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
@keyframes ads-overlay-pop {
|
|
287
|
+
0% { transform: scale(1); }
|
|
288
|
+
50% { transform: scale(1.15); }
|
|
289
|
+
100% { transform: scale(1); }
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
@keyframes ads-overlay-shake {
|
|
293
|
+
0%, 100% { transform: translateX(0); }
|
|
294
|
+
20%, 60% { transform: translateX(-3px); }
|
|
295
|
+
40%, 80% { transform: translateX(3px); }
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
@keyframes ads-overlay-swing {
|
|
299
|
+
0%, 100% { transform: rotate(0); }
|
|
300
|
+
20% { transform: rotate(-10deg); }
|
|
301
|
+
40% { transform: rotate(8deg); }
|
|
302
|
+
60% { transform: rotate(-5deg); }
|
|
303
|
+
80% { transform: rotate(3deg); }
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
@media (prefers-reduced-motion: reduce) {
|
|
307
|
+
.ads-overlay-icon,
|
|
308
|
+
.ads-overlay-icon * {
|
|
309
|
+
animation: none !important;
|
|
310
|
+
stroke-dashoffset: 0 !important;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
</style>
|
|
@@ -12,27 +12,46 @@ export const useOverlayLoading = () => {
|
|
|
12
12
|
close: () => void;
|
|
13
13
|
patch: (props: Record<string, unknown>) => void;
|
|
14
14
|
} | null = null;
|
|
15
|
+
/**
|
|
16
|
+
* O overlay é destruído ao fechar (destroyOnClose). Fechar pelo X ou pela ação emite `close`
|
|
17
|
+
* direto no useOverlay, sem passar por aqui; chamar close/patch depois disso lança
|
|
18
|
+
* "Overlay not found". Por isso a referência é limpa quando o overlay fecha, por qualquer caminho.
|
|
19
|
+
*/
|
|
20
|
+
const safely = (action: () => void) => {
|
|
21
|
+
try {
|
|
22
|
+
action();
|
|
23
|
+
} catch {
|
|
24
|
+
currentOverlay = null;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
15
28
|
const show = (options: OverlayLoadingOptions) => {
|
|
16
29
|
if (currentOverlay) {
|
|
17
|
-
currentOverlay
|
|
30
|
+
const previous = currentOverlay;
|
|
31
|
+
safely(() => previous.close());
|
|
18
32
|
}
|
|
19
|
-
|
|
33
|
+
const created = overlay.create(OverlayLoadingComponent, {
|
|
20
34
|
destroyOnClose: true,
|
|
21
35
|
props: {
|
|
22
36
|
isVisible: true,
|
|
23
37
|
...options,
|
|
24
38
|
},
|
|
25
39
|
});
|
|
40
|
+
currentOverlay = created;
|
|
26
41
|
|
|
27
|
-
|
|
42
|
+
const opened = created.open();
|
|
43
|
+
void Promise.resolve(opened).then(() => {
|
|
44
|
+
if (currentOverlay?.id === created.id) currentOverlay = null;
|
|
45
|
+
});
|
|
28
46
|
|
|
29
|
-
return
|
|
47
|
+
return created.id;
|
|
30
48
|
};
|
|
31
49
|
|
|
32
50
|
const close = () => {
|
|
33
51
|
if (currentOverlay) {
|
|
34
|
-
currentOverlay
|
|
52
|
+
const target = currentOverlay;
|
|
35
53
|
currentOverlay = null;
|
|
54
|
+
safely(() => target.close());
|
|
36
55
|
}
|
|
37
56
|
};
|
|
38
57
|
|
|
@@ -42,10 +61,13 @@ export const useOverlayLoading = () => {
|
|
|
42
61
|
*/
|
|
43
62
|
const update = (options: Partial<OverlayLoadingOptions>) => {
|
|
44
63
|
if (currentOverlay) {
|
|
45
|
-
currentOverlay
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
64
|
+
const target = currentOverlay;
|
|
65
|
+
safely(() =>
|
|
66
|
+
target.patch({
|
|
67
|
+
isVisible: true,
|
|
68
|
+
...options,
|
|
69
|
+
}),
|
|
70
|
+
);
|
|
49
71
|
}
|
|
50
72
|
};
|
|
51
73
|
|
package/app/theme/ads-theme.ts
CHANGED
|
@@ -225,7 +225,7 @@ export const adsDropdownMenuUi = {
|
|
|
225
225
|
"!min-w-56 !bg-[var(--ads-surface-card)] !shadow-[var(--ads-shadow-level-1)] !ring-0 !rounded-[var(--ads-radius-sm)] border border-[var(--ads-border-subtle)]",
|
|
226
226
|
viewport: "!divide-y-0",
|
|
227
227
|
group: "!p-0",
|
|
228
|
-
item: "!items-center !gap-
|
|
228
|
+
item: "!items-center !gap-3 !rounded-none !p-[var(--ads-select-item-padding)] !text-sm !font-normal !text-[var(--ads-text-secondary)] border-b border-[var(--ads-select-panel-border)] last:border-b-0 before:!hidden data-highlighted:!bg-[var(--ads-select-item-hover)]",
|
|
229
229
|
itemLeadingIcon: "!size-4 !text-[var(--ads-text-secondary)]",
|
|
230
230
|
itemLabel: "!truncate !text-sm !font-normal !text-[var(--ads-text-secondary)]",
|
|
231
231
|
} as const;
|