@bitrise/bitkit 12.100.0 → 12.101.1-alpha.0

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.
Files changed (41) hide show
  1. package/package.json +13 -11
  2. package/src/Components/Badge/Badge.theme.ts +4 -6
  3. package/src/Components/ColorButton/ColorButton.theme.ts +1 -1
  4. package/src/Components/ColorButton/ColorButton.tsx +1 -1
  5. package/src/Components/Dialog/Dialog.tsx +18 -4
  6. package/src/Components/Filter/Filter.theme.ts +1 -1
  7. package/src/Components/Form/Form.theme.ts +4 -6
  8. package/src/Components/Form/Input/Input.tsx +1 -1
  9. package/src/Components/Link/Link.theme.ts +2 -2
  10. package/src/Components/Link/Link.tsx +1 -1
  11. package/src/Components/Menu/MenuItem.tsx +1 -1
  12. package/src/Components/Notification/Notification.tsx +1 -1
  13. package/src/Components/Ribbon/Ribbon.tsx +1 -1
  14. package/src/Components/SegmentedControl/SegmentedControl.theme.ts +1 -1
  15. package/src/Components/Sidebar/SidebarItem.theme.ts +1 -1
  16. package/src/Components/Tabs/ContainedTab.tsx +4 -3
  17. package/src/Components/Tabs/Tabs.theme.ts +2 -3
  18. package/src/Components/Tag/Tag.theme.ts +3 -8
  19. package/src/Components/Tag/Tag.tsx +1 -1
  20. package/src/Components/Text/Text.theme.ts +46 -2
  21. package/src/Components/Text/Text.tsx +8 -17
  22. package/src/Components/components.theme.ts +103 -0
  23. package/src/Foundations/Colors/Colors.tsx +30 -4
  24. package/src/Foundations/Themes/Alert.theme.ts +4 -6
  25. package/src/Foundations/Typography/Typography.tsx +30 -0
  26. package/src/Foundations/docComponents/DocTitle.tsx +11 -0
  27. package/src/Foundations/docComponents/TokenTable.tsx +24 -9
  28. package/src/index.ts +2 -1
  29. package/src/theme.ts +13 -105
  30. package/src/tokens/colorTokens.ts +9 -0
  31. package/src/tokens/semanticTokens.ts +29 -0
  32. package/src/tokens/textTokens.ts +96 -0
  33. package/src/tokens/tokens.json +203 -203
  34. package/src/tokens/tokens.ts +14 -43
  35. package/src/tokens/tokensUtils.ts +47 -4
  36. package/src/types/colors.ts +12 -0
  37. package/src/types/typography.ts +19 -0
  38. package/src/utils/utils.ts +14 -0
  39. package/src/Foundations/Colors/CommonTokens.tsx +0 -21
  40. package/src/Foundations/Colors/SystemTokens.tsx +0 -27
  41. 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.100.0",
4
+ "version": "12.101.1-alpha.0",
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.12",
59
- "@storybook/addon-essentials": "^7.6.12",
60
- "@storybook/addon-interactions": "^7.6.12",
61
- "@storybook/addon-links": "^7.6.12",
62
- "@storybook/addons": "^7.6.12",
63
- "@storybook/blocks": "^7.6.12",
64
- "@storybook/react": "^7.6.12",
65
- "@storybook/react-webpack5": "^7.6.12",
66
- "@storybook/theming": "^7.6.12",
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.12",
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
- textTransform: 'uppercase',
8
+ paddingY: '4',
9
+ ...getTextToken('comp.badge.sm'),
12
10
  },
13
11
  };
14
12
 
@@ -1,4 +1,4 @@
1
- import { ColorScheme } from '../../tokens/tokens';
1
+ import { ColorScheme } from '../../types/colors';
2
2
 
