@beydesign/storybook 0.0.55 → 0.0.56
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/stories/Agent/AgentCard.js +1 -1
- package/dist/stories/Agent/AgentCardSkeleton.js +2 -2
- package/dist/stories/Agent/CreateNewCard.d.ts +16 -0
- package/dist/stories/Agent/CreateNewCard.js +24 -0
- package/dist/stories/Agent/CreateNewCard.stories.d.ts +7 -0
- package/dist/stories/Agent/CreateNewCard.stories.js +23 -0
- package/dist/stories/Navigation/Sidebar.js +3 -1
- package/package.json +1 -1
|
@@ -50,7 +50,7 @@ export const AgentCard = ({ title, description = '', date = '', showDate = false
|
|
|
50
50
|
}
|
|
51
51
|
return (_jsx("img", { src: agentImage, alt: "Agent", width: '100%', height: '100%', style: { objectFit: 'cover', height: '100%', width: '100%' } }));
|
|
52
52
|
};
|
|
53
|
-
return (_jsxs(Box, { width: '
|
|
53
|
+
return (_jsxs(Box, { width: 'auto', display: 'flex', flexDirection: 'column', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', padding: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', bgcolor: isError
|
|
54
54
|
? 'var(--colors-light-background-bg-error-subtle)'
|
|
55
55
|
: isDraft
|
|
56
56
|
? 'var(--colors-light-background-bg-element)'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
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
|
-
export const AgentCardSkeleton = ({ width = '
|
|
5
|
-
return (_jsxs(Box, { width: width, display: "flex", flexDirection: "column", borderRadius:
|
|
4
|
+
export const AgentCardSkeleton = ({ width = 'auto', showDate = false, showBadges = false, showDescription = false, style, }) => {
|
|
5
|
+
return (_jsxs(Box, { width: width, display: "flex", flexDirection: "column", borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', padding: "var(--spacing-tokens-size-in-px-spacing-spacing-xl)", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-lg)", bgcolor: "var(--colors-light-background-bg-component)", boxShadow: `var(--global-shadows-shadow-xs-offset-x) var(--global-shadows-shadow-xs-offset-y) var(--global-shadows-shadow-xs-blur) var(--global-shadows-shadow-xs-spread) var(--global-shadows-shadow-xs-color)`, style: style, children: [_jsx(Box, { width: "100%", sx: { aspectRatio: 1 }, borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-sm)", overflow: "hidden", children: _jsx(SkeletonLoader, {}) }), _jsx(SkeletonLoader, { width: "70%", height: "24px", borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)" }), showDate && (_jsx(SkeletonLoader, { width: "100%", height: "20px", borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)" })), showBadges && (_jsxs(Box, { display: "flex", flexDirection: "row", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-md)", children: [_jsx(SkeletonLoader, { width: "60px", height: "24px", borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)" }), _jsx(SkeletonLoader, { width: "80px", height: "24px", borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)" })] })), showDescription && (_jsxs(Box, { display: "flex", flexDirection: "column", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-sm)", children: [_jsx(SkeletonLoader, { width: "100%", height: "16px", borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)" }), _jsx(SkeletonLoader, { width: "80%", height: "16px", borderRadius: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)" })] }))] }));
|
|
6
6
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface CreateNewCardProps {
|
|
3
|
+
/**
|
|
4
|
+
* The text to display on the card
|
|
5
|
+
*/
|
|
6
|
+
text: string;
|
|
7
|
+
/**
|
|
8
|
+
* Optional click handler
|
|
9
|
+
*/
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* CreateNewCard component that displays a card with a plus icon and text
|
|
14
|
+
* Used for "Create New" actions in a grid of cards
|
|
15
|
+
*/
|
|
16
|
+
export declare const CreateNewCard: React.FC<CreateNewCardProps>;
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { Plus } from '@phosphor-icons/react';
|
|
5
|
+
/**
|
|
6
|
+
* CreateNewCard component that displays a card with a plus icon and text
|
|
7
|
+
* Used for "Create New" actions in a grid of cards
|
|
8
|
+
*/
|
|
9
|
+
export const CreateNewCard = ({ text, onClick, }) => {
|
|
10
|
+
return (_jsx(Box, { width: 'auto', height: 'auto', sx: {
|
|
11
|
+
backgroundColor: 'var(--colors-light-background-bg-element)',
|
|
12
|
+
cursor: 'pointer',
|
|
13
|
+
transition: 'all 0.2s ease-in-out',
|
|
14
|
+
borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)',
|
|
15
|
+
'&:hover': {
|
|
16
|
+
backgroundColor: 'var(--colors-light-background-bg-card-highlight-hover)',
|
|
17
|
+
},
|
|
18
|
+
position: 'relative',
|
|
19
|
+
overflow: 'hidden',
|
|
20
|
+
}, onClick: onClick, children: _jsxs(Box, { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', padding: '24px', sx: { gap: '16px' }, children: [_jsx(Typography, { text: text, size: TypographySize.HeadingXS, weight: TypographyWeight.SemiBold, color: 'var(--colors-light-background-bg-brand)' }), _jsx(Box, { display: 'flex', width: '48px', height: '48px', borderRadius: '50%', sx: {
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
justifyContent: 'center',
|
|
23
|
+
}, children: _jsx(Plus, { size: 36, weight: "fill", color: 'var(--colors-light-background-bg-brand)' }) })] }) }));
|
|
24
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { CreateNewCard } from './CreateNewCard';
|
|
3
|
+
declare const meta: Meta<typeof CreateNewCard>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof CreateNewCard>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const CustomText: Story;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CreateNewCard } from './CreateNewCard';
|
|
2
|
+
import { action } from '@storybook/addon-actions';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Design System/Components/Agent/CreateNewCard',
|
|
5
|
+
component: CreateNewCard,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: 'centered',
|
|
8
|
+
},
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
export const Default = {
|
|
13
|
+
args: {
|
|
14
|
+
text: 'New Text-to-Video',
|
|
15
|
+
onClick: action('clicked'),
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export const CustomText = {
|
|
19
|
+
args: {
|
|
20
|
+
text: 'Add new item',
|
|
21
|
+
onClick: action('clicked'),
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -104,7 +104,9 @@ export const Sidebar = ({ size = SidebarSize.Expanded, className = '', navSectio
|
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
const isCollapsed = sidebarSize === SidebarSize.Collapsed;
|
|
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, { text:
|
|
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, { text: isCollapsed
|
|
108
|
+
? section.title.split(' ')[0]
|
|
109
|
+
: section.title, size: TypographySize.TextS, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-paragraph)", className: isCollapsed ? 'hidden' : '' }) })), section.items.map((item, itemIndex) => (_jsx(NavItemWrapper, { item: item, isCollapsed: isCollapsed }, `${item.text}-${itemIndex}`)))] }), sectionIndex < navSections.length - 1 &&
|
|
108
110
|
section.showSeparator && _jsx(Separator, { "$size": sidebarSize })] }, `section-${sectionIndex}`))) }), _jsx(BottomContainer, { children: _jsxs(Box, { display: "flex", flexDirection: "column", gap: "16px", children: [credits && (_jsx(Box, { sx: {
|
|
109
111
|
display: 'flex',
|
|
110
112
|
justifyContent: 'center',
|