@bitrise/bitkit 10.1.0-alpha-chakra.2 → 10.1.0-alpha-breadcrumb.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 +57 -23
- package/src/Components/Breadcrumb/Breadcrumb.stories.tsx +30 -0
- package/src/Components/Breadcrumb/Breadcrumb.theme.ts +25 -0
- package/src/Components/Breadcrumb/Breadcrumb.tsx +50 -0
- package/src/Components/Breadcrumb/BreadcrumbLink.tsx +33 -0
- package/src/Components/Dialog/Dialog.tsx +4 -0
- package/src/Components/Tabs/Tab.tsx +24 -2
- package/src/Components/Transitions/Fade.stories.tsx +26 -0
- package/src/Components/Transitions/Fade.tsx +12 -0
- package/src/Old/AddonBeam/AddonBeam.css +16 -0
- package/src/Old/AddonBeam/AddonBeam.tsx +117 -0
- package/src/Old/AddonBeam/AddonBeamLink.tsx +37 -0
- package/src/Old/AddonFooter/AddonFooter.tsx +24 -0
- package/src/Old/AppLayout/AppLayout.css +45 -0
- package/src/Old/AppLayout/AppLayout.tsx +21 -0
- package/src/Old/AppLayout/AppLayoutBody.tsx +10 -0
- package/src/Old/AppLayout/AppLayoutHeader.tsx +10 -0
- package/src/Old/AppLayout/AppLayoutMain.tsx +10 -0
- package/src/Old/AppLayout/AppLayoutSidebar.tsx +10 -0
- package/src/Old/Avatar/Avatar.css +4 -0
- package/src/Old/Avatar/Avatar.tsx +64 -0
- package/src/Old/Avatar/avatarColors.ts +26 -0
- package/src/Old/Bounds/Bounds.tsx +20 -0
- package/src/Old/Button/Button.css +249 -0
- package/src/Old/Button/Button.test.tsx +29 -0
- package/src/Old/Button/Button.tsx +55 -0
- package/src/Old/Button/ButtonSize.ts +3 -0
- package/src/Old/Button/Buttons.test.tsx +42 -0
- package/src/Old/Button/Buttons.tsx +34 -0
- package/src/Old/Button/__snapshots__/Button.test.tsx.snap +73 -0
- package/src/Old/Button/__snapshots__/Buttons.test.tsx.snap +45 -0
- package/src/Old/DatePicker/DatePicker.tsx +6 -6
- package/src/Old/DatePicker/DatePickerMonth.tsx +7 -7
- package/src/Old/Dropdown/Dropdown.tsx +5 -3
- package/src/Old/Dropdown/DropdownButton.tsx +16 -2
- package/src/Old/Dropdown/DropdownMenuItem.tsx +2 -1
- package/src/Old/Dropdown/DropdownMenuItemGroup.tsx +2 -2
- package/src/Old/ExternalLink/ExternalLink.tsx +24 -0
- package/src/Old/Icon/Icon.css +4 -0
- package/src/Old/Icon/Icon.tsx +32 -0
- package/src/Old/Icon/tsx/IconsAddOns.tsx +14 -0
- package/src/Old/Icon/tsx/IconsAddOnsColorTuorqouise.tsx +20 -0
- package/src/Old/Icon/tsx/IconsAddOnsColorViolet.tsx +20 -0
- package/src/Old/Icon/tsx/IconsAddOnsWhite.tsx +20 -0
- package/src/Old/Icon/tsx/IconsApp.tsx +16 -0
- package/src/Old/Icon/tsx/IconsArrowBack.tsx +14 -0
- package/src/Old/Icon/tsx/IconsArrowDown.tsx +21 -0
- package/src/Old/Icon/tsx/IconsArrowForward.tsx +16 -0
- package/src/Old/Icon/tsx/IconsArrowQuit.tsx +14 -0
- package/src/Old/Icon/tsx/IconsArrowUp.tsx +14 -0
- package/src/Old/Icon/tsx/IconsBackArrow.tsx +13 -0
- package/src/Old/Icon/tsx/IconsBell.tsx +16 -0
- package/src/Old/Icon/tsx/IconsBitbot.tsx +16 -0
- package/src/Old/Icon/tsx/IconsBitbotFailed.tsx +18 -0
- package/src/Old/Icon/tsx/IconsBitbucket.tsx +26 -0
- package/src/Old/Icon/tsx/IconsBitbucketFill.tsx +14 -0
- package/src/Old/Icon/tsx/IconsBitriseCertified.tsx +19 -0
- package/src/Old/Icon/tsx/IconsBook.tsx +16 -0
- package/src/Old/Icon/tsx/IconsBranchBranch.tsx +16 -0
- package/src/Old/Icon/tsx/IconsBranchCommit.tsx +14 -0
- package/src/Old/Icon/tsx/IconsBranchPull.tsx +16 -0
- package/src/Old/Icon/tsx/IconsBranchPush.tsx +21 -0
- package/src/Old/Icon/tsx/IconsBranchTag.tsx +16 -0
- package/src/Old/Icon/tsx/IconsBug.tsx +16 -0
- package/src/Old/Icon/tsx/IconsBuild.tsx +14 -0
- package/src/Old/Icon/tsx/IconsBuildstatusAborted.tsx +16 -0
- package/src/Old/Icon/tsx/IconsBuildstatusAbortedSolid.tsx +15 -0
- package/src/Old/Icon/tsx/IconsBuildstatusFailed.tsx +16 -0
- package/src/Old/Icon/tsx/IconsBuildstatusFailedSolid.tsx +15 -0
- package/src/Old/Icon/tsx/IconsBuildstatusLoading.tsx +13 -0
- package/src/Old/Icon/tsx/IconsBuildstatusLoadingAnimated.tsx +31 -0
- package/src/Old/Icon/tsx/IconsBuildstatusLoadingeeehh.tsx +13 -0
- package/src/Old/Icon/tsx/IconsBuildstatusLoadingeeehhWhite.tsx +13 -0
- package/src/Old/Icon/tsx/IconsBuildstatusNeverbuilt.tsx +14 -0
- package/src/Old/Icon/tsx/IconsBuildstatusSuccessful.tsx +16 -0
- package/src/Old/Icon/tsx/IconsBuildstatusSuccessfulSolid.tsx +15 -0
- package/src/Old/Icon/tsx/IconsCalendar.tsx +16 -0
- package/src/Old/Icon/tsx/IconsChain.tsx +16 -0
- package/src/Old/Icon/tsx/IconsChangePlan.tsx +14 -0
- package/src/Old/Icon/tsx/IconsChat.tsx +14 -0
- package/src/Old/Icon/tsx/IconsChatMessage.tsx +16 -0
- package/src/Old/Icon/tsx/IconsChevronDown.tsx +13 -0
- package/src/Old/Icon/tsx/IconsChevronLeft.tsx +16 -0
- package/src/Old/Icon/tsx/IconsChevronRight.tsx +16 -0
- package/src/Old/Icon/tsx/IconsChevronUp.tsx +15 -0
- package/src/Old/Icon/tsx/IconsClock.tsx +16 -0
- package/src/Old/Icon/tsx/IconsCloseSmall.tsx +16 -0
- package/src/Old/Icon/tsx/IconsCode.tsx +16 -0
- package/src/Old/Icon/tsx/IconsCoffee.tsx +16 -0
- package/src/Old/Icon/tsx/IconsConsole.tsx +16 -0
- package/src/Old/Icon/tsx/IconsCredit.tsx +21 -0
- package/src/Old/Icon/tsx/IconsCreditcard.tsx +16 -0
- package/src/Old/Icon/tsx/IconsDeleteNope.tsx +15 -0
- package/src/Old/Icon/tsx/IconsDeployment.tsx +14 -0
- package/src/Old/Icon/tsx/IconsDoc.tsx +16 -0
- package/src/Old/Icon/tsx/IconsDollars.tsx +16 -0
- package/src/Old/Icon/tsx/IconsDownload.tsx +16 -0
- package/src/Old/Icon/tsx/IconsDropdownArrows.tsx +16 -0
- package/src/Old/Icon/tsx/IconsDudes.tsx +14 -0
- package/src/Old/Icon/tsx/IconsDuplicate.tsx +14 -0
- package/src/Old/Icon/tsx/IconsEnterprise.tsx +19 -0
- package/src/Old/Icon/tsx/IconsErrorGeneral.tsx +16 -0
- package/src/Old/Icon/tsx/IconsFileDoc.tsx +16 -0
- package/src/Old/Icon/tsx/IconsFilePdf.tsx +16 -0
- package/src/Old/Icon/tsx/IconsFilePlist.tsx +16 -0
- package/src/Old/Icon/tsx/IconsFileZip.tsx +16 -0
- package/src/Old/Icon/tsx/IconsFilter.tsx +16 -0
- package/src/Old/Icon/tsx/IconsFlag.tsx +13 -0
- package/src/Old/Icon/tsx/IconsFolder.tsx +16 -0
- package/src/Old/Icon/tsx/IconsFullscreen.tsx +14 -0
- package/src/Old/Icon/tsx/IconsFullscreenExit.tsx +14 -0
- package/src/Old/Icon/tsx/IconsGauge.tsx +16 -0
- package/src/Old/Icon/tsx/IconsGithub.tsx +14 -0
- package/src/Old/Icon/tsx/IconsGitlab.tsx +20 -0
- package/src/Old/Icon/tsx/IconsGitlabFill.tsx +14 -0
- package/src/Old/Icon/tsx/IconsGlobe.tsx +16 -0
- package/src/Old/Icon/tsx/IconsGroup.tsx +14 -0
- package/src/Old/Icon/tsx/IconsHeart.tsx +14 -0
- package/src/Old/Icon/tsx/IconsHidePassword.tsx +19 -0
- package/src/Old/Icon/tsx/IconsHistory.tsx +14 -0
- package/src/Old/Icon/tsx/IconsImage.tsx +14 -0
- package/src/Old/Icon/tsx/IconsInfo.tsx +14 -0
- package/src/Old/Icon/tsx/IconsIntegrations.tsx +14 -0
- package/src/Old/Icon/tsx/IconsInteraction.tsx +14 -0
- package/src/Old/Icon/tsx/IconsInvoice.tsx +16 -0
- package/src/Old/Icon/tsx/IconsJapanese.tsx +15 -0
- package/src/Old/Icon/tsx/IconsKey.tsx +14 -0
- package/src/Old/Icon/tsx/IconsLaptop.tsx +13 -0
- package/src/Old/Icon/tsx/IconsLaptops.tsx +16 -0
- package/src/Old/Icon/tsx/IconsLightbulb.tsx +16 -0
- package/src/Old/Icon/tsx/IconsLock.tsx +16 -0
- package/src/Old/Icon/tsx/IconsLogin.tsx +16 -0
- package/src/Old/Icon/tsx/IconsLogout.tsx +16 -0
- package/src/Old/Icon/tsx/IconsMagnifier.tsx +16 -0
- package/src/Old/Icon/tsx/IconsMail.tsx +16 -0
- package/src/Old/Icon/tsx/IconsMenuGrid.tsx +16 -0
- package/src/Old/Icon/tsx/IconsMenuHamburger.tsx +13 -0
- package/src/Old/Icon/tsx/IconsMessage.tsx +16 -0
- package/src/Old/Icon/tsx/IconsMinusClose.tsx +10 -0
- package/src/Old/Icon/tsx/IconsMinusRemove.tsx +16 -0
- package/src/Old/Icon/tsx/IconsMobile.tsx +16 -0
- package/src/Old/Icon/tsx/IconsMonitoring.tsx +14 -0
- package/src/Old/Icon/tsx/IconsMoreHorizontal.tsx +13 -0
- package/src/Old/Icon/tsx/IconsMoreVertical.tsx +17 -0
- package/src/Old/Icon/tsx/IconsNoTie.tsx +14 -0
- package/src/Old/Icon/tsx/IconsNumero.tsx +16 -0
- package/src/Old/Icon/tsx/IconsOpenInBrowser.tsx +16 -0
- package/src/Old/Icon/tsx/IconsOverview.tsx +14 -0
- package/src/Old/Icon/tsx/IconsOwner.tsx +19 -0
- package/src/Old/Icon/tsx/IconsPause.tsx +14 -0
- package/src/Old/Icon/tsx/IconsPencil.tsx +17 -0
- package/src/Old/Icon/tsx/IconsPercent.tsx +14 -0
- package/src/Old/Icon/tsx/IconsPerson.tsx +14 -0
- package/src/Old/Icon/tsx/IconsPlatformsAndroid.tsx +16 -0
- package/src/Old/Icon/tsx/IconsPlatformsApple.tsx +16 -0
- package/src/Old/Icon/tsx/IconsPlatformsCordova.tsx +14 -0
- package/src/Old/Icon/tsx/IconsPlatformsFastlane.tsx +14 -0
- package/src/Old/Icon/tsx/IconsPlatformsFlutter.tsx +14 -0
- package/src/Old/Icon/tsx/IconsPlatformsGo.tsx +13 -0
- package/src/Old/Icon/tsx/IconsPlatformsIonic.tsx +14 -0
- package/src/Old/Icon/tsx/IconsPlatformsMacos.tsx +14 -0
- package/src/Old/Icon/tsx/IconsPlatformsNodejs.tsx +13 -0
- package/src/Old/Icon/tsx/IconsPlatformsOther.tsx +21 -0
- package/src/Old/Icon/tsx/IconsPlatformsReact.tsx +14 -0
- package/src/Old/Icon/tsx/IconsPlatformsXamarin.tsx +14 -0
- package/src/Old/Icon/tsx/IconsPlay.tsx +16 -0
- package/src/Old/Icon/tsx/IconsPlusAdd.tsx +16 -0
- package/src/Old/Icon/tsx/IconsPlusOpen.tsx +13 -0
- package/src/Old/Icon/tsx/IconsPower.tsx +11 -0
- package/src/Old/Icon/tsx/IconsRefresh.tsx +13 -0
- package/src/Old/Icon/tsx/IconsRequest.tsx +14 -0
- package/src/Old/Icon/tsx/IconsResponsiveness.tsx +14 -0
- package/src/Old/Icon/tsx/IconsSave.tsx +14 -0
- package/src/Old/Icon/tsx/IconsSecurityShield.tsx +16 -0
- package/src/Old/Icon/tsx/IconsSettings.tsx +16 -0
- package/src/Old/Icon/tsx/IconsShip.tsx +14 -0
- package/src/Old/Icon/tsx/IconsShowPassword.tsx +16 -0
- package/src/Old/Icon/tsx/IconsShuffle.tsx +16 -0
- package/src/Old/Icon/tsx/IconsStability.tsx +16 -0
- package/src/Old/Icon/tsx/IconsStack.tsx +16 -0
- package/src/Old/Icon/tsx/IconsStatus.tsx +16 -0
- package/src/Old/Icon/tsx/IconsStepThirdParty.tsx +16 -0
- package/src/Old/Icon/tsx/IconsStepUpgrade.tsx +10 -0
- package/src/Old/Icon/tsx/IconsStepUpgradeCircle.tsx +11 -0
- package/src/Old/Icon/tsx/IconsStepVersionOk.tsx +11 -0
- package/src/Old/Icon/tsx/IconsSteps.tsx +14 -0
- package/src/Old/Icon/tsx/IconsStepsColorTuorqouise.tsx +14 -0
- package/src/Old/Icon/tsx/IconsStepsColorViolet.tsx +14 -0
- package/src/Old/Icon/tsx/IconsStepsWhite.tsx +14 -0
- package/src/Old/Icon/tsx/IconsStopwatch.tsx +16 -0
- package/src/Old/Icon/tsx/IconsSupport.tsx +16 -0
- package/src/Old/Icon/tsx/IconsSwitch.tsx +13 -0
- package/src/Old/Icon/tsx/IconsTestFailed.tsx +14 -0
- package/src/Old/Icon/tsx/IconsTestInconclusive.tsx +14 -0
- package/src/Old/Icon/tsx/IconsTestInfo.tsx +14 -0
- package/src/Old/Icon/tsx/IconsTestSkipped.tsx +14 -0
- package/src/Old/Icon/tsx/IconsTestSuccess.tsx +14 -0
- package/src/Old/Icon/tsx/IconsTestWarning.tsx +14 -0
- package/src/Old/Icon/tsx/IconsTick.tsx +13 -0
- package/src/Old/Icon/tsx/IconsTime.tsx +16 -0
- package/src/Old/Icon/tsx/IconsTrace.tsx +14 -0
- package/src/Old/Icon/tsx/IconsTrash.tsx +16 -0
- package/src/Old/Icon/tsx/IconsTrigger.tsx +16 -0
- package/src/Old/Icon/tsx/IconsTwitter.tsx +16 -0
- package/src/Old/Icon/tsx/IconsValidateShield.tsx +16 -0
- package/src/Old/Icon/tsx/IconsWarning.tsx +16 -0
- package/src/Old/Icon/tsx/IconsWebUi.tsx +17 -0
- package/src/Old/Icon/tsx/IconsWindow.tsx +16 -0
- package/src/Old/Icon/tsx/IconsWorkflow.tsx +16 -0
- package/src/Old/Icon/tsx/IconsWorkflowFlow.tsx +16 -0
- package/src/Old/Icon/tsx/IconsWow.tsx +16 -0
- package/src/Old/Icon/tsx/index.ts +694 -0
- package/src/Old/Input/InputLabel.tsx +3 -5
- package/src/Old/Link/Link.css +44 -0
- package/src/Old/Link/Link.tsx +30 -0
- package/src/Old/Modal/Modal.css +67 -0
- package/src/Old/Modal/Modal.tsx +117 -0
- package/src/Old/Modal/ModalBody.tsx +17 -0
- package/src/Old/Modal/ModalHeader.tsx +50 -0
- package/src/Old/Modal/ModalHeaderProgress.tsx +23 -0
- package/src/Old/Modal/ModalTitle.tsx +13 -0
- package/src/Old/Notification/Notification.tsx +4 -3
- package/src/Old/Notification/__snapshots__/Notification.test.tsx.snap +12 -8
- package/src/Old/Progress/ProgressBitbot.tsx +3 -3
- package/src/Old/Progress/ProgressButtonContent.tsx +35 -0
- package/src/Old/Ribbon/Ribbon.tsx +4 -4
- package/src/Old/Sidebar/Sidebar.css +125 -0
- package/src/Old/Sidebar/Sidebar.tsx +25 -0
- package/src/Old/Sidebar/SidebarHeader.tsx +10 -0
- package/src/Old/Sidebar/SidebarMenu.tsx +30 -0
- package/src/Old/Sidebar/SidebarMenuContext.ts +7 -0
- package/src/Old/Sidebar/SidebarMenuItem.tsx +67 -0
- package/src/Old/Sidebar/SidebarSubMenu.tsx +33 -0
- package/src/Old/Sidebar/SidebarSubMenuItem.tsx +59 -0
- 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/Tabs/Tab.tsx +23 -0
- package/src/Old/Tabs/Tabs.css +30 -0
- package/src/Old/Tabs/Tabs.tsx +18 -0
- package/src/Old/Text/TextSizes.css +39 -0
- package/src/Old/Toggle/Toggle.tsx +1 -1
- package/src/Old/Tooltip/Tooltip.tsx +85 -0
- package/src/Old/hooks/index.ts +1 -0
- package/src/Old/hooks/useResizeObserver.ts +40 -0
- package/src/Old/variables.css +1 -0
- package/src/Old/variables.ts +3 -0
- package/src/index.ts +9 -0
- package/src/old.ts +64 -0
- package/src/theme.ts +2 -0
- package/src/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
3
|
+
|
|
4
|
+
export type Props = FlexProps;
|
|
5
|
+
|
|
6
|
+
const AppLayoutHeader: React.FunctionComponent<Props> = (props: Props) => {
|
|
7
|
+
return <Flex {...props} className="AppLayout__header" />;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default AppLayoutHeader;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
3
|
+
|
|
4
|
+
export type Props = FlexProps;
|
|
5
|
+
|
|
6
|
+
const AppLayoutMain: React.FunctionComponent<Props> = (props: Props) => {
|
|
7
|
+
return <Flex {...props} direction="vertical" grow />;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default AppLayoutMain;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
3
|
+
|
|
4
|
+
export type Props = FlexProps;
|
|
5
|
+
|
|
6
|
+
const AppLayoutSidebar: React.FunctionComponent<Props> = (props: Props) => {
|
|
7
|
+
return <Flex {...props} alignSelf="start" className="AppLayout__sidebar" />;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default AppLayoutSidebar;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
3
|
+
import Text from '../Text/Text';
|
|
4
|
+
import avatarColors from './avatarColors';
|
|
5
|
+
import './Avatar.css';
|
|
6
|
+
|
|
7
|
+
const { useMemo } = React;
|
|
8
|
+
|
|
9
|
+
export interface Props extends FlexProps {
|
|
10
|
+
name: string;
|
|
11
|
+
url?: string;
|
|
12
|
+
size?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const Avatar: React.FunctionComponent<Props> = (props: Props) => {
|
|
16
|
+
const { url, name, size = '2rem', ...rest } = props;
|
|
17
|
+
|
|
18
|
+
const memoizedValue = useMemo(() => {
|
|
19
|
+
if (!url) {
|
|
20
|
+
const str = name.toUpperCase();
|
|
21
|
+
const shortHand = `${str.charAt(0)}${str.charAt(str.length - 1)}`;
|
|
22
|
+
const seed = str.charCodeAt(0) + str.charCodeAt(str.length - 1);
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
shortHand,
|
|
26
|
+
styles: {
|
|
27
|
+
backgroundColor: avatarColors[seed % avatarColors.length],
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
shortHand: null,
|
|
34
|
+
styles: {
|
|
35
|
+
backgroundImage: `url(${url})`,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}, [name, url]);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Flex
|
|
42
|
+
borderRadius="rounded"
|
|
43
|
+
{...rest}
|
|
44
|
+
alignChildrenHorizontal="middle"
|
|
45
|
+
alignChildrenVertical="middle"
|
|
46
|
+
className="Avatar"
|
|
47
|
+
direction="horizontal"
|
|
48
|
+
height={size}
|
|
49
|
+
overflow="hidden"
|
|
50
|
+
style={{ ...memoizedValue.styles, ...rest.styles }}
|
|
51
|
+
width={size}
|
|
52
|
+
>
|
|
53
|
+
<Flex>
|
|
54
|
+
{memoizedValue.shortHand && (
|
|
55
|
+
<Text size="3" textColor="neutral.100">
|
|
56
|
+
{memoizedValue.shortHand}
|
|
57
|
+
</Text>
|
|
58
|
+
)}
|
|
59
|
+
</Flex>
|
|
60
|
+
</Flex>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default Avatar;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
'#68442c',
|
|
3
|
+
'#86d641',
|
|
4
|
+
'#a775db',
|
|
5
|
+
'#df5ac3',
|
|
6
|
+
'#46bee8',
|
|
7
|
+
'#63c99a',
|
|
8
|
+
'#19937c',
|
|
9
|
+
'#ed544c',
|
|
10
|
+
'#ff931e',
|
|
11
|
+
'#107ec1',
|
|
12
|
+
'#48e1ed',
|
|
13
|
+
'#743da5',
|
|
14
|
+
'#f9d128',
|
|
15
|
+
'#ff931e',
|
|
16
|
+
'#9e4b39',
|
|
17
|
+
'#b51c98',
|
|
18
|
+
'#b20202',
|
|
19
|
+
'#bf8a66',
|
|
20
|
+
'#2c3f50',
|
|
21
|
+
'#441f62',
|
|
22
|
+
'#0c5b4c',
|
|
23
|
+
'#391401',
|
|
24
|
+
'#27ae61',
|
|
25
|
+
'#ef7bef',
|
|
26
|
+
];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Base, { Props as BaseProps } from '../Base/Base';
|
|
3
|
+
import useResizeObserver, { DOMRectReadOnlyWithoutToJSON } from '../hooks/useResizeObserver';
|
|
4
|
+
|
|
5
|
+
export interface Props extends BaseProps {
|
|
6
|
+
children: (size: DOMRectReadOnlyWithoutToJSON) => React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Bounds: React.FunctionComponent<Props> = (props: Props) => {
|
|
10
|
+
const { children, ...rest } = props;
|
|
11
|
+
const [size, ref] = useResizeObserver();
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<Base {...rest} innerRef={ref}>
|
|
15
|
+
{children(size)}
|
|
16
|
+
</Base>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default Bounds;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--Button--border-small: 0.0625rem;
|
|
3
|
+
--Button--border-medium: 0.0625rem;
|
|
4
|
+
--Button--border-large: 0.125rem;
|
|
5
|
+
--Button--padding-small-vertical: calc(var(--size--x1) - var(--Button--border-small));
|
|
6
|
+
--Button--padding-small-horizontal: var(--size--x3);
|
|
7
|
+
--Button--padding-medium-vertical: calc(var(--size--x3) - var(--Button--border-medium));
|
|
8
|
+
--Button--padding-medium-horizontal: var(--size--x4);
|
|
9
|
+
--Button--padding-large-vertical: var(--size--x4);
|
|
10
|
+
--Button--padding-large-horizontal: var(--size--x6);
|
|
11
|
+
--Button--line-height: var(--size--x6);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.Button {
|
|
15
|
+
border: 0 solid transparent;
|
|
16
|
+
background-color: transparent;
|
|
17
|
+
line-height: var(--Button--line-height);
|
|
18
|
+
transition-property: border-color, background-color, color;
|
|
19
|
+
transition-duration: var(--transition-duration--base);
|
|
20
|
+
transition-timing-function: var(--transition-timing-function);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.Button:hover {
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.Button:disabled,
|
|
28
|
+
.Button[disabled] {
|
|
29
|
+
cursor: not-allowed;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.Button--full-width {
|
|
33
|
+
width: 100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.Button--size-small {
|
|
37
|
+
padding: var(--Button--padding-small-vertical) var(--Button--padding-small-horizontal);
|
|
38
|
+
border-width: var(--Button--border-small);
|
|
39
|
+
border-radius: var(--size--x1);
|
|
40
|
+
font-size: var(--fontSizes-2);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.Button--size-medium {
|
|
44
|
+
padding: var(--Button--padding-medium-vertical) var(--Button--padding-medium-horizontal);
|
|
45
|
+
border-width: var(--Button--border-medium);
|
|
46
|
+
border-radius: var(--size--x1);
|
|
47
|
+
font-size: var(--fontSizes-3);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.Button--size-large {
|
|
51
|
+
padding: var(--Button--padding-large-vertical) var(--Button--padding-large-horizontal);
|
|
52
|
+
border-width: var(--Button--border-large);
|
|
53
|
+
border-radius: 0.375rem;
|
|
54
|
+
font-size: var(--fontSizes-4);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.Button--borderless {
|
|
58
|
+
border: none;
|
|
59
|
+
border-radius: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* stylelint-disable no-descending-specificity */
|
|
63
|
+
.Button--level-primary,
|
|
64
|
+
.Button--level-secondary {
|
|
65
|
+
position: relative;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
z-index: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.Button--level-primary::before,
|
|
71
|
+
.Button--level-primary::after,
|
|
72
|
+
.Button--level-secondary::before,
|
|
73
|
+
.Button--level-secondary::after {
|
|
74
|
+
content: '';
|
|
75
|
+
position: absolute;
|
|
76
|
+
top: -0.125rem;
|
|
77
|
+
right: -0.125rem;
|
|
78
|
+
bottom: -0.125rem;
|
|
79
|
+
left: -0.125rem;
|
|
80
|
+
z-index: -1;
|
|
81
|
+
transition-property: opacity;
|
|
82
|
+
transition-duration: var(--transition-duration--base);
|
|
83
|
+
transition-timing-function: var(--transition-timing-function);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.Button--level-primary:disabled::before,
|
|
87
|
+
.Button--level-primary:hover:not(:disabled)::before,
|
|
88
|
+
.Button--level-primary[disabled]::before,
|
|
89
|
+
.Button--level-primary:hover:not([disabled])::before,
|
|
90
|
+
.Button--level-secondary:disabled::before,
|
|
91
|
+
.Button--level-secondary:hover:not(:disabled)::before,
|
|
92
|
+
.Button--level-secondary[disabled]::before,
|
|
93
|
+
.Button--level-secondary:hover:not([disabled])::before {
|
|
94
|
+
opacity: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.Button--level-primary:hover:not(:disabled)::after,
|
|
98
|
+
.Button--level-primary:hover:not([disabled])::after,
|
|
99
|
+
.Button--level-secondary:hover:not(:disabled)::after,
|
|
100
|
+
.Button--level-secondary:hover:not([disabled])::after {
|
|
101
|
+
opacity: 1;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.Button--level-primary:disabled::after,
|
|
105
|
+
.Button--level-primary:active:not(:disabled)::after,
|
|
106
|
+
.Button--level-primary[disabled]::after,
|
|
107
|
+
.Button--level-primary:active:not([disabled])::after,
|
|
108
|
+
.Button--level-secondary:disabled::after,
|
|
109
|
+
.Button--level-secondary:active:not(:disabled)::after,
|
|
110
|
+
.Button--level-secondary[disabled]::after,
|
|
111
|
+
.Button--level-secondary:active:not([disabled])::after {
|
|
112
|
+
opacity: 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.Button--level-primary {
|
|
116
|
+
border-color: var(--color-eggplant);
|
|
117
|
+
background-color: var(--color-grape--5);
|
|
118
|
+
color: var(--color-gray--1);
|
|
119
|
+
font-weight: var(--font-weight--bold);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.Button--level-primary:disabled,
|
|
123
|
+
.Button--level-primary[disabled] {
|
|
124
|
+
border-color: var(--color-gray--5);
|
|
125
|
+
background-image: linear-gradient(to bottom, var(--color-gray--4), var(--color-gray--5));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.Button--level-primary::before {
|
|
129
|
+
opacity: 1;
|
|
130
|
+
background-image: linear-gradient(to bottom, #6C0EB2, #450674);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.Button--level-primary::after {
|
|
134
|
+
opacity: 0;
|
|
135
|
+
background-image: linear-gradient(to bottom, #50167B, #3D125D);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.Button--level-secondary {
|
|
139
|
+
border-color: var(--color-gray--3);
|
|
140
|
+
background-color: var(--color-gray--2);
|
|
141
|
+
color: var(--color-grape--5);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.Button--level-secondary:disabled,
|
|
145
|
+
.Button--level-secondary[disabled] {
|
|
146
|
+
border-color: var(--color-gray--3);
|
|
147
|
+
background-image: linear-gradient(to bottom, var(--color-white), var(--color-gray--1));
|
|
148
|
+
color: var(--color-gray--5);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.Button--level-secondary:active:not(:disabled) {
|
|
152
|
+
border-color: var(--color-eggplant);
|
|
153
|
+
background-color: var(--color-grape--5);
|
|
154
|
+
color: var(--color-gray--1);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.Button--level-secondary::before {
|
|
158
|
+
opacity: 1;
|
|
159
|
+
background-image: linear-gradient(to bottom, var(--color-white), var(--color-gray--1));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.Button--level-secondary::after {
|
|
163
|
+
content: none;
|
|
164
|
+
opacity: 0;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.Button--level-tertiary {
|
|
168
|
+
border-color: transparent;
|
|
169
|
+
background-color: transparent;
|
|
170
|
+
color: var(--color-grape--3);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.Button--level-tertiary:disabled,
|
|
174
|
+
.Button--level-tertiary[disabled] {
|
|
175
|
+
color: var(--color-gray--5);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.Button--level-tertiary:hover:not(:disabled),
|
|
179
|
+
.Button--level-tertiary:hover:not([disabled]) {
|
|
180
|
+
background-color: var(--color-grape--1);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.Button--level-tertiary:active:not(:disabled),
|
|
184
|
+
.Button--level-tertiary:active:not([disabled]) {
|
|
185
|
+
background-color: var(--color-grape--5);
|
|
186
|
+
color: var(--color-gray--1);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.Button--variant-danger.Button--level-primary:not(:disabled),
|
|
190
|
+
.Button--variant-danger.Button--level-primary:not([disabled]) {
|
|
191
|
+
border-color: #D4093C;
|
|
192
|
+
background-color: #C90032;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.Button--variant-danger.Button--level-primary:not(:disabled):active,
|
|
196
|
+
.Button--variant-danger.Button--level-primary:not([disabled]):active {
|
|
197
|
+
border-color: #D4093C;
|
|
198
|
+
background-color: var(--color-red--5);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.Button--variant-danger.Button--level-primary:not(:disabled)::before,
|
|
202
|
+
.Button--variant-danger.Button--level-primary:not([disabled])::before {
|
|
203
|
+
background-image: linear-gradient(to bottom, #FF2158, #E41447);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.Button--variant-danger.Button--level-primary:not(:disabled)::after,
|
|
207
|
+
.Button--variant-danger.Button--level-primary:not([disabled])::after {
|
|
208
|
+
content: none;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.Button--variant-danger.Button--level-secondary:not(:disabled),
|
|
212
|
+
.Button--variant-danger.Button--level-secondary:not([disabled]) {
|
|
213
|
+
border-color: var(--color-gray--3);
|
|
214
|
+
background-color: var(--color-red--1);
|
|
215
|
+
color: var(--color-red--3);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.Button--variant-danger.Button--level-secondary:not(:disabled):hover,
|
|
219
|
+
.Button--variant-danger.Button--level-secondary:not([disabled]):hover {
|
|
220
|
+
border-color: var(--color-red--2);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.Button--variant-danger.Button--level-secondary:not(:disabled):active,
|
|
224
|
+
.Button--variant-danger.Button--level-secondary:not([disabled]):active {
|
|
225
|
+
border-color: #D4093C;
|
|
226
|
+
background-color: var(--color-red--5);
|
|
227
|
+
color: var(--color-gray--1);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.Button--variant-danger.Button--level-secondary:not(:disabled)::before,
|
|
231
|
+
.Button--variant-danger.Button--level-secondary:not([disabled])::before {
|
|
232
|
+
background-image: linear-gradient(to bottom, var(--color-white), var(--color-gray--1));
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.Button--variant-danger.Button--level-secondary:not(:disabled)::after,
|
|
236
|
+
.Button--variant-danger.Button--level-secondary:not([disabled])::after {
|
|
237
|
+
content: none;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.Buttons--joined .Button:not(:first-child) {
|
|
241
|
+
border-top-left-radius: 0;
|
|
242
|
+
border-bottom-left-radius: 0;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.Buttons--joined .Button:not(:last-child) {
|
|
246
|
+
border-right: 0;
|
|
247
|
+
border-top-right-radius: 0;
|
|
248
|
+
border-bottom-right-radius: 0;
|
|
249
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { shallow } from 'enzyme';
|
|
2
|
+
import { shallowToJson } from 'enzyme-to-json';
|
|
3
|
+
import Button from './Button';
|
|
4
|
+
|
|
5
|
+
describe('Button', () => {
|
|
6
|
+
test('default template', () => {
|
|
7
|
+
expect(shallowToJson(shallow(<Button>Content</Button>))).toMatchSnapshot();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('borderless', () => {
|
|
11
|
+
expect(shallowToJson(shallow(<Button borderless>Content</Button>))).toMatchSnapshot();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('fullWidth', () => {
|
|
15
|
+
expect(shallowToJson(shallow(<Button fullWidth>Content</Button>))).toMatchSnapshot();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('level', () => {
|
|
19
|
+
expect(shallowToJson(shallow(<Button level="primary">Content</Button>))).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('size', () => {
|
|
23
|
+
expect(shallowToJson(shallow(<Button size="small">Content</Button>))).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('variant', () => {
|
|
27
|
+
expect(shallowToJson(shallow(<Button variant="danger">Content</Button>))).toMatchSnapshot();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
4
|
+
import './Button.css';
|
|
5
|
+
import ButtonSize from './ButtonSize';
|
|
6
|
+
|
|
7
|
+
export interface Props extends FlexProps {
|
|
8
|
+
/**
|
|
9
|
+
* Removes the borders from the Button, useful for when used inside a w
|
|
10
|
+
* rapping container with custom borders
|
|
11
|
+
*/
|
|
12
|
+
borderless?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Allows the Button to fill the container space rather than shrinking
|
|
15
|
+
* down to the content
|
|
16
|
+
*/
|
|
17
|
+
fullWidth?: boolean;
|
|
18
|
+
/** Sets the visual importance of the Button. */
|
|
19
|
+
level?: 'primary' | 'secondary' | 'tertiary';
|
|
20
|
+
/**
|
|
21
|
+
* Sets the size of the Button. Small allows the Button to fit
|
|
22
|
+
* into smaller spaces, while large will help the button stand
|
|
23
|
+
* out on a page with lots of space.
|
|
24
|
+
*/
|
|
25
|
+
size?: ButtonSize;
|
|
26
|
+
/**
|
|
27
|
+
* Variant is another prop that changes the styles to indicate it's usage.
|
|
28
|
+
* For example "danger" is to let the user know this button performs a
|
|
29
|
+
* potentionally dangerous action.
|
|
30
|
+
*/
|
|
31
|
+
variant?: 'danger';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Standard Button component */
|
|
35
|
+
const Button: React.FunctionComponent<Props> = (props: Props) => {
|
|
36
|
+
const { borderless, className, fullWidth, level, size, variant, ...rest } = props;
|
|
37
|
+
|
|
38
|
+
const gap = size === 'small' ? 'x1' : 'x2';
|
|
39
|
+
const classes = classnames(className, 'Button', `Button--level-${level}`, `Button--size-${size}`, {
|
|
40
|
+
'Button--borderless': borderless,
|
|
41
|
+
'Button--full-width': fullWidth,
|
|
42
|
+
[`Button--variant-${variant}`]: variant,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<Flex Component="button" {...rest} alignChildren="middle" className={classes} direction="horizontal" gap={gap} />
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
Button.defaultProps = {
|
|
51
|
+
level: 'secondary',
|
|
52
|
+
size: 'medium',
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default Button;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { shallow } from 'enzyme';
|
|
2
|
+
import { shallowToJson } from 'enzyme-to-json';
|
|
3
|
+
import Button from './Button';
|
|
4
|
+
import Buttons from './Buttons';
|
|
5
|
+
|
|
6
|
+
describe('Buttons', () => {
|
|
7
|
+
test('default template', () => {
|
|
8
|
+
expect(
|
|
9
|
+
shallowToJson(
|
|
10
|
+
shallow(
|
|
11
|
+
<Buttons>
|
|
12
|
+
<Button>Content</Button>
|
|
13
|
+
</Buttons>,
|
|
14
|
+
),
|
|
15
|
+
),
|
|
16
|
+
).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test('fullWidth', () => {
|
|
20
|
+
expect(
|
|
21
|
+
shallowToJson(
|
|
22
|
+
shallow(
|
|
23
|
+
<Buttons fullWidth>
|
|
24
|
+
<Button>Content</Button>
|
|
25
|
+
</Buttons>,
|
|
26
|
+
),
|
|
27
|
+
),
|
|
28
|
+
).toMatchSnapshot();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('joined', () => {
|
|
32
|
+
expect(
|
|
33
|
+
shallowToJson(
|
|
34
|
+
shallow(
|
|
35
|
+
<Buttons joined>
|
|
36
|
+
<Button>Content</Button>
|
|
37
|
+
</Buttons>,
|
|
38
|
+
),
|
|
39
|
+
),
|
|
40
|
+
).toMatchSnapshot();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
4
|
+
|
|
5
|
+
export interface Props extends FlexProps {
|
|
6
|
+
/** */
|
|
7
|
+
fullWidth?: boolean;
|
|
8
|
+
gap?: FlexProps['gap'];
|
|
9
|
+
/** Connects any child components, when not provided they will be spaced out a little bit. */
|
|
10
|
+
joined?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Parent component to any multiples of Buttons. */
|
|
14
|
+
const Buttons: React.FunctionComponent<Props> = (props: Props) => {
|
|
15
|
+
const { fullWidth, gap, joined, ...rest } = props;
|
|
16
|
+
const classes = classnames('Buttons', {
|
|
17
|
+
'Buttons--joined': joined,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Flex
|
|
22
|
+
{...rest}
|
|
23
|
+
className={classes}
|
|
24
|
+
direction={fullWidth ? 'vertical' : 'horizontal'}
|
|
25
|
+
gap={joined && !fullWidth ? undefined : gap}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
Buttons.defaultProps = {
|
|
31
|
+
gap: 'x2',
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default Buttons;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Button borderless 1`] = `
|
|
4
|
+
<Flex
|
|
5
|
+
Component="button"
|
|
6
|
+
alignChildren="middle"
|
|
7
|
+
className="Button Button--level-secondary Button--size-medium Button--borderless"
|
|
8
|
+
direction="horizontal"
|
|
9
|
+
gap="x2"
|
|
10
|
+
>
|
|
11
|
+
Content
|
|
12
|
+
</Flex>
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
exports[`Button default template 1`] = `
|
|
16
|
+
<Flex
|
|
17
|
+
Component="button"
|
|
18
|
+
alignChildren="middle"
|
|
19
|
+
className="Button Button--level-secondary Button--size-medium"
|
|
20
|
+
direction="horizontal"
|
|
21
|
+
gap="x2"
|
|
22
|
+
>
|
|
23
|
+
Content
|
|
24
|
+
</Flex>
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
exports[`Button fullWidth 1`] = `
|
|
28
|
+
<Flex
|
|
29
|
+
Component="button"
|
|
30
|
+
alignChildren="middle"
|
|
31
|
+
className="Button Button--level-secondary Button--size-medium Button--full-width"
|
|
32
|
+
direction="horizontal"
|
|
33
|
+
gap="x2"
|
|
34
|
+
>
|
|
35
|
+
Content
|
|
36
|
+
</Flex>
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
exports[`Button level 1`] = `
|
|
40
|
+
<Flex
|
|
41
|
+
Component="button"
|
|
42
|
+
alignChildren="middle"
|
|
43
|
+
className="Button Button--level-primary Button--size-medium"
|
|
44
|
+
direction="horizontal"
|
|
45
|
+
gap="x2"
|
|
46
|
+
>
|
|
47
|
+
Content
|
|
48
|
+
</Flex>
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
exports[`Button size 1`] = `
|
|
52
|
+
<Flex
|
|
53
|
+
Component="button"
|
|
54
|
+
alignChildren="middle"
|
|
55
|
+
className="Button Button--level-secondary Button--size-small"
|
|
56
|
+
direction="horizontal"
|
|
57
|
+
gap="x1"
|
|
58
|
+
>
|
|
59
|
+
Content
|
|
60
|
+
</Flex>
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
exports[`Button variant 1`] = `
|
|
64
|
+
<Flex
|
|
65
|
+
Component="button"
|
|
66
|
+
alignChildren="middle"
|
|
67
|
+
className="Button Button--level-secondary Button--size-medium Button--variant-danger"
|
|
68
|
+
direction="horizontal"
|
|
69
|
+
gap="x2"
|
|
70
|
+
>
|
|
71
|
+
Content
|
|
72
|
+
</Flex>
|
|
73
|
+
`;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Buttons default template 1`] = `
|
|
4
|
+
<Flex
|
|
5
|
+
className="Buttons"
|
|
6
|
+
direction="horizontal"
|
|
7
|
+
gap="x2"
|
|
8
|
+
>
|
|
9
|
+
<Button
|
|
10
|
+
level="secondary"
|
|
11
|
+
size="medium"
|
|
12
|
+
>
|
|
13
|
+
Content
|
|
14
|
+
</Button>
|
|
15
|
+
</Flex>
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
exports[`Buttons fullWidth 1`] = `
|
|
19
|
+
<Flex
|
|
20
|
+
className="Buttons"
|
|
21
|
+
direction="vertical"
|
|
22
|
+
gap="x2"
|
|
23
|
+
>
|
|
24
|
+
<Button
|
|
25
|
+
level="secondary"
|
|
26
|
+
size="medium"
|
|
27
|
+
>
|
|
28
|
+
Content
|
|
29
|
+
</Button>
|
|
30
|
+
</Flex>
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
exports[`Buttons joined 1`] = `
|
|
34
|
+
<Flex
|
|
35
|
+
className="Buttons Buttons--joined"
|
|
36
|
+
direction="horizontal"
|
|
37
|
+
>
|
|
38
|
+
<Button
|
|
39
|
+
level="secondary"
|
|
40
|
+
size="medium"
|
|
41
|
+
>
|
|
42
|
+
Content
|
|
43
|
+
</Button>
|
|
44
|
+
</Flex>
|
|
45
|
+
`;
|