@bitrise/bitkit 13.248.0 → 13.250.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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "13.248.0",
4
+ "version": "13.250.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -51,6 +51,9 @@ const MatchingResults = (props: MatchingResultsProps) => {
51
51
  } else {
52
52
  const filterRegexp = new RegExp(`^${selected[0].split(/\*+/).map(regExpEscape).join('.*')}$`);
53
53
  matchingResults = items.filter((item) => {
54
+ if (item.includes('*')) {
55
+ return false;
56
+ }
54
57
  return filterRegexp.test(item);
55
58
  });
56
59
  if (!matchingResults.length) {
@@ -61,7 +64,7 @@ const MatchingResults = (props: MatchingResultsProps) => {
61
64
  );
62
65
  } else {
63
66
  content = (
64
- <Box maxHeight="11rem" overflow="scroll">
67
+ <Box maxHeight="11rem" overflow="auto">
65
68
  <List textStyle="body/md/regular" variant="unordered">
66
69
  {matchingResults.map((r) => (
67
70
  <ListItem key={r}>{r}</ListItem>
@@ -128,7 +131,8 @@ const FilterForm = (props: FilterFormProps) => {
128
131
  const isAsync = !!onAsyncSearch;
129
132
  const withSearch = (options && options.length > 5) || isAsync;
130
133
 
131
- const isDisabled = isEqual(selected, value) || !selected[0].includes('*');
134
+ const isSubmitDisabled =
135
+ isEqual(selected, value) || (mode === 'pattern' && !!selected[0] && !selected[0].includes('*'));
132
136
  const filteredOptions = useMemo(() => {
133
137
  if (options?.length) {
134
138
  return options.filter((opt) => {
@@ -314,8 +318,11 @@ const FilterForm = (props: FilterFormProps) => {
314
318
  <Button onClick={onCancelClick} size="sm" type="reset" variant="secondary">
315
319
  Cancel
316
320
  </Button>
317
- <Tooltip label={isDisabled ? 'Add `*` in the pattern or select manually.' : undefined}>
318
- <Button isDisabled={isDisabled} size="sm" type="submit">
321
+ <Tooltip
322
+ label="Add `*` in the pattern or select manually."
323
+ isDisabled={mode === 'manually' || !!(selected[0] && selected[0].includes('*'))}
324
+ >
325
+ <Button isDisabled={isSubmitDisabled} size="sm" type="submit">
319
326
  {(selected.length === 0 || selected[0] === '') && isEditMode ? 'Remove' : 'Apply'}
320
327
  </Button>
321
328
  </Tooltip>