@cratis/showrunner.marquee.react 0.0.0-stage → 1.11.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.
Files changed (205) hide show
  1. package/.storybook/main.ts +11 -0
  2. package/.storybook/preview.tsx +21 -0
  3. package/Banner/MarqueeBanner.tsx +49 -0
  4. package/Banner/index.ts +4 -0
  5. package/Dialog/MarqueeDialog.tsx +58 -0
  6. package/Dialog/index.ts +4 -0
  7. package/Icons.tsx +34 -0
  8. package/Labels/MarqueeLabels.ts +28 -0
  9. package/Labels/defaultMarqueeLabels.ts +17 -0
  10. package/Labels/index.ts +6 -0
  11. package/Labels/resolveLabels.ts +12 -0
  12. package/Markdown/MarqueeMarkdown.tsx +41 -0
  13. package/Markdown/index.ts +5 -0
  14. package/Markdown/safeLink.ts +25 -0
  15. package/Marquee.tsx +56 -0
  16. package/README.md +48 -2
  17. package/Selection/announcementSelection.ts +51 -0
  18. package/Selection/importancePresentation.ts +33 -0
  19. package/Selection/index.ts +5 -0
  20. package/dist/cjs/Banner/MarqueeBanner.d.ts +11 -0
  21. package/dist/cjs/Banner/MarqueeBanner.d.ts.map +1 -0
  22. package/dist/cjs/Banner/MarqueeBanner.js +52 -0
  23. package/dist/cjs/Banner/MarqueeBanner.js.map +1 -0
  24. package/dist/cjs/Banner/MarqueeBanner.stories.d.ts +11 -0
  25. package/dist/cjs/Banner/MarqueeBanner.stories.d.ts.map +1 -0
  26. package/dist/cjs/Banner/index.d.ts +2 -0
  27. package/dist/cjs/Banner/index.d.ts.map +1 -0
  28. package/dist/cjs/Dialog/MarqueeDialog.d.ts +13 -0
  29. package/dist/cjs/Dialog/MarqueeDialog.d.ts.map +1 -0
  30. package/dist/cjs/Dialog/MarqueeDialog.js +43 -0
  31. package/dist/cjs/Dialog/MarqueeDialog.js.map +1 -0
  32. package/dist/cjs/Dialog/MarqueeDialog.stories.d.ts +13 -0
  33. package/dist/cjs/Dialog/MarqueeDialog.stories.d.ts.map +1 -0
  34. package/dist/cjs/Dialog/index.d.ts +2 -0
  35. package/dist/cjs/Dialog/index.d.ts.map +1 -0
  36. package/dist/cjs/Examples/AppShell.d.ts +5 -0
  37. package/dist/cjs/Examples/AppShell.d.ts.map +1 -0
  38. package/dist/cjs/Examples/CustomBanner.d.ts +2 -0
  39. package/dist/cjs/Examples/CustomBanner.d.ts.map +1 -0
  40. package/dist/cjs/Examples/CustomDialog.d.ts +2 -0
  41. package/dist/cjs/Examples/CustomDialog.d.ts.map +1 -0
  42. package/dist/cjs/Examples/CustomMarkdown.d.ts +2 -0
  43. package/dist/cjs/Examples/CustomMarkdown.d.ts.map +1 -0
  44. package/dist/cjs/Examples/LocalizedMarquee.d.ts +2 -0
  45. package/dist/cjs/Examples/LocalizedMarquee.d.ts.map +1 -0
  46. package/dist/cjs/Examples/OwnSurface.d.ts +2 -0
  47. package/dist/cjs/Examples/OwnSurface.d.ts.map +1 -0
  48. package/dist/cjs/Icons.d.ts +6 -0
  49. package/dist/cjs/Icons.d.ts.map +1 -0
  50. package/dist/cjs/Icons.js +29 -0
  51. package/dist/cjs/Icons.js.map +1 -0
  52. package/dist/cjs/Labels/MarqueeLabels.d.ts +10 -0
  53. package/dist/cjs/Labels/MarqueeLabels.d.ts.map +1 -0
  54. package/dist/cjs/Labels/defaultMarqueeLabels.d.ts +3 -0
  55. package/dist/cjs/Labels/defaultMarqueeLabels.d.ts.map +1 -0
  56. package/dist/cjs/Labels/defaultMarqueeLabels.js +18 -0
  57. package/dist/cjs/Labels/defaultMarqueeLabels.js.map +1 -0
  58. package/dist/cjs/Labels/index.d.ts +4 -0
  59. package/dist/cjs/Labels/index.d.ts.map +1 -0
  60. package/dist/cjs/Labels/resolveLabels.d.ts +3 -0
  61. package/dist/cjs/Labels/resolveLabels.d.ts.map +1 -0
  62. package/dist/cjs/Labels/resolveLabels.js +17 -0
  63. package/dist/cjs/Labels/resolveLabels.js.map +1 -0
  64. package/dist/cjs/Markdown/MarqueeMarkdown.d.ts +7 -0
  65. package/dist/cjs/Markdown/MarqueeMarkdown.d.ts.map +1 -0
  66. package/dist/cjs/Markdown/MarqueeMarkdown.js +38 -0
  67. package/dist/cjs/Markdown/MarqueeMarkdown.js.map +1 -0
  68. package/dist/cjs/Markdown/index.d.ts +3 -0
  69. package/dist/cjs/Markdown/index.d.ts.map +1 -0
  70. package/dist/cjs/Markdown/safeLink.d.ts +3 -0
  71. package/dist/cjs/Markdown/safeLink.d.ts.map +1 -0
  72. package/dist/cjs/Markdown/safeLink.js +30 -0
  73. package/dist/cjs/Markdown/safeLink.js.map +1 -0
  74. package/dist/cjs/Marquee.d.ts +14 -0
  75. package/dist/cjs/Marquee.d.ts.map +1 -0
  76. package/dist/cjs/Marquee.js +44 -0
  77. package/dist/cjs/Marquee.js.map +1 -0
  78. package/dist/cjs/Selection/announcementSelection.d.ts +8 -0
  79. package/dist/cjs/Selection/announcementSelection.d.ts.map +1 -0
  80. package/dist/cjs/Selection/announcementSelection.js +34 -0
  81. package/dist/cjs/Selection/announcementSelection.js.map +1 -0
  82. package/dist/cjs/Selection/importancePresentation.d.ts +8 -0
  83. package/dist/cjs/Selection/importancePresentation.d.ts.map +1 -0
  84. package/dist/cjs/Selection/importancePresentation.js +33 -0
  85. package/dist/cjs/Selection/importancePresentation.js.map +1 -0
  86. package/dist/cjs/Selection/index.d.ts +3 -0
  87. package/dist/cjs/Selection/index.d.ts.map +1 -0
  88. package/dist/cjs/index.d.ts +9 -0
  89. package/dist/cjs/index.d.ts.map +1 -0
  90. package/dist/cjs/index.js +31 -0
  91. package/dist/cjs/index.js.map +1 -0
  92. package/dist/cjs/package.json +3 -0
  93. package/dist/cjs/useAnnouncements.d.ts +12 -0
  94. package/dist/cjs/useAnnouncements.d.ts.map +1 -0
  95. package/dist/cjs/useAnnouncements.js +52 -0
  96. package/dist/cjs/useAnnouncements.js.map +1 -0
  97. package/dist/esm/Banner/MarqueeBanner.d.ts +11 -0
  98. package/dist/esm/Banner/MarqueeBanner.d.ts.map +1 -0
  99. package/dist/esm/Banner/MarqueeBanner.js +50 -0
  100. package/dist/esm/Banner/MarqueeBanner.js.map +1 -0
  101. package/dist/esm/Banner/MarqueeBanner.stories.d.ts +11 -0
  102. package/dist/esm/Banner/MarqueeBanner.stories.d.ts.map +1 -0
  103. package/dist/esm/Banner/MarqueeBanner.stories.js +15 -0
  104. package/dist/esm/Banner/MarqueeBanner.stories.js.map +1 -0
  105. package/dist/esm/Banner/index.d.ts +2 -0
  106. package/dist/esm/Banner/index.d.ts.map +1 -0
  107. package/dist/esm/Banner/index.js +2 -0
  108. package/dist/esm/Banner/index.js.map +1 -0
  109. package/dist/esm/Dialog/MarqueeDialog.d.ts +13 -0
  110. package/dist/esm/Dialog/MarqueeDialog.d.ts.map +1 -0
  111. package/dist/esm/Dialog/MarqueeDialog.js +41 -0
  112. package/dist/esm/Dialog/MarqueeDialog.js.map +1 -0
  113. package/dist/esm/Dialog/MarqueeDialog.stories.d.ts +13 -0
  114. package/dist/esm/Dialog/MarqueeDialog.stories.d.ts.map +1 -0
  115. package/dist/esm/Dialog/MarqueeDialog.stories.js +18 -0
  116. package/dist/esm/Dialog/MarqueeDialog.stories.js.map +1 -0
  117. package/dist/esm/Dialog/index.d.ts +2 -0
  118. package/dist/esm/Dialog/index.d.ts.map +1 -0
  119. package/dist/esm/Dialog/index.js +2 -0
  120. package/dist/esm/Dialog/index.js.map +1 -0
  121. package/dist/esm/Examples/AppShell.d.ts +5 -0
  122. package/dist/esm/Examples/AppShell.d.ts.map +1 -0
  123. package/dist/esm/Examples/AppShell.js +6 -0
  124. package/dist/esm/Examples/AppShell.js.map +1 -0
  125. package/dist/esm/Examples/CustomBanner.d.ts +2 -0
  126. package/dist/esm/Examples/CustomBanner.d.ts.map +1 -0
  127. package/dist/esm/Examples/CustomBanner.js +5 -0
  128. package/dist/esm/Examples/CustomBanner.js.map +1 -0
  129. package/dist/esm/Examples/CustomDialog.d.ts +2 -0
  130. package/dist/esm/Examples/CustomDialog.d.ts.map +1 -0
  131. package/dist/esm/Examples/CustomDialog.js +5 -0
  132. package/dist/esm/Examples/CustomDialog.js.map +1 -0
  133. package/dist/esm/Examples/CustomMarkdown.d.ts +2 -0
  134. package/dist/esm/Examples/CustomMarkdown.d.ts.map +1 -0
  135. package/dist/esm/Examples/CustomMarkdown.js +5 -0
  136. package/dist/esm/Examples/CustomMarkdown.js.map +1 -0
  137. package/dist/esm/Examples/LocalizedMarquee.d.ts +2 -0
  138. package/dist/esm/Examples/LocalizedMarquee.d.ts.map +1 -0
  139. package/dist/esm/Examples/LocalizedMarquee.js +12 -0
  140. package/dist/esm/Examples/LocalizedMarquee.js.map +1 -0
  141. package/dist/esm/Examples/OwnSurface.d.ts +2 -0
  142. package/dist/esm/Examples/OwnSurface.d.ts.map +1 -0
  143. package/dist/esm/Examples/OwnSurface.js +7 -0
  144. package/dist/esm/Examples/OwnSurface.js.map +1 -0
  145. package/dist/esm/Icons.d.ts +6 -0
  146. package/dist/esm/Icons.d.ts.map +1 -0
  147. package/dist/esm/Icons.js +27 -0
  148. package/dist/esm/Icons.js.map +1 -0
  149. package/dist/esm/Labels/MarqueeLabels.d.ts +10 -0
  150. package/dist/esm/Labels/MarqueeLabels.d.ts.map +1 -0
  151. package/dist/esm/Labels/MarqueeLabels.js +2 -0
  152. package/dist/esm/Labels/MarqueeLabels.js.map +1 -0
  153. package/dist/esm/Labels/defaultMarqueeLabels.d.ts +3 -0
  154. package/dist/esm/Labels/defaultMarqueeLabels.d.ts.map +1 -0
  155. package/dist/esm/Labels/defaultMarqueeLabels.js +16 -0
  156. package/dist/esm/Labels/defaultMarqueeLabels.js.map +1 -0
  157. package/dist/esm/Labels/index.d.ts +4 -0
  158. package/dist/esm/Labels/index.d.ts.map +1 -0
  159. package/dist/esm/Labels/index.js +4 -0
  160. package/dist/esm/Labels/index.js.map +1 -0
  161. package/dist/esm/Labels/resolveLabels.d.ts +3 -0
  162. package/dist/esm/Labels/resolveLabels.d.ts.map +1 -0
  163. package/dist/esm/Labels/resolveLabels.js +15 -0
  164. package/dist/esm/Labels/resolveLabels.js.map +1 -0
  165. package/dist/esm/Markdown/MarqueeMarkdown.d.ts +7 -0
  166. package/dist/esm/Markdown/MarqueeMarkdown.d.ts.map +1 -0
  167. package/dist/esm/Markdown/MarqueeMarkdown.js +36 -0
  168. package/dist/esm/Markdown/MarqueeMarkdown.js.map +1 -0
  169. package/dist/esm/Markdown/index.d.ts +3 -0
  170. package/dist/esm/Markdown/index.d.ts.map +1 -0
  171. package/dist/esm/Markdown/index.js +3 -0
  172. package/dist/esm/Markdown/index.js.map +1 -0
  173. package/dist/esm/Markdown/safeLink.d.ts +3 -0
  174. package/dist/esm/Markdown/safeLink.d.ts.map +1 -0
  175. package/dist/esm/Markdown/safeLink.js +27 -0
  176. package/dist/esm/Markdown/safeLink.js.map +1 -0
  177. package/dist/esm/Marquee.d.ts +14 -0
  178. package/dist/esm/Marquee.d.ts.map +1 -0
  179. package/dist/esm/Marquee.js +42 -0
  180. package/dist/esm/Marquee.js.map +1 -0
  181. package/dist/esm/Selection/announcementSelection.d.ts +8 -0
  182. package/dist/esm/Selection/announcementSelection.d.ts.map +1 -0
  183. package/dist/esm/Selection/announcementSelection.js +31 -0
  184. package/dist/esm/Selection/announcementSelection.js.map +1 -0
  185. package/dist/esm/Selection/importancePresentation.d.ts +8 -0
  186. package/dist/esm/Selection/importancePresentation.d.ts.map +1 -0
  187. package/dist/esm/Selection/importancePresentation.js +31 -0
  188. package/dist/esm/Selection/importancePresentation.js.map +1 -0
  189. package/dist/esm/Selection/index.d.ts +3 -0
  190. package/dist/esm/Selection/index.d.ts.map +1 -0
  191. package/dist/esm/Selection/index.js +3 -0
  192. package/dist/esm/Selection/index.js.map +1 -0
  193. package/dist/esm/index.d.ts +9 -0
  194. package/dist/esm/index.d.ts.map +1 -0
  195. package/dist/esm/index.js +12 -0
  196. package/dist/esm/index.js.map +1 -0
  197. package/dist/esm/package.json +3 -0
  198. package/dist/esm/useAnnouncements.d.ts +12 -0
  199. package/dist/esm/useAnnouncements.d.ts.map +1 -0
  200. package/dist/esm/useAnnouncements.js +49 -0
  201. package/dist/esm/useAnnouncements.js.map +1 -0
  202. package/index.ts +11 -0
  203. package/package.json +90 -4
  204. package/styles.css +129 -0
  205. package/useAnnouncements.ts +69 -0
