@bitrise/bitkit 13.108.0 → 13.110.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.108.0",
4
+ "version": "13.110.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -38,7 +38,7 @@
38
38
  "@floating-ui/react-dom-interactions": "^0.8.1",
39
39
  "@fontsource/figtree": "^5.0.20",
40
40
  "@fontsource/source-code-pro": "^5.0.18",
41
- "framer-motion": "^11.2.12",
41
+ "framer-motion": "^11.2.13",
42
42
  "luxon": "^3.4.4",
43
43
  "react": "^18.3.1",
44
44
  "react-dom": "^18.3.1",
@@ -67,7 +67,7 @@
67
67
  "@storybook/react": "^8.1.11",
68
68
  "@storybook/react-webpack5": "^8.1.11",
69
69
  "@storybook/theming": "^8.1.11",
70
- "@testing-library/dom": "^10.2.0",
70
+ "@testing-library/dom": "^10.3.1",
71
71
  "@testing-library/jest-dom": "^6.4.6",
72
72
  "@testing-library/react": "^16.0.0",
73
73
  "@testing-library/user-event": "^14.5.2",
@@ -75,20 +75,20 @@
75
75
  "@types/luxon": "^3.4.2",
76
76
  "@types/react": "^18.3.3",
77
77
  "@types/react-dom": "^18.3.0",
78
- "@typescript-eslint/eslint-plugin": "^7.14.1",
79
- "@typescript-eslint/parser": "^7.14.1",
78
+ "@typescript-eslint/eslint-plugin": "^7.15.0",
79
+ "@typescript-eslint/parser": "^7.15.0",
80
80
  "axios": "^1.7.2",
81
81
  "eslint": "^8.57.0",
82
- "glob": "^10.4.2",
82
+ "glob": "^10.4.3",
83
83
  "jest": "^29.7.0",
84
84
  "jest-environment-jsdom": "^29.7.0",
85
85
  "jsdom": "^24.1.0",
86
86
  "prettier": "^3.3.2",
87
- "react-hook-form": "^7.52.0",
88
- "release-it": "^17.4.0",
87
+ "react-hook-form": "^7.52.1",
88
+ "release-it": "^17.4.1",
89
89
  "storybook": "^8.1.11",
90
90
  "ts-jest": "^29.1.5",
91
- "typescript": "^5.5.2"
91
+ "typescript": "^5.5.3"
92
92
  },
