@fluidattacks/design 1.3.0 → 1.5.0
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/design.js +538 -255
- package/dist/design.mjs +7224 -6721
- package/dist/src/components/accordion/accordion-content/index.d.ts +2 -2
- package/dist/src/components/accordion/types.d.ts +11 -6
- package/dist/src/components/code-snippet/index.d.ts +3 -0
- package/dist/src/components/code-snippet/location-code/index.d.ts +3 -0
- package/dist/src/components/code-snippet/styles.d.ts +3 -0
- package/dist/src/components/code-snippet/types.d.ts +22 -0
- package/dist/src/components/divider/index.d.ts +3 -0
- package/dist/src/components/divider/types.d.ts +11 -0
- package/dist/src/components/list-item/index.d.ts +4 -0
- package/dist/src/components/list-item/styles.d.ts +3 -0
- package/dist/src/components/list-item/types.d.ts +28 -0
- package/dist/src/components/radio-button/styles.d.ts +0 -2
- package/dist/src/components/radio-button/types.d.ts +1 -4
- package/dist/src/components/table-button/index.d.ts +3 -0
- package/dist/src/components/table-button/styles.d.ts +2 -0
- package/dist/src/components/table-button/types.d.ts +16 -0
- package/dist/src/components/tag/index.d.ts +4 -0
- package/dist/src/components/tag/styles.d.ts +7 -0
- package/dist/src/components/tag/types.d.ts +20 -0
- package/dist/src/components/toggle/index.d.ts +4 -0
- package/dist/src/components/toggle/styles.d.ts +4 -0
- package/dist/src/components/toggle/types.d.ts +28 -0
- package/dist/src/index.d.ts +6 -0
- package/package.json +3 -1
- package/dist/src/components/accordion/accordion-content/types.d.ts +0 -16
- package/dist/src/components/accordion/utils.d.ts +0 -20
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IAccordionContentProps } from '
|
|
2
|
-
declare const AccordionContent: ({ isSelectedAndOpen, item,
|
|
1
|
+
import { IAccordionContentProps } from '../types';
|
|
2
|
+
declare const AccordionContent: ({ isSelectedAndOpen, item, }: Readonly<IAccordionContentProps>) => JSX.Element;
|
|
3
3
|
export { AccordionContent };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
type TVariant = "progress" | "simple" | "platform";
|
|
2
1
|
type TAligned = "end" | "start";
|
|
3
2
|
/**
|
|
4
3
|
* Accordion item properties.
|
|
@@ -12,6 +11,16 @@ interface IAccordionItemProps {
|
|
|
12
11
|
description?: string;
|
|
13
12
|
extraElement?: JSX.Element;
|
|
14
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Accordion Content props
|
|
16
|
+
* @interface IAccordionContentProps
|
|
17
|
+
* @property {boolean} isSelectedAndOpen If item in accordion is selected and open.
|
|
18
|
+
* @property {IAccordionItemProps} item Accordion item.
|
|
19
|
+
*/
|
|
20
|
+
interface IAccordionContentProps {
|
|
21
|
+
isSelectedAndOpen: boolean;
|
|
22
|
+
item: IAccordionItemProps;
|
|
23
|
+
}
|
|
15
24
|
/**
|
|
16
25
|
* Pass more than 1 item to activate the progress variant.
|
|
17
26
|
*
|
|
@@ -19,15 +28,11 @@ interface IAccordionItemProps {
|
|
|
19
28
|
* @interface IAccordionProps
|
|
20
29
|
* @property {TAligned} [aligned] - Alignment of the accordion title.
|
|
21
30
|
* @property {IAccordionItemProps[]} items - A list of accordion items.
|
|
22
|
-
* @property {number} [progressTime] - Time remaining until the next item (in seconds).
|
|
23
31
|
* @property {string} [bgColor] - Background color of the accordion.
|
|
24
|
-
* @property {TVariant} [variant] - Type of accordion variant.
|
|
25
32
|
*/
|
|
26
33
|
interface IAccordionProps {
|
|
27
34
|
aligned?: TAligned;
|
|
28
35
|
items: IAccordionItemProps[];
|
|
29
|
-
progressTime?: number;
|
|
30
36
|
bgColor?: string;
|
|
31
|
-
variant?: TVariant;
|
|
32
37
|
}
|
|
33
|
-
export type { IAccordionProps, IAccordionItemProps,
|
|
38
|
+
export type { IAccordionProps, IAccordionItemProps, IAccordionContentProps, TAligned, };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const CodeContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
declare const ButtonsContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export { ButtonsContainer, CodeContainer };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snippet props.
|
|
3
|
+
* @interface ISnippet
|
|
4
|
+
* @property {string} content - The code snippet content.
|
|
5
|
+
* @property {number} offset - The offset of the code snippet in the source code.
|
|
6
|
+
*/
|
|
7
|
+
interface ISnippet {
|
|
8
|
+
content: string;
|
|
9
|
+
offset: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Code snippet component props.
|
|
13
|
+
* @property {string} [noCodeMessage] - Message to display when no code snippet is provided.
|
|
14
|
+
* @property {ISnippet | string} snippet - The code snippet object.
|
|
15
|
+
* @property {string} [specific] - Additional information related to the code snippet.
|
|
16
|
+
*/
|
|
17
|
+
interface ICodeSnippetProps {
|
|
18
|
+
noCodeMessage?: string;
|
|
19
|
+
snippet: ISnippet | string;
|
|
20
|
+
specific?: string;
|
|
21
|
+
}
|
|
22
|
+
export type { ICodeSnippetProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IMarginModifiable } from '../@core/types';
|
|
2
|
+
/**
|
|
3
|
+
* Divider component props.
|
|
4
|
+
* @interface IDividerProps
|
|
5
|
+
* @extends IMarginModifiable
|
|
6
|
+
* @property {string} [color] - The divider color.
|
|
7
|
+
*/
|
|
8
|
+
interface IDividerProps extends IMarginModifiable {
|
|
9
|
+
color?: string;
|
|
10
|
+
}
|
|
11
|
+
export type { IDividerProps };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ListItemsWrapper } from './styles';
|
|
2
|
+
import { IListItemProps } from './types';
|
|
3
|
+
declare const ListItem: ({ children, disabled, icon, iconType, href, onClick, onKeyDown, selected, value, ...props }: Readonly<IListItemProps>) => JSX.Element;
|
|
4
|
+
export { ListItem, ListItemsWrapper };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const Li: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, never>> & string;
|
|
2
|
+
declare const ListItemsWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLUListElement>, HTMLUListElement>, never>> & string;
|
|
3
|
+
export { Li, ListItemsWrapper };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HTMLAttributes, HTMLProps } from 'react';
|
|
2
|
+
import { IIconModifiable } from '../@core';
|
|
3
|
+
/**
|
|
4
|
+
* Label component props.
|
|
5
|
+
* @interface ILabelProps
|
|
6
|
+
* @property { string } color - The color for the label.
|
|
7
|
+
* @property { string } [href] - The URL for the label.
|
|
8
|
+
*/
|
|
9
|
+
interface ILabelProps {
|
|
10
|
+
color: string;
|
|
11
|
+
href?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* List item component props.
|
|
15
|
+
* @interface IListItemProps
|
|
16
|
+
* @extends IIconModifiable
|
|
17
|
+
* @extends HTMLAttributes<HTMLLIElement>
|
|
18
|
+
* @property { string } [header] - The header text for the list item.
|
|
19
|
+
* @property { string } [href] - The URL for the list item.
|
|
20
|
+
* @property { boolean } [selected] - Whether the list item is selected.
|
|
21
|
+
* @property { string } [value] - The value for the list item.
|
|
22
|
+
*/
|
|
23
|
+
interface IListItemProps extends Partial<Pick<IIconModifiable, "icon" | "iconType">>, HTMLAttributes<HTMLLIElement>, HTMLProps<HTMLLIElement> {
|
|
24
|
+
href?: string;
|
|
25
|
+
selected?: boolean;
|
|
26
|
+
value?: string;
|
|
27
|
+
}
|
|
28
|
+
export type { IListItemProps, ILabelProps };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { TVariant } from './types';
|
|
2
1
|
declare const LabelContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, {
|
|
3
2
|
$disabled: boolean;
|
|
4
|
-
$variant: TVariant;
|
|
5
3
|
}>> & string;
|
|
6
4
|
declare const CheckMark: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
7
5
|
ref?: ((instance: HTMLSpanElement | null) => void) | import('react').RefObject<HTMLSpanElement> | null | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes, HTMLProps } from 'react';
|
|
2
|
-
type TVariant = "web" | "platform";
|
|
3
2
|
/**
|
|
4
3
|
* Radio button props.
|
|
5
4
|
* @interface IRadioButtonProps
|
|
@@ -7,11 +6,9 @@ type TVariant = "web" | "platform";
|
|
|
7
6
|
* @extends HTMLProps<HTMLInputElement>
|
|
8
7
|
* @property {string} name - Input name.
|
|
9
8
|
* @property {string} value - Radio button value.
|
|
10
|
-
* @property {Function} [variant] - Radio button variant type.
|
|
11
9
|
*/
|
|
12
10
|
interface IRadioButtonProps extends HTMLAttributes<HTMLInputElement>, HTMLProps<HTMLInputElement> {
|
|
13
11
|
name: string;
|
|
14
12
|
value: string;
|
|
15
|
-
variant?: TVariant;
|
|
16
13
|
}
|
|
17
|
-
export type { IRadioButtonProps
|
|
14
|
+
export type { IRadioButtonProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const StyledTableButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
2
|
+
export { StyledTableButton };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { IIconModifiable } from '../@core';
|
|
3
|
+
type TVariant = "add" | "approve" | "disabled" | "reject" | "submit" | "success";
|
|
4
|
+
/**
|
|
5
|
+
* Table button component props.
|
|
6
|
+
* @interface ITableButtonProps
|
|
7
|
+
* @extends IIconModifiable
|
|
8
|
+
* @extends ButtonHTMLAttributes<HTMLButtonElement>
|
|
9
|
+
* @property { string } [label] - Button label.
|
|
10
|
+
* @property { TVariant } variant - Button variant.
|
|
11
|
+
*/
|
|
12
|
+
interface ITableButtonProps extends Partial<Pick<IIconModifiable, "icon">>, ButtonHTMLAttributes<HTMLButtonElement> {
|
|
13
|
+
label?: string;
|
|
14
|
+
variant: TVariant;
|
|
15
|
+
}
|
|
16
|
+
export type { ITableButtonProps, TVariant };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TTagVariant } from './types';
|
|
2
|
+
interface IStyledTag {
|
|
3
|
+
$fontSize?: string;
|
|
4
|
+
$variant: TTagVariant;
|
|
5
|
+
}
|
|
6
|
+
declare const StyledTag: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, IStyledTag>> & string;
|
|
7
|
+
export { StyledTag };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IIconModifiable } from '../@core';
|
|
2
|
+
type TTagVariant = "default" | "error" | "inactive" | "new" | "reachable" | "remediation" | "review" | "role" | "success" | "technique" | "warning";
|
|
3
|
+
/**
|
|
4
|
+
* Tag component props.
|
|
5
|
+
* @interface ITagProps
|
|
6
|
+
* @extends IIconModifiable
|
|
7
|
+
* @extends HTMLAttributes<HTMLSpanElement>
|
|
8
|
+
* @property { boolean } [disabled] - Whether the tag is disabled.
|
|
9
|
+
* @property { string } [fontSize] - The font size for the tag.
|
|
10
|
+
* @property { Function } [onClose] - Function handler for close button click.
|
|
11
|
+
* @property { TTagType } [type] - The type of the tag.
|
|
12
|
+
* @property { TTagVariant } [variant] - The variant of the tag.
|
|
13
|
+
*/
|
|
14
|
+
interface ITagProps extends Partial<Pick<IIconModifiable, "icon" | "iconColor">>, React.HTMLAttributes<HTMLSpanElement> {
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
fontSize?: string;
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
variant?: TTagVariant;
|
|
19
|
+
}
|
|
20
|
+
export type { ITagProps, TTagVariant };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const Slider: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
declare const Ball: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
declare const ToggleContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
|
|
4
|
+
export { Slider, ToggleContainer, Ball };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Property } from 'csstype';
|
|
2
|
+
import { InputHTMLAttributes } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Toggle component props.
|
|
5
|
+
* @interface ILabel
|
|
6
|
+
* @property { string } on - The label for the on state.
|
|
7
|
+
* @property { string } off - The label for the off state.
|
|
8
|
+
*/
|
|
9
|
+
interface ILabel {
|
|
10
|
+
on: string;
|
|
11
|
+
off: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Toggle component props.
|
|
15
|
+
* @interface IToggleProps
|
|
16
|
+
* @extends InputHTMLAttributes<HTMLInputElement>
|
|
17
|
+
* @property { Property.JustifyContent } [justify] - The justification of the toggle and its labels.
|
|
18
|
+
* @property { ILabel | string } [leftDescription] - The label or description for the left side of the toggle.
|
|
19
|
+
* @property { string } name - The name of the input field.
|
|
20
|
+
* @property { string } [rightDescription] - The label or description for the right side of the toggle.
|
|
21
|
+
*/
|
|
22
|
+
interface IToggleProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
23
|
+
justify?: Property.JustifyContent;
|
|
24
|
+
leftDescription?: ILabel | string;
|
|
25
|
+
name: string;
|
|
26
|
+
rightDescription?: string;
|
|
27
|
+
}
|
|
28
|
+
export type { IToggleProps };
|
package/dist/src/index.d.ts
CHANGED
|
@@ -5,10 +5,12 @@ export * from './components/button';
|
|
|
5
5
|
export * from './components/carousel';
|
|
6
6
|
export * from './components/checkbox';
|
|
7
7
|
export * from './components/cloud-image';
|
|
8
|
+
export * from './components/code-snippet';
|
|
8
9
|
export * from './components/colors';
|
|
9
10
|
export * from './components/container';
|
|
10
11
|
export * from './components/content-card';
|
|
11
12
|
export * from './components/content-card-carousel';
|
|
13
|
+
export * from './components/divider';
|
|
12
14
|
export * from './components/file-preview';
|
|
13
15
|
export * from './components/form';
|
|
14
16
|
export * from './components/icon';
|
|
@@ -17,6 +19,7 @@ export * from './components/inputs';
|
|
|
17
19
|
export * from './components/interactive-card';
|
|
18
20
|
export * from './components/language-selector';
|
|
19
21
|
export * from './components/link';
|
|
22
|
+
export * from './components/list-item';
|
|
20
23
|
export * from './components/logo';
|
|
21
24
|
export * from './components/logo-carousel';
|
|
22
25
|
export * from './components/message-banner';
|
|
@@ -24,7 +27,10 @@ export * from './components/notification-sign';
|
|
|
24
27
|
export * from './components/progress-bar';
|
|
25
28
|
export * from './components/radio-button';
|
|
26
29
|
export * from './components/search-bar';
|
|
30
|
+
export * from './components/table-button';
|
|
27
31
|
export * from './components/tabs';
|
|
32
|
+
export * from './components/tag';
|
|
33
|
+
export * from './components/toggle';
|
|
28
34
|
export * from './components/toggle-buttons';
|
|
29
35
|
export * from './components/tooltip';
|
|
30
36
|
export * from './components/typography';
|
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"@cloudinary/url-gen": "1.21.0",
|
|
9
9
|
"@fortawesome/free-solid-svg-icons": "6.7.1",
|
|
10
10
|
"@fortawesome/react-fontawesome": "0.2.2",
|
|
11
|
+
"prismjs": "1.29.0",
|
|
11
12
|
"react": "18.2.0",
|
|
12
13
|
"react-dom": "18.2.0",
|
|
13
14
|
"react-international-phone": "4.3.0",
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
"@storybook/react-vite": "8.4.6",
|
|
27
28
|
"@storybook/test": "8.4.6",
|
|
28
29
|
"@storybook/test-runner": "0.20.1",
|
|
30
|
+
"@types/prismjs": "1.26.5",
|
|
29
31
|
"@types/react": "18.2.0",
|
|
30
32
|
"@types/react-dom": "18.2.0",
|
|
31
33
|
"@vitejs/plugin-react-swc": "3.7.1",
|
|
@@ -94,5 +96,5 @@
|
|
|
94
96
|
"test-storybook": "test-storybook"
|
|
95
97
|
},
|
|
96
98
|
"types": "dist/src/index.d.ts",
|
|
97
|
-
"version": "1.
|
|
99
|
+
"version": "1.5.0"
|
|
98
100
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IAccordionItemProps, TVariant } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Accordion Content props
|
|
4
|
-
* @interface IAccordionContentProps
|
|
5
|
-
* @property {boolean} isSelectedAndOpen If item in accordion is selected and open.
|
|
6
|
-
* @property {IAccordionItemProps} item Accordion item.
|
|
7
|
-
* @property {TVariant} variant Type of accordion.
|
|
8
|
-
* @property {boolean} render Render condition.
|
|
9
|
-
*/
|
|
10
|
-
interface IAccordionContentProps {
|
|
11
|
-
isSelectedAndOpen: boolean;
|
|
12
|
-
item: IAccordionItemProps;
|
|
13
|
-
variant: TVariant;
|
|
14
|
-
render: boolean;
|
|
15
|
-
}
|
|
16
|
-
export type { IAccordionContentProps };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IconName } from '@fortawesome/free-solid-svg-icons';
|
|
2
|
-
import { Property } from 'csstype';
|
|
3
|
-
import { SetStateAction } from 'react';
|
|
4
|
-
import { TAligned, TVariant } from './types';
|
|
5
|
-
import { TSize, TSpacing } from '../@core';
|
|
6
|
-
declare const getItemBorderBottom: (index: number, isSelectedAndOpen: boolean, totalItems: number, variant: TVariant) => string | undefined;
|
|
7
|
-
declare const getItemBorderTop: (isSelectedAndOpen: boolean, variant: TVariant) => string | undefined;
|
|
8
|
-
declare const getIcon: (isSelectedAndOpen: boolean, variant: TVariant) => IconName;
|
|
9
|
-
declare const getContentDisplay: (isSelectedAndOpen: boolean) => Property.Display;
|
|
10
|
-
declare const handleContentVisibility: (index: number, currentItem: number, setIsOpen: (value: SetStateAction<boolean>) => void) => void;
|
|
11
|
-
declare const getTitlePadding: (variant: TVariant) => [TSpacing, TSpacing, TSpacing, TSpacing];
|
|
12
|
-
declare const getContentPadding: (variant: TVariant) => [TSpacing, TSpacing, TSpacing, TSpacing] | undefined;
|
|
13
|
-
declare const getHoverBgColor: (variant: TVariant) => string | undefined;
|
|
14
|
-
declare const getBorderColor: (variant: TVariant) => string;
|
|
15
|
-
declare const getIconColor: (variant: TVariant) => string;
|
|
16
|
-
declare const getFlexDirection: (aligned: TAligned) => Property.FlexDirection;
|
|
17
|
-
declare const getFontSize: (variant: TVariant) => TSize;
|
|
18
|
-
declare const getDelay: (progressTime: number) => number;
|
|
19
|
-
declare const sleep: (seconds: number) => Promise<PromiseConstructor>;
|
|
20
|
-
export { getItemBorderBottom, getItemBorderTop, getBorderColor, getContentDisplay, getDelay, getFlexDirection, getFontSize, getHoverBgColor, getIconColor, getTitlePadding, getContentPadding, getIcon, handleContentVisibility, sleep, };
|