@clarlabs/ui 0.1.29 → 0.1.31
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/index.d.ts +32 -2
- package/dist/index.js +24 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4042 -3928
- package/dist/index.mjs.map +1 -1
- package/dist/ui.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -157,7 +157,7 @@ export declare type ButtonSize = 'sm' | 'md' | 'lg';
|
|
|
157
157
|
|
|
158
158
|
export declare type ButtonVariant = 'primary' | 'secondary' | 'success' | 'danger' | 'outline' | 'ghost';
|
|
159
159
|
|
|
160
|
-
export declare function Calendar({ value, onChange, onClick, minDate, maxDate, events, highlightedDates, disabledDates, showWeekNumbers, firstDayOfWeek, variant, className, ...props }: CalendarProps): default_2.JSX.Element;
|
|
160
|
+
export declare function Calendar({ value, onChange, onClick, onDayClick, minDate, maxDate, events, highlightedDates, disabledDates, showWeekNumbers, firstDayOfWeek, variant, className, ...props }: CalendarProps): default_2.JSX.Element;
|
|
161
161
|
|
|
162
162
|
export declare interface CalendarEvent {
|
|
163
163
|
id: string;
|
|
@@ -173,6 +173,8 @@ export declare interface CalendarProps extends Omit<default_2.HTMLAttributes<HTM
|
|
|
173
173
|
value?: Date;
|
|
174
174
|
onChange?: (date: Date) => void;
|
|
175
175
|
onClick?: (events: CalendarEvent[]) => void;
|
|
176
|
+
/** Called when a date cell is clicked, passes the clicked date (for date/range pickers) */
|
|
177
|
+
onDayClick?: (date: Date) => void;
|
|
176
178
|
minDate?: Date;
|
|
177
179
|
maxDate?: Date;
|
|
178
180
|
events?: CalendarEvent[];
|
|
@@ -1166,7 +1168,21 @@ export declare interface RichSelectProps {
|
|
|
1166
1168
|
className?: string;
|
|
1167
1169
|
}
|
|
1168
1170
|
|
|
1169
|
-
export declare function Search({ onSearch, results, totalCount, pageSize, placeholder, loading, debounceMs, className }: SearchProps): default_2.JSX.Element;
|
|
1171
|
+
export declare function Search({ onSearch, results, totalCount, pageSize, placeholder, loading, debounceMs, dateFilterMode, dateFilter, onDateFilterChange, histogramData, onHistogramBrush, className }: SearchProps): default_2.JSX.Element;
|
|
1172
|
+
|
|
1173
|
+
export declare type SearchDateFilter = {
|
|
1174
|
+
date: Date | null;
|
|
1175
|
+
} | {
|
|
1176
|
+
start: Date | null;
|
|
1177
|
+
end: Date | null;
|
|
1178
|
+
};
|
|
1179
|
+
|
|
1180
|
+
export declare interface SearchHistogramBucket {
|
|
1181
|
+
/** Date as ISO string (YYYY-MM-DD) */
|
|
1182
|
+
date: string;
|
|
1183
|
+
/** Hit count for this date */
|
|
1184
|
+
count: number;
|
|
1185
|
+
}
|
|
1170
1186
|
|
|
1171
1187
|
export declare interface SearchProps {
|
|
1172
1188
|
/** Callback when user searches or changes page. Hook to any data source (API, local filter, etc.) */
|
|
@@ -1174,6 +1190,7 @@ export declare interface SearchProps {
|
|
|
1174
1190
|
query: string;
|
|
1175
1191
|
page: number;
|
|
1176
1192
|
pageSize: number;
|
|
1193
|
+
dateFilter?: SearchDateFilter;
|
|
1177
1194
|
}) => void | Promise<void>;
|
|
1178
1195
|
/** Search results from your data source */
|
|
1179
1196
|
results: SearchResult[];
|
|
@@ -1187,6 +1204,19 @@ export declare interface SearchProps {
|
|
|
1187
1204
|
loading?: boolean;
|
|
1188
1205
|
/** Debounce delay in ms before firing onSearch (0 = no debounce) */
|
|
1189
1206
|
debounceMs?: number;
|
|
1207
|
+
/** Show optional date filter. Use 'date' for single date or 'range' for date range */
|
|
1208
|
+
dateFilterMode?: 'date' | 'range';
|
|
1209
|
+
/** Controlled date filter value */
|
|
1210
|
+
dateFilter?: SearchDateFilter;
|
|
1211
|
+
/** Called when date filter changes (e.g. from picker or histogram brush) */
|
|
1212
|
+
onDateFilterChange?: (filter: SearchDateFilter) => void;
|
|
1213
|
+
/** Optional histogram data - date vs hits. Renders above results when provided. */
|
|
1214
|
+
histogramData?: SearchHistogramBucket[];
|
|
1215
|
+
/** Called when user brushes/drags on histogram to select a date range */
|
|
1216
|
+
onHistogramBrush?: (range: {
|
|
1217
|
+
start: Date;
|
|
1218
|
+
end: Date;
|
|
1219
|
+
}) => void;
|
|
1190
1220
|
/** Custom class name */
|
|
1191
1221
|
className?: string;
|
|
1192
1222
|
}
|