@bitrise/bitkit 10.25.2 → 10.25.3

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.25.2",
4
+ "version": "10.25.3",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -5,10 +5,9 @@ import {
5
5
  BreadcrumbItem,
6
6
  BreadcrumbSeparator,
7
7
  forwardRef,
8
- useBreakpointValue,
9
8
  } from '@chakra-ui/react';
10
- import { BREAKPOINTS } from '../../Foundations/Breakpoints/Breakpoints';
11
9
  import Icon, { TypeIconName } from '../Icon/Icon';
10
+ import { useResponsive } from '../../hooks';
12
11
 
13
12
  export interface BreadcrumbProps extends ChakraBreadcrumbProps {
14
13
  hasSeparatorAfterLast?: boolean;
@@ -21,7 +20,7 @@ export interface BreadcrumbProps extends ChakraBreadcrumbProps {
21
20
  */
22
21
  const Breadcrumb = forwardRef<BreadcrumbProps, 'nav'>((props, ref) => {
23
22
  const { children, hasSeparatorAfterLast, hasSeparatorBeforeFirst, separatorIconName, ...rest } = props;
24
- const isMobile = !!useBreakpointValue({ [BREAKPOINTS.MOBILE]: true, [BREAKPOINTS.DESKTOP]: false }, 'desktop');
23
+ const { isMobile } = useResponsive();
25
24
 
26
25
  const childrenCount = Children.count(children);
27
26
  const items = Children.map(children, (child, index) => {
@@ -2,10 +2,9 @@ import {
2
2
  BreadcrumbLink as ChakraBreadcrumbLink,
3
3
  BreadcrumbLinkProps as ChakraBreadcrumbLinkProps,
4
4
  forwardRef,
5
- useBreakpointValue,
6
5
  } from '@chakra-ui/react';
7
- import { BREAKPOINTS } from '../../Foundations/Breakpoints/Breakpoints';
8
6
  import Avatar from '../Avatar/Avatar';
7
+ import { useResponsive } from '../../hooks';
9
8
 
10
9
  export interface BreadcrumbLinkProps extends ChakraBreadcrumbLinkProps {
11
10
  avatarName?: string;
@@ -14,7 +13,7 @@ export interface BreadcrumbLinkProps extends ChakraBreadcrumbLinkProps {
14
13
 
15
14
  const BreadcrumbLink = forwardRef<BreadcrumbLinkProps, 'a'>((props, ref) => {
16
15
  const { avatarName, avatarUrl, children, isCurrentPage, ...rest } = props;
17
- const isMobile = !!useBreakpointValue({ [BREAKPOINTS.MOBILE]: true, [BREAKPOINTS.DESKTOP]: false }, 'desktop');
16
+ const { isMobile } = useResponsive();
18
17
 
19
18
  const properties: ChakraBreadcrumbLinkProps = {
20
19
  color: isCurrentPage ? 'neutral.40' : 'inherit',
@@ -37,7 +37,7 @@ const Dialog = ({
37
37
  variant,
38
38
  ...rest
39
39
  }: DialogProps) => {
40
- const dialogSize = useBreakpointValue({ [BREAKPOINTS.MOBILE]: 'mobile', [BREAKPOINTS.DESKTOP]: size });
40
+ const dialogSize = useBreakpointValue({ [BREAKPOINTS.MOBILE]: 'mobile', [BREAKPOINTS.TABLET]: size });
41
41
  const prefersReducedMotion = usePrefersReducedMotion({ ssr: false });
42
42
 
43
43
  return (
@@ -17,7 +17,7 @@ export interface LightBoxProps extends Omit<HTMLChakraProps<'section'>, 'scrollB
17
17
 
18
18
  const LightBox = ({ children, dataTestid, size, isOpen, onClose, ...rest }: LightBoxProps) => {
19
19
  const prefersReducedMotion = usePrefersReducedMotion({ ssr: false });
20
- const dialogSize = useBreakpointValue({ [BREAKPOINTS.MOBILE]: 'mobile', [BREAKPOINTS.DESKTOP]: size });
20
+ const dialogSize = useBreakpointValue({ [BREAKPOINTS.MOBILE]: 'mobile', [BREAKPOINTS.TABLET]: size });
21
21
 
22
22
  return (
23
23
  <Modal isOpen={isOpen} motionPreset={prefersReducedMotion ? 'none' : 'scale'} onClose={onClose} size={dialogSize}>
@@ -2,7 +2,6 @@ import { createContext, useContext, useMemo } from 'react';
2
2
  import { Alert as ChakraAlert, AlertProps, forwardRef } from '@chakra-ui/react';
3
3
 
4
4
  import { ColorScheme } from '../../Foundations/Colors/Colors';
5
- import { BREAKPOINTS } from '../../Foundations/Breakpoints/Breakpoints';
6
5
  import CloseButton from '../CloseButton/CloseButton';
7
6
  import ColorButton, { ColorButtonProps } from '../ColorButton/ColorButton';
8
7
  import Icon from '../Icon/Icon';
@@ -62,19 +61,8 @@ const Ribbon = forwardRef<RibbonProps, 'div'>((props, ref) => {
62
61
  {...rest}
63
62
  >
64
63
  <ActionContext.Provider value={actionContext}>
65
- {onClose && (
66
- <Box
67
- display={{ [BREAKPOINTS.MOBILE]: 'none', [BREAKPOINTS.DESKTOP]: 'block' }}
68
- width={24}
69
- height={24}
70
- marginEnd="auto"
71
- />
72
- )}
73
- <Box
74
- display="flex"
75
- flexDirection={{ [BREAKPOINTS.MOBILE]: 'column', [BREAKPOINTS.DESKTOP]: 'row' }}
76
- gap={{ [BREAKPOINTS.MOBILE]: 12, [BREAKPOINTS.DESKTOP]: 16 }}
77
- >
64
+ {onClose && <Box display={['none', 'block']} width={24} height={24} marginEnd="auto" />}
65
+ <Box display="flex" flexDirection={['column', 'row']} gap={['12', '16']}>
78
66
  {children}
79
67
  {actionButton}
80
68
  </Box>
@@ -47,9 +47,9 @@ export const Responsive = () => {
47
47
  This Box is
48
48
  <List>
49
49
  <ListItem>green below 848px (53rem)</ListItem>
50
- <ListItem>purple from 848px (53rem) but below 1280px (80rem)</ListItem>
51
- <ListItem>red from 1280px (80rem) but below 1616px (101rem)</ListItem>
52
- <ListItem>gray from 1616px (101rem)</ListItem>
50
+ <ListItem>purple from 848px (53rem)</ListItem>
51
+ <ListItem>but red from 1280px (80rem)</ListItem>
52
+ <ListItem>but gray from 1616px (101rem)</ListItem>
53
53
  </List>
54
54
  </Box>
55
55
  </CardContent>