@fattureincloud/fic-design-system 0.4.28 → 0.4.30
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +38 -0
- package/dist/components/badge/Badge.d.ts +11 -1
- package/dist/components/badge/badge.stories.d.ts +3 -2
- package/dist/components/badge/badgePalette.d.ts +3 -0
- package/dist/components/badge/index.d.ts +3 -3
- package/dist/components/badge/types.d.ts +17 -1
- package/dist/components/banner/Banner.d.ts +10 -9
- package/dist/components/banner/banner.stories.d.ts +3 -4
- package/dist/components/banner/bannerPalette.d.ts +3 -0
- package/dist/components/banner/index.d.ts +3 -2
- package/dist/components/banner/styled.d.ts +5 -0
- package/dist/components/banner/types.d.ts +23 -0
- package/dist/components/chip/Chip.d.ts +13 -0
- package/dist/components/chip/chip.stories.d.ts +6 -0
- package/dist/components/chip/chipPalette.d.ts +3 -0
- package/dist/components/chip/index.d.ts +3 -0
- package/dist/components/chip/styled.d.ts +6 -0
- package/dist/components/chip/types.d.ts +25 -0
- package/dist/components/chips/chips.d.ts +2 -6
- package/dist/components/chips/index.d.ts +2 -2
- package/dist/components/chips/styled.d.ts +3 -0
- package/dist/components/floatingBadge/NotificationBadge.d.ts +9 -0
- package/dist/components/floatingBadge/floatingBadge.d.ts +7 -1
- package/dist/components/floatingBadge/floatingBadge.stories.d.ts +2 -1
- package/dist/components/floatingBadge/floatingBadgePalette.d.ts +3 -0
- package/dist/components/floatingBadge/index.d.ts +4 -2
- package/dist/components/floatingBadge/types.d.ts +24 -3
- package/dist/components/floatingBadge/withBadge.d.ts +5 -0
- package/dist/components/form/label/Label.d.ts +9 -8
- package/dist/components/form/label/index.d.ts +3 -2
- package/dist/components/form/label/labelPalette.d.ts +3 -0
- package/dist/components/form/label/styled.d.ts +2 -0
- package/dist/components/form/label/types.d.ts +21 -0
- package/dist/components/form/label/utils.d.ts +9 -0
- package/dist/components/layout/index.d.ts +1 -2
- package/dist/components/layout/sidebarItem/SidebarItem.d.ts +19 -26
- package/dist/components/layout/sidebarItem/components/SidebarItemDropdown.d.ts +2 -7
- package/dist/components/layout/sidebarItem/index.d.ts +5 -5
- package/dist/components/layout/sidebarItem/sidebarItem.stories.d.ts +2 -1
- package/dist/components/layout/sidebarItem/sidebarItemPalette.d.ts +1 -12
- package/dist/components/layout/sidebarItem/styled.d.ts +13 -0
- package/dist/components/layout/sidebarItem/types.d.ts +58 -2
- package/dist/components/layout/sidebarItem/utils.d.ts +2 -2
- package/dist/components/pagination/Pagination.d.ts +16 -0
- package/dist/components/pagination/index.d.ts +3 -3
- package/dist/components/pagination/pagination.stories.d.ts +2 -1
- package/dist/components/pagination/paginationPalette.d.ts +3 -0
- package/dist/components/pagination/styled.d.ts +5 -0
- package/dist/components/pagination/types.d.ts +15 -0
- package/dist/components/progressbar/index.d.ts +3 -2
- package/dist/components/progressbar/progressBarPalette.d.ts +3 -0
- package/dist/components/progressbar/progressbar.d.ts +9 -8
- package/dist/components/progressbar/progressbar.stories.d.ts +6 -4
- package/dist/components/progressbar/styled.d.ts +3 -0
- package/dist/components/progressbar/types.d.ts +15 -9
- package/dist/components/table/Table.d.ts +3 -1
- package/dist/components/table/hooks/useTableHooks.d.ts +2 -2
- package/dist/components/tabs/common/Item.d.ts +1 -1
- package/dist/components/tabs/common/types.d.ts +3 -0
- package/dist/components/tip/index.d.ts +4 -3
- package/dist/components/tip/shortcutTip.d.ts +12 -1
- package/dist/components/tip/styled.d.ts +5 -0
- package/dist/components/tip/tip.d.ts +11 -1
- package/dist/components/tip/tip.stories.d.ts +4 -5
- package/dist/components/tip/tipPalette.d.ts +3 -0
- package/dist/components/tip/types.d.ts +24 -6
- package/dist/index.d.ts +10 -10
- package/dist/index.esm.js +5 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/styles/theme.d.ts +16 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,43 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v0.4.30 - 29/09/2022
|
4
|
+
|
5
|
+
### 🚀 Added
|
6
|
+
|
7
|
+
- Tabs badge
|
8
|
+
- Table actionsHeader
|
9
|
+
|
10
|
+
### 🐛 Bug Fix
|
11
|
+
|
12
|
+
- Table text selection restored
|
13
|
+
|
14
|
+
## v0.4.29 - 14/09/2022
|
15
|
+
|
16
|
+
### 💥 Breaking
|
17
|
+
|
18
|
+
- Progressbar renamed ProgressBar
|
19
|
+
|
20
|
+
### 🚀 Added
|
21
|
+
|
22
|
+
- Chip leftIcon
|
23
|
+
- Badge palette
|
24
|
+
- Chip palette
|
25
|
+
- Tip palette
|
26
|
+
- FloatingBadgeType and FloatingBadge palette
|
27
|
+
- ProgressBar palette
|
28
|
+
- Banner palette
|
29
|
+
- NotificationBadge
|
30
|
+
|
31
|
+
### 🐛 Bug Fix
|
32
|
+
|
33
|
+
- Label mandatory icon space fix
|
34
|
+
- SidebarItem fix
|
35
|
+
|
36
|
+
### 💅 Enhancement
|
37
|
+
|
38
|
+
- Chip refactor
|
39
|
+
- Pagination refactor
|
40
|
+
|
3
41
|
## v0.4.28 - 13/09/2022
|
4
42
|
|
5
43
|
### 🐛 Bug Fix
|
@@ -1,3 +1,13 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { BadgeProps } from './
|
2
|
+
import { BadgeProps } from './';
|
3
|
+
/**
|
4
|
+
* Component Props:
|
5
|
+
* @param {ReactText} text Component main content
|
6
|
+
* @param {BadgeType} type Used to set the badge variant (standard, error, info, warning, success)
|
7
|
+
* @param {string} className Used to apply custom classes
|
8
|
+
* @param {string} imageUrl Avatar image
|
9
|
+
* @param {IconProps} leftIcon Configuration of the left icon
|
10
|
+
* @param {IconProps} rightIcon Configuration of the right icon
|
11
|
+
* @param {function} handleRightIconClick Callback called on right icon click
|
12
|
+
*/
|
3
13
|
export declare const Badge: (props: BadgeProps) => JSX.Element;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { Meta } from '@storybook/react';
|
3
|
-
import { BadgeProps } from './
|
2
|
+
import { Meta, Story } from '@storybook/react';
|
3
|
+
import { BadgeProps } from './';
|
4
|
+
export declare const Template: Story<BadgeProps>;
|
4
5
|
export declare const Normal: () => JSX.Element;
|
5
6
|
export declare const Advanced: () => JSX.Element;
|
6
7
|
declare const BadgeStories: Meta<BadgeProps>;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
export {
|
1
|
+
export { Badge } from './Badge';
|
2
|
+
export { default as badgePalette } from './badgePalette';
|
3
|
+
export { BadgeProps, BadgePalette, BadgeType } from './types';
|
@@ -1,10 +1,26 @@
|
|
1
1
|
import { ReactText } from 'react';
|
2
|
+
import { paletteColor } from '../..';
|
2
3
|
import { IconProps } from '../icon';
|
3
4
|
export interface BadgeProps {
|
4
5
|
text?: ReactText;
|
5
|
-
|
6
|
+
type?: BadgeType;
|
7
|
+
className?: string;
|
6
8
|
imageUrl?: string;
|
7
9
|
leftIcon?: IconProps;
|
8
10
|
rightIcon?: IconProps;
|
9
11
|
handleRightIconClick?: () => void;
|
10
12
|
}
|
13
|
+
export declare enum BadgeType {
|
14
|
+
STANDARD = "standard",
|
15
|
+
ERROR = "error",
|
16
|
+
INFO = "info",
|
17
|
+
WARNING = "warning",
|
18
|
+
SUCCESS = "success"
|
19
|
+
}
|
20
|
+
export declare type BadgeParams = 'color' | 'backgroundColor';
|
21
|
+
export declare type BadgeParts = {
|
22
|
+
[key in BadgeParams]: paletteColor;
|
23
|
+
};
|
24
|
+
export declare type BadgePalette = {
|
25
|
+
[key in BadgeType]: BadgeParts;
|
26
|
+
};
|
@@ -1,11 +1,12 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
}
|
10
|
-
|
2
|
+
import { BannerProps } from './types';
|
3
|
+
/**
|
4
|
+
* Component Props:
|
5
|
+
* @param {string} type Used to set style and colors of the component among those present in the palette
|
6
|
+
* @param {function} onClose Callback called on right icon click
|
7
|
+
* @param {string|JSX.Element} content Component main content
|
8
|
+
* @param {IconProps} icon Configuration of the left icon
|
9
|
+
* @param {string} className To support styled-components customization
|
10
|
+
*/
|
11
|
+
declare const Banner: ({ type, content, icon, onClose, className }: BannerProps) => JSX.Element;
|
11
12
|
export default Banner;
|
@@ -1,6 +1,5 @@
|
|
1
|
-
|
2
|
-
import {
|
3
|
-
|
4
|
-
export declare const WithKnobs: () => JSX.Element;
|
1
|
+
import { Meta, Story } from '@storybook/react';
|
2
|
+
import { BannerProps } from './types';
|
3
|
+
export declare const Template: Story<BannerProps>;
|
5
4
|
declare const BannerStories: Meta<BannerProps>;
|
6
5
|
export default BannerStories;
|
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
export {
|
1
|
+
export { default as Banner } from './Banner';
|
2
|
+
export { default as bannerPalette } from './bannerPalette';
|
3
|
+
export { BannerProps, BannerPalette, BannerType } from './types';
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { BannerProps } from './types';
|
2
|
+
export declare const BannerWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
3
|
+
type: BannerProps['type'];
|
4
|
+
}, never>;
|
5
|
+
export declare const BannerContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { paletteColor } from '../../styles/types';
|
3
|
+
import { IconProps } from '../icon';
|
4
|
+
export interface BannerProps {
|
5
|
+
type?: BannerType;
|
6
|
+
onClose?: () => void;
|
7
|
+
content: string | JSX.Element;
|
8
|
+
icon?: IconProps;
|
9
|
+
className?: string;
|
10
|
+
}
|
11
|
+
export declare enum BannerType {
|
12
|
+
STANDARD = "standard",
|
13
|
+
ERROR = "error",
|
14
|
+
INFO = "info",
|
15
|
+
WARNING = "warning",
|
16
|
+
SUCCESS = "success"
|
17
|
+
}
|
18
|
+
export declare type BannerPalette = {
|
19
|
+
[key in BannerType]: {
|
20
|
+
color: paletteColor;
|
21
|
+
backgroundColor: paletteColor;
|
22
|
+
};
|
23
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { ChipProps } from '.';
|
3
|
+
/**
|
4
|
+
* Component Props:
|
5
|
+
* @param {string|number} text Component main content
|
6
|
+
* @param {boolean} statusEdit Used to set chip edit status
|
7
|
+
* @param {string} className To support styled-components customization
|
8
|
+
* @param {ChipType} type Used to set style and colors of the component among those present in the palette
|
9
|
+
* @param {IconProps} leftIcon Configuration of the left icon
|
10
|
+
* @param {function} closeAction Callback called on right icon click
|
11
|
+
*/
|
12
|
+
declare const Chip: (props: ChipProps) => JSX.Element;
|
13
|
+
export default Chip;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { ChipProps } from './types';
|
3
|
+
export declare const LeftIcon: import("styled-components").StyledComponent<({ onClick, isDisabled, ...props }: import("../icon").IconProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
4
|
+
export declare const RightIcon: import("styled-components").StyledComponent<({ onClick, isDisabled, ...props }: import("../icon").IconProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
5
|
+
export declare const Text: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
6
|
+
export declare const ChipWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ChipProps, never>;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { paletteColor } from '../..';
|
2
|
+
import { IconProps } from '../icon';
|
3
|
+
export declare enum ChipType {
|
4
|
+
STANDARD = "standard",
|
5
|
+
ERROR = "error",
|
6
|
+
INFO = "info",
|
7
|
+
WARNING = "warning",
|
8
|
+
SUCCESS = "success"
|
9
|
+
}
|
10
|
+
export interface ChipProps {
|
11
|
+
text?: string | number;
|
12
|
+
statusEdit?: boolean;
|
13
|
+
className?: string;
|
14
|
+
type?: ChipType;
|
15
|
+
leftIcon?: IconProps;
|
16
|
+
closeAction?: () => void;
|
17
|
+
}
|
18
|
+
export declare type ChipPalette = {
|
19
|
+
[key in ChipType]: {
|
20
|
+
color: paletteColor;
|
21
|
+
backgroundColor: paletteColor;
|
22
|
+
hover: paletteColor;
|
23
|
+
active: paletteColor;
|
24
|
+
};
|
25
|
+
};
|
@@ -1,7 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
export declare class UnstyledChip extends Component<UnstyledChipProps, UnstyledChipState> {
|
4
|
-
render(): JSX.Element;
|
5
|
-
}
|
6
|
-
declare const Chip: TChip;
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare const Chip: (props: any) => JSX.Element;
|
7
3
|
export default Chip;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
export {
|
1
|
+
export { default as Chip } from './Chips';
|
2
|
+
export { ChipsProps } from './types';
|
@@ -0,0 +1,3 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
export declare const ChipWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, any, never>;
|
3
|
+
export declare const ChipIcon: import("styled-components").StyledComponent<({ onClick, isDisabled, ...props }: import("../icon").IconProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { NotificationBadgeProps } from './types';
|
2
|
+
/**
|
3
|
+
* Component Props:
|
4
|
+
* @param {'small' | 'medium' | 'large'} size Used to hide the floating badge
|
5
|
+
* @param {string} className Apply custom classes
|
6
|
+
* @param {FloatingBadgeType} type Used to pass and render children nodes
|
7
|
+
*/
|
8
|
+
declare const NotificationBadge: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, NotificationBadgeProps, never>;
|
9
|
+
export default NotificationBadge;
|
@@ -1,2 +1,8 @@
|
|
1
1
|
import { FloatingBadgeProps } from './types';
|
2
|
-
|
2
|
+
/**
|
3
|
+
* Component Props:
|
4
|
+
* @param {string | number} counter Count number
|
5
|
+
* @param {number} top Set top margin
|
6
|
+
* @param {number} right Set right margin
|
7
|
+
*/
|
8
|
+
export declare const FloatingBadge: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, import("./types").NotificationBadgeProps & FloatingBadgeProps, never>;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { Meta } from '@storybook/react';
|
2
|
+
import { Meta, Story } from '@storybook/react';
|
3
3
|
import { WithBadgeProps } from './types';
|
4
|
+
export declare const Template: Story<WithBadgeProps>;
|
4
5
|
export declare const Normal: () => JSX.Element;
|
5
6
|
export declare const WithKnobs: () => JSX.Element;
|
6
7
|
declare const WithBadgeStories: Meta<WithBadgeProps>;
|
@@ -1,2 +1,4 @@
|
|
1
|
-
|
2
|
-
export {
|
1
|
+
export { default as floatingBadgePalette } from './floatingBadgePalette';
|
2
|
+
export { default as NotificationBadge } from './NotificationBadge';
|
3
|
+
export { default as WithBadge } from './WithBadge';
|
4
|
+
export { FloatingBadgePalette, FloatingBadgeType } from './types';
|
@@ -1,12 +1,33 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
|
2
|
+
import { paletteColor } from '../..';
|
3
|
+
export interface FloatingBadgeProps extends NotificationBadgeProps {
|
3
4
|
counter?: string | number;
|
4
|
-
size?: 'small' | 'medium' | 'large';
|
5
5
|
top?: number;
|
6
6
|
right?: number;
|
7
|
-
className?: string;
|
8
7
|
}
|
9
8
|
export interface WithBadgeProps extends FloatingBadgeProps {
|
10
9
|
isDisabled?: boolean;
|
11
10
|
children: React.ReactNode;
|
12
11
|
}
|
12
|
+
export interface NotificationBadgeProps {
|
13
|
+
size?: 'small' | 'medium' | 'large';
|
14
|
+
className?: string;
|
15
|
+
type?: FloatingBadgeType;
|
16
|
+
}
|
17
|
+
export declare enum FloatingBadgeType {
|
18
|
+
STANDARD = "standard",
|
19
|
+
ERROR = "error",
|
20
|
+
INFO = "info",
|
21
|
+
WARNING = "warning",
|
22
|
+
SUCCESS = "success",
|
23
|
+
DISABLED = "disabled"
|
24
|
+
}
|
25
|
+
export declare type FloatingBadgeColors = {
|
26
|
+
[key in FloatingBadgeType]: {
|
27
|
+
color: paletteColor;
|
28
|
+
backgroundColor: paletteColor;
|
29
|
+
};
|
30
|
+
};
|
31
|
+
export declare type FloatingBadgePalette = FloatingBadgeColors & {
|
32
|
+
borderRadius: string | number;
|
33
|
+
};
|
@@ -1,4 +1,9 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { WithBadgeProps } from './types';
|
3
|
+
/**
|
4
|
+
* Component Props:
|
5
|
+
* @param {boolean} isDisabled Used to hide the floating badge
|
6
|
+
* @param {React.ReactNode} children Used to pass and render children nodes
|
7
|
+
*/
|
3
8
|
declare const WithBadge: (props: WithBadgeProps) => JSX.Element;
|
4
9
|
export default WithBadge;
|
@@ -1,10 +1,11 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
import { LabelProps } from './';
|
3
|
+
/**
|
4
|
+
* Component Props:
|
5
|
+
* @param {string | JSX.Element} label Label text content
|
6
|
+
* @param {LabelType | paletteColor} color Customize label color
|
7
|
+
* @param {boolean} disabled Used to hide the label
|
8
|
+
* @param {boolean} required Add asterisk and red color
|
9
|
+
*/
|
10
|
+
declare const Label: ({ label, disabled, required, color }: LabelProps) => JSX.Element | null;
|
10
11
|
export default Label;
|
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
export { LabelProps,
|
1
|
+
export { default as Label } from './Label';
|
2
|
+
export { LabelProps, LabelType, LabelPalette } from './types';
|
3
|
+
export { default as labelPalette } from './labelPalette';
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { paletteColor } from '../../..';
|
3
|
+
export interface WrapperProps {
|
4
|
+
disabled?: boolean;
|
5
|
+
required?: boolean;
|
6
|
+
color?: LabelType | paletteColor;
|
7
|
+
}
|
8
|
+
export interface LabelProps extends WrapperProps {
|
9
|
+
label?: string | JSX.Element;
|
10
|
+
}
|
11
|
+
export declare enum LabelType {
|
12
|
+
STANDARD = "standard",
|
13
|
+
ERROR = "error",
|
14
|
+
INFO = "info",
|
15
|
+
WARNING = "warning",
|
16
|
+
SUCCESS = "success",
|
17
|
+
DISABLED = "disabled"
|
18
|
+
}
|
19
|
+
export declare type LabelPalette = {
|
20
|
+
[key in LabelType]: paletteColor;
|
21
|
+
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { DefaultTheme } from 'styled-components';
|
2
|
+
import { paletteColor } from '../../../styles/types';
|
3
|
+
import { LabelType } from './types';
|
4
|
+
export interface GetLabelColorParams {
|
5
|
+
theme: DefaultTheme;
|
6
|
+
disabled?: boolean;
|
7
|
+
color?: LabelType | paletteColor;
|
8
|
+
}
|
9
|
+
export declare const getLabelColor: ({ theme, color, disabled }: GetLabelColorParams) => string;
|
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
export { SidebarItem, SidebarItemProps, sidebarItemHeight, SidebarItemPalette, CustomSidebarItemProps };
|
1
|
+
export { CustomSidebarItemProps, SidebarItem, sidebarItemHeight, SidebarItemPalette, SidebarItemProps, SidebarBadgeConfigType, SidebarBadgeConfigProps, } from './sidebarItem';
|
@@ -1,28 +1,21 @@
|
|
1
|
-
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
}
|
21
|
-
export declare const sidebarItemHeight = 44;
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { SidebarItemProps } from './types';
|
3
|
+
/**
|
4
|
+
* Component Props:
|
5
|
+
* @param {iconProps} icon Configuration of the left icon
|
6
|
+
* @param {string} title Used to set the sidebar item title
|
7
|
+
* @param {boolean} isDisabled Used to disable the item
|
8
|
+
* @param {boolean} isHidden Hide the sidebar item
|
9
|
+
* @param {function} onClick Callback called on item click
|
10
|
+
* @param {boolean} isOpen Set isOpen state
|
11
|
+
* @param {boolean} caretVisible Used to display caret icon
|
12
|
+
* @param {DropdownItemProps[]} dropdownContent Custom dropdown content
|
13
|
+
* @param {string} className Used to apply custom classes
|
14
|
+
* @param {boolean} isActive Set isOpen state
|
15
|
+
* @param {boolean} forceOpenDropdown Used to force open the dropdown content
|
16
|
+
* @param {CustomSidebarItemProps} customProps Used to set render sidebar item custom content
|
17
|
+
* @param {string} href Specify a redirect URL on item click
|
18
|
+
* @param {SidebarBadgeConfigProps} badgeConfig Used to add a badge, counter, icon to the item
|
19
|
+
*/
|
22
20
|
declare const SidebarItem: (props: SidebarItemProps) => JSX.Element | null;
|
23
|
-
export interface WrapperProps {
|
24
|
-
isActive: boolean;
|
25
|
-
isDisabled: boolean;
|
26
|
-
customColor?: paletteColor;
|
27
|
-
}
|
28
21
|
export default SidebarItem;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import {
|
3
|
-
|
4
|
-
content: DropdownItemProps[];
|
5
|
-
className?: string;
|
6
|
-
forceOpen?: boolean;
|
7
|
-
}
|
8
|
-
declare const SidebarItemDropdown: ({ className, content, forceOpen }: Props) => JSX.Element;
|
2
|
+
import { SidebarItemDropdownProps } from '../types';
|
3
|
+
declare const SidebarItemDropdown: ({ className, content, forceOpen }: SidebarItemDropdownProps) => JSX.Element;
|
9
4
|
export default SidebarItemDropdown;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
export {
|
1
|
+
export { default as SidebarItemDropdown } from './components/SidebarItemDropdown';
|
2
|
+
export { default as SidebarItem } from './SidebarItem';
|
3
|
+
export { default as sidebarItemPalette } from './sidebarItemPalette';
|
4
|
+
export { sidebarItemHeight } from './styled';
|
5
|
+
export { CustomSidebarItemProps, SidebarItemPalette, SidebarItemProps, SidebarBadgeConfigType, SidebarBadgeConfigProps, } from './types';
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { Meta, Story } from '@storybook/react';
|
2
|
-
import { SidebarItemProps } from '
|
2
|
+
import { SidebarItemProps } from '.';
|
3
3
|
export declare const Template: Story<SidebarItemProps>;
|
4
|
+
export declare const Normal: Story<SidebarItemProps>;
|
4
5
|
declare const SidebarItemStory: Meta<SidebarItemProps>;
|
5
6
|
export default SidebarItemStory;
|
@@ -1,14 +1,3 @@
|
|
1
|
-
import {
|
2
|
-
import { paletteColor } from '../../../styles/types';
|
3
|
-
declare type statusType = 'normal' | 'active' | 'disabled';
|
4
|
-
export interface SidebarItemStyles extends colorsPalette {
|
5
|
-
hoverColor: paletteColor;
|
6
|
-
hoverBackground: paletteColor;
|
7
|
-
dropdownHover: paletteColor;
|
8
|
-
dropdownActive: paletteColor;
|
9
|
-
}
|
10
|
-
export declare type SidebarItemPalette = {
|
11
|
-
[key in statusType]: SidebarItemStyles;
|
12
|
-
};
|
1
|
+
import { SidebarItemPalette } from './types';
|
13
2
|
declare const sidebarItemPalette: SidebarItemPalette;
|
14
3
|
export default sidebarItemPalette;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { paletteColor } from '../../../styles/types';
|
3
|
+
import { SidebarItemStyles } from './types';
|
4
|
+
export interface WrapperProps {
|
5
|
+
isActive: boolean;
|
6
|
+
isDisabled: boolean;
|
7
|
+
customColor?: paletteColor;
|
8
|
+
}
|
9
|
+
export declare const sidebarItemHeight = 44;
|
10
|
+
export declare const Dropdown: import("styled-components").StyledComponent<({ className, content, forceOpen }: import("./types").SidebarItemDropdownProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
11
|
+
export declare const SidebarItemWrapper: import("styled-components").StyledComponent<"a", import("styled-components").DefaultTheme, SidebarItemStyles & WrapperProps, keyof SidebarItemStyles>;
|
12
|
+
export declare const Title: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
13
|
+
export declare const NoIcon: import("styled-components").StyledComponent<({ onClick, isDisabled, ...props }: import("../../icon").IconProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
@@ -1,7 +1,63 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { MouseEventHandler } from 'react';
|
2
|
+
import { colorsPalette } from '../../../common/types/colorsPalette';
|
2
3
|
import { paletteColor } from '../../../styles/types';
|
3
|
-
import {
|
4
|
+
import { DropdownItemProps } from '../../dropdown/types';
|
5
|
+
import { FloatingBadgeType } from '../../floatingBadge/types';
|
6
|
+
import { IconProps } from '../../icon';
|
7
|
+
export interface SidebarItemProps {
|
8
|
+
icon?: IconProps;
|
9
|
+
title: string;
|
10
|
+
isDisabled?: boolean;
|
11
|
+
isHidden?: boolean;
|
12
|
+
onClick?: MouseEventHandler;
|
13
|
+
isOpen?: boolean;
|
14
|
+
caretVisible?: boolean;
|
15
|
+
dropdownContent?: DropdownItemProps[];
|
16
|
+
className?: string;
|
17
|
+
isActive?: boolean;
|
18
|
+
forceOpenDropdown?: boolean;
|
19
|
+
customProps?: CustomSidebarItemProps;
|
20
|
+
href?: string;
|
21
|
+
badgeConfig?: SidebarBadgeConfigProps;
|
22
|
+
}
|
4
23
|
export interface CustomSidebarItemProps {
|
5
24
|
color?: paletteColor;
|
6
25
|
renderContent?: React.FC<SidebarItemProps>;
|
7
26
|
}
|
27
|
+
export interface SidebarItemDropdownProps {
|
28
|
+
content: DropdownItemProps[];
|
29
|
+
className?: string;
|
30
|
+
forceOpen?: boolean;
|
31
|
+
}
|
32
|
+
export declare enum SidebarBadgeConfigType {
|
33
|
+
COUNTER = 0,
|
34
|
+
ICON = 1,
|
35
|
+
DOT = 2
|
36
|
+
}
|
37
|
+
declare type BadgeBaseConfig = {
|
38
|
+
size?: 'small' | 'medium' | 'large';
|
39
|
+
variant?: FloatingBadgeType;
|
40
|
+
};
|
41
|
+
interface BadgeCounterConfig extends BadgeBaseConfig {
|
42
|
+
type: SidebarBadgeConfigType.COUNTER;
|
43
|
+
counter: number | string;
|
44
|
+
}
|
45
|
+
interface BadgeIconConfig extends BadgeBaseConfig {
|
46
|
+
type: SidebarBadgeConfigType.ICON;
|
47
|
+
icon: IconProps;
|
48
|
+
}
|
49
|
+
interface BadgeDotConfig extends BadgeBaseConfig {
|
50
|
+
type: SidebarBadgeConfigType.DOT;
|
51
|
+
}
|
52
|
+
export declare type SidebarBadgeConfigProps = BadgeCounterConfig | BadgeIconConfig | BadgeDotConfig;
|
53
|
+
declare type StatusType = 'normal' | 'active' | 'disabled';
|
54
|
+
export interface SidebarItemStyles extends colorsPalette {
|
55
|
+
hoverColor: paletteColor;
|
56
|
+
hoverBackground: paletteColor;
|
57
|
+
dropdownHover: paletteColor;
|
58
|
+
dropdownActive: paletteColor;
|
59
|
+
}
|
60
|
+
export declare type SidebarItemPalette = {
|
61
|
+
[key in StatusType]: SidebarItemStyles;
|
62
|
+
};
|
63
|
+
export {};
|