@bitrise/bitkit 10.0.2 → 10.1.0-alpha-chakra.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 +23 -57
- package/src/Components/Dialog/Dialog.tsx +1 -0
- package/src/Components/Tabs/Tab.tsx +2 -24
- package/src/Old/DatePicker/DatePicker.tsx +6 -6
- package/src/Old/DatePicker/DatePickerMonth.tsx +7 -7
- package/src/Old/Dropdown/Dropdown.tsx +3 -5
- package/src/Old/Dropdown/DropdownButton.tsx +2 -16
- package/src/Old/Dropdown/DropdownMenuItem.tsx +1 -2
- package/src/Old/Dropdown/DropdownMenuItemGroup.tsx +2 -2
- package/src/Old/Input/InputLabel.tsx +5 -3
- package/src/Old/Notification/Notification.tsx +3 -4
- package/src/Old/Notification/__snapshots__/Notification.test.tsx.snap +8 -12
- package/src/Old/Progress/ProgressBitbot.tsx +3 -3
- package/src/Old/Ribbon/Ribbon.tsx +4 -4
- package/src/Old/Status/Status404.tsx +3 -3
- package/src/Old/Status/Status500.tsx +4 -4
- package/src/Old/Table/TableHeaderCell.tsx +1 -1
- package/src/Old/Text/TextSizes.css +0 -39
- package/src/Old/Toggle/Toggle.tsx +1 -1
- package/src/Old/hooks/index.ts +0 -1
- package/src/Old/variables.css +0 -1
- package/src/Old/variables.ts +0 -3
- package/src/index.ts +0 -3
- package/src/old.ts +0 -64
- package/src/tsconfig.tsbuildinfo +1 -1
- package/src/Components/Transitions/Fade.stories.tsx +0 -26
- package/src/Components/Transitions/Fade.tsx +0 -12
- package/src/Old/AddonBeam/AddonBeam.css +0 -16
- package/src/Old/AddonBeam/AddonBeam.tsx +0 -117
- package/src/Old/AddonBeam/AddonBeamLink.tsx +0 -37
- package/src/Old/AddonFooter/AddonFooter.tsx +0 -24
- package/src/Old/AppLayout/AppLayout.css +0 -45
- package/src/Old/AppLayout/AppLayout.tsx +0 -21
- package/src/Old/AppLayout/AppLayoutBody.tsx +0 -10
- package/src/Old/AppLayout/AppLayoutHeader.tsx +0 -10
- package/src/Old/AppLayout/AppLayoutMain.tsx +0 -10
- package/src/Old/AppLayout/AppLayoutSidebar.tsx +0 -10
- package/src/Old/Avatar/Avatar.css +0 -4
- package/src/Old/Avatar/Avatar.tsx +0 -64
- package/src/Old/Avatar/avatarColors.ts +0 -26
- package/src/Old/Bounds/Bounds.tsx +0 -20
- package/src/Old/Button/Button.css +0 -249
- package/src/Old/Button/Button.test.tsx +0 -29
- package/src/Old/Button/Button.tsx +0 -55
- package/src/Old/Button/ButtonSize.ts +0 -3
- package/src/Old/Button/Buttons.test.tsx +0 -42
- package/src/Old/Button/Buttons.tsx +0 -34
- package/src/Old/Button/__snapshots__/Button.test.tsx.snap +0 -73
- package/src/Old/Button/__snapshots__/Buttons.test.tsx.snap +0 -45
- package/src/Old/ExternalLink/ExternalLink.tsx +0 -24
- package/src/Old/Icon/Icon.css +0 -4
- package/src/Old/Icon/Icon.tsx +0 -32
- package/src/Old/Icon/tsx/IconsAddOns.tsx +0 -14
- package/src/Old/Icon/tsx/IconsAddOnsColorTuorqouise.tsx +0 -20
- package/src/Old/Icon/tsx/IconsAddOnsColorViolet.tsx +0 -20
- package/src/Old/Icon/tsx/IconsAddOnsWhite.tsx +0 -20
- package/src/Old/Icon/tsx/IconsApp.tsx +0 -16
- package/src/Old/Icon/tsx/IconsArrowBack.tsx +0 -14
- package/src/Old/Icon/tsx/IconsArrowDown.tsx +0 -21
- package/src/Old/Icon/tsx/IconsArrowForward.tsx +0 -16
- package/src/Old/Icon/tsx/IconsArrowQuit.tsx +0 -14
- package/src/Old/Icon/tsx/IconsArrowUp.tsx +0 -14
- package/src/Old/Icon/tsx/IconsBackArrow.tsx +0 -13
- package/src/Old/Icon/tsx/IconsBell.tsx +0 -16
- package/src/Old/Icon/tsx/IconsBitbot.tsx +0 -16
- package/src/Old/Icon/tsx/IconsBitbotFailed.tsx +0 -18
- package/src/Old/Icon/tsx/IconsBitbucket.tsx +0 -26
- package/src/Old/Icon/tsx/IconsBitbucketFill.tsx +0 -14
- package/src/Old/Icon/tsx/IconsBitriseCertified.tsx +0 -19
- package/src/Old/Icon/tsx/IconsBook.tsx +0 -16
- package/src/Old/Icon/tsx/IconsBranchBranch.tsx +0 -16
- package/src/Old/Icon/tsx/IconsBranchCommit.tsx +0 -14
- package/src/Old/Icon/tsx/IconsBranchPull.tsx +0 -16
- package/src/Old/Icon/tsx/IconsBranchPush.tsx +0 -21
- package/src/Old/Icon/tsx/IconsBranchTag.tsx +0 -16
- package/src/Old/Icon/tsx/IconsBug.tsx +0 -16
- package/src/Old/Icon/tsx/IconsBuild.tsx +0 -14
- package/src/Old/Icon/tsx/IconsBuildstatusAborted.tsx +0 -16
- package/src/Old/Icon/tsx/IconsBuildstatusAbortedSolid.tsx +0 -15
- package/src/Old/Icon/tsx/IconsBuildstatusFailed.tsx +0 -16
- package/src/Old/Icon/tsx/IconsBuildstatusFailedSolid.tsx +0 -15
- package/src/Old/Icon/tsx/IconsBuildstatusLoading.tsx +0 -13
- package/src/Old/Icon/tsx/IconsBuildstatusLoadingAnimated.tsx +0 -31
- package/src/Old/Icon/tsx/IconsBuildstatusLoadingeeehh.tsx +0 -13
- package/src/Old/Icon/tsx/IconsBuildstatusLoadingeeehhWhite.tsx +0 -13
- package/src/Old/Icon/tsx/IconsBuildstatusNeverbuilt.tsx +0 -14
- package/src/Old/Icon/tsx/IconsBuildstatusSuccessful.tsx +0 -16
- package/src/Old/Icon/tsx/IconsBuildstatusSuccessfulSolid.tsx +0 -15
- package/src/Old/Icon/tsx/IconsCalendar.tsx +0 -16
- package/src/Old/Icon/tsx/IconsChain.tsx +0 -16
- package/src/Old/Icon/tsx/IconsChangePlan.tsx +0 -14
- package/src/Old/Icon/tsx/IconsChat.tsx +0 -14
- package/src/Old/Icon/tsx/IconsChatMessage.tsx +0 -16
- package/src/Old/Icon/tsx/IconsChevronDown.tsx +0 -13
- package/src/Old/Icon/tsx/IconsChevronLeft.tsx +0 -16
- package/src/Old/Icon/tsx/IconsChevronRight.tsx +0 -16
- package/src/Old/Icon/tsx/IconsChevronUp.tsx +0 -15
- package/src/Old/Icon/tsx/IconsClock.tsx +0 -16
- package/src/Old/Icon/tsx/IconsCloseSmall.tsx +0 -16
- package/src/Old/Icon/tsx/IconsCode.tsx +0 -16
- package/src/Old/Icon/tsx/IconsCoffee.tsx +0 -16
- package/src/Old/Icon/tsx/IconsConsole.tsx +0 -16
- package/src/Old/Icon/tsx/IconsCredit.tsx +0 -21
- package/src/Old/Icon/tsx/IconsCreditcard.tsx +0 -16
- package/src/Old/Icon/tsx/IconsDeleteNope.tsx +0 -15
- package/src/Old/Icon/tsx/IconsDeployment.tsx +0 -14
- package/src/Old/Icon/tsx/IconsDoc.tsx +0 -16
- package/src/Old/Icon/tsx/IconsDollars.tsx +0 -16
- package/src/Old/Icon/tsx/IconsDownload.tsx +0 -16
- package/src/Old/Icon/tsx/IconsDropdownArrows.tsx +0 -16
- package/src/Old/Icon/tsx/IconsDudes.tsx +0 -14
- package/src/Old/Icon/tsx/IconsDuplicate.tsx +0 -14
- package/src/Old/Icon/tsx/IconsEnterprise.tsx +0 -19
- package/src/Old/Icon/tsx/IconsErrorGeneral.tsx +0 -16
- package/src/Old/Icon/tsx/IconsFileDoc.tsx +0 -16
- package/src/Old/Icon/tsx/IconsFilePdf.tsx +0 -16
- package/src/Old/Icon/tsx/IconsFilePlist.tsx +0 -16
- package/src/Old/Icon/tsx/IconsFileZip.tsx +0 -16
- package/src/Old/Icon/tsx/IconsFilter.tsx +0 -16
- package/src/Old/Icon/tsx/IconsFlag.tsx +0 -13
- package/src/Old/Icon/tsx/IconsFolder.tsx +0 -16
- package/src/Old/Icon/tsx/IconsFullscreen.tsx +0 -14
- package/src/Old/Icon/tsx/IconsFullscreenExit.tsx +0 -14
- package/src/Old/Icon/tsx/IconsGauge.tsx +0 -16
- package/src/Old/Icon/tsx/IconsGithub.tsx +0 -14
- package/src/Old/Icon/tsx/IconsGitlab.tsx +0 -20
- package/src/Old/Icon/tsx/IconsGitlabFill.tsx +0 -14
- package/src/Old/Icon/tsx/IconsGlobe.tsx +0 -16
- package/src/Old/Icon/tsx/IconsGroup.tsx +0 -14
- package/src/Old/Icon/tsx/IconsHeart.tsx +0 -14
- package/src/Old/Icon/tsx/IconsHidePassword.tsx +0 -19
- package/src/Old/Icon/tsx/IconsHistory.tsx +0 -14
- package/src/Old/Icon/tsx/IconsImage.tsx +0 -14
- package/src/Old/Icon/tsx/IconsInfo.tsx +0 -14
- package/src/Old/Icon/tsx/IconsIntegrations.tsx +0 -14
- package/src/Old/Icon/tsx/IconsInteraction.tsx +0 -14
- package/src/Old/Icon/tsx/IconsInvoice.tsx +0 -16
- package/src/Old/Icon/tsx/IconsJapanese.tsx +0 -15
- package/src/Old/Icon/tsx/IconsKey.tsx +0 -14
- package/src/Old/Icon/tsx/IconsLaptop.tsx +0 -13
- package/src/Old/Icon/tsx/IconsLaptops.tsx +0 -16
- package/src/Old/Icon/tsx/IconsLightbulb.tsx +0 -16
- package/src/Old/Icon/tsx/IconsLock.tsx +0 -16
- package/src/Old/Icon/tsx/IconsLogin.tsx +0 -16
- package/src/Old/Icon/tsx/IconsLogout.tsx +0 -16
- package/src/Old/Icon/tsx/IconsMagnifier.tsx +0 -16
- package/src/Old/Icon/tsx/IconsMail.tsx +0 -16
- package/src/Old/Icon/tsx/IconsMenuGrid.tsx +0 -16
- package/src/Old/Icon/tsx/IconsMenuHamburger.tsx +0 -13
- package/src/Old/Icon/tsx/IconsMessage.tsx +0 -16
- package/src/Old/Icon/tsx/IconsMinusClose.tsx +0 -10
- package/src/Old/Icon/tsx/IconsMinusRemove.tsx +0 -16
- package/src/Old/Icon/tsx/IconsMobile.tsx +0 -16
- package/src/Old/Icon/tsx/IconsMonitoring.tsx +0 -14
- package/src/Old/Icon/tsx/IconsMoreHorizontal.tsx +0 -13
- package/src/Old/Icon/tsx/IconsMoreVertical.tsx +0 -17
- package/src/Old/Icon/tsx/IconsNoTie.tsx +0 -14
- package/src/Old/Icon/tsx/IconsNumero.tsx +0 -16
- package/src/Old/Icon/tsx/IconsOpenInBrowser.tsx +0 -16
- package/src/Old/Icon/tsx/IconsOverview.tsx +0 -14
- package/src/Old/Icon/tsx/IconsOwner.tsx +0 -19
- package/src/Old/Icon/tsx/IconsPause.tsx +0 -14
- package/src/Old/Icon/tsx/IconsPencil.tsx +0 -17
- package/src/Old/Icon/tsx/IconsPercent.tsx +0 -14
- package/src/Old/Icon/tsx/IconsPerson.tsx +0 -14
- package/src/Old/Icon/tsx/IconsPlatformsAndroid.tsx +0 -16
- package/src/Old/Icon/tsx/IconsPlatformsApple.tsx +0 -16
- package/src/Old/Icon/tsx/IconsPlatformsCordova.tsx +0 -14
- package/src/Old/Icon/tsx/IconsPlatformsFastlane.tsx +0 -14
- package/src/Old/Icon/tsx/IconsPlatformsFlutter.tsx +0 -14
- package/src/Old/Icon/tsx/IconsPlatformsGo.tsx +0 -13
- package/src/Old/Icon/tsx/IconsPlatformsIonic.tsx +0 -14
- package/src/Old/Icon/tsx/IconsPlatformsMacos.tsx +0 -14
- package/src/Old/Icon/tsx/IconsPlatformsNodejs.tsx +0 -13
- package/src/Old/Icon/tsx/IconsPlatformsOther.tsx +0 -21
- package/src/Old/Icon/tsx/IconsPlatformsReact.tsx +0 -14
- package/src/Old/Icon/tsx/IconsPlatformsXamarin.tsx +0 -14
- package/src/Old/Icon/tsx/IconsPlay.tsx +0 -16
- package/src/Old/Icon/tsx/IconsPlusAdd.tsx +0 -16
- package/src/Old/Icon/tsx/IconsPlusOpen.tsx +0 -13
- package/src/Old/Icon/tsx/IconsPower.tsx +0 -11
- package/src/Old/Icon/tsx/IconsRefresh.tsx +0 -13
- package/src/Old/Icon/tsx/IconsRequest.tsx +0 -14
- package/src/Old/Icon/tsx/IconsResponsiveness.tsx +0 -14
- package/src/Old/Icon/tsx/IconsSave.tsx +0 -14
- package/src/Old/Icon/tsx/IconsSecurityShield.tsx +0 -16
- package/src/Old/Icon/tsx/IconsSettings.tsx +0 -16
- package/src/Old/Icon/tsx/IconsShip.tsx +0 -14
- package/src/Old/Icon/tsx/IconsShowPassword.tsx +0 -16
- package/src/Old/Icon/tsx/IconsShuffle.tsx +0 -16
- package/src/Old/Icon/tsx/IconsStability.tsx +0 -16
- package/src/Old/Icon/tsx/IconsStack.tsx +0 -16
- package/src/Old/Icon/tsx/IconsStatus.tsx +0 -16
- package/src/Old/Icon/tsx/IconsStepThirdParty.tsx +0 -16
- package/src/Old/Icon/tsx/IconsStepUpgrade.tsx +0 -10
- package/src/Old/Icon/tsx/IconsStepUpgradeCircle.tsx +0 -11
- package/src/Old/Icon/tsx/IconsStepVersionOk.tsx +0 -11
- package/src/Old/Icon/tsx/IconsSteps.tsx +0 -14
- package/src/Old/Icon/tsx/IconsStepsColorTuorqouise.tsx +0 -14
- package/src/Old/Icon/tsx/IconsStepsColorViolet.tsx +0 -14
- package/src/Old/Icon/tsx/IconsStepsWhite.tsx +0 -14
- package/src/Old/Icon/tsx/IconsStopwatch.tsx +0 -16
- package/src/Old/Icon/tsx/IconsSupport.tsx +0 -16
- package/src/Old/Icon/tsx/IconsSwitch.tsx +0 -13
- package/src/Old/Icon/tsx/IconsTestFailed.tsx +0 -14
- package/src/Old/Icon/tsx/IconsTestInconclusive.tsx +0 -14
- package/src/Old/Icon/tsx/IconsTestInfo.tsx +0 -14
- package/src/Old/Icon/tsx/IconsTestSkipped.tsx +0 -14
- package/src/Old/Icon/tsx/IconsTestSuccess.tsx +0 -14
- package/src/Old/Icon/tsx/IconsTestWarning.tsx +0 -14
- package/src/Old/Icon/tsx/IconsTick.tsx +0 -13
- package/src/Old/Icon/tsx/IconsTime.tsx +0 -16
- package/src/Old/Icon/tsx/IconsTrace.tsx +0 -14
- package/src/Old/Icon/tsx/IconsTrash.tsx +0 -16
- package/src/Old/Icon/tsx/IconsTrigger.tsx +0 -16
- package/src/Old/Icon/tsx/IconsTwitter.tsx +0 -16
- package/src/Old/Icon/tsx/IconsValidateShield.tsx +0 -16
- package/src/Old/Icon/tsx/IconsWarning.tsx +0 -16
- package/src/Old/Icon/tsx/IconsWebUi.tsx +0 -17
- package/src/Old/Icon/tsx/IconsWindow.tsx +0 -16
- package/src/Old/Icon/tsx/IconsWorkflow.tsx +0 -16
- package/src/Old/Icon/tsx/IconsWorkflowFlow.tsx +0 -16
- package/src/Old/Icon/tsx/IconsWow.tsx +0 -16
- package/src/Old/Icon/tsx/index.ts +0 -694
- package/src/Old/Link/Link.css +0 -44
- package/src/Old/Link/Link.tsx +0 -30
- package/src/Old/Modal/Modal.css +0 -67
- package/src/Old/Modal/Modal.tsx +0 -117
- package/src/Old/Modal/ModalBody.tsx +0 -17
- package/src/Old/Modal/ModalHeader.tsx +0 -50
- package/src/Old/Modal/ModalHeaderProgress.tsx +0 -23
- package/src/Old/Modal/ModalTitle.tsx +0 -13
- package/src/Old/Progress/ProgressButtonContent.tsx +0 -35
- package/src/Old/Sidebar/Sidebar.css +0 -125
- package/src/Old/Sidebar/Sidebar.tsx +0 -25
- package/src/Old/Sidebar/SidebarHeader.tsx +0 -10
- package/src/Old/Sidebar/SidebarMenu.tsx +0 -30
- package/src/Old/Sidebar/SidebarMenuContext.ts +0 -7
- package/src/Old/Sidebar/SidebarMenuItem.tsx +0 -67
- package/src/Old/Sidebar/SidebarSubMenu.tsx +0 -33
- package/src/Old/Sidebar/SidebarSubMenuItem.tsx +0 -59
- package/src/Old/Tabs/Tab.tsx +0 -23
- package/src/Old/Tabs/Tabs.css +0 -30
- package/src/Old/Tabs/Tabs.tsx +0 -18
- package/src/Old/Tooltip/Tooltip.tsx +0 -85
- package/src/Old/hooks/useResizeObserver.ts +0 -40
package/src/Old/Link/Link.css
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
.Link {
|
|
2
|
-
color: inherit;
|
|
3
|
-
transition-property: color;
|
|
4
|
-
transition-duration: var(--transition-duration--fast);
|
|
5
|
-
transition-timing-function: var(--transition-timing-function);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.Link--underline {
|
|
9
|
-
text-decoration: underline;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.Link--color-grape-3 {
|
|
13
|
-
color: var(--color-grape--3);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.Link--color-grape-3:hover { color: var(--color-grape--4); }
|
|
17
|
-
|
|
18
|
-
.Link--color-grape-5 {
|
|
19
|
-
color: var(--color-grape--5);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.Link--color-grape-5:hover { color: var(--color-grape--3); }
|
|
23
|
-
|
|
24
|
-
.Link--color-gray-1 {
|
|
25
|
-
color: var(--color-gray--1);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.Link--color-gray-1:hover { color: var(--color-gray--2); }
|
|
29
|
-
|
|
30
|
-
.Link--color-gray-5 {
|
|
31
|
-
color: var(--color-gray--5);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.Link--color-gray-5:hover { color: var(--color-gray--6); }
|
|
35
|
-
|
|
36
|
-
.Link--color-white {
|
|
37
|
-
color: var(--color-white);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.Link--color-white:hover { color: var(--color-gray--1); }
|
|
41
|
-
|
|
42
|
-
.Link:focus-visible {
|
|
43
|
-
box-shadow: none;
|
|
44
|
-
}
|
package/src/Old/Link/Link.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
import Base, { Props as BaseProps } from '../Base/Base';
|
|
4
|
-
import './Link.css';
|
|
5
|
-
|
|
6
|
-
export type TypeLinkColor = 'purple.50' | 'purple.10' | 'neutral.95' | 'neutral.70' | 'neutral.100';
|
|
7
|
-
|
|
8
|
-
export interface Props extends BaseProps {
|
|
9
|
-
Component?: BaseProps['Component'];
|
|
10
|
-
/** A subset of the base level color that has interaction styling */
|
|
11
|
-
color?: TypeLinkColor;
|
|
12
|
-
/** Applies an underline styling to the link */
|
|
13
|
-
underline?: boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/** Styled link component */
|
|
17
|
-
const Link: React.FunctionComponent<Props> = (props: Props) => {
|
|
18
|
-
const { className, color, underline, ...rest } = props;
|
|
19
|
-
const classes = classnames(className, 'Link', `Link--color-${color}`, {
|
|
20
|
-
'Link--underline': underline,
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
return <Base {...rest} className={classes} />;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
Link.defaultProps = {
|
|
27
|
-
Component: 'a',
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export default Link;
|
package/src/Old/Modal/Modal.css
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
@keyframes ModalFadeIn {
|
|
3
|
-
from { opacity: 0; }
|
|
4
|
-
to { opacity: 1; }
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
@keyframes ModalFadeOut {
|
|
8
|
-
from { opacity: 1; }
|
|
9
|
-
to { opacity: 0; }
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.Body--modal-open { overflow: hidden; }
|
|
13
|
-
|
|
14
|
-
.Modal {
|
|
15
|
-
position: fixed;
|
|
16
|
-
top: 0;
|
|
17
|
-
right: 0;
|
|
18
|
-
bottom: 0;
|
|
19
|
-
left: 0;
|
|
20
|
-
background-color: var(--color-overlay--black);
|
|
21
|
-
overflow: auto;
|
|
22
|
-
z-index: var(--z-index-Modal);
|
|
23
|
-
animation-name: ModalFadeOut;
|
|
24
|
-
animation-duration: var(--transition-duration--fast);
|
|
25
|
-
animation-fill-mode: forwards;
|
|
26
|
-
animation-timing-function: var(--transition-timing-function);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.Modal__content {
|
|
30
|
-
max-width: 100%;
|
|
31
|
-
animation-duration: var(--transition-duration--fast);
|
|
32
|
-
animation-fill-mode: forwards;
|
|
33
|
-
animation-timing-function: var(--transition-timing-function);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.Modal__content,
|
|
37
|
-
.Modal__content:first-child,
|
|
38
|
-
.Modal__content:last-child {
|
|
39
|
-
margin-top: auto;
|
|
40
|
-
margin-bottom: auto;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.Modal--visible {
|
|
44
|
-
animation-name: ModalFadeIn;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.Modal--visible .Modal__content {
|
|
48
|
-
animation-duration: var(--transition-duration-base);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.ModalHeader {
|
|
52
|
-
position: relative;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.ModalHeader__progress,
|
|
56
|
-
.ModalHeader--with-separator::before {
|
|
57
|
-
position: absolute;
|
|
58
|
-
bottom: 0;
|
|
59
|
-
left: 0;
|
|
60
|
-
width: 100%;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.ModalHeader--with-separator::before {
|
|
64
|
-
content: '';
|
|
65
|
-
height: var(--size--x1);
|
|
66
|
-
background: linear-gradient(90deg, var(--color-grape--1) -28.36%, var(--color-grape--2) 100%);
|
|
67
|
-
}
|
package/src/Old/Modal/Modal.tsx
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
import { useEventListener } from '../hooks';
|
|
4
|
-
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
5
|
-
import Portal from '../Portal/Portal';
|
|
6
|
-
import { TypeColors } from '../Base/Base';
|
|
7
|
-
import { ModalContext } from './ModalContext';
|
|
8
|
-
import './Modal.css';
|
|
9
|
-
|
|
10
|
-
const { useEffect, useState } = React;
|
|
11
|
-
|
|
12
|
-
const enableScroll = () => document.body.classList.remove('Body--modal-open');
|
|
13
|
-
const disableScroll = () => document.body.classList.add('Body--modal-open');
|
|
14
|
-
|
|
15
|
-
export interface Props extends FlexProps {
|
|
16
|
-
/**
|
|
17
|
-
* Background color of the dialog box
|
|
18
|
-
*/
|
|
19
|
-
backgroundColor?: TypeColors;
|
|
20
|
-
/**
|
|
21
|
-
* Flag to set the initial height of the dialog box to
|
|
22
|
-
* the full height available.
|
|
23
|
-
*/
|
|
24
|
-
fullHeight?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Callback that is called when clicking on the overlay
|
|
27
|
-
* area, useful for dismissing the modal.
|
|
28
|
-
*/
|
|
29
|
-
onClose?: () => void;
|
|
30
|
-
/**
|
|
31
|
-
* Flag that controls the rendering and visibility of the
|
|
32
|
-
* modal to the user.
|
|
33
|
-
*/
|
|
34
|
-
visible: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Width of the dialog box.
|
|
37
|
-
*/
|
|
38
|
-
width: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Modal component with overlay for interupting a user with
|
|
43
|
-
* an important message or question.
|
|
44
|
-
*/
|
|
45
|
-
const Modal: React.FunctionComponent<Props> = (props: Props) => {
|
|
46
|
-
const { backgroundColor, children, fullHeight, onClose, visible, width, ...rest } = props;
|
|
47
|
-
|
|
48
|
-
const [modalElement, setModalElement] = useState<HTMLElement | null>(null);
|
|
49
|
-
const [render, setRender] = useState(visible);
|
|
50
|
-
|
|
51
|
-
const classes = classnames('Modal', {
|
|
52
|
-
'Modal--visible': visible,
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const handleClick = (event: React.SyntheticEvent) => {
|
|
56
|
-
event.stopPropagation();
|
|
57
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
if (visible) {
|
|
62
|
-
setRender(true);
|
|
63
|
-
disableScroll();
|
|
64
|
-
} else {
|
|
65
|
-
enableScroll();
|
|
66
|
-
}
|
|
67
|
-
}, [visible]);
|
|
68
|
-
|
|
69
|
-
useEventListener(
|
|
70
|
-
modalElement,
|
|
71
|
-
'animationend',
|
|
72
|
-
() => {
|
|
73
|
-
if (!visible) {
|
|
74
|
-
setRender(false);
|
|
75
|
-
setModalElement(null);
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
[visible],
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
if (!render) {
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
<Portal element={document.body}>
|
|
87
|
-
<Flex
|
|
88
|
-
alignChildrenHorizontal="middle"
|
|
89
|
-
className={classes}
|
|
90
|
-
direction="vertical"
|
|
91
|
-
innerRef={setModalElement}
|
|
92
|
-
onClick={onClose}
|
|
93
|
-
padding="x6"
|
|
94
|
-
>
|
|
95
|
-
<Flex
|
|
96
|
-
backgroundColor={backgroundColor}
|
|
97
|
-
borderRadius="x2"
|
|
98
|
-
className="Modal__content"
|
|
99
|
-
direction="vertical"
|
|
100
|
-
grow={fullHeight}
|
|
101
|
-
onClick={handleClick}
|
|
102
|
-
width={width}
|
|
103
|
-
{...rest}
|
|
104
|
-
>
|
|
105
|
-
{/* eslint-disable-next-line react/jsx-no-constructed-context-values */}
|
|
106
|
-
<ModalContext.Provider value={{ modalElement, onClose }}>{children}</ModalContext.Provider>
|
|
107
|
-
</Flex>
|
|
108
|
-
</Flex>
|
|
109
|
-
</Portal>
|
|
110
|
-
);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
Modal.defaultProps = {
|
|
114
|
-
backgroundColor: 'neutral.100',
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export default Modal;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
3
|
-
|
|
4
|
-
export type Props = FlexProps;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Modal body wrapper with preset padding.
|
|
8
|
-
*/
|
|
9
|
-
const ModalBody: React.FunctionComponent<Props> = (props: Props) => {
|
|
10
|
-
return <Flex grow {...props} />;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
ModalBody.defaultProps = {
|
|
14
|
-
padding: 'x10',
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default ModalBody;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
import { Icon } from '@bitrise/bitkit';
|
|
4
|
-
import Link from '../Link/Link';
|
|
5
|
-
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
6
|
-
import { ModalContext } from './ModalContext';
|
|
7
|
-
|
|
8
|
-
const { useContext } = React;
|
|
9
|
-
|
|
10
|
-
export interface Props extends FlexProps {
|
|
11
|
-
gap?: FlexProps['gap'];
|
|
12
|
-
padding?: FlexProps['padding'];
|
|
13
|
-
/**
|
|
14
|
-
* Flag to toggle the gradient separator
|
|
15
|
-
*/
|
|
16
|
-
withSeparator?: boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Modal header wrapper with optional gradient separator.
|
|
21
|
-
*/
|
|
22
|
-
const ModalHeader: React.FunctionComponent<Props> = (props: Props) => {
|
|
23
|
-
const { withSeparator, children, padding, paddingHorizontal = padding, paddingVertical = padding, ...rest } = props;
|
|
24
|
-
const { onClose } = useContext(ModalContext);
|
|
25
|
-
|
|
26
|
-
const classes = classnames('ModalHeader', {
|
|
27
|
-
'ModalHeader--with-separator': withSeparator,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<Flex {...rest} className={classes} direction="horizontal">
|
|
32
|
-
<Flex grow initial="none" paddingHorizontal={paddingHorizontal} paddingVertical={paddingVertical}>
|
|
33
|
-
{children}
|
|
34
|
-
</Flex>
|
|
35
|
-
<Flex padding="x4">
|
|
36
|
-
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
|
37
|
-
<Link clickable color="purple.10" onClick={onClose}>
|
|
38
|
-
<Icon name="CloseSmall" />
|
|
39
|
-
</Link>
|
|
40
|
-
</Flex>
|
|
41
|
-
</Flex>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
ModalHeader.defaultProps = {
|
|
46
|
-
gap: 'x2',
|
|
47
|
-
padding: 'x6',
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export default ModalHeader;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
3
|
-
import ProgressBar from '../Progress/ProgressBar';
|
|
4
|
-
|
|
5
|
-
export interface Props extends FlexProps {
|
|
6
|
-
/** A number between 0 and 1 that represents the progress to display */
|
|
7
|
-
progress: number;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* ModalHeader progress bar
|
|
12
|
-
*/
|
|
13
|
-
const ModalHeaderProgress: React.FunctionComponent<Props> = (props: Props) => {
|
|
14
|
-
const { progress, ...rest } = props;
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<Flex {...rest} className="ModalHeader__progress">
|
|
18
|
-
<ProgressBar foregroundColor="purple.40" height="4px" progress={progress} />
|
|
19
|
-
</Flex>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default ModalHeaderProgress;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import Text, { Props as TextProps } from '../Text/Text';
|
|
3
|
-
|
|
4
|
-
export type Props = TextProps;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Modal specific styled text to appear as a title.
|
|
8
|
-
*/
|
|
9
|
-
const ModalTitle: React.FunctionComponent<Props> = (props: Props) => {
|
|
10
|
-
return <Text {...props} letterSpacing="x1" margin="x4" size="5" textColor="purple.10" weight="bold" />;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default ModalTitle;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import Base from '../Base/Base';
|
|
3
|
-
import Visibility from '../Visibility/Visibility';
|
|
4
|
-
import ButtonSize from '../Button/ButtonSize';
|
|
5
|
-
import ProgressSpinner from './ProgressSpinner';
|
|
6
|
-
|
|
7
|
-
export interface Props {
|
|
8
|
-
progressing: boolean;
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
size?: ButtonSize;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* A progress indicator action button that is useful
|
|
15
|
-
* to provide inline feedback that after a user action,
|
|
16
|
-
* something is happening.
|
|
17
|
-
*/
|
|
18
|
-
const ProgressButtonContent: React.FunctionComponent<Props> = (props: Props) => {
|
|
19
|
-
const { children, progressing, size } = props;
|
|
20
|
-
const gap = size === 'small' ? 'x1' : 'x2';
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<Base container>
|
|
24
|
-
<Visibility alignChildren="middle" direction="horizontal" gap={gap} visible={!progressing}>
|
|
25
|
-
{children}
|
|
26
|
-
</Visibility>
|
|
27
|
-
|
|
28
|
-
<Visibility absolute="center" visible={progressing}>
|
|
29
|
-
{progressing && <ProgressSpinner size="1.5rem" />}
|
|
30
|
-
</Visibility>
|
|
31
|
-
</Base>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default ProgressButtonContent;
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/* stylelint-disable no-descending-specificity */
|
|
2
|
-
|
|
3
|
-
.Sidebar__header,
|
|
4
|
-
.Sidebar__menu {
|
|
5
|
-
border-bottom-width: 0.0625rem;
|
|
6
|
-
border-bottom-style: solid;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.Sidebar__menu:first-child {
|
|
10
|
-
border-top-width: 0.0625rem;
|
|
11
|
-
border-top-style: solid;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.Sidebar__header {
|
|
15
|
-
padding: var(--size--x4) var(--size--x6);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.Sidebar__menu-item {
|
|
19
|
-
position: relative;
|
|
20
|
-
overflow: hidden;
|
|
21
|
-
z-index: 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.Sidebar__menu-item::before {
|
|
25
|
-
content: '';
|
|
26
|
-
position: absolute;
|
|
27
|
-
top: 0;
|
|
28
|
-
bottom: 0;
|
|
29
|
-
left: 0;
|
|
30
|
-
width: var(--size--x1);
|
|
31
|
-
opacity: 0;
|
|
32
|
-
border-radius: 0 var(--size--x1) var(--size--x1) 0;
|
|
33
|
-
background-color: var(--color-aqua--3);
|
|
34
|
-
transition-property: opacity;
|
|
35
|
-
transition-duration: var(--transition-duration--slow);
|
|
36
|
-
transition-timing-function: var(--transition-timing-function);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.Sidebar__menu-item-link {
|
|
40
|
-
position: relative;
|
|
41
|
-
padding: var(--size--x4) var(--size--x6);
|
|
42
|
-
cursor: pointer;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.Sidebar__menu-item-link::before {
|
|
46
|
-
content: '';
|
|
47
|
-
position: absolute;
|
|
48
|
-
top: 0;
|
|
49
|
-
right: 0;
|
|
50
|
-
bottom: 0;
|
|
51
|
-
left: 0;
|
|
52
|
-
border-radius: var(--size--x2);
|
|
53
|
-
z-index: -1;
|
|
54
|
-
transition-property: transform, border-radius, background-color;
|
|
55
|
-
transition-duration: var(--transition-duration--base);
|
|
56
|
-
transition-timing-function: var(--transition-timing-function);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.Sidebar__menu-item--active::before,
|
|
60
|
-
.Sidebar__menu-item--active:hover::before {
|
|
61
|
-
opacity: 1;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.Sidebar__menu-item--active .Sidebar__menu-item-link::before,
|
|
65
|
-
.Sidebar__menu-item--active:hover .Sidebar__menu-item-link::before {
|
|
66
|
-
transform: scale(1.2);
|
|
67
|
-
border-radius: 0;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.Sidebar__sub-menu-item {
|
|
71
|
-
padding: var(--size--x2) var(--size--x6);
|
|
72
|
-
border-top-width: 0.0625rem;
|
|
73
|
-
border-top-style: solid;
|
|
74
|
-
cursor: pointer;
|
|
75
|
-
transition-property: background-color;
|
|
76
|
-
transition-duration: var(--transition-duration--base);
|
|
77
|
-
transition-timing-function: var(--transition-timing-function);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.Sidebar--theme-dark {
|
|
81
|
-
background-color: var(--color-grape--5);
|
|
82
|
-
color: var(--color-gray--1);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.Sidebar--theme-dark .Sidebar__header,
|
|
86
|
-
.Sidebar--theme-dark .Sidebar__menu {
|
|
87
|
-
border-bottom-color: var(--color-grape--4);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.Sidebar--theme-dark .Sidebar__menu:first-child {
|
|
91
|
-
border-top-color: var(--color-grape--4);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.Sidebar--theme-dark .Sidebar__sub-menu-item {
|
|
95
|
-
border-top-color: var(--color-grape--5);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.Sidebar--theme-light {
|
|
99
|
-
background-color: var(--color-white);
|
|
100
|
-
color: var(--color-grape-5);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.Sidebar--theme-light .Sidebar__header,
|
|
104
|
-
.Sidebar--theme-light .Sidebar__menu {
|
|
105
|
-
border-bottom-color: var(--color-gray--2);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.Sidebar--theme-light .Sidebar__menu:first-child {
|
|
109
|
-
border-top-color: var(--color-gray--2);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.Sidebar--theme-light .Sidebar__sub-menu-item,
|
|
113
|
-
.Sidebar--theme-light .Sidebar__menu-item--active .Sidebar__menu-item-link::before,
|
|
114
|
-
.Sidebar--theme-light .Sidebar__menu-item:hover .Sidebar__menu-item-link::before {
|
|
115
|
-
background-color: var(--color-gray--1);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.Sidebar--theme-light .Sidebar__sub-menu-item {
|
|
119
|
-
border-top-color: var(--color-gray--2);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.Sidebar--theme-light .Sidebar__sub-menu-item--active,
|
|
123
|
-
.Sidebar--theme-light .Sidebar__sub-menu-item:hover {
|
|
124
|
-
background-color: var(--color-gray--2);
|
|
125
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
4
|
-
import './Sidebar.css';
|
|
5
|
-
|
|
6
|
-
export interface Props extends FlexProps {
|
|
7
|
-
theme?: 'dark' | 'light';
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* A full sidebar navigation component that can include a combination
|
|
12
|
-
* of top level and sub menus.
|
|
13
|
-
*/
|
|
14
|
-
const Sidebar: React.FunctionComponent<Props> = (props: Props) => {
|
|
15
|
-
const { theme, ...rest } = props;
|
|
16
|
-
const classes = classnames('Sidebar', `Sidebar--theme-${theme}`);
|
|
17
|
-
|
|
18
|
-
return <Flex className={classes} grow {...rest} />;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
Sidebar.defaultProps = {
|
|
22
|
-
theme: 'dark',
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default Sidebar;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import Base, { Props as BaseProps } from '../Base/Base';
|
|
3
|
-
|
|
4
|
-
export type Props = BaseProps;
|
|
5
|
-
|
|
6
|
-
const SidebarHeader: React.FunctionComponent<Props> = (props: Props) => {
|
|
7
|
-
return <Base {...props} className="Sidebar__header" />;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default SidebarHeader;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import Base, { Props as BaseProps } from '../Base/Base';
|
|
3
|
-
import { SidebarMenuContext } from './SidebarMenuContext';
|
|
4
|
-
|
|
5
|
-
const { useState } = React;
|
|
6
|
-
|
|
7
|
-
export interface Props extends BaseProps {
|
|
8
|
-
/** Active flag that sets the visual state of the SidebarMenuItem and
|
|
9
|
-
* also expands the SidebarSubMenu, if there is one included.
|
|
10
|
-
*/
|
|
11
|
-
active: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Child of the Sidebar component that should include exactly one SidebarMenuItem
|
|
16
|
-
* and an optional SidebarSubMenu.
|
|
17
|
-
*/
|
|
18
|
-
const SidebarMenu: React.FunctionComponent<Props> = (props: Props) => {
|
|
19
|
-
const { active, ...rest } = props;
|
|
20
|
-
const [hasSubMenu, setHasSubMenu] = useState(false);
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
24
|
-
<SidebarMenuContext.Provider value={{ active, hasSubMenu, setHasSubMenu }}>
|
|
25
|
-
<Base {...rest} className="Sidebar__menu" />
|
|
26
|
-
</SidebarMenuContext.Provider>
|
|
27
|
-
);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export default SidebarMenu;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
import { TypeIconName } from '../Icon/tsx';
|
|
4
|
-
import Base, { Props as BaseProps } from '../Base/Base';
|
|
5
|
-
import Flex from '../Flex/Flex';
|
|
6
|
-
import Icon from '../Icon/Icon';
|
|
7
|
-
import Visibility from '../Visibility/Visibility';
|
|
8
|
-
import VisibilityContainer from '../Visibility/VisibilityContainer';
|
|
9
|
-
import { SidebarMenuContext } from './SidebarMenuContext';
|
|
10
|
-
|
|
11
|
-
const { useContext } = React;
|
|
12
|
-
|
|
13
|
-
export interface Props extends BaseProps {
|
|
14
|
-
Component?: BaseProps['Component'];
|
|
15
|
-
/**
|
|
16
|
-
* Name of an icon (from the Icon component) that should
|
|
17
|
-
* appear next to the text.
|
|
18
|
-
*/
|
|
19
|
-
icon?: TypeIconName;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Child of the SidebarMenu component that is used to handle the
|
|
24
|
-
* navigation when interacted with.
|
|
25
|
-
*/
|
|
26
|
-
const SidebarMenuItem: React.FunctionComponent<Props> = (props: Props) => {
|
|
27
|
-
const { children, icon, ...rest } = props;
|
|
28
|
-
const { active, hasSubMenu } = useContext(SidebarMenuContext);
|
|
29
|
-
const classes = classnames('Sidebar__menu-item', {
|
|
30
|
-
'Sidebar__menu-item--active': active,
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<Base className={classes} padding="x1">
|
|
35
|
-
<VisibilityContainer
|
|
36
|
-
{...rest}
|
|
37
|
-
alignChildrenVertical="middle"
|
|
38
|
-
className="Sidebar__menu-item-link"
|
|
39
|
-
direction="horizontal"
|
|
40
|
-
enabled={!active}
|
|
41
|
-
gap="x4"
|
|
42
|
-
>
|
|
43
|
-
{icon && (
|
|
44
|
-
<Flex>
|
|
45
|
-
<Icon name={icon} />
|
|
46
|
-
</Flex>
|
|
47
|
-
)}
|
|
48
|
-
|
|
49
|
-
<Flex grow initial="none">
|
|
50
|
-
{children}
|
|
51
|
-
</Flex>
|
|
52
|
-
|
|
53
|
-
{hasSubMenu && (
|
|
54
|
-
<Visibility>
|
|
55
|
-
<Icon name="ChevronDown" />
|
|
56
|
-
</Visibility>
|
|
57
|
-
)}
|
|
58
|
-
</VisibilityContainer>
|
|
59
|
-
</Base>
|
|
60
|
-
);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
SidebarMenuItem.defaultProps = {
|
|
64
|
-
Component: 'a',
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export default SidebarMenuItem;
|