@rufous/ui 0.3.12 → 0.3.15

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
@@ -1757,6 +1757,113 @@ interface PhoneFieldProps {
1757
1757
  }
1758
1758
  declare const PhoneField: React__default.ForwardRefExoticComponent<PhoneFieldProps & React__default.RefAttributes<HTMLDivElement>>;
1759
1759
 
1760
+ interface TreeNode {
1761
+ id: string | number;
1762
+ label: string;
1763
+ name?: string;
1764
+ children?: TreeNode[];
1765
+ }
1766
+ type TreeSelectMultiValue = Record<string, boolean>;
1767
+ type TreeSelectSingleValue = string | number | null;
1768
+ type TreeSelectValue = TreeSelectSingleValue | TreeSelectMultiValue;
1769
+ interface TreeSelectProps {
1770
+ /** Tree data — each node may have nested children */
1771
+ options: TreeNode[];
1772
+ /** Controlled value. Single mode: id or null. Multiple mode: Record<id, boolean>. */
1773
+ value?: TreeSelectValue;
1774
+ /** Called when selection changes */
1775
+ onChange?: (e: {
1776
+ value: TreeSelectValue;
1777
+ }) => void;
1778
+ /** Called when a node is selected */
1779
+ onNodeSelect?: (e: {
1780
+ node: TreeNode;
1781
+ }) => void;
1782
+ /** Called when a node is unselected */
1783
+ onNodeUnselect?: (e: {
1784
+ node: TreeNode;
1785
+ }) => void;
1786
+ /** 'single' (default) or 'multiple' (checkbox tree) */
1787
+ selectionMode?: 'single' | 'multiple';
1788
+ /** Placeholder text shown when nothing is selected */
1789
+ placeholder?: string;
1790
+ /** Show a search filter input at the top of the dropdown */
1791
+ filter?: boolean;
1792
+ /** Auto-focus the filter input when the dropdown opens */
1793
+ filterInputAutoFocus?: boolean;
1794
+ /** Clear filter text when the dropdown closes */
1795
+ resetFilterOnHide?: boolean;
1796
+ /** PrimeReact compat — accepted but not used (checkboxes handle multi-select) */
1797
+ metaKeySelection?: boolean;
1798
+ /** Disable the whole control */
1799
+ disabled?: boolean;
1800
+ /** Floating label */
1801
+ label?: string;
1802
+ /** Visual variant (mirrors TextField) */
1803
+ variant?: 'outlined' | 'filled' | 'standard';
1804
+ /** Size */
1805
+ size?: 'small' | 'medium';
1806
+ /** Error state */
1807
+ error?: boolean;
1808
+ /** Helper / error text below the field */
1809
+ helperText?: ReactNode;
1810
+ /** Stretch to full container width */
1811
+ fullWidth?: boolean;
1812
+ /** Show a clear button when a value is selected */
1813
+ clearable?: boolean;
1814
+ /** Mark the field as required — appends an asterisk to the label */
1815
+ required?: boolean;
1816
+ style?: CSSProperties;
1817
+ className?: string;
1818
+ sx?: SxProp;
1819
+ }
1820
+ declare function TreeSelect({ options, value, onChange, onNodeSelect, onNodeUnselect, selectionMode, placeholder, filter, filterInputAutoFocus, resetFilterOnHide, metaKeySelection: _metaKeySelection, disabled, label, variant, size, error, helperText, fullWidth, clearable, required, style, className, sx, }: TreeSelectProps): React__default.JSX.Element;
1821
+
1822
+ interface UserOption {
1823
+ id?: string | number;
1824
+ _id?: string | number;
1825
+ userFirstName?: string;
1826
+ userLastName?: string;
1827
+ emailId?: string;
1828
+ }
1829
+ interface UserSelectionFieldProps {
1830
+ /** Selected user (single) or array of users (multiple) */
1831
+ value?: UserOption | UserOption[] | null;
1832
+ /** Called when selection changes */
1833
+ onChange: (value: UserOption | UserOption[] | null) => void;
1834
+ /** Available user options */
1835
+ options?: UserOption[];
1836
+ /** Show a loading spinner */
1837
+ loading?: boolean;
1838
+ /**
1839
+ * Called when the search text changes and no local match is found —
1840
+ * use this to trigger an API search.
1841
+ */
1842
+ onSearchChange?: (value: string) => void;
1843
+ /** Label / placeholder text */
1844
+ label?: string;
1845
+ /** Allow selecting multiple users */
1846
+ multiple?: boolean;
1847
+ /** In multiple mode, cap how many tag chips are shown before "+N more" */
1848
+ limitTags?: number;
1849
+ size?: 'small' | 'medium';
1850
+ variant?: 'outlined' | 'filled' | 'standard';
1851
+ disabled?: boolean;
1852
+ error?: boolean;
1853
+ helperText?: ReactNode;
1854
+ fullWidth?: boolean;
1855
+ required?: boolean;
1856
+ /**
1857
+ * Override the default name/email filter. Receives (options, inputValue).
1858
+ * Pass `(opts) => opts` to skip internal filtering when options are pre-filtered externally.
1859
+ */
1860
+ filterOptions?: (options: UserOption[], inputValue: string) => UserOption[];
1861
+ className?: string;
1862
+ style?: CSSProperties;
1863
+ sx?: SxProp;
1864
+ }
1865
+ declare function UserSelectionField({ value, onChange, options, loading, onSearchChange, label, multiple, limitTags, size, variant, disabled, error, helperText, fullWidth, required, filterOptions: filterOptionsProp, className, style, sx, }: UserSelectionFieldProps): React__default.JSX.Element;
1866
+
1760
1867
  type ToolbarButton = 'undo' | 'redo' | 'ai' | 'paragraph' | 'fontsize' | 'font' | 'color' | 'bold' | 'italic' | 'strike' | 'link' | 'lineheight' | 'ul' | 'ol' | 'align' | 'indent' | 'outdent' | 'table' | 'image' | 'video' | 'cut' | 'copy' | 'paste' | 'specialchars' | 'code' | 'fullscreen' | 'tts' | 'stt' | 'translate' | 'todo' | '|';
