@cerberus-design/react 0.7.4-next-92f76bb → 0.7.4-next-9a605c3

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 (89) hide show
  1. package/build/legacy/_tsup-dts-rollup.d.ts +144 -5
  2. package/build/legacy/{chunk-7BB66W4A.js → chunk-4EMJR2AY.js} +2 -2
  3. package/build/legacy/{chunk-OLQQB53X.js → chunk-BEYPMC73.js} +2 -2
  4. package/build/legacy/{chunk-3RZUW5KH.js → chunk-DB2OA5PU.js} +3 -3
  5. package/build/legacy/{chunk-GIHAFJYX.js → chunk-GVNPFXKL.js} +9 -2
  6. package/build/legacy/chunk-GVNPFXKL.js.map +1 -0
  7. package/build/legacy/{chunk-ANXV7JDK.js → chunk-IL5ELPTT.js} +2 -2
  8. package/build/legacy/chunk-NWMNEJGU.js +16 -0
  9. package/build/legacy/chunk-NWMNEJGU.js.map +1 -0
  10. package/build/legacy/chunk-SINTHADQ.js +22 -0
  11. package/build/legacy/chunk-SINTHADQ.js.map +1 -0
  12. package/build/legacy/chunk-SPGBCV6A.js +70 -0
  13. package/build/legacy/chunk-SPGBCV6A.js.map +1 -0
  14. package/build/legacy/chunk-TAJBSUS7.js +99 -0
  15. package/build/legacy/chunk-TAJBSUS7.js.map +1 -0
  16. package/build/legacy/{chunk-DCI4IKCI.js → chunk-X5JR5LSC.js} +2 -2
  17. package/build/legacy/{chunk-DED42MIR.js → chunk-XB4ZRAH4.js} +2 -2
  18. package/build/legacy/components/FileUploader.js +3 -3
  19. package/build/legacy/components/Input.js +3 -3
  20. package/build/legacy/components/Notification.js +12 -0
  21. package/build/legacy/components/Notification.js.map +1 -0
  22. package/build/legacy/components/NotificationDescription.js +7 -0
  23. package/build/legacy/components/NotificationDescription.js.map +1 -0
  24. package/build/legacy/components/NotificationHeading.js +7 -0
  25. package/build/legacy/components/NotificationHeading.js.map +1 -0
  26. package/build/legacy/components/Toggle.js +3 -3
  27. package/build/legacy/config/cerbIcons.js +1 -1
  28. package/build/legacy/config/defineIcons.js +2 -2
  29. package/build/legacy/context/confirm-modal.js +3 -3
  30. package/build/legacy/context/notification-center.js +19 -0
  31. package/build/legacy/context/notification-center.js.map +1 -0
  32. package/build/legacy/context/prompt-modal.js +4 -4
  33. package/build/legacy/index.js +37 -19
  34. package/build/legacy/index.js.map +1 -1
  35. package/build/modern/_tsup-dts-rollup.d.ts +144 -5
  36. package/build/modern/chunk-32E6OUMD.js +99 -0
  37. package/build/modern/chunk-32E6OUMD.js.map +1 -0
  38. package/build/modern/{chunk-2NSXMFKX.js → chunk-3YORUZIQ.js} +2 -2
  39. package/build/modern/{chunk-OLQQB53X.js → chunk-BEYPMC73.js} +2 -2
  40. package/build/modern/{chunk-DKHQ5GBY.js → chunk-BMQ7I2PL.js} +3 -3
  41. package/build/modern/{chunk-GIHAFJYX.js → chunk-GVNPFXKL.js} +9 -2
  42. package/build/modern/chunk-GVNPFXKL.js.map +1 -0
  43. package/build/modern/{chunk-ANXV7JDK.js → chunk-IL5ELPTT.js} +2 -2
  44. package/build/modern/chunk-NWMNEJGU.js +16 -0
  45. package/build/modern/chunk-NWMNEJGU.js.map +1 -0
  46. package/build/modern/chunk-OCBED5GL.js +70 -0
  47. package/build/modern/chunk-OCBED5GL.js.map +1 -0
  48. package/build/modern/chunk-SINTHADQ.js +22 -0
  49. package/build/modern/chunk-SINTHADQ.js.map +1 -0
  50. package/build/modern/{chunk-DED42MIR.js → chunk-XB4ZRAH4.js} +2 -2
  51. package/build/modern/{chunk-SHNZS357.js → chunk-ZPWSMCZ5.js} +2 -2
  52. package/build/modern/components/FileUploader.js +3 -3
  53. package/build/modern/components/Input.js +3 -3
  54. package/build/modern/components/Notification.js +12 -0
  55. package/build/modern/components/Notification.js.map +1 -0
  56. package/build/modern/components/NotificationDescription.js +7 -0
  57. package/build/modern/components/NotificationDescription.js.map +1 -0
  58. package/build/modern/components/NotificationHeading.js +7 -0
  59. package/build/modern/components/NotificationHeading.js.map +1 -0
  60. package/build/modern/components/Toggle.js +3 -3
  61. package/build/modern/config/cerbIcons.js +1 -1
  62. package/build/modern/config/defineIcons.js +2 -2
  63. package/build/modern/context/confirm-modal.js +3 -3
  64. package/build/modern/context/notification-center.js +19 -0
  65. package/build/modern/context/notification-center.js.map +1 -0
  66. package/build/modern/context/prompt-modal.js +4 -4
  67. package/build/modern/index.js +37 -19
  68. package/build/modern/index.js.map +1 -1
  69. package/package.json +3 -3
  70. package/src/components/Notification.tsx +94 -0
  71. package/src/components/NotificationDescription.tsx +31 -0
  72. package/src/components/NotificationHeading.tsx +28 -0
  73. package/src/config/cerbIcons.ts +19 -6
  74. package/src/context/notification-center.tsx +159 -0
  75. package/src/index.ts +4 -0
  76. package/build/legacy/chunk-GIHAFJYX.js.map +0 -1
  77. package/build/modern/chunk-GIHAFJYX.js.map +0 -1
  78. /package/build/legacy/{chunk-7BB66W4A.js.map → chunk-4EMJR2AY.js.map} +0 -0
  79. /package/build/legacy/{chunk-OLQQB53X.js.map → chunk-BEYPMC73.js.map} +0 -0
  80. /package/build/legacy/{chunk-3RZUW5KH.js.map → chunk-DB2OA5PU.js.map} +0 -0
  81. /package/build/legacy/{chunk-ANXV7JDK.js.map → chunk-IL5ELPTT.js.map} +0 -0
  82. /package/build/legacy/{chunk-DCI4IKCI.js.map → chunk-X5JR5LSC.js.map} +0 -0
  83. /package/build/legacy/{chunk-DED42MIR.js.map → chunk-XB4ZRAH4.js.map} +0 -0
  84. /package/build/modern/{chunk-2NSXMFKX.js.map → chunk-3YORUZIQ.js.map} +0 -0
  85. /package/build/modern/{chunk-OLQQB53X.js.map → chunk-BEYPMC73.js.map} +0 -0
  86. /package/build/modern/{chunk-DKHQ5GBY.js.map → chunk-BMQ7I2PL.js.map} +0 -0
  87. /package/build/modern/{chunk-ANXV7JDK.js.map → chunk-IL5ELPTT.js.map} +0 -0
  88. /package/build/modern/{chunk-DED42MIR.js.map → chunk-XB4ZRAH4.js.map} +0 -0
  89. /package/build/modern/{chunk-SHNZS357.js.map → chunk-ZPWSMCZ5.js.map} +0 -0
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  Toggle
4
- } from "../chunk-ANXV7JDK.js";
4
+ } from "../chunk-IL5ELPTT.js";
5
5
  import "../chunk-ZAU4JVLL.js";
