@mirror-physics/fractal-ui 0.2.0-next.27 → 0.2.0-next.28

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ReactNode, HTMLAttributes } from 'react';
2
+ import { ReactNode, HTMLAttributes, CSSProperties } from 'react';
3
3
  import { ClassValue } from 'clsx';
4
4
 
5
5
  type ButtonType = 'primary' | 'secondary' | 'ghost' | 'danger';
@@ -96,9 +96,12 @@ interface ModalProps {
96
96
  noClose?: boolean;
97
97
  /** Modal width: 'sm' (420px), 'md' (756px), 'lg' (near-fullscreen). */
98
98
  size?: 'sm' | 'md' | 'lg';
99
+ /** Replaces the body with a whole-surface loading state while retaining the modal chrome. */
100
+ loading?: boolean;
101
+ loadingLabel?: string;
99
102
  className?: string;
100
103
  }
101
- declare function Modal({ open, onClose, title, children, danger, warn, footer, noClose, size, className }: ModalProps): React.ReactPortal | null;
104
+ declare function Modal({ open, onClose, title, children, danger, warn, footer, noClose, size, loading, loadingLabel, className }: ModalProps): React.ReactPortal | null;
102
105
 
103
106
  interface DataTableColumn<T> {
104
107
  key: string;
@@ -258,6 +261,100 @@ interface LatticeLoaderProps extends HTMLAttributes<HTMLSpanElement> {
258
261
  }
259
262
  declare function LatticeLoader({ className, label, ...props }: LatticeLoaderProps): React.JSX.Element;
260
263
 
264
+ type UILoaderTone = 'neutral' | 'blue' | 'green';
265
+ interface UILoaderProps {
266
+ /** Visual height. Width follows the mark's aspect ratio. */
267
+ size?: number | string;
268
+ tone?: UILoaderTone;
269
+ className?: string;
270
+ style?: CSSProperties;
271
+ label?: string;
272
+ /** Use when another nearby element already announces loading. */
273
+ ariaHidden?: boolean;
274
+ }
275
+ /** A branded shine loader for whole UI surfaces, not component-level content. */
276
+ declare function UILoader({ size, tone, className, style, label, ariaHidden }: UILoaderProps): React.JSX.Element;
277
+
278
+ type GhostLength = number | string;
279
+ interface GhostProps extends HTMLAttributes<HTMLDivElement> {
280
+ /** Width of the placeholder. Numbers are interpreted as pixels. */
281
+ width?: GhostLength;
282
+ /** Height of the placeholder. Numbers are interpreted as pixels. */
283
+ height?: GhostLength;
284
+ /** Border radius override. */
285
+ radius?: GhostLength;
286
+ }
287
+ interface GhostLineProps extends Omit<GhostProps, 'height'> {
288
+ /** Text-line size. */
289
+ size?: 'sm' | 'md' | 'lg';
290
+ }
291
+ /**
292
+ * An intentionally content-free, shimmering placeholder. Use the composed
293
+ * ghosts below for standard Fractal components; use this primitive for custom
294
+ * product layouts.
295
+ */
296
+ declare function Ghost({ className, width, height, radius, style, ...props }: GhostProps): React.JSX.Element;
297
+ declare function GhostLine({ className, size, width, ...props }: GhostLineProps): React.JSX.Element;
298
+ interface ButtonGhostProps extends Omit<GhostProps, 'height'> {
299
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
300
+ iconOnly?: boolean;
301
+ }
302
+ declare function ButtonGhost({ className, size, iconOnly, width, ...props }: ButtonGhostProps): React.JSX.Element;
303
+ interface CardGhostProps extends HTMLAttributes<HTMLDivElement> {
304
+ lines?: number;
305
+ showHeader?: boolean;
306
+ }
307
+ declare function CardGhost({ className, lines, showHeader, ...props }: CardGhostProps): React.JSX.Element;
308
+ interface DataTableGhostProps extends HTMLAttributes<HTMLDivElement> {
309
+ /** Display placeholder cells for a header that is itself still loading. */
310
+ showHeader?: boolean;
311
+ /** Static header labels to retain while only rows are loading. */
312
+ headers?: ReactNode[];
313
+ /** Number of column placeholders. */
314
+ columns?: number;
315
+ /** Number of data row placeholders. */
316
+ rows?: number;
317
+ /** Optional CSS widths mirroring the eventual table columns. */
318
+ columnWidths?: string[];
319
+ size?: 'sm' | 'md' | 'lg';
320
+ }
321
+ declare function DataTableGhost({ className, showHeader, headers, columns, rows, columnWidths, size, ...props }: DataTableGhostProps): React.JSX.Element;
322
+ interface FormFieldGhostProps extends HTMLAttributes<HTMLDivElement> {
323
+ labelWidth?: GhostLength;
324
+ multiline?: boolean;
325
+ }
326
+ declare function InputGhost({ className, labelWidth, ...props }: FormFieldGhostProps): React.JSX.Element;
327
+ declare function TextareaGhost({ className, labelWidth, ...props }: FormFieldGhostProps): React.JSX.Element;
328
+ declare function LabelGhost({ className, width, ...props }: Omit<GhostLineProps, 'size'>): React.JSX.Element;
329
+ declare function AlertGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
330
+ declare function CheckboxGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
331
+ declare const ToggleGhost: typeof CheckboxGhost;
332
+ declare function ChipGhost({ className, width, ...props }: Omit<GhostProps, 'height'>): React.JSX.Element;
333
+ declare function LinkGhost({ className, width, ...props }: Omit<GhostLineProps, 'size'>): React.JSX.Element;
334
+ declare const TextButtonGhost: typeof LinkGhost;
335
+ declare function DropdownGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
336
+ declare function ContentSwitcherGhost({ className, options, ...props }: HTMLAttributes<HTMLDivElement> & {
337
+ options?: number;
338
+ }): React.JSX.Element;
339
+ declare const TabsGhost: typeof ContentSwitcherGhost;
340
+ declare function DisclosureGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
341
+ declare function PaginationGhost({ className, pages, ...props }: HTMLAttributes<HTMLDivElement> & {
342
+ pages?: number;
343
+ }): React.JSX.Element;
344
+ declare function FileDropzoneGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
345
+ declare function PromptCardGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
346
+ declare function SortableTableGhost(props: DataTableGhostProps): React.JSX.Element;
347
+ interface SidebarGhostProps extends HTMLAttributes<HTMLDivElement> {
348
+ items?: number;
349
+ }
350
+ declare function SidebarGhost({ className, items, ...props }: SidebarGhostProps): React.JSX.Element;
351
+ interface SurfaceGhostProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
352
+ title?: ReactNode;
353
+ lines?: number;
354
+ }
355
+ declare function ModalGhost({ className, title, lines, ...props }: SurfaceGhostProps): React.JSX.Element;
356
+ declare function SidePanelGhost({ className, title, lines, ...props }: SurfaceGhostProps): React.JSX.Element;
357
+
261
358
  interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
