@beydesign/storybook 0.0.48 → 0.0.49
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.
|
@@ -34,6 +34,8 @@ export type TextAreaProps = {
|
|
|
34
34
|
required?: boolean;
|
|
35
35
|
/** Text area label trailing element */
|
|
36
36
|
labelTrailingElement?: React.ReactNode;
|
|
37
|
+
/** Text area label container style */
|
|
38
|
+
labelContainerStyle?: SxProps<Theme>;
|
|
37
39
|
};
|
|
38
40
|
/**
|
|
39
41
|
* Text input component props
|
|
@@ -65,6 +67,8 @@ export type TextInputProps = {
|
|
|
65
67
|
required?: boolean;
|
|
66
68
|
/** Text input label trailing element */
|
|
67
69
|
labelTrailingElement?: React.ReactNode;
|
|
70
|
+
/** Text input label container style */
|
|
71
|
+
labelContainerStyle?: SxProps<Theme>;
|
|
68
72
|
};
|
|
69
73
|
/**
|
|
70
74
|
* Toggle position variants
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { TypographySize, TypographyWeight } from './types';
|
|
3
3
|
import { Box } from '@mui/material';
|
|
4
|
-
export const Typography = ({ text, color, size = TypographySize.HeadingL, weight = TypographyWeight.Bold, className, required = false, style, trailingElement = null, }) => {
|
|
4
|
+
export const Typography = ({ text, color, size = TypographySize.HeadingL, weight = TypographyWeight.Bold, className, required = false, style, trailingElement = null, textStyle, }) => {
|
|
5
5
|
const getTypographySizeToken = () => {
|
|
6
6
|
let sizeLc = size?.toLowerCase() || '';
|
|
7
7
|
if (sizeLc.includes('heading')) {
|
|
@@ -52,11 +52,11 @@ export const Typography = ({ text, color, size = TypographySize.HeadingL, weight
|
|
|
52
52
|
textTransform: getTextTransform(),
|
|
53
53
|
textDecoration: textDecoration,
|
|
54
54
|
color: color || 'var(--global-text-text-title)',
|
|
55
|
-
...
|
|
55
|
+
...textStyle,
|
|
56
56
|
}, children: [text, required && _jsx("span", { style: { color: requiredColor }, children: "*" })] }));
|
|
57
57
|
};
|
|
58
58
|
if (!trailingElement) {
|
|
59
59
|
return _jsx(Label, {});
|
|
60
60
|
}
|
|
61
|
-
return (_jsxs(Box, { display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "flex-start", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-xs)", children: [_jsx(Label, {}), trailingElement] }));
|
|
61
|
+
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] }));
|
|
62
62
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Theme, SxProps } from '@mui/material';
|
|
1
2
|
/**
|
|
2
3
|
* Typography size variants
|
|
3
4
|
*/
|
|
@@ -37,8 +38,10 @@ export interface TypographyProps {
|
|
|
37
38
|
color?: string;
|
|
38
39
|
/** CSS class name for additional styling */
|
|
39
40
|
className?: string;
|
|
40
|
-
/** Style object for
|
|
41
|
-
style?:
|
|
41
|
+
/** Style object for the container */
|
|
42
|
+
style?: SxProps<Theme>;
|
|
43
|
+
/** Style object for the text */
|
|
44
|
+
textStyle?: React.CSSProperties;
|
|
42
45
|
/** Whether the typography is required */
|
|
43
46
|
required?: boolean;
|
|
44
47
|
/** Whether the typography has a trailing element */
|