@beydesign/storybook 0.1.2 → 0.1.3

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.
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { StripeProductCardSkeletonProps } from './types';
3
+ export declare const StripeProductCardSkeleton: React.FC<StripeProductCardSkeletonProps>;
@@ -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 StripeProductCardSkeleton = ({ width = 'auto', showMostPopular = false, showBubble = false, showButton = true, showFeatures = true, featuresCount = 5, style, }) => {
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(--colors-light-background-bg-white)", position: "relative", boxShadow: '0px 0px 10px 0px rgba(0, 0, 0, 0.1)', style: style, 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
+ };
@@ -0,0 +1,16 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { StripeProductCardSkeleton } from './StripeProductCardSkeleton';
3
+ declare const meta: Meta<typeof StripeProductCardSkeleton>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof StripeProductCardSkeleton>;
6
+ export declare const Default: Story;
7
+ export declare const WithMostPopular: Story;
8
+ export declare const WithBubble: Story;
9
+ export declare const WithoutButton: Story;
10
+ export declare const WithoutFeatures: Story;
11
+ export declare const CustomFeaturesCount: Story;
12
+ export declare const Complete: Story;
13
+ export declare const CustomWidth: Story;
14
+ export declare const PricingGrid: Story;
15
+ export declare const LoadingState: Story;
16
+ export declare const MinimalVariant: Story;
@@ -0,0 +1,137 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box } from '@mui/material';
3
+ import { StripeProductCardSkeleton } from './StripeProductCardSkeleton';
4
+ const meta = {
5
+ title: 'Design System/Components/StripeProduct/StripeProductCardSkeleton',
6
+ component: StripeProductCardSkeleton,
7
+ parameters: {
8
+ layout: 'centered',
9
+ },
10
+ tags: ['autodocs'],
11
+ argTypes: {
12
+ width: {
13
+ control: 'text',
14
+ description: 'Width of the skeleton card',
15
+ table: {
16
+ type: { summary: 'string | number' },
17
+ defaultValue: { summary: 'auto' },
18
+ },
19
+ },
20
+ showMostPopular: {
21
+ control: 'boolean',
22
+ description: 'Show the most popular badge placeholder',
23
+ table: {
24
+ type: { summary: 'boolean' },
25
+ defaultValue: { summary: 'false' },
26
+ },
27
+ },
28
+ showBubble: {
29
+ control: 'boolean',
30
+ description: 'Show the bubble placeholder',
31
+ table: {
32
+ type: { summary: 'boolean' },
33
+ defaultValue: { summary: 'false' },
34
+ },
35
+ },
36
+ showButton: {
37
+ control: 'boolean',
38
+ description: 'Show the button placeholder',
39
+ table: {
40
+ type: { summary: 'boolean' },
41
+ defaultValue: { summary: 'true' },
42
+ },
43
+ },
44
+ showFeatures: {
45
+ control: 'boolean',
46
+ description: 'Show the features section placeholder',
47
+ table: {
48
+ type: { summary: 'boolean' },
49
+ defaultValue: { summary: 'true' },
50
+ },
51
+ },
52
+ featuresCount: {
53
+ control: 'number',
54
+ description: 'Number of feature items to show',
55
+ table: {
56
+ type: { summary: 'number' },
57
+ defaultValue: { summary: '5' },
58
+ },
59
+ },
60
+ style: {
61
+ control: 'object',
62
+ description: 'Custom style for the skeleton',
63
+ table: {
64
+ type: { summary: 'React.CSSProperties' },
65
+ defaultValue: { summary: 'undefined' },
66
+ },
67
+ },
68
+ },
69
+ };
70
+ export default meta;
71
+ export const Default = {
72
+ args: {
73
+ width: '360px',
74
+ },
75
+ };
76
+ export const WithMostPopular = {
77
+ args: {
78
+ width: '360px',
79
+ showMostPopular: true,
80
+ },
81
+ };
82
+ export const WithBubble = {
83
+ args: {
84
+ width: '360px',
85
+ showBubble: true,
86
+ },
87
+ };
88
+ export const WithoutButton = {
89
+ args: {
90
+ width: '360px',
91
+ showButton: false,
92
+ },
93
+ };
94
+ export const WithoutFeatures = {
95
+ args: {
96
+ width: '360px',
97
+ showFeatures: false,
98
+ },
99
+ };
100
+ export const CustomFeaturesCount = {
101
+ args: {
102
+ width: '360px',
103
+ featuresCount: 8,
104
+ },
105
+ };
106
+ export const Complete = {
107
+ args: {
108
+ width: '360px',
109
+ showMostPopular: true,
110
+ showBubble: true,
111
+ showButton: true,
112
+ showFeatures: true,
113
+ featuresCount: 6,
114
+ },
115
+ };
116
+ export const CustomWidth = {
117
+ args: {
118
+ width: '500px',
119
+ showMostPopular: true,
120
+ showBubble: true,
121
+ },
122
+ };
123
+ export const PricingGrid = {
124
+ render: () => (_jsxs(Box, { display: "flex", flexWrap: "wrap", gap: 3, children: [_jsx(StripeProductCardSkeleton, { width: "360px", showFeatures: true }), _jsx(StripeProductCardSkeleton, { width: "360px", showMostPopular: true, showBubble: true, featuresCount: 7 }), _jsx(StripeProductCardSkeleton, { width: "360px", showFeatures: true })] })),
125
+ };
126
+ export const LoadingState = {
127
+ render: () => (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 4, children: [_jsxs(Box, { children: [_jsx("h3", { children: "Loading state example" }), _jsx("p", { children: "This demonstrates how the skeleton appears while loading pricing plans" })] }), _jsx(Box, { display: "flex", flexWrap: "wrap", gap: 3, justifyContent: "center", children: Array(3)
128
+ .fill(0)
129
+ .map((_, index) => (_jsx(StripeProductCardSkeleton, { width: "360px", showMostPopular: index === 1, showBubble: index === 1, featuresCount: index === 1 ? 7 : 5 }, index))) })] })),
130
+ };
131
+ export const MinimalVariant = {
132
+ args: {
133
+ width: '360px',
134
+ showButton: false,
135
+ showFeatures: false,
136
+ },
137
+ };
@@ -1,2 +1,3 @@
1
1
  export * from './StripeProduct';
2
+ export * from './StripeProductCardSkeleton';
2
3
  export * from './types';
@@ -1,2 +1,3 @@
1
1
  export * from './StripeProduct';
2
+ export * from './StripeProductCardSkeleton';
2
3
  export * from './types';
@@ -31,3 +31,22 @@ export interface StripeProductProps {
31
31
  /** Class name of the product */
32
32
  className?: string;
33
33
  }
34
+ /**
35
+ * Stripe product card skeleton component props
36
+ */
37
+ export interface StripeProductCardSkeletonProps {
38
+ /** Width of the skeleton card */
39
+ width?: string | number;
40
+ /** Show the most popular badge placeholder */
41
+ showMostPopular?: boolean;
42
+ /** Show the bubble placeholder */
43
+ showBubble?: boolean;
44
+ /** Show the button placeholder */
45
+ showButton?: boolean;
46
+ /** Show the features section placeholder */
47
+ showFeatures?: boolean;
48
+ /** Number of feature items to show */
49
+ featuresCount?: number;
50
+ /** Custom style for the skeleton */
51
+ style?: React.CSSProperties;
52
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@beydesign/storybook",
3
3
  "private": false,
4
- "version": "0.1.2",
4
+ "version": "0.1.3",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",