@bitrise/bitkit 9.28.0 → 9.29.0-alpha-dot-migration.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": "9.28.0",
4
+ "version": "9.29.0-alpha-dot-migration.1",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -53,4 +53,5 @@ WithProps.args = {
53
53
  ...Dialog.defaultProps,
54
54
  title: 'Title',
55
55
  lotsOfContent: false,
56
+ dataTestid: 'test-modal',
56
57
  };
@@ -14,7 +14,7 @@ import Text from '../Text/Text';
14
14
  type DialogState = {
15
15
  isOpen: boolean;
16
16
  onClose(): void;
17
- onOpen(): void;
17
+ onOpen?(): void;
18
18
  };
19
19
 
20
20
  export const useDialog = (): DialogState => {
@@ -27,17 +27,18 @@ export const useDialog = (): DialogState => {
27
27
  };
28
28
  export interface DialogProps {
29
29
  children: ReactNode;
30
+ dataTestid?: string;
30
31
  size?: 'small' | 'medium' | 'large';
31
32
  state: DialogState;
32
33
  title: string;
33
34
  }
34
35
 
35
- const Dialog = ({ children, state, size, title }: DialogProps) => {
36
+ const Dialog = ({ children, dataTestid, state, size, title }: DialogProps) => {
36
37
  const dialogSize = useBreakpointValue({ mobile: 'full', desktop: size });
37
38
  return (
38
39
  <Modal closeOnOverlayClick={false} isOpen={state.isOpen} onClose={state.onClose} size={dialogSize}>
39
40
  <ModalOverlay />
40
- <ModalContent>
41
+ <ModalContent data-testid={dataTestid}>
41
42
  <ModalHeader>
42
43
  <Text as="h1" size="5">
43
44
  {title}
@@ -0,0 +1,15 @@
1
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
2
+ import Dot from './Dot';
3
+
4
+ export default {
5
+ title: 'Components/Dot',
6
+ component: Dot,
7
+ } as ComponentMeta<typeof Dot>;
8
+
9
+ const Template: ComponentStory<typeof Dot> = ({ ...props }) => <Dot {...props} />;
10
+
11
+ export const WithProps = Template.bind({});
12
+ WithProps.args = {
13
+ size: 32,
14
+ backgroundColor: 'green.50',
15
+ };
@@ -0,0 +1,14 @@
1
+ import { BoxProps, forwardRef } from '@chakra-ui/react';
2
+ import Box from '../Box/Box';
3
+
4
+ export interface DotProps extends BoxProps {
5
+ size: BoxProps['width'];
6
+ }
7
+
8
+ const Dot = forwardRef<DotProps, 'div'>((props, ref) => {
9
+ const { size, ...rest } = props;
10
+
11
+ return <Box ref={ref} width={size} height={size} borderRadius="50%" aria-hidden {...rest} />;
12
+ });
13
+
14
+ export default Dot;
@@ -1,4 +1,4 @@
1
- import React, { createContext, useContext, useMemo } from 'react';
1
+ import { createContext, useContext, useMemo } from 'react';
2
2
  import {
3
3
  Alert as ChakraAlert,
4
4
  AlertTitle as NotificationTitle,
package/src/index.ts CHANGED
@@ -81,6 +81,9 @@ export { default as MenuItem } from './Components/Menu/MenuItem';
81
81
  export type { MenuListProps } from './Components/Menu/MenuList';
82
82
  export { default as MenuList } from './Components/Menu/MenuList';
83
83
 
84
+ export type { DotProps } from './Components/Dot/Dot';
85
+ export { default as Dot } from './Components/Dot/Dot';
86
+
84
87
  export { default as useToast } from './Components/Toast/Toast';
85
88
 
86
89
  export type { EmptyStateProps } from './Components/EmptyState/EmptyState';
package/src/old.ts CHANGED
@@ -52,9 +52,6 @@ export { default as Checkbox } from './Old/Checkbox/Checkbox';
52
52
  export type { Props as DatePickerProps } from './Old/DatePicker/DatePicker';
53
53
  export { default as DatePicker } from './Old/DatePicker/DatePicker';
54
54
 
55
- export type { Props as DotProps } from './Old/Dot/Dot';
56
- export { default as Dot } from './Old/Dot/Dot';
57
-
58
55
  export type { Props as DropdownProps } from './Old/Dropdown/Dropdown';
59
56
  export { default as Dropdown } from './Old/Dropdown/Dropdown';
60
57