@bitrise/bitkit 10.11.0-alpha-chakra.1 → 10.11.0-alpha-chakra.2

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": "10.11.0-alpha-chakra.1",
4
+ "version": "10.11.0-alpha-chakra.2",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -23,6 +23,10 @@ const AccordionTheme: ComponentStyleConfig = {
23
23
  _disabled: {
24
24
  pointerEvents: 'none',
25
25
  },
26
+ _focusVisible: {
27
+ background: 'purple.95',
28
+ boxShadow: 'none',
29
+ },
26
30
  },
27
31
  icon: {
28
32
  width: '24',
@@ -8,7 +8,7 @@ import {
8
8
 
9
9
  export interface AccordionProps extends Omit<ChakraAccordionProps, 'onChange'> {
10
10
  colorScheme?: 'white' | 'gray';
11
- onChange: (ids: string[], indexes: number[]) => void;
11
+ onChange?: (ids: string[], indexes: number[]) => void;
12
12
  }
13
13
 
14
14
  const getItemIds = (props: AccordionProps) => {
@@ -26,11 +26,13 @@ const Accordion = (props: AccordionProps) => {
26
26
  const itemIds = getItemIds(props);
27
27
 
28
28
  const onAccordionChange = (indexes: ExpandedIndex) => {
29
- const indexArray = Object.values(indexes).sort();
30
- onChange(
31
- indexArray.map((i: number) => itemIds[i]),
32
- indexArray,
33
- );
29
+ if (onChange) {
30
+ const indexArray = Object.values(indexes).sort();
31
+ onChange(
32
+ indexArray.map((i: number) => itemIds[i]),
33
+ indexArray,
34
+ );
35
+ }
34
36
  };
35
37
 
36
38
  return (