@mirror-physics/fractal-ui 0.2.0-next.10 → 0.2.0-next.14

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.cts CHANGED
@@ -157,6 +157,12 @@ interface ChipProps extends React.HTMLAttributes<HTMLSpanElement> {
157
157
  }
158
158
  declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLSpanElement>>;
159
159
 
160
+ interface CheckboxProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
161
+ checked: boolean;
162
+ onCheckedChange: (checked: boolean) => void;
163
+ }
164
+ declare function Checkbox({ checked, onCheckedChange, className, disabled, onClick, onKeyDown, ...props }: CheckboxProps): React.JSX.Element;
165
+
160
166
  type SortDirection = 'asc' | 'desc' | null;
161
167
  interface SortableTableColumn<T> {
162
168
  key: string;
@@ -167,12 +173,18 @@ interface SortableTableColumn<T> {
167
173
  render: (row: T, index: number) => ReactNode;
168
174
  align?: 'left' | 'right';
169
175
  }
176
+ interface SortableTableRowAction<T> {
177
+ label: (row: T, index: number) => string;
178
+ icon: (row: T, index: number) => ReactNode;
179
+ }
170
180
  interface SortableTableProps<T> {
171
181
  columns: SortableTableColumn<T>[];
172
182
  data: T[];
173
183
  emptyMessage?: string;
174
184
  header?: ReactNode;
175
185
  size?: 'sm' | 'md' | 'lg';
186
+ /** Removes the table's outer border and radius for use inside another framed surface. */
187
+ embedded?: boolean;
176
188
  className?: string;
177
189
  defaultSortKey?: string;
178
190
  defaultSortDirection?: SortDirection;
@@ -182,8 +194,10 @@ interface SortableTableProps<T> {
182
194
  highlightRow?: (row: T, index: number) => boolean;
183
195
  /** Invoked when a row is selected. Enables pointer and keyboard row activation. */
184
196
  onRowClick?: (row: T, index: number) => void;
197
+ /** Directional affordance displayed over the right edge of an interactive row. */
198
+ rowAction?: SortableTableRowAction<T>;
185
199
  }
186
- declare function SortableTable<T>({ columns, data, emptyMessage, header, size, className, defaultSortKey, defaultSortDirection, sortKey: controlledKey, sortDirection: controlledDirection, onSortChange, highlightRow, onRowClick, }: SortableTableProps<T>): React.JSX.Element;
200
+ declare function SortableTable<T>({ columns, data, emptyMessage, header, size, embedded, className, defaultSortKey, defaultSortDirection, sortKey: controlledKey, sortDirection: controlledDirection, onSortChange, highlightRow, onRowClick, rowAction, }: SortableTableProps<T>): React.JSX.Element;
187
201
 
188
202
  interface TabItem {
189
203
  id: string;
@@ -201,6 +215,21 @@ interface TabsProps {
201
215
  }
202
216
  declare function Tabs({ items, defaultValue, value: controlledValue, onValueChange, className, ariaLabel, }: TabsProps): React.JSX.Element;
203
217
 
218
+ interface ContentSwitcherItem {
219
+ value: string;
220
+ label: React.ReactNode;
221
+ disabled?: boolean;
222
+ }
223
+ interface ContentSwitcherProps {
224
+ items: ContentSwitcherItem[];
225
+ value: string;
226
+ onValueChange: (value: string) => void;
227
+ ariaLabel: string;
228
+ fullWidth?: boolean;
229
+ className?: string;
230
+ }
231
+ declare function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth, className }: ContentSwitcherProps): React.JSX.Element;
232
+
204
233
  interface DisclosureProps {
205
234
  title: ReactNode;
206
235
  meta?: ReactNode;
@@ -208,10 +237,11 @@ interface DisclosureProps {
208
237
  defaultOpen?: boolean;
209
238
  open?: boolean;
210
239
  onOpenChange?: (open: boolean) => void;
240
+ disabled?: boolean;
211
241
  className?: string;
212
242
  variant?: 'card' | 'plain';
213
243
  }
214
- declare function Disclosure({ title, meta, children, defaultOpen, open: controlledOpen, onOpenChange, className, variant, }: DisclosureProps): React.JSX.Element;
244
+ declare function Disclosure({ title, meta, children, defaultOpen, open: controlledOpen, onOpenChange, disabled, className, variant, }: DisclosureProps): React.JSX.Element;
215
245
 
216
246
  interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
217
247
  /** Fixed sidebar width. Defaults to the standard application width. */
@@ -240,8 +270,8 @@ interface SidePanelProps {
240
270
  description?: React.ReactNode;
241
271
  children: React.ReactNode;
242
272
  footer?: React.ReactNode;
243
- /** Panel width: sm (420px), md (540px), or lg (680px). */
244
- size?: 'sm' | 'md' | 'lg';
273
+ /** Panel width: sm (420px), md (540px), lg (680px), or xl (960px). */
274
+ size?: 'sm' | 'md' | 'lg' | 'xl';
245
275
  className?: string;
246
276
  }
247
277
  declare function SidePanel({ open, onClose, title, description, children, footer, size, className }: SidePanelProps): React.ReactPortal | null;
@@ -250,6 +280,17 @@ interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement
250
280
  }
251
281
  declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
252
282
 
283
+ type TextButtonSize = 'sm' | 'md';
284
+ type TextButtonIconPosition = 'start' | 'end';
285
+ type TextButtonTone = 'primary' | 'secondary';
286
+ interface TextButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
287
+ icon?: React.ReactNode;
288
+ iconPosition?: TextButtonIconPosition;
289
+ size?: TextButtonSize;
290
+ tone?: TextButtonTone;
291
+ }
292
+ declare const TextButton: React.ForwardRefExoticComponent<TextButtonProps & React.RefAttributes<HTMLButtonElement>>;
293
+
253
294
  interface FileDropzoneProps {
254
295
  files: File[];
255
296
  onFilesChange: (files: File[]) => void;
@@ -262,6 +303,20 @@ interface FileDropzoneProps {
262
303
  }
263
304
  declare function FileDropzone({ files, onFilesChange, accept, multiple, disabled, title, description, className, }: FileDropzoneProps): React.JSX.Element;
264
305
 
306
+ interface PaginationProps {
307
+ /** One-based active page. */
308
+ page: number;
309
+ pageSize: number;
310
+ totalItems: number;
311
+ onPageChange: (page: number) => void;
312
+ /** Optional page sizes, rendered as an unframed selector in the pagination footer. */
313
+ pageSizeOptions?: number[];
314
+ onPageSizeChange?: (pageSize: number) => void;
315
+ ariaLabel?: string;
316
+ className?: string;
317
+ }
318
+ declare function Pagination({ page, pageSize, totalItems, onPageChange, pageSizeOptions, onPageSizeChange, ariaLabel, className, }: PaginationProps): React.JSX.Element;
319
+
265
320
  /**
266
321
  * Register an Escape-key dismiss handler with the global priority stack.
267
322
  *
@@ -273,4 +328,4 @@ declare function useEscapeDismiss(priority: number, handler: () => void, enabled
273
328
 
274
329
  declare function cn(...inputs: ClassValue[]): string;
275
330
 
276
- export { Alert, AlertDescription, AlertTitle, Button, type ButtonColor, type ButtonProps, type ButtonSize, type ButtonType, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Chip, type ChipProps, type ChipTone, DataTable, type DataTableColumn, type DataTableProps, Disclosure, type DisclosureProps, Dropdown, type DropdownItem, type DropdownProps, FeatureCard, type FeatureCardProps, FileDropzone, type FileDropzoneProps, FolderCard, type FolderCardProps, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, type LinkSize, type LinkTheme, Modal, type ModalProps, PromptCard, type PromptCardProps, type PromptCardTone, PromptGrid, type PromptGridProps, SidePanel, type SidePanelProps, Sidebar, SidebarBrand, SidebarFooter, SidebarHeader, SidebarNav, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarSection, type SortDirection, SortableTable, type SortableTableColumn, type SortableTableProps, type TabItem, Tabs, type TabsProps, Textarea, type TextareaProps, Toggle, type ToggleProps, cn, useEscapeDismiss };
331
+ export { Alert, AlertDescription, AlertTitle, Button, type ButtonColor, type ButtonProps, type ButtonSize, type ButtonType, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type CheckboxProps, Chip, type ChipProps, type ChipTone, ContentSwitcher, type ContentSwitcherItem, type ContentSwitcherProps, DataTable, type DataTableColumn, type DataTableProps, Disclosure, type DisclosureProps, Dropdown, type DropdownItem, type DropdownProps, FeatureCard, type FeatureCardProps, FileDropzone, type FileDropzoneProps, FolderCard, type FolderCardProps, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, type LinkSize, type LinkTheme, Modal, type ModalProps, Pagination, type PaginationProps, PromptCard, type PromptCardProps, type PromptCardTone, PromptGrid, type PromptGridProps, SidePanel, type SidePanelProps, Sidebar, SidebarBrand, SidebarFooter, SidebarHeader, SidebarNav, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarSection, type SortDirection, SortableTable, type SortableTableColumn, type SortableTableProps, type SortableTableRowAction, type TabItem, Tabs, type TabsProps, TextButton, type TextButtonIconPosition, type TextButtonProps, type TextButtonSize, type TextButtonTone, Textarea, type TextareaProps, Toggle, type ToggleProps, cn, useEscapeDismiss };
package/dist/index.d.ts CHANGED
@@ -157,6 +157,12 @@ interface ChipProps extends React.HTMLAttributes<HTMLSpanElement> {
157
157
  }
158
158
  declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLSpanElement>>;
159
159
 
160
+ interface CheckboxProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
161
+ checked: boolean;
162
+ onCheckedChange: (checked: boolean) => void;
163
+ }
164
+ declare function Checkbox({ checked, onCheckedChange, className, disabled, onClick, onKeyDown, ...props }: CheckboxProps): React.JSX.Element;
165
+
160
166
  type SortDirection = 'asc' | 'desc' | null;
161
167
  interface SortableTableColumn<T> {
162
168
  key: string;
@@ -167,12 +173,18 @@ interface SortableTableColumn<T> {
167
173
  render: (row: T, index: number) => ReactNode;
168
174
  align?: 'left' | 'right';
169
175
  }
176
+ interface SortableTableRowAction<T> {
177
+ label: (row: T, index: number) => string;
178
+ icon: (row: T, index: number) => ReactNode;
179
+ }
170
180
  interface SortableTableProps<T> {
171
181
  columns: SortableTableColumn<T>[];
172
182
  data: T[];
173
183
  emptyMessage?: string;
174
184
  header?: ReactNode;
175
185
  size?: 'sm' | 'md' | 'lg';
186
+ /** Removes the table's outer border and radius for use inside another framed surface. */
187
+ embedded?: boolean;
176
188
  className?: string;
177
189
  defaultSortKey?: string;
178
190
  defaultSortDirection?: SortDirection;
@@ -182,8 +194,10 @@ interface SortableTableProps<T> {
182
194
  highlightRow?: (row: T, index: number) => boolean;
183
195
  /** Invoked when a row is selected. Enables pointer and keyboard row activation. */
184
196
  onRowClick?: (row: T, index: number) => void;
197
+ /** Directional affordance displayed over the right edge of an interactive row. */
198
+ rowAction?: SortableTableRowAction<T>;
185
199
  }
186
- declare function SortableTable<T>({ columns, data, emptyMessage, header, size, className, defaultSortKey, defaultSortDirection, sortKey: controlledKey, sortDirection: controlledDirection, onSortChange, highlightRow, onRowClick, }: SortableTableProps<T>): React.JSX.Element;
200
+ declare function SortableTable<T>({ columns, data, emptyMessage, header, size, embedded, className, defaultSortKey, defaultSortDirection, sortKey: controlledKey, sortDirection: controlledDirection, onSortChange, highlightRow, onRowClick, rowAction, }: SortableTableProps<T>): React.JSX.Element;
187
201
 
188
202
  interface TabItem {
189
203
  id: string;
@@ -201,6 +215,21 @@ interface TabsProps {
201
215
  }
202
216
  declare function Tabs({ items, defaultValue, value: controlledValue, onValueChange, className, ariaLabel, }: TabsProps): React.JSX.Element;
203
217
 
218
+ interface ContentSwitcherItem {
219
+ value: string;
220
+ label: React.ReactNode;
221
+ disabled?: boolean;
222
+ }
223
+ interface ContentSwitcherProps {
224
+ items: ContentSwitcherItem[];
225
+ value: string;
226
+ onValueChange: (value: string) => void;
227
+ ariaLabel: string;
228
+ fullWidth?: boolean;
229
+ className?: string;
230
+ }
231
+ declare function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth, className }: ContentSwitcherProps): React.JSX.Element;
232
+
204
233
  interface DisclosureProps {
205
234
  title: ReactNode;
206
235
  meta?: ReactNode;
@@ -208,10 +237,11 @@ interface DisclosureProps {
208
237
  defaultOpen?: boolean;
209
238
  open?: boolean;
210
239
  onOpenChange?: (open: boolean) => void;
240
+ disabled?: boolean;
211
241
  className?: string;
212
242
  variant?: 'card' | 'plain';
213
243
  }
214
- declare function Disclosure({ title, meta, children, defaultOpen, open: controlledOpen, onOpenChange, className, variant, }: DisclosureProps): React.JSX.Element;
244
+ declare function Disclosure({ title, meta, children, defaultOpen, open: controlledOpen, onOpenChange, disabled, className, variant, }: DisclosureProps): React.JSX.Element;
215
245
 
216
246
  interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
217
247
  /** Fixed sidebar width. Defaults to the standard application width. */
@@ -240,8 +270,8 @@ interface SidePanelProps {
240
270
  description?: React.ReactNode;
241
271
  children: React.ReactNode;
242
272
  footer?: React.ReactNode;
243
- /** Panel width: sm (420px), md (540px), or lg (680px). */
244
- size?: 'sm' | 'md' | 'lg';
273
+ /** Panel width: sm (420px), md (540px), lg (680px), or xl (960px). */
274
+ size?: 'sm' | 'md' | 'lg' | 'xl';
245
275
  className?: string;
246
276
  }
247
277
  declare function SidePanel({ open, onClose, title, description, children, footer, size, className }: SidePanelProps): React.ReactPortal | null;
@@ -250,6 +280,17 @@ interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement
250
280
  }
