@bitrise/bitkit 10.29.0 → 10.30.0-alpha-input.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 +2 -1
- package/src/Components/Dropdown/Dropdown.tsx +14 -25
- package/src/Components/Form/FormHelperText/FormHelperText.tsx +9 -0
- package/src/Components/Form/FormLabel/FormLabel.tsx +9 -0
- package/src/Components/Form/Input/Input.stories.tsx +52 -0
- package/src/Components/Form/Input/Input.theme.ts +38 -0
- package/src/Components/Form/Input/Input.tsx +133 -0
- package/src/Components/Form/Textarea/Textarea.theme.ts +5 -30
- package/src/Components/Form/Textarea/Textarea.tsx +2 -2
- package/src/Components/Select/Select.tsx +2 -2
- package/src/Components/Toggle/Toggle.tsx +2 -2
- package/src/index.ts +9 -0
- package/src/old.ts +0 -15
- package/src/theme.ts +1 -1
- package/src/tsconfig.tsbuildinfo +1 -1
- package/src/Components/Input/Input.theme.ts +0 -20
- package/src/Old/Input/InputContainer.tsx +0 -30
- package/src/Old/Input/InputContent.tsx +0 -35
- package/src/Old/Input/InputLabel.tsx +0 -16
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SystemStyleObject } from '@chakra-ui/react';
|
|
2
|
-
|
|
3
|
-
const InputTheme = {
|
|
4
|
-
baseStyle: {
|
|
5
|
-
field: <SystemStyleObject>{
|
|
6
|
-
height: '48',
|
|
7
|
-
borderRadius: '4',
|
|
8
|
-
borderStyle: 'solid',
|
|
9
|
-
borderColor: 'neutral.90',
|
|
10
|
-
borderWidth: '1px',
|
|
11
|
-
boxShadow: 'inner',
|
|
12
|
-
_focusVisible: {
|
|
13
|
-
boxShadow: 'outline',
|
|
14
|
-
outline: 'none',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default InputTheme;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
4
|
-
import './Input.css';
|
|
5
|
-
|
|
6
|
-
export interface Props extends FlexProps {
|
|
7
|
-
/** Applies styling to indicate the input is disabled */
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
/** Applies styling to indicate the input is invalid */
|
|
10
|
-
invalid?: boolean;
|
|
11
|
-
/** Applies styling to indicate the input is readOnly */
|
|
12
|
-
readOnly?: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* The wrapping container component for the Input and InputContent components.
|
|
17
|
-
* Provides styling such as the border and background.
|
|
18
|
-
*/
|
|
19
|
-
const InputContainer: React.FunctionComponent<Props> = (props: Props) => {
|
|
20
|
-
const { disabled, invalid, readOnly, ...rest } = props;
|
|
21
|
-
const classes = classnames('Input__container', {
|
|
22
|
-
'Input__container--disabled': disabled,
|
|
23
|
-
'Input__container--invalid': invalid,
|
|
24
|
-
'Input__container--readonly': readOnly,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
return <Flex {...rest} Component="label" className={classes} direction="horizontal" />;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export default InputContainer;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
4
|
-
import './Input.css';
|
|
5
|
-
|
|
6
|
-
export interface Props extends FlexProps {
|
|
7
|
-
/** Sets specific styling for if the content appears inside or
|
|
8
|
-
* outside the input element.
|
|
9
|
-
*/
|
|
10
|
-
outside?: boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* The content component that holds input content like the Input element
|
|
15
|
-
* or icons.
|
|
16
|
-
*/
|
|
17
|
-
const InputContent: React.FunctionComponent<Props> = (props: Props) => {
|
|
18
|
-
const { outside, ...rest } = props;
|
|
19
|
-
const classes = classnames('Input__content', {
|
|
20
|
-
'Input__content--outside': outside,
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<Flex
|
|
25
|
-
{...rest}
|
|
26
|
-
alignChildrenVertical="middle"
|
|
27
|
-
className={classes}
|
|
28
|
-
direction="horizontal"
|
|
29
|
-
gap="x2"
|
|
30
|
-
grow={!outside}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default InputContent;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import Text, { TextProps } from '../../Components/Text/Text';
|
|
3
|
-
|
|
4
|
-
export type Props = {
|
|
5
|
-
htmlFor?: string | undefined;
|
|
6
|
-
} & TextProps;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Provides specific styling for a label that accompanies an
|
|
10
|
-
* input.
|
|
11
|
-
*/
|
|
12
|
-
const InputLabel: React.FunctionComponent<Props> = (props: Props) => {
|
|
13
|
-
return <Text as="label" marginY="4" size="3" color="purple.10" fontWeight="bold" {...props} />;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default InputLabel;
|