@bitrise/bitkit 11.6.0 → 12.0.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": "11.6.0",
4
+ "version": "12.0.0",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -4,10 +4,7 @@ import {
4
4
  usePrefersReducedMotion,
5
5
  } from '@chakra-ui/react';
6
6
 
7
- export type AccordionButtonSize = 'sm' | 'md';
8
-
9
7
  export type AccordionProps = Omit<ChakraAccordionProps, 'defaultIndex'> & {
10
- buttonSize?: AccordionButtonSize;
11
8
  defaultIndex: number[];
12
9
  };
13
10
 
@@ -16,15 +13,12 @@ export type AccordionProps = Omit<ChakraAccordionProps, 'defaultIndex'> & {
16
13
  */
17
14
  const Accordion = (props: AccordionProps) => {
18
15
  const prefersReducedMotion = usePrefersReducedMotion({ ssr: false });
19
- const { buttonSize = 'md', children, colorScheme, defaultIndex, variant, ...rest } = props;
16
+ const { children, defaultIndex, ...rest } = props;
20
17
 
21
18
  return (
22
19
  <ChakraAccordion
23
20
  allowMultiple
24
21
  allowToggle
25
- buttonSize={buttonSize}
26
- colorScheme={colorScheme}
27
- variant={variant}
28
22
  reduceMotion={prefersReducedMotion}
29
23
  defaultIndex={defaultIndex}
30
24
  {...rest}
@@ -1,7 +1,6 @@
1
1
  import { StyleFunctionProps } from '@chakra-ui/styled-system';
2
2
  import type { ComponentStyleConfig } from '@chakra-ui/theme';
3
3
  import { CSSObject } from '@emotion/react';
4
- import { AccordionButtonSize } from '../Accordion/Accordion';
5
4
 
6
5
  type ColorObj = {
7
6
  [key: string]: {
@@ -127,12 +126,7 @@ const LegacyBaseStyle: ({ colorScheme, variant }: Pick<StyleFunctionProps, 'colo
127
126
  },
128
127
  });
129
128
 
130
- const buttonPaddingBlockSizes: Record<AccordionButtonSize, string> = {
131
- sm: '12',
132
- md: '20',
133
- };
134
-
135
- const BaseStyle: (buttonSize: AccordionButtonSize) => CSSObject = (buttonSize) => ({
129
+ const BaseStyle: () => CSSObject = () => ({
136
130
  item: {
137
131
  borderTop: '1px solid',
138
132
  borderTopColor: 'neutral.90',
@@ -142,8 +136,7 @@ const BaseStyle: (buttonSize: AccordionButtonSize) => CSSObject = (buttonSize) =
142
136
  alignItems: 'center',
143
137
  justifyContent: 'space-between',
144
138
  width: '100%',
145
- paddingInline: '16',
146
- paddingBlock: buttonPaddingBlockSizes[buttonSize],
139
+ padding: '16',
147
140
  borderColor: 'neutral.93',
148
141
  _hover: {
149
142
  background: 'neutral.93',
@@ -158,8 +151,7 @@ const BaseStyle: (buttonSize: AccordionButtonSize) => CSSObject = (buttonSize) =
158
151
  marginLeft: '16',
159
152
  },
160
153
  panel: {
161
- paddingBlockEnd: '16',
162
- paddingInline: '16',
154
+ padding: '16',
163
155
  },
164
156
  root: {
165
157
  borderBottom: '1px solid',
@@ -168,10 +160,8 @@ const BaseStyle: (buttonSize: AccordionButtonSize) => CSSObject = (buttonSize) =
168
160
  });
169
161
 
170
162
  const AccordionTheme: ComponentStyleConfig = {
171
- baseStyle: ({ buttonSize, colorScheme, variant }) => {
172
- return variant === 'legacy' || variant === 'flat'
173
- ? LegacyBaseStyle({ colorScheme, variant })
174
- : BaseStyle(buttonSize);
163
+ baseStyle: ({ colorScheme, variant }) => {
164
+ return variant === 'legacy' || variant === 'flat' ? LegacyBaseStyle({ colorScheme, variant }) : BaseStyle();
175
165
  },
176
166
  };
177
167