beez-ui 0.9.0 → 0.10.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/CHANGELOG.md +19 -0
- package/README.md +9 -5
- package/dist/components/account-menu.d.ts +10 -0
- package/dist/components/account-menu.js +139 -118
- package/dist/components/file-upload.d.ts +14 -4
- package/dist/components/file-upload.js +304 -206
- package/dist/components/filter-presets-bar.d.ts +3 -1
- package/dist/components/filter-presets-bar.js +62 -60
- package/dist/components/presence-swap.d.ts +1 -1
- package/dist/components/presence-swap.js +51 -3
- package/dist/components/sidebar.d.ts +143 -56
- package/dist/components/sidebar.js +1409 -995
- package/dist/hooks/use-sidebar-persistence.d.ts +2 -0
- package/dist/hooks/use-sidebar-persistence.js +8 -1
- package/dist/motion/glide-indicator.d.ts +0 -13
- package/dist/motion/glide-indicator.js +1 -9
- package/dist/motion/shared-layout-bg.d.ts +16 -0
- package/dist/motion/shared-layout-bg.js +181 -0
- package/dist/styles.css +1 -1
- package/package.json +4 -6
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,25 @@ Todos los cambios relevantes de beez-ui se documentan en este archivo con el for
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.10.0] - 2026-10-03
|
|
8
|
+
|
|
9
|
+
- 6769ea7 agrega funcionalidad de persistencia y animación al sidebar
|
|
10
|
+
- 3a84ef1 agrega actualización de la dependencia «beez-rp» a la versión 0.6.1
|
|
11
|
+
- 2723ab1 Bump beez-rp to 0.6.0 (#4)
|
|
12
|
+
- 811829a update «beez-rp» dependency to version 0.5.0
|
|
13
|
+
- ab5c997 build: bump beez-rp to 0.4.0
|
|
14
|
+
- d267b0b add checks configuration to prevent redundant validation before version bump
|
|
15
|
+
- 041a0f8 Migrate linting from ESLint to oxlint (#3)
|
|
16
|
+
|
|
17
|
+
## [0.9.1] - 2026-09-27
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- `FileUploadDropZone` acepta `labels.uploadActionMobileSuffix`, un texto que completa la acción de subir en pantallas chicas.
|
|
22
|
+
- `FileUploadItem` acepta `icon` para mostrar un ícono propio por tipo de archivo y `progressVariant="fill"` para indicar el progreso rellenando el fondo del ítem.
|
|
23
|
+
- `AccountMenu` acepta clases para el texto, nombre, email y chevron del disparador, el encabezado, su avatar y el ítem de sesión, por ejemplo para ocultar la identidad en un sidebar colapsado.
|
|
24
|
+
- `FilterPresetSaveButton` acepta `className` para adaptar el botón al slot de acción de un input.
|
|
25
|
+
|
|
7
26
|
## [0.9.0] - 2026-09-27
|
|
8
27
|
|
|
9
28
|
### Added
|
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ siguen los tokens de [beui motion](https://beui.dev/components/motion):
|
|
|
80
80
|
- `Dialog` y `AlertDialog` suben con spring; `Sheet` entra desde su borde con spring
|
|
81
81
|
y sale con la curva de cajón (0.24 s), sin demorar la siguiente interacción.
|
|
82
82
|
- `GlideSlot` desliza el indicador activo entre ítems como un `layoutId` compartido:
|
|
83
|
-
la pestaña activa de `Tabs` (fondo o subrayado),
|
|
83
|
+
la pestaña activa de `Tabs` (fondo o subrayado), la
|
|
84
84
|
página actual de `PaginationContent`, y al navegar con teclado el ítem resaltado de
|
|
85
85
|
`DropdownMenu` y `Select` y la sugerencia activa de `FilterQueryBar`. Con el puntero,
|
|
86
86
|
esos resaltados lo siguen al instante: el propio puntero ya marca la posición.
|
|
@@ -91,6 +91,10 @@ siguen los tokens de [beui motion](https://beui.dev/components/motion):
|
|
|
91
91
|
(grupos y columnas) giran en lugar de cambiar de ícono; CSS define el ángulo final.
|
|
92
92
|
- Las opciones del `Select` entran escalonadas con blur (las primeras 10; el resto
|
|
93
93
|
solo se desvanece) y los checks de ítems de `Select` y `DropdownMenu` aparecen con pop.
|
|
94
|
+
- `Sidebar` sigue a [beui animated sidebar](https://beui.dev/components/motion/animated-sidebar):
|
|
95
|
+
el ancho cambia con un spring entre el panel y el riel de íconos, las etiquetas se
|
|
96
|
+
desvanecen al colapsar, una píldora compartida sigue al ítem activo y al hovereado, los
|
|
97
|
+
submenús se despliegan escalonados y en pantallas chicas se abre como hoja con foco atrapado.
|
|
94
98
|
- El ícono de `AnimatedThemeToggler` cambia con blur y escala; el botón de cierre de
|
|
95
99
|
`Dialog` aparece con un pop demorado.
|
|
96
100
|
- El contenido de `Tabs` entra con un desplazamiento de 4 px y `Alert` entra con blur.
|
|
@@ -158,7 +162,7 @@ Next y TanStack Router son peers opcionales aislados en sus entrypoints. El prov
|
|
|
158
162
|
|
|
159
163
|
- Tema: `AnimatedThemeToggler` y `ThemedToaster` consumen el contexto compartido. Sus props explícitas de tema siguen disponibles para usos controlados.
|
|
160
164
|
- Navegación: `PaginationNext`, `PaginationPrevious` y `PaginationLink` usan anclas nativas. El prop opcional `component` admite el adaptador del router que elija la app. Sin proveedor usa el elemento nativo; con el proveedor de Next usa su navegación cliente.
|
|
161
|
-
- Sidebar: `defaultOpen` y el modo controlado conservan la semántica de LaTribu. `storageKey` activa opcionalmente persistencia local segura tras hidratar, sin cambiar la cookie pública `sidebar_state` ni sus siete días de duración.
|
|
165
|
+
- Sidebar: en `SidebarProvider`, `defaultOpen` y el modo controlado conservan la semántica de LaTribu. Los ítems con `href` navegan con el adaptador de router del proveedor. `storageKey` activa opcionalmente persistencia local segura tras hidratar, sin cambiar la cookie pública `sidebar_state` ni sus siete días de duración.
|
|
162
166
|
- Formularios y tablas: el consumidor provee sus datos, validaciones y callbacks. No se importan servicios, modelos de negocio ni endpoints de agenda-mensual.
|
|
163
167
|
|
|
164
168
|
## Componentes incorporados desde agenda-mensual
|
|
@@ -180,7 +184,7 @@ Provienen de las carpetas de producto de LaTribu y agenda-mensual y quedaron des
|
|
|
180
184
|
- Cuenta: `AccountMenu`, con inicio de sesión mediante `signInHref` o `onSignIn`.
|
|
181
185
|
- Contenido: `RichTextContent`, `RichMarkdownContent`, `RichLinkEditor` y `useRichLinkEditor`. Solo interpretan links en markdown, URLs sueltas, listas y negrita; el HTML del contenido nunca se renderiza como markup.
|
|
182
186
|
- Filtros guardados: `FilterPresetsBar` y `FilterPresetSaveButton` guardan, aplican, editan y borran consultas con nombre de `FilterQueryBar`. La app decide dónde persistirlas; `parseFilterPresets` valida lo que vuelve del almacenamiento.
|
|
183
|
-
- Archivos: `FileUpload`, `FileUploadDropZone`, `FileUploadList` y `FileUploadItem` validan tipo y tamaño, pero no suben archivos: el progreso y los errores los informa la app.
|
|
187
|
+
- Archivos: `FileUpload`, `FileUploadDropZone`, `FileUploadList` y `FileUploadItem` validan tipo y tamaño, pero no suben archivos: el progreso y los errores los informa la app. Cada ítem acepta un ícono propio y un progreso en barra (`bar`) o de relleno (`fill`).
|
|
184
188
|
- Utilidades: `formatFileSize`, `copyTextToClipboard` y búsqueda difusa.
|
|
185
189
|
|
|
186
190
|
Los hooks de uso general se importan desde `beez-ui/hooks`: `useIsMobile`, `useIsHydrated`, `useViewerTimeZone`, `usePrefersReducedMotion` y `useHorizontalSwipe` (con `resolveHorizontalSwipe`). `useIsMobile` también sigue disponible desde la raíz.
|
|
@@ -222,11 +226,11 @@ pnpm build
|
|
|
222
226
|
pnpm release:prepare
|
|
223
227
|
```
|
|
224
228
|
|
|
225
|
-
`pnpm build` genera las declaraciones con TypeScript 7, JavaScript con Oxc/React Compiler y CSS con el CLI de Tailwind. `pnpm check` ejecuta
|
|
229
|
+
`pnpm build` genera las declaraciones con TypeScript 7, JavaScript con Oxc/React Compiler y CSS con el CLI de Tailwind. `pnpm check` ejecuta oxlint (configurado en `.oxlintrc.json`), los typechecks separados de código y tests con TypeScript 7, y Vitest 5. `tests/tsconfig.json` incorpora los matchers de Testing Library y los tipos de Vite sin incluirlos en el código de producción. `test:browser` verifica una app React/Vite nativa y una app Next real en Chromium y WebKit, tanto en desktop como en móvil. Los tests unitarios importan los archivos compilados. Los consumidores de navegador no instalan plugins de Tailwind, y una prueba adicional sirve el tarball por HTTP sin procesadores CSS para verificar estilos computados y carga de fuentes. Una prueba adicional instala el tarball en un consumidor aislado sin Next y verifica render, filtrado y declaraciones públicas.
|
|
226
230
|
|
|
227
231
|
Los tests resuelven `beez-ui`, `beez-ui/next`, `beez-ui/tanstack` y `beez-ui/hooks` mediante rutas explícitas a las declaraciones compiladas en `tests/tsconfig.json`. Ejecutar `pnpm build` después de clonar o si falta `dist`; los comandos de validación completos ya lo hacen. Si el editor conserva diagnósticos anteriores después del build, reiniciar su servidor de TypeScript.
|
|
228
232
|
|
|
229
|
-
El compilador `tsc` es TypeScript 7.
|
|
233
|
+
El compilador `tsc` es TypeScript 7. El paquete `typescript` apunta a la [API de compatibilidad oficial de TypeScript 6](https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/#running-side-by-side-with-typescript-6.0) mediante un alias, porque el plugin de docgen de Storybook lo declara como dependencia peer; no reemplaza el compilador de los typechecks. El lint no depende de él: oxlint analiza TypeScript sin el compilador.
|
|
230
234
|
|
|
231
235
|
## Crear y publicar una versión
|
|
232
236
|
|
|
@@ -10,7 +10,17 @@ export interface AccountMenuLabels {
|
|
|
10
10
|
export interface AccountMenuClassNames {
|
|
11
11
|
trigger?: string;
|
|
12
12
|
triggerAvatar?: string;
|
|
13
|
+
/** Name and email block of the `sidebar` trigger, for example to hide it in a collapsed sidebar. */
|
|
14
|
+
triggerText?: string;
|
|
15
|
+
triggerName?: string;
|
|
16
|
+
triggerEmail?: string;
|
|
17
|
+
triggerChevron?: string;
|
|
13
18
|
content?: string;
|
|
19
|
+
/** Identity header at the top of the menu. */
|
|
20
|
+
header?: string;
|
|
21
|
+
headerAvatar?: string;
|
|
22
|
+
/** Sign-in and sign-out item. */
|
|
23
|
+
item?: string;
|
|
14
24
|
/** Badge shown while authenticated, when `showStatusBadge` is enabled. */
|
|
15
25
|
connectedBadge?: string;
|
|
16
26
|
/** Badge shown while signed out, when `showStatusBadge` is enabled. */
|
|
@@ -105,7 +105,7 @@ function AccountAvatar(t0) {
|
|
|
105
105
|
* @returns The trigger and its menu.
|
|
106
106
|
*/
|
|
107
107
|
export function AccountMenu(t0) {
|
|
108
|
-
const $ = _c(
|
|
108
|
+
const $ = _c(79);
|
|
109
109
|
const { name, email, status, image: t1, avatarFallback, onSignOut, signOutDisabled: t2, onSignIn, signInHref, triggerVariant: t3, showStatusBadge: t4, tooltipLabel, labels, classNames, align: t5, side: t6, sideOffset: t7, children } = t0;
|
|
110
110
|
const image = t1 === undefined ? null : t1;
|
|
111
111
|
const signOutDisabled = t2 === undefined ? false : t2;
|
|
@@ -184,29 +184,33 @@ export function AccountMenu(t0) {
|
|
|
184
184
|
t16 = $[17];
|
|
185
185
|
}
|
|
186
186
|
let t17;
|
|
187
|
-
if ($[18] !==
|
|
187
|
+
if ($[18] !== classNames?.triggerChevron || $[19] !== classNames?.triggerEmail || $[20] !== classNames?.triggerName || $[21] !== classNames?.triggerText || $[22] !== email || $[23] !== name || $[24] !== triggerVariant) {
|
|
188
188
|
t17 = triggerVariant === "sidebar" ? /* @__PURE__ */ _jsxs(_Fragment, { children: [/* @__PURE__ */ _jsxs("span", {
|
|
189
|
-
className: "grid min-w-0 flex-1",
|
|
189
|
+
className: cn("grid min-w-0 flex-1", classNames?.triggerText),
|
|
190
190
|
children: [/* @__PURE__ */ _jsx("span", {
|
|
191
|
-
className: "truncate text-sm font-semibold",
|
|
191
|
+
className: cn("truncate text-sm font-semibold", classNames?.triggerName),
|
|
192
192
|
children: name
|
|
193
193
|
}), /* @__PURE__ */ _jsx("span", {
|
|
194
|
-
className: "truncate text-xs text-muted-foreground",
|
|
194
|
+
className: cn("truncate text-xs text-muted-foreground", classNames?.triggerEmail),
|
|
195
195
|
children: email
|
|
196
196
|
})]
|
|
197
197
|
}), /* @__PURE__ */ _jsx(ChevronDownIcon, {
|
|
198
198
|
"aria-hidden": "true",
|
|
199
|
-
className: "size-4 shrink-0 text-muted-foreground"
|
|
199
|
+
className: cn("size-4 shrink-0 text-muted-foreground", classNames?.triggerChevron)
|
|
200
200
|
})] }) : null;
|
|
201
|
-
$[18] =
|
|
202
|
-
$[19] =
|
|
203
|
-
$[20] =
|
|
204
|
-
$[21] =
|
|
201
|
+
$[18] = classNames?.triggerChevron;
|
|
202
|
+
$[19] = classNames?.triggerEmail;
|
|
203
|
+
$[20] = classNames?.triggerName;
|
|
204
|
+
$[21] = classNames?.triggerText;
|
|
205
|
+
$[22] = email;
|
|
206
|
+
$[23] = name;
|
|
207
|
+
$[24] = triggerVariant;
|
|
208
|
+
$[25] = t17;
|
|
205
209
|
} else {
|
|
206
|
-
t17 = $[
|
|
210
|
+
t17 = $[25];
|
|
207
211
|
}
|
|
208
212
|
let t18;
|
|
209
|
-
if ($[
|
|
213
|
+
if ($[26] !== resolvedLabels.trigger || $[27] !== t14 || $[28] !== t16 || $[29] !== t17 || $[30] !== triggerVariant) {
|
|
210
214
|
const triggerButton = /* @__PURE__ */ _jsxs("button", {
|
|
211
215
|
"data-slot": "account-menu-trigger",
|
|
212
216
|
"data-variant": triggerVariant,
|
|
@@ -219,187 +223,204 @@ export function AccountMenu(t0) {
|
|
|
219
223
|
asChild: true,
|
|
220
224
|
children: triggerButton
|
|
221
225
|
});
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
226
|
+
$[26] = resolvedLabels.trigger;
|
|
227
|
+
$[27] = t14;
|
|
228
|
+
$[28] = t16;
|
|
229
|
+
$[29] = t17;
|
|
230
|
+
$[30] = triggerVariant;
|
|
231
|
+
$[31] = t18;
|
|
228
232
|
} else {
|
|
229
|
-
t18 = $[
|
|
233
|
+
t18 = $[31];
|
|
230
234
|
}
|
|
231
235
|
const trigger = t18;
|
|
232
236
|
let t19;
|
|
233
|
-
if ($[
|
|
237
|
+
if ($[32] !== tooltipLabel || $[33] !== trigger) {
|
|
234
238
|
t19 = tooltipLabel ? /* @__PURE__ */ _jsx(TooltipTrigger, {
|
|
235
239
|
asChild: true,
|
|
236
240
|
children: trigger
|
|
237
241
|
}) : trigger;
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
242
|
+
$[32] = tooltipLabel;
|
|
243
|
+
$[33] = trigger;
|
|
244
|
+
$[34] = t19;
|
|
241
245
|
} else {
|
|
242
|
-
t19 = $[
|
|
246
|
+
t19 = $[34];
|
|
243
247
|
}
|
|
244
248
|
const t20 = classNames?.content;
|
|
245
249
|
let t21;
|
|
246
|
-
if ($[
|
|
250
|
+
if ($[35] !== t20) {
|
|
247
251
|
t21 = cn("min-w-56", t20);
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
252
|
+
$[35] = t20;
|
|
253
|
+
$[36] = t21;
|
|
254
|
+
} else {
|
|
255
|
+
t21 = $[36];
|
|
256
|
+
}
|
|
257
|
+
const t22 = classNames?.header;
|
|
258
|
+
let t23;
|
|
259
|
+
if ($[37] !== t22) {
|
|
260
|
+
t23 = cn("grid grid-cols-[auto_minmax(0,1fr)] items-center gap-2.5 px-2 py-1.5", t22);
|
|
261
|
+
$[37] = t22;
|
|
262
|
+
$[38] = t23;
|
|
250
263
|
} else {
|
|
251
|
-
|
|
264
|
+
t23 = $[38];
|
|
252
265
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
266
|
+
const t24 = classNames?.headerAvatar;
|
|
267
|
+
let t25;
|
|
268
|
+
if ($[39] !== avatarProps || $[40] !== t24) {
|
|
269
|
+
t25 = /* @__PURE__ */ _jsx(AccountAvatar, {
|
|
256
270
|
...avatarProps,
|
|
257
|
-
isDecorative: true
|
|
271
|
+
isDecorative: true,
|
|
272
|
+
className: t24
|
|
258
273
|
});
|
|
259
|
-
$[
|
|
260
|
-
$[
|
|
274
|
+
$[39] = avatarProps;
|
|
275
|
+
$[40] = t24;
|
|
276
|
+
$[41] = t25;
|
|
261
277
|
} else {
|
|
262
|
-
|
|
278
|
+
t25 = $[41];
|
|
263
279
|
}
|
|
264
|
-
let
|
|
265
|
-
if ($[
|
|
266
|
-
|
|
280
|
+
let t26;
|
|
281
|
+
if ($[42] !== name) {
|
|
282
|
+
t26 = /* @__PURE__ */ _jsx("span", {
|
|
267
283
|
className: "truncate text-sm leading-tight font-semibold",
|
|
268
284
|
children: name
|
|
269
285
|
});
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
286
|
+
$[42] = name;
|
|
287
|
+
$[43] = t26;
|
|
272
288
|
} else {
|
|
273
|
-
|
|
289
|
+
t26 = $[43];
|
|
274
290
|
}
|
|
275
|
-
let
|
|
276
|
-
if ($[
|
|
277
|
-
|
|
291
|
+
let t27;
|
|
292
|
+
if ($[44] !== email) {
|
|
293
|
+
t27 = /* @__PURE__ */ _jsx("span", {
|
|
278
294
|
className: "truncate text-xs leading-tight text-muted-foreground",
|
|
279
295
|
children: email
|
|
280
296
|
});
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
297
|
+
$[44] = email;
|
|
298
|
+
$[45] = t27;
|
|
283
299
|
} else {
|
|
284
|
-
|
|
300
|
+
t27 = $[45];
|
|
285
301
|
}
|
|
286
|
-
let
|
|
287
|
-
if ($[
|
|
288
|
-
|
|
302
|
+
let t28;
|
|
303
|
+
if ($[46] !== t26 || $[47] !== t27) {
|
|
304
|
+
t28 = /* @__PURE__ */ _jsxs("span", {
|
|
289
305
|
className: "grid min-w-0 gap-px",
|
|
290
|
-
children: [
|
|
306
|
+
children: [t26, t27]
|
|
291
307
|
});
|
|
292
|
-
$[
|
|
293
|
-
$[
|
|
294
|
-
$[
|
|
308
|
+
$[46] = t26;
|
|
309
|
+
$[47] = t27;
|
|
310
|
+
$[48] = t28;
|
|
295
311
|
} else {
|
|
296
|
-
|
|
312
|
+
t28 = $[48];
|
|
297
313
|
}
|
|
298
|
-
let
|
|
299
|
-
if ($[
|
|
300
|
-
|
|
301
|
-
className:
|
|
302
|
-
children: [
|
|
314
|
+
let t29;
|
|
315
|
+
if ($[49] !== t23 || $[50] !== t25 || $[51] !== t28) {
|
|
316
|
+
t29 = /* @__PURE__ */ _jsxs("div", {
|
|
317
|
+
className: t23,
|
|
318
|
+
children: [t25, t28]
|
|
303
319
|
});
|
|
304
|
-
$[
|
|
305
|
-
$[
|
|
306
|
-
$[
|
|
320
|
+
$[49] = t23;
|
|
321
|
+
$[50] = t25;
|
|
322
|
+
$[51] = t28;
|
|
323
|
+
$[52] = t29;
|
|
307
324
|
} else {
|
|
308
|
-
|
|
325
|
+
t29 = $[52];
|
|
309
326
|
}
|
|
310
|
-
let
|
|
311
|
-
if ($[
|
|
312
|
-
|
|
313
|
-
$[
|
|
327
|
+
let t30;
|
|
328
|
+
if ($[53] === Symbol.for("react.memo_cache_sentinel")) {
|
|
329
|
+
t30 = /* @__PURE__ */ _jsx(DropdownMenuSeparator, {});
|
|
330
|
+
$[53] = t30;
|
|
314
331
|
} else {
|
|
315
|
-
|
|
332
|
+
t30 = $[53];
|
|
316
333
|
}
|
|
317
|
-
let
|
|
318
|
-
if ($[
|
|
319
|
-
|
|
334
|
+
let t31;
|
|
335
|
+
if ($[54] !== classNames?.item || $[55] !== isAuthenticated || $[56] !== onSignIn || $[57] !== onSignOut || $[58] !== resolvedLabels.signIn || $[59] !== resolvedLabels.signOut || $[60] !== signInHref || $[61] !== signOutDisabled) {
|
|
336
|
+
t31 = isAuthenticated ? /* @__PURE__ */ _jsxs(DropdownMenuItem, {
|
|
337
|
+
className: classNames?.item,
|
|
320
338
|
disabled: signOutDisabled,
|
|
321
339
|
onSelect: () => void onSignOut(),
|
|
322
340
|
children: [/* @__PURE__ */ _jsx(LogOutIcon, { "aria-hidden": "true" }), resolvedLabels.signOut]
|
|
323
341
|
}) : signInHref ? /* @__PURE__ */ _jsx(DropdownMenuItem, {
|
|
324
342
|
asChild: true,
|
|
343
|
+
className: classNames?.item,
|
|
325
344
|
children: /* @__PURE__ */ _jsxs(Link, {
|
|
326
345
|
href: signInHref,
|
|
327
346
|
children: [/* @__PURE__ */ _jsx(LogInIcon, { "aria-hidden": "true" }), resolvedLabels.signIn]
|
|
328
347
|
})
|
|
329
348
|
}) : /* @__PURE__ */ _jsxs(DropdownMenuItem, {
|
|
349
|
+
className: classNames?.item,
|
|
330
350
|
onSelect: () => onSignIn?.(),
|
|
331
351
|
children: [/* @__PURE__ */ _jsx(LogInIcon, { "aria-hidden": "true" }), resolvedLabels.signIn]
|
|
332
352
|
});
|
|
333
|
-
$[
|
|
334
|
-
$[
|
|
335
|
-
$[
|
|
336
|
-
$[
|
|
337
|
-
$[
|
|
338
|
-
$[
|
|
339
|
-
$[
|
|
340
|
-
$[
|
|
353
|
+
$[54] = classNames?.item;
|
|
354
|
+
$[55] = isAuthenticated;
|
|
355
|
+
$[56] = onSignIn;
|
|
356
|
+
$[57] = onSignOut;
|
|
357
|
+
$[58] = resolvedLabels.signIn;
|
|
358
|
+
$[59] = resolvedLabels.signOut;
|
|
359
|
+
$[60] = signInHref;
|
|
360
|
+
$[61] = signOutDisabled;
|
|
361
|
+
$[62] = t31;
|
|
341
362
|
} else {
|
|
342
|
-
|
|
363
|
+
t31 = $[62];
|
|
343
364
|
}
|
|
344
|
-
let
|
|
345
|
-
if ($[
|
|
346
|
-
|
|
365
|
+
let t32;
|
|
366
|
+
if ($[63] !== align || $[64] !== children || $[65] !== side || $[66] !== sideOffset || $[67] !== t21 || $[68] !== t29 || $[69] !== t31) {
|
|
367
|
+
t32 = /* @__PURE__ */ _jsxs(DropdownMenuContent, {
|
|
347
368
|
"data-slot": "account-menu-content",
|
|
348
369
|
align,
|
|
349
370
|
side,
|
|
350
371
|
sideOffset,
|
|
351
372
|
className: t21,
|
|
352
373
|
children: [
|
|
353
|
-
|
|
354
|
-
|
|
374
|
+
t29,
|
|
375
|
+
t30,
|
|
355
376
|
children,
|
|
356
|
-
|
|
377
|
+
t31
|
|
357
378
|
]
|
|
358
379
|
});
|
|
359
|
-
$[
|
|
360
|
-
$[
|
|
361
|
-
$[
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
364
|
-
$[
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
380
|
+
$[63] = align;
|
|
381
|
+
$[64] = children;
|
|
382
|
+
$[65] = side;
|
|
383
|
+
$[66] = sideOffset;
|
|
384
|
+
$[67] = t21;
|
|
385
|
+
$[68] = t29;
|
|
386
|
+
$[69] = t31;
|
|
387
|
+
$[70] = t32;
|
|
367
388
|
} else {
|
|
368
|
-
|
|
389
|
+
t32 = $[70];
|
|
369
390
|
}
|
|
370
|
-
let
|
|
371
|
-
if ($[
|
|
372
|
-
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
391
|
+
let t33;
|
|
392
|
+
if ($[71] !== t19 || $[72] !== t32) {
|
|
393
|
+
t33 = /* @__PURE__ */ _jsxs(DropdownMenu, { children: [t19, t32] });
|
|
394
|
+
$[71] = t19;
|
|
395
|
+
$[72] = t32;
|
|
396
|
+
$[73] = t33;
|
|
376
397
|
} else {
|
|
377
|
-
|
|
398
|
+
t33 = $[73];
|
|
378
399
|
}
|
|
379
|
-
const menu =
|
|
400
|
+
const menu = t33;
|
|
380
401
|
if (!tooltipLabel) {
|
|
381
402
|
return menu;
|
|
382
403
|
}
|
|
383
|
-
let
|
|
384
|
-
if ($[
|
|
385
|
-
|
|
404
|
+
let t34;
|
|
405
|
+
if ($[74] !== tooltipLabel) {
|
|
406
|
+
t34 = /* @__PURE__ */ _jsx(TooltipContent, {
|
|
386
407
|
side: "bottom",
|
|
387
408
|
sideOffset: 8,
|
|
388
409
|
children: tooltipLabel
|
|
389
410
|
});
|
|
390
|
-
$[
|
|
391
|
-
$[
|
|
411
|
+
$[74] = tooltipLabel;
|
|
412
|
+
$[75] = t34;
|
|
392
413
|
} else {
|
|
393
|
-
|
|
414
|
+
t34 = $[75];
|
|
394
415
|
}
|
|
395
|
-
let
|
|
396
|
-
if ($[
|
|
397
|
-
|
|
398
|
-
$[
|
|
399
|
-
$[
|
|
400
|
-
$[
|
|
416
|
+
let t35;
|
|
417
|
+
if ($[76] !== menu || $[77] !== t34) {
|
|
418
|
+
t35 = /* @__PURE__ */ _jsxs(Tooltip, { children: [menu, t34] });
|
|
419
|
+
$[76] = menu;
|
|
420
|
+
$[77] = t34;
|
|
421
|
+
$[78] = t35;
|
|
401
422
|
} else {
|
|
402
|
-
|
|
423
|
+
t35 = $[78];
|
|
403
424
|
}
|
|
404
|
-
return
|
|
425
|
+
return t35;
|
|
405
426
|
}
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
* File upload building blocks: a drop zone that validates picked or dropped files, and a list of
|
|
3
3
|
* files with upload progress, failure and retry. Uploading itself stays with the application.
|
|
4
4
|
*/
|
|
5
|
-
import { type ComponentProps } from "react";
|
|
5
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
6
6
|
export interface FileUploadDropZoneLabels {
|
|
7
7
|
uploadAction: string;
|
|
8
|
+
/** Appended to the action on narrow screens, where drag and drop is not offered. Empty by default. */
|
|
9
|
+
uploadActionMobileSuffix: string;
|
|
8
10
|
/** Shown next to the action on wide screens. */
|
|
9
11
|
dragAndDrop: string;
|
|
10
12
|
/** Accessible name of the hidden file input. */
|
|
@@ -55,15 +57,23 @@ export interface FileUploadItemProps {
|
|
|
55
57
|
onRetry?: () => void;
|
|
56
58
|
locale?: string;
|
|
57
59
|
labels?: Partial<FileUploadItemLabels>;
|
|
60
|
+
/** File illustration, such as an icon for its type. Defaults to a generic file icon. */
|
|
61
|
+
icon?: ReactNode;
|
|
62
|
+
/**
|
|
63
|
+
* `bar` shows a progress bar with the percentage under the name; `fill` tints the item
|
|
64
|
+
* background from left to right and shows the percentage next to the status.
|
|
65
|
+
*/
|
|
66
|
+
progressVariant?: FileUploadProgressVariant;
|
|
58
67
|
className?: string;
|
|
59
68
|
}
|
|
69
|
+
export type FileUploadProgressVariant = "bar" | "fill";
|
|
60
70
|
/**
|
|
61
|
-
* Renders one file with its size, status, progress bar
|
|
62
|
-
* retry action. Place it inside `FileUploadList` so additions and removals animate.
|
|
71
|
+
* Renders one file with its size, status, progress (a bar or a background fill), delete action
|
|
72
|
+
* and, after a failure, a retry action. Place it inside `FileUploadList` so additions and removals animate.
|
|
63
73
|
* @param props - File metadata, progress, callbacks and optional copy.
|
|
64
74
|
* @returns The list item.
|
|
65
75
|
*/
|
|
66
|
-
export declare function FileUploadItem({ name, size, progress, failed, onDelete, isDeleteDisabled, onRetry, locale, labels, className, }: FileUploadItemProps): import("react").JSX.Element;
|
|
76
|
+
export declare function FileUploadItem({ name, size, progress, failed, onDelete, isDeleteDisabled, onRetry, locale, labels, icon, progressVariant, className, }: FileUploadItemProps): import("react").JSX.Element;
|
|
67
77
|
/**
|
|
68
78
|
* Lays out a drop zone and its file list.
|
|
69
79
|
* @param props - Native `div` attributes.
|