@beydesign/storybook 0.1.20 → 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 +65 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- 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.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.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.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.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/dist/stories/UI/index.d.ts +1 -0
- package/dist/stories/UI/index.js +1 -0
- package/dist/stories/UI/types.d.ts +42 -0
- package/dist/stories/UI/types.js +30 -0
- package/package.json +2 -2
|
@@ -34,15 +34,15 @@ const ColorSwatch = ({ name, value }) => {
|
|
|
34
34
|
return (_jsxs("div", { className: styles.swatch, children: [_jsx("div", { className: styles.color, style: {
|
|
35
35
|
background: isGradient ? displayValue : value,
|
|
36
36
|
backgroundSize: 'cover',
|
|
37
|
-
} }), _jsxs("div", { className: styles.details, children: [_jsxs("div", { className: styles.name, style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: "var(--
|
|
37
|
+
} }), _jsxs("div", { className: styles.details, children: [_jsxs("div", { className: styles.name, style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: "var(--color-text-text-label)", children: name }), _jsx(Copy, { size: 16, onClick: handleCopyName, style: {
|
|
38
38
|
cursor: 'pointer',
|
|
39
|
-
color: 'var(--
|
|
40
|
-
} }), copiedName && (_jsx("div", { className: `${styles.copyIndicator} ${styles.visible}`, children: "Copied!" }))] }), _jsxs("div", { className: styles.value, style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [_jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: "var(--
|
|
39
|
+
color: 'var(--color-text-text-subtle)',
|
|
40
|
+
} }), copiedName && (_jsx("div", { className: `${styles.copyIndicator} ${styles.visible}`, children: "Copied!" }))] }), _jsxs("div", { className: styles.value, style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [_jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: "var(--color-text-text-subtle)", children: displayValue }), _jsx(Copy, { size: 16, onClick: handleCopyValue, style: {
|
|
41
41
|
cursor: 'pointer',
|
|
42
|
-
color: 'var(--
|
|
42
|
+
color: 'var(--color-text-text-subtle)',
|
|
43
43
|
} }), copiedValue && (_jsx("div", { className: `${styles.copyIndicator} ${styles.visible}`, children: "Copied!" }))] })] })] }));
|
|
44
44
|
};
|
|
45
|
-
const ColorGroup = ({ title, colors }) => (_jsxs("div", { className: styles.group, children: [_jsx(Typography, { size: TypographySize.TextM, weight: TypographyWeight.Medium, color: "var(--
|
|
45
|
+
const ColorGroup = ({ title, colors }) => (_jsxs("div", { className: styles.group, children: [_jsx(Typography, { size: TypographySize.TextM, weight: TypographyWeight.Medium, color: "var(--color-text-text-label)", children: title }), _jsx("div", { className: styles.swatchGrid, children: Object.entries(colors).map(([name, value]) => (_jsx(ColorSwatch, { name: name, value: value }, name))) })] }));
|
|
46
46
|
export const Colors = () => {
|
|
47
47
|
// Group colors by their categories
|
|
48
48
|
const primitives = {
|
|
@@ -184,77 +184,75 @@ export const Colors = () => {
|
|
|
184
184
|
};
|
|
185
185
|
const semanticColors = {
|
|
186
186
|
Background: {
|
|
187
|
-
'--
|
|
188
|
-
'--
|
|
189
|
-
'--
|
|
190
|
-
'--
|
|
191
|
-
'--
|
|
192
|
-
'--
|
|
193
|
-
'--
|
|
194
|
-
'--
|
|
195
|
-
'--
|
|
196
|
-
'--
|
|
197
|
-
'--
|
|
198
|
-
'--
|
|
199
|
-
'--
|
|
200
|
-
'--
|
|
201
|
-
'--
|
|
202
|
-
'--
|
|
203
|
-
'--
|
|
204
|
-
'--
|
|
205
|
-
'--
|
|
206
|
-
'--
|
|
207
|
-
'--
|
|
208
|
-
'--
|
|
209
|
-
'--
|
|
210
|
-
'--
|
|
211
|
-
'--
|
|
212
|
-
'--
|
|
213
|
-
'--
|
|
214
|
-
'--colors-light-background-bg-overlay-2': 'var(--colors-light-background-bg-overlay-2)',
|
|
187
|
+
'--color-background-bg-brand-primary': 'var(--color-background-bg-brand-primary)',
|
|
188
|
+
'--color-background-bg-brand-primary-hover': 'var(--color-background-bg-brand-primary-hover)',
|
|
189
|
+
'--color-background-bg-brand-secondary-hover': 'var(--color-background-bg-brand-secondary-hover)',
|
|
190
|
+
'--color-background-bg-error': 'var(--color-background-bg-error)',
|
|
191
|
+
'--color-background-bg-error-solid': 'var(--color-background-bg-error-solid)',
|
|
192
|
+
'--color-background-bg-error-subtle': 'var(--color-background-bg-error-subtle)',
|
|
193
|
+
'--color-background-bg-success': 'var(--color-background-bg-success)',
|
|
194
|
+
'--color-background-bg-white': 'var(--color-background-bg-white)',
|
|
195
|
+
'--color-background-bg-page': 'var(--color-background-bg-page)',
|
|
196
|
+
'--color-background-bg-page-contrast': 'var(--color-background-bg-page-contrast)',
|
|
197
|
+
'--color-background-bg-element': 'var(--color-background-bg-element)',
|
|
198
|
+
'--color-background-bg-component': 'var(--color-background-bg-component)',
|
|
199
|
+
'--color-background-bg-component-hover': 'var(--color-background-bg-component-hover)',
|
|
200
|
+
'--color-background-bg-component-disabled': 'var(--color-background-bg-component-disabled)',
|
|
201
|
+
'--color-background-bg-component-dark': 'var(--color-background-bg-component-dark)',
|
|
202
|
+
'--color-background-bg-card-highlight': 'var(--color-background-bg-card-highlight)',
|
|
203
|
+
'--color-background-bg-card-highlight-hover': 'var(--color-background-bg-card-highlight-hover)',
|
|
204
|
+
'--color-background-bg-component-contrast-subtle': 'var(--color-background-bg-component-contrast-subtle)',
|
|
205
|
+
'--color-background-bg-component-contrast-subtle-hover': 'var(--color-background-bg-component-contrast-subtle-hover)',
|
|
206
|
+
'--color-background-bg-overlay-1': 'var(--color-background-bg-overlay-1)',
|
|
207
|
+
'--color-background-bg-badge-accent-success': 'var(--color-background-bg-badge-accent-success)',
|
|
208
|
+
'--color-background-bg-badge-accent-brand-violet': 'var(--color-background-bg-badge-accent-brand-violet)',
|
|
209
|
+
'--color-background-bg-badge-accent-red': 'var(--color-background-bg-badge-accent-red)',
|
|
210
|
+
'--color-background-bg-badge-accent-gray': 'var(--color-background-bg-badge-accent-gray)',
|
|
211
|
+
'--color-background-bg-badge-accent-yellow': 'var(--color-background-bg-badge-accent-yellow)',
|
|
212
|
+
'--color-background-bg-button-disabled': 'var(--color-background-bg-button-disabled)',
|
|
213
|
+
'--color-background-bg-overlay-2': 'var(--color-background-bg-overlay-2)',
|
|
215
214
|
},
|
|
216
215
|
Border: {
|
|
217
|
-
'--
|
|
218
|
-
'--
|
|
219
|
-
'--
|
|
220
|
-
'--
|
|
221
|
-
'--
|
|
222
|
-
'--
|
|
223
|
-
'--
|
|
224
|
-
'--
|
|
216
|
+
'--color-border-border-brand': 'var(--color-border-border-brand)',
|
|
217
|
+
'--color-border-border-brand-hover': 'var(--color-border-border-brand-hover)',
|
|
218
|
+
'--color-border-border-divider': 'var(--color-border-border-divider)',
|
|
219
|
+
'--color-border-border-component': 'var(--color-border-border-component)',
|
|
220
|
+
'--color-border-border-component-active': 'var(--color-border-border-component-active)',
|
|
221
|
+
'--color-border-border-subtle': 'var(--color-border-border-subtle)',
|
|
222
|
+
'--color-border-border-error': 'var(--color-border-border-error)',
|
|
223
|
+
'--color-border-border-white': 'var(--color-border-border-white)',
|
|
225
224
|
},
|
|
226
225
|
Text: {
|
|
227
|
-
'--
|
|
228
|
-
'--
|
|
229
|
-
'--
|
|
230
|
-
'--
|
|
231
|
-
'--
|
|
232
|
-
'--
|
|
233
|
-
'--
|
|
234
|
-
'--
|
|
235
|
-
'--
|
|
236
|
-
'--
|
|
237
|
-
'--
|
|
238
|
-
'--
|
|
239
|
-
'--
|
|
240
|
-
'--
|
|
241
|
-
'--colors-light-text-text-disabled': 'var(--colors-light-text-text-disabled)',
|
|
226
|
+
'--color-text-text-title': 'var(--color-text-text-title)',
|
|
227
|
+
'--color-text-text-label': 'var(--color-text-text-label)',
|
|
228
|
+
'--color-text-text-paragraph': 'var(--color-text-text-paragraph)',
|
|
229
|
+
'--color-text-text-accent': 'var(--color-text-text-accent)',
|
|
230
|
+
'--color-text-text-clicable': 'var(--color-text-text-clicable)',
|
|
231
|
+
'--color-text-text-clicable-hover': 'var(--color-text-text-clicable-hover)',
|
|
232
|
+
'--color-text-text-subtle': 'var(--color-text-text-subtle)',
|
|
233
|
+
'--color-text-text-white': 'var(--color-text-text-white)',
|
|
234
|
+
'--color-text-text-inactive': 'var(--color-text-text-inactive)',
|
|
235
|
+
'--color-text-text-placeholder': 'var(--color-text-text-placeholder)',
|
|
236
|
+
'--color-text-text-error': 'var(--color-text-text-error)',
|
|
237
|
+
'--color-text-text-success': 'var(--color-text-text-success)',
|
|
238
|
+
'--color-text-text-warning': 'var(--color-text-text-warning)',
|
|
239
|
+
'--color-text-text-disabled': 'var(--color-text-text-disabled)',
|
|
242
240
|
},
|
|
243
241
|
Foreground: {
|
|
244
|
-
'--
|
|
245
|
-
'--
|
|
246
|
-
'--
|
|
247
|
-
'--
|
|
248
|
-
'--
|
|
249
|
-
'--
|
|
250
|
-
'--
|
|
251
|
-
'--
|
|
252
|
-
'--
|
|
253
|
-
'--
|
|
254
|
-
'--
|
|
255
|
-
'--
|
|
256
|
-
'--
|
|
257
|
-
'--
|
|
242
|
+
'--color-foreground-fg-white': 'var(--color-foreground-fg-white)',
|
|
243
|
+
'--color-foreground-fg-disabled': 'var(--color-foreground-fg-disabled)',
|
|
244
|
+
'--color-foreground-fg-primary': 'var(--color-foreground-fg-primary)',
|
|
245
|
+
'--color-foreground-fg-secondary': 'var(--color-foreground-fg-secondary)',
|
|
246
|
+
'--color-foreground-fg-secondary-hover': 'var(--color-foreground-fg-secondary-hover)',
|
|
247
|
+
'--color-foreground-fg-tertiary': 'var(--color-foreground-fg-tertiary)',
|
|
248
|
+
'--color-foreground-fg-tertiary-hover': 'var(--color-foreground-fg-tertiary-hover)',
|
|
249
|
+
'--color-foreground-fg-quaternary': 'var(--color-foreground-fg-quaternary)',
|
|
250
|
+
'--color-foreground-fg-quaternary-hover-brand': 'var(--color-foreground-fg-quaternary-hover-brand)',
|
|
251
|
+
'--color-foreground-fg-quaternary-hover': 'var(--color-foreground-fg-quaternary-hover)',
|
|
252
|
+
'--color-foreground-fg-error': 'var(--color-foreground-fg-error)',
|
|
253
|
+
'--color-foreground-fg-success': 'var(--color-foreground-fg-success)',
|
|
254
|
+
'--color-foreground-fg-warning': 'var(--color-foreground-fg-warning)',
|
|
255
|
+
'--color-foreground-fg-brand-primary': 'var(--color-foreground-fg-brand-primary)',
|
|
258
256
|
},
|
|
259
257
|
};
|
|
260
258
|
const gradients = {
|
|
@@ -264,5 +262,5 @@ export const Colors = () => {
|
|
|
264
262
|
'--global-bp-gradient': 'var(--global-bp-gradient)',
|
|
265
263
|
},
|
|
266
264
|
};
|
|
267
|
-
return (_jsxs("div", { className: styles.container, children: [_jsx(Typography, { size: TypographySize.HeadingXL, weight: TypographyWeight.Bold, color: "var(--
|
|
265
|
+
return (_jsxs("div", { className: styles.container, children: [_jsx(Typography, { size: TypographySize.HeadingXL, weight: TypographyWeight.Bold, color: "var(--color-text-text-title)", children: "Color System" }), _jsxs("section", { children: [_jsx(Typography, { size: TypographySize.HeadingM, weight: TypographyWeight.SemiBold, color: "var(--color-text-text-label)", children: "Gradients" }), Object.entries(gradients).map(([title, colors]) => (_jsx(ColorGroup, { title: title, colors: colors }, title)))] }), _jsxs("section", { children: [_jsx(Typography, { size: TypographySize.HeadingM, weight: TypographyWeight.SemiBold, color: "var(--color-text-text-label)", children: "Primitive Colors" }), Object.entries(primitives).map(([title, colors]) => (_jsx(ColorGroup, { title: title, colors: colors }, title)))] }), _jsxs("section", { children: [_jsx(Typography, { size: TypographySize.HeadingM, weight: TypographyWeight.SemiBold, color: "var(--color-text-text-label)", children: "Semantic Colors" }), Object.entries(semanticColors).map(([title, colors]) => (_jsx(ColorGroup, { title: title, colors: colors }, title)))] })] }));
|
|
268
266
|
};
|
|
@@ -13,7 +13,7 @@ export const ComplexHeader = ({ title = 'Title', badgeText = '22', newButtonText
|
|
|
13
13
|
setLayoutType(type);
|
|
14
14
|
onLayoutChange?.(type);
|
|
15
15
|
};
|
|
16
|
-
return (_jsxs(Box, { className: className, display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', borderBottom: '1px solid var(--
|
|
16
|
+
return (_jsxs(Box, { className: className, display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', borderBottom: '1px solid var(--color-border-border-component)', bgcolor: 'var(--color-background-bg-page-contrast)', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-4xl)', height: 'var( --spacing-tokens-size-in-px-spacing-spacing-7xl)', sx: sx, children: [_jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', children: [_jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [_jsx(Typography, { size: TypographySize.HeadingS, weight: TypographyWeight.Bold, children: title }), badgeText && (_jsx(Badge, { text: badgeText, size: BadgeSize.md, color: BadgeColor.Violet }))] }), onNewClick && (_jsx(MainButton, { text: newButtonText, hierarchy: ButtonHierarchy.Secondary, size: ButtonSize.xs, showTrailingIcon: true, trailingIcon: 'Plus', onClick: onNewClick }))] }), _jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', children: [_jsx(AutoComplete, { options: [], placeholder: "Search", onChange: () => { }, value: '' }), _jsx(MainButton, { text: 'Output File', hierarchy: ButtonHierarchy.SecondaryColor, size: ButtonSize.lg, showTrailingIcon: true, trailingIcon: 'DownloadSimple', onClick: onOutputFileClick }), _jsx(MainButton, { text: 'Download All', hierarchy: ButtonHierarchy.Primary, size: ButtonSize.lg, showTrailingIcon: true, trailingIcon: 'DownloadSimple', onClick: onDownloadAllClick }), _jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'center', alignItems: 'center', children: [_jsx(MainButton, { hierarchy: layoutType === LayoutType.Grid
|
|
17
17
|
? ButtonHierarchy.TertiaryColor
|
|
18
18
|
: ButtonHierarchy.Tertiary, size: ButtonSize.sm, displayIconMode: ButtonDisplayMode.Only, displayIcon: "GridFour", onClick: () => handleLayoutChange(LayoutType.Grid) }), _jsx(MainButton, { hierarchy: layoutType === LayoutType.List
|
|
19
19
|
? ButtonHierarchy.TertiaryColor
|
|
@@ -5,5 +5,5 @@ import { ButtonHierarchy, ButtonSize } from '../Buttons';
|
|
|
5
5
|
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
6
6
|
import { Avatar, AvatarSize } from '../UI';
|
|
7
7
|
export const Header = ({ title = 'Beyond Presence', email, avatarProps, backButtonText = 'Back', onBackClick, onLogoutClick, className, }) => {
|
|
8
|
-
return (_jsxs(Box, { className: className, display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', borderBottom: '1px solid var(--
|
|
8
|
+
return (_jsxs(Box, { className: className, display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', borderBottom: '1px solid var(--color-border-border-component)', bgcolor: 'var(--color-background-bg-page-contrast)', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-4xl)', height: 'var( --spacing-tokens-size-in-px-spacing-spacing-7xl)', children: [onBackClick ? (_jsx(MainButton, { text: backButtonText, hierarchy: ButtonHierarchy.Tertiary, showLeadingIcon: true, leadingIcon: 'ArrowLeft', onClick: onBackClick })) : (_jsx(Typography, { size: TypographySize.HeadingS, weight: TypographyWeight.SemiBold, children: title })), _jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: '8px', children: [_jsxs(Box, { display: 'flex', flexDirection: 'column', alignItems: 'flex-end', justifyContent: 'space-between', children: [_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.SemiBold, children: email }), _jsx(MainButton, { text: 'Log Out', size: ButtonSize.sm, hierarchy: ButtonHierarchy.Tertiary, onClick: onLogoutClick, style: { paddingInline: '0px', paddingBlock: '0.1rem' } })] }), _jsx(Avatar, { ...avatarProps, size: AvatarSize.md })] })] }));
|
|
9
9
|
};
|
|
@@ -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',
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
import { Badge, BadgeColor, BadgeSize, CheckIcon, CheckIconColor, CheckIconSize, CheckIconType, } from '../UI';
|
|
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
|
+
const planKey = title?.toLowerCase()?.replace(/\s+/g, '-');
|
|
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(--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
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { PlanCard } from './PlanCard';
|
|
3
|
+
declare const meta: Meta<typeof PlanCard>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof PlanCard>;
|
|
6
|
+
export declare const Pro: Story;
|
|
7
|
+
export declare const Free: Story;
|
|
8
|
+
export declare const Personal: Story;
|
|
9
|
+
export declare const Custom: Story;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { PlanCard } from './PlanCard';
|
|
2
|
+
import { BadgeColor } from '../UI';
|
|
3
|
+
import { ButtonHierarchy } from '../Buttons';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Design System/Components/PlanCard/PlanCard',
|
|
6
|
+
component: PlanCard,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
design: {
|
|
10
|
+
type: 'figspec',
|
|
11
|
+
url: 'https://www.figma.com/design/mIhjz2yJjcpLlIqw6oUivt/Beyond-Presence?node-id=7002-19848',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
argTypes: {
|
|
16
|
+
title: { control: 'text', description: 'Plan name' },
|
|
17
|
+
description: { control: 'text', description: 'Short plan description' },
|
|
18
|
+
price: {
|
|
19
|
+
control: 'text',
|
|
20
|
+
description: 'Price text (e.g. "€210" or "Custom")',
|
|
21
|
+
},
|
|
22
|
+
priceSuffix: {
|
|
23
|
+
control: 'text',
|
|
24
|
+
description: 'Price suffix',
|
|
25
|
+
table: { defaultValue: { summary: '/month' } },
|
|
26
|
+
},
|
|
27
|
+
badgeText: { control: 'text', description: 'Badge text' },
|
|
28
|
+
badgeColor: {
|
|
29
|
+
control: 'select',
|
|
30
|
+
options: Object.values(BadgeColor),
|
|
31
|
+
description: 'Badge color',
|
|
32
|
+
table: { defaultValue: { summary: BadgeColor.Lemon } },
|
|
33
|
+
},
|
|
34
|
+
highlighted: {
|
|
35
|
+
control: 'boolean',
|
|
36
|
+
description: 'Brand background + border highlight',
|
|
37
|
+
},
|
|
38
|
+
featuresTitle: {
|
|
39
|
+
control: 'text',
|
|
40
|
+
table: { defaultValue: { summary: 'This includes:' } },
|
|
41
|
+
},
|
|
42
|
+
features: { control: 'object', description: 'Feature list' },
|
|
43
|
+
buttonText: {
|
|
44
|
+
control: 'text',
|
|
45
|
+
table: { defaultValue: { summary: 'Upgrade' } },
|
|
46
|
+
},
|
|
47
|
+
buttonDisabled: { control: 'boolean' },
|
|
48
|
+
buttonHierarchy: {
|
|
49
|
+
control: 'select',
|
|
50
|
+
options: Object.values(ButtonHierarchy),
|
|
51
|
+
table: { defaultValue: { summary: ButtonHierarchy.Primary } },
|
|
52
|
+
},
|
|
53
|
+
buttonLoading: { control: 'boolean' },
|
|
54
|
+
width: {
|
|
55
|
+
control: 'text',
|
|
56
|
+
table: { defaultValue: { summary: '286px' } },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
export default meta;
|
|
61
|
+
export const Pro = {
|
|
62
|
+
args: {
|
|
63
|
+
title: 'Pro',
|
|
64
|
+
description: 'Designed for professionals looking to expand their reach.',
|
|
65
|
+
price: '€210',
|
|
66
|
+
priceSuffix: '/month',
|
|
67
|
+
badgeText: 'Most Popular',
|
|
68
|
+
badgeColor: BadgeColor.Lemon,
|
|
69
|
+
highlighted: true,
|
|
70
|
+
buttonText: 'Upgrade',
|
|
71
|
+
features: [
|
|
72
|
+
'300 credits (300 min of Conversational Agent video)',
|
|
73
|
+
'5 stock Digital Twins',
|
|
74
|
+
'3 active Conversational Agents',
|
|
75
|
+
'Priority support',
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
export const Free = {
|
|
80
|
+
args: {
|
|
81
|
+
title: 'Free',
|
|
82
|
+
description: 'Discover what Beyond Presence has to offer.',
|
|
83
|
+
price: '€0',
|
|
84
|
+
priceSuffix: '/month',
|
|
85
|
+
badgeText: 'Current Plan',
|
|
86
|
+
badgeColor: BadgeColor.Green,
|
|
87
|
+
buttonText: 'Current plan',
|
|
88
|
+
buttonDisabled: true,
|
|
89
|
+
features: [
|
|
90
|
+
'1 credit (1 min of Conversational Agent video)',
|
|
91
|
+
'5 stock Digital Twins',
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
export const Personal = {
|
|
96
|
+
args: {
|
|
97
|
+
title: 'Personal',
|
|
98
|
+
description: 'Tailored for personal projects and independent creators.',
|
|
99
|
+
price: '€50',
|
|
100
|
+
priceSuffix: '/month',
|
|
101
|
+
buttonText: 'Upgrade',
|
|
102
|
+
features: [
|
|
103
|
+
'50 credits (50 min of Conversational Agent video)',
|
|
104
|
+
'5 stock Digital Twins',
|
|
105
|
+
'1 active Conversational Agent',
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
export const Custom = {
|
|
110
|
+
args: {
|
|
111
|
+
title: 'Professional',
|
|
112
|
+
description: 'For businesses with high volume and custom needs.',
|
|
113
|
+
price: 'Custom',
|
|
114
|
+
priceSuffix: '',
|
|
115
|
+
buttonText: 'Upgrade',
|
|
116
|
+
features: ['5000+ credits (5000+ min of Conversational Agent video)'],
|
|
117
|
+
},
|
|
118
|
+
parameters: {
|
|
119
|
+
docs: {
|
|
120
|
+
description: {
|
|
121
|
+
story: 'A custom-priced plan — the price suffix is omitted.',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '@mui/material';
|
|
3
|
+
import { SkeletonLoader } from '../UI';
|
|
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(--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
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { PlanCardSkeleton } from './PlanCardSkeleton';
|
|
3
|
+
declare const meta: Meta<typeof PlanCardSkeleton>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof PlanCardSkeleton>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Grid: Story;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '@mui/material';
|
|
3
|
+
import { PlanCardSkeleton } from './PlanCardSkeleton';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Design System/Components/PlanCard/PlanCardSkeleton',
|
|
6
|
+
component: PlanCardSkeleton,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
},
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: {
|
|
12
|
+
showBadge: {
|
|
13
|
+
control: 'boolean',
|
|
14
|
+
table: { defaultValue: { summary: 'true' } },
|
|
15
|
+
},
|
|
16
|
+
showButton: {
|
|
17
|
+
control: 'boolean',
|
|
18
|
+
table: { defaultValue: { summary: 'true' } },
|
|
19
|
+
},
|
|
20
|
+
showFeatures: {
|
|
21
|
+
control: 'boolean',
|
|
22
|
+
table: { defaultValue: { summary: 'true' } },
|
|
23
|
+
},
|
|
24
|
+
featuresCount: {
|
|
25
|
+
control: 'number',
|
|
26
|
+
table: { defaultValue: { summary: '4' } },
|
|
27
|
+
},
|
|
28
|
+
width: {
|
|
29
|
+
control: 'text',
|
|
30
|
+
table: { defaultValue: { summary: '286px' } },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export default meta;
|
|
35
|
+
export const Default = {
|
|
36
|
+
args: {},
|
|
37
|
+
};
|
|
38
|
+
export const Grid = {
|
|
39
|
+
render: () => (_jsxs(Box, { display: "flex", flexWrap: "wrap", gap: 2, children: [_jsx(PlanCardSkeleton, {}), _jsx(PlanCardSkeleton, { featuresCount: 3 }), _jsx(PlanCardSkeleton, { featuresCount: 5 })] })),
|
|
40
|
+
};
|