@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,23 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ContextMenu as ContextMenu$1, ContextMenuTrigger, ContextMenuContent, ContextMenuSeparator, ContextMenuItem } from './ui/context-menu.js';
|
|
5
|
+
|
|
6
|
+
function ContextMenu({ trigger, items }) {
|
|
7
|
+
return /* @__PURE__ */ jsxs(ContextMenu$1, { children: [
|
|
8
|
+
/* @__PURE__ */ jsx(ContextMenuTrigger, { asChild: true, children: trigger }),
|
|
9
|
+
/* @__PURE__ */ jsx(ContextMenuContent, { children: items.map((item, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
10
|
+
item.separatorBefore && /* @__PURE__ */ jsx(ContextMenuSeparator, {}),
|
|
11
|
+
/* @__PURE__ */ jsx(
|
|
12
|
+
ContextMenuItem,
|
|
13
|
+
{
|
|
14
|
+
variant: item.tone === "danger" ? "destructive" : "default",
|
|
15
|
+
onSelect: item.onSelect,
|
|
16
|
+
children: item.label
|
|
17
|
+
}
|
|
18
|
+
)
|
|
19
|
+
] }, index)) })
|
|
20
|
+
] });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { ContextMenu };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface DialogProps {
|
|
3
|
+
/** Element that opens the dialog (e.g. a Button). */
|
|
4
|
+
trigger: React.ReactNode;
|
|
5
|
+
/** Accessible dialog title, rendered in the header. */
|
|
6
|
+
title: string;
|
|
7
|
+
/** Optional subtitle rendered below the title. */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Constrains the dialog width; defaults to 'md'. */
|
|
10
|
+
size?: "sm" | "md" | "lg";
|
|
11
|
+
/** Dialog body content. */
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
/** Rendered in the dialog footer (e.g. action buttons). */
|
|
14
|
+
footer?: React.ReactNode;
|
|
15
|
+
/** Controlled open state. */
|
|
16
|
+
open?: boolean;
|
|
17
|
+
/** Called when the open state should change. */
|
|
18
|
+
onOpenChange?: (open: boolean) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function Dialog({ trigger, title, description, size, children, footer, open, onOpenChange, }: DialogProps): React.JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { cn } from '../lib/utils.js';
|
|
4
|
+
import { Dialog as Dialog$1, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from './ui/dialog.js';
|
|
5
|
+
|
|
6
|
+
const sizeMap = {
|
|
7
|
+
sm: "sm:max-w-sm",
|
|
8
|
+
md: "sm:max-w-md",
|
|
9
|
+
lg: "sm:max-w-lg"
|
|
10
|
+
};
|
|
11
|
+
function Dialog({
|
|
12
|
+
trigger,
|
|
13
|
+
title,
|
|
14
|
+
description,
|
|
15
|
+
size = "md",
|
|
16
|
+
children,
|
|
17
|
+
footer,
|
|
18
|
+
open,
|
|
19
|
+
onOpenChange
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ jsxs(Dialog$1, { open, onOpenChange, children: [
|
|
22
|
+
/* @__PURE__ */ jsx(DialogTrigger, { asChild: true, children: trigger }),
|
|
23
|
+
/* @__PURE__ */ jsxs(DialogContent, { className: cn(sizeMap[size]), children: [
|
|
24
|
+
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
25
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: title }),
|
|
26
|
+
description && /* @__PURE__ */ jsx(DialogDescription, { children: description })
|
|
27
|
+
] }),
|
|
28
|
+
children,
|
|
29
|
+
footer && /* @__PURE__ */ jsx(DialogFooter, { children: footer })
|
|
30
|
+
] })
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { Dialog };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Drawer — a closed convenience wrapper over the vaul-backed shadcn Drawer.
|
|
4
|
+
*
|
|
5
|
+
* The underlying Drawer exposes className on its content panel and leaves
|
|
6
|
+
* header composition entirely to callers. This wrapper closes that:
|
|
7
|
+
* - Title and description are typed props rendered in a consistent
|
|
8
|
+
* DrawerHeader with the system's typographic treatment, rather than
|
|
9
|
+
* free-form children.
|
|
10
|
+
* - The drag handle and bottom-sheet sizing are baked in by the primitive
|
|
11
|
+
* and intentionally not re-exposed here.
|
|
12
|
+
* - No `className` or `style` escape hatch on any public prop.
|
|
13
|
+
*/
|
|
14
|
+
export interface DrawerProps {
|
|
15
|
+
/** Element that opens the drawer (e.g. a Button). */
|
|
16
|
+
trigger: React.ReactNode;
|
|
17
|
+
/** Accessible panel title. */
|
|
18
|
+
title?: string;
|
|
19
|
+
/** Optional subtitle rendered below the title. */
|
|
20
|
+
description?: string;
|
|
21
|
+
/** Panel body content. */
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
/** Controlled open state. */
|
|
24
|
+
open?: boolean;
|
|
25
|
+
/** Called when the open state should change. */
|
|
26
|
+
onOpenChange?: (open: boolean) => void;
|
|
27
|
+
}
|
|
28
|
+
export declare function Drawer({ trigger, title, description, children, open, onOpenChange, }: DrawerProps): React.JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Drawer as Drawer$1, DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription } from './ui/drawer.js';
|
|
4
|
+
|
|
5
|
+
function Drawer({
|
|
6
|
+
trigger,
|
|
7
|
+
title,
|
|
8
|
+
description,
|
|
9
|
+
children,
|
|
10
|
+
open,
|
|
11
|
+
onOpenChange
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsxs(Drawer$1, { open, onOpenChange, children: [
|
|
14
|
+
/* @__PURE__ */ jsx(DrawerTrigger, { asChild: true, children: trigger }),
|
|
15
|
+
/* @__PURE__ */ jsxs(DrawerContent, { children: [
|
|
16
|
+
(title || description) && /* @__PURE__ */ jsxs(DrawerHeader, { children: [
|
|
17
|
+
title && /* @__PURE__ */ jsx(DrawerTitle, { children: title }),
|
|
18
|
+
description && /* @__PURE__ */ jsx(DrawerDescription, { children: description })
|
|
19
|
+
] }),
|
|
20
|
+
children
|
|
21
|
+
] })
|
|
22
|
+
] });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { Drawer };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* DropdownMenu — a closed convenience wrapper over the shadcn DropdownMenu primitives.
|
|
4
|
+
*
|
|
5
|
+
* The raw primitives are composition primitives that accept arbitrary className,
|
|
6
|
+
* free-form children, and any nesting pattern. Callers can — and routinely do —
|
|
7
|
+
* produce menus with inconsistent item shapes, ad-hoc hover colors, and bespoke
|
|
8
|
+
* separators. This wrapper closes that by driving the menu from a typed item
|
|
9
|
+
* model:
|
|
10
|
+
* - `items` is an array of plain data objects with `label`, `onSelect`,
|
|
11
|
+
* `tone`, and `separatorBefore`; no JSX, no className.
|
|
12
|
+
* - `tone: 'danger'` maps to the primitive's `variant="destructive"` so
|
|
13
|
+
* callers express intent, not appearance.
|
|
14
|
+
* - `label` renders a section header above all items when provided.
|
|
15
|
+
* - No `className` or `style` escape hatch on any public prop.
|
|
16
|
+
*/
|
|
17
|
+
export interface DropdownMenuItem {
|
|
18
|
+
/** Display text for the menu item. */
|
|
19
|
+
label: string;
|
|
20
|
+
/** Called when the item is selected. */
|
|
21
|
+
onSelect?: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Intent of the action.
|
|
24
|
+
* 'danger' renders the item in the destructive style.
|
|
25
|
+
*/
|
|
26
|
+
tone?: "default" | "danger";
|
|
27
|
+
/** Render a separator rule immediately before this item. */
|
|
28
|
+
separatorBefore?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface DropdownMenuProps {
|
|
31
|
+
/** Element that opens the menu (e.g. a Button). */
|
|
32
|
+
trigger: React.ReactNode;
|
|
33
|
+
/** Optional group label displayed at the top of the menu. */
|
|
34
|
+
label?: string;
|
|
35
|
+
/** Ordered list of menu items. */
|
|
36
|
+
items: DropdownMenuItem[];
|
|
37
|
+
/** Controlled open state. */
|
|
38
|
+
open?: boolean;
|
|
39
|
+
/** Called when the open state should change. */
|
|
40
|
+
onOpenChange?: (open: boolean) => void;
|
|
41
|
+
}
|
|
42
|
+
export declare function DropdownMenu({ trigger, label, items, open, onOpenChange, }: DropdownMenuProps): React.JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { DropdownMenu as DropdownMenu$1, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuItem } from './ui/dropdown-menu.js';
|
|
5
|
+
|
|
6
|
+
function DropdownMenu({
|
|
7
|
+
trigger,
|
|
8
|
+
label,
|
|
9
|
+
items,
|
|
10
|
+
open,
|
|
11
|
+
onOpenChange
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1, { open, onOpenChange, children: [
|
|
14
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: trigger }),
|
|
15
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { children: /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
|
|
16
|
+
label && /* @__PURE__ */ jsx(DropdownMenuLabel, { children: label }),
|
|
17
|
+
items.map((item, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
18
|
+
item.separatorBefore && /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
DropdownMenuItem,
|
|
21
|
+
{
|
|
22
|
+
variant: item.tone === "danger" ? "destructive" : "default",
|
|
23
|
+
onSelect: item.onSelect,
|
|
24
|
+
children: item.label
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
] }, index))
|
|
28
|
+
] }) })
|
|
29
|
+
] });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { DropdownMenu };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Empty — a closed empty-state wrapper over shadcn's Empty primitive family.
|
|
4
|
+
*
|
|
5
|
+
* shadcn's Empty parts accept arbitrary `className` and free-form children,
|
|
6
|
+
* letting consumers produce wildly inconsistent empty states. This wrapper
|
|
7
|
+
* closes it:
|
|
8
|
+
* - `title` is the required heading; always renders via EmptyTitle.
|
|
9
|
+
* - `description` is optional supporting text; renders via EmptyDescription.
|
|
10
|
+
* - `icon` is an optional React node (e.g. an SVG icon) shown in an
|
|
11
|
+
* EmptyMedia container with the 'icon' variant for correct sizing/bg.
|
|
12
|
+
* - `action` is an optional React node (e.g. a Button) shown below the text.
|
|
13
|
+
* - NO `className`/`style` escape hatch. Every empty state on screen uses
|
|
14
|
+
* the same on-brand structure and spacing.
|
|
15
|
+
* - Need a custom media treatment? Add an enumerated `mediaVariant` prop.
|
|
16
|
+
*/
|
|
17
|
+
export interface EmptyProps {
|
|
18
|
+
/** Primary heading of the empty state. */
|
|
19
|
+
title: string;
|
|
20
|
+
/** Optional supporting description text. */
|
|
21
|
+
description?: string;
|
|
22
|
+
/** Optional icon or illustration rendered above the title. */
|
|
23
|
+
icon?: React.ReactNode;
|
|
24
|
+
/** Optional action element (e.g. a Button) rendered below the text. */
|
|
25
|
+
action?: React.ReactNode;
|
|
26
|
+
}
|
|
27
|
+
/** Closed empty state — no className/style. */
|
|
28
|
+
export declare function Empty({ title, description, icon, action }: EmptyProps): React.JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Empty as Empty$1, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription, EmptyContent } from './ui/empty.js';
|
|
3
|
+
|
|
4
|
+
function Empty({ title, description, icon, action }) {
|
|
5
|
+
return /* @__PURE__ */ jsxs(Empty$1, { children: [
|
|
6
|
+
/* @__PURE__ */ jsxs(EmptyHeader, { children: [
|
|
7
|
+
icon && /* @__PURE__ */ jsx(EmptyMedia, { variant: "icon", children: icon }),
|
|
8
|
+
/* @__PURE__ */ jsx(EmptyTitle, { children: title }),
|
|
9
|
+
description && /* @__PURE__ */ jsx(EmptyDescription, { children: description })
|
|
10
|
+
] }),
|
|
11
|
+
action && /* @__PURE__ */ jsx(EmptyContent, { children: action })
|
|
12
|
+
] });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { Empty };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Field — closed form-field wrapper over shadcn's Field primitives.
|
|
4
|
+
*
|
|
5
|
+
* shadcn's Field parts (FieldLabel, FieldDescription, FieldError) each accept
|
|
6
|
+
* arbitrary `className`, and callers must compose them manually. This wrapper
|
|
7
|
+
* collapses the composition into a single component driven by intent props:
|
|
8
|
+
* - `label` renders a FieldLabel linked to the control via `htmlFor`.
|
|
9
|
+
* - `hint` renders a FieldDescription below the control.
|
|
10
|
+
* - `error` renders a FieldError alert below the control (takes priority
|
|
11
|
+
* over `hint` when both are supplied).
|
|
12
|
+
* - `children` is the form control (e.g., an HIYF <Input> or <Select>).
|
|
13
|
+
* - there is NO `className` / `style` prop.
|
|
14
|
+
* - need horizontal orientation or a fieldset group? Use the raw Field
|
|
15
|
+
* primitives from the ui layer for those advanced cases, or extend
|
|
16
|
+
* this wrapper with an `orientation` prop.
|
|
17
|
+
*/
|
|
18
|
+
export interface FieldProps {
|
|
19
|
+
/** Label text linked to the control. */
|
|
20
|
+
label?: string;
|
|
21
|
+
/** Hint / helper text shown below the control. */
|
|
22
|
+
hint?: string;
|
|
23
|
+
/** Error message shown below the control; marks the field invalid. */
|
|
24
|
+
error?: string;
|
|
25
|
+
/** The `id` of the control, used to link the label via htmlFor. */
|
|
26
|
+
htmlFor?: string;
|
|
27
|
+
/** The form control to render inside the field. */
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export declare function Field({ label, hint, error, htmlFor, children }: FieldProps): React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Field as Field$1, FieldLabel, FieldError, FieldDescription } from './ui/field.js';
|
|
4
|
+
|
|
5
|
+
function Field({ label, hint, error, htmlFor, children }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs(Field$1, { "data-invalid": !!error || void 0, children: [
|
|
7
|
+
label && /* @__PURE__ */ jsx(FieldLabel, { htmlFor, children: label }),
|
|
8
|
+
children,
|
|
9
|
+
error ? /* @__PURE__ */ jsx(FieldError, { children: error }) : hint ? /* @__PURE__ */ jsx(FieldDescription, { children: hint }) : null
|
|
10
|
+
] });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { Field };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { GridPlacement } from '../utils/grid';
|
|
3
|
+
import type { ResponsiveValue } from '../utils/types';
|
|
4
|
+
import { type BoxProps } from './Box';
|
|
5
|
+
type OmittedGridProps = 'display' | 'gridTemplateColumns' | 'gridTemplateRows' | 'gridTemplateAreas' | 'gridColumn' | 'gridRow' | 'gridAutoFlow' | 'gridAutoRows' | 'gridAutoColumns';
|
|
6
|
+
export interface GridProps extends Omit<BoxProps, OmittedGridProps> {
|
|
7
|
+
/** `grid-template-columns`, e.g. `"repeat(3, 1fr)"`. */
|
|
8
|
+
templateColumns?: ResponsiveValue<string>;
|
|
9
|
+
/** `grid-template-rows`. */
|
|
10
|
+
templateRows?: ResponsiveValue<string>;
|
|
11
|
+
/** `grid-template-areas`. */
|
|
12
|
+
templateAreas?: ResponsiveValue<string>;
|
|
13
|
+
/** `grid-auto-flow`. */
|
|
14
|
+
autoFlow?: BoxProps['gridAutoFlow'];
|
|
15
|
+
/** `grid-auto-rows`. */
|
|
16
|
+
autoRows?: ResponsiveValue<string>;
|
|
17
|
+
/** `grid-auto-columns`. */
|
|
18
|
+
autoColumns?: ResponsiveValue<string>;
|
|
19
|
+
/** `grid-column` — a line, or `<start> / <end>`. */
|
|
20
|
+
column?: ResponsiveValue<GridPlacement>;
|
|
21
|
+
/** `grid-row` — a line, or `<start> / <end>`. */
|
|
22
|
+
row?: ResponsiveValue<GridPlacement>;
|
|
23
|
+
/** Render as `inline-grid` instead of `grid`. */
|
|
24
|
+
inline?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Grid is a Box that lays out its children with CSS grid. It defaults to
|
|
28
|
+
* `display: grid` and exposes the grid properties under short prop names.
|
|
29
|
+
* Spacing (`gap`/`rowGap`/`columnGap`) and every other Box prop are inherited.
|
|
30
|
+
*/
|
|
31
|
+
export declare const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<HTMLElement>>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Box } from './Box.js';
|
|
5
|
+
|
|
6
|
+
const Grid = React.forwardRef(function Grid2({
|
|
7
|
+
templateColumns,
|
|
8
|
+
templateRows,
|
|
9
|
+
templateAreas,
|
|
10
|
+
autoFlow,
|
|
11
|
+
autoRows,
|
|
12
|
+
autoColumns,
|
|
13
|
+
column,
|
|
14
|
+
row,
|
|
15
|
+
inline,
|
|
16
|
+
...rest
|
|
17
|
+
}, ref) {
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
Box,
|
|
20
|
+
{
|
|
21
|
+
ref,
|
|
22
|
+
display: inline ? "inline-grid" : "grid",
|
|
23
|
+
gridTemplateColumns: templateColumns,
|
|
24
|
+
gridTemplateRows: templateRows,
|
|
25
|
+
gridTemplateAreas: templateAreas,
|
|
26
|
+
gridAutoFlow: autoFlow,
|
|
27
|
+
gridAutoRows: autoRows,
|
|
28
|
+
gridAutoColumns: autoColumns,
|
|
29
|
+
gridColumn: column,
|
|
30
|
+
gridRow: row,
|
|
31
|
+
...rest
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
Grid.displayName = "Grid";
|
|
36
|
+
|
|
37
|
+
export { Grid };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { GridLine } from '../utils/grid';
|
|
3
|
+
import type { ResponsiveValue } from '../utils/types';
|
|
4
|
+
import { type BoxProps } from './Box';
|
|
5
|
+
type OmittedGridItemProps = 'gridArea' | 'gridColumn' | 'gridRow' | 'gridColumnStart' | 'gridColumnEnd' | 'gridRowStart' | 'gridRowEnd';
|
|
6
|
+
type Span = ResponsiveValue<number | 'auto'>;
|
|
7
|
+
type Line = ResponsiveValue<GridLine>;
|
|
8
|
+
export interface GridItemProps extends Omit<BoxProps, OmittedGridItemProps> {
|
|
9
|
+
/** `grid-area`. */
|
|
10
|
+
area?: ResponsiveValue<string>;
|
|
11
|
+
/** Number of columns to span, or `"auto"`. */
|
|
12
|
+
colSpan?: Span;
|
|
13
|
+
/** `grid-column-start`. */
|
|
14
|
+
colStart?: Line;
|
|
15
|
+
/** `grid-column-end`. */
|
|
16
|
+
colEnd?: Line;
|
|
17
|
+
/** Number of rows to span, or `"auto"`. */
|
|
18
|
+
rowSpan?: Span;
|
|
19
|
+
/** `grid-row-start`. */
|
|
20
|
+
rowStart?: Line;
|
|
21
|
+
/** `grid-row-end`. */
|
|
22
|
+
rowEnd?: Line;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* GridItem positions a single child inside a `Grid`. `colSpan`/`rowSpan` set how
|
|
26
|
+
* many tracks the item spans; `colStart`/`colEnd`/`rowStart`/`rowEnd` and `area`
|
|
27
|
+
* place it explicitly. All other Box props are inherited.
|
|
28
|
+
*/
|
|
29
|
+
export declare const GridItem: React.ForwardRefExoticComponent<GridItemProps & React.RefAttributes<HTMLElement>>;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Box } from './Box.js';
|
|
5
|
+
|
|
6
|
+
function spanValue(value) {
|
|
7
|
+
return value === "auto" ? "auto" : `span ${value} / span ${value}`;
|
|
8
|
+
}
|
|
9
|
+
function mapResponsive(value, fn) {
|
|
10
|
+
if (value === void 0) return void 0;
|
|
11
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
12
|
+
const out = {};
|
|
13
|
+
for (const [key, v] of Object.entries(value)) {
|
|
14
|
+
if (v !== void 0) out[key] = fn(v);
|
|
15
|
+
}
|
|
16
|
+
return out;
|
|
17
|
+
}
|
|
18
|
+
return fn(value);
|
|
19
|
+
}
|
|
20
|
+
const GridItem = React.forwardRef(
|
|
21
|
+
function GridItem2({ area, colSpan, colStart, colEnd, rowSpan, rowStart, rowEnd, ...rest }, ref) {
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
Box,
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
gridArea: area,
|
|
27
|
+
gridColumn: mapResponsive(colSpan, spanValue),
|
|
28
|
+
gridColumnStart: colStart,
|
|
29
|
+
gridColumnEnd: colEnd,
|
|
30
|
+
gridRow: mapResponsive(rowSpan, spanValue),
|
|
31
|
+
gridRowStart: rowStart,
|
|
32
|
+
gridRowEnd: rowEnd,
|
|
33
|
+
...rest
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
GridItem.displayName = "GridItem";
|
|
39
|
+
|
|
40
|
+
export { GridItem };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* HoverCard — a closed convenience wrapper over the shadcn HoverCard primitives.
|
|
4
|
+
*
|
|
5
|
+
* The underlying HoverCardContent accepts arbitrary `className`, enabling
|
|
6
|
+
* per-instance overrides to width, shadow, and border radius that would
|
|
7
|
+
* fragment the visual language. This wrapper closes that:
|
|
8
|
+
* - `side` is the only placement control; align is fixed to 'center'
|
|
9
|
+
* because hover-cards rarely need asymmetric anchoring.
|
|
10
|
+
* - The card's background (bg-popover), shadow (shadow-md), and ring are
|
|
11
|
+
* fixed to the system token treatment — no per-instance overrides.
|
|
12
|
+
* - No `className` or `style` escape hatch on any public prop.
|
|
13
|
+
*/
|
|
14
|
+
export interface HoverCardProps {
|
|
15
|
+
/** Element that triggers the hover card on mouse enter. */
|
|
16
|
+
trigger: React.ReactNode;
|
|
17
|
+
/** Card content shown on hover. */
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
/** Preferred side relative to the trigger; defaults to 'bottom'. */
|
|
20
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
21
|
+
}
|
|
22
|
+
export declare function HoverCard({ trigger, children, side }: HoverCardProps): React.JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { HoverCard as HoverCard$1, HoverCardTrigger, HoverCardContent } from './ui/hover-card.js';
|
|
4
|
+
|
|
5
|
+
function HoverCard({ trigger, children, side = "bottom" }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs(HoverCard$1, { children: [
|
|
7
|
+
/* @__PURE__ */ jsx(HoverCardTrigger, { asChild: true, children: trigger }),
|
|
8
|
+
/* @__PURE__ */ jsx(HoverCardContent, { side, children })
|
|
9
|
+
] });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { HoverCard };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Input — closed wrapper over shadcn's <Input>.
|
|
4
|
+
*
|
|
5
|
+
* shadcn's Input accepts arbitrary `className`, which lets callers override any
|
|
6
|
+
* aspect of the field's appearance. This wrapper closes that hatch:
|
|
7
|
+
* - `invalid` is the only expressible state variation; it activates the
|
|
8
|
+
* design system's error ring via `aria-invalid` (which the base component
|
|
9
|
+
* already styles) rather than an ad-hoc border-red class.
|
|
10
|
+
* - there is NO `className` / `style` prop.
|
|
11
|
+
* - standard behaviour props (type, placeholder, value, onChange, disabled,
|
|
12
|
+
* id) all pass through unchanged.
|
|
13
|
+
* - need a visual variant? Add a prop here — not a one-off className.
|
|
14
|
+
*/
|
|
15
|
+
export interface InputProps {
|
|
16
|
+
/** Activates the error ring. Prefer pairing with a <Label> and error text. */
|
|
17
|
+
invalid?: boolean;
|
|
18
|
+
type?: React.HTMLInputTypeAttribute;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
value?: string | number | readonly string[];
|
|
21
|
+
defaultValue?: string | number | readonly string[];
|
|
22
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
id?: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
autoComplete?: string;
|
|
27
|
+
autoFocus?: boolean;
|
|
28
|
+
readOnly?: boolean;
|
|
29
|
+
required?: boolean;
|
|
30
|
+
min?: string | number;
|
|
31
|
+
max?: string | number;
|
|
32
|
+
step?: string | number;
|
|
33
|
+
}
|
|
34
|
+
export declare function Input({ invalid, ...rest }: InputProps): React.JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* InputGroup — closed wrapper over shadcn's InputGroup family.
|
|
4
|
+
*
|
|
5
|
+
* shadcn's InputGroup requires manual composition of InputGroupAddon,
|
|
6
|
+
* InputGroupInput, etc., each accepting arbitrary `className`. This wrapper
|
|
7
|
+
* collapses that into a single component:
|
|
8
|
+
* - `children` is the primary control (typically an HIYF <Input> or
|
|
9
|
+
* any other input element).
|
|
10
|
+
* - `prefix` renders an inline-start addon (icon, text, or any node).
|
|
11
|
+
* - `suffix` renders an inline-end addon (icon, text, or any node).
|
|
12
|
+
* - The addon elements use the primitive's `inline-start` / `inline-end`
|
|
13
|
+
* alignment, the only sanctioned inline positions.
|
|
14
|
+
* - there is NO `className` / `style` prop.
|
|
15
|
+
* - need block-start / block-end addons or an internal button? Extend this
|
|
16
|
+
* component with deliberate props — not one-off className overrides.
|
|
17
|
+
*/
|
|
18
|
+
type ControlProps = Omit<React.ComponentPropsWithRef<'input'>, 'className' | 'style' | 'prefix'>;
|
|
19
|
+
export interface InputGroupProps extends ControlProps {
|
|
20
|
+
/** Optional leading addon rendered before the control (icon, text, …). */
|
|
21
|
+
prefix?: React.ReactNode;
|
|
22
|
+
/** Optional trailing addon rendered after the control (icon, text, …). */
|
|
23
|
+
suffix?: React.ReactNode;
|
|
24
|
+
/** Error state — drives the destructive ring on the whole group. */
|
|
25
|
+
invalid?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function InputGroup({ prefix, suffix, invalid, ...inputProps }: InputGroupProps): React.JSX.Element;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { InputGroup as InputGroup$1, InputGroupAddon, InputGroupInput } from './ui/input-group.js';
|
|
4
|
+
|
|
5
|
+
function InputGroup({ prefix, suffix, invalid, ...inputProps }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs(InputGroup$1, { children: [
|
|
7
|
+
prefix && /* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-start", children: prefix }),
|
|
8
|
+
/* @__PURE__ */ jsx(InputGroupInput, { "aria-invalid": invalid || void 0, ...inputProps }),
|
|
9
|
+
suffix && /* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-end", children: suffix })
|
|
10
|
+
] });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { InputGroup };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* InputOTP — closed wrapper over shadcn's InputOTP family.
|
|
4
|
+
*
|
|
5
|
+
* shadcn's InputOTP requires manual composition of InputOTPGroup and
|
|
6
|
+
* InputOTPSlot children, each accepting arbitrary `className`. This wrapper
|
|
7
|
+
* collapses the composition into a single component:
|
|
8
|
+
* - `length` controls how many digit slots are rendered (default 6);
|
|
9
|
+
* all slots live in a single group with no separator.
|
|
10
|
+
* - `value` and `onChange` give full controlled-input support.
|
|
11
|
+
* - there is NO `className` / `style` prop.
|
|
12
|
+
* - need separators between slot groups? Extend this component with a
|
|
13
|
+
* `groups` prop — a deliberate, reviewable change.
|
|
14
|
+
*/
|
|
15
|
+
export interface InputOTPProps {
|
|
16
|
+
/** Number of OTP character slots. Defaults to 6. */
|
|
17
|
+
length?: number;
|
|
18
|
+
/** Controlled value string. */
|
|
19
|
+
value?: string;
|
|
20
|
+
/** Called with the updated value string on each keystroke. */
|
|
21
|
+
onChange?: (value: string) => void;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Associates the hidden input with a form. */
|
|
24
|
+
name?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function InputOTP({ length, value, onChange, disabled, name, }: InputOTPProps): React.JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { InputOTP as InputOTP$1, InputOTPGroup, InputOTPSlot } from './ui/input-otp.js';
|
|
4
|
+
|
|
5
|
+
function InputOTP({
|
|
6
|
+
length = 6,
|
|
7
|
+
value,
|
|
8
|
+
onChange,
|
|
9
|
+
disabled,
|
|
10
|
+
name
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
InputOTP$1,
|
|
14
|
+
{
|
|
15
|
+
maxLength: length,
|
|
16
|
+
value,
|
|
17
|
+
onChange,
|
|
18
|
+
disabled,
|
|
19
|
+
name,
|
|
20
|
+
children: /* @__PURE__ */ jsx(InputOTPGroup, { children: Array.from({ length }, (_, i) => /* @__PURE__ */ jsx(InputOTPSlot, { index: i }, i)) })
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { InputOTP };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Kbd — closed keyboard-shortcut wrapper over shadcn's Kbd primitive.
|
|
4
|
+
*
|
|
5
|
+
* shadcn's <Kbd> accepts arbitrary `className` and renders a single key. This
|
|
6
|
+
* wrapper closes that hatch and adds multi-key support:
|
|
7
|
+
* - `keys` renders each string as its own <kbd> chip inside a KbdGroup,
|
|
8
|
+
* which automatically spaces them with a gap.
|
|
9
|
+
* - `children` can be used as an alternative to `keys` for a single raw key
|
|
10
|
+
* or any React node (e.g. an SVG icon representing ⌘).
|
|
11
|
+
* - When both are supplied `keys` takes precedence.
|
|
12
|
+
* - there is NO `className` / `style` prop.
|
|
13
|
+
*/
|
|
14
|
+
export interface KbdProps {
|
|
15
|
+
/**
|
|
16
|
+
* Array of key labels to display. Each string becomes its own chip.
|
|
17
|
+
* Example: ['⌘', 'K'] renders ⌘ + K as two adjacent chips.
|
|
18
|
+
*/
|
|
19
|
+
keys?: string[];
|
|
20
|
+
/**
|
|
21
|
+
* Alternative to `keys` — renders a single chip containing the given content.
|
|
22
|
+
* Ignored when `keys` is provided.
|
|
23
|
+
*/
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
export declare function Kbd({ keys, children }: KbdProps): React.JSX.Element;
|