@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.
- package/package.json +4 -1
- package/src/tsconfig.tsbuildinfo +1 -0
- 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 -996
- 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
- package/tsconfig.json +0 -25
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Button,
|
|
4
|
-
Buttons,
|
|
5
|
-
Flex,
|
|
6
|
-
Modal,
|
|
7
|
-
ModalTitle,
|
|
8
|
-
Text,
|
|
9
|
-
Tooltip,
|
|
10
|
-
ModalHeader,
|
|
11
|
-
ModalBody,
|
|
12
|
-
Icon,
|
|
13
|
-
ModalHeaderProgress,
|
|
14
|
-
} from '@bitrise/bitkit';
|
|
15
|
-
import Section from '../../Section/Section';
|
|
16
|
-
|
|
17
|
-
type ModalTypes =
|
|
18
|
-
| 'modalWithHeaderVisible'
|
|
19
|
-
| 'modalWithLotsOfContentVisible'
|
|
20
|
-
| 'modalWithProgressVisible'
|
|
21
|
-
| 'modalWithTitleVisible';
|
|
22
|
-
|
|
23
|
-
const { useState } = React;
|
|
24
|
-
|
|
25
|
-
const SectionModals = () => {
|
|
26
|
-
const [progress, setProgress] = useState(0);
|
|
27
|
-
const [state, setVisible] = useState<Record<ModalTypes, boolean>>({
|
|
28
|
-
modalWithHeaderVisible: false,
|
|
29
|
-
modalWithLotsOfContentVisible: false,
|
|
30
|
-
modalWithProgressVisible: false,
|
|
31
|
-
modalWithTitleVisible: false,
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
const handleCloseModal = (modalName: ModalTypes) => setVisible({ ...state, [modalName]: false });
|
|
35
|
-
const handleOpenModal = (modalName: ModalTypes) => setVisible({ ...state, [modalName]: true });
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<Section>
|
|
39
|
-
<Buttons margin="x2">
|
|
40
|
-
<Button level="primary" onClick={() => handleOpenModal('modalWithTitleVisible')}>
|
|
41
|
-
Open Modal with Title
|
|
42
|
-
</Button>
|
|
43
|
-
</Buttons>
|
|
44
|
-
|
|
45
|
-
<Buttons margin="x2">
|
|
46
|
-
<Button level="primary" onClick={() => handleOpenModal('modalWithHeaderVisible')}>
|
|
47
|
-
Open Modal with Header
|
|
48
|
-
</Button>
|
|
49
|
-
</Buttons>
|
|
50
|
-
|
|
51
|
-
<Buttons margin="x2">
|
|
52
|
-
<Button level="primary" onClick={() => handleOpenModal('modalWithProgressVisible')}>
|
|
53
|
-
Open Modal with Progress
|
|
54
|
-
</Button>
|
|
55
|
-
</Buttons>
|
|
56
|
-
|
|
57
|
-
<Buttons margin="x2">
|
|
58
|
-
<Button level="primary" onClick={() => handleOpenModal('modalWithLotsOfContentVisible')}>
|
|
59
|
-
Open Modal with lots of content
|
|
60
|
-
</Button>
|
|
61
|
-
</Buttons>
|
|
62
|
-
|
|
63
|
-
<Modal
|
|
64
|
-
backgroundColor="white"
|
|
65
|
-
onClose={() => handleCloseModal('modalWithTitleVisible')}
|
|
66
|
-
visible={state.modalWithTitleVisible}
|
|
67
|
-
width="28rem"
|
|
68
|
-
>
|
|
69
|
-
<ModalHeader />
|
|
70
|
-
<ModalBody>
|
|
71
|
-
<Flex direction="horizontal">
|
|
72
|
-
<Flex grow initial="none">
|
|
73
|
-
<ModalTitle>I protest your unauthorised presence!</ModalTitle>
|
|
74
|
-
<Text textColor="gray-7">I must protest your unauthorised presence on this bridge!</Text>
|
|
75
|
-
</Flex>
|
|
76
|
-
</Flex>
|
|
77
|
-
<Buttons alignChildrenHorizontal="end" margin="x6">
|
|
78
|
-
<Button level="secondary" onClick={() => handleCloseModal('modalWithTitleVisible')}>
|
|
79
|
-
Run
|
|
80
|
-
</Button>
|
|
81
|
-
|
|
82
|
-
<Tooltip title="Careful!" visible>
|
|
83
|
-
{({ ref }) => (
|
|
84
|
-
<Button
|
|
85
|
-
innerRef={ref}
|
|
86
|
-
level="primary"
|
|
87
|
-
onClick={() => handleCloseModal('modalWithTitleVisible')}
|
|
88
|
-
variant="danger"
|
|
89
|
-
>
|
|
90
|
-
Jump!
|
|
91
|
-
</Button>
|
|
92
|
-
)}
|
|
93
|
-
</Tooltip>
|
|
94
|
-
</Buttons>
|
|
95
|
-
</ModalBody>
|
|
96
|
-
</Modal>
|
|
97
|
-
|
|
98
|
-
<Modal
|
|
99
|
-
backgroundColor="white"
|
|
100
|
-
onClose={() => handleCloseModal('modalWithHeaderVisible')}
|
|
101
|
-
visible={state.modalWithHeaderVisible}
|
|
102
|
-
width="600px"
|
|
103
|
-
>
|
|
104
|
-
<ModalHeader alignChildrenVertical="middle" minHeight="4.5rem" paddingVertical="x0" withSeparator>
|
|
105
|
-
<Flex alignChildrenVertical="middle" direction="horizontal" gap="x2">
|
|
106
|
-
<Flex>
|
|
107
|
-
<Icon name="Bitbot" size="2rem" />
|
|
108
|
-
</Flex>
|
|
109
|
-
|
|
110
|
-
<Flex>
|
|
111
|
-
<Text letterSpacing="x3" size="4" textColor="grape-4" weight="bold">
|
|
112
|
-
Modals may have complex headers
|
|
113
|
-
</Text>
|
|
114
|
-
<Text size="1" textColor="gray-7" uppercase>
|
|
115
|
-
Even a subtitle fits in here!
|
|
116
|
-
</Text>
|
|
117
|
-
</Flex>
|
|
118
|
-
</Flex>
|
|
119
|
-
</ModalHeader>
|
|
120
|
-
|
|
121
|
-
<ModalBody>
|
|
122
|
-
<ModalTitle>And we can still use a Title for the content!</ModalTitle>
|
|
123
|
-
<Text color="gray-7">And make the body look however you'd like</Text>
|
|
124
|
-
<Flex alignChildrenHorizontal="end" direction="horizontal" margin="x6">
|
|
125
|
-
<Button level="primary" onClick={() => handleCloseModal('modalWithHeaderVisible')}>
|
|
126
|
-
Close
|
|
127
|
-
</Button>
|
|
128
|
-
</Flex>
|
|
129
|
-
</ModalBody>
|
|
130
|
-
</Modal>
|
|
131
|
-
|
|
132
|
-
<Modal
|
|
133
|
-
backgroundColor="white"
|
|
134
|
-
onClose={() => handleCloseModal('modalWithProgressVisible')}
|
|
135
|
-
visible={state.modalWithProgressVisible}
|
|
136
|
-
width="600px"
|
|
137
|
-
>
|
|
138
|
-
<ModalHeader alignChildrenVertical="middle" minHeight="4.5rem" paddingVertical="x0" withSeparator>
|
|
139
|
-
<Text size="5" textColor="grape-4" weight="bold">
|
|
140
|
-
Modal Header
|
|
141
|
-
</Text>
|
|
142
|
-
|
|
143
|
-
<ModalHeaderProgress progress={progress} />
|
|
144
|
-
</ModalHeader>
|
|
145
|
-
|
|
146
|
-
<ModalBody>
|
|
147
|
-
<Text margin="x4">Modal with a progress line inside the header, click next to see it progress!</Text>
|
|
148
|
-
|
|
149
|
-
<Buttons alignChildrenHorizontal="end">
|
|
150
|
-
{progress === 1 ? (
|
|
151
|
-
<Button
|
|
152
|
-
level="primary"
|
|
153
|
-
onClick={() => {
|
|
154
|
-
setProgress(0);
|
|
155
|
-
handleCloseModal('modalWithProgressVisible');
|
|
156
|
-
}}
|
|
157
|
-
>
|
|
158
|
-
Ok, cool
|
|
159
|
-
</Button>
|
|
160
|
-
) : (
|
|
161
|
-
<Button level="primary" onClick={() => setProgress(progress + 0.25)}>
|
|
162
|
-
Next!
|
|
163
|
-
</Button>
|
|
164
|
-
)}
|
|
165
|
-
</Buttons>
|
|
166
|
-
</ModalBody>
|
|
167
|
-
</Modal>
|
|
168
|
-
|
|
169
|
-
<Modal
|
|
170
|
-
backgroundColor="white"
|
|
171
|
-
onClose={() => handleCloseModal('modalWithLotsOfContentVisible')}
|
|
172
|
-
visible={state.modalWithLotsOfContentVisible}
|
|
173
|
-
width="600px"
|
|
174
|
-
>
|
|
175
|
-
<ModalHeader />
|
|
176
|
-
<ModalBody>
|
|
177
|
-
<ModalTitle>Modal Title</ModalTitle>
|
|
178
|
-
|
|
179
|
-
<Text margin="x2">
|
|
180
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque scelerisque arcu vitae nibh rutrum,
|
|
181
|
-
sit amet lobortis ligula rutrum. Quisque volutpat vitae mauris non interdum. Ut egestas, ex aliquam
|
|
182
|
-
hendrerit placerat, mi nisi sollicitudin elit, sit amet vulputate nisi leo a tortor. Pellentesque rhoncus
|
|
183
|
-
mattis nisl, vel efficitur libero euismod nec. Fusce sed tincidunt nisi. Sed porta odio risus, sagittis
|
|
184
|
-
venenatis lacus pharetra ut. Integer turpis leo, tempor vel est ut, viverra dignissim urna.
|
|
185
|
-
</Text>
|
|
186
|
-
|
|
187
|
-
<Text margin="x2">
|
|
188
|
-
Phasellus rhoncus consectetur risus efficitur finibus. Pellentesque in enim in lorem volutpat blandit sed
|
|
189
|
-
venenatis tortor. Praesent consectetur pellentesque risus eget elementum. Cras molestie dapibus nisl, in
|
|
190
|
-
consequat tellus sollicitudin id. Curabitur vitae molestie nunc. Mauris dapibus suscipit erat, vel tempus
|
|
191
|
-
tellus. Morbi mi dui, ornare et mattis eu, consequat ac tortor.
|
|
192
|
-
</Text>
|
|
193
|
-
|
|
194
|
-
<Text margin="x2">
|
|
195
|
-
Curabitur laoreet porta est eu fermentum. Nunc imperdiet porta leo, ac commodo nisi maximus eu. Morbi
|
|
196
|
-
ultricies sed ex ac fermentum. Sed posuere ex non lectus pretium viverra eu non arcu. Nullam vel auctor
|
|
197
|
-
tortor, non faucibus nunc. Vestibulum bibendum nibh quam, in faucibus lacus condimentum ac. Integer at
|
|
198
|
-
faucibus sapien. Phasellus fringilla magna neque, et sodales mauris semper et. Vestibulum aliquam, sem
|
|
199
|
-
gravida mollis hendrerit, felis dui rutrum lectus, eu congue metus neque id eros. Maecenas posuere nunc a
|
|
200
|
-
elit bibendum vulputate. Nam ut faucibus magna. Maecenas id dolor lacinia ipsum rhoncus pellentesque.
|
|
201
|
-
Maecenas nisl lectus, bibendum sit amet justo ut, vestibulum bibendum dolor. Nullam sodales ultrices congue.
|
|
202
|
-
Donec erat massa, consequat non tincidunt sagittis, lobortis vel odio.
|
|
203
|
-
</Text>
|
|
204
|
-
|
|
205
|
-
<Text margin="x2">
|
|
206
|
-
Fusce vitae semper nibh, et efficitur ipsum. Ut mattis sollicitudin nisl, sit amet gravida nibh ornare sed.
|
|
207
|
-
Cras quis turpis sem. Suspendisse eget urna ac quam varius ullamcorper et at erat. Fusce eleifend pulvinar
|
|
208
|
-
justo, non faucibus neque. Vivamus elementum convallis tempor. Suspendisse egestas nunc in erat commodo, sed
|
|
209
|
-
rutrum ante maximus. Orci varius natoque penatibus et magnis dis parturient montes, ]nascetur ridiculus mus.
|
|
210
|
-
Nam sapien lorem, finibus ac molestie ut, ultrices id purus.
|
|
211
|
-
</Text>
|
|
212
|
-
|
|
213
|
-
<Flex alignChildrenHorizontal="end" direction="horizontal" margin="x6">
|
|
214
|
-
<Button level="primary" onClick={() => handleCloseModal('modalWithLotsOfContentVisible')}>
|
|
215
|
-
Close
|
|
216
|
-
</Button>
|
|
217
|
-
</Flex>
|
|
218
|
-
</ModalBody>
|
|
219
|
-
</Modal>
|
|
220
|
-
</Section>
|
|
221
|
-
);
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
export default SectionModals;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Link, Notification } from '@bitrise/bitkit';
|
|
3
|
-
import CodeBlock from '../../CodeBlock/CodeBlock';
|
|
4
|
-
import Section from '../../Section/Section';
|
|
5
|
-
|
|
6
|
-
const SectionNotification = () => {
|
|
7
|
-
return (
|
|
8
|
-
<Section>
|
|
9
|
-
<Notification margin="x2" onRemove={() => {}} type="warning">
|
|
10
|
-
You need to setup publishing on the <Link underline>Settings page</Link>.
|
|
11
|
-
</Notification>
|
|
12
|
-
|
|
13
|
-
<Notification icon="Deployment" margin="x2" onRemove={() => {}} type="inform">
|
|
14
|
-
App is ready for publishing to App Store Connect.
|
|
15
|
-
</Notification>
|
|
16
|
-
|
|
17
|
-
<Notification margin="x2" onRemove={() => {}} type="alert">
|
|
18
|
-
Publish has failed. See the error log at the <Link underline>Activity tab</Link>.
|
|
19
|
-
</Notification>
|
|
20
|
-
|
|
21
|
-
<Notification margin="x2" onRemove={() => {}} type="success">
|
|
22
|
-
App has successfully published to <Link underline>App Store Connect</Link>
|
|
23
|
-
</Notification>
|
|
24
|
-
|
|
25
|
-
<Notification margin="x2" onRemove={() => {}} type="progress">
|
|
26
|
-
Publishing to App Store Connect is in progress.
|
|
27
|
-
</Notification>
|
|
28
|
-
|
|
29
|
-
<CodeBlock title="Notification usage example">{`const Component = () => (
|
|
30
|
-
<Notification margin="x2" onRemove={ () => {} } type="progress">
|
|
31
|
-
Publishing to App Store Connect is in progress.
|
|
32
|
-
</Notification>
|
|
33
|
-
);`}</CodeBlock>
|
|
34
|
-
</Section>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default SectionNotification;
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Button,
|
|
4
|
-
DropdownMenu,
|
|
5
|
-
DropdownMenuItem,
|
|
6
|
-
Icon,
|
|
7
|
-
Placement,
|
|
8
|
-
PlacementArea,
|
|
9
|
-
PlacementManager,
|
|
10
|
-
PlacementReference,
|
|
11
|
-
Tab,
|
|
12
|
-
Tabs,
|
|
13
|
-
} from '@bitrise/bitkit';
|
|
14
|
-
import CodeBlock from '../../CodeBlock/CodeBlock';
|
|
15
|
-
import Section from '../../Section/Section';
|
|
16
|
-
|
|
17
|
-
const { useState } = React;
|
|
18
|
-
|
|
19
|
-
const SectionPlacement = () => {
|
|
20
|
-
const [visible, setVisible] = useState(false);
|
|
21
|
-
const [selectedTab, setSelectedTab] = useState(1);
|
|
22
|
-
const [ref, setRef] = useState<SVGSVGElement>();
|
|
23
|
-
|
|
24
|
-
const handleToggle = () => {
|
|
25
|
-
setVisible(!visible);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<Section>
|
|
30
|
-
<Tabs gap="x6" margin="x8">
|
|
31
|
-
<Tab active={selectedTab === 1} onClick={() => setSelectedTab(1)}>
|
|
32
|
-
Placement Reference
|
|
33
|
-
</Tab>
|
|
34
|
-
|
|
35
|
-
<Tab active={selectedTab === 2} onClick={() => setSelectedTab(2)}>
|
|
36
|
-
Reference Element
|
|
37
|
-
</Tab>
|
|
38
|
-
</Tabs>
|
|
39
|
-
|
|
40
|
-
{selectedTab === 1 && (
|
|
41
|
-
<>
|
|
42
|
-
<PlacementManager>
|
|
43
|
-
<PlacementReference>
|
|
44
|
-
{/* eslint-disable-next-line @typescript-eslint/no-shadow */}
|
|
45
|
-
{({ ref }) => (
|
|
46
|
-
<Button innerRef={ref} level="primary" onClick={handleToggle}>
|
|
47
|
-
<Icon name="More" />
|
|
48
|
-
</Button>
|
|
49
|
-
)}
|
|
50
|
-
</PlacementReference>
|
|
51
|
-
|
|
52
|
-
<Placement
|
|
53
|
-
onClose={(event: MouseEvent) => {
|
|
54
|
-
console.log('Placement closed via event', event);
|
|
55
|
-
handleToggle();
|
|
56
|
-
}}
|
|
57
|
-
visible={visible}
|
|
58
|
-
>
|
|
59
|
-
{() => (
|
|
60
|
-
<DropdownMenu withArrow>
|
|
61
|
-
<DropdownMenuItem icon="Percent" onClick={handleToggle}>
|
|
62
|
-
Refer your friends
|
|
63
|
-
</DropdownMenuItem>
|
|
64
|
-
|
|
65
|
-
<DropdownMenuItem icon="Settings" onClick={handleToggle}>
|
|
66
|
-
Account setings
|
|
67
|
-
</DropdownMenuItem>
|
|
68
|
-
|
|
69
|
-
<DropdownMenuItem icon="ChangePlan" onClick={handleToggle}>
|
|
70
|
-
Change plan
|
|
71
|
-
</DropdownMenuItem>
|
|
72
|
-
|
|
73
|
-
<DropdownMenuItem icon="Logout" onClick={handleToggle}>
|
|
74
|
-
Log out
|
|
75
|
-
</DropdownMenuItem>
|
|
76
|
-
</DropdownMenu>
|
|
77
|
-
)}
|
|
78
|
-
</Placement>
|
|
79
|
-
</PlacementManager>
|
|
80
|
-
|
|
81
|
-
<CodeBlock margin="x4" title="PlacementReference Example">{`const Component = () => {
|
|
82
|
-
const [visible, setVisible] = React.useState(false);
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<PlacementManager>
|
|
86
|
-
<PlacementReference>
|
|
87
|
-
{ ({ ref }) => (
|
|
88
|
-
<Button
|
|
89
|
-
innerRef={ ref }
|
|
90
|
-
level="primary"
|
|
91
|
-
onClick={ () => setVisible(true) }>
|
|
92
|
-
<Icon name="More" />
|
|
93
|
-
</Button>
|
|
94
|
-
) }
|
|
95
|
-
</PlacementReference>
|
|
96
|
-
|
|
97
|
-
<Placement onClose={ () => setVisible(false) } visible={ visible }>
|
|
98
|
-
{ () => (
|
|
99
|
-
<DropdownMenu withArrow>
|
|
100
|
-
<DropdownMenuItem icon="Percent">
|
|
101
|
-
Refer your friends
|
|
102
|
-
</DropdownMenuItem>
|
|
103
|
-
|
|
104
|
-
<DropdownMenuItem icon="Settings">
|
|
105
|
-
Account setings
|
|
106
|
-
</DropdownMenuItem>
|
|
107
|
-
|
|
108
|
-
<DropdownMenuItem icon="ChangePlan">
|
|
109
|
-
Change plan
|
|
110
|
-
</DropdownMenuItem>
|
|
111
|
-
|
|
112
|
-
<DropdownMenuItem icon="Logout">
|
|
113
|
-
Log out
|
|
114
|
-
</DropdownMenuItem>
|
|
115
|
-
</DropdownMenu>
|
|
116
|
-
) }
|
|
117
|
-
</Placement>
|
|
118
|
-
</PlacementManager>
|
|
119
|
-
);
|
|
120
|
-
};`}</CodeBlock>
|
|
121
|
-
</>
|
|
122
|
-
)}
|
|
123
|
-
|
|
124
|
-
{selectedTab === 2 && (
|
|
125
|
-
<>
|
|
126
|
-
<Icon innerRef={setRef} name="Bitbot" size="4rem" />
|
|
127
|
-
|
|
128
|
-
<Placement backgroundColor="black" placement="right" referenceElement={ref} textColor="white" visible={!!ref}>
|
|
129
|
-
{() => (
|
|
130
|
-
<PlacementArea padding="x3" withArrow>
|
|
131
|
-
Hi, I'm Bitbot 👋
|
|
132
|
-
</PlacementArea>
|
|
133
|
-
)}
|
|
134
|
-
</Placement>
|
|
135
|
-
|
|
136
|
-
<CodeBlock margin="x4" title="Pre-existing Reference Element">{`const Component = () => {
|
|
137
|
-
const [ref, setRef] = React.useState();
|
|
138
|
-
|
|
139
|
-
return (
|
|
140
|
-
<React.Fragment>
|
|
141
|
-
<Icon
|
|
142
|
-
innerRef={ setRef }
|
|
143
|
-
name="Bitbot"
|
|
144
|
-
size="4rem" />
|
|
145
|
-
|
|
146
|
-
<Placement
|
|
147
|
-
backgroundColor="black"
|
|
148
|
-
placement="right"
|
|
149
|
-
referenceElement={ ref }
|
|
150
|
-
textColor="white"
|
|
151
|
-
visible={ !!ref }>
|
|
152
|
-
{ () => (
|
|
153
|
-
<PlacementArea padding="x3" withArrow>
|
|
154
|
-
Hi, I'm Bitbot 👋
|
|
155
|
-
</PlacementArea>
|
|
156
|
-
) }
|
|
157
|
-
</Placement>
|
|
158
|
-
</React.Fragment>
|
|
159
|
-
);
|
|
160
|
-
};`}</CodeBlock>
|
|
161
|
-
</>
|
|
162
|
-
)}
|
|
163
|
-
</Section>
|
|
164
|
-
);
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
export default SectionPlacement;
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
hooks,
|
|
4
|
-
Base,
|
|
5
|
-
Buttons,
|
|
6
|
-
ProgressBar,
|
|
7
|
-
ProgressButton,
|
|
8
|
-
ProgressColorButton,
|
|
9
|
-
ProgressBitbot,
|
|
10
|
-
ProgressSpinner,
|
|
11
|
-
Flex,
|
|
12
|
-
Text,
|
|
13
|
-
Icon,
|
|
14
|
-
} from '@bitrise/bitkit';
|
|
15
|
-
import Section from '../../Section/Section';
|
|
16
|
-
import SectionSubTitle from '../../Section/SectionSubTitle';
|
|
17
|
-
|
|
18
|
-
const { useRef, useState } = React;
|
|
19
|
-
const { useMediaQuery } = hooks;
|
|
20
|
-
|
|
21
|
-
const SectionProgress = () => {
|
|
22
|
-
const match = useMediaQuery(['896px']);
|
|
23
|
-
const refTimeout = useRef(0);
|
|
24
|
-
const [progress, setProgress] = useState(0);
|
|
25
|
-
const [progressing1, setProgressing1] = useState(false);
|
|
26
|
-
const [progressing2, setProgressing2] = useState(false);
|
|
27
|
-
const [progressing3, setProgressing3] = useState(false);
|
|
28
|
-
const [progressing4, setProgressing4] = useState(false);
|
|
29
|
-
const [progressing5, setProgressing5] = useState(false);
|
|
30
|
-
|
|
31
|
-
React.useEffect(() => {
|
|
32
|
-
refTimeout.current = window.setTimeout(
|
|
33
|
-
() => {
|
|
34
|
-
setProgress(progress < 1 ? progress + Math.random() * (0.1 - 0.05) + 0.05 : 0);
|
|
35
|
-
},
|
|
36
|
-
progress < 1 ? Math.random() * (500 - 250) + 250 : 1000,
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
return () => {
|
|
40
|
-
window.clearTimeout(refTimeout.current);
|
|
41
|
-
};
|
|
42
|
-
}, [progress]);
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<Section>
|
|
46
|
-
<Base margin="x6">
|
|
47
|
-
<SectionSubTitle>Indeterminate progress Bitbot</SectionSubTitle>
|
|
48
|
-
|
|
49
|
-
<Flex direction={match('896px') ? 'horizontal' : 'vertical'} gap="x4">
|
|
50
|
-
<Flex backgroundColor="gray-1" grow padding="x6">
|
|
51
|
-
<ProgressBitbot content="Loading something..." size="64px" textColor="grape-3" />
|
|
52
|
-
</Flex>
|
|
53
|
-
|
|
54
|
-
<Flex backgroundColor="grape-5" grow padding="x6">
|
|
55
|
-
<ProgressBitbot content="Loading user settings..." size="64px" textColor="gray-1" />
|
|
56
|
-
</Flex>
|
|
57
|
-
|
|
58
|
-
<Flex backgroundColor="gray-1" grow padding="x6">
|
|
59
|
-
<ProgressBitbot content="Loading your apps..." size="64px" textColor="aqua-3" />
|
|
60
|
-
</Flex>
|
|
61
|
-
</Flex>
|
|
62
|
-
</Base>
|
|
63
|
-
|
|
64
|
-
<Base margin="x12">
|
|
65
|
-
<SectionSubTitle>Indeterminate progress spinner</SectionSubTitle>
|
|
66
|
-
|
|
67
|
-
<Flex direction={match('896px') ? 'horizontal' : 'vertical'} gap="x4">
|
|
68
|
-
<Flex backgroundColor="gray-1" grow padding="x6">
|
|
69
|
-
<ProgressSpinner size="2rem" textColor="grape-3" />
|
|
70
|
-
</Flex>
|
|
71
|
-
|
|
72
|
-
<Flex backgroundColor="grape-5" grow padding="x6">
|
|
73
|
-
<ProgressSpinner size="2rem" textColor="gray-1" />
|
|
74
|
-
</Flex>
|
|
75
|
-
|
|
76
|
-
<Flex backgroundColor="gray-1" grow padding="x6">
|
|
77
|
-
<ProgressSpinner size="2rem" textColor="aqua-3" />
|
|
78
|
-
</Flex>
|
|
79
|
-
</Flex>
|
|
80
|
-
</Base>
|
|
81
|
-
|
|
82
|
-
<Base margin="x12">
|
|
83
|
-
<SectionSubTitle>Indeterminate progress buttons (Press them to toggle the states)</SectionSubTitle>
|
|
84
|
-
|
|
85
|
-
<Buttons>
|
|
86
|
-
<ProgressButton level="primary" onClick={() => setProgressing1(!progressing1)} progressing={progressing1}>
|
|
87
|
-
Primary
|
|
88
|
-
</ProgressButton>
|
|
89
|
-
|
|
90
|
-
<ProgressButton
|
|
91
|
-
level="primary"
|
|
92
|
-
onClick={() => setProgressing2(!progressing2)}
|
|
93
|
-
progressing={progressing2}
|
|
94
|
-
variant="danger"
|
|
95
|
-
>
|
|
96
|
-
Danger!
|
|
97
|
-
</ProgressButton>
|
|
98
|
-
|
|
99
|
-
<ProgressButton level="secondary" onClick={() => setProgressing3(!progressing3)} progressing={progressing3}>
|
|
100
|
-
Secondary
|
|
101
|
-
</ProgressButton>
|
|
102
|
-
|
|
103
|
-
<ProgressColorButton
|
|
104
|
-
color="blue"
|
|
105
|
-
onClick={() => setProgressing4(!progressing4)}
|
|
106
|
-
progressing={progressing4}
|
|
107
|
-
size="medium"
|
|
108
|
-
>
|
|
109
|
-
Color button
|
|
110
|
-
</ProgressColorButton>
|
|
111
|
-
|
|
112
|
-
<ProgressButton level="primary" onClick={() => setProgressing5(!progressing5)} progressing={progressing5}>
|
|
113
|
-
<Icon name="App" />
|
|
114
|
-
<span>Button with icon</span>
|
|
115
|
-
</ProgressButton>
|
|
116
|
-
</Buttons>
|
|
117
|
-
</Base>
|
|
118
|
-
|
|
119
|
-
<Base margin="x12">
|
|
120
|
-
<SectionSubTitle>Determinate progress bar</SectionSubTitle>
|
|
121
|
-
|
|
122
|
-
<Text>Without stripes</Text>
|
|
123
|
-
|
|
124
|
-
<ProgressBar
|
|
125
|
-
backgroundColor="gray-2"
|
|
126
|
-
borderRadius="x2"
|
|
127
|
-
foregroundColor="grape-3"
|
|
128
|
-
height="8px"
|
|
129
|
-
margin="x2"
|
|
130
|
-
progress={progress}
|
|
131
|
-
/>
|
|
132
|
-
|
|
133
|
-
<Text>With stripes</Text>
|
|
134
|
-
|
|
135
|
-
<ProgressBar
|
|
136
|
-
backgroundColor="gray-2"
|
|
137
|
-
borderRadius="x2"
|
|
138
|
-
foregroundColor="aqua-3"
|
|
139
|
-
height="8px"
|
|
140
|
-
margin="x2"
|
|
141
|
-
progress={progress}
|
|
142
|
-
stripeColor="gray-1"
|
|
143
|
-
/>
|
|
144
|
-
</Base>
|
|
145
|
-
</Section>
|
|
146
|
-
);
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
export default SectionProgress;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { hooks, Flex, RadioButton } from '@bitrise/bitkit';
|
|
3
|
-
import Section from '../../Section/Section';
|
|
4
|
-
import SectionSubTitle from '../../Section/SectionSubTitle';
|
|
5
|
-
import CodeBlock from '../../CodeBlock/CodeBlock';
|
|
6
|
-
|
|
7
|
-
const { useMediaQuery } = hooks;
|
|
8
|
-
|
|
9
|
-
const SectionFormElements = () => {
|
|
10
|
-
const match = useMediaQuery(['896px']);
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<Section>
|
|
14
|
-
<Flex direction={match('896px') ? 'horizontal' : 'vertical'} gap="x12" margin="x12">
|
|
15
|
-
<Flex grow initial={match('896px') ? 'none' : 'content'}>
|
|
16
|
-
<SectionSubTitle>Checked RadioButton</SectionSubTitle>
|
|
17
|
-
<RadioButton defaultChecked>RadioButton label</RadioButton>
|
|
18
|
-
</Flex>
|
|
19
|
-
|
|
20
|
-
<Flex grow initial={match('896px') ? 'none' : 'content'}>
|
|
21
|
-
<SectionSubTitle>Unchecked RadioButton</SectionSubTitle>
|
|
22
|
-
<RadioButton>RadioButton label</RadioButton>
|
|
23
|
-
</Flex>
|
|
24
|
-
|
|
25
|
-
<Flex grow initial={match('896px') ? 'none' : 'content'}>
|
|
26
|
-
<SectionSubTitle>Disabled RadioButton</SectionSubTitle>
|
|
27
|
-
<RadioButton disabled>RadioButton label</RadioButton>
|
|
28
|
-
</Flex>
|
|
29
|
-
</Flex>
|
|
30
|
-
|
|
31
|
-
<CodeBlock title="RadioButton usage example">{`const Component = () => (
|
|
32
|
-
<RadioButton>RadioButton label</RadioButton>
|
|
33
|
-
);`}</CodeBlock>
|
|
34
|
-
</Section>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default SectionFormElements;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import CodeBlock from '../../CodeBlock/CodeBlock';
|
|
4
|
-
import Section from '../../Section/Section';
|
|
5
|
-
import Window from '../../Window/Window';
|
|
6
|
-
import SandboxFrame from '../../Sandbox/SandboxFrame';
|
|
7
|
-
|
|
8
|
-
const SectionRibbon = () => {
|
|
9
|
-
return (
|
|
10
|
-
<Section>
|
|
11
|
-
<Window
|
|
12
|
-
backgroundColor="gray-1"
|
|
13
|
-
borderColor="gray-2"
|
|
14
|
-
borderWidth="x1"
|
|
15
|
-
elevation="x2"
|
|
16
|
-
textColor="grape-5"
|
|
17
|
-
title="Responsive Ribbon"
|
|
18
|
-
>
|
|
19
|
-
<SandboxFrame minHeight="200px" src="/sandbox/ribbon" />
|
|
20
|
-
</Window>
|
|
21
|
-
|
|
22
|
-
<CodeBlock title="Ribbon usage example">{`const Component = () => (
|
|
23
|
-
<Ribbon type="warning" onRemove={ () => {} }>
|
|
24
|
-
<Text align="middle">
|
|
25
|
-
Ribbon text.
|
|
26
|
-
</Text>
|
|
27
|
-
</Ribbon>
|
|
28
|
-
);`}</CodeBlock>
|
|
29
|
-
</Section>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export default SectionRibbon;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Ribbon, Link, Text } from '@bitrise/bitkit';
|
|
3
|
-
import Section from '../../Section/Section';
|
|
4
|
-
|
|
5
|
-
const SectionRibbonSandbox = () => {
|
|
6
|
-
return (
|
|
7
|
-
<Section>
|
|
8
|
-
<Ribbon onRemove={() => {}} type="warning">
|
|
9
|
-
<Text align="middle">
|
|
10
|
-
13 days, 3 hours and 25 minutes left from your two-week Development trial. <Link underline>More info</Link>
|
|
11
|
-
</Text>
|
|
12
|
-
</Ribbon>
|
|
13
|
-
</Section>
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default SectionRibbonSandbox;
|