@foundrykit/components 1.0.9 → 1.0.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @foundrykit/components
2
2
 
3
+ ## 1.0.10
4
+
5
+ ### Patch Changes
6
+
7
+ - adding the advanced search bar
8
+ - Updated dependencies
9
+ - @foundrykit/hooks@1.0.6
10
+ - @foundrykit/types@1.0.8
11
+ - @foundrykit/primitives@1.0.10
12
+
3
13
  ## 1.0.9
4
14
 
5
15
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -3,6 +3,10 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { DayPicker } from 'react-day-picker';
4
4
  import { Button, Dialog } from '@foundrykit/primitives';
5
5
  import { Command as Command$1 } from 'cmdk';
6
+ import * as class_variance_authority_types from 'class-variance-authority/types';
7
+ import { VariantProps } from 'class-variance-authority';
8
+ import { SearchResult, SearchSection as SearchSection$1 } from '@foundrykit/types';
9
+ export { SearchResult, SearchSection as SearchSectionType } from '@foundrykit/types';
6
10
  export { cn } from '@foundrykit/utils';
7
11
 
8
12
  interface SearchBarProps extends React.InputHTMLAttributes<HTMLInputElement> {
@@ -53,4 +57,57 @@ declare function CommandSeparator({ className, ...props }: React.ComponentProps<
53
57
  declare function CommandItem({ className, ...props }: React.ComponentProps<typeof Command$1.Item>): react_jsx_runtime.JSX.Element;
54
58
  declare function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
55
59
 
56
- export { Calendar, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DatePicker, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, SearchBar };
60
+ interface AdvancedSearchProviderProps {
61
+ children: React.ReactNode;
62
+ onSearch?: (query: string) => Promise<SearchResult[]> | SearchResult[];
63
+ onResultSelect?: (result: SearchResult) => void;
64
+ debounceMs?: number;
65
+ minQueryLength?: number;
66
+ }
67
+ declare function AdvancedSearchProvider({ children, onSearch, onResultSelect, debounceMs, minQueryLength, }: AdvancedSearchProviderProps): react_jsx_runtime.JSX.Element;
68
+ declare const searchInputWrapperVariants: (props?: ({
69
+ size?: "sm" | "lg" | "md" | "xl" | null | undefined;
70
+ variant?: "default" | "ghost" | "filled" | null | undefined;
71
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
72
+ declare const searchResultsVariants: (props?: ({
73
+ size?: "sm" | "lg" | "md" | "xl" | "2xl" | "full" | null | undefined;
74
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
75
+ interface SearchInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>, VariantProps<typeof searchInputWrapperVariants> {
76
+ placeholder?: string;
77
+ showSearchIcon?: boolean;
78
+ showClearButton?: boolean;
79
+ onClear?: () => void;
80
+ asChild?: boolean;
81
+ }
82
+ declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
83
+ interface SearchTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
84
+ asChild?: boolean;
85
+ }
86
+ declare const SearchTrigger: React.ForwardRefExoticComponent<SearchTriggerProps & React.RefAttributes<HTMLButtonElement>>;
87
+ interface SearchResultsProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof searchResultsVariants> {
88
+ sections?: SearchSection$1[];
89
+ showEmptyState?: boolean;
90
+ emptyStateMessage?: string;
91
+ showLoadingState?: boolean;
92
+ loadingMessage?: string;
93
+ }
94
+ declare const SearchResults: React.ForwardRefExoticComponent<SearchResultsProps & React.RefAttributes<HTMLDivElement>>;
95
+ interface AdvancedSearchBarProps extends React.HTMLAttributes<HTMLDivElement> {
96
+ open?: boolean;
97
+ onOpenChange?: (open: boolean) => void;
98
+ }
99
+ declare const AdvancedSearchBar: React.ForwardRefExoticComponent<AdvancedSearchBarProps & React.RefAttributes<HTMLDivElement>>;
100
+ interface SearchSectionProps extends React.HTMLAttributes<HTMLDivElement> {
101
+ title?: string;
102
+ maxResults?: number;
103
+ showMore?: boolean;
104
+ onShowMore?: () => void;
105
+ }
106
+ declare const SearchSection: React.ForwardRefExoticComponent<SearchSectionProps & React.RefAttributes<HTMLDivElement>>;
107
+ interface SearchItemProps extends React.HTMLAttributes<HTMLDivElement> {
108
+ result?: SearchResult;
109
+ onClick?: () => void;
110
+ }
111
+ declare const SearchItem: React.ForwardRefExoticComponent<SearchItemProps & React.RefAttributes<HTMLDivElement>>;
112
+
113
+ export { AdvancedSearchBar, AdvancedSearchProvider, Calendar, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DatePicker, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, SearchBar, SearchInput, SearchItem, SearchResults, SearchSection, SearchTrigger };