@bitrise/bitkit 13.119.0 → 13.121.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
|
@@ -25,12 +25,14 @@ export interface TagsInputProps extends UsedFormControlProps {
|
|
|
25
25
|
invalidValues?: string[];
|
|
26
26
|
errorText?: ReactNode;
|
|
27
27
|
helperText?: ReactNode;
|
|
28
|
+
isReadOnly?: boolean;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
const TagsInput = ({
|
|
31
32
|
errorText,
|
|
32
33
|
helperText,
|
|
33
34
|
invalidValues = [],
|
|
35
|
+
isReadOnly,
|
|
34
36
|
label,
|
|
35
37
|
maxCount,
|
|
36
38
|
onNewValues,
|
|
@@ -74,7 +76,7 @@ const TagsInput = ({
|
|
|
74
76
|
const isInvalid = rest.isInvalid || (maxCount && value.length > maxCount) || Boolean(errorText);
|
|
75
77
|
const id = useId();
|
|
76
78
|
return (
|
|
77
|
-
<FormControl {...rest} isInvalid={isInvalid}>
|
|
79
|
+
<FormControl {...rest} isInvalid={isInvalid} isReadOnly={isReadOnly}>
|
|
78
80
|
<Box alignItems="center" display={label || maxCount ? 'flex' : 'none'} gap="4" marginBlockEnd="4">
|
|
79
81
|
{label && (
|
|
80
82
|
<FormLabel
|
|
@@ -110,12 +112,13 @@ const TagsInput = ({
|
|
|
110
112
|
gap="4"
|
|
111
113
|
paddingRight={isInvalid ? '42px' : undefined}
|
|
112
114
|
position="relative"
|
|
115
|
+
data-readonly={isReadOnly}
|
|
113
116
|
>
|
|
114
117
|
{value.map((item, idx) => (
|
|
115
118
|
<Tag
|
|
116
119
|
key={item}
|
|
117
120
|
colorScheme={invalidValues.includes(item) || (maxCount && idx > maxCount - 1) ? 'red' : undefined}
|
|
118
|
-
onClose={() => removeItem(item)}
|
|
121
|
+
onClose={isReadOnly ? undefined : () => removeItem(item)}
|
|
119
122
|
size="sm"
|
|
120
123
|
>
|
|
121
124
|
{item}
|
|
@@ -130,6 +133,10 @@ const TagsInput = ({
|
|
|
130
133
|
onKeyDown={keydownHandler}
|
|
131
134
|
onPaste={pasteEventHandler}
|
|
132
135
|
placeholder={value.length === 0 ? placeholder : undefined}
|
|
136
|
+
readOnly={isReadOnly}
|
|
137
|
+
_readOnly={{
|
|
138
|
+
backgroundColor: 'background/disabled',
|
|
139
|
+
}}
|
|
133
140
|
/>
|
|
134
141
|
{isInvalid && <Icon color="icon.negative" name="ErrorCircleFilled" position="absolute" right="16" />}
|
|
135
142
|
</Box>
|
|
@@ -2,11 +2,15 @@ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
|
|
|
2
2
|
|
|
3
3
|
const Code = forwardRef<IconProps, 'svg'>((props, ref) => (
|
|
4
4
|
<Icon ref={ref} viewBox="0 0 16 16" {...props}>
|
|
5
|
+
<path d="M8.79775 3.73663L5.79775 11.7366L7.20224 12.2633L10.2022 4.26332L8.79775 3.73663Z" fill="currentColor" />
|
|
5
6
|
<path
|
|
6
|
-
d="
|
|
7
|
+
d="M4.46966 11.0303L1.43933 7.99998L4.46966 4.96965L5.53032 6.03031L3.56065 7.99998L5.53032 9.96965L4.46966 11.0303Z"
|
|
8
|
+
fill="currentColor"
|
|
9
|
+
/>
|
|
10
|
+
<path
|
|
11
|
+
d="M11.5303 4.96965L14.5607 7.99998L11.5303 11.0303L10.4697 9.96965L12.4393 7.99998L10.4697 6.03031L11.5303 4.96965Z"
|
|
7
12
|
fill="currentColor"
|
|
8
13
|
/>
|
|
9
|
-
<path d="m5.833 11 3.25-6.667L10.238 5l-3.25 6.667L5.833 11Z" fill="currentColor" />
|
|
10
14
|
</Icon>
|
|
11
15
|
));
|
|
12
16
|
|
|
@@ -2,11 +2,15 @@ import { forwardRef, Icon, IconProps } from '@chakra-ui/react';
|
|
|
2
2
|
|
|
3
3
|
const Code = forwardRef<IconProps, 'svg'>((props, ref) => (
|
|
4
4
|
<Icon ref={ref} viewBox="0 0 24 24" {...props}>
|
|
5
|
+
<path d="M13.0513 5.68378L9.05132 17.6838L10.9487 18.3162L14.9487 6.31623L13.0513 5.68378Z" fill="currentColor" />
|
|
5
6
|
<path
|
|
6
|
-
d="
|
|
7
|
+
d="M17.2071 7.2929L21.9142 12L17.2071 16.7071L15.7929 15.2929L19.0858 12L15.7929 8.70711L17.2071 7.2929Z"
|
|
8
|
+
fill="currentColor"
|
|
9
|
+
/>
|
|
10
|
+
<path
|
|
11
|
+
d="M6.79289 16.7071L2.08578 12L6.79289 7.2929L8.20711 8.70711L4.91421 12L8.20711 15.2929L6.79289 16.7071Z"
|
|
7
12
|
fill="currentColor"
|
|
8
13
|
/>
|
|
9
|
-
<path d="m8.75 16.5 4.875-10 1.732 1-4.875 10-1.732-1Z" fill="currentColor" />
|
|
10
14
|
</Icon>
|
|
11
15
|
));
|
|
12
16
|
|