@awsmbiz/inbis-ui 0.0.0-stage → 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/README.md +114 -2
- package/dist/index.d.ts +208 -0
- package/dist/index.js +1036 -0
- package/dist/index.js.map +1 -0
- package/package.json +76 -3
- package/styles/globals.css +149 -0
package/README.md
CHANGED
|
@@ -1,3 +1,115 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @awsmbiz/inbis-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
shadcn/ui primitives, accessible forms and the Tailwind CSS v4 theme shared by Inbis frontends.
|
|
4
|
+
It grows only by what the platform's screens need (Q54). Everything here is held to WCAG 2.2 AA
|
|
5
|
+
(Q56): zero axe violations in both themes at desktop and phone widths, keyboard operable with a
|
|
6
|
+
visible focus indicator, touch targets of at least 24×24 px, and `prefers-reduced-motion` honoured.
|
|
7
|
+
|
|
8
|
+
| Export | Contents |
|
|
9
|
+
|---|---|
|
|
10
|
+
| `@awsmbiz/inbis-ui` | Primitives: `Button`, `Input`, `Label`, `Card`, `Alert`, `Badge`, `Checkbox`, `Switch`, `NativeSelect` (+ `NativeSelectOption`, `NativeSelectOptGroup`), `Dialog`, `AlertDialog`, `Sheet`, `DropdownMenu`, `Tooltip` (+ `TooltipProvider`), `Tabs`, `Table`, `Pagination`, `Skeleton`, `Separator`, `Field*` layout parts, `Toaster` + `toast` (sonner), each with its shadcn sub-components; variant helpers `buttonVariants`, `badgeVariants`, `tabsListVariants`; `cn` |
|
|
11
|
+
| | Forms: `useZodForm`, `Form`, `FormField`, `FormRootError` (below); types `FormProps`, `FormFieldProps`, `FormControlProps` |
|
|
12
|
+
| `@awsmbiz/inbis-ui/globals.css` | Tailwind v4 entry: `tailwindcss`, `tw-animate-css`, `shadcn/tailwind.css`, the neutral light/dark theme tokens, the reduced-motion rule, and `@source` for this package's `dist` |
|
|
13
|
+
|
|
14
|
+
Peer dependencies: `react` and `react-dom` ^19.3.1, `tailwindcss` ^4.3.3, `react-hook-form`
|
|
15
|
+
^7.91.0 and `zod` ^4.6.7 (for the forms). Dependencies: `radix-ui`, `class-variance-authority`,
|
|
16
|
+
`cn`, `lucide-react`, `sonner`, `@hookform/resolvers`, `shadcn` (for `shadcn/tailwind.css`) and
|
|
17
|
+
`tw-animate-css`, at the versions pinned in the root README.
|
|
18
|
+
|
|
19
|
+
Used by `@awsmbiz/inbis-auth-ui` and `@awsmbiz/inbis-admin-ui`; an app uses it directly for its own screens and
|
|
20
|
+
admin pages.
|
|
21
|
+
|
|
22
|
+
## Using it in an app (Vite + `@tailwindcss/vite`)
|
|
23
|
+
|
|
24
|
+
```css
|
|
25
|
+
/* app.css */
|
|
26
|
+
@import "@awsmbiz/inbis-ui/globals.css";
|
|
27
|
+
@import "@awsmbiz/inbis-auth-ui/styles.css"; /* if you use @awsmbiz/inbis-auth-ui */
|
|
28
|
+
@import "@awsmbiz/inbis-admin-ui/styles.css"; /* if you use @awsmbiz/inbis-admin-ui */
|
|
29
|
+
@source "./"; /* your own components */
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`globals.css` already tells Tailwind to scan this package's compiled `dist`, so classes used
|
|
33
|
+
by the components are generated in the consuming app, also when installed from npm.
|
|
34
|
+
|
|
35
|
+
Dark theme: put the `dark` class on `<html>` (and `color-scheme: dark`). Render one `<Toaster />`
|
|
36
|
+
(pass `theme` to match) and wrap the app in `<TooltipProvider>` if it uses tooltips.
|
|
37
|
+
|
|
38
|
+
## Forms
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
const schema = z.object({ email: z.email("Enter a valid email address.") });
|
|
42
|
+
|
|
43
|
+
function InviteForm() {
|
|
44
|
+
const form = useZodForm(schema, { defaultValues: { email: "" } });
|
|
45
|
+
return (
|
|
46
|
+
<Form form={form} onSubmit={async (values) => { /* values parsed by the schema */ }}>
|
|
47
|
+
<FormRootError />
|
|
48
|
+
<FormField
|
|
49
|
+
control={form.control}
|
|
50
|
+
name="email"
|
|
51
|
+
label="Email"
|
|
52
|
+
description="The invitation is sent here."
|
|
53
|
+
render={({ field, control }) => <Input type="email" {...field} {...control} />}
|
|
54
|
+
/>
|
|
55
|
+
<Button type="submit">Send</Button>
|
|
56
|
+
</Form>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- `FormField` labels the control and sets `aria-describedby` (description, then error) and
|
|
62
|
+
`aria-invalid`; spread `control` onto the control. `orientation="horizontal"` puts the control
|
|
63
|
+
before its label, for checkboxes and switches (map `field.value`/`field.onChange` to
|
|
64
|
+
`checked`/`onCheckedChange`, and pass `field.ref`).
|
|
65
|
+
- Errors are announced (`role="alert"`). A failed submit moves focus to the first invalid control.
|
|
66
|
+
- `form.setError("root", { message })` (for example a server rejection) shows in `FormRootError`,
|
|
67
|
+
also announced. Announce successful async outcomes with `toast(…)`; the toaster is a polite live region.
|
|
68
|
+
|
|
69
|
+
## Accessibility changes from shadcn
|
|
70
|
+
|
|
71
|
+
Generated files are kept as the CLI writes them except for these deliberate changes, each
|
|
72
|
+
checked by a test:
|
|
73
|
+
|
|
74
|
+
- **Tokens** (`test/theme-contrast.test.ts` checks every text/surface pair at 4.5:1 and every
|
|
75
|
+
control boundary, checked state and focus ring at 3:1, in both themes): light `--destructive`
|
|
76
|
+
is red-700; light `--muted-foreground`, `--input`, `--ring` and `--sidebar-ring` are darker;
|
|
77
|
+
dark `--input` is opaque.
|
|
78
|
+
- **Select** is shadcn's `native-select`, not the Radix listbox: Radix's select always hides the
|
|
79
|
+
rest of the page with `aria-hidden` while it is open, which axe reports (`aria-hidden-focus`).
|
|
80
|
+
A native select is fully accessible and gives phones their own picker.
|
|
81
|
+
- **Dropdown menus** are non-modal by default and, like **tooltips**, not portalled, for the same
|
|
82
|
+
reason and so their content stays inside the page's landmarks (axe `region`).
|
|
83
|
+
- **Dialogs, alert dialogs and sheets** scroll inside themselves when taller than the viewport
|
|
84
|
+
(`max-h` + `overflow-y-auto`), so at 400% zoom (320×256 CSS px) no title, field or button is
|
|
85
|
+
cut off (WCAG 1.4.10 Reflow; `e2e/a11y-admin.spec.ts`).
|
|
86
|
+
- **Tab panels** show the focus ring; **pagination** links are named "Previous page"/"Next page"
|
|
87
|
+
(the visible text is part of the name); the **toaster** takes `theme` instead of `next-themes`.
|
|
88
|
+
- **Reduced motion**: `globals.css` cuts every animation and transition to an instant under
|
|
89
|
+
`prefers-reduced-motion: reduce`.
|
|
90
|
+
|
|
91
|
+
The playground's component gallery (`/dev/ui`, `apps/identity-playground/web/src/ui-gallery.tsx`)
|
|
92
|
+
shows every component and state; `e2e/ui-gallery.spec.ts` runs axe over each in both themes at
|
|
93
|
+
desktop and phone widths, and checks keyboard use, focus indicators, touch targets and reduced motion.
|
|
94
|
+
|
|
95
|
+
## Tests
|
|
96
|
+
|
|
97
|
+
`test/theme-contrast.test.ts` (every token pair in both themes) and `test/form.test.tsx` (label,
|
|
98
|
+
description and error wiring, focus on the first error) run in `pnpm test` (Vitest + jsdom).
|
|
99
|
+
The components are covered in a real browser by the playground: `e2e/ui-gallery.spec.ts` (every
|
|
100
|
+
component and state) and, as used by the screens, `e2e/accessibility.spec.ts`,
|
|
101
|
+
`e2e/a11y-app.spec.ts`, `e2e/a11y-admin.spec.ts` and `e2e/a11y-focus.spec.ts`.
|
|
102
|
+
|
|
103
|
+
## Adding a component (maintainers)
|
|
104
|
+
|
|
105
|
+
The layout follows the shadcn monorepo guidance (`docs/research/plan-verification.md` #26):
|
|
106
|
+
this package owns the primitives and its own `components.json` (style `radix-nova`, base color
|
|
107
|
+
`neutral`, Lucide icons, Tailwind v4 with an empty `tailwind.config`).
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
pnpm --filter @awsmbiz/inbis-ui shadcn add <component> # writes src/components/<component>.tsx
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Then export it from `src/index.ts`, add any new dependency with an exact version, drop
|
|
114
|
+
`"use client"`, add it to the gallery, and build. Components are built with tsdown to ESM in
|
|
115
|
+
`dist/`.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { AlertDialog as AlertDialog$1, Checkbox as Checkbox$1, Dialog as Dialog$1, DropdownMenu as DropdownMenu$1, Label as Label$1, Separator as Separator$1, Switch as Switch$1, Tabs as Tabs$1, Tooltip as Tooltip$1 } from "radix-ui";
|
|
6
|
+
import { ToasterProps, toast } from "sonner";
|
|
7
|
+
import { Control, ControllerFieldState, ControllerRenderProps, FieldPath, FieldValues, SubmitHandler, UseFormProps, UseFormReturn } from "react-hook-form";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
declare const alertVariants: (props?: ({
|
|
10
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
declare function Alert({ className, variant, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React$1.JSX.Element;
|
|
13
|
+
declare function AlertTitle({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
14
|
+
declare function AlertDescription({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
15
|
+
declare function AlertAction({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
16
|
+
declare const buttonVariants: (props?: ({
|
|
17
|
+
variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link" | null | undefined;
|
|
18
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
19
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
20
|
+
declare function Button({ className, variant, size, asChild, ...props }: React$1.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
21
|
+
asChild?: boolean;
|
|
22
|
+
}): React$1.JSX.Element;
|
|
23
|
+
declare function AlertDialog({ ...props }: React$1.ComponentProps<typeof AlertDialog$1.Root>): React$1.JSX.Element;
|
|
24
|
+
declare function AlertDialogTrigger({ ...props }: React$1.ComponentProps<typeof AlertDialog$1.Trigger>): React$1.JSX.Element;
|
|
25
|
+
declare function AlertDialogPortal({ ...props }: React$1.ComponentProps<typeof AlertDialog$1.Portal>): React$1.JSX.Element;
|
|
26
|
+
declare function AlertDialogOverlay({ className, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Overlay>): React$1.JSX.Element;
|
|
27
|
+
declare function AlertDialogContent({ className, size, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Content> & {
|
|
28
|
+
size?: "default" | "sm";
|
|
29
|
+
}): React$1.JSX.Element;
|
|
30
|
+
declare function AlertDialogHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
31
|
+
declare function AlertDialogFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
32
|
+
declare function AlertDialogMedia({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
33
|
+
declare function AlertDialogTitle({ className, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Title>): React$1.JSX.Element;
|
|
34
|
+
declare function AlertDialogDescription({ className, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Description>): React$1.JSX.Element;
|
|
35
|
+
declare function AlertDialogAction({ className, variant, size, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Action> & Pick<React$1.ComponentProps<typeof Button>, "variant" | "size">): React$1.JSX.Element;
|
|
36
|
+
declare function AlertDialogCancel({ className, variant, size, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Cancel> & Pick<React$1.ComponentProps<typeof Button>, "variant" | "size">): React$1.JSX.Element;
|
|
37
|
+
declare const badgeVariants: (props?: ({
|
|
38
|
+
variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link" | null | undefined;
|
|
39
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
40
|
+
declare function Badge({ className, variant, asChild, ...props }: React$1.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
41
|
+
asChild?: boolean;
|
|
42
|
+
}): React$1.JSX.Element;
|
|
43
|
+
declare function Card({ className, size, ...props }: React$1.ComponentProps<"div"> & {
|
|
44
|
+
size?: "default" | "sm";
|
|
45
|
+
}): React$1.JSX.Element;
|
|
46
|
+
declare function CardHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
47
|
+
declare function CardTitle({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
48
|
+
declare function CardDescription({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
49
|
+
declare function CardAction({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
50
|
+
declare function CardContent({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
51
|
+
declare function CardFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
52
|
+
declare function Checkbox({ className, ...props }: React$1.ComponentProps<typeof Checkbox$1.Root>): React$1.JSX.Element;
|
|
53
|
+
declare function Dialog({ ...props }: React$1.ComponentProps<typeof Dialog$1.Root>): React$1.JSX.Element;
|
|
54
|
+
declare function DialogTrigger({ ...props }: React$1.ComponentProps<typeof Dialog$1.Trigger>): React$1.JSX.Element;
|
|
55
|
+
declare function DialogPortal({ ...props }: React$1.ComponentProps<typeof Dialog$1.Portal>): React$1.JSX.Element;
|
|
56
|
+
declare function DialogClose({ ...props }: React$1.ComponentProps<typeof Dialog$1.Close>): React$1.JSX.Element;
|
|
57
|
+
declare function DialogOverlay({ className, ...props }: React$1.ComponentProps<typeof Dialog$1.Overlay>): React$1.JSX.Element;
|
|
58
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React$1.ComponentProps<typeof Dialog$1.Content> & {
|
|
59
|
+
showCloseButton?: boolean;
|
|
60
|
+
}): React$1.JSX.Element;
|
|
61
|
+
declare function DialogHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
62
|
+
declare function DialogFooter({ className, showCloseButton, children, ...props }: React$1.ComponentProps<"div"> & {
|
|
63
|
+
showCloseButton?: boolean;
|
|
64
|
+
}): React$1.JSX.Element;
|
|
65
|
+
declare function DialogTitle({ className, ...props }: React$1.ComponentProps<typeof Dialog$1.Title>): React$1.JSX.Element;
|
|
66
|
+
declare function DialogDescription({ className, ...props }: React$1.ComponentProps<typeof Dialog$1.Description>): React$1.JSX.Element;
|
|
67
|
+
declare function DropdownMenu({ modal, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Root>): React$1.JSX.Element;
|
|
68
|
+
declare function DropdownMenuPortal({ ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Portal>): React$1.JSX.Element;
|
|
69
|
+
declare function DropdownMenuTrigger({ ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Trigger>): React$1.JSX.Element;
|
|
70
|
+
declare function DropdownMenuContent({ className, align, sideOffset, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Content>): React$1.JSX.Element;
|
|
71
|
+
declare function DropdownMenuGroup({ ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Group>): React$1.JSX.Element;
|
|
72
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Item> & {
|
|
73
|
+
inset?: boolean;
|
|
74
|
+
variant?: "default" | "destructive";
|
|
75
|
+
}): React$1.JSX.Element;
|
|
76
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.CheckboxItem> & {
|
|
77
|
+
inset?: boolean;
|
|
78
|
+
}): React$1.JSX.Element;
|
|
79
|
+
declare function DropdownMenuRadioGroup({ ...props }: React$1.ComponentProps<typeof DropdownMenu$1.RadioGroup>): React$1.JSX.Element;
|
|
80
|
+
declare function DropdownMenuRadioItem({ className, children, inset, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.RadioItem> & {
|
|
81
|
+
inset?: boolean;
|
|
82
|
+
}): React$1.JSX.Element;
|
|
83
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Label> & {
|
|
84
|
+
inset?: boolean;
|
|
85
|
+
}): React$1.JSX.Element;
|
|
86
|
+
declare function DropdownMenuSeparator({ className, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Separator>): React$1.JSX.Element;
|
|
87
|
+
declare function DropdownMenuShortcut({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
88
|
+
declare function DropdownMenuSub({ ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Sub>): React$1.JSX.Element;
|
|
89
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.SubTrigger> & {
|
|
90
|
+
inset?: boolean;
|
|
91
|
+
}): React$1.JSX.Element;
|
|
92
|
+
declare function DropdownMenuSubContent({ className, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.SubContent>): React$1.JSX.Element;
|
|
93
|
+
declare function Label({ className, ...props }: React$1.ComponentProps<typeof Label$1.Root>): React$1.JSX.Element;
|
|
94
|
+
declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): import("react").JSX.Element;
|
|
95
|
+
declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<"legend"> & {
|
|
96
|
+
variant?: "legend" | "label";
|
|
97
|
+
}): import("react").JSX.Element;
|
|
98
|
+
declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
99
|
+
declare const fieldVariants: (props?: ({
|
|
100
|
+
orientation?: "vertical" | "horizontal" | "responsive" | null | undefined;
|
|
101
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
102
|
+
declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): import("react").JSX.Element;
|
|
103
|
+
declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
104
|
+
declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): import("react").JSX.Element;
|
|
105
|
+
declare function FieldTitle({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
106
|
+
declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): import("react").JSX.Element;
|
|
107
|
+
declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<"div"> & {
|
|
108
|
+
children?: React.ReactNode;
|
|
109
|
+
}): import("react").JSX.Element;
|
|
110
|
+
declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<"div"> & {
|
|
111
|
+
errors?: ({
|
|
112
|
+
message?: string;
|
|
113
|
+
} | undefined)[];
|
|
114
|
+
}): import("react").JSX.Element | null;
|
|
115
|
+
declare function Input({ className, type, ...props }: React$1.ComponentProps<"input">): React$1.JSX.Element;
|
|
116
|
+
declare function Pagination({ className, ...props }: React$1.ComponentProps<"nav">): React$1.JSX.Element;
|
|
117
|
+
declare function PaginationContent({ className, ...props }: React$1.ComponentProps<"ul">): React$1.JSX.Element;
|
|
118
|
+
declare function PaginationItem({ ...props }: React$1.ComponentProps<"li">): React$1.JSX.Element;
|
|
119
|
+
type PaginationLinkProps = {
|
|
120
|
+
isActive?: boolean;
|
|
121
|
+
} & Pick<React$1.ComponentProps<typeof Button>, "size"> & React$1.ComponentProps<"a">;
|
|
122
|
+
declare function PaginationLink({ className, isActive, size, ...props }: PaginationLinkProps): React$1.JSX.Element;
|
|
123
|
+
declare function PaginationPrevious({ className, text, ...props }: React$1.ComponentProps<typeof PaginationLink> & {
|
|
124
|
+
text?: string;
|
|
125
|
+
}): React$1.JSX.Element;
|
|
126
|
+
declare function PaginationNext({ className, text, ...props }: React$1.ComponentProps<typeof PaginationLink> & {
|
|
127
|
+
text?: string;
|
|
128
|
+
}): React$1.JSX.Element;
|
|
129
|
+
declare function PaginationEllipsis({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
130
|
+
type NativeSelectProps = Omit<React$1.ComponentProps<"select">, "size"> & {
|
|
131
|
+
size?: "sm" | "default";
|
|
132
|
+
};
|
|
133
|
+
declare function NativeSelect({ className, size, ...props }: NativeSelectProps): React$1.JSX.Element;
|
|
134
|
+
declare function NativeSelectOption({ className, ...props }: React$1.ComponentProps<"option">): React$1.JSX.Element;
|
|
135
|
+
declare function NativeSelectOptGroup({ className, ...props }: React$1.ComponentProps<"optgroup">): React$1.JSX.Element;
|
|
136
|
+
declare function Separator({ className, orientation, decorative, ...props }: React$1.ComponentProps<typeof Separator$1.Root>): React$1.JSX.Element;
|
|
137
|
+
declare function Sheet({ ...props }: React$1.ComponentProps<typeof Dialog$1.Root>): React$1.JSX.Element;
|
|
138
|
+
declare function SheetTrigger({ ...props }: React$1.ComponentProps<typeof Dialog$1.Trigger>): React$1.JSX.Element;
|
|
139
|
+
declare function SheetClose({ ...props }: React$1.ComponentProps<typeof Dialog$1.Close>): React$1.JSX.Element;
|
|
140
|
+
declare function SheetContent({ className, children, side, showCloseButton, ...props }: React$1.ComponentProps<typeof Dialog$1.Content> & {
|
|
141
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
142
|
+
showCloseButton?: boolean;
|
|
143
|
+
}): React$1.JSX.Element;
|
|
144
|
+
declare function SheetHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
145
|
+
declare function SheetFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
146
|
+
declare function SheetTitle({ className, ...props }: React$1.ComponentProps<typeof Dialog$1.Title>): React$1.JSX.Element;
|
|
147
|
+
declare function SheetDescription({ className, ...props }: React$1.ComponentProps<typeof Dialog$1.Description>): React$1.JSX.Element;
|
|
148
|
+
declare function Skeleton({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
149
|
+
declare const Toaster: ({ ...props }: ToasterProps) => import("react").JSX.Element;
|
|
150
|
+
declare function Switch({ className, size, ...props }: React$1.ComponentProps<typeof Switch$1.Root> & {
|
|
151
|
+
size?: "sm" | "default";
|
|
152
|
+
}): React$1.JSX.Element;
|
|
153
|
+
declare function Table({ className, ...props }: React$1.ComponentProps<"table">): React$1.JSX.Element;
|
|
154
|
+
declare function TableHeader({ className, ...props }: React$1.ComponentProps<"thead">): React$1.JSX.Element;
|
|
155
|
+
declare function TableBody({ className, ...props }: React$1.ComponentProps<"tbody">): React$1.JSX.Element;
|
|
156
|
+
declare function TableFooter({ className, ...props }: React$1.ComponentProps<"tfoot">): React$1.JSX.Element;
|
|
157
|
+
declare function TableRow({ className, ...props }: React$1.ComponentProps<"tr">): React$1.JSX.Element;
|
|
158
|
+
declare function TableHead({ className, ...props }: React$1.ComponentProps<"th">): React$1.JSX.Element;
|
|
159
|
+
declare function TableCell({ className, ...props }: React$1.ComponentProps<"td">): React$1.JSX.Element;
|
|
160
|
+
declare function TableCaption({ className, ...props }: React$1.ComponentProps<"caption">): React$1.JSX.Element;
|
|
161
|
+
declare function Tabs({ className, orientation, ...props }: React$1.ComponentProps<typeof Tabs$1.Root>): React$1.JSX.Element;
|
|
162
|
+
declare const tabsListVariants: (props?: ({
|
|
163
|
+
variant?: "default" | "line" | null | undefined;
|
|
164
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
165
|
+
declare function TabsList({ className, variant, ...props }: React$1.ComponentProps<typeof Tabs$1.List> & VariantProps<typeof tabsListVariants>): React$1.JSX.Element;
|
|
166
|
+
declare function TabsTrigger({ className, ...props }: React$1.ComponentProps<typeof Tabs$1.Trigger>): React$1.JSX.Element;
|
|
167
|
+
declare function TabsContent({ className, ...props }: React$1.ComponentProps<typeof Tabs$1.Content>): React$1.JSX.Element;
|
|
168
|
+
declare function TooltipProvider({ delayDuration, ...props }: React$1.ComponentProps<typeof Tooltip$1.Provider>): React$1.JSX.Element;
|
|
169
|
+
declare function Tooltip({ ...props }: React$1.ComponentProps<typeof Tooltip$1.Root>): React$1.JSX.Element;
|
|
170
|
+
declare function TooltipTrigger({ ...props }: React$1.ComponentProps<typeof Tooltip$1.Trigger>): React$1.JSX.Element;
|
|
171
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React$1.ComponentProps<typeof Tooltip$1.Content>): React$1.JSX.Element;
|
|
172
|
+
/** `useForm` with a Zod schema as the resolver: values are validated and parsed by the schema. */
|
|
173
|
+
export declare function useZodForm<TInput extends FieldValues, TOutput extends FieldValues>(schema: z.ZodType<TOutput, TInput>, options?: Omit<UseFormProps<TInput, unknown, TOutput>, "resolver">): UseFormReturn<TInput, unknown, TOutput>;
|
|
174
|
+
type FormProps<TFieldValues extends FieldValues, TTransformed extends FieldValues> = Omit<ComponentProps<"form">, "onSubmit"> & {
|
|
175
|
+
form: UseFormReturn<TFieldValues, unknown, TTransformed>;
|
|
176
|
+
/** Called with the parsed values once every field is valid. */
|
|
177
|
+
onSubmit: SubmitHandler<TTransformed>;
|
|
178
|
+
};
|
|
179
|
+
/** A `<form>` bound to a react-hook-form instance; browser validation is off so errors are the form's own. */
|
|
180
|
+
export declare function Form<TFieldValues extends FieldValues, TTransformed extends FieldValues>({ form, onSubmit, children, ...props }: FormProps<TFieldValues, TTransformed>): import("react").JSX.Element;
|
|
181
|
+
/** ARIA props for the control a FormField renders; spread them onto it. */
|
|
182
|
+
interface FormControlProps {
|
|
183
|
+
id: string;
|
|
184
|
+
"aria-invalid": true | undefined;
|
|
185
|
+
"aria-describedby": string | undefined;
|
|
186
|
+
}
|
|
187
|
+
interface FormFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>, TTransformed> {
|
|
188
|
+
control: Control<TFieldValues, unknown, TTransformed>;
|
|
189
|
+
name: TName;
|
|
190
|
+
label: ReactNode;
|
|
191
|
+
description?: ReactNode;
|
|
192
|
+
/** "horizontal" puts the control before its label (checkboxes, switches). */
|
|
193
|
+
orientation?: "vertical" | "horizontal";
|
|
194
|
+
className?: string;
|
|
195
|
+
render: (props: {
|
|
196
|
+
field: ControllerRenderProps<TFieldValues, TName>;
|
|
197
|
+
fieldState: ControllerFieldState;
|
|
198
|
+
control: FormControlProps;
|
|
199
|
+
}) => ReactNode;
|
|
200
|
+
}
|
|
201
|
+
/** One labelled form control with its description and error message. */
|
|
202
|
+
export declare function FormField<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>, TTransformed>({ control, name, label, description, orientation, className, render }: FormFieldProps<TFieldValues, TName, TTransformed>): import("react").JSX.Element;
|
|
203
|
+
/** The form-level error (`form.setError("root", …)`, e.g. a server rejection), announced when it appears. */
|
|
204
|
+
export declare function FormRootError({ className }: {
|
|
205
|
+
className?: string;
|
|
206
|
+
}): import("react").JSX.Element | null;
|
|
207
|
+
export { Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Badge, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, type FormControlProps, type FormFieldProps, type FormProps, Input, Label, NativeSelect, NativeSelectOptGroup, NativeSelectOption, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, tabsListVariants, toast };
|
|
208
|
+
//# sourceMappingURL=index.d.ts.map
|