@bitrise/bitkit 9.5.1 → 9.5.3
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 +5 -1
- package/src/tsconfig.tsbuildinfo +1 -0
- package/src/variables.css +141 -1
- package/.browserslistrc +0 -2
- package/.editorconfig +0 -4
- package/.eslint-tsconfig.json +0 -7
- package/.eslintrc.js +0 -28
- package/.husky/commit-msg +0 -4
- package/.nvmrc +0 -1
- package/.storybook/main.js +0 -35
- package/.storybook/manager.js +0 -6
- package/.storybook/preview.tsx +0 -20
- package/.storybook/theme.js +0 -7
- package/.stylelintignore +0 -2
- package/.stylelintrc +0 -287
- package/.svgrrc.js +0 -52
- package/.tool-versions +0 -1
- package/@types/@bitrise/bitkit.ts +0 -1
- package/@types/react-docgen.ts +0 -119
- package/CHANGELOG.md +0 -989
- package/CONTRIBUTING.md +0 -79
- package/FAQ.md +0 -19
- package/bitrise.yml +0 -66
- package/commitlint.config.js +0 -10
- package/jest.setup.js +0 -36
- package/netlify.toml +0 -42
- package/postcss.config.js +0 -16
- package/release.config.js +0 -32
- package/renovate.json +0 -6
- package/scripts/build-docs-watch.ts +0 -7
- package/scripts/build-docs.ts +0 -59
- package/site/assets/fonts/TT_Norms_Pro_Bold.woff +0 -0
- package/site/assets/fonts/TT_Norms_Pro_Normal.woff +0 -0
- package/site/assets/icons/favicon-32x32.png +0 -0
- package/site/assets/images/app_icon.jpg +0 -0
- package/site/assets/images/status-checks.png +0 -0
- package/site/components/CodeBlock/CodeBlock.css +0 -87
- package/site/components/CodeBlock/CodeBlock.tsx +0 -35
- package/site/components/Documentation/ComponentDocumentationPage.tsx +0 -150
- package/site/components/Documentation/Components/SectionAddonBeam.tsx +0 -47
- package/site/components/Documentation/Components/SectionAddonBeamSandbox.tsx +0 -32
- package/site/components/Documentation/Components/SectionAddonFooter.tsx +0 -22
- package/site/components/Documentation/Components/SectionAppear.tsx +0 -59
- package/site/components/Documentation/Components/SectionAvatar.tsx +0 -50
- package/site/components/Documentation/Components/SectionBadge.tsx +0 -38
- package/site/components/Documentation/Components/SectionBase.tsx +0 -17
- package/site/components/Documentation/Components/SectionButtons.tsx +0 -361
- package/site/components/Documentation/Components/SectionCards.tsx +0 -276
- package/site/components/Documentation/Components/SectionCheckbox.tsx +0 -38
- package/site/components/Documentation/Components/SectionDatePicker.tsx +0 -82
- package/site/components/Documentation/Components/SectionDivider.tsx +0 -31
- package/site/components/Documentation/Components/SectionDot.tsx +0 -27
- package/site/components/Documentation/Components/SectionDropdowns.tsx +0 -388
- package/site/components/Documentation/Components/SectionExpand.tsx +0 -143
- package/site/components/Documentation/Components/SectionFlex.tsx +0 -33
- package/site/components/Documentation/Components/SectionFormElements.tsx +0 -187
- package/site/components/Documentation/Components/SectionGrid.tsx +0 -125
- package/site/components/Documentation/Components/SectionHamburger.tsx +0 -34
- package/site/components/Documentation/Components/SectionIcons.tsx +0 -30
- package/site/components/Documentation/Components/SectionInputs.tsx +0 -89
- package/site/components/Documentation/Components/SectionList.tsx +0 -26
- package/site/components/Documentation/Components/SectionModals.tsx +0 -224
- package/site/components/Documentation/Components/SectionNotification.tsx +0 -38
- package/site/components/Documentation/Components/SectionPlacement.tsx +0 -167
- package/site/components/Documentation/Components/SectionProgress.tsx +0 -149
- package/site/components/Documentation/Components/SectionRadioButton.tsx +0 -38
- package/site/components/Documentation/Components/SectionRibbon.tsx +0 -33
- package/site/components/Documentation/Components/SectionRibbonSandbox.tsx +0 -17
- package/site/components/Documentation/Components/SectionSidebar.tsx +0 -125
- package/site/components/Documentation/Components/SectionSkeleton.tsx +0 -99
- package/site/components/Documentation/Components/SectionStatus.tsx +0 -53
- package/site/components/Documentation/Components/SectionStatusSandbox404.tsx +0 -42
- package/site/components/Documentation/Components/SectionStatusSandbox500.tsx +0 -13
- package/site/components/Documentation/Components/SectionTable.tsx +0 -83
- package/site/components/Documentation/Components/SectionTabs.tsx +0 -25
- package/site/components/Documentation/Components/SectionText.tsx +0 -34
- package/site/components/Documentation/Components/SectionTextarea.tsx +0 -43
- package/site/components/Documentation/Components/SectionToggle.tsx +0 -50
- package/site/components/Documentation/Components/SectionTooltips.tsx +0 -50
- package/site/components/Documentation/Documentation.tsx +0 -302
- package/site/components/Documentation/Materials/SectionColors.css +0 -33
- package/site/components/Documentation/Materials/SectionColors.tsx +0 -197
- package/site/components/Documentation/Materials/SectionIcons.tsx +0 -106
- package/site/components/Documentation/Materials/SectionTypography.tsx +0 -143
- package/site/components/Page/Page.tsx +0 -8
- package/site/components/Page/PageTitle.tsx +0 -8
- package/site/components/PropsTable/PropsTable.tsx +0 -35
- package/site/components/PropsTable/PropsTableCellUnion.tsx +0 -29
- package/site/components/PropsTable/PropsTableRow.tsx +0 -55
- package/site/components/Root/Root.tsx +0 -89
- package/site/components/Root/index.tsx +0 -4
- package/site/components/Sandbox/Sandbox.tsx +0 -19
- package/site/components/Sandbox/SandboxFrame.css +0 -20
- package/site/components/Sandbox/SandboxFrame.tsx +0 -77
- package/site/components/Section/Section.tsx +0 -8
- package/site/components/Section/SectionSubTitle.tsx +0 -8
- package/site/components/Section/SectionTitle.tsx +0 -8
- package/site/components/SideMenu/SideMenu.css +0 -39
- package/site/components/SideMenu/SideMenu.tsx +0 -53
- package/site/components/SideMenu/SideMenuItem.tsx +0 -34
- package/site/components/Window/Window.tsx +0 -62
- package/site/index.css +0 -11
- package/site/index.html +0 -16
- package/site/index.tsx +0 -16
- package/superstatic.json +0 -13
|
@@ -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 { 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,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 { 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;
|