@rfdtech/components 1.5.0 → 1.8.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 +481 -2
- package/dist/components/badge/Badge.d.ts +4 -0
- package/dist/components/badge/Badge.d.ts.map +1 -0
- package/dist/components/badge/Badge.test.d.ts +2 -0
- package/dist/components/badge/Badge.test.d.ts.map +1 -0
- package/dist/components/badge/index.d.ts +3 -0
- package/dist/components/badge/index.d.ts.map +1 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +10 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb/Breadcrumb.test.d.ts +2 -0
- package/dist/components/breadcrumb/Breadcrumb.test.d.ts.map +1 -0
- package/dist/components/breadcrumb/index.d.ts +3 -0
- package/dist/components/breadcrumb/index.d.ts.map +1 -0
- package/dist/components/command/Command.d.ts +18 -0
- package/dist/components/command/Command.d.ts.map +1 -0
- package/dist/components/command/Command.test.d.ts +2 -0
- package/dist/components/command/Command.test.d.ts.map +1 -0
- package/dist/components/command/CommandDialogContext.d.ts +10 -0
- package/dist/components/command/CommandDialogContext.d.ts.map +1 -0
- package/dist/components/command/hooks/parseCommandShortcut.d.ts +11 -0
- package/dist/components/command/hooks/parseCommandShortcut.d.ts.map +1 -0
- package/dist/components/command/hooks/useCommandShortcut.d.ts +8 -0
- package/dist/components/command/hooks/useCommandShortcut.d.ts.map +1 -0
- package/dist/components/command/index.d.ts +6 -0
- package/dist/components/command/index.d.ts.map +1 -0
- package/dist/components/dialog/Dialog.d.ts +12 -0
- package/dist/components/dialog/Dialog.d.ts.map +1 -0
- package/dist/components/dialog/Dialog.test.d.ts +2 -0
- package/dist/components/dialog/Dialog.test.d.ts.map +1 -0
- package/dist/components/dialog/index.d.ts +3 -0
- package/dist/components/dialog/index.d.ts.map +1 -0
- package/dist/components/draggable/Draggable.d.ts +5 -0
- package/dist/components/draggable/Draggable.d.ts.map +1 -0
- package/dist/components/draggable/Draggable.test.d.ts +2 -0
- package/dist/components/draggable/Draggable.test.d.ts.map +1 -0
- package/dist/components/draggable/DraggableContext.d.ts +16 -0
- package/dist/components/draggable/DraggableContext.d.ts.map +1 -0
- package/dist/components/draggable/hooks/clampPosition.d.ts +10 -0
- package/dist/components/draggable/hooks/clampPosition.d.ts.map +1 -0
- package/dist/components/draggable/hooks/clampPosition.test.d.ts +2 -0
- package/dist/components/draggable/hooks/clampPosition.test.d.ts.map +1 -0
- package/dist/components/draggable/hooks/useDraggable.d.ts +3 -0
- package/dist/components/draggable/hooks/useDraggable.d.ts.map +1 -0
- package/dist/components/draggable/index.d.ts +6 -0
- package/dist/components/draggable/index.d.ts.map +1 -0
- package/dist/components/field/Field.d.ts +8 -0
- package/dist/components/field/Field.d.ts.map +1 -0
- package/dist/components/field/Field.test.d.ts +2 -0
- package/dist/components/field/Field.test.d.ts.map +1 -0
- package/dist/components/field/FieldContext.d.ts +4 -0
- package/dist/components/field/FieldContext.d.ts.map +1 -0
- package/dist/components/field/index.d.ts +3 -0
- package/dist/components/field/index.d.ts.map +1 -0
- package/dist/components/form/Form.d.ts +6 -0
- package/dist/components/form/Form.d.ts.map +1 -0
- package/dist/components/form/Form.test.d.ts +2 -0
- package/dist/components/form/Form.test.d.ts.map +1 -0
- package/dist/components/form/FormFieldContext.d.ts +5 -0
- package/dist/components/form/FormFieldContext.d.ts.map +1 -0
- package/dist/components/form/index.d.ts +3 -0
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/input/Input.d.ts +4 -0
- package/dist/components/input/Input.d.ts.map +1 -0
- package/dist/components/input/Input.test.d.ts +2 -0
- package/dist/components/input/Input.test.d.ts.map +1 -0
- package/dist/components/input/index.d.ts +3 -0
- package/dist/components/input/index.d.ts.map +1 -0
- package/dist/components/modal/Modal.d.ts +15 -0
- package/dist/components/modal/Modal.d.ts.map +1 -0
- package/dist/components/modal/Modal.test.d.ts +2 -0
- package/dist/components/modal/Modal.test.d.ts.map +1 -0
- package/dist/components/modal/index.d.ts +3 -0
- package/dist/components/modal/index.d.ts.map +1 -0
- package/dist/components/progress-bar/ProgressBar.d.ts +4 -0
- package/dist/components/progress-bar/ProgressBar.d.ts.map +1 -0
- package/dist/components/progress-bar/ProgressBar.test.d.ts +2 -0
- package/dist/components/progress-bar/ProgressBar.test.d.ts.map +1 -0
- package/dist/components/progress-bar/index.d.ts +3 -0
- package/dist/components/progress-bar/index.d.ts.map +1 -0
- package/dist/components/sheet/Sheet.d.ts +15 -0
- package/dist/components/sheet/Sheet.d.ts.map +1 -0
- package/dist/components/sheet/Sheet.test.d.ts +2 -0
- package/dist/components/sheet/Sheet.test.d.ts.map +1 -0
- package/dist/components/sheet/index.d.ts +3 -0
- package/dist/components/sheet/index.d.ts.map +1 -0
- package/dist/components/sidebar/Sidebar.d.ts +17 -0
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -0
- package/dist/components/sidebar/Sidebar.test.d.ts +2 -0
- package/dist/components/sidebar/Sidebar.test.d.ts.map +1 -0
- package/dist/components/sidebar/SidebarContext.d.ts +15 -0
- package/dist/components/sidebar/SidebarContext.d.ts.map +1 -0
- package/dist/components/sidebar/hooks/useSidebarMedia.d.ts +2 -0
- package/dist/components/sidebar/hooks/useSidebarMedia.d.ts.map +1 -0
- package/dist/components/sidebar/index.d.ts +3 -0
- package/dist/components/sidebar/index.d.ts.map +1 -0
- package/dist/components/sortable/Sortable.d.ts +7 -0
- package/dist/components/sortable/Sortable.d.ts.map +1 -0
- package/dist/components/sortable/Sortable.test.d.ts +2 -0
- package/dist/components/sortable/Sortable.test.d.ts.map +1 -0
- package/dist/components/sortable/SortableContext.d.ts +32 -0
- package/dist/components/sortable/SortableContext.d.ts.map +1 -0
- package/dist/components/sortable/hooks/useSortableDragEnd.d.ts +3 -0
- package/dist/components/sortable/hooks/useSortableDragEnd.d.ts.map +1 -0
- package/dist/components/sortable/hooks/useSortableDragEnd.test.d.ts +2 -0
- package/dist/components/sortable/hooks/useSortableDragEnd.test.d.ts.map +1 -0
- package/dist/components/sortable/index.d.ts +4 -0
- package/dist/components/sortable/index.d.ts.map +1 -0
- package/dist/components/textarea/Textarea.d.ts +4 -0
- package/dist/components/textarea/Textarea.d.ts.map +1 -0
- package/dist/components/textarea/Textarea.test.d.ts +2 -0
- package/dist/components/textarea/Textarea.test.d.ts.map +1 -0
- package/dist/components/textarea/index.d.ts +3 -0
- package/dist/components/textarea/index.d.ts.map +1 -0
- package/dist/components/toast/Toast.test.d.ts +2 -0
- package/dist/components/toast/Toast.test.d.ts.map +1 -0
- package/dist/components/toast/ToastProvider.d.ts +4 -0
- package/dist/components/toast/ToastProvider.d.ts.map +1 -0
- package/dist/components/toast/Toaster.d.ts +4 -0
- package/dist/components/toast/Toaster.d.ts.map +1 -0
- package/dist/components/toast/hooks/useToast.d.ts +3 -0
- package/dist/components/toast/hooks/useToast.d.ts.map +1 -0
- package/dist/components/toast/index.d.ts +5 -0
- package/dist/components/toast/index.d.ts.map +1 -0
- package/dist/hooks/createBrowserSearchParamAdapter.d.ts +3 -0
- package/dist/hooks/createBrowserSearchParamAdapter.d.ts.map +1 -0
- package/dist/hooks/createSearchParamAdapter.d.ts +10 -0
- package/dist/hooks/createSearchParamAdapter.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +9 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/overlaySearchParamData.d.ts +6 -0
- package/dist/hooks/overlaySearchParamData.d.ts.map +1 -0
- package/dist/hooks/overlaySearchParamData.test.d.ts +2 -0
- package/dist/hooks/overlaySearchParamData.test.d.ts.map +1 -0
- package/dist/hooks/useDialogSearchParam.d.ts +3 -0
- package/dist/hooks/useDialogSearchParam.d.ts.map +1 -0
- package/dist/hooks/useModalSearchParam.d.ts +3 -0
- package/dist/hooks/useModalSearchParam.d.ts.map +1 -0
- package/dist/hooks/useSearchParamOverlay.d.ts +3 -0
- package/dist/hooks/useSearchParamOverlay.d.ts.map +1 -0
- package/dist/hooks/useSearchParamOverlay.test.d.ts +2 -0
- package/dist/hooks/useSearchParamOverlay.test.d.ts.map +1 -0
- package/dist/index.cjs +82 -43
- package/dist/index.css +1 -1
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12531 -6357
- package/dist/types/badge.d.ts +14 -0
- package/dist/types/badge.d.ts.map +1 -0
- package/dist/types/breadcrumb.d.ts +61 -0
- package/dist/types/breadcrumb.d.ts.map +1 -0
- package/dist/types/command.d.ts +88 -0
- package/dist/types/command.d.ts.map +1 -0
- package/dist/types/dialog.d.ts +28 -0
- package/dist/types/dialog.d.ts.map +1 -0
- package/dist/types/draggable.d.ts +49 -0
- package/dist/types/draggable.d.ts.map +1 -0
- package/dist/types/field.d.ts +45 -0
- package/dist/types/field.d.ts.map +1 -0
- package/dist/types/form.d.ts +23 -0
- package/dist/types/form.d.ts.map +1 -0
- package/dist/types/input.d.ts +10 -0
- package/dist/types/input.d.ts.map +1 -0
- package/dist/types/modal.d.ts +47 -0
- package/dist/types/modal.d.ts.map +1 -0
- package/dist/types/progress-bar.d.ts +20 -0
- package/dist/types/progress-bar.d.ts.map +1 -0
- package/dist/types/search-param-overlay.d.ts +27 -0
- package/dist/types/search-param-overlay.d.ts.map +1 -0
- package/dist/types/sheet.d.ts +49 -0
- package/dist/types/sheet.d.ts.map +1 -0
- package/dist/types/sidebar.d.ts +122 -0
- package/dist/types/sidebar.d.ts.map +1 -0
- package/dist/types/sortable.d.ts +36 -0
- package/dist/types/sortable.d.ts.map +1 -0
- package/dist/types/textarea.d.ts +10 -0
- package/dist/types/textarea.d.ts.map +1 -0
- package/dist/types/toast.d.ts +52 -0
- package/dist/types/toast.d.ts.map +1 -0
- package/dist/utils/slot.d.ts +7 -0
- package/dist/utils/slot.d.ts.map +1 -0
- package/package.json +25 -3
package/README.md
CHANGED
|
@@ -66,6 +66,32 @@ npm install @rfdtech/components
|
|
|
66
66
|
Requires React 18+. npm 7+ auto-installs `react` and `react-dom` as peer dependencies. Radix UI and other runtime packages are included as dependencies of `@rfdtech/components`.
|
|
67
67
|
|
|
68
68
|
|
|
69
|
+
## Hooks
|
|
70
|
+
|
|
71
|
+
Shared hooks for URL-driven overlay state and router integration. See the [Hooks](/docs/hooks) docs page for full API reference.
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import {
|
|
75
|
+
Dialog,
|
|
76
|
+
DialogContent,
|
|
77
|
+
useDialogSearchParam,
|
|
78
|
+
useModalSearchParam,
|
|
79
|
+
} from "@rfdtech/components";
|
|
80
|
+
|
|
81
|
+
const { open, data, onOpenChange, openWith } = useDialogSearchParam<{
|
|
82
|
+
userId: string;
|
|
83
|
+
}>("edit-profile");
|
|
84
|
+
|
|
85
|
+
openWith({ userId: "42" });
|
|
86
|
+
|
|
87
|
+
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
88
|
+
<DialogContent>Edit user {data?.userId}</DialogContent>
|
|
89
|
+
</Dialog>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Exports: `useSearchParamOverlay`, `useDialogSearchParam`, `useModalSearchParam`, `createSearchParamAdapter`, `createBrowserSearchParamAdapter`, `readOverlayData`, `writeOverlayData`, `clearOverlayData`, `getDataPrefix`. Types: `SearchParamOverlayState`, `SearchParamOverlayData`, `SearchParamAdapter`, `UseSearchParamOverlayOptions`, `UseSearchParamOverlayReturn`.
|
|
93
|
+
|
|
94
|
+
|
|
69
95
|
## AppSwitcher
|
|
70
96
|
|
|
71
97
|
Google Apps–style 9-dot launcher for switching between GSL systems. Drop it into your header to let users jump between products. Pass `apps` directly from your own data layer; use `loading` while data is being fetched.
|
|
@@ -92,6 +118,54 @@ Props: `apps`, `loading`, `loadingLabel`, `columns`, `open`, `onOpenChange`, `on
|
|
|
92
118
|
Also exported: `AppSwitcherItem`, `GridIcon`, `SystemAppIcon`, `useAppSwitcher`.
|
|
93
119
|
|
|
94
120
|
|
|
121
|
+
## Badge
|
|
122
|
+
|
|
123
|
+
Compact inline label for status, counts, and metadata with semantic color variants. See the [Badge](/docs/badge) docs page for props and exported types.
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
import { Badge } from "@rfdtech/components";
|
|
127
|
+
|
|
128
|
+
<Badge variant="success">Active</Badge>
|
|
129
|
+
<Badge variant="warning">Pending</Badge>
|
|
130
|
+
<Badge variant="error">Failed</Badge>
|
|
131
|
+
<Badge variant="outline" size="md">
|
|
132
|
+
Draft
|
|
133
|
+
</Badge>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Props: `variant`, `size`, `classNames`, `className`, and standard `span` attributes. Exported types: `BadgeProps`, `BadgeClassNames`, `BadgeVariant`, `BadgeSize`.
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
## Breadcrumb
|
|
140
|
+
|
|
141
|
+
Compound breadcrumb primitives for hierarchical page trails. See the [Breadcrumb](/docs/breadcrumb) docs page for props and exported types.
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
import {
|
|
145
|
+
Breadcrumb,
|
|
146
|
+
BreadcrumbItem,
|
|
147
|
+
BreadcrumbLink,
|
|
148
|
+
BreadcrumbList,
|
|
149
|
+
BreadcrumbPage,
|
|
150
|
+
BreadcrumbSeparator,
|
|
151
|
+
} from "@rfdtech/components";
|
|
152
|
+
|
|
153
|
+
<Breadcrumb>
|
|
154
|
+
<BreadcrumbList>
|
|
155
|
+
<BreadcrumbItem>
|
|
156
|
+
<BreadcrumbLink href="/">Home</BreadcrumbLink>
|
|
157
|
+
</BreadcrumbItem>
|
|
158
|
+
<BreadcrumbSeparator />
|
|
159
|
+
<BreadcrumbItem>
|
|
160
|
+
<BreadcrumbPage>Profile</BreadcrumbPage>
|
|
161
|
+
</BreadcrumbItem>
|
|
162
|
+
</BreadcrumbList>
|
|
163
|
+
</Breadcrumb>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Exported parts: `Breadcrumb`, `BreadcrumbList`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbPage`, `BreadcrumbSeparator`, `BreadcrumbEllipsis`. Exported types: `BreadcrumbProps`, `BreadcrumbLinkProps`, `BreadcrumbPageProps`, and related `*ClassNames` interfaces.
|
|
167
|
+
|
|
168
|
+
|
|
95
169
|
## BulkImportModal
|
|
96
170
|
|
|
97
171
|
Four-step modal wizard for importing spreadsheet data (.xlsx, .xls, .csv). Parsing and validation run entirely in the browser.
|
|
@@ -99,7 +173,7 @@ Four-step modal wizard for importing spreadsheet data (.xlsx, .xls, .csv). Parsi
|
|
|
99
173
|
### Usage
|
|
100
174
|
|
|
101
175
|
```tsx
|
|
102
|
-
import { BulkImportModal } from "@rfdtech/components";
|
|
176
|
+
import { BulkImportModal, useModalSearchParam } from "@rfdtech/components";
|
|
103
177
|
|
|
104
178
|
const fields = [
|
|
105
179
|
{ key: "email", label: "Email", required: true },
|
|
@@ -107,13 +181,18 @@ const fields = [
|
|
|
107
181
|
{ key: "student_id", label: "Student ID" },
|
|
108
182
|
];
|
|
109
183
|
|
|
184
|
+
const { open, onOpenChange, openWith } = useModalSearchParam("bulk-import");
|
|
185
|
+
|
|
186
|
+
<button type="button" onClick={() => openWith()}>Import students</button>
|
|
187
|
+
|
|
110
188
|
<BulkImportModal
|
|
111
189
|
open={open}
|
|
112
|
-
onOpenChange={
|
|
190
|
+
onOpenChange={onOpenChange}
|
|
113
191
|
title="Import students"
|
|
114
192
|
fields={fields}
|
|
115
193
|
onComplete={(result) => {
|
|
116
194
|
console.log(result.rows, result.errors);
|
|
195
|
+
onOpenChange(false);
|
|
117
196
|
}}
|
|
118
197
|
/>
|
|
119
198
|
```
|
|
@@ -292,6 +371,54 @@ import { Checkbox } from "@rfdtech/components";
|
|
|
292
371
|
Props: `checked`, `defaultChecked`, `onCheckedChange`, `label`, `disabled`, `required`, `name`, `value`, `id`, `aria-label`, `classNames`, `className`. Exported types: `CheckboxProps`, `CheckboxClassNames`.
|
|
293
372
|
|
|
294
373
|
|
|
374
|
+
## Command
|
|
375
|
+
|
|
376
|
+
Compound command menu primitives for searchable, keyboard-navigable action lists. Supports inline pickers and modal palettes via `CommandDialog`. See the [Command](/docs/command) docs page for props and exported types.
|
|
377
|
+
|
|
378
|
+
```tsx
|
|
379
|
+
import {
|
|
380
|
+
Command,
|
|
381
|
+
CommandDialog,
|
|
382
|
+
CommandEmpty,
|
|
383
|
+
CommandGroup,
|
|
384
|
+
CommandInput,
|
|
385
|
+
CommandItem,
|
|
386
|
+
CommandList,
|
|
387
|
+
CommandShortcut,
|
|
388
|
+
useDialogSearchParam,
|
|
389
|
+
} from "@rfdtech/components";
|
|
390
|
+
|
|
391
|
+
<Command label="Field picker">
|
|
392
|
+
<CommandInput placeholder="Search fields..." />
|
|
393
|
+
<CommandList>
|
|
394
|
+
<CommandEmpty>No results.</CommandEmpty>
|
|
395
|
+
<CommandGroup heading="Fields">
|
|
396
|
+
<CommandItem value="email" onSelect={() => setField("email")}>
|
|
397
|
+
Email
|
|
398
|
+
</CommandItem>
|
|
399
|
+
</CommandGroup>
|
|
400
|
+
</CommandList>
|
|
401
|
+
</Command>
|
|
402
|
+
|
|
403
|
+
const { open, onOpenChange, openWith } = useDialogSearchParam("command-menu");
|
|
404
|
+
|
|
405
|
+
<Button onClick={() => openWith()}>Open command menu</Button>
|
|
406
|
+
|
|
407
|
+
<CommandDialog open={open} onOpenChange={onOpenChange} shortcut label="Command menu">
|
|
408
|
+
<CommandInput placeholder="Type a command..." />
|
|
409
|
+
<CommandList>
|
|
410
|
+
<CommandItem onSelect={() => go("/dashboard")}>Dashboard</CommandItem>
|
|
411
|
+
<CommandItem onSelect={signOut}>
|
|
412
|
+
Sign out
|
|
413
|
+
<CommandShortcut><span>⌘</span><span>Q</span></CommandShortcut>
|
|
414
|
+
</CommandItem>
|
|
415
|
+
</CommandList>
|
|
416
|
+
</CommandDialog>
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
Exports: `Command`, `CommandDialog`, `CommandInput`, `CommandList`, `CommandEmpty`, `CommandGroup`, `CommandItem`, `CommandSeparator`, `CommandLoading`, `CommandShortcut`, `useCommandShortcut`. Exported types: `CommandProps`, `CommandDialogProps`, `CommandItemProps`, `CommandShortcutProps`, `UseCommandShortcutOptions`, and related `*ClassNames` types.
|
|
420
|
+
|
|
421
|
+
|
|
295
422
|
## RadioGroup
|
|
296
423
|
|
|
297
424
|
Single-choice radio group with optional labels and descriptions on each `Radio` item. Use `variant="card"` for bordered choice cards. See the [RadioGroup](/docs/radio-group) docs page for props and exported types.
|
|
@@ -339,6 +466,193 @@ import { Dropdown } from "@rfdtech/components";
|
|
|
339
466
|
Props: `value`, `onValueChange`, `options`, `placeholder`, `clearable`, `disabled`, `aria-label`, `classNames`, `className`. Exported types: `DropdownProps`, `DropdownOption`, `DropdownClassNames`.
|
|
340
467
|
|
|
341
468
|
|
|
469
|
+
## Form
|
|
470
|
+
|
|
471
|
+
Field, Input, and Textarea primitives for accessible form layouts. See the [Form](/docs/form) docs page for props and exported types.
|
|
472
|
+
|
|
473
|
+
```tsx
|
|
474
|
+
import {
|
|
475
|
+
Field,
|
|
476
|
+
FieldControl,
|
|
477
|
+
FieldDescription,
|
|
478
|
+
FieldLabel,
|
|
479
|
+
Input,
|
|
480
|
+
Textarea,
|
|
481
|
+
} from "@rfdtech/components";
|
|
482
|
+
|
|
483
|
+
<Field>
|
|
484
|
+
<FieldLabel>Email</FieldLabel>
|
|
485
|
+
<FieldControl>
|
|
486
|
+
<Input type="email" placeholder="you@example.com" />
|
|
487
|
+
</FieldControl>
|
|
488
|
+
<FieldDescription>We will never share your email.</FieldDescription>
|
|
489
|
+
</Field>
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
Exports: `Field`, `FieldLabel`, `FieldDescription`, `FieldError`, `FieldControl`, `Input`, `Textarea`. Types: `FieldProps`, `FieldClassNames`, `InputProps`, `TextareaProps`.
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
## FormField
|
|
496
|
+
|
|
497
|
+
react-hook-form adapters with Zod validation support. See the [FormField](/docs/form-field) docs page for props and exported types.
|
|
498
|
+
|
|
499
|
+
```bash
|
|
500
|
+
npm install react-hook-form zod @hookform/resolvers
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
```tsx
|
|
504
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
505
|
+
import { useForm } from "react-hook-form";
|
|
506
|
+
import { z } from "zod";
|
|
507
|
+
import {
|
|
508
|
+
Button,
|
|
509
|
+
Field,
|
|
510
|
+
FieldControl,
|
|
511
|
+
FieldError,
|
|
512
|
+
FieldLabel,
|
|
513
|
+
Form,
|
|
514
|
+
FormField,
|
|
515
|
+
Input,
|
|
516
|
+
} from "@rfdtech/components";
|
|
517
|
+
|
|
518
|
+
const formSchema = z.object({
|
|
519
|
+
email: z.string().min(1, "Email is required").email("Enter a valid email address"),
|
|
520
|
+
});
|
|
521
|
+
|
|
522
|
+
type FormValues = z.infer<typeof formSchema>;
|
|
523
|
+
|
|
524
|
+
const form = useForm<FormValues>({
|
|
525
|
+
resolver: zodResolver(formSchema),
|
|
526
|
+
defaultValues: { email: "" },
|
|
527
|
+
});
|
|
528
|
+
|
|
529
|
+
<Form {...form}>
|
|
530
|
+
<form onSubmit={form.handleSubmit(onSubmit)}>
|
|
531
|
+
<FormField
|
|
532
|
+
control={form.control}
|
|
533
|
+
name="email"
|
|
534
|
+
render={({ field, fieldState }) => (
|
|
535
|
+
<Field invalid={!!fieldState.error}>
|
|
536
|
+
<FieldLabel>Email</FieldLabel>
|
|
537
|
+
<FieldControl>
|
|
538
|
+
<Input type="email" {...field} />
|
|
539
|
+
</FieldControl>
|
|
540
|
+
<FieldError>{fieldState.error?.message}</FieldError>
|
|
541
|
+
</Field>
|
|
542
|
+
)}
|
|
543
|
+
/>
|
|
544
|
+
<Button type="submit">Save</Button>
|
|
545
|
+
</form>
|
|
546
|
+
</Form>
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
Exports: `Form`, `FormField`, `useFormField`. Types: `FormProps`, `FormFieldProps`, `UseFormFieldReturn`.
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
## Dialog
|
|
553
|
+
|
|
554
|
+
Compound dialog primitives for modal overlays. See the [Dialog](/docs/dialog) docs page for props and exported types.
|
|
555
|
+
|
|
556
|
+
```tsx
|
|
557
|
+
import {
|
|
558
|
+
Button,
|
|
559
|
+
Dialog,
|
|
560
|
+
DialogContent,
|
|
561
|
+
DialogDescription,
|
|
562
|
+
DialogOverlay,
|
|
563
|
+
DialogPortal,
|
|
564
|
+
DialogTitle,
|
|
565
|
+
useDialogSearchParam,
|
|
566
|
+
} from "@rfdtech/components";
|
|
567
|
+
|
|
568
|
+
const { open, data, onOpenChange, openWith } = useDialogSearchParam<{
|
|
569
|
+
userId: string;
|
|
570
|
+
}>("edit-profile");
|
|
571
|
+
|
|
572
|
+
<Button variant="secondary" onClick={() => openWith({ userId: "42" })}>
|
|
573
|
+
Edit profile
|
|
574
|
+
</Button>
|
|
575
|
+
|
|
576
|
+
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
577
|
+
<DialogPortal>
|
|
578
|
+
<DialogOverlay />
|
|
579
|
+
<DialogContent showCloseButton>
|
|
580
|
+
<DialogTitle>Edit profile</DialogTitle>
|
|
581
|
+
<DialogDescription>
|
|
582
|
+
Make changes here. Editing user {data?.userId}.
|
|
583
|
+
</DialogDescription>
|
|
584
|
+
</DialogContent>
|
|
585
|
+
</DialogPortal>
|
|
586
|
+
</Dialog>
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
Props: `Dialog` — `open`, `defaultOpen`, `onOpenChange`. `DialogContent` — `showCloseButton`, `classNames`, `className`. Styled parts also support part-level `classNames`. Exported types: `DialogOverlayProps`, `DialogContentProps`, `DialogTitleProps`, `DialogDescriptionProps`, and related `*ClassNames` interfaces.
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
## Draggable
|
|
593
|
+
|
|
594
|
+
Repositionable panel primitive with optional handle and bounded pointer dragging. See the [Draggable](/docs/draggable) docs page for props and exported types.
|
|
595
|
+
|
|
596
|
+
```tsx
|
|
597
|
+
import { Draggable, DraggableHandle } from "@rfdtech/components";
|
|
598
|
+
|
|
599
|
+
<div style={{ position: "relative", height: 240 }}>
|
|
600
|
+
<Draggable defaultPosition={{ x: 24, y: 24 }} bounds="parent">
|
|
601
|
+
<DraggableHandle aria-label="Drag card" />
|
|
602
|
+
<div>Drag me</div>
|
|
603
|
+
</Draggable>
|
|
604
|
+
</div>
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
Exports: `Draggable`, `DraggableHandle`, `useDraggable`, `clampPosition`. Types: `DraggableProps`, `DraggableHandleProps`, `DraggablePosition`, `DraggableBounds`, `DraggableAxis`, `UseDraggableOptions`, `UseDraggableReturn`.
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
## Modal
|
|
611
|
+
|
|
612
|
+
Compound modal primitives for near full-viewport overlays with header, body, and footer slots. See the [Modal](/docs/modal) docs page for props and exported types.
|
|
613
|
+
|
|
614
|
+
```tsx
|
|
615
|
+
import {
|
|
616
|
+
Button,
|
|
617
|
+
Modal,
|
|
618
|
+
ModalBody,
|
|
619
|
+
ModalContent,
|
|
620
|
+
ModalDescription,
|
|
621
|
+
ModalFooter,
|
|
622
|
+
ModalHeader,
|
|
623
|
+
ModalOverlay,
|
|
624
|
+
ModalPortal,
|
|
625
|
+
ModalTitle,
|
|
626
|
+
useModalSearchParam,
|
|
627
|
+
} from "@rfdtech/components";
|
|
628
|
+
|
|
629
|
+
const { open, onOpenChange, openWith } = useModalSearchParam("review-changes");
|
|
630
|
+
|
|
631
|
+
<Button variant="secondary" onClick={() => openWith()}>
|
|
632
|
+
Review changes
|
|
633
|
+
</Button>
|
|
634
|
+
|
|
635
|
+
<Modal open={open} onOpenChange={onOpenChange}>
|
|
636
|
+
<ModalPortal>
|
|
637
|
+
<ModalOverlay />
|
|
638
|
+
<ModalContent showCloseButton>
|
|
639
|
+
<ModalHeader>
|
|
640
|
+
<ModalTitle>Review changes</ModalTitle>
|
|
641
|
+
<ModalDescription>Confirm before publishing.</ModalDescription>
|
|
642
|
+
</ModalHeader>
|
|
643
|
+
<ModalBody>{children}</ModalBody>
|
|
644
|
+
<ModalFooter>
|
|
645
|
+
<Button variant="ghost" onClick={() => onOpenChange(false)}>Cancel</Button>
|
|
646
|
+
<Button onClick={() => onOpenChange(false)}>Publish</Button>
|
|
647
|
+
</ModalFooter>
|
|
648
|
+
</ModalContent>
|
|
649
|
+
</ModalPortal>
|
|
650
|
+
</Modal>
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
Props: `Modal` — `open`, `defaultOpen`, `onOpenChange`. `ModalContent` — `showCloseButton`, `classNames`, `className`. Layout parts (`ModalHeader`, `ModalBody`, `ModalFooter`) support part-level `classNames`. Exported types: `ModalOverlayProps`, `ModalContentProps`, `ModalHeaderProps`, `ModalTitleProps`, `ModalDescriptionProps`, `ModalBodyProps`, `ModalFooterProps`, and related `*ClassNames` interfaces.
|
|
654
|
+
|
|
655
|
+
|
|
342
656
|
## Popover
|
|
343
657
|
|
|
344
658
|
Compound popover primitives for floating panels. See the [Popover](/docs/popover) docs page for props and exported types.
|
|
@@ -385,6 +699,144 @@ import {
|
|
|
385
699
|
Exports: `Popover`, `PopoverTrigger`, `PopoverContent`, `PopoverPortal`, `PopoverAnchor`, `PopoverClose`. Exported types: `PopoverContentProps`, `PopoverContentClassNames`.
|
|
386
700
|
|
|
387
701
|
|
|
702
|
+
## ProgressBar
|
|
703
|
+
|
|
704
|
+
Accessible progress indicator for task completion and loading states. See the [ProgressBar](/docs/progress-bar) docs page for props and exported types.
|
|
705
|
+
|
|
706
|
+
```tsx
|
|
707
|
+
import { ProgressBar } from "@rfdtech/components";
|
|
708
|
+
|
|
709
|
+
<ProgressBar value={60} label="Upload progress" showValue />
|
|
710
|
+
<ProgressBar value={100} variant="success" />
|
|
711
|
+
<ProgressBar indeterminate label="Loading" size="md" />
|
|
712
|
+
```
|
|
713
|
+
|
|
714
|
+
Props: `value`, `max`, `variant`, `size`, `indeterminate`, `label`, `showValue`, `classNames`, `className`, and standard `div` attributes. Exported types: `ProgressBarProps`, `ProgressBarClassNames`, `ProgressBarVariant`, `ProgressBarSize`.
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
## Sidebar
|
|
718
|
+
|
|
719
|
+
Compound sidebar primitives for app shells and section navigation. Desktop uses a sticky card-style rail with optional collapse; mobile uses an offcanvas drawer with trigger and overlay. See the [Sidebar](/docs/sidebar) docs page for props and exported types.
|
|
720
|
+
|
|
721
|
+
```tsx
|
|
722
|
+
import {
|
|
723
|
+
Sidebar,
|
|
724
|
+
SidebarCollapse,
|
|
725
|
+
SidebarContent,
|
|
726
|
+
SidebarGroup,
|
|
727
|
+
SidebarGroupLabel,
|
|
728
|
+
SidebarHeader,
|
|
729
|
+
SidebarItem,
|
|
730
|
+
SidebarLink,
|
|
731
|
+
SidebarNav,
|
|
732
|
+
SidebarOverlay,
|
|
733
|
+
SidebarProvider,
|
|
734
|
+
SidebarTrigger,
|
|
735
|
+
} from "@rfdtech/components";
|
|
736
|
+
|
|
737
|
+
<SidebarProvider>
|
|
738
|
+
<SidebarTrigger>Open menu</SidebarTrigger>
|
|
739
|
+
<SidebarOverlay />
|
|
740
|
+
<Sidebar>
|
|
741
|
+
<SidebarHeader>
|
|
742
|
+
<div className="gsl-sidebar__header-brand">
|
|
743
|
+
<span className="gsl-sidebar__header-title">GSL Admin</span>
|
|
744
|
+
</div>
|
|
745
|
+
<SidebarCollapse />
|
|
746
|
+
</SidebarHeader>
|
|
747
|
+
<SidebarContent>
|
|
748
|
+
<SidebarNav aria-label="Main">
|
|
749
|
+
<SidebarGroup>
|
|
750
|
+
<SidebarGroupLabel>General</SidebarGroupLabel>
|
|
751
|
+
<SidebarItem>
|
|
752
|
+
<SidebarLink href="/dashboard" icon={<DashboardIcon />} active={path === "/dashboard"}>
|
|
753
|
+
Dashboard
|
|
754
|
+
</SidebarLink>
|
|
755
|
+
</SidebarItem>
|
|
756
|
+
</SidebarGroup>
|
|
757
|
+
</SidebarNav>
|
|
758
|
+
</SidebarContent>
|
|
759
|
+
</Sidebar>
|
|
760
|
+
<main>{children}</main>
|
|
761
|
+
</SidebarProvider>
|
|
762
|
+
```
|
|
763
|
+
|
|
764
|
+
Exports: `SidebarProvider`, `useSidebar`, `Sidebar`, `SidebarBadge`, `SidebarCollapse`, `SidebarTrigger`, `SidebarOverlay`, `SidebarHeader`, `SidebarContent`, `SidebarFooter`, `SidebarNav`, `SidebarGroup`, `SidebarGroupLabel`, `SidebarItem`, `SidebarLink`. Exported types: `SidebarProviderProps`, `SidebarProps`, `SidebarLinkProps`, `SidebarBadgeProps`, `SidebarCollapseProps`, and related `*ClassNames` types.
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
## Sheet
|
|
768
|
+
|
|
769
|
+
Compound sheet primitives for edge-sliding panels. See the [Sheet](/docs/sheet) docs page for props and exported types.
|
|
770
|
+
|
|
771
|
+
```tsx
|
|
772
|
+
import {
|
|
773
|
+
Button,
|
|
774
|
+
Sheet,
|
|
775
|
+
SheetBody,
|
|
776
|
+
SheetContent,
|
|
777
|
+
SheetDescription,
|
|
778
|
+
SheetFooter,
|
|
779
|
+
SheetHeader,
|
|
780
|
+
SheetOverlay,
|
|
781
|
+
SheetPortal,
|
|
782
|
+
SheetTitle,
|
|
783
|
+
SheetTrigger,
|
|
784
|
+
} from "@rfdtech/components";
|
|
785
|
+
|
|
786
|
+
<Sheet open={open} onOpenChange={setOpen}>
|
|
787
|
+
<SheetTrigger asChild>
|
|
788
|
+
<Button variant="secondary">Open filters</Button>
|
|
789
|
+
</SheetTrigger>
|
|
790
|
+
<SheetPortal>
|
|
791
|
+
<SheetOverlay />
|
|
792
|
+
<SheetContent side="right" showCloseButton>
|
|
793
|
+
<SheetHeader>
|
|
794
|
+
<SheetTitle>Filters</SheetTitle>
|
|
795
|
+
<SheetDescription>Refine the results below.</SheetDescription>
|
|
796
|
+
</SheetHeader>
|
|
797
|
+
<SheetBody>{children}</SheetBody>
|
|
798
|
+
<SheetFooter>
|
|
799
|
+
<Button variant="ghost" onClick={() => setOpen(false)}>Reset</Button>
|
|
800
|
+
<Button onClick={() => setOpen(false)}>Apply</Button>
|
|
801
|
+
</SheetFooter>
|
|
802
|
+
</SheetContent>
|
|
803
|
+
</SheetPortal>
|
|
804
|
+
</Sheet>
|
|
805
|
+
```
|
|
806
|
+
|
|
807
|
+
Props: `Sheet` — `open`, `defaultOpen`, `onOpenChange`. `SheetContent` — `side`, `showCloseButton`, `classNames`, `className`. Layout parts support part-level `classNames`. Exported types: `SheetSide`, `SheetOverlayProps`, `SheetContentProps`, `SheetHeaderProps`, `SheetTitleProps`, `SheetDescriptionProps`, `SheetBodyProps`, `SheetFooterProps`, and related `*ClassNames` interfaces.
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
## Sortable
|
|
811
|
+
|
|
812
|
+
Reorderable list primitive with optional drag handles and keyboard support. See the [Sortable](/docs/sortable) docs page for props and exported types.
|
|
813
|
+
|
|
814
|
+
```tsx
|
|
815
|
+
import { useState } from "react";
|
|
816
|
+
import {
|
|
817
|
+
Sortable,
|
|
818
|
+
SortableHandle,
|
|
819
|
+
SortableItem,
|
|
820
|
+
SortableList,
|
|
821
|
+
} from "@rfdtech/components";
|
|
822
|
+
|
|
823
|
+
const [items, setItems] = useState(["alpha", "beta", "gamma"]);
|
|
824
|
+
|
|
825
|
+
<Sortable items={items} onReorder={setItems}>
|
|
826
|
+
<SortableList>
|
|
827
|
+
{items.map((id) => (
|
|
828
|
+
<SortableItem key={id} id={id}>
|
|
829
|
+
<SortableHandle aria-label={`Reorder ${id}`} />
|
|
830
|
+
<span>{id}</span>
|
|
831
|
+
</SortableItem>
|
|
832
|
+
))}
|
|
833
|
+
</SortableList>
|
|
834
|
+
</Sortable>
|
|
835
|
+
```
|
|
836
|
+
|
|
837
|
+
Exports: `Sortable`, `SortableList`, `SortableItem`, `SortableHandle`, `reorderItems`. Types: `SortableProps`, `SortableListProps`, `SortableItemProps`, `SortableHandleProps`, `SortableId`, `SortableStrategy`, `SortableClassNames`.
|
|
838
|
+
|
|
839
|
+
|
|
388
840
|
## Tabs
|
|
389
841
|
|
|
390
842
|
Compound tabs primitives for switching between related panels. See the [Tabs](/docs/tabs) docs page for props and exported types.
|
|
@@ -404,6 +856,33 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@rfdtech/components";
|
|
|
404
856
|
|
|
405
857
|
Exports: `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent`. Props: `Tabs` — `value`, `defaultValue`, `onValueChange`, `orientation`, `activationMode`, `variant`, `classNames`, `className`, `children`. `TabsTrigger` — `value`, `disabled`, `classNames`, `className`. Exported types: `TabsProps`, `TabsListProps`, `TabsTriggerProps`, `TabsContentProps`, `TabsVariant`, `TabsClassNames`, `TabsListClassNames`, `TabsTriggerClassNames`, `TabsContentClassNames`.
|
|
406
858
|
|
|
859
|
+
|
|
860
|
+
## Toast
|
|
861
|
+
|
|
862
|
+
Transient notifications with an imperative `useToast` hook, powered by Sonner. See the [Toast](/docs/toast) docs page for props and exported types.
|
|
863
|
+
|
|
864
|
+
```tsx
|
|
865
|
+
import { CheckCircle2 } from "lucide-react";
|
|
866
|
+
import { ToastProvider, Toaster, useToast } from "@rfdtech/components";
|
|
867
|
+
|
|
868
|
+
<ToastProvider>
|
|
869
|
+
<App />
|
|
870
|
+
<Toaster />
|
|
871
|
+
</ToastProvider>
|
|
872
|
+
|
|
873
|
+
const { toast } = useToast();
|
|
874
|
+
|
|
875
|
+
toast({
|
|
876
|
+
title: "Profile saved",
|
|
877
|
+
description: "Your changes were applied.",
|
|
878
|
+
variant: "success",
|
|
879
|
+
icon: <CheckCircle2 size={18} strokeWidth={2} aria-hidden />,
|
|
880
|
+
});
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
Exports: `ToastProvider`, `Toaster`, `useToast`. Types: `ToastOptions`, `ToastVariant`, `ToastProviderProps`, `ToasterProps`, `UseToastReturn`, `ToastClassNames`, `ToastAction`, `ToastReturn`.
|
|
884
|
+
|
|
885
|
+
|
|
407
886
|
## Development
|
|
408
887
|
|
|
409
888
|
```bash
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/badge/Badge.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,oBAAoB,CAAC;AAE5B,eAAO,MAAM,KAAK,wGA0BhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.test.d.ts","sourceRoot":"","sources":["../../../src/components/badge/Badge.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EACV,eAAe,EACf,UAAU,EACV,SAAS,EACT,YAAY,GACb,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BreadcrumbEllipsisProps, BreadcrumbItemProps, BreadcrumbLinkProps, BreadcrumbListProps, BreadcrumbPageProps, BreadcrumbProps, BreadcrumbSeparatorProps } from "../../types/breadcrumb";
|
|
2
|
+
import "./styles/breadcrumb.css";
|
|
3
|
+
export declare const Breadcrumb: import("react").ForwardRefExoticComponent<BreadcrumbProps & import("react").RefAttributes<HTMLElement>>;
|
|
4
|
+
export declare const BreadcrumbList: import("react").ForwardRefExoticComponent<BreadcrumbListProps & import("react").RefAttributes<HTMLOListElement>>;
|
|
5
|
+
export declare const BreadcrumbItem: import("react").ForwardRefExoticComponent<BreadcrumbItemProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
6
|
+
export declare const BreadcrumbLink: import("react").ForwardRefExoticComponent<BreadcrumbLinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
7
|
+
export declare const BreadcrumbPage: import("react").ForwardRefExoticComponent<BreadcrumbPageProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
8
|
+
export declare const BreadcrumbSeparator: import("react").ForwardRefExoticComponent<BreadcrumbSeparatorProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
9
|
+
export declare const BreadcrumbEllipsis: import("react").ForwardRefExoticComponent<BreadcrumbEllipsisProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
10
|
+
//# sourceMappingURL=Breadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/Breadcrumb.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,yBAAyB,CAAC;AAEjC,eAAO,MAAM,UAAU,yGAsBtB,CAAC;AAEF,eAAO,MAAM,cAAc,kHAY1B,CAAC;AAEF,eAAO,MAAM,cAAc,+GAY1B,CAAC;AAEF,eAAO,MAAM,cAAc,mHAgC1B,CAAC;AAEF,eAAO,MAAM,cAAc,iHAa1B,CAAC;AAEF,eAAO,MAAM,mBAAmB,oHAwB9B,CAAC;AAEH,eAAO,MAAM,kBAAkB,qHA6B7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumb.test.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/Breadcrumb.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "./Breadcrumb";
|
|
2
|
+
export type { BreadcrumbClassNames, BreadcrumbEllipsisClassNames, BreadcrumbEllipsisProps, BreadcrumbItemClassNames, BreadcrumbItemProps, BreadcrumbLinkClassNames, BreadcrumbLinkProps, BreadcrumbListClassNames, BreadcrumbListProps, BreadcrumbPageClassNames, BreadcrumbPageProps, BreadcrumbProps, BreadcrumbSeparatorClassNames, BreadcrumbSeparatorProps, } from "../../types/breadcrumb";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,oBAAoB,EACpB,4BAA4B,EAC5B,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,EACf,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CommandDialogProps, CommandEmptyProps, CommandGroupProps, CommandInputProps, CommandItemProps, CommandListProps, CommandLoadingProps, CommandProps, CommandSeparatorProps, CommandShortcutProps } from "../../types/command";
|
|
2
|
+
import "./styles/command.css";
|
|
3
|
+
export { useCommandDialog } from "./CommandDialogContext";
|
|
4
|
+
export { useCommandShortcut } from "./hooks/useCommandShortcut";
|
|
5
|
+
export type { UseCommandShortcutOptions } from "./hooks/useCommandShortcut";
|
|
6
|
+
export { formatCommandShortcutLabels, matchesCommandShortcut, parseCommandShortcut, } from "./hooks/parseCommandShortcut";
|
|
7
|
+
export type { ParsedCommandShortcut } from "./hooks/parseCommandShortcut";
|
|
8
|
+
export declare const Command: import("react").ForwardRefExoticComponent<CommandProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const CommandDialog: import("react").ForwardRefExoticComponent<CommandDialogProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const CommandInput: import("react").ForwardRefExoticComponent<CommandInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
11
|
+
export declare const CommandList: import("react").ForwardRefExoticComponent<CommandListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export declare const CommandEmpty: import("react").ForwardRefExoticComponent<CommandEmptyProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export declare const CommandGroup: import("react").ForwardRefExoticComponent<CommandGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export declare const CommandItem: import("react").ForwardRefExoticComponent<CommandItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export declare const CommandShortcut: import("react").ForwardRefExoticComponent<CommandShortcutProps & import("react").RefAttributes<HTMLElement>>;
|
|
16
|
+
export declare const CommandSeparator: import("react").ForwardRefExoticComponent<CommandSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export declare const CommandLoading: import("react").ForwardRefExoticComponent<CommandLoadingProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
//# sourceMappingURL=Command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Command.d.ts","sourceRoot":"","sources":["../../../src/components/command/Command.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,YAAY,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAqB1E,eAAO,MAAM,OAAO,yGAalB,CAAC;AAEH,eAAO,MAAM,aAAa,+GAmFzB,CAAC;AAEF,eAAO,MAAM,YAAY,gHAgDxB,CAAC;AAEF,eAAO,MAAM,WAAW,6GAYvB,CAAC;AAEF,eAAO,MAAM,YAAY,8GAYxB,CAAC;AAEF,eAAO,MAAM,YAAY,8GAmCxB,CAAC;AAEF,eAAO,MAAM,WAAW,6GAYvB,CAAC;AAEF,eAAO,MAAM,eAAe,8GAe3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,kHAe3B,CAAC;AAEH,eAAO,MAAM,cAAc,gHAY1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Command.test.d.ts","sourceRoot":"","sources":["../../../src/components/command/Command.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface CommandDialogContextValue {
|
|
3
|
+
inputShortcut?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function CommandDialogProvider({ children, inputShortcut, }: {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
inputShortcut?: string;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
export declare function useCommandDialog(): CommandDialogContextValue | null;
|
|
10
|
+
//# sourceMappingURL=CommandDialogContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandDialogContext.d.ts","sourceRoot":"","sources":["../../../src/components/command/CommandDialogContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,MAAM,WAAW,yBAAyB;IACxC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,aAAa,GACd,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,+BAMA;AAED,wBAAgB,gBAAgB,qCAE/B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ParsedCommandShortcut {
|
|
2
|
+
key: string;
|
|
3
|
+
metaKey: boolean;
|
|
4
|
+
ctrlKey: boolean;
|
|
5
|
+
shiftKey: boolean;
|
|
6
|
+
altKey: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function parseCommandShortcut(shortcut: string): ParsedCommandShortcut;
|
|
9
|
+
export declare function matchesCommandShortcut(event: KeyboardEvent, shortcut: string): boolean;
|
|
10
|
+
export declare function formatCommandShortcutLabels(shortcut: string): string[];
|
|
11
|
+
//# sourceMappingURL=parseCommandShortcut.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseCommandShortcut.d.ts","sourceRoot":"","sources":["../../../../src/components/command/hooks/parseCommandShortcut.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CACjB;AAUD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,qBAAqB,CA0B5E;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,MAAM,GACf,OAAO,CAUT;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAwCtE"}
|