@sonic-equipment/ui 0.0.105 → 0.0.106
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.js
CHANGED
|
@@ -8337,23 +8337,18 @@ var styles$B = {"announcement-provider":"announcement-provider-module-sVIKY","an
|
|
|
8337
8337
|
|
|
8338
8338
|
function AnnouncementProvider() {
|
|
8339
8339
|
const languageCode = useLanguageCode();
|
|
8340
|
+
const nodeRef = useRef(null);
|
|
8340
8341
|
const { data: announcements } = useFetchAnnouncements({
|
|
8341
8342
|
languageCode,
|
|
8342
8343
|
});
|
|
8343
8344
|
const [dismissedIds, setDismissedIds] = useLocalStorage('dismissedAnnouncementIds', []);
|
|
8344
8345
|
const filteredAnnouncements = announcements?.filter(({ id }) => !dismissedIds.includes(id));
|
|
8345
|
-
return (jsx(TransitionGroup, { className: styles$B['announcement-provider'], children: filteredAnnouncements?.map(
|
|
8346
|
+
return (jsx(TransitionGroup, { className: styles$B['announcement-provider'], children: filteredAnnouncements?.map(announcement => (jsx(CSSTransition, { classNames: {
|
|
8346
8347
|
enter: styles$B['announcement-enter'],
|
|
8347
8348
|
enterActive: styles$B['announcement-enter-active'],
|
|
8348
8349
|
exit: styles$B['announcement-exit'],
|
|
8349
8350
|
exitActive: styles$B['announcement-exit-active'],
|
|
8350
|
-
}, timeout: 300, children: jsx(ConnectedAnnouncement, { announcement:
|
|
8351
|
-
href,
|
|
8352
|
-
id,
|
|
8353
|
-
text,
|
|
8354
|
-
title,
|
|
8355
|
-
type,
|
|
8356
|
-
}, onDismiss: id => setDismissedIds(dismissedIds => [...dismissedIds, id]) }) }, id))) }));
|
|
8351
|
+
}, nodeRef: nodeRef, timeout: 300, children: jsx(ConnectedAnnouncement, { announcement: announcement, onDismiss: id => setDismissedIds(dismissedIds => [...dismissedIds, id]) }) }, announcement.id))) }));
|
|
8357
8352
|
}
|
|
8358
8353
|
|
|
8359
8354
|
var styles$A = {"page-container":"page-container-module-PYmbC","inner-page-container":"page-container-module-uD8GF"};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react';
|
|
2
2
|
import { Announcement } from './announcement';
|
|
3
|
+
import { AnnouncementProvider } from './announcement-provider';
|
|
3
4
|
declare const meta: {
|
|
4
5
|
component: typeof Announcement;
|
|
5
6
|
parameters: {
|
|
@@ -14,3 +15,4 @@ export declare const Promo: Story;
|
|
|
14
15
|
export declare const Informative: Story;
|
|
15
16
|
export declare const Notice: Story;
|
|
16
17
|
export declare const Critical: Story;
|
|
18
|
+
export declare const Connected: StoryObj<typeof AnnouncementProvider>;
|