@bitrise/bitkit 12.105.0 → 12.106.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 (42) hide show
  1. package/package.json +17 -14
  2. package/src/Components/Avatar/Avatar.tsx +0 -2
  3. package/src/Components/Badge/Badge.theme.ts +2 -6
  4. package/src/Components/Card/Card.tsx +0 -2
  5. package/src/Components/ColorButton/ColorButton.theme.ts +1 -1
  6. package/src/Components/ColorButton/ColorButton.tsx +1 -1
  7. package/src/Components/Dialog/Dialog.tsx +1 -1
  8. package/src/Components/Filter/Filter.theme.ts +1 -1
  9. package/src/Components/Form/Form.theme.ts +3 -6
  10. package/src/Components/Form/Input/Input.tsx +1 -1
  11. package/src/Components/Link/Link.theme.ts +2 -2
  12. package/src/Components/Link/Link.tsx +1 -1
  13. package/src/Components/Menu/MenuItem.tsx +1 -1
  14. package/src/Components/Notification/Notification.tsx +1 -1
  15. package/src/Components/Ribbon/Ribbon.tsx +1 -1
  16. package/src/Components/SegmentedControl/SegmentedControl.theme.ts +1 -1
  17. package/src/Components/Sidebar/SidebarItem.theme.ts +1 -1
  18. package/src/Components/Tabs/ContainedTab.tsx +3 -3
  19. package/src/Components/Tabs/Tabs.theme.ts +1 -3
  20. package/src/Components/Tag/Tag.theme.ts +3 -8
  21. package/src/Components/Tag/Tag.tsx +1 -1
  22. package/src/Components/Text/Text.theme.ts +45 -2
  23. package/src/Components/Text/Text.tsx +4 -17
  24. package/src/Components/components.theme.ts +103 -0
  25. package/src/Foundations/Colors/Colors.tsx +30 -4
  26. package/src/Foundations/Themes/Alert.theme.ts +3 -4
  27. package/src/Foundations/Typography/Typography.tsx +25 -0
  28. package/src/Foundations/docComponents/DocTitle.tsx +11 -0
  29. package/src/Foundations/docComponents/TokenTable.tsx +42 -13
  30. package/src/index.ts +1 -2
  31. package/src/theme.ts +13 -112
  32. package/src/tokens/tokensToTheme.json +977 -0
  33. package/src/types/bitkit.ts +37 -0
  34. package/src/utils/utils.ts +14 -0
  35. package/src/Foundations/Colors/CommonTokens.tsx +0 -21
  36. package/src/Foundations/Colors/SystemTokens.tsx +0 -27
  37. package/src/Foundations/Radii/Radii.ts +0 -10
  38. package/src/Foundations/Sizes/Sizes.ts +0 -18
  39. package/src/Foundations/Typography/Typography.ts +0 -69
  40. package/src/tokens/tokens.json +0 -3275
  41. package/src/tokens/tokens.ts +0 -49
  42. package/src/tokens/tokensUtils.ts +0 -20
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.105.0",
4
+ "version": "12.106.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -10,6 +10,7 @@
10
10
  "license": "UNLICENSED",
11
11
  "scripts": {
12
12
  "build-storybook": "storybook build",
13
+ "create-theme-from-tokens": "node ./scripts/createThemeFromTokens.js",
13
14
  "lint": "eslint src --ext ts,tsx",
14
15
  "lint:fix": "eslint src --ext ts,tsx --fix",
15
16
  "release": "release-it minor --ci",
@@ -35,12 +36,14 @@
35
36
  "@emotion/react": "^11.11.3",
36
37
  "@emotion/styled": "^11.11.0",
37
38
  "@floating-ui/react-dom-interactions": "^0.8.1",
39
+ "@fontsource/figtree": "^5.0.18",
40
+ "@fontsource/source-code-pro": "^5.0.16",
38
41
  "framer-motion": "^11.0.3",
39
42
  "luxon": "^3.4.4",
40
43
  "react": "^18.2.0",
41
44
  "react-dom": "^18.2.0",
42
- "react-focus-lock": "^2.9.7",
43
- "react-imask": "^7.3.0",
45
+ "react-focus-lock": "^2.9.8",
46
+ "react-imask": "^7.4.0",
44
47
  "react-markdown": "^9.0.1"
45
48
  },
