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

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';
@@ -94,11 +94,16 @@ interface ModalProps {
94
94
  footer?: React.ReactNode;
95
95
  /** When true, prevents closing via overlay click or Escape. */
96
96
  noClose?: boolean;
97
+ /** Keeps the close control visible but disables every dismissal route. */
98
+ closeDisabled?: boolean;
97
99
  /** Modal width: 'sm' (420px), 'md' (756px), 'lg' (near-fullscreen). */
98
100
  size?: 'sm' | 'md' | 'lg';
101
+ /** Replaces the body with a whole-surface loading state while retaining the modal chrome. */
102
+ loading?: boolean;
103
+ loadingLabel?: string;
99
104
  className?: string;
100
105
  }
101
- declare function Modal({ open, onClose, title, children, danger, warn, footer, noClose, size, className }: ModalProps): React.ReactPortal | null;
106
+ declare function Modal({ open, onClose, title, children, danger, warn, footer, noClose, closeDisabled, size, loading, loadingLabel, className }: ModalProps): React.ReactPortal | null;
102
107
 
103
108
  interface DataTableColumn<T> {
104
109
  key: string;
@@ -258,6 +263,100 @@ interface LatticeLoaderProps extends HTMLAttributes<HTMLSpanElement> {
258
263
  }
259
264
  declare function LatticeLoader({ className, label, ...props }: LatticeLoaderProps): React.JSX.Element;
260
265
 
266
+ type UILoaderTone = 'neutral' | 'blue' | 'green';
267
+ interface UILoaderProps {
268
+ /** Visual height. Width follows the mark's aspect ratio. */
269
+ size?: number | string;
270
+ tone?: UILoaderTone;
271
+ className?: string;
272
+ style?: CSSProperties;
273
+ label?: string;
274
+ /** Use when another nearby element already announces loading. */
275
+ ariaHidden?: boolean;
276
+ }
277
+ /** A branded shine loader for whole UI surfaces, not component-level content. */
278
+ declare function UILoader({ size, tone, className, style, label, ariaHidden }: UILoaderProps): React.JSX.Element;
279
+
280
+ type GhostLength = number | string;
281
+ interface GhostProps extends HTMLAttributes<HTMLDivElement> {
282
+ /** Width of the placeholder. Numbers are interpreted as pixels. */
283
+ width?: GhostLength;
284
+ /** Height of the placeholder. Numbers are interpreted as pixels. */
285
+ height?: GhostLength;
286
+ /** Border radius override. */
287
+ radius?: GhostLength;
288
+ }
289
+ interface GhostLineProps extends Omit<GhostProps, 'height'> {
290
+ /** Text-line size. */
291
+ size?: 'sm' | 'md' | 'lg';
292
+ }
293
+ /**
294
+ * An intentionally content-free, shimmering placeholder. Use the composed
295
+ * ghosts below for standard Fractal components; use this primitive for custom
296
+ * product layouts.
297
+ */
298
+ declare function Ghost({ className, width, height, radius, style, ...props }: GhostProps): React.JSX.Element;
299
+ declare function GhostLine({ className, size, width, ...props }: GhostLineProps): React.JSX.Element;
300
+ interface ButtonGhostProps extends Omit<GhostProps, 'height'> {
301
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
302
+ iconOnly?: boolean;
303
+ }
304
+ declare function ButtonGhost({ className, size, iconOnly, width, ...props }: ButtonGhostProps): React.JSX.Element;
305
+ interface CardGhostProps extends HTMLAttributes<HTMLDivElement> {
306
+ lines?: number;
307
+ showHeader?: boolean;
308
+ }
309
+ declare function CardGhost({ className, lines, showHeader, ...props }: CardGhostProps): React.JSX.Element;
310
+ interface DataTableGhostProps extends HTMLAttributes<HTMLDivElement> {
311
+ /** Display placeholder cells for a header that is itself still loading. */
312
+ showHeader?: boolean;
313
+ /** Static header labels to retain while only rows are loading. */
314
+ headers?: ReactNode[];
315
+ /** Number of column placeholders. */
316
+ columns?: number;
317
+ /** Number of data row placeholders. */
318
+ rows?: number;
319
+ /** Optional CSS widths mirroring the eventual table columns. */
320
+ columnWidths?: string[];
321
+ size?: 'sm' | 'md' | 'lg';
322
+ }
323
+ declare function DataTableGhost({ className, showHeader, headers, columns, rows, columnWidths, size, ...props }: DataTableGhostProps): React.JSX.Element;
324
+ interface FormFieldGhostProps extends HTMLAttributes<HTMLDivElement> {
325
+ labelWidth?: GhostLength;
326
+ multiline?: boolean;
327
+ }
328
+ declare function InputGhost({ className, labelWidth, ...props }: FormFieldGhostProps): React.JSX.Element;
329
+ declare function TextareaGhost({ className, labelWidth, ...props }: FormFieldGhostProps): React.JSX.Element;
330
+ declare function LabelGhost({ className, width, ...props }: Omit<GhostLineProps, 'size'>): React.JSX.Element;
331
+ declare function AlertGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
332
+ declare function CheckboxGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
333
+ declare const ToggleGhost: typeof CheckboxGhost;
334
+ declare function ChipGhost({ className, width, ...props }: Omit<GhostProps, 'height'>): React.JSX.Element;
335
+ declare function LinkGhost({ className, width, ...props }: Omit<GhostLineProps, 'size'>): React.JSX.Element;
336
+ declare const TextButtonGhost: typeof LinkGhost;
337
+ declare function DropdownGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
338
+ declare function ContentSwitcherGhost({ className, options, ...props }: HTMLAttributes<HTMLDivElement> & {
339
+ options?: number;
340
+ }): React.JSX.Element;
341
+ declare const TabsGhost: typeof ContentSwitcherGhost;
342
+ declare function DisclosureGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
343
+ declare function PaginationGhost({ className, pages, ...props }: HTMLAttributes<HTMLDivElement> & {
344
+ pages?: number;
345
+ }): React.JSX.Element;
346
+ declare function FileDropzoneGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
347
+ declare function PromptCardGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
348
+ declare function SortableTableGhost(props: DataTableGhostProps): React.JSX.Element;
349
+ interface SidebarGhostProps extends HTMLAttributes<HTMLDivElement> {
350
+ items?: number;
351
+ }
352
+ declare function SidebarGhost({ className, items, ...props }: SidebarGhostProps): React.JSX.Element;
353
+ interface SurfaceGhostProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
354
+ title?: ReactNode;
355
+ lines?: number;
356
+ }
357
+ declare function ModalGhost({ className, title, lines, ...props }: SurfaceGhostProps): React.JSX.Element;
358
+ declare function SidePanelGhost({ className, title, lines, ...props }: SurfaceGhostProps): React.JSX.Element;
359
+
261
360
  interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
262
361
  /** Fixed sidebar width. Defaults to the standard application width. */
263
362
  width?: string;
@@ -287,9 +386,12 @@ interface SidePanelProps {
287
386
  footer?: React.ReactNode;
288
387
  /** Panel width: sm (420px), md (540px), lg (680px), or xl (960px). */
289
388
  size?: 'sm' | 'md' | 'lg' | 'xl';
389
+ /** Replaces the body with a whole-surface loading state while retaining the panel header. */
390
+ loading?: boolean;
391
+ loadingLabel?: string;
290
392
  className?: string;
291
393
  }
292
- declare function SidePanel({ open, onClose, title, description, children, footer, size, className }: SidePanelProps): React.ReactPortal | null;
394
+ declare function SidePanel({ open, onClose, title, description, children, footer, size, loading, loadingLabel, className }: SidePanelProps): React.ReactPortal | null;
293
395
 
294
396
  interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
295
397
  }
@@ -343,4 +445,4 @@ declare function useEscapeDismiss(priority: number, handler: () => void, enabled
343
445
 
344
446
  declare function cn(...inputs: ClassValue[]): string;
345
447
 
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 };
448
+ 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 };