3
3
  const schemeColors: Record<ColorScheme, any> = {
4
4
  blue: {
@@ -1,5 +1,5 @@
1
1
  import { Button as ChakraButton, ButtonProps as ChakraButtonProps, forwardRef, useStyleConfig } from '@chakra-ui/react';
2
- import { ColorScheme } from '../../tokens/tokens';
2
+ import { ColorScheme } from '../../types/colors';
3
3
 
4
4
  export interface ColorButtonProps extends ChakraButtonProps {
5
5
  as?: 'a' | 'button';
@@ -10,9 +10,11 @@ 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';
17
+ import Tooltip from '../Tooltip/Tooltip';
16
18
 
17
19
  export interface DialogProps extends Omit<HTMLChakraProps<'section'>, 'scrollBehavior'> {
18
20
  isClosable?: boolean;
@@ -23,10 +25,12 @@ export interface DialogProps extends Omit<HTMLChakraProps<'section'>, 'scrollBeh
23
25
  title: string;
24
26
  trapFocus?: boolean;
25
27
  variant?: 'default' | 'empty';
28
+ closeNotice?: string;
26
29
  }
27
30
 
28
31
  const Dialog: ComponentWithAs<'section', DialogProps> = ({
29
32
  children,
33
+ closeNotice,
30
34
  isClosable,
31
35
  isOpen,
32
36
  onClose,
@@ -41,6 +45,12 @@ const Dialog: ComponentWithAs<'section', DialogProps> = ({
41
45
  const prefersReducedMotion = usePrefersReducedMotion({ ssr: false });
42
46
  const headerId = useId();
43
47
 
48
+ const closeBtn = (
49
+ <ModalCloseButton isDisabled={!isClosable} size="large">
50
+ <Icon name="CloseSmall" />
51
+ </ModalCloseButton>
52
+ );
53
+
44
54
  return (
45
55
  <Modal
46
56
  closeOnEsc={isClosable}
@@ -57,13 +67,17 @@ const Dialog: ComponentWithAs<'section', DialogProps> = ({
57
67
  {variant !== 'empty' && (
58
68
  <>
59
69
  <ModalHeader marginRight="48">
60
- <Text as="h1" id={headerId} size="5">
70
+ <Text as="h1" id={headerId} {...getTextToken('comp.dialog.title')}>
61
71
  {title}
62
72
  </Text>
63
73
  </ModalHeader>
64
- <ModalCloseButton isDisabled={!isClosable} size="large">
65
- <Icon name="CloseSmall" />
66
- </ModalCloseButton>
74
+ {closeNotice ? (
75
+ <Tooltip label={closeNotice} placement="top">
76
+ {closeBtn}
77
+ </Tooltip>
78
+ ) : (
79
+ closeBtn
80
+ )}
67
81
  </>
68
82
  )}
69
83
  {children}
@@ -74,7 +74,7 @@ const FilterTheme = defineMultiStyleConfig({
74
74
  },
75
75
  formTitle: {
76
76
  color: 'purpe.10',
77
- fontWeight: 'demiBold',
77
+ fontWeight: 'semibold',
78
78
  },
79
79
  icon: {
80
80
  color: 'neutral.60',
@@ -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
- fontSize: '2',
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 { textSizes } from '../../Foundations/Typography/Typography';
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
- ...textSizes,
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 '../../Foundations/Typography/Typography';
2
+ import { TextSizes } from '../Text/Text.theme';
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 '../../tokens/tokens';
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 '../../tokens/tokens';
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 '../../tokens/tokens';
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';
@@ -50,7 +50,7 @@ const SegmentedControlTheme = itemHelpers.defineMultiStyleConfig({
50
50
  cursor: 'pointer',
51
51
  flexGrow: 1,
52
52
  fontSize: '3',
53
- fontWeight: 'demiBold',
53
+ fontWeight: 'semibold',
54
54
  lineHeight: '2.375rem',
55
55
  paddingX: '0.375rem',
56
56
  textAlign: 'center',
@@ -55,7 +55,7 @@ const SidebarItemTheme = itemHelpers.defineMultiStyleConfig({
55
55
  bg: 'purple.93',
56
56
  },
57
57
  bg: 'purple.95',
58
- fontWeight: 'demiBold',
58
+ fontWeight: 'semibold',
59
59
  },
60
60
  },
61
61
  },
@@ -1,8 +1,9 @@
1
1
  import { Button, forwardRef, TabProps as ChakraTabProps, useTab, useTabsStyles } from '@chakra-ui/react';
2
- import { TypeColors } from '../../tokens/tokens';
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" fontWeight="bold" hasEllipsis>
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 size="2">
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 '../../tokens/tokens';
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,49 @@
1
- import { textSizes } from '../../Foundations/Typography/Typography';
1
+ import { StyleProps } from '@chakra-ui/styled-system';
2
2
 
3
- const TextTheme = textSizes;
3
+ export type TextSizes = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8';
4
+
5
+ const sizes: Record<TextSizes, StyleProps> = {
6
+ '1': {
7
+ fontSize: '0.6875rem',
8
+ lineHeight: '1rem',
9
+ textTransform: 'uppercase',
10
+ },
11
+ '2': {
12
+ fontSize: '0.875rem',
13
+ lineHeight: '1.25rem',
14
+ },
15
+ '3': {
16
+ fontSize: '1rem',
17
+ lineHeight: '1.5rem',
18
+ },
19
+ '4': {
20
+ fontSize: '1.1875rem',
21
+ lineHeight: '1.75rem',
22
+ },
23
+ '5': {
24
+ fontSize: '1.5rem',
25
+ fontWeight: 'bold',
26
+ lineHeight: '2.25rem',
27
+ },
28
+ '6': {
29
+ fontSize: '1.875rem',
30
+ fontWeight: 'bold',
31
+ lineHeight: '2.5rem',
32
+ },
33
+ '7': {
34
+ fontSize: '2.25rem',
35
+ fontWeight: 'bold',
36
+ lineHeight: '3rem',
37
+ },
38
+ '8': {
39
+ fontSize: '3rem',
40
+ fontWeight: 'bold',
41
+ lineHeight: '3.75rem',
42
+ },
43
+ };
44
+
45
+ const TextTheme = {
46
+ sizes,
47
+ };
4
48
 
5
49
  export default TextTheme;
@@ -1,30 +1,21 @@
1
1
  import { forwardRef, ResponsiveValue, Text as ChakraText, TextProps as ChakraTextProps } from '@chakra-ui/react';
2
- import { TextSizes } from '../../Foundations/Typography/Typography';
2
+ import { getTextToken } from '../../tokens/textTokens';
3
+ import { TokenStrings } from '../../types/typography';
4
+ import { TextSizes } from './Text.theme';
3
5
 
4
6
  export interface TextProps extends ChakraTextProps {
5
- /**
6
- * Font weight
7
- */
8
- fontWeight?: ResponsiveValue<'bold' | 'demiBold' | 'normal'>;
9
7
  hasEllipsis?: boolean;
10
- /**
11
- * Size config (https://www.figma.com/file/grik9mTaJ5DfhydhWhXdP5/Bitkit-Foundations?node-id=211%3A12)
12
- */
13
8
  size?: ResponsiveValue<TextSizes>;
9
+ token?: TokenStrings;
14
10
  }
15
11
 
16
12
  /**
17
13
  * `Text` component is the used to render text and paragraphs within an interface. It renders a `<p>` tag by default.
18
14
  */
19
15
  const Text = forwardRef<TextProps, 'p'>((props, ref) => {
20
- const { fontWeight, hasEllipsis, size, textTransform, ...rest } = props;
21
- const properties: ChakraTextProps = { fontWeight, size, textTransform, ...rest };
22
- if (size === '1' && (!textTransform || textTransform === 'none')) {
23
- properties.textTransform = 'uppercase';
24
- }
25
- if (!fontWeight && (size === '5' || size === '6' || size === '7' || size === '8')) {
26
- properties.fontWeight = 'bold';
27
- }
16
+ const { hasEllipsis, size, token, ...rest } = props;
17
+ const properties: ChakraTextProps = { size, ...rest };
18
+
28
19
  if (hasEllipsis) {
29
20
  if (!properties.maxWidth) {
30
21
  properties.maxWidth = '100%';
@@ -33,7 +24,7 @@ const Text = forwardRef<TextProps, 'p'>((props, ref) => {
33
24
  properties.whiteSpace = 'nowrap';
34
25
  properties.overflow = 'hidden';
35
26
  }
36
- return <ChakraText {...properties} ref={ref} />;
27
+ return <ChakraText {...properties} {...getTextToken(token)} ref={ref} />;
37
28
  });
38
29
 
39
30
  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 CommonTokens from './CommonTokens';
6
- import SystemTokens from './SystemTokens';
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
- <CommonTokens />
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
- <SystemTokens />
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 '../../tokens/tokens';
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: {