@beydesign/storybook 0.0.50 → 0.0.51

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 { ProcessHeaderProps } from './types';
3
+ export declare const ProcessHeader: React.FC<ProcessHeaderProps>;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box } from '@mui/material';
3
+ import { Badge, BadgeColor, BadgeSize } from '../UI';
4
+ import { Typography, TypographySize, TypographyWeight } from '../Typography';
5
+ import { ButtonHierarchy, ButtonSize, MainButton } from '../Buttons';
6
+ export const ProcessHeader = ({ title, currentStep, subtitle, totalSteps, headerRightText, onCancelClick, sx, className, }) => {
7
+ const stepChecks = () => {
8
+ return (currentStep && totalSteps && currentStep > 1 && currentStep <= totalSteps);
9
+ };
10
+ return (_jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-3xl)', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', sx: sx, className: className, children: [_jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', children: [_jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', children: [headerRightText && (_jsx(Badge, { text: headerRightText, size: BadgeSize.lg, color: BadgeColor.Green })), stepChecks() && (_jsx(Badge, { text: `Step ${currentStep} of ${totalSteps}`, size: BadgeSize.lg, color: BadgeColor.Violet }))] }), _jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [title && (_jsx(Typography, { text: `${title}.`, size: TypographySize.TextM, weight: TypographyWeight.SemiBold })), subtitle && (_jsx(Typography, { text: subtitle, size: TypographySize.TextS, weight: TypographyWeight.Regular }))] })] }), onCancelClick && (_jsx(MainButton, { text: 'Cancel Process', onClick: onCancelClick, size: ButtonSize.xs, hierarchy: ButtonHierarchy.TetriaryColor, trailingIcon: 'X', showTrailingIcon: true }))] }));
11
+ };
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { ProcessHeader } from './ProcessHeader';
3
+ declare const meta: Meta<typeof ProcessHeader>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof ProcessHeader>;
6
+ export declare const Default: Story;
@@ -0,0 +1,76 @@
1
+ import { ProcessHeader } from './ProcessHeader';
2
+ import styles from './Header.module.css';
3
+ const meta = {
4
+ title: 'Design System/Components/Navigation/ProcessHeader',
5
+ component: ProcessHeader,
6
+ parameters: {
7
+ layout: 'centered',
8
+ design: {
9
+ type: 'figspec',
10
+ url: 'https://www.figma.com/design/Ze4bBHgBQYinBDZr1COHuk/Agents?node-id=1928-68769&t=ff7acatvxaY98hGj-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
+ subtitle: {
23
+ control: 'text',
24
+ description: 'Subtitle of the header',
25
+ table: {
26
+ type: { summary: 'string' },
27
+ },
28
+ },
29
+ currentStep: {
30
+ control: 'number',
31
+ description: 'Current step of the process',
32
+ table: {
33
+ type: { summary: 'number' },
34
+ },
35
+ },
36
+ totalSteps: {
37
+ control: 'number',
38
+ description: 'Total steps of the process',
39
+ table: {
40
+ type: { summary: 'number' },
41
+ },
42
+ },
43
+ headerRightText: {
44
+ control: 'text',
45
+ description: 'Text to display in the header right',
46
+ table: {
47
+ type: { summary: 'string' },
48
+ },
49
+ },
50
+ onCancelClick: {
51
+ description: 'Callback to handle the cancel button click',
52
+ table: {
53
+ type: { summary: 'function' },
54
+ },
55
+ },
56
+ sx: {
57
+ control: 'object',
58
+ description: 'Style object to apply to the component',
59
+ table: {
60
+ type: { summary: 'object' },
61
+ },
62
+ },
63
+ },
64
+ };
65
+ export default meta;
66
+ export const Default = {
67
+ args: {
68
+ title: 'Train Agent',
69
+ subtitle: 'Please fill in the necessary information for your agent & upload knowledge files.',
70
+ currentStep: 3,
71
+ totalSteps: 3,
72
+ headerRightText: 'New Agent',
73
+ onCancelClick: () => { },
74
+ className: styles['responsive-width'],
75
+ },
76
+ };
@@ -2,3 +2,4 @@ export * from './Header';
2
2
  export * from './NavItem';
3
3
  export * from './Sidebar';
4
4
  export * from './types';
5
+ export * from './ProcessHeader';
@@ -2,3 +2,4 @@ export * from './Header';
2
2
  export * from './NavItem';
3
3
  export * from './Sidebar';
4
4
  export * from './types';
5
+ export * from './ProcessHeader';
@@ -1,3 +1,4 @@
1
+ import { SxProps, Theme } from '@mui/material';
1
2
  import { IconName } from '../../utils';
2
3
  import { AvatarProps } from '../UI';
3
4
  /**
@@ -141,3 +142,21 @@ export interface SidebarProps {
141
142
  color?: string;
142
143
  };
143
144
  }
145
+ export interface ProcessHeaderProps {
146
+ /** The title of the process */
147
+ title: string;
148
+ /** The subtitle of the process */
149
+ subtitle: string;
150
+ /** The current step of the process */
151
+ currentStep: number;
152
+ /** The total steps of the process */
153
+ totalSteps: number;
154
+ /** The text to display in the header right */
155
+ headerRightText?: string;
156
+ /** The callback to handle the cancel button click */
157
+ onCancelClick?: () => void;
158
+ /** The style object to apply to the component */
159
+ sx?: SxProps<Theme>;
160
+ /** The class name to apply to the component */
161
+ className?: string;
162
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@beydesign/storybook",
3
3
  "private": false,
4
- "version": "0.0.50",
4
+ "version": "0.0.51",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",