@bitrise/bitkit 12.52.5 → 12.53.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,94 +1,94 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "12.52.5",
4
+ "version": "12.53.0",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
8
8
  "scripts": {
9
- "build:icons": "ts-node ./scripts/build-icons.ts",
10
9
  "commitlint": "commitlint",
11
10
  "lint": "eslint src --ext ts,tsx",
12
11
  "semantic-release": "semantic-release",
13
12
  "start": "yarn storybook",
14
13
  "test": "jest",
15
- "storybook": "start-storybook -p 6006",
16
- "build-storybook": "build-storybook"
14
+ "storybook": "storybook dev -p 6006",
15
+ "build-storybook": "storybook build"
17
16
  },
18
17
  "alias": {
19
18
  "@bitrise/bitkit": "./src",
20
19
  "framer-motion": "./node_modules/framer-motion/dist/cjs"
21
20
  },
22
21
  "dependencies": {
23
- "@chakra-ui/react": "^2.8.0",
22
+ "@chakra-ui/react": "^2.8.1",
24
23
  "@chakra-ui/react-utils": "^2.0.12",
25
24
  "@chakra-ui/styled-system": "^2.9.1",
26
- "@chakra-ui/theme": "^2.3.0",
27
- "@chakra-ui/theme-tools": "^2.1.0",
25
+ "@chakra-ui/theme": "^3.3.0",
26
+ "@chakra-ui/theme-tools": "^2.1.1",
28
27
  "@chakra-ui/utils": "^2.0.15",
29
- "@emotion/react": "^11.10.5",
30
- "@emotion/styled": "^11.10.5",
28
+ "@emotion/react": "^11.11.1",
29
+ "@emotion/styled": "^11.11.0",
31
30
  "@floating-ui/react-dom-interactions": "^0.8.1",
32
- "ast-types": "npm:@gkz/ast-types",
33
- "framer-motion": "^7.6.5",
34
- "luxon": "^3.1.0",
31
+ "framer-motion": "^10.16.4",
32
+ "luxon": "^3.4.3",
35
33
  "react": "^18.2.0",
36
34
  "react-dom": "^18.2.0",
37
- "react-focus-lock": "^2.9.1",
38
- "react-markdown": "^8.0.7"
35
+ "react-focus-lock": "^2.9.6",
36
+ "react-markdown": "^9.0.0"
39
37
  },
40
38
  "peerDependencies": {
41
39
  "react": "^18.2.0",
42
40
  "react-dom": "^18.2.0"
43
41
  },
