@bitrise/bitkit 9.14.0-alpha-chakra.7 → 9.14.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.
Files changed (34) hide show
  1. package/package.json +11 -12
  2. package/src/Components/Menu/Menu.theme.ts +3 -3
  3. package/src/Old/AddonBeam/AddonBeam.tsx +2 -2
  4. package/src/Old/Avatar/Avatar.tsx +1 -1
  5. package/src/Old/Base/Base.tsx +56 -74
  6. package/src/Old/Checkbox/Checkbox.tsx +1 -1
  7. package/src/Old/DatePicker/DatePickerMonth.tsx +1 -1
  8. package/src/Old/Dropdown/DropdownMenuItemGroup.tsx +1 -1
  9. package/src/Old/Input/InputInlineHelp.tsx +1 -1
  10. package/src/Old/Input/InputLabel.tsx +1 -1
  11. package/src/Old/Link/Link.tsx +1 -1
  12. package/src/Old/Modal/Modal.tsx +1 -1
  13. package/src/Old/Modal/ModalHeader.tsx +1 -1
  14. package/src/Old/Modal/ModalHeaderProgress.tsx +1 -1
  15. package/src/Old/Modal/ModalTitle.tsx +1 -1
  16. package/src/Old/Placement/PlacementArrowPropsContext.ts +1 -1
  17. package/src/Old/Placement/PlacementPopper.tsx +1 -1
  18. package/src/Old/RadioButton/RadioButton.tsx +1 -1
  19. package/src/Old/Sidebar/SidebarSubMenuItem.tsx +1 -1
  20. package/src/Old/Skeleton/Skeleton.css +5 -5
  21. package/src/Old/Skeleton/Skeleton.tsx +3 -13
  22. package/src/Old/Skeleton/SkeletonBox.tsx +1 -1
  23. package/src/Old/Table/TableCell.tsx +1 -1
  24. package/src/Old/Tooltip/Tooltip.tsx +2 -2
  25. package/src/index.ts +0 -6
  26. package/src/old.ts +3 -0
  27. package/src/theme.ts +0 -2
  28. package/src/tsconfig.tsbuildinfo +1 -1
  29. package/src/Components/Dropdown/Dropdown.stories.tsx +0 -63
  30. package/src/Components/Dropdown/Dropdown.styles.ts +0 -82
  31. package/src/Components/Dropdown/Dropdown.tsx +0 -64
  32. package/src/Components/Select/Select.stories.tsx +0 -38
  33. package/src/Components/Select/Select.theme.ts +0 -51
  34. package/src/Components/Select/Select.tsx +0 -17
@@ -1,63 +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
- },
17
- } as ComponentMeta<typeof Dropdown>;
18
-
19
- const buildStatusOptions = [
20
- { value: 'all', label: 'All status' },
21
- { value: 'successful', label: 'Successful' },
22
- { value: 'failed', label: 'Failed' },
23
- { value: 'aborted', label: 'Aborted' },
24
- {
25
- value: 'on_hold',
26
- label:
27
- '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',
28
- },
29
- ];
30
-
31
- const flavorOptions = [
32
- { value: 'vanilla', label: 'Vanilla' },
33
- { value: 'chocolate', label: 'Chocolate' },
34
- { value: 'strawberry', label: 'Strawberry' },
35
- { value: 'salted-caramel', label: 'Salted Caramel' },
36
- ];
37
-
38
- const groupedOptions = [
39
- {
40
- label: 'Build status',
41
- options: buildStatusOptions,
42
- },
43
- {
44
- label: 'Flavours',
45
- options: flavorOptions,
46
- },
47
- ];
48
-
49
- const Template: ComponentStory<typeof Dropdown> = (props) => <Dropdown {...props} />;
50
-
51
- export const WithProps = Template.bind({});
52
- WithProps.args = sortObjectByKey({
53
- ...Dropdown.defaultProps,
54
- options: buildStatusOptions,
55
- placeholder: 'Select build status',
56
- });
57
-
58
- export const WithOptionGroups = Template.bind({});
59
- WithOptionGroups.args = sortObjectByKey({
60
- ...Dropdown.defaultProps,
61
- options: groupedOptions,
62
- placeholder: 'Select something 🤔',
63
- });
@@ -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;