beez-ui 0.9.1 → 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 +10 -0
- package/README.md +8 -4
- 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,16 @@ 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
|
+
|
|
7
17
|
## [0.9.1] - 2026-09-27
|
|
8
18
|
|
|
9
19
|
### 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
|
|
@@ -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
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Cross-fades between states of the same region, such as idle, loading and result. */
|
|
2
|
-
import type
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
3
|
declare const PRESENCE_SWAP_ELEMENTS: {
|
|
4
4
|
readonly div: import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>;
|
|
5
5
|
readonly span: import("motion/react").ForwardRefComponent<HTMLSpanElement, import("motion/react").HTMLMotionProps<"span">>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
3
|
+
/** Cross-fades between states of the same region, such as idle, loading and result. */
|
|
4
|
+
import { useState } from "react";
|
|
3
5
|
import { AnimatePresence, motion, useIsPresent } from "motion/react";
|
|
4
6
|
import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
|
|
5
7
|
import { cn } from "../lib/utils.js";
|
|
@@ -20,8 +22,12 @@ function PresenceSwapItem(t0) {
|
|
|
20
22
|
const { as, className, children } = t0;
|
|
21
23
|
const MotionElement = PRESENCE_SWAP_ELEMENTS[as];
|
|
22
24
|
const isPresent = useIsPresent();
|
|
25
|
+
const [isMountedExiting] = useState(!isPresent);
|
|
23
26
|
const shouldReduceMotion = usePrefersReducedMotion();
|
|
24
27
|
const distance = shouldReduceMotion ? 0 : MOTION_CONTENT_DISTANCE;
|
|
28
|
+
if (isMountedExiting) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
25
31
|
const t1 = isPresent ? undefined : true;
|
|
26
32
|
const t2 = !isPresent || undefined;
|
|
27
33
|
let t3;
|
|
@@ -98,6 +104,47 @@ function PresenceSwapItem(t0) {
|
|
|
98
104
|
return t8;
|
|
99
105
|
}
|
|
100
106
|
/**
|
|
107
|
+
* Gives every key change its own presence key. Motion keeps the exit bookkeeping of a key that
|
|
108
|
+
* already left, so a reused key (loading → error → loading) mounted already exiting would have
|
|
109
|
+
* its removal ignored and stall a `wait` swap forever.
|
|
110
|
+
* @param presenceKey - Key identifying the current state.
|
|
111
|
+
* @returns A key that is never reused within this swap.
|
|
112
|
+
*/
|
|
113
|
+
function usePresenceSwapKey(presenceKey) {
|
|
114
|
+
const $ = _c(5);
|
|
115
|
+
let t0;
|
|
116
|
+
if ($[0] !== presenceKey) {
|
|
117
|
+
t0 = {
|
|
118
|
+
presenceKey,
|
|
119
|
+
generation: 0
|
|
120
|
+
};
|
|
121
|
+
$[0] = presenceKey;
|
|
122
|
+
$[1] = t0;
|
|
123
|
+
} else {
|
|
124
|
+
t0 = $[1];
|
|
125
|
+
}
|
|
126
|
+
const [current, setCurrent] = useState(t0);
|
|
127
|
+
if (current.presenceKey !== presenceKey) {
|
|
128
|
+
const t1 = current.generation + 1;
|
|
129
|
+
let t2;
|
|
130
|
+
if ($[2] !== presenceKey || $[3] !== t1) {
|
|
131
|
+
t2 = {
|
|
132
|
+
presenceKey,
|
|
133
|
+
generation: t1
|
|
134
|
+
};
|
|
135
|
+
$[2] = presenceKey;
|
|
136
|
+
$[3] = t1;
|
|
137
|
+
$[4] = t2;
|
|
138
|
+
} else {
|
|
139
|
+
t2 = $[4];
|
|
140
|
+
}
|
|
141
|
+
const next = t2;
|
|
142
|
+
setCurrent(next);
|
|
143
|
+
return `${next.generation}:${presenceKey}`;
|
|
144
|
+
}
|
|
145
|
+
return `${current.generation}:${presenceKey}`;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
101
148
|
* Swaps keyed content with a short lift-and-fade; the first render is not animated.
|
|
102
149
|
* @param props - Key identifying the current state and its content.
|
|
103
150
|
* @returns The animated content.
|
|
@@ -107,6 +154,7 @@ export function PresenceSwap(t0) {
|
|
|
107
154
|
const { presenceKey, children, as: t1, className, mode: t2 } = t0;
|
|
108
155
|
const as = t1 === undefined ? "div" : t1;
|
|
109
156
|
const mode = t2 === undefined ? "wait" : t2;
|
|
157
|
+
const itemKey = usePresenceSwapKey(presenceKey);
|
|
110
158
|
const t3 = as === "span" && "inline-flex items-center";
|
|
111
159
|
let t4;
|
|
112
160
|
if ($[0] !== className || $[1] !== t3) {
|
|
@@ -118,15 +166,15 @@ export function PresenceSwap(t0) {
|
|
|
118
166
|
t4 = $[2];
|
|
119
167
|
}
|
|
120
168
|
let t5;
|
|
121
|
-
if ($[3] !== as || $[4] !== children || $[5] !==
|
|
169
|
+
if ($[3] !== as || $[4] !== children || $[5] !== itemKey || $[6] !== t4) {
|
|
122
170
|
t5 = /* @__PURE__ */ _jsx(PresenceSwapItem, {
|
|
123
171
|
as,
|
|
124
172
|
className: t4,
|
|
125
173
|
children
|
|
126
|
-
},
|
|
174
|
+
}, itemKey);
|
|
127
175
|
$[3] = as;
|
|
128
176
|
$[4] = children;
|
|
129
|
-
$[5] =
|
|
177
|
+
$[5] = itemKey;
|
|
130
178
|
$[6] = t4;
|
|
131
179
|
$[7] = t5;
|
|
132
180
|
} else {
|
|
@@ -1,71 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Animated application sidebar adapted from beui.dev/components/motion/animated-sidebar: the rail
|
|
3
|
+
* morphs its width with a spring, labels fade out of the icon rail, a shared pill follows the
|
|
4
|
+
* hovered and active items, submenus unfold with a stagger, and small screens get a focus-trapped
|
|
5
|
+
* sheet. Links route through the `BeezUIProvider` adapter and the open state keeps the
|
|
6
|
+
* `sidebar_state` cookie contract read by server entrypoints.
|
|
7
|
+
*/
|
|
1
8
|
import * as React from "react";
|
|
2
|
-
import { type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
+
import { type HTMLMotionProps } from "motion/react";
|
|
10
|
+
type SidebarState = "expanded" | "collapsed";
|
|
11
|
+
type SidebarSide = "left" | "right";
|
|
12
|
+
type SidebarVariant = "sidebar" | "floating" | "inset";
|
|
13
|
+
type SidebarCollapsible = "offcanvas" | "icon" | "none";
|
|
14
|
+
type SidebarLinkTarget = "_blank" | "_self" | "_parent" | "_top";
|
|
15
|
+
type SidebarContextValue = {
|
|
16
|
+
isMobile: boolean;
|
|
17
|
+
layoutId: string;
|
|
18
|
+
/** Sheet width; the sheet is portaled outside the wrapper that declares the CSS variables. */
|
|
19
|
+
mobileWidth: string;
|
|
9
20
|
open: boolean;
|
|
10
|
-
setOpen: (open: boolean) => void;
|
|
11
21
|
openMobile: boolean;
|
|
22
|
+
reduce: boolean;
|
|
23
|
+
setOpen: (open: boolean) => void;
|
|
12
24
|
setOpenMobile: (open: boolean) => void;
|
|
13
|
-
|
|
25
|
+
state: SidebarState;
|
|
14
26
|
toggleSidebar: () => void;
|
|
27
|
+
triggerRef: React.RefObject<HTMLButtonElement | null>;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Reads the sidebar state shared by `SidebarProvider`.
|
|
31
|
+
* @returns Open state for desktop and mobile, viewport and motion flags, and state setters.
|
|
32
|
+
*/
|
|
33
|
+
declare function useSidebar(): SidebarContextValue;
|
|
34
|
+
type SidebarProviderStyle = React.CSSProperties & {
|
|
35
|
+
"--sidebar-width"?: string;
|
|
36
|
+
"--sidebar-width-icon"?: string;
|
|
37
|
+
"--sidebar-width-mobile"?: string;
|
|
15
38
|
};
|
|
16
|
-
|
|
17
|
-
|
|
39
|
+
export type SidebarProviderProps = React.ComponentProps<"div"> & {
|
|
40
|
+
/** Controlled desktop state. */
|
|
41
|
+
open?: boolean;
|
|
42
|
+
/** Desktop state before any interaction; server entrypoints pass the `sidebar_state` cookie here. */
|
|
18
43
|
defaultOpen?: boolean;
|
|
44
|
+
onOpenChange?: (open: boolean) => void;
|
|
45
|
+
/** Controlled state of the small-screen sheet. */
|
|
46
|
+
openMobile?: boolean;
|
|
47
|
+
defaultOpenMobile?: boolean;
|
|
48
|
+
onOpenMobileChange?: (open: boolean) => void;
|
|
19
49
|
/** Opts into local persistence without changing the shared SSR cookie contract. */
|
|
20
50
|
storageKey?: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}): React.JSX.Element;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
51
|
+
style?: SidebarProviderStyle;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Owns the open state of the sidebar, the ⌘B / Ctrl+B shortcut and the layout wrapper.
|
|
55
|
+
* @param props - Controlled or default state for both viewports, persistence key and wrapper attributes.
|
|
56
|
+
* @returns The wrapper that lays out the sidebar next to its inset.
|
|
57
|
+
*/
|
|
58
|
+
declare function SidebarProvider({ children, open: openProp, defaultOpen, onOpenChange, openMobile: openMobileProp, defaultOpenMobile, onOpenMobileChange, storageKey, className, style, ...props }: SidebarProviderProps): React.JSX.Element;
|
|
59
|
+
export type SidebarProps = Omit<HTMLMotionProps<"aside">, "children"> & {
|
|
60
|
+
children?: React.ReactNode;
|
|
61
|
+
side?: SidebarSide;
|
|
62
|
+
variant?: SidebarVariant;
|
|
63
|
+
/** `icon` shrinks to an icon rail, `offcanvas` slides away, `none` stays expanded on every viewport. */
|
|
64
|
+
collapsible?: SidebarCollapsible;
|
|
65
|
+
ariaLabel?: string;
|
|
66
|
+
/** Classes of the inner panel that paints the sidebar surface. */
|
|
67
|
+
panelClassName?: string;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Renders the sidebar: a width-morphing rail on desktop and a sheet on small screens.
|
|
71
|
+
* @param props - Side, variant, collapse mode, accessible name and panel classes.
|
|
72
|
+
* @returns The desktop rail, the mobile sheet portal, or an always-expanded panel.
|
|
73
|
+
*/
|
|
74
|
+
declare function Sidebar({ side, variant, collapsible, ariaLabel, children, className, panelClassName, style, ...props }: SidebarProps): React.JSX.Element;
|
|
75
|
+
/**
|
|
76
|
+
* Button that toggles the desktop rail or the mobile sheet; shows a panel icon unless given children.
|
|
77
|
+
* @param props - Native button attributes.
|
|
78
|
+
* @returns The toggle button.
|
|
79
|
+
*/
|
|
80
|
+
declare function SidebarTrigger({ children, className, onClick, ref, type, ...props }: React.ComponentProps<"button">): React.JSX.Element;
|
|
81
|
+
/**
|
|
82
|
+
* Button that closes the sidebar on the current viewport.
|
|
83
|
+
* @param props - Native button attributes; the content is the consumer's icon or text.
|
|
84
|
+
* @returns The close button.
|
|
85
|
+
*/
|
|
86
|
+
declare function SidebarClose({ className, onClick, type, ...props }: React.ComponentProps<"button">): React.JSX.Element;
|
|
87
|
+
/**
|
|
88
|
+
* Thin hit area on the sidebar edge that toggles it with the pointer.
|
|
89
|
+
* @param props - Native button attributes.
|
|
90
|
+
* @returns The rail button, outside the tab order.
|
|
91
|
+
*/
|
|
92
|
+
declare function SidebarRail({ className, onClick, type, ...props }: React.ComponentProps<"button">): React.JSX.Element;
|
|
93
|
+
/**
|
|
94
|
+
* Main content area laid out next to the sidebar.
|
|
95
|
+
* @param props - Motion-enabled `main` attributes.
|
|
96
|
+
* @returns The content landmark.
|
|
97
|
+
*/
|
|
98
|
+
declare function SidebarInset({ className, ...props }: HTMLMotionProps<"main">): React.JSX.Element;
|
|
33
99
|
declare function SidebarHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
34
|
-
declare function SidebarFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
35
|
-
declare function SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): React.JSX.Element;
|
|
36
100
|
declare function SidebarContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
101
|
+
declare function SidebarFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
37
102
|
declare function SidebarGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}): React.JSX.Element;
|
|
41
|
-
declare function SidebarGroupAction({ className, asChild, ...props }: React.ComponentProps<"button"> & {
|
|
42
|
-
asChild?: boolean;
|
|
43
|
-
}): React.JSX.Element;
|
|
103
|
+
/** Section heading that fades out of the icon rail and is hidden from assistive technology there. */
|
|
104
|
+
declare function SidebarGroupLabel({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
44
105
|
declare function SidebarGroupContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
106
|
+
/** Menu list whose items share a hover pill that glides between them. */
|
|
45
107
|
declare function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
|
|
46
|
-
declare function SidebarMenuItem({ className, ...props }:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
declare function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
|
|
65
|
-
declare function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
66
|
-
declare function SidebarMenuSubButton({ asChild, size, isActive, className, ...props }: React.ComponentProps<"a"> & {
|
|
67
|
-
asChild?: boolean;
|
|
68
|
-
size?: "sm" | "md";
|
|
108
|
+
declare function SidebarMenuItem({ className, ...props }: HTMLMotionProps<"li">): React.JSX.Element;
|
|
109
|
+
export type SidebarMenuSubProps = Omit<HTMLMotionProps<"ul">, "children"> & {
|
|
110
|
+
/** Whether the submenu is unfolded; it never renders inside the icon rail. */
|
|
111
|
+
open: boolean;
|
|
112
|
+
children?: React.ReactNode;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Nested list that unfolds with a clip and staggered items.
|
|
116
|
+
* @param props - Open state and motion-enabled list attributes.
|
|
117
|
+
* @returns The submenu while open and the sidebar is expanded.
|
|
118
|
+
*/
|
|
119
|
+
declare function SidebarMenuSub({ open, children, className, ...props }: SidebarMenuSubProps): React.JSX.Element;
|
|
120
|
+
declare function SidebarMenuSubItem({ className, ...props }: HTMLMotionProps<"li">): React.JSX.Element;
|
|
121
|
+
type SidebarActionProps = {
|
|
122
|
+
children: React.ReactNode;
|
|
123
|
+
icon?: React.ReactNode;
|
|
124
|
+
/** Renders a link through the `BeezUIProvider` routing adapter instead of a button. */
|
|
125
|
+
href?: string;
|
|
69
126
|
isActive?: boolean;
|
|
70
|
-
|
|
71
|
-
|
|
127
|
+
disabled?: boolean;
|
|
128
|
+
target?: SidebarLinkTarget;
|
|
129
|
+
rel?: string;
|
|
130
|
+
onSelect?: () => void;
|
|
131
|
+
className?: string;
|
|
132
|
+
};
|
|
133
|
+
export type SidebarMenuSubButtonProps = SidebarActionProps & {
|
|
134
|
+
/** Closes the mobile sheet after selecting; on by default. */
|
|
135
|
+
closeOnSelect?: boolean;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Submenu entry; shows a dot when no icon is given.
|
|
139
|
+
* @param props - Label, icon, link or select handler, active and disabled state.
|
|
140
|
+
* @returns The submenu link or button.
|
|
141
|
+
*/
|
|
142
|
+
declare function SidebarMenuSubButton({ children, icon, href, isActive, disabled, closeOnSelect, target, rel, onSelect, className, }: SidebarMenuSubButtonProps): React.JSX.Element;
|
|
143
|
+
export type SidebarMenuButtonProps = SidebarActionProps & {
|
|
144
|
+
/** Trailing content such as a counter, hidden in the icon rail. */
|
|
145
|
+
badge?: React.ReactNode;
|
|
146
|
+
/** Marks the button as a submenu toggle and shows a rotating chevron. */
|
|
147
|
+
ariaExpanded?: boolean;
|
|
148
|
+
/** Closes the mobile sheet after selecting; defaults to on, except for submenu toggles. */
|
|
149
|
+
closeOnSelect?: boolean;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Top-level menu entry: the active one carries a pill that glides between entries, and the label
|
|
153
|
+
* fades out of the icon rail, leaving a string label as accessible name and native tooltip.
|
|
154
|
+
* @param props - Label, icon, badge, link or select handler, submenu and active state.
|
|
155
|
+
* @returns The menu link or button.
|
|
156
|
+
*/
|
|
157
|
+
declare function SidebarMenuButton({ children, icon, badge, href, isActive, ariaExpanded, disabled, closeOnSelect, target, rel, onSelect, className, }: SidebarMenuButtonProps): React.JSX.Element;
|
|
158
|
+
export { Sidebar, SidebarClose, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarTrigger, useSidebar, };
|