@bitrise/bitkit 9.15.0-alpha-chakra.2 → 9.16.0
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 +11 -12
- package/src/Components/Menu/Menu.theme.ts +3 -3
- package/src/Components/Text/Text.tsx +11 -5
- package/src/Foundations/Typography/Typography.ts +7 -0
- package/src/index.ts +7 -4
- package/src/old.ts +2 -13
- package/src/theme.ts +0 -2
- package/src/tsconfig.tsbuildinfo +1 -1
- package/src/Components/Dropdown/Dropdown.stories.tsx +0 -69
- package/src/Components/Dropdown/Dropdown.styles.ts +0 -82
- package/src/Components/Dropdown/Dropdown.tsx +0 -64
- package/src/Components/Select/Select.stories.tsx +0 -38
- package/src/Components/Select/Select.theme.ts +0 -51
- package/src/Components/Select/Select.tsx +0 -17
- package/src/Old/Button/ColorButton.css +0 -81
- package/src/Old/Button/ColorButton.test.tsx +0 -18
- package/src/Old/Button/ColorButton.tsx +0 -31
- package/src/Old/Button/__snapshots__/ColorButton.test.tsx.snap +0 -13
- package/src/Old/Progress/ProgressColorButton.tsx +0 -22
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
2
|
-
import { sortObjectByKey } from '../../utils/storyUtils';
|
|
3
|
-
import Dropdown from './Dropdown';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Components/Dropdown',
|
|
7
|
-
component: Dropdown,
|
|
8
|
-
args: {
|
|
9
|
-
isDisabled: false,
|
|
10
|
-
isLoading: false,
|
|
11
|
-
},
|
|
12
|
-
argTypes: {
|
|
13
|
-
onChange: {
|
|
14
|
-
action: 'onChange event',
|
|
15
|
-
},
|
|
16
|
-
size: {
|
|
17
|
-
options: ['small', 'medium'],
|
|
18
|
-
control: {
|
|
19
|
-
type: 'radio',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
} as ComponentMeta<typeof Dropdown>;
|
|
24
|
-
|
|
25
|
-
const buildStatusOptions = [
|
|
26
|
-
{ value: 'all', label: 'All status' },
|
|
27
|
-
{ value: 'successful', label: 'Successful' },
|
|
28
|
-
{ value: 'failed', label: 'Failed' },
|
|
29
|
-
{ value: 'aborted', label: 'Aborted' },
|
|
30
|
-
{
|
|
31
|
-
value: 'on_hold',
|
|
32
|
-
label:
|
|
33
|
-
'On hold, but has a really long label text for test blah blah lorem ipsum dolor sit amet blah blah lorem ipsum dolor sit amet blah blah lorem ipsum dolor sit amet blah blah lorem ipsum dolor sit amet blah blah lorem ipsum dolor sit amet',
|
|
34
|
-
},
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
const flavorOptions = [
|
|
38
|
-
{ value: 'vanilla', label: 'Vanilla' },
|
|
39
|
-
{ value: 'chocolate', label: 'Chocolate' },
|
|
40
|
-
{ value: 'strawberry', label: 'Strawberry' },
|
|
41
|
-
{ value: 'salted-caramel', label: 'Salted Caramel' },
|
|
42
|
-
];
|
|
43
|
-
|
|
44
|
-
const groupedOptions = [
|
|
45
|
-
{
|
|
46
|
-
label: 'Build status',
|
|
47
|
-
options: buildStatusOptions,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
label: 'Flavours',
|
|
51
|
-
options: flavorOptions,
|
|
52
|
-
},
|
|
53
|
-
];
|
|
54
|
-
|
|
55
|
-
const Template: ComponentStory<typeof Dropdown> = (props) => <Dropdown {...props} />;
|
|
56
|
-
|
|
57
|
-
export const WithProps = Template.bind({});
|
|
58
|
-
WithProps.args = sortObjectByKey({
|
|
59
|
-
...Dropdown.defaultProps,
|
|
60
|
-
options: buildStatusOptions,
|
|
61
|
-
placeholder: 'Select build status',
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
export const WithOptionGroups = Template.bind({});
|
|
65
|
-
WithOptionGroups.args = sortObjectByKey({
|
|
66
|
-
...Dropdown.defaultProps,
|
|
67
|
-
options: groupedOptions,
|
|
68
|
-
placeholder: 'Select something 🤔',
|
|
69
|
-
});
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { ChakraStylesConfig } from 'chakra-react-select';
|
|
2
|
-
import type { SystemStyleObject } from '@chakra-ui/theme-tools';
|
|
3
|
-
import SelectTheme from '../Select/Select.theme';
|
|
4
|
-
|
|
5
|
-
const controlTextStyle = {
|
|
6
|
-
cursor: 'default',
|
|
7
|
-
maxWidth: 'calc(100% - 3rem)',
|
|
8
|
-
overflow: 'hidden',
|
|
9
|
-
position: 'absolute',
|
|
10
|
-
textOverflow: 'ellipsis',
|
|
11
|
-
top: '50%',
|
|
12
|
-
transform: 'translateY(-50%)',
|
|
13
|
-
whiteSpace: 'nowrap',
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const getDropdownStyles = (size: 'small' | 'medium', additionalStyle?: SystemStyleObject): ChakraStylesConfig => ({
|
|
17
|
-
container: (_provided, state) => ({
|
|
18
|
-
borderRadius: '4',
|
|
19
|
-
boxShadow: state.isFocused ? 'outline' : 'none',
|
|
20
|
-
position: 'relative',
|
|
21
|
-
zIndex: state.isFocused ? '1' : '0',
|
|
22
|
-
...additionalStyle,
|
|
23
|
-
}),
|
|
24
|
-
control: () => ({
|
|
25
|
-
display: 'flex',
|
|
26
|
-
...SelectTheme.baseStyle.field,
|
|
27
|
-
...SelectTheme.sizes[size].field,
|
|
28
|
-
paddingRight: '8',
|
|
29
|
-
}),
|
|
30
|
-
groupHeading: () => ({
|
|
31
|
-
display: 'flex',
|
|
32
|
-
alignItems: 'center',
|
|
33
|
-
gap: '16',
|
|
34
|
-
color: 'neutral.50',
|
|
35
|
-
fontSize: '2',
|
|
36
|
-
lineHeight: '3',
|
|
37
|
-
paddingX: '16',
|
|
38
|
-
paddingY: '12',
|
|
39
|
-
textTransform: 'uppercase',
|
|
40
|
-
_after: {
|
|
41
|
-
content: `''`,
|
|
42
|
-
flex: 1,
|
|
43
|
-
height: '1px',
|
|
44
|
-
bg: 'neutral.90',
|
|
45
|
-
},
|
|
46
|
-
}),
|
|
47
|
-
indicatorsContainer: (provided) => ({
|
|
48
|
-
...provided,
|
|
49
|
-
width: '100%',
|
|
50
|
-
alignItems: 'center',
|
|
51
|
-
justifyContent: 'flex-end',
|
|
52
|
-
}),
|
|
53
|
-
loadingIndicator: () => ({
|
|
54
|
-
color: 'neutral.70',
|
|
55
|
-
width: '16',
|
|
56
|
-
height: '16',
|
|
57
|
-
marginRight: '8',
|
|
58
|
-
}),
|
|
59
|
-
menu: () => ({
|
|
60
|
-
position: 'absolute',
|
|
61
|
-
transform: 'translateY(8px)',
|
|
62
|
-
width: '100%',
|
|
63
|
-
}),
|
|
64
|
-
menuList: (provided) => ({
|
|
65
|
-
...provided,
|
|
66
|
-
borderRadius: '4',
|
|
67
|
-
}),
|
|
68
|
-
option: (provided) => ({
|
|
69
|
-
...provided,
|
|
70
|
-
padding: '12',
|
|
71
|
-
}),
|
|
72
|
-
placeholder: () => ({
|
|
73
|
-
...controlTextStyle,
|
|
74
|
-
}),
|
|
75
|
-
singleValue: () => controlTextStyle,
|
|
76
|
-
valueContainer: () => ({
|
|
77
|
-
display: 'flex',
|
|
78
|
-
alignItems: 'center',
|
|
79
|
-
}),
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
export default getDropdownStyles;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { chakraComponents, ChakraStylesConfig, DropdownIndicatorProps, Props, Select } from 'chakra-react-select';
|
|
3
|
-
import type { SystemStyleObject } from '@chakra-ui/theme-tools';
|
|
4
|
-
import Icon from '../../Old/Icon/Icon';
|
|
5
|
-
import getDropdownStyles from './Dropdown.styles';
|
|
6
|
-
|
|
7
|
-
export type DropdownProps = Omit<Props, 'defaultValue' | 'onChange'> & {
|
|
8
|
-
defaultValue?: any;
|
|
9
|
-
onChange?: ((newValue: any) => void) | undefined;
|
|
10
|
-
size?: 'small' | 'medium';
|
|
11
|
-
style?: SystemStyleObject;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const components = {
|
|
15
|
-
DropdownIndicator: (props: DropdownIndicatorProps) => {
|
|
16
|
-
return (
|
|
17
|
-
<chakraComponents.DropdownIndicator {...props}>
|
|
18
|
-
<Icon name="DropdownArrows" />
|
|
19
|
-
</chakraComponents.DropdownIndicator>
|
|
20
|
-
);
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const Dropdown = (props: DropdownProps) => {
|
|
25
|
-
const { defaultValue, isDisabled, isLoading, onChange, options, placeholder, size = 'medium', style } = props;
|
|
26
|
-
const chakraStyles: ChakraStylesConfig = getDropdownStyles(size, style);
|
|
27
|
-
|
|
28
|
-
const defaultValueWithLabel = defaultValue;
|
|
29
|
-
|
|
30
|
-
if (!defaultValue?.label && defaultValue?.text) {
|
|
31
|
-
defaultValueWithLabel.label = defaultValue.text;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const mappedOptions = options?.map((opt: any) => {
|
|
35
|
-
if (!opt.label && opt.text) {
|
|
36
|
-
return {
|
|
37
|
-
...opt,
|
|
38
|
-
label: opt.text,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
return opt;
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
const properties: Props = {
|
|
45
|
-
chakraStyles,
|
|
46
|
-
components,
|
|
47
|
-
defaultValue,
|
|
48
|
-
isDisabled: isDisabled || isLoading,
|
|
49
|
-
isLoading,
|
|
50
|
-
isSearchable: false,
|
|
51
|
-
onChange,
|
|
52
|
-
options: mappedOptions,
|
|
53
|
-
placeholder,
|
|
54
|
-
selectedOptionStyle: 'check',
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
return <Select {...properties} />;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
Dropdown.defaultProps = {
|
|
61
|
-
size: 'medium',
|
|
62
|
-
} as DropdownProps;
|
|
63
|
-
|
|
64
|
-
export default Dropdown;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
2
|
-
import { sortObjectByKey } from '../../utils/storyUtils';
|
|
3
|
-
import Select from './Select';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Components/Select',
|
|
7
|
-
component: Select,
|
|
8
|
-
argTypes: {
|
|
9
|
-
onChange: {
|
|
10
|
-
action: 'onChange event',
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
} as ComponentMeta<typeof Select>;
|
|
14
|
-
|
|
15
|
-
const args = {
|
|
16
|
-
...Select.defaultProps,
|
|
17
|
-
isDisabled: false,
|
|
18
|
-
isInvalid: false,
|
|
19
|
-
isRequired: false,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const children = (
|
|
23
|
-
<>
|
|
24
|
-
<option value="all">All status</option>
|
|
25
|
-
<option value="successful">Successful</option>
|
|
26
|
-
<option value="failed">Failed</option>
|
|
27
|
-
<option value="aborted">Aborted</option>
|
|
28
|
-
<option value="on_hold">On hold</option>
|
|
29
|
-
</>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
const Template: ComponentStory<typeof Select> = (props) => <Select {...props}>{children}</Select>;
|
|
33
|
-
|
|
34
|
-
export const WithProps = Template.bind({});
|
|
35
|
-
WithProps.args = sortObjectByKey({
|
|
36
|
-
...args,
|
|
37
|
-
placeholder: 'Select build status',
|
|
38
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
const SelectTheme = {
|
|
2
|
-
baseStyle: {
|
|
3
|
-
field: {
|
|
4
|
-
appearance: 'none',
|
|
5
|
-
bgGradient: 'linear(to-b, neutral.100, neutral.93)',
|
|
6
|
-
border: '0.0625rem solid',
|
|
7
|
-
borderColor: 'neutral.90',
|
|
8
|
-
borderRadius: '4',
|
|
9
|
-
color: 'purple.10',
|
|
10
|
-
position: 'relative',
|
|
11
|
-
width: '100%',
|
|
12
|
-
_hover: {
|
|
13
|
-
bgGradient: 'linear(to-b, neutral.93, neutral.93)',
|
|
14
|
-
},
|
|
15
|
-
_active: {
|
|
16
|
-
bgGradient: 'linear(to-b, neutral.90, neutral.90)',
|
|
17
|
-
borderColor: 'neutral.80',
|
|
18
|
-
},
|
|
19
|
-
_disabled: {
|
|
20
|
-
color: 'neutral.70',
|
|
21
|
-
pointerEvents: 'none',
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
icon: {
|
|
25
|
-
right: '8',
|
|
26
|
-
_disabled: {
|
|
27
|
-
opacity: '0.2',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
sizes: {
|
|
32
|
-
small: {
|
|
33
|
-
field: {
|
|
34
|
-
height: '32',
|
|
35
|
-
fontSize: '2',
|
|
36
|
-
paddingLeft: '12',
|
|
37
|
-
paddingRight: '32',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
medium: {
|
|
41
|
-
field: {
|
|
42
|
-
height: '48',
|
|
43
|
-
fontSize: '3',
|
|
44
|
-
paddingLeft: '16',
|
|
45
|
-
paddingRight: '32',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export default SelectTheme;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Select as ChakraSelect, SelectProps as ChakraSelectProps } from '@chakra-ui/react';
|
|
3
|
-
import Icon from '../../Old/Icon/Icon';
|
|
4
|
-
|
|
5
|
-
export interface SelectProps extends ChakraSelectProps {
|
|
6
|
-
size?: 'small' | 'medium';
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const Select = (props: SelectProps) => {
|
|
10
|
-
return <ChakraSelect icon={<Icon name="DropdownArrows" />} variant="select" {...props} />;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
Select.defaultProps = {
|
|
14
|
-
size: 'medium',
|
|
15
|
-
} as SelectProps;
|
|
16
|
-
|
|
17
|
-
export default Select;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
.ColorButton {
|
|
2
|
-
border: 0 solid currentColor;
|
|
3
|
-
background-color: transparent;
|
|
4
|
-
line-height: var(--Button--line-height);
|
|
5
|
-
transition-property: border-color, background-color, color;
|
|
6
|
-
transition-duration: var(--transition-duration--base);
|
|
7
|
-
transition-timing-function: var(--transition-timing-function);
|
|
8
|
-
|
|
9
|
-
&:hover {
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&:disabled,
|
|
14
|
-
&[disabled] {
|
|
15
|
-
opacity: 0.5;
|
|
16
|
-
cursor: default;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.ColorButton--size-small {
|
|
21
|
-
padding: var(--Button--padding-small-vertical) var(--Button--padding-small-horizontal);
|
|
22
|
-
border-width: var(--Button--border-small);
|
|
23
|
-
border-radius: var(--size--x1);
|
|
24
|
-
font-size: var(--fontSizes-2);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.ColorButton--size-medium {
|
|
28
|
-
padding: var(--Button--padding-medium-vertical) var(--Button--padding-medium-horizontal);
|
|
29
|
-
border-width: var(--Button--border-medium);
|
|
30
|
-
border-radius: var(--size--x1);
|
|
31
|
-
font-size: var(--fontSizes-3);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.ColorButton--size-large {
|
|
35
|
-
padding: var(--Button--padding-large-vertical) var(--Button--padding-large-horizontal);
|
|
36
|
-
border-width: var(--Button--border-large);
|
|
37
|
-
border-radius: 0.375rem;
|
|
38
|
-
font-size: var(--fontSizes-4);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.ColorButton--color-blue {
|
|
42
|
-
color: var(--color-blue--4);
|
|
43
|
-
|
|
44
|
-
&:hover { background-color: rgba(var(--rgb-blue--2), 0.15); }
|
|
45
|
-
&:active { background-color: rgba(var(--rgb-blue--2), 0.3); }
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.ColorButton--color-grape {
|
|
49
|
-
color: var(--color-eggplant);
|
|
50
|
-
|
|
51
|
-
&:hover { background-color: rgba(var(--rgb-grape--2), 0.15); }
|
|
52
|
-
&:active { background-color: rgba(var(--rgb-grape--2), 0.3); }
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.ColorButton--color-green {
|
|
56
|
-
color: var(--color-green--4);
|
|
57
|
-
|
|
58
|
-
&:hover { background-color: rgba(var(--rgb-green--2), 0.15); }
|
|
59
|
-
&:active { background-color: rgba(var(--rgb-green--2), 0.3); }
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.ColorButton--color-red {
|
|
63
|
-
color: var(--color-red--4);
|
|
64
|
-
|
|
65
|
-
&:hover { background-color: rgba(var(--rgb-red--2), 0.15); }
|
|
66
|
-
&:active { background-color: rgba(var(--rgb-red--2), 0.3); }
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.ColorButton--color-white {
|
|
70
|
-
color: var(--color-white);
|
|
71
|
-
|
|
72
|
-
&:hover { background-color: rgba(var(--rgb-white), 0.15); }
|
|
73
|
-
&:active { background-color: rgba(var(--rgb-white), 0.3); }
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.ColorButton--color-yellow {
|
|
77
|
-
color: var(--color-yellow--5);
|
|
78
|
-
|
|
79
|
-
&:hover { background-color: rgba(var(--rgb-yellow--2), 0.15); }
|
|
80
|
-
&:active { background-color: rgba(var(--rgb-yellow--2), 0.3); }
|
|
81
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { shallow } from 'enzyme';
|
|
3
|
-
import { shallowToJson } from 'enzyme-to-json';
|
|
4
|
-
import ColorButton from './ColorButton';
|
|
5
|
-
|
|
6
|
-
describe('ColorButton', () => {
|
|
7
|
-
test('default template', () => {
|
|
8
|
-
expect(
|
|
9
|
-
shallowToJson(
|
|
10
|
-
shallow(
|
|
11
|
-
<ColorButton color="blue" size="small">
|
|
12
|
-
Content
|
|
13
|
-
</ColorButton>,
|
|
14
|
-
),
|
|
15
|
-
),
|
|
16
|
-
).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
4
|
-
import './ColorButton.css';
|
|
5
|
-
import ButtonSize from './ButtonSize';
|
|
6
|
-
|
|
7
|
-
export interface Props extends FlexProps {
|
|
8
|
-
/** Color of the button */
|
|
9
|
-
color: 'blue' | 'grape' | 'green' | 'red' | 'white' | 'yellow';
|
|
10
|
-
/**
|
|
11
|
-
* Sets the size of the Button. Small allows the Button to fit
|
|
12
|
-
* into smaller spaces, while large will help the button stand
|
|
13
|
-
* out on a page with lots of space.
|
|
14
|
-
*/
|
|
15
|
-
size?: ButtonSize;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
const ColorButton: React.FunctionComponent<Props> = (props: Props) => {
|
|
22
|
-
const { color, size, ...rest } = props;
|
|
23
|
-
|
|
24
|
-
const classes = classnames('ColorButton', `ColorButton--color-${color}`, `ColorButton--size-${size}`);
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<Flex Component="button" {...rest} alignChildren="middle" className={classes} direction="horizontal" gap="x1" />
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default ColorButton;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`ColorButton default template 1`] = `
|
|
4
|
-
<Flex
|
|
5
|
-
Component="button"
|
|
6
|
-
alignChildren="middle"
|
|
7
|
-
className="ColorButton ColorButton--color-blue ColorButton--size-small"
|
|
8
|
-
direction="horizontal"
|
|
9
|
-
gap="x1"
|
|
10
|
-
>
|
|
11
|
-
Content
|
|
12
|
-
</Flex>
|
|
13
|
-
`;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import ColorButton, { Props as ColorButtonProps } from '../Button/ColorButton';
|
|
3
|
-
import ProgressButtonContent, { Props as ProgressButtonContentProps } from './ProgressButtonContent';
|
|
4
|
-
|
|
5
|
-
export interface Props extends ColorButtonProps, ProgressButtonContentProps {}
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A progress indicator colored action button that is useful
|
|
9
|
-
* to provide inline feedback that after a user action,
|
|
10
|
-
* something is happening.
|
|
11
|
-
*/
|
|
12
|
-
const ProgressColorButton: React.FunctionComponent<Props> = (props: Props) => {
|
|
13
|
-
const { children, progressing, ...rest } = props;
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<ColorButton {...rest}>
|
|
17
|
-
<ProgressButtonContent progressing={progressing}>{children}</ProgressButtonContent>
|
|
18
|
-
</ColorButton>
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default ProgressColorButton;
|