6
- import "../chunk-OLQQB53X.js";
7
- import "../chunk-GIHAFJYX.js";
6
+ import "../chunk-BEYPMC73.js";
7
+ import "../chunk-GVNPFXKL.js";
8
8
  export {
9
9
  Toggle
10
10
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  defaultIcons
3
- } from "../chunk-GIHAFJYX.js";
3
+ } from "../chunk-GVNPFXKL.js";
4
4
  export {
5
5
  defaultIcons
6
6
  };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  $cerberusIcons,
3
3
  defineIcons
4
- } from "../chunk-OLQQB53X.js";
5
- import "../chunk-GIHAFJYX.js";
4
+ } from "../chunk-BEYPMC73.js";
5
+ import "../chunk-GVNPFXKL.js";
6
6
  export {
7
7
  $cerberusIcons,
8
8
  defineIcons
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  ConfirmModal,
4
4
  useConfirmModal
5
- } from "../chunk-7BB66W4A.js";
5
+ } from "../chunk-4EMJR2AY.js";
6
6
  import "../chunk-4CAT3FHV.js";
7
7
  import "../chunk-2UFNQM55.js";
8
8
  import "../chunk-4M4LCQ43.js";
@@ -12,8 +12,8 @@ import "../chunk-JJP2TFTU.js";
12
12
  import "../chunk-2ATICEW3.js";
13
13
  import "../chunk-4O4QFF4S.js";
14
14
  import "../chunk-KESKDLX6.js";
15
- import "../chunk-OLQQB53X.js";
16
- import "../chunk-GIHAFJYX.js";
15
+ import "../chunk-BEYPMC73.js";
16
+ import "../chunk-GVNPFXKL.js";
17
17
  import "../chunk-TZNYJ3G7.js";
18
18
  export {
19
19
  ConfirmModal,
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import {
3
+ NotificationCenter,
4
+ useNotificationCenter
5
+ } from "../chunk-TAJBSUS7.js";
6
+ import "../chunk-SPGBCV6A.js";
7
+ import "../chunk-SINTHADQ.js";
8
+ import "../chunk-NWMNEJGU.js";
9
+ import "../chunk-4CAT3FHV.js";
10
+ import "../chunk-4O4QFF4S.js";
11
+ import "../chunk-SLHX5K6I.js";
12
+ import "../chunk-KESKDLX6.js";
13
+ import "../chunk-BEYPMC73.js";
14
+ import "../chunk-GVNPFXKL.js";
15
+ export {
16
+ NotificationCenter,
17
+ useNotificationCenter
18
+ };
19
+ //# sourceMappingURL=notification-center.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  PromptModal,
4
4
  usePromptModal
5
- } from "../chunk-3RZUW5KH.js";
5
+ } from "../chunk-DB2OA5PU.js";
6
6
  import "../chunk-4CAT3FHV.js";
7
- import "../chunk-DED42MIR.js";
7
+ import "../chunk-XB4ZRAH4.js";
8
8
  import "../chunk-JJGZRBIR.js";
9
9
  import "../chunk-2UFNQM55.js";
10
10
  import "../chunk-4M4LCQ43.js";
@@ -15,8 +15,8 @@ import "../chunk-2ATICEW3.js";
15
15
  import "../chunk-ZAU4JVLL.js";
16
16
  import "../chunk-4O4QFF4S.js";
17
17
  import "../chunk-KESKDLX6.js";
18
- import "../chunk-OLQQB53X.js";
19
- import "../chunk-GIHAFJYX.js";
18
+ import "../chunk-BEYPMC73.js";
19
+ import "../chunk-GVNPFXKL.js";
20
20
  import "../chunk-TZNYJ3G7.js";
