@foundrykit/components 2.2.0 → 2.2.1
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/dist/chunk-4WYKNDYY.js +91 -0
- package/dist/chunk-4WYKNDYY.js.map +1 -0
- package/dist/chunk-5CXNMTIN.js +84 -0
- package/dist/chunk-5CXNMTIN.js.map +1 -0
- package/dist/chunk-B5ZTF5MZ.js +203 -0
- package/dist/chunk-B5ZTF5MZ.js.map +1 -0
- package/dist/chunk-EDNWBEKV.js +51 -0
- package/dist/chunk-EDNWBEKV.js.map +1 -0
- package/dist/chunk-ID7BFTID.js +248 -0
- package/dist/chunk-ID7BFTID.js.map +1 -0
- package/dist/chunk-IYBHXVCH.js +181 -0
- package/dist/chunk-IYBHXVCH.js.map +1 -0
- package/dist/chunk-KQZEF7PS.js +71 -0
- package/dist/chunk-KQZEF7PS.js.map +1 -0
- package/dist/chunk-P3GSYR7O.js +889 -0
- package/dist/chunk-P3GSYR7O.js.map +1 -0
- package/dist/chunk-PKSRYDN4.js +168 -0
- package/dist/chunk-PKSRYDN4.js.map +1 -0
- package/dist/chunk-SFM7ZMG2.js +104 -0
- package/dist/chunk-SFM7ZMG2.js.map +1 -0
- package/dist/chunk-TLQQZJUR.js +126 -0
- package/dist/chunk-TLQQZJUR.js.map +1 -0
- package/dist/chunk-UE7CDYEN.js +59 -0
- package/dist/chunk-UE7CDYEN.js.map +1 -0
- package/dist/chunk-UG7YS3D5.js +198 -0
- package/dist/chunk-UG7YS3D5.js.map +1 -0
- package/dist/components/advanced-search-bar/index.d.ts +308 -0
- package/dist/components/advanced-search-bar/index.js +34 -0
- package/dist/components/advanced-search-bar/index.js.map +1 -0
- package/dist/components/calendar/index.d.ts +20 -0
- package/dist/components/calendar/index.js +11 -0
- package/dist/components/calendar/index.js.map +1 -0
- package/dist/components/carousel/index.d.ts +40 -0
- package/dist/components/carousel/index.js +17 -0
- package/dist/components/carousel/index.js.map +1 -0
- package/dist/components/chart/index.d.ts +59 -0
- package/dist/components/chart/index.js +21 -0
- package/dist/components/chart/index.js.map +1 -0
- package/dist/components/combobox/index.d.ts +33 -0
- package/dist/components/combobox/index.js +10 -0
- package/dist/components/combobox/index.js.map +1 -0
- package/dist/components/command/index.d.ts +33 -0
- package/dist/components/command/index.js +25 -0
- package/dist/components/command/index.js.map +1 -0
- package/dist/components/data-table/index.d.ts +17 -0
- package/dist/components/data-table/index.js +9 -0
- package/dist/components/data-table/index.js.map +1 -0
- package/dist/components/date-picker/index.d.ts +17 -0
- package/dist/components/date-picker/index.js +9 -0
- package/dist/components/date-picker/index.js.map +1 -0
- package/dist/components/form/index.d.ts +37 -0
- package/dist/components/form/index.js +23 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/input-otp/index.d.ts +30 -0
- package/dist/components/input-otp/index.js +15 -0
- package/dist/components/input-otp/index.js.map +1 -0
- package/dist/components/pagination/index.d.ts +26 -0
- package/dist/components/pagination/index.js +20 -0
- package/dist/components/pagination/index.js.map +1 -0
- package/dist/components/search-bar/index.d.ts +17 -0
- package/dist/components/search-bar/index.js +9 -0
- package/dist/components/search-bar/index.js.map +1 -0
- package/dist/components/sidebar/index.d.ts +70 -0
- package/dist/components/sidebar/index.js +652 -0
- package/dist/components/sidebar/index.js.map +1 -0
- package/dist/components/theme-toggle/index.d.ts +20 -0
- package/dist/components/theme-toggle/index.js +9 -0
- package/dist/components/theme-toggle/index.js.map +1 -0
- package/dist/index.d.ts +27 -605
- package/dist/index.js +73 -2337
- package/dist/index.js.map +1 -1
- package/package.json +15 -8
- package/CHANGELOG.md +0 -362
- package/src/components/advanced-search-bar/config.ts +0 -223
- package/src/components/advanced-search-bar/index.tsx +0 -1415
- package/src/components/calendar/config.ts +0 -51
- package/src/components/calendar/index.tsx +0 -225
- package/src/components/carousel/config.ts +0 -28
- package/src/components/carousel/index.tsx +0 -258
- package/src/components/chart/config.ts +0 -28
- package/src/components/chart/index.tsx +0 -365
- package/src/components/combobox/config.ts +0 -28
- package/src/components/combobox/index.tsx +0 -111
- package/src/components/command/config.ts +0 -804
- package/src/components/command/index.tsx +0 -195
- package/src/components/data-table/config.ts +0 -28
- package/src/components/data-table/index.tsx +0 -124
- package/src/components/date-picker/config.ts +0 -55
- package/src/components/date-picker/index.tsx +0 -207
- package/src/components/form/config.ts +0 -21
- package/src/components/form/index.tsx +0 -150
- package/src/components/input-otp/config.ts +0 -28
- package/src/components/input-otp/index.tsx +0 -92
- package/src/components/pagination/config.ts +0 -367
- package/src/components/pagination/index.tsx +0 -135
- package/src/components/search-bar/config.ts +0 -58
- package/src/components/search-bar/index.tsx +0 -70
- package/src/components/sidebar/config.ts +0 -29
- package/src/components/sidebar/index.tsx +0 -723
- package/src/components/theme-toggle/config.ts +0 -27
- package/src/components/theme-toggle/index.tsx +0 -63
- package/src/index.ts +0 -83
- package/tsconfig.json +0 -12
- package/tsconfig.lint.json +0 -8
- package/tsup.config.ts +0 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,608 +1,30 @@
|
|
|
1
|
-
import { SearchResult, SearchSection as SearchSection$1 } from '@foundrykit/types';
|
|
2
1
|
export { SearchResult, SearchSection as SearchSectionType } from '@foundrykit/types';
|
|
3
2
|
export { cn } from '@foundrykit/utils';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export { Root as AdvancedSearchBar, AdvancedSearchBarWrapper, Provider as AdvancedSearchProvider, Input as SearchInput, Item as SearchItem, Results as SearchResults, Section as SearchSection, Trigger as SearchTrigger } from './components/advanced-search-bar/index.js';
|
|
4
|
+
export { Calendar } from './components/calendar/index.js';
|
|
5
|
+
export { Carousel, CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from './components/carousel/index.js';
|
|
6
|
+
export { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, useChart } from './components/chart/index.js';
|
|
7
|
+
export { Combobox } from './components/combobox/index.js';
|
|
8
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from './components/command/index.js';
|
|
9
|
+
export { DataTable } from './components/data-table/index.js';
|
|
10
|
+
export { DatePicker } from './components/date-picker/index.js';
|
|
11
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from './components/form/index.js';
|
|
12
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from './components/input-otp/index.js';
|
|
13
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from './components/pagination/index.js';
|
|
14
|
+
export { SearchBar } from './components/search-bar/index.js';
|
|
15
|
+
export { ThemeToggle } from './components/theme-toggle/index.js';
|
|
7
16
|
export { useFormField } from '@foundrykit/hooks';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Props for the AdvancedSearchProvider component.
|
|
24
|
-
* This provider manages the search state and behaviour for all child components.
|
|
25
|
-
*/
|
|
26
|
-
interface AdvancedSearchProviderProps {
|
|
27
|
-
/** Child components that will have access to the search context */
|
|
28
|
-
children: React.ReactNode;
|
|
29
|
-
/**
|
|
30
|
-
* Function called when user types in the search input.
|
|
31
|
-
* Should return a Promise or array of SearchResult objects.
|
|
32
|
-
* @param query - The search query string
|
|
33
|
-
* @returns Promise<SearchResult[]> | SearchResult[] - Array of search results
|
|
34
|
-
*/
|
|
35
|
-
onSearch?: (query: string) => Promise<SearchResult[]> | SearchResult[];
|
|
36
|
-
/**
|
|
37
|
-
* Function called when user selects a result from the dropdown.
|
|
38
|
-
* @param result - The selected SearchResult object
|
|
39
|
-
*/
|
|
40
|
-
onResultSelect?: (result: SearchResult) => void;
|
|
41
|
-
/**
|
|
42
|
-
* Debounce delay in milliseconds for search requests.
|
|
43
|
-
* @default 300
|
|
44
|
-
*/
|
|
45
|
-
debounceMs?: number;
|
|
46
|
-
/**
|
|
47
|
-
* Minimum number of characters required before triggering search.
|
|
48
|
-
* @default 1
|
|
49
|
-
*/
|
|
50
|
-
minQueryLength?: number;
|
|
51
|
-
/**
|
|
52
|
-
* Behavior when search results are empty or query is too short.
|
|
53
|
-
* - 'show-empty-message': Show "No results found" message
|
|
54
|
-
* - 'hide-until-min-chars': Hide results until minimum characters typed
|
|
55
|
-
* - 'show-all-results': Show initial results when empty
|
|
56
|
-
* @default 'show-empty-message'
|
|
57
|
-
*/
|
|
58
|
-
emptyStateBehaviour?: EmptyStateBehavior;
|
|
59
|
-
/**
|
|
60
|
-
* Initial results to show when component first loads.
|
|
61
|
-
* Useful for showing popular/recent searches.
|
|
62
|
-
*/
|
|
63
|
-
initialResults?: SearchResult[];
|
|
64
|
-
/**
|
|
65
|
-
* Custom styles for different parts of the search component.
|
|
66
|
-
*/
|
|
67
|
-
styles?: {
|
|
68
|
-
/** CSS properties for the results dropdown */
|
|
69
|
-
results?: React.CSSProperties;
|
|
70
|
-
width?: string | number;
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* AdvancedSearchProvider component that manages search state and provides context to child components.
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* ```tsx
|
|
78
|
-
* <AdvancedSearchProvider
|
|
79
|
-
* onSearch={async (query) => {
|
|
80
|
-
* const results = await searchAPI(query);
|
|
81
|
-
* return results;
|
|
82
|
-
* }}
|
|
83
|
-
* onResultSelect={(result) => {
|
|
84
|
-
* console.log('Selected:', result);
|
|
85
|
-
* }}
|
|
86
|
-
* emptyStateBehaviour="show-all-results"
|
|
87
|
-
* initialResults={popularDestinations}
|
|
88
|
-
* >
|
|
89
|
-
* <AdvancedSearchBar>
|
|
90
|
-
* <SearchInput placeholder="Search destinations..." />
|
|
91
|
-
* <SearchResults />
|
|
92
|
-
* </AdvancedSearchBar>
|
|
93
|
-
* </AdvancedSearchProvider>
|
|
94
|
-
* ```
|
|
95
|
-
*/
|
|
96
|
-
declare function AdvancedSearchProvider({ children, onSearch, onResultSelect, debounceMs, minQueryLength, emptyStateBehaviour, initialResults, styles, }: AdvancedSearchProviderProps): react_jsx_runtime.JSX.Element;
|
|
97
|
-
/**
|
|
98
|
-
* Variant styles for the search input wrapper.
|
|
99
|
-
* Controls the size and visual appearance of the search input container.
|
|
100
|
-
*/
|
|
101
|
-
declare const searchInputWrapperVariants: (props?: ({
|
|
102
|
-
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
103
|
-
variant?: "default" | "ghost" | "filled" | null | undefined;
|
|
104
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
105
|
-
/**
|
|
106
|
-
* Variant styles for the search results container.
|
|
107
|
-
* Controls the maximum width of the search results dropdown.
|
|
108
|
-
*/
|
|
109
|
-
declare const searchResultsVariants: (props?: ({
|
|
110
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null | undefined;
|
|
111
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
112
|
-
/**
|
|
113
|
-
* Props for the SearchInput component.
|
|
114
|
-
* Extends standard input props with search-specific functionality.
|
|
115
|
-
*/
|
|
116
|
-
interface SearchInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>, VariantProps<typeof searchInputWrapperVariants> {
|
|
117
|
-
/** Placeholder text shown when input is empty */
|
|
118
|
-
placeholder?: string;
|
|
119
|
-
/** Whether to show the search icon on the left side */
|
|
120
|
-
showSearchIcon?: boolean;
|
|
121
|
-
/** Whether to show the clear button when there's text */
|
|
122
|
-
showClearButton?: boolean;
|
|
123
|
-
/** Callback function called when clear button is clicked */
|
|
124
|
-
onClear?: () => void;
|
|
125
|
-
/** Whether to render as a child component using Slot */
|
|
126
|
-
asChild?: boolean;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* SearchInput component that provides a search input field with optional search icon and clear button.
|
|
130
|
-
* Automatically integrates with the search context to handle query state and search triggering.
|
|
131
|
-
*
|
|
132
|
-
* @example
|
|
133
|
-
* ```tsx
|
|
134
|
-
* <SearchInput
|
|
135
|
-
* placeholder="Search destinations..."
|
|
136
|
-
* size="lg"
|
|
137
|
-
* variant="default"
|
|
138
|
-
* showSearchIcon={true}
|
|
139
|
-
* showClearButton={true}
|
|
140
|
-
* />
|
|
141
|
-
* ```
|
|
142
|
-
*/
|
|
143
|
-
declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
144
|
-
/**
|
|
145
|
-
* Props for the SearchTrigger component.
|
|
146
|
-
* Used to create custom trigger buttons that open the search dropdown.
|
|
147
|
-
*/
|
|
148
|
-
interface SearchTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
149
|
-
/** Whether to render as a child component using Slot */
|
|
150
|
-
asChild?: boolean;
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* SearchTrigger component that creates a button to open/close the search dropdown.
|
|
154
|
-
* Can be used with asChild to wrap custom button components.
|
|
155
|
-
*
|
|
156
|
-
* @example
|
|
157
|
-
* ```tsx
|
|
158
|
-
* <SearchTrigger asChild>
|
|
159
|
-
* <Button variant="outline" className="w-full justify-start">
|
|
160
|
-
* <Search className="mr-2 h-4 w-4" />
|
|
161
|
-
* Click to search...
|
|
162
|
-
* </Button>
|
|
163
|
-
* </SearchTrigger>
|
|
164
|
-
* ```
|
|
165
|
-
*/
|
|
166
|
-
declare const SearchTrigger: React.ForwardRefExoticComponent<SearchTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
167
|
-
/**
|
|
168
|
-
* Props for the SearchResults component.
|
|
169
|
-
* Displays the search results in a scrollable dropdown with customizable sections.
|
|
170
|
-
*/
|
|
171
|
-
interface SearchResultsProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof searchResultsVariants> {
|
|
172
|
-
/** Custom sections to display instead of default results */
|
|
173
|
-
sections?: SearchSection$1[];
|
|
174
|
-
/** Whether to show empty state message when no results */
|
|
175
|
-
showEmptyState?: boolean;
|
|
176
|
-
/** Custom message to show when no results are found */
|
|
177
|
-
emptyStateMessage?: string;
|
|
178
|
-
/** Whether to show loading state while searching */
|
|
179
|
-
showLoadingState?: boolean;
|
|
180
|
-
/** Whether loading replaces results or keeps previous results visible */
|
|
181
|
-
loadingBehaviour?: 'replace-results' | 'preserve-results';
|
|
182
|
-
/** Custom loading state rendered instead of loadingMessage */
|
|
183
|
-
loadingState?: React.ReactNode;
|
|
184
|
-
/** Custom message to show while loading */
|
|
185
|
-
loadingMessage?: string;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* SearchResults component that displays search results in a scrollable dropdown.
|
|
189
|
-
* Automatically handles loading states, empty states, and result selection.
|
|
190
|
-
*
|
|
191
|
-
* @example
|
|
192
|
-
* ```tsx
|
|
193
|
-
* <SearchResults
|
|
194
|
-
* size="lg"
|
|
195
|
-
* showEmptyState={true}
|
|
196
|
-
* emptyStateMessage="No destinations found."
|
|
197
|
-
* showLoadingState={true}
|
|
198
|
-
* loadingMessage="Searching destinations..."
|
|
199
|
-
* />
|
|
200
|
-
* ```
|
|
201
|
-
*/
|
|
202
|
-
declare const SearchResults: React.ForwardRefExoticComponent<SearchResultsProps & React.RefAttributes<HTMLDivElement>>;
|
|
203
|
-
/**
|
|
204
|
-
* Props for the AdvancedSearchBar component.
|
|
205
|
-
* Main container component that orchestrates the search input and results dropdown.
|
|
206
|
-
*/
|
|
207
|
-
interface AdvancedSearchBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
208
|
-
/** Controlled open state of the results dropdown */
|
|
209
|
-
open?: boolean;
|
|
210
|
-
/** Callback function called when open state changes */
|
|
211
|
-
onOpenChange?: (open: boolean) => void;
|
|
212
|
-
/**
|
|
213
|
-
* Layout mode for the results panel.
|
|
214
|
-
* - `"popover"` (default): absolutely positioned dropdown below the input.
|
|
215
|
-
* - `"inline"`: normal document flow, rendered inside the same root element.
|
|
216
|
-
*/
|
|
217
|
-
resultsMode?: 'popover' | 'inline';
|
|
218
|
-
/** Extra classes applied to the trigger/input wrapper div. */
|
|
219
|
-
triggerClassName?: string;
|
|
220
|
-
/** Extra classes applied to the results panel wrapper div. */
|
|
221
|
-
resultsClassName?: string;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* AdvancedSearchBar component that provides the main search interface.
|
|
225
|
-
* Combines search input with results dropdown in a compound pattern.
|
|
226
|
-
*
|
|
227
|
-
* @example
|
|
228
|
-
* ```tsx
|
|
229
|
-
* <AdvancedSearchBar>
|
|
230
|
-
* <SearchInput placeholder="Search destinations..." />
|
|
231
|
-
* <SearchResults />
|
|
232
|
-
* </AdvancedSearchBar>
|
|
233
|
-
* ```
|
|
234
|
-
*/
|
|
235
|
-
declare const AdvancedSearchBar: React.ForwardRefExoticComponent<AdvancedSearchBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
236
|
-
/**
|
|
237
|
-
* Props for the SearchSection component.
|
|
238
|
-
* Used in compound pattern to create organized sections of search results.
|
|
239
|
-
*/
|
|
240
|
-
interface SearchSectionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
241
|
-
/** Title displayed above the section results */
|
|
242
|
-
title?: string;
|
|
243
|
-
/** Maximum number of results to show in this section */
|
|
244
|
-
maxResults?: number;
|
|
245
|
-
/** Whether to show a "Show more" button */
|
|
246
|
-
showMore?: boolean;
|
|
247
|
-
/** Callback function called when "Show more" is clicked */
|
|
248
|
-
onShowMore?: () => void;
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* SearchSection component for organizing search results into sections.
|
|
252
|
-
* Used in compound pattern to create structured result displays.
|
|
253
|
-
*
|
|
254
|
-
* @example
|
|
255
|
-
* ```tsx
|
|
256
|
-
* <SearchSection title="Popular Searches" showMore={true} onShowMore={handleShowMore}>
|
|
257
|
-
* <SearchItem result={popularResult1} />
|
|
258
|
-
* <SearchItem result={popularResult2} />
|
|
259
|
-
* </SearchSection>
|
|
260
|
-
* ```
|
|
261
|
-
*/
|
|
262
|
-
declare const SearchSection: React.ForwardRefExoticComponent<SearchSectionProps & React.RefAttributes<HTMLDivElement>>;
|
|
263
|
-
/**
|
|
264
|
-
* Props for the SearchItem component.
|
|
265
|
-
* Used in compound pattern to render individual search result items.
|
|
266
|
-
*/
|
|
267
|
-
interface SearchItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
268
|
-
/** The search result data to display */
|
|
269
|
-
result?: SearchResult;
|
|
270
|
-
/** Callback function called when the item is clicked */
|
|
271
|
-
onClick?: () => void;
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* SearchItem component for rendering individual search result items.
|
|
275
|
-
* Can be used with result data or custom children in compound pattern.
|
|
276
|
-
*
|
|
277
|
-
* @example
|
|
278
|
-
* ```tsx
|
|
279
|
-
* <SearchItem result={searchResult} />
|
|
280
|
-
*
|
|
281
|
-
* // Or with custom children
|
|
282
|
-
* <SearchItem onClick={handleClick}>
|
|
283
|
-
* <div>Custom result display</div>
|
|
284
|
-
* </SearchItem>
|
|
285
|
-
* ```
|
|
286
|
-
*/
|
|
287
|
-
declare const SearchItem: React.ForwardRefExoticComponent<SearchItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Wrapper component for documentation and preview purposes.
|
|
291
|
-
* Provides a complete search implementation with mock data for testing and demos.
|
|
292
|
-
*
|
|
293
|
-
* @deprecated Demo-only helper. Prefer composing AdvancedSearchProvider,
|
|
294
|
-
* AdvancedSearchBar, SearchInput, and SearchResults in application code.
|
|
295
|
-
*
|
|
296
|
-
* @param props - Configuration props for the search wrapper
|
|
297
|
-
* @returns Complete search component with mock functionality
|
|
298
|
-
*
|
|
299
|
-
* @example
|
|
300
|
-
* ```tsx
|
|
301
|
-
* <AdvancedSearchBarWrapper
|
|
302
|
-
* emptyStateBehaviour="show-all-results"
|
|
303
|
-
* size="lg"
|
|
304
|
-
* variant="default"
|
|
305
|
-
* useCustomTrigger={false}
|
|
306
|
-
* />
|
|
307
|
-
* ```
|
|
308
|
-
*/
|
|
309
|
-
declare function AdvancedSearchBarWrapper(props?: {
|
|
310
|
-
/** Minimum number of characters required before triggering search */
|
|
311
|
-
minQueryLength?: number;
|
|
312
|
-
/** Behaviour when search results are empty or query is too short */
|
|
313
|
-
emptyStateBehaviour?: 'show-empty-message' | 'hide-until-min-chars' | 'show-all-results';
|
|
314
|
-
/** Size variant for the search input */
|
|
315
|
-
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
316
|
-
/** Visual variant for the search input */
|
|
317
|
-
variant?: 'default' | 'ghost' | 'filled';
|
|
318
|
-
/** Whether to use a custom trigger button instead of input */
|
|
319
|
-
useCustomTrigger?: boolean;
|
|
320
|
-
}): react_jsx_runtime.JSX.Element;
|
|
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
|
-
* `role="combobox"` takes no name from its text, so give it a label: `aria-label`
|
|
426
|
-
* or an `id` paired with `<Label htmlFor>`.
|
|
427
|
-
*
|
|
428
|
-
* @example
|
|
429
|
-
* ```tsx
|
|
430
|
-
* <Combobox
|
|
431
|
-
* options={[{ value: 'next', label: 'Next.js' }]}
|
|
432
|
-
* value={value}
|
|
433
|
-
* onValueChange={setValue}
|
|
434
|
-
* placeholder='Select framework...'
|
|
435
|
-
* />
|
|
436
|
-
* ```
|
|
437
|
-
*/
|
|
438
|
-
declare function Combobox({ options, value, onValueChange, placeholder, id, 'aria-label': ariaLabel, }: {
|
|
439
|
-
options: ComboboxOption[];
|
|
440
|
-
value?: string;
|
|
441
|
-
onValueChange?: (value: string) => void;
|
|
442
|
-
placeholder?: string;
|
|
443
|
-
/** Lets a `<Label htmlFor>` name the trigger. */
|
|
444
|
-
id?: string;
|
|
445
|
-
/** Names the trigger when there is no visible label. */
|
|
446
|
-
'aria-label'?: string;
|
|
447
|
-
}): react_jsx_runtime.JSX.Element;
|
|
448
|
-
|
|
449
|
-
/** Styled `cmdk` command menu — the root container for a command palette. */
|
|
450
|
-
declare function Command({ className, ...props }: React.ComponentProps<typeof Command$1>): react_jsx_runtime.JSX.Element;
|
|
451
|
-
/**
|
|
452
|
-
* Command menu rendered inside a modal dialog. `title` and `description` are
|
|
453
|
-
* visually hidden but read by assistive technology.
|
|
454
|
-
*/
|
|
455
|
-
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
456
|
-
title?: string;
|
|
457
|
-
description?: string;
|
|
458
|
-
className?: string;
|
|
459
|
-
showCloseButton?: boolean;
|
|
460
|
-
}): react_jsx_runtime.JSX.Element;
|
|
461
|
-
/** Search input for a command menu, with a leading search icon. */
|
|
462
|
-
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof Command$1.Input>): react_jsx_runtime.JSX.Element;
|
|
463
|
-
/** Scrollable list containing command groups and items. */
|
|
464
|
-
declare function CommandList({ className, ...props }: React.ComponentProps<typeof Command$1.List>): react_jsx_runtime.JSX.Element;
|
|
465
|
-
/** Message shown when no command items match the current query. */
|
|
466
|
-
declare function CommandEmpty({ ...props }: React.ComponentProps<typeof Command$1.Empty>): react_jsx_runtime.JSX.Element;
|
|
467
|
-
/** Labelled group of related command items. */
|
|
468
|
-
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof Command$1.Group>): react_jsx_runtime.JSX.Element;
|
|
469
|
-
/** Horizontal divider between command groups or items. */
|
|
470
|
-
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof Command$1.Separator>): react_jsx_runtime.JSX.Element;
|
|
471
|
-
/** Selectable command item within a {@link CommandList} or {@link CommandGroup}. */
|
|
472
|
-
declare function CommandItem({ className, ...props }: React.ComponentProps<typeof Command$1.Item>): react_jsx_runtime.JSX.Element;
|
|
473
|
-
/** Right-aligned keyboard-shortcut hint shown inside a command item. */
|
|
474
|
-
declare function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
|
|
475
|
-
|
|
476
|
-
/**
|
|
477
|
-
* Generic, paginated, sortable data table driven by TanStack Table column defs.
|
|
478
|
-
*
|
|
479
|
-
* @example
|
|
480
|
-
* ```tsx
|
|
481
|
-
* <DataTable columns={columns} data={data} />
|
|
482
|
-
* ```
|
|
483
|
-
*/
|
|
484
|
-
declare function DataTable<TData, TValue>({ columns, data, }: {
|
|
485
|
-
columns: ColumnDef<TData, TValue>[];
|
|
486
|
-
data: TData[];
|
|
487
|
-
}): react_jsx_runtime.JSX.Element;
|
|
488
|
-
|
|
489
|
-
interface DatePickerProps {
|
|
490
|
-
value?: Date;
|
|
491
|
-
onValueChange?: (date: Date | undefined) => void;
|
|
492
|
-
placeholder?: string;
|
|
493
|
-
className?: string;
|
|
494
|
-
disabled?: boolean;
|
|
495
|
-
}
|
|
496
|
-
/**
|
|
497
|
-
* Date picker pairing a native date input with a pop-up month grid. Controlled
|
|
498
|
-
* via `value`/`onValueChange`; the calendar closes on selection, outside click,
|
|
499
|
-
* or Escape and returns focus to the toggle button.
|
|
500
|
-
*/
|
|
501
|
-
declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLDivElement>>;
|
|
502
|
-
|
|
503
|
-
/** Form context provider — re-export of react-hook-form's `FormProvider`. */
|
|
504
|
-
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
505
|
-
/**
|
|
506
|
-
* Connects a single field to react-hook-form via a `Controller` and exposes the
|
|
507
|
-
* field name to the surrounding form components through context.
|
|
508
|
-
*/
|
|
509
|
-
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
510
|
-
|
|
511
|
-
/**
|
|
512
|
-
* Wrapper for a single form field that generates a unique id shared by its
|
|
513
|
-
* label, control, description, and message for accessible associations.
|
|
514
|
-
*/
|
|
515
|
-
declare function FormItem({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
516
|
-
/** Label bound to the field's control; styled as an error when the field is invalid. */
|
|
517
|
-
declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
518
|
-
/**
|
|
519
|
-
* Wires the field's control element with the correct `id`, `aria-describedby`,
|
|
520
|
-
* and `aria-invalid` attributes. Render the input as its single child.
|
|
521
|
-
*/
|
|
522
|
-
declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): react_jsx_runtime.JSX.Element;
|
|
523
|
-
/** Helper text describing the field, linked to the control via `aria-describedby`. */
|
|
524
|
-
declare function FormDescription({ className, ...props }: React.ComponentProps<'p'>): react_jsx_runtime.JSX.Element;
|
|
525
|
-
/**
|
|
526
|
-
* Displays the field's validation error message, or its children when there is
|
|
527
|
-
* no error. Renders nothing when there is no content to show.
|
|
528
|
-
*/
|
|
529
|
-
declare function FormMessage({ className, ...props }: React.ComponentProps<'p'>): react_jsx_runtime.JSX.Element | null;
|
|
530
|
-
|
|
531
|
-
/**
|
|
532
|
-
* Accessible one-time-password input with individually styled character slots.
|
|
533
|
-
*
|
|
534
|
-
* @example
|
|
535
|
-
* ```tsx
|
|
536
|
-
* <InputOTP maxLength={6}>
|
|
537
|
-
* <InputOTPGroup>
|
|
538
|
-
* <InputOTPSlot index={0} />
|
|
539
|
-
* <InputOTPSlot index={1} />
|
|
540
|
-
* </InputOTPGroup>
|
|
541
|
-
* </InputOTP>
|
|
542
|
-
* ```
|
|
543
|
-
*/
|
|
544
|
-
declare function InputOTP({ className, containerClassName, ...props }: React.ComponentProps<typeof OTPInput> & {
|
|
545
|
-
containerClassName?: string;
|
|
546
|
-
}): react_jsx_runtime.JSX.Element;
|
|
547
|
-
/** Groups related OTP slots together with a shared border. */
|
|
548
|
-
declare function InputOTPGroup({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
549
|
-
/** A single character slot, driven by the OTP input context. */
|
|
550
|
-
declare function InputOTPSlot({ index, className, ...props }: React.ComponentProps<'div'> & {
|
|
551
|
-
index: number;
|
|
552
|
-
}): react_jsx_runtime.JSX.Element;
|
|
553
|
-
/** Visual separator rendered between OTP groups. */
|
|
554
|
-
declare function InputOTPSeparator({ ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
555
|
-
|
|
556
|
-
/** Navigation landmark that wraps a set of pagination controls. */
|
|
557
|
-
declare function Pagination({ className, ...props }: React.ComponentProps<'nav'>): react_jsx_runtime.JSX.Element;
|
|
558
|
-
/** Horizontal list container for pagination items. */
|
|
559
|
-
declare function PaginationContent({ className, ...props }: React.ComponentProps<'ul'>): react_jsx_runtime.JSX.Element;
|
|
560
|
-
/** List item wrapping a single pagination control. */
|
|
561
|
-
declare function PaginationItem({ ...props }: React.ComponentProps<'li'>): react_jsx_runtime.JSX.Element;
|
|
562
|
-
type PaginationLinkProps = {
|
|
563
|
-
isActive?: boolean;
|
|
564
|
-
} & Pick<React.ComponentProps<typeof Button>, 'size'> & React.ComponentProps<'a'>;
|
|
565
|
-
/**
|
|
566
|
-
* Anchor styled as a page-number button. Set `isActive` to mark the current
|
|
567
|
-
* page (applies `aria-current="page"` and an outlined style).
|
|
568
|
-
*/
|
|
569
|
-
declare function PaginationLink({ className, isActive, size, ...props }: PaginationLinkProps): react_jsx_runtime.JSX.Element;
|
|
570
|
-
/** Pagination link for navigating to the previous page. */
|
|
571
|
-
declare function PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>): react_jsx_runtime.JSX.Element;
|
|
572
|
-
/** Pagination link for navigating to the next page. */
|
|
573
|
-
declare function PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>): react_jsx_runtime.JSX.Element;
|
|
574
|
-
/** Non-interactive ellipsis indicating skipped page numbers. */
|
|
575
|
-
declare function PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
|
|
576
|
-
|
|
577
|
-
interface SearchBarProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
578
|
-
onSearch?: (query: string) => void;
|
|
579
|
-
placeholder?: string;
|
|
580
|
-
className?: string;
|
|
581
|
-
value?: string;
|
|
582
|
-
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
583
|
-
}
|
|
584
|
-
/**
|
|
585
|
-
* Search input with a leading search icon. Works uncontrolled or controlled
|
|
586
|
-
* (pass `value`/`onChange`); `onSearch` is called with the current query text on
|
|
587
|
-
* every change.
|
|
588
|
-
*/
|
|
589
|
-
declare const SearchBar: React.ForwardRefExoticComponent<SearchBarProps & React.RefAttributes<HTMLInputElement>>;
|
|
590
|
-
|
|
591
|
-
/**
|
|
592
|
-
* Dark mode toggle. Flips the `.dark` class on `<html>`, which drives the
|
|
593
|
-
* `@foundrykit/tailwind` dark tokens. Exposes one state to assistive tech:
|
|
594
|
-
* a fixed "Dark mode" label with `aria-pressed`.
|
|
595
|
-
*
|
|
596
|
-
* While the class flips, `.theme-switching` is set on `<html>` so transitions
|
|
597
|
-
* are suppressed (the rule ships in `@foundrykit/tailwind/globals.css`).
|
|
598
|
-
*
|
|
599
|
-
* @example
|
|
600
|
-
* ```tsx
|
|
601
|
-
* <ThemeToggle />
|
|
602
|
-
* ```
|
|
603
|
-
*/
|
|
604
|
-
declare function ThemeToggle({ className }: {
|
|
605
|
-
className?: string;
|
|
606
|
-
}): react_jsx_runtime.JSX.Element;
|
|
607
|
-
|
|
608
|
-
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, ThemeToggle, useChart };
|
|
17
|
+
import 'class-variance-authority/types';
|
|
18
|
+
import 'react/jsx-runtime';
|
|
19
|
+
import 'class-variance-authority';
|
|
20
|
+
import 'react';
|
|
21
|
+
import '@foundrykit/primitives';
|
|
22
|
+
import 'react-day-picker';
|
|
23
|
+
import 'embla-carousel-react';
|
|
24
|
+
import 'recharts';
|
|
25
|
+
import 'cmdk';
|
|
26
|
+
import '@tanstack/react-table';
|
|
27
|
+
import 'react-hook-form';
|
|
28
|
+
import '@radix-ui/react-label';
|
|
29
|
+
import '@radix-ui/react-slot';
|
|
30
|
+
import 'input-otp';
|