251
281
  declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
252
282
 
283
+ type TextButtonSize = 'sm' | 'md';
284
+ type TextButtonIconPosition = 'start' | 'end';
285
+ type TextButtonTone = 'primary' | 'secondary';
286
+ interface TextButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
287
+ icon?: React.ReactNode;
288
+ iconPosition?: TextButtonIconPosition;
289
+ size?: TextButtonSize;
290
+ tone?: TextButtonTone;
291
+ }
292
+ declare const TextButton: React.ForwardRefExoticComponent<TextButtonProps & React.RefAttributes<HTMLButtonElement>>;
293
+
253
294
  interface FileDropzoneProps {
254
295
  files: File[];
255
296
  onFilesChange: (files: File[]) => void;
@@ -262,6 +303,20 @@ interface FileDropzoneProps {
262
303
  }
263
304
  declare function FileDropzone({ files, onFilesChange, accept, multiple, disabled, title, description, className, }: FileDropzoneProps): React.JSX.Element;
264
305
 
306
+ interface PaginationProps {
307
+ /** One-based active page. */
308
+ page: number;
309
+ pageSize: number;
310
+ totalItems: number;
311
+ onPageChange: (page: number) => void;
312
+ /** Optional page sizes, rendered as an unframed selector in the pagination footer. */
313
+ pageSizeOptions?: number[];
314
+ onPageSizeChange?: (pageSize: number) => void;
315
+ ariaLabel?: string;
316
+ className?: string;
317
+ }
318
+ declare function Pagination({ page, pageSize, totalItems, onPageChange, pageSizeOptions, onPageSizeChange, ariaLabel, className, }: PaginationProps): React.JSX.Element;
319
+
265
320
  /**
266
321
  * Register an Escape-key dismiss handler with the global priority stack.
267
322
  *
@@ -273,4 +328,4 @@ declare function useEscapeDismiss(priority: number, handler: () => void, enabled
273
328
 
274
329
  declare function cn(...inputs: ClassValue[]): string;
275
330
 
276
- export { Alert, AlertDescription, AlertTitle, Button, type ButtonColor, type ButtonProps, type ButtonSize, type ButtonType, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Chip, type ChipProps, type ChipTone, DataTable, type DataTableColumn, type DataTableProps, Disclosure, type DisclosureProps, Dropdown, type DropdownItem, type DropdownProps, FeatureCard, type FeatureCardProps, FileDropzone, type FileDropzoneProps, FolderCard, type FolderCardProps, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, type LinkSize, type LinkTheme, Modal, type ModalProps, PromptCard, type PromptCardProps, type PromptCardTone, PromptGrid, type PromptGridProps, SidePanel, type SidePanelProps, Sidebar, SidebarBrand, SidebarFooter, SidebarHeader, SidebarNav, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarSection, type SortDirection, SortableTable, type SortableTableColumn, type SortableTableProps, type TabItem, Tabs, type TabsProps, Textarea, type TextareaProps, Toggle, type ToggleProps, cn, useEscapeDismiss };
331
+ export { Alert, AlertDescription, AlertTitle, Button, type ButtonColor, type ButtonProps, type ButtonSize, type ButtonType, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type CheckboxProps, Chip, type ChipProps, type ChipTone, ContentSwitcher, type ContentSwitcherItem, type ContentSwitcherProps, DataTable, type DataTableColumn, type DataTableProps, Disclosure, type DisclosureProps, Dropdown, type DropdownItem, type DropdownProps, FeatureCard, type FeatureCardProps, FileDropzone, type FileDropzoneProps, FolderCard, type FolderCardProps, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, type LinkSize, type LinkTheme, Modal, type ModalProps, Pagination, type PaginationProps, PromptCard, type PromptCardProps, type PromptCardTone, PromptGrid, type PromptGridProps, SidePanel, type SidePanelProps, Sidebar, SidebarBrand, SidebarFooter, SidebarHeader, SidebarNav, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarSection, type SortDirection, SortableTable, type SortableTableColumn, type SortableTableProps, type SortableTableRowAction, type TabItem, Tabs, type TabsProps, TextButton, type TextButtonIconPosition, type TextButtonProps, type TextButtonSize, type TextButtonTone, Textarea, type TextareaProps, Toggle, type ToggleProps, cn, useEscapeDismiss };