@bitrise/bitkit 12.30.1 → 12.31.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "12.30.1",
4
+ "version": "12.31.1",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -58,6 +58,10 @@ const DropdownTheme = {
58
58
  backgroundColor: 'purple.93',
59
59
  },
60
60
  },
61
+ _disabled: {
62
+ color: 'neutral.70',
63
+ pointerEvents: 'none',
64
+ },
61
65
  },
62
66
  options: {
63
67
  paddingY: '12',
@@ -10,8 +10,15 @@ export type DropdownOptionProps<T> = {
10
10
  children?: ReactNode;
11
11
  'aria-label'?: string;
12
12
  onClick?: MouseEventHandler<HTMLElement>;
13
+ isDisabled?: boolean;
13
14
  };
14
- const DropdownOption = <T = string,>({ value = null, children, onClick, ...rest }: DropdownOptionProps<T>) => {
15
+ const DropdownOption = <T = string,>({
16
+ value = null,
17
+ children,
18
+ onClick,
19
+ isDisabled,
20
+ ...rest
21
+ }: DropdownOptionProps<T>) => {
15
22
  const { item } = useDropdownStyles();
16
23
  const ctx = useDropdownContext<T | null>();
17
24
  const { index } = rest as { index?: number };
@@ -24,6 +31,7 @@ const DropdownOption = <T = string,>({ value = null, children, onClick, ...rest
24
31
  ctx.listRef.current[index!] = node;
25
32
  }
26
33
  }}
34
+ aria-disabled={isDisabled || undefined}
27
35
  {...rest}
28
36
  className={cx(
29
37
  value === ctx.formValue && 'bitkit-select__option-active',
@@ -1,18 +1,30 @@
1
- import { ReactNode } from 'react';
1
+ import { ReactNode, RefObject } from 'react';
2
2
  import { ChakraProvider } from '@chakra-ui/react';
3
3
  import theme from '../../theme';
4
4
 
5
5
  type ProviderProps = {
6
6
  children: ReactNode;
7
- toastOffset?: string;
7
+ toastOptions?: {
8
+ offsetTop?: string;
9
+ offsetRight?: string;
10
+ portalRef: RefObject<HTMLElement>;
11
+ };
8
12
  };
9
13
 
10
- const Provider = ({ children, toastOffset }: ProviderProps) => {
14
+ const Provider = ({ children, toastOptions }: ProviderProps) => {
11
15
  return (
12
16
  <ChakraProvider
13
17
  theme={theme}
14
18
  toastOptions={{
15
- defaultOptions: toastOffset ? { containerStyle: { transform: `translateY(${toastOffset})` } } : undefined,
19
+ defaultOptions: {
20
+ containerStyle: {
21
+ transform: toastOptions?.offsetTop && `translateY(${toastOptions.offsetTop})`,
22
+ marginRight: toastOptions?.offsetRight,
23
+ },
24
+ },
25
+ portalProps: {
26
+ containerRef: toastOptions?.portalRef,
27
+ },
16
28
  }}
17
29
  >
18
30
  {children}