21
21
  export {
22
22
  PromptModal,
@@ -1,3 +1,20 @@
1
+ import {
2
+ NotificationCenter,
3
+ useNotificationCenter
4
+ } from "./chunk-TAJBSUS7.js";
5
+ import {
6
+ PromptModal,
7
+ usePromptModal
8
+ } from "./chunk-DB2OA5PU.js";
9
+ import {
10
+ Tab
11
+ } from "./chunk-NE5NHILF.js";
12
+ import {
13
+ TabList
14
+ } from "./chunk-ISPTI4GC.js";
15
+ import {
16
+ TabPanel
17
+ } from "./chunk-U72VPIZA.js";
1
18
  import {
2
19
  Tag
3
20
  } from "./chunk-EVEEQRH6.js";
@@ -6,15 +23,11 @@ import {
6
23
  } from "./chunk-TCO46FK7.js";
7
24
  import {
8
25
  Toggle
9
- } from "./chunk-ANXV7JDK.js";
26
+ } from "./chunk-IL5ELPTT.js";
10
27
  import {
11
28
  ConfirmModal,
12
29
  useConfirmModal
13
- } from "./chunk-7BB66W4A.js";
14
- import {
15
- PromptModal,
16
- usePromptModal
17
- } from "./chunk-3RZUW5KH.js";
30
+ } from "./chunk-4EMJR2AY.js";
18
31
  import {
19
32
  NavMenuList,
20
33
  getPosition
@@ -26,24 +39,24 @@ import {
26
39
  NavMenu,
27
40
  useNavMenuContext
28
41
  } from "./chunk-KJUCHZHV.js";
42
+ import {
43
+ Notification
44
+ } from "./chunk-SPGBCV6A.js";
45
+ import {
46
+ NotificationDescription
47
+ } from "./chunk-SINTHADQ.js";
48
+ import {
49
+ NotificationHeading
50
+ } from "./chunk-NWMNEJGU.js";
29
51
  import {
30
52
  Portal
31
53
  } from "./chunk-4CAT3FHV.js";
32
54
  import {
33
55
  Radio
34
56
  } from "./chunk-PH64POOB.js";
35
- import {
36
- Tab
37
- } from "./chunk-NE5NHILF.js";
38
- import {
39
- TabList
40
- } from "./chunk-ISPTI4GC.js";
41
- import {
42
- TabPanel
43
- } from "./chunk-U72VPIZA.js";
44
57
  import {
45
58
  Input
46
- } from "./chunk-DED42MIR.js";
59
+ } from "./chunk-XB4ZRAH4.js";
47
60
  import {
48
61
  Label
49
62
  } from "./chunk-JJGZRBIR.js";
@@ -97,7 +110,7 @@ import {
97
110
  } from "./chunk-ZAU4JVLL.js";
98
111
  import {
99
112
  FileUploader
100
- } from "./chunk-DCI4IKCI.js";
113
+ } from "./chunk-X5JR5LSC.js";
101
114
  import {
102
115
  Show
103
116
  } from "./chunk-4O4QFF4S.js";
@@ -122,8 +135,8 @@ import {
122
135
  import {
123
136
  $cerberusIcons,
124
137
  defineIcons
125
- } from "./chunk-OLQQB53X.js";
126
- import "./chunk-GIHAFJYX.js";
138
+ } from "./chunk-BEYPMC73.js";
139
+ import "./chunk-GVNPFXKL.js";
127
140
  import {
128
141
  useModal
129
142
  } from "./chunk-TZNYJ3G7.js";
