@bitrise/bitkit 13.306.0 → 13.308.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": "13.306.0",
4
+ "version": "13.308.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -6,6 +6,7 @@ const DialogTheme: ComponentStyleConfig = {
6
6
  flex: 1,
7
7
  overflow: scrollBehavior === 'inside' ? 'auto' : undefined,
8
8
  paddingX: '32',
9
+ marginBottom: '16',
9
10
  },
10
11
  closeButton: {
11
12
  color: 'purple.10',
@@ -33,12 +34,12 @@ const DialogTheme: ComponentStyleConfig = {
33
34
  gap: '16',
34
35
  justifyContent: 'end',
35
36
  padding: '32',
36
- paddingTop: '48',
37
37
  },
38
38
  header: {
39
39
  color: 'purple.10',
40
40
  padding: '24',
41
41
  paddingLeft: '30',
42
+ marginRight: '48',
42
43
  },
43
44
  overlay: {
44
45
  backgroundColor: 'rgba(0, 0, 0, .5)',
@@ -91,6 +92,30 @@ const DialogTheme: ComponentStyleConfig = {
91
92
  },
92
93
  },
93
94
  },
95
+ variants: {
96
+ default: {
97
+ header: {
98
+ textStyle: 'comp/dialog/title',
99
+ },
100
+ },
101
+ overflow: {
102
+ header: {
103
+ textStyle: 'heading/h4',
104
+ padding: '16',
105
+ paddingLeft: '16',
106
+ marginRight: '16',
107
+ },
108
+ closeButton: {
109
+ top: '16',
110
+ },
111
+ body: {
112
+ paddingX: '16',
113
+ },
114
+ footer: {
115
+ padding: '16',
116
+ },
117
+ },
118
+ },
94
119
  };
95
120
 
96
121
  export default DialogTheme;
@@ -36,11 +36,32 @@ const Dialog: ComponentWithAs<'section', DialogProps> = ({
36
36
  const headerId = useId();
37
37
 
38
38
  const closeBtn = (
39
- <ModalCloseButton isDisabled={!isClosable} size="large">
39
+ <ModalCloseButton isDisabled={!isClosable} size={variant === 'overflow' ? 'small' : `large`}>
40
40
  <Icon name="Cross" />
41
41
  </ModalCloseButton>
42
42
  );
43
43
 
44
+ const modalHeader = () => {
45
+ if (variant === 'empty') return null;
46
+
47
+ return (
48
+ <>
49
+ <ModalHeader>
50
+ <Text as="h1" id={headerId}>
51
+ {title}
52
+ </Text>
53
+ </ModalHeader>
54
+ {closeNotice ? (
55
+ <Tooltip label={closeNotice} placement="top">
56
+ {closeBtn}
57
+ </Tooltip>
58
+ ) : (
59
+ closeBtn
60
+ )}
61
+ </>
62
+ );
63
+ };
64
+
44
65
  return (
45
66
  <DialogContextProvider value={{ scrollBehavior }}>
46
67
  <Modal
@@ -54,26 +75,12 @@ const Dialog: ComponentWithAs<'section', DialogProps> = ({
54
75
  scrollBehavior={scrollBehavior}
55
76
  size={dialogSize}
56
77
  trapFocus={trapFocus}
78
+ variant={variant}
57
79
  >
58
80
  <ModalOverlay />
59
81
 
60
82
  <ModalContent aria-labelledby={variant !== 'empty' ? headerId : undefined} {...rest}>
61
- {variant !== 'empty' && (
62
- <>
63
- <ModalHeader marginRight="48">
64
- <Text as="h1" id={headerId} textStyle="comp/dialog/title">
65
- {title}
66
- </Text>
67
- </ModalHeader>
68
- {closeNotice ? (
69
- <Tooltip label={closeNotice} placement="top">
70
- {closeBtn}
71
- </Tooltip>
72
- ) : (
73
- closeBtn
74
- )}
75
- </>
76
- )}
83
+ {modalHeader()}
77
84
  {children}
78
85
  </ModalContent>
79
86
  </Modal>
@@ -69,24 +69,33 @@ const ScrollableDialogBody = (props: DialogBodyProps) => {
69
69
  <Box display="flex" flexDir="column" minH={0} position="relative">
70
70
  <ModalBody ref={contentRef} {...props} />
71
71
  {isScrollButtonVisible && (
72
- <ScrollButton
73
- alignSelf="center"
74
- bottom={8}
75
- flexShrink={0}
76
- onClick={(e) => {
77
- if (!contentRef.current) {
78
- return;
79
- }
80
-
81
- (e.currentTarget as HTMLElement).blur();
82
-
83
- contentRef.current.scrollTo({
84
- top: contentRef.current.scrollHeight,
85
- behavior: 'smooth',
86
- });
87
- }}
88
- position="absolute"
89
- />
72
+ <>
73
+ <Box
74
+ background="linear-gradient(0deg, #FFF 0%, rgba(255, 255, 255, 0.00) 100%)"
75
+ width="100%"
76
+ height={32}
77
+ bottom={16}
78
+ position="absolute"
79
+ />
80
+ <ScrollButton
81
+ alignSelf="center"
82
+ bottom={16}
83
+ flexShrink={0}
84
+ onClick={(e) => {
85
+ if (!contentRef.current) {
86
+ return;
87
+ }
88
+
89
+ (e.currentTarget as HTMLElement).blur();
90
+
91
+ contentRef.current.scrollTo({
92
+ top: contentRef.current.scrollHeight,
93
+ behavior: 'smooth',
94
+ });
95
+ }}
96
+ position="absolute"
97
+ />
98
+ </>
90
99
  )}
91
100
  </Box>
92
101
  );
@@ -11,6 +11,6 @@ export interface DialogProps
11
11
  scrollBehavior?: 'inside' | 'outside';
12
12
  title: string;
13
13
  trapFocus?: boolean;
14
- variant?: 'default' | 'empty';
14
+ variant?: 'default' | 'empty' | 'overflow';
15
15
  closeNotice?: string;
16
16
  }
@@ -14,7 +14,7 @@ const LinkButton = forwardRef<LinkButtonProps, 'div'>((props, ref) => {
14
14
  const styles = useStyleConfig('LinkButton', { size, ...rest });
15
15
 
16
16
  return (
17
- <Box as="button" disabled={isDisabled} ref={ref} _css={styles} {...rest}>
17
+ <Box as="button" disabled={isDisabled} ref={ref} __css={styles} {...rest}>
18
18
  {children}
19
19
  {rightIconName && <Icon name={rightIconName} size="16" />}
20
20
  </Box>
package/src/index.ts CHANGED
@@ -5,6 +5,9 @@ export * from './hooks';
5
5
 
6
6
  export { default as theme, breakpoints } from './theme';
7
7
 
8
+ export type { LinkButtonProps } from './Components/LinkButton/LinkButton';
9
+ export { default as LinkButton } from './Components/LinkButton/LinkButton';
10
+
8
11
  export type { LinkProps } from './Components/Link/Link';
9
12
  export { default as Link } from './Components/Link/Link';
10
13