@beydesign/storybook 0.0.1 → 0.0.2
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/README.md +60 -40
- package/dist/App.js +161 -5
- package/dist/assets/animations/loading-animation.json +1 -0
- package/dist/index.d.ts +12 -2
- package/dist/index.js +12 -4
- package/dist/stories/Agent/AgentCard.d.ts +3 -0
- package/dist/stories/Agent/AgentCard.js +102 -0
- package/dist/stories/Agent/AgentCard.stories.d.ts +13 -0
- package/dist/stories/Agent/AgentCard.stories.js +303 -0
- package/dist/stories/Agent/AgentCardSkeleton.d.ts +2 -0
- package/dist/stories/Agent/AgentCardSkeleton.js +6 -0
- package/dist/stories/Agent/AgentCardSkeleton.stories.d.ts +13 -0
- package/dist/stories/Agent/AgentCardSkeleton.stories.js +101 -0
- package/dist/stories/Agent/CreateNewCard.d.ts +7 -0
- package/dist/stories/Agent/CreateNewCard.js +25 -0
- package/dist/stories/Agent/CreateNewCard.stories.d.ts +7 -0
- package/dist/stories/Agent/CreateNewCard.stories.js +23 -0
- package/dist/stories/Agent/index.d.ts +4 -0
- package/dist/stories/Agent/index.js +4 -0
- package/dist/stories/Agent/types.d.ts +96 -0
- package/dist/stories/Agent/types.js +7 -0
- package/dist/stories/Buttons/MainButton.d.ts +3 -0
- package/dist/stories/Buttons/MainButton.js +302 -0
- package/dist/stories/Buttons/MainButton.stories.d.ts +28 -0
- package/dist/stories/Buttons/MainButton.stories.js +299 -0
- package/dist/stories/Buttons/ToggleButtonGroup.d.ts +3 -0
- package/dist/stories/Buttons/ToggleButtonGroup.js +34 -0
- package/dist/stories/Buttons/ToggleButtonGroup.stories.d.ts +9 -0
- package/dist/stories/Buttons/ToggleButtonGroup.stories.js +78 -0
- package/dist/stories/Buttons/index.d.ts +3 -0
- package/dist/stories/Buttons/index.js +3 -0
- package/dist/stories/{types/button.d.ts → Buttons/types.d.ts} +37 -14
- package/dist/stories/{types/button.js → Buttons/types.js} +12 -2
- package/dist/stories/Credits/CreditsCard.d.ts +3 -0
- package/dist/stories/Credits/CreditsCard.js +53 -0
- package/dist/stories/Credits/CreditsCard.stories.d.ts +7 -0
- package/dist/stories/Credits/CreditsCard.stories.js +34 -0
- package/dist/stories/Credits/CreditsCardSkeleton.d.ts +3 -0
- package/dist/stories/Credits/CreditsCardSkeleton.js +30 -0
- package/dist/stories/Credits/CreditsCardSkeleton.stories.d.ts +7 -0
- package/dist/stories/Credits/CreditsCardSkeleton.stories.js +40 -0
- package/dist/stories/Credits/index.d.ts +3 -0
- package/dist/stories/Credits/index.js +3 -0
- package/dist/stories/Credits/types.d.ts +57 -0
- package/dist/stories/Credits/types.js +11 -0
- package/dist/stories/EntityCard/EntityCard.d.ts +3 -0
- package/dist/stories/EntityCard/EntityCard.js +22 -0
- package/dist/stories/EntityCard/EntityCard.stories.d.ts +10 -0
- package/dist/stories/EntityCard/EntityCard.stories.js +187 -0
- package/dist/stories/EntityCard/EntityCardSkeleton.d.ts +3 -0
- package/dist/stories/EntityCard/EntityCardSkeleton.js +9 -0
- package/dist/stories/EntityCard/EntityCardSkeleton.stories.d.ts +10 -0
- package/dist/stories/EntityCard/EntityCardSkeleton.stories.js +73 -0
- package/dist/stories/EntityCard/index.d.ts +3 -0
- package/dist/stories/EntityCard/index.js +3 -0
- package/dist/stories/EntityCard/types.d.ts +54 -0
- package/dist/stories/EntityCard/types.js +1 -0
- package/dist/stories/Form/AutoComplete.d.ts +3 -0
- package/dist/stories/Form/AutoComplete.js +163 -0
- package/dist/stories/Form/AutoComplete.stories.d.ts +6 -0
- package/dist/stories/Form/AutoComplete.stories.js +88 -0
- package/dist/stories/Form/Checkbox.d.ts +3 -0
- package/dist/stories/Form/Checkbox.js +65 -0
- package/dist/stories/Form/Checkbox.stories.d.ts +13 -0
- package/dist/stories/Form/Checkbox.stories.js +121 -0
- package/dist/stories/Form/Dropdown.d.ts +3 -0
- package/dist/stories/Form/Dropdown.js +183 -0
- package/dist/stories/Form/Dropdown.stories.d.ts +6 -0
- package/dist/stories/Form/Dropdown.stories.js +122 -0
- package/dist/stories/Form/FileUpload/FileUpload.d.ts +3 -0
- package/dist/stories/Form/FileUpload/FileUpload.js +128 -0
- package/dist/stories/Form/FileUpload/FileUpload.stories.d.ts +7 -0
- package/dist/stories/Form/FileUpload/FileUpload.stories.js +51 -0
- package/dist/stories/Form/FileUpload/FileUploading.d.ts +3 -0
- package/dist/stories/Form/FileUpload/FileUploading.js +49 -0
- package/dist/stories/Form/FileUpload/FileUploading.stories.d.ts +10 -0
- package/dist/stories/Form/FileUpload/FileUploading.stories.js +108 -0
- package/dist/stories/Form/FileUpload/UploadedFile.d.ts +3 -0
- package/dist/stories/Form/FileUpload/UploadedFile.js +12 -0
- package/dist/stories/Form/FileUpload/UploadedFile.stories.d.ts +7 -0
- package/dist/stories/Form/FileUpload/UploadedFile.stories.js +73 -0
- package/dist/stories/Form/FileUpload/index.d.ts +3 -0
- package/dist/stories/Form/FileUpload/index.js +3 -0
- package/dist/stories/Form/TextArea.d.ts +3 -0
- package/dist/stories/Form/TextArea.js +23 -0
- package/dist/stories/Form/TextArea.stories.d.ts +161 -0
- package/dist/stories/Form/TextArea.stories.js +142 -0
- package/dist/stories/Form/TextInput.d.ts +3 -0
- package/dist/stories/Form/TextInput.js +57 -0
- package/dist/stories/Form/TextInput.stories.d.ts +155 -0
- package/dist/stories/Form/TextInput.stories.js +155 -0
- package/dist/stories/Form/Toggle.d.ts +3 -0
- package/dist/stories/Form/Toggle.js +57 -0
- package/dist/stories/Form/Toggle.stories.d.ts +6 -0
- package/dist/stories/Form/Toggle.stories.js +79 -0
- package/dist/stories/Form/index.d.ts +8 -0
- package/dist/stories/Form/index.js +8 -0
- package/dist/stories/Form/types.d.ts +274 -0
- package/dist/stories/Form/types.js +46 -0
- package/dist/stories/Foundations/Colors.d.ts +2 -0
- package/dist/stories/Foundations/Colors.js +266 -0
- package/dist/stories/Foundations/Colors.stories.d.ts +6 -0
- package/dist/stories/Foundations/Colors.stories.js +15 -0
- package/dist/stories/Foundations/index.d.ts +1 -0
- package/dist/stories/Foundations/index.js +1 -0
- package/dist/stories/Navigation/ComplexHeader.d.ts +3 -0
- package/dist/stories/Navigation/ComplexHeader.js +21 -0
- package/dist/stories/Navigation/ComplexHeader.stories.d.ts +6 -0
- package/dist/stories/Navigation/ComplexHeader.stories.js +82 -0
- package/dist/stories/Navigation/Header.d.ts +3 -0
- package/dist/stories/Navigation/Header.js +9 -0
- package/dist/stories/Navigation/Header.stories.d.ts +7 -0
- package/dist/stories/Navigation/Header.stories.js +87 -0
- package/dist/stories/Navigation/NavItem.d.ts +3 -0
- package/dist/stories/Navigation/NavItem.js +66 -0
- package/dist/stories/Navigation/NavItem.stories.d.ts +14 -0
- package/dist/stories/Navigation/NavItem.stories.js +100 -0
- package/dist/stories/Navigation/ProcessHeader.d.ts +3 -0
- package/dist/stories/Navigation/ProcessHeader.js +11 -0
- package/dist/stories/Navigation/ProcessHeader.stories.d.ts +6 -0
- package/dist/stories/Navigation/ProcessHeader.stories.js +76 -0
- package/dist/stories/Navigation/Sidebar.d.ts +3 -0
- package/dist/stories/Navigation/Sidebar.js +115 -0
- package/dist/stories/Navigation/Sidebar.stories.d.ts +11 -0
- package/dist/stories/Navigation/Sidebar.stories.js +174 -0
- package/dist/stories/Navigation/index.d.ts +6 -0
- package/dist/stories/Navigation/index.js +6 -0
- package/dist/stories/Navigation/types.d.ts +186 -0
- package/dist/stories/Navigation/types.js +21 -0
- package/dist/stories/PlanCard/PlanCard.d.ts +3 -0
- package/dist/stories/PlanCard/PlanCard.js +13 -0
- package/dist/stories/PlanCard/PlanCard.stories.d.ts +9 -0
- package/dist/stories/PlanCard/PlanCard.stories.js +125 -0
- package/dist/stories/PlanCard/PlanCardSkeleton.d.ts +3 -0
- package/dist/stories/PlanCard/PlanCardSkeleton.js +6 -0
- package/dist/stories/PlanCard/PlanCardSkeleton.stories.d.ts +7 -0
- package/dist/stories/PlanCard/PlanCardSkeleton.stories.js +40 -0
- package/dist/stories/PlanCard/index.d.ts +3 -0
- package/dist/stories/PlanCard/index.js +3 -0
- package/dist/stories/PlanCard/types.d.ts +61 -0
- package/dist/stories/PlanCard/types.js +1 -0
- package/dist/stories/StripeProduct/StripeProduct.d.ts +3 -0
- package/dist/stories/StripeProduct/StripeProduct.js +24 -0
- package/dist/stories/StripeProduct/StripeProduct.stories.d.ts +10 -0
- package/dist/stories/StripeProduct/StripeProduct.stories.js +110 -0
- package/dist/stories/StripeProduct/StripeProductCardSkeleton.d.ts +3 -0
- package/dist/stories/StripeProduct/StripeProductCardSkeleton.js +6 -0
- package/dist/stories/StripeProduct/StripeProductCardSkeleton.stories.d.ts +16 -0
- package/dist/stories/StripeProduct/StripeProductCardSkeleton.stories.js +137 -0
- package/dist/stories/StripeProduct/index.d.ts +3 -0
- package/dist/stories/StripeProduct/index.js +3 -0
- package/dist/stories/StripeProduct/types.d.ts +56 -0
- package/dist/stories/StripeProduct/types.js +1 -0
- package/dist/stories/Typography/Typography.d.ts +3 -0
- package/dist/stories/Typography/Typography.js +22 -0
- package/dist/stories/Typography/Typography.stories.d.ts +25 -0
- package/dist/stories/Typography/Typography.stories.js +225 -0
- package/dist/stories/Typography/index.d.ts +2 -0
- package/dist/stories/Typography/index.js +2 -0
- package/dist/stories/Typography/types.d.ts +46 -0
- package/dist/stories/Typography/types.js +27 -0
- package/dist/stories/UI/Avatar.d.ts +3 -0
- package/dist/stories/UI/Avatar.js +76 -0
- package/dist/stories/UI/Avatar.stories.d.ts +8 -0
- package/dist/stories/UI/Avatar.stories.js +76 -0
- package/dist/stories/UI/Badge.d.ts +3 -0
- package/dist/stories/UI/Badge.js +118 -0
- package/dist/stories/UI/Badge.stories.d.ts +11 -0
- package/dist/stories/UI/Badge.stories.js +107 -0
- package/dist/stories/UI/CheckIcon.d.ts +3 -0
- package/dist/stories/UI/CheckIcon.js +36 -0
- package/dist/stories/UI/CheckIcon.stories.d.ts +7 -0
- package/dist/stories/UI/CheckIcon.stories.js +48 -0
- package/dist/stories/UI/FeatureBanner.d.ts +3 -0
- package/dist/stories/UI/FeatureBanner.js +34 -0
- package/dist/stories/UI/FeatureBanner.stories.d.ts +9 -0
- package/dist/stories/UI/FeatureBanner.stories.js +131 -0
- package/dist/stories/UI/HintBubble.d.ts +3 -0
- package/dist/stories/UI/HintBubble.js +28 -0
- package/dist/stories/UI/HintBubble.stories.d.ts +9 -0
- package/dist/stories/UI/HintBubble.stories.js +68 -0
- package/dist/stories/UI/Logo.d.ts +3 -0
- package/dist/stories/UI/Logo.js +60 -0
- package/dist/stories/UI/Logo.stories.d.ts +11 -0
- package/dist/stories/UI/Logo.stories.js +65 -0
- package/dist/stories/UI/Menu.d.ts +3 -0
- package/dist/stories/UI/Menu.js +56 -0
- package/dist/stories/UI/Menu.stories.d.ts +7 -0
- package/dist/stories/UI/Menu.stories.js +80 -0
- package/dist/stories/UI/ProgressIndicator.d.ts +3 -0
- package/dist/stories/UI/ProgressIndicator.js +35 -0
- package/dist/stories/UI/ProgressIndicator.stories.d.ts +10 -0
- package/dist/stories/UI/ProgressIndicator.stories.js +98 -0
- package/dist/stories/UI/PromoBanner.d.ts +3 -0
- package/dist/stories/UI/PromoBanner.js +34 -0
- package/dist/stories/UI/PromoBanner.stories.d.ts +9 -0
- package/dist/stories/UI/PromoBanner.stories.js +159 -0
- package/dist/stories/UI/SkeletonLoader.d.ts +3 -0
- package/dist/stories/UI/SkeletonLoader.js +19 -0
- package/dist/stories/UI/SkeletonLoader.stories.d.ts +8 -0
- package/dist/stories/UI/SkeletonLoader.stories.js +74 -0
- package/dist/stories/UI/Stepper.d.ts +3 -0
- package/dist/stories/UI/Stepper.js +67 -0
- package/dist/stories/UI/Stepper.stories.d.ts +6 -0
- package/dist/stories/UI/Stepper.stories.js +65 -0
- package/dist/stories/UI/Topbar.d.ts +3 -0
- package/dist/stories/UI/Topbar.js +9 -0
- package/dist/stories/UI/Topbar.stories.d.ts +6 -0
- package/dist/stories/UI/Topbar.stories.js +71 -0
- package/dist/stories/UI/index.d.ts +13 -0
- package/dist/stories/UI/index.js +13 -0
- package/dist/stories/UI/types.d.ts +398 -0
- package/dist/stories/UI/types.js +110 -0
- package/dist/utils/common.d.ts +2 -0
- package/dist/utils/common.js +20 -0
- package/dist/utils/icon.d.ts +6 -0
- package/dist/utils/icon.js +6 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/typography.d.ts +14 -0
- package/dist/utils/typography.js +46 -0
- package/package.json +48 -42
- package/dist/stories/Button.d.ts +0 -4
- package/dist/stories/Button.js +0 -258
- package/dist/stories/Colors.d.ts +0 -5
- package/dist/stories/Colors.js +0 -9
- package/dist/stories/Header.d.ts +0 -12
- package/dist/stories/Header.js +0 -4
- package/dist/stories/Header.stories.d.ts +0 -18
- package/dist/stories/Header.stories.js +0 -26
- package/dist/stories/Page.d.ts +0 -3
- package/dist/stories/Page.js +0 -8
- package/dist/stories/Page.stories.d.ts +0 -12
- package/dist/stories/Page.stories.js +0 -24
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Logo } from './Logo';
|
|
2
|
+
import { LogoVariant } from './types';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Design System/Foundations/UI/Logo',
|
|
5
|
+
component: Logo,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: 'centered',
|
|
8
|
+
design: {
|
|
9
|
+
type: 'figspec',
|
|
10
|
+
url: 'https://www.figma.com/design/mIhjz2yJjcpLlIqw6oUivt/Beyond-Presence?node-id=278-2962&m=dev',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
argTypes: {
|
|
15
|
+
variant: {
|
|
16
|
+
control: 'select',
|
|
17
|
+
options: Object.values(LogoVariant),
|
|
18
|
+
},
|
|
19
|
+
color: {
|
|
20
|
+
control: 'color',
|
|
21
|
+
},
|
|
22
|
+
gradient: {
|
|
23
|
+
control: 'text',
|
|
24
|
+
description: 'CSS gradient value to apply to the logo',
|
|
25
|
+
},
|
|
26
|
+
svgUrl: {
|
|
27
|
+
control: 'text',
|
|
28
|
+
description: 'URL to an external SVG file to override the default logo',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export default meta;
|
|
33
|
+
export const Horizontal = {
|
|
34
|
+
args: {
|
|
35
|
+
variant: LogoVariant.Horizontal,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
export const Vertical = {
|
|
39
|
+
args: {
|
|
40
|
+
variant: LogoVariant.Vertical,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
export const Icon = {
|
|
44
|
+
args: {
|
|
45
|
+
variant: LogoVariant.Icon,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
export const CustomColor = {
|
|
49
|
+
args: {
|
|
50
|
+
variant: LogoVariant.Horizontal,
|
|
51
|
+
color: 'var(--color-foreground-fg-success)',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
export const WithGradient = {
|
|
55
|
+
args: {
|
|
56
|
+
variant: LogoVariant.Horizontal,
|
|
57
|
+
gradient: 'var(--global-logo-gradient)',
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
export const ExternalSvg = {
|
|
61
|
+
args: {
|
|
62
|
+
svgUrl: 'https://storage.googleapis.com/bey-dev-public/testTavus.svg',
|
|
63
|
+
color: '#181717',
|
|
64
|
+
},
|
|
65
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { MenuItem as MuiMenuItem, Menu as MuiMenu, } from '@mui/material';
|
|
3
|
+
import { Fragment, useState } from 'react';
|
|
4
|
+
import { MainButton, ButtonDisplayMode, ButtonHierarchy, ButtonType, ButtonSize, } from '../Buttons';
|
|
5
|
+
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
6
|
+
import { getIconComponent } from '../../utils';
|
|
7
|
+
export const Menu = ({ icon = 'DotsThree', items, style, testKey, size = ButtonSize.xl, hierarchy = ButtonHierarchy.Secondary, }) => {
|
|
8
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
9
|
+
const open = Boolean(anchorEl);
|
|
10
|
+
const handleClick = (event) => {
|
|
11
|
+
setAnchorEl(event.currentTarget);
|
|
12
|
+
};
|
|
13
|
+
const handleClose = () => {
|
|
14
|
+
setAnchorEl(null);
|
|
15
|
+
};
|
|
16
|
+
const handleMenuItemClick = (item, event) => {
|
|
17
|
+
handleClose();
|
|
18
|
+
if (item.onClick) {
|
|
19
|
+
item?.onClick(event);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const getColor = (action) => {
|
|
23
|
+
if (action?.destructive)
|
|
24
|
+
return 'var(--color-text-text-error)';
|
|
25
|
+
return 'var(--color-text-text-title)';
|
|
26
|
+
};
|
|
27
|
+
return (_jsxs(Fragment, { children: [_jsx(MainButton, { displayIcon: icon, onClick: handleClick, type: ButtonType.Button, displayIconMode: ButtonDisplayMode.Only, hierarchy: hierarchy, size: size, style: style, testId: `${testKey}-menu-button` }), _jsx(MuiMenu, { id: "basic-menu", "data-testid": `${testKey}-menu`, anchorEl: anchorEl, open: open, onClose: handleClose, MenuListProps: {
|
|
28
|
+
'aria-labelledby': 'basic-button',
|
|
29
|
+
style: {
|
|
30
|
+
padding: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)',
|
|
31
|
+
},
|
|
32
|
+
}, slotProps: {
|
|
33
|
+
paper: {
|
|
34
|
+
style: {
|
|
35
|
+
borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)',
|
|
36
|
+
backgroundColor: 'var(--color-background-bg-component)',
|
|
37
|
+
border: '1px solid var(--color-border-border-component)',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
root: { style: { gap: '4px' } },
|
|
41
|
+
}, children: items?.map((action, index) => {
|
|
42
|
+
if (action) {
|
|
43
|
+
return (_jsxs(MuiMenuItem, { onClick: (e) => handleMenuItemClick(action, e), sx: {
|
|
44
|
+
gap: '8px',
|
|
45
|
+
'&:hover': {
|
|
46
|
+
backgroundColor: 'var(--color-background-bg-component-hover)',
|
|
47
|
+
},
|
|
48
|
+
}, disableRipple: true, "data-testid": `${testKey}-menu-item-${index}`, children: [action?.icon &&
|
|
49
|
+
getIconComponent(action.icon, {
|
|
50
|
+
width: '20px',
|
|
51
|
+
height: '20px',
|
|
52
|
+
color: getColor(action),
|
|
53
|
+
}), action?.label && (_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: getColor(action), children: action.label }))] }, index));
|
|
54
|
+
}
|
|
55
|
+
}) })] }));
|
|
56
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Menu } from './Menu';
|
|
2
|
+
import { ButtonSize, ButtonHierarchy } from '../Buttons';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Design System/Components/UI/Menu',
|
|
5
|
+
component: Menu,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: 'centered',
|
|
8
|
+
},
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
icon: {
|
|
12
|
+
control: 'select',
|
|
13
|
+
options: ['DotsThree', 'Pencil', 'Trash'],
|
|
14
|
+
defaultValue: 'DotsThree',
|
|
15
|
+
description: 'The icon to display in the menu',
|
|
16
|
+
table: {
|
|
17
|
+
type: {
|
|
18
|
+
summary: 'string',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
items: {
|
|
23
|
+
control: 'object',
|
|
24
|
+
description: 'The items to display in the menu',
|
|
25
|
+
table: {
|
|
26
|
+
type: {
|
|
27
|
+
summary: 'MenuItemProps[]',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
style: {
|
|
32
|
+
control: 'object',
|
|
33
|
+
description: 'The style to display in the menu',
|
|
34
|
+
table: {
|
|
35
|
+
type: { summary: 'CSSProperties' },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
control: 'select',
|
|
40
|
+
options: Object.values(ButtonSize),
|
|
41
|
+
description: 'Size of the trigger button',
|
|
42
|
+
table: {
|
|
43
|
+
type: { summary: 'ButtonSize' },
|
|
44
|
+
defaultValue: { summary: ButtonSize.xl },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
hierarchy: {
|
|
48
|
+
control: 'select',
|
|
49
|
+
options: Object.values(ButtonHierarchy),
|
|
50
|
+
description: 'Hierarchy of the trigger button',
|
|
51
|
+
table: {
|
|
52
|
+
type: { summary: 'ButtonHierarchy' },
|
|
53
|
+
defaultValue: { summary: ButtonHierarchy.Secondary },
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
export default meta;
|
|
59
|
+
export const Default = {
|
|
60
|
+
args: {
|
|
61
|
+
icon: 'DotsThree',
|
|
62
|
+
items: [
|
|
63
|
+
{ label: 'Edit', onClick: () => { }, destructive: false, icon: 'Pencil' },
|
|
64
|
+
{ label: 'Delete', onClick: () => { }, destructive: true, icon: 'Trash' },
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
export const Small = {
|
|
69
|
+
args: {
|
|
70
|
+
...Default.args,
|
|
71
|
+
size: ButtonSize.sm,
|
|
72
|
+
},
|
|
73
|
+
parameters: {
|
|
74
|
+
docs: {
|
|
75
|
+
description: {
|
|
76
|
+
story: 'The trigger button rendered at the small size, used in compact contexts such as the EntityCard action row.',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ProgressIndicatorMode } from './types';
|
|
3
|
+
import { Box } from '@mui/material';
|
|
4
|
+
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
5
|
+
export const ProgressIndicator = ({ mode = ProgressIndicatorMode.Value, overriddenText = null, currentValue = 40, maxValue = 100, fillColor = 'var(--color-background-bg-brand-primary)', backgroundColor = 'var(--color-background-bg-component)', text = 'used', textColor = 'var(--color-text-text-title)', style, textStyle, testId, }) => {
|
|
6
|
+
let errorText = '';
|
|
7
|
+
const calculateFill = () => {
|
|
8
|
+
if (currentValue > maxValue)
|
|
9
|
+
return 100;
|
|
10
|
+
return (currentValue / maxValue) * 100;
|
|
11
|
+
};
|
|
12
|
+
if (isNaN(currentValue) || !isFinite(currentValue)) {
|
|
13
|
+
errorText = 'Current value must be a valid number';
|
|
14
|
+
}
|
|
15
|
+
else if (isNaN(maxValue) || !isFinite(maxValue)) {
|
|
16
|
+
errorText = 'Max value must be a valid number';
|
|
17
|
+
}
|
|
18
|
+
else if (currentValue < 0) {
|
|
19
|
+
errorText = 'Invalid current value';
|
|
20
|
+
}
|
|
21
|
+
else if (mode === ProgressIndicatorMode.Percentage) {
|
|
22
|
+
if (maxValue > 100 || maxValue < 0) {
|
|
23
|
+
errorText = 'Invalid max value for percentage mode';
|
|
24
|
+
}
|
|
25
|
+
else if (currentValue > maxValue) {
|
|
26
|
+
errorText = 'Current value is greater than max value for percentage mode';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (errorText) {
|
|
30
|
+
return (_jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, children: errorText }));
|
|
31
|
+
}
|
|
32
|
+
return (_jsxs(Box, { display: "flex", flexDirection: mode === ProgressIndicatorMode.Value ? 'column' : 'row', justifyContent: 'space-between', alignItems: mode === ProgressIndicatorMode.Value ? 'flex-end' : 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', sx: style, minWidth: 200, "data-testid": testId, children: [mode === ProgressIndicatorMode.Value && (_jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: textColor, textStyle: textStyle, children: overriddenText ||
|
|
33
|
+
`${currentValue.toLocaleString(undefined, { maximumFractionDigits: 2 })} / ${maxValue.toLocaleString(undefined, { maximumFractionDigits: 2 })} ${text}` })), _jsx(Box, { display: "flex", flexGrow: 1, flexDirection: "row", alignItems: "center", borderRadius: '4px', sx: { backgroundColor, overflow: 'hidden' }, height: '4px', width: '100%', children: _jsx(Box, { height: '100%', borderRadius: '4px', sx: { backgroundColor: fillColor, width: `${calculateFill()}%` } }) }), mode === ProgressIndicatorMode.Percentage && (_jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: textColor, textStyle: textStyle, children: overriddenText ||
|
|
34
|
+
`${currentValue.toLocaleString(undefined, { maximumFractionDigits: 2 })}%` }))] }));
|
|
35
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ProgressIndicator } from './ProgressIndicator';
|
|
3
|
+
declare const meta: Meta<typeof ProgressIndicator>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ProgressIndicator>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const ValueWithOverriddenText: Story;
|
|
8
|
+
export declare const Percentage: Story;
|
|
9
|
+
export declare const PercentageWithOverriddenText: Story;
|
|
10
|
+
export declare const Custom: Story;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ProgressIndicator } from './ProgressIndicator';
|
|
2
|
+
import { ProgressIndicatorMode } from './types';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Design System/Components/UI/ProgressIndicator',
|
|
5
|
+
component: ProgressIndicator,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: 'centered',
|
|
8
|
+
design: {
|
|
9
|
+
type: 'figspec',
|
|
10
|
+
url: 'https://www.figma.com/design/mIhjz2yJjcpLlIqw6oUivt/Beyond-Presence?node-id=4793-22258&t=3PJghL9RdZ71sldb-1',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
argTypes: {
|
|
15
|
+
currentValue: {
|
|
16
|
+
control: 'number',
|
|
17
|
+
description: 'Current value of the progress indicator',
|
|
18
|
+
table: {
|
|
19
|
+
type: { summary: 'number' },
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
maxValue: {
|
|
23
|
+
control: 'number',
|
|
24
|
+
description: 'Maximum value of the progress indicator',
|
|
25
|
+
table: {
|
|
26
|
+
type: { summary: 'number' },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
mode: {
|
|
30
|
+
control: 'select',
|
|
31
|
+
description: 'Mode of the progress indicator',
|
|
32
|
+
options: Object.values(ProgressIndicatorMode),
|
|
33
|
+
table: {
|
|
34
|
+
type: { summary: 'string' },
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
text: {
|
|
38
|
+
control: 'text',
|
|
39
|
+
description: 'Text of the progress indicator',
|
|
40
|
+
},
|
|
41
|
+
textColor: {
|
|
42
|
+
control: 'color',
|
|
43
|
+
description: 'Text color of the progress indicator',
|
|
44
|
+
},
|
|
45
|
+
fillColor: {
|
|
46
|
+
control: 'color',
|
|
47
|
+
description: 'Fill color of the progress indicator',
|
|
48
|
+
},
|
|
49
|
+
backgroundColor: {
|
|
50
|
+
control: 'color',
|
|
51
|
+
description: 'Background color of the progress indicator',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
export default meta;
|
|
56
|
+
export const Default = {
|
|
57
|
+
args: {
|
|
58
|
+
mode: ProgressIndicatorMode.Value,
|
|
59
|
+
currentValue: 10,
|
|
60
|
+
maxValue: 100,
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
export const ValueWithOverriddenText = {
|
|
64
|
+
args: {
|
|
65
|
+
mode: ProgressIndicatorMode.Value,
|
|
66
|
+
currentValue: 10,
|
|
67
|
+
maxValue: 100,
|
|
68
|
+
overriddenText: 'Step 10 of 100',
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
export const Percentage = {
|
|
72
|
+
args: {
|
|
73
|
+
mode: ProgressIndicatorMode.Percentage,
|
|
74
|
+
currentValue: 30,
|
|
75
|
+
maxValue: 100,
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
export const PercentageWithOverriddenText = {
|
|
79
|
+
args: {
|
|
80
|
+
mode: ProgressIndicatorMode.Percentage,
|
|
81
|
+
currentValue: 30,
|
|
82
|
+
maxValue: 100,
|
|
83
|
+
overriddenText: 'Step 30 of 100',
|
|
84
|
+
style: { width: '400px' },
|
|
85
|
+
textStyle: { width: '120px' },
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
export const Custom = {
|
|
89
|
+
args: {
|
|
90
|
+
mode: ProgressIndicatorMode.Value,
|
|
91
|
+
currentValue: 10,
|
|
92
|
+
maxValue: 100,
|
|
93
|
+
backgroundColor: 'red',
|
|
94
|
+
fillColor: 'blue',
|
|
95
|
+
text: 'consumed',
|
|
96
|
+
textColor: 'purple',
|
|
97
|
+
},
|
|
98
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '@mui/material';
|
|
3
|
+
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
4
|
+
import { MainButton, ButtonHierarchy, ButtonSize } from '../Buttons';
|
|
5
|
+
const DEFAULT_BACKGROUND = 'linear-gradient(180deg, rgba(194, 171, 252, 0.08) 0%, rgba(128, 96, 198, 0.2) 100%)';
|
|
6
|
+
export const PromoBanner = ({ title = 'Real-time AI avatars for every conversation.', description = 'Trusted by developers, startups, educators, and enterprises to build engaging AI experiences at scale:', features = [
|
|
7
|
+
'Real-Time',
|
|
8
|
+
'Multilingual',
|
|
9
|
+
'API-first',
|
|
10
|
+
'Enterprise-ready',
|
|
11
|
+
'GDPR Compliant',
|
|
12
|
+
], promoCode, promoCodeLabel = 'YOUR PROMO CODE', onCopyPromoCode, ctaText, onCtaClick, footerText, leftImage, rightImage, showImages = true, background = DEFAULT_BACKGROUND, style: customStyle, testId, }) => {
|
|
13
|
+
const handleCopyPromoCode = () => {
|
|
14
|
+
if (!promoCode)
|
|
15
|
+
return;
|
|
16
|
+
navigator.clipboard?.writeText(promoCode);
|
|
17
|
+
onCopyPromoCode?.(promoCode);
|
|
18
|
+
};
|
|
19
|
+
const featuresText = features?.length
|
|
20
|
+
? features.map((feature) => `✓ ${feature}`).join(', ') + '.'
|
|
21
|
+
: '';
|
|
22
|
+
const renderSideImage = (image) => {
|
|
23
|
+
if (!showImages || !image)
|
|
24
|
+
return null;
|
|
25
|
+
return (_jsx(Box, { component: "img", src: image, alt: "", height: "100%", flexShrink: 0, sx: { objectFit: 'contain' } }));
|
|
26
|
+
};
|
|
27
|
+
return (_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "center", gap: "40px", height: "220px", width: "100%", overflow: "hidden", borderRadius: "var(--spacing-tokens-size-in-px-radius-radius-lg)", paddingX: "var(--spacing-tokens-size-in-px-spacing-spacing-2xl)", sx: { background, boxSizing: 'border-box', ...customStyle }, "data-testid": testId, children: [renderSideImage(leftImage), _jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-2xl)", flex: 1, minWidth: 0, paddingY: "var(--spacing-tokens-size-in-px-spacing-spacing-3xl)", children: [_jsxs(Box, { display: "flex", flexDirection: "column", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-md)", width: "100%", children: [title && (_jsx(Typography, { size: TypographySize.HeadingM, weight: TypographyWeight.Bold, color: "var(--color-text-text-title)", textStyle: { textAlign: 'center' }, children: title })), (description || featuresText) && (_jsxs(Box, { display: "flex", flexDirection: "column", children: [description && (_jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: "var(--color-text-text-title)", children: description })), featuresText && (_jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.Bold, color: "var(--color-text-text-title)", children: featuresText }))] }))] }), (promoCode || ctaText) && (_jsxs(Box, { display: "flex", justifyContent: "center", alignItems: "stretch", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-md)", children: [promoCode && (_jsxs(Box, { position: "relative", display: "flex", children: [_jsx(MainButton, { text: promoCode, size: ButtonSize.md, hierarchy: ButtonHierarchy.SecondaryColor, showTrailingIcon: true, trailingIcon: "Copy", onClick: handleCopyPromoCode, style: {
|
|
28
|
+
border: '1px dashed var(--color-border-border-component)',
|
|
29
|
+
height: '100%',
|
|
30
|
+
}, testId: testId ? `${testId}-promo-code` : undefined }), promoCodeLabel && (_jsx(Box, { position: "absolute", top: "-13px", left: "-8px", bgcolor: "var(--color-background-bg-icon-badge)", borderRadius: "var(--spacing-tokens-size-in-px-radius-radius-xs)", padding: "var(--spacing-tokens-size-in-px-spacing-spacing-xxs) var(--spacing-tokens-size-in-px-spacing-spacing-sm)", whiteSpace: "nowrap", zIndex: 1, children: _jsx(Typography, { size: TypographySize.Text2XS, weight: TypographyWeight.SemiBold,
|
|
31
|
+
// Invariant violet label (bg-icon-badge) -> pin to the
|
|
32
|
+
// invariant dark text so it stays legible in both themes.
|
|
33
|
+
color: "var(--color-text-text-dark)", children: promoCodeLabel }) }))] })), ctaText && (_jsx(MainButton, { text: ctaText, size: ButtonSize.md, hierarchy: ButtonHierarchy.Primary, onClick: onCtaClick, testId: testId ? `${testId}-cta` : undefined }))] })), footerText && (_jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: "var(--color-text-text-title)", textStyle: { width: '100%' }, children: footerText }))] }), renderSideImage(rightImage)] }));
|
|
34
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { PromoBanner } from './PromoBanner';
|
|
3
|
+
declare const meta: Meta<typeof PromoBanner>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof PromoBanner>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithoutImages: Story;
|
|
8
|
+
export declare const WithoutPromoCode: Story;
|
|
9
|
+
export declare const TitleAndCtaOnly: Story;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { PromoBanner } from './PromoBanner';
|
|
2
|
+
import bannerAvatarsLeft from '../assets/banner/banner-avatars-left.png';
|
|
3
|
+
import bannerAvatarsRight from '../assets/banner/banner-avatars-right.png';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Design System/Components/UI/PromoBanner',
|
|
6
|
+
component: PromoBanner,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'padded',
|
|
9
|
+
design: {
|
|
10
|
+
type: 'figspec',
|
|
11
|
+
url: 'https://www.figma.com/design/mIhjz2yJjcpLlIqw6oUivt/Beyond-Presence?node-id=7020-10224',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
argTypes: {
|
|
16
|
+
title: {
|
|
17
|
+
control: 'text',
|
|
18
|
+
description: 'Title of the banner',
|
|
19
|
+
table: {
|
|
20
|
+
type: { summary: 'string' },
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
description: {
|
|
24
|
+
control: 'text',
|
|
25
|
+
description: 'Description text shown below the title',
|
|
26
|
+
table: {
|
|
27
|
+
type: { summary: 'string' },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
features: {
|
|
31
|
+
control: 'object',
|
|
32
|
+
description: 'Feature highlights rendered as a checkmark list',
|
|
33
|
+
table: {
|
|
34
|
+
type: { summary: 'string[]' },
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
promoCode: {
|
|
38
|
+
control: 'text',
|
|
39
|
+
description: 'Promo code to display',
|
|
40
|
+
table: {
|
|
41
|
+
type: { summary: 'string' },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
promoCodeLabel: {
|
|
45
|
+
control: 'text',
|
|
46
|
+
description: 'Label shown on top of the promo code',
|
|
47
|
+
table: {
|
|
48
|
+
type: { summary: 'string' },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
onCopyPromoCode: {
|
|
52
|
+
action: 'promo code copied',
|
|
53
|
+
description: 'Called after the promo code is copied to the clipboard',
|
|
54
|
+
table: {
|
|
55
|
+
type: { summary: 'function' },
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
ctaText: {
|
|
59
|
+
control: 'text',
|
|
60
|
+
description: 'Call-to-action button text',
|
|
61
|
+
table: {
|
|
62
|
+
type: { summary: 'string' },
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
onCtaClick: {
|
|
66
|
+
action: 'cta clicked',
|
|
67
|
+
description: 'Called when the call-to-action button is clicked',
|
|
68
|
+
table: {
|
|
69
|
+
type: { summary: 'function' },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
footerText: {
|
|
73
|
+
control: 'text',
|
|
74
|
+
description: 'Footer note shown below the actions',
|
|
75
|
+
table: {
|
|
76
|
+
type: { summary: 'string' },
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
leftImage: {
|
|
80
|
+
control: 'text',
|
|
81
|
+
description: 'Image URL of the avatar collage shown on the left side',
|
|
82
|
+
table: {
|
|
83
|
+
type: { summary: 'string' },
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
rightImage: {
|
|
87
|
+
control: 'text',
|
|
88
|
+
description: 'Image URL of the avatar collage shown on the right side',
|
|
89
|
+
table: {
|
|
90
|
+
type: { summary: 'string' },
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
showImages: {
|
|
94
|
+
control: 'boolean',
|
|
95
|
+
description: 'Whether to show the avatar images',
|
|
96
|
+
table: {
|
|
97
|
+
type: { summary: 'boolean' },
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
background: {
|
|
101
|
+
control: 'text',
|
|
102
|
+
description: 'Background of the banner',
|
|
103
|
+
table: {
|
|
104
|
+
type: { summary: 'string' },
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
style: {
|
|
108
|
+
control: 'object',
|
|
109
|
+
description: 'Custom style for the banner',
|
|
110
|
+
table: {
|
|
111
|
+
type: { summary: 'object' },
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
export default meta;
|
|
117
|
+
export const Default = {
|
|
118
|
+
args: {
|
|
119
|
+
title: 'Real-time AI avatars for every conversation.',
|
|
120
|
+
description: 'Trusted by developers, startups, educators, and enterprises to build engaging AI experiences at scale:',
|
|
121
|
+
features: [
|
|
122
|
+
'Real-Time',
|
|
123
|
+
'Multilingual',
|
|
124
|
+
'API-first',
|
|
125
|
+
'Enterprise-ready',
|
|
126
|
+
'GDPR Compliant',
|
|
127
|
+
],
|
|
128
|
+
promoCode: 'PKAJ2HGO',
|
|
129
|
+
promoCodeLabel: 'YOUR PROMO CODE',
|
|
130
|
+
ctaText: 'Enjoy 1 month free on Starter',
|
|
131
|
+
footerText: 'Use Promo code at checkout and get 90 End-to-End API minutes or 180 Audio-to-Video API minutes free.',
|
|
132
|
+
leftImage: bannerAvatarsLeft,
|
|
133
|
+
rightImage: bannerAvatarsRight,
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
export const WithoutImages = {
|
|
137
|
+
args: {
|
|
138
|
+
...Default.args,
|
|
139
|
+
showImages: false,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
export const WithoutPromoCode = {
|
|
143
|
+
args: {
|
|
144
|
+
...Default.args,
|
|
145
|
+
promoCode: undefined,
|
|
146
|
+
footerText: undefined,
|
|
147
|
+
ctaText: 'Upgrade to Starter',
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
export const TitleAndCtaOnly = {
|
|
151
|
+
args: {
|
|
152
|
+
title: 'Real-time AI avatars for every conversation.',
|
|
153
|
+
description: undefined,
|
|
154
|
+
features: [],
|
|
155
|
+
ctaText: 'Get Started',
|
|
156
|
+
leftImage: bannerAvatarsLeft,
|
|
157
|
+
rightImage: bannerAvatarsRight,
|
|
158
|
+
},
|
|
159
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '@mui/material';
|
|
3
|
+
export const SkeletonLoader = ({ width = '100%', height = '100%', borderRadius = 'var(--spacing-tokens-size-in-px-spacing-sm)', animationDuration = 1.5, style, }) => {
|
|
4
|
+
return (_jsx(Box, { width: width, height: height, borderRadius: borderRadius, sx: {
|
|
5
|
+
background: 'linear-gradient(90deg, var(--color-background-bg-element) 25%, var(--color-background-bg-component) 50%, var(--color-background-bg-element) 75%)',
|
|
6
|
+
backgroundSize: '200% 100%',
|
|
7
|
+
animation: `shimmer ${animationDuration}s infinite linear`,
|
|
8
|
+
...style,
|
|
9
|
+
}, children: _jsx("style", { children: `
|
|
10
|
+
@keyframes shimmer {
|
|
11
|
+
0% {
|
|
12
|
+
background-position: 200% 0;
|
|
13
|
+
}
|
|
14
|
+
100% {
|
|
15
|
+
background-position: -200% 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
` }) }));
|
|
19
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { SkeletonLoader } from './SkeletonLoader';
|
|
3
|
+
declare const meta: Meta<typeof SkeletonLoader>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof SkeletonLoader>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const CustomAnimation: Story;
|
|
8
|
+
export declare const RoundedSkeleton: Story;
|