@bitrise/bitkit 9.5.2 → 9.5.3-alpha-src.1

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 (105) hide show
  1. package/package.json +4 -1
  2. package/src/tsconfig.tsbuildinfo +1 -0
  3. package/.browserslistrc +0 -2
  4. package/.editorconfig +0 -4
  5. package/.eslint-tsconfig.json +0 -7
  6. package/.eslintrc.js +0 -28
  7. package/.husky/commit-msg +0 -4
  8. package/.nvmrc +0 -1
  9. package/.storybook/main.js +0 -35
  10. package/.storybook/manager.js +0 -6
  11. package/.storybook/preview.tsx +0 -20
  12. package/.storybook/theme.js +0 -7
  13. package/.stylelintignore +0 -2
  14. package/.stylelintrc +0 -287
  15. package/.svgrrc.js +0 -52
  16. package/.tool-versions +0 -1
  17. package/@types/@bitrise/bitkit.ts +0 -1
  18. package/@types/react-docgen.ts +0 -119
  19. package/CHANGELOG.md +0 -996
  20. package/CONTRIBUTING.md +0 -79
  21. package/FAQ.md +0 -19
  22. package/bitrise.yml +0 -66
  23. package/commitlint.config.js +0 -10
  24. package/jest.setup.js +0 -36
  25. package/netlify.toml +0 -42
  26. package/postcss.config.js +0 -16
  27. package/release.config.js +0 -32
  28. package/renovate.json +0 -6
  29. package/scripts/build-docs-watch.ts +0 -7
  30. package/scripts/build-docs.ts +0 -59
  31. package/site/assets/fonts/TT_Norms_Pro_Bold.woff +0 -0
  32. package/site/assets/fonts/TT_Norms_Pro_Normal.woff +0 -0
  33. package/site/assets/icons/favicon-32x32.png +0 -0
  34. package/site/assets/images/app_icon.jpg +0 -0
  35. package/site/assets/images/status-checks.png +0 -0
  36. package/site/components/CodeBlock/CodeBlock.css +0 -87
  37. package/site/components/CodeBlock/CodeBlock.tsx +0 -35
  38. package/site/components/Documentation/ComponentDocumentationPage.tsx +0 -150
  39. package/site/components/Documentation/Components/SectionAddonBeam.tsx +0 -47
  40. package/site/components/Documentation/Components/SectionAddonBeamSandbox.tsx +0 -32
  41. package/site/components/Documentation/Components/SectionAddonFooter.tsx +0 -22
  42. package/site/components/Documentation/Components/SectionAppear.tsx +0 -59
  43. package/site/components/Documentation/Components/SectionAvatar.tsx +0 -50
  44. package/site/components/Documentation/Components/SectionBadge.tsx +0 -38
  45. package/site/components/Documentation/Components/SectionBase.tsx +0 -17
  46. package/site/components/Documentation/Components/SectionButtons.tsx +0 -361
  47. package/site/components/Documentation/Components/SectionCards.tsx +0 -276
  48. package/site/components/Documentation/Components/SectionCheckbox.tsx +0 -38
  49. package/site/components/Documentation/Components/SectionDatePicker.tsx +0 -82
  50. package/site/components/Documentation/Components/SectionDivider.tsx +0 -31
  51. package/site/components/Documentation/Components/SectionDot.tsx +0 -27
  52. package/site/components/Documentation/Components/SectionDropdowns.tsx +0 -388
  53. package/site/components/Documentation/Components/SectionExpand.tsx +0 -143
  54. package/site/components/Documentation/Components/SectionFlex.tsx +0 -33
  55. package/site/components/Documentation/Components/SectionFormElements.tsx +0 -187
  56. package/site/components/Documentation/Components/SectionGrid.tsx +0 -125
  57. package/site/components/Documentation/Components/SectionHamburger.tsx +0 -34
  58. package/site/components/Documentation/Components/SectionIcons.tsx +0 -30
  59. package/site/components/Documentation/Components/SectionInputs.tsx +0 -89
  60. package/site/components/Documentation/Components/SectionList.tsx +0 -26
  61. package/site/components/Documentation/Components/SectionModals.tsx +0 -224
  62. package/site/components/Documentation/Components/SectionNotification.tsx +0 -38
  63. package/site/components/Documentation/Components/SectionPlacement.tsx +0 -167
  64. package/site/components/Documentation/Components/SectionProgress.tsx +0 -149
  65. package/site/components/Documentation/Components/SectionRadioButton.tsx +0 -38
  66. package/site/components/Documentation/Components/SectionRibbon.tsx +0 -33
  67. package/site/components/Documentation/Components/SectionRibbonSandbox.tsx +0 -17
  68. package/site/components/Documentation/Components/SectionSidebar.tsx +0 -125
  69. package/site/components/Documentation/Components/SectionSkeleton.tsx +0 -99
  70. package/site/components/Documentation/Components/SectionStatus.tsx +0 -53
  71. package/site/components/Documentation/Components/SectionStatusSandbox404.tsx +0 -42
  72. package/site/components/Documentation/Components/SectionStatusSandbox500.tsx +0 -13
  73. package/site/components/Documentation/Components/SectionTable.tsx +0 -83
  74. package/site/components/Documentation/Components/SectionTabs.tsx +0 -25
  75. package/site/components/Documentation/Components/SectionText.tsx +0 -34
  76. package/site/components/Documentation/Components/SectionTextarea.tsx +0 -43
  77. package/site/components/Documentation/Components/SectionToggle.tsx +0 -50
  78. package/site/components/Documentation/Components/SectionTooltips.tsx +0 -50
  79. package/site/components/Documentation/Documentation.tsx +0 -302
  80. package/site/components/Documentation/Materials/SectionColors.css +0 -33
  81. package/site/components/Documentation/Materials/SectionColors.tsx +0 -197
  82. package/site/components/Documentation/Materials/SectionIcons.tsx +0 -106
  83. package/site/components/Documentation/Materials/SectionTypography.tsx +0 -143
  84. package/site/components/Page/Page.tsx +0 -8
  85. package/site/components/Page/PageTitle.tsx +0 -8
  86. package/site/components/PropsTable/PropsTable.tsx +0 -35
  87. package/site/components/PropsTable/PropsTableCellUnion.tsx +0 -29
  88. package/site/components/PropsTable/PropsTableRow.tsx +0 -55
  89. package/site/components/Root/Root.tsx +0 -89
  90. package/site/components/Root/index.tsx +0 -4
  91. package/site/components/Sandbox/Sandbox.tsx +0 -19
  92. package/site/components/Sandbox/SandboxFrame.css +0 -20
  93. package/site/components/Sandbox/SandboxFrame.tsx +0 -77
  94. package/site/components/Section/Section.tsx +0 -8
  95. package/site/components/Section/SectionSubTitle.tsx +0 -8
  96. package/site/components/Section/SectionTitle.tsx +0 -8
  97. package/site/components/SideMenu/SideMenu.css +0 -39
  98. package/site/components/SideMenu/SideMenu.tsx +0 -53
  99. package/site/components/SideMenu/SideMenuItem.tsx +0 -34
  100. package/site/components/Window/Window.tsx +0 -62
  101. package/site/index.css +0 -11
  102. package/site/index.html +0 -16
  103. package/site/index.tsx +0 -16
  104. package/superstatic.json +0 -13
  105. package/tsconfig.json +0 -25
