@bitrise/bitkit 9.5.0 → 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 (106) hide show
  1. package/package.json +4 -1
  2. package/src/tsconfig.tsbuildinfo +1 -0
  3. package/src/variables.css +141 -1
  4. package/.browserslistrc +0 -2
  5. package/.editorconfig +0 -4
  6. package/.eslint-tsconfig.json +0 -7
  7. package/.eslintrc.js +0 -28
  8. package/.husky/commit-msg +0 -4
  9. package/.nvmrc +0 -1
  10. package/.storybook/main.js +0 -35
  11. package/.storybook/manager.js +0 -6
  12. package/.storybook/preview.tsx +0 -20
  13. package/.storybook/theme.js +0 -7
  14. package/.stylelintignore +0 -2
  15. package/.stylelintrc +0 -287
  16. package/.svgrrc.js +0 -52
  17. package/.tool-versions +0 -1
  18. package/@types/@bitrise/bitkit.ts +0 -1
  19. package/@types/react-docgen.ts +0 -119
  20. package/CHANGELOG.md +0 -987
  21. package/CONTRIBUTING.md +0 -79
  22. package/FAQ.md +0 -19
  23. package/bitrise.yml +0 -66
  24. package/commitlint.config.js +0 -10
  25. package/jest.setup.js +0 -36
  26. package/netlify.toml +0 -42
  27. package/postcss.config.js +0 -16
  28. package/release.config.js +0 -32
  29. package/renovate.json +0 -6
  30. package/scripts/build-docs-watch.ts +0 -7
  31. package/scripts/build-docs.ts +0 -59
  32. package/site/assets/fonts/TT_Norms_Pro_Bold.woff +0 -0
  33. package/site/assets/fonts/TT_Norms_Pro_Normal.woff +0 -0
  34. package/site/assets/icons/favicon-32x32.png +0 -0
  35. package/site/assets/images/app_icon.jpg +0 -0
  36. package/site/assets/images/status-checks.png +0 -0
  37. package/site/components/CodeBlock/CodeBlock.css +0 -87
  38. package/site/components/CodeBlock/CodeBlock.tsx +0 -35
  39. package/site/components/Documentation/ComponentDocumentationPage.tsx +0 -150
  40. package/site/components/Documentation/Components/SectionAddonBeam.tsx +0 -47
  41. package/site/components/Documentation/Components/SectionAddonBeamSandbox.tsx +0 -32
  42. package/site/components/Documentation/Components/SectionAddonFooter.tsx +0 -22
  43. package/site/components/Documentation/Components/SectionAppear.tsx +0 -59
  44. package/site/components/Documentation/Components/SectionAvatar.tsx +0 -50
  45. package/site/components/Documentation/Components/SectionBadge.tsx +0 -38
  46. package/site/components/Documentation/Components/SectionBase.tsx +0 -17
  47. package/site/components/Documentation/Components/SectionButtons.tsx +0 -361
  48. package/site/components/Documentation/Components/SectionCards.tsx +0 -276
  49. package/site/components/Documentation/Components/SectionCheckbox.tsx +0 -38
  50. package/site/components/Documentation/Components/SectionDatePicker.tsx +0 -82
  51. package/site/components/Documentation/Components/SectionDivider.tsx +0 -31
  52. package/site/components/Documentation/Components/SectionDot.tsx +0 -27
  53. package/site/components/Documentation/Components/SectionDropdowns.tsx +0 -388
  54. package/site/components/Documentation/Components/SectionExpand.tsx +0 -143
  55. package/site/components/Documentation/Components/SectionFlex.tsx +0 -33
  56. package/site/components/Documentation/Components/SectionFormElements.tsx +0 -187
  57. package/site/components/Documentation/Components/SectionGrid.tsx +0 -125
  58. package/site/components/Documentation/Components/SectionHamburger.tsx +0 -34
  59. package/site/components/Documentation/Components/SectionIcons.tsx +0 -30
  60. package/site/components/Documentation/Components/SectionInputs.tsx +0 -89
  61. package/site/components/Documentation/Components/SectionList.tsx +0 -26
  62. package/site/components/Documentation/Components/SectionModals.tsx +0 -224
  63. package/site/components/Documentation/Components/SectionNotification.tsx +0 -38
  64. package/site/components/Documentation/Components/SectionPlacement.tsx +0 -167
  65. package/site/components/Documentation/Components/SectionProgress.tsx +0 -149
  66. package/site/components/Documentation/Components/SectionRadioButton.tsx +0 -38
  67. package/site/components/Documentation/Components/SectionRibbon.tsx +0 -33
  68. package/site/components/Documentation/Components/SectionRibbonSandbox.tsx +0 -17
  69. package/site/components/Documentation/Components/SectionSidebar.tsx +0 -125
  70. package/site/components/Documentation/Components/SectionSkeleton.tsx +0 -99
  71. package/site/components/Documentation/Components/SectionStatus.tsx +0 -53
  72. package/site/components/Documentation/Components/SectionStatusSandbox404.tsx +0 -42
  73. package/site/components/Documentation/Components/SectionStatusSandbox500.tsx +0 -13
  74. package/site/components/Documentation/Components/SectionTable.tsx +0 -83
  75. package/site/components/Documentation/Components/SectionTabs.tsx +0 -25
  76. package/site/components/Documentation/Components/SectionText.tsx +0 -34
  77. package/site/components/Documentation/Components/SectionTextarea.tsx +0 -43
  78. package/site/components/Documentation/Components/SectionToggle.tsx +0 -50
  79. package/site/components/Documentation/Components/SectionTooltips.tsx +0 -50
  80. package/site/components/Documentation/Documentation.tsx +0 -302
  81. package/site/components/Documentation/Materials/SectionColors.css +0 -33
  82. package/site/components/Documentation/Materials/SectionColors.tsx +0 -197
  83. package/site/components/Documentation/Materials/SectionIcons.tsx +0 -106
  84. package/site/components/Documentation/Materials/SectionTypography.tsx +0 -143
  85. package/site/components/Page/Page.tsx +0 -8
  86. package/site/components/Page/PageTitle.tsx +0 -8
  87. package/site/components/PropsTable/PropsTable.tsx +0 -35
  88. package/site/components/PropsTable/PropsTableCellUnion.tsx +0 -29
  89. package/site/components/PropsTable/PropsTableRow.tsx +0 -55
  90. package/site/components/Root/Root.tsx +0 -89
  91. package/site/components/Root/index.tsx +0 -4
  92. package/site/components/Sandbox/Sandbox.tsx +0 -19
  93. package/site/components/Sandbox/SandboxFrame.css +0 -20
  94. package/site/components/Sandbox/SandboxFrame.tsx +0 -77
  95. package/site/components/Section/Section.tsx +0 -8
  96. package/site/components/Section/SectionSubTitle.tsx +0 -8
  97. package/site/components/Section/SectionTitle.tsx +0 -8
  98. package/site/components/SideMenu/SideMenu.css +0 -39
  99. package/site/components/SideMenu/SideMenu.tsx +0 -53
  100. package/site/components/SideMenu/SideMenuItem.tsx +0 -34
  101. package/site/components/Window/Window.tsx +0 -62
  102. package/site/index.css +0 -11
  103. package/site/index.html +0 -16
  104. package/site/index.tsx +0 -16
  105. package/superstatic.json +0 -13
  106. package/tsconfig.json +0 -25
