@jackbernnie/hiyf 0.1.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 +191 -0
- package/NOTICE +12 -0
- package/README.md +47 -0
- package/dist/components/Accordion.d.ts +38 -0
- package/dist/components/Accordion.js +38 -0
- package/dist/components/Alert.d.ts +29 -0
- package/dist/components/Alert.js +39 -0
- package/dist/components/AlertDialog.d.ts +37 -0
- package/dist/components/AlertDialog.js +38 -0
- package/dist/components/AspectRatio.d.ts +15 -0
- package/dist/components/AspectRatio.js +15 -0
- package/dist/components/Avatar.d.ts +26 -0
- package/dist/components/Avatar.js +13 -0
- package/dist/components/Badge.d.ts +18 -0
- package/dist/components/Badge.js +17 -0
- package/dist/components/Box.d.ts +13 -0
- package/dist/components/Box.js +52 -0
- package/dist/components/Breadcrumb.d.ts +33 -0
- package/dist/components/Breadcrumb.js +16 -0
- package/dist/components/Button.d.ts +40 -0
- package/dist/components/Button.js +33 -0
- package/dist/components/ButtonGroup.d.ts +18 -0
- package/dist/components/ButtonGroup.js +8 -0
- package/dist/components/Card.d.ts +46 -0
- package/dist/components/Card.js +24 -0
- package/dist/components/Carousel.d.ts +27 -0
- package/dist/components/Carousel.js +13 -0
- package/dist/components/Chart.d.ts +17 -0
- package/dist/components/Chart.js +94 -0
- package/dist/components/Checkbox.d.ts +26 -0
- package/dist/components/Checkbox.js +9 -0
- package/dist/components/Collapsible.d.ts +27 -0
- package/dist/components/Collapsible.js +26 -0
- package/dist/components/Combobox.d.ts +36 -0
- package/dist/components/Combobox.js +41 -0
- package/dist/components/Command.d.ts +37 -0
- package/dist/components/Command.js +32 -0
- package/dist/components/ContextMenu.d.ts +34 -0
- package/dist/components/ContextMenu.js +23 -0
- package/dist/components/Dialog.d.ts +20 -0
- package/dist/components/Dialog.js +34 -0
- package/dist/components/Drawer.d.ts +28 -0
- package/dist/components/Drawer.js +25 -0
- package/dist/components/DropdownMenu.d.ts +42 -0
- package/dist/components/DropdownMenu.js +32 -0
- package/dist/components/Empty.d.ts +28 -0
- package/dist/components/Empty.js +15 -0
- package/dist/components/Field.d.ts +30 -0
- package/dist/components/Field.js +13 -0
- package/dist/components/Grid.d.ts +32 -0
- package/dist/components/Grid.js +37 -0
- package/dist/components/GridItem.d.ts +30 -0
- package/dist/components/GridItem.js +40 -0
- package/dist/components/HoverCard.d.ts +22 -0
- package/dist/components/HoverCard.js +12 -0
- package/dist/components/Input.d.ts +34 -0
- package/dist/components/Input.js +8 -0
- package/dist/components/InputGroup.d.ts +28 -0
- package/dist/components/InputGroup.js +13 -0
- package/dist/components/InputOTP.d.ts +26 -0
- package/dist/components/InputOTP.js +25 -0
- package/dist/components/Kbd.d.ts +26 -0
- package/dist/components/Kbd.js +11 -0
- package/dist/components/Label.d.ts +20 -0
- package/dist/components/Label.js +17 -0
- package/dist/components/Menubar.d.ts +35 -0
- package/dist/components/Menubar.js +19 -0
- package/dist/components/NativeSelect.d.ts +33 -0
- package/dist/components/NativeSelect.js +37 -0
- package/dist/components/NavigationMenu.d.ts +32 -0
- package/dist/components/NavigationMenu.js +14 -0
- package/dist/components/Pagination.d.ts +28 -0
- package/dist/components/Pagination.js +62 -0
- package/dist/components/Popover.d.ts +28 -0
- package/dist/components/Popover.js +19 -0
- package/dist/components/Progress.d.ts +25 -0
- package/dist/components/Progress.js +37 -0
- package/dist/components/RadioGroup.d.ts +35 -0
- package/dist/components/RadioGroup.js +44 -0
- package/dist/components/Resizable.d.ts +31 -0
- package/dist/components/Resizable.js +17 -0
- package/dist/components/ScrollArea.d.ts +8 -0
- package/dist/components/ScrollArea.js +14 -0
- package/dist/components/Select.d.ts +35 -0
- package/dist/components/Select.js +33 -0
- package/dist/components/Separator.d.ts +10 -0
- package/dist/components/Separator.js +30 -0
- package/dist/components/Sheet.d.ts +31 -0
- package/dist/components/Sheet.js +26 -0
- package/dist/components/Sidebar.d.ts +52 -0
- package/dist/components/Sidebar.js +96 -0
- package/dist/components/Skeleton.d.ts +40 -0
- package/dist/components/Skeleton.js +42 -0
- package/dist/components/Slider.d.ts +26 -0
- package/dist/components/Slider.js +9 -0
- package/dist/components/Spinner.d.ts +7 -0
- package/dist/components/Spinner.js +13 -0
- package/dist/components/Status.d.ts +30 -0
- package/dist/components/Status.js +27 -0
- package/dist/components/Switch.d.ts +27 -0
- package/dist/components/Switch.js +9 -0
- package/dist/components/Table.d.ts +39 -0
- package/dist/components/Table.js +22 -0
- package/dist/components/Tabs.d.ts +32 -0
- package/dist/components/Tabs.js +21 -0
- package/dist/components/Text.d.ts +2 -0
- package/dist/components/Text.js +5 -0
- package/dist/components/Textarea.d.ts +32 -0
- package/dist/components/Textarea.js +15 -0
- package/dist/components/Toaster.d.ts +30 -0
- package/dist/components/Toaster.js +9 -0
- package/dist/components/Toggle.d.ts +34 -0
- package/dist/components/Toggle.js +31 -0
- package/dist/components/ToggleGroup.d.ts +46 -0
- package/dist/components/ToggleGroup.js +26 -0
- package/dist/components/Tooltip.d.ts +25 -0
- package/dist/components/Tooltip.js +12 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/accordion.js +81 -0
- package/dist/components/ui/alert-dialog.d.ts +18 -0
- package/dist/components/ui/alert-dialog.js +154 -0
- package/dist/components/ui/alert.d.ts +10 -0
- package/dist/components/ui/alert.js +64 -0
- package/dist/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/components/ui/aspect-ratio.js +11 -0
- package/dist/components/ui/avatar.d.ts +11 -0
- package/dist/components/ui/avatar.js +57 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/badge.js +42 -0
- package/dist/components/ui/breadcrumb.d.ts +11 -0
- package/dist/components/ui/breadcrumb.js +87 -0
- package/dist/components/ui/button-group.d.ts +11 -0
- package/dist/components/ui/button-group.js +37 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/button.js +55 -0
- package/dist/components/ui/card.d.ts +11 -0
- package/dist/components/ui/card.js +82 -0
- package/dist/components/ui/carousel.d.ts +28 -0
- package/dist/components/ui/carousel.js +196 -0
- package/dist/components/ui/chart.d.ts +44 -0
- package/dist/components/ui/chart.js +198 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox.js +33 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/collapsible.js +33 -0
- package/dist/components/ui/combobox.d.ts +24 -0
- package/dist/components/ui/combobox.js +160 -0
- package/dist/components/ui/command.d.ts +18 -0
- package/dist/components/ui/command.js +142 -0
- package/dist/components/ui/context-menu.d.ts +31 -0
- package/dist/components/ui/context-menu.js +73 -0
- package/dist/components/ui/dialog.d.ts +17 -0
- package/dist/components/ui/dialog.js +138 -0
- package/dist/components/ui/direction.d.ts +7 -0
- package/dist/components/ui/direction.js +14 -0
- package/dist/components/ui/drawer.d.ts +13 -0
- package/dist/components/ui/drawer.js +101 -0
- package/dist/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/components/ui/dropdown-menu.js +98 -0
- package/dist/components/ui/empty.d.ts +11 -0
- package/dist/components/ui/empty.js +97 -0
- package/dist/components/ui/field.d.ts +24 -0
- package/dist/components/ui/field.js +110 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/hover-card.js +37 -0
- package/dist/components/ui/input-group.d.ts +16 -0
- package/dist/components/ui/input-group.js +111 -0
- package/dist/components/ui/input-otp.d.ts +11 -0
- package/dist/components/ui/input-otp.js +66 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/input.js +19 -0
- package/dist/components/ui/item.d.ts +23 -0
- package/dist/components/ui/item.js +181 -0
- package/dist/components/ui/kbd.d.ts +3 -0
- package/dist/components/ui/kbd.js +28 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.js +23 -0
- package/dist/components/ui/menubar.d.ts +30 -0
- package/dist/components/ui/menubar.js +119 -0
- package/dist/components/ui/native-select.d.ts +8 -0
- package/dist/components/ui/native-select.js +49 -0
- package/dist/components/ui/navigation-menu.d.ts +14 -0
- package/dist/components/ui/navigation-menu.js +139 -0
- package/dist/components/ui/pagination.d.ts +17 -0
- package/dist/components/ui/pagination.js +120 -0
- package/dist/components/ui/popover.d.ts +10 -0
- package/dist/components/ui/popover.js +37 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group.js +44 -0
- package/dist/components/ui/resizable.d.ts +7 -0
- package/dist/components/ui/resizable.js +44 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/scroll-area.js +59 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/select.js +131 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.js +27 -0
- package/dist/components/ui/sheet.d.ts +14 -0
- package/dist/components/ui/sheet.js +113 -0
- package/dist/components/ui/sidebar.d.ts +69 -0
- package/dist/components/ui/sidebar.js +459 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/slider.js +60 -0
- package/dist/components/ui/sonner.d.ts +3 -0
- package/dist/components/ui/sonner.js +38 -0
- package/dist/components/ui/spinner.d.ts +2 -0
- package/dist/components/ui/spinner.js +13 -0
- package/dist/components/ui/switch.d.ts +6 -0
- package/dist/components/ui/switch.js +32 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/table.js +95 -0
- package/dist/components/ui/tabs.d.ts +11 -0
- package/dist/components/ui/tabs.js +87 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/textarea.js +18 -0
- package/dist/components/ui/toggle-group.d.ts +10 -0
- package/dist/components/ui/toggle-group.js +76 -0
- package/dist/components/ui/toggle.d.ts +9 -0
- package/dist/components/ui/toggle.js +43 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip.js +53 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +18 -0
- package/dist/index.d.ts +122 -0
- package/dist/index.js +61 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +8 -0
- package/dist/primitives/createText.d.ts +103 -0
- package/dist/primitives/createText.js +183 -0
- package/dist/primitives/resolveProperties.d.ts +17 -0
- package/dist/stylex.css +1450 -0
- package/dist/tokens/animations.d.ts +126 -0
- package/dist/tokens/animations.js +61 -0
- package/dist/tokens/tokens.stylex.d.ts +85 -0
- package/dist/tokens/tokens.stylex.js +81 -0
- package/dist/utils/box-styles.d.ts +1117 -0
- package/dist/utils/box-styles.js +1455 -0
- package/dist/utils/grid.d.ts +4 -0
- package/dist/utils/resolvers.d.ts +10 -0
- package/dist/utils/resolvers.js +356 -0
- package/dist/utils/types.d.ts +133 -0
- package/package.json +80 -0
- package/src/theme.css +206 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type SeparatorSpacing = 'sm' | 'md' | 'lg';
|
|
3
|
+
export type SeparatorOrientation = 'horizontal' | 'vertical';
|
|
4
|
+
export interface SeparatorProps {
|
|
5
|
+
/** Axis of the rule. Defaults to 'horizontal'. */
|
|
6
|
+
orientation?: SeparatorOrientation;
|
|
7
|
+
/** Enumerated surrounding whitespace. Defaults to 'md'. */
|
|
8
|
+
spacing?: SeparatorSpacing;
|
|
9
|
+
}
|
|
10
|
+
export declare function Separator({ orientation, spacing, }: SeparatorProps): React.JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Separator as Separator$1 } from './ui/separator.js';
|
|
4
|
+
|
|
5
|
+
const SPACING_MAP = {
|
|
6
|
+
horizontal: {
|
|
7
|
+
sm: "my-2",
|
|
8
|
+
md: "my-4",
|
|
9
|
+
lg: "my-8"
|
|
10
|
+
},
|
|
11
|
+
vertical: {
|
|
12
|
+
sm: "mx-2",
|
|
13
|
+
md: "mx-4",
|
|
14
|
+
lg: "mx-8"
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
function Separator({
|
|
18
|
+
orientation = "horizontal",
|
|
19
|
+
spacing = "md"
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
Separator$1,
|
|
23
|
+
{
|
|
24
|
+
orientation,
|
|
25
|
+
className: SPACING_MAP[orientation][spacing]
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { Separator };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Sheet — a closed convenience wrapper over the shadcn Sheet primitives.
|
|
4
|
+
*
|
|
5
|
+
* The underlying Sheet passes `className` through to both the overlay and
|
|
6
|
+
* the slide-in panel, and accepts arbitrary children without structural
|
|
7
|
+
* guidance. This wrapper closes that:
|
|
8
|
+
* - `side` is the only placement control, already enumerated by the
|
|
9
|
+
* primitive; the wrapper just keeps callers from reaching past it.
|
|
10
|
+
* - Header (title + description) is composed internally from typed props
|
|
11
|
+
* rather than left as free-form children, ensuring consistent padding
|
|
12
|
+
* and typography every time.
|
|
13
|
+
* - No `className` or `style` escape hatch on any public prop.
|
|
14
|
+
*/
|
|
15
|
+
export interface SheetProps {
|
|
16
|
+
/** Element that opens the sheet (e.g. a Button). */
|
|
17
|
+
trigger: React.ReactNode;
|
|
18
|
+
/** Accessible panel title. */
|
|
19
|
+
title?: string;
|
|
20
|
+
/** Optional subtitle rendered below the title. */
|
|
21
|
+
description?: string;
|
|
22
|
+
/** Edge from which the panel slides in; defaults to 'right'. */
|
|
23
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
24
|
+
/** Panel body content. */
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
/** Controlled open state. */
|
|
27
|
+
open?: boolean;
|
|
28
|
+
/** Called when the open state should change. */
|
|
29
|
+
onOpenChange?: (open: boolean) => void;
|
|
30
|
+
}
|
|
31
|
+
export declare function Sheet({ trigger, title, description, side, children, open, onOpenChange, }: SheetProps): React.JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Sheet as Sheet$1, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription } from './ui/sheet.js';
|
|
4
|
+
|
|
5
|
+
function Sheet({
|
|
6
|
+
trigger,
|
|
7
|
+
title,
|
|
8
|
+
description,
|
|
9
|
+
side = "right",
|
|
10
|
+
children,
|
|
11
|
+
open,
|
|
12
|
+
onOpenChange
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ jsxs(Sheet$1, { open, onOpenChange, children: [
|
|
15
|
+
/* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: trigger }),
|
|
16
|
+
/* @__PURE__ */ jsxs(SheetContent, { side, children: [
|
|
17
|
+
(title || description) && /* @__PURE__ */ jsxs(SheetHeader, { children: [
|
|
18
|
+
title && /* @__PURE__ */ jsx(SheetTitle, { children: title }),
|
|
19
|
+
description && /* @__PURE__ */ jsx(SheetDescription, { children: description })
|
|
20
|
+
] }),
|
|
21
|
+
children
|
|
22
|
+
] })
|
|
23
|
+
] });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { Sheet };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Sidebar — closed app-shell wrapper over shadcn's Sidebar primitive family.
|
|
4
|
+
*
|
|
5
|
+
* Matches the shadcn "sidebar-07" behaviour from a typed data model:
|
|
6
|
+
* - `collapsible="icon"` — collapses to an icon rail (toggle via the trigger,
|
|
7
|
+
* the rail edge, or Cmd/Ctrl+B). Labels hide; icons + tooltips remain.
|
|
8
|
+
* - items take an `icon`, can be `active`, and may nest `items` to become a
|
|
9
|
+
* collapsible sub-menu (chevron expands an indented list).
|
|
10
|
+
* - optional `brand` header (icon + title + subtitle) and `user` footer
|
|
11
|
+
* (avatar + name + email), both of which also collapse to their icon.
|
|
12
|
+
* - `children` is the main inset content; it gets a header with the trigger.
|
|
13
|
+
* - No `className`/`style` escape hatch. Need badges or actions? Add typed
|
|
14
|
+
* fields to SidebarNavItem here.
|
|
15
|
+
*/
|
|
16
|
+
export interface SidebarNavSubItem {
|
|
17
|
+
label: string;
|
|
18
|
+
active?: boolean;
|
|
19
|
+
onSelect?: () => void;
|
|
20
|
+
}
|
|
21
|
+
export interface SidebarNavItem {
|
|
22
|
+
label: string;
|
|
23
|
+
/** Leading icon (e.g. a lucide/hugeicons element). Shown in the icon rail. */
|
|
24
|
+
icon?: React.ReactNode;
|
|
25
|
+
active?: boolean;
|
|
26
|
+
onSelect?: () => void;
|
|
27
|
+
/** Nested items turn this into a collapsible sub-menu. */
|
|
28
|
+
items?: SidebarNavSubItem[];
|
|
29
|
+
/** Whether the sub-menu starts expanded. */
|
|
30
|
+
defaultOpen?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface SidebarNavGroup {
|
|
33
|
+
label?: string;
|
|
34
|
+
items: SidebarNavItem[];
|
|
35
|
+
}
|
|
36
|
+
export interface SidebarBrand {
|
|
37
|
+
icon?: React.ReactNode;
|
|
38
|
+
title: string;
|
|
39
|
+
subtitle?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface SidebarUser {
|
|
42
|
+
name: string;
|
|
43
|
+
email?: string;
|
|
44
|
+
avatar?: React.ReactNode;
|
|
45
|
+
}
|
|
46
|
+
export interface SidebarProps {
|
|
47
|
+
groups: SidebarNavGroup[];
|
|
48
|
+
brand?: SidebarBrand;
|
|
49
|
+
user?: SidebarUser;
|
|
50
|
+
children: React.ReactNode;
|
|
51
|
+
}
|
|
52
|
+
export declare function Sidebar({ groups, brand, user, children }: SidebarProps): React.JSX.Element;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { SidebarProvider, Sidebar as Sidebar$1, SidebarHeader, SidebarMenu, SidebarMenuItem, SidebarMenuButton, SidebarContent, SidebarGroup, SidebarGroupLabel, SidebarFooter, SidebarRail, SidebarInset, SidebarTrigger, SidebarMenuSub, SidebarMenuSubItem, SidebarMenuSubButton } from './ui/sidebar.js';
|
|
4
|
+
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from './ui/collapsible.js';
|
|
5
|
+
import { TooltipProvider } from './ui/tooltip.js';
|
|
6
|
+
|
|
7
|
+
function Chevron() {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
"svg",
|
|
10
|
+
{
|
|
11
|
+
className: "ml-auto size-4 shrink-0 text-sidebar-foreground/60 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90",
|
|
12
|
+
viewBox: "0 0 24 24",
|
|
13
|
+
fill: "none",
|
|
14
|
+
stroke: "currentColor",
|
|
15
|
+
strokeWidth: "2",
|
|
16
|
+
strokeLinecap: "round",
|
|
17
|
+
strokeLinejoin: "round",
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" })
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
function NavItem({ item }) {
|
|
24
|
+
if (item.items && item.items.length > 0) {
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
Collapsible,
|
|
27
|
+
{
|
|
28
|
+
asChild: true,
|
|
29
|
+
defaultOpen: item.defaultOpen ?? item.active,
|
|
30
|
+
className: "group/collapsible",
|
|
31
|
+
children: /* @__PURE__ */ jsxs(SidebarMenuItem, { children: [
|
|
32
|
+
/* @__PURE__ */ jsx(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(SidebarMenuButton, { tooltip: item.label, isActive: item.active, children: [
|
|
33
|
+
item.icon,
|
|
34
|
+
/* @__PURE__ */ jsx("span", { children: item.label }),
|
|
35
|
+
/* @__PURE__ */ jsx(Chevron, {})
|
|
36
|
+
] }) }),
|
|
37
|
+
/* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx(SidebarMenuSub, { children: item.items.map((sub) => /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(
|
|
38
|
+
SidebarMenuSubButton,
|
|
39
|
+
{
|
|
40
|
+
isActive: sub.active,
|
|
41
|
+
onClick: sub.onSelect,
|
|
42
|
+
children: /* @__PURE__ */ jsx("span", { children: sub.label })
|
|
43
|
+
}
|
|
44
|
+
) }, sub.label)) }) })
|
|
45
|
+
] })
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
return /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(
|
|
50
|
+
SidebarMenuButton,
|
|
51
|
+
{
|
|
52
|
+
tooltip: item.label,
|
|
53
|
+
isActive: item.active,
|
|
54
|
+
onClick: item.onSelect,
|
|
55
|
+
children: [
|
|
56
|
+
item.icon,
|
|
57
|
+
/* @__PURE__ */ jsx("span", { children: item.label })
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
) });
|
|
61
|
+
}
|
|
62
|
+
function Sidebar({ groups, brand, user, children }) {
|
|
63
|
+
return (
|
|
64
|
+
// The icon-rail tooltips on SidebarMenuButton need a TooltipProvider; this
|
|
65
|
+
// shadcn build's SidebarProvider doesn't include one, so we add it.
|
|
66
|
+
/* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs(SidebarProvider, { className: "h-full min-h-0", children: [
|
|
67
|
+
/* @__PURE__ */ jsxs(Sidebar$1, { collapsible: "icon", children: [
|
|
68
|
+
brand && /* @__PURE__ */ jsx(SidebarHeader, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(SidebarMenuButton, { size: "lg", children: [
|
|
69
|
+
brand.icon && /* @__PURE__ */ jsx("div", { className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground", children: brand.icon }),
|
|
70
|
+
/* @__PURE__ */ jsxs("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
71
|
+
/* @__PURE__ */ jsx("span", { className: "truncate font-semibold", children: brand.title }),
|
|
72
|
+
brand.subtitle && /* @__PURE__ */ jsx("span", { className: "truncate text-xs text-sidebar-foreground/70", children: brand.subtitle })
|
|
73
|
+
] })
|
|
74
|
+
] }) }) }) }),
|
|
75
|
+
/* @__PURE__ */ jsx(SidebarContent, { children: groups.map((group, groupIndex) => /* @__PURE__ */ jsxs(SidebarGroup, { children: [
|
|
76
|
+
group.label && /* @__PURE__ */ jsx(SidebarGroupLabel, { children: group.label }),
|
|
77
|
+
/* @__PURE__ */ jsx(SidebarMenu, { children: group.items.map((item) => /* @__PURE__ */ jsx(NavItem, { item }, item.label)) })
|
|
78
|
+
] }, groupIndex)) }),
|
|
79
|
+
user && /* @__PURE__ */ jsx(SidebarFooter, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(SidebarMenuButton, { size: "lg", children: [
|
|
80
|
+
user.avatar && /* @__PURE__ */ jsx("div", { className: "size-8 shrink-0 overflow-hidden rounded-lg", children: user.avatar }),
|
|
81
|
+
/* @__PURE__ */ jsxs("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
82
|
+
/* @__PURE__ */ jsx("span", { className: "truncate font-semibold", children: user.name }),
|
|
83
|
+
user.email && /* @__PURE__ */ jsx("span", { className: "truncate text-xs text-sidebar-foreground/70", children: user.email })
|
|
84
|
+
] })
|
|
85
|
+
] }) }) }) }),
|
|
86
|
+
/* @__PURE__ */ jsx(SidebarRail, {})
|
|
87
|
+
] }),
|
|
88
|
+
/* @__PURE__ */ jsxs(SidebarInset, { children: [
|
|
89
|
+
/* @__PURE__ */ jsx("header", { className: "flex h-14 shrink-0 items-center gap-2 border-b border-border px-4", children: /* @__PURE__ */ jsx(SidebarTrigger, { className: "-ml-1" }) }),
|
|
90
|
+
children
|
|
91
|
+
] })
|
|
92
|
+
] }) })
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { Sidebar };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Skeleton — a closed wrapper over shadcn's Skeleton primitive.
|
|
4
|
+
*
|
|
5
|
+
* shadcn's <Skeleton> accepts arbitrary `className` for width/height/shape,
|
|
6
|
+
* making every usage a one-off. This wrapper closes it:
|
|
7
|
+
* - `width` and `height` are enumerated tokens mapped to fixed Tailwind
|
|
8
|
+
* classes — the only expressible sizes are correct, system-sanctioned ones.
|
|
9
|
+
* - `shape` ('line'|'circle'|'block') controls border-radius declaratively.
|
|
10
|
+
* - NO `className`/`style` escape hatch. Every skeleton on screen is one of
|
|
11
|
+
* a finite, on-brand set of shapes.
|
|
12
|
+
* - Need a new size step? Add it to the token maps here.
|
|
13
|
+
*/
|
|
14
|
+
declare const WIDTH_MAP: {
|
|
15
|
+
readonly xs: "w-10";
|
|
16
|
+
readonly sm: "w-20";
|
|
17
|
+
readonly md: "w-40";
|
|
18
|
+
readonly lg: "w-64";
|
|
19
|
+
readonly full: "w-full";
|
|
20
|
+
};
|
|
21
|
+
declare const HEIGHT_MAP: {
|
|
22
|
+
readonly xs: "h-3";
|
|
23
|
+
readonly sm: "h-4";
|
|
24
|
+
readonly md: "h-6";
|
|
25
|
+
readonly lg: "h-10";
|
|
26
|
+
readonly full: "h-full";
|
|
27
|
+
};
|
|
28
|
+
export type SkeletonWidth = keyof typeof WIDTH_MAP;
|
|
29
|
+
export type SkeletonHeight = keyof typeof HEIGHT_MAP;
|
|
30
|
+
export type SkeletonShape = 'line' | 'circle' | 'block';
|
|
31
|
+
export interface SkeletonProps {
|
|
32
|
+
/** Enumerated width token. Defaults to 'full'. */
|
|
33
|
+
width?: SkeletonWidth;
|
|
34
|
+
/** Enumerated height token. Defaults to 'sm'. */
|
|
35
|
+
height?: SkeletonHeight;
|
|
36
|
+
/** Shape treatment: line = rounded bar, circle = pill/avatar, block = card. */
|
|
37
|
+
shape?: SkeletonShape;
|
|
38
|
+
}
|
|
39
|
+
export declare function Skeleton({ width, height, shape, }: SkeletonProps): React.JSX.Element;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
const WIDTH_MAP = {
|
|
5
|
+
xs: "w-10",
|
|
6
|
+
sm: "w-20",
|
|
7
|
+
md: "w-40",
|
|
8
|
+
lg: "w-64",
|
|
9
|
+
full: "w-full"
|
|
10
|
+
};
|
|
11
|
+
const HEIGHT_MAP = {
|
|
12
|
+
xs: "h-3",
|
|
13
|
+
sm: "h-4",
|
|
14
|
+
md: "h-6",
|
|
15
|
+
lg: "h-10",
|
|
16
|
+
full: "h-full"
|
|
17
|
+
};
|
|
18
|
+
const shapeVariants = cva("animate-pulse bg-muted", {
|
|
19
|
+
variants: {
|
|
20
|
+
shape: {
|
|
21
|
+
line: "rounded-md",
|
|
22
|
+
circle: "rounded-full",
|
|
23
|
+
block: "rounded-lg"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: { shape: "line" }
|
|
27
|
+
});
|
|
28
|
+
function Skeleton({
|
|
29
|
+
width = "full",
|
|
30
|
+
height = "sm",
|
|
31
|
+
shape = "line"
|
|
32
|
+
}) {
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
"data-slot": "skeleton",
|
|
37
|
+
className: `${shapeVariants({ shape })} ${WIDTH_MAP[width]} ${HEIGHT_MAP[height]}`
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { Skeleton };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Slider — closed wrapper over shadcn's <Slider>.
|
|
4
|
+
*
|
|
5
|
+
* shadcn's Slider accepts `className`, which lets callers restyle the track,
|
|
6
|
+
* range fill, and thumb arbitrarily. This wrapper closes every visual escape
|
|
7
|
+
* hatch while keeping the full behavioural surface:
|
|
8
|
+
* - value, defaultValue, min, max, step, and onValueChange all pass through.
|
|
9
|
+
* - there is NO `className` / `style` prop. Track colour, thumb size, and
|
|
10
|
+
* focus ring are fixed to the design system's token values.
|
|
11
|
+
* - need a coloured range (e.g. warning-amber)? Add a `color` prop here —
|
|
12
|
+
* a deliberate, reviewable change — rather than a one-off class.
|
|
13
|
+
*/
|
|
14
|
+
export interface SliderProps {
|
|
15
|
+
value?: number[];
|
|
16
|
+
defaultValue?: number[];
|
|
17
|
+
min?: number;
|
|
18
|
+
max?: number;
|
|
19
|
+
step?: number;
|
|
20
|
+
onValueChange?: (value: number[]) => void;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
id?: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
orientation?: 'horizontal' | 'vertical';
|
|
25
|
+
}
|
|
26
|
+
export declare function Slider({ ...props }: SliderProps): React.JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface SpinnerProps {
|
|
3
|
+
/** Enumerated size. Defaults to 'md'. */
|
|
4
|
+
size?: 'sm' | 'md' | 'lg';
|
|
5
|
+
}
|
|
6
|
+
/** Closed loading spinner — no className/style. */
|
|
7
|
+
export declare function Spinner({ size }: SpinnerProps): React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Spinner as Spinner$1 } from './ui/spinner.js';
|
|
3
|
+
|
|
4
|
+
const SIZE_CLASS = {
|
|
5
|
+
sm: "size-3",
|
|
6
|
+
md: "size-4",
|
|
7
|
+
lg: "size-6"
|
|
8
|
+
};
|
|
9
|
+
function Spinner({ size = "md" }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(Spinner$1, { className: SIZE_CLASS[size] });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { Spinner };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
/**
|
|
3
|
+
* Status — an EXEMPLAR of the HIYF philosophy applied to the shadcn base.
|
|
4
|
+
*
|
|
5
|
+
* shadcn's <Badge> is open: it takes arbitrary `className`, a `variant` named by
|
|
6
|
+
* appearance (default/secondary/destructive/outline), and any children. This
|
|
7
|
+
* wrapper closes it down:
|
|
8
|
+
* - `color` is named by INTENT (success/warning/danger/info/neutral), not by
|
|
9
|
+
* appearance — the same idea as HIYF's "tokens as intent".
|
|
10
|
+
* - there is NO `className` / `style` escape hatch, so every Status on screen
|
|
11
|
+
* is one of a handful of correct, on-brand treatments. An off-brand status
|
|
12
|
+
* chip is simply not expressible.
|
|
13
|
+
* - need another treatment? Add a `color` here — a deliberate, reviewable
|
|
14
|
+
* change to the design system — rather than passing a one-off class.
|
|
15
|
+
*
|
|
16
|
+
* Copy this shape to wrap any other shadcn primitive in lockdown style.
|
|
17
|
+
*/
|
|
18
|
+
declare const statusVariants: (props?: ({
|
|
19
|
+
color?: "danger" | "warning" | "success" | "neutral" | "info" | null | undefined;
|
|
20
|
+
size?: "sm" | "md" | null | undefined;
|
|
21
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
22
|
+
export type StatusColor = NonNullable<VariantProps<typeof statusVariants>['color']>;
|
|
23
|
+
export interface StatusProps {
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
/** Named by intent, not appearance. */
|
|
26
|
+
color?: StatusColor;
|
|
27
|
+
size?: 'sm' | 'md';
|
|
28
|
+
}
|
|
29
|
+
export declare function Status({ children, color, size }: StatusProps): import("react").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
const statusVariants = cva(
|
|
5
|
+
"inline-flex w-fit items-center gap-1.5 rounded-full border border-transparent font-medium",
|
|
6
|
+
{
|
|
7
|
+
variants: {
|
|
8
|
+
color: {
|
|
9
|
+
neutral: "bg-muted text-muted-foreground",
|
|
10
|
+
success: "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",
|
|
11
|
+
warning: "bg-amber-500/10 text-amber-600 dark:text-amber-400",
|
|
12
|
+
danger: "bg-destructive/10 text-destructive",
|
|
13
|
+
info: "bg-blue-500/10 text-blue-600 dark:text-blue-400"
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
sm: "px-2 py-0.5 text-xs",
|
|
17
|
+
md: "px-2.5 py-1 text-sm"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: { color: "neutral", size: "sm" }
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
function Status({ children, color, size }) {
|
|
24
|
+
return /* @__PURE__ */ jsx("span", { className: statusVariants({ color, size }), children });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { Status };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Switch — closed wrapper over shadcn's <Switch>.
|
|
4
|
+
*
|
|
5
|
+
* shadcn's Switch accepts `className` and an internal `size` prop that spans
|
|
6
|
+
* both layout and visual scale. This wrapper closes the className escape hatch
|
|
7
|
+
* while keeping `size` as the only sanctioned scale variant:
|
|
8
|
+
* - `size` maps directly to the base component's two options (sm / md),
|
|
9
|
+
* renamed to match HIYF conventions.
|
|
10
|
+
* - there is NO `className` / `style` prop. The checked colour, thumb shape,
|
|
11
|
+
* and animation are fixed to the design system's token values.
|
|
12
|
+
* - need a third size? Add it here — a deliberate, reviewable change.
|
|
13
|
+
*/
|
|
14
|
+
export interface SwitchProps {
|
|
15
|
+
/** Controls the track and thumb scale. Defaults to 'md'. */
|
|
16
|
+
size?: 'sm' | 'md';
|
|
17
|
+
checked?: boolean;
|
|
18
|
+
defaultChecked?: boolean;
|
|
19
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** For associating with a <Label htmlFor={id}>. */
|
|
22
|
+
id?: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
value?: string;
|
|
25
|
+
required?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function Switch({ size, ...props }: SwitchProps): React.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Switch as Switch$1 } from './ui/switch.js';
|
|
4
|
+
|
|
5
|
+
function Switch({ size = "md", ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(Switch$1, { size: size === "md" ? "default" : "sm", ...props });
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { Switch };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Table — a closed generic data table wrapper over shadcn's Table primitive family.
|
|
4
|
+
*
|
|
5
|
+
* shadcn's Table passes `className` to every sub-part, leaving consumers free to
|
|
6
|
+
* apply arbitrary one-off styles and compose rows however they like. This wrapper
|
|
7
|
+
* closes it:
|
|
8
|
+
* - `columns` is a typed column descriptor array with `key`, `header`, `align`,
|
|
9
|
+
* and an optional `render` function; no className escapes.
|
|
10
|
+
* - `data` is a generic array of row objects; the type parameter `T` flows
|
|
11
|
+
* through so column keys and render callbacks are fully type-checked.
|
|
12
|
+
* - `caption` is an optional accessible table caption.
|
|
13
|
+
* - NO `className`/`style` escape hatch. Every table on screen is rendered by
|
|
14
|
+
* the same correct, on-brand structure.
|
|
15
|
+
* - Need a new alignment or row variant? Add it to the column descriptor here.
|
|
16
|
+
*/
|
|
17
|
+
export interface TableColumn<T> {
|
|
18
|
+
/** Property key on each data row (used as default cell content). */
|
|
19
|
+
key: string;
|
|
20
|
+
/** Column header label. */
|
|
21
|
+
header: string;
|
|
22
|
+
/** Text alignment for both the header and cells. Defaults to 'left'. */
|
|
23
|
+
align?: 'left' | 'right' | 'center';
|
|
24
|
+
/**
|
|
25
|
+
* Optional custom renderer for this column's cell.
|
|
26
|
+
* Receives the full row object and returns a React node.
|
|
27
|
+
*/
|
|
28
|
+
render?: (row: T) => React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export interface TableProps<T> {
|
|
31
|
+
/** Column definitions — header labels, keys, alignment, and optional renderers. */
|
|
32
|
+
columns: TableColumn<T>[];
|
|
33
|
+
/** Array of data rows to render. */
|
|
34
|
+
data: T[];
|
|
35
|
+
/** Optional accessible caption rendered below the table. */
|
|
36
|
+
caption?: string;
|
|
37
|
+
}
|
|
38
|
+
/** Closed generic data table — no className/style. */
|
|
39
|
+
export declare function Table<T extends Record<string, unknown>>({ columns, data, caption, }: TableProps<T>): React.JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Table as Table$1, TableCaption, TableHeader, TableRow, TableHead, TableBody, TableCell } from './ui/table.js';
|
|
4
|
+
|
|
5
|
+
const ALIGN_CLASS = {
|
|
6
|
+
left: "text-left",
|
|
7
|
+
right: "text-right",
|
|
8
|
+
center: "text-center"
|
|
9
|
+
};
|
|
10
|
+
function Table({
|
|
11
|
+
columns,
|
|
12
|
+
data,
|
|
13
|
+
caption
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ jsxs(Table$1, { children: [
|
|
16
|
+
caption && /* @__PURE__ */ jsx(TableCaption, { children: caption }),
|
|
17
|
+
/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsx(TableRow, { children: columns.map((col) => /* @__PURE__ */ jsx(TableHead, { className: ALIGN_CLASS[col.align ?? "left"], children: col.header }, col.key)) }) }),
|
|
18
|
+
/* @__PURE__ */ jsx(TableBody, { children: data.map((row, rowIndex) => /* @__PURE__ */ jsx(TableRow, { children: columns.map((col) => /* @__PURE__ */ jsx(TableCell, { className: ALIGN_CLASS[col.align ?? "left"], children: col.render ? col.render(row) : String(row[col.key] ?? "") }, col.key)) }, rowIndex)) })
|
|
19
|
+
] });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { Table };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Tabs — closed wrapper over shadcn's composable Tabs parts.
|
|
4
|
+
*
|
|
5
|
+
* The raw parts accept arbitrary className and free-form children. This
|
|
6
|
+
* wrapper closes that down by driving the tab strip and panels from a
|
|
7
|
+
* typed `tabs` data model:
|
|
8
|
+
* - `tabs` is the only way to populate tabs; no ad-hoc TabsTrigger /
|
|
9
|
+
* TabsContent imports needed (or possible) from consumer code.
|
|
10
|
+
* - Controlled and uncontrolled modes are supported via `value` /
|
|
11
|
+
* `onValueChange` / `defaultValue`, matching the Radix root contract.
|
|
12
|
+
* - No `className` or `style` escape hatch on the public API.
|
|
13
|
+
*/
|
|
14
|
+
export interface TabItem {
|
|
15
|
+
/** Unique identifier for the tab; used as the Radix `value`. */
|
|
16
|
+
value: string;
|
|
17
|
+
/** Label rendered in the tab trigger button. */
|
|
18
|
+
label: string;
|
|
19
|
+
/** Content rendered in the corresponding tab panel. */
|
|
20
|
+
content: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export interface TabsProps {
|
|
23
|
+
/** Ordered list of tab definitions. */
|
|
24
|
+
tabs: TabItem[];
|
|
25
|
+
/** Tab value selected on first render (uncontrolled). */
|
|
26
|
+
defaultValue?: string;
|
|
27
|
+
/** Controlled selected tab value. */
|
|
28
|
+
value?: string;
|
|
29
|
+
/** Called when the selected tab changes. */
|
|
30
|
+
onValueChange?: (value: string) => void;
|
|
31
|
+
}
|
|
32
|
+
export declare function Tabs({ tabs, defaultValue, value, onValueChange }: TabsProps): React.JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Tabs as Tabs$1, TabsList, TabsTrigger, TabsContent } from './ui/tabs.js';
|
|
4
|
+
|
|
5
|
+
function Tabs({ tabs, defaultValue, value, onValueChange }) {
|
|
6
|
+
const resolvedDefault = defaultValue ?? tabs[0]?.value;
|
|
7
|
+
return /* @__PURE__ */ jsxs(
|
|
8
|
+
Tabs$1,
|
|
9
|
+
{
|
|
10
|
+
defaultValue: resolvedDefault,
|
|
11
|
+
value,
|
|
12
|
+
onValueChange,
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ jsx(TabsList, { children: tabs.map((tab) => /* @__PURE__ */ jsx(TabsTrigger, { value: tab.value, children: tab.label }, tab.value)) }),
|
|
15
|
+
tabs.map((tab) => /* @__PURE__ */ jsx(TabsContent, { value: tab.value, children: tab.content }, tab.value))
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { Tabs };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Textarea — closed wrapper over shadcn's <Textarea>.
|
|
4
|
+
*
|
|
5
|
+
* shadcn's Textarea accepts arbitrary `className`, leaving visual treatment
|
|
6
|
+
* entirely up to the caller. This wrapper closes that escape hatch:
|
|
7
|
+
* - `invalid` is the only expressible state variation; it wires up
|
|
8
|
+
* `aria-invalid` so the base component's built-in error ring activates.
|
|
9
|
+
* - `rows` controls height for fixed-size scenarios (the base uses
|
|
10
|
+
* field-sizing: content by default; setting rows overrides that).
|
|
11
|
+
* - there is NO `className` / `style` prop.
|
|
12
|
+
* - standard behaviour props pass through unchanged.
|
|
13
|
+
* - need a resize mode or other treatment? Add a prop here.
|
|
14
|
+
*/
|
|
15
|
+
export interface TextareaProps {
|
|
16
|
+
/** Activates the error ring. Prefer pairing with a <Label> and error text. */
|
|
17
|
+
invalid?: boolean;
|
|
18
|
+
/** Fixed row height. Omit to use content-sized auto-grow. */
|
|
19
|
+
rows?: number;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
value?: string;
|
|
22
|
+
defaultValue?: string;
|
|
23
|
+
onChange?: React.ChangeEventHandler<HTMLTextAreaElement>;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
id?: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
readOnly?: boolean;
|
|
28
|
+
required?: boolean;
|
|
29
|
+
autoFocus?: boolean;
|
|
30
|
+
autoComplete?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function Textarea({ invalid, rows, ...rest }: TextareaProps): React.JSX.Element;
|