@ndlib/component-library 0.0.34 → 0.0.36
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/components/composites/EmptyState/EmptyState.stories.d.ts +1 -0
- package/dist/components/composites/EmptyState/EmptyState.stories.js +5 -1
- package/dist/components/composites/EmptyState/index.d.ts +5 -0
- package/dist/components/composites/EmptyState/index.js +8 -2
- package/dist/components/elements/Fields/Select/index.js +1 -1
- package/dist/components/elements/Icon/index.js +12 -2
- package/dist/components/elements/List/List.stories.d.ts +1 -0
- package/dist/components/elements/List/List.stories.js +6 -0
- package/dist/components/elements/List/index.d.ts +7 -0
- package/dist/components/elements/List/index.js +37 -15
- package/dist/components/elements/text/ReadMore/index.d.ts +4 -0
- package/dist/components/elements/text/ReadMore/index.js +1 -1
- package/dist/components/providers/ui.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/typography.d.ts +7 -0
- package/dist/theme/typography.js +34 -3
- package/package.json +1 -1
|
@@ -4,5 +4,6 @@ declare const meta: Meta<typeof EmptyState>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof EmptyState>;
|
|
6
6
|
export declare const Default: Story;
|
|
7
|
+
export declare const Small: Story;
|
|
7
8
|
export declare const CustomMessage: Story;
|
|
8
9
|
export declare const CustomIcon: Story;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { EmptyState } from '.';
|
|
2
|
+
import { EMPTY_STATE_SIZE, EmptyState } from '.';
|
|
3
3
|
import NotInterestedIcon from '@mui/icons-material/NotInterested';
|
|
4
4
|
const meta = {
|
|
5
5
|
title: 'Composites/EmptyState',
|
|
@@ -11,6 +11,10 @@ export const Default = {
|
|
|
11
11
|
render: () => _jsx(EmptyState, {}),
|
|
12
12
|
args: {},
|
|
13
13
|
};
|
|
14
|
+
export const Small = {
|
|
15
|
+
render: () => _jsx(EmptyState, { size: EMPTY_STATE_SIZE.SM }),
|
|
16
|
+
args: {},
|
|
17
|
+
};
|
|
14
18
|
export const CustomMessage = {
|
|
15
19
|
render: () => _jsx(EmptyState, { message: "Custom message" }),
|
|
16
20
|
args: {},
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { StyledElementProps } from '../../../theme';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
export declare enum EMPTY_STATE_SIZE {
|
|
4
|
+
SM = "SM",
|
|
5
|
+
LG = "LG"
|
|
6
|
+
}
|
|
3
7
|
type EmptyStateProps = StyledElementProps<HTMLDivElement, {
|
|
4
8
|
icon?: React.FC;
|
|
9
|
+
size?: EMPTY_STATE_SIZE;
|
|
5
10
|
message?: string;
|
|
6
11
|
}>;
|
|
7
12
|
export declare const DEFAULT_MESSAGE = "No results found.";
|
|
@@ -19,8 +19,14 @@ import { Icon } from '../../elements/Icon';
|
|
|
19
19
|
import { FONT_SIZE } from '../../../theme/typography';
|
|
20
20
|
import { importedDefaultComponentShim } from '../../../utils/misc';
|
|
21
21
|
const SearchOffIcon = importedDefaultComponentShim(_SearchOffIcon);
|
|
22
|
+
export var EMPTY_STATE_SIZE;
|
|
23
|
+
(function (EMPTY_STATE_SIZE) {
|
|
24
|
+
EMPTY_STATE_SIZE["SM"] = "SM";
|
|
25
|
+
EMPTY_STATE_SIZE["LG"] = "LG";
|
|
26
|
+
})(EMPTY_STATE_SIZE || (EMPTY_STATE_SIZE = {}));
|
|
22
27
|
export const DEFAULT_MESSAGE = 'No results found.';
|
|
23
28
|
export const EmptyState = (_a) => {
|
|
24
|
-
var { icon, message, sx } = _a, rest = __rest(_a, ["icon", "message", "sx"]);
|
|
25
|
-
|
|
29
|
+
var { icon, message, size: sizeProp, sx } = _a, rest = __rest(_a, ["icon", "message", "size", "sx"]);
|
|
30
|
+
const size = sizeProp || EMPTY_STATE_SIZE.LG;
|
|
31
|
+
return (_jsxs(Column, Object.assign({ sx: Object.assign({ width: '100%', alignItems: 'center', justifyContent: 'center', mt: size === EMPTY_STATE_SIZE.SM ? 3 : 5 }, sx) }, rest, { children: [_jsx(Row, { children: _jsx(Icon, { icon: icon || SearchOffIcon, size: size === EMPTY_STATE_SIZE.SM ? FONT_SIZE.ML : FONT_SIZE.XL, color: COLOR.GRAY }) }), _jsx(Row, Object.assign({ sx: { mt: size === EMPTY_STATE_SIZE.SM ? 0 : 1 } }, { children: _jsx(Paragraph, Object.assign({ sx: { color: COLOR.GRAY }, size: size === EMPTY_STATE_SIZE.SM ? PARAGRAPH_SIZE.MD : PARAGRAPH_SIZE.LG }, { children: message || DEFAULT_MESSAGE })) }))] })));
|
|
26
32
|
};
|
|
@@ -13,10 +13,20 @@ import { jsx as _jsx } from "theme-ui/jsx-runtime";
|
|
|
13
13
|
/** @jsxImportSource theme-ui */
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { COLOR, colors } from '../../../theme/colors';
|
|
16
|
+
import { useEnvironment } from '../../providers/env';
|
|
16
17
|
export const Icon = (_a) => {
|
|
17
|
-
var { icon, size, color, sx } = _a, rest = __rest(_a, ["icon", "size", "color", "sx"]);
|
|
18
|
+
var { icon, size, color, sx, onClick } = _a, rest = __rest(_a, ["icon", "size", "color", "sx", "onClick"]);
|
|
18
19
|
const InnerComponent = icon;
|
|
19
|
-
|
|
20
|
+
const { flagInDevelopment } = useEnvironment();
|
|
21
|
+
if (onClick && !rest['aria-label']) {
|
|
22
|
+
flagInDevelopment('Icon component with onClick should have an aria-label and tabIndex={0}');
|
|
23
|
+
}
|
|
24
|
+
return (_jsx("div", Object.assign({ tabIndex: onClick ? 0 : undefined, role: onClick ? 'button' : 'none', sx: Object.assign(Object.assign({}, sx), { fontSize: size, display: 'flex', alignItems: 'center', justifyContent: 'center', ':hover': onClick
|
|
25
|
+
? {
|
|
26
|
+
cursor: 'pointer',
|
|
27
|
+
transform: 'scale(1.05)',
|
|
28
|
+
}
|
|
29
|
+
: {} }) }, rest, { children: React.createElement(InnerComponent, {
|
|
20
30
|
fontSize: 'inherit',
|
|
21
31
|
style: {
|
|
22
32
|
color: colors[color || COLOR.PRIMARY],
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
|
3
|
+
import BookmarkIcon from '@mui/icons-material/Bookmark';
|
|
4
|
+
import BookmarkBorderIcon from '@mui/icons-material/BookmarkBorder';
|
|
3
5
|
import { LIST_SIZE, List, ListItem } from './index';
|
|
4
6
|
import { Row } from '../layout/Row';
|
|
5
7
|
import { Column } from '../layout/Column';
|
|
6
8
|
import { HEADING_SIZE, Heading } from '../text/Heading';
|
|
7
9
|
import { GROUP_TYPE, Group } from '../Group';
|
|
8
10
|
import { COLOR } from '../../..';
|
|
11
|
+
import { FONT_SIZE } from '../../../theme/typography';
|
|
9
12
|
const meta = {
|
|
10
13
|
title: 'Elements/List',
|
|
11
14
|
component: List,
|
|
@@ -29,3 +32,6 @@ export const Ordered = {
|
|
|
29
32
|
export const CustomIcon = {
|
|
30
33
|
render: () => (_jsx(Row, { children: _jsxs(List, Object.assign({ icon: ChevronRightIcon, iconColor: COLOR.PRIMARY }, { children: [_jsx(ListItem, Object.assign({ index: 0 }, { children: "List Item 1" })), _jsx(ListItem, Object.assign({ index: 1 }, { children: "List Item 2" })), _jsx(ListItem, Object.assign({ index: 2 }, { children: "List Item 3" }))] })) })),
|
|
31
34
|
};
|
|
35
|
+
export const CustomIconPerItem = {
|
|
36
|
+
render: () => (_jsx(Row, { children: _jsxs(List, Object.assign({ iconSize: FONT_SIZE.ML }, { children: [_jsx(ListItem, Object.assign({ index: 0, icon: BookmarkIcon, onIconClick: () => { }, iconLabel: "Unfavorite" }, { children: "Favorite 1" })), _jsx(ListItem, Object.assign({ index: 1, icon: BookmarkIcon, onIconClick: () => { }, iconLabel: "Favorite" }, { children: "Favorited 2" })), _jsx(ListItem, Object.assign({ index: 2, icon: BookmarkBorderIcon, onIconClick: () => { }, iconLabel: "Favorite" }, { children: "Not Favorited" }))] })) })),
|
|
37
|
+
};
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { StyledElementProps } from '../../../theme';
|
|
4
4
|
import { COLOR } from '../../..';
|
|
5
|
+
import { FONT_SIZE } from '../../../theme/typography';
|
|
5
6
|
type ListProps = StyledElementProps<HTMLUListElement, {
|
|
6
7
|
ordered?: boolean;
|
|
7
8
|
size?: LIST_SIZE;
|
|
8
9
|
icon?: React.FC<any>;
|
|
9
10
|
iconColor?: COLOR;
|
|
11
|
+
iconSize?: FONT_SIZE;
|
|
10
12
|
}>;
|
|
11
13
|
export declare enum LIST_SIZE {
|
|
12
14
|
SM = "sm",
|
|
@@ -16,6 +18,11 @@ export declare enum LIST_SIZE {
|
|
|
16
18
|
export declare const List: React.FC<ListProps>;
|
|
17
19
|
type ListItemProps = StyledElementProps<HTMLLIElement, {
|
|
18
20
|
index: number;
|
|
21
|
+
icon?: React.FC<any>;
|
|
22
|
+
iconSize?: FONT_SIZE;
|
|
23
|
+
iconColor?: COLOR;
|
|
24
|
+
iconLabel?: string;
|
|
25
|
+
onIconClick?: () => void;
|
|
19
26
|
}>;
|
|
20
27
|
export declare const ListItem: React.FC<ListItemProps>;
|
|
21
28
|
export {};
|
|
@@ -20,6 +20,9 @@ import { COLOR, Label, TYPOGRAPHY_TYPE } from '../../..';
|
|
|
20
20
|
import { FONT_SIZE, getTypographyStyles } from '../../../theme/typography';
|
|
21
21
|
import { Icon } from '../Icon';
|
|
22
22
|
import { importedDefaultComponentShim } from '../../../utils/misc';
|
|
23
|
+
import { useLinesHeight } from '../text/ReadMore';
|
|
24
|
+
import { Column } from '../layout/Column';
|
|
25
|
+
import { useEnvironment } from '../../providers/env';
|
|
23
26
|
const CircleIcon = importedDefaultComponentShim(_CircleIcon);
|
|
24
27
|
const CircleOutlinedIcon = importedDefaultComponentShim(_CircleOutlinedIcon);
|
|
25
28
|
const SquareIcon = importedDefaultComponentShim(_SquareIcon);
|
|
@@ -35,6 +38,11 @@ const marginSizeMap = {
|
|
|
35
38
|
[LIST_SIZE.MD]: 3,
|
|
36
39
|
[LIST_SIZE.LG]: 4,
|
|
37
40
|
};
|
|
41
|
+
const iconSizeMap = {
|
|
42
|
+
[LIST_SIZE.SM]: FONT_SIZE.XXS,
|
|
43
|
+
[LIST_SIZE.MD]: FONT_SIZE.XXS,
|
|
44
|
+
[LIST_SIZE.LG]: FONT_SIZE.XS,
|
|
45
|
+
};
|
|
38
46
|
const defaultIcons = [
|
|
39
47
|
CircleIcon,
|
|
40
48
|
CircleOutlinedIcon,
|
|
@@ -42,39 +50,53 @@ const defaultIcons = [
|
|
|
42
50
|
SquareOutlinedIcon,
|
|
43
51
|
];
|
|
44
52
|
const sizeTypographyMap = {
|
|
45
|
-
[LIST_SIZE.SM]: TYPOGRAPHY_TYPE.
|
|
46
|
-
[LIST_SIZE.MD]: TYPOGRAPHY_TYPE.
|
|
47
|
-
[LIST_SIZE.LG]: TYPOGRAPHY_TYPE.
|
|
53
|
+
[LIST_SIZE.SM]: TYPOGRAPHY_TYPE.CONDENSED_TEXT_SMALL,
|
|
54
|
+
[LIST_SIZE.MD]: TYPOGRAPHY_TYPE.CONDENSED_TEXT_MEDIUM,
|
|
55
|
+
[LIST_SIZE.LG]: TYPOGRAPHY_TYPE.CONDENSED_TEXT_LARGE,
|
|
48
56
|
};
|
|
49
57
|
const ListConfigContext = React.createContext({
|
|
50
58
|
size: LIST_SIZE.MD,
|
|
51
59
|
ordered: false,
|
|
52
60
|
icon: CircleIcon,
|
|
53
61
|
iconColor: COLOR.TEXT,
|
|
62
|
+
iconSize: undefined,
|
|
54
63
|
depth: -1,
|
|
55
64
|
});
|
|
56
65
|
const useListConfig = () => React.useContext(ListConfigContext);
|
|
57
|
-
export const List = ({ sx, size, ordered, icon, iconColor, children, }) => {
|
|
58
|
-
const { depth: parentDepth, size: parentSize, iconColor: parentIconColor, } = useListConfig();
|
|
66
|
+
export const List = ({ sx, size: sizeParam, ordered, icon, iconSize: iconSizeParam, iconColor: iconColorParam, children, }) => {
|
|
67
|
+
const { depth: parentDepth, size: parentSize, iconColor: parentIconColor, iconSize: parentIconSize, } = useListConfig();
|
|
59
68
|
const depth = parentDepth + 1;
|
|
60
69
|
const defaultStyles = Object.assign({ listStyleType: 'none' }, getTypographyStyles());
|
|
61
70
|
const defaultIcon = defaultIcons[depth] || CircleIcon;
|
|
71
|
+
const size = sizeParam || parentSize || LIST_SIZE.MD;
|
|
72
|
+
const iconSize = iconSizeParam || parentIconSize || iconSizeMap[size];
|
|
73
|
+
const iconColor = iconColorParam || parentIconColor || COLOR.TEXT;
|
|
62
74
|
return (_jsx(ListConfigContext.Provider, Object.assign({ value: {
|
|
63
|
-
size
|
|
75
|
+
size,
|
|
64
76
|
icon: icon || defaultIcon,
|
|
65
|
-
iconColor
|
|
77
|
+
iconColor,
|
|
78
|
+
iconSize,
|
|
66
79
|
ordered: ordered || false,
|
|
67
80
|
depth,
|
|
68
81
|
} }, { children: ordered ? (_jsx("ul", Object.assign({ sx: Object.assign(Object.assign({}, defaultStyles), sx) }, { children: children }))) : (_jsx("ol", Object.assign({ sx: Object.assign(Object.assign({}, defaultStyles), sx) }, { children: children }))) })));
|
|
69
82
|
};
|
|
70
83
|
export const ListItem = (_a) => {
|
|
71
|
-
var { index, sx, children } = _a, rest = __rest(_a, ["index", "sx", "children"]);
|
|
72
|
-
const { ordered, icon, iconColor, size, depth } = useListConfig();
|
|
84
|
+
var { index, sx, icon: iconParam, iconSize: iconSizeParam, iconColor: iconColorParam, onIconClick, onClick, children, iconLabel } = _a, rest = __rest(_a, ["index", "sx", "icon", "iconSize", "iconColor", "onIconClick", "onClick", "children", "iconLabel"]);
|
|
85
|
+
const { ordered, icon: listIcon, iconColor: listIconColor, iconSize: listIconSize, size, depth, } = useListConfig();
|
|
86
|
+
const { flagInDevelopment } = useEnvironment();
|
|
87
|
+
if (onIconClick && !iconLabel) {
|
|
88
|
+
flagInDevelopment('ListItem component with onIconClick should have an iconLabel prop for accessibility');
|
|
89
|
+
}
|
|
90
|
+
const icon = iconParam || listIcon;
|
|
91
|
+
const iconSize = iconSizeParam || listIconSize;
|
|
92
|
+
const iconColor = iconColorParam || listIconColor;
|
|
93
|
+
const typography = sizeTypographyMap[size];
|
|
73
94
|
const typographyStyles = getTypographyStyles(sizeTypographyMap[size]);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
95
|
+
const lineHeight = useLinesHeight({ typography, lines: 1 });
|
|
96
|
+
return (_jsxs("li", Object.assign({ sx: Object.assign(Object.assign({ depth, display: 'flex', mt: index === 0 && depth === 0 ? 0 : marginSizeMap[size], ml: 1 }, typographyStyles), sx) }, rest, { children: [ordered ? (_jsxs(Label, Object.assign({ standalone: true, sx: { mr: 2 } }, { children: [index + 1, "."] }))) : (_jsx(Column, Object.assign({ sx: { height: lineHeight }, justify: "center" }, { children: _jsx(Icon, { icon: icon, color: iconColor, size: iconSize, onClick: onIconClick, "aria-label": iconLabel, sx: {
|
|
97
|
+
mr: 3,
|
|
98
|
+
alignItems: 'flex-start',
|
|
99
|
+
} }) }))), _jsx("div", Object.assign({ sx: {
|
|
100
|
+
cursor: onClick ? 'pointer' : 'default',
|
|
101
|
+
}, tabIndex: onClick ? 0 : undefined }, { children: children }))] })));
|
|
80
102
|
};
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { StyledElementProps } from '../../../../theme';
|
|
4
4
|
import { TYPOGRAPHY_TYPE } from '../../../../theme/typography';
|
|
5
|
+
export declare const useLinesHeight: (args: {
|
|
6
|
+
lines: number;
|
|
7
|
+
typography: TYPOGRAPHY_TYPE;
|
|
8
|
+
}) => string;
|
|
5
9
|
export declare const ReadMore: React.FC<StyledElementProps<HTMLDivElement, {
|
|
6
10
|
typography: TYPOGRAPHY_TYPE;
|
|
7
11
|
lines: number;
|
|
@@ -33,7 +33,7 @@ const ReadMoreLink = (props) => {
|
|
|
33
33
|
cursor: 'pointer',
|
|
34
34
|
} }, { children: "Read More..." })) })));
|
|
35
35
|
};
|
|
36
|
-
const useLinesHeight = (args) => {
|
|
36
|
+
export const useLinesHeight = (args) => {
|
|
37
37
|
const theme = useTheme();
|
|
38
38
|
const styles = getTypographyStyles(args.typography);
|
|
39
39
|
const fontSize = styles.fontSize;
|
|
@@ -6,5 +6,6 @@ import { AlertsProvider } from './alerts';
|
|
|
6
6
|
import { FontLoader } from '../../FontLoader';
|
|
7
7
|
import { GlobalStyles } from '../../theme/GlobalStyles';
|
|
8
8
|
export const UiProvider = ({ env, components, alertsConfig, children, loadFonts, loadGlobalStyles, }) => {
|
|
9
|
+
console.log('here');
|
|
9
10
|
return (_jsxs(EnvironmentProvider, Object.assign({ env: env }, { children: [_jsx(ComponentConfigProvider, Object.assign({ config: components || {} }, { children: _jsx(ThemeProvider, { children: _jsx(AlertsProvider, Object.assign({}, alertsConfig, { children: children })) }) })), loadGlobalStyles && _jsx(GlobalStyles, {}), loadFonts && _jsx(FontLoader, {})] })));
|
|
10
11
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export { Spinner, SPINNER_SIZE } from './components/elements/Spinner';
|
|
|
30
30
|
export { Pill, PILL_SIZE, PILL_TYPE } from './components/elements/Pill';
|
|
31
31
|
export { Card, CARD_SIZE, CARD_LAYOUT } from './components/composites/Card';
|
|
32
32
|
export { NavMenu } from './components/composites/NavMenu';
|
|
33
|
-
export { EmptyState } from './components/composites/EmptyState';
|
|
33
|
+
export { EmptyState, EMPTY_STATE_SIZE, } from './components/composites/EmptyState';
|
|
34
34
|
export { DropdownLinks } from './components/composites/DropdownLinks';
|
|
35
35
|
export { UiProvider } from './components/providers/ui';
|
|
36
36
|
export { MenuProvider, useMenu } from './components/providers/menu';
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ export { Spinner, SPINNER_SIZE } from './components/elements/Spinner';
|
|
|
30
30
|
export { Pill, PILL_SIZE, PILL_TYPE } from './components/elements/Pill';
|
|
31
31
|
export { Card, CARD_SIZE, CARD_LAYOUT } from './components/composites/Card';
|
|
32
32
|
export { NavMenu } from './components/composites/NavMenu';
|
|
33
|
-
export { EmptyState } from './components/composites/EmptyState';
|
|
33
|
+
export { EmptyState, EMPTY_STATE_SIZE, } from './components/composites/EmptyState';
|
|
34
34
|
export { DropdownLinks } from './components/composites/DropdownLinks';
|
|
35
35
|
export { UiProvider } from './components/providers/ui';
|
|
36
36
|
export { MenuProvider, useMenu } from './components/providers/menu';
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ export declare const theme: {
|
|
|
65
65
|
normal: string;
|
|
66
66
|
};
|
|
67
67
|
fontSizes: {
|
|
68
|
+
xxs: string;
|
|
68
69
|
xs: string;
|
|
69
70
|
sm: string;
|
|
70
71
|
ms: string;
|
|
@@ -161,6 +162,7 @@ export declare const useTheme: () => {
|
|
|
161
162
|
normal: string;
|
|
162
163
|
};
|
|
163
164
|
fontSizes: {
|
|
165
|
+
xxs: string;
|
|
164
166
|
xs: string;
|
|
165
167
|
sm: string;
|
|
166
168
|
ms: string;
|
|
@@ -6,6 +6,7 @@ export declare enum FONT {
|
|
|
6
6
|
NORMAL = "normal"
|
|
7
7
|
}
|
|
8
8
|
export declare enum FONT_SIZE {
|
|
9
|
+
XXS = "xxs",
|
|
9
10
|
XS = "xs",
|
|
10
11
|
SM = "sm",
|
|
11
12
|
MS = "ms",
|
|
@@ -26,6 +27,7 @@ export declare enum LINE_HEIGHT {
|
|
|
26
27
|
CONDENSED = "condensed"
|
|
27
28
|
}
|
|
28
29
|
export declare const fontSizeMap: {
|
|
30
|
+
xxs: string;
|
|
29
31
|
xs: string;
|
|
30
32
|
sm: string;
|
|
31
33
|
ms: string;
|
|
@@ -43,6 +45,7 @@ export declare const fontStyles: {
|
|
|
43
45
|
normal: string;
|
|
44
46
|
};
|
|
45
47
|
fontSizes: {
|
|
48
|
+
xxs: string;
|
|
46
49
|
xs: string;
|
|
47
50
|
sm: string;
|
|
48
51
|
ms: string;
|
|
@@ -67,6 +70,10 @@ export declare enum TYPOGRAPHY_TYPE {
|
|
|
67
70
|
PARAGRAPH_SMALL = "paragraphSmall",
|
|
68
71
|
PARAGRAPH_MEDIUM = "paragraphMedium",
|
|
69
72
|
PARAGRAPH_LARGE = "paragraphLarge",
|
|
73
|
+
CONDENSED_TEXT_XSMALL = "condensedTextXSmall",
|
|
74
|
+
CONDENSED_TEXT_SMALL = "condensedTextSmall",
|
|
75
|
+
CONDENSED_TEXT_MEDIUM = "condensedTextMedium",
|
|
76
|
+
CONDENSED_TEXT_LARGE = "condensedTextLarge",
|
|
70
77
|
HEADING_SMALL = "headingSmall",
|
|
71
78
|
HEADING_MEDIUM = "headingMedium",
|
|
72
79
|
HEADING_LARGE = "headingLarge",
|
package/dist/theme/typography.js
CHANGED
|
@@ -8,6 +8,7 @@ export var FONT;
|
|
|
8
8
|
})(FONT || (FONT = {}));
|
|
9
9
|
export var FONT_SIZE;
|
|
10
10
|
(function (FONT_SIZE) {
|
|
11
|
+
FONT_SIZE["XXS"] = "xxs";
|
|
11
12
|
FONT_SIZE["XS"] = "xs";
|
|
12
13
|
FONT_SIZE["SM"] = "sm";
|
|
13
14
|
FONT_SIZE["MS"] = "ms";
|
|
@@ -19,6 +20,7 @@ export var FONT_SIZE;
|
|
|
19
20
|
})(FONT_SIZE || (FONT_SIZE = {}));
|
|
20
21
|
export const getIconSize = (fontSize) => {
|
|
21
22
|
return {
|
|
23
|
+
[FONT_SIZE.XXS]: FONT_SIZE.XS,
|
|
22
24
|
[FONT_SIZE.XS]: FONT_SIZE.SM,
|
|
23
25
|
[FONT_SIZE.SM]: FONT_SIZE.SM,
|
|
24
26
|
[FONT_SIZE.MS]: FONT_SIZE.MD,
|
|
@@ -41,6 +43,7 @@ export var LINE_HEIGHT;
|
|
|
41
43
|
LINE_HEIGHT["CONDENSED"] = "condensed";
|
|
42
44
|
})(LINE_HEIGHT || (LINE_HEIGHT = {}));
|
|
43
45
|
export const fontSizeMap = {
|
|
46
|
+
[FONT_SIZE.XXS]: '0.675rem',
|
|
44
47
|
[FONT_SIZE.XS]: '0.75rem',
|
|
45
48
|
[FONT_SIZE.SM]: '0.875rem',
|
|
46
49
|
[FONT_SIZE.MS]: '1rem',
|
|
@@ -78,6 +81,10 @@ export var TYPOGRAPHY_TYPE;
|
|
|
78
81
|
TYPOGRAPHY_TYPE["PARAGRAPH_SMALL"] = "paragraphSmall";
|
|
79
82
|
TYPOGRAPHY_TYPE["PARAGRAPH_MEDIUM"] = "paragraphMedium";
|
|
80
83
|
TYPOGRAPHY_TYPE["PARAGRAPH_LARGE"] = "paragraphLarge";
|
|
84
|
+
TYPOGRAPHY_TYPE["CONDENSED_TEXT_XSMALL"] = "condensedTextXSmall";
|
|
85
|
+
TYPOGRAPHY_TYPE["CONDENSED_TEXT_SMALL"] = "condensedTextSmall";
|
|
86
|
+
TYPOGRAPHY_TYPE["CONDENSED_TEXT_MEDIUM"] = "condensedTextMedium";
|
|
87
|
+
TYPOGRAPHY_TYPE["CONDENSED_TEXT_LARGE"] = "condensedTextLarge";
|
|
81
88
|
TYPOGRAPHY_TYPE["HEADING_SMALL"] = "headingSmall";
|
|
82
89
|
TYPOGRAPHY_TYPE["HEADING_MEDIUM"] = "headingMedium";
|
|
83
90
|
TYPOGRAPHY_TYPE["HEADING_LARGE"] = "headingLarge";
|
|
@@ -114,6 +121,30 @@ export const typographyStyleMap = {
|
|
|
114
121
|
lineHeight: LINE_HEIGHT.NORMAL,
|
|
115
122
|
fontWeight: FONT_WEIGHT.NORMAL,
|
|
116
123
|
},
|
|
124
|
+
[TYPOGRAPHY_TYPE.CONDENSED_TEXT_XSMALL]: {
|
|
125
|
+
fontFamily: FONT.NORMAL,
|
|
126
|
+
fontSize: FONT_SIZE.XS,
|
|
127
|
+
lineHeight: LINE_HEIGHT.CONDENSED,
|
|
128
|
+
fontWeight: FONT_WEIGHT.NORMAL,
|
|
129
|
+
},
|
|
130
|
+
[TYPOGRAPHY_TYPE.CONDENSED_TEXT_SMALL]: {
|
|
131
|
+
fontFamily: FONT.NORMAL,
|
|
132
|
+
fontSize: FONT_SIZE.SM,
|
|
133
|
+
lineHeight: LINE_HEIGHT.CONDENSED,
|
|
134
|
+
fontWeight: FONT_WEIGHT.NORMAL,
|
|
135
|
+
},
|
|
136
|
+
[TYPOGRAPHY_TYPE.CONDENSED_TEXT_MEDIUM]: {
|
|
137
|
+
fontFamily: FONT.NORMAL,
|
|
138
|
+
fontSize: FONT_SIZE.MS,
|
|
139
|
+
lineHeight: LINE_HEIGHT.CONDENSED,
|
|
140
|
+
fontWeight: FONT_WEIGHT.NORMAL,
|
|
141
|
+
},
|
|
142
|
+
[TYPOGRAPHY_TYPE.CONDENSED_TEXT_LARGE]: {
|
|
143
|
+
fontFamily: FONT.NORMAL,
|
|
144
|
+
fontSize: FONT_SIZE.MD,
|
|
145
|
+
lineHeight: LINE_HEIGHT.CONDENSED,
|
|
146
|
+
fontWeight: FONT_WEIGHT.NORMAL,
|
|
147
|
+
},
|
|
117
148
|
[TYPOGRAPHY_TYPE.HEADING_SMALL]: {
|
|
118
149
|
fontFamily: FONT.NORMAL,
|
|
119
150
|
fontSize: FONT_SIZE.MD,
|
|
@@ -142,19 +173,19 @@ export const typographyStyleMap = {
|
|
|
142
173
|
fontFamily: FONT.NORMAL,
|
|
143
174
|
fontSize: FONT_SIZE.SM,
|
|
144
175
|
fontWeight: FONT_WEIGHT.BOLD,
|
|
145
|
-
lineHeight: LINE_HEIGHT.
|
|
176
|
+
lineHeight: LINE_HEIGHT.CONDENSED,
|
|
146
177
|
},
|
|
147
178
|
[TYPOGRAPHY_TYPE.CONTROL_MEDIUM]: {
|
|
148
179
|
fontFamily: FONT.NORMAL,
|
|
149
180
|
fontSize: FONT_SIZE.MS,
|
|
150
181
|
fontWeight: FONT_WEIGHT.BOLD,
|
|
151
|
-
lineHeight: LINE_HEIGHT.
|
|
182
|
+
lineHeight: LINE_HEIGHT.CONDENSED,
|
|
152
183
|
},
|
|
153
184
|
[TYPOGRAPHY_TYPE.CONTROL_LARGE]: {
|
|
154
185
|
fontFamily: FONT.NORMAL,
|
|
155
186
|
fontSize: FONT_SIZE.ML,
|
|
156
187
|
fontWeight: FONT_WEIGHT.BOLD,
|
|
157
|
-
lineHeight: LINE_HEIGHT.
|
|
188
|
+
lineHeight: LINE_HEIGHT.CONDENSED,
|
|
158
189
|
},
|
|
159
190
|
[TYPOGRAPHY_TYPE.HEADLINE_SMALL]: {
|
|
160
191
|
fontFamily: FONT.SERIF,
|