@@ -1,143 +0,0 @@
1
- import * as React from 'react';
2
- import { Link as RouterLink } from 'react-router-dom';
3
- import {
4
- variables,
5
- Card,
6
- CardContent,
7
- CardDivider,
8
- Expand,
9
- Flex,
10
- Icon,
11
- Link,
12
- Text,
13
- TypeTextSize,
14
- } from '@bitrise/bitkit';
15
- import CodeBlock from '../../CodeBlock/CodeBlock';
16
-
17
- const { useState } = React;
18
-
19
- const configurations: {
20
- fontSizePx: number;
21
- lineHeightPx: number;
22
- size: TypeTextSize;
23
- uppercase?: boolean;
24
- }[] = [
25
- {
26
- fontSizePx: variables.fontSize1Px,
27
- lineHeightPx: variables.lineHeight1Px,
28
- size: '1',
29
- },
30
- {
31
- fontSizePx: variables.fontSize2Px,
32
- lineHeightPx: variables.lineHeight2Px,
33
- size: '2',
34
- },
35
- {
36
- fontSizePx: variables.fontSize3Px,
37
- lineHeightPx: variables.lineHeight3Px,
38
- size: '3',
39
- },
40
- {
41
- fontSizePx: variables.fontSize4Px,
42
- lineHeightPx: variables.lineHeight4Px,
43
- size: '4',
44
- },
45
- {
46
- fontSizePx: variables.fontSize5Px,
47
- lineHeightPx: variables.lineHeight5Px,
48
- size: '5',
49
- },
50
- {
51
- fontSizePx: variables.fontSize6Px,
52
- lineHeightPx: variables.lineHeight6Px,
53
- size: '6',
54
- },
55
- {
56
- fontSizePx: variables.fontSize7Px,
57
- lineHeightPx: variables.lineHeight7Px,
58
- size: '7',
59
- },
60
- {
61
- fontSizePx: variables.fontSize8Px,
62
- lineHeightPx: variables.lineHeight8Px,
63
- size: '8',
64
- },
65
- ];
66
-
67
- const SectionTypography = () => {
68
- const [expanded, setExpanded] = useState<{ [key in TypeTextSize]?: boolean }>({});
69
-
70
- return (
71
- <Flex>
72
- <Text Component="h2" margin="x6" size="8" weight="bold">
73
- Typography
74
- </Text>
75
-
76
- <Text Component="p">
77
- You can mix and match to get any text you like, but below shows the best combinations to use from the design
78
- guide. All of these examples can be achieved with the{' '}
79
- <Link Component={RouterLink} color="grape-3" to="/documentation/components/text">
80
- Text component
81
- </Link>
82
- .
83
- </Text>
84
-
85
- <CodeBlock title="Text component example">{`<Text letterSpacing="x5" size="1" uppercase weight="medium">
86
- I must protest your unauthorised presence on this bridge!
87
- </Text>
88
-
89
- <Text size="8">
90
- I must protest your unauthorised presence on this bridge!
91
- </Text>`}</CodeBlock>
92
-
93
- {configurations.map((config) => (
94
- <Card direction="vertical" elevation="x2" key={config.size} margin="x6" onClick={() => {}}>
95
- <Link color="grape-5" onClick={() => setExpanded({ ...expanded, [config.size]: !expanded[config.size] })}>
96
- <CardContent paddingHorizontal="x6" paddingVertical="x4">
97
- <Flex alignChildrenVertical="middle" direction="horizontal" gap="x6">
98
- <Flex grow initial="none">
99
- <Text Component="h3" margin="x1" weight="bold">
100
- Size {config.size}
101
- </Text>
102
- <Text Component="p" margin="x1" size="2">
103
- Font size: {config.fontSizePx}px{' '}
104
- <Text emphasis inline textColor="gray-5">
105
- ({config.fontSizePx / 16}rem)
106
- </Text>
107
- <br />
108
- Line height: {config.lineHeightPx}px{' '}
109
- <Text emphasis inline textColor="gray-5">
110
- ({config.lineHeightPx / 16}rem)
111
- </Text>
112
- </Text>
113
- </Flex>
114
-
115
- <Flex>
116
- <Text size={config.size} textColor="gray-3">
117
- Aa
118
- </Text>
119
- </Flex>
120
-
121
- <Flex>
122
- <Icon name={expanded[config.size] ? 'ChevronDown' : 'ChevronRight'} />
123
- </Flex>
124
- </Flex>
125
- </CardContent>
126
- </Link>
127
-
128
- <Expand expanded={!!expanded[config.size]}>
129
- <CardDivider />
130
-
131
- <CardContent padding="x6">
132
- <Text size={config.size} textColor="gray-7">
133
- I must protest your unauthorised presence on this bridge!
134
- </Text>
135
- </CardContent>
136
- </Expand>
137
- </Card>
138
- ))}
139
- </Flex>
140
- );
141
- };
142
-
143
- export default SectionTypography;
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- import { Base, BaseProps } from '@bitrise/bitkit';
3
-
4
- const Page: React.SFC<BaseProps> = (props: BaseProps) => {
5
- return <Base {...props} />;
6
- };
7
-
8
- export default Page;
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- import { Text, TextProps } from '@bitrise/bitkit';
3
-
4
- const PageTitle: React.SFC<TextProps> = (props: TextProps) => {
5
- return <Text {...props} margin="x6" size="6" textColor="grape-5" weight="bold" />;
6
- };
7
-
8
- export default PageTitle;
@@ -1,35 +0,0 @@
1
- import * as React from 'react';
2
- import { PropDescriptor } from 'react-docgen';
3
- import { Table, TableProps, TableBody, Text } from '@bitrise/bitkit';
4
- import PropsTableRow from './PropsTableRow';
5
-
6
- interface Props extends TableProps {
7
- composes?: string[];
8
- displayName: string;
9
- props: {
10
- [key: string]: PropDescriptor;
11
- };
12
- }
13
-
14
- const PropsTable: React.SFC<Props> = ({ composes, displayName, props = {}, ...rest }: Props) => {
15
- if (Object.keys(props).length === 0) {
16
- return (
17
- <Text margin="x1" size="2" textColor="gray-5">
18
- This component has no props to show{' '}
19
- {composes && composes.length && `, however it extends ${composes.join(', ')}`}.
20
- </Text>
21
- );
22
- }
23
-
24
- return (
25
- <Table {...rest}>
26
- <TableBody>
27
- {Object.entries(props).map(([propName, prop]) => (
28
- <PropsTableRow {...prop} id={`${displayName}-${propName}`} key={propName} name={propName} />
29
- ))}
30
- </TableBody>
31
- </Table>
32
- );
33
- };
34
-
35
- export default PropsTable;
@@ -1,29 +0,0 @@
1
- import * as React from 'react';
2
- import { FlowElementsType, FlowLiteralType, FlowTypeDescriptor, PropDescriptor } from 'react-docgen';
3
- import { Text } from '@bitrise/bitkit';
4
-
5
- interface Props extends PropDescriptor {
6
- flowType: FlowElementsType;
7
- }
8
-
9
- const elementFormatter = (element: FlowTypeDescriptor) => {
10
- switch (element.name) {
11
- case 'literal':
12
- return (element as FlowLiteralType).value;
13
- case 'string':
14
- return 'String';
15
- default:
16
- return element.name;
17
- }
18
- };
19
- const PropsTableCellUnion: React.SFC<Props> = (props: Props) => {
20
- const { flowType } = props;
21
-
22
- if (!flowType) {
23
- return null;
24
- }
25
-
26
- return <Text size="2">{flowType.elements.map(elementFormatter).join(' | ')}</Text>;
27
- };
28
-
29
- export default PropsTableCellUnion;
@@ -1,55 +0,0 @@
1
- import * as React from 'react';
2
- import { PropDescriptor, FlowTypeName } from 'react-docgen';
3
- import { Flex, TableCell, TableRow, Text } from '@bitrise/bitkit';
4
- import PropsTableCellUnion from './PropsTableCellUnion';
5
-
6
- interface Props extends PropDescriptor {
7
- name: string;
8
- }
9
-
10
- const CellMap: {
11
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
- [key in FlowTypeName]?: React.ComponentType<any>;
13
- } = {
14
- union: PropsTableCellUnion,
15
- };
16
-
17
- const PropsTableRow: React.SFC<Props> = (props: Props) => {
18
- const { defaultValue, description, flowType, name, required, ...rest } = props;
19
- const TypeCell = flowType && CellMap[flowType.name as FlowTypeName];
20
-
21
- return (
22
- <TableRow {...rest}>
23
- <TableCell>
24
- <Flex alignChildrenVertical="middle" direction="horizontal" gap="x2">
25
- <Flex>
26
- <Text>{name}</Text>
27
- </Flex>
28
-
29
- {required && (
30
- <Flex>
31
- <Text size="1" textColor="red-3" uppercase>
32
- [Required]
33
- </Text>
34
- </Flex>
35
- )}
36
- </Flex>
37
-
38
- <Text size="2">{description}</Text>
39
- </TableCell>
40
-
41
- <TableCell>
42
- {flowType && flowType.name}
43
- {defaultValue && (
44
- <Text breakOn="none" size="2" textColor="gray-5">
45
- Default Value: {defaultValue.value}
46
- </Text>
47
- )}
48
- </TableCell>
49
-
50
- <TableCell>{TypeCell && <TypeCell {...props} />}</TableCell>
51
- </TableRow>
52
- );
53
- };
54
-
55
- export default PropsTableRow;
@@ -1,89 +0,0 @@
1
- import * as React from 'react';
2
- import { Link as RouterLink, Switch, Route, Redirect } from 'react-router-dom';
3
- import { Flex, Icon, Image, Link, Tabs, Tab, Text } from '@bitrise/bitkit';
4
- import Documentation from '../Documentation/Documentation';
5
-
6
- const Root = () => {
7
- return (
8
- <Flex direction="vertical" grow maxWidth="75rem" paddingHorizontal="x6">
9
- <Flex Component="header" alignChildrenVertical="middle" direction="horizontal" gap="x6" paddingVertical="x6">
10
- <Flex grow>
11
- <Link Component={RouterLink} color="grape-5" to="/">
12
- <Flex alignChildrenVertical="middle" direction="horizontal" gap="x2">
13
- <Flex>
14
- <Icon name="Bitbot" />
15
- </Flex>
16
-
17
- <Flex>
18
- <Text>Bitkit</Text>
19
- </Flex>
20
- </Flex>
21
- </Link>
22
- </Flex>
23
-
24
- <Flex>
25
- <Tabs>
26
- <Route path="/documentation">
27
- {({ match }) => (
28
- <Tab active={!!match} to="/documentation">
29
- Documentation
30
- </Tab>
31
- )}
32
- </Route>
33
- </Tabs>
34
- </Flex>
35
- </Flex>
36
-
37
- <Flex direction="vertical" grow paddingVertical="x6">
38
- <Switch>
39
- <Route component={Documentation} path="/documentation" />
40
- <Redirect to="/documentation" />
41
- </Switch>
42
- </Flex>
43
-
44
- <Flex Component="footer" paddingVertical="x16">
45
- <Flex alignChildren="middle" direction="vertical" margin="x4">
46
- <Icon margin="x2" name="Bitbot" size="3rem" />
47
-
48
- <Text letterSpacing="x5" size="1" uppercase>
49
- Bitkit
50
- </Text>
51
-
52
- <Flex direction="horizontal" gap="x1">
53
- <Flex>
54
- <Text letterSpacing="x5" size="1" uppercase>
55
- Built with
56
- </Text>
57
- </Flex>
58
-
59
- <Flex>
60
- <Icon name="Heart" size="1rem" />
61
- </Flex>
62
-
63
- <Flex>
64
- <Text letterSpacing="x5" size="1" uppercase>
65
- in Budapest
66
- </Text>
67
- </Flex>
68
- </Flex>
69
- </Flex>
70
-
71
- <Flex alignChildren="middle" direction="horizontal" gap="x4" margin="x4">
72
- <Flex>
73
- <Link color="gray-5" href="https://github.com/bitrise-io/bitkit" target="BitkitGithub">
74
- <Image src="https://img.shields.io/bitrise/32b14416be4b7b24?token=HajDQ5RghA58-GjGCjGPMA" />
75
- </Link>
76
- </Flex>
77
-
78
- <Flex>
79
- <Link color="gray-5" href="https://www.npmjs.com/package/@bitrise/bitkit" target="BitkitNPM">
80
- <Image src="https://img.shields.io/npm/v/@bitrise/bitkit" />
81
- </Link>
82
- </Flex>
83
- </Flex>
84
- </Flex>
85
- </Flex>
86
- );
87
- };
88
-
89
- export default Root;
@@ -1,4 +0,0 @@
1
- import { withRouter } from 'react-router-dom';
2
- import Root from './Root';
3
-
4
- export default withRouter(Root);
@@ -1,19 +0,0 @@
1
- import * as React from 'react';
2
- import { Route, Switch } from 'react-router-dom';
3
- import SectionAddonBeamSandbox from '../Documentation/Components/SectionAddonBeamSandbox';
4
- import SectionRibbonSandbox from '../Documentation/Components/SectionRibbonSandbox';
5
- import SectionStatusSandbox404 from '../Documentation/Components/SectionStatusSandbox404';
6
- import SectionStatusSandbox500 from '../Documentation/Components/SectionStatusSandbox500';
7
-
8
- const Sandbox = () => {
9
- return (
10
- <Switch>
11
- <Route component={SectionAddonBeamSandbox} path="/sandbox/addonbeam" />
12
- <Route component={SectionRibbonSandbox} path="/sandbox/ribbon" />
13
- <Route component={SectionStatusSandbox404} path="/sandbox/status404" />
14
- <Route component={SectionStatusSandbox500} path="/sandbox/status500" />
15
- </Switch>
16
- );
17
- };
18
-
19
- export default Sandbox;
@@ -1,20 +0,0 @@
1
- .Sandbox__iframe {
2
- width: 100%;
3
- border: none;
4
- }
5
-
6
- .Sandbox__frame-content {
7
- position: relative;
8
- padding-right: var(--size--x4);
9
- border-left: 0.0625rem solid var(--color-gray--2);
10
- }
11
-
12
- .Sandbox__frame-handle {
13
- position: absolute;
14
- top: 0;
15
- right: 0;
16
- bottom: 0;
17
- border-left: 0.0625rem solid var(--color-gray--2);
18
- background-color: var(--color-gray--1);
19
- cursor: col-resize;
20
- }
@@ -1,77 +0,0 @@
1
- import * as React from 'react';
2
- import { hooks, Flex, FlexProps, Icon } from '@bitrise/bitkit';
3
- import './SandboxFrame.css';
4
-
5
- const { useRef } = React;
6
- const { useEventListener } = hooks;
7
-
8
- interface Props extends FlexProps {
9
- minHeight: number | string;
10
- src: string;
11
- }
12
- const SandboxFrame = (props: Props) => {
13
- const { src, ...rest } = props;
14
- const refContainer = useRef<HTMLDivElement>();
15
- const refContent = useRef<HTMLDivElement>();
16
- const xStart = useRef<number>(0);
17
- const refContentWidth = useRef<number>(0);
18
- const isDragging = useRef<boolean>(false);
19
-
20
- const handleMouseDown = (event: React.MouseEvent) => {
21
- isDragging.current = true;
22
- xStart.current = event.clientX;
23
-
24
- if (refContainer.current) {
25
- refContainer.current.style.pointerEvents = 'none';
26
- }
27
-
28
- if (refContent.current) {
29
- refContentWidth.current = refContent.current.offsetWidth;
30
- }
31
- };
32
-
33
- useEventListener(document, 'mouseup', () => {
34
- isDragging.current = false;
35
-
36
- if (refContainer.current) {
37
- refContainer.current.style.pointerEvents = null;
38
- }
39
- });
40
-
41
- useEventListener(document, 'mousemove', ({ clientX }) => {
42
- if (isDragging.current && refContainer.current && refContent.current) {
43
- const containerWidth = refContainer.current.clientWidth;
44
- const dx = xStart.current - clientX;
45
- const p = Math.max(0, Math.min(1, (refContentWidth.current / 2 - dx) / (containerWidth / 2)));
46
-
47
- refContent.current.style.width = `${p * 100}%`;
48
- }
49
- });
50
-
51
- return (
52
- <Flex
53
- {...rest}
54
- alignChildrenHorizontal="middle"
55
- backgroundColor="black"
56
- className="Sandbox__frame"
57
- direction="horizontal"
58
- grow
59
- innerRef={refContainer}
60
- >
61
- <Flex className="Sandbox__frame-content" direction="horizontal" elevation="x2" innerRef={refContent} width="100%">
62
- <Flex Component="iframe" {...rest} className="Sandbox__iframe" grow src={src} />
63
-
64
- <Flex
65
- alignChildren="middle"
66
- className="Sandbox__frame-handle"
67
- direction="vertical"
68
- onMouseDown={handleMouseDown}
69
- >
70
- <Icon name="Pause" size="1rem" />
71
- </Flex>
72
- </Flex>
73
- </Flex>
74
- );
75
- };
76
-
77
- export default SandboxFrame;
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- import { Base, BaseProps } from '@bitrise/bitkit';
3
-
4
- const Section: React.SFC<BaseProps> = (props: BaseProps) => {
5
- return <Base {...props} margin="x4" />;
6
- };
7
-
8
- export default Section;
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- import { Text, TextProps } from '@bitrise/bitkit';
3
-
4
- const SectionSubTitle: React.SFC<TextProps> = (props: TextProps) => {
5
- return <Text {...props} margin="x3" size="2" uppercase />;
6
- };
7
-
8
- export default SectionSubTitle;
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- import { Text, TextProps } from '@bitrise/bitkit';
3
-
4
- const SectionTitle: React.SFC<TextProps> = (props: TextProps) => {
5
- return <Text {...props} margin="x6" size="5" textColor="grape-4" weight="bold" />;
6
- };
7
-
8
- export default SectionTitle;
@@ -1,39 +0,0 @@
1
- .SideMenu {
2
- color: var(--color-gray--5);
3
- transition-property: background-color;
4
- transition-duration: var(--transition-duration--fast);
5
- transition-timing-function: var(--transition-timing-function);
6
- }
7
-
8
- .SideMenu__link {
9
- cursor: pointer;
10
- }
11
-
12
- .SideMenu__link-text {
13
- padding: var(--size--x1) 0;
14
- border-bottom: 0.125rem solid transparent;
15
- transition-property: color;
16
- transition-duration: var(--transition-duration--fast);
17
- transition-timing-function: var(--transition-timing-function);
18
- }
19
-
20
- .SideMenu--active .SideMenu__link-text {
21
- border-bottom-color: var(--color-aqua--3);
22
- color: var(--color-aqua--3);
23
- }
24
-
25
- .SideMenu__item {
26
- display: block;
27
- margin-left: var(--size--x4);
28
- transition-property: color;
29
- transition-duration: var(--transition-duration--fast);
30
- transition-timing-function: var(--transition-timing-function);
31
-
32
- &:hover {
33
- color: var(--color-aqua--3);
34
- }
35
- }
36
-
37
- .SideMenu__item--active {
38
- border-bottom: 0.125rem solid var(--color-aqua--3);
39
- }
@@ -1,53 +0,0 @@
1
- import * as React from 'react';
2
- import { Link } from 'react-router-dom';
3
- import classnames from 'classnames';
4
- import { Base, BaseProps, Flex, Expand, Icon, Text, Visibility, VisibilityContainer } from '@bitrise/bitkit';
5
- import './SideMenu.css';
6
-
7
- interface Props extends BaseProps {
8
- active: boolean;
9
- children?: React.ReactNode;
10
- name: string;
11
- to?: string;
12
- }
13
-
14
- const SideMenu: React.SFC<Props> = (props: Props) => {
15
- const { active, children, name, to, ...rest } = props;
16
- const classes = classnames('SideMenu', {
17
- 'SideMenu--active': active,
18
- });
19
-
20
- return (
21
- <Base {...rest} className={classes} margin="x1">
22
- <VisibilityContainer
23
- Component={to ? Link : undefined}
24
- alignChildrenVertical="middle"
25
- className="SideMenu__link"
26
- direction="horizontal"
27
- enabled={!active}
28
- gap="x4"
29
- to={to}
30
- >
31
- <Flex grow initial="none">
32
- <Text className="SideMenu__link-text" inline>
33
- {name}
34
- </Text>
35
- </Flex>
36
-
37
- {children && (
38
- <Visibility Component={Flex}>
39
- <Icon name="ChevronDown" />
40
- </Visibility>
41
- )}
42
- </VisibilityContainer>
43
-
44
- {children && (
45
- <Expand className="SideMenu__items" expanded={active} paddingVertical="x2">
46
- {children}
47
- </Expand>
48
- )}
49
- </Base>
50
- );
51
- };
52
-
53
- export default SideMenu;
@@ -1,34 +0,0 @@
1
- import * as React from 'react';
2
- import classnames from 'classnames';
3
- import { Link } from 'react-router-dom';
4
- import { Base, BaseProps } from '@bitrise/bitkit';
5
-
6
- interface Props extends BaseProps {
7
- active: boolean;
8
- children: React.ReactNode;
9
- onClick?: (event: React.SyntheticEvent) => void;
10
- to?: string;
11
- }
12
-
13
- const SidebarMenuItem: React.SFC<Props> = (props: Props) => {
14
- const { active, children, onClick, to, ...rest } = props;
15
- const classes = classnames('SideMenu__item', {
16
- 'SideMenu__item--active': active,
17
- });
18
-
19
- const handleClick = (event: React.SyntheticEvent) => {
20
- event.stopPropagation();
21
-
22
- if (onClick) {
23
- onClick(event);
24
- }
25
- };
26
-
27
- return (
28
- <Base {...rest} Component={to ? Link : undefined} className={classes} onClick={handleClick} to={to}>
29
- {children}
30
- </Base>
31
- );
32
- };
33
-
34
- export default SidebarMenuItem;