@bitrise/bitkit 13.116.0 → 13.118.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.116.0",
4
+ "version": "13.118.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -77,6 +77,7 @@ const DatePickerDayView = ({
77
77
  onMouseEnter={onMouseEnter}
78
78
  role="option"
79
79
  sx={day}
80
+ type="button"
80
81
  >
81
82
  <Text sx={text}>{children}</Text>
82
83
  </Box>
@@ -24,6 +24,7 @@ export const DatePickerHeaderPrevious = ({ label }: { label: string }) => {
24
24
  isTooltipDisabled
25
25
  onClick={onPrevious}
26
26
  size="sm"
27
+ type="button"
27
28
  variant="tertiary"
28
29
  visibility={controls === 'right' ? 'hidden' : undefined}
29
30
  />
@@ -46,6 +46,7 @@ const DatePickerMonthItem = ({
46
46
  onClick={() => onClick(n)}
47
47
  role="option"
48
48
  sx={day}
49
+ type="button"
49
50
  width="48"
50
51
  >
51
52
  <Text sx={{ ...text, width: '48' }}>{children}</Text>
@@ -20,7 +20,7 @@ const DraggableCard = forwardRef<HTMLDivElement, DraggableCardProps>((props, ref
20
20
  return (
21
21
  <Card ref={ref} {...rest} sx={style.card}>
22
22
  <Box visibility={isDragging ? 'hidden' : 'visible'} sx={style.wrapper}>
23
- <Box as="button" ref={activatorRef} {...activatorListeners} sx={style.handler}>
23
+ <Box as="button" ref={activatorRef} {...activatorListeners} sx={style.handler} type="button">
24
24
  <svg width="8" height="12" viewBox="0 0 8 12" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
25
25
  <circle cx="2" cy="2" r="1" />
26
26
  <circle cx="6" cy="2" r="1" />
@@ -64,7 +64,7 @@ const FilterDate = (props: FilterDateProps) => {
64
64
  mode="range"
65
65
  >
66
66
  <Box position={isOpen ? 'relative' : undefined} sx={filterStyle.item} zIndex={isOpen ? 'dialog' : undefined}>
67
- <Text as="button" disabled={isLoading} onClick={onToggle} size="2" sx={filterStyle.tagEdit}>
67
+ <Text as="button" disabled={isLoading} onClick={onToggle} size="2" sx={filterStyle.tagEdit} type="button">
68
68
  <Icon color="neutral.60" name="Calendar" size="16" /> {label}
69
69
  <Icon name="ChevronDown" size="16" />
70
70
  </Text>
@@ -75,6 +75,7 @@ const FilterItem = (props: FilterItemProps) => {
75
75
  onClick={onToggle}
76
76
  size="2"
77
77
  sx={filterStyle.tagEdit}
78
+ type="button"
78
79
  >
79
80
  {getText()}
80
81
  {type === 'select' && <Icon name="ChevronDown" size="16" />}
@@ -0,0 +1,33 @@
1
+ import { forwardRef } from '@chakra-ui/react';
2
+ import Text, { TextProps } from '../Text/Text';
3
+ import Tooltip, { TooltipProps } from '../Tooltip/Tooltip';
4
+ import Icon from '../Icon/Icon';
5
+
6
+ export interface LabelProps extends TextProps {
7
+ tooltip?: Omit<TooltipProps, 'children'>;
8
+ }
9
+
10
+ const Label = forwardRef<LabelProps, 'label'>((props, ref) => {
11
+ const { children, tooltip, ...rest } = props;
12
+ return (
13
+ <Text
14
+ as="label"
15
+ textStyle="comp/input/label"
16
+ display="flex"
17
+ alignItems="center"
18
+ gap="4"
19
+ marginBlockEnd="4"
20
+ {...rest}
21
+ ref={ref}
22
+ >
23
+ {children}
24
+ {tooltip && (
25
+ <Tooltip {...tooltip}>
26
+ <Icon color="icon.tertiary" name="InfoCircle" size="16" />
27
+ </Tooltip>
28
+ )}
29
+ </Text>
30
+ );
31
+ });
32
+
33
+ export default Label;
@@ -1,7 +1,8 @@
1
1
  import Box, { BoxProps } from '../Box/Box';
2
2
  import Icon, { TypeIconName } from '../Icon/Icon';
3
- import Tooltip, { TooltipProps } from '../Tooltip/Tooltip';
3
+ import { TooltipProps } from '../Tooltip/Tooltip';
4
4
  import Text, { TextProps } from '../Text/Text';
5
+ import Label from '../Label/Label';
5
6
 
6
7
  export interface LabeledDataProps extends BoxProps {
7
8
  as?: 'div' | 'dl';
@@ -62,14 +63,9 @@ const LabeledData = ({
62
63
 
63
64
  return (
64
65
  <Box as={as} display="flex" flexDirection="column" gap="4" {...rest}>
65
- <Box as="dt" display="flex" alignItems="center" gap="4" color={labelColor} textStyle="comp/input/label">
66
+ <Label as="dt" color={labelColor} tooltip={tooltip}>
66
67
  {label}
67
- {tooltip && (
68
- <Tooltip {...tooltip}>
69
- <Icon color="icon.tertiary" name="InfoCircle" size="16" />
70
- </Tooltip>
71
- )}
72
- </Box>
68
+ </Label>
73
69
  <Box as="dd" display="flex" alignItems="center" gap="4" color="text/body" textStyle={`comp/data/${size}`}>
74
70
  {data}
75
71
  {trendIconName && trendValue && <Icon color={trendIconColor} name={trendIconName} size={trendIconSize} />}
@@ -71,7 +71,7 @@ const Sidebar = forwardRef<SidebarProps, 'nav'>(({ children, title, ...boxProps
71
71
 
72
72
  const SidebarButton = ({ onClick, title }: Pick<BoxProps, 'onClick'> & { title: string }) => {
73
73
  return (
74
- <Box alignItems="center" as="button" display="flex" gap="4" h="56" onClick={onClick} paddingLeft="16">
74
+ <Box alignItems="center" as="button" type="button" display="flex" gap="4" h="56" onClick={onClick} paddingLeft="16">
75
75
  <Icon name="ChevronLeft" size="24" />
76
76
  <Text as="span" lineHeight="var(--space-24)">
77
77
  {title}
@@ -63,6 +63,7 @@ const Th = forwardRef<TableColumnHeaderProps, 'th'>((props, ref) => {
63
63
  flexDirection: isNumeric ? 'row-reverse' : 'row',
64
64
  }}
65
65
  as="button"
66
+ type="button"
66
67
  onClick={onClick}
67
68
  >
68
69
  {properties.children}
@@ -47,7 +47,7 @@ const Toggletip = (props: ToggletipProps) => {
47
47
  return (
48
48
  <Popover placement="top" variant="dark" withArrow {...rest}>
49
49
  <PopoverTrigger>
50
- <Box as="button" {...(popoverTrigger || {})}>
50
+ <Box as="button" type="button" {...(popoverTrigger || {})}>
51
51
  {children}
52
52
  </Box>
53
53
  </PopoverTrigger>
package/src/index.ts CHANGED
@@ -345,3 +345,6 @@ export { default as DataWidget } from './Components/DataWidget/DataWidget';
345
345
 
346
346
  export type { DataWidgetItemProps } from './Components/DataWidget/DataWidgetItem';
347
347
  export { default as DataWidgetItem } from './Components/DataWidget/DataWidgetItem';
348
+
349
+ export type { LabelProps } from './Components/Label/Label';
350
+ export { default as Label } from './Components/Label/Label';