@beydesign/storybook 0.0.78 → 0.0.80
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 +3 -3
- package/dist/stories/Agent/CreateNewCard.js +1 -1
- package/dist/stories/Buttons/MainButton.js +1 -1
- package/dist/stories/Credits/CreditsCard.js +2 -2
- package/dist/stories/Form/AutoComplete.js +4 -5
- package/dist/stories/Form/Checkbox.js +1 -1
- package/dist/stories/Form/FileUpload/FileUpload.js +3 -3
- package/dist/stories/Form/FileUpload/FileUploading.js +3 -3
- package/dist/stories/Form/FileUpload/UploadedFile.js +1 -1
- package/dist/stories/Form/TextArea.js +2 -2
- package/dist/stories/Form/TextInput.js +2 -2
- package/dist/stories/Form/Toggle.js +1 -1
- package/dist/stories/Form/index.d.ts +1 -0
- package/dist/stories/Form/index.js +1 -0
- package/dist/stories/Foundations/Colors.js +4 -4
- package/dist/stories/Navigation/ComplexHeader.js +1 -1
- package/dist/stories/Navigation/Header.js +1 -1
- package/dist/stories/Navigation/NavItem.js +2 -2
- package/dist/stories/Navigation/ProcessHeader.js +1 -1
- package/dist/stories/Navigation/Sidebar.js +2 -2
- package/dist/stories/Typography/Typography.d.ts +1 -1
- package/dist/stories/Typography/Typography.js +16 -27
- package/dist/stories/Typography/Typography.stories.js +32 -34
- package/dist/stories/Typography/types.d.ts +1 -6
- package/dist/stories/UI/Avatar.js +1 -1
- package/dist/stories/UI/Badge.js +1 -1
- package/dist/stories/UI/HintBubble.js +1 -1
- package/dist/stories/UI/Menu.js +1 -1
- package/dist/stories/UI/ProgressIndicator.js +2 -2
- package/dist/stories/UI/Topbar.js +1 -1
- package/dist/utils/typography.d.ts +1 -1
- package/dist/utils/typography.js +8 -6
- package/package.json +1 -1
|
@@ -43,10 +43,10 @@ export const AgentCard = ({ title, description = '', date = '', showDate = false
|
|
|
43
43
|
// Render loading state or placeholder
|
|
44
44
|
const renderImageContent = () => {
|
|
45
45
|
if (isLoading) {
|
|
46
|
-
return (_jsx(Box, { width: '100%', height: '100%', bgcolor: 'var(--colors-light-background-bg-element)', display: 'flex', justifyContent: 'center', alignItems: 'center', children: _jsxs(Box, { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [_jsx(ArrowsClockwise, { size: 24, color: 'var(--colors-light-text-text-subtle)', className: "spin-animation" }), _jsx(Typography, {
|
|
46
|
+
return (_jsx(Box, { width: '100%', height: '100%', bgcolor: 'var(--colors-light-background-bg-element)', display: 'flex', justifyContent: 'center', alignItems: 'center', children: _jsxs(Box, { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [_jsx(ArrowsClockwise, { size: 24, color: 'var(--colors-light-text-text-subtle)', className: "spin-animation" }), _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: 'var(--colors-light-text-text-subtle)', children: "Loading preview..." })] }) }));
|
|
47
47
|
}
|
|
48
48
|
if (imageError || !agentImage) {
|
|
49
|
-
return (_jsx(Box, { width: '100%', height: '100%', bgcolor: 'var(--colors-light-background-bg-element)', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', border: '2px solid var(--colors-light-border-border-component)', boxSizing: 'border-box', display: 'flex', justifyContent: 'center', alignItems: 'center', children: _jsx(Typography, {
|
|
49
|
+
return (_jsx(Box, { width: '100%', height: '100%', bgcolor: 'var(--colors-light-background-bg-element)', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', border: '2px solid var(--colors-light-border-border-component)', boxSizing: 'border-box', display: 'flex', justifyContent: 'center', alignItems: 'center', children: _jsx(Typography, { size: TypographySize.HeadingXS, weight: TypographyWeight.SemiBold, children: "No Preview Available" }) }));
|
|
50
50
|
}
|
|
51
51
|
return (_jsx("img", { src: agentImage, alt: "Agent", width: '100%', height: '100%', style: { objectFit: 'cover', height: '100%', width: '100%' } }));
|
|
52
52
|
};
|
|
@@ -77,5 +77,5 @@ export const AgentCard = ({ title, description = '', date = '', showDate = false
|
|
|
77
77
|
position: 'absolute',
|
|
78
78
|
right: '8px',
|
|
79
79
|
top: '8px',
|
|
80
|
-
} })), isReady && hovered && onPreview && active && (_jsx(Box, { position: 'absolute', top: '0', left: '0', width: '100%', height: '100%', bgcolor: 'var(--colors-light-background-bg-component-hover)', sx: { zIndex: 1 }, display: 'flex', justifyContent: 'center', alignItems: 'center', children: _jsx(MainButton, { text: previewButtonText, onClick: onPreview, showTrailingIcon: true, trailingIcon: "Play", hierarchy: ButtonHierarchy.SecondaryTransparent, size: ButtonSize.sm, style: { border: 'none' } }) })), isProcessing && (_jsxs(Box, { position: 'absolute', top: '0', left: '0', width: '100%', height: '100%', bgcolor: 'var(--colors-light-background-bg-component-hover)', style: { zIndex: 1 }, display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [_jsx(ArrowsClockwise, { size: 24, color: 'var(--primitives-desktop-primary-white-100)', className: "spin-animation" }), _jsx(Typography, {
|
|
80
|
+
} })), isReady && hovered && onPreview && active && (_jsx(Box, { position: 'absolute', top: '0', left: '0', width: '100%', height: '100%', bgcolor: 'var(--colors-light-background-bg-component-hover)', sx: { zIndex: 1 }, display: 'flex', justifyContent: 'center', alignItems: 'center', children: _jsx(MainButton, { text: previewButtonText, onClick: onPreview, showTrailingIcon: true, trailingIcon: "Play", hierarchy: ButtonHierarchy.SecondaryTransparent, size: ButtonSize.sm, style: { border: 'none' } }) })), isProcessing && (_jsxs(Box, { position: 'absolute', top: '0', left: '0', width: '100%', height: '100%', bgcolor: 'var(--colors-light-background-bg-component-hover)', style: { zIndex: 1 }, display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [_jsx(ArrowsClockwise, { size: 24, color: 'var(--primitives-desktop-primary-white-100)', className: "spin-animation" }), _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.SemiBold, color: 'var(--primitives-desktop-primary-white-100)', children: processingText }), showProgressIndicator && (_jsx(ProgressIndicator, { mode: ProgressIndicatorMode.Percentage, currentValue: progressValue, maxValue: 100, textColor: 'var(--primitives-desktop-primary-white-100)' }))] })), isError && (_jsxs(Box, { position: 'absolute', top: '0', left: '0', width: '100%', height: '100%', bgcolor: 'var(--colors-light-background-bg-error-solid)', style: { zIndex: 1, opacity: 0.7 }, display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [_jsx(Warning, { size: 74, color: 'var(--primitives-desktop-primary-white-100)' }), _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.SemiBold, color: 'var(--primitives-desktop-primary-white-100)', children: "Something went wrong" })] }))] }), _jsx(Typography, { size: TypographySize.HeadingXS, weight: TypographyWeight.SemiBold, children: title }), (showDate || showActiveToggle) && (_jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', children: [showDate && (_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: 'var(--colors-light-text-text-subtle)', children: date })), showActiveToggle && (_jsx(Toggle, { checked: active, onChange: (checked) => onActiveToggleChange?.(checked), disabled: activeToggleDisabled, text: "Active", togglePosition: TogglePosition.Right, style: { flex: 1 } }))] })), showBadges && (_jsx(Box, { display: 'flex', flexDirection: 'row', flexWrap: 'wrap', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', children: badges.map((badge, index) => (_jsx(Badge, { text: badge, size: BadgeSize.lg, fill: true }, `badge-${index}-${badge}`))) })), showDescription && (_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: 'var(--colors-light-text-text-paragraph)', children: description }))] }));
|
|
81
81
|
};
|
|
@@ -18,7 +18,7 @@ export const CreateNewCard = ({ text, onClick, }) => {
|
|
|
18
18
|
position: 'relative',
|
|
19
19
|
overflow: 'hidden',
|
|
20
20
|
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)`,
|
|
21
|
-
}, onClick: onClick, children: _jsxs(Box, { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', padding: '24px', sx: { gap: '16px' }, children: [_jsx(Typography, {
|
|
21
|
+
}, onClick: onClick, children: _jsxs(Box, { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', padding: '24px', sx: { gap: '16px' }, children: [_jsx(Typography, { size: TypographySize.HeadingXS, weight: TypographyWeight.SemiBold, color: 'var(--colors-light-background-bg-brand)', children: text }), _jsx(Box, { display: 'flex', width: '48px', height: '48px', borderRadius: '50%', sx: {
|
|
22
22
|
alignItems: 'center',
|
|
23
23
|
justifyContent: 'center',
|
|
24
24
|
}, children: _jsx(Plus, { size: 36, weight: "fill", color: 'var(--colors-light-background-bg-brand)' }) })] }) }));
|
|
@@ -278,7 +278,7 @@ export const MainButton = ({ onClick, text, disabled = false, loading = false, t
|
|
|
278
278
|
gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)',
|
|
279
279
|
}, children: [showLeadingIcon &&
|
|
280
280
|
leadingIcon &&
|
|
281
|
-
getIconComponent(leadingIcon, iconProps), text && (_jsx(Typography, {
|
|
281
|
+
getIconComponent(leadingIcon, iconProps), text && (_jsx(Typography, { size: getTextSize(), weight: TypographyWeight.SemiBold, children: text })), showTrailingIcon &&
|
|
282
282
|
trailingIcon &&
|
|
283
283
|
getIconComponent(trailingIcon, iconProps)] }));
|
|
284
284
|
};
|
|
@@ -39,9 +39,9 @@ export const CreditsCard = ({ size = CreditsCardSize.Expanded, className, maxCre
|
|
|
39
39
|
const isCollapsed = size === CreditsCardSize.Collapsed;
|
|
40
40
|
return (_jsxs(StyledCard, { "$collapsed": isCollapsed, "$size": size, className: className, children: [!isCollapsed &&
|
|
41
41
|
maxCredits !== undefined &&
|
|
42
|
-
usedCredits !== undefined && (_jsxs(_Fragment, { children: [_jsxs(CreditRow, { children: [_jsxs(Box, { gap: "2px", display: "flex", flexDirection: "row", children: [_jsx(TextWrapper, { children: _jsx(Typography, {
|
|
42
|
+
usedCredits !== undefined && (_jsxs(_Fragment, { children: [_jsxs(CreditRow, { children: [_jsxs(Box, { gap: "2px", display: "flex", flexDirection: "row", children: [_jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-title)", children: "My Credits:" }) }), _jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-title)", children: `${usedCredits}/` }) }), _jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-paragraph)", children: `${maxCredits}` }) })] }), _jsx(Box, { onClick: (e) => e.stopPropagation(), children: _jsx(MainButton, { text: "Upgrade", hierarchy: ButtonHierarchy.TetriaryColor, size: ButtonSize.md, style: { padding: '0' }, onClick: () => {
|
|
43
43
|
if (onUpgradeClick) {
|
|
44
44
|
onUpgradeClick();
|
|
45
45
|
}
|
|
46
|
-
} }) })] }), _jsx(CreditRow, { style: { justifyContent: 'end' }, children: _jsx(Box, { display: "flex", flexDirection: "row", children: _jsx(TextWrapper, { children: _jsx(Typography, {
|
|
46
|
+
} }) })] }), _jsx(CreditRow, { style: { justifyContent: 'end' }, children: _jsx(Box, { display: "flex", flexDirection: "row", children: _jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: "var(--colors-light-text-text-subtle)", children: creditInfoText }) }) }) })] })), isCollapsed && maxCredits !== undefined && usedCredits !== undefined && (_jsx(_Fragment, { children: _jsx(CreditRow, { "$collapsed": true, children: _jsx(Box, { display: "flex", flexDirection: "row", gap: "2px", children: _jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextM, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-title)", children: `${usedCredits}` }) }) }) }) }))] }));
|
|
47
47
|
};
|
|
@@ -3,7 +3,7 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
3
3
|
import { Box } from '@mui/material';
|
|
4
4
|
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
5
5
|
import { getIconComponent } from '../../utils';
|
|
6
|
-
import { getTypographySizeToken, getTypographyWeightToken, getTextStyles,
|
|
6
|
+
import { getTypographySizeToken, getTypographyWeightToken, getTextStyles, } from '../../utils';
|
|
7
7
|
export const AutoComplete = ({ options, value, onChange, leadingIcon = 'MagnifyingGlass', placeholder = 'Search', disabled = false, onBlur, onFocus, }) => {
|
|
8
8
|
const [searchText, setSearchText] = useState('');
|
|
9
9
|
const [focused, setFocused] = useState(false);
|
|
@@ -118,8 +118,7 @@ export const AutoComplete = ({ options, value, onChange, leadingIcon = 'Magnifyi
|
|
|
118
118
|
}, [options, searchText]);
|
|
119
119
|
const sizeToken = getTypographySizeToken(TypographySize.TextS);
|
|
120
120
|
const weightToken = getTypographyWeightToken(TypographyWeight.Regular);
|
|
121
|
-
const { fontSize, fontWeight, fontFamily, lineHeight, letterSpacing, paragraphIndent, paragraphSpacing, textDecoration, } = getTextStyles(sizeToken, weightToken);
|
|
122
|
-
const textTransform = getTextTransform(sizeToken, weightToken);
|
|
121
|
+
const { fontSize, fontWeight, fontFamily, lineHeight, letterSpacing, paragraphIndent, paragraphSpacing, textDecoration, textTransform, } = getTextStyles(sizeToken, weightToken);
|
|
123
122
|
return (_jsxs(Box, { display: 'flex', flexDirection: 'column', position: 'relative', width: "100%", children: [_jsxs(Box, { display: 'flex', flexDirection: 'row', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', alignItems: 'center', justifyContent: 'center', border: `1px solid ${focused ? 'var(--colors-light-border-border-component-active)' : 'var(--colors-light-border-border-component)'}`, borderRadius: '4px', bgcolor: disabled
|
|
124
123
|
? 'var(--primitives-desktop-primary-gray-25)'
|
|
125
124
|
: 'var(--primitives-desktop-primary-white-100)', children: [getIconComponent(leadingIcon, {
|
|
@@ -152,7 +151,7 @@ export const AutoComplete = ({ options, value, onChange, leadingIcon = 'Magnifyi
|
|
|
152
151
|
onClick: handleClear,
|
|
153
152
|
style: { cursor: disabled ? 'default' : 'pointer' },
|
|
154
153
|
'aria-label': 'Clear input',
|
|
155
|
-
})] }), focused && (_jsx(Box, { id: "autocomplete-options", ref: optionsContainerRef, position: 'absolute', top: '100%', left: 0, zIndex: 1000, bgcolor: 'var(--primitives-desktop-primary-white-100)', borderRadius: '4px', width: '100%', maxHeight: '200px', overflow: 'auto', boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.1)', mt: '4px', role: "listbox", children: filteredOptions.length === 0 ? (_jsx(Box, { display: 'flex', flexDirection: 'row', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', children: _jsx(Typography, {
|
|
154
|
+
})] }), focused && (_jsx(Box, { id: "autocomplete-options", ref: optionsContainerRef, position: 'absolute', top: '100%', left: 0, zIndex: 1000, bgcolor: 'var(--primitives-desktop-primary-white-100)', borderRadius: '4px', width: '100%', maxHeight: '200px', overflow: 'auto', boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.1)', mt: '4px', role: "listbox", children: filteredOptions.length === 0 ? (_jsx(Box, { display: 'flex', flexDirection: 'row', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', children: _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, children: "No results found" }) })) : (filteredOptions.map((option, index) => (_jsx(Box, { display: 'flex', flexDirection: 'row', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', onClick: () => handleOptionSelect(option), sx: {
|
|
156
155
|
cursor: 'pointer',
|
|
157
156
|
backgroundColor: highlightedIndex === index
|
|
158
157
|
? 'var(--primitives-desktop-primary-gray-25)'
|
|
@@ -160,5 +159,5 @@ export const AutoComplete = ({ options, value, onChange, leadingIcon = 'Magnifyi
|
|
|
160
159
|
'&:hover': {
|
|
161
160
|
backgroundColor: 'var(--primitives-desktop-primary-gray-25)',
|
|
162
161
|
},
|
|
163
|
-
}, role: "option", "aria-selected": highlightedIndex === index, tabIndex: -1, children: _jsx(Typography, {
|
|
162
|
+
}, role: "option", "aria-selected": highlightedIndex === index, tabIndex: -1, children: _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, children: option }) }, option)))) }))] }));
|
|
164
163
|
};
|
|
@@ -61,5 +61,5 @@ export const Checkbox = ({ type = CheckboxType.Checkbox, label, checked, disable
|
|
|
61
61
|
backgroundColor: 'transparent',
|
|
62
62
|
transition: 'all 0.2s ease-in-out',
|
|
63
63
|
},
|
|
64
|
-
} })) : null, _jsx(Typography, {
|
|
64
|
+
} })) : null, _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, children: label })] }));
|
|
65
65
|
};
|
|
@@ -120,9 +120,9 @@ export const FileUpload = ({ disabled, sx, acceptedFileTypes = '.pdf,.doc,.docx,
|
|
|
120
120
|
? 'var(--colors-light-background-bg-brand-hover)'
|
|
121
121
|
: 'var(--colors-light-background-bg-brand)'}`, borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', bgcolor: 'var(--primitives-desktop-primary-white-100)', children: _jsx(UploadSimple, { height: '20px', width: '20px', weight: "bold", color: disabled
|
|
122
122
|
? 'var(--colors-light-foreground-fg-disabled)'
|
|
123
|
-
: 'var(--colors-light-foreground-fg-brand-primary)' }) }), _jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)', children: [_jsx(Typography, {
|
|
123
|
+
: 'var(--colors-light-foreground-fg-brand-primary)' }) }), _jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)', children: [_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.SemiBold, color: disabled
|
|
124
124
|
? 'var(--colors-light-text-text-disabled)'
|
|
125
|
-
: 'var(--colors-light-text-text-accent)',
|
|
125
|
+
: 'var(--colors-light-text-text-accent)', textStyle: { cursor: disabled ? 'not-allowed' : 'pointer' }, children: "Click to upload" }), _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: disabled
|
|
126
126
|
? 'var(--colors-light-text-text-subtle)'
|
|
127
|
-
: 'var(--colors-light-text-text-paragraph)' }), _jsxs(Box, { display: 'flex', flexDirection: 'row', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)', children: [fileIcons.map((Icon, index) => (_jsx(Icon, { ...iconProps }, index))), fileIcons.length === 0 && _jsx(FileCode, { ...iconProps })] })] })] }));
|
|
127
|
+
: 'var(--colors-light-text-text-paragraph)', children: "or drag and drop" }), _jsxs(Box, { display: 'flex', flexDirection: 'row', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)', children: [fileIcons.map((Icon, index) => (_jsx(Icon, { ...iconProps }, index))), fileIcons.length === 0 && _jsx(FileCode, { ...iconProps })] })] })] }));
|
|
128
128
|
};
|
|
@@ -25,9 +25,9 @@ export const FileUploading = ({ uploadProgress, uploadingStatus, sx, onCancel, o
|
|
|
25
25
|
color: isError
|
|
26
26
|
? 'var(--colors-light-text-text-error)'
|
|
27
27
|
: 'var(--colors-light-foreground-fg-primary)',
|
|
28
|
-
}), _jsx(Typography, {
|
|
28
|
+
}), _jsx(Typography, { size: TypographySize.TextM, weight: TypographyWeight.Regular, color: isError
|
|
29
29
|
? 'var(--colors-light-text-text-error)'
|
|
30
|
-
: 'var(--primitives-desktop-primary-gray-950)' })] }), _jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'center', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [showCancel &&
|
|
30
|
+
: 'var(--primitives-desktop-primary-gray-950)', children: fileName })] }), _jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'center', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [showCancel &&
|
|
31
31
|
onCancel &&
|
|
32
32
|
isUploading &&
|
|
33
33
|
getIconComponent('X', {
|
|
@@ -41,5 +41,5 @@ export const FileUploading = ({ uploadProgress, uploadingStatus, sx, onCancel, o
|
|
|
41
41
|
width: '24px',
|
|
42
42
|
height: '24px',
|
|
43
43
|
color: 'var(--colors-light-foreground-fg-success)',
|
|
44
|
-
})] })] }), _jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)', children: [!isError && uploadProgress && (_jsx(ProgressIndicator, { currentValue: uploadProgress, maxValue: 100, mode: ProgressIndicatorMode.Percentage, style: { width: '100%' } })), isError && (_jsxs(Fragment, { children: [_jsx(Typography, {
|
|
44
|
+
})] })] }), _jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)', children: [!isError && uploadProgress && (_jsx(ProgressIndicator, { currentValue: uploadProgress, maxValue: 100, mode: ProgressIndicatorMode.Percentage, style: { width: '100%' } })), isError && (_jsxs(Fragment, { children: [_jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: 'var(--colors-light-text-text-error)', children: "Upload failed, please try again." }), showRetry && onRetry && (_jsx(Box, { onClick: onRetry, style: { cursor: 'pointer' }, children: _jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.SemiBold, color: 'var(--colors-light-text-text-error)', children: "Try again" }) }))] }))] })] }));
|
|
45
45
|
};
|
|
@@ -8,5 +8,5 @@ export const UploadedFile = ({ type = FileType.Default, showDelete = true, onDel
|
|
|
8
8
|
const isSampleFile = type === FileType.Sample;
|
|
9
9
|
return (_jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)', padding: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', paddingLeft: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', bgcolor: isSampleFile
|
|
10
10
|
? 'var(--colors-light-background-bg-card-highlight)'
|
|
11
|
-
: 'var(--colors-light-background-bg-component-contrast-subtle)', minWidth: '240px', minHeight: '36px', sx: { ...sx }, children: [_jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [_jsx(File, { width: '24px', height: '24px', color: 'var(--colors-light-foreground-fg-primary)' }), _jsx(Typography, {
|
|
11
|
+
: 'var(--colors-light-background-bg-component-contrast-subtle)', minWidth: '240px', minHeight: '36px', sx: { ...sx }, children: [_jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [_jsx(File, { width: '24px', height: '24px', color: 'var(--colors-light-foreground-fg-primary)' }), _jsx(Typography, { size: TypographySize.TextM, weight: TypographyWeight.Medium, color: 'var(--colors-light-foreground-fg-primary)', children: fileName })] }), _jsxs(Box, { display: 'flex', flexDirection: 'row', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [showDownload && onDownload && (_jsx(MainButton, { hierarchy: ButtonHierarchy.Secondary, size: ButtonSize.xs, displayIconMode: ButtonDisplayMode.Only, displayIcon: "DownloadSimple", onClick: onDownload })), showDelete && onDelete && (_jsx(MainButton, { hierarchy: ButtonHierarchy.Secondary, size: ButtonSize.xs, displayIconMode: ButtonDisplayMode.Only, displayIcon: "X", onClick: onDelete }))] })] }));
|
|
12
12
|
};
|
|
@@ -5,7 +5,7 @@ import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
|
5
5
|
import { HintBubble, HintBubbleSize } from '../UI';
|
|
6
6
|
export const TextArea = ({ label, value, onChange, placeholder, hintText, errorText, disabled, allowMaxLength = false, maxLength = 256, showMaxLengthIndicator = false, numberOfRows = 5, style, hintBubbleProps, hintBubbleText, required, labelTrailingElement, labelContainerStyle, }) => {
|
|
7
7
|
const [focused, setFocused] = useState(false);
|
|
8
|
-
return (_jsx(Box, { display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', sx: style, children: _jsxs(Box, { display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', minWidth: '260px', children: [label && (
|
|
8
|
+
return (_jsx(Box, { display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', sx: style, children: _jsxs(Box, { display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', minWidth: '260px', children: [label && (_jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', sx: labelContainerStyle, children: [_jsx(Typography, { size: TypographySize.HeadingXS, weight: TypographyWeight.SemiBold, required: required, children: label }), labelTrailingElement] })), hintBubbleText && (_jsx(HintBubble, { text: hintBubbleText, size: HintBubbleSize.sm, ...hintBubbleProps })), _jsx(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', bgcolor: 'var(--colors-light-background-bg-component)', border: `1px solid ${errorText
|
|
9
9
|
? 'var(--colors-light-border-border-error)'
|
|
10
10
|
: focused
|
|
11
11
|
? 'var(--colors-light-border-border-component-active)'
|
|
@@ -19,5 +19,5 @@ export const TextArea = ({ label, value, onChange, placeholder, hintText, errorT
|
|
|
19
19
|
: 'var(--colors-light-text-text-title)',
|
|
20
20
|
backgroundColor: 'transparent',
|
|
21
21
|
resize: 'none',
|
|
22
|
-
}, maxLength: allowMaxLength ? maxLength : undefined, onFocus: () => setFocused(true), onBlur: () => setFocused(false), required: required }) }), _jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', children: [errorText ? (_jsx(Typography, {
|
|
22
|
+
}, maxLength: allowMaxLength ? maxLength : undefined, onFocus: () => setFocused(true), onBlur: () => setFocused(false), required: required }) }), _jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', children: [errorText ? (_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: 'var(--colors-light-text-text-error)', children: errorText })) : hintText ? (_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: 'var(--colors-light-text-text-subtle)', children: hintText })) : (_jsx(Box, { style: { flex: 1 } })), showMaxLengthIndicator && allowMaxLength && maxLength && (_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: 'var(--colors-light-text-text-subtle)', children: `${maxLength - value.length}` }))] })] }) }));
|
|
23
23
|
};
|
|
@@ -5,7 +5,7 @@ import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
|
5
5
|
import { HintBubble, HintBubbleSize } from '../UI';
|
|
6
6
|
export const TextInput = ({ label, value, onChange, placeholder, hintText, errorText, disabled, trailingText, style, hintBubbleText, hintBubbleProps, required, labelTrailingElement, labelContainerStyle, }) => {
|
|
7
7
|
const [focused, setFocused] = useState(false);
|
|
8
|
-
return (_jsx(Box, { display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', sx: style, children: _jsxs(Box, { display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', minWidth: '260px', children: [label && (
|
|
8
|
+
return (_jsx(Box, { display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', sx: style, children: _jsxs(Box, { display: 'flex', flexDirection: 'column', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', minWidth: '260px', children: [label && (_jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', sx: labelContainerStyle, children: [_jsx(Typography, { size: TypographySize.HeadingXS, weight: TypographyWeight.SemiBold, required: required, children: label }), labelTrailingElement] })), hintBubbleText && (_jsx(HintBubble, { text: hintBubbleText, size: HintBubbleSize.sm, ...hintBubbleProps })), _jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', bgcolor: 'var(--colors-light-background-bg-component)', border: errorText
|
|
9
9
|
? 'none'
|
|
10
10
|
: '1px solid var(--colors-light-border-border-component)', overflow: 'hidden', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)', children: [_jsx(Box, { display: 'flex', flexDirection: 'row', padding: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', width: '100%', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs) 0 0 var(--spacing-tokens-size-in-px-spacing-spacing-xs)', border: `${errorText
|
|
11
11
|
? '1px solid var(--colors-light-border-border-error)'
|
|
@@ -19,5 +19,5 @@ export const TextInput = ({ label, value, onChange, placeholder, hintText, error
|
|
|
19
19
|
? 'var(--colors-light-text-text-disabled)'
|
|
20
20
|
: 'var(--colors-light-text-text-title)',
|
|
21
21
|
backgroundColor: 'transparent',
|
|
22
|
-
}, onFocus: () => setFocused(true), onBlur: () => setFocused(false), required: required }) }), trailingText && (_jsx(Box, { display: 'flex', alignItems: 'center', height: '100%', padding: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', borderLeft: '1px solid var(--colors-light-border-border-component)', children: _jsx(Typography, {
|
|
22
|
+
}, onFocus: () => setFocused(true), onBlur: () => setFocused(false), required: required }) }), trailingText && (_jsx(Box, { display: 'flex', alignItems: 'center', height: '100%', padding: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', borderLeft: '1px solid var(--colors-light-border-border-component)', children: _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: 'var(--colors-light-text-text-paragraph)', children: trailingText }) }))] }), errorText && (_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: 'var(--colors-light-text-text-error)', children: errorText })), hintText && !errorText && (_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: 'var(--colors-light-text-text-subtle)', children: hintText }))] }) }));
|
|
23
23
|
};
|
|
@@ -53,5 +53,5 @@ const IOSSwitch = styled((props) => (_jsx(Switch, { focusVisibleClassName: ".Mui
|
|
|
53
53
|
},
|
|
54
54
|
}));
|
|
55
55
|
export const Toggle = ({ checked, onChange, text = 'Click me', title, disabled = false, togglePosition = TogglePosition.Left, style, }) => {
|
|
56
|
-
return (_jsxs(Box, { display: "flex", alignItems: "flex-start", flexDirection: togglePosition === TogglePosition.Left ? 'row' : 'row-reverse', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', sx: style, children: [_jsx(IOSSwitch, { checked: checked, onChange: (e) => onChange(e.target.checked), disabled: disabled }), text && (_jsxs(Box, { display: "flex", flexDirection: "column", children: [_jsx(Typography, {
|
|
56
|
+
return (_jsxs(Box, { display: "flex", alignItems: "flex-start", flexDirection: togglePosition === TogglePosition.Left ? 'row' : 'row-reverse', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', sx: style, children: [_jsx(IOSSwitch, { checked: checked, onChange: (e) => onChange(e.target.checked), disabled: disabled }), text && (_jsxs(Box, { display: "flex", flexDirection: "column", children: [_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: 'var(--colors-light-text-text-title)', children: text }), title && (_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: "#475467", children: title }))] }))] }));
|
|
57
57
|
};
|
|
@@ -34,15 +34,15 @@ const ColorSwatch = ({ name, value }) => {
|
|
|
34
34
|
return (_jsxs("div", { className: styles.swatch, children: [_jsx("div", { className: styles.color, style: {
|
|
35
35
|
background: isGradient ? displayValue : value,
|
|
36
36
|
backgroundSize: 'cover',
|
|
37
|
-
} }), _jsxs("div", { className: styles.details, children: [_jsxs("div", { className: styles.name, style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [_jsx(Typography, {
|
|
37
|
+
} }), _jsxs("div", { className: styles.details, children: [_jsxs("div", { className: styles.name, style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-label)", children: name }), _jsx(Copy, { size: 16, onClick: handleCopyName, style: {
|
|
38
38
|
cursor: 'pointer',
|
|
39
39
|
color: 'var(--colors-light-text-text-subtle)',
|
|
40
|
-
} }), copiedName && (_jsx("div", { className: `${styles.copyIndicator} ${styles.visible}`, children: "Copied!" }))] }), _jsxs("div", { className: styles.value, style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [_jsx(Typography, {
|
|
40
|
+
} }), copiedName && (_jsx("div", { className: `${styles.copyIndicator} ${styles.visible}`, children: "Copied!" }))] }), _jsxs("div", { className: styles.value, style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [_jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: "var(--colors-light-text-text-subtle)", children: displayValue }), _jsx(Copy, { size: 16, onClick: handleCopyValue, style: {
|
|
41
41
|
cursor: 'pointer',
|
|
42
42
|
color: 'var(--colors-light-text-text-subtle)',
|
|
43
43
|
} }), copiedValue && (_jsx("div", { className: `${styles.copyIndicator} ${styles.visible}`, children: "Copied!" }))] })] })] }));
|
|
44
44
|
};
|
|
45
|
-
const ColorGroup = ({ title, colors }) => (_jsxs("div", { className: styles.group, children: [_jsx(Typography, {
|
|
45
|
+
const ColorGroup = ({ title, colors }) => (_jsxs("div", { className: styles.group, children: [_jsx(Typography, { size: TypographySize.TextM, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-label)", children: title }), _jsx("div", { className: styles.swatchGrid, children: Object.entries(colors).map(([name, value]) => (_jsx(ColorSwatch, { name: name, value: value }, name))) })] }));
|
|
46
46
|
export const Colors = () => {
|
|
47
47
|
// Group colors by their categories
|
|
48
48
|
const primitives = {
|
|
@@ -264,5 +264,5 @@ export const Colors = () => {
|
|
|
264
264
|
'--global-bp-gradient': 'var(--global-bp-gradient)',
|
|
265
265
|
},
|
|
266
266
|
};
|
|
267
|
-
return (_jsxs("div", { className: styles.container, children: [_jsx(Typography, {
|
|
267
|
+
return (_jsxs("div", { className: styles.container, children: [_jsx(Typography, { size: TypographySize.HeadingXL, weight: TypographyWeight.Bold, color: "var(--colors-light-text-text-title)", children: "Color System" }), _jsxs("section", { children: [_jsx(Typography, { size: TypographySize.HeadingM, weight: TypographyWeight.SemiBold, color: "var(--colors-light-text-text-label)", children: "Gradients" }), Object.entries(gradients).map(([title, colors]) => (_jsx(ColorGroup, { title: title, colors: colors }, title)))] }), _jsxs("section", { children: [_jsx(Typography, { size: TypographySize.HeadingM, weight: TypographyWeight.SemiBold, color: "var(--colors-light-text-text-label)", children: "Primitive Colors" }), Object.entries(primitives).map(([title, colors]) => (_jsx(ColorGroup, { title: title, colors: colors }, title)))] }), _jsxs("section", { children: [_jsx(Typography, { size: TypographySize.HeadingM, weight: TypographyWeight.SemiBold, color: "var(--colors-light-text-text-label)", children: "Semantic Colors" }), Object.entries(semanticColors).map(([title, colors]) => (_jsx(ColorGroup, { title: title, colors: colors }, title)))] })] }));
|
|
268
268
|
};
|
|
@@ -13,7 +13,7 @@ export const ComplexHeader = ({ title = 'Title', badgeText = '22', newButtonText
|
|
|
13
13
|
setLayoutType(type);
|
|
14
14
|
onLayoutChange?.(type);
|
|
15
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: [
|
|
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: [_jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [_jsx(Typography, { size: TypographySize.HeadingS, weight: TypographyWeight.Bold, children: title }), badgeText && (_jsx(Badge, { text: badgeText, size: BadgeSize.md, color: BadgeColor.Violet }))] }), 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
17
|
? ButtonHierarchy.TetriaryColor
|
|
18
18
|
: ButtonHierarchy.Tetriary, size: ButtonSize.sm, displayIconMode: ButtonDisplayMode.Only, displayIcon: "GridFour", onClick: () => handleLayoutChange(LayoutType.Grid) }), _jsx(MainButton, { hierarchy: layoutType === LayoutType.List
|
|
19
19
|
? ButtonHierarchy.TetriaryColor
|
|
@@ -5,5 +5,5 @@ import { ButtonHierarchy, ButtonSize } from '../Buttons';
|
|
|
5
5
|
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
6
6
|
import { Avatar, AvatarSize } from '../UI';
|
|
7
7
|
export const Header = ({ title = 'Beyond Presence', email, avatarProps, backButtonText = 'Back', onBackClick, onLogoutClick, className, }) => {
|
|
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, {
|
|
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, { size: TypographySize.HeadingS, weight: TypographyWeight.SemiBold, children: title })), _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, { size: TypographySize.TextS, weight: TypographyWeight.SemiBold, children: email }), _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 })] })] }));
|
|
9
9
|
};
|
|
@@ -58,9 +58,9 @@ export const NavItem = ({ text, icon, state = NavItemState.Default, size = NavIt
|
|
|
58
58
|
left: '0',
|
|
59
59
|
}, children: _jsx("path", { d: "M0 0C2.76142 0 5 2.23858 5 5V31C5 33.7614 2.76142 36 0 36V0Z" }) }), _jsxs(Box, { display: "flex", alignItems: "center", gap: "8px", sx: { transition: 'gap 0.3s ease-in-out' }, children: [_jsx(IconWrapper, { className: "nav-item-icon", "$state": state, children: getIconComponent(icon, {
|
|
60
60
|
size: 20,
|
|
61
|
-
}) }), !isCollapsed && (_jsx(TextWrapper, { className: "nav-item-text", children: _jsx(Typography, {
|
|
61
|
+
}) }), !isCollapsed && (_jsx(TextWrapper, { className: "nav-item-text", children: _jsx(Typography, { size: TypographySize.TextS, weight: state === NavItemState.Active
|
|
62
62
|
? TypographyWeight.SemiBold
|
|
63
63
|
: TypographyWeight.Medium, className: "nav-item-text", color: state === NavItemState.Active
|
|
64
64
|
? 'var(--colors-light-background-bg-brand)'
|
|
65
|
-
: 'var(--colors-light-text-text-paragraph)' }) })), showBadge && !isCollapsed && (_jsx(Badge, { size: BadgeSize.xs, icon: "ClockCountdown", showIcon: true, text: "Coming Soon", color: BadgeColor.Default }))] })] }));
|
|
65
|
+
: 'var(--colors-light-text-text-paragraph)', children: text }) })), showBadge && !isCollapsed && (_jsx(Badge, { size: BadgeSize.xs, icon: "ClockCountdown", showIcon: true, text: "Coming Soon", color: BadgeColor.Default }))] })] }));
|
|
66
66
|
};
|
|
@@ -7,5 +7,5 @@ export const ProcessHeader = ({ title, currentStep, subtitle, totalSteps, header
|
|
|
7
7
|
const stepChecks = () => {
|
|
8
8
|
return (currentStep && totalSteps && currentStep >= 1 && currentStep <= totalSteps);
|
|
9
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, {
|
|
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, { size: TypographySize.TextM, weight: TypographyWeight.SemiBold, children: `${title}.` })), subtitle && (_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, children: subtitle }))] })] }), onCancelClick && (_jsx(MainButton, { text: 'Cancel Process', onClick: onCancelClick, size: ButtonSize.md, hierarchy: ButtonHierarchy.TetriaryColor, trailingIcon: 'X', showTrailingIcon: true }))] }));
|
|
11
11
|
};
|
|
@@ -104,9 +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: isCollapsed
|
|
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, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-paragraph)", className: isCollapsed ? 'hidden' : '', children: isCollapsed
|
|
108
108
|
? section.title.split(' ')[0]
|
|
109
|
-
: section.title
|
|
109
|
+
: section.title }) })), section.items.map((item, itemIndex) => (_jsx(NavItemWrapper, { item: item, isCollapsed: isCollapsed }, `${item.text}-${itemIndex}`)))] }), sectionIndex < navSections.length - 1 &&
|
|
110
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: {
|
|
111
111
|
display: 'flex',
|
|
112
112
|
justifyContent: 'center',
|
|
@@ -1,33 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { TypographySize, TypographyWeight } from './types';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export const Typography = ({ text, color, size = TypographySize.HeadingL, weight = TypographyWeight.Bold, className, required = false, style, trailingElement = null, textStyle, }) => {
|
|
3
|
+
import { getTextStyles, getTypographySizeToken, getTypographyWeightToken, } from '../../utils';
|
|
4
|
+
export const Typography = ({ text, color, size = TypographySize.HeadingL, weight = TypographyWeight.Bold, className, required = false, textStyle, children, }) => {
|
|
6
5
|
const sizeToken = getTypographySizeToken(size);
|
|
7
6
|
const weightToken = getTypographyWeightToken(weight);
|
|
8
|
-
const { fontSize, fontWeight, fontFamily, lineHeight, letterSpacing, paragraphIndent, paragraphSpacing, textDecoration, } = getTextStyles(sizeToken, weightToken);
|
|
9
|
-
const textTransform = getTextTransform(sizeToken, weightToken);
|
|
7
|
+
const { fontSize, fontWeight, fontFamily, lineHeight, letterSpacing, paragraphIndent, paragraphSpacing, textDecoration, textTransform, } = getTextStyles(sizeToken, weightToken);
|
|
10
8
|
const requiredColor = 'var(--colors-light-text-text-error)';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
textDecoration: textDecoration,
|
|
25
|
-
color: color || 'var(--global-text-text-title)',
|
|
26
|
-
...textStyle,
|
|
27
|
-
}, children: [text, required && _jsx("span", { style: { color: requiredColor }, children: "*" })] }));
|
|
28
|
-
};
|
|
29
|
-
if (!trailingElement) {
|
|
30
|
-
return _jsx(Label, {});
|
|
31
|
-
}
|
|
32
|
-
return (_jsxs(Box, { display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "flex-start", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)", sx: style, children: [_jsx(Label, {}), trailingElement] }));
|
|
9
|
+
return (_jsxs("span", { className: className, style: {
|
|
10
|
+
fontSize: fontSize,
|
|
11
|
+
fontWeight: fontWeight,
|
|
12
|
+
fontFamily: fontFamily + ', sans-serif',
|
|
13
|
+
lineHeight: lineHeight + 'px',
|
|
14
|
+
letterSpacing: letterSpacing,
|
|
15
|
+
textIndent: paragraphIndent,
|
|
16
|
+
marginBottom: paragraphSpacing,
|
|
17
|
+
textTransform: textTransform,
|
|
18
|
+
textDecoration: textDecoration,
|
|
19
|
+
color: color || 'var(--global-text-text-title)',
|
|
20
|
+
...textStyle,
|
|
21
|
+
}, children: [children || text, required && _jsx("span", { style: { color: requiredColor }, children: ' *' })] }));
|
|
33
22
|
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { Typography } from './Typography';
|
|
3
2
|
import { TypographySize, TypographyWeight } from './types';
|
|
4
|
-
import { Info } from '@phosphor-icons/react';
|
|
5
3
|
const meta = {
|
|
6
4
|
title: 'Design System/Components/Typography/Typography',
|
|
7
5
|
component: Typography,
|
|
@@ -16,7 +14,14 @@ const meta = {
|
|
|
16
14
|
argTypes: {
|
|
17
15
|
text: {
|
|
18
16
|
control: 'text',
|
|
19
|
-
description: '
|
|
17
|
+
description: 'Text content of the typography',
|
|
18
|
+
table: {
|
|
19
|
+
type: { summary: 'string' },
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
children: {
|
|
23
|
+
control: 'text',
|
|
24
|
+
description: 'Text content of the typography',
|
|
20
25
|
table: {
|
|
21
26
|
type: { summary: 'string' },
|
|
22
27
|
},
|
|
@@ -53,13 +58,6 @@ const meta = {
|
|
|
53
58
|
type: { summary: 'boolean' },
|
|
54
59
|
},
|
|
55
60
|
},
|
|
56
|
-
style: {
|
|
57
|
-
control: 'object',
|
|
58
|
-
description: 'Style of the typography',
|
|
59
|
-
table: {
|
|
60
|
-
type: { summary: 'object' },
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
61
|
className: {
|
|
64
62
|
control: 'text',
|
|
65
63
|
description: 'Class name of the typography',
|
|
@@ -67,10 +65,11 @@ const meta = {
|
|
|
67
65
|
type: { summary: 'string' },
|
|
68
66
|
},
|
|
69
67
|
},
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
textStyle: {
|
|
69
|
+
control: 'object',
|
|
70
|
+
description: 'Style object of the typography',
|
|
72
71
|
table: {
|
|
73
|
-
type: { summary: '
|
|
72
|
+
type: { summary: 'object' },
|
|
74
73
|
},
|
|
75
74
|
},
|
|
76
75
|
},
|
|
@@ -78,142 +77,141 @@ const meta = {
|
|
|
78
77
|
export default meta;
|
|
79
78
|
export const HeadingXLBold = {
|
|
80
79
|
args: {
|
|
81
|
-
|
|
80
|
+
children: 'Typography',
|
|
82
81
|
size: TypographySize.HeadingXL,
|
|
83
82
|
weight: TypographyWeight.Bold,
|
|
84
|
-
trailingElement: _jsx(Info, { size: 24 }),
|
|
85
83
|
required: true,
|
|
86
84
|
},
|
|
87
85
|
};
|
|
88
86
|
export const HeadingXLSemiBold = {
|
|
89
87
|
args: {
|
|
90
|
-
|
|
88
|
+
children: 'Typography',
|
|
91
89
|
size: TypographySize.HeadingXL,
|
|
92
90
|
weight: TypographyWeight.SemiBold,
|
|
93
91
|
},
|
|
94
92
|
};
|
|
95
93
|
export const HeadingXLMedium = {
|
|
96
94
|
args: {
|
|
97
|
-
|
|
95
|
+
children: 'Typography',
|
|
98
96
|
size: TypographySize.HeadingXL,
|
|
99
97
|
weight: TypographyWeight.Medium,
|
|
100
98
|
},
|
|
101
99
|
};
|
|
102
100
|
export const HeadingXLRegular = {
|
|
103
101
|
args: {
|
|
104
|
-
|
|
102
|
+
children: 'Typography',
|
|
105
103
|
size: TypographySize.HeadingXL,
|
|
106
104
|
weight: TypographyWeight.Regular,
|
|
107
105
|
},
|
|
108
106
|
};
|
|
109
107
|
export const HeadingLBold = {
|
|
110
108
|
args: {
|
|
111
|
-
|
|
109
|
+
children: 'Typography',
|
|
112
110
|
size: TypographySize.HeadingL,
|
|
113
111
|
weight: TypographyWeight.Bold,
|
|
114
112
|
},
|
|
115
113
|
};
|
|
116
114
|
export const HeadingLSemiBold = {
|
|
117
115
|
args: {
|
|
118
|
-
|
|
116
|
+
children: 'Typography',
|
|
119
117
|
size: TypographySize.HeadingL,
|
|
120
118
|
weight: TypographyWeight.SemiBold,
|
|
121
119
|
},
|
|
122
120
|
};
|
|
123
121
|
export const HeadingLMedium = {
|
|
124
122
|
args: {
|
|
125
|
-
|
|
123
|
+
children: 'Typography',
|
|
126
124
|
size: TypographySize.HeadingL,
|
|
127
125
|
weight: TypographyWeight.Medium,
|
|
128
126
|
},
|
|
129
127
|
};
|
|
130
128
|
export const HeadingLRegular = {
|
|
131
129
|
args: {
|
|
132
|
-
|
|
130
|
+
children: 'Typography',
|
|
133
131
|
size: TypographySize.HeadingL,
|
|
134
132
|
weight: TypographyWeight.Regular,
|
|
135
133
|
},
|
|
136
134
|
};
|
|
137
135
|
export const HeadingMBold = {
|
|
138
136
|
args: {
|
|
139
|
-
|
|
137
|
+
children: 'Typography',
|
|
140
138
|
size: TypographySize.HeadingM,
|
|
141
139
|
weight: TypographyWeight.Bold,
|
|
142
140
|
},
|
|
143
141
|
};
|
|
144
142
|
export const Heading2XSRegular = {
|
|
145
143
|
args: {
|
|
146
|
-
|
|
144
|
+
children: 'Typography',
|
|
147
145
|
size: TypographySize.Heading2XS,
|
|
148
146
|
weight: TypographyWeight.Regular,
|
|
149
147
|
},
|
|
150
148
|
};
|
|
151
149
|
export const TextLBold = {
|
|
152
150
|
args: {
|
|
153
|
-
|
|
151
|
+
children: 'Typography',
|
|
154
152
|
size: TypographySize.TextL,
|
|
155
153
|
weight: TypographyWeight.Bold,
|
|
156
154
|
},
|
|
157
155
|
};
|
|
158
156
|
export const TextLSemiBold = {
|
|
159
157
|
args: {
|
|
160
|
-
|
|
158
|
+
children: 'Typography',
|
|
161
159
|
size: TypographySize.TextL,
|
|
162
160
|
weight: TypographyWeight.SemiBold,
|
|
163
161
|
},
|
|
164
162
|
};
|
|
165
163
|
export const TextLMedium = {
|
|
166
164
|
args: {
|
|
167
|
-
|
|
165
|
+
children: 'Typography',
|
|
168
166
|
size: TypographySize.TextL,
|
|
169
167
|
weight: TypographyWeight.Medium,
|
|
170
168
|
},
|
|
171
169
|
};
|
|
172
170
|
export const TextLRegular = {
|
|
173
171
|
args: {
|
|
174
|
-
|
|
172
|
+
children: 'Typography',
|
|
175
173
|
size: TypographySize.TextL,
|
|
176
174
|
weight: TypographyWeight.Regular,
|
|
177
175
|
},
|
|
178
176
|
};
|
|
179
177
|
export const TextMBold = {
|
|
180
178
|
args: {
|
|
181
|
-
|
|
179
|
+
children: 'Typography',
|
|
182
180
|
size: TypographySize.TextM,
|
|
183
181
|
weight: TypographyWeight.Bold,
|
|
184
182
|
},
|
|
185
183
|
};
|
|
186
184
|
export const TextMSemiBold = {
|
|
187
185
|
args: {
|
|
188
|
-
|
|
186
|
+
children: 'Typography',
|
|
189
187
|
size: TypographySize.TextM,
|
|
190
188
|
weight: TypographyWeight.SemiBold,
|
|
191
189
|
},
|
|
192
190
|
};
|
|
193
191
|
export const TextMMedium = {
|
|
194
192
|
args: {
|
|
195
|
-
|
|
193
|
+
children: 'Typography',
|
|
196
194
|
size: TypographySize.TextM,
|
|
197
195
|
weight: TypographyWeight.Medium,
|
|
198
196
|
},
|
|
199
197
|
};
|
|
200
198
|
export const TextMRegular = {
|
|
201
199
|
args: {
|
|
202
|
-
|
|
200
|
+
children: 'Typography',
|
|
203
201
|
size: TypographySize.TextM,
|
|
204
202
|
weight: TypographyWeight.Regular,
|
|
205
203
|
},
|
|
206
204
|
};
|
|
207
205
|
export const TextSBold = {
|
|
208
206
|
args: {
|
|
209
|
-
|
|
207
|
+
children: 'Typography',
|
|
210
208
|
size: TypographySize.TextS,
|
|
211
209
|
weight: TypographyWeight.Bold,
|
|
212
210
|
},
|
|
213
211
|
};
|
|
214
212
|
export const TextSSemiBold = {
|
|
215
213
|
args: {
|
|
216
|
-
|
|
214
|
+
children: 'Typography',
|
|
217
215
|
size: TypographySize.TextS,
|
|
218
216
|
weight: TypographyWeight.SemiBold,
|
|
219
217
|
},
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Theme, SxProps } from '@mui/material';
|
|
2
1
|
/**
|
|
3
2
|
* Typography size variants
|
|
4
3
|
*/
|
|
@@ -29,7 +28,7 @@ export declare enum TypographyWeight {
|
|
|
29
28
|
*/
|
|
30
29
|
export interface TypographyProps {
|
|
31
30
|
/** Text content of the typography */
|
|
32
|
-
text
|
|
31
|
+
text?: string;
|
|
33
32
|
/** Size variant of the typography */
|
|
34
33
|
size?: TypographySize;
|
|
35
34
|
/** Weight variant of the typography */
|
|
@@ -38,12 +37,8 @@ export interface TypographyProps {
|
|
|
38
37
|
color?: string;
|
|
39
38
|
/** CSS class name for additional styling */
|
|
40
39
|
className?: string;
|
|
41
|
-
/** Style object for the container */
|
|
42
|
-
style?: SxProps<Theme>;
|
|
43
40
|
/** Style object for the text */
|
|
44
41
|
textStyle?: React.CSSProperties;
|
|
45
42
|
/** Whether the typography is required */
|
|
46
43
|
required?: boolean;
|
|
47
|
-
/** Whether the typography has a trailing element */
|
|
48
|
-
trailingElement?: React.ReactNode;
|
|
49
44
|
}
|
|
@@ -65,7 +65,7 @@ export const Avatar = ({ avatarStyle = AvatarStyle.Placeholder, border = false,
|
|
|
65
65
|
},
|
|
66
66
|
};
|
|
67
67
|
if (avatarStyle === AvatarStyle.Letters) {
|
|
68
|
-
return (_jsx(MuiAvatar, { ...props, children: _jsx(Typography, {
|
|
68
|
+
return (_jsx(MuiAvatar, { ...props, children: _jsx(Typography, { size: getTextSize(), weight: TypographyWeight.Medium, children: getInitials(text) }) }));
|
|
69
69
|
}
|
|
70
70
|
else if (avatarStyle === AvatarStyle.Picture) {
|
|
71
71
|
return _jsx(MuiAvatar, { ...props, src: image });
|
package/dist/stories/UI/Badge.js
CHANGED
|
@@ -114,5 +114,5 @@ export const Badge = ({ color = BadgeColor.Default, size = BadgeSize.md, text, s
|
|
|
114
114
|
color: iconColor || getTextColor(),
|
|
115
115
|
weight: iconWeight,
|
|
116
116
|
};
|
|
117
|
-
return (_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "center", bgcolor: fill ? backgroundColor : 'transparent', border: fill ? border : 'none', borderRadius: fill ? 'var(--spacing-tokens-size-in-px-radius-radius-full)' : 'none', padding: padding, margin: 0, gap: "4px", sx: customStyle, children: [showIcon && icon && getIconComponent(icon, iconProps), text && (_jsx(Typography, {
|
|
117
|
+
return (_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "center", bgcolor: fill ? backgroundColor : 'transparent', border: fill ? border : 'none', borderRadius: fill ? 'var(--spacing-tokens-size-in-px-radius-radius-full)' : 'none', padding: padding, margin: 0, gap: "4px", sx: customStyle, children: [showIcon && icon && getIconComponent(icon, iconProps), text && (_jsx(Typography, { size: getTypographySize(size), weight: TypographyWeight.Medium, color: getTextColor(), children: text }))] }));
|
|
118
118
|
};
|
|
@@ -24,5 +24,5 @@ export const HintBubble = ({ text, size = HintBubbleSize.md, type = HintBubbleTy
|
|
|
24
24
|
return 'var(--colors-light-text-text-error)';
|
|
25
25
|
return 'var(--colors-light-text-text-title)';
|
|
26
26
|
};
|
|
27
|
-
return (_jsx(Box, { borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', bgcolor: 'var(--colors-light-background-bg-card-highlight)', padding: getPadding(), gap: '10px', sx: style, children: _jsx(Typography, {
|
|
27
|
+
return (_jsx(Box, { borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', bgcolor: 'var(--colors-light-background-bg-card-highlight)', padding: getPadding(), gap: '10px', sx: style, children: _jsx(Typography, { size: getTypographySize(), weight: getTypographyWeight(), color: getTypographyColor(), children: text }) }));
|
|
28
28
|
};
|
package/dist/stories/UI/Menu.js
CHANGED
|
@@ -43,7 +43,7 @@ export const Menu = ({ icon = 'DotsThree', items, style, }) => {
|
|
|
43
43
|
width: '20px',
|
|
44
44
|
height: '20px',
|
|
45
45
|
color: getColor(action),
|
|
46
|
-
}), action?.label && (_jsx(Typography, {
|
|
46
|
+
}), action?.label && (_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: getColor(action), children: action.label }))] }, index));
|
|
47
47
|
}
|
|
48
48
|
}) })] }));
|
|
49
49
|
};
|
|
@@ -25,7 +25,7 @@ export const ProgressIndicator = ({ mode = ProgressIndicatorMode.Value, currentV
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
if (errorText) {
|
|
28
|
-
return (_jsx(Typography, {
|
|
28
|
+
return (_jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, children: errorText }));
|
|
29
29
|
}
|
|
30
|
-
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, {
|
|
30
|
+
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, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: textColor, children: `${currentValue.toLocaleString(undefined, { maximumFractionDigits: 2 })} / ${maxValue.toLocaleString(undefined, { maximumFractionDigits: 2 })} ${text}` })), _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, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: textColor, children: `${currentValue.toLocaleString(undefined, { maximumFractionDigits: 2 })}%` }))] }));
|
|
31
31
|
};
|
|
@@ -5,5 +5,5 @@ import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
|
5
5
|
import { Badge } from './Badge';
|
|
6
6
|
import { ButtonHierarchy, ButtonSize, MainButton } from '../Buttons';
|
|
7
7
|
export const Topbar = ({ title, badgeText, newButtonText, onNewButtonClick, newButtonHidden, className, style, }) => {
|
|
8
|
-
return (_jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', className: className, sx: style, minWidth: '400px', children: [
|
|
8
|
+
return (_jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', paddingX: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', paddingY: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', className: className, sx: style, minWidth: '400px', children: [_jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', children: [_jsx(Typography, { size: TypographySize.HeadingS, weight: TypographyWeight.SemiBold, children: title }), badgeText && (_jsx(Badge, { text: badgeText, size: BadgeSize.xs, color: BadgeColor.Violet, style: { marginBottom: '10px' } }))] }), !newButtonHidden && (_jsx(MainButton, { size: ButtonSize.lg, text: newButtonText, onClick: onNewButtonClick, hierarchy: ButtonHierarchy.Primary, trailingIcon: 'Plus', showTrailingIcon: true }))] }));
|
|
9
9
|
};
|
|
@@ -10,5 +10,5 @@ export declare const getTextStyles: (sizeToken: string, weightToken: string) =>
|
|
|
10
10
|
paragraphIndent: string;
|
|
11
11
|
paragraphSpacing: string;
|
|
12
12
|
textDecoration: string;
|
|
13
|
+
textTransform: "uppercase" | "none";
|
|
13
14
|
};
|
|
14
|
-
export declare const getTextTransform: (sizeToken: string, weightToken: string) => "uppercase" | "none";
|
package/dist/utils/typography.js
CHANGED
|
@@ -16,6 +16,12 @@ export const getTypographyWeightToken = (weight) => {
|
|
|
16
16
|
}
|
|
17
17
|
return weightLc;
|
|
18
18
|
};
|
|
19
|
+
const getTextTransform = (sizeToken, weightToken) => {
|
|
20
|
+
const computedValue = getComputedStyle(document.documentElement)
|
|
21
|
+
.getPropertyValue(`--global-${sizeToken}-${weightToken}-text-case`)
|
|
22
|
+
.trim();
|
|
23
|
+
return computedValue === 'uppercase' ? 'uppercase' : 'none';
|
|
24
|
+
};
|
|
19
25
|
export const getTextStyles = (sizeToken, weightToken) => {
|
|
20
26
|
const fontSize = `var(--global-${sizeToken}-${weightToken}-font-size)`;
|
|
21
27
|
const fontWeight = `var(--global-${sizeToken}-${weightToken}-font-weight)`;
|
|
@@ -25,6 +31,7 @@ export const getTextStyles = (sizeToken, weightToken) => {
|
|
|
25
31
|
const paragraphIndent = `var(--global-${sizeToken}-${weightToken}-paragraph-indent)`;
|
|
26
32
|
const paragraphSpacing = `var(--global-${sizeToken}-${weightToken}-paragraph-spacing)`;
|
|
27
33
|
const textDecoration = `var(--global-${sizeToken}-${weightToken}-text-decoration)`;
|
|
34
|
+
const textTransform = getTextTransform(sizeToken, weightToken);
|
|
28
35
|
return {
|
|
29
36
|
fontSize,
|
|
30
37
|
fontWeight,
|
|
@@ -34,11 +41,6 @@ export const getTextStyles = (sizeToken, weightToken) => {
|
|
|
34
41
|
paragraphIndent,
|
|
35
42
|
paragraphSpacing,
|
|
36
43
|
textDecoration,
|
|
44
|
+
textTransform,
|
|
37
45
|
};
|
|
38
46
|
};
|
|
39
|
-
export const getTextTransform = (sizeToken, weightToken) => {
|
|
40
|
-
const computedValue = getComputedStyle(document.documentElement)
|
|
41
|
-
.getPropertyValue(`--global-${sizeToken}-${weightToken}-text-case`)
|
|
42
|
-
.trim();
|
|
43
|
-
return computedValue === 'uppercase' ? 'uppercase' : 'none';
|
|
44
|
-
};
|