@balena/ui-shared-components 13.0.1-build-renovate-major-7-react-router-dom-4d0f1522f5b29b2463a45372d50ffd57935d613b-1 → 14.0.0-build-remove-announcement-component-c55a3354b337b349f4cd13392d0a10da32df8ce4-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/dist/index.d.ts
CHANGED
|
@@ -42,8 +42,6 @@ export type { LimitedRowImagesProps } from './components/LimitedRowImages';
|
|
|
42
42
|
export { LimitedRowImages } from './components/LimitedRowImages';
|
|
43
43
|
export type { MUILinkWithTrackingProps } from './components/MUILinkWithTracking';
|
|
44
44
|
export { MUILinkWithTracking } from './components/MUILinkWithTracking';
|
|
45
|
-
export type { AnnouncementProps, AnnouncementCloseReason, } from './components/Announcement';
|
|
46
|
-
export { Announcement } from './components/Announcement';
|
|
47
45
|
export type { OrderedListItemProps } from './components/OrderedListItem';
|
|
48
46
|
export { OrderedListItem } from './components/OrderedListItem';
|
|
49
47
|
export { generateHexColorFromString, HighlightedName, } from './components/HighlightedName';
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,6 @@ export { CollectionSummary } from './components/CollectionSummary';
|
|
|
20
20
|
export { DropDownButton } from './components/DropDownButton';
|
|
21
21
|
export { LimitedRowImages } from './components/LimitedRowImages';
|
|
22
22
|
export { MUILinkWithTracking } from './components/MUILinkWithTracking';
|
|
23
|
-
export { Announcement } from './components/Announcement';
|
|
24
23
|
export { OrderedListItem } from './components/OrderedListItem';
|
|
25
24
|
export { generateHexColorFromString, HighlightedName, } from './components/HighlightedName';
|
|
26
25
|
export { RouterLinkWithTracking } from './components/RouterLinkWithTracking';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@balena/ui-shared-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0-build-remove-announcement-component-c55a3354b337b349f4cd13392d0a10da32df8ce4-1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"files": [
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"react-dropzone": "^14.2.3",
|
|
45
45
|
"react-helmet": "^6.1.0",
|
|
46
46
|
"react-markdown": "^10.0.0",
|
|
47
|
-
"react-router-dom": "^
|
|
47
|
+
"react-router-dom": "^6.28.0",
|
|
48
48
|
"remark-breaks": "^4.0.0",
|
|
49
49
|
"remark-gfm": "^4.0.0",
|
|
50
50
|
"rimraf": "^6.0.0",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
},
|
|
133
133
|
"homepage": "https://github.com/balena-io/ui-shared-components#readme",
|
|
134
134
|
"versionist": {
|
|
135
|
-
"publishedAt": "2025-07-
|
|
135
|
+
"publishedAt": "2025-07-28T12:58:39.016Z"
|
|
136
136
|
},
|
|
137
137
|
"overrides": {
|
|
138
138
|
"storybook": "$storybook"
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { SxProps } from '@mui/material';
|
|
3
|
-
import type { SnackbarCloseReason } from '@mui/material/Snackbar/Snackbar';
|
|
4
|
-
export type AnnouncementCloseReason = SnackbarCloseReason | 'closeButtonClick' | 'linkClick';
|
|
5
|
-
export interface AnnouncementProps {
|
|
6
|
-
open?: boolean;
|
|
7
|
-
onClose: (event: React.SyntheticEvent<any> | Event, reason: AnnouncementCloseReason) => void;
|
|
8
|
-
campaignId: string;
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
illustration?: React.ReactNode;
|
|
11
|
-
title: string;
|
|
12
|
-
sx?: SxProps;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* This component is a notification intended to be displayed in the bottom right
|
|
16
|
-
* corner of the screen, usually sharing updates on the product with our users.
|
|
17
|
-
*
|
|
18
|
-
* This is a Themed Component as documented here: https://mui.com/material-ui/customization/creating-themed-components/.
|
|
19
|
-
* As such, it can be modified in the theme.
|
|
20
|
-
*/
|
|
21
|
-
export declare const Announcement: React.ForwardRefExoticComponent<AnnouncementProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { Typography } from '@mui/material';
|
|
5
|
-
import { Box, Slide, Snackbar, Stack, styled, useThemeProps, } from '@mui/material';
|
|
6
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
7
|
-
import { faClose } from '@fortawesome/free-solid-svg-icons/faClose';
|
|
8
|
-
import { IconButtonWithTracking } from '../IconButtonWithTracking';
|
|
9
|
-
import { useEffect } from 'react';
|
|
10
|
-
import { useAnalyticsContext } from '../../contexts/AnalyticsContext';
|
|
11
|
-
import { token } from '../../utils/token';
|
|
12
|
-
const AnnouncementRoot = styled(Box, {
|
|
13
|
-
name: 'Announcement',
|
|
14
|
-
slot: 'root',
|
|
15
|
-
})(({ theme }) => ({
|
|
16
|
-
alignItems: 'center',
|
|
17
|
-
backgroundColor: 'white',
|
|
18
|
-
borderRadius: token('shape.borderRadius.md'),
|
|
19
|
-
boxShadow: '0px 0px 8px 0px rgba(35, 68, 94, 0.3)', // TODO add a design token for box shadows
|
|
20
|
-
display: 'flex',
|
|
21
|
-
gap: theme.spacing(3),
|
|
22
|
-
maxWidth: '100%',
|
|
23
|
-
padding: theme.spacing(3),
|
|
24
|
-
width: '100%',
|
|
25
|
-
}));
|
|
26
|
-
const AnnouncementIllustration = styled('figure', {
|
|
27
|
-
name: 'Announcement',
|
|
28
|
-
slot: 'illustration',
|
|
29
|
-
})(({ theme }) => ({
|
|
30
|
-
margin: 0,
|
|
31
|
-
maxWidth: 48,
|
|
32
|
-
minWidth: 48,
|
|
33
|
-
[theme.breakpoints.up('sm')]: {
|
|
34
|
-
maxWidth: 72,
|
|
35
|
-
},
|
|
36
|
-
'& *': {
|
|
37
|
-
width: '100%',
|
|
38
|
-
},
|
|
39
|
-
}));
|
|
40
|
-
const AnnouncementTitle = styled('h3', {
|
|
41
|
-
name: 'Announcement',
|
|
42
|
-
slot: 'title',
|
|
43
|
-
})(({ theme }) => (Object.assign(Object.assign({}, theme.typography.bodyLg), { margin: 0, display: 'flex', alignItems: 'center', gap: theme.spacing(1) })));
|
|
44
|
-
const AnnouncementContent = styled(Stack, {
|
|
45
|
-
name: 'Announcement',
|
|
46
|
-
slot: 'content',
|
|
47
|
-
})(({ theme }) => ({
|
|
48
|
-
flexGrow: 1,
|
|
49
|
-
gap: theme.spacing(1),
|
|
50
|
-
[theme.breakpoints.up('sm')]: {
|
|
51
|
-
gap: theme.spacing(2),
|
|
52
|
-
},
|
|
53
|
-
}));
|
|
54
|
-
function SlideTransition(props) {
|
|
55
|
-
return _jsx(Slide, Object.assign({}, props, { direction: "up" }));
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* This component is a notification intended to be displayed in the bottom right
|
|
59
|
-
* corner of the screen, usually sharing updates on the product with our users.
|
|
60
|
-
*
|
|
61
|
-
* This is a Themed Component as documented here: https://mui.com/material-ui/customization/creating-themed-components/.
|
|
62
|
-
* As such, it can be modified in the theme.
|
|
63
|
-
*/
|
|
64
|
-
export const Announcement = React.forwardRef(function Announcement(inProps, ref) {
|
|
65
|
-
const props = useThemeProps({ props: inProps, name: 'Announcement' });
|
|
66
|
-
const { illustration, campaignId, children, title, onClose, open, sx } = props, other = __rest(props, ["illustration", "campaignId", "children", "title", "onClose", "open", "sx"]);
|
|
67
|
-
const { state: analytics } = useAnalyticsContext();
|
|
68
|
-
// TODO remove this event after the first campaign, when we are sure that the notification is being shown properly
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
var _a;
|
|
71
|
-
if (open) {
|
|
72
|
-
(_a = analytics.webTracker) === null || _a === void 0 ? void 0 : _a.track('Announcement displayed', {
|
|
73
|
-
campaign_id: campaignId,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}, [open, analytics.webTracker, campaignId]);
|
|
77
|
-
return (_jsx(Snackbar, { open: open, anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, TransitionComponent: SlideTransition, ref: ref, onClose: onClose, sx: [
|
|
78
|
-
(theme) => ({
|
|
79
|
-
zIndex: theme.zIndex.drawer - 1,
|
|
80
|
-
[theme.breakpoints.up('sm')]: {
|
|
81
|
-
maxWidth: 350,
|
|
82
|
-
},
|
|
83
|
-
}),
|
|
84
|
-
// See: https://mui.com/system/getting-started/the-sx-prop/#passing-the-sx-prop
|
|
85
|
-
...(Array.isArray(sx) ? sx : [sx]),
|
|
86
|
-
], children: _jsxs(AnnouncementRoot, Object.assign({}, other, { children: [illustration && (_jsx(AnnouncementIllustration, { children: illustration })), _jsxs(AnnouncementContent, { children: [_jsxs(AnnouncementTitle, { children: [title, _jsx(IconButtonWithTracking, { edge: "end", size: "small", eventName: "Announcement dismissed", eventProperties: { campaign_id: campaignId }, onClick: (e) => {
|
|
87
|
-
onClose === null || onClose === void 0 ? void 0 : onClose(e, 'closeButtonClick');
|
|
88
|
-
}, sx: { ml: 'auto', my: -1 }, children: _jsx(FontAwesomeIcon, { icon: faClose }) })] }), _jsx(Typography, { children: children })] })] })) }, SlideTransition.name));
|
|
89
|
-
});
|