@rufous/ui 0.3.38 → 0.3.39

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/main.d.ts CHANGED
@@ -405,6 +405,7 @@ interface SubmitButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement
405
405
  bgGradiant?: boolean;
406
406
  onClick?: (e: React.MouseEvent<HTMLButtonElement>) => Promise<void> | void;
407
407
  onDoubleClick?: (e: React.MouseEvent<HTMLButtonElement>) => Promise<void> | void;
408
+ /** Externally controlled loading state — stacks with internal loading */
408
409
  isLoading?: boolean;
409
410
  sx?: SxProp;
410
411
  }
@@ -433,6 +434,7 @@ interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>
433
434
  disableElevation?: boolean;
434
435
  disableRipple?: boolean;
435
436
  href?: string;
437
+ /** Controlled external loading state */
436
438
  loading?: boolean;
437
439
  loadingPosition?: "start" | "end" | "center";
438
440
  component?: React.ElementType;
@@ -440,6 +442,16 @@ interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>
440
442
  className?: string;
441
443
  style?: CSSProperties;
442
444
  sx?: SxProp;
445
+ /**
446
+ * When true, the button automatically enters a loading/disabled state
447
+ * on click and stays there for at least `minLoadingMs` (default 1500 ms).
448
+ * If `onClick` returns a Promise, loading persists until the Promise
449
+ * settles **and** the minimum duration has elapsed — whichever is longer.
450
+ * Prevents accidental double-submissions without any extra state in the parent.
451
+ */
452
+ debounce?: boolean;
453
+ /** Minimum loading duration in ms when `debounce` is enabled. Default: 1500. */
454
+ minLoadingMs?: number;
443
455
  }
444
456
  declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
445
457
 
