@bitrise/bitkit 12.113.1-alpha.0 → 12.114.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.
- package/package.json +15 -15
- package/src/Components/Card/Card.tsx +0 -2
- package/src/Components/Dialog/Dialog.tsx +1 -1
- package/src/Components/Filter/Filter.storyData.ts +1 -1
- package/src/Components/Filter/Filter.tsx +2 -1
- package/src/Components/LightBox/LightBox.tsx +1 -1
- package/src/Components/components.theme.ts +1 -1
- package/src/hooks/useResponsive.ts +2 -1
- package/src/index.ts +1 -3
- package/src/theme.ts +8 -6
- package/src/tokens/tokensToTheme.json +23 -0
- package/src/types/bitkit.ts +8 -17
- package/src/Foundations/Breakpoints/Breakpoints.ts +0 -15
- package/src/Foundations/Colors/Colors.tsx +0 -49
- package/src/Foundations/Icons/figmaIcons.ts +0 -319
- package/src/Foundations/Shadows/Shadows.ts +0 -14
- package/src/Foundations/Typography/Typography.tsx +0 -25
- package/src/Foundations/Zindex/Zindex.ts +0 -14
- package/src/Foundations/docComponents/DocTitle.tsx +0 -11
- package/src/Foundations/docComponents/TokenTable.tsx +0 -106
- /package/src/{Foundations/Themes → Components/Alert}/Alert.theme.ts +0 -0
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.
|
|
4
|
+
"version": "12.114.1-alpha.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"@floating-ui/react-dom-interactions": "^0.8.1",
|
|
39
39
|
"@fontsource/figtree": "^5.0.18",
|
|
40
40
|
"@fontsource/source-code-pro": "^5.0.16",
|
|
41
|
-
"framer-motion": "^11.0.
|
|
41
|
+
"framer-motion": "^11.0.5",
|
|
42
42
|
"luxon": "^3.4.4",
|
|
43
43
|
"react": "^18.2.0",
|
|
44
44
|
"react-dom": "^18.2.0",
|
|
45
|
-
"react-focus-lock": "^2.
|
|
45
|
+
"react-focus-lock": "^2.10.1",
|
|
46
46
|
"react-imask": "^7.4.0",
|
|
47
47
|
"react-markdown": "^9.0.1"
|
|
48
48
|
},
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
"@bitrise/eslint-plugin": "^2.5.0",
|
|
59
59
|
"@chakra-ui/cli": "^2.4.1",
|
|
60
60
|
"@google-cloud/storage": "^7.7.0",
|
|
61
|
-
"@storybook/addon-actions": "^7.6.
|
|
62
|
-
"@storybook/addon-essentials": "^7.6.
|
|
63
|
-
"@storybook/addon-interactions": "^7.6.
|
|
64
|
-
"@storybook/addon-links": "^7.6.
|
|
65
|
-
"@storybook/addons": "^7.6.
|
|
66
|
-
"@storybook/blocks": "^7.6.
|
|
67
|
-
"@storybook/react": "^7.6.
|
|
68
|
-
"@storybook/react-webpack5": "^7.6.
|
|
69
|
-
"@storybook/theming": "^7.6.
|
|
61
|
+
"@storybook/addon-actions": "^7.6.15",
|
|
62
|
+
"@storybook/addon-essentials": "^7.6.15",
|
|
63
|
+
"@storybook/addon-interactions": "^7.6.15",
|
|
64
|
+
"@storybook/addon-links": "^7.6.15",
|
|
65
|
+
"@storybook/addons": "^7.6.15",
|
|
66
|
+
"@storybook/blocks": "^7.6.15",
|
|
67
|
+
"@storybook/react": "^7.6.15",
|
|
68
|
+
"@storybook/react-webpack5": "^7.6.15",
|
|
69
|
+
"@storybook/theming": "^7.6.15",
|
|
70
70
|
"@testing-library/dom": "^9.3.4",
|
|
71
71
|
"@testing-library/jest-dom": "^6.4.2",
|
|
72
72
|
"@testing-library/react": "^14.2.1",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"axios": "^1.6.7",
|
|
81
81
|
"eslint": "^8.56.0",
|
|
82
82
|
"eslint-plugin-import": "^2.29.1",
|
|
83
|
-
"eslint-plugin-jest": "^27.
|
|
83
|
+
"eslint-plugin-jest": "^27.8.0",
|
|
84
84
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
85
85
|
"eslint-plugin-prettier": "^5.1.3",
|
|
86
86
|
"eslint-plugin-react": "^7.33.2",
|
|
@@ -93,8 +93,8 @@
|
|
|
93
93
|
"jsdom": "^24.0.0",
|
|
94
94
|
"prettier": "^3.2.5",
|
|
95
95
|
"react-hook-form": "^7.50.1",
|
|
96
|
-
"release-it": "^17.0.
|
|
97
|
-
"storybook": "^7.6.
|
|
96
|
+
"release-it": "^17.0.5",
|
|
97
|
+
"storybook": "^7.6.15",
|
|
98
98
|
"ts-jest": "^29.1.2",
|
|
99
99
|
"typescript": "^5.3.3"
|
|
100
100
|
},
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { forwardRef, HTMLChakraProps, useStyleConfig } from '@chakra-ui/react';
|
|
2
|
-
import { Shadows } from '../../Foundations/Shadows/Shadows';
|
|
3
2
|
import Box, { BoxProps } from '../Box/Box';
|
|
4
3
|
|
|
5
4
|
export interface CardProps extends BoxProps {
|
|
6
|
-
boxShadow?: keyof Shadows;
|
|
7
5
|
href?: string;
|
|
8
6
|
variant?: 'elevated' | 'outline';
|
|
9
7
|
withHover?: boolean;
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
useBreakpointValue,
|
|
11
11
|
usePrefersReducedMotion,
|
|
12
12
|
} from '@chakra-ui/react';
|
|
13
|
-
import { BREAKPOINTS } from '../../
|
|
13
|
+
import { BREAKPOINTS } from '../../types/bitkit';
|
|
14
14
|
import Icon from '../Icon/Icon';
|
|
15
15
|
import Text from '../Text/Text';
|
|
16
16
|
import Tooltip from '../Tooltip/Tooltip';
|
|
@@ -84,7 +84,7 @@ export const FILTER_STORY_DATA: FilterData = {
|
|
|
84
84
|
export const FILTER_STORY_INIT_STATE: FilterState = {
|
|
85
85
|
app: ['46b6b9a78a418ee8'],
|
|
86
86
|
cache_type: ['gradle'],
|
|
87
|
-
pipeline: ['ipsum'],
|
|
87
|
+
pipeline: ['ipsum', 'dolor'],
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
export const FILTER_STORY_CONTEXT: FilterContextType = {
|
|
@@ -43,7 +43,8 @@ const Filter = (props: FilterProps) => {
|
|
|
43
43
|
if (values?.length) {
|
|
44
44
|
const cleanValues = values.filter((v) => v !== null && v !== '' && v !== undefined);
|
|
45
45
|
if (cleanValues.length) {
|
|
46
|
-
|
|
46
|
+
const { isMultiple } = data[category];
|
|
47
|
+
cleanState[category] = isMultiple ? cleanValues : cleanValues.slice(0, 1);
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
});
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useBreakpointValue,
|
|
7
7
|
usePrefersReducedMotion,
|
|
8
8
|
} from '@chakra-ui/react';
|
|
9
|
-
import { BREAKPOINTS } from '../../
|
|
9
|
+
import { BREAKPOINTS } from '../../types/bitkit';
|
|
10
10
|
|
|
11
11
|
export interface LightBoxProps extends Omit<HTMLChakraProps<'section'>, 'scrollBehavior'> {
|
|
12
12
|
dataTestid?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useMediaQuery } from '@chakra-ui/react';
|
|
2
|
-
import
|
|
2
|
+
import { breakpoints } from '../theme';
|
|
3
|
+
import { BREAKPOINTS } from '../types/bitkit';
|
|
3
4
|
|
|
4
5
|
const minusOnePixel = (value: string) => {
|
|
5
6
|
const valueInPixels = parseInt(value, 10) * 16;
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ export * from './types/chakra';
|
|
|
3
3
|
export * from './utils/reexports';
|
|
4
4
|
export * from './hooks';
|
|
5
5
|
|
|
6
|
-
export { default as theme } from './theme';
|
|
6
|
+
export { default as theme, breakpoints } from './theme';
|
|
7
7
|
|
|
8
8
|
export type { LinkProps } from './Components/Link/Link';
|
|
9
9
|
export { default as Link } from './Components/Link/Link';
|
|
@@ -157,8 +157,6 @@ export {
|
|
|
157
157
|
export type { NotificationProps } from './Components/Notification/Notification';
|
|
158
158
|
export { default as Notification } from './Components/Notification/Notification';
|
|
159
159
|
|
|
160
|
-
export { BREAKPOINTS } from './Foundations/Breakpoints/Breakpoints';
|
|
161
|
-
|
|
162
160
|
export type { AccordionProps } from './Components/Accordion/Accordion';
|
|
163
161
|
export { default as Accordion } from './Components/Accordion/Accordion';
|
|
164
162
|
|
package/src/theme.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import tokens from './tokens/tokensToTheme.json';
|
|
2
2
|
|
|
3
|
-
import breakpoints from './Foundations/Breakpoints/Breakpoints';
|
|
4
|
-
import shadows from './Foundations/Shadows/Shadows';
|
|
5
|
-
import zIndices from './Foundations/Zindex/Zindex';
|
|
6
|
-
|
|
7
3
|
import components from './Components/components.theme';
|
|
4
|
+
import { BREAKPOINTS } from './types/bitkit';
|
|
5
|
+
|
|
6
|
+
export const breakpoints = {
|
|
7
|
+
[BREAKPOINTS.MOBILE]: '0rem',
|
|
8
|
+
[BREAKPOINTS.TABLET]: '53rem', // 848px
|
|
9
|
+
[BREAKPOINTS.DESKTOP]: '80rem', // 1280px
|
|
10
|
+
[BREAKPOINTS.WIDEDESKTOP]: '101rem', // 1616px
|
|
11
|
+
};
|
|
8
12
|
|
|
9
13
|
const theme = {
|
|
10
14
|
...tokens,
|
|
@@ -13,7 +17,6 @@ const theme = {
|
|
|
13
17
|
config: {
|
|
14
18
|
cssVarPrefix: '',
|
|
15
19
|
},
|
|
16
|
-
shadows,
|
|
17
20
|
space: tokens.sizes,
|
|
18
21
|
styles: {
|
|
19
22
|
global: {
|
|
@@ -38,7 +41,6 @@ const theme = {
|
|
|
38
41
|
},
|
|
39
42
|
},
|
|
40
43
|
},
|
|
41
|
-
zIndices,
|
|
42
44
|
};
|
|
43
45
|
|
|
44
46
|
export default theme;
|
|
@@ -835,6 +835,17 @@
|
|
|
835
835
|
"utilities/skeleton-strong": "sys.fg.minimal"
|
|
836
836
|
}
|
|
837
837
|
},
|
|
838
|
+
"shadows": {
|
|
839
|
+
"formFocus": "0 0.125rem 0.1875rem 0 rgba(0, 0, 0, 0.1) inset, 0 0 0 3px var(--colors-purple-70)",
|
|
840
|
+
"inner": "0 0.125rem 0.1875rem 0 rgba(0, 0, 0, 0.1) inset",
|
|
841
|
+
"innerSmall": "0 0.0625rem 0.125rem 0 rgba(0, 0, 0, 0.1) inset",
|
|
842
|
+
"large": "0 0.125rem 1.5rem 0 rgba(0, 0, 0, 0.08)",
|
|
843
|
+
"medium": "0 0.125rem 0.75rem 0 rgba(0, 0, 0, 0.06)",
|
|
844
|
+
"none": "none",
|
|
845
|
+
"outline": "0 0 0 3px var(--colors-purple-70)",
|
|
846
|
+
"small": "0 0.125rem 0.25rem 0 rgba(0, 0, 0, 0.06)",
|
|
847
|
+
"tooltip": "0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.2)"
|
|
848
|
+
},
|
|
838
849
|
"sizes": {
|
|
839
850
|
"4": "0.25rem",
|
|
840
851
|
"8": "0.5rem",
|
|
@@ -1221,5 +1232,17 @@
|
|
|
1221
1232
|
"letterSpacing": "2",
|
|
1222
1233
|
"textTransform": "uppercase"
|
|
1223
1234
|
}
|
|
1235
|
+
},
|
|
1236
|
+
"zIndices": {
|
|
1237
|
+
"auto": "auto",
|
|
1238
|
+
"base": 0,
|
|
1239
|
+
"dialog": 1300,
|
|
1240
|
+
"dialogOverlay": 1299,
|
|
1241
|
+
"fullDialog": 1200,
|
|
1242
|
+
"fullDialogOverlay": 1199,
|
|
1243
|
+
"header": 1100,
|
|
1244
|
+
"hide": -1,
|
|
1245
|
+
"popover": 1400,
|
|
1246
|
+
"tooltip": 1500
|
|
1224
1247
|
}
|
|
1225
1248
|
}
|
package/src/types/bitkit.ts
CHANGED
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
import tokens from '../tokens/tokensToTheme.json';
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
|
|
9
|
-
'heading.h6',
|
|
10
|
-
'body.lg.regular',
|
|
11
|
-
'body.lg.semibold',
|
|
12
|
-
'body.lg.underline',
|
|
13
|
-
'body.md.regular',
|
|
14
|
-
'body.md.semibold',
|
|
15
|
-
'body.sm.regular',
|
|
16
|
-
'body.sm.semibold',
|
|
17
|
-
'code.lg',
|
|
18
|
-
'code.md',
|
|
19
|
-
] as const;
|
|
3
|
+
export const BREAKPOINTS = {
|
|
4
|
+
DESKTOP: 'desktop',
|
|
5
|
+
MOBILE: 'base',
|
|
6
|
+
TABLET: 'tablet',
|
|
7
|
+
WIDEDESKTOP: 'wideDesktop',
|
|
8
|
+
};
|
|
20
9
|
|
|
21
10
|
export type Radii = keyof typeof tokens.radii;
|
|
22
11
|
export type TypeColors = `${
|
|
@@ -32,6 +21,8 @@ export type TypeColors = `${
|
|
|
32
21
|
|
|
33
22
|
export type ColorScheme = 'blue' | 'red' | 'orange' | 'yellow' | 'green' | 'purple' | 'neutral';
|
|
34
23
|
|
|
24
|
+
export type Shadows = keyof typeof tokens.shadows;
|
|
25
|
+
|
|
35
26
|
export type TextSizes = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8';
|
|
36
27
|
|
|
37
28
|
export type TypeSizes = keyof typeof tokens.sizes;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export const BREAKPOINTS = {
|
|
2
|
-
DESKTOP: 'desktop',
|
|
3
|
-
MOBILE: 'base',
|
|
4
|
-
TABLET: 'tablet',
|
|
5
|
-
WIDEDESKTOP: 'wideDesktop',
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const breakpoints = {
|
|
9
|
-
[BREAKPOINTS.MOBILE]: '0rem',
|
|
10
|
-
[BREAKPOINTS.TABLET]: '53rem', // 848px
|
|
11
|
-
[BREAKPOINTS.DESKTOP]: '80rem', // 1280px
|
|
12
|
-
[BREAKPOINTS.WIDEDESKTOP]: '101rem', // 1616px
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default breakpoints;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
-
import { Unstyled } from '@storybook/blocks';
|
|
3
|
-
import Provider from '../../Components/Provider/Provider';
|
|
4
|
-
import Divider from '../../Components/Divider/Divider';
|
|
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';
|
|
9
|
-
import Palette from './Palette';
|
|
10
|
-
|
|
11
|
-
const commonColorKeys = ['background', 'border', 'icon', 'text'];
|
|
12
|
-
const systemColorKeys = Object.keys(tokens.semanticTokens.colors.sys);
|
|
13
|
-
|
|
14
|
-
const Colors = () => {
|
|
15
|
-
return (
|
|
16
|
-
<Unstyled>
|
|
17
|
-
<Provider>
|
|
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>
|
|
29
|
-
<Divider marginBottom="32" marginTop="48" size="1" />
|
|
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>
|
|
42
|
-
<Divider marginBottom="32" marginTop="48" size="1" />
|
|
43
|
-
<Palette />
|
|
44
|
-
</Provider>
|
|
45
|
-
</Unstyled>
|
|
46
|
-
);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export default Colors;
|
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
import { SystemStyleObject } from '@chakra-ui/styled-system';
|
|
2
|
-
import { TypeIconName } from '../../Components/Icon/Icon';
|
|
3
|
-
|
|
4
|
-
export type FigmaIcon = {
|
|
5
|
-
iconName: TypeIconName | '';
|
|
6
|
-
figmaToken: string;
|
|
7
|
-
tags?: string;
|
|
8
|
-
css?: SystemStyleObject;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const figmaIcons: {
|
|
12
|
-
[category: string]: FigmaIcon[];
|
|
13
|
-
} = {
|
|
14
|
-
Actions: [
|
|
15
|
-
{ figmaToken: 'plus', iconName: 'PlusOpen' },
|
|
16
|
-
{ figmaToken: 'plus-circle', iconName: 'PlusAdd', tags: 'add' },
|
|
17
|
-
{ figmaToken: 'plus-circle-filled', iconName: '' },
|
|
18
|
-
{ figmaToken: 'minus', iconName: 'MinusClose' },
|
|
19
|
-
{ figmaToken: 'minus-circle', iconName: 'MinusRemove', tags: 'remove' },
|
|
20
|
-
{ figmaToken: 'minus-circle-filled', iconName: '' },
|
|
21
|
-
{ figmaToken: 'cross', iconName: 'CloseSmall', tags: 'cancel, close, x, x-mark' },
|
|
22
|
-
{ figmaToken: 'cross-circle', iconName: 'CrossCircle', tags: 'clear, dismiss, remove' },
|
|
23
|
-
{ figmaToken: 'cross-circle-filled', iconName: 'BuildstatusFailedSolid', tags: 'failed, error, status' },
|
|
24
|
-
],
|
|
25
|
-
'Arrows and Chevrons': [
|
|
26
|
-
{ figmaToken: 'arrow-left', iconName: 'ArrowLeft' },
|
|
27
|
-
{ figmaToken: 'arrow-down', iconName: 'ArrowDown' },
|
|
28
|
-
{ figmaToken: 'arrow-right', iconName: 'ArrowRight' },
|
|
29
|
-
{ figmaToken: 'arrow-up', iconName: 'ArrowUp' },
|
|
30
|
-
{ figmaToken: 'arrow-left-over-right', iconName: 'Request', tags: 'request' },
|
|
31
|
-
{ figmaToken: 'arrow-up-down', iconName: 'SortArrows' },
|
|
32
|
-
{ figmaToken: 'arrow-back-and-up', iconName: 'ArrowQuit', tags: 'quit' },
|
|
33
|
-
{ figmaToken: 'arrow-move-down', iconName: 'ArrowMoveDown' },
|
|
34
|
-
{ figmaToken: 'arrow-move-left', iconName: 'ArrowMoveLeft' },
|
|
35
|
-
{ figmaToken: 'arrow-move-right', iconName: 'ArrowMoveRight' },
|
|
36
|
-
{ figmaToken: 'arrow-move-up', iconName: 'ArrowMoveUp' },
|
|
37
|
-
{ figmaToken: 'chevron-down', iconName: 'ChevronDown' },
|
|
38
|
-
{ figmaToken: 'chevron-left', iconName: 'ChevronLeft' },
|
|
39
|
-
{ figmaToken: 'chevron-right', iconName: 'ChevronRight' },
|
|
40
|
-
{ figmaToken: 'chevron-up', iconName: 'ChevronUp' },
|
|
41
|
-
],
|
|
42
|
-
Bitrise: [
|
|
43
|
-
{ figmaToken: 'addons', iconName: 'Addons' },
|
|
44
|
-
{ figmaToken: 'addons-purple', iconName: 'AddonsViolet' },
|
|
45
|
-
{ figmaToken: 'addons-turqouise', iconName: 'AddonsTuorqouise' },
|
|
46
|
-
{ figmaToken: 'addons-white', iconName: 'AddonsWhite' },
|
|
47
|
-
{ figmaToken: 'steps', iconName: 'Steps' },
|
|
48
|
-
{ figmaToken: 'steps-purple', iconName: 'StepsViolet' },
|
|
49
|
-
{ figmaToken: 'steps-turqouise', iconName: 'StepsTuorqouise' },
|
|
50
|
-
{ figmaToken: 'steps-white', iconName: 'StepsWhite' },
|
|
51
|
-
{ figmaToken: 'build', iconName: 'Build' },
|
|
52
|
-
{ figmaToken: 'workflow', iconName: 'Workflow' },
|
|
53
|
-
{ figmaToken: 'workflow-flow', iconName: 'WorkflowFlow' },
|
|
54
|
-
{ figmaToken: 'bitbot', iconName: 'Bitbot' },
|
|
55
|
-
{ figmaToken: 'bitbot-error', iconName: 'BitbotError' },
|
|
56
|
-
{ figmaToken: 'ship', iconName: 'Ship' },
|
|
57
|
-
{ figmaToken: 'trace', iconName: 'Trace' },
|
|
58
|
-
{ figmaToken: 'badge-bitrise', iconName: 'BadgeBitrise' },
|
|
59
|
-
{ figmaToken: 'badge-3rd-party', iconName: 'Badge3rdParty' },
|
|
60
|
-
{ figmaToken: 'step-upgrade', iconName: 'StepUpgrade' },
|
|
61
|
-
{ figmaToken: 'step-version-ok', iconName: 'StepVersionOk' },
|
|
62
|
-
],
|
|
63
|
-
Computer: [
|
|
64
|
-
{ figmaToken: 'memory', iconName: 'Cache', tags: 'cache, ram' },
|
|
65
|
-
{ figmaToken: 'configure', iconName: 'Configure' },
|
|
66
|
-
{ figmaToken: 'cpu', iconName: 'Cpu' },
|
|
67
|
-
{ figmaToken: 'file-doc', iconName: 'FileDoc' },
|
|
68
|
-
{ figmaToken: 'file-pdf', iconName: 'FilePdf' },
|
|
69
|
-
{ figmaToken: 'file-plist', iconName: 'FilePlist' },
|
|
70
|
-
{ figmaToken: 'file-zip', iconName: 'FileZip' },
|
|
71
|
-
{ figmaToken: 'login', iconName: 'Login' },
|
|
72
|
-
{ figmaToken: 'logout', iconName: 'Logout' },
|
|
73
|
-
{ figmaToken: 'filter', iconName: 'Filter', tags: 'configuration, preferences' },
|
|
74
|
-
{ figmaToken: 'copy', iconName: 'Duplicate', tags: 'clone, duplicate' },
|
|
75
|
-
{ figmaToken: 'download', iconName: 'Download' },
|
|
76
|
-
{ figmaToken: 'install', iconName: '' },
|
|
77
|
-
{ figmaToken: 'upload', iconName: 'Upload' },
|
|
78
|
-
{ figmaToken: 'folder', iconName: 'Folder' },
|
|
79
|
-
{ figmaToken: 'save', iconName: 'Save' },
|
|
80
|
-
{ figmaToken: 'fullscreen', iconName: 'Fullscreen' },
|
|
81
|
-
{ figmaToken: 'fullscreen-exit', iconName: 'FullscreenExit' },
|
|
82
|
-
{ figmaToken: 'mobile', iconName: 'Mobile' },
|
|
83
|
-
{ figmaToken: 'laptop', iconName: 'Laptop' },
|
|
84
|
-
{ figmaToken: 'screenshare', iconName: 'Screenshare' },
|
|
85
|
-
{ figmaToken: 'microphone', iconName: 'Podcast' },
|
|
86
|
-
{ figmaToken: 'headset', iconName: 'Webinar', tags: 'webinar' },
|
|
87
|
-
{ figmaToken: 'chat', iconName: 'Chat' },
|
|
88
|
-
{ figmaToken: 'message', iconName: 'Message' },
|
|
89
|
-
{ figmaToken: 'message-alert', iconName: 'ChatMessage', tags: 'chat' },
|
|
90
|
-
{ figmaToken: 'terminal', iconName: 'Window', tags: 'prompt, window' },
|
|
91
|
-
{ figmaToken: 'monitor-chart', iconName: 'MonitorChart' },
|
|
92
|
-
{ figmaToken: 'open-in-new', iconName: 'OpenInBrowser', tags: 'link, new-tab, browser' },
|
|
93
|
-
],
|
|
94
|
-
Developer: [
|
|
95
|
-
{ figmaToken: 'app', iconName: 'App' },
|
|
96
|
-
{ figmaToken: 'branch', iconName: 'Branch' },
|
|
97
|
-
{ figmaToken: 'commit', iconName: '' },
|
|
98
|
-
{ figmaToken: 'pull', iconName: 'Pull' },
|
|
99
|
-
{ figmaToken: 'push', iconName: 'Commit' },
|
|
100
|
-
{ figmaToken: 'bug', iconName: 'Bug' },
|
|
101
|
-
{ figmaToken: 'trigger', iconName: 'Trigger' },
|
|
102
|
-
{ figmaToken: 'stack', iconName: 'Stack' },
|
|
103
|
-
{ figmaToken: 'code', iconName: 'Code' },
|
|
104
|
-
{ figmaToken: 'code-signing', iconName: 'CodeSigning' },
|
|
105
|
-
{ figmaToken: 'deployment', iconName: 'Deployment' },
|
|
106
|
-
{ figmaToken: 'security-shield', iconName: 'SecurityShield' },
|
|
107
|
-
{ figmaToken: 'validate-shield', iconName: 'ValidateShield' },
|
|
108
|
-
{ figmaToken: 'web ui', iconName: 'WebUi' },
|
|
109
|
-
{ figmaToken: 'webhooks', iconName: 'Webhooks' },
|
|
110
|
-
{ figmaToken: 'agent', iconName: 'Agent' },
|
|
111
|
-
],
|
|
112
|
-
Logos: [
|
|
113
|
-
{ figmaToken: 'android', iconName: 'Android' },
|
|
114
|
-
{ figmaToken: 'apple', iconName: 'Apple', tags: 'ios' },
|
|
115
|
-
{ figmaToken: 'apple-filled', iconName: 'AppleFill', tags: 'ios' },
|
|
116
|
-
{ figmaToken: 'macos', iconName: 'Macos' },
|
|
117
|
-
{ figmaToken: 'twitter', iconName: 'Twitter' },
|
|
118
|
-
{ figmaToken: 'bitbucket', iconName: 'BitbucketPlain' },
|
|
119
|
-
{ figmaToken: 'bitbucket-color', iconName: 'BitbucketBlue' },
|
|
120
|
-
{ figmaToken: 'bitbucket-white', iconName: 'BitbucketShadedWhite' },
|
|
121
|
-
{ figmaToken: 'cordova', iconName: 'Cordova' },
|
|
122
|
-
{ figmaToken: 'fastlane', iconName: 'Fastlane' },
|
|
123
|
-
{ figmaToken: 'flutter', iconName: 'Flutter' },
|
|
124
|
-
{ figmaToken: 'go', iconName: 'Go' },
|
|
125
|
-
{ figmaToken: 'github', iconName: 'Github' },
|
|
126
|
-
{ figmaToken: 'gitlab', iconName: 'GitlabPlain' },
|
|
127
|
-
{ figmaToken: 'gitlab-color', iconName: 'GitlabColor' },
|
|
128
|
-
{ figmaToken: 'gitlab-white', iconName: 'GitlabShadedWhite' },
|
|
129
|
-
{ figmaToken: 'ionic', iconName: 'Ionic' },
|
|
130
|
-
{ figmaToken: 'nodejs', iconName: 'Nodejs' },
|
|
131
|
-
{ figmaToken: 'react', iconName: 'ReactIcon' },
|
|
132
|
-
{ figmaToken: 'xamarin', iconName: 'Xamarin' },
|
|
133
|
-
{ figmaToken: 'other', iconName: 'Other' },
|
|
134
|
-
{ figmaToken: 'google', iconName: 'GoogleColor' },
|
|
135
|
-
{ figmaToken: 'bazel', iconName: 'Bazel' },
|
|
136
|
-
{ figmaToken: 'gradle', iconName: 'Gradle' },
|
|
137
|
-
{ figmaToken: 'launchdarkly', iconName: 'LaunchDarkly' },
|
|
138
|
-
],
|
|
139
|
-
Media: [
|
|
140
|
-
{ figmaToken: 'pause', iconName: 'Pause' },
|
|
141
|
-
{ figmaToken: 'play', iconName: 'Play' },
|
|
142
|
-
{ figmaToken: 'shuffle', iconName: 'Shuffle' },
|
|
143
|
-
{ figmaToken: 'video', iconName: 'Video' },
|
|
144
|
-
],
|
|
145
|
-
Navigation: [
|
|
146
|
-
{ figmaToken: 'dashboard', iconName: '' },
|
|
147
|
-
{ figmaToken: 'dashboard-filled', iconName: '' },
|
|
148
|
-
{ figmaToken: 'build-test', iconName: 'BuildTest', tags: 'automation, ci/cd' },
|
|
149
|
-
{ figmaToken: 'build-test-filled', iconName: 'BuildTestSolid', tags: 'automation, ci/cd' },
|
|
150
|
-
{ figmaToken: 'build-cache', iconName: 'BuildCache' },
|
|
151
|
-
{ figmaToken: 'build-cache-filled', iconName: 'BuildCacheSolid' },
|
|
152
|
-
{ figmaToken: 'release', iconName: 'Release' },
|
|
153
|
-
{ figmaToken: 'release-filled', iconName: 'ReleaseSolid' },
|
|
154
|
-
{ figmaToken: 'insights', iconName: 'Insights' },
|
|
155
|
-
{ figmaToken: 'insights-filled', iconName: 'InsightsSolid' },
|
|
156
|
-
{ figmaToken: 'settings', iconName: 'Settings' },
|
|
157
|
-
{ figmaToken: 'settings-filled', iconName: 'SettingsSolid' },
|
|
158
|
-
],
|
|
159
|
-
Objects: [
|
|
160
|
-
{ figmaToken: 'anchor', iconName: 'Anchor' },
|
|
161
|
-
{ figmaToken: 'bell', iconName: 'Bell' },
|
|
162
|
-
{ figmaToken: 'book', iconName: 'Book' },
|
|
163
|
-
{ figmaToken: 'calendar', iconName: 'Calendar' },
|
|
164
|
-
{ figmaToken: 'coffee', iconName: 'Coffee' },
|
|
165
|
-
{ figmaToken: 'creditcard', iconName: 'Creditcard' },
|
|
166
|
-
{ figmaToken: 'credits', iconName: 'Credits' },
|
|
167
|
-
{ figmaToken: 'crown', iconName: 'Owner' },
|
|
168
|
-
{ figmaToken: 'doc', iconName: 'Doc' },
|
|
169
|
-
{ figmaToken: 'enterprise', iconName: 'Enterprise' },
|
|
170
|
-
{ figmaToken: 'flag', iconName: 'Flag' },
|
|
171
|
-
{ figmaToken: 'japanese', iconName: 'Japanese' },
|
|
172
|
-
{ figmaToken: 'gauge', iconName: 'Gauge' },
|
|
173
|
-
{ figmaToken: 'globe', iconName: 'Globe' },
|
|
174
|
-
{ figmaToken: 'heart', iconName: 'Heart' },
|
|
175
|
-
{ figmaToken: 'hourglass', iconName: 'Time', tags: 'time, sand' },
|
|
176
|
-
{ figmaToken: 'image', iconName: 'Image' },
|
|
177
|
-
{ figmaToken: 'invoice', iconName: 'Invoice' },
|
|
178
|
-
{ figmaToken: 'key', iconName: 'Key' },
|
|
179
|
-
{ figmaToken: 'lightbulb', iconName: 'Lightbulb' },
|
|
180
|
-
{ figmaToken: 'link', iconName: 'Link' },
|
|
181
|
-
{ figmaToken: 'lock', iconName: 'Lock', tags: 'private' },
|
|
182
|
-
{ figmaToken: 'lock-open', iconName: 'LockOpen', tags: 'public, unlocked' },
|
|
183
|
-
{ figmaToken: 'magnifier', iconName: 'Magnifier' },
|
|
184
|
-
{ figmaToken: 'mail', iconName: 'Mail', tags: 'email, envelope, message' },
|
|
185
|
-
{ figmaToken: 'news', iconName: 'News' },
|
|
186
|
-
{ figmaToken: 'no-tie', iconName: 'NoTie' },
|
|
187
|
-
{ figmaToken: 'pencil', iconName: 'Pencil' },
|
|
188
|
-
{ figmaToken: 'star', iconName: 'Star' },
|
|
189
|
-
{ figmaToken: 'stopwatch', iconName: 'Stopwatch' },
|
|
190
|
-
{ figmaToken: 'tag', iconName: 'Tag' },
|
|
191
|
-
{ figmaToken: 'tools', iconName: 'Tools' },
|
|
192
|
-
{ figmaToken: 'trash', iconName: 'Trash', tags: 'delete, remove' },
|
|
193
|
-
{ figmaToken: 'siren', iconName: 'Siren', tags: 'alert, alarm, emergency' },
|
|
194
|
-
],
|
|
195
|
-
People: [
|
|
196
|
-
{ figmaToken: 'person', iconName: 'Person', tags: 'account, user' },
|
|
197
|
-
{ figmaToken: 'connected-accounts', iconName: 'ConnectedAccounts' },
|
|
198
|
-
{ figmaToken: 'people', iconName: 'Dudes', tags: 'dudes, team' },
|
|
199
|
-
{ figmaToken: 'person-with-desk', iconName: 'Conference' },
|
|
200
|
-
{ figmaToken: 'eye', iconName: 'ShowPassword', tags: 'password, show, view' },
|
|
201
|
-
{ figmaToken: 'eye-slash', iconName: 'HidePassword', tags: 'hide, password' },
|
|
202
|
-
],
|
|
203
|
-
Status: [
|
|
204
|
-
{ figmaToken: 'circle', iconName: 'BuildstatusNeverbuilt' },
|
|
205
|
-
{ figmaToken: 'circle-dashed', iconName: 'StageIncomplete' },
|
|
206
|
-
{ figmaToken: 'circle-half-full', iconName: 'StageCurrent', tags: 'in-progress' },
|
|
207
|
-
{
|
|
208
|
-
figmaToken: 'block-circle',
|
|
209
|
-
iconName: '',
|
|
210
|
-
tags: 'abort, aborted, ban, block, forbidden, restricted, status, progress',
|
|
211
|
-
},
|
|
212
|
-
{ figmaToken: 'question-circle', iconName: '', tags: 'help, support' },
|
|
213
|
-
{ figmaToken: 'question-circle-filled', iconName: '' },
|
|
214
|
-
{ figmaToken: 'skip-circle', iconName: 'StepstatusSkip', tags: 'progress' },
|
|
215
|
-
{ figmaToken: 'skip-circle-filled', iconName: '' },
|
|
216
|
-
{ figmaToken: 'check', iconName: 'Tick', tags: 'tick' },
|
|
217
|
-
{ figmaToken: 'check-circle', iconName: 'BuildstatusSuccessful', tags: 'success' },
|
|
218
|
-
{ figmaToken: 'check-circle-filled', iconName: 'BuildstatusSuccessfulSolid', tags: 'success' },
|
|
219
|
-
{ figmaToken: 'error-circle', iconName: 'StepstatusWarning' },
|
|
220
|
-
{ figmaToken: 'error-circle-filled', iconName: 'ErrorCircleFilled' },
|
|
221
|
-
{ figmaToken: 'info-circle', iconName: '', tags: 'tooltip' },
|
|
222
|
-
{ figmaToken: 'info-circle-filled', iconName: '' },
|
|
223
|
-
{ figmaToken: 'warning', iconName: 'Warning' },
|
|
224
|
-
{ figmaToken: 'warning-yellow', iconName: 'WarningColored' },
|
|
225
|
-
],
|
|
226
|
-
'Status (old)': [
|
|
227
|
-
{ figmaToken: 'test-failed', iconName: 'TestFailed' },
|
|
228
|
-
{ figmaToken: 'test-inconclusive', iconName: 'TestInconclusive' },
|
|
229
|
-
{ figmaToken: 'test-info', iconName: 'TestInfo' },
|
|
230
|
-
{ figmaToken: 'test-inprogress', iconName: 'TestInprogress' },
|
|
231
|
-
{ figmaToken: 'test-skipped', iconName: 'TestSkipped' },
|
|
232
|
-
{ figmaToken: 'test-success', iconName: 'TestSuccess' },
|
|
233
|
-
{ figmaToken: 'test-warning', iconName: 'TestWarning' },
|
|
234
|
-
{ figmaToken: 'spinner-eggplant', iconName: 'ProgressEggplant', tags: 'loading, progress' },
|
|
235
|
-
{ figmaToken: 'spinner-violet', iconName: 'ProgressViolet', tags: 'loading, progress' },
|
|
236
|
-
{ figmaToken: 'spinner-white', iconName: 'ProgressWhite', tags: 'loading, progress' },
|
|
237
|
-
{ figmaToken: 'build-spinner-white', iconName: 'BuildstatusProgressWhite', tags: 'progress, running, status' },
|
|
238
|
-
{
|
|
239
|
-
figmaToken: 'build-spinner-eggplant',
|
|
240
|
-
iconName: 'BuildstatusProgressEggplant',
|
|
241
|
-
tags: 'progress, running, status',
|
|
242
|
-
},
|
|
243
|
-
],
|
|
244
|
-
Symbols: [
|
|
245
|
-
{ figmaToken: 'expand', iconName: 'Expand' },
|
|
246
|
-
{ figmaToken: 'refresh', iconName: 'Refresh' },
|
|
247
|
-
{ figmaToken: 'replace', iconName: 'Replace' },
|
|
248
|
-
{ figmaToken: 'history', iconName: 'History' },
|
|
249
|
-
{ figmaToken: 'responsiveness', iconName: 'Responsiveness' },
|
|
250
|
-
{ figmaToken: 'power', iconName: 'Power' },
|
|
251
|
-
{ figmaToken: 'menu-grid', iconName: 'MenuGrid' },
|
|
252
|
-
{ figmaToken: 'menu-hamburger', iconName: 'MenuHamburger' },
|
|
253
|
-
{ figmaToken: 'more-horizontal', iconName: 'MoreHorizontal' },
|
|
254
|
-
{ figmaToken: 'more-vertical', iconName: 'MoreVertical' },
|
|
255
|
-
{ figmaToken: 'overview', iconName: 'Overview' },
|
|
256
|
-
{ figmaToken: 'dot', iconName: 'Bulletpoint', tags: 'bullet, bulletpoint' },
|
|
257
|
-
{ figmaToken: 'group', iconName: 'Group' },
|
|
258
|
-
{ figmaToken: 'percent', iconName: 'Percent' },
|
|
259
|
-
{ figmaToken: 'box-arrow-down', iconName: 'BoxWithArrowDown' },
|
|
260
|
-
{ figmaToken: 'box-dot', iconName: 'BoxWithDot' },
|
|
261
|
-
{ figmaToken: 'box-lines-overflow', iconName: 'OverflowingLines', tags: 'text, wrap' },
|
|
262
|
-
{ figmaToken: 'box-lines-wrap', iconName: 'WrappedLines', tags: 'text' },
|
|
263
|
-
{ figmaToken: 'change-plan', iconName: 'ChangePlan' },
|
|
264
|
-
{ figmaToken: 'dollar', iconName: 'Dollars' },
|
|
265
|
-
{ figmaToken: 'hashtag', iconName: 'Numero', tags: 'numero' },
|
|
266
|
-
{ figmaToken: 'cycle', iconName: 'Cycle' },
|
|
267
|
-
{ figmaToken: 'interaction', iconName: 'Interaction' },
|
|
268
|
-
{ figmaToken: 'stability', iconName: 'Stability' },
|
|
269
|
-
{ figmaToken: 'swag', iconName: 'Swag' },
|
|
270
|
-
{ figmaToken: 'tasks', iconName: 'Testing', tags: 'checklist, list, testing' },
|
|
271
|
-
{ figmaToken: 'wow', iconName: 'Wow' },
|
|
272
|
-
{ figmaToken: 'details', iconName: 'Details' },
|
|
273
|
-
],
|
|
274
|
-
'UI Components': [
|
|
275
|
-
{
|
|
276
|
-
css: {
|
|
277
|
-
path: {
|
|
278
|
-
fill: 'neutral.80',
|
|
279
|
-
},
|
|
280
|
-
},
|
|
281
|
-
figmaToken: 'table-sort: Not sorted',
|
|
282
|
-
iconName: 'Sort',
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
css: {
|
|
286
|
-
path: {
|
|
287
|
-
fill: 'neutral.10',
|
|
288
|
-
},
|
|
289
|
-
},
|
|
290
|
-
figmaToken: 'table-sort: Hover',
|
|
291
|
-
iconName: 'Sort',
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
css: {
|
|
295
|
-
path: {
|
|
296
|
-
fill: 'neutral.80',
|
|
297
|
-
},
|
|
298
|
-
'path:first-of-type': {
|
|
299
|
-
fill: 'neutral.10',
|
|
300
|
-
},
|
|
301
|
-
},
|
|
302
|
-
figmaToken: 'table-sort: Up',
|
|
303
|
-
iconName: 'Sort',
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
css: {
|
|
307
|
-
path: {
|
|
308
|
-
fill: 'neutral.80',
|
|
309
|
-
},
|
|
310
|
-
'path:last-of-type': {
|
|
311
|
-
fill: 'neutral.10',
|
|
312
|
-
},
|
|
313
|
-
},
|
|
314
|
-
figmaToken: 'table-sort: Descending',
|
|
315
|
-
iconName: 'Sort',
|
|
316
|
-
},
|
|
317
|
-
{ figmaToken: 'dropdown-arrows', iconName: 'DropdownArrows' },
|
|
318
|
-
],
|
|
319
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const shadows = {
|
|
2
|
-
formFocus: '0 0.125rem 0.1875rem 0 rgba(0, 0, 0, 0.1) inset, 0 0 0 3px var(--colors-purple-70)',
|
|
3
|
-
inner: '0 0.125rem 0.1875rem 0 rgba(0, 0, 0, 0.1) inset',
|
|
4
|
-
innerSmall: '0 0.0625rem 0.125rem 0 rgba(0, 0, 0, 0.1) inset',
|
|
5
|
-
large: '0 0.125rem 1.5rem 0 rgba(0, 0, 0, 0.08)',
|
|
6
|
-
medium: '0 0.125rem 0.75rem 0 rgba(0, 0, 0, 0.06)',
|
|
7
|
-
none: 'none',
|
|
8
|
-
outline: '0 0 0 3px var(--colors-purple-70)',
|
|
9
|
-
small: '0 0.125rem 0.25rem 0 rgba(0, 0, 0, 0.06)',
|
|
10
|
-
tooltip: '0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.2)',
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type Shadows = typeof shadows;
|
|
14
|
-
export default shadows;
|
|
@@ -1,25 +0,0 @@
|
|
|
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;
|
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
|
-
import { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { useToken } from '@chakra-ui/react';
|
|
4
|
-
import CodeSnippet from '../../Components/CodeSnippet/CodeSnippet';
|
|
5
|
-
import Dot from '../../Components/Dot/Dot';
|
|
6
|
-
import Table from '../../Components/Table/Table';
|
|
7
|
-
import TableCaption from '../../Components/Table/TableCaption';
|
|
8
|
-
import TableContainer, { TableContainerProps } from '../../Components/Table/TableContainer';
|
|
9
|
-
import Tbody from '../../Components/Table/Tbody';
|
|
10
|
-
import Td from '../../Components/Table/Td';
|
|
11
|
-
import Text from '../../Components/Text/Text';
|
|
12
|
-
import Th from '../../Components/Table/Th';
|
|
13
|
-
import Thead from '../../Components/Table/Thead';
|
|
14
|
-
import Tr from '../../Components/Table/Tr';
|
|
15
|
-
import { textStyles } from '../../tokens/tokensToTheme.json';
|
|
16
|
-
|
|
17
|
-
type RowType = {
|
|
18
|
-
groupName: string;
|
|
19
|
-
token: string;
|
|
20
|
-
tokenPrefix?: string;
|
|
21
|
-
type?: 'color' | 'text';
|
|
22
|
-
value: string;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const Row = ({ groupName, token, tokenPrefix, type, value }: RowType) => {
|
|
26
|
-
const themeValue = useToken('colors', value);
|
|
27
|
-
const [hexa, setHexa] = useState(themeValue);
|
|
28
|
-
|
|
29
|
-
const dotRef = useRef<HTMLDivElement>(null);
|
|
30
|
-
|
|
31
|
-
const tokenKey = type === 'color' ? [tokenPrefix, groupName, token].filter(Boolean).join('/') : token;
|
|
32
|
-
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
if (dotRef.current && hexa.includes('var(')) {
|
|
35
|
-
setHexa(getComputedStyle(dotRef.current).getPropertyValue(hexa.replace('var(', '').replace(')', '')));
|
|
36
|
-
}
|
|
37
|
-
}, []);
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<Tr role="group">
|
|
41
|
-
<Td>
|
|
42
|
-
<CodeSnippet _groupHover={{ backgroundColor: 'neutral.93' }}>{tokenKey}</CodeSnippet>
|
|
43
|
-
</Td>
|
|
44
|
-
<Td>
|
|
45
|
-
<>
|
|
46
|
-
{type === 'color' && (
|
|
47
|
-
<>
|
|
48
|
-
<Text marginBottom="8" size="2">
|
|
49
|
-
{hexa}
|
|
50
|
-
</Text>
|
|
51
|
-
<Text size="2">({value})</Text>
|
|
52
|
-
</>
|
|
53
|
-
)}
|
|
54
|
-
{type === 'text' && (
|
|
55
|
-
<Text as="pre" textStyle="code/lg" whiteSpace="normal">
|
|
56
|
-
{JSON.stringify(textStyles[tokenKey as keyof typeof textStyles]).replace(/,/, ', ')}
|
|
57
|
-
</Text>
|
|
58
|
-
)}
|
|
59
|
-
</>
|
|
60
|
-
</Td>
|
|
61
|
-
<Td>
|
|
62
|
-
{type === 'color' && <Dot ref={dotRef} backgroundColor={value} border="1px solid" size="48" />}
|
|
63
|
-
{type === 'text' && <Text textStyle={tokenKey}>{tokenKey}</Text>}
|
|
64
|
-
</Td>
|
|
65
|
-
</Tr>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export interface TokenTableProps extends TableContainerProps {
|
|
70
|
-
data: any;
|
|
71
|
-
groupName: string;
|
|
72
|
-
tokenPrefix?: string;
|
|
73
|
-
type?: 'color' | 'text';
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const TokenTable = (props: TokenTableProps) => {
|
|
77
|
-
const { data, groupName, tokenPrefix, type = 'color', ...rest } = props;
|
|
78
|
-
return (
|
|
79
|
-
<TableContainer {...rest}>
|
|
80
|
-
<Table isFixed>
|
|
81
|
-
<TableCaption>{groupName}</TableCaption>
|
|
82
|
-
<Thead>
|
|
83
|
-
<Tr>
|
|
84
|
-
<Th width="30%">Token</Th>
|
|
85
|
-
<Th>Value</Th>
|
|
86
|
-
<Th width="20%">Example</Th>
|
|
87
|
-
</Tr>
|
|
88
|
-
</Thead>
|
|
89
|
-
<Tbody>
|
|
90
|
-
{Object.entries(data).map(([token, value]) => (
|
|
91
|
-
<Row
|
|
92
|
-
key={token}
|
|
93
|
-
groupName={groupName}
|
|
94
|
-
token={token}
|
|
95
|
-
tokenPrefix={tokenPrefix}
|
|
96
|
-
type={type}
|
|
97
|
-
value={`${value}`}
|
|
98
|
-
/>
|
|
99
|
-
))}
|
|
100
|
-
</Tbody>
|
|
101
|
-
</Table>
|
|
102
|
-
</TableContainer>
|
|
103
|
-
);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
export default TokenTable;
|
|
File without changes
|