@bitrise/bitkit 12.101.0 → 12.101.1-alpha.1
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/package.json +13 -11
- package/src/Components/Badge/Badge.theme.ts +4 -6
- package/src/Components/ColorButton/ColorButton.theme.ts +1 -1
- package/src/Components/ColorButton/ColorButton.tsx +1 -1
- package/src/Components/Dialog/Dialog.tsx +2 -1
- package/src/Components/Filter/Filter.theme.ts +1 -1
- package/src/Components/Form/Form.theme.ts +4 -6
- package/src/Components/Form/Input/Input.tsx +1 -1
- package/src/Components/Link/Link.theme.ts +2 -2
- package/src/Components/Link/Link.tsx +1 -1
- package/src/Components/Menu/MenuItem.tsx +1 -1
- package/src/Components/Notification/Notification.tsx +1 -1
- package/src/Components/Ribbon/Ribbon.tsx +1 -1
- package/src/Components/SegmentedControl/SegmentedControl.theme.ts +1 -1
- package/src/Components/Sidebar/SidebarItem.theme.ts +1 -1
- package/src/Components/Tabs/ContainedTab.tsx +4 -3
- package/src/Components/Tabs/Tabs.theme.ts +2 -3
- package/src/Components/Tag/Tag.theme.ts +3 -8
- package/src/Components/Tag/Tag.tsx +1 -1
- package/src/Components/Text/Text.theme.ts +45 -2
- package/src/Components/Text/Text.tsx +7 -17
- package/src/Components/components.theme.ts +103 -0
- package/src/Foundations/Colors/Colors.tsx +30 -4
- package/src/Foundations/Themes/Alert.theme.ts +4 -6
- package/src/Foundations/Typography/Typography.tsx +30 -0
- package/src/Foundations/docComponents/DocTitle.tsx +11 -0
- package/src/Foundations/docComponents/TokenTable.tsx +24 -9
- package/src/index.ts +2 -1
- package/src/theme.ts +13 -105
- package/src/tokens/colorTokens.ts +9 -0
- package/src/tokens/semanticTokens.ts +29 -0
- package/src/tokens/textTokens.ts +96 -0
- package/src/tokens/tokens.json +203 -203
- package/src/tokens/tokens.ts +14 -43
- package/src/tokens/tokensUtils.ts +47 -4
- package/src/types/colors.ts +12 -0
- package/src/types/typography.ts +21 -0
- package/src/utils/utils.ts +14 -0
- package/src/Foundations/Colors/CommonTokens.tsx +0 -21
- package/src/Foundations/Colors/SystemTokens.tsx +0 -27
- package/src/Foundations/Typography/Typography.ts +0 -69
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitrise/bitkit",
|
|
3
3
|
"description": "Bitrise React component library",
|
|
4
|
-
"version": "12.101.
|
|
4
|
+
"version": "12.101.1-alpha.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
|
|
@@ -35,6 +35,8 @@
|
|
|
35
35
|
"@emotion/react": "^11.11.3",
|
|
36
36
|
"@emotion/styled": "^11.11.0",
|
|
37
37
|
"@floating-ui/react-dom-interactions": "^0.8.1",
|
|
38
|
+
"@fontsource/figtree": "^5.0.18",
|
|
39
|
+
"@fontsource/source-code-pro": "^5.0.16",
|
|
38
40
|
"framer-motion": "^11.0.3",
|
|
39
41
|
"luxon": "^3.4.4",
|
|
40
42
|
"react": "^18.2.0",
|
|
@@ -55,15 +57,15 @@
|
|
|
55
57
|
"@bitrise/eslint-plugin": "^2.5.0",
|
|
56
58
|
"@chakra-ui/cli": "^2.4.1",
|
|
57
59
|
"@google-cloud/storage": "^7.7.0",
|
|
58
|
-
"@storybook/addon-actions": "^7.6.
|
|
59
|
-
"@storybook/addon-essentials": "^7.6.
|
|
60
|
-
"@storybook/addon-interactions": "^7.6.
|
|
61
|
-
"@storybook/addon-links": "^7.6.
|
|
62
|
-
"@storybook/addons": "^7.6.
|
|
63
|
-
"@storybook/blocks": "^7.6.
|
|
64
|
-
"@storybook/react": "^7.6.
|
|
65
|
-
"@storybook/react-webpack5": "^7.6.
|
|
66
|
-
"@storybook/theming": "^7.6.
|
|
60
|
+
"@storybook/addon-actions": "^7.6.13",
|
|
61
|
+
"@storybook/addon-essentials": "^7.6.13",
|
|
62
|
+
"@storybook/addon-interactions": "^7.6.13",
|
|
63
|
+
"@storybook/addon-links": "^7.6.13",
|
|
64
|
+
"@storybook/addons": "^7.6.13",
|
|
65
|
+
"@storybook/blocks": "^7.6.13",
|
|
66
|
+
"@storybook/react": "^7.6.13",
|
|
67
|
+
"@storybook/react-webpack5": "^7.6.13",
|
|
68
|
+
"@storybook/theming": "^7.6.13",
|
|
67
69
|
"@testing-library/dom": "^9.3.4",
|
|
68
70
|
"@testing-library/jest-dom": "^6.4.2",
|
|
69
71
|
"@testing-library/react": "^14.2.1",
|
|
@@ -91,7 +93,7 @@
|
|
|
91
93
|
"prettier": "^3.2.5",
|
|
92
94
|
"react-hook-form": "^7.50.1",
|
|
93
95
|
"release-it": "^17.0.3",
|
|
94
|
-
"storybook": "^7.6.
|
|
96
|
+
"storybook": "^7.6.13",
|
|
95
97
|
"ts-jest": "^29.1.2",
|
|
96
98
|
"typescript": "^5.3.3"
|
|
97
99
|
},
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
+
import { getTextToken } from '../../tokens/textTokens';
|
|
2
|
+
|
|
1
3
|
const BadgeTheme = {
|
|
2
4
|
baseStyle: {
|
|
3
5
|
borderRadius: '4',
|
|
4
6
|
display: 'inline-block',
|
|
5
|
-
fontSize: '1',
|
|
6
|
-
fontWeight: 'bold',
|
|
7
|
-
lineHeight: '11px',
|
|
8
|
-
paddingBottom: '5px',
|
|
9
|
-
paddingTop: '6px',
|
|
10
7
|
paddingX: '8',
|
|
11
|
-
|
|
8
|
+
paddingY: '4',
|
|
9
|
+
...getTextToken('comp.badge.sm'),
|
|
12
10
|
},
|
|
13
11
|
};
|
|
14
12
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Button as ChakraButton, ButtonProps as ChakraButtonProps, forwardRef, useStyleConfig } from '@chakra-ui/react';
|
|
2
|
-
import { ColorScheme } from '../../
|
|
2
|
+
import { ColorScheme } from '../../types/colors';
|
|
3
3
|
|
|
4
4
|
export interface ColorButtonProps extends ChakraButtonProps {
|
|
5
5
|
as?: 'a' | 'button';
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
useBreakpointValue,
|
|
11
11
|
usePrefersReducedMotion,
|
|
12
12
|
} from '@chakra-ui/react';
|
|
13
|
+
import { getTextToken } from '../../tokens/textTokens';
|
|
13
14
|
import { BREAKPOINTS } from '../../Foundations/Breakpoints/Breakpoints';
|
|
14
15
|
import Icon from '../Icon/Icon';
|
|
15
16
|
import Text from '../Text/Text';
|
|
@@ -66,7 +67,7 @@ const Dialog: ComponentWithAs<'section', DialogProps> = ({
|
|
|
66
67
|
{variant !== 'empty' && (
|
|
67
68
|
<>
|
|
68
69
|
<ModalHeader marginRight="48">
|
|
69
|
-
<Text as="h1" id={headerId}
|
|
70
|
+
<Text as="h1" id={headerId} {...getTextToken('comp.dialog.title')}>
|
|
70
71
|
{title}
|
|
71
72
|
</Text>
|
|
72
73
|
</ModalHeader>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ComponentStyleConfig } from '@chakra-ui/theme';
|
|
2
|
+
import { getTextToken } from '../../tokens/textTokens';
|
|
2
3
|
|
|
3
4
|
const FormTheme = {
|
|
4
5
|
Form: {
|
|
5
6
|
baseStyle: {
|
|
6
7
|
helperText: {
|
|
7
8
|
color: 'neutral.50',
|
|
8
|
-
fontSize: '2',
|
|
9
|
-
lineHeight: '1.25rem',
|
|
10
9
|
marginTop: '4',
|
|
10
|
+
...getTextToken('comp.input.helperText'),
|
|
11
11
|
},
|
|
12
12
|
} as ComponentStyleConfig,
|
|
13
13
|
},
|
|
@@ -15,9 +15,8 @@ const FormTheme = {
|
|
|
15
15
|
baseStyle: {
|
|
16
16
|
text: {
|
|
17
17
|
color: 'red.50',
|
|
18
|
-
fontSize: '2',
|
|
19
|
-
lineHeight: '1.25rem',
|
|
20
18
|
marginTop: '4',
|
|
19
|
+
...getTextToken('comp.input.helperText'),
|
|
21
20
|
},
|
|
22
21
|
} as ComponentStyleConfig,
|
|
23
22
|
},
|
|
@@ -27,8 +26,7 @@ const FormTheme = {
|
|
|
27
26
|
color: 'neutral.80',
|
|
28
27
|
},
|
|
29
28
|
color: 'purple.10',
|
|
30
|
-
|
|
31
|
-
fontWeight: 'bold',
|
|
29
|
+
...getTextToken('comp.input.label'),
|
|
32
30
|
} as ComponentStyleConfig,
|
|
33
31
|
},
|
|
34
32
|
};
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
InputRightElement,
|
|
15
15
|
SystemStyleObject,
|
|
16
16
|
} from '@chakra-ui/react';
|
|
17
|
-
import { TypeColors } from '../../../tokens/tokens';
|
|
18
17
|
import Icon, { TypeIconName } from '../../Icon/Icon';
|
|
19
18
|
import Text from '../../Text/Text';
|
|
20
19
|
import Box from '../../Box/Box';
|
|
21
20
|
import Tooltip, { TooltipProps } from '../../Tooltip/Tooltip';
|
|
21
|
+
import { TypeColors } from '../../../types/colors';
|
|
22
22
|
|
|
23
23
|
type UsedFormControlProps = Omit<FormControlProps, 'label' | 'onBlur' | 'onChange'>;
|
|
24
24
|
type UsedChakraInputProps = Pick<
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import TextTheme from '../Text/Text.theme';
|
|
2
2
|
|
|
3
3
|
const schemeColors = {
|
|
4
4
|
default: { color: 'inherit', hover: 'inherit' },
|
|
@@ -21,7 +21,7 @@ const LinkTheme = {
|
|
|
21
21
|
fontSize: 'inherit',
|
|
22
22
|
};
|
|
23
23
|
},
|
|
24
|
-
...
|
|
24
|
+
...TextTheme,
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export default LinkTheme;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { forwardRef, Link as ChakraLink, LinkProps as ChakraLinkProps } from '@chakra-ui/react';
|
|
2
|
-
import { TextSizes } from '../../
|
|
2
|
+
import { TextSizes } from '../../types/typography';
|
|
3
3
|
|
|
4
4
|
export interface LinkProps extends ChakraLinkProps {
|
|
5
5
|
as?: 'a' | 'button';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { forwardRef, MenuItem as ChakraMenuItem, MenuItemProps as ChakraMenuItemProps } from '@chakra-ui/react';
|
|
2
|
-
import { TypeColors } from '../../
|
|
2
|
+
import { TypeColors } from '../../types/colors';
|
|
3
3
|
import Box from '../Box/Box';
|
|
4
4
|
import Icon, { TypeIconName } from '../Icon/Icon';
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cloneElement, createContext, ReactElement, useContext, useMemo } from 'react';
|
|
2
2
|
import { Alert as ChakraAlert, AlertProps, forwardRef } from '@chakra-ui/react';
|
|
3
3
|
|
|
4
|
-
import { ColorScheme } from '../../
|
|
4
|
+
import { ColorScheme } from '../../types/colors';
|
|
5
5
|
import Box from '../Box/Box';
|
|
6
6
|
import CloseButton from '../CloseButton/CloseButton';
|
|
7
7
|
import ColorButton, { ColorButtonProps } from '../ColorButton/ColorButton';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createContext, useContext, useMemo } from 'react';
|
|
2
2
|
import { Alert as ChakraAlert, AlertProps, forwardRef } from '@chakra-ui/react';
|
|
3
3
|
|
|
4
|
-
import { ColorScheme } from '../../
|
|
4
|
+
import { ColorScheme } from '../../types/colors';
|
|
5
5
|
import CloseButton from '../CloseButton/CloseButton';
|
|
6
6
|
import ColorButton, { ColorButtonProps } from '../ColorButton/ColorButton';
|
|
7
7
|
import Box from '../Box/Box';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Button, forwardRef, TabProps as ChakraTabProps, useTab, useTabsStyles } from '@chakra-ui/react';
|
|
2
|
-
import { TypeColors } from '../../
|
|
2
|
+
import { TypeColors } from '../../types/colors';
|
|
3
3
|
import Box from '../Box/Box';
|
|
4
4
|
import Icon, { TypeIconName } from '../Icon/Icon';
|
|
5
5
|
import Text from '../Text/Text';
|
|
6
|
+
import { getTextToken } from '../../tokens/textTokens';
|
|
6
7
|
|
|
7
8
|
export interface ContainedTabProps extends ChakraTabProps {
|
|
8
9
|
id: string;
|
|
@@ -19,14 +20,14 @@ const ContainedTab = forwardRef<ContainedTabProps, 'button'>((props, ref) => {
|
|
|
19
20
|
return (
|
|
20
21
|
<Button __css={styles.containedTab} {...tabProps}>
|
|
21
22
|
<Box display="flex" gap="16" justifyContent="space-between">
|
|
22
|
-
<Text as="span"
|
|
23
|
+
<Text as="span" hasEllipsis {...getTextToken('comp.tabs.contained')}>
|
|
23
24
|
{tabProps.children}
|
|
24
25
|
</Text>
|
|
25
26
|
{isWarning && <Icon name="WarningColored" />}
|
|
26
27
|
{!isWarning && iconName && <Icon color={iconColor} name={iconName} />}
|
|
27
28
|
</Box>
|
|
28
29
|
{secondaryText && (
|
|
29
|
-
<Text as="span" display="block" hasEllipsis
|
|
30
|
+
<Text as="span" display="block" hasEllipsis {...getTextToken('comp.tabs.contained-secondary')}>
|
|
30
31
|
{secondaryText}
|
|
31
32
|
</Text>
|
|
32
33
|
)}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineStyle, defineStyleConfig, SystemStyleObject } from '@chakra-ui/styled-system';
|
|
2
|
+
import { getTextToken } from '../../tokens/textTokens';
|
|
2
3
|
|
|
3
4
|
const baseStyle = defineStyle(
|
|
4
5
|
({ variant }): SystemStyleObject => ({
|
|
@@ -75,14 +76,12 @@ const baseStyle = defineStyle(
|
|
|
75
76
|
alignItems: 'center',
|
|
76
77
|
color: 'neutral.50',
|
|
77
78
|
display: 'flex',
|
|
78
|
-
fontSize: '3',
|
|
79
|
-
fontWeight: 'bold',
|
|
80
79
|
gap: '8',
|
|
81
80
|
justifyContent: 'flex-start',
|
|
82
|
-
lineHeight: '1.5rem',
|
|
83
81
|
paddingX: '16',
|
|
84
82
|
paddingY: '12',
|
|
85
83
|
whiteSpace: 'nowrap',
|
|
84
|
+
...getTextToken('comp.tabs.line'),
|
|
86
85
|
},
|
|
87
86
|
tablist: {
|
|
88
87
|
borderBottom: variant === 'line' ? '1px solid' : undefined,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createMultiStyleConfigHelpers } from '@chakra-ui/styled-system';
|
|
2
2
|
import { rem } from '../../utils/utils';
|
|
3
|
+
import { getTextToken } from '../../tokens/textTokens';
|
|
3
4
|
import { TagProps } from './Tag';
|
|
4
5
|
|
|
5
6
|
const { defineMultiStyleConfig, definePartsStyle } = createMultiStyleConfigHelpers([
|
|
@@ -26,10 +27,7 @@ const sizes = {
|
|
|
26
27
|
paddingRight: onClose ? rem(4) : rem(12),
|
|
27
28
|
paddingY: leftIcon || onClose ? rem(4) : rem(6),
|
|
28
29
|
},
|
|
29
|
-
label:
|
|
30
|
-
fontSize: '2',
|
|
31
|
-
lineHeight: rem(20),
|
|
32
|
-
},
|
|
30
|
+
label: getTextToken('comp.tag.md'),
|
|
33
31
|
};
|
|
34
32
|
}),
|
|
35
33
|
sm: definePartsStyle((props) => {
|
|
@@ -46,10 +44,7 @@ const sizes = {
|
|
|
46
44
|
paddingRight: onClose ? rem(2) : rem(8),
|
|
47
45
|
paddingY: onClose ? rem(2) : rem(4),
|
|
48
46
|
},
|
|
49
|
-
label:
|
|
50
|
-
fontSize: rem(12),
|
|
51
|
-
lineHeight: rem(16),
|
|
52
|
-
},
|
|
47
|
+
label: getTextToken('comp.tag.sm'),
|
|
53
48
|
};
|
|
54
49
|
}),
|
|
55
50
|
};
|
|
@@ -4,7 +4,7 @@ import Skeleton from '../Skeleton/Skeleton';
|
|
|
4
4
|
import SkeletonBox from '../Skeleton/SkeletonBox';
|
|
5
5
|
import Text from '../Text/Text';
|
|
6
6
|
import Tooltip from '../Tooltip/Tooltip';
|
|
7
|
-
import { TypeColors } from '../../
|
|
7
|
+
import { TypeColors } from '../../types/colors';
|
|
8
8
|
|
|
9
9
|
export interface TagProps extends Omit<ChakraTagProps, 'colorScheme' | 'size' | 'variant'> {
|
|
10
10
|
closeButtonTooltip?: string;
|
|
@@ -1,5 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StyleProps } from '@chakra-ui/styled-system';
|
|
2
|
+
import { TextSizes } from '../../types/typography';
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
+
const sizes: Record<TextSizes, StyleProps> = {
|
|
5
|
+
'1': {
|
|
6
|
+
fontSize: '0.6875rem',
|
|
7
|
+
lineHeight: '1rem',
|
|
8
|
+
textTransform: 'uppercase',
|
|
9
|
+
},
|
|
10
|
+
'2': {
|
|
11
|
+
fontSize: '0.875rem',
|
|
12
|
+
lineHeight: '1.25rem',
|
|
13
|
+
},
|
|
14
|
+
'3': {
|
|
15
|
+
fontSize: '1rem',
|
|
16
|
+
lineHeight: '1.5rem',
|
|
17
|
+
},
|
|
18
|
+
'4': {
|
|
19
|
+
fontSize: '1.1875rem',
|
|
20
|
+
lineHeight: '1.75rem',
|
|
21
|
+
},
|
|
22
|
+
'5': {
|
|
23
|
+
fontSize: '1.5rem',
|
|
24
|
+
fontWeight: 'bold',
|
|
25
|
+
lineHeight: '2.25rem',
|
|
26
|
+
},
|
|
27
|
+
'6': {
|
|
28
|
+
fontSize: '1.875rem',
|
|
29
|
+
fontWeight: 'bold',
|
|
30
|
+
lineHeight: '2.5rem',
|
|
31
|
+
},
|
|
32
|
+
'7': {
|
|
33
|
+
fontSize: '2.25rem',
|
|
34
|
+
fontWeight: 'bold',
|
|
35
|
+
lineHeight: '3rem',
|
|
36
|
+
},
|
|
37
|
+
'8': {
|
|
38
|
+
fontSize: '3rem',
|
|
39
|
+
fontWeight: 'bold',
|
|
40
|
+
lineHeight: '3.75rem',
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const TextTheme = {
|
|
45
|
+
sizes,
|
|
46
|
+
};
|
|
4
47
|
|
|
5
48
|
export default TextTheme;
|
|
@@ -1,30 +1,20 @@
|
|
|
1
1
|
import { forwardRef, ResponsiveValue, Text as ChakraText, TextProps as ChakraTextProps } from '@chakra-ui/react';
|
|
2
|
-
import {
|
|
2
|
+
import { getTextToken } from '../../tokens/textTokens';
|
|
3
|
+
import { TextSizes, TokenStrings } from '../../types/typography';
|
|
3
4
|
|
|
4
5
|
export interface TextProps extends ChakraTextProps {
|
|
5
|
-
/**
|
|
6
|
-
* Font weight
|
|
7
|
-
*/
|
|
8
|
-
fontWeight?: ResponsiveValue<'bold' | 'demiBold' | 'normal'>;
|
|
9
6
|
hasEllipsis?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Size config (https://www.figma.com/file/grik9mTaJ5DfhydhWhXdP5/Bitkit-Foundations?node-id=211%3A12)
|
|
12
|
-
*/
|
|
13
7
|
size?: ResponsiveValue<TextSizes>;
|
|
8
|
+
token?: TokenStrings;
|
|
14
9
|
}
|
|
15
10
|
|
|
16
11
|
/**
|
|
17
12
|
* `Text` component is the used to render text and paragraphs within an interface. It renders a `<p>` tag by default.
|
|
18
13
|
*/
|
|
19
14
|
const Text = forwardRef<TextProps, 'p'>((props, ref) => {
|
|
20
|
-
const {
|
|
21
|
-
const properties: ChakraTextProps = {
|
|
22
|
-
|
|
23
|
-
properties.textTransform = 'uppercase';
|
|
24
|
-
}
|
|
25
|
-
if (!fontWeight && (size === '5' || size === '6' || size === '7' || size === '8')) {
|
|
26
|
-
properties.fontWeight = 'bold';
|
|
27
|
-
}
|
|
15
|
+
const { hasEllipsis, size, token, ...rest } = props;
|
|
16
|
+
const properties: ChakraTextProps = { size, ...rest };
|
|
17
|
+
|
|
28
18
|
if (hasEllipsis) {
|
|
29
19
|
if (!properties.maxWidth) {
|
|
30
20
|
properties.maxWidth = '100%';
|
|
@@ -33,7 +23,7 @@ const Text = forwardRef<TextProps, 'p'>((props, ref) => {
|
|
|
33
23
|
properties.whiteSpace = 'nowrap';
|
|
34
24
|
properties.overflow = 'hidden';
|
|
35
25
|
}
|
|
36
|
-
return <ChakraText {...properties} ref={ref} />;
|
|
26
|
+
return <ChakraText {...properties} {...getTextToken(token)} ref={ref} />;
|
|
37
27
|
});
|
|
38
28
|
|
|
39
29
|
Text.defaultProps = {
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import Alert from '../Foundations/Themes/Alert.theme';
|
|
2
|
+
import Accordion from './AccordionLegacy/Accordion.theme';
|
|
3
|
+
import Avatar from './Avatar/Avatar.theme';
|
|
4
|
+
import Badge from './Badge/Badge.theme';
|
|
5
|
+
import Breadcrumb from './Breadcrumb/Breadcrumb.theme';
|
|
6
|
+
import Button from './Button/Button.theme';
|
|
7
|
+
import Card from './Card/Card.theme';
|
|
8
|
+
import Checkbox from './Form/Checkbox/Checkbox.theme';
|
|
9
|
+
import ColorButton from './ColorButton/ColorButton.theme';
|
|
10
|
+
import Dialog from './Dialog/Dialog.theme';
|
|
11
|
+
import Divider from './Divider/Divider.theme';
|
|
12
|
+
import Drawer from './Drawer/Drawer.theme';
|
|
13
|
+
import EmptyState from './EmptyState/EmptyState.theme';
|
|
14
|
+
import Link from './Link/Link.theme';
|
|
15
|
+
import List from './List/List.theme';
|
|
16
|
+
import Menu from './Menu/Menu.theme';
|
|
17
|
+
import Radio from './Form/Radio/Radio.theme';
|
|
18
|
+
import Select from './Select/Select.theme';
|
|
19
|
+
import Input from './Form/Input/Input.theme';
|
|
20
|
+
import Dropdown from './Dropdown/Dropdown.theme';
|
|
21
|
+
import Tabs from './Tabs/Tabs.theme';
|
|
22
|
+
import Text from './Text/Text.theme';
|
|
23
|
+
import Table from './Table/Table.theme';
|
|
24
|
+
import Tooltip from './Tooltip/Tooltip.theme';
|
|
25
|
+
import CloseButton from './CloseButton/CloseButton.theme';
|
|
26
|
+
import Popover from './Popover/Popover.theme';
|
|
27
|
+
import Toggle from './Toggle/Toggle.theme';
|
|
28
|
+
import Textarea from './Form/Textarea/Textarea.theme';
|
|
29
|
+
import Form from './Form/Form.theme';
|
|
30
|
+
import DatePickerDay from './DatePicker/DatePickerDay.theme';
|
|
31
|
+
import NumberInput from './NumberInput/NumberInput.theme';
|
|
32
|
+
import Skeleton from './Skeleton/Skeleton.theme';
|
|
33
|
+
import ProgressBar from './ProgressBar/ProgressBar.theme';
|
|
34
|
+
import ProgressIndicator from './ProgressIndicator/ProgressIndicator.theme';
|
|
35
|
+
import Slider from './Slider/Slider.theme';
|
|
36
|
+
import Sidebar from './Sidebar/Sidebar.theme';
|
|
37
|
+
import SidebarItem from './Sidebar/SidebarItem.theme';
|
|
38
|
+
import SegmentedControl from './SegmentedControl/SegmentedControl.theme';
|
|
39
|
+
import Tag from './Tag/Tag.theme';
|
|
40
|
+
import Note from './Note/Note.theme';
|
|
41
|
+
import CodeBlock from './CodeBlock/CodeBlock.theme';
|
|
42
|
+
import CodeSnippet from './CodeSnippet/CodeSnippet.theme';
|
|
43
|
+
import DefinitionTooltip from './DefinitionTooltip/DefinitionTooltip.theme';
|
|
44
|
+
import ExpandableCard from './ExpandableCard/ExpandableCard.theme';
|
|
45
|
+
import FileInput from './Form/FileInput/FileInput.theme';
|
|
46
|
+
import Filter from './Filter/Filter.theme';
|
|
47
|
+
import Toggletip from './Toggletip/Toggletip.theme';
|
|
48
|
+
import FilterSwitch from './Filter/FilterSwitch/FilterSwitch.theme';
|
|
49
|
+
import TagsInput from './Form/TagsInput/TagsInput.theme';
|
|
50
|
+
|
|
51
|
+
const components = {
|
|
52
|
+
Accordion,
|
|
53
|
+
Avatar,
|
|
54
|
+
Badge,
|
|
55
|
+
Breadcrumb,
|
|
56
|
+
Button,
|
|
57
|
+
Card,
|
|
58
|
+
Checkbox,
|
|
59
|
+
ColorButton,
|
|
60
|
+
Divider,
|
|
61
|
+
Drawer,
|
|
62
|
+
Dropdown,
|
|
63
|
+
EmptyState,
|
|
64
|
+
FilterSwitch,
|
|
65
|
+
...Form,
|
|
66
|
+
Alert,
|
|
67
|
+
CloseButton,
|
|
68
|
+
CodeBlock,
|
|
69
|
+
CodeSnippet,
|
|
70
|
+
DatePickerDay,
|
|
71
|
+
DefinitionTooltip,
|
|
72
|
+
ExpandableCard,
|
|
73
|
+
FileInput,
|
|
74
|
+
Filter,
|
|
75
|
+
Input,
|
|
76
|
+
Link,
|
|
77
|
+
List,
|
|
78
|
+
Menu,
|
|
79
|
+
Modal: Dialog,
|
|
80
|
+
Note,
|
|
81
|
+
NumberInput,
|
|
82
|
+
Popover,
|
|
83
|
+
Progress: ProgressBar,
|
|
84
|
+
ProgressIndicator,
|
|
85
|
+
Radio,
|
|
86
|
+
SegmentedControl,
|
|
87
|
+
Select,
|
|
88
|
+
Sidebar,
|
|
89
|
+
SidebarItem,
|
|
90
|
+
Skeleton,
|
|
91
|
+
Slider,
|
|
92
|
+
Switch: Toggle,
|
|
93
|
+
Table,
|
|
94
|
+
Tabs,
|
|
95
|
+
Tag,
|
|
96
|
+
TagsInput,
|
|
97
|
+
Text,
|
|
98
|
+
Textarea,
|
|
99
|
+
Toggletip,
|
|
100
|
+
Tooltip,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export default components;
|
|
@@ -2,17 +2,43 @@
|
|
|
2
2
|
import { Unstyled } from '@storybook/blocks';
|
|
3
3
|
import Provider from '../../Components/Provider/Provider';
|
|
4
4
|
import Divider from '../../Components/Divider/Divider';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import { semanticTokens } from '../../tokens/semanticTokens';
|
|
6
|
+
import Card from '../../Components/Card/Card';
|
|
7
|
+
import TokenTable from '../docComponents/TokenTable';
|
|
8
|
+
import DocTitle from '../docComponents/DocTitle';
|
|
7
9
|
import Palette from './Palette';
|
|
8
10
|
|
|
11
|
+
const commonColorKeys = ['background', 'border', 'icon', 'text'];
|
|
12
|
+
const systemColorKeys = Object.keys(semanticTokens.colors.sys);
|
|
13
|
+
|
|
9
14
|
const Colors = () => {
|
|
10
15
|
return (
|
|
11
16
|
<Unstyled>
|
|
12
17
|
<Provider>
|
|
13
|
-
<
|
|
18
|
+
<DocTitle>Common Tokens</DocTitle>
|
|
19
|
+
<Card boxShadow="medium" padding="24">
|
|
20
|
+
{commonColorKeys.map((groupName) => (
|
|
21
|
+
<TokenTable
|
|
22
|
+
key={groupName}
|
|
23
|
+
data={semanticTokens.colors[groupName]}
|
|
24
|
+
groupName={groupName}
|
|
25
|
+
marginBottom="24"
|
|
26
|
+
/>
|
|
27
|
+
))}
|
|
28
|
+
</Card>
|
|
14
29
|
<Divider marginBottom="32" marginTop="48" size="1" />
|
|
15
|
-
<
|
|
30
|
+
<DocTitle>System Tokens</DocTitle>
|
|
31
|
+
<Card boxShadow="medium" padding="24">
|
|
32
|
+
{systemColorKeys.map((groupName) => (
|
|
33
|
+
<TokenTable
|
|
34
|
+
key={groupName}
|
|
35
|
+
data={semanticTokens.colors.sys[groupName]}
|
|
36
|
+
groupName={groupName}
|
|
37
|
+
marginBottom="24"
|
|
38
|
+
tokenPrefix="sys."
|
|
39
|
+
/>
|
|
40
|
+
))}
|
|
41
|
+
</Card>
|
|
16
42
|
<Divider marginBottom="32" marginTop="48" size="1" />
|
|
17
43
|
<Palette />
|
|
18
44
|
</Provider>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ColorScheme } from '../../
|
|
1
|
+
import { ColorScheme } from '../../types/colors';
|
|
2
|
+
import { getTextToken } from '../../tokens/textTokens';
|
|
2
3
|
|
|
3
4
|
const AlertTheme = {
|
|
4
5
|
baseStyle({ colorScheme }: { colorScheme: ColorScheme }) {
|
|
@@ -12,19 +13,16 @@ const AlertTheme = {
|
|
|
12
13
|
borderWidth: '1px',
|
|
13
14
|
color: `${colorScheme}.40`,
|
|
14
15
|
display: 'flex',
|
|
15
|
-
fontSize: '3',
|
|
16
16
|
gap: '8',
|
|
17
|
-
lineHeight: '1.5rem',
|
|
18
17
|
padding: '12',
|
|
18
|
+
...getTextToken('comp.notification.message'),
|
|
19
19
|
},
|
|
20
20
|
icon: {
|
|
21
21
|
h: 24,
|
|
22
22
|
marginEnd: 8,
|
|
23
23
|
w: 24,
|
|
24
24
|
},
|
|
25
|
-
title:
|
|
26
|
-
fontWeight: 'bold',
|
|
27
|
-
},
|
|
25
|
+
title: getTextToken('comp.notification.title'),
|
|
28
26
|
};
|
|
29
27
|
},
|
|
30
28
|
defaultProps: {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
+
import { Unstyled } from '@storybook/blocks';
|
|
3
|
+
import Provider from '../../Components/Provider/Provider';
|
|
4
|
+
import DocTitle from '../docComponents/DocTitle';
|
|
5
|
+
import TokenTable from '../docComponents/TokenTable';
|
|
6
|
+
import textTokens, { getTextToken } from '../../tokens/textTokens';
|
|
7
|
+
import { TOKEN_STRINGS } from '../../types/typography';
|
|
8
|
+
|
|
9
|
+
const bodyStyles = TOKEN_STRINGS.filter((token) => token.includes('body')).reduce(
|
|
10
|
+
(obj, current) => {
|
|
11
|
+
obj[current.replace('body.', '')] = getTextToken(current);
|
|
12
|
+
return obj;
|
|
13
|
+
},
|
|
14
|
+
{} as Record<string, Record<string, string>>,
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const Typography = () => {
|
|
18
|
+
return (
|
|
19
|
+
<Unstyled>
|
|
20
|
+
<Provider>
|
|
21
|
+
<DocTitle>Text Tokens</DocTitle>
|
|
22
|
+
<TokenTable data={textTokens.heading} groupName="heading" marginBottom="24" type="text" />
|
|
23
|
+
<TokenTable data={bodyStyles} groupName="body" marginBottom="24" type="text" />
|
|
24
|
+
<TokenTable data={textTokens.code} groupName="code" type="text" />
|
|
25
|
+
</Provider>
|
|
26
|
+
</Unstyled>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default Typography;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Text from '../../Components/Text/Text';
|
|
2
|
+
|
|
3
|
+
const DocTitle = ({ children }: { children: string }) => {
|
|
4
|
+
return (
|
|
5
|
+
<Text as="h2" color="pal.purple.10" fontWeight="normal" marginBlockEnd="8" size="8">
|
|
6
|
+
{children}
|
|
7
|
+
</Text>
|
|
8
|
+
);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default DocTitle;
|