@bitrise/bitkit 13.215.0 → 13.217.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
CHANGED
|
@@ -65,13 +65,11 @@ const InputTheme = defineStyle({
|
|
|
65
65
|
pointerEvents: 'none',
|
|
66
66
|
top: '50%',
|
|
67
67
|
transform: 'translateY(-50%)',
|
|
68
|
-
left: '12',
|
|
69
68
|
},
|
|
70
69
|
rightIconWrapper: {
|
|
71
70
|
pointerEvents: 'none',
|
|
72
71
|
top: '50%',
|
|
73
72
|
transform: 'translateY(-50%)',
|
|
74
|
-
right: '12',
|
|
75
73
|
},
|
|
76
74
|
inputContainer: {
|
|
77
75
|
position: 'relative',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeEvent, ReactNode, Ref, useState } from 'react';
|
|
1
|
+
import { ChangeEvent, ReactNode, Ref, useCallback, useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
FormControl,
|
|
4
4
|
FormControlProps,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import Icon, { TypeIconName } from '../../Icon/Icon';
|
|
21
21
|
import { TooltipProps } from '../../Tooltip/Tooltip';
|
|
22
22
|
import FormLabel, { FormLabelProps } from '../FormLabel';
|
|
23
|
-
import { getDataAttributes } from '../../../utils/utils';
|
|
23
|
+
import { getDataAttributes, rem } from '../../../utils/utils';
|
|
24
24
|
|
|
25
25
|
type UsedFormControlProps = Omit<FormControlProps, 'label' | 'onBlur' | 'onChange'>;
|
|
26
26
|
type UsedChakraInputProps = Pick<
|
|
@@ -169,6 +169,22 @@ const Input = forwardRef<InputProps, 'div'>((props, ref) => {
|
|
|
169
169
|
const iconSize = size === 'lg' ? '24' : '16';
|
|
170
170
|
const style = useMultiStyleConfig('Input');
|
|
171
171
|
|
|
172
|
+
const [leftIconPos, setLeftIconPos] = useState(rem(12));
|
|
173
|
+
|
|
174
|
+
const leftAddonRef = useCallback((node: HTMLDivElement | null) => {
|
|
175
|
+
if (node) {
|
|
176
|
+
setLeftIconPos(rem(node.getBoundingClientRect().width + 12));
|
|
177
|
+
}
|
|
178
|
+
}, []);
|
|
179
|
+
|
|
180
|
+
const [rightIconPos, setRightIconPos] = useState(rem(12));
|
|
181
|
+
|
|
182
|
+
const rightAddonRef = useCallback((node: HTMLDivElement | null) => {
|
|
183
|
+
if (node) {
|
|
184
|
+
setRightIconPos(rem(node.getBoundingClientRect().width + 12));
|
|
185
|
+
}
|
|
186
|
+
}, []);
|
|
187
|
+
|
|
172
188
|
return (
|
|
173
189
|
<FormControl {...formControlProps}>
|
|
174
190
|
<FormLabel
|
|
@@ -182,9 +198,9 @@ const Input = forwardRef<InputProps, 'div'>((props, ref) => {
|
|
|
182
198
|
{label}
|
|
183
199
|
</FormLabel>
|
|
184
200
|
<InputGroup sx={style.inputContainer} {...inputWrapperStyle}>
|
|
185
|
-
{leftAddon && <LeftContentWrapper>{leftAddon}</LeftContentWrapper>}
|
|
186
|
-
{
|
|
187
|
-
<InputLeftElement sx={style.leftIconWrapper}>
|
|
201
|
+
{leftAddon && <LeftContentWrapper ref={leftAddonRef}>{leftAddon}</LeftContentWrapper>}
|
|
202
|
+
{leftIconName && (
|
|
203
|
+
<InputLeftElement sx={style.leftIconWrapper} left={leftIconPos}>
|
|
188
204
|
<Icon
|
|
189
205
|
color={leftIconColor}
|
|
190
206
|
name={leftIconName}
|
|
@@ -201,9 +217,13 @@ const Input = forwardRef<InputProps, 'div'>((props, ref) => {
|
|
|
201
217
|
{...dataAttributes}
|
|
202
218
|
onChange={onInputChange}
|
|
203
219
|
/>
|
|
204
|
-
{rightAddon &&
|
|
205
|
-
|
|
206
|
-
|
|
220
|
+
{rightAddon && (
|
|
221
|
+
<RightContentWrapper ref={rightAddonRef} bottom="0">
|
|
222
|
+
{rightAddon}
|
|
223
|
+
</RightContentWrapper>
|
|
224
|
+
)}
|
|
225
|
+
{(rightIconName || isWarning || warningText || isInvalid) && (
|
|
226
|
+
<InputRightElement sx={style.rightIconWrapper} right={rightIconPos}>
|
|
207
227
|
{rightIconName && !isWarning && !warningText && !isInvalid && (
|
|
208
228
|
<Icon
|
|
209
229
|
color={rightIconColor}
|
|
@@ -58,7 +58,7 @@ const Tabletheme = {
|
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
60
|
borderCollapse: 'separate',
|
|
61
|
-
borderColor: '
|
|
61
|
+
borderColor: 'border/minimal',
|
|
62
62
|
borderRadius: '4',
|
|
63
63
|
borderSpacing: 0,
|
|
64
64
|
borderStyle: 'solid',
|
|
@@ -103,10 +103,46 @@ const Tabletheme = {
|
|
|
103
103
|
border: 'none',
|
|
104
104
|
},
|
|
105
105
|
td: {
|
|
106
|
-
|
|
106
|
+
_first: {
|
|
107
|
+
paddingLeft: '12',
|
|
108
|
+
},
|
|
109
|
+
_last: {
|
|
110
|
+
paddingRight: '12',
|
|
111
|
+
},
|
|
112
|
+
borderColor: 'border/regular',
|
|
107
113
|
},
|
|
108
114
|
th: {
|
|
109
|
-
|
|
115
|
+
_first: {
|
|
116
|
+
paddingLeft: '12',
|
|
117
|
+
},
|
|
118
|
+
_last: {
|
|
119
|
+
paddingRight: '12',
|
|
120
|
+
},
|
|
121
|
+
borderColor: 'border/regular',
|
|
122
|
+
},
|
|
123
|
+
thead: {
|
|
124
|
+
backgroundColor: 'transparent',
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
card: {
|
|
128
|
+
table: {
|
|
129
|
+
border: 'none',
|
|
130
|
+
},
|
|
131
|
+
td: {
|
|
132
|
+
_first: {
|
|
133
|
+
paddingLeft: '24',
|
|
134
|
+
},
|
|
135
|
+
_last: {
|
|
136
|
+
paddingRight: '24',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
th: {
|
|
140
|
+
_first: {
|
|
141
|
+
paddingLeft: '24',
|
|
142
|
+
},
|
|
143
|
+
_last: {
|
|
144
|
+
paddingRight: '24',
|
|
145
|
+
},
|
|
110
146
|
},
|
|
111
147
|
thead: {
|
|
112
148
|
backgroundColor: 'transparent',
|
|
@@ -3,7 +3,7 @@ import { forwardRef, Table as ChakraTable, TableProps as ChakraTableProps } from
|
|
|
3
3
|
export interface TableProps extends ChakraTableProps {
|
|
4
4
|
disableRowHover?: boolean;
|
|
5
5
|
isFixed?: boolean;
|
|
6
|
-
variant?: 'borderless' | 'default';
|
|
6
|
+
variant?: 'borderless' | 'default' | 'card';
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
/**
|