@beydesign/storybook 0.0.38 → 0.0.40
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 +9 -32
- package/dist/index.js +9 -45
- package/dist/stories/{AgentCard → Agent}/AgentCard.js +4 -11
- package/dist/stories/{AgentCard → Agent}/AgentCardSkeleton.js +1 -1
- package/dist/stories/Agent/index.d.ts +3 -0
- package/dist/stories/Agent/index.js +3 -0
- package/dist/stories/{AgentCard → Agent}/types.d.ts +1 -1
- package/dist/stories/Buttons/MainButton.d.ts +3 -0
- package/dist/stories/{Button.js → Buttons/MainButton.js} +3 -7
- package/dist/stories/{Button.stories.d.ts → Buttons/MainButton.stories.d.ts} +1 -1
- package/dist/stories/{Button.stories.js → Buttons/MainButton.stories.js} +3 -6
- package/dist/stories/Buttons/ToggleButtonGroup.d.ts +3 -0
- package/dist/stories/{ToggleButtonGroup.js → Buttons/ToggleButtonGroup.js} +3 -7
- package/dist/stories/{ToggleButtonGroup.stories.js → Buttons/ToggleButtonGroup.stories.js} +2 -2
- package/dist/stories/Buttons/index.d.ts +3 -0
- package/dist/stories/Buttons/index.js +3 -0
- package/dist/stories/{types/button.d.ts → Buttons/types.d.ts} +21 -3
- package/dist/stories/{types/button.js → Buttons/types.js} +9 -0
- package/dist/stories/{CreditsCard.d.ts → Credits/CreditsCard.d.ts} +1 -1
- package/dist/stories/{CreditsCard.js → Credits/CreditsCard.js} +3 -5
- package/dist/stories/{CreditsCard.stories.js → Credits/CreditsCard.stories.js} +2 -2
- package/dist/stories/Credits/index.d.ts +2 -0
- package/dist/stories/Credits/index.js +2 -0
- package/dist/stories/{Checkbox.d.ts → Form/Checkbox.d.ts} +1 -1
- package/dist/stories/{Checkbox.js → Form/Checkbox.js} +2 -3
- package/dist/stories/{Checkbox.stories.js → Form/Checkbox.stories.js} +2 -2
- package/dist/stories/{TextArea.d.ts → Form/TextArea.d.ts} +1 -1
- package/dist/stories/{TextArea.js → Form/TextArea.js} +1 -2
- package/dist/stories/{TextArea.stories.d.ts → Form/TextArea.stories.d.ts} +1 -1
- package/dist/stories/{TextArea.stories.js → Form/TextArea.stories.js} +1 -1
- package/dist/stories/{TextInput.d.ts → Form/TextInput.d.ts} +1 -1
- package/dist/stories/{TextInput.js → Form/TextInput.js} +1 -2
- package/dist/stories/{TextInput.stories.d.ts → Form/TextInput.stories.d.ts} +1 -1
- package/dist/stories/{TextInput.stories.js → Form/TextInput.stories.js} +1 -1
- package/dist/stories/Form/Toggle.d.ts +3 -0
- package/dist/stories/{Toggle.js → Form/Toggle.js} +2 -6
- package/dist/stories/{Toggle.stories.js → Form/Toggle.stories.js} +2 -2
- package/dist/stories/Form/index.d.ts +5 -0
- package/dist/stories/Form/index.js +5 -0
- package/dist/stories/Form/types.d.ts +94 -0
- package/dist/stories/{types/toggle.js → Form/types.js} +5 -0
- package/dist/stories/{Colors.js → Foundations/Colors.js} +1 -2
- package/dist/stories/Foundations/index.d.ts +1 -0
- package/dist/stories/Foundations/index.js +1 -0
- package/dist/stories/{Header.d.ts → Navigation/Header.d.ts} +1 -1
- package/dist/stories/{Header.js → Navigation/Header.js} +4 -6
- package/dist/stories/{Header.stories.js → Navigation/Header.stories.js} +2 -2
- package/dist/stories/{NavItem.d.ts → Navigation/NavItem.d.ts} +1 -1
- package/dist/stories/{NavItem.js → Navigation/NavItem.js} +4 -6
- package/dist/stories/{NavItem.stories.js → Navigation/NavItem.stories.js} +2 -2
- package/dist/stories/{Sidebar.d.ts → Navigation/Sidebar.d.ts} +1 -1
- package/dist/stories/{Sidebar.js → Navigation/Sidebar.js} +5 -11
- package/dist/stories/{Sidebar.stories.js → Navigation/Sidebar.stories.js} +2 -3
- package/dist/stories/Navigation/index.d.ts +4 -0
- package/dist/stories/Navigation/index.js +4 -0
- package/dist/stories/{types/sidebar.d.ts → Navigation/types.d.ts} +61 -1
- package/dist/stories/{types/nav-item.js → Navigation/types.js} +5 -0
- package/dist/stories/Typography/Typography.d.ts +3 -0
- package/dist/stories/{Typography.js → Typography/Typography.js} +2 -5
- package/dist/stories/{Typography.stories.js → Typography/Typography.stories.js} +2 -2
- package/dist/stories/Typography/index.d.ts +2 -0
- package/dist/stories/Typography/index.js +2 -0
- package/dist/stories/{types/typography.d.ts → Typography/types.d.ts} +0 -5
- package/dist/stories/UI/Avatar.d.ts +3 -0
- package/dist/stories/{Avatar.js → UI/Avatar.js} +4 -7
- package/dist/stories/{Avatar.stories.js → UI/Avatar.stories.js} +2 -2
- package/dist/stories/{Bagde.d.ts → UI/Badge.d.ts} +1 -1
- package/dist/stories/{Bagde.js → UI/Badge.js} +3 -4
- package/dist/stories/{Badge.stories.d.ts → UI/Badge.stories.d.ts} +1 -1
- package/dist/stories/{Badge.stories.js → UI/Badge.stories.js} +3 -3
- package/dist/stories/{HintBubble.d.ts → UI/HintBubble.d.ts} +1 -1
- package/dist/stories/{HintBubble.js → UI/HintBubble.js} +2 -3
- package/dist/stories/{HintBubble.stories.js → UI/HintBubble.stories.js} +2 -2
- package/dist/stories/{Logo.d.ts → UI/Logo.d.ts} +1 -1
- package/dist/stories/{Logo.js → UI/Logo.js} +1 -1
- package/dist/stories/UI/Logo.stories.d.ts +11 -0
- package/dist/stories/{Logo.stories.js → UI/Logo.stories.js} +2 -2
- package/dist/stories/UI/Menu.d.ts +3 -0
- package/dist/stories/{Menu.js → UI/Menu.js} +3 -11
- package/dist/stories/UI/Menu.stories.d.ts +6 -0
- package/dist/stories/{Menu.stories.js → UI/Menu.stories.js} +1 -1
- package/dist/stories/UI/ProgressIndicator.d.ts +3 -0
- package/dist/stories/{ProgressIndicator.js → UI/ProgressIndicator.js} +2 -6
- package/dist/stories/{ProgressIndicator.stories.js → UI/ProgressIndicator.stories.js} +2 -2
- package/dist/stories/UI/SkeletonLoader.d.ts +3 -0
- package/dist/stories/{SkeletonLoader.stories.js → UI/SkeletonLoader.stories.js} +1 -1
- package/dist/stories/UI/index.d.ts +8 -0
- package/dist/stories/UI/index.js +8 -0
- package/dist/stories/UI/types.d.ts +205 -0
- package/dist/stories/UI/types.js +71 -0
- package/dist/utils/common.d.ts +1 -0
- package/dist/utils/common.js +6 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/package.json +1 -1
- package/dist/stories/AgentCard/index.d.ts +0 -3
- package/dist/stories/AgentCard/index.js +0 -2
- package/dist/stories/Avatar.d.ts +0 -4
- package/dist/stories/Button.d.ts +0 -4
- package/dist/stories/Logo.stories.d.ts +0 -39
- package/dist/stories/Menu.d.ts +0 -4
- package/dist/stories/Menu.stories.d.ts +0 -43
- package/dist/stories/ProgressIndicator.d.ts +0 -4
- package/dist/stories/SkeletonLoader.d.ts +0 -24
- package/dist/stories/Toggle.d.ts +0 -4
- package/dist/stories/ToggleButtonGroup.d.ts +0 -4
- package/dist/stories/Typography.d.ts +0 -4
- package/dist/stories/types/avatar.d.ts +0 -44
- package/dist/stories/types/avatar.js +0 -28
- package/dist/stories/types/badge.d.ts +0 -49
- package/dist/stories/types/badge.js +0 -25
- package/dist/stories/types/checkbox.d.ts +0 -26
- package/dist/stories/types/checkbox.js +0 -5
- package/dist/stories/types/header.d.ts +0 -25
- package/dist/stories/types/header.js +0 -1
- package/dist/stories/types/hint-bubble.d.ts +0 -24
- package/dist/stories/types/hint-bubble.js +0 -10
- package/dist/stories/types/logo.d.ts +0 -30
- package/dist/stories/types/logo.js +0 -6
- package/dist/stories/types/menu.d.ts +0 -30
- package/dist/stories/types/menu.js +0 -1
- package/dist/stories/types/nav-item.d.ts +0 -41
- package/dist/stories/types/progress-indicator.d.ts +0 -35
- package/dist/stories/types/progress-indicator.js +0 -8
- package/dist/stories/types/sidebar.js +0 -5
- package/dist/stories/types/text-area.d.ts +0 -30
- package/dist/stories/types/text-area.js +0 -1
- package/dist/stories/types/text-input.d.ts +0 -26
- package/dist/stories/types/text-input.js +0 -1
- package/dist/stories/types/toggle-button-group.d.ts +0 -28
- package/dist/stories/types/toggle-button-group.js +0 -9
- package/dist/stories/types/toggle.d.ts +0 -32
- /package/dist/stories/{AgentCard → Agent}/AgentCard.d.ts +0 -0
- /package/dist/stories/{AgentCard → Agent}/AgentCard.stories.d.ts +0 -0
- /package/dist/stories/{AgentCard → Agent}/AgentCard.stories.js +0 -0
- /package/dist/stories/{AgentCard → Agent}/AgentCardSkeleton.d.ts +0 -0
- /package/dist/stories/{AgentCard → Agent}/AgentCardSkeleton.stories.d.ts +0 -0
- /package/dist/stories/{AgentCard → Agent}/AgentCardSkeleton.stories.js +0 -0
- /package/dist/stories/{AgentCard → Agent}/types.js +0 -0
- /package/dist/stories/{ToggleButtonGroup.stories.d.ts → Buttons/ToggleButtonGroup.stories.d.ts} +0 -0
- /package/dist/stories/{CreditsCard.stories.d.ts → Credits/CreditsCard.stories.d.ts} +0 -0
- /package/dist/stories/{types/credits-card.d.ts → Credits/types.d.ts} +0 -0
- /package/dist/stories/{types/credits-card.js → Credits/types.js} +0 -0
- /package/dist/stories/{Checkbox.stories.d.ts → Form/Checkbox.stories.d.ts} +0 -0
- /package/dist/stories/{Toggle.stories.d.ts → Form/Toggle.stories.d.ts} +0 -0
- /package/dist/stories/{Colors.d.ts → Foundations/Colors.d.ts} +0 -0
- /package/dist/stories/{Colors.stories.d.ts → Foundations/Colors.stories.d.ts} +0 -0
- /package/dist/stories/{Colors.stories.js → Foundations/Colors.stories.js} +0 -0
- /package/dist/stories/{Header.stories.d.ts → Navigation/Header.stories.d.ts} +0 -0
- /package/dist/stories/{NavItem.stories.d.ts → Navigation/NavItem.stories.d.ts} +0 -0
- /package/dist/stories/{Sidebar.stories.d.ts → Navigation/Sidebar.stories.d.ts} +0 -0
- /package/dist/stories/{Typography.stories.d.ts → Typography/Typography.stories.d.ts} +0 -0
- /package/dist/stories/{types/typography.js → Typography/types.js} +0 -0
- /package/dist/stories/{Avatar.stories.d.ts → UI/Avatar.stories.d.ts} +0 -0
- /package/dist/stories/{HintBubble.stories.d.ts → UI/HintBubble.stories.d.ts} +0 -0
- /package/dist/stories/{ProgressIndicator.stories.d.ts → UI/ProgressIndicator.stories.d.ts} +0 -0
- /package/dist/stories/{SkeletonLoader.js → UI/SkeletonLoader.js} +0 -0
- /package/dist/stories/{SkeletonLoader.stories.d.ts → UI/SkeletonLoader.stories.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Colors';
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '@mui/material';
|
|
3
|
-
import { MainButton } from '
|
|
4
|
-
import { ButtonHierarchy, ButtonSize } from '
|
|
5
|
-
import { Typography } from '
|
|
6
|
-
import {
|
|
7
|
-
import { Avatar } from './Avatar';
|
|
8
|
-
import { AvatarSize } from './types/avatar';
|
|
3
|
+
import { MainButton } from '../Buttons';
|
|
4
|
+
import { ButtonHierarchy, ButtonSize } from '../Buttons';
|
|
5
|
+
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
6
|
+
import { Avatar, AvatarSize } from '../UI';
|
|
9
7
|
export const Header = ({ title = 'Beyond Presence', email, avatarProps, backButtonText = 'Back', onBackClick, onLogoutClick, className, }) => {
|
|
10
8
|
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)', children: [onBackClick ? (_jsx(MainButton, { text: backButtonText, hierarchy: ButtonHierarchy.Tetriary, showLeadingIcon: true, leadingIcon: 'ArrowLeft', onClick: onBackClick })) : (_jsx(Typography, { text: title, size: TypographySize.HeadingS, weight: TypographyWeight.SemiBold })), _jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: '8px', children: [_jsxs(Box, { display: 'flex', flexDirection: 'column', alignItems: 'flex-end', justifyContent: 'space-between', children: [_jsx(Typography, { text: email, size: TypographySize.TextS, weight: TypographyWeight.SemiBold }), _jsx(MainButton, { text: 'Log Out', size: ButtonSize.sm, hierarchy: ButtonHierarchy.Tetriary, onClick: onLogoutClick, style: { paddingInline: '0px', paddingBlock: '0.1rem' } })] }), _jsx(Avatar, { ...avatarProps, size: AvatarSize.md })] })] }));
|
|
11
9
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Header } from './Header';
|
|
2
|
-
import { AvatarStyle } from '
|
|
2
|
+
import { AvatarStyle } from '../UI';
|
|
3
3
|
import styles from './Header.module.css';
|
|
4
4
|
const meta = {
|
|
5
|
-
title: 'Design System/Components/Header',
|
|
5
|
+
title: 'Design System/Components/Navigation/Header',
|
|
6
6
|
component: Header,
|
|
7
7
|
parameters: {
|
|
8
8
|
layout: 'centered',
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
|
-
import { NavItemState, NavItemSize } from './types
|
|
4
|
-
import { Typography } from '
|
|
5
|
-
import {
|
|
6
|
-
import { Badge } from './Bagde';
|
|
7
|
-
import { BadgeColor, BadgeSize } from './types/badge';
|
|
3
|
+
import { NavItemState, NavItemSize } from './types';
|
|
4
|
+
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
5
|
+
import { Badge, BadgeColor, BadgeSize } from '../UI';
|
|
8
6
|
import { Box } from '@mui/material';
|
|
9
|
-
import { getIconComponent } from '
|
|
7
|
+
import { getIconComponent } from '../../utils';
|
|
10
8
|
const StyledNavItem = styled.div `
|
|
11
9
|
display: flex;
|
|
12
10
|
flex-direction: row;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { NavItem } from './NavItem';
|
|
3
|
-
import { NavItemState, NavItemSize } from './types
|
|
3
|
+
import { NavItemState, NavItemSize } from './types';
|
|
4
4
|
const meta = {
|
|
5
|
-
title: 'Design System/Components/NavItem',
|
|
5
|
+
title: 'Design System/Components/Navigation/NavItem',
|
|
6
6
|
component: NavItem,
|
|
7
7
|
parameters: {
|
|
8
8
|
layout: 'centered',
|
|
@@ -3,17 +3,11 @@ import React, { useState } from 'react';
|
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
4
|
import { Box } from '@mui/material';
|
|
5
5
|
import { NavItem } from './NavItem';
|
|
6
|
-
import { Logo } from '
|
|
7
|
-
import { CreditsCard } from '
|
|
8
|
-
import { SidebarSize } from './types
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { CreditsCardSize } from './types/credits-card';
|
|
12
|
-
import { Typography } from './Typography';
|
|
13
|
-
import { TypographySize, TypographyWeight } from './types/typography';
|
|
14
|
-
import { MainButton } from './Button';
|
|
15
|
-
import { ButtonDisplayMode, ButtonHierarchy, ButtonShape, } from './types/button';
|
|
16
|
-
import { ButtonSize } from './types/button';
|
|
6
|
+
import { Logo, LogoVariant } from '../UI';
|
|
7
|
+
import { CreditsCard, CreditsCardSize } from '../Credits';
|
|
8
|
+
import { SidebarSize, NavItemSize, NavItemState, } from './types';
|
|
9
|
+
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
10
|
+
import { MainButton, ButtonDisplayMode, ButtonHierarchy, ButtonShape, ButtonSize, } from '../Buttons';
|
|
17
11
|
const StyledSidebar = styled.div `
|
|
18
12
|
display: flex;
|
|
19
13
|
flex-direction: column;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Sidebar } from './Sidebar';
|
|
3
|
-
import { SidebarSize } from './types
|
|
4
|
-
import { NavItemState } from './types/nav-item';
|
|
3
|
+
import { SidebarSize, NavItemState } from './types';
|
|
5
4
|
import { Box, Stack, Typography } from '@mui/material';
|
|
6
5
|
const meta = {
|
|
7
|
-
title: 'Design System/Components/Sidebar',
|
|
6
|
+
title: 'Design System/Components/Navigation/Sidebar',
|
|
8
7
|
component: Sidebar,
|
|
9
8
|
parameters: {
|
|
10
9
|
layout: 'fullscreen',
|
|
@@ -1,4 +1,64 @@
|
|
|
1
|
-
import { IconName } from '../../utils
|
|
1
|
+
import { IconName } from '../../utils';
|
|
2
|
+
import { AvatarProps } from '../UI';
|
|
3
|
+
/**
|
|
4
|
+
* Header component props
|
|
5
|
+
*/
|
|
6
|
+
export type HeaderProps = {
|
|
7
|
+
/** Title of the header */
|
|
8
|
+
title: string;
|
|
9
|
+
/** Email of the logged in user */
|
|
10
|
+
email: string;
|
|
11
|
+
/** Avatar props */
|
|
12
|
+
avatarProps: AvatarProps;
|
|
13
|
+
/** Text of the back button */
|
|
14
|
+
backButtonText?: string;
|
|
15
|
+
/** CSS class name for additional styling */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Callback function to handle back button click */
|
|
18
|
+
onBackClick?: () => void;
|
|
19
|
+
/** Callback function to handle logout button click */
|
|
20
|
+
onLogoutClick?: () => void;
|
|
21
|
+
};
|
|
22
|
+
export declare enum NavItemState {
|
|
23
|
+
Default = "default",
|
|
24
|
+
Active = "active",
|
|
25
|
+
Disabled = "disabled"
|
|
26
|
+
}
|
|
27
|
+
export declare enum NavItemSize {
|
|
28
|
+
Expanded = "expanded",
|
|
29
|
+
Collapsed = "collapsed"
|
|
30
|
+
}
|
|
31
|
+
export interface NavItemProps {
|
|
32
|
+
/**
|
|
33
|
+
* The text to display in the navigation item
|
|
34
|
+
*/
|
|
35
|
+
text: string;
|
|
36
|
+
/**
|
|
37
|
+
* The icon to display before the text
|
|
38
|
+
* Uses Phosphor Icons
|
|
39
|
+
*/
|
|
40
|
+
icon: IconName;
|
|
41
|
+
/**
|
|
42
|
+
* The current state of the navigation item
|
|
43
|
+
*/
|
|
44
|
+
state?: NavItemState;
|
|
45
|
+
/**
|
|
46
|
+
* The size of the navigation item
|
|
47
|
+
*/
|
|
48
|
+
size?: NavItemSize;
|
|
49
|
+
/**
|
|
50
|
+
* Whether to show a "Coming Soon" badge
|
|
51
|
+
*/
|
|
52
|
+
showBadge?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Optional click handler
|
|
55
|
+
*/
|
|
56
|
+
onClick?: () => void;
|
|
57
|
+
/**
|
|
58
|
+
* Optional className for additional styling
|
|
59
|
+
*/
|
|
60
|
+
className?: string;
|
|
61
|
+
}
|
|
2
62
|
export declare enum SidebarSize {
|
|
3
63
|
Expanded = "expanded",
|
|
4
64
|
Collapsed = "collapsed"
|
|
@@ -9,3 +9,8 @@ export var NavItemSize;
|
|
|
9
9
|
NavItemSize["Expanded"] = "expanded";
|
|
10
10
|
NavItemSize["Collapsed"] = "collapsed";
|
|
11
11
|
})(NavItemSize || (NavItemSize = {}));
|
|
12
|
+
export var SidebarSize;
|
|
13
|
+
(function (SidebarSize) {
|
|
14
|
+
SidebarSize["Expanded"] = "expanded";
|
|
15
|
+
SidebarSize["Collapsed"] = "collapsed";
|
|
16
|
+
})(SidebarSize || (SidebarSize = {}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { TypographySize, TypographyWeight
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TypographySize, TypographyWeight } from './types';
|
|
3
3
|
export const Typography = ({ text, color, size = TypographySize.HeadingL, weight = TypographyWeight.Bold, className, style, }) => {
|
|
4
4
|
const getTypographySizeToken = () => {
|
|
5
5
|
let sizeLc = size?.toLowerCase() || '';
|
|
@@ -50,6 +50,3 @@ export const Typography = ({ text, color, size = TypographySize.HeadingL, weight
|
|
|
50
50
|
...style,
|
|
51
51
|
}, children: text }));
|
|
52
52
|
};
|
|
53
|
-
export const Components = () => {
|
|
54
|
-
return (_jsxs("div", { style: { padding: '20px' }, children: [_jsx("h1", { children: "Typography" }), _jsx("div", { style: { display: 'flex', gap: '1rem', flexDirection: 'column' }, children: _jsxs("div", { children: [_jsx("h2", { children: "Size: Xl (HeadingXL)" }), _jsx(Typography, { text: "HeadingXL", size: TypographySize.HeadingXL, weight: TypographyWeight.Bold })] }) })] }));
|
|
55
|
-
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Typography } from './Typography';
|
|
2
|
-
import { TypographySize, TypographyWeight } from './types
|
|
2
|
+
import { TypographySize, TypographyWeight } from './types';
|
|
3
3
|
const meta = {
|
|
4
|
-
title: 'Design System/Foundations/Typography',
|
|
4
|
+
title: 'Design System/Foundations/Typography/Typography',
|
|
5
5
|
component: Typography,
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: 'centered',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { AvatarImage, AvatarSize, AvatarStyle
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { AvatarImage, AvatarSize, AvatarStyle } from './types';
|
|
3
3
|
import { Avatar as MuiAvatar, } from '@mui/material';
|
|
4
4
|
import { User } from '@phosphor-icons/react';
|
|
5
|
-
import { Typography } from '
|
|
6
|
-
import {
|
|
5
|
+
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
6
|
+
import { getInitials } from '../../utils';
|
|
7
7
|
export const Avatar = ({ avatarStyle = AvatarStyle.Placeholder, border = false, image = AvatarImage, size = AvatarSize.xxl, style: customStyle, text = 'Scarlett Johansson', }) => {
|
|
8
8
|
const getDimensions = (avatarSize) => {
|
|
9
9
|
switch (avatarSize) {
|
|
@@ -74,6 +74,3 @@ export const Avatar = ({ avatarStyle = AvatarStyle.Placeholder, border = false,
|
|
|
74
74
|
return (_jsx(MuiAvatar, { ...props, children: _jsx(User, { size: dimensions / 2, weight: "bold" }) }));
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
-
export const Components = () => {
|
|
78
|
-
return (_jsxs("div", { style: { padding: '20px' }, children: [_jsx("h1", { children: "Avatars" }), _jsxs("div", { style: { display: 'flex', gap: '1rem', flexDirection: 'column' }, children: [_jsxs("div", { children: [_jsx("h2", { children: "Size: sm, Avatar Style: Letters" }), _jsx(Avatar, { text: "Scarlett Johansson", size: AvatarSize.sm, avatarStyle: AvatarStyle.Letters })] }), _jsxs("div", { children: [_jsx("h2", { children: "Size: sm, Avatar Style: Picture" }), _jsx(Avatar, { image: AvatarImage, size: AvatarSize.sm, avatarStyle: AvatarStyle.Picture })] }), _jsxs("div", { children: [_jsx("h2", { children: "Size: sm, Avatar Style: Placeholder" }), _jsx(Avatar, { size: AvatarSize.sm, avatarStyle: AvatarStyle.Placeholder })] })] })] }));
|
|
79
|
-
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Avatar } from './Avatar';
|
|
2
|
-
import {
|
|
2
|
+
import { AvatarStyle, AvatarSize, AvatarImage } from './types';
|
|
3
3
|
const meta = {
|
|
4
|
-
title: 'Design System/Components/Avatar',
|
|
4
|
+
title: 'Design System/Components/UI/Avatar',
|
|
5
5
|
component: Avatar,
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: 'centered',
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { BadgeColor, BadgeSize } from './types
|
|
2
|
+
import { BadgeColor, BadgeSize } from './types';
|
|
3
3
|
import { Box } from '@mui/material';
|
|
4
|
-
import { Typography } from '
|
|
5
|
-
import {
|
|
6
|
-
import { getIconComponent } from '../utils/icon';
|
|
4
|
+
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
5
|
+
import { getIconComponent } from '../../utils';
|
|
7
6
|
export const Badge = ({ color = BadgeColor.Default, size = BadgeSize.md, text, style: customStyle, icon = 'Cactus', showIcon = false, fill = true, }) => {
|
|
8
7
|
const getBackgroundColor = (color) => {
|
|
9
8
|
switch (color) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Badge } from './
|
|
2
|
-
import { BadgeColor, BadgeSize } from './types
|
|
1
|
+
import { Badge } from './Badge';
|
|
2
|
+
import { BadgeColor, BadgeSize } from './types';
|
|
3
3
|
const meta = {
|
|
4
|
-
title: 'Design System/Components/Badge',
|
|
4
|
+
title: 'Design System/Components/UI/Badge',
|
|
5
5
|
component: Badge,
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: 'centered',
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '@mui/material';
|
|
3
|
-
import { Typography } from '
|
|
4
|
-
import {
|
|
5
|
-
import { HintBubbleSize, HintBubbleType, } from './types/hint-bubble';
|
|
3
|
+
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
4
|
+
import { HintBubbleSize, HintBubbleType } from './types';
|
|
6
5
|
export const HintBubble = ({ text, size = HintBubbleSize.md, type = HintBubbleType.Info, }) => {
|
|
7
6
|
const getPadding = () => {
|
|
8
7
|
if (size === HintBubbleSize.sm) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HintBubble } from './HintBubble';
|
|
2
|
-
import { HintBubbleSize, HintBubbleType } from './types
|
|
2
|
+
import { HintBubbleSize, HintBubbleType } from './types';
|
|
3
3
|
const meta = {
|
|
4
|
-
title: 'Design System/Components/HintBubble',
|
|
4
|
+
title: 'Design System/Components/UI/HintBubble',
|
|
5
5
|
component: HintBubble,
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: 'centered',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { LogoVariant } from './types
|
|
2
|
+
import { LogoVariant } from './types';
|
|
3
3
|
export const Logo = ({ variant = LogoVariant.Horizontal, color = 'var(--colors-light-background-bg-brand)', gradient, className = '', svgUrl, }) => {
|
|
4
4
|
const logoColor = gradient ? 'url(#gradient)' : color;
|
|
5
5
|
if (svgUrl) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Logo } from './Logo';
|
|
3
|
+
declare const meta: Meta<typeof Logo>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Horizontal: Story;
|
|
7
|
+
export declare const Vertical: Story;
|
|
8
|
+
export declare const Icon: Story;
|
|
9
|
+
export declare const CustomColor: Story;
|
|
10
|
+
export declare const WithGradient: Story;
|
|
11
|
+
export declare const ExternalSvg: Story;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Logo } from './Logo';
|
|
2
|
-
import { LogoVariant } from './types
|
|
2
|
+
import { LogoVariant } from './types';
|
|
3
3
|
const meta = {
|
|
4
|
-
title: 'Design System/Foundations/Logo',
|
|
4
|
+
title: 'Design System/Foundations/UI/Logo',
|
|
5
5
|
component: Logo,
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: 'centered',
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { MenuItem as MuiMenuItem, Menu as MuiMenu, } from '@mui/material';
|
|
3
3
|
import { Fragment, useState } from 'react';
|
|
4
|
-
import { MainButton } from '
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { TypographySize, TypographyWeight } from './types/typography';
|
|
8
|
-
import { getIconComponent } from '../utils/icon';
|
|
4
|
+
import { MainButton, ButtonDisplayMode, ButtonHierarchy, ButtonType, } from '../Buttons';
|
|
5
|
+
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
6
|
+
import { getIconComponent } from '../../utils';
|
|
9
7
|
export const Menu = ({ icon = 'DotsThree', items, style, }) => {
|
|
10
8
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
11
9
|
const open = Boolean(anchorEl);
|
|
@@ -49,9 +47,3 @@ export const Menu = ({ icon = 'DotsThree', items, style, }) => {
|
|
|
49
47
|
}
|
|
50
48
|
}) })] }));
|
|
51
49
|
};
|
|
52
|
-
export const Components = () => {
|
|
53
|
-
return (_jsxs("div", { style: { padding: '20px' }, children: [_jsx("h1", { children: "Menu" }), _jsx("div", { style: { display: 'flex', gap: '1rem', flexDirection: 'column' }, children: _jsx(Menu, { icon: "DotsThree", items: [
|
|
54
|
-
{ label: 'Edit', onClick: () => { }, icon: 'Pencil' },
|
|
55
|
-
{ label: 'Delete', onClick: () => { }, icon: 'Trash' },
|
|
56
|
-
] }) })] }));
|
|
57
|
-
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ProgressIndicatorMode
|
|
2
|
+
import { ProgressIndicatorMode } from './types';
|
|
3
3
|
import { Box } from '@mui/material';
|
|
4
|
-
import { Typography } from '
|
|
5
|
-
import { TypographySize, TypographyWeight } from './types/typography';
|
|
4
|
+
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
6
5
|
export const ProgressIndicator = ({ mode = ProgressIndicatorMode.Value, currentValue = 40, maxValue = 100, fillColor = 'var(--colors-light-background-bg-brand)', backgroundColor = 'var(--colors-light-background-bg-white)', text = 'used', textColor = 'var(--colors-light-text-text-primary)', style, }) => {
|
|
7
6
|
let errorText = '';
|
|
8
7
|
const calculateFill = () => {
|
|
@@ -35,6 +34,3 @@ export const ProgressIndicator = ({ mode = ProgressIndicatorMode.Value, currentV
|
|
|
35
34
|
}
|
|
36
35
|
return (_jsxs(Box, { display: "flex", flexDirection: mode === ProgressIndicatorMode.Value ? 'column' : 'row', justifyContent: 'space-between', alignItems: mode === ProgressIndicatorMode.Value ? 'flex-end' : 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', sx: style, minWidth: 200, children: [mode === ProgressIndicatorMode.Value && (_jsx(Typography, { text: `${currentValue} / ${maxValue} ${text}`, size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: textColor })), _jsx(Box, { display: "flex", flexGrow: 1, flexDirection: "row", alignItems: "center", borderRadius: '4px', sx: { backgroundColor, overflow: 'hidden' }, height: '4px', width: '100%', children: _jsx(Box, { height: '100%', borderRadius: '4px', sx: { backgroundColor: fillColor, width: `${calculateFill()}%` } }) }), mode === ProgressIndicatorMode.Percentage && (_jsx(Typography, { text: `${currentValue}%`, size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: textColor }))] }));
|
|
37
36
|
};
|
|
38
|
-
export const Components = () => {
|
|
39
|
-
return (_jsxs("div", { style: { padding: '20px' }, children: [_jsx("h1", { children: "Progress Indicator" }), _jsx("div", { style: { display: 'flex', gap: '1rem', flexDirection: 'column' } })] }));
|
|
40
|
-
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ProgressIndicator } from './ProgressIndicator';
|
|
2
|
-
import { ProgressIndicatorMode } from './types
|
|
2
|
+
import { ProgressIndicatorMode } from './types';
|
|
3
3
|
const meta = {
|
|
4
|
-
title: 'Design System/Components/ProgressIndicator',
|
|
4
|
+
title: 'Design System/Components/UI/ProgressIndicator',
|
|
5
5
|
component: ProgressIndicator,
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: 'centered',
|