@@ -153,6 +166,10 @@ export {
153
166
  NavMenuLink,
154
167
  NavMenuList,
155
168
  NavMenuTrigger,
169
+ Notification,
170
+ NotificationCenter,
171
+ NotificationDescription,
172
+ NotificationHeading,
156
173
  Portal,
157
174
  PromptModal,
158
175
  Radio,
@@ -176,6 +193,7 @@ export {
176
193
  useFieldContext,
177
194
  useModal,
178
195
  useNavMenuContext,
196
+ useNotificationCenter,
179
197
  usePromptModal,
180
198
  useTabsContext,
181
199
  useTabsKeyboardNavigation,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * This module is the entry point for the Cerberus React package.\n * @module\n */\n\n// components\n\nexport * from './components/Button'\nexport * from './components/Droppable'\nexport * from './components/FieldMessage'\nexport * from './components/FeatureFlag'\nexport * from './components/FileUploader'\nexport * from './components/IconButton'\nexport * from './components/Input'\nexport * from './components/Label'\nexport * from './components/Modal'\nexport * from './components/ModalHeader'\nexport * from './components/ModalHeading'\nexport * from './components/ModalDescription'\nexport * from './components/ModalIcon'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Portal'\nexport * from './components/Radio'\nexport * from './components/Tab'\nexport * from './components/TabList'\nexport * from './components/TabPanel'\nexport * from './components/Tag'\nexport * from './components/Textarea'\nexport * from './components/Toggle'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/confirm-modal'\nexport * from './context/feature-flags'\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/prompt-modal'\nexport * from './context/tabs'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useModal'\nexport * from './hooks/useTheme'\nexport * from './hooks/useToggle'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\nexport * from './aria-helpers/tabs.aria'\nexport * from './aria-helpers/trap-focus.aria'\n\n// utils\n\nexport * from './config/defineIcons'\n\n// shared types\n\nexport * from './types'\n\n// 3rd party\n\nexport * from '@dnd-kit/core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * This module is the entry point for the Cerberus React package.\n * @module\n */\n\n// components\n\nexport * from './components/Button'\nexport * from './components/Droppable'\nexport * from './components/FieldMessage'\nexport * from './components/FeatureFlag'\nexport * from './components/FileUploader'\nexport * from './components/IconButton'\nexport * from './components/Input'\nexport * from './components/Label'\nexport * from './components/Modal'\nexport * from './components/ModalHeader'\nexport * from './components/ModalHeading'\nexport * from './components/ModalDescription'\nexport * from './components/ModalIcon'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Notification'\nexport * from './components/NotificationHeading'\nexport * from './components/NotificationDescription'\nexport * from './components/Portal'\nexport * from './components/Radio'\nexport * from './components/Tab'\nexport * from './components/TabList'\nexport * from './components/TabPanel'\nexport * from './components/Tag'\nexport * from './components/Textarea'\nexport * from './components/Toggle'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/confirm-modal'\nexport * from './context/feature-flags'\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/notification-center'\nexport * from './context/prompt-modal'\nexport * from './context/tabs'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useModal'\nexport * from './hooks/useTheme'\nexport * from './hooks/useToggle'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\nexport * from './aria-helpers/tabs.aria'\nexport * from './aria-helpers/trap-focus.aria'\n\n// utils\n\nexport * from './config/defineIcons'\n\n// shared types\n\nexport * from './types'\n\n// 3rd party\n\nexport * from '@dnd-kit/core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,cAAc;","names":[]}
@@ -25,6 +25,7 @@ import { defaultCoordinates } from '@dnd-kit/core';
25
25
  import { defaultDropAnimation } from '@dnd-kit/core';
26
26
  import { defaultDropAnimationSideEffects } from '@dnd-kit/core';
27
27
  import { defaultScreenReaderInstructions } from '@dnd-kit/core';
28
+ import { DialogHTMLAttributes } from 'react';
28
29
  import { DistanceMeasurement } from '@dnd-kit/core';
29
30
  import { DndContext } from '@dnd-kit/core';
30
31
  import { DndContextDescriptor } from '@dnd-kit/core';
@@ -76,9 +77,11 @@ import { MeasuringStrategy } from '@dnd-kit/core';
76
77
  import { ModalIconVariantProps } from '@cerberus/styled-system/recipes';
77
78
  import { Modifier } from '@dnd-kit/core';
78
79
  import { Modifiers } from '@dnd-kit/core';
80
+ import { MouseEvent as MouseEvent_2 } from 'react';
79
81
  import { MouseSensor } from '@dnd-kit/core';
80
82
  import { MouseSensorOptions } from '@dnd-kit/core';
81
83
  import { MutableRefObject } from 'react';
84
+ import { NotificationVariantProps } from '@cerberus-design/styled-system/recipes';
82
85
  import { Over } from '@dnd-kit/core';
83
86
  import { PointerActivationConstraint } from '@dnd-kit/core';
84
87
  import { PointerEventHandlers } from '@dnd-kit/core';
@@ -143,6 +146,16 @@ export { AutoScrollActivator }
143
146
 
144
147
  export { AutoScrollOptions }
145
148
 
149
+ declare interface BaseNotificationDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {
150
+ }
151
+ export { BaseNotificationDescriptionProps }
152
+ export { BaseNotificationDescriptionProps as BaseNotificationDescriptionProps_alias_1 }
153
+
154
+ declare interface BaseNotificationHeadingProps extends HTMLAttributes<HTMLParagraphElement> {
155
+ }
156
+ export { BaseNotificationHeadingProps }
157
+ export { BaseNotificationHeadingProps as BaseNotificationHeadingProps_alias_1 }
158
+
146
159
  /**
147
160
  * A component that allows the user to perform actions
148
161
  * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx
@@ -255,11 +268,15 @@ export { DefaultThemes }
255
268
  export { DefaultThemes as DefaultThemes_alias_1 }
256
269
 
257
270
  export declare interface DefinedIcons {
258
- confirmModal?: CarbonIconType | ElementType;
259
- fileUploader?: CarbonIconType | ElementType;
260
- promptModal?: CarbonIconType | ElementType;
261
- invalid: CarbonIconType | ElementType;
262
- toggleChecked?: CarbonIconType | ElementType;
271
+ confirmModal?: IconType;
272
+ promptModal?: IconType;
273
+ fileUploader?: IconType;
274
+ infoNotification?: IconType;
275
+ successNotification?: IconType;
276
+ warningNotification?: IconType;
277
+ dangerNotification?: IconType;
278
+ invalid: IconType;
279
+ toggleChecked?: IconType;
263
280
  }
264
281
 
265
282
  declare function defineIcons(icons: DefinedIcons): Required<DefinedIcons>;
@@ -482,6 +499,8 @@ declare type IconButtonRecipeProps = RecipeVariantProps<typeof iconButton>;
482
499
  export { IconButtonRecipeProps }
483
500
  export { IconButtonRecipeProps as IconButtonRecipeProps_alias_1 }
484
501
 
502
+ export declare type IconType = CarbonIconType | ElementType;
503
+
485
504
  declare function Input(props: InputProps): JSX_2.Element;
486
505
  export { Input }
487
506
  export { Input as Input_alias_1 }
@@ -758,6 +777,109 @@ declare type NavTriggerRef = RefObject<HTMLButtonElement>;
758
777
  export { NavTriggerRef }
759
778
  export { NavTriggerRef as NavTriggerRef_alias_1 }
760
779
 
780
+ /**
781
+ * The info notification component.
782
+ * @param props - The component props.
783
+ * @returns The info notification component.
784
+ * @example
785
+ * ```tsx
786
+ * <Notification id="info:1" open>
787
+ * <NotificationHeading>Info Notification</NotificationHeading>
788
+ * <NotificationDescription>
789
+ * This is a description with a <a href="#">link</a> in the message.
790
+ * </NotificationDescription>
791
+ * </Notification>
792
+ * ```
793
+ */
794
+ declare function Notification_2(props: PropsWithChildren<NotificationProps>): JSX_2.Element;
795
+ export { Notification_2 as Notification }
796
+ export { Notification_2 as Notification_alias_1 }
797
+
798
+ declare interface NotificationBaseProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, 'onClose'> {
799
+ id: string;
800
+ onClose?: (e: MouseEvent_2<HTMLButtonElement>) => void;
801
+ }
802
+ export { NotificationBaseProps }
803
+ export { NotificationBaseProps as NotificationBaseProps_alias_1 }
804
+
805
+ /**
806
+ * Provides a notification center to the app.
807
+ * @example
808
+ * ```tsx
809
+ * // Wrap the Provider around the root of the feature.
810
+ * <Notifications>
811
+ * <SomeFeatureSection />
812
+ * </Notifications>
813
+ *
814
+ * // Use the hook to show a notification.
815
+ * const notify = useNotifications()
816
+ *
817
+ * const handleClick = useCallback(() => {
818
+ * notify({
819
+ * palette: 'info',
820
+ * heading: 'New feature!',
821
+ * description: 'We have added a new feature to the app.',
822
+ * })
823
+ * }, [notify])
824
+ * ```
825
+ */
826
+ declare function NotificationCenter(props: PropsWithChildren<NotificationsProviderProps>): JSX_2.Element;
827
+ export { NotificationCenter }
828
+ export { NotificationCenter as NotificationCenter_alias_1 }
829
+
830
+ /**
831
+ * The NotificationDescription component is used to render the description of a notification.
832
+ * @param props - The anything a HTMLParagraphElement can accept.
833
+ */
834
+ declare function NotificationDescription(props: NotificationDescriptionProps): JSX_2.Element;
835
+ export { NotificationDescription }
836
+ export { NotificationDescription as NotificationDescription_alias_1 }
837
+
838
+ declare type NotificationDescriptionProps = BaseNotificationDescriptionProps & NotificationVariantProps;
839
+ export { NotificationDescriptionProps }
840
+ export { NotificationDescriptionProps as NotificationDescriptionProps_alias_1 }
841
+
842
+ /**
843
+ * The NotificationHeading component is used to render the heading of a notification.
844
+ * @param props - The anything a HTMLParagraphElement can accept.
845
+ */
846
+ declare function NotificationHeading(props: NotificationHeadingProps): JSX_2.Element;
847
+ export { NotificationHeading }
848
+ export { NotificationHeading as NotificationHeading_alias_1 }
849
+
850
+ declare type NotificationHeadingProps = BaseNotificationHeadingProps & NotificationVariantProps;
851
+ export { NotificationHeadingProps }
852
+ export { NotificationHeadingProps as NotificationHeadingProps_alias_1 }
853
+
854
+ declare type NotificationProps = NotificationBaseProps & NotificationVariantProps;
855
+ export { NotificationProps }
856
+ export { NotificationProps as NotificationProps_alias_1 }
857
+
858
+ declare interface NotificationsProviderProps extends PortalProps {
859
+ }
860
+ export { NotificationsProviderProps }
861
+ export { NotificationsProviderProps as NotificationsProviderProps_alias_1 }
862
+
863
+ declare interface NotificationsValue {
864
+ notify: (options: NotifyOptions) => void;
865
+ }
866
+ export { NotificationsValue }
867
+ export { NotificationsValue as NotificationsValue_alias_1 }
868
+
869
+ /**
870
+ * This module provides a context and hook for notifications.
871
+ * @module
872
+ */
873
+ declare interface NotifyOptions {
874
+ palette: 'info' | 'success' | 'warning' | 'danger';
875
+ heading: string;
876
+ id?: string;
877
+ description?: ReactNode;
878
+ onClose?: () => void;
879
+ }
880
+ export { NotifyOptions }
881
+ export { NotifyOptions as NotifyOptions_alias_1 }
882
+
761
883
  export { Over }
762
884
 
763
885
  export { PointerActivationConstraint }
@@ -1219,6 +1341,23 @@ declare function useNavMenuContext(): NavMenuContextValue;
1219
1341
  export { useNavMenuContext }
1220
1342
  export { useNavMenuContext as useNavMenuContext_alias_1 }
1221
1343
 
1344
+ /**
1345
+ * The hook to use the NotificationCenter.
1346
+ * @returns The notify method to trigger a notification.
1347
+ * @example
1348
+ * ```tsx
1349
+ * const {notify} = useNotificationCenter()
1350
+ * notify({
1351
+ * palette: 'info',
1352
+ * heading: 'New feature',
1353
+ * description: 'We have added a new feature to the app.',
1354
+ * })
1355
+ * ```
1356
+ */
1357
+ declare function useNotificationCenter(): NotificationsValue;
1358
+ export { useNotificationCenter }
1359
+ export { useNotificationCenter as useNotificationCenter_alias_1 }
1360
+
1222
1361
  declare function usePromptModal(): PromptModalValue;
1223
1362
  export { usePromptModal }
1224
1363
  export { usePromptModal as usePromptModal_alias_1 }
@@ -0,0 +1,99 @@
1
+ import {
2
+ Notification
3
+ } from "./chunk-OCBED5GL.js";
4
+ import {
5
+ NotificationDescription
6
+ } from "./chunk-SINTHADQ.js";
7
+ import {
8
+ NotificationHeading
9
+ } from "./chunk-NWMNEJGU.js";
10
+ import {
11
+ Portal
12
+ } from "./chunk-4CAT3FHV.js";
13
+ import {
14
+ Show
15
+ } from "./chunk-4O4QFF4S.js";
16
+
17
+ // src/context/notification-center.tsx
18
+ import {
19
+ createContext,
20
+ useCallback,
21
+ useContext,
22
+ useMemo,
23
+ useState
24
+ } from "react";
25
+ import { vstack } from "@cerberus-design/styled-system/patterns";
26
+ import { cx } from "@cerberus-design/styled-system/css";
27
+ import { notification } from "@cerberus-design/styled-system/recipes";
28
+ import { jsx, jsxs } from "react/jsx-runtime";
29
+ var NotificationsContext = createContext(null);
30
+ function NotificationCenter(props) {
31
+ const [activeNotifications, setActiveNotifications] = useState([]);
32
+ const handleNotify = useCallback((options) => {
33
+ setActiveNotifications((prev) => {
34
+ const id = `${options.palette}:${prev.length + 1}`;
35
+ return [...prev, { ...options, id }];
36
+ });
37
+ }, []);
38
+ const handleClose = useCallback((e) => {
39
+ const target = e.currentTarget;
40
+ setActiveNotifications((prev) => {
41
+ const item = prev.find((option) => option.id === target.value);
42
+ if (item?.onClose) item.onClose();
43
+ return prev.filter((option) => option.id !== target.value);
44
+ });
45
+ }, []);
46
+ const value = useMemo(
47
+ () => ({
48
+ notify: handleNotify
49
+ }),
50
+ [handleNotify]
51
+ );
52
+ return /* @__PURE__ */ jsxs(NotificationsContext.Provider, { value, children: [
53
+ props.children,
54
+ /* @__PURE__ */ jsx(Show, { when: activeNotifications.length > 0, children: /* @__PURE__ */ jsx(Portal, { container: props.container, children: /* @__PURE__ */ jsx(
55
+ "div",
56
+ {
57
+ className: cx(
58
+ notification().center,
59
+ vstack({
60
+ alignItems: "flex-end",
61
+ gap: "4"
62
+ })
63
+ ),
64
+ style: {
65
+ alignItems: "flex-end"
66
+ },
67
+ children: activeNotifications.map((option) => /* @__PURE__ */ jsxs(
68
+ Notification,
69
+ {
70
+ id: option.id,
71
+ onClose: handleClose,
72
+ open: true,
73
+ palette: option.palette,
74
+ children: [
75
+ /* @__PURE__ */ jsx(NotificationHeading, { palette: option.palette, children: option.heading }),
76
+ /* @__PURE__ */ jsx(NotificationDescription, { palette: option.palette, children: option.description })
77
+ ]
78
+ },
79
+ option.id
80
+ ))
81
+ }
82
+ ) }) })
83
+ ] });
84
+ }
85
+ function useNotificationCenter() {
86
+ const context = useContext(NotificationsContext);
87
+ if (!context) {
88
+ throw new Error(
89
+ "useNotificationCenter must be used within a NotificationsProvider"
90
+ );
91
+ }
92
+ return context;
93
+ }
94
+
95
+ export {
96
+ NotificationCenter,
97
+ useNotificationCenter
98
+ };
99
+ //# sourceMappingURL=chunk-32E6OUMD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/context/notification-center.tsx"],"sourcesContent":["'use client'\n\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n type MouseEvent,\n type PropsWithChildren,\n type ReactNode,\n} from 'react'\nimport { Show } from '../components/Show'\nimport { NotificationHeading } from '../components/NotificationHeading'\nimport { NotificationDescription } from '../components/NotificationDescription'\nimport { Notification } from '../components/Notification'\nimport { vstack } from '@cerberus-design/styled-system/patterns'\nimport { Portal, type PortalProps } from '../components/Portal'\nimport { cx } from '@cerberus-design/styled-system/css'\nimport { notification } from '@cerberus-design/styled-system/recipes'\n\n/**\n * This module provides a context and hook for notifications.\n * @module\n */\n\nexport interface NotifyOptions {\n palette: 'info' | 'success' | 'warning' | 'danger'\n heading: string\n id?: string\n description?: ReactNode\n onClose?: () => void\n}\n\nexport interface NotificationsValue {\n notify: (options: NotifyOptions) => void\n}\n\nconst NotificationsContext = createContext<NotificationsValue | null>(null)\n\nexport interface NotificationsProviderProps extends PortalProps {}\n\n/**\n * Provides a notification center to the app.\n * @example\n * ```tsx\n * // Wrap the Provider around the root of the feature.\n * <Notifications>\n * <SomeFeatureSection />\n * </Notifications>\n *\n * // Use the hook to show a notification.\n * const notify = useNotifications()\n *\n * const handleClick = useCallback(() => {\n * notify({\n * palette: 'info',\n * heading: 'New feature!',\n * description: 'We have added a new feature to the app.',\n * })\n * }, [notify])\n * ```\n */\nexport function NotificationCenter(\n props: PropsWithChildren<NotificationsProviderProps>,\n) {\n const [activeNotifications, setActiveNotifications] = useState<\n NotifyOptions[]\n >([])\n\n const handleNotify = useCallback((options: NotifyOptions) => {\n setActiveNotifications((prev) => {\n const id = `${options.palette}:${prev.length + 1}`\n return [...prev, { ...options, id }]\n })\n }, [])\n\n const handleClose = useCallback((e: MouseEvent<HTMLButtonElement>) => {\n const target = e.currentTarget as HTMLButtonElement\n setActiveNotifications((prev) => {\n const item = prev.find((option) => option.id === target.value)\n if (item?.onClose) item.onClose()\n return prev.filter((option) => option.id !== target.value)\n })\n }, [])\n\n const value = useMemo(\n () => ({\n notify: handleNotify,\n }),\n [handleNotify],\n )\n\n // For some reason, the vstack pattern alignItems is not registering here.\n // So we are forcing it with the style prop.\n\n return (\n <NotificationsContext.Provider value={value}>\n {props.children}\n\n <Show when={activeNotifications.length > 0}>\n <Portal container={props.container}>\n <div\n className={cx(\n notification().center,\n vstack({\n alignItems: 'flex-end',\n gap: '4',\n }),\n )}\n style={{\n alignItems: 'flex-end',\n }}\n >\n {activeNotifications.map((option) => (\n <Notification\n id={option.id!}\n key={option.id}\n onClose={handleClose}\n open\n palette={option.palette}\n >\n <NotificationHeading palette={option.palette}>\n {option.heading}\n </NotificationHeading>\n <NotificationDescription palette={option.palette}>\n {option.description}\n </NotificationDescription>\n </Notification>\n ))}\n </div>\n </Portal>\n </Show>\n </NotificationsContext.Provider>\n )\n}\n\n/**\n * The hook to use the NotificationCenter.\n * @returns The notify method to trigger a notification.\n * @example\n * ```tsx\n * const {notify} = useNotificationCenter()\n * notify({\n * palette: 'info',\n * heading: 'New feature',\n * description: 'We have added a new feature to the app.',\n * })\n * ```\n */\nexport function useNotificationCenter(): NotificationsValue {\n const context = useContext(NotificationsContext)\n if (!context) {\n throw new Error(\n 'useNotificationCenter must be used within a NotificationsProvider',\n )\n }\n return context\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAKP,SAAS,cAAc;AAEvB,SAAS,UAAU;AACnB,SAAS,oBAAoB;AAgGf,SAOE,KAPF;AA7Ed,IAAM,uBAAuB,cAAyC,IAAI;AAyBnE,SAAS,mBACd,OACA;AACA,QAAM,CAAC,qBAAqB,sBAAsB,IAAI,SAEpD,CAAC,CAAC;AAEJ,QAAM,eAAe,YAAY,CAAC,YAA2B;AAC3D,2BAAuB,CAAC,SAAS;AAC/B,YAAM,KAAK,GAAG,QAAQ,OAAO,IAAI,KAAK,SAAS,CAAC;AAChD,aAAO,CAAC,GAAG,MAAM,EAAE,GAAG,SAAS,GAAG,CAAC;AAAA,IACrC,CAAC;AAAA,EACH,GAAG,CAAC,CAAC;AAEL,QAAM,cAAc,YAAY,CAAC,MAAqC;AACpE,UAAM,SAAS,EAAE;AACjB,2BAAuB,CAAC,SAAS;AAC/B,YAAM,OAAO,KAAK,KAAK,CAAC,WAAW,OAAO,OAAO,OAAO,KAAK;AAC7D,UAAI,MAAM,QAAS,MAAK,QAAQ;AAChC,aAAO,KAAK,OAAO,CAAC,WAAW,OAAO,OAAO,OAAO,KAAK;AAAA,IAC3D,CAAC;AAAA,EACH,GAAG,CAAC,CAAC;AAEL,QAAM,QAAQ;AAAA,IACZ,OAAO;AAAA,MACL,QAAQ;AAAA,IACV;AAAA,IACA,CAAC,YAAY;AAAA,EACf;AAKA,SACE,qBAAC,qBAAqB,UAArB,EAA8B,OAC5B;AAAA,UAAM;AAAA,IAEP,oBAAC,QAAK,MAAM,oBAAoB,SAAS,GACvC,8BAAC,UAAO,WAAW,MAAM,WACvB;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT,aAAa,EAAE;AAAA,UACf,OAAO;AAAA,YACL,YAAY;AAAA,YACZ,KAAK;AAAA,UACP,CAAC;AAAA,QACH;AAAA,QACA,OAAO;AAAA,UACL,YAAY;AAAA,QACd;AAAA,QAEC,8BAAoB,IAAI,CAAC,WACxB;AAAA,UAAC;AAAA;AAAA,YACC,IAAI,OAAO;AAAA,YAEX,SAAS;AAAA,YACT,MAAI;AAAA,YACJ,SAAS,OAAO;AAAA,YAEhB;AAAA,kCAAC,uBAAoB,SAAS,OAAO,SAClC,iBAAO,SACV;AAAA,cACA,oBAAC,2BAAwB,SAAS,OAAO,SACtC,iBAAO,aACV;AAAA;AAAA;AAAA,UAVK,OAAO;AAAA,QAWd,CACD;AAAA;AAAA,IACH,GACF,GACF;AAAA,KACF;AAEJ;AAeO,SAAS,wBAA4C;AAC1D,QAAM,UAAU,WAAW,oBAAoB;AAC/C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-4O4QFF4S.js";
4
4
  import {
5
5
  $cerberusIcons
6
- } from "./chunk-OLQQB53X.js";
6
+ } from "./chunk-BEYPMC73.js";
7
7
 
8
8
  // src/components/FileUploader.tsx
9
9
  import { cx } from "@cerberus-design/styled-system/css";
@@ -59,4 +59,4 @@ function FileUploader(props) {
59
59
  export {
60
60
  FileUploader
61
61
  };
62
- //# sourceMappingURL=chunk-2NSXMFKX.js.map
62
+ //# sourceMappingURL=chunk-3YORUZIQ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  defaultIcons
3
- } from "./chunk-GIHAFJYX.js";
3
+ } from "./chunk-GVNPFXKL.js";
4
4
 
