sixseconds-modules 2.0.3 → 3.0.3
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/components/common/Avatar.d.ts +10 -0
- package/dist/components/common/Badge.d.ts +9 -0
- package/dist/components/common/Btn.d.ts +10 -0
- package/dist/components/common/Dialog.d.ts +17 -0
- package/dist/components/common/Dropdown.d.ts +10 -0
- package/dist/components/common/IconBtn.d.ts +7 -0
- package/dist/components/common/Input.d.ts +9 -0
- package/dist/components/common/icons.d.ts +7 -0
- package/dist/components/common/index.d.ts +8 -0
- package/dist/components/dialogs/{changePasswrod.d.ts → ChangePasswordDialog.d.ts} +2 -2
- package/dist/components/dialogs/{dangerDialog.d.ts → DangerDialog.d.ts} +1 -1
- package/dist/components/dialogs/{viewProfile.d.ts → ViewProfileDialog.d.ts} +2 -2
- package/dist/components/dialogs/index.d.ts +3 -2
- package/dist/components/elements/BackArrow.d.ts +8 -0
- package/dist/components/elements/FormikErrorMsg.d.ts +6 -0
- package/dist/components/elements/Warning.d.ts +6 -0
- package/dist/components/elements/index.d.ts +3 -4
- package/dist/components/features/PreviousLoginBanner.d.ts +9 -0
- package/dist/components/features/index.d.ts +1 -1
- package/dist/components/header/AppMenus.d.ts +17 -0
- package/dist/components/header/Header.d.ts +8 -0
- package/dist/components/header/Language.d.ts +11 -0
- package/dist/components/header/Logo.d.ts +6 -0
- package/dist/components/header/MainMenu.d.ts +8 -0
- package/dist/components/header/Notification.d.ts +12 -0
- package/dist/components/header/UserProfile.d.ts +11 -0
- package/dist/components/header/index.d.ts +3 -13
- package/dist/components/header/types.d.ts +82 -0
- package/dist/components/index.d.ts +5 -5
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useClickAway.d.ts +7 -0
- package/dist/hooks/useMediaQuery.d.ts +3 -0
- package/dist/index.cjs.js +913 -15033
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.es.js +908 -15028
- package/dist/index.es.js.map +1 -1
- package/dist/main.d.ts +0 -1
- package/package.json +20 -26
- package/README.md +0 -1
- package/dist/components/buttons/button.d.ts +0 -12
- package/dist/components/buttons/buttonStyled.d.ts +0 -2
- package/dist/components/buttons/index.d.ts +0 -1
- package/dist/components/change-password/changePasswordStyled.d.ts +0 -2
- package/dist/components/change-password/index.d.ts +0 -8
- package/dist/components/dialogs/styles.d.ts +0 -3
- package/dist/components/elements/backArrow.d.ts +0 -7
- package/dist/components/elements/formikMsg.d.ts +0 -6
- package/dist/components/elements/logo.d.ts +0 -6
- package/dist/components/elements/warning.d.ts +0 -5
- package/dist/components/features/previousLoginBanner.d.ts +0 -8
- package/dist/components/header/appMenus.d.ts +0 -12
- package/dist/components/header/dropDownMenu.d.ts +0 -9
- package/dist/components/header/language.d.ts +0 -13
- package/dist/components/header/notification.d.ts +0 -10
- package/dist/components/header/subheaderStyled.d.ts +0 -2
- package/dist/components/header/type.d.ts +0 -93
- package/dist/components/header/userProfile.d.ts +0 -12
- package/dist/components/inputFields/index.d.ts +0 -1
- package/dist/components/inputFields/labeledInput.d.ts +0 -17
- package/dist/providers/index.d.ts +0 -2
- package/dist/providers/mui.d.ts +0 -6
- package/dist/providers/shadowIsland.d.ts +0 -19
- package/dist/styles.css +0 -461
- package/dist/vite.svg +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
src?: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/** Circular avatar; renders the image when `src` is set, otherwise `children` (initials). */
|
|
9
|
+
export declare function Avatar({ src, alt, className, children }: Props): import("react").JSX.Element;
|
|
10
|
+
export default Avatar;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
count?: number;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
/** Notification-style count badge on the top-right of its child. */
|
|
8
|
+
export declare function Badge({ count, children, className }: Props): import("react").JSX.Element;
|
|
9
|
+
export default Badge;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
type Variant = "primary" | "outline" | "danger" | "ghost";
|
|
3
|
+
interface Props extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
variant?: Variant;
|
|
5
|
+
btnTitle?: ReactNode;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
block?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function Btn({ variant, btnTitle, isLoading, block, disabled, className, children, type, ...rest }: Props): import("react").JSX.Element;
|
|
10
|
+
export default Btn;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type Size = "xs" | "sm" | "md";
|
|
3
|
+
interface Props {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
size?: Size;
|
|
7
|
+
showClose?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Raw modal dialog. Renders in-tree (no portal), a fixed full-screen overlay.
|
|
13
|
+
* The overlay carries `ssh-scope` so content is style-isolated even if the
|
|
14
|
+
* dialog is used on its own. Clicking the backdrop closes it.
|
|
15
|
+
*/
|
|
16
|
+
export declare function Dialog({ open, onClose, size, showClose, className, children }: Props): import("react").JSX.Element | null;
|
|
17
|
+
export default Dialog;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: CSSProperties;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/** Absolutely-positioned dropdown panel that closes on outside click. */
|
|
9
|
+
export declare function Dropdown({ onClose, className, style, children }: Props): import("react").JSX.Element;
|
|
10
|
+
export default Dropdown;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
interface Props extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
/** Borderless icon trigger (grid/bell/language/avatar buttons in the header). */
|
|
6
|
+
export declare function IconBtn({ className, children, type, ...rest }: Props): import("react").JSX.Element;
|
|
7
|
+
export default IconBtn;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
interface Props extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
3
|
+
label?: ReactNode;
|
|
4
|
+
required?: boolean;
|
|
5
|
+
wrapClassName?: string;
|
|
6
|
+
}
|
|
7
|
+
/** Labeled text/password input. Spreads Formik's getFieldProps (name/value/onChange/onBlur). */
|
|
8
|
+
export declare function LabeledInput({ label, required, type, wrapClassName, className, ...rest }: Props): import("react").JSX.Element;
|
|
9
|
+
export default LabeledInput;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
export declare const MenuIcon: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
3
|
+
export declare const CloseIcon: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
4
|
+
export declare const CheckIcon: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
5
|
+
export declare const CaretDownIcon: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
6
|
+
export declare const EyeOffIcon: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
7
|
+
export declare const ExitIcon: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Btn } from './Btn';
|
|
2
|
+
export { IconBtn } from './IconBtn';
|
|
3
|
+
export { Avatar } from './Avatar';
|
|
4
|
+
export { Badge } from './Badge';
|
|
5
|
+
export { LabeledInput } from './Input';
|
|
6
|
+
export { Dropdown } from './Dropdown';
|
|
7
|
+
export { Dialog } from './Dialog';
|
|
8
|
+
export * from './icons';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SetStateAction, t } from '../../types';
|
|
2
|
-
import { IState } from '../header/
|
|
2
|
+
import { IState } from '../header/types';
|
|
3
3
|
interface IProps {
|
|
4
4
|
email: string;
|
|
5
5
|
t: t;
|
|
6
6
|
setInitialState: SetStateAction<IState>;
|
|
7
7
|
isOpen: boolean;
|
|
8
8
|
}
|
|
9
|
-
export default function ChangePasswordDialog({ isOpen, email, t, setInitialState }: IProps): import("react
|
|
9
|
+
export default function ChangePasswordDialog({ isOpen, email, t, setInitialState }: IProps): import("react").JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -7,5 +7,5 @@ interface IProps {
|
|
|
7
7
|
handleClick: () => void;
|
|
8
8
|
isLoading?: boolean;
|
|
9
9
|
}
|
|
10
|
-
declare
|
|
10
|
+
declare function DangerDialog({ open, setInitialState, title, description, buttonTitle, isLoading, handleClick, }: IProps): import("react").JSX.Element;
|
|
11
11
|
export default DangerDialog;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SetStateAction } from '../../types';
|
|
2
|
-
import { IState, IUserDataProps } from '../header/
|
|
2
|
+
import { IState, IUserDataProps } from '../header/types';
|
|
3
3
|
interface IProps {
|
|
4
4
|
userData?: IUserDataProps;
|
|
5
5
|
setInitialState: SetStateAction<IState>;
|
|
6
6
|
isOpen: boolean;
|
|
7
7
|
}
|
|
8
|
-
export default function ViewProfileDialog({ userData, setInitialState, isOpen }: IProps): import("react
|
|
8
|
+
export default function ViewProfileDialog({ userData, setInitialState, isOpen }: IProps): import("react").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { default as DangerDialog } from './
|
|
2
|
-
export { default as ViewProfileDialog } from './
|
|
1
|
+
export { default as DangerDialog } from './DangerDialog';
|
|
2
|
+
export { default as ViewProfileDialog } from './ViewProfileDialog';
|
|
3
|
+
export { default as ChangePasswordDialog } from './ChangePasswordDialog';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { default as BackArrow } from './
|
|
2
|
-
export { default as Warning } from './
|
|
3
|
-
export { default as FormikErrorMsg } from './
|
|
4
|
-
export { default as Logo } from './logo';
|
|
1
|
+
export { default as BackArrow } from './BackArrow';
|
|
2
|
+
export { default as Warning } from './Warning';
|
|
3
|
+
export { default as FormikErrorMsg } from './FormikErrorMsg';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { t } from '../../types';
|
|
3
|
+
interface IProps {
|
|
4
|
+
t: t;
|
|
5
|
+
router?: any;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
}
|
|
8
|
+
export declare function PreviousLoginBanner({ t, router, style }: IProps): import("react").JSX.Element | null;
|
|
9
|
+
export default PreviousLoginBanner;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { PreviousLoginBanner } from './PreviousLoginBanner';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SetStateAction, t } from '../../types';
|
|
2
|
+
import { IState } from './types';
|
|
3
|
+
interface Props {
|
|
4
|
+
menuItems?: {
|
|
5
|
+
name: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
link: string;
|
|
8
|
+
type: "tab" | "app";
|
|
9
|
+
}[];
|
|
10
|
+
setInitialState: SetStateAction<IState>;
|
|
11
|
+
t: t;
|
|
12
|
+
appName: string;
|
|
13
|
+
router: any;
|
|
14
|
+
}
|
|
15
|
+
/** Grid of cross-app shortcuts (the "waffle" menu). */
|
|
16
|
+
declare function AppMenus({ menuItems, setInitialState, t, appName, router }: Props): import("react").JSX.Element;
|
|
17
|
+
export default AppMenus;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IHeaderProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* SixSeconds common Header — raw HTML + namespaced CSS (no MUI). Every rendered
|
|
4
|
+
* node lives under `.ssh-scope`, so the host application's styles can neither
|
|
5
|
+
* bleed in nor be overridden.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Header({ router, frontCustomComponent, endCustomComponents, totallyEndCustomComponent, userData, interFaceLangList, centerCustomComponents, updateInterfaceLang, selectedInterFaceLang, logoutHandler, logo, isNotification, extraMenuOptions, isMenu, isAccessAppMenu, notificationAccessApps, style, className, isMainLogo, isLang, handleSideToggle, t, }: IHeaderProps): import("react").JSX.Element;
|
|
8
|
+
export default Header;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SetStateAction, t } from '../../types';
|
|
2
|
+
import { IInterFaceLang, IState } from './types';
|
|
3
|
+
interface Props {
|
|
4
|
+
interFaceLangList?: IInterFaceLang[];
|
|
5
|
+
updateInterfaceLang?: any;
|
|
6
|
+
selectedInterFaceLang?: IInterFaceLang;
|
|
7
|
+
setInitialState: SetStateAction<IState>;
|
|
8
|
+
t: t;
|
|
9
|
+
}
|
|
10
|
+
declare function Language({ interFaceLangList, updateInterfaceLang, selectedInterFaceLang, setInitialState, t }: Props): import("react").JSX.Element;
|
|
11
|
+
export default Language;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IState } from './types';
|
|
2
|
+
interface IProps {
|
|
3
|
+
headerMenuArray: any[];
|
|
4
|
+
initialState: IState;
|
|
5
|
+
}
|
|
6
|
+
/** Desktop horizontal nav with hover submenus; collapses to a mobile list. */
|
|
7
|
+
declare function MainMenu({ headerMenuArray, initialState }: IProps): import("react").JSX.Element | null;
|
|
8
|
+
export default MainMenu;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SetStateAction, t } from '../../types';
|
|
2
|
+
import { IState } from './types';
|
|
3
|
+
interface Props {
|
|
4
|
+
setInitialState: SetStateAction<IState>;
|
|
5
|
+
initialState: IState;
|
|
6
|
+
notificationAccessApps?: {
|
|
7
|
+
name: string;
|
|
8
|
+
}[];
|
|
9
|
+
t: t;
|
|
10
|
+
}
|
|
11
|
+
declare function Notification({ setInitialState, notificationAccessApps, initialState, t }: Props): import("react").JSX.Element;
|
|
12
|
+
export default Notification;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SetStateAction, t } from '../../types';
|
|
2
|
+
import { IState, IUserDataProps } from './types';
|
|
3
|
+
interface Props {
|
|
4
|
+
userData?: IUserDataProps;
|
|
5
|
+
setInitialState: SetStateAction<IState>;
|
|
6
|
+
extraMenuOptions?: any;
|
|
7
|
+
t: t;
|
|
8
|
+
router?: any;
|
|
9
|
+
}
|
|
10
|
+
declare function UserProfile({ t, userData, setInitialState, extraMenuOptions, router }: Props): import("react").JSX.Element;
|
|
11
|
+
export default UserProfile;
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* Wraps HeaderInner in a Shadow DOM boundary (`ShadowIsland`) so that:
|
|
6
|
-
* 1. The host application's CSS physically cannot cross into the header — it
|
|
7
|
-
* always renders with only its own styling, in every app it is embedded in.
|
|
8
|
-
* 2. The header's own styles (Emotion + stylesheet) stay inside the shadow root
|
|
9
|
-
* and never leak out into the host document.
|
|
10
|
-
* 3. MUI overlays (dialogs, tooltips) are portalled back into the shadow root,
|
|
11
|
-
* so they are isolated too.
|
|
12
|
-
*/
|
|
13
|
-
export declare const Header: (props: IHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export { Header } from './Header';
|
|
2
|
+
export { default as Logo } from './Logo';
|
|
3
|
+
export type { IHeaderProps, IUserDataProps, IInterFaceLang, IState } from './types';
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { APP_NAMES } from '../../constants';
|
|
3
|
+
import { t } from '../../types';
|
|
4
|
+
export interface IState {
|
|
5
|
+
languages: string[];
|
|
6
|
+
menuData: never[];
|
|
7
|
+
isMenuIconsShow: boolean;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
toggles: {
|
|
10
|
+
appMenus: boolean;
|
|
11
|
+
notification: boolean;
|
|
12
|
+
logout: boolean;
|
|
13
|
+
lang: boolean;
|
|
14
|
+
dropDownMenu: boolean;
|
|
15
|
+
changePassword: boolean;
|
|
16
|
+
viewProfile: boolean;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface IUserDataProps {
|
|
20
|
+
userprofile: string;
|
|
21
|
+
certId: string | number;
|
|
22
|
+
email: string;
|
|
23
|
+
role: string;
|
|
24
|
+
fullName: string;
|
|
25
|
+
appName: (typeof APP_NAMES)[keyof typeof APP_NAMES];
|
|
26
|
+
appAccess?: {
|
|
27
|
+
name: string;
|
|
28
|
+
icon: string;
|
|
29
|
+
link: string;
|
|
30
|
+
type: "tab" | "app";
|
|
31
|
+
}[];
|
|
32
|
+
bio: string;
|
|
33
|
+
title: string;
|
|
34
|
+
company: string;
|
|
35
|
+
certBio: string;
|
|
36
|
+
certProfileUrl: string;
|
|
37
|
+
certOfferToHelp: string;
|
|
38
|
+
certification: string[];
|
|
39
|
+
country: string;
|
|
40
|
+
languages: string[];
|
|
41
|
+
areaOfWork: string[];
|
|
42
|
+
linkedInUrl: string;
|
|
43
|
+
notificationCount: number;
|
|
44
|
+
}
|
|
45
|
+
export interface IInterFaceLang {
|
|
46
|
+
id: number;
|
|
47
|
+
label: string;
|
|
48
|
+
value: string | number;
|
|
49
|
+
flag: string;
|
|
50
|
+
}
|
|
51
|
+
export interface IHeaderProps {
|
|
52
|
+
t: t;
|
|
53
|
+
router?: any;
|
|
54
|
+
notificationAccessApps?: {
|
|
55
|
+
name: string;
|
|
56
|
+
}[];
|
|
57
|
+
userData?: IUserDataProps;
|
|
58
|
+
interFaceLangList?: IInterFaceLang[];
|
|
59
|
+
updateInterfaceLang?: any;
|
|
60
|
+
logoutHandler?: any;
|
|
61
|
+
selectedInterFaceLang?: IInterFaceLang;
|
|
62
|
+
isNotification?: boolean;
|
|
63
|
+
isMenu?: boolean;
|
|
64
|
+
isAccessAppMenu?: boolean;
|
|
65
|
+
extraMenuOptions?: {
|
|
66
|
+
components: ReactNode;
|
|
67
|
+
isViewProfile: boolean;
|
|
68
|
+
isChangePassword: boolean;
|
|
69
|
+
isEditProfile: boolean;
|
|
70
|
+
};
|
|
71
|
+
/** Inline style applied to the fixed header bar (replaces the old MUI `sx`). */
|
|
72
|
+
style?: CSSProperties;
|
|
73
|
+
className?: string;
|
|
74
|
+
logo?: ReactNode;
|
|
75
|
+
frontCustomComponent?: ReactNode;
|
|
76
|
+
centerCustomComponents?: ReactNode;
|
|
77
|
+
endCustomComponents?: ReactNode;
|
|
78
|
+
totallyEndCustomComponent?: ReactNode;
|
|
79
|
+
isMainLogo?: boolean;
|
|
80
|
+
isLang?: boolean;
|
|
81
|
+
handleSideToggle?: () => void;
|
|
82
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './header
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
1
|
+
export * from './common';
|
|
2
|
+
export * from './header';
|
|
3
|
+
export * from './elements';
|
|
4
|
+
export * from './features';
|
|
5
|
+
export * from './dialogs';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Raw replacement for MUI's ClickAwayListener. Calls `onAway` when a pointer
|
|
4
|
+
* event occurs outside `ref`. Only active while `active` is true.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useClickAway<T extends HTMLElement>(ref: RefObject<T | null>, onAway: () => void, active?: boolean): void;
|
|
7
|
+
export default useClickAway;
|