@bitrise/bitkit 12.105.0 → 12.107.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 +18 -12
  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
@@ -0,0 +1,37 @@
1
+ import tokens from '../tokens/tokensToTheme.json';
2
+
3
+ export const TOKEN_STRINGS = [
4
+ 'heading.h1',
5
+ 'heading.h2',
6
+ 'heading.h3',
7
+ 'heading.h4',
8
+ 'heading.h5',
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;
20
+
21
+ export type Radii = keyof typeof tokens.radii;
22
+ export type TypeColors = `${
23
+ | 'neutral'
24
+ | 'purple'
25
+ | 'red'
26
+ | 'orange'
27
+ | 'yellow'
28
+ | 'green'
29
+ | 'turquoise'
30
+ | 'purple'
31
+ | 'blue'}.${'10' | '20' | '30' | '40' | '50' | '60' | '70' | '80' | '90' | '93' | '95' | '100'}`;
32
+
33
+ export type ColorScheme = 'blue' | 'red' | 'orange' | 'yellow' | 'green' | 'purple' | 'neutral';
34
+
35
+ export type TextSizes = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8';
36
+
37
+ export type TypeSizes = keyof typeof tokens.sizes;
@@ -36,3 +36,17 @@ export function useDebounce<T>(value: T, delay?: number): T {
36
36
 
37
37
  return debouncedValue;
38
38
  }
39
+
40
+ export function isObject(value: any): boolean {
41
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
42
+ }
43
+
44
+ export function getTokenValue(tokenString: string, tokenObject: any) {
45
+ let returnValue = {};
46
+ try {
47
+ returnValue = tokenString.split('.').reduce((o, i) => o[i], tokenObject);
48
+ } catch (e) {
49
+ returnValue = {};
50
+ }
51
+ return isObject(returnValue) ? returnValue : {};
52
+ }
@@ -1,21 +0,0 @@
1
- import { semanticTokens } from '../../tokens/tokens';
2
- import Card from '../../Components/Card/Card';
3
- import Text from '../../Components/Text/Text';
4
- import TokenTable from '../docComponents/TokenTable';
5
-
6
- const commonColorKeys = ['background', 'border', 'icon', 'text'];
7
-
8
- const CommonTokens = () => (
9
- <>
10
- <Text as="h2" color="pal.purple.10" fontWeight="normal" marginBlockEnd="8" size="8">
11
- Common Tokens
12
- </Text>
13
- <Card boxShadow="medium" padding="24">
14
- {commonColorKeys.map((groupName) => (
15
- <TokenTable key={groupName} data={semanticTokens.colors[groupName]} groupName={groupName} marginBottom="24" />
16
- ))}
17
- </Card>
18
- </>
19
- );
20
-
21
- export default CommonTokens;
@@ -1,27 +0,0 @@
1
- import { semanticTokens } from '../../tokens/tokens';
2
- import Card from '../../Components/Card/Card';
3
- import Text from '../../Components/Text/Text';
4
- import TokenTable from '../docComponents/TokenTable';
5
-
6
- const systemColorKeys = Object.keys(semanticTokens.colors.sys);
7
-
8
- const SystemTokens = () => (
9
- <>
10
- <Text as="h2" color="pal.purple.10" fontWeight="normal" marginBlockEnd="8" size="8">
11
- System Tokens
12
- </Text>
13
- <Card boxShadow="medium" padding="24">
14
- {systemColorKeys.map((groupName) => (
15
- <TokenTable
16
- key={groupName}
17
- data={semanticTokens.colors.sys[groupName]}
18
- groupName={groupName}
19
- marginBottom="24"
20
- tokenPrefix="sys."
21
- />
22
- ))}
23
- </Card>
24
- </>
25
- );
26
-
27
- export default SystemTokens;
@@ -1,10 +0,0 @@
1
- const radii = {
2
- '4': '0.25rem',
3
- '8': '0.5rem',
4
- '12': '0.75rem',
5
- '16': '1rem',
6
- '24': '1.5rem',
7
- };
8
-
9
- export type Radii = typeof radii;
10
- export default radii;
@@ -1,18 +0,0 @@
1
- const sizes = {
2
- '0': '0',
3
- '4': '0.25rem',
4
- '8': '0.5rem',
5
- '12': '0.75rem',
6
- '16': '1rem',
7
- '20': '1.25rem',
8
- '24': '1.5rem',
9
- '32': '2rem',
10
- '40': '2.5rem',
11
- '48': '3rem',
12
- '64': '4rem',
13
- '96': '6rem',
14
- '128': '8rem',
15
- };
16
-
17
- export type TypeSizes = keyof typeof sizes;
18
- export default sizes;
@@ -1,69 +0,0 @@
1
- const typography = {
2
- fonts: {
3
- body: `"TT Norms Pro", sans-serif`,
4
- mono: `"Source Code Pro Bitrise", monospace`,
5
- },
6
- fontSizes: {
7
- '1': '0.6875rem',
8
- '2': '0.875rem',
9
- '3': '1rem',
10
- '4': '1.1875rem',
11
- '5': '1.5rem',
12
- '6': '1.875rem',
13
- '7': '2.25rem',
14
- '8': '3rem',
15
- },
16
- fontWeights: {
17
- bold: 700,
18
- demiBold: 600,
19
- normal: 400,
20
- },
21
- letterSpacings: {
22
- '1': '0.00625rem',
23
- '2': '0.009375rem',
24
- '3': '0.0175rem',
25
- '4': '0.0375rem',
26
- '5': '0.05rem',
27
- },
28
- };
29
-
30
- export const textSizes = {
31
- sizes: {
32
- '1': {
33
- fontSize: '1',
34
- lineHeight: '1rem',
35
- },
36
- '2': {
37
- fontSize: '2',
38
- lineHeight: '1.25rem',
39
- },
40
- '3': {
41
- fontSize: '3',
42
- lineHeight: '1.5rem',
43
- },
44
- '4': {
45
- fontSize: '4',
46
- lineHeight: '1.75rem',
47
- },
48
- '5': {
49
- fontSize: '5',
50
- lineHeight: '2.25rem',
51
- },
52
- '6': {
53
- fontSize: '6',
54
- lineHeight: '2.5rem',
55
- },
56
- '7': {
57
- fontSize: '7',
58
- lineHeight: '3rem',
59
- },
60
- '8': {
61
- fontSize: '8',
62
- lineHeight: '3.75rem',
63
- },
64
- },
65
- };
66
-
67
- export type TextSizes = keyof typeof textSizes.sizes;
68
-
69
- export default typography;