46
49
  "peerDependencies": {
@@ -55,15 +58,15 @@
55
58
  "@bitrise/eslint-plugin": "^2.5.0",
56
59
  "@chakra-ui/cli": "^2.4.1",
57
60
  "@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",
61
+ "@storybook/addon-actions": "^7.6.14",
62
+ "@storybook/addon-essentials": "^7.6.14",
63
+ "@storybook/addon-interactions": "^7.6.14",
64
+ "@storybook/addon-links": "^7.6.14",
65
+ "@storybook/addons": "^7.6.14",
66
+ "@storybook/blocks": "^7.6.14",
67
+ "@storybook/react": "^7.6.14",
68
+ "@storybook/react-webpack5": "^7.6.14",
69
+ "@storybook/theming": "^7.6.14",
67
70
  "@testing-library/dom": "^9.3.4",
68
71
  "@testing-library/jest-dom": "^6.4.2",
69
72
  "@testing-library/react": "^14.2.1",
@@ -71,7 +74,7 @@
71
74
  "@types/jest": "^29.5.12",
72
75
  "@types/luxon": "^3.4.2",
73
76
  "@types/react": "^18.2.55",
74
- "@types/react-dom": "^18.2.18",
77
+ "@types/react-dom": "^18.2.19",
75
78
  "@typescript-eslint/eslint-plugin": "^6.21.0",
76
79
  "@typescript-eslint/parser": "^6.21.0",
77
80
  "axios": "^1.6.7",
@@ -91,7 +94,7 @@
91
94
  "prettier": "^3.2.5",
92
95
  "react-hook-form": "^7.50.1",
93
96
  "release-it": "^17.0.3",
94
- "storybook": "^7.6.12",
97
+ "storybook": "^7.6.14",
95
98
  "ts-jest": "^29.1.2",
96
99
  "typescript": "^5.3.3"
97
100
  },
@@ -1,10 +1,8 @@
1
1
  import { Avatar as ChakraAvatar, AvatarProps as ChakraAvatarProps, forwardRef } from '@chakra-ui/react';
2
- import { Radii } from '../../Foundations/Radii/Radii';
3
2
 
4
3
  export type AvatarSizes = '16' | '24' | '32' | '40' | '48' | '64' | '96' | '128';
5
4
 
6
5
  export interface AvatarProps extends ChakraAvatarProps {
7
- borderRadius?: keyof Radii;
8
6
  size?: AvatarSizes;
9
7
  }
10
8
 
@@ -2,13 +2,9 @@ const BadgeTheme = {
2
2
  baseStyle: {
3
3
  borderRadius: '4',
4
4
  display: 'inline-block',
5
- fontSize: '1',
6
- fontWeight: 'bold',
7
- lineHeight: '11px',
8
- paddingBottom: '5px',
9
- paddingTop: '6px',
10
5
  paddingX: '8',
11
- textTransform: 'uppercase',
6
+ paddingY: '4',
7
+ textStyle: 'comp/badge/sm',
12
8
  },
13
9
  };
14
10
 
@@ -1,10 +1,8 @@
1
1
  import { forwardRef, HTMLChakraProps, useStyleConfig } from '@chakra-ui/react';
2
- import { Radii } from '../../Foundations/Radii/Radii';
3
2
  import { Shadows } from '../../Foundations/Shadows/Shadows';
4
3
  import Box, { BoxProps } from '../Box/Box';
5
4
 