44
42
  "devDependencies": {
45
- "@babel/core": "^7.20.2",
46
- "@bitrise/eslint-plugin": "^2.2.0",
47
- "@commitlint/cli": "^16.3.0",
48
- "@commitlint/config-conventional": "^16.2.4",
49
- "@google-cloud/storage": "^5.20.5",
50
- "@semantic-release/changelog": "^6.0.1",
51
- "@semantic-release/commit-analyzer": "^9.0.2",
43
+ "@babel/core": "^7.23.2",
44
+ "@babel/preset-env": "^7.23.2",
45
+ "@babel/preset-react": "^7.22.15",
46
+ "@babel/preset-typescript": "^7.23.2",
47
+ "@bitrise/eslint-plugin": "^2.3.0",
48
+ "@commitlint/cli": "^17.8.0",
49
+ "@commitlint/config-conventional": "^17.8.0",
50
+ "@google-cloud/storage": "^7.3.0",
51
+ "@semantic-release/commit-analyzer": "^11.0.0",
52
52
  "@semantic-release/git": "^10.0.1",
53
- "@storybook/addon-actions": "^6.5.15",
54
- "@storybook/addon-essentials": "^6.5.15",
55
- "@storybook/addon-interactions": "^6.5.15",
56
- "@storybook/addon-links": "^6.5.15",
57
- "@storybook/addons": "^6.5.15",
58
- "@storybook/builder-webpack5": "^6.5.15",
59
- "@storybook/manager-webpack5": "^6.5.15",
60
- "@storybook/react": "^6.5.15",
61
- "@storybook/testing-library": "^0.0.13",
62
- "@storybook/theming": "^6.5.15",
63
- "@testing-library/dom": "^8.19.0",
64
- "@testing-library/jest-dom": "^5.16.5",
65
- "@testing-library/react": "^13.4.0",
66
- "@testing-library/user-event": "^14.4.3",
67
- "@types/jest": "^29.2.2",
68
- "@types/luxon": "^3.1.0",
69
- "@types/react": "^18.0.25",
70
- "@types/react-dom": "^18.0.8",
71
- "@typescript-eslint/eslint-plugin": "^5.42.1",
72
- "@typescript-eslint/parser": "^5.42.1",
73
- "axios": "^0.27.2",
74
- "eslint": "^8.27.0",
75
- "eslint-plugin-import": "^2.26.0",
76
- "eslint-plugin-jest": "^26.6.0",
77
- "eslint-plugin-jsx-a11y": "^6.6.1",
78
- "eslint-plugin-prettier": "^4.2.1",
79
- "eslint-plugin-react": "^7.31.10",
53
+ "@storybook/addon-actions": "^7.5.0",
54
+ "@storybook/addon-essentials": "^7.5.0",
55
+ "@storybook/addon-interactions": "^7.5.0",
56
+ "@storybook/addon-links": "^7.5.0",
57
+ "@storybook/addons": "^7.5.0",
58
+ "@storybook/blocks": "^7.5.0",
59
+ "@storybook/react": "^7.5.0",
60
+ "@storybook/react-webpack5": "^7.5.0",
61
+ "@storybook/testing-library": "^0.2.2",
62
+ "@storybook/theming": "^7.5.0",
63
+ "@testing-library/dom": "^9.3.3",
64
+ "@testing-library/jest-dom": "^6.1.4",
65
+ "@testing-library/react": "^14.0.0",
66
+ "@testing-library/user-event": "^14.5.1",
67
+ "@types/jest": "^29.5.5",
68
+ "@types/luxon": "^3.3.2",
69
+ "@types/react": "^18.2.28",
70
+ "@types/react-dom": "^18.2.13",
71
+ "@typescript-eslint/eslint-plugin": "^6.8.0",
72
+ "@typescript-eslint/parser": "^6.8.0",
73
+ "axios": "^1.5.1",
74
+ "eslint": "^8.51.0",
75
+ "eslint-plugin-import": "^2.28.1",
76
+ "eslint-plugin-jest": "^27.4.2",
77
+ "eslint-plugin-jsx-a11y": "^6.7.1",
78
+ "eslint-plugin-prettier": "^5.0.1",
79
+ "eslint-plugin-react": "^7.33.2",
80
80
  "eslint-plugin-react-hooks": "^4.6.0",
81
- "eslint-plugin-storybook": "^0.6.10",
82
- "eslint-plugin-testing-library": "^5.9.1",
83
- "glob": "^8.0.3",
84
- "husky": "^7.0.4",
85
- "jest": "^29.3.1",
86
- "jest-environment-jsdom": "^28.1.3",
87
- "jsdom": "^20.0.2",
88
- "prettier": "^2.7.1",
89
- "react-hook-form": "^7.39.2",
90
- "semantic-release": "^19.0.5",
91
- "ts-jest": "^29.0.3",
81
+ "eslint-plugin-storybook": "^0.6.15",
82
+ "eslint-plugin-testing-library": "^6.1.0",
83
+ "glob": "^10.3.10",
84
+ "jest": "^29.7.0",
85
+ "jest-environment-jsdom": "^29.7.0",
86
+ "jsdom": "^22.1.0",
87
+ "prettier": "^3.0.3",
88
+ "react-hook-form": "^7.47.0",
89
+ "semantic-release": "^22.0.5",
90
+ "storybook": "^7.5.0",
91
+ "ts-jest": "^29.1.1",
92
92
  "typescript": "^4.8.4"
93
93
  },
