@bitrise/bitkit 12.101.1-alpha.1 → 12.103.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 +11 -13
- package/src/Components/Badge/Badge.theme.ts +6 -4
- package/src/Components/ColorButton/ColorButton.theme.ts +1 -1
- package/src/Components/ColorButton/ColorButton.tsx +1 -1
- package/src/Components/DatePicker/useDateRange.ts +13 -0
- package/src/Components/Dialog/Dialog.tsx +1 -2
- package/src/Components/Filter/Filter.theme.ts +1 -1
- package/src/Components/Form/DateInput/DateInput.tsx +22 -15
- package/src/Components/Form/Form.theme.ts +6 -4
- 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 -4
- package/src/Components/Tabs/Tabs.theme.ts +3 -2
- package/src/Components/Tag/Tag.theme.ts +8 -3
- package/src/Components/Tag/Tag.tsx +1 -1
- package/src/Components/Text/Text.theme.ts +2 -45
- package/src/Components/Text/Text.tsx +17 -7
- package/src/Foundations/Colors/Colors.tsx +4 -30
- package/src/Foundations/Colors/CommonTokens.tsx +21 -0
- package/src/Foundations/Colors/SystemTokens.tsx +27 -0
- package/src/Foundations/Themes/Alert.theme.ts +6 -4
- package/src/Foundations/Typography/Typography.ts +69 -0
- package/src/Foundations/docComponents/TokenTable.tsx +9 -24
- package/src/index.ts +3 -4
- package/src/theme.ts +105 -13
- package/src/tokens/tokens.json +203 -203
- package/src/tokens/tokens.ts +43 -14
- package/src/tokens/tokensUtils.ts +4 -47
- package/src/utils/utils.ts +0 -14
- package/src/Components/components.theme.ts +0 -103
- package/src/Foundations/Typography/Typography.tsx +0 -30
- package/src/Foundations/docComponents/DocTitle.tsx +0 -11
- package/src/tokens/colorTokens.ts +0 -9
- package/src/tokens/semanticTokens.ts +0 -29
- package/src/tokens/textTokens.ts +0 -96
- package/src/types/colors.ts +0 -12
- package/src/types/typography.ts +0 -21
package/src/tokens/tokens.ts
CHANGED
|
@@ -1,20 +1,49 @@
|
|
|
1
1
|
import tokensJson from './tokens.json';
|
|
2
|
-
import {
|
|
2
|
+
import { looper } from './tokensUtils';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
mono: `"Source Code Pro", monospace`,
|
|
4
|
+
const legacyTokens = {
|
|
5
|
+
brand: {
|
|
6
|
+
primary: 'pal.purple.30',
|
|
8
7
|
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
bold: 700,
|
|
12
|
-
demiBold: 600,
|
|
13
|
-
normal: 400,
|
|
14
|
-
semibold: 600,
|
|
8
|
+
separator: {
|
|
9
|
+
primary: 'pal.neutral.90',
|
|
15
10
|
},
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
text: {
|
|
12
|
+
body: 'pal.neutral.10',
|
|
13
|
+
link: 'pal.purple.50',
|
|
14
|
+
linkHover: 'pal.purple.30',
|
|
15
|
+
secondary: 'pal.neutral.40',
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const commonColors = (({ background, border, icon, text }) => ({ background, border, icon, text }))(
|
|
20
|
+
tokensJson.comp.color,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const paletteColors = looper(tokensJson.core.color.pal);
|
|
24
|
+
|
|
25
|
+
export const colors = {
|
|
26
|
+
pal: paletteColors,
|
|
27
|
+
...paletteColors,
|
|
18
28
|
};
|
|
19
29
|
|
|
20
|
-
export
|
|
30
|
+
export const semanticTokens = {
|
|
31
|
+
colors: {
|
|
32
|
+
...legacyTokens,
|
|
33
|
+
sys: looper(tokensJson.system.color.sys),
|
|
34
|
+
...looper(commonColors),
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type TypeColors = `${
|
|
39
|
+
| 'neutral'
|
|
40
|
+
| 'purple'
|
|
41
|
+
| 'red'
|
|
42
|
+
| 'orange'
|
|
43
|
+
| 'yellow'
|
|
44
|
+
| 'green'
|
|
45
|
+
| 'turquoise'
|
|
46
|
+
| 'purple'
|
|
47
|
+
| 'blue'}.${'10' | '20' | '30' | '40' | '50' | '60' | '70' | '80' | '90' | '93' | '95' | '100'}`;
|
|
48
|
+
|
|
49
|
+
export type ColorScheme = 'blue' | 'red' | 'orange' | 'yellow' | 'green' | 'purple' | 'neutral';
|
|
@@ -3,61 +3,18 @@ type JsonValue = {
|
|
|
3
3
|
value: string;
|
|
4
4
|
};
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
typography: /\{typography\.(.*)\}/,
|
|
6
|
+
const valueFormatter = (obj: JsonValue) => {
|
|
7
|
+
return obj.value.replace(/\{color\.(.*)\}/, '$1');
|
|
9
8
|
};
|
|
10
9
|
|
|
11
|
-
const
|
|
12
|
-
color: (value: string) => value.replace(VALUE_REGEXPS.color, '$1'),
|
|
13
|
-
fontSize: (value: string) => {
|
|
14
|
-
const number = value.split('*')[1] || '1';
|
|
15
|
-
return `${number.trim()}rem`;
|
|
16
|
-
},
|
|
17
|
-
typography: (value: string) => {
|
|
18
|
-
if (!value) {
|
|
19
|
-
return value;
|
|
20
|
-
}
|
|
21
|
-
return value.replace(VALUE_REGEXPS.typography, '$1').replace(/\{(.*)\}/, '$1');
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const looper = (
|
|
26
|
-
obj: any,
|
|
27
|
-
formatterType?: keyof typeof VALUE_FORMATTERS,
|
|
28
|
-
formatterFunction?: (key: string, value: string) => any,
|
|
29
|
-
) => {
|
|
30
|
-
const returnObject: any = {};
|
|
31
|
-
Object.keys(obj).forEach((key) => {
|
|
32
|
-
const val: JsonValue | string = obj[key];
|
|
33
|
-
let finalValue = typeof val === 'string' ? val : val.value;
|
|
34
|
-
if (formatterType) {
|
|
35
|
-
finalValue = VALUE_FORMATTERS[formatterType](finalValue);
|
|
36
|
-
}
|
|
37
|
-
if (formatterFunction) {
|
|
38
|
-
finalValue = formatterFunction(key, finalValue);
|
|
39
|
-
}
|
|
40
|
-
if (finalValue) {
|
|
41
|
-
returnObject[key] = finalValue;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
return returnObject;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const colorLooper = (obj: any) => {
|
|
10
|
+
export const looper = (obj: any) => {
|
|
48
11
|
const returnObject: any = {};
|
|
49
12
|
Object.keys(obj).forEach((color) => {
|
|
50
13
|
returnObject[color] = {};
|
|
51
14
|
Object.keys(obj[color]).forEach((key: string) => {
|
|
52
15
|
const valueObj: JsonValue = obj[color][key];
|
|
53
|
-
returnObject[color][key] =
|
|
16
|
+
returnObject[color][key] = valueFormatter(valueObj);
|
|
54
17
|
});
|
|
55
18
|
});
|
|
56
19
|
return returnObject;
|
|
57
20
|
};
|
|
58
|
-
|
|
59
|
-
export const getFontSizes = (json: any) => {
|
|
60
|
-
const returnObj: Record<string, string> = looper(json, 'fontSize');
|
|
61
|
-
|
|
62
|
-
return returnObj;
|
|
63
|
-
};
|
package/src/utils/utils.ts
CHANGED
|
@@ -36,17 +36,3 @@ 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,103 +0,0 @@
|
|
|
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;
|
|
@@ -1,30 +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 textTokens, { getTextToken } from '../../tokens/textTokens';
|
|
7
|
-
import { TOKEN_STRINGS } from '../../types/typography';
|
|
8
|
-
|
|
9
|
-
const bodyStyles = TOKEN_STRINGS.filter((token) => token.includes('body')).reduce(
|
|
10
|
-
(obj, current) => {
|
|
11
|
-
obj[current.replace('body.', '')] = getTextToken(current);
|
|
12
|
-
return obj;
|
|
13
|
-
},
|
|
14
|
-
{} as Record<string, Record<string, string>>,
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
const Typography = () => {
|
|
18
|
-
return (
|
|
19
|
-
<Unstyled>
|
|
20
|
-
<Provider>
|
|
21
|
-
<DocTitle>Text Tokens</DocTitle>
|
|
22
|
-
<TokenTable data={textTokens.heading} groupName="heading" marginBottom="24" type="text" />
|
|
23
|
-
<TokenTable data={bodyStyles} groupName="body" marginBottom="24" type="text" />
|
|
24
|
-
<TokenTable data={textTokens.code} groupName="code" type="text" />
|
|
25
|
-
</Provider>
|
|
26
|
-
</Unstyled>
|
|
27
|
-
);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
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,29 +0,0 @@
|
|
|
1
|
-
import tokensJson from './tokens.json';
|
|
2
|
-
import { colorLooper } from './tokensUtils';
|
|
3
|
-
|
|
4
|
-
const legacyColorTokens = {
|
|
5
|
-
brand: {
|
|
6
|
-
primary: 'pal.purple.30',
|
|
7
|
-
},
|
|
8
|
-
separator: {
|
|
9
|
-
primary: 'pal.neutral.90',
|
|
10
|
-
},
|
|
11
|
-
text: {
|
|
12
|
-
body: 'pal.neutral.10',
|
|
13
|
-
link: 'pal.purple.50',
|
|
14
|
-
linkHover: 'pal.purple.30',
|
|
15
|
-
secondary: 'pal.neutral.40',
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const commonColors = (({ background, border, icon, text }) => ({ background, border, icon, text }))(
|
|
20
|
-
tokensJson.comp.color,
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
export const semanticTokens = {
|
|
24
|
-
colors: {
|
|
25
|
-
...legacyColorTokens,
|
|
26
|
-
sys: colorLooper(tokensJson.system.color.sys),
|
|
27
|
-
...colorLooper(commonColors),
|
|
28
|
-
},
|
|
29
|
-
};
|
package/src/tokens/textTokens.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { getTokenValue } from '../utils/utils';
|
|
2
|
-
import tokensJson from './tokens.json';
|
|
3
|
-
import { looper } from './tokensUtils';
|
|
4
|
-
|
|
5
|
-
const textTokens: Record<string, any> = {
|
|
6
|
-
comp: {},
|
|
7
|
-
fonts: { mono: {}, sans: {} },
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const textValueFormatter = (property: string, value: string) => {
|
|
11
|
-
let finalProperty = property;
|
|
12
|
-
let finalValue = value.replace(/\{(.+)\}/, '$1').split('.')[1] || '';
|
|
13
|
-
if (property === 'fontFamily' && finalValue === 'font-mono') {
|
|
14
|
-
finalValue = 'mono';
|
|
15
|
-
}
|
|
16
|
-
if (
|
|
17
|
-
(property === 'fontFamily' && finalValue === 'font-sans') ||
|
|
18
|
-
(property === 'fontWeight' && finalValue === 'normal') ||
|
|
19
|
-
(property === 'letterSpacing' && finalValue === '0') ||
|
|
20
|
-
property === 'paragraphSpacing' ||
|
|
21
|
-
(property === 'textCase' && finalValue === 'none') ||
|
|
22
|
-
(property === 'textDecoration' && finalValue === 'none')
|
|
23
|
-
) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
if (property === 'textCase') {
|
|
27
|
-
finalProperty = 'textTransform';
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return { finalProperty, finalValue };
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
Object.entries(tokensJson.core.typography.fonts.mono).forEach(([name, { value: ruleObj }]) => {
|
|
34
|
-
textTokens.fonts.mono[name] = {};
|
|
35
|
-
Object.entries(ruleObj).forEach(([property, value]) => {
|
|
36
|
-
const textRules = textValueFormatter(property, value);
|
|
37
|
-
if (textRules) {
|
|
38
|
-
const { finalProperty, finalValue } = textRules;
|
|
39
|
-
textTokens.fonts.mono[name][finalProperty] = finalValue;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
Object.entries(tokensJson.core.typography.fonts.sans).forEach(([size, variant]) => {
|
|
45
|
-
textTokens.fonts.sans[size] = {};
|
|
46
|
-
Object.entries(variant).forEach(([name, { value: ruleObj }]) => {
|
|
47
|
-
textTokens.fonts.sans[size][name] = {};
|
|
48
|
-
Object.entries(ruleObj).forEach(([property, value]) => {
|
|
49
|
-
const textRules = textValueFormatter(property, value);
|
|
50
|
-
if (textRules) {
|
|
51
|
-
const { finalProperty, finalValue } = textRules;
|
|
52
|
-
textTokens.fonts.sans[size][name][finalProperty] = finalValue;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
Object.entries(tokensJson.system.typography).forEach(([type, sizes]) => {
|
|
59
|
-
textTokens[type] = {};
|
|
60
|
-
if (type === 'body') {
|
|
61
|
-
Object.entries(sizes).forEach(([size, variants]) => {
|
|
62
|
-
textTokens[type][size] = looper(variants, 'typography', (_k: string, v: string) => {
|
|
63
|
-
return getTokenValue(v, textTokens);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
} else {
|
|
67
|
-
textTokens[type] = looper(sizes, 'typography', (_k: string, v: string) => {
|
|
68
|
-
return getTokenValue(v, textTokens);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
Object.entries(tokensJson.comp.typography.comp).forEach(([component, keys]) => {
|
|
74
|
-
textTokens.comp[component] = {};
|
|
75
|
-
if (component === 'link' || component === 'tabs') {
|
|
76
|
-
Object.entries(keys).forEach(([key, { value }]) => {
|
|
77
|
-
textTokens.comp[component][key] = looper(value, 'typography', (k: string, v: string) => {
|
|
78
|
-
const finalValue = textValueFormatter(k, v)?.finalValue;
|
|
79
|
-
return finalValue;
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
} else {
|
|
83
|
-
textTokens.comp[component] = looper(keys, 'typography', (_k: string, v: string) => {
|
|
84
|
-
return getTokenValue(v, textTokens);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
export const getTextToken = (token?: string) => {
|
|
90
|
-
if (!token) {
|
|
91
|
-
return {};
|
|
92
|
-
}
|
|
93
|
-
return getTokenValue(token, textTokens);
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export default textTokens;
|
package/src/types/colors.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type TypeColors = `${
|
|
2
|
-
| 'neutral'
|
|
3
|
-
| 'purple'
|
|
4
|
-
| 'red'
|
|
5
|
-
| 'orange'
|
|
6
|
-
| 'yellow'
|
|
7
|
-
| 'green'
|
|
8
|
-
| 'turquoise'
|
|
9
|
-
| 'purple'
|
|
10
|
-
| 'blue'}.${'10' | '20' | '30' | '40' | '50' | '60' | '70' | '80' | '90' | '93' | '95' | '100'}`;
|
|
11
|
-
|
|
12
|
-
export type ColorScheme = 'blue' | 'red' | 'orange' | 'yellow' | 'green' | 'purple' | 'neutral';
|
package/src/types/typography.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export const TOKEN_STRINGS = [
|
|
2
|
-
'heading.h1',
|
|
3
|
-
'heading.h2',
|
|
4
|
-
'heading.h3',
|
|
5
|
-
'heading.h4',
|
|
6
|
-
'heading.h5',
|
|
7
|
-
'heading.h6',
|
|
8
|
-
'body.lg.regular',
|
|
9
|
-
'body.lg.semibold',
|
|
10
|
-
'body.lg.underline',
|
|
11
|
-
'body.md.regular',
|
|
12
|
-
'body.md.semibold',
|
|
13
|
-
'body.sm.regular',
|
|
14
|
-
'body.sm.semibold',
|
|
15
|
-
'code.lg',
|
|
16
|
-
'code.md',
|
|
17
|
-
] as const;
|
|
18
|
-
|
|
19
|
-
export type TokenStrings = (typeof TOKEN_STRINGS)[number];
|
|
20
|
-
|
|
21
|
-
export type TextSizes = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8';
|