262
359
  /** Fixed sidebar width. Defaults to the standard application width. */
263
360
  width?: string;
@@ -287,9 +384,12 @@ interface SidePanelProps {
287
384
  footer?: React.ReactNode;
288
385
  /** Panel width: sm (420px), md (540px), lg (680px), or xl (960px). */
289
386
  size?: 'sm' | 'md' | 'lg' | 'xl';
387
+ /** Replaces the body with a whole-surface loading state while retaining the panel header. */
388
+ loading?: boolean;
389
+ loadingLabel?: string;
290
390
  className?: string;
291
391
  }
292
- declare function SidePanel({ open, onClose, title, description, children, footer, size, className }: SidePanelProps): React.ReactPortal | null;
392
+ declare function SidePanel({ open, onClose, title, description, children, footer, size, loading, loadingLabel, className }: SidePanelProps): React.ReactPortal | null;
293
393
 
294
394
  interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
295
395
  }
@@ -343,4 +443,4 @@ declare function useEscapeDismiss(priority: number, handler: () => void, enabled
343
443
 
344
444
  declare function cn(...inputs: ClassValue[]): string;
345
445
 
346
- 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, LatticeLoader, type LatticeLoaderProps, 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 SortableTableDefaultSort, 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 };
446
+ export { Alert, AlertDescription, AlertGhost, AlertTitle, Button, type ButtonColor, ButtonGhost, type ButtonGhostProps, type ButtonProps, type ButtonSize, type ButtonType, Card, CardContent, CardDescription, CardFooter, CardGhost, type CardGhostProps, CardHeader, CardTitle, Checkbox, CheckboxGhost, type CheckboxProps, Chip, ChipGhost, type ChipProps, type ChipTone, ContentSwitcher, ContentSwitcherGhost, type ContentSwitcherItem, type ContentSwitcherProps, DataTable, type DataTableColumn, DataTableGhost, type DataTableGhostProps, type DataTableProps, Disclosure, DisclosureGhost, type DisclosureProps, Dropdown, DropdownGhost, type DropdownItem, type DropdownProps, FeatureCard, type FeatureCardProps, FileDropzone, FileDropzoneGhost, type FileDropzoneProps, FolderCard, type FolderCardProps, type FormFieldGhostProps, Ghost, GhostLine, type GhostLineProps, type GhostProps, Input, InputGhost, type InputProps, Label, LabelGhost, type LabelProps, LatticeLoader, type LatticeLoaderProps, Link, LinkGhost, type LinkProps, type LinkSize, type LinkTheme, Modal, ModalGhost, type ModalProps, Pagination, PaginationGhost, type PaginationProps, PromptCard, PromptCardGhost, type PromptCardProps, type PromptCardTone, PromptGrid, type PromptGridProps, SidePanel, SidePanelGhost, type SidePanelProps, Sidebar, SidebarBrand, SidebarFooter, SidebarGhost, type SidebarGhostProps, SidebarHeader, SidebarNav, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarSection, type SortDirection, SortableTable, type SortableTableColumn, type SortableTableDefaultSort, SortableTableGhost, type SortableTableProps, type SortableTableRowAction, type SurfaceGhostProps, type TabItem, Tabs, TabsGhost, type TabsProps, TextButton, TextButtonGhost, type TextButtonIconPosition, type TextButtonProps, type TextButtonSize, type TextButtonTone, Textarea, TextareaGhost, type TextareaProps, Toggle, ToggleGhost, type ToggleProps, UILoader, type UILoaderProps, type UILoaderTone, cn, useEscapeDismiss };