@beydesign/storybook 0.0.72 → 0.0.73
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/Navigation/ComplexHeader.d.ts +3 -0
- package/dist/stories/Navigation/ComplexHeader.js +21 -0
- package/dist/stories/Navigation/ComplexHeader.stories.d.ts +6 -0
- package/dist/stories/Navigation/ComplexHeader.stories.js +82 -0
- package/dist/stories/Navigation/index.d.ts +1 -0
- package/dist/stories/Navigation/index.js +1 -0
- package/dist/stories/Navigation/types.d.ts +24 -0
- package/dist/stories/Navigation/types.js +5 -0
- package/dist/stories/UI/Topbar.d.ts +3 -0
- package/dist/stories/UI/Topbar.js +9 -0
- package/dist/stories/UI/Topbar.stories.d.ts +6 -0
- package/dist/stories/UI/Topbar.stories.js +71 -0
- package/dist/stories/UI/index.d.ts +1 -0
- package/dist/stories/UI/index.js +1 -0
- package/dist/stories/UI/types.d.ts +15 -2
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { LayoutType } from './types';
|
|
4
|
+
import { Box } from '@mui/material';
|
|
5
|
+
import { ButtonDisplayMode, ButtonSize, MainButton } from '../Buttons';
|
|
6
|
+
import { ButtonHierarchy } from '../Buttons';
|
|
7
|
+
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
8
|
+
import { Badge, BadgeColor, BadgeSize } from '../UI';
|
|
9
|
+
import { AutoComplete } from '../Form/AutoComplete';
|
|
10
|
+
export const ComplexHeader = ({ title = 'Title', badgeText = '22', newButtonText = 'New', onNewClick, onOutputFileClick, onDownloadAllClick, onLayoutChange, className, sx, }) => {
|
|
11
|
+
const [layoutType, setLayoutType] = useState(LayoutType.Grid);
|
|
12
|
+
const handleLayoutChange = (type) => {
|
|
13
|
+
setLayoutType(type);
|
|
14
|
+
onLayoutChange?.(type);
|
|
15
|
+
};
|
|
16
|
+
return (_jsxs(Box, { className: className, display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', borderBottom: '1px solid var(--primitives-desktop-primary-gray-200)', bgcolor: 'var(--colors-light-background-bg-white)', 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: [_jsx(Typography, { text: title, size: TypographySize.HeadingS, weight: TypographyWeight.Bold, trailingElement: badgeText && (_jsx(Badge, { text: badgeText, size: BadgeSize.md, color: BadgeColor.Violet })), style: { gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)' } }), 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
|
+
? ButtonHierarchy.TetriaryColor
|
|
18
|
+
: ButtonHierarchy.Tetriary, size: ButtonSize.sm, displayIconMode: ButtonDisplayMode.Only, displayIcon: "GridFour", onClick: () => handleLayoutChange(LayoutType.Grid) }), _jsx(MainButton, { hierarchy: layoutType === LayoutType.List
|
|
19
|
+
? ButtonHierarchy.TetriaryColor
|
|
20
|
+
: ButtonHierarchy.Tetriary, size: ButtonSize.sm, displayIconMode: ButtonDisplayMode.Only, displayIcon: "List", onClick: () => handleLayoutChange(LayoutType.List) })] })] })] }));
|
|
21
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import styles from './Header.module.css';
|
|
2
|
+
import { ComplexHeader } from './ComplexHeader';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Design System/Components/Navigation/ComplexHeader',
|
|
5
|
+
component: ComplexHeader,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: 'centered',
|
|
8
|
+
design: {
|
|
9
|
+
type: 'figspec',
|
|
10
|
+
url: 'https://www.figma.com/design/mIhjz2yJjcpLlIqw6oUivt/Beyond-Presence?node-id=4781-5713&t=vdrrXyG9txidDmlc-1',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
argTypes: {
|
|
15
|
+
title: {
|
|
16
|
+
control: 'text',
|
|
17
|
+
description: 'Title of the header',
|
|
18
|
+
table: {
|
|
19
|
+
type: { summary: 'string' },
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
badgeText: {
|
|
23
|
+
control: 'text',
|
|
24
|
+
description: 'Text of the badge',
|
|
25
|
+
table: {
|
|
26
|
+
type: { summary: 'string' },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
newButtonText: {
|
|
30
|
+
control: 'text',
|
|
31
|
+
description: 'Text of the new button',
|
|
32
|
+
table: {
|
|
33
|
+
type: { summary: 'string' },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
onNewClick: {
|
|
37
|
+
description: 'Callback function to handle new button click',
|
|
38
|
+
table: {
|
|
39
|
+
type: { summary: 'function' },
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
onOutputFileClick: {
|
|
43
|
+
description: 'Callback function to handle output file button click',
|
|
44
|
+
table: {
|
|
45
|
+
type: { summary: 'function' },
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
onDownloadAllClick: {
|
|
49
|
+
description: 'Callback function to handle download all button click',
|
|
50
|
+
table: {
|
|
51
|
+
type: { summary: 'function' },
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
onLayoutChange: {
|
|
55
|
+
description: 'Callback function to handle layout change',
|
|
56
|
+
table: {
|
|
57
|
+
type: { summary: 'function' },
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
className: {
|
|
61
|
+
control: 'text',
|
|
62
|
+
description: 'Custom class name for the header',
|
|
63
|
+
table: {
|
|
64
|
+
type: { summary: 'string' },
|
|
65
|
+
defaultValue: { summary: styles['responsive-width'] },
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
export default meta;
|
|
71
|
+
export const Default = {
|
|
72
|
+
args: {
|
|
73
|
+
title: 'Beyond Presence',
|
|
74
|
+
badgeText: '22',
|
|
75
|
+
newButtonText: 'New Agent',
|
|
76
|
+
onNewClick: () => { },
|
|
77
|
+
onOutputFileClick: () => { },
|
|
78
|
+
onDownloadAllClick: () => { },
|
|
79
|
+
onLayoutChange: () => { },
|
|
80
|
+
className: styles['responsive-width'],
|
|
81
|
+
},
|
|
82
|
+
};
|
|
@@ -20,6 +20,30 @@ export type HeaderProps = {
|
|
|
20
20
|
/** Callback function to handle logout button click */
|
|
21
21
|
onLogoutClick?: () => void;
|
|
22
22
|
};
|
|
23
|
+
export declare enum LayoutType {
|
|
24
|
+
List = "list",
|
|
25
|
+
Grid = "grid"
|
|
26
|
+
}
|
|
27
|
+
export type ComplexHeaderProps = {
|
|
28
|
+
/** Title of the header */
|
|
29
|
+
title: string;
|
|
30
|
+
/** Text of the badge */
|
|
31
|
+
badgeText?: string;
|
|
32
|
+
/** Text of the new button */
|
|
33
|
+
newButtonText?: string;
|
|
34
|
+
/** Callback function to handle new button click */
|
|
35
|
+
onNewClick?: () => void;
|
|
36
|
+
/** Callback function to handle output file button click */
|
|
37
|
+
onOutputFileClick?: () => void;
|
|
38
|
+
/** Callback function to handle download all button click */
|
|
39
|
+
onDownloadAllClick?: () => void;
|
|
40
|
+
/** CSS class name for additional styling */
|
|
41
|
+
className?: string;
|
|
42
|
+
/** Callback function to handle layout change */
|
|
43
|
+
onLayoutChange?: (layoutType: LayoutType) => void;
|
|
44
|
+
/** Style object to apply to the component */
|
|
45
|
+
sx?: SxProps<Theme>;
|
|
46
|
+
};
|
|
23
47
|
export declare enum NavItemState {
|
|
24
48
|
Default = "default",
|
|
25
49
|
Active = "active",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { BadgeColor, BadgeSize } from './types';
|
|
3
|
+
import { Box } from '@mui/material';
|
|
4
|
+
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
5
|
+
import { Badge } from './Badge';
|
|
6
|
+
import { ButtonHierarchy, ButtonSize, MainButton } from '../Buttons';
|
|
7
|
+
export const Topbar = ({ title, badgeText, newButtonText, onNewButtonClick, className, style, }) => {
|
|
8
|
+
return (_jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', paddingX: 'var(--spacing-tokens-size-in-px-spacing-md)', paddingY: 'var(--spacing-tokens-size-in-px-spacing-sm)', className: className, sx: style, minWidth: '400px', children: [_jsx(Typography, { text: title, size: TypographySize.HeadingS, weight: TypographyWeight.SemiBold, trailingElement: badgeText && (_jsx(Badge, { text: badgeText, size: BadgeSize.xs, color: BadgeColor.Violet, style: { marginBottom: '10px' } })), style: { gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)' } }), _jsx(MainButton, { size: ButtonSize.lg, text: newButtonText, onClick: onNewButtonClick, hierarchy: ButtonHierarchy.Primary, trailingIcon: 'Plus', showTrailingIcon: true })] }));
|
|
9
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Topbar } from './Topbar';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Design System/Components/UI/Topbar',
|
|
4
|
+
component: Topbar,
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: 'centered',
|
|
7
|
+
design: {
|
|
8
|
+
type: 'figspec',
|
|
9
|
+
url: 'https://www.figma.com/design/Ze4bBHgBQYinBDZr1COHuk/Agents?node-id=1006-13664&t=CyBQppCouqmiQpIk-1',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
argTypes: {
|
|
14
|
+
title: {
|
|
15
|
+
control: 'text',
|
|
16
|
+
description: 'Title of the topbar',
|
|
17
|
+
table: {
|
|
18
|
+
type: { summary: 'string' },
|
|
19
|
+
defaultValue: { summary: 'undefined' },
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
badgeText: {
|
|
23
|
+
control: 'text',
|
|
24
|
+
description: 'Text of the badge',
|
|
25
|
+
table: {
|
|
26
|
+
type: { summary: 'string' },
|
|
27
|
+
defaultValue: { summary: 'undefined' },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
newButtonText: {
|
|
31
|
+
control: 'text',
|
|
32
|
+
description: 'Text of the new button',
|
|
33
|
+
table: {
|
|
34
|
+
type: { summary: 'string' },
|
|
35
|
+
defaultValue: { summary: 'undefined' },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
onNewButtonClick: {
|
|
39
|
+
description: 'Function to call when the new button is clicked',
|
|
40
|
+
table: {
|
|
41
|
+
type: { summary: 'function' },
|
|
42
|
+
defaultValue: { summary: 'undefined' },
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
style: {
|
|
46
|
+
control: 'object',
|
|
47
|
+
description: 'Style of the topbar',
|
|
48
|
+
table: {
|
|
49
|
+
type: { summary: 'object' },
|
|
50
|
+
defaultValue: { summary: 'undefined' },
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
className: {
|
|
54
|
+
control: 'text',
|
|
55
|
+
description: 'Class name of the topbar',
|
|
56
|
+
table: {
|
|
57
|
+
type: { summary: 'string' },
|
|
58
|
+
defaultValue: { summary: 'undefined' },
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
export default meta;
|
|
64
|
+
export const Default = {
|
|
65
|
+
args: {
|
|
66
|
+
title: 'My Agents',
|
|
67
|
+
badgeText: '10',
|
|
68
|
+
newButtonText: 'New Agent',
|
|
69
|
+
onNewButtonClick: () => { },
|
|
70
|
+
},
|
|
71
|
+
};
|
package/dist/stories/UI/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Theme } from '@mui/material';
|
|
2
|
-
import { SxProps } from '@mui/material';
|
|
1
|
+
import { Theme, SxProps } from '@mui/material';
|
|
3
2
|
import { IconName } from '../../utils';
|
|
4
3
|
/**
|
|
5
4
|
* Badge size variants
|
|
@@ -205,3 +204,17 @@ export interface SkeletonLoaderProps {
|
|
|
205
204
|
*/
|
|
206
205
|
style?: React.CSSProperties;
|
|
207
206
|
}
|
|
207
|
+
export interface TopbarProps {
|
|
208
|
+
/** Title */
|
|
209
|
+
title: string;
|
|
210
|
+
/** Badge */
|
|
211
|
+
badgeText?: string;
|
|
212
|
+
/** New button */
|
|
213
|
+
newButtonText?: string;
|
|
214
|
+
/** On click of new button */
|
|
215
|
+
onNewButtonClick?: () => void;
|
|
216
|
+
/** Style */
|
|
217
|
+
style?: SxProps<Theme>;
|
|
218
|
+
/** Class name */
|
|
219
|
+
className?: string;
|
|
220
|
+
}
|