tcce-design-system 0.1.13 → 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.
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { AnchorHTMLAttributes } from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
3
|
+
import { Component } from 'react';
|
|
4
|
+
import { Context } from 'react';
|
|
2
5
|
import { default as default_2 } from 'react';
|
|
3
6
|
import { DetailedHTMLProps } from 'react';
|
|
7
|
+
import { FastOmit } from 'styled-components';
|
|
8
|
+
import { ForwardRefComponent } from 'motion/react';
|
|
4
9
|
import { ForwardRefExoticComponent } from 'react';
|
|
5
10
|
import { HTMLAttributeAnchorTarget } from 'react';
|
|
6
11
|
import { HTMLAttributes } from 'react';
|
|
12
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
7
13
|
import { IStyledComponentBase } from 'styled-components/dist/types';
|
|
8
14
|
import { JSX } from 'react/jsx-runtime';
|
|
9
15
|
import { MouseEventHandler } from 'react';
|
|
16
|
+
import { PropsWithChildren } from 'react';
|
|
10
17
|
import { ReactNode } from 'react';
|
|
11
18
|
import { RefAttributes } from 'react';
|
|
12
19
|
import { RemixiconComponentType } from '@remixicon/react';
|
|
@@ -22,6 +29,16 @@ export declare const ALLOWED_INPUT_TYPES: readonly ["text", "email", "password",
|
|
|
22
29
|
|
|
23
30
|
export declare type AllowedInputType = (typeof ALLOWED_INPUT_TYPES)[number];
|
|
24
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Sidebar container.
|
|
34
|
+
* @param $collapsed - Whether the sidebar is collapsed.
|
|
35
|
+
* @param $open - Whether the sidebar is open (mobile).
|
|
36
|
+
*/
|
|
37
|
+
export declare const Aside: IStyledComponentBase<"web", Substitute<DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, {
|
|
38
|
+
$collapsed: boolean;
|
|
39
|
+
$open: boolean;
|
|
40
|
+
}>> & string;
|
|
41
|
+
|
|
25
42
|
export declare const baseContentTableStyles: RuleSet<object>;
|
|
26
43
|
|
|
27
44
|
export declare const baseFieldStyles: RuleSet<object>;
|
|
@@ -68,6 +85,8 @@ export declare const bodyTextStyles: {
|
|
|
68
85
|
12: RuleSet<object>;
|
|
69
86
|
};
|
|
70
87
|
|
|
88
|
+
export declare const BrandLogo: IStyledComponentBase<"web", FastOmit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
89
|
+
|
|
71
90
|
export declare const Button: default_2.FC<ButtonProps>;
|
|
72
91
|
|
|
73
92
|
declare interface ButtonProps extends default_2.ButtonHTMLAttributes<HTMLButtonElement>, WithIconsProps {
|
|
@@ -136,6 +155,11 @@ export declare interface CheckboxSpecificProps {
|
|
|
136
155
|
checkboxLabel?: string;
|
|
137
156
|
}
|
|
138
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Button to toggle sidebar collapse/expand.
|
|
160
|
+
*/
|
|
161
|
+
export declare const CloseOpenButton: IStyledComponentBase<"web", FastOmit<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
162
|
+
|
|
139
163
|
declare type ColorKey = 'primary' | 'orange' | 'white' | 'gray';
|
|
140
164
|
|
|
141
165
|
declare type ColorKey_2 = 'primary' | 'orange' | 'white' | 'gray';
|
|
@@ -420,6 +444,19 @@ export declare type HasIcons<T extends WithIconsProps> = {
|
|
|
420
444
|
hasRightIcon: boolean;
|
|
421
445
|
} & T;
|
|
422
446
|
|
|
447
|
+
/**
|
|
448
|
+
* Checks if the user has at least one of the required permissions.
|
|
449
|
+
*
|
|
450
|
+
* @param {string[]} userRoles - The roles or permissions assigned to the user.
|
|
451
|
+
* @param {string[]} permissions - The required permissions to check against.
|
|
452
|
+
* @returns {boolean} True if the user has permission, otherwise false.
|
|
453
|
+
*
|
|
454
|
+
* - Returns false if no permissions are provided.
|
|
455
|
+
* - Returns true if 'all' is included in the permissions array.
|
|
456
|
+
* - Returns true if any of the user's roles match the required permissions.
|
|
457
|
+
*/
|
|
458
|
+
export declare const hasPermission: (userRoles?: string[], permissions?: string[]) => boolean;
|
|
459
|
+
|
|
423
460
|
/**
|
|
424
461
|
* Main Header component for the application.
|
|
425
462
|
* Displays notifications, user profile, and optional children.
|
|
@@ -431,7 +468,6 @@ export declare const Header: default_2.FC<HeaderProps>;
|
|
|
431
468
|
|
|
432
469
|
/**
|
|
433
470
|
* Props for the Header component.
|
|
434
|
-
* @param sidebarCollapsed: Whether the sidebar is collapsed.
|
|
435
471
|
* @param user: User information for profile display.
|
|
436
472
|
* @param hasNotifications: Whether there are new notifications.
|
|
437
473
|
* @param notificationCount: Optional count of notifications to display.
|
|
@@ -441,7 +477,7 @@ export declare const Header: default_2.FC<HeaderProps>;
|
|
|
441
477
|
* @param userMenuItems: Additional menu items for the user dropdown.
|
|
442
478
|
* @param children: Any additional elements to render in the left section.
|
|
443
479
|
*/
|
|
444
|
-
|
|
480
|
+
declare interface HeaderProps {
|
|
445
481
|
user?: User;
|
|
446
482
|
hasNotifications?: boolean;
|
|
447
483
|
notificationCount?: number;
|
|
@@ -449,7 +485,7 @@ export declare interface HeaderProps {
|
|
|
449
485
|
onUserProfileClick?: () => void;
|
|
450
486
|
onLogout?: () => void;
|
|
451
487
|
userMenuItems?: UserMenuItem[];
|
|
452
|
-
children?:
|
|
488
|
+
children?: React.ReactNode;
|
|
453
489
|
}
|
|
454
490
|
|
|
455
491
|
export declare const HeadingBold: IStyledComponentBase<"web", Substitute<DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {
|
|
@@ -576,6 +612,7 @@ export declare interface LayoutProps extends SidebarProps {
|
|
|
576
612
|
notificationCount?: number;
|
|
577
613
|
onNotificationClick?: () => void;
|
|
578
614
|
onUserProfileClick?: () => void;
|
|
615
|
+
onNavigate?: (href: string) => void;
|
|
579
616
|
onLogout?: () => void;
|
|
580
617
|
userMenuItems?: UserMenuItem[];
|
|
581
618
|
contentClassName?: string;
|
|
@@ -590,6 +627,11 @@ export declare interface LayoutProps extends SidebarProps {
|
|
|
590
627
|
*/
|
|
591
628
|
export declare const Link: default_2.ForwardRefExoticComponent<LinkProps & default_2.RefAttributes<HTMLAnchorElement>>;
|
|
592
629
|
|
|
630
|
+
/**
|
|
631
|
+
* CSS styles applied when the Link is disabled.
|
|
632
|
+
*/
|
|
633
|
+
export declare const LinkDisabledStyles: RuleSet<object>;
|
|
634
|
+
|
|
593
635
|
/**
|
|
594
636
|
* Props for the Link component.
|
|
595
637
|
* Extends standard anchor attributes and WithIconsProps.
|
|
@@ -618,11 +660,41 @@ export declare interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElemen
|
|
|
618
660
|
*/
|
|
619
661
|
export declare type LinkSize = 'sm' | 'md' | 'lg';
|
|
620
662
|
|
|
663
|
+
/**
|
|
664
|
+
* CSS styles for each Link size.
|
|
665
|
+
*/
|
|
666
|
+
export declare const LinkSizeStyles: {
|
|
667
|
+
sm: RuleSet<object>;
|
|
668
|
+
md: RuleSet<object>;
|
|
669
|
+
lg: RuleSet<object>;
|
|
670
|
+
};
|
|
671
|
+
|
|
621
672
|
/**
|
|
622
673
|
* Defines the available visual variants for the Link component.
|
|
623
674
|
*/
|
|
624
675
|
export declare type LinkVariant = 'underlined' | 'plain';
|
|
625
676
|
|
|
677
|
+
/**
|
|
678
|
+
* CSS styles for each Link variant.
|
|
679
|
+
*/
|
|
680
|
+
export declare const LinkVariantStyles: {
|
|
681
|
+
underlined: RuleSet<object>;
|
|
682
|
+
plain: RuleSet<object>;
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* Button to open sidebar on mobile devices.
|
|
687
|
+
* @param $hidden - Whether the button is hidden.
|
|
688
|
+
*/
|
|
689
|
+
export declare const MobileOpenBtn: IStyledComponentBase<"web", Substitute<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
690
|
+
$hidden: boolean;
|
|
691
|
+
}>> & string;
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* Navigation container for sidebar menu items.
|
|
695
|
+
*/
|
|
696
|
+
export declare const Nav: IStyledComponentBase<"web", FastOmit<DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
697
|
+
|
|
626
698
|
/**
|
|
627
699
|
* Represents a navigation item used in the sidebar navigation component.
|
|
628
700
|
*
|
|
@@ -665,6 +737,11 @@ export declare const normalizeSelectOptions: (options: Array<{
|
|
|
665
737
|
label: string;
|
|
666
738
|
}> | SelectOption[]) => SelectOption[];
|
|
667
739
|
|
|
740
|
+
/**
|
|
741
|
+
* Overlay component for mobile sidebar.
|
|
742
|
+
*/
|
|
743
|
+
export declare const Overlay: IStyledComponentBase<"web", FastOmit<Omit<HTMLMotionProps<"div">, "ref"> & RefAttributes<HTMLDivElement>, never>> & string & Omit<ForwardRefComponent<HTMLDivElement, HTMLMotionProps<"div">>, keyof Component<any, {}, any>>;
|
|
744
|
+
|
|
668
745
|
/**
|
|
669
746
|
* Animation for overlay/backdrop elements.
|
|
670
747
|
* Provides a simple fade animation for modal backdrops.
|
|
@@ -815,6 +892,8 @@ export declare type SetDigits = default_2.Dispatch<default_2.SetStateAction<stri
|
|
|
815
892
|
*/
|
|
816
893
|
export declare const Sidebar: default_2.FC<SidebarProps>;
|
|
817
894
|
|
|
895
|
+
export declare const SidebarContext: Context<SidebarContextValue | undefined>;
|
|
896
|
+
|
|
818
897
|
/**
|
|
819
898
|
* Context value for managing the sidebar state.
|
|
820
899
|
* @property isCollapsed - Boolean indicating whether the sidebar is collapsed.
|
|
@@ -829,6 +908,14 @@ export declare interface SidebarContextValue {
|
|
|
829
908
|
setIsMobileOpen: (v: boolean) => void;
|
|
830
909
|
}
|
|
831
910
|
|
|
911
|
+
/**
|
|
912
|
+
* Sidebar header container.
|
|
913
|
+
* @param $collapsed - Whether the sidebar is collapsed.
|
|
914
|
+
*/
|
|
915
|
+
export declare const SidebarHeader: IStyledComponentBase<"web", Substitute<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
916
|
+
$collapsed: boolean;
|
|
917
|
+
}>> & string;
|
|
918
|
+
|
|
832
919
|
/**
|
|
833
920
|
* Props for the Sidebar component.
|
|
834
921
|
*
|
|
@@ -845,8 +932,11 @@ export declare interface SidebarProps {
|
|
|
845
932
|
activePath?: string;
|
|
846
933
|
logoImgExpanded?: default_2.ReactNode;
|
|
847
934
|
logoImgCollapsed?: default_2.ReactNode;
|
|
935
|
+
onNavigate?: (href: string) => void;
|
|
848
936
|
}
|
|
849
937
|
|
|
938
|
+
export declare const SidebarProvider: ({ children }: PropsWithChildren) => JSX.Element;
|
|
939
|
+
|
|
850
940
|
declare type Size = 'sm' | 'md' | 'lg' | 'xl';
|
|
851
941
|
|
|
852
942
|
export declare const sizeStyles: {
|
|
@@ -935,7 +1025,7 @@ export declare const slideAnimation: {
|
|
|
935
1025
|
|
|
936
1026
|
/**
|
|
937
1027
|
* Smart animation configuration for consistent motion across the design system.
|
|
938
|
-
* Provides default animation properties for
|
|
1028
|
+
* Provides default animation properties for motion/react components.
|
|
939
1029
|
*
|
|
940
1030
|
* Features:
|
|
941
1031
|
* - Consistent transition timing and easing
|
|
@@ -1205,7 +1295,7 @@ export declare interface User {
|
|
|
1205
1295
|
declare interface UserMenuItem {
|
|
1206
1296
|
id: string;
|
|
1207
1297
|
label: string;
|
|
1208
|
-
icon:
|
|
1298
|
+
icon: React.ReactNode | RemixiconComponentType;
|
|
1209
1299
|
onClick: () => void;
|
|
1210
1300
|
variant?: 'default' | 'danger';
|
|
1211
1301
|
}
|