@justanarthur/modo-ui 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/LICENSE.beui +21 -0
- package/LICENSE.fluid-functionalism +21 -0
- package/LICENSE.motion-primitives +21 -0
- package/LICENSE.sileo +21 -0
- package/README.md +608 -2
- package/dist/base.css +994 -0
- package/dist/blocks/sidebar-app/index.d.ts +34 -0
- package/dist/blocks/sidebar-app/index.js +31 -0
- package/dist/components/badge/index.d.ts +59 -0
- package/dist/components/badge/index.js +16 -0
- package/dist/components/button/index.d.ts +59 -0
- package/dist/components/button/index.js +14 -0
- package/dist/components/card/index.d.ts +141 -0
- package/dist/components/card/index.js +42 -0
- package/dist/components/inputs/checkbox-group/index.d.ts +50 -0
- package/dist/components/inputs/checkbox-group/index.js +21 -0
- package/dist/components/inputs/color-picker/index.d.ts +137 -0
- package/dist/components/inputs/color-picker/index.js +35 -0
- package/dist/components/inputs/combobox/index.d.ts +161 -0
- package/dist/components/inputs/combobox/index.js +38 -0
- package/dist/components/inputs/date-time/calendar/index.d.ts +45 -0
- package/dist/components/inputs/date-time/calendar/index.js +18 -0
- package/dist/components/inputs/date-time/date-picker/index.d.ts +82 -0
- package/dist/components/inputs/date-time/date-picker/index.js +32 -0
- package/dist/components/inputs/date-time/date-range-picker/index.d.ts +64 -0
- package/dist/components/inputs/date-time/date-range-picker/index.js +31 -0
- package/dist/components/inputs/date-time/duration-picker/index.d.ts +57 -0
- package/dist/components/inputs/date-time/duration-picker/index.js +31 -0
- package/dist/components/inputs/date-time/month-picker/index.d.ts +57 -0
- package/dist/components/inputs/date-time/month-picker/index.js +30 -0
- package/dist/components/inputs/date-time/time-picker/index.d.ts +59 -0
- package/dist/components/inputs/date-time/time-picker/index.js +31 -0
- package/dist/components/inputs/input/index.d.ts +84 -0
- package/dist/components/inputs/input/index.js +19 -0
- package/dist/components/inputs/input-copy/index.d.ts +44 -0
- package/dist/components/inputs/input-copy/index.js +16 -0
- package/dist/components/inputs/input-message/index.d.ts +125 -0
- package/dist/components/inputs/input-message/index.js +25 -0
- package/dist/components/inputs/radio-group/index.d.ts +58 -0
- package/dist/components/inputs/radio-group/index.js +20 -0
- package/dist/components/inputs/search/index.d.ts +83 -0
- package/dist/components/inputs/search/index.js +25 -0
- package/dist/components/inputs/select/index.d.ts +105 -0
- package/dist/components/inputs/select/index.js +34 -0
- package/dist/components/inputs/slider/index.d.ts +108 -0
- package/dist/components/inputs/slider/index.js +14 -0
- package/dist/components/inputs/switch/index.d.ts +43 -0
- package/dist/components/inputs/switch/index.js +14 -0
- package/dist/components/navigation/accordion/index.d.ts +117 -0
- package/dist/components/navigation/accordion/index.js +28 -0
- package/dist/components/navigation/sidebar/index.d.ts +388 -0
- package/dist/components/navigation/sidebar/index.js +99 -0
- package/dist/components/navigation/tabs/index.d.ts +70 -0
- package/dist/components/navigation/tabs/index.js +23 -0
- package/dist/components/navigation/tabs-subtle/index.d.ts +73 -0
- package/dist/components/navigation/tabs-subtle/index.js +21 -0
- package/dist/components/overlays/alert-dialog/index.d.ts +67 -0
- package/dist/components/overlays/alert-dialog/index.js +22 -0
- package/dist/components/overlays/command/index.d.ts +121 -0
- package/dist/components/overlays/command/index.js +36 -0
- package/dist/components/overlays/context-menu/index.d.ts +97 -0
- package/dist/components/overlays/context-menu/index.js +29 -0
- package/dist/components/overlays/dialog/index.d.ts +130 -0
- package/dist/components/overlays/dialog/index.js +37 -0
- package/dist/components/overlays/dropdown/index.d.ts +222 -0
- package/dist/components/overlays/dropdown/index.js +44 -0
- package/dist/components/overlays/popover/index.d.ts +87 -0
- package/dist/components/overlays/popover/index.js +26 -0
- package/dist/components/overlays/preview-card/index.d.ts +75 -0
- package/dist/components/overlays/preview-card/index.js +19 -0
- package/dist/components/overlays/sheet/index.d.ts +67 -0
- package/dist/components/overlays/sheet/index.js +24 -0
- package/dist/components/overlays/toast/index.d.ts +107 -0
- package/dist/components/overlays/toast/index.js +21 -0
- package/dist/components/overlays/tooltip/index.d.ts +75 -0
- package/dist/components/overlays/tooltip/index.js +17 -0
- package/dist/components/table/index.d.ts +44 -0
- package/dist/components/table/index.js +26 -0
- package/dist/components/thinking-indicator/index.d.ts +32 -0
- package/dist/components/thinking-indicator/index.js +13 -0
- package/dist/index.d.ts +3926 -0
- package/dist/index.js +511 -0
- package/dist/preset.d.ts +104 -0
- package/dist/preset.js +124 -0
- package/dist/primitives/code/index.d.ts +23 -0
- package/dist/primitives/code/index.js +11 -0
- package/dist/primitives/craft/index.d.ts +31 -0
- package/dist/primitives/craft/index.js +11 -0
- package/dist/primitives/fluid-hover/index.d.ts +233 -0
- package/dist/primitives/fluid-hover/index.js +25 -0
- package/dist/primitives/morph/index.d.ts +127 -0
- package/dist/primitives/morph/index.js +19 -0
- package/dist/primitives/motion/index.d.ts +115 -0
- package/dist/primitives/motion/index.js +19 -0
- package/dist/primitives/scroll-area/index.d.ts +41 -0
- package/dist/primitives/scroll-area/index.js +12 -0
- package/dist/primitives/sizes/index.d.ts +128 -0
- package/dist/primitives/sizes/index.js +21 -0
- package/dist/primitives/surface/index.d.ts +69 -0
- package/dist/primitives/surface/index.js +17 -0
- package/dist/shared/components-0ke6xada.js +123 -0
- package/dist/shared/components-0q0sqfh4.js +146 -0
- package/dist/shared/components-0sn7ypjw.js +61 -0
- package/dist/shared/components-1j9791sn.js +345 -0
- package/dist/shared/components-1rfwbyyc.js +361 -0
- package/dist/shared/components-1v7rxytx.js +30 -0
- package/dist/shared/components-1xekx2hx.js +215 -0
- package/dist/shared/components-39jq9va1.js +86 -0
- package/dist/shared/components-3gae8nta.js +719 -0
- package/dist/shared/components-3k8xpnpq.js +1759 -0
- package/dist/shared/components-3ky44908.js +9 -0
- package/dist/shared/components-3mkepka5.js +111 -0
- package/dist/shared/components-3wk0w46f.js +667 -0
- package/dist/shared/components-4cnjmgex.js +124 -0
- package/dist/shared/components-59efxjd9.js +298 -0
- package/dist/shared/components-5xc2j8jz.js +159 -0
- package/dist/shared/components-62ybc7t2.js +496 -0
- package/dist/shared/components-66mv71kx.js +262 -0
- package/dist/shared/components-7ans7ce5.js +120 -0
- package/dist/shared/components-7btqt08d.js +270 -0
- package/dist/shared/components-7r3etddy.js +171 -0
- package/dist/shared/components-7x9kawxv.js +152 -0
- package/dist/shared/components-8fpr3s4p.js +292 -0
- package/dist/shared/components-9jvzzvt1.js +198 -0
- package/dist/shared/components-apdwtweq.js +484 -0
- package/dist/shared/components-asr5pg50.js +191 -0
- package/dist/shared/components-b2wyq2cq.js +232 -0
- package/dist/shared/components-c6s6b43g.js +15 -0
- package/dist/shared/components-ca2c898n.js +1828 -0
- package/dist/shared/components-cbxjn9p8.js +141 -0
- package/dist/shared/components-chacnk61.js +216 -0
- package/dist/shared/components-cv16mryv.js +62 -0
- package/dist/shared/components-ez65vtbq.js +110 -0
- package/dist/shared/components-ezxhrmer.js +17 -0
- package/dist/shared/components-gc5vtq2f.js +149 -0
- package/dist/shared/components-gf5s6ap9.js +42 -0
- package/dist/shared/components-gvr9w41t.js +193 -0
- package/dist/shared/components-h2dpcwgc.js +137 -0
- package/dist/shared/components-hawvy2qz.js +105 -0
- package/dist/shared/components-hqeq3w9q.js +375 -0
- package/dist/shared/components-jjw69c4c.js +28 -0
- package/dist/shared/components-jwst3vtj.js +346 -0
- package/dist/shared/components-kvr7f9hy.js +45 -0
- package/dist/shared/components-men63rwj.js +9 -0
- package/dist/shared/components-mhd39z7x.js +22 -0
- package/dist/shared/components-n7mjr357.js +26 -0
- package/dist/shared/components-ng72k97e.js +128 -0
- package/dist/shared/components-nh8tma1n.js +986 -0
- package/dist/shared/components-njzgqdwy.js +445 -0
- package/dist/shared/components-ny774h8p.js +293 -0
- package/dist/shared/components-q4daerx0.js +58 -0
- package/dist/shared/components-q5xj5c16.js +79 -0
- package/dist/shared/components-rr7a6ja9.js +160 -0
- package/dist/shared/components-s2bz1xpk.js +63 -0
- package/dist/shared/components-tqvarbfv.js +288 -0
- package/dist/shared/components-v6xp325t.js +304 -0
- package/dist/shared/components-v7wtz8hk.js +144 -0
- package/dist/shared/components-vc7vq5nz.js +32 -0
- package/dist/shared/components-vfbhxf5r.js +58 -0
- package/dist/shared/components-vynjtrk6.js +19 -0
- package/dist/shared/components-wvp1m52g.js +1200 -0
- package/dist/shared/components-yh3kwdhr.js +981 -0
- package/dist/shared/components-ytb2tefr.js +291 -0
- package/dist/shared/components-zfnmn5d4.js +220 -0
- package/dist/shared/components-zrkzcayz.js +141 -0
- package/dist/shared/components-zx6b6yby.js +42 -0
- package/dist/styles.css +1949 -0
- package/dist/tailwind.css +219 -0
- package/dist/tokens.css +345 -0
- package/package.json +103 -4
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, HTMLAttributes as HTMLAttributes3, ReactNode as ReactNode4, RefAttributes } from "react";
|
|
2
|
+
import { HTMLAttributes, MutableRefObject, ReactElement } from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import { ButtonHTMLAttributes, ReactNode as ReactNode2 } from "react";
|
|
5
|
+
import { ComponentType } from "react";
|
|
6
|
+
interface IconComponentProps {
|
|
7
|
+
size?: number | string;
|
|
8
|
+
strokeWidth?: number | string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
type IconComponent = ComponentType<IconComponentProps>;
|
|
12
|
+
import { ClassProp as ClassProp_wz9o0r } from "class-variance-authority/types";
|
|
13
|
+
declare const buttonVariants: (props?: ({
|
|
14
|
+
variant?: "primary" | "secondary" | "tertiary" | "ghost" | null | undefined;
|
|
15
|
+
size?: "default" | "compact" | "icon" | "icon-compact" | null | undefined;
|
|
16
|
+
iconLeft?: boolean | null | undefined;
|
|
17
|
+
iconRight?: boolean | null | undefined;
|
|
18
|
+
} & ClassProp_wz9o0r) | undefined) => string;
|
|
19
|
+
type ButtonSizeCanonical = "default" | "compact" | "icon" | "icon-compact";
|
|
20
|
+
/** Public size values: the canonical two-size scale plus the pre-sizes-system
|
|
21
|
+
* aliases, kept so existing call sites keep compiling. Aliases resolve onto
|
|
22
|
+
* the canonical ladder (sm → compact; md/lg → default). */
|
|
23
|
+
type ButtonSize = ButtonSizeCanonical | "sm" | "md" | "lg" | "icon-sm" | "icon-lg";
|
|
24
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, Omit<VariantProps<typeof buttonVariants>, "size"> {
|
|
25
|
+
/** Visual style of the button. Defaults to `"primary"`. */
|
|
26
|
+
variant?: "primary" | "secondary" | "tertiary" | "ghost";
|
|
27
|
+
/** Step on the size ladder (36px default, 28px compact — see Sizes): `"default"` | `"compact"` | `"icon"` | `"icon-compact"`. Omitted, the button follows the surrounding SizeProvider. Legacy sm/md/lg values resolve as aliases (sm → compact; md/lg → default; icon-sm → icon-compact; icon-lg → icon). */
|
|
28
|
+
size?: ButtonSize;
|
|
29
|
+
/** Merge props onto the child element instead of rendering a `<button>` — the single React-element child becomes the rendered element (slot-style). Defaults to `false`. */
|
|
30
|
+
asChild?: boolean;
|
|
31
|
+
/** Folds the button into a circle around a spinner and disables it; the button keeps its box, so nothing around it moves. Defaults to `false`. */
|
|
32
|
+
loading?: boolean;
|
|
33
|
+
/** Icon displayed before the label. */
|
|
34
|
+
leadingIcon?: IconComponent;
|
|
35
|
+
/** Icon displayed after the label. */
|
|
36
|
+
trailingIcon?: IconComponent;
|
|
37
|
+
/** Forces the pressed/held visual — e.g. while a dropdown or popover the button opened is showing. Defaults to `false`. */
|
|
38
|
+
active?: boolean;
|
|
39
|
+
/** Disables the button. Defaults to `false`. */
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
/** The label. With `size="icon"` / `"icon-compact"`, the icon itself (give the button an `aria-label`). */
|
|
42
|
+
children?: ReactNode2;
|
|
43
|
+
}
|
|
44
|
+
import { ForwardRefExoticComponent as ForwardRefExoticComponent_tcubfn2 } from "react";
|
|
45
|
+
import { RefAttributes as RefAttributes_miuf562 } from "react";
|
|
46
|
+
declare const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
47
|
+
declare const SIDEBAR_COOKIE_MAX_AGE: number;
|
|
48
|
+
declare const SIDEBAR_WIDTH = "16rem";
|
|
49
|
+
declare const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
50
|
+
/** Bare-key toggle defaults: "[" for a left sidebar, "]" for a right one.
|
|
51
|
+
* Bare (no ⌘/Ctrl) so the browser's history shortcuts stay untouched. */
|
|
52
|
+
declare const SIDEBAR_KEYBOARD_SHORTCUT = "[";
|
|
53
|
+
declare const SIDEBAR_KEYBOARD_SHORTCUT_RIGHT = "]";
|
|
54
|
+
/** Drag-resize clamp for the built-in rail handle (px). */
|
|
55
|
+
declare const SIDEBAR_MIN_WIDTH = 160;
|
|
56
|
+
declare const SIDEBAR_MAX_WIDTH = 360;
|
|
57
|
+
type SidebarSide = "left" | "right";
|
|
58
|
+
type SidebarVariant = "sidebar" | "floating" | "inset";
|
|
59
|
+
type SidebarCollapsible = "offcanvas" | "none";
|
|
60
|
+
interface SidebarContextValue {
|
|
61
|
+
/** What shows: expanded while kept open or open on hover. */
|
|
62
|
+
state: "expanded" | "collapsed";
|
|
63
|
+
/** Kept open. */
|
|
64
|
+
open: boolean;
|
|
65
|
+
setOpen: (open: boolean | ((prev: boolean) => boolean)) => void;
|
|
66
|
+
openMobile: boolean;
|
|
67
|
+
setOpenMobile: React.Dispatch<React.SetStateAction<boolean>>;
|
|
68
|
+
isMobile: boolean;
|
|
69
|
+
toggleSidebar: () => void;
|
|
70
|
+
/** Live rail width — the rail's drag-resize updates it. */
|
|
71
|
+
width: string;
|
|
72
|
+
setWidth: (width: string) => void;
|
|
73
|
+
widthMobile: string;
|
|
74
|
+
mobileBreakpoint: number;
|
|
75
|
+
/** Which edge the rendered Sidebar sits on (registered by <Sidebar/>). */
|
|
76
|
+
side: SidebarSide;
|
|
77
|
+
/** Internal: <Sidebar/> reports its side so the provider can resolve the
|
|
78
|
+
* default shortcut and the rail can mirror. */
|
|
79
|
+
registerSide: (side: SidebarSide) => void;
|
|
80
|
+
/** The resolved toggle key ("[" / "]" / custom / null when disabled). */
|
|
81
|
+
shortcut: string | null;
|
|
82
|
+
/** The collapsed sidebar opens on hover (see the provider's prop). */
|
|
83
|
+
openOnHover: boolean;
|
|
84
|
+
/** True while the collapsed sidebar is open on hover. */
|
|
85
|
+
hoverOpen: boolean;
|
|
86
|
+
setHoverOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
87
|
+
/** Internal: the shell and the triggers register their nodes; the hover
|
|
88
|
+
* zone is measured off them. */
|
|
89
|
+
shellRef: MutableRefObject<HTMLElement | null>;
|
|
90
|
+
registerTrigger: (node: HTMLElement) => () => void;
|
|
91
|
+
/** Internal: true while the rail is being drag-resized (disables the
|
|
92
|
+
* width spring so the panel tracks the pointer 1:1). */
|
|
93
|
+
isResizing: boolean;
|
|
94
|
+
setIsResizing: React.Dispatch<React.SetStateAction<boolean>>;
|
|
95
|
+
}
|
|
96
|
+
declare function useSidebar(): SidebarContextValue;
|
|
97
|
+
interface SidebarProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
98
|
+
defaultOpen?: boolean;
|
|
99
|
+
open?: boolean;
|
|
100
|
+
onOpenChange?: (open: boolean) => void;
|
|
101
|
+
/** Persist the desktop open state to the `sidebar_state` cookie so a server
|
|
102
|
+
* layout can read it back into `defaultOpen`. Mobile state never persists. */
|
|
103
|
+
persist?: boolean;
|
|
104
|
+
/** Bare-key toggle shortcut. Defaults to "[" for a left sidebar and "]"
|
|
105
|
+
* for a right one; `null` disables it. */
|
|
106
|
+
shortcut?: string | null;
|
|
107
|
+
/** Viewport width (px) below which the sidebar renders as a drawer. */
|
|
108
|
+
mobileBreakpoint?: number;
|
|
109
|
+
/** While collapsed, open the sidebar when the pointer reaches its edge or
|
|
110
|
+
* the trigger beside it, and close it a beat after the pointer leaves.
|
|
111
|
+
* `open` then says whether it is kept open, and the trigger switches
|
|
112
|
+
* between the two. Hovering never writes the cookie. @default false */
|
|
113
|
+
openOnHover?: boolean;
|
|
114
|
+
width?: string;
|
|
115
|
+
widthMobile?: string;
|
|
116
|
+
}
|
|
117
|
+
declare const SidebarProvider: ForwardRefExoticComponent_tcubfn2<SidebarProviderProps & RefAttributes_miuf562<HTMLDivElement>>;
|
|
118
|
+
type SidebarTriggerProps = ButtonProps;
|
|
119
|
+
/** Ghost icon button calling toggleSidebar(). The icon mirrors the
|
|
120
|
+
* sidebar's side, and its tooltip names the action with the toggle
|
|
121
|
+
* keystroke by default. With `openOnHover` it switches between open and on
|
|
122
|
+
* hover (a dashed glyph), and the hover zone reaches its far side when it
|
|
123
|
+
* sits beside the sidebar's edge. */
|
|
124
|
+
declare const SidebarTrigger: ForwardRefExoticComponent_tcubfn2<ButtonProps & RefAttributes_miuf562<HTMLButtonElement>>;
|
|
125
|
+
interface SidebarRailProps extends HTMLAttributes<HTMLButtonElement> {
|
|
126
|
+
/** Pin the tooltip open/closed; `undefined` leaves it on hover. */
|
|
127
|
+
tooltipOpen?: boolean;
|
|
128
|
+
}
|
|
129
|
+
/** The grab strip on the sidebar's inner edge, rendered by default inside
|
|
130
|
+
* the desktop shell: drag it to resize (clamped), click it to collapse, and
|
|
131
|
+
* its tooltip explains both with the toggle keystroke. Hovering it
|
|
132
|
+
* brightens the edge border. */
|
|
133
|
+
declare const SidebarRail: ForwardRefExoticComponent_tcubfn2<SidebarRailProps & RefAttributes_miuf562<HTMLButtonElement>>;
|
|
134
|
+
type SidebarInsetProps = HTMLAttributes<HTMLElement>;
|
|
135
|
+
declare const SidebarInset: ForwardRefExoticComponent_tcubfn2<SidebarInsetProps & RefAttributes_miuf562<HTMLElement>>;
|
|
136
|
+
type SidebarInputProps = React.InputHTMLAttributes<HTMLInputElement>;
|
|
137
|
+
declare const SidebarInput: ForwardRefExoticComponent_tcubfn2<SidebarInputProps & RefAttributes_miuf562<HTMLInputElement>>;
|
|
138
|
+
type SidebarSectionProps = HTMLAttributes<HTMLDivElement>;
|
|
139
|
+
declare const SidebarHeader: ForwardRefExoticComponent_tcubfn2<SidebarSectionProps & RefAttributes_miuf562<HTMLDivElement>>;
|
|
140
|
+
declare const SidebarFooter: ForwardRefExoticComponent_tcubfn2<SidebarSectionProps & RefAttributes_miuf562<HTMLDivElement>>;
|
|
141
|
+
declare const SidebarSeparator: ForwardRefExoticComponent_tcubfn2<SidebarSectionProps & RefAttributes_miuf562<HTMLDivElement>>;
|
|
142
|
+
interface SidebarGroupProps extends SidebarSectionProps {
|
|
143
|
+
/** Makes the group's SidebarGroupLabel a toggle that collapses everything
|
|
144
|
+
* rendered after it — a group-level accordion. Uncontrolled by default;
|
|
145
|
+
* pass `open`/`onOpenChange` to control it. */
|
|
146
|
+
collapsible?: boolean;
|
|
147
|
+
open?: boolean;
|
|
148
|
+
defaultOpen?: boolean;
|
|
149
|
+
onOpenChange?: (open: boolean) => void;
|
|
150
|
+
}
|
|
151
|
+
declare const SidebarGroup: ForwardRefExoticComponent_tcubfn2<SidebarGroupProps & RefAttributes_miuf562<HTMLDivElement>>;
|
|
152
|
+
interface SidebarGroupLabelProps extends HTMLAttributes<HTMLDivElement> {
|
|
153
|
+
render?: ReactElement;
|
|
154
|
+
asChild?: boolean;
|
|
155
|
+
}
|
|
156
|
+
declare const SidebarGroupLabel: ForwardRefExoticComponent_tcubfn2<SidebarGroupLabelProps & RefAttributes_miuf562<HTMLDivElement>>;
|
|
157
|
+
interface SidebarGroupActionProps extends HTMLAttributes<HTMLButtonElement> {
|
|
158
|
+
render?: ReactElement;
|
|
159
|
+
asChild?: boolean;
|
|
160
|
+
}
|
|
161
|
+
declare const SidebarGroupAction: ForwardRefExoticComponent_tcubfn2<SidebarGroupActionProps & RefAttributes_miuf562<HTMLButtonElement>>;
|
|
162
|
+
/** Header action cluster: 1–3 SidebarGroupActions laid out in a row over the
|
|
163
|
+
* group label's right edge. Use instead of a lone SidebarGroupAction when a
|
|
164
|
+
* section needs several controls. */
|
|
165
|
+
type SidebarGroupActionsProps = HTMLAttributes<HTMLDivElement>;
|
|
166
|
+
declare const SidebarGroupActions: ForwardRefExoticComponent_tcubfn2<SidebarGroupActionsProps & RefAttributes_miuf562<HTMLDivElement>>;
|
|
167
|
+
declare const SidebarGroupContent: ForwardRefExoticComponent_tcubfn2<SidebarSectionProps & RefAttributes_miuf562<HTMLDivElement>>;
|
|
168
|
+
import { VariantProps as VariantProps2 } from "class-variance-authority";
|
|
169
|
+
import { AnchorHTMLAttributes, ButtonHTMLAttributes as ButtonHTMLAttributes2, HTMLAttributes as HTMLAttributes2, LiHTMLAttributes, ReactElement as ReactElement2 } from "react";
|
|
170
|
+
type SizeVariant = "default" | "compact";
|
|
171
|
+
import { Context as Context_rri5bl2 } from "react";
|
|
172
|
+
import { ForwardRefExoticComponent as ForwardRefExoticComponent_tcubfn3 } from "react";
|
|
173
|
+
import { RefAttributes as RefAttributes_miuf563 } from "react";
|
|
174
|
+
import { ClassProp as ClassProp_wz9o0r2 } from "class-variance-authority/types";
|
|
175
|
+
/** The selection a `Sidebar` holds for buttons that carry a `value`. */
|
|
176
|
+
interface SidebarSelectionValue {
|
|
177
|
+
value: string | undefined;
|
|
178
|
+
select: (value: string) => void;
|
|
179
|
+
}
|
|
180
|
+
declare const SidebarSelection: Context_rri5bl2<SidebarSelectionValue | null>;
|
|
181
|
+
interface SidebarMenuProps extends HTMLAttributes2<HTMLUListElement> {
|
|
182
|
+
/** Pins the menu's rows to one step of the size ladder. Omitted, they
|
|
183
|
+
* follow the surrounding SizeProvider. */
|
|
184
|
+
size?: SizeVariant;
|
|
185
|
+
/** Draw the traveling keyboard focus ring. Off, keyboard focus moves the
|
|
186
|
+
* hover background only. @default true */
|
|
187
|
+
focusRing?: boolean;
|
|
188
|
+
}
|
|
189
|
+
declare const SidebarMenu: ForwardRefExoticComponent_tcubfn3<SidebarMenuProps & RefAttributes_miuf563<HTMLUListElement>>;
|
|
190
|
+
interface SidebarMenuItemProps extends LiHTMLAttributes<HTMLLIElement> {
|
|
191
|
+
/** The row folds a `SidebarMenuSub` under it: its button toggles the sub-menu and shows a chevron. */
|
|
192
|
+
collapsible?: boolean;
|
|
193
|
+
/** Controlled open state of a collapsible row's sub-menu. */
|
|
194
|
+
open?: boolean;
|
|
195
|
+
/** Initial open state of a collapsible row's sub-menu. */
|
|
196
|
+
defaultOpen?: boolean;
|
|
197
|
+
/** Called when a collapsible row opens or closes. */
|
|
198
|
+
onOpenChange?: (open: boolean) => void;
|
|
199
|
+
}
|
|
200
|
+
declare const SidebarMenuItem: ForwardRefExoticComponent_tcubfn3<SidebarMenuItemProps & RefAttributes_miuf563<HTMLLIElement>>;
|
|
201
|
+
type SidebarMenuSubItemProps = LiHTMLAttributes<HTMLLIElement>;
|
|
202
|
+
declare const SidebarMenuSubItem: ForwardRefExoticComponent_tcubfn3<SidebarMenuSubItemProps & RefAttributes_miuf563<HTMLLIElement>>;
|
|
203
|
+
declare const sidebarMenuButtonVariants: (props?: ({
|
|
204
|
+
variant?: "default" | "outline" | null | undefined;
|
|
205
|
+
} & ClassProp_wz9o0r2) | undefined) => string;
|
|
206
|
+
interface SidebarMenuButtonProps extends ButtonHTMLAttributes2<HTMLButtonElement>, VariantProps2<typeof sidebarMenuButtonVariants> {
|
|
207
|
+
isActive?: boolean;
|
|
208
|
+
size?: "default" | "sm" | "lg";
|
|
209
|
+
icon?: IconComponent;
|
|
210
|
+
/** Semantic thread state for status-dot navigation. Drives the dot
|
|
211
|
+
* visuals (`active`/`unread` → filled, `idle` → ring), stamps
|
|
212
|
+
* `data-status` on the button, appends visually-hidden "unread" text for
|
|
213
|
+
* screen readers, and `"active"` implies `isActive`. */
|
|
214
|
+
status?: "active" | "unread" | "idle";
|
|
215
|
+
/** Visual-only dot in the icon column — the escape hatch when the
|
|
216
|
+
* semantic `status` vocabulary doesn't fit. Overrides the dot derived
|
|
217
|
+
* from `status`. Ignored when `icon` is set. */
|
|
218
|
+
dot?: "filled" | "ring";
|
|
219
|
+
/** Selection key: the row is active while the surrounding `Sidebar`'s
|
|
220
|
+
* `value` matches it, and pressing it selects it. With a `value`,
|
|
221
|
+
* `status="active"` no longer implies the active row. */
|
|
222
|
+
value?: string;
|
|
223
|
+
render?: ReactElement2;
|
|
224
|
+
asChild?: boolean;
|
|
225
|
+
}
|
|
226
|
+
declare const SidebarMenuButton: ForwardRefExoticComponent_tcubfn3<SidebarMenuButtonProps & RefAttributes_miuf563<HTMLButtonElement>>;
|
|
227
|
+
interface SidebarMenuActionProps extends ButtonHTMLAttributes2<HTMLButtonElement> {
|
|
228
|
+
showOnHover?: boolean;
|
|
229
|
+
render?: ReactElement2;
|
|
230
|
+
asChild?: boolean;
|
|
231
|
+
}
|
|
232
|
+
declare const SidebarMenuAction: ForwardRefExoticComponent_tcubfn3<SidebarMenuActionProps & RefAttributes_miuf563<HTMLButtonElement>>;
|
|
233
|
+
interface SidebarMenuActionsProps extends HTMLAttributes2<HTMLDivElement> {
|
|
234
|
+
/** Hide the cluster until the row is hovered or focused. */
|
|
235
|
+
showOnHover?: boolean;
|
|
236
|
+
}
|
|
237
|
+
/** Row-level cluster for more than one SidebarMenuAction. It owns the
|
|
238
|
+
* positioning and publishes the whole count to the row, so the button
|
|
239
|
+
* reserves the exact gutter the cluster occupies. */
|
|
240
|
+
declare const SidebarMenuActions: ForwardRefExoticComponent_tcubfn3<SidebarMenuActionsProps & RefAttributes_miuf563<HTMLDivElement>>;
|
|
241
|
+
type SidebarMenuBadgeProps = HTMLAttributes2<HTMLDivElement>;
|
|
242
|
+
declare const SidebarMenuBadge: ForwardRefExoticComponent_tcubfn3<SidebarMenuBadgeProps & RefAttributes_miuf563<HTMLDivElement>>;
|
|
243
|
+
interface SidebarMenuSkeletonProps extends HTMLAttributes2<HTMLDivElement> {
|
|
244
|
+
showIcon?: boolean;
|
|
245
|
+
}
|
|
246
|
+
declare const SidebarMenuSkeleton: ForwardRefExoticComponent_tcubfn3<SidebarMenuSkeletonProps & RefAttributes_miuf563<HTMLDivElement>>;
|
|
247
|
+
interface SidebarMenuSubProps extends HTMLAttributes2<HTMLUListElement> {
|
|
248
|
+
/** Built-in measured-height collapse. Omitted, the sub-menu follows its
|
|
249
|
+
* `collapsible` row's state, or stays visible without one. */
|
|
250
|
+
open?: boolean;
|
|
251
|
+
}
|
|
252
|
+
declare const SidebarMenuSub: ForwardRefExoticComponent_tcubfn3<SidebarMenuSubProps & RefAttributes_miuf563<HTMLUListElement>>;
|
|
253
|
+
interface SidebarMenuSubButtonProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
254
|
+
isActive?: boolean;
|
|
255
|
+
size?: "sm" | "md";
|
|
256
|
+
icon?: IconComponent;
|
|
257
|
+
/** Selection key, as on `SidebarMenuButton`. Without an `href` the row renders a button. */
|
|
258
|
+
value?: string;
|
|
259
|
+
render?: ReactElement2;
|
|
260
|
+
asChild?: boolean;
|
|
261
|
+
}
|
|
262
|
+
declare const SidebarMenuSubButton: ForwardRefExoticComponent_tcubfn3<SidebarMenuSubButtonProps & RefAttributes_miuf563<HTMLAnchorElement>>;
|
|
263
|
+
interface SidebarProps extends Omit<HTMLAttributes3<HTMLDivElement>, "defaultValue" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration"> {
|
|
264
|
+
/** The edge it sits on; the shortcut key and the rail mirror it. Defaults to `'left'`. */
|
|
265
|
+
side?: "left" | "right";
|
|
266
|
+
/** `'sidebar'` sits flush with an inner border, `'floating'` lifts it onto its own card one surface level up, `'inset'` makes the main region the card. Defaults to `'sidebar'`. */
|
|
267
|
+
variant?: "sidebar" | "floating" | "inset";
|
|
268
|
+
/** `'offcanvas'` collapses it away (rail, trigger, shortcut, open on hover, mobile drawer); `'none'` pins it open, with no rail or drawer — for a sidebar inside a dialog. Defaults to `'offcanvas'`. */
|
|
269
|
+
collapsible?: "offcanvas" | "none";
|
|
270
|
+
/** The `sidebar` variant's inner-edge border. Defaults to `true`. */
|
|
271
|
+
bordered?: boolean;
|
|
272
|
+
/** Render the built-in resize/collapse rail on the inner edge. Defaults to `true`. */
|
|
273
|
+
rail?: boolean;
|
|
274
|
+
/** Pin the rail's tooltip open (`true`) or closed (`false`); left out, it shows on hover. Dragging always hides it. */
|
|
275
|
+
railTooltipOpen?: boolean;
|
|
276
|
+
/** Controlled selection: the menu button or sub-button whose `value` matches is the active row. */
|
|
277
|
+
value?: string;
|
|
278
|
+
/** Initial selection, for an uncontrolled sidebar. */
|
|
279
|
+
defaultValue?: string;
|
|
280
|
+
/** Called with the `value` of the row that was pressed. */
|
|
281
|
+
onValueChange?: (value: string) => void;
|
|
282
|
+
/** Extra classes for the sidebar column (`h-full` pins it to a bounded frame). */
|
|
283
|
+
className?: string;
|
|
284
|
+
/** The sidebar's parts: `Sidebar.Header`, `Sidebar.Content`, `Sidebar.Footer`. */
|
|
285
|
+
children?: ReactNode4;
|
|
286
|
+
}
|
|
287
|
+
type SidebarComponent = ForwardRefExoticComponent<SidebarProps & RefAttributes<HTMLDivElement>> & {
|
|
288
|
+
Provider: typeof SidebarProvider;
|
|
289
|
+
Trigger: typeof SidebarTrigger;
|
|
290
|
+
Rail: typeof SidebarRail;
|
|
291
|
+
Inset: typeof SidebarInset;
|
|
292
|
+
Input: typeof SidebarInput;
|
|
293
|
+
Header: typeof SidebarHeader;
|
|
294
|
+
Content: typeof SidebarContent;
|
|
295
|
+
Footer: typeof SidebarFooter;
|
|
296
|
+
Separator: typeof SidebarSeparator;
|
|
297
|
+
Group: typeof SidebarGroup;
|
|
298
|
+
GroupLabel: typeof SidebarGroupLabel;
|
|
299
|
+
GroupAction: typeof SidebarGroupAction;
|
|
300
|
+
GroupActions: typeof SidebarGroupActions;
|
|
301
|
+
GroupContent: typeof SidebarGroupContent;
|
|
302
|
+
Menu: typeof SidebarMenu;
|
|
303
|
+
MenuItem: typeof SidebarMenuItem;
|
|
304
|
+
MenuButton: typeof SidebarMenuButton;
|
|
305
|
+
MenuAction: typeof SidebarMenuAction;
|
|
306
|
+
MenuActions: typeof SidebarMenuActions;
|
|
307
|
+
MenuBadge: typeof SidebarMenuBadge;
|
|
308
|
+
MenuSkeleton: typeof SidebarMenuSkeleton;
|
|
309
|
+
MenuSub: typeof SidebarMenuSub;
|
|
310
|
+
MenuSubItem: typeof SidebarMenuSubItem;
|
|
311
|
+
MenuSubButton: typeof SidebarMenuSubButton;
|
|
312
|
+
};
|
|
313
|
+
/**
|
|
314
|
+
* A sidebar built from composable parts. Drag its edge to resize, collapse it
|
|
315
|
+
* away, and on mobile it becomes a drawer.
|
|
316
|
+
*
|
|
317
|
+
* Everything that moves here moves in the morph style (see Morph). The
|
|
318
|
+
* active row and the hover highlight are liquid: a new selection melts
|
|
319
|
+
* across from the old one, and the highlight drips from row to row, into a
|
|
320
|
+
* row's sub-menu too. On mobile it is a `Sheet` growing out of its edge
|
|
321
|
+
* that you swipe away. The menus in the header, the footer and on each row
|
|
322
|
+
* are Dropdowns, and the tooltips are Tooltips, so they grow out of their
|
|
323
|
+
* triggers too.
|
|
324
|
+
*
|
|
325
|
+
* Wrap the page in `Sidebar.Provider`, then put the `Sidebar` and a
|
|
326
|
+
* `Sidebar.Inset` (the main region) inside it. The provider holds the open
|
|
327
|
+
* state (`open` / `defaultOpen` / `onOpenChange`, kept in the `sidebar_state`
|
|
328
|
+
* cookie unless `persist={false}`), the `width` and `widthMobile`, the
|
|
329
|
+
* `mobileBreakpoint` under which it becomes a drawer, `openOnHover` (below)
|
|
330
|
+
* and the bare `shortcut` key (`[` for a left sidebar,
|
|
331
|
+
* `]` for a right one; `null` turns it off). It fills the viewport; pass
|
|
332
|
+
* `className="h-full min-h-0"` to fill a bounded frame instead.
|
|
333
|
+
*
|
|
334
|
+
* Drag the rail on the inner edge to resize the sidebar (160–360px); throw
|
|
335
|
+
* it at the edge to collapse, or click it. There is no icon-only rail on
|
|
336
|
+
* purpose: a collapsed sidebar opens whole on hover instead.
|
|
337
|
+
*
|
|
338
|
+
* With `openOnHover`, collapsing leaves the sidebar on hover: it opens, in
|
|
339
|
+
* flow, while the pointer is between its edge and the far side of a
|
|
340
|
+
* `Sidebar.Trigger` beside it (or a thin strip at the edge), and closes a
|
|
341
|
+
* beat after the pointer leaves. `open` is then whether it is kept open: the
|
|
342
|
+
* trigger switches between the two and draws a dashed glyph while on hover,
|
|
343
|
+
* and the rail collapses or resizes the hover without keeping it open.
|
|
344
|
+
*
|
|
345
|
+
* ## Rows
|
|
346
|
+
*
|
|
347
|
+
* - Two levels: `Sidebar.MenuButton` rows, each folding a
|
|
348
|
+
* `Sidebar.MenuSub` of `Sidebar.MenuSubButton` rows. A
|
|
349
|
+
* `Sidebar.MenuItem collapsible` toggles its sub-menu from its own button
|
|
350
|
+
* and draws the chevron.
|
|
351
|
+
* - Give a button a `value` and the sidebar's `value` / `defaultValue` picks
|
|
352
|
+
* the active row; pressing a row selects it. `isActive` still forces a row
|
|
353
|
+
* active.
|
|
354
|
+
* - `icon` puts a glyph in the leading slot; `status` (`'active'`,
|
|
355
|
+
* `'unread'`, `'idle'`) a thread's dot instead.
|
|
356
|
+
* - `Sidebar.MenuBadge` keeps the rightmost slot; up to three
|
|
357
|
+
* `Sidebar.MenuAction`s (in a `Sidebar.MenuActions` cluster) sit beside
|
|
358
|
+
* it, `showOnHover` so the label keeps the room at rest.
|
|
359
|
+
* - The rows share one fluid hover, one keyboard roving focus (arrows,
|
|
360
|
+
* Home, End) and one focus ring across both levels.
|
|
361
|
+
*
|
|
362
|
+
* ## Sections
|
|
363
|
+
*
|
|
364
|
+
* `Sidebar.Group` with a `Sidebar.GroupLabel` is a section; `collapsible`
|
|
365
|
+
* makes the label fold everything under it. `Sidebar.GroupActions` holds
|
|
366
|
+
* its `Sidebar.GroupAction` buttons over the label's right edge.
|
|
367
|
+
*
|
|
368
|
+
* Statics:
|
|
369
|
+
* - `Sidebar.Provider`, `Sidebar.Inset`, `Sidebar.Trigger` (the ghost icon
|
|
370
|
+
* button with the shortcut in its tooltip), `Sidebar.Rail`.
|
|
371
|
+
* - `Sidebar.Header`, `Sidebar.Content` (the scrolling region),
|
|
372
|
+
* `Sidebar.Footer`, `Sidebar.Separator`, `Sidebar.Input`.
|
|
373
|
+
* - `Sidebar.Group`, `Sidebar.GroupLabel`, `Sidebar.GroupAction`,
|
|
374
|
+
* `Sidebar.GroupActions`, `Sidebar.GroupContent`.
|
|
375
|
+
* - `Sidebar.Menu`, `Sidebar.MenuItem`, `Sidebar.MenuButton`,
|
|
376
|
+
* `Sidebar.MenuAction`, `Sidebar.MenuActions`, `Sidebar.MenuBadge`,
|
|
377
|
+
* `Sidebar.MenuSkeleton`, `Sidebar.MenuSub`, `Sidebar.MenuSubItem`,
|
|
378
|
+
* `Sidebar.MenuSubButton`.
|
|
379
|
+
* - `useSidebar()` (named export) reads the provider's state.
|
|
380
|
+
*
|
|
381
|
+
* @example {@include ./examples.mdx}
|
|
382
|
+
*/
|
|
383
|
+
declare const Sidebar: SidebarComponent;
|
|
384
|
+
interface SidebarContentProps extends HTMLAttributes3<HTMLDivElement> {
|
|
385
|
+
viewportClassName?: string;
|
|
386
|
+
}
|
|
387
|
+
declare const SidebarContent: ForwardRefExoticComponent<SidebarContentProps & RefAttributes<HTMLDivElement>>;
|
|
388
|
+
export { SIDEBAR_COOKIE_MAX_AGE, SIDEBAR_COOKIE_NAME, SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_KEYBOARD_SHORTCUT_RIGHT, SIDEBAR_MAX_WIDTH, SIDEBAR_MIN_WIDTH, SIDEBAR_WIDTH, SIDEBAR_WIDTH_MOBILE, Sidebar, SidebarCollapsible, SidebarContent, SidebarContentProps, SidebarContextValue, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupActionProps, SidebarGroupActions, SidebarGroupContent, SidebarGroupLabel, SidebarGroupLabelProps, SidebarHeader, SidebarInput, SidebarInputProps, SidebarInset, SidebarInsetProps, SidebarMenu, SidebarMenuAction, SidebarMenuActionProps, SidebarMenuActions, SidebarMenuBadge, SidebarMenuBadgeProps, SidebarMenuButton, SidebarMenuButtonProps, SidebarMenuItem, SidebarMenuItemProps, SidebarMenuProps, SidebarMenuSkeleton, SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubButtonProps, SidebarMenuSubItem, SidebarMenuSubItemProps, SidebarMenuSubProps, SidebarProps, SidebarProvider, SidebarProviderProps, SidebarRail, SidebarRailProps, SidebarSectionProps, SidebarSelection, SidebarSelectionValue, SidebarSeparator, SidebarSide, SidebarTrigger, SidebarTriggerProps, SidebarVariant, Sidebar as default, sidebarMenuButtonVariants, useSidebar };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SIDEBAR_COOKIE_NAME2,
|
|
3
|
+
SIDEBAR_COOKIE_MAX_AGE2,
|
|
4
|
+
SIDEBAR_WIDTH2,
|
|
5
|
+
SIDEBAR_WIDTH_MOBILE2,
|
|
6
|
+
SIDEBAR_KEYBOARD_SHORTCUT2,
|
|
7
|
+
SIDEBAR_KEYBOARD_SHORTCUT_RIGHT2,
|
|
8
|
+
SIDEBAR_MIN_WIDTH2,
|
|
9
|
+
SIDEBAR_MAX_WIDTH2,
|
|
10
|
+
useSidebar2,
|
|
11
|
+
SidebarProvider2,
|
|
12
|
+
SidebarTrigger2,
|
|
13
|
+
SidebarRail2,
|
|
14
|
+
SidebarInset2,
|
|
15
|
+
SidebarInput2,
|
|
16
|
+
SidebarHeader2,
|
|
17
|
+
SidebarFooter2,
|
|
18
|
+
SidebarSeparator2,
|
|
19
|
+
SidebarGroup2,
|
|
20
|
+
SidebarGroupLabel2,
|
|
21
|
+
SidebarGroupAction2,
|
|
22
|
+
SidebarGroupActions2,
|
|
23
|
+
SidebarGroupContent2,
|
|
24
|
+
SidebarSelection2,
|
|
25
|
+
SidebarMenu2,
|
|
26
|
+
SidebarMenuItem2,
|
|
27
|
+
SidebarMenuSubItem2,
|
|
28
|
+
sidebarMenuButtonVariants2,
|
|
29
|
+
SidebarMenuButton2,
|
|
30
|
+
SidebarMenuAction2,
|
|
31
|
+
SidebarMenuActions2,
|
|
32
|
+
SidebarMenuBadge2,
|
|
33
|
+
SidebarMenuSkeleton2,
|
|
34
|
+
SidebarMenuSub2,
|
|
35
|
+
SidebarMenuSubButton2,
|
|
36
|
+
Sidebar2,
|
|
37
|
+
SidebarContent2,
|
|
38
|
+
sidebar_default
|
|
39
|
+
} from "../../../shared/components-ca2c898n.js";
|
|
40
|
+
import"../../../shared/components-c6s6b43g.js";
|
|
41
|
+
import"../../../shared/components-mhd39z7x.js";
|
|
42
|
+
import"../../../shared/components-ng72k97e.js";
|
|
43
|
+
import"../../../shared/components-rr7a6ja9.js";
|
|
44
|
+
import"../../../shared/components-zfnmn5d4.js";
|
|
45
|
+
import"../../../shared/components-3ky44908.js";
|
|
46
|
+
import"../../../shared/components-zrkzcayz.js";
|
|
47
|
+
import"../../../shared/components-0q0sqfh4.js";
|
|
48
|
+
import"../../../shared/components-kvr7f9hy.js";
|
|
49
|
+
import"../../../shared/components-59efxjd9.js";
|
|
50
|
+
import"../../../shared/components-chacnk61.js";
|
|
51
|
+
import"../../../shared/components-hqeq3w9q.js";
|
|
52
|
+
import"../../../shared/components-jjw69c4c.js";
|
|
53
|
+
import"../../../shared/components-b2wyq2cq.js";
|
|
54
|
+
import"../../../shared/components-n7mjr357.js";
|
|
55
|
+
import"../../../shared/components-men63rwj.js";
|
|
56
|
+
import"../../../shared/components-0sn7ypjw.js";
|
|
57
|
+
import"../../../shared/components-hawvy2qz.js";
|
|
58
|
+
import"../../../shared/components-cv16mryv.js";
|
|
59
|
+
import"../../../shared/components-zx6b6yby.js";
|
|
60
|
+
import"../../../shared/components-ezxhrmer.js";
|
|
61
|
+
export {
|
|
62
|
+
SIDEBAR_COOKIE_MAX_AGE2 as SIDEBAR_COOKIE_MAX_AGE,
|
|
63
|
+
SIDEBAR_COOKIE_NAME2 as SIDEBAR_COOKIE_NAME,
|
|
64
|
+
SIDEBAR_KEYBOARD_SHORTCUT2 as SIDEBAR_KEYBOARD_SHORTCUT,
|
|
65
|
+
SIDEBAR_KEYBOARD_SHORTCUT_RIGHT2 as SIDEBAR_KEYBOARD_SHORTCUT_RIGHT,
|
|
66
|
+
SIDEBAR_MAX_WIDTH2 as SIDEBAR_MAX_WIDTH,
|
|
67
|
+
SIDEBAR_MIN_WIDTH2 as SIDEBAR_MIN_WIDTH,
|
|
68
|
+
SIDEBAR_WIDTH2 as SIDEBAR_WIDTH,
|
|
69
|
+
SIDEBAR_WIDTH_MOBILE2 as SIDEBAR_WIDTH_MOBILE,
|
|
70
|
+
Sidebar2 as Sidebar,
|
|
71
|
+
SidebarContent2 as SidebarContent,
|
|
72
|
+
SidebarFooter2 as SidebarFooter,
|
|
73
|
+
SidebarGroup2 as SidebarGroup,
|
|
74
|
+
SidebarGroupAction2 as SidebarGroupAction,
|
|
75
|
+
SidebarGroupActions2 as SidebarGroupActions,
|
|
76
|
+
SidebarGroupContent2 as SidebarGroupContent,
|
|
77
|
+
SidebarGroupLabel2 as SidebarGroupLabel,
|
|
78
|
+
SidebarHeader2 as SidebarHeader,
|
|
79
|
+
SidebarInput2 as SidebarInput,
|
|
80
|
+
SidebarInset2 as SidebarInset,
|
|
81
|
+
SidebarMenu2 as SidebarMenu,
|
|
82
|
+
SidebarMenuAction2 as SidebarMenuAction,
|
|
83
|
+
SidebarMenuActions2 as SidebarMenuActions,
|
|
84
|
+
SidebarMenuBadge2 as SidebarMenuBadge,
|
|
85
|
+
SidebarMenuButton2 as SidebarMenuButton,
|
|
86
|
+
SidebarMenuItem2 as SidebarMenuItem,
|
|
87
|
+
SidebarMenuSkeleton2 as SidebarMenuSkeleton,
|
|
88
|
+
SidebarMenuSub2 as SidebarMenuSub,
|
|
89
|
+
SidebarMenuSubButton2 as SidebarMenuSubButton,
|
|
90
|
+
SidebarMenuSubItem2 as SidebarMenuSubItem,
|
|
91
|
+
SidebarProvider2 as SidebarProvider,
|
|
92
|
+
SidebarRail2 as SidebarRail,
|
|
93
|
+
SidebarSelection2 as SidebarSelection,
|
|
94
|
+
SidebarSeparator2 as SidebarSeparator,
|
|
95
|
+
SidebarTrigger2 as SidebarTrigger,
|
|
96
|
+
sidebar_default as default,
|
|
97
|
+
sidebarMenuButtonVariants2 as sidebarMenuButtonVariants,
|
|
98
|
+
useSidebar2 as useSidebar
|
|
99
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
2
|
+
import { ComponentPropsWithoutRef, ForwardRefExoticComponent, ReactNode as ReactNode2, RefAttributes } from "react";
|
|
3
|
+
import { ComponentType } from "react";
|
|
4
|
+
interface IconComponentProps {
|
|
5
|
+
size?: number | string;
|
|
6
|
+
strokeWidth?: number | string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
type IconComponent = ComponentType<IconComponentProps>;
|
|
10
|
+
type SizeVariant = "default" | "compact";
|
|
11
|
+
import { TabsListProps as TabsListProps_6iqhkk } from "@base-ui/react";
|
|
12
|
+
interface TabsProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.Root>, "onValueChange" | "value" | "defaultValue" | "onSelect"> {
|
|
13
|
+
/** Controlled active tab value. Takes precedence over selectedIndex. */
|
|
14
|
+
value?: string;
|
|
15
|
+
/** Called when the active tab changes. */
|
|
16
|
+
onValueChange?: (value: string) => void;
|
|
17
|
+
/** Index-based controlled alternative. */
|
|
18
|
+
selectedIndex?: number;
|
|
19
|
+
/** Called with the new index when the active tab changes. */
|
|
20
|
+
onSelect?: (index: number) => void;
|
|
21
|
+
/** Default active tab for uncontrolled usage. Defaults to the first tab. */
|
|
22
|
+
defaultValue?: string;
|
|
23
|
+
/** Index-based uncontrolled alternative: the tab active on first render. Ignored when `defaultValue` is set. */
|
|
24
|
+
defaultSelectedIndex?: number;
|
|
25
|
+
/** Pins the segmented control to one step of the size ladder (default 36px outer, compact 28px). Defaults to the surrounding SizeProvider. */
|
|
26
|
+
size?: SizeVariant;
|
|
27
|
+
/** Tabs.List and Tabs.Panel children. */
|
|
28
|
+
children?: ReactNode2;
|
|
29
|
+
}
|
|
30
|
+
type TabsComponent = ForwardRefExoticComponent<TabsProps & RefAttributes<HTMLDivElement>> & {
|
|
31
|
+
List: typeof TabsList;
|
|
32
|
+
Item: typeof TabItem;
|
|
33
|
+
Panel: typeof TabPanel;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Segmented control tabs with sliding active indicator, fluid hover, and
|
|
37
|
+
* spring animations.
|
|
38
|
+
*
|
|
39
|
+
* Built on Base UI Tabs: `Tabs` owns the selection, `Tabs.List` draws the
|
|
40
|
+
* segmented track with an elevated indicator that melts toward the active tab
|
|
41
|
+
* like a drop (lifted three surface levels above whatever it sits on; see the
|
|
42
|
+
* liquid indicators in Morph) and a translucent hover pill that drips out of
|
|
43
|
+
* it, and `Tabs.Panel` shows the content of the active tab. Arrow keys
|
|
44
|
+
* move and activate. Select by value — `defaultValue` uncontrolled, `value` +
|
|
45
|
+
* `onValueChange` controlled — or by index with `defaultSelectedIndex` /
|
|
46
|
+
* `selectedIndex` + `onSelect`.
|
|
47
|
+
*
|
|
48
|
+
* Statics:
|
|
49
|
+
* - `Tabs.List` — the segmented track holding the tabs.
|
|
50
|
+
* - `Tabs.Item` — one tab: `value`, `label`, optional `icon`.
|
|
51
|
+
* - `Tabs.Panel` — content shown while the tab with the same `value` is active.
|
|
52
|
+
*
|
|
53
|
+
* @example {@include ./examples.mdx}
|
|
54
|
+
*/
|
|
55
|
+
declare const Tabs: TabsComponent;
|
|
56
|
+
type TabsListProps = ComponentPropsWithoutRef<typeof TabsPrimitive.List>;
|
|
57
|
+
declare const TabsList: ForwardRefExoticComponent<Omit<Omit<TabsListProps_6iqhkk, "ref"> & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
58
|
+
interface TabItemProps extends ComponentPropsWithoutRef<typeof TabsPrimitive.Tab> {
|
|
59
|
+
value: string;
|
|
60
|
+
icon?: IconComponent;
|
|
61
|
+
label: string;
|
|
62
|
+
/** @internal Auto-assigned by TabsList. */
|
|
63
|
+
_index?: number;
|
|
64
|
+
}
|
|
65
|
+
declare const TabItem: ForwardRefExoticComponent<TabItemProps & RefAttributes<HTMLButtonElement>>;
|
|
66
|
+
interface TabPanelProps extends ComponentPropsWithoutRef<typeof TabsPrimitive.Panel> {
|
|
67
|
+
value: string;
|
|
68
|
+
}
|
|
69
|
+
declare const TabPanel: ForwardRefExoticComponent<TabPanelProps & RefAttributes<HTMLDivElement>>;
|
|
70
|
+
export { TabItem, TabItemProps, TabPanel, TabPanelProps, Tabs, TabsList, TabsListProps, TabsProps, Tabs as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tabs2,
|
|
3
|
+
TabsList2,
|
|
4
|
+
TabItem2,
|
|
5
|
+
TabPanel2,
|
|
6
|
+
tabs_default
|
|
7
|
+
} from "../../../shared/components-tqvarbfv.js";
|
|
8
|
+
import"../../../shared/components-59efxjd9.js";
|
|
9
|
+
import"../../../shared/components-chacnk61.js";
|
|
10
|
+
import"../../../shared/components-hqeq3w9q.js";
|
|
11
|
+
import"../../../shared/components-jjw69c4c.js";
|
|
12
|
+
import"../../../shared/components-men63rwj.js";
|
|
13
|
+
import"../../../shared/components-0sn7ypjw.js";
|
|
14
|
+
import"../../../shared/components-cv16mryv.js";
|
|
15
|
+
import"../../../shared/components-zx6b6yby.js";
|
|
16
|
+
import"../../../shared/components-ezxhrmer.js";
|
|
17
|
+
export {
|
|
18
|
+
TabItem2 as TabItem,
|
|
19
|
+
TabPanel2 as TabPanel,
|
|
20
|
+
Tabs2 as Tabs,
|
|
21
|
+
TabsList2 as TabsList,
|
|
22
|
+
tabs_default as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, HTMLAttributes, ReactNode as ReactNode2, RefAttributes } from "react";
|
|
2
|
+
import { ComponentType } from "react";
|
|
3
|
+
interface IconComponentProps {
|
|
4
|
+
size?: number | string;
|
|
5
|
+
strokeWidth?: number | string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
type IconComponent = ComponentType<IconComponentProps>;
|
|
9
|
+
type SizeVariant = "default" | "compact";
|
|
10
|
+
interface TabsSubtleProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
11
|
+
/** TabsSubtle.Item children, and optionally the TabsSubtle.Panel children they select. */
|
|
12
|
+
children: ReactNode2;
|
|
13
|
+
/** Index of the currently selected tab. Controlled — pair it with `onSelect`. */
|
|
14
|
+
selectedIndex?: number;
|
|
15
|
+
/** Selected tab on first render when uncontrolled. Defaults to `0`. */
|
|
16
|
+
defaultSelectedIndex?: number;
|
|
17
|
+
/** Called when a tab is selected. */
|
|
18
|
+
onSelect?: (index: number) => void;
|
|
19
|
+
/** Prefix for ARIA IDs linking tabs to panels. Defaults to a generated one when panels are nested inside. */
|
|
20
|
+
idPrefix?: string;
|
|
21
|
+
/** When true, only the selected tab shows its text label. Requires icons on tabs. Defaults to `false`. */
|
|
22
|
+
activeLabel?: boolean;
|
|
23
|
+
/** Pins the tabs to one step of the size ladder (default 36px, compact 28px). Defaults to the surrounding SizeProvider. */
|
|
24
|
+
size?: SizeVariant;
|
|
25
|
+
}
|
|
26
|
+
type TabsSubtleComponent = ForwardRefExoticComponent<TabsSubtleProps & RefAttributes<HTMLDivElement>> & {
|
|
27
|
+
Item: typeof TabsSubtleItem;
|
|
28
|
+
Panel: typeof TabsSubtlePanel;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Tab navigation with smooth pill animations.
|
|
32
|
+
*
|
|
33
|
+
* A borderless tab strip: the selected pill melts from tab to tab like a drop
|
|
34
|
+
* (the liquid indicators in Morph), a lighter hover pill previews the next one, and the active label animates to semibold
|
|
35
|
+
* without shifting. With `activeLabel`, tabs collapse to their icon and the
|
|
36
|
+
* selected one expands its label to a measured width. Base UI owns
|
|
37
|
+
* `role="tablist"`, the roving tabindex and Arrow/Home/End navigation
|
|
38
|
+
* (manual activation — arrows move, Enter or Space selects). Uncontrolled with
|
|
39
|
+
* `defaultSelectedIndex`, or controlled with `selectedIndex` + `onSelect`.
|
|
40
|
+
*
|
|
41
|
+
* The root element is the tab list itself, so nested `TabsSubtle.Panel`
|
|
42
|
+
* children are lifted out and rendered as its siblings, wired to the tabs
|
|
43
|
+
* through a generated id prefix; panels rendered outside still take
|
|
44
|
+
* `selectedIndex` and `idPrefix` as props.
|
|
45
|
+
*
|
|
46
|
+
* Statics:
|
|
47
|
+
* - `TabsSubtle.Item` — one tab: `index`, `label`, optional `icon`.
|
|
48
|
+
* - `TabsSubtle.Panel` — content for the tab with the same `index`.
|
|
49
|
+
*
|
|
50
|
+
* @example {@include ./examples.mdx}
|
|
51
|
+
*/
|
|
52
|
+
declare const TabsSubtle: TabsSubtleComponent;
|
|
53
|
+
interface TabsSubtleItemProps extends HTMLAttributes<HTMLButtonElement> {
|
|
54
|
+
/** Icon displayed in the tab. */
|
|
55
|
+
icon?: IconComponent;
|
|
56
|
+
/** Text label for the tab. */
|
|
57
|
+
label: string;
|
|
58
|
+
/** Position index within the tab list. */
|
|
59
|
+
index: number;
|
|
60
|
+
}
|
|
61
|
+
declare const TabsSubtleItem: ForwardRefExoticComponent<TabsSubtleItemProps & RefAttributes<HTMLButtonElement>>;
|
|
62
|
+
interface TabsSubtlePanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
63
|
+
/** Index of this panel; rendered only when it matches the selected tab. */
|
|
64
|
+
index: number;
|
|
65
|
+
/** Currently selected tab index. Defaults to the enclosing TabsSubtle's selection. */
|
|
66
|
+
selectedIndex?: number;
|
|
67
|
+
/** Must match the TabsSubtle idPrefix. Defaults to the enclosing TabsSubtle's prefix. */
|
|
68
|
+
idPrefix?: string;
|
|
69
|
+
/** Panel content, only rendered when selected. */
|
|
70
|
+
children: ReactNode2;
|
|
71
|
+
}
|
|
72
|
+
declare const TabsSubtlePanel: ForwardRefExoticComponent<TabsSubtlePanelProps & RefAttributes<HTMLDivElement>>;
|
|
73
|
+
export { TabsSubtle, TabsSubtleItem, TabsSubtleItemProps, TabsSubtlePanel, TabsSubtlePanelProps, TabsSubtleProps, TabsSubtle as default };
|