@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.
- package/package.json +17 -14
- package/src/Components/Avatar/Avatar.tsx +0 -2
- package/src/Components/Badge/Badge.theme.ts +2 -6
- package/src/Components/Card/Card.tsx +0 -2
- package/src/Components/ColorButton/ColorButton.theme.ts +1 -1
- package/src/Components/ColorButton/ColorButton.tsx +1 -1
- package/src/Components/Dialog/Dialog.tsx +1 -1
- package/src/Components/Filter/Filter.theme.ts +1 -1
- package/src/Components/Form/Form.theme.ts +3 -6
- package/src/Components/Form/Input/Input.tsx +1 -1
- package/src/Components/Link/Link.theme.ts +2 -2
- package/src/Components/Link/Link.tsx +1 -1
- package/src/Components/Menu/MenuItem.tsx +1 -1
- package/src/Components/Notification/Notification.tsx +1 -1
- package/src/Components/Ribbon/Ribbon.tsx +1 -1
- package/src/Components/SegmentedControl/SegmentedControl.theme.ts +1 -1
- package/src/Components/Sidebar/SidebarItem.theme.ts +1 -1
- package/src/Components/Tabs/ContainedTab.tsx +3 -3
- package/src/Components/Tabs/Tabs.theme.ts +1 -3
- package/src/Components/Tag/Tag.theme.ts +3 -8
- package/src/Components/Tag/Tag.tsx +1 -1
- package/src/Components/Text/Text.theme.ts +45 -2
- package/src/Components/Text/Text.tsx +4 -17
- package/src/Components/components.theme.ts +103 -0
- package/src/Foundations/Colors/Colors.tsx +30 -4
- package/src/Foundations/Themes/Alert.theme.ts +3 -4
- package/src/Foundations/Typography/Typography.tsx +25 -0
- package/src/Foundations/docComponents/DocTitle.tsx +11 -0
- package/src/Foundations/docComponents/TokenTable.tsx +42 -13
- package/src/index.ts +1 -2
- package/src/theme.ts +13 -112
- package/src/tokens/tokensToTheme.json +977 -0
- package/src/types/bitkit.ts +37 -0
- package/src/utils/utils.ts +14 -0
- package/src/Foundations/Colors/CommonTokens.tsx +0 -21
- package/src/Foundations/Colors/SystemTokens.tsx +0 -27
- package/src/Foundations/Radii/Radii.ts +0 -10
- package/src/Foundations/Sizes/Sizes.ts +0 -18
- package/src/Foundations/Typography/Typography.ts +0 -69
- package/src/tokens/tokens.json +0 -3275
- package/src/tokens/tokens.ts +0 -49
- package/src/tokens/tokensUtils.ts +0 -20
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Text from '../../Components/Text/Text';
|
|
2
|
+
|
|
3
|
+
const DocTitle = ({ children }: { children: string }) => {
|
|
4
|
+
return (
|
|
5
|
+
<Text as="h2" color="pal.purple.10" fontWeight="normal" marginBlockEnd="8" size="8">
|
|
6
|
+
{children}
|
|
7
|
+
</Text>
|
|
8
|
+
);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default DocTitle;
|
|
@@ -12,13 +12,24 @@ import Text from '../../Components/Text/Text';
|
|
|
12
12
|
import Th from '../../Components/Table/Th';
|
|
13
13
|
import Thead from '../../Components/Table/Thead';
|
|
14
14
|
import Tr from '../../Components/Table/Tr';
|
|
15
|
+
import { textStyles } from '../../tokens/tokensToTheme.json';
|
|
15
16
|
|
|
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) => {
|
|
17
26
|
const themeValue = useToken('colors', value);
|
|
18
27
|
const [hexa, setHexa] = useState(themeValue);
|
|
19
28
|
|
|
20
29
|
const dotRef = useRef<HTMLDivElement>(null);
|
|
21
30
|
|
|
31
|
+
const tokenKey = type === 'color' ? [tokenPrefix, groupName, token].filter(Boolean).join('.') : token;
|
|
32
|
+
|
|
22
33
|
useEffect(() => {
|
|
23
34
|
if (dotRef.current && hexa.includes('var(')) {
|
|
24
35
|
setHexa(getComputedStyle(dotRef.current).getPropertyValue(hexa.replace('var(', '').replace(')', '')));
|
|
@@ -28,45 +39,63 @@ const Row = ({ token, value }: { token: string; value: string }) => {
|
|
|
28
39
|
return (
|
|
29
40
|
<Tr role="group">
|
|
30
41
|
<Td>
|
|
31
|
-
<CodeSnippet _groupHover={{ backgroundColor: 'neutral.93' }}>{
|
|
42
|
+
<CodeSnippet _groupHover={{ backgroundColor: 'neutral.93' }}>{tokenKey}</CodeSnippet>
|
|
32
43
|
</Td>
|
|
33
44
|
<Td>
|
|
34
45
|
<>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
+
)}
|
|
39
59
|
</>
|
|
40
60
|
</Td>
|
|
41
61
|
<Td>
|
|
42
|
-
<Dot ref={dotRef} backgroundColor={value} border="1px solid" size="48" />
|
|
62
|
+
{type === 'color' && <Dot ref={dotRef} backgroundColor={value} border="1px solid" size="48" />}
|
|
63
|
+
{type === 'text' && <Text textStyle={tokenKey}>{tokenKey}</Text>}
|
|
43
64
|
</Td>
|
|
44
65
|
</Tr>
|
|
45
66
|
);
|
|
46
67
|
};
|
|
47
68
|
|
|
48
69
|
export interface TokenTableProps extends TableContainerProps {
|
|
49
|
-
data:
|
|
70
|
+
data: any;
|
|
50
71
|
groupName: string;
|
|
51
72
|
tokenPrefix?: string;
|
|
73
|
+
type?: 'color' | 'text';
|
|
52
74
|
}
|
|
53
75
|
|
|
54
76
|
const TokenTable = (props: TokenTableProps) => {
|
|
55
|
-
const { data, groupName, tokenPrefix = '', ...rest } = props;
|
|
77
|
+
const { data, groupName, tokenPrefix, type = 'color', ...rest } = props;
|
|
56
78
|
return (
|
|
57
79
|
<TableContainer {...rest}>
|
|
58
|
-
<Table>
|
|
80
|
+
<Table isFixed>
|
|
59
81
|
<TableCaption>{groupName}</TableCaption>
|
|
60
82
|
<Thead>
|
|
61
83
|
<Tr>
|
|
62
|
-
<Th>Token</Th>
|
|
84
|
+
<Th width="30%">Token</Th>
|
|
63
85
|
<Th>Value</Th>
|
|
64
|
-
<Th>Example</Th>
|
|
86
|
+
<Th width="20%">Example</Th>
|
|
65
87
|
</Tr>
|
|
66
88
|
</Thead>
|
|
67
89
|
<Tbody>
|
|
68
90
|
{Object.entries(data).map(([token, value]) => (
|
|
69
|
-
<Row
|
|
91
|
+
<Row
|
|
92
|
+
key={token}
|
|
93
|
+
groupName={groupName}
|
|
94
|
+
token={token}
|
|
95
|
+
tokenPrefix={tokenPrefix}
|
|
96
|
+
type={type}
|
|
97
|
+
value={`${value}`}
|
|
98
|
+
/>
|
|
70
99
|
))}
|
|
71
100
|
</Tbody>
|
|
72
101
|
</Table>
|
package/src/index.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
export * from './types/bitkit';
|
|
1
2
|
export * from './types/chakra';
|
|
2
3
|
export * from './utils/reexports';
|
|
3
4
|
export * from './hooks';
|
|
4
5
|
|
|
5
6
|
export { default as theme } from './theme';
|
|
6
|
-
export type { TypeColors } from './tokens/tokens';
|
|
7
|
-
export type { TypeSizes } from './Foundations/Sizes/Sizes';
|
|
8
7
|
|
|
9
8
|
export type { LinkProps } from './Components/Link/Link';
|
|
10
9
|
export { default as Link } from './Components/Link/Link';
|
package/src/theme.ts
CHANGED
|
@@ -1,124 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import Checkbox from './Components/Form/Checkbox/Checkbox.theme';
|
|
8
|
-
import ColorButton from './Components/ColorButton/ColorButton.theme';
|
|
9
|
-
import Dialog from './Components/Dialog/Dialog.theme';
|
|
10
|
-
import Divider from './Components/Divider/Divider.theme';
|
|
11
|
-
import Drawer from './Components/Drawer/Drawer.theme';
|
|
12
|
-
import EmptyState from './Components/EmptyState/EmptyState.theme';
|
|
13
|
-
import Link from './Components/Link/Link.theme';
|
|
14
|
-
import List from './Components/List/List.theme';
|
|
15
|
-
import Menu from './Components/Menu/Menu.theme';
|
|
16
|
-
import Radio from './Components/Form/Radio/Radio.theme';
|
|
17
|
-
import Select from './Components/Select/Select.theme';
|
|
18
|
-
import Input from './Components/Form/Input/Input.theme';
|
|
19
|
-
import Dropdown from './Components/Dropdown/Dropdown.theme';
|
|
20
|
-
import Tabs from './Components/Tabs/Tabs.theme';
|
|
21
|
-
import Text from './Components/Text/Text.theme';
|
|
22
|
-
import Table from './Components/Table/Table.theme';
|
|
23
|
-
import Alert from './Foundations/Themes/Alert.theme';
|
|
24
|
-
import Tooltip from './Components/Tooltip/Tooltip.theme';
|
|
25
|
-
import CloseButton from './Components/CloseButton/CloseButton.theme';
|
|
26
|
-
import Popover from './Components/Popover/Popover.theme';
|
|
27
|
-
import Toggle from './Components/Toggle/Toggle.theme';
|
|
28
|
-
import Textarea from './Components/Form/Textarea/Textarea.theme';
|
|
29
|
-
import Form from './Components/Form/Form.theme';
|
|
30
|
-
import DatePickerDay from './Components/DatePicker/DatePickerDay.theme';
|
|
31
|
-
import NumberInput from './Components/NumberInput/NumberInput.theme';
|
|
32
|
-
import Skeleton from './Components/Skeleton/Skeleton.theme';
|
|
33
|
-
import ProgressBar from './Components/ProgressBar/ProgressBar.theme';
|
|
34
|
-
import ProgressIndicator from './Components/ProgressIndicator/ProgressIndicator.theme';
|
|
35
|
-
import Slider from './Components/Slider/Slider.theme';
|
|
36
|
-
import Sidebar from './Components/Sidebar/Sidebar.theme';
|
|
37
|
-
import SidebarItem from './Components/Sidebar/SidebarItem.theme';
|
|
38
|
-
import SegmentedControl from './Components/SegmentedControl/SegmentedControl.theme';
|
|
39
|
-
import Tag from './Components/Tag/Tag.theme';
|
|
40
|
-
import Note from './Components/Note/Note.theme';
|
|
41
|
-
import CodeBlock from './Components/CodeBlock/CodeBlock.theme';
|
|
42
|
-
import CodeSnippet from './Components/CodeSnippet/CodeSnippet.theme';
|
|
43
|
-
import DefinitionTooltip from './Components/DefinitionTooltip/DefinitionTooltip.theme';
|
|
44
|
-
import ExpandableCard from './Components/ExpandableCard/ExpandableCard.theme';
|
|
45
|
-
import FileInput from './Components/Form/FileInput/FileInput.theme';
|
|
46
|
-
import Filter from './Components/Filter/Filter.theme';
|
|
1
|
+
import '@fontsource/figtree/400.css';
|
|
2
|
+
import '@fontsource/figtree/600.css';
|
|
3
|
+
import '@fontsource/figtree/700.css';
|
|
4
|
+
import '@fontsource/source-code-pro/400.css';
|
|
5
|
+
|
|
6
|
+
import tokens from './tokens/tokensToTheme.json';
|
|
47
7
|
|
|
48
8
|
import breakpoints from './Foundations/Breakpoints/Breakpoints';
|
|
49
|
-
import radii from './Foundations/Radii/Radii';
|
|
50
9
|
import shadows from './Foundations/Shadows/Shadows';
|
|
51
|
-
import sizes from './Foundations/Sizes/Sizes';
|
|
52
|
-
import typography from './Foundations/Typography/Typography';
|
|
53
10
|
import zIndices from './Foundations/Zindex/Zindex';
|
|
54
|
-
|
|
55
|
-
import
|
|
56
|
-
import { colors, semanticTokens } from './tokens/tokens';
|
|
57
|
-
import TagsInput from './Components/Form/TagsInput/TagsInput.theme';
|
|
11
|
+
|
|
12
|
+
import components from './Components/components.theme';
|
|
58
13
|
|
|
59
14
|
const theme = {
|
|
15
|
+
...tokens,
|
|
60
16
|
breakpoints,
|
|
61
|
-
|
|
17
|
+
components,
|
|
62
18
|
config: {
|
|
63
19
|
cssVarPrefix: '',
|
|
64
20
|
},
|
|
65
|
-
...typography,
|
|
66
|
-
components: {
|
|
67
|
-
Accordion,
|
|
68
|
-
Avatar,
|
|
69
|
-
Badge,
|
|
70
|
-
Breadcrumb,
|
|
71
|
-
Button,
|
|
72
|
-
Card,
|
|
73
|
-
Checkbox,
|
|
74
|
-
ColorButton,
|
|
75
|
-
Divider,
|
|
76
|
-
Drawer,
|
|
77
|
-
Dropdown,
|
|
78
|
-
EmptyState,
|
|
79
|
-
FilterSwitch,
|
|
80
|
-
...Form,
|
|
81
|
-
Alert,
|
|
82
|
-
CloseButton,
|
|
83
|
-
CodeBlock,
|
|
84
|
-
CodeSnippet,
|
|
85
|
-
DatePickerDay,
|
|
86
|
-
DefinitionTooltip,
|
|
87
|
-
ExpandableCard,
|
|
88
|
-
FileInput,
|
|
89
|
-
Filter,
|
|
90
|
-
Input,
|
|
91
|
-
Link,
|
|
92
|
-
List,
|
|
93
|
-
Menu,
|
|
94
|
-
Modal: Dialog,
|
|
95
|
-
Note,
|
|
96
|
-
NumberInput,
|
|
97
|
-
Popover,
|
|
98
|
-
Progress: ProgressBar,
|
|
99
|
-
ProgressIndicator,
|
|
100
|
-
Radio,
|
|
101
|
-
SegmentedControl,
|
|
102
|
-
Select,
|
|
103
|
-
Sidebar,
|
|
104
|
-
SidebarItem,
|
|
105
|
-
Skeleton,
|
|
106
|
-
Slider,
|
|
107
|
-
Switch: Toggle,
|
|
108
|
-
Table,
|
|
109
|
-
Tabs,
|
|
110
|
-
Tag,
|
|
111
|
-
TagsInput,
|
|
112
|
-
Text,
|
|
113
|
-
Textarea,
|
|
114
|
-
Toggletip,
|
|
115
|
-
Tooltip,
|
|
116
|
-
},
|
|
117
|
-
radii,
|
|
118
|
-
semanticTokens,
|
|
119
21
|
shadows,
|
|
120
|
-
sizes,
|
|
121
|
-
space: sizes,
|
|
22
|
+
space: tokens.sizes,
|
|
122
23
|
styles: {
|
|
123
24
|
global: {
|
|
124
25
|
'*:focus-visible': {
|
|
@@ -129,10 +30,10 @@ const theme = {
|
|
|
129
30
|
textDecoration: 'none',
|
|
130
31
|
},
|
|
131
32
|
body: {
|
|
132
|
-
color: 'text.
|
|
33
|
+
color: 'text.primary',
|
|
133
34
|
fontFamily: 'body',
|
|
134
35
|
fontSize: '3',
|
|
135
|
-
lineHeight: '
|
|
36
|
+
lineHeight: 'size-3',
|
|
136
37
|
},
|
|
137
38
|
hr: {
|
|
138
39
|
borderTopWidth: 0,
|