5
5
  // src/config/defineIcons.ts
6
6
  function _validateIconsProperties(icons) {
@@ -24,4 +24,4 @@ export {
24
24
  defineIcons,
25
25
  $cerberusIcons
26
26
  };
27
- //# sourceMappingURL=chunk-OLQQB53X.js.map
27
+ //# sourceMappingURL=chunk-BEYPMC73.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-4CAT3FHV.js";
4
4
  import {
5
5
  Input
6
- } from "./chunk-DED42MIR.js";
6
+ } from "./chunk-XB4ZRAH4.js";
7
7
  import {
8
8
  Label
9
9
  } from "./chunk-JJGZRBIR.js";
@@ -36,7 +36,7 @@ import {
36
36
  } from "./chunk-JIZQFTW6.js";
37
37
  import {
38
38
  $cerberusIcons
39
- } from "./chunk-OLQQB53X.js";
39
+ } from "./chunk-BEYPMC73.js";
40
40
  import {
41
41
  useModal
42
42
  } from "./chunk-C5HLLGME.js";
@@ -204,4 +204,4 @@ export {
204
204
  PromptModal,
205
205
  usePromptModal
206
206
  };
207
- //# sourceMappingURL=chunk-DKHQ5GBY.js.map
207
+ //# sourceMappingURL=chunk-BMQ7I2PL.js.map
@@ -1,14 +1,21 @@
1
1
  // src/config/cerbIcons.ts
