@beydesign/storybook 0.0.99 → 0.1.1
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/stories/StripeProduct/StripeProduct.d.ts +3 -0
- package/dist/stories/StripeProduct/StripeProduct.js +26 -0
- package/dist/stories/StripeProduct/StripeProduct.stories.d.ts +10 -0
- package/dist/stories/StripeProduct/StripeProduct.stories.js +110 -0
- package/dist/stories/StripeProduct/index.d.ts +2 -0
- package/dist/stories/StripeProduct/index.js +2 -0
- package/dist/stories/StripeProduct/types.d.ts +33 -0
- package/dist/stories/StripeProduct/types.js +1 -0
- package/dist/stories/UI/Badge.d.ts +1 -1
- package/dist/stories/UI/Badge.js +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
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 { ButtonHierarchy, ButtonSize, MainButton } from '../Buttons';
|
|
5
|
+
import { getIconComponent } from '../../utils';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { Badge, BadgeColor, BadgeSize } from '../UI';
|
|
8
|
+
export const StripeProduct = ({ className, description, features, isMostPopular, isEnterprisePlan, style, title, duration, price, buttonProps, bubbleText, bubbleTooltip, bubbleTopOffset, }) => {
|
|
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(--primitives-desktop-primary-brand-violet-50)'
|
|
11
|
+
: 'var(--colors-light-background-bg-white)', border: isMostPopular
|
|
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, 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' }, 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, onClick: buttonProps?.onClick, text: buttonProps?.text, size: buttonProps?.size || ButtonSize.lg, hierarchy: buttonProps?.hierarchy || ButtonHierarchy.Primary, style: {
|
|
14
|
+
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(--colors-light-text-text-title)', children: "This includes:" }), features.map((feature, index) => {
|
|
16
|
+
const isHeading = feature?.startsWith('-');
|
|
17
|
+
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
|
+
size: '12px',
|
|
19
|
+
color: 'var(--primitives-desktop-primary-brand-violet-500)',
|
|
20
|
+
}) })), _jsx(Typography, { size: TypographySize.TextS, weight: isHeading
|
|
21
|
+
? TypographyWeight.Medium
|
|
22
|
+
: TypographyWeight.Regular, color: isHeading
|
|
23
|
+
? 'var(--colors-light-text-text-title)'
|
|
24
|
+
: 'var(--colors-light-text-text-paragraph)', textStyle: { textAlign: 'left' }, children: isHeading ? feature?.slice(1)?.trim() : feature })] }, `${index}`));
|
|
25
|
+
})] }))] }));
|
|
26
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { StripeProduct } from './StripeProduct';
|
|
3
|
+
declare const meta: Meta<typeof StripeProduct>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof StripeProduct>;
|
|
6
|
+
export declare const DefaultWithSubheadings: Story;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const MostPopular: Story;
|
|
9
|
+
export declare const EnterprisePlan: Story;
|
|
10
|
+
export declare const WithBubble: Story;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { StripeProduct } from './StripeProduct';
|
|
3
|
+
import { Tooltip } from '@mui/material';
|
|
4
|
+
import { Info } from '@phosphor-icons/react';
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Design System/Components/StripeProduct/StripeProduct',
|
|
7
|
+
component: StripeProduct,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
design: {
|
|
11
|
+
type: 'figspec',
|
|
12
|
+
url: 'https://www.figma.com/design/LMfTHn8ncZVSVlEUGYSz4Q/Settings?node-id=3593-20344&m=dev',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
tags: ['autodocs'],
|
|
16
|
+
argTypes: {},
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
export const DefaultWithSubheadings = {
|
|
20
|
+
args: {
|
|
21
|
+
title: 'Starter',
|
|
22
|
+
description: 'Tailored for personal projects and independent creators.',
|
|
23
|
+
price: '$100',
|
|
24
|
+
duration: 'month',
|
|
25
|
+
features: [
|
|
26
|
+
'-E2E Agent API',
|
|
27
|
+
'Included Mins: 90',
|
|
28
|
+
'Bundle $/min: $0.54',
|
|
29
|
+
'Overage $/min: $0.33',
|
|
30
|
+
'-A2V Api',
|
|
31
|
+
'Included mins: 180',
|
|
32
|
+
'Bundle $/min: $0.27',
|
|
33
|
+
'Overage $/min: $0.18',
|
|
34
|
+
],
|
|
35
|
+
isMostPopular: false,
|
|
36
|
+
buttonProps: {
|
|
37
|
+
text: 'Select',
|
|
38
|
+
onClick: () => { },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
export const Default = {
|
|
43
|
+
args: {
|
|
44
|
+
title: 'Starter',
|
|
45
|
+
description: 'Tailored for personal projects and independent creators.',
|
|
46
|
+
price: '$100',
|
|
47
|
+
duration: 'month',
|
|
48
|
+
features: [
|
|
49
|
+
'1 credit (1 min of Conversational Agent video)',
|
|
50
|
+
'5 stock Digital Twins',
|
|
51
|
+
],
|
|
52
|
+
isMostPopular: false,
|
|
53
|
+
buttonProps: {
|
|
54
|
+
text: 'Select',
|
|
55
|
+
onClick: () => { },
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
export const MostPopular = {
|
|
60
|
+
args: {
|
|
61
|
+
title: 'Growth',
|
|
62
|
+
description: 'Designed for professionals looking to expand their reach.',
|
|
63
|
+
price: '$149',
|
|
64
|
+
duration: 'month',
|
|
65
|
+
features: [
|
|
66
|
+
'300 credits (300 min of Conversational Agent video)',
|
|
67
|
+
'5 stock Digital Twins',
|
|
68
|
+
'3 active Conversational Agents',
|
|
69
|
+
'Priority support',
|
|
70
|
+
],
|
|
71
|
+
isMostPopular: true,
|
|
72
|
+
buttonProps: {
|
|
73
|
+
text: 'Select',
|
|
74
|
+
onClick: () => { },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
export const EnterprisePlan = {
|
|
79
|
+
args: {
|
|
80
|
+
title: 'Enterprise',
|
|
81
|
+
description: 'Customized for large organizations and enterprise clients.',
|
|
82
|
+
price: 'Custom',
|
|
83
|
+
duration: 'month',
|
|
84
|
+
features: [
|
|
85
|
+
'5000+ credits (5000+ min of Conversational Agent video)',
|
|
86
|
+
'Integration support',
|
|
87
|
+
'Full customization',
|
|
88
|
+
],
|
|
89
|
+
isMostPopular: false,
|
|
90
|
+
isEnterprisePlan: true,
|
|
91
|
+
buttonProps: {
|
|
92
|
+
text: 'Contact us',
|
|
93
|
+
onClick: () => { },
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
export const WithBubble = {
|
|
98
|
+
args: {
|
|
99
|
+
title: 'Starter',
|
|
100
|
+
description: 'Tailored for personal projects and independent creators.',
|
|
101
|
+
price: '$100',
|
|
102
|
+
duration: 'month',
|
|
103
|
+
features: [
|
|
104
|
+
'1 credit (1 min of Conversational Agent video)',
|
|
105
|
+
'5 stock Digital Twins',
|
|
106
|
+
],
|
|
107
|
+
bubbleText: "You're currently on the monthly plan",
|
|
108
|
+
bubbleTooltip: (_jsx(Tooltip, { title: "You're currently on the monthly plan", placement: "top", children: _jsx(Info, {}) })),
|
|
109
|
+
},
|
|
110
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MainButtonProps } from '../Buttons';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Stripe product component props
|
|
5
|
+
*/
|
|
6
|
+
export interface StripeProductProps {
|
|
7
|
+
/** Title of the product */
|
|
8
|
+
title: string;
|
|
9
|
+
/** Description of the product */
|
|
10
|
+
description: string;
|
|
11
|
+
/** Price of the product */
|
|
12
|
+
price: string;
|
|
13
|
+
/** Duration of the product */
|
|
14
|
+
duration: string;
|
|
15
|
+
/** Features of the product */
|
|
16
|
+
features?: string[];
|
|
17
|
+
/** Whether the product is the most popular */
|
|
18
|
+
isMostPopular?: boolean;
|
|
19
|
+
/** Whether the product is the enterprise plan */
|
|
20
|
+
isEnterprisePlan?: boolean;
|
|
21
|
+
/** Props for the button */
|
|
22
|
+
buttonProps?: MainButtonProps;
|
|
23
|
+
/** Text of the bubble */
|
|
24
|
+
bubbleText?: string;
|
|
25
|
+
/** Tooltip of the bubble */
|
|
26
|
+
bubbleTooltip?: JSX.Element;
|
|
27
|
+
/** Top offset of the bubble */
|
|
28
|
+
bubbleTopOffset?: React.CSSProperties['top'];
|
|
29
|
+
/** Style of the product */
|
|
30
|
+
style?: React.CSSProperties;
|
|
31
|
+
/** Class name of the product */
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/stories/UI/Badge.js
CHANGED
|
@@ -3,7 +3,7 @@ import { BadgeColor, BadgeSize } from './types';
|
|
|
3
3
|
import { Box } from '@mui/material';
|
|
4
4
|
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
5
5
|
import { getIconComponent } from '../../utils';
|
|
6
|
-
export const Badge = ({ color = BadgeColor.Default, size = BadgeSize.md, text, style: customStyle, icon = 'Cactus', showIcon = false, fill = true, iconWeight = 'regular', iconSize, iconColor, }) => {
|
|
6
|
+
export const Badge = ({ color = BadgeColor.Default, size = BadgeSize.md, text, children, style: customStyle, icon = 'Cactus', showIcon = false, fill = true, iconWeight = 'regular', iconSize, iconColor, }) => {
|
|
7
7
|
const getBackgroundColor = (color) => {
|
|
8
8
|
switch (color) {
|
|
9
9
|
case BadgeColor.Default:
|
|
@@ -114,5 +114,5 @@ export const Badge = ({ color = BadgeColor.Default, size = BadgeSize.md, text, s
|
|
|
114
114
|
color: iconColor || getTextColor(),
|
|
115
115
|
weight: iconWeight,
|
|
116
116
|
};
|
|
117
|
-
return (_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "center", bgcolor: fill ? backgroundColor : 'transparent', border: fill ? border : 'none', borderRadius: fill ? 'var(--spacing-tokens-size-in-px-radius-radius-full)' : 'none', padding: padding, margin: 0, gap: "4px", sx: customStyle, children: [showIcon && icon && getIconComponent(icon, iconProps), text && (_jsx(Typography, { size: getTypographySize(size), weight: TypographyWeight.Medium, color: getTextColor(), children: text }))] }));
|
|
117
|
+
return (_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "center", bgcolor: fill ? backgroundColor : 'transparent', border: fill ? border : 'none', borderRadius: fill ? 'var(--spacing-tokens-size-in-px-radius-radius-full)' : 'none', padding: padding, margin: 0, gap: "4px", sx: customStyle, children: [showIcon && icon && getIconComponent(icon, iconProps), text && (_jsx(Typography, { size: getTypographySize(size), weight: TypographyWeight.Medium, color: getTextColor(), children: text })), children] }));
|
|
118
118
|
};
|