6
5
  export interface CardProps extends BoxProps {
7
- borderRadius?: keyof Radii;
8
6
  boxShadow?: keyof Shadows;
9
7
  href?: string;
10
8
  variant?: 'elevated' | 'outline';
@@ -1,4 +1,4 @@
1
- import { ColorScheme } from '../../tokens/tokens';
1
+ import { ColorScheme } from '../../types/bitkit';
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/bitkit';
3
3
 
4
4
  export interface ColorButtonProps extends ChakraButtonProps {
5
5
  as?: 'a' | 'button';
@@ -69,7 +69,7 @@ const Dialog: ComponentWithAs<'section', DialogProps> = ({
69
69
  {variant !== 'empty' && (
70
70
  <>
71
71
  <ModalHeader marginRight="48">
72
- <Text as="h1" id={headerId} size="5">
72
+ <Text as="h1" id={headerId} textStyle="com/dialog/title">
73
73
  {title}
74
74
  </Text>
75
75
  </ModalHeader>
@@ -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',
@@ -5,9 +5,8 @@ const FormTheme = {
5
5
  baseStyle: {
6
6
  helperText: {
7
7
  color: 'neutral.50',
8
- fontSize: '2',
9
- lineHeight: '1.25rem',
10
8
  marginTop: '4',
9
+ textStyle: 'comp/input/helperText',
11
10
  },
12
11
  } as ComponentStyleConfig,
13
12
  },
@@ -15,9 +14,8 @@ const FormTheme = {
15
14
  baseStyle: {
16
15
  text: {
17
16
  color: 'red.50',
18
- fontSize: '2',
19
- lineHeight: '1.25rem',
20
17
  marginTop: '4',
18
+ textStyle: 'comp/input/helperText',
21
19
  },
22
20
  } as ComponentStyleConfig,
23
21
  },
@@ -27,8 +25,7 @@ const FormTheme = {
27
25
  color: 'neutral.80',
28
26
  },
29
27
  color: 'purple.10',
30
- fontSize: '2',
31
- fontWeight: 'bold',
28
+ textStyle: 'comp/input/label',
32
29
  } as ComponentStyleConfig,
33
30
  },
34
31
  };
@@ -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/bitkit';
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 '../../types/bitkit';
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/bitkit';
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/bitkit';
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/bitkit';
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,5 +1,5 @@
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/bitkit';
3
3
  import Box from '../Box/Box';
4
4
  import Icon, { TypeIconName } from '../Icon/Icon';
5
5
  import Text from '../Text/Text';
@@ -19,14 +19,14 @@ const ContainedTab = forwardRef<ContainedTabProps, 'button'>((props, ref) => {
19
19
  return (
20
20
  <Button __css={styles.containedTab} {...tabProps}>
21
21
  <Box display="flex" gap="16" justifyContent="space-between">
22
- <Text as="span" fontWeight="bold" hasEllipsis>
22
+ <Text as="span" hasEllipsis textStyle="comp/tabs/contained">
23
23
  {tabProps.children}
24
24
  </Text>
25
25
  {isWarning && <Icon name="WarningColored" />}
26
26
  {!isWarning && iconName && <Icon color={iconColor} name={iconName} />}
27
27
  </Box>
28
28
  {secondaryText && (
29
- <Text as="span" display="block" hasEllipsis size="2">
29
+ <Text as="span" display="block" hasEllipsis textStyle="comp/tabs/contained-secondary">
30
30
  {secondaryText}
31
31
  </Text>
32
32
  )}
@@ -75,13 +75,11 @@ const baseStyle = defineStyle(
75
75
  alignItems: 'center',
76
76
  color: 'neutral.50',
77
77
  display: 'flex',
78
- fontSize: '3',
79
- fontWeight: 'bold',
80
78
  gap: '8',
81
79
  justifyContent: 'flex-start',
82
- lineHeight: '1.5rem',
83
80
  paddingX: '16',
84
81
  paddingY: '12',
82
+ textStyle: 'comp/tabs/line',
85
83
  whiteSpace: 'nowrap',
86
84
  },
87
85
  tablist: {
@@ -1,5 +1,6 @@
1
1
  import { createMultiStyleConfigHelpers } from '@chakra-ui/styled-system';
2
2
  import { rem } from '../../utils/utils';
3
+ import tokensToTheme from '../../tokens/tokensToTheme.json';
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: tokensToTheme.textStyles['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: tokensToTheme.textStyles['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/bitkit';
8
8
 
9
9
  export interface TagProps extends Omit<ChakraTagProps, 'colorScheme' | 'size' | 'variant'> {
10
10
  closeButtonTooltip?: string;
@@ -1,5 +1,48 @@
1
- import { textSizes } from '../../Foundations/Typography/Typography';
1
+ import { StyleProps } from '@chakra-ui/styled-system';
2
+ import { TextSizes } from '../../types/bitkit';
2
3
 
3
- const TextTheme = textSizes;
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,15 +1,8 @@
1
1
  import { forwardRef, ResponsiveValue, Text as ChakraText, TextProps as ChakraTextProps } from '@chakra-ui/react';
2
- import { TextSizes } from '../../Foundations/Typography/Typography';
2
+ import { TextSizes } from '../../types/bitkit';
3
3
 
4
4
  export interface TextProps extends ChakraTextProps {
5
- /**
6
- * Font weight
7
- */
8
- fontWeight?: ResponsiveValue<'bold' | 'demiBold' | 'normal'>;
9
5
  hasEllipsis?: boolean;
10
- /**
11
- * Size config (https://www.figma.com/file/grik9mTaJ5DfhydhWhXdP5/Bitkit-Foundations?node-id=211%3A12)
12
- */
13
6
  size?: ResponsiveValue<TextSizes>;
14
7
  }
15
8
 
@@ -17,14 +10,9 @@ export interface TextProps extends ChakraTextProps {
17
10
  * `Text` component is the used to render text and paragraphs within an interface. It renders a `<p>` tag by default.
18
11
  */
19
12
  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
- }
13
+ const { hasEllipsis, size, ...rest } = props;
14
+ const properties: ChakraTextProps = { size, ...rest };
15
+
28
16
  if (hasEllipsis) {
29
17
  if (!properties.maxWidth) {
30
18
  properties.maxWidth = '100%';
@@ -38,7 +26,6 @@ const Text = forwardRef<TextProps, 'p'>((props, ref) => {
38
26
 
39
27
  Text.defaultProps = {
40
28
  as: 'p',
41
- size: '3',
42
29
  } as TextProps;
43
30
 
44
31
  export default Text;
@@ -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 tokens from '../../tokens/tokensToTheme.json';
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(tokens.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={tokens.semanticTokens.colors[groupName as keyof typeof tokens.semanticTokens.colors]}
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={tokens.semanticTokens.colors.sys[groupName as keyof typeof tokens.semanticTokens.colors.sys]}
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,4 @@
1
- import { ColorScheme } from '../../tokens/tokens';
1
+ import { ColorScheme } from '../../types/bitkit';
2
2
 
3
3
  const AlertTheme = {
4
4
  baseStyle({ colorScheme }: { colorScheme: ColorScheme }) {
@@ -12,10 +12,9 @@ const AlertTheme = {
12
12
  borderWidth: '1px',
13
13
  color: `${colorScheme}.40`,
14
14
  display: 'flex',
15
- fontSize: '3',
16
15
  gap: '8',
17
- lineHeight: '1.5rem',
18
16
  padding: '12',
17
+ textStyle: 'comp/notification/message',
19
18
  },
20
19
  icon: {
21
20
  h: 24,
@@ -23,7 +22,7 @@ const AlertTheme = {
23
22
  w: 24,
24
23
  },
25
24
  title: {
26
- fontWeight: 'bold',
25
+ textStyle: 'comp/notification/title',
27
26
  },
28
27
  };
29
28
  },
@@ -0,0 +1,25 @@
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 { textStyles } from '../../tokens/tokensToTheme.json';
7
+
8
+ const getStyles = (filterString: string) => {
9
+ return Object.fromEntries(Object.entries(textStyles).filter(([key]) => key.includes(filterString)));
10
+ };
11
+
12
+ const Typography = () => {
13
+ return (
14
+ <Unstyled>
15
+ <Provider>
16
+ <DocTitle>Text Styles</DocTitle>
17
+ <TokenTable data={getStyles('heading/')} groupName="heading" marginBottom="24" type="text" />
18
+ <TokenTable data={getStyles('body/')} groupName="body" marginBottom="24" type="text" />
19
+ <TokenTable data={getStyles('code/')} groupName="code" type="text" />
20
+ </Provider>
21
+ </Unstyled>
22
+ );
23
+ };
24
+
25
+ export default Typography;