@@ -1,302 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- /* eslint-disable global-require */
3
- import * as React from 'react';
4
- import { RouteComponentProps } from 'react-router';
5
- import { Redirect, Route, Switch } from 'react-router-dom';
6
- import { Flex, Text } from '@bitrise/bitkit';
7
- import Provider from '../../../src/Components/Provider/Provider';
8
- import documentation from '../../../documentation.json';
9
- import SideMenu from '../SideMenu/SideMenu';
10
- import SideMenuItem from '../SideMenu/SideMenuItem';
11
- import ComponentDocumentationPage from './ComponentDocumentationPage';
12
- import SectionColors from './Materials/SectionColors';
13
- import SectionIcons from './Materials/SectionIcons';
14
- import SectionTypography from './Materials/SectionTypography';
15
-
16
- const { useEffect } = React;
17
-
18
- const SectionMap = {
19
- AddonBeam: {
20
- Showcase: require('./Components/SectionAddonBeam').default,
21
- components: [documentation.AddonBeam, documentation.AddonBeamLink],
22
- },
23
- AddonFooter: {
24
- Showcase: require('./Components/SectionAddonFooter').default,
25
- components: [documentation.AddonFooter],
26
- },
27
- Appear: {
28
- Showcase: require('./Components/SectionAppear').default,
29
- components: [documentation.Appear],
30
- },
31
- Avatar: {
32
- Showcase: require('./Components/SectionAvatar').default,
33
- components: [documentation.Avatar],
34
- },
35
- Badge: {
36
- Showcase: require('./Components/SectionBadge').default,
37
- components: [documentation.Badge],
38
- },
39
- Base: {
40
- Showcase: require('./Components/SectionBase').default,
41
- components: [documentation.Base],
42
- },
43
- Button: {
44
- Showcase: require('./Components/SectionButtons').default,
45
- components: [documentation.Button, documentation.Buttons, documentation.ColorButton],
46
- },
47
- Card: {
48
- Showcase: require('./Components/SectionCards').default,
49
- components: [documentation.Card, documentation.CardContent, documentation.CardDivider],
50
- },
51
- Checkbox: {
52
- Showcase: require('./Components/SectionCheckbox').default,
53
- components: [documentation.Checkbox],
54
- },
55
- DatePicker: {
56
- Showcase: require('./Components/SectionDatePicker').default,
57
- components: [documentation.DatePicker],
58
- },
59
- Divider: {
60
- Showcase: require('./Components/SectionDivider').default,
61
- components: [documentation.Divider],
62
- },
63
- Dot: {
64
- Showcase: require('./Components/SectionDot').default,
65
- components: [documentation.Dot],
66
- },
67
- Dropdown: {
68
- Showcase: require('./Components/SectionDropdowns').default,
69
- components: [
70
- documentation.Dropdown,
71
- documentation.DropdownButton,
72
- documentation.DropdownMenus,
73
- documentation.DropdownMenu,
74
- documentation.DropdownMenuItem,
75
- ],
76
- },
77
- Expand: {
78
- Showcase: require('./Components/SectionExpand').default,
79
- components: [documentation.Expand],
80
- },
81
- Flex: {
82
- Showcase: require('./Components/SectionFlex').default,
83
- components: [documentation.Flex],
84
- },
85
- Grid: {
86
- Showcase: require('./Components/SectionGrid').default,
87
- components: [documentation.Grid],
88
- },
89
- Hamburger: {
90
- Showcase: require('./Components/SectionHamburger').default,
91
- components: [documentation.Hamburger],
92
- },
93
- Icon: {
94
- Showcase: require('./Components/SectionIcons').default,
95
- components: [documentation.Icon],
96
- },
97
- Image: {
98
- components: [documentation.Image],
99
- },
100
- Input: {
101
- Showcase: require('./Components/SectionInputs').default,
102
- components: [
103
- documentation.Input,
104
- documentation.InputContainer,
105
- documentation.InputContent,
106
- documentation.InputInlineHelp,
107
- documentation.InputLabel,
108
- ],
109
- },
110
- Link: {
111
- components: [documentation.Link],
112
- },
113
- List: {
114
- Showcase: require('./Components/SectionList').default,
115
- components: [documentation.List, documentation.ListItem],
116
- },
117
- Logo: {
118
- components: [documentation.Logo],
119
- },
120
- Modal: {
121
- Showcase: require('./Components/SectionModals').default,
122
- components: [
123
- documentation.Modal,
124
- documentation.ModalTitle,
125
- documentation.ModalHeader,
126
- documentation.ModalHeaderProgress,
127
- documentation.ModalBody,
128
- ],
129
- },
130
- Notification: {
131
- Showcase: require('./Components/SectionNotification').default,
132
- components: [documentation.Notification],
133
- },
134
- Placement: {
135
- Showcase: require('./Components/SectionPlacement').default,
136
- components: [
137
- documentation.Placement,
138
- documentation.PlacementArea,
139
- documentation.PlacementArrow,
140
- documentation.PlacementManager,
141
- documentation.PlacementReference,
142
- ],
143
- },
144
- Progress: {
145
- Showcase: require('./Components/SectionProgress').default,
146
- components: [
147
- documentation.ProgressBar,
148
- documentation.ProgressButton,
149
- documentation.ProgressBitbot,
150
- documentation.ProgressSpinner,
151
- documentation.ProgressColorButton,
152
- ],
153
- },
154
- RadioButton: {
155
- Showcase: require('./Components/SectionRadioButton').default,
156
- components: [documentation.RadioButton],
157
- },
158
- Ribbon: {
159
- Showcase: require('./Components/SectionRibbon').default,
160
- components: [documentation.Ribbon],
161
- },
162
- Sidebar: {
163
- Showcase: require('./Components/SectionSidebar').default,
164
- components: [
165
- documentation.Sidebar,
166
- documentation.SidebarMenu,
167
- documentation.SidebarMenuItem,
168
- documentation.SidebarSubMenu,
169
- documentation.SidebarSubMenuItem,
170
- ],
171
- },
172
- Skeleton: {
173
- Showcase: require('./Components/SectionSkeleton').default,
174
- components: [documentation.Skeleton, documentation.SkeletonBox],
175
- },
176
- Status: {
177
- Showcase: require('./Components/SectionStatus').default,
178
- components: [documentation.Status404, documentation.Status500],
179
- },
180
- Table: {
181
- Showcase: require('./Components/SectionTable').default,
182
- components: [
183
- documentation.Table,
184
- documentation.TableBody,
185
- documentation.TableCell,
186
- documentation.TableHeader,
187
- documentation.TableHeaderCell,
188
- documentation.TableHeaderRow,
189
- documentation.TableRow,
190
- ],
191
- },
192
- Tabs: {
193
- Showcase: require('./Components/SectionTabs').default,
194
- components: [documentation.Tab, documentation.Tabs],
195
- },
196
- Text: {
197
- Showcase: require('./Components/SectionText').default,
198
- components: [documentation.Text],
199
- information: `Bitkit uses 'TT Norms' for the regular font and 'Source Code Pro'
200
- for the monospace font. Both of these are not websafe fonts and are not provided
201
- as part of the Bitkit.`,
202
- },
203
- Textarea: {
204
- Showcase: require('./Components/SectionTextarea').default,
205
- components: [documentation.Textarea],
206
- },
207
- Toggle: {
208
- Showcase: require('./Components/SectionToggle').default,
209
- components: [documentation.Toggle],
210
- },
211
- Tooltip: {
212
- Showcase: require('./Components/SectionTooltips').default,
213
- components: [documentation.Tooltip],
214
- },
215
- Visibility: {
216
- components: [documentation.Visibility, documentation.VisibilityContainer],
217
- },
218
- };
219
-
220
- const Documentation = (props: RouteComponentProps) => {
221
- const { location } = props;
222
-
223
- useEffect(() => {
224
- const element = location.hash && document.querySelector(location.hash);
225
-
226
- if (location.hash && element) {
227
- element.scrollIntoView();
228
- } else {
229
- window.scrollTo({ top: 0 });
230
- }
231
- }, [location]);
232
-
233
- return (
234
- <Provider>
235
- <Flex direction="horizontal" gap="x12" grow>
236
- <Flex>
237
- <Flex margin="x6">
238
- <Text margin="x2">Materials</Text>
239
-
240
- <Route path="/documentation/materials/colors">
241
- {({ match }) => <SideMenu active={!!match} name="Colors" to="/documentation/materials/colors" />}
242
- </Route>
243
-
244
- <Route path="/documentation/materials/icons">
245
- {({ match }) => <SideMenu active={!!match} name="Icons" to="/documentation/materials/icons" />}
246
- </Route>
247
-
248
- <Route path="/documentation/materials/typography">
249
- {({ match }) => <SideMenu active={!!match} name="Typography" to="/documentation/materials/typography" />}
250
- </Route>
251
- </Flex>
252
-
253
- <Flex margin="x6">
254
- <Text margin="x2">Components</Text>
255
-
256
- {Object.entries(SectionMap).map(([sectionName, { components }]) => (
257
- <Route key={sectionName} path={`/documentation/components/${sectionName}`}>
258
- {({ match }) => (
259
- <SideMenu active={!!match} name={sectionName} to={`/documentation/components/${sectionName}`}>
260
- {components.map((c) => {
261
- if (!c) {
262
- return;
263
- }
264
- const { displayName } = c;
265
- return (
266
- <Route key={displayName} path={`/documentation/components/${sectionName}#${displayName}`}>
267
- {({ match: m }) => (
268
- <SideMenuItem active={!!m} to={`/documentation/components/${sectionName}#${displayName}`}>
269
- {displayName}
270
- </SideMenuItem>
271
- )}
272
- </Route>
273
- );
274
- })}
275
- </SideMenu>
276
- )}
277
- </Route>
278
- ))}
279
- </Flex>
280
- </Flex>
281
-
282
- <Flex grow initial="none">
283
- <Switch>
284
- <Route path="/documentation/404" render={() => null} />
285
- <Route
286
- path="/documentation/components/:sectionName"
287
- render={(properties) => <ComponentDocumentationPage {...properties} map={SectionMap} />}
288
- />
289
-
290
- <Route component={SectionColors} path="/documentation/materials/colors" />
291
- <Route component={SectionIcons} path="/documentation/materials/icons" />
292
- <Route component={SectionTypography} path="/documentation/materials/typography" />
293
-
294
- <Redirect to="/documentation/materials/colors" />
295
- </Switch>
296
- </Flex>
297
- </Flex>
298
- </Provider>
299
- );
300
- };
301
-
302
- export default Documentation;
@@ -1,33 +0,0 @@
1
- .SectionColors__color {
2
- transform-origin: center;
3
- transition-property: border-radius, transform;
4
- transition-duration: var(--transition-duration--base);
5
- transition-timing-function: var(--transition-timing-function);
6
-
7
- &:active {
8
- transform: scale(0.925);
9
- }
10
- }
11
-
12
- .SectionColors__color--active,
13
- .SectionColors__color--active:active {
14
- transform: scale(1.25);
15
- border-radius: var(--size--x1);
16
- z-index: 1;
17
- }
18
-
19
- .SectionColors__color-row:first-child > :first-child {
20
- border-top-left-radius: var(--size--x1);
21
- }
22
-
23
- .SectionColors__color-row:first-child > :last-child {
24
- border-top-right-radius: var(--size--x1);
25
- }
26
-
27
- .SectionColors__color-row:last-child > :first-child {
28
- border-bottom-left-radius: var(--size--x1);
29
- }
30
-
31
- .SectionColors__color-row:last-child > :last-child {
32
- border-bottom-right-radius: var(--size--x1);
33
- }
@@ -1,197 +0,0 @@
1
- import * as React from 'react';
2
- import { Link as RouterLink } from 'react-router-dom';
3
- import classnames from 'classnames';
4
- import { variables, Card, CardContent, Flex, Link, Text, TypeColors } from '@bitrise/bitkit';
5
- import CodeBlock from '../../CodeBlock/CodeBlock';
6
- import './SectionColors.css';
7
-
8
- const { useState } = React;
9
-
10
- const colorGrid: [TypeColors, boolean][][] = [
11
- [
12
- ['black', true],
13
- ['gray-8', true],
14
- ['gray-7', true],
15
- ['gray-6', true],
16
- ['gray-5', false],
17
- ['gray-4', false],
18
- ['gray-3', false],
19
- ['gray-2', false],
20
- ['gray-1', false],
21
- ['white', false],
22
- ],
23
- [
24
- ['black', true],
25
- ['aqua-5', true],
26
- ['grape-5', true],
27
- ['red-5', true],
28
- ['orange-5', true],
29
- ['yellow-5', true],
30
- ['green-5', true],
31
- ['blue-5', true],
32
- ['darkblue-5', true],
33
- ['violet-5', true],
34
- ],
35
- [
36
- ['black', true],
37
- ['aqua-4', true],
38
- ['grape-4', true],
39
- ['red-4', true],
40
- ['orange-4', true],
41
- ['yellow-4', true],
42
- ['green-4', true],
43
- ['blue-4', true],
44
- ['darkblue-4', true],
45
- ['violet-4', true],
46
- ],
47
- [
48
- ['black', true],
49
- ['aqua-3', false],
50
- ['grape-3', true],
51
- ['red-3', true],
52
- ['orange-3', true],
53
- ['yellow-3', true],
54
- ['green-3', true],
55
- ['blue-3', true],
56
- ['darkblue-3', true],
57
- ['violet-3', true],
58
- ],
59
- [
60
- ['black', true],
61
- ['aqua-2', false],
62
- ['grape-2', false],
63
- ['red-2', false],
64
- ['orange-2', false],
65
- ['yellow-2', false],
66
- ['green-2', false],
67
- ['blue-2', false],
68
- ['darkblue-2', false],
69
- ['violet-2', false],
70
- ],
71
- [
72
- ['black', true],
73
- ['aqua-1', false],
74
- ['grape-1', false],
75
- ['red-1', false],
76
- ['orange-1', false],
77
- ['yellow-1', false],
78
- ['green-1', false],
79
- ['blue-1', false],
80
- ['darkblue-1', false],
81
- ['violet-1', false],
82
- ],
83
- ];
84
-
85
- const SectionColors = () => {
86
- const [[permActiveColor, isPermActiveColorDark], setPermActiveColor] = useState<[TypeColors, boolean]>([
87
- 'grape-3',
88
- true,
89
- ]);
90
- const [[tempActiveColor, isTempActiveColorDark], setTempActiveColor] = useState<[TypeColors | null, boolean]>([
91
- null,
92
- true,
93
- ]);
94
-
95
- const activeColor = tempActiveColor || permActiveColor;
96
- const isActiveColorDark = tempActiveColor ? isTempActiveColorDark : isPermActiveColorDark;
97
-
98
- return (
99
- <Flex>
100
- <Text margin="x12" size="8" weight="bold">
101
- Colors
102
- </Text>
103
-
104
- <Card elevation="x2">
105
- <CardContent padding="x6">
106
- <Flex direction="horizontal" gap="x6">
107
- <Flex borderColor="gray-2" borderRadius="x2">
108
- {colorGrid.map((colors, index) => (
109
- <Flex className="SectionColors__color-row" direction="horizontal" key={index}>
110
- {colors.map(([color, isDark]) => (
111
- <Flex
112
- backgroundColor={color}
113
- className={classnames('SectionColors__color', {
114
- 'SectionColors__color--active': color === permActiveColor,
115
- })}
116
- clickable
117
- container={color === permActiveColor}
118
- elevation={color === permActiveColor ? 'x1' : undefined}
119
- grow
120
- height="2rem"
121
- key={color}
122
- onClick={() => setPermActiveColor([color, isDark])}
123
- onMouseEnter={() => setTempActiveColor([color, isDark])}
124
- onMouseLeave={() => setTempActiveColor([null, isDark])}
125
- width="2rem"
126
- />
127
- ))}
128
- </Flex>
129
- ))}
130
- </Flex>
131
-
132
- <Flex
133
- backgroundColor={activeColor}
134
- borderRadius="x2"
135
- direction="vertical"
136
- grow
137
- initial="none"
138
- padding="x6"
139
- textColor={isActiveColorDark ? 'gray-1' : 'grape-5'}
140
- >
141
- <Flex grow>
142
- <Text letterSpacing="x2" size="2" uppercase>
143
- {activeColor.replace('-', ' ')}
144
- </Text>
145
- <Text size="2">
146
- <code>{variables.colorMap[activeColor]}</code>
147
- </Text>
148
- <Text size="2">
149
- <code>rgb({variables.rgbMap[activeColor].join(', ')})</code>
150
- </Text>
151
- </Flex>
152
-
153
- <Flex>
154
- <Text size="2">
155
- <code>var(--color-{activeColor.replace('-', '--')})</code>
156
- </Text>
157
- <Text size="2">
158
- <code>
159
- variables.color{activeColor.charAt(0).toUpperCase() + activeColor.slice(1).replace('-', '')}
160
- </code>
161
- </Text>
162
- </Flex>
163
- </Flex>
164
- </Flex>
165
- </CardContent>
166
- </Card>
167
-
168
- <Text margin="x12">
169
- Colors from the available swatch above can be used from exported javascript variables, the available CSS
170
- variables (
171
- <Link color="grape-3" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties">
172
- Custom Properties
173
- </Link>
174
- ) and also from the handy props provided by the{' '}
175
- <Link Component={RouterLink} color="grape-3" to="/documentation/components/base">
176
- Base component
177
- </Link>
178
- , which makes them available on all components (...there's some exceptions).
179
- </Text>
180
-
181
- <CodeBlock title="Colors from the React components">{`<Flex backgroundColor="grape-5" borderRadius="x1" padding="x2" textColor="gray-1">
182
- <Icon name="Bitbot">
183
- </Flex>`}</CodeBlock>
184
-
185
- <CodeBlock title="Colors from the Javascript variables">{`import { variables } from '@bitrise/bitkit';
186
-
187
- console.log(variables.colorAqua1) // ${variables.colorAqua1}`}</CodeBlock>
188
-
189
- <CodeBlock language="css" title="Colors from the CSS variables">{`.MyComponent {
190
- background-color: var(--color-grape--5);
191
- color: var(--color-gray--1);
192
- }`}</CodeBlock>
193
- </Flex>
194
- );
195
- };
196
-
197
- export default SectionColors;
@@ -1,106 +0,0 @@
1
- import * as React from 'react';
2
- import { Link as RouterLink } from 'react-router-dom';
3
- import sample from 'lodash.sample';
4
- import {
5
- variables,
6
- Flex,
7
- Grid,
8
- Icon,
9
- Input,
10
- InputContainer,
11
- InputContent,
12
- InputLabel,
13
- Link,
14
- Text,
15
- TypeIconName,
16
- } from '@bitrise/bitkit';
17
- import CodeBlock from '../../CodeBlock/CodeBlock';
18
-
19
- const { useEffect, useState } = React;
20
-
21
- const SectionIcons = () => {
22
- const [iconName, setIconName] = useState<string>('');
23
- const [iconRandomName, setIconRandomName] = useState<TypeIconName | null>(null);
24
- const icons = variables.icons.filter((name) => !iconName || name.toLowerCase().includes(iconName.toLowerCase()));
25
-
26
- useEffect(() => {
27
- const iconRandomName = sample(variables.icons);
28
-
29
- if (iconRandomName) {
30
- setIconRandomName(iconRandomName);
31
- }
32
- }, [icons.length === 0]);
33
-
34
- return (
35
- <Flex>
36
- <Text margin="x6" size="8" weight="bold">
37
- Icons
38
- </Text>
39
-
40
- <Text>
41
- All of the Icons below can be achieved with the React{' '}
42
- <Link Component={RouterLink} color="grape-3" to="/documentation/components/icon">
43
- Icon component
44
- </Link>{' '}
45
- and outputs inline SVG for super quality and easy alignment. The SVG elements uses{' '}
46
- <code>fill: currentColor;</code> and so inherits the font color from it's parent.
47
- </Text>
48
-
49
- <CodeBlock title="Icon component example">{'<Icon name="Bitbot" size="2rem" textColor="grape-3" />'}</CodeBlock>
50
-
51
- <InputLabel>Icon search</InputLabel>
52
-
53
- <InputContainer>
54
- <InputContent>
55
- <Input
56
- onChange={(e: React.ChangeEvent<HTMLInputElement>) => setIconName(e.target.value)}
57
- placeholder="Looking for something special?"
58
- value={iconName}
59
- />
60
- <Icon name="Magnifier" />
61
- </InputContent>
62
- </InputContainer>
63
-
64
- {!!icons.length && (
65
- <Grid alignChildren="middle" gap="x2" margin="x8" repeatWidthMin="4rem">
66
- {icons.map((name) => (
67
- <Flex
68
- alignChildren="middle"
69
- backgroundColor="gray-1"
70
- borderRadius="x1"
71
- clickable
72
- direction="vertical"
73
- key={name}
74
- padding="x2"
75
- title={name}
76
- >
77
- <Icon name={name} />
78
- <Text ellipsis margin="x1" size="1">
79
- {name}
80
- </Text>
81
- </Flex>
82
- ))}
83
- </Grid>
84
- )}
85
-
86
- {!icons.length && iconRandomName && (
87
- <Flex alignChildren="middle" direction="vertical" gap="x4" margin="x12">
88
- <Flex backgroundColor="gray-1" borderRadius="x2" padding="x2" title={iconRandomName}>
89
- <Icon name={iconRandomName} size="3rem" />
90
- </Flex>
91
-
92
- <Flex>
93
- <Text align="middle" margin="x1">
94
- No icons found matching "{iconName}".
95
- </Text>
96
- <Text align="middle" margin="x1">
97
- How about this random icon called "{iconRandomName}"?
98
- </Text>
99
- </Flex>
100
- </Flex>
101
- )}
102
- </Flex>
103
- );
104
- };
105
-
106
- export default SectionIcons;