1761
1868
  type EditorVariant = 'default' | 'basic';
1762
1869
  interface RufousTextEditorProps {
@@ -1843,4 +1950,4 @@ interface MentionItemData {
1843
1950
  shortName?: string;
1844
1951
  }
1845
1952
 
1846
- 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, 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, Fade, type FadeProps, FunctionIcon, Grid, type GridProps, Grow, type GrowProps, HelpOutlinedIcon, HierarchyIcon, IconButton, type IconButtonProps, ImageField, type ImageFieldProps, InactiveGroupIcon, IndustryIcon, InvoiceIcon, Link, type LinkProps, List, ListItem, ListItemButton, type ListItemButtonProps, ListItemIcon, type ListItemIconProps, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, LocationPinIcon, LogsIcon, 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, Select, type SelectProps, SidebarIcon, Skeleton, type SkeletonProps, Slide, type SlideProps, Slider, type SliderProps, 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, Typography, type TypographyProps, UnArchivedIcon, UnsubscribeIcon, UploadIcon, UserAssignIcon, ViewIcon, WorkItemIcon, Zoom, type ZoomProps, transformLegacyTodos, useRufousTheme };
1953
+ 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, 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, Fade, type FadeProps, FunctionIcon, Grid, type GridProps, Grow, type GrowProps, HelpOutlinedIcon, HierarchyIcon, IconButton, type IconButtonProps, ImageField, type ImageFieldProps, InactiveGroupIcon, IndustryIcon, InvoiceIcon, Link, type LinkProps, List, ListItem, ListItemButton, type ListItemButtonProps, ListItemIcon, type ListItemIconProps, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, LocationPinIcon, LogsIcon, 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, Select, type SelectProps, SidebarIcon, Skeleton, type SkeletonProps, Slide, type SlideProps, Slider, type SliderProps, 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, transformLegacyTodos, useRufousTheme };