tcce-design-system 0.1.13 → 0.1.14
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>, {
|
|
@@ -590,6 +626,11 @@ export declare interface LayoutProps extends SidebarProps {
|
|
|
590
626
|
*/
|
|
591
627
|
export declare const Link: default_2.ForwardRefExoticComponent<LinkProps & default_2.RefAttributes<HTMLAnchorElement>>;
|
|
592
628
|
|
|
629
|
+
/**
|
|
630
|
+
* CSS styles applied when the Link is disabled.
|
|
631
|
+
*/
|
|
632
|
+
export declare const LinkDisabledStyles: RuleSet<object>;
|
|
633
|
+
|
|
593
634
|
/**
|
|
594
635
|
* Props for the Link component.
|
|
595
636
|
* Extends standard anchor attributes and WithIconsProps.
|
|
@@ -618,11 +659,41 @@ export declare interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElemen
|
|
|
618
659
|
*/
|
|
619
660
|
export declare type LinkSize = 'sm' | 'md' | 'lg';
|
|
620
661
|
|
|
662
|
+
/**
|
|
663
|
+
* CSS styles for each Link size.
|
|
664
|
+
*/
|
|
665
|
+
export declare const LinkSizeStyles: {
|
|
666
|
+
sm: RuleSet<object>;
|
|
667
|
+
md: RuleSet<object>;
|
|
668
|
+
lg: RuleSet<object>;
|
|
669
|
+
};
|
|
670
|
+
|
|
621
671
|
/**
|
|
622
672
|
* Defines the available visual variants for the Link component.
|
|
623
673
|
*/
|
|
624
674
|
export declare type LinkVariant = 'underlined' | 'plain';
|
|
625
675
|
|
|
676
|
+
/**
|
|
677
|
+
* CSS styles for each Link variant.
|
|
678
|
+
*/
|
|
679
|
+
export declare const LinkVariantStyles: {
|
|
680
|
+
underlined: RuleSet<object>;
|
|
681
|
+
plain: RuleSet<object>;
|
|
682
|
+
};
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Button to open sidebar on mobile devices.
|
|
686
|
+
* @param $hidden - Whether the button is hidden.
|
|
687
|
+
*/
|
|
688
|
+
export declare const MobileOpenBtn: IStyledComponentBase<"web", Substitute<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
689
|
+
$hidden: boolean;
|
|
690
|
+
}>> & string;
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Navigation container for sidebar menu items.
|
|
694
|
+
*/
|
|
695
|
+
export declare const Nav: IStyledComponentBase<"web", FastOmit<DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
696
|
+
|
|
626
697
|
/**
|
|
627
698
|
* Represents a navigation item used in the sidebar navigation component.
|
|
628
699
|
*
|
|
@@ -665,6 +736,11 @@ export declare const normalizeSelectOptions: (options: Array<{
|
|
|
665
736
|
label: string;
|
|
666
737
|
}> | SelectOption[]) => SelectOption[];
|
|
667
738
|
|
|
739
|
+
/**
|
|
740
|
+
* Overlay component for mobile sidebar.
|
|
741
|
+
*/
|
|
742
|
+
export declare const Overlay: IStyledComponentBase<"web", FastOmit<Omit<HTMLMotionProps<"div">, "ref"> & RefAttributes<HTMLDivElement>, never>> & string & Omit<ForwardRefComponent<HTMLDivElement, HTMLMotionProps<"div">>, keyof Component<any, {}, any>>;
|
|
743
|
+
|
|
668
744
|
/**
|
|
669
745
|
* Animation for overlay/backdrop elements.
|
|
670
746
|
* Provides a simple fade animation for modal backdrops.
|
|
@@ -815,6 +891,8 @@ export declare type SetDigits = default_2.Dispatch<default_2.SetStateAction<stri
|
|
|
815
891
|
*/
|
|
816
892
|
export declare const Sidebar: default_2.FC<SidebarProps>;
|
|
817
893
|
|
|
894
|
+
export declare const SidebarContext: Context<SidebarContextValue | undefined>;
|
|
895
|
+
|
|
818
896
|
/**
|
|
819
897
|
* Context value for managing the sidebar state.
|
|
820
898
|
* @property isCollapsed - Boolean indicating whether the sidebar is collapsed.
|
|
@@ -829,6 +907,14 @@ export declare interface SidebarContextValue {
|
|
|
829
907
|
setIsMobileOpen: (v: boolean) => void;
|
|
830
908
|
}
|
|
831
909
|
|
|
910
|
+
/**
|
|
911
|
+
* Sidebar header container.
|
|
912
|
+
* @param $collapsed - Whether the sidebar is collapsed.
|
|
913
|
+
*/
|
|
914
|
+
export declare const SidebarHeader: IStyledComponentBase<"web", Substitute<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
915
|
+
$collapsed: boolean;
|
|
916
|
+
}>> & string;
|
|
917
|
+
|
|
832
918
|
/**
|
|
833
919
|
* Props for the Sidebar component.
|
|
834
920
|
*
|
|
@@ -847,6 +933,8 @@ export declare interface SidebarProps {
|
|
|
847
933
|
logoImgCollapsed?: default_2.ReactNode;
|
|
848
934
|
}
|
|
849
935
|
|
|
936
|
+
export declare const SidebarProvider: ({ children }: PropsWithChildren) => JSX.Element;
|
|
937
|
+
|
|
850
938
|
declare type Size = 'sm' | 'md' | 'lg' | 'xl';
|
|
851
939
|
|
|
852
940
|
export declare const sizeStyles: {
|
|
@@ -1205,7 +1293,7 @@ export declare interface User {
|
|
|
1205
1293
|
declare interface UserMenuItem {
|
|
1206
1294
|
id: string;
|
|
1207
1295
|
label: string;
|
|
1208
|
-
icon:
|
|
1296
|
+
icon: React.ReactNode | RemixiconComponentType;
|
|
1209
1297
|
onClick: () => void;
|
|
1210
1298
|
variant?: 'default' | 'danger';
|
|
1211
1299
|
}
|