@@ -0,0 +1,11 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import type { StorybookConfig } from '@storybook/react-vite';
5
+
6
+ const config: StorybookConfig = {
7
+ stories: ['../**/*.stories.tsx'],
8
+ framework: '@storybook/react-vite'
9
+ };
10
+
11
+ export default config;
@@ -0,0 +1,21 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { CratisComponentsProvider } from '@cratis/components';
5
+ import '@cratis/components/tokens';
6
+ import '@cratis/components/styles';
7
+ import '@cratis/components/theme';
8
+ import type { Preview } from '@storybook/react-vite';
9
+ import '../styles.css';
10
+
11
+ const preview: Preview = {
12
+ decorators: [
13
+ Story => (
14
+ <CratisComponentsProvider>
15
+ <Story />
16
+ </CratisComponentsProvider>
17
+ )
18
+ ]
19
+ };
20
+
21
+ export default preview;
@@ -0,0 +1,49 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { AnnouncementForMe } from '@cratis/showrunner.marquee';
5
+ import { ComponentType } from 'react';
6
+ import { ImportanceIcon } from '../Icons.js';
7
+ import { MarqueeLabels } from '../Labels/index.js';
8
+ import { MarqueeMarkdown, MarqueeMarkdownProps } from '../Markdown/index.js';
9
+ import { importancePresentation } from '../Selection/index.js';
10
+
11
+ /**
12
+ * Props for {@link MarqueeBanner}, and for the component given to the `banner` slot of {@link Marquee}.
13
+ */
14
+ export interface MarqueeBannerProps {
15
+ /** The banners to show, the most important first. Empty when there is none. */
16
+ announcements: AnnouncementForMe[];
17
+
18
+ /** The texts to show. */
19
+ labels: MarqueeLabels;
20
+
21
+ /** Renders the Markdown of a body; the `markdown` slot of {@link Marquee}. */
22
+ markdown?: ComponentType<MarqueeMarkdownProps>;
23
+ }
24
+
25
+ /**
26
+ * The banners at the top of the application, one row for each, with the icon and the color of its importance.
27
+ *
28
+ * The region is announced politely when a row appears, and is always rendered, because a live region that is added
29
+ * with its content is not reliably announced. It takes no space while it is empty. A banner has no close button: it
30
+ * stays until it is withdrawn or its window ends.
31
+ */
32
+ export const MarqueeBanner = ({ announcements, labels, markdown: Markdown = MarqueeMarkdown }: MarqueeBannerProps) => (
33
+ <div className='marquee-banner' role='status' aria-live='polite' aria-label={labels.banners}>
34
+ {announcements.map(announcement => {
35
+ const presentation = importancePresentation(announcement.importance, labels);
36
+ return (
37
+ <div key={announcement.id.toString()} className={`marquee-banner__item marquee-banner__item--${presentation.modifier}`}>
38
+ <ImportanceIcon presentation={presentation} />
39
+ <div className='marquee-banner__text'>
40
+ <span className='marquee-banner__title'>{announcement.title}</span>
41
+ <div className='marquee-banner__body'>
42
+ <Markdown source={announcement.body} compact />
43
+ </div>
44
+ </div>
45
+ </div>
46
+ );
47
+ })}
48
+ </div>
49
+ );
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ export * from './MarqueeBanner.js';
@@ -0,0 +1,58 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { DialogButtons } from '@cratis/arc.react/dialogs';
5
+ import { Dialog, DialogInitialFocus } from '@cratis/components/Dialogs';
6
+ import { AnnouncementForMe } from '@cratis/showrunner.marquee';
7
+ import { ComponentType } from 'react';
8
+ import { ImportanceIcon } from '../Icons.js';
9
+ import { MarqueeLabels } from '../Labels/index.js';
10
+ import { MarqueeMarkdown, MarqueeMarkdownProps } from '../Markdown/index.js';
11
+ import { importancePresentation } from '../Selection/index.js';
12
+
13
+ /**
14
+ * Props for {@link MarqueeDialog}, and for the component given to the `dialog` slot of {@link Marquee}.
15
+ */
16
+ export interface MarqueeDialogProps {
17
+ /** The announcement to show. */
18
+ announcement: AnnouncementForMe;
19
+
20
+ /** Whether more dialogs follow this one; the button then moves on instead of finishing. */
21
+ hasMore: boolean;
22
+
23
+ /** Called when the person closes the dialog, with the button, Escape or the close button of the header. */
24
+ onClose: () => void;
25
+
26
+ /** The texts to show. */
27
+ labels: MarqueeLabels;
28
+
29
+ /** Renders the Markdown of a body; the `markdown` slot of {@link Marquee}. */
30
+ markdown?: ComponentType<MarqueeMarkdownProps>;
31
+ }
32
+
33
+ /**
34
+ * One announcement in a dialog. Focus moves into the dialog and is kept in it until it is closed, and lands on the
35
+ * title instead of the button, so the Enter or Space that was being pressed when it opened does not close it unread.
36
+ */
37
+ export const MarqueeDialog = ({ announcement, hasMore, onClose, labels, markdown: Markdown = MarqueeMarkdown }: MarqueeDialogProps) => {
38
+ const presentation = importancePresentation(announcement.importance, labels);
39
+
40
+ return (
41
+ <Dialog
42
+ title={announcement.title}
43
+ width='34rem'
44
+ buttons={DialogButtons.Ok}
45
+ okLabel={hasMore ? labels.next : labels.acknowledge}
46
+ closeAriaLabel={labels.close}
47
+ initialFocus={DialogInitialFocus.Content}
48
+ onConfirm={onClose}
49
+ onCancel={onClose}>
50
+ <div className='marquee-dialog'>
51
+ <div className={`marquee-dialog__importance marquee-dialog__importance--${presentation.modifier}`}>
52
+ <ImportanceIcon presentation={presentation} />
53
+ </div>
54
+ <Markdown source={announcement.body} />
55
+ </div>
56
+ </Dialog>
57
+ );
58
+ };
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ export * from './MarqueeDialog.js';
package/Icons.tsx ADDED
@@ -0,0 +1,34 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { ImportancePresentation } from './Selection/index.js';
5
+
6
+ const paths: Record<ImportancePresentation['modifier'], string> = {
7
+ information: 'M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z',
8
+ warning: 'M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z',
9
+ critical: 'M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'
10
+ };
11
+
12
+ /**
13
+ * Props for {@link ImportanceIcon}.
14
+ */
15
+ export interface ImportanceIconProps {
16
+ /** How the importance is presented. */
17
+ presentation: ImportancePresentation;
18
+ }
19
+
20
+ /**
21
+ * The icon of an importance, named for screen readers so the level is read out with the announcement.
22
+ */
23
+ export const ImportanceIcon = ({ presentation }: ImportanceIconProps) => (
24
+ <svg
25
+ className={`marquee-icon marquee-icon--${presentation.modifier}`}
26
+ viewBox='0 0 24 24'
27
+ width='1em'
28
+ height='1em'
29
+ role='img'
30
+ aria-label={presentation.label}
31
+ focusable='false'>
32
+ <path fill='currentColor' d={paths[presentation.modifier]} />
33
+ </svg>
34
+ );
@@ -0,0 +1,28 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ /**
5
+ * The texts Marquee shows. Every one is a prop so a product can localize it.
6
+ */
7
+ export interface MarqueeLabels {
8
+ /** The accessible name of the region the banners are announced in. */
9
+ banners: string;
10
+
11
+ /** The button that closes a dialog when no other follows. */
12
+ acknowledge: string;
13
+
14
+ /** The button that moves on to the next dialog when more follow. */
15
+ next: string;
16
+
17
+ /** The accessible name of the close button in the header of a dialog. */
18
+ close: string;
19
+
20
+ /** The accessible name of the icon of an announcement of information importance. */
21
+ information: string;
22
+
23
+ /** The accessible name of the icon of an announcement of warning importance. */
24
+ warning: string;
25
+
26
+ /** The accessible name of the icon of an announcement of critical importance. */
27
+ critical: string;
28
+ }
@@ -0,0 +1,17 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { MarqueeLabels } from './MarqueeLabels.js';
5
+
6
+ /**
7
+ * The English texts Marquee shows without overrides.
8
+ */
9
+ export const defaultMarqueeLabels: MarqueeLabels = {
10
+ banners: 'Announcements',
11
+ acknowledge: 'Got it',
12
+ next: 'Next',
13
+ close: 'Close',
14
+ information: 'Information',
15
+ warning: 'Warning',
16
+ critical: 'Critical'
17
+ };
@@ -0,0 +1,6 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ export * from './defaultMarqueeLabels.js';
5
+ export * from './MarqueeLabels.js';
6
+ export * from './resolveLabels.js';
@@ -0,0 +1,12 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { defaultMarqueeLabels } from './defaultMarqueeLabels.js';
5
+ import { MarqueeLabels } from './MarqueeLabels.js';
6
+
7
+ /**
8
+ * Overlays the texts a product gives on the English defaults.
9
+ * @param overrides The texts to replace; the rest stay English.
10
+ * @returns The texts to show.
11
+ */
12
+ export const resolveLabels = (overrides?: Partial<MarqueeLabels>): MarqueeLabels => ({ ...defaultMarqueeLabels, ...overrides });
@@ -0,0 +1,41 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { ComponentProps, ComponentType } from 'react';
5
+ import ReactMarkdown from 'react-markdown';
6
+ import { safeLinkOrEmpty } from './safeLink.js';
7
+
8
+ /**
9
+ * Props for the component that renders the Markdown body of an announcement. Give your own to the `markdown` slot of
10
+ * {@link Marquee}.
11
+ */
12
+ export interface MarqueeMarkdownProps {
13
+ /** The Markdown source. */
14
+ source: string;
15
+
16
+ /** Whether to render inline, as the banner does: paragraphs run together and take no space between them. */
17
+ compact?: boolean;
18
+ }
19
+
20
+ type LinkProps = ComponentProps<'a'>;
21
+
22
+ const Link = ({ href, title, children }: LinkProps) => href
23
+ ? <a href={href} title={title} target='_blank' rel='noopener noreferrer'>{children}</a>
24
+ : <span>{children}</span>;
25
+
26
+ /**
27
+ * Renders the Markdown of an announcement as React elements, never as injected HTML: raw HTML in the source is
28
+ * dropped, images are left out, a link opens in a new tab with `noopener noreferrer`, and only `https`, `mailto`
29
+ * and `tel` links are links at all.
30
+ */
31
+ export const MarqueeMarkdown: ComponentType<MarqueeMarkdownProps> = ({ source, compact = false }: MarqueeMarkdownProps) => (
32
+ <div className={compact ? 'marquee-markdown marquee-markdown--compact' : 'marquee-markdown'}>
33
+ <ReactMarkdown
34
+ skipHtml
35
+ disallowedElements={['img']}
36
+ urlTransform={safeLinkOrEmpty}
37
+ components={{ a: Link }}>
38
+ {source}
39
+ </ReactMarkdown>
40
+ </div>
41
+ );
@@ -0,0 +1,5 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ export * from './MarqueeMarkdown.js';
5
+ export * from './safeLink.js';
@@ -0,0 +1,25 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ const allowedProtocols = new Set(['https:', 'mailto:', 'tel:']);
5
+
6
+ /**
7
+ * Whether a link may be followed from an announcement: only `https`, `mailto` and `tel`. A relative link, a scheme
8
+ * that runs code such as `javascript:` and a scheme that carries content such as `data:` are not.
9
+ * @param url The link as written in the announcement.
10
+ * @returns True when it is safe to link to.
11
+ */
12
+ export const isSafeLink = (url: string): boolean => {
13
+ try {
14
+ return allowedProtocols.has(new URL(url).protocol);
15
+ } catch {
16
+ return false;
17
+ }
18
+ };
19
+
20
+ /**
21
+ * Empties a link that is not safe, so it never reaches an `href`.
22
+ * @param url The link as written in the announcement.
23
+ * @returns The link, or an empty string.
24
+ */
25
+ export const safeLinkOrEmpty = (url: string): string => isSafeLink(url) ? url : '';
package/Marquee.tsx ADDED
@@ -0,0 +1,56 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { AnnouncementForMe } from '@cratis/showrunner.marquee';
5
+ import { ComponentType, useMemo } from 'react';
6
+ import { MarqueeBanner, MarqueeBannerProps } from './Banner/index.js';
7
+ import { MarqueeDialog, MarqueeDialogProps } from './Dialog/index.js';
8
+ import { MarqueeLabels, resolveLabels } from './Labels/index.js';
9
+ import { MarqueeMarkdown, MarqueeMarkdownProps } from './Markdown/index.js';
10
+ import { useAnnouncements } from './useAnnouncements.js';
11
+
12
+ /**
13
+ * Props for {@link Marquee}.
14
+ */
15
+ export interface MarqueeProps {
16
+ /** Replaces the banners. Gets every banner to show, and draws them all. */
17
+ banner?: ComponentType<MarqueeBannerProps>;
18
+
19
+ /** Replaces the dialog. Gets one dialog at a time, the most important first. */
20
+ dialog?: ComponentType<MarqueeDialogProps>;
21
+
22
+ /** Replaces the Markdown renderer the default banner and dialog use, and that a custom one is given. */
23
+ markdown?: ComponentType<MarqueeMarkdownProps>;
24
+
25
+ /** The texts to replace; the rest stay English. */
26
+ labels?: Partial<MarqueeLabels>;
27
+
28
+ /** How often to apply the windows of the announcements against the clock, in milliseconds. Defaults to 60 seconds. */
29
+ checkInterval?: number;
30
+ }
31
+
32
+ /**
33
+ * Shows the announcements of a product the way its people expect: banners at the top, and dialogs one at a time. Mount
34
+ * it once, first in the application shell and inside Arc's context; it brings its own queries and commands, so it needs
35
+ * nothing but the backend package `Cratis.Showrunner.Marquee`.
36
+ */
37
+ export const Marquee = ({ banner: Banner = MarqueeBanner, dialog: Dialog = MarqueeDialog, markdown = MarqueeMarkdown, labels, checkInterval }: MarqueeProps) => {
38
+ const { banners, dialogs, close } = useAnnouncements({ checkInterval });
39
+ const resolvedLabels = useMemo(() => resolveLabels(labels), [labels]);
40
+ const [dialog, ...rest]: (AnnouncementForMe | undefined)[] = dialogs;
41
+
42
+ return (
43
+ <>
44
+ <Banner announcements={banners} labels={resolvedLabels} markdown={markdown} />
45
+ {dialog && (
46
+ <Dialog
47
+ key={dialog.id.toString()}
48
+ announcement={dialog}
49
+ hasMore={rest.length > 0}
50
+ onClose={() => void close(dialog)}
51
+ labels={resolvedLabels}
52
+ markdown={markdown} />
53
+ )}
54
+ </>
55
+ );
56
+ };
package/README.md CHANGED
@@ -1,3 +1,49 @@
1
- # Temporary Holding Version
1
+ # @cratis/showrunner.marquee.react
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The Marquee drop-in React component, the Showrunner announcements part: `<Marquee />` shows a product's announcements as
4
+ banners at the top and dialogs one at a time. Built on `@cratis/components` and the generated proxies in
5
+ `@cratis/showrunner.marquee`. How to use it: [Documentation/Marquee](../../../Documentation/Marquee/index.md).
6
+
7
+ ## Component hierarchy
8
+
9
+ ```
10
+ Marquee useAnnouncements, then the banner and one dialog
11
+ ├── MarqueeBanner role='status' live region, one row for each banner
12
+ │ └── MarqueeMarkdown compact
13
+ └── MarqueeDialog Cratis Components Dialog, one announcement at a time
14
+ └── MarqueeMarkdown
15
+ ```
16
+
17
+ `banner`, `dialog` and `markdown` are slots: a product replaces any of them. `useAnnouncements` gives a product the
18
+ announcements to draw a surface of its own.
19
+
20
+ ## Architecture decisions
21
+
22
+ - **Decisions live in pure, specified modules; the components render and wire events.**
23
+
24
+ | Module | Decides |
25
+ | --- | --- |
26
+ | `Selection/announcementSelection.ts` | which announcements are inside their window, which dialogs are still due, in which order |
27
+ | `Selection/importancePresentation.ts` | the modifier and the icon name of an importance |
28
+ | `Markdown/safeLink.ts` | which links may be followed |
29
+ | `Labels/` | English defaults and overrides |
30
+
31
+ - **The backend does not apply the window.** The query returns announcements scheduled for later, and
32
+ `useAnnouncements` compares each window with the clock every 60 seconds. The start is inclusive, the end exclusive.
33
+ - **A dialog closed is remembered in state, not in storage.** A dialog is closed for the session in the hook, so it is
34
+ not offered again if the observable query sends its list again. `DialogOnce` is also acknowledged through the
35
+ command, which is what keeps it from coming back on any device. A failed acknowledgement does not keep the dialog
36
+ open; it returns in the next session.
37
+ - **Markdown is rendered as elements, never as HTML.** `react-markdown` with `skipHtml`, images disallowed, and every
38
+ link passed through `isSafeLink` (`https`, `mailto`, `tel`). A link opens in a new tab with `noopener noreferrer`.
39
+ - **The banner region is always rendered**, because a live region that is added with its content is not reliably
40
+ announced. It takes no space while it is empty.
41
+ - **Dialog focus lands on the title** (`DialogInitialFocus.Content`), so a key held when the dialog opened does not
42
+ acknowledge it unread.
43
+ - **No MVVM.** The component keeps no state of its own beyond the clock and the closed ids, in one hook.
44
+
45
+ ## Examples and stories
46
+
47
+ `Examples/` holds the code shown in the documentation. It is compiled with the package, and a specification fails when a
48
+ documentation page no longer contains an example exactly as it builds. `yarn storybook` runs the stories of the banner
49
+ and the dialog, one for each importance and display.
@@ -0,0 +1,51 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { AnnouncementForMe, Display } from '@cratis/showrunner.marquee';
5
+
6
+ /**
7
+ * What of the announcements a person is to see is on screen right now.
8
+ */
9
+ export interface AnnouncementSelection {
10
+ /** The banners to show, the most important first. */
11
+ banners: AnnouncementForMe[];
12
+
13
+ /** The dialogs to show one at a time, the most important first. Only the first is open. */
14
+ dialogs: AnnouncementForMe[];
15
+ }
16
+
17
+ /**
18
+ * Whether an announcement is inside its window at a moment. The window starts at `activeFrom` and ends just before
19
+ * `activeUntil`, so an announcement that ends at 18:00 is gone at 18:00.
20
+ * @param announcement The announcement.
21
+ * @param now The moment.
22
+ * @returns True when it is to be shown.
23
+ */
24
+ export const isActiveAt = (announcement: AnnouncementForMe, now: Date): boolean =>
25
+ announcement.activeFrom.getTime() <= now.getTime() && now.getTime() < announcement.activeUntil.getTime();
26
+
27
+ const byImportanceThenWindow = (first: AnnouncementForMe, second: AnnouncementForMe): number =>
28
+ (second.importance - first.importance)
29
+ || (first.activeFrom.getTime() - second.activeFrom.getTime())
30
+ || first.id.toString().localeCompare(second.id.toString());
31
+
32
+ /**
33
+ * Decides what is on screen from the announcements the backend returned, the clock and what the person closed.
34
+ *
35
+ * A banner is shown for as long as its window lasts: it can not be closed. A dialog is shown until it is closed, the
36
+ * most important first, and a dialog closed in this session is not offered again in it.
37
+ * @param announcements The announcements the backend returned, with their windows, which the backend does not apply.
38
+ * @param now The moment to apply the windows at.
39
+ * @param closedIds The ids of the dialogs closed in this session.
40
+ * @returns What to show.
41
+ */
42
+ export const selectAnnouncements = (announcements: AnnouncementForMe[], now: Date, closedIds: ReadonlySet<string>): AnnouncementSelection => {
43
+ const active = announcements.filter(announcement => isActiveAt(announcement, now));
44
+
45
+ return {
46
+ banners: active.filter(announcement => announcement.display === Display.banner).sort(byImportanceThenWindow),
47
+ dialogs: active
48
+ .filter(announcement => announcement.display !== Display.banner && !closedIds.has(announcement.id.toString()))
49
+ .sort(byImportanceThenWindow)
50
+ };
51
+ };
@@ -0,0 +1,33 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { Importance } from '@cratis/showrunner.marquee';
5
+ import { MarqueeLabels } from '../Labels/index.js';
6
+
7
+ /**
8
+ * How an importance looks: a modifier the stylesheet colors, and the label of its icon.
9
+ */
10
+ export interface ImportancePresentation {
11
+ /** The modifier of the class names, `marquee-banner__item--<modifier>` and `marquee-dialog__importance--<modifier>`. */
12
+ modifier: 'information' | 'warning' | 'critical';
13
+
14
+ /** The accessible name of the icon. */
15
+ label: string;
16
+ }
17
+
18
+ /**
19
+ * Chooses how an importance is presented, so the banner and the dialog agree on the color and the icon of a level.
20
+ * @param importance The importance.
21
+ * @param labels The texts to name the icon with.
22
+ * @returns How to present it.
23
+ */
24
+ export const importancePresentation = (importance: Importance, labels: MarqueeLabels): ImportancePresentation => {
25
+ switch (importance) {
26
+ case Importance.warning:
27
+ return { modifier: 'warning', label: labels.warning };
28
+ case Importance.critical:
29
+ return { modifier: 'critical', label: labels.critical };
30
+ default:
31
+ return { modifier: 'information', label: labels.information };
32
+ }
33
+ };
@@ -0,0 +1,5 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ export * from './announcementSelection.js';
5
+ export * from './importancePresentation.js';
@@ -0,0 +1,11 @@
1
+ import { AnnouncementForMe } from '@cratis/showrunner.marquee';
2
+ import { ComponentType } from 'react';
3
+ import { MarqueeLabels } from '../Labels/index.js';
4
+ import { MarqueeMarkdownProps } from '../Markdown/index.js';
5
+ export interface MarqueeBannerProps {
6
+ announcements: AnnouncementForMe[];
7
+ labels: MarqueeLabels;
8
+ markdown?: ComponentType<MarqueeMarkdownProps>;
9
+ }
10
+ export declare const MarqueeBanner: ({ announcements, labels, markdown: Markdown }: MarqueeBannerProps) => import("react").JSX.Element;
11
+ //# sourceMappingURL=MarqueeBanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarqueeBanner.d.ts","sourceRoot":"","sources":["../../../Banner/MarqueeBanner.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAmB,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAM7E,MAAM,WAAW,kBAAkB;IAE/B,aAAa,EAAE,iBAAiB,EAAE,CAAC;IAGnC,MAAM,EAAE,aAAa,CAAC;IAGtB,QAAQ,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CAClD;AASD,eAAO,MAAM,aAAa,GAAI,+CAAiE,kBAAkB,gCAiBhH,CAAC"}
@@ -0,0 +1,52 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var Icons = require('../Icons.js');
5
+ var MarqueeMarkdown = require('../Markdown/MarqueeMarkdown.js');
6
+ require('@cratis/showrunner.marquee');
7
+ var importancePresentation = require('../Selection/importancePresentation.js');
8
+
9
+ // Copyright (c) Cratis. All rights reserved.
10
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
11
+ /**
12
+ * The banners at the top of the application, one row for each, with the icon and the color of its importance.
13
+ *
14
+ * The region is announced politely when a row appears, and is always rendered, because a live region that is added
15
+ * with its content is not reliably announced. It takes no space while it is empty. A banner has no close button: it
16
+ * stays until it is withdrawn or its window ends.
17
+ */ const MarqueeBanner = ({ announcements, labels, markdown: Markdown = MarqueeMarkdown.MarqueeMarkdown })=>/*#__PURE__*/ jsxRuntime.jsx("div", {
18
+ className: "marquee-banner",
19
+ role: "status",
20
+ "aria-live": "polite",
21
+ "aria-label": labels.banners,
22
+ children: announcements.map((announcement)=>{
23
+ const presentation = importancePresentation.importancePresentation(announcement.importance, labels);
24
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
25
+ className: `marquee-banner__item marquee-banner__item--${presentation.modifier}`,
26
+ children: [
27
+ /*#__PURE__*/ jsxRuntime.jsx(Icons.ImportanceIcon, {
28
+ presentation: presentation
29
+ }),
30
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
31
+ className: "marquee-banner__text",
32
+ children: [
33
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
34
+ className: "marquee-banner__title",
35
+ children: announcement.title
36
+ }),
37
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
38
+ className: "marquee-banner__body",
39
+ children: /*#__PURE__*/ jsxRuntime.jsx(Markdown, {
40
+ source: announcement.body,
41
+ compact: true
42
+ })
43
+ })
44
+ ]
45
+ })
46
+ ]
47
+ }, announcement.id.toString());
48
+ })
49
+ });
50
+
51
+ exports.MarqueeBanner = MarqueeBanner;
52
+ //# sourceMappingURL=MarqueeBanner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarqueeBanner.js","sources":["../../../Banner/MarqueeBanner.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { AnnouncementForMe } from '@cratis/showrunner.marquee';\nimport { ComponentType } from 'react';\nimport { ImportanceIcon } from '../Icons.js';\nimport { MarqueeLabels } from '../Labels/index.js';\nimport { MarqueeMarkdown, MarqueeMarkdownProps } from '../Markdown/index.js';\nimport { importancePresentation } from '../Selection/index.js';\n\n/**\n * Props for {@link MarqueeBanner}, and for the component given to the `banner` slot of {@link Marquee}.\n */\nexport interface MarqueeBannerProps {\n /** The banners to show, the most important first. Empty when there is none. */\n announcements: AnnouncementForMe[];\n\n /** The texts to show. */\n labels: MarqueeLabels;\n\n /** Renders the Markdown of a body; the `markdown` slot of {@link Marquee}. */\n markdown?: ComponentType<MarqueeMarkdownProps>;\n}\n\n/**\n * The banners at the top of the application, one row for each, with the icon and the color of its importance.\n *\n * The region is announced politely when a row appears, and is always rendered, because a live region that is added\n * with its content is not reliably announced. It takes no space while it is empty. A banner has no close button: it\n * stays until it is withdrawn or its window ends.\n */\nexport const MarqueeBanner = ({ announcements, labels, markdown: Markdown = MarqueeMarkdown }: MarqueeBannerProps) => (\n <div className='marquee-banner' role='status' aria-live='polite' aria-label={labels.banners}>\n {announcements.map(announcement => {\n const presentation = importancePresentation(announcement.importance, labels);\n return (\n <div key={announcement.id.toString()} className={`marquee-banner__item marquee-banner__item--${presentation.modifier}`}>\n <ImportanceIcon presentation={presentation} />\n <div className='marquee-banner__text'>\n <span className='marquee-banner__title'>{announcement.title}</span>\n <div className='marquee-banner__body'>\n <Markdown source={announcement.body} compact />\n </div>\n </div>\n </div>\n );\n })}\n </div>\n);\n"],"names":["MarqueeBanner","announcements","labels","markdown","Markdown","MarqueeMarkdown","_jsx","div","className","role","aria-live","aria-label","banners","map","announcement","presentation","importancePresentation","importance","_jsxs","modifier","ImportanceIcon","span","title","source","body","compact","id","toString"],"mappings":";;;;;;;;AAAA;AACA;AAuBA;;;;;;AAMC,IACM,MAAMA,aAAAA,GAAgB,CAAC,EAAEC,aAAa,EAAEC,MAAM,EAAEC,QAAAA,EAAUC,QAAAA,GAAWC,+BAAe,EAAsB,iBAC7GC,cAAA,CAACC,KAAAA,EAAAA;QAAIC,SAAAA,EAAU,gBAAA;QAAiBC,IAAAA,EAAK,QAAA;QAASC,WAAAA,EAAU,QAAA;AAASC,QAAAA,YAAAA,EAAYT,OAAOU,OAAO;kBACtFX,aAAAA,CAAcY,GAAG,CAACC,CAAAA,YAAAA,GAAAA;AACf,YAAA,MAAMC,YAAAA,GAAeC,6CAAAA,CAAuBF,YAAAA,CAAaG,UAAU,EAAEf,MAAAA,CAAAA;AACrE,YAAA,qBACIgB,eAAA,CAACX,KAAAA,EAAAA;AAAqCC,gBAAAA,SAAAA,EAAW,CAAC,2CAA2C,EAAEO,YAAAA,CAAaI,QAAQ,CAAA,CAAE;;kCAClHb,cAAA,CAACc,oBAAAA,EAAAA;wBAAeL,YAAAA,EAAcA;;kCAC9BG,eAAA,CAACX,KAAAA,EAAAA;wBAAIC,SAAAA,EAAU,sBAAA;;0CACXF,cAAA,CAACe,MAAAA,EAAAA;gCAAKb,SAAAA,EAAU,uBAAA;AAAyBM,gCAAAA,QAAAA,EAAAA,YAAAA,CAAaQ;;0CACtDhB,cAAA,CAACC,KAAAA,EAAAA;gCAAIC,SAAAA,EAAU,sBAAA;AACX,gCAAA,QAAA,gBAAAF,cAAA,CAACF,QAAAA,EAAAA;AAASmB,oCAAAA,MAAAA,EAAQT,aAAaU,IAAI;oCAAEC,OAAO,EAAA;;;;;;eAL9CX,YAAAA,CAAaY,EAAE,CAACC,QAAQ,EAAA,CAAA;AAU1C,QAAA,CAAA;AAEN,KAAA;;"}
@@ -0,0 +1,11 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { MarqueeBanner } from './MarqueeBanner.js';
3
+ declare const meta: Meta<typeof MarqueeBanner>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MarqueeBanner>;
6
+ export declare const Information: Story;
7
+ export declare const Warning: Story;
8
+ export declare const Critical: Story;
9
+ export declare const Several: Story;
10
+ export declare const None: Story;
11
+ //# sourceMappingURL=MarqueeBanner.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarqueeBanner.stories.d.ts","sourceRoot":"","sources":["../../../Banner/MarqueeBanner.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,aAAa,CAIpC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,aAAa,CAAC,CAAC;AAE5C,eAAO,MAAM,WAAW,EAAE,KAAkE,CAAC;AAC7F,eAAO,MAAM,OAAO,EAAE,KAAkE,CAAC;AACzF,eAAO,MAAM,QAAQ,EAAE,KAAkE,CAAC;AAC1F,eAAO,MAAM,OAAO,EAAE,KAA4E,CAAC;AACnG,eAAO,MAAM,IAAI,EAAE,KAAuC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './MarqueeBanner.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Banner/index.ts"],"names":[],"mappings":"AAGA,cAAc,oBAAoB,CAAC"}