@beydesign/storybook 0.1.21 → 0.2.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/App.js +9 -9
- package/dist/stories/Agent/AgentCard.js +9 -9
- package/dist/stories/Agent/AgentCardSkeleton.js +1 -1
- package/dist/stories/Agent/CreateNewCard.js +4 -4
- package/dist/stories/Buttons/MainButton.js +51 -51
- package/dist/stories/Buttons/ToggleButtonGroup.js +4 -4
- package/dist/stories/Credits/CreditsCard.js +4 -4
- package/dist/stories/Credits/CreditsCardSkeleton.js +2 -2
- package/dist/stories/EntityCard/EntityCard.js +3 -3
- package/dist/stories/EntityCard/EntityCardSkeleton.js +1 -1
- package/dist/stories/Form/AutoComplete.js +10 -10
- package/dist/stories/Form/Checkbox.js +7 -7
- package/dist/stories/Form/Dropdown.js +16 -16
- package/dist/stories/Form/FileUpload/FileUpload.js +15 -15
- package/dist/stories/Form/FileUpload/FileUploading.js +8 -8
- package/dist/stories/Form/FileUpload/UploadedFile.js +2 -2
- package/dist/stories/Form/TextArea.js +7 -7
- package/dist/stories/Form/TextInput.js +10 -10
- package/dist/stories/Form/Toggle.js +5 -5
- package/dist/stories/Form/Toggle.stories.js +1 -1
- package/dist/stories/Foundations/Colors.js +69 -71
- package/dist/stories/Navigation/ComplexHeader.js +1 -1
- package/dist/stories/Navigation/Header.js +1 -1
- package/dist/stories/Navigation/NavItem.js +9 -9
- package/dist/stories/Navigation/NavItem.stories.js +2 -2
- package/dist/stories/Navigation/Sidebar.js +7 -8
- package/dist/stories/Navigation/Sidebar.stories.js +1 -1
- package/dist/stories/PlanCard/PlanCard.js +4 -4
- package/dist/stories/PlanCard/PlanCardSkeleton.js +1 -1
- package/dist/stories/StripeProduct/StripeProduct.js +5 -7
- package/dist/stories/StripeProduct/StripeProductCardSkeleton.js +1 -1
- package/dist/stories/Typography/Typography.js +1 -1
- package/dist/stories/UI/Avatar.js +6 -6
- package/dist/stories/UI/Badge.js +4 -4
- package/dist/stories/UI/CheckIcon.js +5 -5
- package/dist/stories/UI/CheckIcon.stories.js +1 -1
- package/dist/stories/UI/FeatureBanner.js +2 -2
- package/dist/stories/UI/HintBubble.js +3 -3
- package/dist/stories/UI/Logo.js +1 -1
- package/dist/stories/UI/Logo.stories.js +1 -1
- package/dist/stories/UI/Menu.js +10 -3
- package/dist/stories/UI/ProgressIndicator.js +1 -1
- package/dist/stories/UI/PromoBanner.js +6 -3
- package/dist/stories/UI/SkeletonLoader.js +1 -1
- package/dist/stories/UI/Stepper.js +12 -12
- package/package.json +2 -2
|
@@ -20,14 +20,14 @@ const StyledNavItem = styled.div `
|
|
|
20
20
|
&:hover {
|
|
21
21
|
.nav-item-icon {
|
|
22
22
|
color: ${({ $state }) => $state === NavItemState.Disabled
|
|
23
|
-
? 'var(--
|
|
24
|
-
: 'var(--
|
|
23
|
+
? 'var(--color-text-text-subtle)'
|
|
24
|
+
: 'var(--color-background-bg-brand-primary-hover)'} !important;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.nav-item-text {
|
|
28
28
|
color: ${({ $state }) => $state === NavItemState.Disabled
|
|
29
|
-
? 'var(--
|
|
30
|
-
: 'var(--
|
|
29
|
+
? 'var(--color-text-text-subtle)'
|
|
30
|
+
: 'var(--color-background-bg-brand-primary-hover)'} !important;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
`;
|
|
@@ -35,8 +35,8 @@ const StyledNavItem = styled.div `
|
|
|
35
35
|
const IconWrapper = styled.span `
|
|
36
36
|
display: inline-flex;
|
|
37
37
|
color: ${({ $state }) => $state === NavItemState.Active
|
|
38
|
-
? 'var(--
|
|
39
|
-
: 'var(--
|
|
38
|
+
? 'var(--color-background-bg-brand-primary)'
|
|
39
|
+
: 'var(--color-text-text-paragraph)'};
|
|
40
40
|
transition: color 0.3s ease-in-out;
|
|
41
41
|
`;
|
|
42
42
|
const TextWrapper = styled.span `
|
|
@@ -51,7 +51,7 @@ export const NavItem = ({ text, icon, state = NavItemState.Default, size = NavIt
|
|
|
51
51
|
};
|
|
52
52
|
const isCollapsed = size === NavItemSize.Collapsed;
|
|
53
53
|
return (_jsxs(StyledNavItem, { "$state": state, "$size": size, onClick: handleClick, className: className, title: isCollapsed ? text : undefined, children: [_jsx("svg", { width: "5", height: "36", viewBox: "0 0 5 36", fill: state === NavItemState.Active
|
|
54
|
-
? 'var(--
|
|
54
|
+
? 'var(--color-background-bg-brand-primary)'
|
|
55
55
|
: 'transparent', xmlns: "http://www.w3.org/2000/svg", style: {
|
|
56
56
|
transition: 'fill 0.3s ease-in-out',
|
|
57
57
|
position: 'absolute',
|
|
@@ -61,6 +61,6 @@ export const NavItem = ({ text, icon, state = NavItemState.Default, size = NavIt
|
|
|
61
61
|
}) }), !isCollapsed && (_jsx(TextWrapper, { className: "nav-item-text", children: _jsx(Typography, { size: TypographySize.TextS, weight: state === NavItemState.Active
|
|
62
62
|
? TypographyWeight.SemiBold
|
|
63
63
|
: TypographyWeight.Medium, className: "nav-item-text", color: state === NavItemState.Active
|
|
64
|
-
? 'var(--
|
|
65
|
-
: 'var(--
|
|
64
|
+
? 'var(--color-background-bg-brand-primary)'
|
|
65
|
+
: 'var(--color-text-text-paragraph)', children: text }) })), showBadge && !isCollapsed && (_jsx(Badge, { size: BadgeSize.xs, icon: "ClockCountdown", showIcon: true, text: "Coming Soon", color: BadgeColor.Default }))] })] }));
|
|
66
66
|
};
|
|
@@ -80,7 +80,7 @@ export const SidebarExpanded = {
|
|
|
80
80
|
flexDirection: 'column',
|
|
81
81
|
gap: '8px',
|
|
82
82
|
padding: '16px',
|
|
83
|
-
backgroundColor: 'var(--
|
|
83
|
+
backgroundColor: 'var(--color-background-bg-white)',
|
|
84
84
|
borderRadius: '8px',
|
|
85
85
|
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',
|
|
86
86
|
}, children: [_jsx(NavItem, { text: "Home", icon: "House", size: NavItemSize.Expanded, state: NavItemState.Active }), _jsx(NavItem, { text: "Settings", icon: "Gear", size: NavItemSize.Expanded }), _jsx(NavItem, { text: "Notifications", icon: "Bell", size: NavItemSize.Expanded }), _jsx(NavItem, { text: "Messages", icon: "ChatText", size: NavItemSize.Expanded }), _jsx(NavItem, { text: "Profile", icon: "User", size: NavItemSize.Expanded }), _jsx(NavItem, { text: "Analytics", icon: "ChartBar", size: NavItemSize.Expanded, showBadge: true, state: NavItemState.Disabled })] })),
|
|
@@ -90,7 +90,7 @@ export const SidebarCollapsed = {
|
|
|
90
90
|
display: 'flex',
|
|
91
91
|
flexDirection: 'column',
|
|
92
92
|
gap: '8px',
|
|
93
|
-
backgroundColor: 'var(--
|
|
93
|
+
backgroundColor: 'var(--color-background-bg-white)',
|
|
94
94
|
borderRadius: '8px',
|
|
95
95
|
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',
|
|
96
96
|
}, children: [_jsx(NavItem, { text: "Home", icon: "House", size: NavItemSize.Collapsed, state: NavItemState.Active }), _jsx(NavItem, { text: "Settings", icon: "Gear", size: NavItemSize.Collapsed }), _jsx(NavItem, { text: "Notifications", icon: "Bell", size: NavItemSize.Collapsed }), _jsx(NavItem, { text: "Messages", icon: "ChatText", size: NavItemSize.Collapsed }), _jsx(NavItem, { text: "Profile", icon: "User", size: NavItemSize.Collapsed }), _jsx(NavItem, { text: "Analytics", icon: "ChartBar", state: NavItemState.Disabled, size: NavItemSize.Collapsed })] })),
|
|
@@ -11,8 +11,8 @@ import { MainButton, ButtonDisplayMode, ButtonHierarchy, ButtonShape, ButtonSize
|
|
|
11
11
|
const StyledSidebar = styled.div `
|
|
12
12
|
display: flex;
|
|
13
13
|
flex-direction: column;
|
|
14
|
-
background-color: var(--
|
|
15
|
-
border-right: 1px solid var(--
|
|
14
|
+
background-color: var(--color-background-bg-component);
|
|
15
|
+
border-right: 1px solid var(--color-border-border-component);
|
|
16
16
|
height: 100vh;
|
|
17
17
|
width: ${({ $size }) => ($size === SidebarSize.Expanded ? '280px' : '80px')};
|
|
18
18
|
transition: width 0.3s ease-in-out;
|
|
@@ -59,7 +59,7 @@ const NavSection = styled.div `
|
|
|
59
59
|
transition: all 0.3s ease-in-out;
|
|
60
60
|
`;
|
|
61
61
|
const SectionTitle = styled.div `
|
|
62
|
-
color: var(--
|
|
62
|
+
color: var(--color-text-text-subtle);
|
|
63
63
|
padding: ${({ $size }) => $size === SidebarSize.Expanded ? '0px 28px' : '0px'};
|
|
64
64
|
display: ${({ $size }) => $size === SidebarSize.Collapsed ? 'flex' : 'block'};
|
|
65
65
|
opacity: ${({ $size }) => ($size === SidebarSize.Collapsed ? 0 : 0.5)};
|
|
@@ -67,11 +67,10 @@ const SectionTitle = styled.div `
|
|
|
67
67
|
transition: all 0.3s ease-in-out;
|
|
68
68
|
`;
|
|
69
69
|
const Separator = styled.div `
|
|
70
|
-
height:
|
|
71
|
-
background-color: var(--
|
|
70
|
+
height: 1px;
|
|
71
|
+
background-color: var(--color-border-border-divider);
|
|
72
72
|
padding: ${({ $size }) => $size === SidebarSize.Collapsed ? '0px 8px' : '0px 28px'};
|
|
73
73
|
margin: ${({ $size }) => $size === SidebarSize.Collapsed ? '16px 12px' : '16px 18px'};
|
|
74
|
-
opacity: 0.05;
|
|
75
74
|
transition: all 0.3s ease-in-out;
|
|
76
75
|
`;
|
|
77
76
|
const BottomContainer = styled.div `
|
|
@@ -90,7 +89,7 @@ const NavItemWrapper = ({ item, isCollapsed, }) => {
|
|
|
90
89
|
};
|
|
91
90
|
return (_jsx(NavItem, { text: item.text, icon: item.icon, state: item.state || NavItemState.Default, size: isCollapsed ? NavItemSize.Collapsed : NavItemSize.Expanded, showBadge: isCollapsed ? false : item.showBadge, onClick: handleClick }));
|
|
92
91
|
};
|
|
93
|
-
export const Sidebar = ({ size = SidebarSize.Expanded, className = '', navSections, bottomNavItems = [], credits, loadingCredits = false, onToggle, logoProps = { color: 'var(--
|
|
92
|
+
export const Sidebar = ({ size = SidebarSize.Expanded, className = '', navSections, bottomNavItems = [], credits, loadingCredits = false, onToggle, logoProps = { color: 'var(--color-foreground-fg-brand-logo)' }, }) => {
|
|
94
93
|
const [sidebarSize, setSidebarSize] = useState(size);
|
|
95
94
|
const handleToggle = () => {
|
|
96
95
|
const newSize = sidebarSize === SidebarSize.Expanded
|
|
@@ -105,7 +104,7 @@ export const Sidebar = ({ size = SidebarSize.Expanded, className = '', navSectio
|
|
|
105
104
|
const cardSize = isCollapsed
|
|
106
105
|
? CreditsCardSize.Collapsed
|
|
107
106
|
: CreditsCardSize.Expanded;
|
|
108
|
-
return (_jsxs(SidebarContainer, { className: className, children: [_jsxs(StyledSidebar, { "$size": sidebarSize, children: [_jsx(LogoContainer, { "$size": sidebarSize, children: _jsx(Logo, { variant: isCollapsed ? LogoVariant.Icon : LogoVariant.Horizontal, color: logoProps.color, gradient: logoProps.gradient }) }), _jsx(NavItemsContainer, { children: navSections.map((section, sectionIndex) => (_jsxs(React.Fragment, { children: [_jsxs(NavSection, { children: [section.title && (_jsx(SectionTitle, { "$size": sidebarSize, children: _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: "var(--
|
|
107
|
+
return (_jsxs(SidebarContainer, { className: className, children: [_jsxs(StyledSidebar, { "$size": sidebarSize, children: [_jsx(LogoContainer, { "$size": sidebarSize, children: _jsx(Logo, { variant: isCollapsed ? LogoVariant.Icon : LogoVariant.Horizontal, color: logoProps.color, gradient: logoProps.gradient }) }), _jsx(NavItemsContainer, { children: navSections.map((section, sectionIndex) => (_jsxs(React.Fragment, { children: [_jsxs(NavSection, { children: [section.title && (_jsx(SectionTitle, { "$size": sidebarSize, children: _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: "var(--color-text-text-paragraph)", className: isCollapsed ? 'hidden' : '', children: isCollapsed
|
|
109
108
|
? section.title.split(' ')[0]
|
|
110
109
|
: section.title }) })), section.items.map((item, itemIndex) => (_jsx(NavItemWrapper, { item: item, isCollapsed: isCollapsed }, `${item.text}-${itemIndex}`)))] }), sectionIndex < navSections.length - 1 &&
|
|
111
110
|
section.showSeparator && _jsx(Separator, { "$size": sidebarSize })] }, `section-${sectionIndex}`))) }), _jsx(BottomContainer, { children: _jsxs(Box, { display: "flex", flexDirection: "column", gap: "16px", children: [_jsx(Box, { display: 'flex', justifyContent: 'center', padding: isCollapsed ? '8px' : '0px 12px', children: loadingCredits ? (_jsx(CreditsCardSkeleton, { size: cardSize })) : credits ? (_jsx(CreditsCard, { size: cardSize, maxCredits: credits.maxCredits, usedCredits: credits.usedCredits, managedAgentsInfoText: credits.managedAgentsInfoText, speechToVideoInfoText: credits.speechToVideoInfoText, onUpgradeClick: credits.onUpgradeClick, overUsageEnabled: credits.overUsageEnabled, overUsedCredits: credits.overUsedCredits })) : null }), bottomNavItems.map((item, index) => (_jsx(NavItemWrapper, { item: item, isCollapsed: isCollapsed }, `bottom-${item.text}-${index}`)))] }) })] }), _jsx(ToggleButtonWrapper, { children: isCollapsed ? (_jsx(MainButton, { text: "Expand", size: ButtonSize.xxs, displayIconMode: ButtonDisplayMode.Only, displayIcon: "CaretRight", onClick: handleToggle, shape: ButtonShape.Circle, hierarchy: ButtonHierarchy.Tertiary, style: {
|
|
@@ -114,7 +114,7 @@ const defaultBottomNavItems = [
|
|
|
114
114
|
];
|
|
115
115
|
export const InBoxContainer = {
|
|
116
116
|
render: (args) => (_jsxs(Stack, { direction: 'row', height: '100%', width: '100%', children: [_jsx(Box, { height: '100%', display: 'flex', flexDirection: 'column', justifyContent: 'space-between', sx: {
|
|
117
|
-
border: '1px solid var(--
|
|
117
|
+
border: '1px solid var(--color-border-border-component)',
|
|
118
118
|
borderRadius: '8px',
|
|
119
119
|
boxShadow: '0 4px 12px rgba(0, 0, 0, 0.1)',
|
|
120
120
|
maxWidth: '280px',
|
|
@@ -6,8 +6,8 @@ import { Badge, BadgeColor, BadgeSize, CheckIcon, CheckIconColor, CheckIconSize,
|
|
|
6
6
|
export const PlanCard = ({ title, description, price, priceSuffix = '/month', badgeText, badgeColor = BadgeColor.Lemon, highlighted = false, featuresTitle = 'This includes:', features = [], buttonText = 'Upgrade', onButtonClick, buttonDisabled = false, buttonHierarchy = ButtonHierarchy.Primary, buttonLoading = false, width = '286px', style, testId, }) => {
|
|
7
7
|
const planKey = title?.toLowerCase()?.replace(/\s+/g, '-');
|
|
8
8
|
return (_jsxs(Box, { width: width, display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-2xl)', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', bgcolor: highlighted
|
|
9
|
-
? 'var(--
|
|
10
|
-
: 'var(--
|
|
11
|
-
? 'var(--
|
|
12
|
-
: 'var(--
|
|
9
|
+
? 'var(--color-background-bg-card-highlight)'
|
|
10
|
+
: 'var(--color-background-bg-component)', border: `1px solid ${highlighted
|
|
11
|
+
? 'var(--color-border-border-brand)'
|
|
12
|
+
: 'var(--color-border-border-subtle)'}`, boxSizing: 'border-box', style: style, "data-testid": testId ?? `${planKey}-plan-card`, children: [_jsxs(Box, { display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [_jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', minHeight: '24px', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [_jsx(Typography, { size: TypographySize.HeadingM, weight: TypographyWeight.Bold, color: 'var(--color-text-text-title)', children: title }), badgeText && (_jsx(Badge, { text: badgeText, color: badgeColor, size: BadgeSize.xs, fill: true }))] }), description && (_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: 'var(--color-text-text-paragraph)', textStyle: { textAlign: 'left' }, children: description })), price && (_jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'baseline', gap: '2px', children: [_jsx(Typography, { size: TypographySize.HeadingL, weight: TypographyWeight.Bold, color: 'var(--color-text-text-title)', children: price }), priceSuffix && (_jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: 'var(--color-text-text-paragraph)', children: priceSuffix }))] }))] }), buttonText && (_jsx(MainButton, { text: buttonText, hierarchy: buttonHierarchy, size: ButtonSize.md, disabled: buttonDisabled, loading: buttonLoading, onClick: onButtonClick, style: { width: '100%' }, testId: `${planKey}-plan-button` })), features.length > 0 && (_jsxs(Box, { display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', alignItems: 'flex-start', children: [_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: 'var(--color-text-text-paragraph)', children: featuresTitle }), features.map((feature, index) => (_jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'flex-start', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', width: '100%', children: [_jsx(CheckIcon, { color: CheckIconColor.Violet, size: CheckIconSize.xs, type: CheckIconType.Duotone }), _jsx(Typography, { size: TypographySize.TextM, weight: TypographyWeight.Regular, color: 'var(--color-text-text-title)', textStyle: { textAlign: 'left' }, children: feature })] }, `${index}-${feature}`)))] }))] }));
|
|
13
13
|
};
|
|
@@ -2,5 +2,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box } from '@mui/material';
|
|
3
3
|
import { SkeletonLoader } from '../UI';
|
|
4
4
|
export const PlanCardSkeleton = ({ showBadge = true, showButton = true, showFeatures = true, featuresCount = 4, width = '286px', style, testId, }) => {
|
|
5
|
-
return (_jsxs(Box, { width: width, display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-2xl)', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', bgcolor: 'var(--
|
|
5
|
+
return (_jsxs(Box, { width: width, display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-2xl)', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', bgcolor: 'var(--color-background-bg-component)', border: '1px solid var(--color-border-border-subtle)', boxSizing: 'border-box', style: style, "data-testid": testId, children: [_jsxs(Box, { display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [_jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [_jsx(SkeletonLoader, { width: '40%', height: '24px', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)' }), showBadge && (_jsx(SkeletonLoader, { width: '88px', height: '24px', borderRadius: 'var(--spacing-tokens-size-in-px-radius-radius-full)' }))] }), _jsx(SkeletonLoader, { width: '100%', height: '20px', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)' }), _jsx(SkeletonLoader, { width: '50%', height: '32px', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)' })] }), showButton && (_jsx(SkeletonLoader, { width: '100%', height: '36px', borderRadius: 'var(--spacing-tokens-size-in-px-radius-radius-xs)' })), showFeatures && (_jsxs(Box, { display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', alignItems: 'flex-start', children: [_jsx(SkeletonLoader, { width: '96px', height: '20px', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)' }), Array.from({ length: featuresCount }).map((_, index) => (_jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', width: '100%', children: [_jsx(SkeletonLoader, { width: '20px', height: '20px', borderRadius: 'var(--spacing-tokens-size-in-px-radius-radius-full)' }), _jsx(SkeletonLoader, { width: index % 2 === 0 ? '80%' : '60%', height: '18px', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)' })] }, index)))] }))] }));
|
|
6
6
|
};
|
|
@@ -7,12 +7,10 @@ import React from 'react';
|
|
|
7
7
|
import { Badge, BadgeColor, BadgeSize } from '../UI';
|
|
8
8
|
export const StripeProduct = ({ className, description, features, isMostPopular, isEnterprisePlan, style, title, duration, price, buttonProps, bubbleText, bubbleTooltip, bubbleTopOffset, testId, }) => {
|
|
9
9
|
return (_jsxs(Box, { display: 'flex', flexDirection: 'column', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-2xl)', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', bgcolor: isMostPopular
|
|
10
|
-
? 'var(--
|
|
11
|
-
: 'var(--
|
|
12
|
-
? '1.5px solid var(--colors-light-border-border-brand)'
|
|
13
|
-
: 'none', position: 'relative', boxShadow: '0px 0px 10px 0px rgba(0, 0, 0, 0.1)', style: style, className: className, "data-testid": testId, children: [bubbleText && (_jsx(Box, { position: 'absolute', top: bubbleTopOffset || '-4%', right: 0, left: 0, children: _jsx(Badge, { text: bubbleText, color: BadgeColor.Yellow, children: bubbleTooltip, size: BadgeSize.xs, fill: true }) })), _jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', children: [_jsx(Typography, { size: TypographySize.HeadingM, weight: TypographyWeight.Bold, color: 'var(--colors-light-text-text-title)', children: title }), isMostPopular && (_jsx(Box, { display: 'flex', justifyContent: 'center', alignItems: 'center', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)', bgcolor: 'var(--primitives-desktop-primary-brand-violet-200)', borderRadius: 'var(--spacing-tokens-size-in-px-radius-radius-sm)', children: _jsx(Typography, { size: TypographySize.HeadingXS, weight: TypographyWeight.Regular, color: 'var(--colors-light-text-text-accent)', children: "Most popular" }) }))] }), _jsx(Typography, { size: TypographySize.HeadingM, weight: TypographyWeight.Regular, color: 'var(--colors-light-text-text-paragraph)', textStyle: { textAlign: 'left', minHeight: '100px' }, children: description }), _jsx(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'end', children: isEnterprisePlan ? (_jsx(Typography, { size: TypographySize.HeadingL, weight: TypographyWeight.Bold, color: 'var(--colors-light-text-text-title)', children: "Custom" })) : (_jsxs(React.Fragment, { children: [_jsx(Typography, { size: TypographySize.HeadingL, weight: TypographyWeight.Bold, color: 'var(--colors-light-text-text-title)', children: price }), _jsxs(Typography, { size: TypographySize.HeadingXS, weight: TypographyWeight.Regular, color: 'var(--colors-light-text-text-paragraph)', children: ["/", duration] })] })) }), buttonProps && (_jsx(MainButton, { disabled: buttonProps?.disabled, loading: buttonProps?.loading, onClick: buttonProps?.onClick, text: buttonProps?.text, size: buttonProps?.size || ButtonSize.lg, hierarchy: buttonProps?.hierarchy || ButtonHierarchy.Primary, style: {
|
|
10
|
+
? 'var(--color-background-bg-card-highlight)'
|
|
11
|
+
: 'var(--color-background-bg-component)', border: isMostPopular ? '1.5px solid var(--color-border-border-brand)' : 'none', position: 'relative', boxShadow: '0px 0px 10px 0px rgba(0, 0, 0, 0.1)', style: style, className: className, "data-testid": testId, children: [bubbleText && (_jsx(Box, { position: 'absolute', top: bubbleTopOffset || '-4%', right: 0, left: 0, children: _jsx(Badge, { text: bubbleText, color: BadgeColor.Yellow, children: bubbleTooltip, size: BadgeSize.xs, fill: true }) })), _jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', children: [_jsx(Typography, { size: TypographySize.HeadingM, weight: TypographyWeight.Bold, color: 'var(--color-text-text-title)', children: title }), isMostPopular && (_jsx(Box, { display: 'flex', justifyContent: 'center', alignItems: 'center', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)', bgcolor: 'var(--color-background-bg-badge-accent-brand-violet)', borderRadius: 'var(--spacing-tokens-size-in-px-radius-radius-sm)', children: _jsx(Typography, { size: TypographySize.HeadingXS, weight: TypographyWeight.Regular, color: 'var(--color-text-text-accent)', children: "Most popular" }) }))] }), _jsx(Typography, { size: TypographySize.HeadingM, weight: TypographyWeight.Regular, color: 'var(--color-text-text-paragraph)', textStyle: { textAlign: 'left', minHeight: '100px' }, children: description }), _jsx(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'end', children: isEnterprisePlan ? (_jsx(Typography, { size: TypographySize.HeadingL, weight: TypographyWeight.Bold, color: 'var(--color-text-text-title)', children: "Custom" })) : (_jsxs(React.Fragment, { children: [_jsx(Typography, { size: TypographySize.HeadingL, weight: TypographyWeight.Bold, color: 'var(--color-text-text-title)', children: price }), _jsxs(Typography, { size: TypographySize.HeadingXS, weight: TypographyWeight.Regular, color: 'var(--color-text-text-paragraph)', children: ["/", duration] })] })) }), buttonProps && (_jsx(MainButton, { disabled: buttonProps?.disabled, loading: buttonProps?.loading, onClick: buttonProps?.onClick, text: buttonProps?.text, size: buttonProps?.size || ButtonSize.lg, hierarchy: buttonProps?.hierarchy || ButtonHierarchy.Primary, style: {
|
|
14
12
|
margin: 'var(--spacing-tokens-size-in-px-spacing-spacing-3xl) 0',
|
|
15
|
-
} })), features && features?.length > 0 && (_jsxs(Box, { display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', alignItems: 'flex-start', children: [_jsx(Typography, { size: TypographySize.TextM, weight: TypographyWeight.Medium, color: 'var(--
|
|
13
|
+
} })), features && features?.length > 0 && (_jsxs(Box, { display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', alignItems: 'flex-start', children: [_jsx(Typography, { size: TypographySize.TextM, weight: TypographyWeight.Medium, color: 'var(--color-text-text-title)', children: "This includes:" }), features.map((feature, index) => {
|
|
16
14
|
const isHeading = feature?.startsWith('-');
|
|
17
15
|
return (_jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'flex-start', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [!isHeading && (_jsx(Box, { width: '18px', height: '18px', bgcolor: 'var(--primitives-desktop-primary-brand-violet-100)', borderRadius: 'var(--spacing-tokens-size-in-px-radius-radius-full)', display: 'flex', justifyContent: 'center', alignItems: 'center', children: getIconComponent('Check', {
|
|
18
16
|
size: '12px',
|
|
@@ -20,7 +18,7 @@ export const StripeProduct = ({ className, description, features, isMostPopular,
|
|
|
20
18
|
}) })), _jsx(Typography, { size: TypographySize.TextS, weight: isHeading
|
|
21
19
|
? TypographyWeight.Medium
|
|
22
20
|
: TypographyWeight.Regular, color: isHeading
|
|
23
|
-
? 'var(--
|
|
24
|
-
: 'var(--
|
|
21
|
+
? 'var(--color-text-text-title)'
|
|
22
|
+
: 'var(--color-text-text-paragraph)', textStyle: { textAlign: 'left' }, children: isHeading ? feature?.slice(1)?.trim() : feature })] }, `${index}`));
|
|
25
23
|
})] }))] }));
|
|
26
24
|
};
|
|
@@ -2,5 +2,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box } from '@mui/material';
|
|
3
3
|
import { SkeletonLoader } from '../UI';
|
|
4
4
|
export const StripeProductCardSkeleton = ({ width = 'auto', showMostPopular = false, showBubble = false, showButton = true, showFeatures = true, featuresCount = 5, style, testId, }) => {
|
|
5
|
-
return (_jsxs(Box, { width: width, display: "flex", flexDirection: "column", borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-2xl)', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', bgcolor: "var(--
|
|
5
|
+
return (_jsxs(Box, { width: width, display: "flex", flexDirection: "column", borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-2xl)', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', bgcolor: "var(--color-background-bg-component)", position: "relative", boxShadow: '0px 0px 10px 0px rgba(0, 0, 0, 0.1)', style: style, "data-testid": testId, children: [showBubble && (_jsx(Box, { position: "absolute", top: "-4%", left: "50%", sx: { transform: 'translateX(-50%)' }, width: "50%", children: _jsx(SkeletonLoader, { height: "24px", borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)" }) })), _jsxs(Box, { display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center", children: [_jsx(SkeletonLoader, { width: "40%", height: "28px", borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)" }), showMostPopular && (_jsx(SkeletonLoader, { width: "100px", height: "28px", borderRadius: "var(--spacing-tokens-size-in-px-radius-radius-sm)" }))] }), _jsxs(Box, { display: "flex", flexDirection: "column", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-sm)", minHeight: "100px", children: [_jsx(SkeletonLoader, { width: "100%", height: "20px", borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)" }), _jsx(SkeletonLoader, { width: "95%", height: "20px", borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)" }), _jsx(SkeletonLoader, { width: "80%", height: "20px", borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)" })] }), _jsxs(Box, { display: "flex", flexDirection: "row", alignItems: "end", gap: "4px", children: [_jsx(SkeletonLoader, { width: "80px", height: "36px", borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)" }), _jsx(SkeletonLoader, { width: "60px", height: "20px", borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)" })] }), showButton && (_jsx(Box, { margin: 'var(--spacing-tokens-size-in-px-spacing-spacing-3xl) 0', children: _jsx(SkeletonLoader, { width: "100%", height: "44px", borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-md)" }) })), showFeatures && (_jsxs(Box, { display: "flex", flexDirection: "column", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-xl)", alignItems: "flex-start", children: [_jsx(SkeletonLoader, { width: "120px", height: "20px", borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)" }), Array.from({ length: featuresCount }).map((_, index) => (_jsxs(Box, { display: "flex", flexDirection: "row", alignItems: "flex-start", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-md)", width: "100%", children: [_jsx(SkeletonLoader, { width: "18px", height: "18px", borderRadius: "var(--spacing-tokens-size-in-px-radius-radius-full)" }), _jsx(SkeletonLoader, { width: index % 3 === 0 ? '85%' : index % 3 === 1 ? '75%' : '90%', height: "18px", borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)" })] }, index)))] }))] }));
|
|
6
6
|
};
|
|
@@ -5,7 +5,7 @@ export const Typography = ({ text, color, size = TypographySize.HeadingL, weight
|
|
|
5
5
|
const sizeToken = getTypographySizeToken(size);
|
|
6
6
|
const weightToken = getTypographyWeightToken(weight);
|
|
7
7
|
const { fontSize, fontWeight, fontFamily, lineHeight, letterSpacing, paragraphIndent, paragraphSpacing, textDecoration, textTransform, } = getTextStyles(sizeToken, weightToken);
|
|
8
|
-
const requiredColor = 'var(--
|
|
8
|
+
const requiredColor = 'var(--color-text-text-error)';
|
|
9
9
|
return (_jsxs("span", { className: className, style: {
|
|
10
10
|
fontSize: fontSize,
|
|
11
11
|
fontWeight: fontWeight,
|
|
@@ -26,13 +26,13 @@ export const Avatar = ({ avatarStyle = AvatarStyle.Placeholder, border = false,
|
|
|
26
26
|
const getColor = (avatarStyle) => {
|
|
27
27
|
switch (avatarStyle) {
|
|
28
28
|
case AvatarStyle.Letters:
|
|
29
|
-
return 'var(--
|
|
29
|
+
return 'var(--color-foreground-fg-primary)';
|
|
30
30
|
case AvatarStyle.Placeholder:
|
|
31
|
-
return 'var(--
|
|
31
|
+
return 'var(--color-foreground-fg-tertiary)';
|
|
32
32
|
case AvatarStyle.Picture:
|
|
33
|
-
return 'var(--
|
|
33
|
+
return 'var(--color-foreground-fg-secondary)';
|
|
34
34
|
default:
|
|
35
|
-
return 'var(--
|
|
35
|
+
return 'var(--color-foreground-fg-tertiary)';
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
const getTextSize = () => {
|
|
@@ -55,9 +55,9 @@ export const Avatar = ({ avatarStyle = AvatarStyle.Placeholder, border = false,
|
|
|
55
55
|
width: dimensions,
|
|
56
56
|
height: dimensions,
|
|
57
57
|
border: border
|
|
58
|
-
? '1px solid var(--
|
|
58
|
+
? '1px solid var(--color-border-border-component)'
|
|
59
59
|
: 'none',
|
|
60
|
-
backgroundColor: 'var(--
|
|
60
|
+
backgroundColor: 'var(--color-background-bg-card-highlight)',
|
|
61
61
|
color: getColor(avatarStyle),
|
|
62
62
|
fontSize: getTextSize(),
|
|
63
63
|
borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-11xl)',
|
package/dist/stories/UI/Badge.js
CHANGED
|
@@ -7,7 +7,7 @@ export const Badge = ({ color = BadgeColor.Default, size = BadgeSize.md, text, c
|
|
|
7
7
|
const getBackgroundColor = (color) => {
|
|
8
8
|
switch (color) {
|
|
9
9
|
case BadgeColor.Default:
|
|
10
|
-
return 'var(--
|
|
10
|
+
return 'var(--color-background-bg-badge-accent-gray)';
|
|
11
11
|
case BadgeColor.Violet:
|
|
12
12
|
return 'var(--primitives-desktop-primary-brand-violet-100)';
|
|
13
13
|
case BadgeColor.Lemon:
|
|
@@ -31,7 +31,7 @@ export const Badge = ({ color = BadgeColor.Default, size = BadgeSize.md, text, c
|
|
|
31
31
|
const getTextColor = () => {
|
|
32
32
|
switch (color) {
|
|
33
33
|
case BadgeColor.Default:
|
|
34
|
-
return 'var(--
|
|
34
|
+
return 'var(--color-text-text-title)';
|
|
35
35
|
case BadgeColor.Violet:
|
|
36
36
|
return 'var(--primitives-desktop-primary-brand-violet-800)';
|
|
37
37
|
case BadgeColor.Lemon:
|
|
@@ -49,7 +49,7 @@ export const Badge = ({ color = BadgeColor.Default, size = BadgeSize.md, text, c
|
|
|
49
49
|
case BadgeColor.Pink:
|
|
50
50
|
return 'var(--primitives-desktop-secondary-pink-800)';
|
|
51
51
|
case BadgeColor.DarkTransparent:
|
|
52
|
-
return 'var(--
|
|
52
|
+
return 'var(--color-text-text-white)';
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
const getBorder = (color) => {
|
|
@@ -73,7 +73,7 @@ export const Badge = ({ color = BadgeColor.Default, size = BadgeSize.md, text, c
|
|
|
73
73
|
case BadgeColor.Pink:
|
|
74
74
|
return '1px solid var(--primitives-desktop-secondary-pink-300)';
|
|
75
75
|
case BadgeColor.DarkTransparent:
|
|
76
|
-
return '1px solid rgba(var(--
|
|
76
|
+
return '1px solid rgba(var(--color-background-bg-component-dark), 0.9)';
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
const getPadding = (size) => {
|
|
@@ -2,15 +2,15 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box } from '@mui/material';
|
|
3
3
|
import { CheckIconColor, CheckIconSize, CheckIconType, } from './types';
|
|
4
4
|
import { getIconComponent } from '../../utils';
|
|
5
|
-
const WHITE = 'var(--
|
|
5
|
+
const WHITE = 'var(--color-foreground-fg-on-primary-accent-color)';
|
|
6
6
|
const COLOR_MAP = {
|
|
7
7
|
[CheckIconColor.Violet]: {
|
|
8
|
-
accent: 'var(--
|
|
9
|
-
subtle: 'var(--
|
|
8
|
+
accent: 'var(--color-foreground-fg-accent-violet)',
|
|
9
|
+
subtle: 'var(--color-background-bg-badge-accent-brand-violet)',
|
|
10
10
|
},
|
|
11
11
|
[CheckIconColor.Green]: {
|
|
12
|
-
accent: 'var(--
|
|
13
|
-
subtle: 'var(--
|
|
12
|
+
accent: 'var(--color-foreground-fg-success)',
|
|
13
|
+
subtle: 'var(--color-background-bg-badge-accent-success)',
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
16
|
const SIZE_MAP = {
|
|
@@ -43,6 +43,6 @@ export const AllVariants = {
|
|
|
43
43
|
render: () => (_jsx(Box, { display: "flex", flexDirection: "column", gap: 3, children: Object.values(CheckIconType).map((type) => (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 1, children: [_jsx("span", { style: {
|
|
44
44
|
fontFamily: 'Figtree, sans-serif',
|
|
45
45
|
fontSize: 12,
|
|
46
|
-
color: 'var(--
|
|
46
|
+
color: 'var(--color-text-text-subtle)',
|
|
47
47
|
}, children: type }), Object.values(CheckIconColor).map((color) => (_jsx(Box, { display: "flex", alignItems: "center", gap: 2, children: Object.values(CheckIconSize).map((size) => (_jsx(CheckIcon, { color: color, type: type, size: size }, `${color}-${type}-${size}`))) }, color)))] }, type))) })),
|
|
48
48
|
};
|
|
@@ -13,7 +13,7 @@ export const FeatureBanner = ({ title, description, actions = [], media = Featur
|
|
|
13
13
|
: ButtonHierarchy.SecondaryColor, onClick: action.onClick, style: action.primary
|
|
14
14
|
? undefined
|
|
15
15
|
: {
|
|
16
|
-
border: '1px solid var(--
|
|
16
|
+
border: '1px solid var(--color-border-border-component)',
|
|
17
17
|
}, testId: testId ? `${testId}-action-${index}` : undefined }, `${action.text}-${index}`));
|
|
18
18
|
const renderMedia = () => {
|
|
19
19
|
if (media === FeatureBannerMedia.None || !mediaImage)
|
|
@@ -30,5 +30,5 @@ export const FeatureBanner = ({ title, description, actions = [], media = Featur
|
|
|
30
30
|
background: bannerBackground,
|
|
31
31
|
boxSizing: 'border-box',
|
|
32
32
|
...customStyle,
|
|
33
|
-
}, "data-testid": testId, children: [_jsxs(Box, { display: "flex", flexDirection: "column", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-xl)", flex: 1, minWidth: 0, children: [_jsxs(Box, { display: "flex", flexDirection: "column", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-md)", children: [title && (_jsx(Typography, { size: TypographySize.HeadingM, weight: TypographyWeight.Bold, color: "var(--
|
|
33
|
+
}, "data-testid": testId, children: [_jsxs(Box, { display: "flex", flexDirection: "column", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-xl)", flex: 1, minWidth: 0, children: [_jsxs(Box, { display: "flex", flexDirection: "column", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-md)", children: [title && (_jsx(Typography, { size: TypographySize.HeadingM, weight: TypographyWeight.Bold, color: "var(--color-text-text-title)", children: title })), description && (_jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: "var(--color-text-text-label)", children: description }))] }), actions.length > 0 && (_jsx(Box, { display: "flex", alignItems: "center", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-md)", children: actions.map(renderAction) }))] }), renderMedia()] }));
|
|
34
34
|
};
|
|
@@ -21,8 +21,8 @@ export const HintBubble = ({ text, size = HintBubbleSize.md, type = HintBubbleTy
|
|
|
21
21
|
};
|
|
22
22
|
const getTypographyColor = () => {
|
|
23
23
|
if (type === HintBubbleType.Error)
|
|
24
|
-
return 'var(--
|
|
25
|
-
return 'var(--
|
|
24
|
+
return 'var(--color-text-text-error)';
|
|
25
|
+
return 'var(--color-text-text-title)';
|
|
26
26
|
};
|
|
27
|
-
return (_jsx(Box, { borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', bgcolor: 'var(--
|
|
27
|
+
return (_jsx(Box, { borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', bgcolor: 'var(--color-background-bg-card-highlight)', padding: getPadding(), gap: '10px', sx: style, children: _jsx(Typography, { size: getTypographySize(), weight: getTypographyWeight(), color: getTypographyColor(), children: text }) }));
|
|
28
28
|
};
|
package/dist/stories/UI/Logo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { LogoVariant } from './types';
|
|
3
|
-
export const Logo = ({ variant = LogoVariant.Horizontal, color = 'var(--
|
|
3
|
+
export const Logo = ({ variant = LogoVariant.Horizontal, color = 'var(--color-background-bg-brand-primary)', gradient, className = '', svgUrl, }) => {
|
|
4
4
|
const logoColor = gradient ? 'url(#gradient)' : color;
|
|
5
5
|
if (svgUrl) {
|
|
6
6
|
const maxDimensions = {
|
package/dist/stories/UI/Menu.js
CHANGED
|
@@ -21,8 +21,8 @@ export const Menu = ({ icon = 'DotsThree', items, style, testKey, size = ButtonS
|
|
|
21
21
|
};
|
|
22
22
|
const getColor = (action) => {
|
|
23
23
|
if (action?.destructive)
|
|
24
|
-
return 'var(--
|
|
25
|
-
return 'var(--
|
|
24
|
+
return 'var(--color-text-text-error)';
|
|
25
|
+
return 'var(--color-text-text-title)';
|
|
26
26
|
};
|
|
27
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
28
|
'aria-labelledby': 'basic-button',
|
|
@@ -33,12 +33,19 @@ export const Menu = ({ icon = 'DotsThree', items, style, testKey, size = ButtonS
|
|
|
33
33
|
paper: {
|
|
34
34
|
style: {
|
|
35
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)',
|
|
36
38
|
},
|
|
37
39
|
},
|
|
38
40
|
root: { style: { gap: '4px' } },
|
|
39
41
|
}, children: items?.map((action, index) => {
|
|
40
42
|
if (action) {
|
|
41
|
-
return (_jsxs(MuiMenuItem, { onClick: (e) => handleMenuItemClick(action, e), sx: {
|
|
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 &&
|
|
42
49
|
getIconComponent(action.icon, {
|
|
43
50
|
width: '20px',
|
|
44
51
|
height: '20px',
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { ProgressIndicatorMode } from './types';
|
|
3
3
|
import { Box } from '@mui/material';
|
|
4
4
|
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
5
|
-
export const ProgressIndicator = ({ mode = ProgressIndicatorMode.Value, overriddenText = null, currentValue = 40, maxValue = 100, fillColor = 'var(--
|
|
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
6
|
let errorText = '';
|
|
7
7
|
const calculateFill = () => {
|
|
8
8
|
if (currentValue > maxValue)
|
|
@@ -24,8 +24,11 @@ export const PromoBanner = ({ title = 'Real-time AI avatars for every conversati
|
|
|
24
24
|
return null;
|
|
25
25
|
return (_jsx(Box, { component: "img", src: image, alt: "", height: "100%", flexShrink: 0, sx: { objectFit: 'contain' } }));
|
|
26
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(--
|
|
28
|
-
border: '1px dashed var(--
|
|
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
29
|
height: '100%',
|
|
30
|
-
}, testId: testId ? `${testId}-promo-code` : undefined }), promoCodeLabel && (_jsx(Box, { position: "absolute", top: "-13px", left: "-8px", bgcolor: "var(--
|
|
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)] }));
|
|
31
34
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box } from '@mui/material';
|
|
3
3
|
export const SkeletonLoader = ({ width = '100%', height = '100%', borderRadius = 'var(--spacing-tokens-size-in-px-spacing-sm)', animationDuration = 1.5, style, }) => {
|
|
4
4
|
return (_jsx(Box, { width: width, height: height, borderRadius: borderRadius, sx: {
|
|
5
|
-
background: 'linear-gradient(90deg, var(--
|
|
5
|
+
background: 'linear-gradient(90deg, var(--color-background-bg-element) 25%, var(--color-background-bg-component) 50%, var(--color-background-bg-element) 75%)',
|
|
6
6
|
backgroundSize: '200% 100%',
|
|
7
7
|
animation: `shimmer ${animationDuration}s infinite linear`,
|
|
8
8
|
...style,
|
|
@@ -12,23 +12,23 @@ const Step = ({ currentStep, totalSteps, index, title, onClick, connectorWidth =
|
|
|
12
12
|
const isCompleted = currentStep > thisStep;
|
|
13
13
|
const getTextColor = () => {
|
|
14
14
|
if (isDisabled)
|
|
15
|
-
return 'var(--
|
|
15
|
+
return 'var(--color-text-text-paragraph)';
|
|
16
16
|
else if (isCurrent)
|
|
17
|
-
return 'var(--
|
|
17
|
+
return 'var(--color-text-text-clicable)';
|
|
18
18
|
else if (isCompleted)
|
|
19
|
-
return 'var(--
|
|
19
|
+
return 'var(--color-text-text-title)';
|
|
20
20
|
else
|
|
21
|
-
return 'var(--
|
|
21
|
+
return 'var(--color-text-text-paragraph)';
|
|
22
22
|
};
|
|
23
23
|
const getIconColor = () => {
|
|
24
24
|
if (isDisabled)
|
|
25
|
-
return 'var(--
|
|
25
|
+
return 'var(--color-foreground-fg-disabled)';
|
|
26
26
|
else if (isCurrent)
|
|
27
|
-
return 'var(--
|
|
27
|
+
return 'var(--color-background-bg-brand-primary)';
|
|
28
28
|
else if (isCompleted)
|
|
29
|
-
return 'var(--
|
|
29
|
+
return 'var(--color-background-bg-brand-primary)';
|
|
30
30
|
else
|
|
31
|
-
return 'var(--
|
|
31
|
+
return 'var(--color-foreground-fg-secondary)';
|
|
32
32
|
};
|
|
33
33
|
const IconComponent = getIconComponent('CheckCircle', {
|
|
34
34
|
size: '24px',
|
|
@@ -42,17 +42,17 @@ const Step = ({ currentStep, totalSteps, index, title, onClick, connectorWidth =
|
|
|
42
42
|
if (thisStep === 1)
|
|
43
43
|
return 'transparent';
|
|
44
44
|
else if (thisStep <= currentStep)
|
|
45
|
-
return 'var(--
|
|
45
|
+
return 'var(--color-background-bg-brand-primary)';
|
|
46
46
|
else
|
|
47
|
-
return 'var(--
|
|
47
|
+
return 'var(--color-foreground-fg-disabled)';
|
|
48
48
|
}
|
|
49
49
|
else if (position === 'right') {
|
|
50
50
|
if (thisStep === totalSteps)
|
|
51
51
|
return 'transparent';
|
|
52
52
|
else if (thisStep < currentStep)
|
|
53
|
-
return 'var(--
|
|
53
|
+
return 'var(--color-background-bg-brand-primary)';
|
|
54
54
|
else
|
|
55
|
-
return 'var(--
|
|
55
|
+
return 'var(--color-foreground-fg-disabled)';
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
return (_jsxs(Box, { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', onClick: onClick ? () => onClick() : undefined, sx: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beydesign/storybook",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@beydesign/tokens": "^0.
|
|
28
|
+
"@beydesign/tokens": "^0.1.1",
|
|
29
29
|
"@emotion/react": "^11.14.0",
|
|
30
30
|
"@emotion/styled": "^11.14.1",
|
|
31
31
|
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|