@bitrise/bitkit 10.36.2 → 11.0.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 +17 -38
- package/src/Components/Menu/MenuItem.tsx +1 -1
- package/tsconfig.json +0 -5
- package/src/Components/Accordion/Accordion.stories.tsx +0 -63
- package/src/Components/Accordion/Accordion.test.tsx +0 -34
- package/src/Components/AspectRatio/AspectRatio.stories.tsx +0 -24
- package/src/Components/Avatar/Avatar.stories.tsx +0 -15
- package/src/Components/Badge/Badge.stories.tsx +0 -13
- package/src/Components/Box/Box.stories.tsx +0 -20
- package/src/Components/Breadcrumb/Breadcrumb.stories.tsx +0 -49
- package/src/Components/Button/Button.stories.tsx +0 -25
- package/src/Components/ButtonGroup/ButtonGroup.stories.tsx +0 -21
- package/src/Components/Card/Card.stories.tsx +0 -44
- package/src/Components/ColorButton/ColorButton.stories.tsx +0 -30
- package/src/Components/DatePicker/DatePicker.stories.tsx +0 -16
- package/src/Components/DatePicker/DatePicker.test.tsx +0 -94
- package/src/Components/Dialog/Dialog.stories.tsx +0 -82
- package/src/Components/Divider/Divider.stories.tsx +0 -18
- package/src/Components/Dot/Dot.stories.tsx +0 -15
- package/src/Components/Dropdown/Dropdown.stories.tsx +0 -154
- package/src/Components/Dropdown/Dropdown.test.tsx +0 -626
- package/src/Components/EmptyState/EmptyState.stories.tsx +0 -18
- package/src/Components/Fade/Fade.stories.tsx +0 -5
- package/src/Components/Form/Checkbox/Checkbox.stories.tsx +0 -43
- package/src/Components/Form/Input/Input.stories.tsx +0 -71
- package/src/Components/Form/Radio/Radio.stories.tsx +0 -35
- package/src/Components/Form/Textarea/Textarea.stories.tsx +0 -20
- package/src/Components/Form/Textarea/Textarea.test.tsx +0 -35
- package/src/Components/Icon/Icon.stories.tsx +0 -10
- package/src/Components/IconButton/IconButton.stories.tsx +0 -27
- package/src/Components/Icons/index.stories.tsx +0 -60
- package/src/Components/Image/Image.stories.tsx +0 -15
- package/src/Components/LightBox/LightBox.stories.tsx +0 -39
- package/src/Components/Link/Link.stories.tsx +0 -28
- package/src/Components/List/List.stories.tsx +0 -24
- package/src/Components/Menu/Menu.stories.tsx +0 -90
- package/src/Components/Notification/Notification.stories.tsx +0 -84
- package/src/Components/OverflowMenu/OverflowMenu.stories.tsx +0 -30
- package/src/Components/Popover/Popover.stories.tsx +0 -19
- package/src/Components/ProgressBar/ProgressBar.stories.tsx +0 -11
- package/src/Components/ProgressBitbot/ProgressBitbot.stories.tsx +0 -12
- package/src/Components/ProgressSpinner/ProgressSpinner.stories.tsx +0 -12
- package/src/Components/Ribbon/Ribbon.stories.tsx +0 -35
- package/src/Components/Select/Select.stories.tsx +0 -100
- package/src/Components/Select/Select.test.tsx +0 -96
- package/src/Components/Skeleton/Skeleton.stories.tsx +0 -18
- package/src/Components/Table/Table.stories.tsx +0 -216
- package/src/Components/Tabs/Tabs.stories.tsx +0 -65
- package/src/Components/Tabs/Tabs.test.tsx +0 -36
- package/src/Components/Text/Text.stories.tsx +0 -22
- package/src/Components/Toast/Toast.stories.tsx +0 -30
- package/src/Components/Toggle/Toggle.stories.tsx +0 -19
- package/src/Foundations/Colors/Colors.stories.mdx +0 -9
- package/src/Foundations/Radii/Radii.examples.tsx +0 -25
- package/src/Foundations/Radii/Radii.stories.mdx +0 -6
- package/src/Foundations/Responsive/Responsive.examples.tsx +0 -95
- package/src/Foundations/Responsive/Responsive.stories.mdx +0 -6
- package/src/Foundations/Shadows/Shadows.examples.tsx +0 -24
- package/src/Foundations/Shadows/Shadows.stories.mdx +0 -6
- package/src/Foundations/Sizes/Sizes.examples.tsx +0 -25
- package/src/Foundations/Sizes/Sizes.stories.mdx +0 -6
- package/src/Foundations/Typography/Typography.examples.tsx +0 -63
- package/src/Foundations/Typography/Typography.stories.mdx +0 -8
- package/src/tsconfig.tsbuildinfo +0 -1
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
2
|
-
import { Story, ComponentMeta } from '@storybook/react';
|
|
3
|
-
import { useDisclosure } from '@chakra-ui/react';
|
|
4
|
-
import { sortObjectByKey } from '../../utils/storyUtils';
|
|
5
|
-
import Button from '../Button/Button';
|
|
6
|
-
import Link from '../Link/Link';
|
|
7
|
-
import Dialog, { DialogProps } from './Dialog';
|
|
8
|
-
import DialogBody from './DialogBody';
|
|
9
|
-
import DialogFooter from './DialogFooter';
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
title: 'Components/Dialog',
|
|
13
|
-
component: Dialog,
|
|
14
|
-
} as ComponentMeta<typeof Dialog>;
|
|
15
|
-
|
|
16
|
-
const TextContent = ({ lotsOfContent = false }: { lotsOfContent?: boolean }) => (
|
|
17
|
-
<>
|
|
18
|
-
{[...Array(lotsOfContent ? 10 : 1)].map((_key, index) => (
|
|
19
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
20
|
-
<p key={index}>
|
|
21
|
-
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a
|
|
22
|
-
galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also
|
|
23
|
-
the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the
|
|
24
|
-
release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software
|
|
25
|
-
like Aldus PageMaker including versions of Lorem Ipsum.
|
|
26
|
-
</p>
|
|
27
|
-
))}
|
|
28
|
-
</>
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
interface StoryType extends DialogProps {
|
|
32
|
-
lotsOfContent: boolean;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const WithProps: Story<StoryType> = ({ lotsOfContent, ...props }: StoryType) => {
|
|
36
|
-
const { variant } = props;
|
|
37
|
-
const { isOpen, onClose, onOpen } = useDisclosure();
|
|
38
|
-
|
|
39
|
-
const getContent = () => {
|
|
40
|
-
if (variant === 'empty') {
|
|
41
|
-
return (
|
|
42
|
-
<DialogBody padding="0">
|
|
43
|
-
<TextContent lotsOfContent={lotsOfContent} />
|
|
44
|
-
<Link as="button" colorScheme="purple" onClick={onClose} marginTop="16">
|
|
45
|
-
Link or button or anything to close this Dialog with onClick
|
|
46
|
-
</Link>
|
|
47
|
-
</DialogBody>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
return (
|
|
51
|
-
<>
|
|
52
|
-
<DialogBody>
|
|
53
|
-
<TextContent lotsOfContent={lotsOfContent} />
|
|
54
|
-
</DialogBody>
|
|
55
|
-
<DialogFooter>
|
|
56
|
-
<Button marginRight="auto" variant="tertiary">
|
|
57
|
-
Tertiary
|
|
58
|
-
</Button>
|
|
59
|
-
<Button variant="secondary">Secondary</Button>
|
|
60
|
-
<Button>Primary</Button>
|
|
61
|
-
</DialogFooter>
|
|
62
|
-
</>
|
|
63
|
-
);
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<>
|
|
68
|
-
<Button onClick={onOpen}>Open Dialog</Button>
|
|
69
|
-
<Dialog padding={variant === 'empty' ? '16' : '0'} {...props} isOpen={isOpen} onClose={onClose}>
|
|
70
|
-
{getContent()}
|
|
71
|
-
</Dialog>
|
|
72
|
-
</>
|
|
73
|
-
);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
WithProps.args = sortObjectByKey({
|
|
77
|
-
...Dialog.defaultProps,
|
|
78
|
-
title: 'Title',
|
|
79
|
-
lotsOfContent: false,
|
|
80
|
-
dataTestid: 'test-modal',
|
|
81
|
-
trapFocus: false,
|
|
82
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
2
|
-
import { sortObjectByKey } from '../../utils/storyUtils';
|
|
3
|
-
import Box from '../Box/Box';
|
|
4
|
-
import Divider from './Divider';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Components/Divider',
|
|
8
|
-
component: Divider,
|
|
9
|
-
} as ComponentMeta<typeof Divider>;
|
|
10
|
-
|
|
11
|
-
const Template: ComponentStory<typeof Divider> = ({ ...props }) => (
|
|
12
|
-
<Box height="64">
|
|
13
|
-
<Divider {...props} />
|
|
14
|
-
</Box>
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
export const WithProps = Template.bind({});
|
|
18
|
-
WithProps.args = sortObjectByKey(Divider.defaultProps);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
2
|
-
import Dot from './Dot';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Components/Dot',
|
|
6
|
-
component: Dot,
|
|
7
|
-
} as ComponentMeta<typeof Dot>;
|
|
8
|
-
|
|
9
|
-
const Template: ComponentStory<typeof Dot> = ({ ...props }) => <Dot {...props} />;
|
|
10
|
-
|
|
11
|
-
export const WithProps = Template.bind({});
|
|
12
|
-
WithProps.args = {
|
|
13
|
-
size: 32,
|
|
14
|
-
backgroundColor: 'green.50',
|
|
15
|
-
};
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { ReactNode, useState } from 'react';
|
|
2
|
-
import { ComponentStoryFn } from '@storybook/react';
|
|
3
|
-
import Notification from '../Notification/Notification';
|
|
4
|
-
import Avatar from '../Avatar/Avatar';
|
|
5
|
-
import Provider from '../Provider/Provider';
|
|
6
|
-
import Dialog from '../Dialog/Dialog';
|
|
7
|
-
import DialogBody from '../Dialog/DialogBody';
|
|
8
|
-
import Dropdown, {
|
|
9
|
-
DropdownGroup,
|
|
10
|
-
DropdownOption,
|
|
11
|
-
DropdownDetailedOption,
|
|
12
|
-
NoResultsFound,
|
|
13
|
-
DropdownSearch,
|
|
14
|
-
} from './Dropdown';
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
title: 'Components/Dropdown',
|
|
18
|
-
component: Dropdown,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const opts = [
|
|
22
|
-
{ value: 'x1', label: 'text1' },
|
|
23
|
-
{ value: 'x2', label: 'text2' },
|
|
24
|
-
{ value: 'x3', label: 'text3' },
|
|
25
|
-
{ value: 'x4', label: 'text4' },
|
|
26
|
-
];
|
|
27
|
-
export const CustomSearch = () => {
|
|
28
|
-
const [searchValue, setSearchValue] = useState('');
|
|
29
|
-
const [options, setOptions] = useState<ReactNode[]>([]);
|
|
30
|
-
const searchOnChange = (nv: string) => {
|
|
31
|
-
setSearchValue(nv);
|
|
32
|
-
setOptions(
|
|
33
|
-
opts
|
|
34
|
-
.filter((opt) => opt.label.includes(nv))
|
|
35
|
-
.map((opt) => (
|
|
36
|
-
<DropdownOption value={opt.value} key={opt.value}>
|
|
37
|
-
{opt.label}
|
|
38
|
-
</DropdownOption>
|
|
39
|
-
)),
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
return <Dropdown search={<DropdownSearch value={searchValue} onChange={searchOnChange} />}>{options}</Dropdown>;
|
|
43
|
-
};
|
|
44
|
-
export const CustomSearchError = () => {
|
|
45
|
-
return (
|
|
46
|
-
<Dropdown search={<DropdownSearch />}>
|
|
47
|
-
<NoResultsFound>
|
|
48
|
-
<Notification status="error">Error</Notification>
|
|
49
|
-
</NoResultsFound>
|
|
50
|
-
</Dropdown>
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const WithDetail = () => {
|
|
55
|
-
return (
|
|
56
|
-
<Dropdown>
|
|
57
|
-
<DropdownDetailedOption value="user1" icon={<Avatar name="some" />} title="hello" subtitle="sub" />
|
|
58
|
-
</Dropdown>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const WithLongOptions = () => {
|
|
63
|
-
return (
|
|
64
|
-
<Dropdown defaultValue="y" w="150px">
|
|
65
|
-
<DropdownOption value="y">
|
|
66
|
-
some very long option text longer than the component with verylongwordwithoutbreakopportunities
|
|
67
|
-
</DropdownOption>
|
|
68
|
-
<DropdownOption>some very long option text longer than the component</DropdownOption>
|
|
69
|
-
</Dropdown>
|
|
70
|
-
);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const WithoutSearch = () => {
|
|
74
|
-
return (
|
|
75
|
-
<Dropdown search={false}>
|
|
76
|
-
<DropdownOption>opt1</DropdownOption>
|
|
77
|
-
<DropdownOption>opt2</DropdownOption>
|
|
78
|
-
<DropdownOption>opt3</DropdownOption>
|
|
79
|
-
</Dropdown>
|
|
80
|
-
);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export const Default: ComponentStoryFn<typeof Dropdown> = (args) => {
|
|
84
|
-
return (
|
|
85
|
-
<form
|
|
86
|
-
onSubmit={(ev) => {
|
|
87
|
-
ev.preventDefault();
|
|
88
|
-
const data = new FormData(ev.target as HTMLFormElement);
|
|
89
|
-
console.log(data.get('dropdown'));
|
|
90
|
-
}}
|
|
91
|
-
>
|
|
92
|
-
<Dropdown aria-label="test" name="dropdown" w="800px" {...args}>
|
|
93
|
-
<DropdownOption>Unset</DropdownOption>
|
|
94
|
-
<DropdownOption value="x1">text1</DropdownOption>
|
|
95
|
-
<DropdownOption value="x2">text2</DropdownOption>
|
|
96
|
-
<DropdownOption value="x3">text3</DropdownOption>
|
|
97
|
-
<DropdownOption value="x4">text4</DropdownOption>
|
|
98
|
-
<DropdownGroup label="test">
|
|
99
|
-
<DropdownOption value="x5">text5</DropdownOption>
|
|
100
|
-
<DropdownOption value="x6">text6</DropdownOption>
|
|
101
|
-
<DropdownOption value="x7">text7</DropdownOption>
|
|
102
|
-
</DropdownGroup>
|
|
103
|
-
<DropdownOption value="v1">
|
|
104
|
-
<div>label</div>
|
|
105
|
-
</DropdownOption>
|
|
106
|
-
<DropdownOption value="v2">
|
|
107
|
-
<div>label</div>
|
|
108
|
-
</DropdownOption>
|
|
109
|
-
</Dropdown>
|
|
110
|
-
<button type="submit">Send</button>
|
|
111
|
-
</form>
|
|
112
|
-
);
|
|
113
|
-
};
|
|
114
|
-
export const InsideDialog = () => {
|
|
115
|
-
return (
|
|
116
|
-
<Provider>
|
|
117
|
-
<Dialog isOpen isClosable title="Dropdown inside Dialog">
|
|
118
|
-
<DialogBody paddingBottom="24">
|
|
119
|
-
<Dropdown search={false}>
|
|
120
|
-
<DropdownOption value="x">Test Opt1</DropdownOption>
|
|
121
|
-
</Dropdown>
|
|
122
|
-
</DialogBody>
|
|
123
|
-
</Dialog>
|
|
124
|
-
</Provider>
|
|
125
|
-
);
|
|
126
|
-
};
|
|
127
|
-
export const WithIcon = () => {
|
|
128
|
-
return (
|
|
129
|
-
<Dropdown iconName="Calendar" defaultValue="daily">
|
|
130
|
-
<DropdownOption value="daily">Daily</DropdownOption>
|
|
131
|
-
<DropdownOption value="weekly">Weekly</DropdownOption>
|
|
132
|
-
<DropdownOption value="monthly">Monthly</DropdownOption>
|
|
133
|
-
</Dropdown>
|
|
134
|
-
);
|
|
135
|
-
};
|
|
136
|
-
export const WithCustomLabel = () => {
|
|
137
|
-
const [value, setValue] = useState('custom');
|
|
138
|
-
|
|
139
|
-
return (
|
|
140
|
-
<Dropdown
|
|
141
|
-
iconName="Calendar"
|
|
142
|
-
value={value}
|
|
143
|
-
onChange={(event) => setValue(event.target.value as string)}
|
|
144
|
-
formLabel={value === 'custom' ? '18 Aug - 19 Aug' : value}
|
|
145
|
-
search={false}
|
|
146
|
-
>
|
|
147
|
-
<DropdownOption value="Last 30 days">Last 30 days</DropdownOption>
|
|
148
|
-
<DropdownOption value="Last 40 days">Last 45 days</DropdownOption>
|
|
149
|
-
<DropdownOption value="Last 50 days">Last 60 days</DropdownOption>
|
|
150
|
-
<DropdownOption value="Last 90 days">Last 90 days</DropdownOption>
|
|
151
|
-
<DropdownOption value="custom">Custom</DropdownOption>
|
|
152
|
-
</Dropdown>
|
|
153
|
-
);
|
|
154
|
-
};
|