beez-ui 0.8.2 → 0.9.1
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 +29 -0
- package/README.md +12 -10
- 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 +73 -0
- package/dist/components/filter-presets-bar.js +510 -0
- package/dist/components/reaction-button.d.ts +7 -2
- package/dist/components/reaction-button.js +59 -48
- package/dist/hooks.d.ts +10 -0
- package/dist/hooks.js +10 -0
- package/dist/index.d.ts +1 -23
- package/dist/index.js +1 -23
- package/dist/styles.css +1 -1
- package/package.json +11 -126
- package/dist/components/bouncing-dots-loader.d.ts +0 -19
- package/dist/components/bouncing-dots-loader.js +0 -47
- package/dist/components/confirm-delete-button.d.ts +0 -29
- package/dist/components/confirm-delete-button.js +0 -254
- package/dist/components/empty-state.d.ts +0 -24
- package/dist/components/empty-state.js +0 -37
- package/dist/components/error-state.d.ts +0 -20
- package/dist/components/error-state.js +0 -145
- package/dist/components/external-browser-handoff.d.ts +0 -27
- package/dist/components/external-browser-handoff.js +0 -306
- package/dist/components/info-popover.d.ts +0 -23
- package/dist/components/info-popover.js +0 -158
- package/dist/components/month-calendar-header.d.ts +0 -65
- package/dist/components/month-calendar-header.js +0 -337
- package/dist/components/month-grid.d.ts +0 -59
- package/dist/components/month-grid.js +0 -301
- package/dist/components/notification-bell.d.ts +0 -50
- package/dist/components/notification-bell.js +0 -338
- package/dist/components/notification-panel.d.ts +0 -56
- package/dist/components/notification-panel.js +0 -281
- package/dist/components/open-in-browser-cta.d.ts +0 -22
- package/dist/components/open-in-browser-cta.js +0 -61
- package/dist/components/pwa-update-control.d.ts +0 -18
- package/dist/components/pwa-update-control.js +0 -119
- package/dist/emoji-picker.d.ts +0 -27
- package/dist/emoji-picker.js +0 -283
- package/dist/hooks/use-minute-clock.d.ts +0 -23
- package/dist/hooks/use-minute-clock.js +0 -147
- package/dist/hooks/use-month-transition-direction.d.ts +0 -21
- package/dist/hooks/use-month-transition-direction.js +0 -110
- package/dist/lib/browser-navigation.d.ts +0 -21
- package/dist/lib/browser-navigation.js +0 -42
- package/dist/lib/in-app-browser.d.ts +0 -35
- package/dist/lib/in-app-browser.js +0 -80
- package/dist/lib/month-grid.d.ts +0 -42
- package/dist/lib/month-grid.js +0 -74
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,35 @@ Todos los cambios relevantes de beez-ui se documentan en este archivo con el for
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.9.1] - 2026-09-27
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `FileUploadDropZone` acepta `labels.uploadActionMobileSuffix`, un texto que completa la acción de subir en pantallas chicas.
|
|
12
|
+
- `FileUploadItem` acepta `icon` para mostrar un ícono propio por tipo de archivo y `progressVariant="fill"` para indicar el progreso rellenando el fondo del ítem.
|
|
13
|
+
- `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.
|
|
14
|
+
- `FilterPresetSaveButton` acepta `className` para adaptar el botón al slot de acción de un input.
|
|
15
|
+
|
|
16
|
+
## [0.9.0] - 2026-09-27
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- `ReactionButton` acepta `activeColor` para elegir el color del ícono activo (por defecto, el color destructivo).
|
|
21
|
+
- Entrypoint `beez-ui/hooks` con los hooks de uso general: `useIsMobile`, `useIsHydrated`, `useViewerTimeZone`, `usePrefersReducedMotion`, `useHorizontalSwipe` y `resolveHorizontalSwipe`.
|
|
22
|
+
- `FilterPresetsBar` y `FilterPresetSaveButton` para guardar, aplicar, editar y borrar consultas con nombre de `FilterQueryBar`, con `parseFilterPresets` para validar las que la app restaura de su almacenamiento.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- `useIsHydrated`, `useViewerTimeZone`, `usePrefersReducedMotion`, `useHorizontalSwipe`, `resolveHorizontalSwipe` y `HORIZONTAL_SWIPE_DIRECTION` se importan desde `beez-ui/hooks` en lugar de la raíz; `useIsMobile` sigue también en la raíz.
|
|
27
|
+
|
|
28
|
+
### Removed
|
|
29
|
+
|
|
30
|
+
- Se retiran `EmptyState`, `ErrorState`, `BouncingDotsLoader` e `InfoPopover`: son envoltorios simples que cada app mantiene con su propio diseño.
|
|
31
|
+
- `getNameInitials` deja de ser público.
|
|
32
|
+
- Se retiran componentes atados a un solo producto que llegaron en 0.8.0: `ExternalBrowserHandoff`, `OpenInBrowserCta`, `detectInAppBrowser`, `buildExternalBrowserUrl`, `NotificationBell`, `NotificationPanel`, `MonthGrid`, `MonthCalendarHeader`, `PwaUpdateControl` y `ConfirmDeleteButton`. Quien los use debe mantener su propia versión.
|
|
33
|
+
- Se retiran los helpers `createMonthGridDays`, `splitCalendarWeeks`, `groupItemsByDateKey`, `shiftMonthKey`, `useMonthTransitionDirection`, `useMinuteClock`, `advanceMinuteClockTo`, `navigateToUrl`, `reloadCurrentPage`, `replaceCurrentUrlSearchParams` y `replaceCurrentUrlSearchParamValues`.
|
|
34
|
+
- Se retira el entrypoint opcional `beez-ui/emoji-picker` y la dependencia opcional `emoji-picker-react`.
|
|
35
|
+
|
|
7
36
|
## [0.8.2] - 2026-09-27
|
|
8
37
|
|
|
9
38
|
### Fixed
|
package/README.md
CHANGED
|
@@ -173,19 +173,21 @@ Los componentes compartidos conservan el tema de LaTribu. Se incorporaron atribu
|
|
|
173
173
|
|
|
174
174
|
## Componentes de producto reutilizables
|
|
175
175
|
|
|
176
|
-
Provienen de las carpetas de producto de LaTribu y agenda-mensual y quedaron desacoplados de su dominio: reciben datos ya resueltos y textos por props, con valores por defecto en español.
|
|
176
|
+
Provienen de las carpetas de producto de LaTribu y agenda-mensual y quedaron desacoplados de su dominio: reciben datos ya resueltos y textos por props, con valores por defecto en español. Solo se incorporan piezas genéricas que no fijan decisiones de un producto y que no son una composición trivial de primitivas existentes; los flujos propios de una app (notificaciones, calendarios de eventos, handoff de navegadores internos, actualización de PWA) y los envoltorios simples (estados vacío y de error, loaders, popovers de ayuda) se mantienen en esa app.
|
|
177
177
|
|
|
178
178
|
- Movimiento: `PresenceSwap`, `AnimatedCount`, `AnimatedCollapse` y `AnimatedListItem`. Los tokens que usa la biblioteca se exportan desde la raíz y desde `beez-ui/motion-tokens`, así las apps animan sus superficies con las mismas curvas y springs en lugar de copiarlos.
|
|
179
|
-
-
|
|
180
|
-
- Cuenta
|
|
179
|
+
- Indicadores: `ProgressRing` y `ReactionButton`. El color del ícono activo de la reacción se configura con `activeColor`.
|
|
180
|
+
- Cuenta: `AccountMenu`, con inicio de sesión mediante `signInHref` o `onSignIn`.
|
|
181
181
|
- 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
|
-
-
|
|
183
|
-
-
|
|
184
|
-
-
|
|
185
|
-
- PWA: `PwaUpdateControl` aparece solo cuando hay un service worker en espera y le envía `{ type: "SKIP_WAITING" }` (configurable con `skipWaitingMessage`).
|
|
186
|
-
- Hooks y utilidades: `useIsHydrated`, `useMinuteClock`, `useViewerTimeZone`, `useHorizontalSwipe`, `usePrefersReducedMotion`, `formatFileSize`, `copyTextToClipboard`, `getNameInitials`, búsqueda difusa y helpers de URL.
|
|
182
|
+
- 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. Cada ítem acepta un ícono propio y un progreso en barra (`bar`) o de relleno (`fill`).
|
|
184
|
+
- Utilidades: `formatFileSize`, `copyTextToClipboard` y búsqueda difusa.
|
|
187
185
|
|
|
188
|
-
|
|
186
|
+
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.
|
|
187
|
+
|
|
188
|
+
```tsx
|
|
189
|
+
import { useIsHydrated } from "beez-ui/hooks";
|
|
190
|
+
```
|
|
189
191
|
|
|
190
192
|
## React Compiler
|
|
191
193
|
|
|
@@ -222,7 +224,7 @@ pnpm release:prepare
|
|
|
222
224
|
|
|
223
225
|
`pnpm build` genera las declaraciones con TypeScript 7, JavaScript con Oxc/React Compiler y CSS con el CLI de Tailwind. `pnpm check` ejecuta ESLint 10, 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.
|
|
224
226
|
|
|
225
|
-
Los tests resuelven `beez-ui`, `beez-ui/next`, `beez-ui/tanstack` y `beez-ui/
|
|
227
|
+
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.
|
|
226
228
|
|
|
227
229
|
El compilador `tsc` es TypeScript 7. Para `typescript-eslint`, se mantiene 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; no reemplaza el compilador de los typechecks.
|
|
228
230
|
|
|
@@ -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.
|