2
2
  import {
3
3
  Checkmark,
4
+ CheckmarkFilled,
4
5
  CloudUpload,
6
+ ErrorFilled,
5
7
  Information,
8
+ InformationFilled,
6
9
  WarningFilled
7
10
  } from "@cerberus/icons";
8
11
  var defaultIcons = {
9
12
  confirmModal: Information,
10
- fileUploader: CloudUpload,
11
13
  promptModal: Information,
14
+ fileUploader: CloudUpload,
15
+ infoNotification: InformationFilled,
16
+ successNotification: CheckmarkFilled,
17
+ warningNotification: WarningFilled,
18
+ dangerNotification: ErrorFilled,
12
19
  invalid: WarningFilled,
13
20
  toggleChecked: Checkmark
14
21
  };
@@ -16,4 +23,4 @@ var defaultIcons = {
16
23
  export {
17
24
  defaultIcons
18
25
  };
19
- //# sourceMappingURL=chunk-GIHAFJYX.js.map
26
+ //# sourceMappingURL=chunk-GVNPFXKL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/config/cerbIcons.ts"],"sourcesContent":["import {\n Checkmark,\n CheckmarkFilled,\n CloudUpload,\n ErrorFilled,\n Information,\n InformationFilled,\n WarningFilled,\n type CarbonIconType,\n} from '@cerberus/icons'\nimport type { ElementType } from 'react'\n\nexport type IconType = CarbonIconType | ElementType\n\nexport interface DefinedIcons {\n confirmModal?: IconType\n promptModal?: IconType\n fileUploader?: IconType\n infoNotification?: IconType\n successNotification?: IconType\n warningNotification?: IconType\n dangerNotification?: IconType\n invalid: IconType\n toggleChecked?: IconType\n}\n\nexport const defaultIcons: DefinedIcons = {\n confirmModal: Information,\n promptModal: Information,\n fileUploader: CloudUpload,\n infoNotification: InformationFilled,\n successNotification: CheckmarkFilled,\n warningNotification: WarningFilled,\n dangerNotification: ErrorFilled,\n invalid: WarningFilled,\n toggleChecked: Checkmark,\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAiBA,IAAM,eAA6B;AAAA,EACxC,cAAc;AAAA,EACd,aAAa;AAAA,EACb,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,eAAe;AACjB;","names":[]}
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-ZAU4JVLL.js";
4
4
  import {
5
5
  $cerberusIcons
6
- } from "./chunk-OLQQB53X.js";
6
+ } from "./chunk-BEYPMC73.js";
7
7
 
