tcce-design-system 0.1.39 → 0.1.41

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.
@@ -624,7 +624,7 @@ export declare interface FilterOptionProps {
624
624
 
625
625
  export declare const flushedStyles: RuleSet<object>;
626
626
 
627
- export declare const FormField: ({ id, name, label, type, size, placeholder, disabled, required, options, checkboxLabel, radioName, pinLength, pinType, rows, className, inputClassName, labelClassName, messageErrorClassName, leftIcon, rightIcon, iconSize, iconColor, onOptionSelect, onRadioChange, onPinComplete, onChange, ...props }: FormFieldComponentProps) => JSX.Element;
627
+ export declare const FormField: ({ id, name, label, type, size, placeholder, disabled, required, options, checkboxLabel, radioName, pinLength, pinType, rows, className, inputClassName, labelClassName, messageErrorClassName, leftIcon, rightIcon, iconSize, iconColor, onOptionSelect, onRadioChange, onPinComplete, onChange, optionsClassName, optionClassName, ...props }: FormFieldComponentProps) => JSX.Element;
628
628
 
629
629
  export declare interface FormFieldComponentProps extends WithIconsProps {
630
630
  id?: string | number;
@@ -648,6 +648,15 @@ export declare interface FormFieldComponentProps extends WithIconsProps {
648
648
  inputClassName?: string;
649
649
  labelClassName?: string;
650
650
  messageErrorClassName?: string;
651
+ /**
652
+ * Class applied to the options container (menu content)
653
+ */
654
+ optionsClassName?: string;
655
+ /**
656
+ * Class applied to each option. Can be a string or a function that receives the option
657
+ * and returns a string (useful for conditional classes per option).
658
+ */
659
+ optionClassName?: string | ((option: SelectOption | null) => string);
651
660
  onOptionSelect?: (option: SelectOption) => void;
652
661
  onRadioChange?: (event: ChangeEvent<HTMLInputElement>) => void;
653
662
  onPinComplete?: (value: string) => void;
@@ -846,15 +855,15 @@ export declare type HasIcons<T extends WithIconsProps> = {
846
855
  /**
847
856
  * Checks if the user has at least one of the required permissions.
848
857
  *
849
- * @param {string[]} userRoles - The roles or permissions assigned to the user.
850
- * @param {string[]} permissions - The required permissions to check against.
858
+ * @param {string[]} userPermissions - The permissions assigned to the user.
859
+ * @param {string[]} requiredPermissions - The required permissions to check against.
851
860
  * @returns {boolean} True if the user has permission, otherwise false.
852
861
  *
853
- * - Returns false if no permissions are provided.
854
- * - Returns true if 'all' is included in the permissions array.
855
- * - Returns true if any of the user's roles match the required permissions.
862
+ * - Returns false if no required permissions are provided.
863
+ * - Returns true if 'all' is included in the required permissions array.
864
+ * - Returns true if any of the user's permissions match the required permissions.
856
865
  */
857
- export declare const hasPermission: (userRoles?: string[], permissions?: string[]) => boolean;
866
+ export declare const hasPermission: (userPermissions?: string[], requiredPermissions?: string[]) => boolean;
858
867
 
859
868
  /**
860
869
  * Main Header component for the application.
@@ -1039,7 +1048,7 @@ export declare interface LayoutMainContentProps {
1039
1048
  * Includes navigation config, user info, and event handlers.
1040
1049
  * @children - Main content to be rendered within the layout.
1041
1050
  * @navigationConfig - Configuration for sidebar navigation items.
1042
- * @userRoles - Roles of the current user for permission-based rendering.
1051
+ * @userPermissions - Permissions of the current user for permission-based rendering.
1043
1052
  * @activePath - Currently active navigation path.
1044
1053
  * @user - User information for the header profile section.
1045
1054
  * @hasNotifications - Whether to show notification indicator in header.
@@ -1384,13 +1393,18 @@ export declare interface SelectInputProps extends Omit<SelectHTMLAttributes<HTML
1384
1393
  className?: string;
1385
1394
  inputClassName?: string;
1386
1395
  optionsClassName?: string;
1387
- optionClassName?: string;
1396
+ optionClassName?: string | ((option: SelectOption | null) => string);
1397
+ searchable?: boolean;
1398
+ searchPlaceholder?: string;
1399
+ clearSearchOnSelect?: boolean;
1400
+ noResultsMessage?: string;
1388
1401
  }
1389
1402
 
1390
1403
  export declare interface SelectOption {
1391
1404
  value: string | number;
1392
1405
  label: string;
1393
1406
  disabled?: boolean;
1407
+ className?: string;
1394
1408
  }
1395
1409
 
1396
1410
  export declare interface SelectSpecificProps {
@@ -1414,13 +1428,13 @@ export declare type SetDigits = Dispatch<SetStateAction<string[]>>;
1414
1428
  /**
1415
1429
  * Sidebar component for navigation.
1416
1430
  * @param navigationConfig - Navigation items configuration.
1417
- * @param userRoles - User roles for access control.
1431
+ * @param userPermissions - User permissions for access control.
1418
1432
  * @param activePath - Currently active navigation path.
1419
1433
  * @param logoImgExpanded - Logo when sidebar is expanded.
1420
1434
  * @param logoImgCollapsed - Logo when sidebar is collapsed.
1421
1435
  */
1422
1436
  export declare const Sidebar: {
1423
- ({ navigationConfig, userRoles, activePath, logoImgExpanded, logoImgCollapsed, onNavigate, }: SidebarProps): JSX.Element;
1437
+ ({ navigationConfig, activePath, logoImgExpanded, logoImgCollapsed, onNavigate, userPermissions, }: SidebarProps): JSX.Element;
1424
1438
  displayName: string;
1425
1439
  };
1426
1440
 
@@ -1452,15 +1466,15 @@ $collapsed: boolean;
1452
1466
  * Props for the Sidebar component.
1453
1467
  *
1454
1468
  * @property navigationConfig - Array of NavigationItem objects defining the sidebar structure.
1455
- * @property userRoles - Optional array of roles assigned to the current user for permission checks.
1469
+ * @property userPermissions - Array of permissions assigned to the current user for permission checks.
1456
1470
  * @property activePath - Optional string representing the currently active navigation path for highlighting purposes.
1457
1471
  * @property logoImgExpanded - Optional React node for the logo when sidebar is expanded.
1458
1472
  * @property logoImgCollapsed - Optional React node for the logo when sidebar is collapsed.
1459
- * @property LinkComponent - Optional custom Link component (e.g., Next.js Link) for internal navigation. If not provided, uses standard anchor tags.
1473
+ * @property onNavigate - Optional callback function for handling navigation events.
1460
1474
  */
1461
1475
  export declare interface SidebarProps {
1462
1476
  navigationConfig: NavigationItem[];
1463
- userRoles?: string[];
1477
+ userPermissions?: Permission[];
1464
1478
  activePath?: string;
1465
1479
  logoImgExpanded?: ReactNode;
1466
1480
  logoImgCollapsed?: ReactNode;