@bitrise/bitkit 10.2.1 → 10.2.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 +1 -1
- package/src/Old/Dropdown/Dropdown.tsx +52 -47
- package/src/Old/Status/Status500.tsx +2 -2
- package/src/old.ts +0 -30
- package/src/tsconfig.tsbuildinfo +1 -1
- package/src/Old/Dropdown/DropdownButton.tsx +0 -14
- package/src/Old/Dropdown/DropdownMenus.tsx +0 -14
- package/src/Old/Image/Image.css +0 -4
- package/src/Old/Image/Image.tsx +0 -15
- package/src/Old/List/List.css +0 -3
- package/src/Old/List/List.tsx +0 -14
- package/src/Old/List/ListItem.tsx +0 -13
- package/src/Old/Portal/Portal.tsx +0 -15
- package/src/Old/RadioButton/RadioButton.css +0 -46
- package/src/Old/RadioButton/RadioButton.tsx +0 -27
- package/src/Old/Status/Status404.tsx +0 -43
package/package.json
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import Placement from '../Placement/Placement';
|
|
3
|
-
import PlacementManager from '../Placement/PlacementManager';
|
|
4
|
-
import PlacementReference from '../Placement/PlacementReference';
|
|
5
2
|
import Text from '../../Components/Text/Text';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
3
|
+
import Popover from '../../Components/Popover/Popover';
|
|
4
|
+
import PopoverTrigger from '../../Components/Popover/PopoverTrigger';
|
|
5
|
+
import PopoverContent from '../../Components/Popover/PopoverContent';
|
|
6
|
+
import Button, { ButtonProps } from '../../Components/Button/Button';
|
|
9
7
|
import DropdownMenuItemGroup from './DropdownMenuItemGroup';
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import DropdownMenuItem from './DropdownMenuItem';
|
|
9
|
+
import DropdownMenu from './DropdownMenu';
|
|
12
10
|
|
|
13
11
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
12
|
type DropdownValue = any;
|
|
@@ -22,7 +20,7 @@ interface OptionGroup {
|
|
|
22
20
|
options: DropdownValue[];
|
|
23
21
|
}
|
|
24
22
|
|
|
25
|
-
export interface Props extends
|
|
23
|
+
export interface Props extends ButtonProps {
|
|
26
24
|
/** Handler for the value that is selected */
|
|
27
25
|
onChange?: (value: DropdownValue) => void;
|
|
28
26
|
/** Array of options that can be selected */
|
|
@@ -40,56 +38,63 @@ export interface Props extends DropdownButtonProps {
|
|
|
40
38
|
*/
|
|
41
39
|
const Dropdown: React.FunctionComponent<Props> = (props: Props) => {
|
|
42
40
|
const { children, options, onChange, selected, maxHeight, menuClassName, ...rest } = props;
|
|
43
|
-
const [visible, setVisible] = useState(false);
|
|
44
41
|
|
|
45
42
|
const handleChange = (value: DropdownValue) => {
|
|
46
43
|
if (onChange) {
|
|
47
44
|
onChange(value);
|
|
48
45
|
}
|
|
49
|
-
setVisible(false);
|
|
50
46
|
};
|
|
51
47
|
|
|
52
|
-
const renderOption = ({ text, value }: Option) => (
|
|
53
|
-
<DropdownMenuItem
|
|
48
|
+
const renderOption = ({ text, value }: Option, onClose: () => void) => (
|
|
49
|
+
<DropdownMenuItem
|
|
50
|
+
onClick={() => {
|
|
51
|
+
handleChange(value);
|
|
52
|
+
onClose();
|
|
53
|
+
}}
|
|
54
|
+
selected={selected === value}
|
|
55
|
+
width="100%"
|
|
56
|
+
>
|
|
54
57
|
{text}
|
|
55
58
|
</DropdownMenuItem>
|
|
56
59
|
);
|
|
57
60
|
|
|
58
61
|
return (
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
<
|
|
76
|
-
{
|
|
77
|
-
|
|
78
|
-
{
|
|
79
|
-
|
|
80
|
-
{option.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
62
|
+
<Popover matchWidth>
|
|
63
|
+
{({ onClose }) => (
|
|
64
|
+
<>
|
|
65
|
+
<PopoverTrigger>
|
|
66
|
+
<Button
|
|
67
|
+
width="100%"
|
|
68
|
+
variant="secondary"
|
|
69
|
+
rightIconName="ChevronDown"
|
|
70
|
+
justifyContent="space-between"
|
|
71
|
+
{...rest}
|
|
72
|
+
>
|
|
73
|
+
<Text as="span" hasEllipsis>
|
|
74
|
+
{children}
|
|
75
|
+
</Text>
|
|
76
|
+
</Button>
|
|
77
|
+
</PopoverTrigger>
|
|
78
|
+
<PopoverContent>
|
|
79
|
+
<DropdownMenu className={menuClassName} maxHeight={maxHeight} width="100%">
|
|
80
|
+
{options.map((option) => (
|
|
81
|
+
<React.Fragment key={option.text}>
|
|
82
|
+
{'options' in option ? (
|
|
83
|
+
<DropdownMenuItemGroup text={option.text}>
|
|
84
|
+
{option.options.map((groupOption) => (
|
|
85
|
+
<React.Fragment key={groupOption.value}>{renderOption(groupOption, onClose)}</React.Fragment>
|
|
86
|
+
))}
|
|
87
|
+
</DropdownMenuItemGroup>
|
|
88
|
+
) : (
|
|
89
|
+
renderOption(option, onClose)
|
|
90
|
+
)}
|
|
91
|
+
</React.Fragment>
|
|
92
|
+
))}
|
|
93
|
+
</DropdownMenu>
|
|
94
|
+
</PopoverContent>
|
|
95
|
+
</>
|
|
96
|
+
)}
|
|
97
|
+
</Popover>
|
|
93
98
|
);
|
|
94
99
|
};
|
|
95
100
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useMediaQuery } from '../hooks';
|
|
3
3
|
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
4
|
-
import Image from '
|
|
4
|
+
import Image from '../../Components/Image/Image';
|
|
5
5
|
import Text from '../../Components/Text/Text';
|
|
6
6
|
|
|
7
7
|
export type Props = FlexProps;
|
|
@@ -32,7 +32,7 @@ const Status500: React.FunctionComponent<Props> = (props: Props) => {
|
|
|
32
32
|
Everything is under control, we will be back soon. Until then keep refreshing your browser.
|
|
33
33
|
</Text>
|
|
34
34
|
|
|
35
|
-
<Image
|
|
35
|
+
<Image marginY="64" src="https://bitrise-bitkit.s3.us-east-2.amazonaws.com/assets/Status500.svg" />
|
|
36
36
|
</Flex>
|
|
37
37
|
);
|
|
38
38
|
};
|
package/src/old.ts
CHANGED
|
@@ -18,12 +18,6 @@ export { default as DatePicker } from './Old/DatePicker/DatePicker';
|
|
|
18
18
|
export type { Props as DropdownProps } from './Old/Dropdown/Dropdown';
|
|
19
19
|
export { default as Dropdown } from './Old/Dropdown/Dropdown';
|
|
20
20
|
|
|
21
|
-
export type { Props as DropdownButtonProps } from './Old/Dropdown/DropdownButton';
|
|
22
|
-
export { default as DropdownButton } from './Old/Dropdown/DropdownButton';
|
|
23
|
-
|
|
24
|
-
export type { Props as DropdownMenusProps } from './Old/Dropdown/DropdownMenus';
|
|
25
|
-
export { default as DropdownMenus } from './Old/Dropdown/DropdownMenus';
|
|
26
|
-
|
|
27
21
|
export type { Props as DropdownMenuProps } from './Old/Dropdown/DropdownMenu';
|
|
28
22
|
export { default as DropdownMenu } from './Old/Dropdown/DropdownMenu';
|
|
29
23
|
|
|
@@ -63,24 +57,6 @@ export { default as Logo } from './Old/Logo/Logo';
|
|
|
63
57
|
export type { Props as NotificationProps } from './Old/Notification/Notification';
|
|
64
58
|
export { default as Notification } from './Old/Notification/Notification';
|
|
65
59
|
|
|
66
|
-
export type { Props as PlacementProps } from './Old/Placement/Placement';
|
|
67
|
-
export { default as Placement } from './Old/Placement/Placement';
|
|
68
|
-
|
|
69
|
-
export type { Props as PlacementAreaProps } from './Old/Placement/PlacementArea';
|
|
70
|
-
export { default as PlacementArea } from './Old/Placement/PlacementArea';
|
|
71
|
-
|
|
72
|
-
export type { Props as PlacementArrowProps } from './Old/Placement/PlacementArrow';
|
|
73
|
-
export { default as PlacementArrow } from './Old/Placement/PlacementArrow';
|
|
74
|
-
|
|
75
|
-
export type { Props as PlacementManagerProps } from './Old/Placement/PlacementManager';
|
|
76
|
-
export { default as PlacementManager } from './Old/Placement/PlacementManager';
|
|
77
|
-
|
|
78
|
-
export type { Props as PlacementReferenceProps } from './Old/Placement/PlacementReference';
|
|
79
|
-
export { default as PlacementReference } from './Old/Placement/PlacementReference';
|
|
80
|
-
|
|
81
|
-
export type { Props as PortalProps } from './Old/Portal/Portal';
|
|
82
|
-
export { default as Portal } from './Old/Portal/Portal';
|
|
83
|
-
|
|
84
60
|
export type { Props as ProgressBarProps } from './Old/Progress/ProgressBar';
|
|
85
61
|
export { default as ProgressBar } from './Old/Progress/ProgressBar';
|
|
86
62
|
|
|
@@ -90,9 +66,6 @@ export { default as ProgressBitbot } from './Old/Progress/ProgressBitbot';
|
|
|
90
66
|
export type { Props as ProgressSpinnerProps } from './Old/Progress/ProgressSpinner';
|
|
91
67
|
export { default as ProgressSpinner } from './Old/Progress/ProgressSpinner';
|
|
92
68
|
|
|
93
|
-
export type { Props as RadioButtonProps } from './Old/RadioButton/RadioButton';
|
|
94
|
-
export { default as RadioButton } from './Old/RadioButton/RadioButton';
|
|
95
|
-
|
|
96
69
|
export type { Props as RibbonProps } from './Old/Ribbon/Ribbon';
|
|
97
70
|
export { default as Ribbon } from './Old/Ribbon/Ribbon';
|
|
98
71
|
|
|
@@ -102,9 +75,6 @@ export { default as Skeleton } from './Old/Skeleton/Skeleton';
|
|
|
102
75
|
export type { Props as SkeletonBoxProps } from './Old/Skeleton/SkeletonBox';
|
|
103
76
|
export { default as SkeletonBox } from './Old/Skeleton/SkeletonBox';
|
|
104
77
|
|
|
105
|
-
export type { Props as Status404Props } from './Old/Status/Status404';
|
|
106
|
-
export { default as Status404 } from './Old/Status/Status404';
|
|
107
|
-
|
|
108
78
|
export type { Props as Status500Props } from './Old/Status/Status500';
|
|
109
79
|
export { default as Status500 } from './Old/Status/Status500';
|
|
110
80
|
|