@@ -1426,14 +1438,6 @@ interface BoxProps extends React.HTMLAttributes<HTMLElement> {
1426
1438
  alignItems?: string;
1427
1439
  justifyContent?: string;
1428
1440
  gap?: string | number;
1429
- padding?: string | number;
1430
- margin?: string | number;
1431
- width?: string | number;
1432
- height?: string | number;
1433
- minWidth?: string | number;
1434
- maxWidth?: string | number;
1435
- minHeight?: string | number;
1436
- maxHeight?: string | number;
1437
1441
  flex?: string | number;
1438
1442
  flexWrap?: string;
1439
1443
  flexGrow?: number;
@@ -1450,6 +1454,28 @@ interface BoxProps extends React.HTMLAttributes<HTMLElement> {
1450
1454
  className?: string;
1451
1455
  style?: CSSProperties;
1452
1456
  sx?: SxProp;
1457
+ width?: string | number;
1458
+ height?: string | number;
1459
+ minWidth?: string | number;
1460
+ maxWidth?: string | number;
1461
+ minHeight?: string | number;
1462
+ maxHeight?: string | number;
1463
+ margin?: string | number;
1464
+ padding?: string | number;
1465
+ m?: number | string;
1466
+ mt?: number | string;
1467
+ mr?: number | string;
1468
+ mb?: number | string;
1469
+ ml?: number | string;
1470
+ mx?: number | string;
1471
+ my?: number | string;
1472
+ p?: number | string;
1473
+ pt?: number | string;
1474
+ pr?: number | string;
1475
+ pb?: number | string;
1476
+ pl?: number | string;
1477
+ px?: number | string;
1478
+ py?: number | string;
1453
1479
  }
1454
1480
  declare const Box: React.ForwardRefExoticComponent<BoxProps & React.RefAttributes<HTMLElement>>;
1455
1481
 
@@ -1468,6 +1494,26 @@ interface StackProps extends React.HTMLAttributes<HTMLElement> {
1468
1494
  className?: string;
1469
1495
  style?: CSSProperties;
1470
1496
  sx?: SxProp;
1497
+ width?: string | number;
1498
+ height?: string | number;
1499
+ minWidth?: string | number;
1500
+ maxWidth?: string | number;
1501
+ minHeight?: string | number;
1502
+ maxHeight?: string | number;
1503
+ m?: number | string;
1504
+ mt?: number | string;
1505
+ mr?: number | string;
1506
+ mb?: number | string;
1507
+ ml?: number | string;
1508
+ mx?: number | string;
1509
+ my?: number | string;
1510
+ p?: number | string;
1511
+ pt?: number | string;
1512
+ pr?: number | string;
1513
+ pb?: number | string;
1514
+ pl?: number | string;
1515
+ px?: number | string;
1516
+ py?: number | string;
1471
1517
  }
1472
1518
  declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLElement>>;
1473
1519
 
@@ -1494,9 +1540,140 @@ interface GridProps extends React.HTMLAttributes<HTMLElement> {
1494
1540
  className?: string;
1495
1541
  style?: CSSProperties;
1496
1542
  sx?: SxProp;
1543
+ width?: string | number;
1544
+ height?: string | number;
1545
+ minWidth?: string | number;
1546
+ maxWidth?: string | number;
1547
+ minHeight?: string | number;
1548
+ maxHeight?: string | number;
1549
+ m?: number | string;
1550
+ mt?: number | string;
1551
+ mr?: number | string;
1552
+ mb?: number | string;
1553
+ ml?: number | string;
1554
+ mx?: number | string;
1555
+ my?: number | string;
1556
+ p?: number | string;
1557
+ pt?: number | string;
1558
+ pr?: number | string;
1559
+ pb?: number | string;
1560
+ pl?: number | string;
1561
+ px?: number | string;
1562
+ py?: number | string;
1497
1563
  }
1498
1564
  declare const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<HTMLElement>>;
1499
1565
 
1566
+ interface TableContainerProps extends React__default.HTMLAttributes<HTMLElement> {
1567
+ component?: keyof React__default.JSX.IntrinsicElements;
1568
+ children?: ReactNode;
1569
+ className?: string;
1570
+ style?: CSSProperties;
1571
+ sx?: SxProp;
1572
+ }
1573
+ declare const TableContainer: React__default.ForwardRefExoticComponent<TableContainerProps & React__default.RefAttributes<HTMLElement>>;
1574
+ interface TableProps extends React__default.TableHTMLAttributes<HTMLTableElement> {
1575
+ size?: "small" | "medium";
1576
+ stickyHeader?: boolean;
1577
+ padding?: "normal" | "checkbox" | "none";
1578
+ children?: ReactNode;
1579
+ className?: string;
1580
+ style?: CSSProperties;
1581
+ sx?: SxProp;
1582
+ }
1583
+ declare const Table: React__default.ForwardRefExoticComponent<TableProps & React__default.RefAttributes<HTMLTableElement>>;
1584
+ interface TableHeadProps extends React__default.HTMLAttributes<HTMLTableSectionElement> {
1585
+ children?: ReactNode;
1586
+ className?: string;
1587
+ style?: CSSProperties;
1588
+ sx?: SxProp;
1589
+ }
1590
+ declare const TableHead: React__default.ForwardRefExoticComponent<TableHeadProps & React__default.RefAttributes<HTMLTableSectionElement>>;
1591
+ interface TableBodyProps extends React__default.HTMLAttributes<HTMLTableSectionElement> {
1592
+ children?: ReactNode;
1593
+ className?: string;
1594
+ style?: CSSProperties;
1595
+ sx?: SxProp;
1596
+ }
1597
+ declare const TableBody: React__default.ForwardRefExoticComponent<TableBodyProps & React__default.RefAttributes<HTMLTableSectionElement>>;
1598
+ interface TableFooterProps extends React__default.HTMLAttributes<HTMLTableSectionElement> {
1599
+ children?: ReactNode;
1600
+ className?: string;
1601
+ style?: CSSProperties;
1602
+ sx?: SxProp;
1603
+ }
1604
+ declare const TableFooter: React__default.ForwardRefExoticComponent<TableFooterProps & React__default.RefAttributes<HTMLTableSectionElement>>;
1605
+ interface TableRowProps extends React__default.HTMLAttributes<HTMLTableRowElement> {
1606
+ hover?: boolean;
1607
+ selected?: boolean;
1608
+ children?: ReactNode;
1609
+ className?: string;
1610
+ style?: CSSProperties;
1611
+ sx?: SxProp;
1612
+ }
1613
+ declare const TableRow: React__default.ForwardRefExoticComponent<TableRowProps & React__default.RefAttributes<HTMLTableRowElement>>;
1614
+ interface TableCellProps extends React__default.TdHTMLAttributes<HTMLTableCellElement> {
1615
+ /** Render as <th> instead of <td>. Auto-set when inside TableHead. */
1616
+ component?: "td" | "th";
1617
+ align?: "left" | "right" | "center" | "justify";
1618
+ /** Override the table-level padding for this cell */
1619
+ padding?: "normal" | "checkbox" | "none";
1620
+ /** Conveys sort direction for assistive technology */
1621
+ sortDirection?: "asc" | "desc" | false;
1622
+ /** Visual variant — auto-detected from parent section */
1623
+ variant?: "head" | "body" | "footer";
1624
+ children?: ReactNode;
1625
+ className?: string;
1626
+ style?: CSSProperties;
1627
+ sx?: SxProp;
1628
+ }
1629
+ declare const TableCell: React__default.ForwardRefExoticComponent<TableCellProps & React__default.RefAttributes<HTMLTableCellElement>>;
1630
+ interface TableSortLabelProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
1631
+ /** Whether this column is the current sort column */
1632
+ active?: boolean;
1633
+ /** Current sort direction */
1634
+ direction?: "asc" | "desc";
1635
+ /** Hide the sort arrow icon when the column is not active */
1636
+ hideSortIcon?: boolean;
1637
+ children?: ReactNode;
1638
+ className?: string;
1639
+ style?: CSSProperties;
1640
+ sx?: SxProp;
1641
+ }
1642
+ declare const TableSortLabel: React__default.ForwardRefExoticComponent<TableSortLabelProps & React__default.RefAttributes<HTMLButtonElement>>;
1643
+ interface TablePaginationProps extends React__default.HTMLAttributes<HTMLDivElement> {
1644
+ /** Total number of rows */
1645
+ count: number;
1646
+ /** Current 0-indexed page */
1647
+ page: number;
1648
+ /** Number of rows per page */
1649
+ rowsPerPage: number;
1650
+ /** Called when the user changes the page */
1651
+ onPageChange: (event: React__default.MouseEvent<HTMLButtonElement> | null, page: number) => void;
1652
+ /** Available rows-per-page options */
1653
+ rowsPerPageOptions?: (number | {
1654
+ value: number;
1655
+ label: string;
1656
+ })[];
1657
+ /** Called when rows-per-page changes */
1658
+ onRowsPerPageChange?: (event: React__default.ChangeEvent<HTMLSelectElement>) => void;
1659
+ /** Label before the rows-per-page selector */
1660
+ labelRowsPerPage?: ReactNode;
1661
+ /** Override the "X–Y of Z" display */
1662
+ labelDisplayedRows?: (args: {
1663
+ from: number;
1664
+ to: number;
1665
+ count: number;
1666
+ }) => ReactNode;
1667
+ /** Show first-page button */
1668
+ showFirstButton?: boolean;
1669
+ /** Show last-page button */
1670
+ showLastButton?: boolean;
1671
+ className?: string;
1672
+ style?: CSSProperties;
1673
+ sx?: SxProp;
1674
+ }
1675
+ declare const TablePagination: React__default.ForwardRefExoticComponent<TablePaginationProps & React__default.RefAttributes<HTMLDivElement>>;
1676
+
1500
1677
  interface PaperProps extends React.HTMLAttributes<HTMLElement> {
1501
1678
  elevation?: number;
1502
1679
  square?: boolean;
@@ -2374,4 +2551,4 @@ declare function useStatesSearch(debounceMs?: number): SearchResult<EnhancedStat
2374
2551
  */
2375
2552
  declare function useCitiesSearch(debounceMs?: number): SearchResult<EnhancedCity>;
2376
2553
 
2377
- export { APP_THEMES, Accordion, AccordionDetails, type AccordionDetailsProps, type AccordionProps, AccordionSummary, type AccordionSummaryProps, type Action, ActivateUserIcon, AddButton, AddressLookup, ArchivedIcon, AssignGroupIcon, Autocomplete, type AutocompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, BaseDialog, Box, type BoxProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, CameraIcon, CancelButton, Card, CardActions, type CardActionsProps, CardContent, type CardContentProps, CardHeader, type CardHeaderProps, CardMedia, type CardMediaProps, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipProps, CircularProgress, CircularProgressIcon, type CircularProgressIconProps, CloseIcon, Collapse, type CollapseProps, type Column, CopyIcon, CustomImage, CustomTaskItem, CustomVideo, CustomYoutube, DataGrid, type DataGridProps, DateField, type DateFieldProps, type DateFormatString, DateRangeField, type DateRangeFieldProps, type DateRangeValue, DifficultyAllIcon, DifficultyEasyIcon, DifficultyHardIcon, DifficultyMediumIcon, Divider, type DividerProps, DollarIcon, DownloadIcon, DownloadPdfIcon, Drawer, type DrawerProps, EditChatIcon, EditIcon, EngagementIcon, type EnhancedCity, type EnhancedCountry, type EnhancedState, Fade, type FadeProps, FontFamily, FontSize, FunctionIcon, Grid, type GridProps, Grow, type GrowProps, HelpOutlinedIcon, HierarchyIcon, INDENT_STEP, IconButton, type IconButtonProps, ImageField, type ImageFieldProps, InactiveGroupIcon, Indent, IndustryIcon, InvoiceIcon, LineHeight, Link, type LinkProps, List, ListItem, ListItemButton, type ListItemButtonProps, ListItemIcon, type ListItemIconProps, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListStyle, ListSubheader, type ListSubheaderProps, LocationPinIcon, LogsIcon, MAX_INDENT, Menu, MenuDivider, MenuItem, type MenuItemProps, MenuList, type MenuListProps, type MenuProps, MinExperienceIcon, NineDotMenuIcon, NotificationIcon, type NumberVariant, Paper, type PaperProps, PhoneField, type PhoneFieldProps, Popover, type PopoverProps, Popper, type PopperProps, ProjectIcon, QualificationsIcon, QuestionStatusAllIcon, QuestionStatusPrivateIcon, QuestionStatusPublicIcon, QuestionTypeAllIcon, QuestionTypeCodingIcon, QuestionTypeDescriptiveIcon, QuestionTypeMultipleIcon, QuestionTypeSingleIcon, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rating, type RatingProps, RefreshIcon, ResendInviteIcon, RolesIcon, RufousAiIcon, RufousBirdIcon, RufousLauncherIcon, RufousLogoLoader, type RufousLogoLoaderProps, RufousTextContent, type RufousTextContentProps, RufousTextEditor, type MentionItemData as RufousTextEditorMentionItem, type RufousTextEditorProps, RufousThemeProvider, STATUS_COLORS, STATUS_IMAGES, STATUS_LABELS, Select, type SelectProps, SidebarIcon, Skeleton, type SkeletonProps, Slide, type SlideProps, Slider, type SliderProps, SmartSelect, type SmartSelectProps, Snackbar, type SnackbarProps, SoftSkillsIcon, type SortDirection, Stack, type StackProps, StandardButton, Step, StepButton, type StepButtonProps, StepContent, type StepContentProps, StepLabel, type StepLabelProps, type StepProps, Stepper, type StepperProps, SubmitButton, SubscribeIcon, SuspendUserIcon, Switch, type SwitchProps, type SxProp, Tab, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, TechnicalSkillsIcon, TextField, type TextFieldProps, TickIcon, TimerIcon, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, Tooltip, type TooltipProps, TrashIcon, type TreeNode, TreeSelect, type TreeSelectMultiValue, type TreeSelectProps, type TreeSelectValue, Typography, type TypographyProps, UnArchivedIcon, UnsubscribeIcon, UploadIcon, UserAssignIcon, type UserOption, UserSelectionField, type UserSelectionFieldProps, ViewIcon, WorkItemIcon, Zoom, type ZoomProps, getAllCountries, getCitiesByName, getCitiesOfCountry, getCitiesOfState, getCityByName, getCountriesByName, getCountryByCode, getCountryByName, getStateByCode, getStateByName, getStatesByName, getStatesOfCountry, transformLegacyTodos, useCitiesSearch, useCountriesSearch, useRufousTheme, useStatesSearch };
2554
+ export { APP_THEMES, Accordion, AccordionDetails, type AccordionDetailsProps, type AccordionProps, AccordionSummary, type AccordionSummaryProps, type Action, ActivateUserIcon, AddButton, AddressLookup, ArchivedIcon, AssignGroupIcon, Autocomplete, type AutocompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, BaseDialog, Box, type BoxProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, CameraIcon, CancelButton, Card, CardActions, type CardActionsProps, CardContent, type CardContentProps, CardHeader, type CardHeaderProps, CardMedia, type CardMediaProps, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipProps, CircularProgress, CircularProgressIcon, type CircularProgressIconProps, CloseIcon, Collapse, type CollapseProps, type Column, CopyIcon, CustomImage, CustomTaskItem, CustomVideo, CustomYoutube, DataGrid, type DataGridProps, DateField, type DateFieldProps, type DateFormatString, DateRangeField, type DateRangeFieldProps, type DateRangeValue, DifficultyAllIcon, DifficultyEasyIcon, DifficultyHardIcon, DifficultyMediumIcon, Divider, type DividerProps, DollarIcon, DownloadIcon, DownloadPdfIcon, Drawer, type DrawerProps, EditChatIcon, EditIcon, EngagementIcon, type EnhancedCity, type EnhancedCountry, type EnhancedState, Fade, type FadeProps, FontFamily, FontSize, FunctionIcon, Grid, type GridProps, Grow, type GrowProps, HelpOutlinedIcon, HierarchyIcon, INDENT_STEP, IconButton, type IconButtonProps, ImageField, type ImageFieldProps, InactiveGroupIcon, Indent, IndustryIcon, InvoiceIcon, LineHeight, Link, type LinkProps, List, ListItem, ListItemButton, type ListItemButtonProps, ListItemIcon, type ListItemIconProps, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListStyle, ListSubheader, type ListSubheaderProps, LocationPinIcon, LogsIcon, MAX_INDENT, Menu, MenuDivider, MenuItem, type MenuItemProps, MenuList, type MenuListProps, type MenuProps, MinExperienceIcon, NineDotMenuIcon, NotificationIcon, type NumberVariant, Paper, type PaperProps, PhoneField, type PhoneFieldProps, Popover, type PopoverProps, Popper, type PopperProps, ProjectIcon, QualificationsIcon, QuestionStatusAllIcon, QuestionStatusPrivateIcon, QuestionStatusPublicIcon, QuestionTypeAllIcon, QuestionTypeCodingIcon, QuestionTypeDescriptiveIcon, QuestionTypeMultipleIcon, QuestionTypeSingleIcon, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rating, type RatingProps, RefreshIcon, ResendInviteIcon, RolesIcon, RufousAiIcon, RufousBirdIcon, RufousLauncherIcon, RufousLogoLoader, type RufousLogoLoaderProps, RufousTextContent, type RufousTextContentProps, RufousTextEditor, type MentionItemData as RufousTextEditorMentionItem, type RufousTextEditorProps, RufousThemeProvider, STATUS_COLORS, STATUS_IMAGES, STATUS_LABELS, Select, type SelectProps, SidebarIcon, Skeleton, type SkeletonProps, Slide, type SlideProps, Slider, type SliderProps, SmartSelect, type SmartSelectProps, Snackbar, type SnackbarProps, SoftSkillsIcon, type SortDirection, Stack, type StackProps, StandardButton, Step, StepButton, type StepButtonProps, StepContent, type StepContentProps, StepLabel, type StepLabelProps, type StepProps, Stepper, type StepperProps, SubmitButton, SubscribeIcon, SuspendUserIcon, Switch, type SwitchProps, type SxProp, Tab, TabPanel, type TabPanelProps, type TabProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableContainer, type TableContainerProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TablePagination, type TablePaginationProps, type TableProps, TableRow, type TableRowProps, TableSortLabel, type TableSortLabelProps, Tabs, type TabsProps, TechnicalSkillsIcon, TextField, type TextFieldProps, TickIcon, TimerIcon, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, Tooltip, type TooltipProps, TrashIcon, type TreeNode, TreeSelect, type TreeSelectMultiValue, type TreeSelectProps, type TreeSelectValue, Typography, type TypographyProps, UnArchivedIcon, UnsubscribeIcon, UploadIcon, UserAssignIcon, type UserOption, UserSelectionField, type UserSelectionFieldProps, ViewIcon, WorkItemIcon, Zoom, type ZoomProps, getAllCountries, getCitiesByName, getCitiesOfCountry, getCitiesOfState, getCityByName, getCountriesByName, getCountryByCode, getCountryByName, getStateByCode, getStateByName, getStatesByName, getStatesOfCountry, transformLegacyTodos, useCitiesSearch, useCountriesSearch, useRufousTheme, useStatesSearch };