94
94
  "files": [
@@ -98,8 +98,5 @@
98
98
  "sideEffects": false,
99
99
  "publishConfig": {
100
100
  "access": "public"
101
- },
102
- "resolutions": {
103
- "**/ast-types": "npm:@gkz/ast-types"
104
101
  }
105
102
  }
@@ -16,13 +16,7 @@ const Accordion = (props: AccordionProps) => {
16
16
  const { children, defaultIndex, ...rest } = props;
17
17
 
18
18
  return (
19
- <ChakraAccordion
20
- allowMultiple
21
- allowToggle
22
- reduceMotion={prefersReducedMotion}
23
- defaultIndex={defaultIndex}
24
- {...rest}
25
- >
19
+ <ChakraAccordion allowMultiple reduceMotion={prefersReducedMotion} defaultIndex={defaultIndex} {...rest}>
26
20
  {children}
27
21
  </ChakraAccordion>
28
22
  );
@@ -44,7 +44,6 @@ const LegacyAccordion = (props: LegacyAccordionProps) => {
44
44
  return (
45
45
  <ChakraAccordion
46
46
  allowMultiple
47
- allowToggle
48
47
  colorScheme={colorScheme}
49
48
  variant={variant}
50
49
  reduceMotion={prefersReducedMotion}
@@ -1,11 +1,20 @@
1
1
  import { ReactNode, useCallback } from 'react';
2
- import { DateTime } from 'luxon';
2
+ import { DateTime, Settings } from 'luxon';
3
3
  import { BoxProps, useMultiStyleConfig } from '@chakra-ui/react';
4
4
  import { createContext } from '@chakra-ui/react-utils';
5
5
  import Box from '../Box/Box';
6
6
  import Text from '../Text/Text';
7
7
  import { useDatePickerContext } from './DatePicker.context';
8
8
 
9
+ // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64995
10
+ Settings.throwOnInvalid = true;
11
+
12
+ declare module 'luxon' {
13
+ export interface TSSettings {
14
+ throwOnInvalid: true;
15
+ }
16
+ }
17
+
9
18
  interface Context {
10
19
  onPreviousMonth: () => void;
11
20
  onNextMonth: () => void;
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import {
3
+ BoxProps,
3
4
  Drawer as ChakraDrawer,
4
5
  DrawerBody,
5
6
  DrawerFooter,
@@ -16,16 +17,17 @@ export interface DrawerProps
16
17
  extends Pick<ChakraDrawerProps, 'finalFocusRef' | 'initialFocusRef' | 'isOpen' | 'onClose' | 'onCloseComplete'> {
17
18
  children: DrawerContentProps['children'];
18
19
  footer?: ReactNode;
20
+ maxWidth?: BoxProps['maxWidth'];
19
21
  title: string;
20
22
  }
21
23
 
22
24
  const Drawer = (props: DrawerProps) => {
23
- const { children, footer, title, ...drawerProps } = props;
25
+ const { children, footer, maxWidth = '20rem', title, ...drawerProps } = props;
24
26
 
25
27
  return (
26
28
  <ChakraDrawer {...drawerProps}>
27
29
  <DrawerOverlay />
28
- <DrawerContent>
30
+ <DrawerContent maxWidth={maxWidth}>
29
31
  <DrawerCloseButton size="small">
30
32
  <Icon name="CloseSmall" />
31
33
  </DrawerCloseButton>
@@ -1,6 +1,4 @@
1
- import type { ComponentStyleConfig } from '@chakra-ui/theme';
2
-
3
- const CheckboxTheme: ComponentStyleConfig = {
1
+ const CheckboxTheme = {
4
2
  baseStyle: {
5
3
  icon: {
6
4
  color: 'neutral.100',
@@ -1,6 +1,4 @@
1
- import type { ComponentStyleConfig } from '@chakra-ui/theme';
2
-
3
- const FilterSwitch: ComponentStyleConfig = {
1
+ const FilterSwitch = {
4
2
  baseStyle: () => {
5
3
  return {
6
4
  container: {
@@ -1,6 +1,4 @@
1
- import type { ComponentStyleConfig } from '@chakra-ui/theme';
2
-
3
- const RadioTheme: ComponentStyleConfig = {
1
+ const RadioTheme = {
4
2
  baseStyle: {
5
3
  icon: {
6
4
  color: 'neutral.100',
@@ -9,23 +9,19 @@ import Text from '../Text/Text';
9
9
  import CodeBlock from '../CodeBlock/CodeBlock';
10
10
 
11
11
  const defaultComponents: Components = {
12
- h1: ({ node, ...props }) => <Text size="6" {...props} />,
13
- h2: ({ node, ...props }) => <Text paddingTop="12" size="5" {...props} />,
14
- h3: ({ node, ...props }) => <Text paddingTop="12" size="4" fontWeight="bold" {...props} />,
15
- h4: ({ node, ...props }) => <Text paddingTop="12" size="3" fontWeight="bold" {...props} />,
16
- h5: ({ node, ...props }) => <Text paddingTop="12" size="2" fontWeight="bold" {...props} />,
17
- h6: ({ node, ...props }) => <Text paddingTop="12" size="1" fontWeight="bold" {...props} />,
12
+ h1: ({ node, ...props }) => <Text as="h1" size="6" {...props} />,
13
+ h2: ({ node, ...props }) => <Text as="h2" size="5" {...props} />,
14
+ h3: ({ node, ...props }) => <Text as="h3" size="4" fontWeight="bold" {...props} />,
15
+ h4: ({ node, ...props }) => <Text as="h4" size="3" fontWeight="bold" {...props} />,
16
+ h5: ({ node, ...props }) => <Text as="h5" size="2" fontWeight="bold" {...props} />,
17
+ h6: ({ node, ...props }) => <Text as="h6" size="1" fontWeight="bold" {...props} />,
18
18
  p: ({ node, ...props }) => <Text {...props} />,
19
19
  hr: () => <Divider my="16" borderColor="separator.primary" size="2" />,
20
- ul: ({ node, ordered, ...props }) => <List paddingBottom="8" {...props} />,
21
- ol: ({ node, ordered, ...props }) => <List paddingBottom="8" isOrdered {...props} />,
22
- code: ({ node, inline, ...props }) => {
23
- if (inline) {
24
- return <code {...props} />;
25
- }
26
- return <CodeBlock {...props} />;
27
- },
28
- li: ({ node, ordered, ...props }) => <ListItem {...props} />,
20
+ ul: ({ node, ...props }) => <List {...props} />,
21
+ ol: ({ node, ...props }) => <List isOrdered {...props} />,
22
+ li: ({ node, ...props }) => <ListItem {...props} />,
23
+ code: ({ node, ...props }) => <code {...props} />,
24
+ pre: ({ node, ...props }) => <CodeBlock>{props.children}</CodeBlock>,
29
25
  blockquote: ({ children }) => (
30
26
  <Box
31
27
  py="8"
@@ -29,7 +29,7 @@ const useToast = () => {
29
29
  <Notification
30
30
  boxShadow="large"
31
31
  maxW="437px"
32
- status={opts.status}
32
+ status={opts.status || 'info'}
33
33
  onClose={opts.isClosable ? onClose : undefined}
34
34
  >
35
35
  <Box display="flex" flexDirection="column">
@@ -1,4 +1,5 @@
1
- // import { ReactNode } from 'react';
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ import { Unstyled } from '@storybook/blocks';
2
3
  import { HStack, VStack } from '@chakra-ui/react';
3
4
  import Box from '../../Components/Box/Box';
4
5
  import Card from '../../Components/Card/Card';
@@ -20,44 +21,46 @@ const DesignTokens = () => {
20
21
  maxWidth: '31.25rem',
21
22
  };
22
23
  return (
23
- <Provider>
24
- <Box sx={textWrapperStyle}>
25
- <Text as="h2" size="8" sx={{ marginBottom: '24' }}>
26
- Design tokens
27
- </Text>
28
- <Text>
29
- Most of our color usage is defined in the Bitkit components themselves, but we also have some additional
30
- colors that we frequently re-use outside of components too. We have defined these colors as design tokens.
31
- </Text>
32
- <Text color="secondary" size="2" sx={{ marginTop: '16' }}>
33
- Design tokens are implemented as styles, which reference the color styles. They are managed by the Figma
34
- plugin called “Theemo”.
35
- </Text>
36
- </Box>
37
- <Card boxShadow="medium" marginBottom="96" padding="24">
38
- <VStack align="flex-start" as="ul" spacing="32">
39
- {Object.keys(TOKENS).map((token: string) => (
40
- <HStack as="li" key={token} spacing="32">
41
- <Box
42
- sx={{
43
- backgroundColor: token,
44
- height: '64',
45
- width: '10rem',
46
- }}
47
- />
48
- <VStack align="flex-start">
49
- <Text fontWeight="bold" size="4">
50
- {token}
51
- </Text>
52
- <Text color="secondary" size="2">
53
- {TOKENS[token]}
54
- </Text>
55
- </VStack>
56
- </HStack>
57
- ))}
58
- </VStack>
59
- </Card>
60
- </Provider>
24
+ <Unstyled>
25
+ <Provider>
26
+ <Box sx={textWrapperStyle}>
27
+ <Text as="h2" size="8" sx={{ marginBottom: '24' }}>
28
+ Design tokens
29
+ </Text>
30
+ <Text>
31
+ Most of our color usage is defined in the Bitkit components themselves, but we also have some additional
32
+ colors that we frequently re-use outside of components too. We have defined these colors as design tokens.
33
+ </Text>
34
+ <Text color="secondary" size="2" sx={{ marginTop: '16' }}>
35
+ Design tokens are implemented as styles, which reference the color styles. They are managed by the Figma
36
+ plugin called “Theemo”.
37
+ </Text>
38
+ </Box>
39
+ <Card boxShadow="medium" marginBottom="96" padding="24">
40
+ <VStack align="flex-start" as="ul" spacing="32">
41
+ {Object.keys(TOKENS).map((token: string) => (
42
+ <HStack as="li" key={token} spacing="32">
43
+ <Box
44
+ sx={{
45
+ backgroundColor: token,
46
+ height: '64',
47
+ width: '10rem',
48
+ }}
49
+ />
50
+ <VStack align="flex-start">
51
+ <Text fontWeight="bold" size="4">
52
+ {token}
53
+ </Text>
54
+ <Text color="secondary" size="2">
55
+ {TOKENS[token]}
56
+ </Text>
57
+ </VStack>
58
+ </HStack>
59
+ ))}
60
+ </VStack>
61
+ </Card>
62
+ </Provider>
63
+ </Unstyled>
61
64
  );
62
65
  };
63
66
 
@@ -1,4 +1,6 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
1
2
  import { ReactNode } from 'react';
3
+ import { Unstyled } from '@storybook/blocks';
2
4
  import { HStack, SystemStyleObject, VStack } from '@chakra-ui/react';
3
5
  import Box from '../../Components/Box/Box';
4
6
  import Card from '../../Components/Card/Card';
@@ -72,71 +74,73 @@ const Item = ({ backgroundColor, children }: { backgroundColor: string; children
72
74
  };
73
75
 
74
76
  const Palette = () => (
75
- <Provider>
76
- <Text as="h2" size="8">
77
- Full palette
78
- </Text>
79
- <Card boxShadow="medium" marginTop="24" padding="24">
80
- <HStack spacing="0" sx={{ alignItems: 'flex-start', marginBottom: '16' }}>
81
- <VStack spacing="0">
82
- <InfoHeader
83
- description="These colors have sufficient contrast with any dark color."
84
- shades={[100, 95, 93]}
85
- style={{ backgroundColor: 'neutral.95', marginTop: '1.75rem' }}
86
- title="Light colors"
87
- />
88
- <InfoHeader
89
- description="Avoid using these colors for text. If you do, check if they have a high enough contrast."
90
- shades={[90, 80, 70, 60, 50]}
91
- style={{ backgroundColor: 'neutral.100' }}
92
- title="Decorative colors"
93
- />
94
- <InfoHeader
95
- description="These colors have sufficient contrast with any light color."
96
- shades={[40, 30, 20, 10]}
97
- style={{ backgroundColor: 'neutral.10' }}
98
- title="Dark colors"
99
- />
100
- </VStack>
101
- {paletteKeys.map((colorName) => (
102
- <VStack key={colorName} spacing="0">
103
- <Text
104
- as="span"
105
- size="1"
106
- sx={{
107
- color: 'text.primary',
108
- marginBottom: '12',
109
- }}
110
- textTransform="uppercase"
111
- >
112
- {colorName}
113
- </Text>
114
- <Divider
115
- size="1"
116
- sx={{
117
- borderColor: 'neutral.95',
118
- }}
77
+ <Unstyled>
78
+ <Provider>
79
+ <Text as="h2" size="8">
80
+ Full palette
81
+ </Text>
82
+ <Card boxShadow="medium" marginTop="24" padding="24">
83
+ <HStack spacing="0" sx={{ alignItems: 'flex-start', marginBottom: '16' }}>
84
+ <VStack spacing="0">
85
+ <InfoHeader
86
+ description="These colors have sufficient contrast with any dark color."
87
+ shades={[100, 95, 93]}
88
+ style={{ backgroundColor: 'neutral.95', marginTop: '1.75rem' }}
89
+ title="Light colors"
90
+ />
91
+ <InfoHeader
92
+ description="Avoid using these colors for text. If you do, check if they have a high enough contrast."
93
+ shades={[90, 80, 70, 60, 50]}
94
+ style={{ backgroundColor: 'neutral.100' }}
95
+ title="Decorative colors"
96
+ />
97
+ <InfoHeader
98
+ description="These colors have sufficient contrast with any light color."
99
+ shades={[40, 30, 20, 10]}
100
+ style={{ backgroundColor: 'neutral.10' }}
101
+ title="Dark colors"
119
102
  />
120
- {Object.keys(colors[colorName])
121
- .reverse()
122
- .map((shade) => {
123
- const backgroundColor = `${colorName}.${shade}`;
124
- return (
125
- <Item backgroundColor={backgroundColor} key={backgroundColor}>
126
- {backgroundColor}
127
- <br />
128
- <br />
129
- {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
130
- {/* @ts-ignore */}
131
- {colors[colorName][shade]}
132
- </Item>
133
- );
134
- })}
135
103
  </VStack>
136
- ))}
137
- </HStack>
138
- </Card>
139
- </Provider>
104
+ {paletteKeys.map((colorName) => (
105
+ <VStack key={colorName} spacing="0">
106
+ <Text
107
+ as="span"
108
+ size="1"
109
+ sx={{
110
+ color: 'text.primary',
111
+ marginBottom: '12',
112
+ }}
113
+ textTransform="uppercase"
114
+ >
115
+ {colorName}
116
+ </Text>
117
+ <Divider
118
+ size="1"
119
+ sx={{
120
+ borderColor: 'neutral.95',
121
+ }}
122
+ />
123
+ {Object.keys(colors[colorName])
124
+ .reverse()
125
+ .map((shade) => {
126
+ const backgroundColor = `${colorName}.${shade}`;
127
+ return (
128
+ <Item backgroundColor={backgroundColor} key={backgroundColor}>
129
+ {backgroundColor}
130
+ <br />
131
+ <br />
132
+ {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
133
+ {/* @ts-ignore */}
134
+ {colors[colorName][shade]}
135
+ </Item>
136
+ );
137
+ })}
138
+ </VStack>
139
+ ))}
140
+ </HStack>
141
+ </Card>
142
+ </Provider>
143
+ </Unstyled>
140
144
  );
141
145
 
142
146
  export default Palette;
package/tsconfig.json CHANGED
@@ -18,6 +18,7 @@
18
18
  "skipLibCheck": true,
19
19
  "sourceMap": true,
20
20
  "strict": true,
21
- "target": "es5"
21
+ "target": "es5",
22
+ "types": ["node", "jest", "@testing-library/jest-dom"],
22
23
  }
23
24
  }