93
93
  "files": [
94
94
  "src",
@@ -0,0 +1,53 @@
1
+ import { createMultiStyleConfigHelpers } from '@chakra-ui/styled-system';
2
+ import { rem } from '../../utils/utils';
3
+
4
+ const { defineMultiStyleConfig } = createMultiStyleConfigHelpers(['container', 'title', 'items']);
5
+
6
+ const DataWidgetTooltipTheme = defineMultiStyleConfig({
7
+ baseStyle: ({ infoLabel, title }) => {
8
+ return {
9
+ container: {
10
+ display: 'flex',
11
+ gap: '8',
12
+ alignItems: 'center',
13
+ height: '40',
14
+ paddingInlineStart: !title ? '8' : undefined,
15
+ paddingInlineEnd: '8',
16
+ width: 'fit-content',
17
+ boxShadow: 'small',
18
+ },
19
+ title: {
20
+ display: 'inline-block',
21
+ paddingInlineStart: '16',
22
+ paddingInlineEnd: infoLabel ? '12' : '16',
23
+ paddingY: rem(9),
24
+ backgroundColor: 'sys/neutral/subtle',
25
+ borderTopLeftRadius: rem(7),
26
+ borderBottomLeftRadius: rem(7),
27
+ textStyle: 'body/md/semibold',
28
+ },
29
+ items: {
30
+ display: 'flex',
31
+ gap: '4',
32
+ alignItems: 'center',
33
+ paddingInlineStart: '8',
34
+ paddingInlineEnd: '4',
35
+ '> div': {
36
+ display: 'flex',
37
+ gap: '4',
38
+ alignItems: 'center',
39
+ },
40
+ '> div + div': {
41
+ _before: {
42
+ content: `'\\B7'`,
43
+ fontSize: '7',
44
+ marginInline: 4,
45
+ color: 'icon/tertiary',
46
+ },
47
+ },
48
+ },
49
+ };
50
+ },
51
+ });
52
+
53
+ export default DataWidgetTooltipTheme;
@@ -0,0 +1,44 @@
1
+ import { ReactNode } from 'react';
2
+ import { useMultiStyleConfig } from '@chakra-ui/react';
3
+ import Box from '../Box/Box';
4
+ import Card, { CardProps } from '../Card/Card';
5
+ import Text from '../Text/Text';
6
+ import Icon from '../Icon/Icon';
7
+ import Tooltip from '../Tooltip/Tooltip';
8
+
9
+ export interface DataWidgetProps extends CardProps {
10
+ additionalElement?: ReactNode;
11
+ children?: ReactNode;
12
+ infoLabel?: string;
13
+ title?: string;
14
+ }
15
+
16
+ const Info = ({ infoLabel }: { infoLabel: string }) => (
17
+ <Tooltip label={infoLabel}>
18
+ <Icon color="icon/tertiary" name="InfoCircle" size="16" marginInlineStart="4" verticalAlign="-3px" />
19
+ </Tooltip>
20
+ );
21
+
22
+ const DataWidget = (props: DataWidgetProps) => {
23
+ const { additionalElement, children, infoLabel, title, ...rest } = props;
24
+
25
+ const style = useMultiStyleConfig('DataWidget', { infoLabel, title });
26
+
27
+ return (
28
+ <Card {...rest} sx={style.container}>
29
+ {!!title && (
30
+ <Text as="span" sx={style.title}>
31
+ {title}
32
+ {!!infoLabel && <Info infoLabel={infoLabel} />}
33
+ </Text>
34
+ )}
35
+ <Box as="dl" sx={style.items}>
36
+ {children}
37
+ </Box>
38
+ {!!infoLabel && !title && <Info infoLabel={infoLabel} />}
39
+ {additionalElement}
40
+ </Card>
41
+ );
42
+ };
43
+
44
+ export default DataWidget;
@@ -0,0 +1,28 @@
1
+ import DefinitionTooltip from '../DefinitionTooltip/DefinitionTooltip';
2
+ import Icon from '../Icon/Icon';
3
+ import Text from '../Text/Text';
4
+
5
+ export type DataWidgetItemProps = {
6
+ hasWarning?: boolean;
7
+ label: string;
8
+ labelTooltip?: string;
9
+ value: string;
10
+ valueTooltip?: string;
11
+ };
12
+
13
+ const DataWidgetItem = (props: DataWidgetItemProps) => {
14
+ const { hasWarning, label, labelTooltip, value, valueTooltip } = props;
15
+ return (
16
+ <div>
17
+ {hasWarning && <Icon name="WarningColored" size="16" marginInlineEnd="4" />}
18
+ <Text as="dt" color="text/primary" textStyle="body/md/semibold">
19
+ {labelTooltip ? <DefinitionTooltip label={labelTooltip}>{label}</DefinitionTooltip> : label}
20
+ </Text>
21
+ <Text as="dd" textStyle="body/md/regular">
22
+ {valueTooltip ? <DefinitionTooltip label={valueTooltip}>{value}</DefinitionTooltip> : value}
23
+ </Text>
24
+ </div>
25
+ );
26
+ };
27
+
28
+ export default DataWidgetItem;
@@ -48,6 +48,7 @@ import FilterSwitch from './Filter/FilterSwitch/FilterSwitch.theme';
48
48
  import TagsInput from './Form/TagsInput/TagsInput.theme';
49
49
  import DraggableCard from './DraggableCard/DraggableCard.theme';
50
50
  import SelectableTag from './SelectableTag/SelectableTag.theme';
51
+ import DataWidget from './DataWidget/DataWidget.theme';
51
52
 
52
53
  const components = {
53
54
  Accordion,
@@ -58,6 +59,7 @@ const components = {
58
59
  Card,
59
60
  Checkbox,
60
61
  ColorButton,
62
+ DataWidget,
61
63
  Divider,
62
64
  Drawer,
63
65
  Dropdown,
package/src/index.ts CHANGED
@@ -335,3 +335,9 @@ export { default as SelectableTag } from './Components/SelectableTag/SelectableT
335
335
 
336
336
  export type { SelectableTagGroupProps } from './Components/SelectableTag/SelectableTagGroup';
337
337
  export { default as SelectableTagGroup } from './Components/SelectableTag/SelectableTagGroup';
338
+
339
+ export type { DataWidgetProps } from './Components/DataWidget/DataWidget';
340
+ export { default as DataWidget } from './Components/DataWidget/DataWidget';
341
+
342
+ export type { DataWidgetItemProps } from './Components/DataWidget/DataWidgetItem';
343
+ export { default as DataWidgetItem } from './Components/DataWidget/DataWidgetItem';