@foundrykit/components 2.1.1 → 2.1.4
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/.turbo/turbo-build.log +14 -14
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +26 -0
- package/README.md +49 -145
- package/dist/index.d.ts +270 -60
- package/dist/index.js +2137 -1447
- package/dist/index.js.map +1 -1
- package/package.json +16 -9
- package/src/components/advanced-search-bar/index.tsx +121 -122
- package/src/components/calendar/config.ts +1 -1
- package/src/components/calendar/index.tsx +37 -25
- package/src/components/carousel/config.ts +28 -0
- package/src/components/carousel/index.tsx +258 -0
- package/src/components/chart/config.ts +28 -0
- package/src/components/chart/index.tsx +365 -0
- package/src/components/combobox/config.ts +28 -0
- package/src/components/combobox/index.tsx +101 -0
- package/src/components/command/config.ts +1 -1
- package/src/components/command/index.tsx +23 -12
- package/src/components/data-table/config.ts +28 -0
- package/src/components/data-table/index.tsx +124 -0
- package/src/components/date-picker/config.ts +1 -1
- package/src/components/date-picker/index.tsx +119 -51
- package/src/components/form/index.tsx +29 -11
- package/src/components/input-otp/config.ts +28 -0
- package/src/components/input-otp/index.tsx +92 -0
- package/src/components/pagination/config.ts +1 -1
- package/src/components/pagination/index.tsx +16 -8
- package/src/components/search-bar/config.ts +1 -1
- package/src/components/search-bar/index.tsx +9 -3
- package/src/components/sidebar/index.tsx +22 -25
- package/src/components/theme-toggle/index.tsx +2 -3
- package/src/index.ts +66 -37
- package/eslint.config.js +0 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
> @foundrykit/components@2.1.
|
|
2
|
+
> @foundrykit/components@2.1.4 build /home/runner/work/foundry/foundry/packages/components
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.5.0
|
|
8
|
+
[34mCLI[39m Using tsup config: /home/runner/work/foundry/foundry/packages/components/tsup.config.ts
|
|
9
|
+
[34mCLI[39m Target: es2022
|
|
10
|
+
[34mCLI[39m Cleaning output folder
|
|
11
|
+
[34mESM[39m Build start
|
|
12
|
+
[32mESM[39m [1mdist/index.js [22m[32m71.51 KB[39m
|
|
13
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m135.55 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 131ms
|
|
15
|
+
[34mDTS[39m Build start
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 8013ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m25.01 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @foundrykit/components
|
|
2
2
|
|
|
3
|
+
## 2.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`f8b9faa`](https://github.com/umi-labs/foundry/commit/f8b9faa49e747e6a25b05f2be11c9b18319706d0), [`66409bd`](https://github.com/umi-labs/foundry/commit/66409bd67c511a8fc0096b479d46e95c8ef2e0b6)]:
|
|
8
|
+
- @foundrykit/types@3.0.0
|
|
9
|
+
- @foundrykit/hooks@2.0.7
|
|
10
|
+
- @foundrykit/primitives@2.0.8
|
|
11
|
+
- @foundrykit/utils@1.0.8
|
|
12
|
+
|
|
13
|
+
## 2.1.3
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`b6fc94d`](https://github.com/umi-labs/foundry/commit/b6fc94d3b0f172aa309388f61bd5306af6405fdf)]:
|
|
18
|
+
- @foundrykit/hooks@2.0.7
|
|
19
|
+
- @foundrykit/primitives@2.0.7
|
|
20
|
+
- @foundrykit/types@2.0.7
|
|
21
|
+
- @foundrykit/utils@1.0.7
|
|
22
|
+
|
|
23
|
+
## 2.1.2
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- [#36](https://github.com/umi-labs/foundry/pull/36) [`e8a0bf2`](https://github.com/umi-labs/foundry/commit/e8a0bf235e7c56807c3b9a57151603842c2cf1b1) Thanks [@sneddonisaac](https://github.com/sneddonisaac)! - Declare `class-variance-authority` as a dependency. `AdvancedSearchBar` imported it without listing it, so installs that don't hoist packages failed to resolve it.
|
|
28
|
+
|
|
3
29
|
## 2.1.1
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,179 +1,83 @@
|
|
|
1
1
|
# @foundrykit/components
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
`@foundrykit/primitives
|
|
5
|
-
consistent styling and behaviour.
|
|
6
|
-
|
|
7
|
-
## Features
|
|
8
|
-
|
|
9
|
-
- **Pre-styled components** - Ready-to-use with consistent design
|
|
10
|
-
- **Built on primitives** - Leverages `@foundrykit/primitives` for accessibility
|
|
11
|
-
- **TypeScript support** - Full type safety with comprehensive definitions
|
|
12
|
-
- **Customizable** - Easy to override styles and behaviour
|
|
13
|
-
- **Consistent API** - Uniform component patterns across the library
|
|
3
|
+
Higher-level, ready-to-use React components built on top of
|
|
4
|
+
[`@foundrykit/primitives`](../primitives) — search bars, date pickers, command
|
|
5
|
+
palettes, pagination, and form helpers with consistent styling and behaviour.
|
|
14
6
|
|
|
15
7
|
## Installation
|
|
16
8
|
|
|
17
9
|
```bash
|
|
18
|
-
pnpm add @foundrykit/components
|
|
10
|
+
pnpm add @foundrykit/components @foundrykit/tailwind
|
|
19
11
|
```
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### Data Entry
|
|
24
|
-
|
|
25
|
-
- **Calendar** - Date picker calendar component
|
|
26
|
-
- **Date Picker** - Complete date selection interface
|
|
27
|
-
- **Search Bar** - Search input with suggestions and filters
|
|
13
|
+
Import the design-token stylesheet once at your app root so the components are
|
|
14
|
+
styled and themeable:
|
|
28
15
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
- **Pagination** - Page navigation with configurable page sizes
|
|
16
|
+
```tsx
|
|
17
|
+
import '@foundrykit/tailwind/globals.css';
|
|
18
|
+
```
|
|
33
19
|
|
|
34
20
|
## Usage
|
|
35
21
|
|
|
36
|
-
### Basic Example
|
|
37
|
-
|
|
38
22
|
```tsx
|
|
39
|
-
import {
|
|
40
|
-
import { DatePicker } from '@foundrykit/components/date-picker';
|
|
41
|
-
import { SearchBar } from '@foundrykit/components/search-bar';
|
|
23
|
+
import { SearchBar, DatePicker } from '@foundrykit/components';
|
|
42
24
|
|
|
43
|
-
function
|
|
25
|
+
function Example() {
|
|
44
26
|
return (
|
|
45
|
-
<div>
|
|
27
|
+
<div className='space-y-4'>
|
|
46
28
|
<SearchBar
|
|
47
29
|
placeholder='Search...'
|
|
48
30
|
onSearch={query => console.log(query)}
|
|
49
31
|
/>
|
|
50
|
-
|
|
51
|
-
<DatePicker onDateSelect={date => console.log(date)} />
|
|
52
|
-
|
|
53
|
-
<Calendar mode='single' onSelect={date => console.log(date)} />
|
|
32
|
+
<DatePicker onValueChange={date => console.log(date)} />
|
|
54
33
|
</div>
|
|
55
34
|
);
|
|
56
35
|
}
|
|
57
36
|
```
|
|
58
37
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
Each component can be configured through its config file:
|
|
38
|
+
Compound components export their parts:
|
|
62
39
|
|
|
63
40
|
```tsx
|
|
64
|
-
import {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<Calendar
|
|
71
|
-
className="custom-calendar"
|
|
72
|
-
disabled={false}
|
|
73
|
-
mode="range"
|
|
74
|
-
/>
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Styling
|
|
78
|
-
|
|
79
|
-
Components come with default styling but can be customized:
|
|
80
|
-
|
|
81
|
-
```tsx
|
|
82
|
-
import { SearchBar } from '@foundrykit/components/search-bar';
|
|
83
|
-
import { cn } from '@foundrykit/utils';
|
|
84
|
-
|
|
85
|
-
function CustomSearchBar({ className, ...props }) {
|
|
86
|
-
return (
|
|
87
|
-
<SearchBar
|
|
88
|
-
className={cn('rounded-lg border-2 border-blue-500', className)}
|
|
89
|
-
{...props}
|
|
90
|
-
/>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## Component Structure
|
|
96
|
-
|
|
97
|
-
Each component is organized as follows:
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
component/
|
|
101
|
-
├── config.ts # Component configuration and variants
|
|
102
|
-
├── index.tsx # Main component exports
|
|
103
|
-
├── variants-grid.tsx # Component variants for documentation
|
|
104
|
-
└── README.md # Component-specific documentation
|
|
41
|
+
import {
|
|
42
|
+
Command,
|
|
43
|
+
CommandInput,
|
|
44
|
+
CommandList,
|
|
45
|
+
CommandItem,
|
|
46
|
+
} from '@foundrykit/components';
|
|
105
47
|
```
|
|
106
48
|
|
|
107
|
-
##
|
|
49
|
+
## Available components
|
|
50
|
+
|
|
51
|
+
- **Search:** `SearchBar` — simple search input with icon; `AdvancedSearchBar`
|
|
52
|
+
(+ `AdvancedSearchProvider`, `SearchInput`, `SearchTrigger`, `SearchResults`,
|
|
53
|
+
`SearchSection`, `SearchItem`, `AdvancedSearchBarWrapper`) — debounced,
|
|
54
|
+
keyboard-navigable search with a results dropdown
|
|
55
|
+
- **Dates:** `DatePicker`, `Calendar` (built on
|
|
56
|
+
[`react-day-picker`](https://daypicker.dev/))
|
|
57
|
+
- **Command palette:** `Command` (+ `CommandDialog`, `CommandInput`,
|
|
58
|
+
`CommandList`, `CommandEmpty`, `CommandGroup`, `CommandItem`,
|
|
59
|
+
`CommandShortcut`, `CommandSeparator`), built on
|
|
60
|
+
[`cmdk`](https://cmdk.paco.me/)
|
|
61
|
+
- **Navigation:** `Pagination` (+ `PaginationContent`, `PaginationItem`,
|
|
62
|
+
`PaginationLink`, `PaginationPrevious`, `PaginationNext`,
|
|
63
|
+
`PaginationEllipsis`)
|
|
64
|
+
- **Forms:** `Form` (+ `FormItem`, `FormLabel`, `FormControl`,
|
|
65
|
+
`FormDescription`, `FormMessage`, `FormField`, `useFormField`), built on
|
|
66
|
+
[`react-hook-form`](https://react-hook-form.com/)
|
|
67
|
+
|
|
68
|
+
The `SearchResult` and `SearchSection` (as `SearchSectionType`) types and the
|
|
69
|
+
`cn` class-merge helper are also re-exported. Every component is exported from
|
|
70
|
+
the package root; individual modules are available via the `./components/*`
|
|
71
|
+
subpath export.
|
|
72
|
+
|
|
73
|
+
## Documentation
|
|
74
|
+
|
|
75
|
+
Explore every component, variant, and state live in Storybook:
|
|
108
76
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
- **@foundrykit/utils** - Utility functions
|
|
112
|
-
- **React** - UI framework
|
|
113
|
-
- **date-fns** - Date manipulation utilities
|
|
114
|
-
- **cmdk** - Command palette functionality
|
|
115
|
-
|
|
116
|
-
## Integration with Primitives
|
|
117
|
-
|
|
118
|
-
Components are built on top of primitives for maximum flexibility:
|
|
119
|
-
|
|
120
|
-
```tsx
|
|
121
|
-
import { Calendar } from '@foundrykit/components/calendar'
|
|
122
|
-
import { Calendar as CalendarPrimitive } from '@foundrykit/primitives/calendar'
|
|
123
|
-
|
|
124
|
-
// Use the pre-styled component
|
|
125
|
-
<Calendar />
|
|
126
|
-
|
|
127
|
-
// Or use the primitive directly for custom styling
|
|
128
|
-
<CalendarPrimitive className="my-custom-styles" />
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
## Customization
|
|
132
|
-
|
|
133
|
-
### Theme Integration
|
|
134
|
-
|
|
135
|
-
Components work with your existing theme system:
|
|
136
|
-
|
|
137
|
-
```tsx
|
|
138
|
-
import { SearchBar } from '@foundrykit/components/search-bar';
|
|
139
|
-
|
|
140
|
-
// Components automatically use your theme tokens
|
|
141
|
-
<SearchBar className='bg-background text-foreground' />;
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### Variant System
|
|
145
|
-
|
|
146
|
-
Many components support variants for different use cases:
|
|
147
|
-
|
|
148
|
-
```tsx
|
|
149
|
-
import { SearchBar } from '@foundrykit/components/search-bar'
|
|
150
|
-
|
|
151
|
-
<SearchBar variant="default" />
|
|
152
|
-
<SearchBar variant="outline" />
|
|
153
|
-
<SearchBar variant="ghost" />
|
|
77
|
+
```bash
|
|
78
|
+
pnpm --filter @foundrykit/storybook dev
|
|
154
79
|
```
|
|
155
80
|
|
|
156
|
-
## Accessibility
|
|
157
|
-
|
|
158
|
-
All components inherit accessibility features from their underlying primitives:
|
|
159
|
-
|
|
160
|
-
- Keyboard navigation
|
|
161
|
-
- Screen reader support
|
|
162
|
-
- Focus management
|
|
163
|
-
- ARIA attributes
|
|
164
|
-
- Color contrast compliance
|
|
165
|
-
|
|
166
|
-
## Contributing
|
|
167
|
-
|
|
168
|
-
When adding new components:
|
|
169
|
-
|
|
170
|
-
1. Build on existing primitives when possible
|
|
171
|
-
2. Follow the established component structure
|
|
172
|
-
3. Include comprehensive TypeScript definitions
|
|
173
|
-
4. Add usage examples and documentation
|
|
174
|
-
5. Ensure accessibility compliance
|
|
175
|
-
6. Update this README
|
|
176
|
-
|
|
177
81
|
## License
|
|
178
82
|
|
|
179
83
|
MIT
|
package/dist/index.d.ts
CHANGED
|
@@ -1,67 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { Button, Dialog } from '@foundrykit/primitives';
|
|
5
|
-
import { Command as Command$1 } from 'cmdk';
|
|
1
|
+
import { SearchResult, SearchSection as SearchSection$1 } from '@foundrykit/types';
|
|
2
|
+
export { SearchResult, SearchSection as SearchSectionType } from '@foundrykit/types';
|
|
3
|
+
export { cn } from '@foundrykit/utils';
|
|
6
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
7
|
-
import
|
|
5
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
6
|
import { EmptyStateBehavior } from '@foundrykit/hooks';
|
|
9
7
|
export { useFormField } from '@foundrykit/hooks';
|
|
10
|
-
import {
|
|
11
|
-
|
|
8
|
+
import { VariantProps } from 'class-variance-authority';
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import { Button, Dialog } from '@foundrykit/primitives';
|
|
11
|
+
import { DayPicker } from 'react-day-picker';
|
|
12
|
+
import useEmblaCarousel, { UseEmblaCarouselType } from 'embla-carousel-react';
|
|
13
|
+
import * as RechartsPrimitive from 'recharts';
|
|
14
|
+
import { Command as Command$1 } from 'cmdk';
|
|
15
|
+
import { ColumnDef } from '@tanstack/react-table';
|
|
12
16
|
import * as react_hook_form from 'react-hook-form';
|
|
13
17
|
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
14
18
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
15
19
|
import { Slot } from '@radix-ui/react-slot';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
interface SearchBarProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
19
|
-
onSearch?: (query: string) => void;
|
|
20
|
-
placeholder?: string;
|
|
21
|
-
className?: string;
|
|
22
|
-
value?: string;
|
|
23
|
-
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
24
|
-
}
|
|
25
|
-
declare const SearchBar: React.ForwardRefExoticComponent<SearchBarProps & React.RefAttributes<HTMLInputElement>>;
|
|
26
|
-
|
|
27
|
-
interface DatePickerProps {
|
|
28
|
-
value?: Date;
|
|
29
|
-
onValueChange?: (date: Date | undefined) => void;
|
|
30
|
-
placeholder?: string;
|
|
31
|
-
className?: string;
|
|
32
|
-
disabled?: boolean;
|
|
33
|
-
}
|
|
34
|
-
declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
-
|
|
36
|
-
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
|
|
37
|
-
buttonVariant?: React.ComponentProps<typeof Button>['variant'];
|
|
38
|
-
}): react_jsx_runtime.JSX.Element;
|
|
39
|
-
|
|
40
|
-
declare function Pagination({ className, ...props }: React.ComponentProps<'nav'>): react_jsx_runtime.JSX.Element;
|
|
41
|
-
declare function PaginationContent({ className, ...props }: React.ComponentProps<'ul'>): react_jsx_runtime.JSX.Element;
|
|
42
|
-
declare function PaginationItem({ ...props }: React.ComponentProps<'li'>): react_jsx_runtime.JSX.Element;
|
|
43
|
-
type PaginationLinkProps = {
|
|
44
|
-
isActive?: boolean;
|
|
45
|
-
} & Pick<React.ComponentProps<typeof Button>, 'size'> & React.ComponentProps<'a'>;
|
|
46
|
-
declare function PaginationLink({ className, isActive, size, ...props }: PaginationLinkProps): react_jsx_runtime.JSX.Element;
|
|
47
|
-
declare function PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>): react_jsx_runtime.JSX.Element;
|
|
48
|
-
declare function PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>): react_jsx_runtime.JSX.Element;
|
|
49
|
-
declare function PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
|
|
50
|
-
|
|
51
|
-
declare function Command({ className, ...props }: React.ComponentProps<typeof Command$1>): react_jsx_runtime.JSX.Element;
|
|
52
|
-
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
53
|
-
title?: string;
|
|
54
|
-
description?: string;
|
|
55
|
-
className?: string;
|
|
56
|
-
showCloseButton?: boolean;
|
|
57
|
-
}): react_jsx_runtime.JSX.Element;
|
|
58
|
-
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof Command$1.Input>): react_jsx_runtime.JSX.Element;
|
|
59
|
-
declare function CommandList({ className, ...props }: React.ComponentProps<typeof Command$1.List>): react_jsx_runtime.JSX.Element;
|
|
60
|
-
declare function CommandEmpty({ ...props }: React.ComponentProps<typeof Command$1.Empty>): react_jsx_runtime.JSX.Element;
|
|
61
|
-
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof Command$1.Group>): react_jsx_runtime.JSX.Element;
|
|
62
|
-
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof Command$1.Separator>): react_jsx_runtime.JSX.Element;
|
|
63
|
-
declare function CommandItem({ className, ...props }: React.ComponentProps<typeof Command$1.Item>): react_jsx_runtime.JSX.Element;
|
|
64
|
-
declare function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
|
|
20
|
+
import { OTPInput } from 'input-otp';
|
|
65
21
|
|
|
66
22
|
/**
|
|
67
23
|
* Props for the AdvancedSearchProvider component.
|
|
@@ -143,7 +99,7 @@ declare function AdvancedSearchProvider({ children, onSearch, onResultSelect, de
|
|
|
143
99
|
* Controls the size and visual appearance of the search input container.
|
|
144
100
|
*/
|
|
145
101
|
declare const searchInputWrapperVariants: (props?: ({
|
|
146
|
-
size?: "sm" | "
|
|
102
|
+
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
147
103
|
variant?: "default" | "ghost" | "filled" | null | undefined;
|
|
148
104
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
149
105
|
/**
|
|
@@ -151,7 +107,7 @@ declare const searchInputWrapperVariants: (props?: ({
|
|
|
151
107
|
* Controls the maximum width of the search results dropdown.
|
|
152
108
|
*/
|
|
153
109
|
declare const searchResultsVariants: (props?: ({
|
|
154
|
-
size?: "sm" | "
|
|
110
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null | undefined;
|
|
155
111
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
156
112
|
/**
|
|
157
113
|
* Props for the SearchInput component.
|
|
@@ -363,13 +319,267 @@ declare function AdvancedSearchBarWrapper(props?: {
|
|
|
363
319
|
useCustomTrigger?: boolean;
|
|
364
320
|
}): react_jsx_runtime.JSX.Element;
|
|
365
321
|
|
|
322
|
+
/**
|
|
323
|
+
* Themed wrapper around `react-day-picker`'s `DayPicker`, styled with FoundryKit
|
|
324
|
+
* design tokens. Accepts all `DayPicker` props (`mode`, `selected`, `onSelect`,
|
|
325
|
+
* etc.) plus `buttonVariant` to control the nav button style.
|
|
326
|
+
*/
|
|
327
|
+
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
|
|
328
|
+
buttonVariant?: React.ComponentProps<typeof Button>['variant'];
|
|
329
|
+
}): react_jsx_runtime.JSX.Element;
|
|
330
|
+
|
|
331
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
332
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
333
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
334
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
335
|
+
type CarouselProps = {
|
|
336
|
+
opts?: CarouselOptions;
|
|
337
|
+
plugins?: CarouselPlugin;
|
|
338
|
+
orientation?: 'horizontal' | 'vertical';
|
|
339
|
+
setApi?: (api: CarouselApi) => void;
|
|
340
|
+
};
|
|
341
|
+
/**
|
|
342
|
+
* Carousel root that provides Embla state to its parts.
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
* ```tsx
|
|
346
|
+
* <Carousel>
|
|
347
|
+
* <CarouselContent>
|
|
348
|
+
* <CarouselItem>Slide 1</CarouselItem>
|
|
349
|
+
* </CarouselContent>
|
|
350
|
+
* <CarouselPrevious />
|
|
351
|
+
* <CarouselNext />
|
|
352
|
+
* </Carousel>
|
|
353
|
+
* ```
|
|
354
|
+
*/
|
|
355
|
+
declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<'div'> & CarouselProps): react_jsx_runtime.JSX.Element;
|
|
356
|
+
/** Scrollable track that holds the carousel items. */
|
|
357
|
+
declare function CarouselContent({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
358
|
+
/** A single slide within a {@link CarouselContent}. */
|
|
359
|
+
declare function CarouselItem({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
360
|
+
/** Button that scrolls the carousel to the previous slide. */
|
|
361
|
+
declare function CarouselPrevious({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): react_jsx_runtime.JSX.Element;
|
|
362
|
+
/** Button that scrolls the carousel to the next slide. */
|
|
363
|
+
declare function CarouselNext({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): react_jsx_runtime.JSX.Element;
|
|
364
|
+
|
|
365
|
+
declare const THEMES: {
|
|
366
|
+
readonly light: "";
|
|
367
|
+
readonly dark: ".dark";
|
|
368
|
+
};
|
|
369
|
+
type ChartConfig = {
|
|
370
|
+
[k in string]: {
|
|
371
|
+
label?: React.ReactNode;
|
|
372
|
+
icon?: React.ComponentType;
|
|
373
|
+
} & ({
|
|
374
|
+
color?: string;
|
|
375
|
+
theme?: never;
|
|
376
|
+
} | {
|
|
377
|
+
color?: never;
|
|
378
|
+
theme: Record<keyof typeof THEMES, string>;
|
|
379
|
+
});
|
|
380
|
+
};
|
|
381
|
+
type ChartContextProps = {
|
|
382
|
+
config: ChartConfig;
|
|
383
|
+
};
|
|
384
|
+
declare function useChart(): ChartContextProps;
|
|
385
|
+
/**
|
|
386
|
+
* Responsive chart wrapper that shares config (labels, colors) with its parts.
|
|
387
|
+
*
|
|
388
|
+
* @example
|
|
389
|
+
* ```tsx
|
|
390
|
+
* <ChartContainer config={config}>
|
|
391
|
+
* <BarChart data={data}>
|
|
392
|
+
* <Bar dataKey='total' fill='var(--color-total)' />
|
|
393
|
+
* </BarChart>
|
|
394
|
+
* </ChartContainer>
|
|
395
|
+
* ```
|
|
396
|
+
*/
|
|
397
|
+
declare function ChartContainer({ id, className, children, config, ...props }: React.ComponentProps<'div'> & {
|
|
398
|
+
config: ChartConfig;
|
|
399
|
+
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
|
|
400
|
+
}): react_jsx_runtime.JSX.Element;
|
|
401
|
+
declare function ChartStyle({ id, config }: {
|
|
402
|
+
id: string;
|
|
403
|
+
config: ChartConfig;
|
|
404
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
405
|
+
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
406
|
+
declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<'div'> & {
|
|
407
|
+
hideLabel?: boolean;
|
|
408
|
+
hideIndicator?: boolean;
|
|
409
|
+
indicator?: 'line' | 'dot' | 'dashed';
|
|
410
|
+
nameKey?: string;
|
|
411
|
+
labelKey?: string;
|
|
412
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
413
|
+
declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
|
414
|
+
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<'div'> & Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {
|
|
415
|
+
hideIcon?: boolean;
|
|
416
|
+
nameKey?: string;
|
|
417
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
418
|
+
|
|
419
|
+
type ComboboxOption = {
|
|
420
|
+
value: string;
|
|
421
|
+
label: string;
|
|
422
|
+
};
|
|
423
|
+
/**
|
|
424
|
+
* Searchable single-select combobox composed from `Popover` and `Command`.
|
|
425
|
+
*
|
|
426
|
+
* @example
|
|
427
|
+
* ```tsx
|
|
428
|
+
* <Combobox
|
|
429
|
+
* options={[{ value: 'next', label: 'Next.js' }]}
|
|
430
|
+
* value={value}
|
|
431
|
+
* onValueChange={setValue}
|
|
432
|
+
* placeholder='Select framework...'
|
|
433
|
+
* />
|
|
434
|
+
* ```
|
|
435
|
+
*/
|
|
436
|
+
declare function Combobox({ options, value, onValueChange, placeholder, }: {
|
|
437
|
+
options: ComboboxOption[];
|
|
438
|
+
value?: string;
|
|
439
|
+
onValueChange?: (value: string) => void;
|
|
440
|
+
placeholder?: string;
|
|
441
|
+
}): react_jsx_runtime.JSX.Element;
|
|
442
|
+
|
|
443
|
+
/** Styled `cmdk` command menu — the root container for a command palette. */
|
|
444
|
+
declare function Command({ className, ...props }: React.ComponentProps<typeof Command$1>): react_jsx_runtime.JSX.Element;
|
|
445
|
+
/**
|
|
446
|
+
* Command menu rendered inside a modal dialog. `title` and `description` are
|
|
447
|
+
* visually hidden but read by assistive technology.
|
|
448
|
+
*/
|
|
449
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
450
|
+
title?: string;
|
|
451
|
+
description?: string;
|
|
452
|
+
className?: string;
|
|
453
|
+
showCloseButton?: boolean;
|
|
454
|
+
}): react_jsx_runtime.JSX.Element;
|
|
455
|
+
/** Search input for a command menu, with a leading search icon. */
|
|
456
|
+
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof Command$1.Input>): react_jsx_runtime.JSX.Element;
|
|
457
|
+
/** Scrollable list containing command groups and items. */
|
|
458
|
+
declare function CommandList({ className, ...props }: React.ComponentProps<typeof Command$1.List>): react_jsx_runtime.JSX.Element;
|
|
459
|
+
/** Message shown when no command items match the current query. */
|
|
460
|
+
declare function CommandEmpty({ ...props }: React.ComponentProps<typeof Command$1.Empty>): react_jsx_runtime.JSX.Element;
|
|
461
|
+
/** Labelled group of related command items. */
|
|
462
|
+
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof Command$1.Group>): react_jsx_runtime.JSX.Element;
|
|
463
|
+
/** Horizontal divider between command groups or items. */
|
|
464
|
+
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof Command$1.Separator>): react_jsx_runtime.JSX.Element;
|
|
465
|
+
/** Selectable command item within a {@link CommandList} or {@link CommandGroup}. */
|
|
466
|
+
declare function CommandItem({ className, ...props }: React.ComponentProps<typeof Command$1.Item>): react_jsx_runtime.JSX.Element;
|
|
467
|
+
/** Right-aligned keyboard-shortcut hint shown inside a command item. */
|
|
468
|
+
declare function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Generic, paginated, sortable data table driven by TanStack Table column defs.
|
|
472
|
+
*
|
|
473
|
+
* @example
|
|
474
|
+
* ```tsx
|
|
475
|
+
* <DataTable columns={columns} data={data} />
|
|
476
|
+
* ```
|
|
477
|
+
*/
|
|
478
|
+
declare function DataTable<TData, TValue>({ columns, data, }: {
|
|
479
|
+
columns: ColumnDef<TData, TValue>[];
|
|
480
|
+
data: TData[];
|
|
481
|
+
}): react_jsx_runtime.JSX.Element;
|
|
482
|
+
|
|
483
|
+
interface DatePickerProps {
|
|
484
|
+
value?: Date;
|
|
485
|
+
onValueChange?: (date: Date | undefined) => void;
|
|
486
|
+
placeholder?: string;
|
|
487
|
+
className?: string;
|
|
488
|
+
disabled?: boolean;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Date picker pairing a native date input with a pop-up month grid. Controlled
|
|
492
|
+
* via `value`/`onValueChange`; the calendar closes on selection, outside click,
|
|
493
|
+
* or Escape and returns focus to the toggle button.
|
|
494
|
+
*/
|
|
495
|
+
declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLDivElement>>;
|
|
496
|
+
|
|
497
|
+
/** Form context provider — re-export of react-hook-form's `FormProvider`. */
|
|
366
498
|
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
499
|
+
/**
|
|
500
|
+
* Connects a single field to react-hook-form via a `Controller` and exposes the
|
|
501
|
+
* field name to the surrounding form components through context.
|
|
502
|
+
*/
|
|
367
503
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
368
504
|
|
|
505
|
+
/**
|
|
506
|
+
* Wrapper for a single form field that generates a unique id shared by its
|
|
507
|
+
* label, control, description, and message for accessible associations.
|
|
508
|
+
*/
|
|
369
509
|
declare function FormItem({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
510
|
+
/** Label bound to the field's control; styled as an error when the field is invalid. */
|
|
370
511
|
declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
512
|
+
/**
|
|
513
|
+
* Wires the field's control element with the correct `id`, `aria-describedby`,
|
|
514
|
+
* and `aria-invalid` attributes. Render the input as its single child.
|
|
515
|
+
*/
|
|
371
516
|
declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): react_jsx_runtime.JSX.Element;
|
|
517
|
+
/** Helper text describing the field, linked to the control via `aria-describedby`. */
|
|
372
518
|
declare function FormDescription({ className, ...props }: React.ComponentProps<'p'>): react_jsx_runtime.JSX.Element;
|
|
519
|
+
/**
|
|
520
|
+
* Displays the field's validation error message, or its children when there is
|
|
521
|
+
* no error. Renders nothing when there is no content to show.
|
|
522
|
+
*/
|
|
373
523
|
declare function FormMessage({ className, ...props }: React.ComponentProps<'p'>): react_jsx_runtime.JSX.Element | null;
|
|
374
524
|
|
|
375
|
-
|
|
525
|
+
/**
|
|
526
|
+
* Accessible one-time-password input with individually styled character slots.
|
|
527
|
+
*
|
|
528
|
+
* @example
|
|
529
|
+
* ```tsx
|
|
530
|
+
* <InputOTP maxLength={6}>
|
|
531
|
+
* <InputOTPGroup>
|
|
532
|
+
* <InputOTPSlot index={0} />
|
|
533
|
+
* <InputOTPSlot index={1} />
|
|
534
|
+
* </InputOTPGroup>
|
|
535
|
+
* </InputOTP>
|
|
536
|
+
* ```
|
|
537
|
+
*/
|
|
538
|
+
declare function InputOTP({ className, containerClassName, ...props }: React.ComponentProps<typeof OTPInput> & {
|
|
539
|
+
containerClassName?: string;
|
|
540
|
+
}): react_jsx_runtime.JSX.Element;
|
|
541
|
+
/** Groups related OTP slots together with a shared border. */
|
|
542
|
+
declare function InputOTPGroup({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
543
|
+
/** A single character slot, driven by the OTP input context. */
|
|
544
|
+
declare function InputOTPSlot({ index, className, ...props }: React.ComponentProps<'div'> & {
|
|
545
|
+
index: number;
|
|
546
|
+
}): react_jsx_runtime.JSX.Element;
|
|
547
|
+
/** Visual separator rendered between OTP groups. */
|
|
548
|
+
declare function InputOTPSeparator({ ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
549
|
+
|
|
550
|
+
/** Navigation landmark that wraps a set of pagination controls. */
|
|
551
|
+
declare function Pagination({ className, ...props }: React.ComponentProps<'nav'>): react_jsx_runtime.JSX.Element;
|
|
552
|
+
/** Horizontal list container for pagination items. */
|
|
553
|
+
declare function PaginationContent({ className, ...props }: React.ComponentProps<'ul'>): react_jsx_runtime.JSX.Element;
|
|
554
|
+
/** List item wrapping a single pagination control. */
|
|
555
|
+
declare function PaginationItem({ ...props }: React.ComponentProps<'li'>): react_jsx_runtime.JSX.Element;
|
|
556
|
+
type PaginationLinkProps = {
|
|
557
|
+
isActive?: boolean;
|
|
558
|
+
} & Pick<React.ComponentProps<typeof Button>, 'size'> & React.ComponentProps<'a'>;
|
|
559
|
+
/**
|
|
560
|
+
* Anchor styled as a page-number button. Set `isActive` to mark the current
|
|
561
|
+
* page (applies `aria-current="page"` and an outlined style).
|
|
562
|
+
*/
|
|
563
|
+
declare function PaginationLink({ className, isActive, size, ...props }: PaginationLinkProps): react_jsx_runtime.JSX.Element;
|
|
564
|
+
/** Pagination link for navigating to the previous page. */
|
|
565
|
+
declare function PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>): react_jsx_runtime.JSX.Element;
|
|
566
|
+
/** Pagination link for navigating to the next page. */
|
|
567
|
+
declare function PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>): react_jsx_runtime.JSX.Element;
|
|
568
|
+
/** Non-interactive ellipsis indicating skipped page numbers. */
|
|
569
|
+
declare function PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
|
|
570
|
+
|
|
571
|
+
interface SearchBarProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
572
|
+
onSearch?: (query: string) => void;
|
|
573
|
+
placeholder?: string;
|
|
574
|
+
className?: string;
|
|
575
|
+
value?: string;
|
|
576
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Search input with a leading search icon. Works uncontrolled or controlled
|
|
580
|
+
* (pass `value`/`onChange`); `onSearch` is called with the current query text on
|
|
581
|
+
* every change.
|
|
582
|
+
*/
|
|
583
|
+
declare const SearchBar: React.ForwardRefExoticComponent<SearchBarProps & React.RefAttributes<HTMLInputElement>>;
|
|
584
|
+
|
|
585
|
+
export { AdvancedSearchBar, AdvancedSearchBarWrapper, AdvancedSearchProvider, Calendar, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DataTable, DatePicker, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, SearchBar, SearchInput, SearchItem, SearchResults, SearchSection, SearchTrigger, useChart };
|