8
8
  // src/components/Toggle.tsx
9
9
  import { cx } from "@cerberus/styled-system/css";
@@ -55,4 +55,4 @@ function Toggle(props) {
55
55
  export {
56
56
  Toggle
57
57
  };
58
- //# sourceMappingURL=chunk-ANXV7JDK.js.map
58
+ //# sourceMappingURL=chunk-IL5ELPTT.js.map
@@ -0,0 +1,16 @@
1
+ // src/components/NotificationHeading.tsx
2
+ import { cx } from "@cerberus-design/styled-system/css";
3
+ import {
4
+ notification
5
+ } from "@cerberus-design/styled-system/recipes";
6
+ import { jsx } from "react/jsx-runtime";
7
+ function NotificationHeading(props) {
8
+ const { palette, ...nativeProps } = props;
9
+ const styles = notification({ palette });
10
+ return /* @__PURE__ */ jsx("p", { className: cx(nativeProps.className, styles.heading), ...nativeProps });
11
+ }
12
+
13
+ export {
14
+ NotificationHeading
15
+ };
16
+ //# sourceMappingURL=chunk-NWMNEJGU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/NotificationHeading.tsx"],"sourcesContent":["/**\n * This module exports the NotificationHeading component.\n * @module\n */\n\nimport { cx } from '@cerberus-design/styled-system/css'\nimport {\n notification,\n type NotificationVariantProps,\n} from '@cerberus-design/styled-system/recipes'\nimport type { HTMLAttributes } from 'react'\n\nexport interface BaseNotificationHeadingProps\n extends HTMLAttributes<HTMLParagraphElement> {}\nexport type NotificationHeadingProps = BaseNotificationHeadingProps &\n NotificationVariantProps\n\n/**\n * The NotificationHeading component is used to render the heading of a notification.\n * @param props - The anything a HTMLParagraphElement can accept.\n */\nexport function NotificationHeading(props: NotificationHeadingProps) {\n const { palette, ...nativeProps } = props\n const styles = notification({ palette })\n return (\n <p className={cx(nativeProps.className, styles.heading)} {...nativeProps} />\n )\n}\n"],"mappings":";AAKA,SAAS,UAAU;AACnB;AAAA,EACE;AAAA,OAEK;AAgBH;AAJG,SAAS,oBAAoB,OAAiC;AACnE,QAAM,EAAE,SAAS,GAAG,YAAY,IAAI;AACpC,QAAM,SAAS,aAAa,EAAE,QAAQ,CAAC;AACvC,SACE,oBAAC,OAAE,WAAW,GAAG,YAAY,WAAW,OAAO,OAAO,GAAI,GAAG,aAAa;AAE9E;","names":[]}