@stack-spot/portal-layout 0.0.65 → 1.0.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 (185) hide show
  1. package/dist/Layout.d.ts +58 -6
  2. package/dist/Layout.d.ts.map +1 -1
  3. package/dist/Layout.js +14 -7
  4. package/dist/Layout.js.map +1 -1
  5. package/dist/LayoutOverlayManager.d.ts +173 -6
  6. package/dist/LayoutOverlayManager.d.ts.map +1 -1
  7. package/dist/LayoutOverlayManager.js +118 -9
  8. package/dist/LayoutOverlayManager.js.map +1 -1
  9. package/dist/components/Dialog.d.ts +48 -5
  10. package/dist/components/Dialog.d.ts.map +1 -1
  11. package/dist/components/Dialog.js +7 -2
  12. package/dist/components/Dialog.js.map +1 -1
  13. package/dist/components/Header.d.ts +29 -1
  14. package/dist/components/Header.d.ts.map +1 -1
  15. package/dist/components/Header.js +6 -2
  16. package/dist/components/Header.js.map +1 -1
  17. package/dist/components/OverlayContent.d.ts +22 -0
  18. package/dist/components/OverlayContent.d.ts.map +1 -1
  19. package/dist/components/OverlayContent.js +4 -0
  20. package/dist/components/OverlayContent.js.map +1 -1
  21. package/dist/components/PortalSwitcher.d.ts +14 -0
  22. package/dist/components/PortalSwitcher.d.ts.map +1 -1
  23. package/dist/components/PortalSwitcher.js +9 -6
  24. package/dist/components/PortalSwitcher.js.map +1 -1
  25. package/dist/components/Toaster.d.ts +4 -0
  26. package/dist/components/Toaster.d.ts.map +1 -1
  27. package/dist/components/Toaster.js +5 -1
  28. package/dist/components/Toaster.js.map +1 -1
  29. package/dist/components/UserMenu.d.ts +14 -1
  30. package/dist/components/UserMenu.d.ts.map +1 -1
  31. package/dist/components/UserMenu.js +5 -1
  32. package/dist/components/UserMenu.js.map +1 -1
  33. package/dist/components/error/ErrorBoundary.d.ts +10 -1
  34. package/dist/components/error/ErrorBoundary.d.ts.map +1 -1
  35. package/dist/components/error/ErrorBoundary.js +10 -1
  36. package/dist/components/error/ErrorBoundary.js.map +1 -1
  37. package/dist/components/error/ErrorManager.d.ts +22 -6
  38. package/dist/components/error/ErrorManager.d.ts.map +1 -1
  39. package/dist/components/error/ErrorManager.js +21 -1
  40. package/dist/components/error/ErrorManager.js.map +1 -1
  41. package/dist/components/error/SilentErrorBoundary.d.ts +11 -2
  42. package/dist/components/error/SilentErrorBoundary.d.ts.map +1 -1
  43. package/dist/components/error/SilentErrorBoundary.js +10 -0
  44. package/dist/components/error/SilentErrorBoundary.js.map +1 -1
  45. package/dist/components/menu/MenuContent.d.ts +19 -2
  46. package/dist/components/menu/MenuContent.d.ts.map +1 -1
  47. package/dist/components/menu/MenuContent.js +33 -35
  48. package/dist/components/menu/MenuContent.js.map +1 -1
  49. package/dist/components/menu/MenuSections.d.ts +10 -0
  50. package/dist/components/menu/MenuSections.d.ts.map +1 -1
  51. package/dist/components/menu/MenuSections.js +70 -16
  52. package/dist/components/menu/MenuSections.js.map +1 -1
  53. package/dist/components/menu/PageSelector.d.ts +5 -0
  54. package/dist/components/menu/PageSelector.d.ts.map +1 -1
  55. package/dist/components/menu/PageSelector.js +8 -3
  56. package/dist/components/menu/PageSelector.js.map +1 -1
  57. package/dist/components/menu/types.d.ts +100 -7
  58. package/dist/components/menu/types.d.ts.map +1 -1
  59. package/dist/components/tour/PortalSwitcherStep.d.ts +6 -1
  60. package/dist/components/tour/PortalSwitcherStep.d.ts.map +1 -1
  61. package/dist/components/tour/PortalSwitcherStep.js +6 -1
  62. package/dist/components/tour/PortalSwitcherStep.js.map +1 -1
  63. package/dist/components/types.d.ts +0 -13
  64. package/dist/components/types.d.ts.map +1 -1
  65. package/dist/dictionary.d.ts +3 -0
  66. package/dist/dictionary.d.ts.map +1 -1
  67. package/dist/dictionary.js +3 -0
  68. package/dist/dictionary.js.map +1 -1
  69. package/dist/elements.d.ts +6 -0
  70. package/dist/elements.d.ts.map +1 -1
  71. package/dist/elements.js +6 -0
  72. package/dist/elements.js.map +1 -1
  73. package/dist/index.d.ts +0 -3
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +0 -3
  76. package/dist/index.js.map +1 -1
  77. package/dist/layout.css +1 -5
  78. package/dist/toaster.d.ts +74 -9
  79. package/dist/toaster.d.ts.map +1 -1
  80. package/dist/toaster.js +32 -6
  81. package/dist/toaster.js.map +1 -1
  82. package/dist/utils.d.ts +6 -69
  83. package/dist/utils.d.ts.map +1 -1
  84. package/dist/utils.js +9 -130
  85. package/dist/utils.js.map +1 -1
  86. package/package.json +16 -15
  87. package/readme.md +146 -0
  88. package/src/Layout.tsx +79 -30
  89. package/src/LayoutOverlayManager.tsx +184 -9
  90. package/src/components/Dialog.tsx +49 -6
  91. package/src/components/Header.tsx +31 -3
  92. package/src/components/OverlayContent.tsx +22 -0
  93. package/src/components/PortalSwitcher.tsx +22 -8
  94. package/src/components/Toaster.tsx +10 -2
  95. package/src/components/UserMenu.tsx +14 -1
  96. package/src/components/error/ErrorBoundary.tsx +11 -2
  97. package/src/components/error/ErrorManager.ts +22 -6
  98. package/src/components/error/SilentErrorBoundary.tsx +12 -2
  99. package/src/components/menu/MenuContent.tsx +33 -52
  100. package/src/components/menu/MenuSections.tsx +99 -49
  101. package/src/components/menu/PageSelector.tsx +8 -3
  102. package/src/components/menu/types.ts +100 -8
  103. package/src/components/tour/PortalSwitcherStep.tsx +7 -4
  104. package/src/components/types.ts +0 -14
  105. package/src/dictionary.ts +3 -0
  106. package/src/elements.ts +6 -0
  107. package/src/index.ts +0 -3
  108. package/src/layout.css +1 -5
  109. package/src/toaster.tsx +125 -14
  110. package/src/utils.ts +9 -142
  111. package/dist/components/BottomNotification.d.ts +0 -1
  112. package/dist/components/BottomNotification.d.ts.map +0 -1
  113. package/dist/components/BottomNotification.js +0 -2
  114. package/dist/components/BottomNotification.js.map +0 -1
  115. package/dist/components/BottomPanel.d.ts +0 -1
  116. package/dist/components/BottomPanel.d.ts.map +0 -1
  117. package/dist/components/BottomPanel.js +0 -2
  118. package/dist/components/BottomPanel.js.map +0 -1
  119. package/dist/components/SelectionList.d.ts +0 -36
  120. package/dist/components/SelectionList.d.ts.map +0 -1
  121. package/dist/components/SelectionList.js +0 -140
  122. package/dist/components/SelectionList.js.map +0 -1
  123. package/dist/components/error/ErrorFeedback.d.ts +0 -3
  124. package/dist/components/error/ErrorFeedback.d.ts.map +0 -1
  125. package/dist/components/error/ErrorFeedback.js +0 -66
  126. package/dist/components/error/ErrorFeedback.js.map +0 -1
  127. package/dist/components/menu/use-check-text-overflow.d.ts +0 -6
  128. package/dist/components/menu/use-check-text-overflow.d.ts.map +0 -1
  129. package/dist/components/menu/use-check-text-overflow.js +0 -20
  130. package/dist/components/menu/use-check-text-overflow.js.map +0 -1
  131. package/dist/components/menu/use-keyboard-controls.d.ts +0 -23
  132. package/dist/components/menu/use-keyboard-controls.d.ts.map +0 -1
  133. package/dist/components/menu/use-keyboard-controls.js +0 -49
  134. package/dist/components/menu/use-keyboard-controls.js.map +0 -1
  135. package/dist/layout-context.d.ts +0 -10
  136. package/dist/layout-context.d.ts.map +0 -1
  137. package/dist/layout-context.js +0 -11
  138. package/dist/layout-context.js.map +0 -1
  139. package/dist/svg/AI.d.ts +0 -6
  140. package/dist/svg/AI.d.ts.map +0 -1
  141. package/dist/svg/AI.js +0 -9
  142. package/dist/svg/AI.js.map +0 -1
  143. package/dist/svg/EDP.d.ts +0 -6
  144. package/dist/svg/EDP.d.ts.map +0 -1
  145. package/dist/svg/EDP.js +0 -5
  146. package/dist/svg/EDP.js.map +0 -1
  147. package/dist/svg/Forbidden.d.ts +0 -6
  148. package/dist/svg/Forbidden.d.ts.map +0 -1
  149. package/dist/svg/Forbidden.js +0 -4
  150. package/dist/svg/Forbidden.js.map +0 -1
  151. package/dist/svg/HUB.d.ts +0 -6
  152. package/dist/svg/HUB.d.ts.map +0 -1
  153. package/dist/svg/HUB.js +0 -5
  154. package/dist/svg/HUB.js.map +0 -1
  155. package/dist/svg/Logo.d.ts +0 -2
  156. package/dist/svg/Logo.d.ts.map +0 -1
  157. package/dist/svg/Logo.js +0 -4
  158. package/dist/svg/Logo.js.map +0 -1
  159. package/dist/svg/NotFound.d.ts +0 -6
  160. package/dist/svg/NotFound.d.ts.map +0 -1
  161. package/dist/svg/NotFound.js +0 -4
  162. package/dist/svg/NotFound.js.map +0 -1
  163. package/dist/svg/ServerError.d.ts +0 -6
  164. package/dist/svg/ServerError.d.ts.map +0 -1
  165. package/dist/svg/ServerError.js +0 -4
  166. package/dist/svg/ServerError.js.map +0 -1
  167. package/dist/svg/Unauthenticated.d.ts +0 -6
  168. package/dist/svg/Unauthenticated.d.ts.map +0 -1
  169. package/dist/svg/Unauthenticated.js +0 -4
  170. package/dist/svg/Unauthenticated.js.map +0 -1
  171. package/src/components/BottomNotification.tsx +0 -0
  172. package/src/components/BottomPanel.tsx +0 -0
  173. package/src/components/SelectionList.tsx +0 -272
  174. package/src/components/error/ErrorFeedback.tsx +0 -114
  175. package/src/components/menu/use-check-text-overflow.tsx +0 -26
  176. package/src/components/menu/use-keyboard-controls.tsx +0 -70
  177. package/src/layout-context.tsx +0 -22
  178. package/src/svg/AI.tsx +0 -37
  179. package/src/svg/EDP.tsx +0 -35
  180. package/src/svg/Forbidden.tsx +0 -22
  181. package/src/svg/HUB.tsx +0 -35
  182. package/src/svg/Logo.tsx +0 -35
  183. package/src/svg/NotFound.tsx +0 -16
  184. package/src/svg/ServerError.tsx +0 -33
  185. package/src/svg/Unauthenticated.tsx +0 -16
@@ -1 +1 @@
1
- {"version":3,"file":"PageSelector.js","sourceRoot":"","sources":["../../../src/components/menu/PageSelector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAc,WAAW,EAA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AE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,YAAG,SAAS,GAAQ,CAAC,CAAC;gCAC3G,KAAK,CAAC,OAAO,EACf,KAAC,OAAO,IAAC,IAAI,EAAC,IAAI,YAAC,KAAC,MAAM,KAAG,GAAU,IAChC,EAET,KAAC,aAAa,IACZ,EAAE,EAAE,EAAE,CAAC,OAAO,EACd,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAC/B,KAAK,EAAE,MAAM,CAAC,CAAC;4BACb,KAAC,IAAI,IAAC,SAAS,EAAC,UAAU,EAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,YAAG,eAAe,GAAQ;4BAC5G,CAAC,CAAC,SAAS,EACb,MAAM,SACN,IACD,CACJ,GAES,CACf,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,aAAa,EAAE,oBAAoB;KACpC;IACD,EAAE,EAAE;QACF,aAAa,EAAE,kBAAkB;KAClC;CACmB,CAAA"}
@@ -1,5 +1,5 @@
1
+ import { Action } from '@stack-spot/portal-components/SelectionList';
1
2
  import { ReactElement, ReactNode } from 'react';
2
- import { Action } from '../types.js';
3
3
  interface BaseMenuItem {
4
4
  hidden?: boolean;
5
5
  /**
@@ -17,40 +17,100 @@ interface BaseMenuItem {
17
17
  overflow?: 'hidden' | 'wrap' | 'ellipsis';
18
18
  }
19
19
  export interface ItemGroup extends BaseMenuItem {
20
+ /**
21
+ * The label for this group.
22
+ */
20
23
  label: string;
24
+ /**
25
+ * The items in this group.
26
+ */
21
27
  children: MenuItem[];
28
+ /**
29
+ * Whether it should start opened or not.
30
+ */
22
31
  open?: boolean;
23
32
  }
24
33
  export interface MenuAction extends Action, BaseMenuItem {
34
+ /**
35
+ * Whether this menu item is currently active or not.
36
+ */
25
37
  active?: boolean;
26
38
  }
27
39
  export type MenuItem = ItemGroup | MenuAction;
28
- export interface MenuButton extends Action {
29
- icon?: ReactElement;
30
- }
31
40
  export interface SelectorItem extends Action {
41
+ /**
42
+ * A unique id for this item.
43
+ */
32
44
  key: string;
45
+ /**
46
+ * An icon to place at the left side of the item.
47
+ */
33
48
  icon?: ReactElement;
34
49
  }
35
50
  export interface Selector {
51
+ /**
52
+ * The current value. Must correspond to a `key` in `options`.
53
+ */
36
54
  value?: string;
55
+ /**
56
+ * A series of options to show in the selector.
57
+ */
37
58
  options: SelectorItem[];
59
+ /**
60
+ * An extra button to show after the list of options.
61
+ */
38
62
  button?: Action;
63
+ /**
64
+ * A title of this selector.
65
+ */
39
66
  title?: string;
67
+ /**
68
+ * A subtitle for this selector.
69
+ */
40
70
  subtitle?: string;
71
+ /**
72
+ * Whether or not the options for this selector are loading.
73
+ */
41
74
  loading?: boolean;
42
75
  }
43
76
  export interface MenuSectionContent {
77
+ /**
78
+ * A link to go back.
79
+ */
44
80
  goBack?: Action;
81
+ /**
82
+ * A title for this menu.
83
+ */
45
84
  title?: string;
85
+ /**
86
+ * A subtitle for this menu.
87
+ */
46
88
  subtitle?: string;
89
+ /**
90
+ * A custom React Node to add right after the menu title.
91
+ */
47
92
  afterTitle?: React.ReactNode;
93
+ /**
94
+ * A page selector.
95
+ */
48
96
  pageSelector?: Selector;
97
+ /**
98
+ * The menu options, may contain subgroups.
99
+ */
49
100
  options?: MenuItem[];
101
+ /**
102
+ * Whether or not the options for this menu are loading.
103
+ */
50
104
  loading?: boolean;
105
+ /**
106
+ * An error to show instead of the menu.
107
+ */
51
108
  error?: string;
52
109
  }
53
110
  export interface MenuSection extends Action {
111
+ /**
112
+ * The icon for this section.
113
+ */
54
114
  icon: ReactElement;
55
115
  /**
56
116
  * The content or a function that creates the content.
@@ -65,29 +125,62 @@ export interface MenuSection extends Action {
65
125
  * This should be used when the content you want to render is not the default content
66
126
  */
67
127
  customContent?: ReactNode;
128
+ /**
129
+ * Whether or not this section is currently active.
130
+ */
68
131
  active?: boolean;
69
- onOpen?: () => void;
132
+ /**
133
+ * A css class to pass to the <li> tag.
134
+ */
70
135
  className?: string;
71
136
  hidden?: boolean;
72
137
  }
73
138
  interface BaseMenuProps {
139
+ /**
140
+ * The sections of the menu.
141
+ */
74
142
  sections?: MenuSection[];
143
+ /**
144
+ * The content of the menu as a React Element. Use this to create anything you want as the menu content, but prefer using `content`
145
+ * instead, which is a predefined menu.
146
+ */
75
147
  customContent?: ReactNode;
148
+ /**
149
+ * Options for the settings button.
150
+ */
76
151
  settings?: {
152
+ /**
153
+ * Whether or not to show the settings button.
154
+ */
77
155
  show?: boolean;
156
+ /**
157
+ * A function to call when the button is clicked.
158
+ */
78
159
  onClick?: () => void;
160
+ /**
161
+ * A url to go to when the button is clicked.
162
+ */
79
163
  href?: string;
164
+ /**
165
+ * Whether or not this button represents the page currently active.
166
+ */
80
167
  active?: boolean;
168
+ /**
169
+ * A css class to pass to the button.
170
+ */
81
171
  className?: string;
82
172
  };
83
173
  }
84
174
  export interface MenuPropsWithStaticContent extends BaseMenuProps {
175
+ /**
176
+ * The config for creating the menu content.
177
+ */
85
178
  content?: MenuSectionContent;
86
179
  }
87
180
  export interface MenuPropsWithDynamicContent extends BaseMenuProps {
88
181
  /**
89
- * The function that creates the content. It will be called only when the content is rendered, i.e. only when the content really needs to
90
- * be rendered.
182
+ * The function that creates a config to render a menu content. It will be called only when the content is rendered, i.e. only when the
183
+ * content really needs to be rendered.
91
184
  *
92
185
  * Tip: this function can be a React Hook.
93
186
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,UAAU,YAAY;IACpB,MAAM,C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kBAAkB,GAAG,CAAC,MAAM,kBAAkB,CAAC,CAAC;IACzD;;OAEG;IACH,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC;CACvB;AAED,MAAM,MAAM,SAAS,GAAG,0BAA0B,GAAG,2BAA2B,CAAA"}
@@ -1,3 +1,8 @@
1
- import { TourStep } from '@stack-spot/portal-components';
1
+ import { TourStep } from '@stack-spot/portal-components/Tour';
2
+ /**
3
+ * Tutorial: a React hook for retrieving the React Tour step that explains how the portal switcher works. The portal switcher is a component
4
+ * at the top left corner of the layout (header) that allows the user to switch between the different Stackspot portals.
5
+ * @returns the React Tour step for the PortalSwitcher.
6
+ */
2
7
  export declare const usePortalSwitcherStep: () => TourStep;
3
8
  //# sourceMappingURL=PortalSwitcherStep.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PortalSwitcherStep.d.ts","sourceRoot":"","sources":["../../../src/components/tour/PortalSwitcherStep.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAmB,MAAM,+BAA+B,CAAA;AAEzE,eAAO,MAAM,qBAAqB,QAAO,QAgBxC,CAAA"}
1
+ {"version":3,"file":"PortalSwitcherStep.d.ts","sourceRoot":"","sources":["../../../src/components/tour/PortalSwitcherStep.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAmB,MAAM,oCAAoC,CAAA;AAG9E;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAO,QAgBxC,CAAA"}
@@ -1,7 +1,12 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Image, Text } from '@citric/core';
3
- import { tourStepBuilder } from '@stack-spot/portal-components';
3
+ import { tourStepBuilder } from '@stack-spot/portal-components/Tour';
4
4
  import { useTranslate } from '@stack-spot/portal-translate';
5
+ /**
6
+ * Tutorial: a React hook for retrieving the React Tour step that explains how the portal switcher works. The portal switcher is a component
7
+ * at the top left corner of the layout (header) that allows the user to switch between the different Stackspot portals.
8
+ * @returns the React Tour step for the PortalSwitcher.
9
+ */
5
10
  export const usePortalSwitcherStep = () => {
6
11
  const t = useTranslate(translations);
7
12
  return tourStepBuilder({
@@ -1 +1 @@
1
- {"version":3,"file":"PortalSwitcherStep.js","sourceRoot":"","sources":["../../../src/components/tour/PortalSwitcherStep.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAY,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAa,EAAE;IAClD,MAAM,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA;IACpC,OAAO,eAAe,CAAC;QACrB,QAAQ,EAAE,kBAAkB;QAC5B,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,OAAO,EAAE,8BACP,KAAC,KAAK,IAAC,GAAG,EAAC,+CAA+C,EAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,GAAI,EAC9E,KAAC,GAAG,IAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,UAAU,EAAC,YAAY,EAAC,WAAW,EAAC,sBAAsB,YAAE,CAAC,CAAC,WAAW,GAAQ,GACnF,IACL;QACH,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;SACf;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAKD,MAAM,YAAY,GAAG;IACnB,EAAE,EAAE;QACF,KAAK,EAAE,qCAAqC;QAC5C,WAAW,EAAE,8LAA8L;QAC3M,QAAQ,EAAE,oFAAoF;KAC/F;IACD,EAAE,EAAE;QACF,KAAK,EAAE,uCAAuC;QAC9C,WAAW,EAAE,wMAAwM;QACrN,QAAQ,EAAE,sFAAsF;KACjG;CACF,CAAA"}
1
+ {"version":3,"file":"PortalSwitcherStep.js","sourceRoot":"","sources":["../../../src/components/tour/PortalSwitcherStep.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAY,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAa,EAAE;IAClD,MAAM,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA;IACpC,OAAO,eAAe,CAAC;QACrB,QAAQ,EAAE,kBAAkB;QAC5B,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,OAAO,EAAE,8BACP,KAAC,KAAK,IAAC,GAAG,EAAC,+CAA+C,EAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,GAAI,EAC9E,KAAC,GAAG,IAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,UAAU,EAAC,YAAY,EAAC,WAAW,EAAC,sBAAsB,YAAE,CAAC,CAAC,WAAW,GAAQ,GACnF,IACL;QACH,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;SACf;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,YAAY,GAAG;IACnB,EAAE,EAAE;QACF,KAAK,EAAE,qCAAqC;QAC5C,WAAW,EAAE,8LAA8L;QAC3M,QAAQ,EAAE,oFAAoF;KAC/F;IACD,EAAE,EAAE;QACF,KAAK,EAAE,uCAAuC;QAC9C,WAAW,EAAE,wMAAwM;QACrN,QAAQ,EAAE,sFAAsF;KACjG;CACF,CAAA"}
@@ -1,15 +1,2 @@
1
- import React, { ReactNode } from 'react';
2
- interface CustomLabel {
3
- id: string;
4
- element: ReactNode;
5
- }
6
- export interface Action {
7
- label: string | CustomLabel;
8
- onClick?: () => void;
9
- href?: string;
10
- target?: React.AnchorHTMLAttributes<HTMLAnchorElement>['target'];
11
- iconActive?: React.ReactElement;
12
- }
13
1
  export type PortalAcronym = 'EDP' | 'AI' | 'HUB';
14
- export {};
15
2
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAExC,UAAU,WAAW;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,SAAS,CAAC;CACpB;AACD,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC;IACjE,UAAU,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;CACjC;AAED,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,CAAA"}
@@ -1,3 +1,6 @@
1
+ /**
2
+ * A global dictionary for layout components.
3
+ */
1
4
  export declare const useDictionary: () => Record<"close" | "validationLabel" | "dismiss" | "confirm" | "cancel", string>;
2
5
  export declare function getDictionary(): {
3
6
  close: string;
@@ -1 +1 @@
1
- {"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../src/dictionary.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,aAAa,sFAAiC,CAAA;AAE3D,wBAAgB,aAAa;;;;;;;;;;;;EAG5B"}
1
+ {"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../src/dictionary.ts"],"names":[],"mappings":"AAmBA;;GAEG;AACH,eAAO,MAAM,aAAa,sFAAiC,CAAA;AAE3D,wBAAgB,aAAa;;;;;;;;;;;;EAG5B"}
@@ -15,6 +15,9 @@ const dictionary = {
15
15
  cancel: 'Cancelar',
16
16
  },
17
17
  };
18
+ /**
19
+ * A global dictionary for layout components.
20
+ */
18
21
  export const useDictionary = () => useTranslate(dictionary);
19
22
  export function getDictionary() {
20
23
  const language = getLanguage();
@@ -1 +1 @@
1
- {"version":3,"file":"dictionary.js","sourceRoot":"","sources":["../src/dictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEpF,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,kDAAkD;QACnE,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,QAAQ;KACjB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,QAAQ;QACf,eAAe,EAAE,4DAA4D;QAC7E,OAAO,EAAE,WAAW;QACpB,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,UAAU;KACnB;CACmB,CAAA;AAEtB,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAAA;AAE3D,MAAM,UAAU,aAAa;IAC3B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAA;IAC9B,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAA;AAC7B,CAAC"}
1
+ {"version":3,"file":"dictionary.js","sourceRoot":"","sources":["../src/dictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEpF,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,kDAAkD;QACnE,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,QAAQ;KACjB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,QAAQ;QACf,eAAe,EAAE,4DAA4D;QAC7E,OAAO,EAAE,WAAW;QACpB,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,UAAU;KACnB;CACmB,CAAA;AAEtB;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAAA;AAE3D,MAAM,UAAU,aAAa;IAC3B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAA;IAC9B,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAA;AAC7B,CAAC"}
@@ -1,3 +1,6 @@
1
+ /**
2
+ * The ids of the layout elements.
3
+ */
1
4
  export declare const elementIds: {
2
5
  readonly layout: "layout";
3
6
  readonly backdrop: "backdrop";
@@ -14,5 +17,8 @@ export declare const elementIds: {
14
17
  };
15
18
  export type LayoutElement = keyof typeof elementIds;
16
19
  export type LayoutElements = Record<LayoutElement, HTMLElement | null>;
20
+ /**
21
+ * @returns an object with the html elements of the layout.
22
+ */
17
23
  export declare function getLayoutElements(): LayoutElements;
18
24
  //# sourceMappingURL=elements.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAab,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,UAAU,CAAA;AACnD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,aAAa,EAAE,WAAW,GAAG,IAAI,CAAC,CAAA;AAEtE,wBAAgB,iBAAiB,mBAKhC"}
1
+ {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAab,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,UAAU,CAAA;AACnD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,aAAa,EAAE,WAAW,GAAG,IAAI,CAAC,CAAA;AAEtE;;GAEG;AACH,wBAAgB,iBAAiB,mBAKhC"}
package/dist/elements.js CHANGED
@@ -1,3 +1,6 @@
1
+ /**
2
+ * The ids of the layout elements.
3
+ */
1
4
  export const elementIds = {
2
5
  layout: 'layout',
3
6
  backdrop: 'backdrop',
@@ -12,6 +15,9 @@ export const elementIds = {
12
15
  menuSections: 'menuSections',
13
16
  accessibilityAnnouncer: 'accessibilityAnnouncer',
14
17
  };
18
+ /**
19
+ * @returns an object with the html elements of the layout.
20
+ */
15
21
  export function getLayoutElements() {
16
22
  return Object.keys(elementIds).reduce((result, id) => ({ ...result, [id]: document.getElementById(id) }), {});
17
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"elements.js","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,cAAc;IAC5B,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,sBAAsB,EAAE,wBAAwB;CACxC,CAAA;AAKV,MAAM,UAAU,iBAAiB;IAC/B,OAAQ,MAAM,CAAC,IAAI,CAAC,UAAU,CAAqB,CAAC,MAAM,CACxD,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC,EAClE,EAAoB,CACrB,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"elements.js","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,cAAc;IAC5B,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,sBAAsB,EAAE,wBAAwB;CACxC,CAAA;AAKV;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAQ,MAAM,CAAC,IAAI,CAAC,UAAU,CAAqB,CAAC,MAAM,CACxD,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC,EAClE,EAAoB,CACrB,CAAA;AACH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -4,14 +4,11 @@ export { Dialog } from './components/Dialog.js';
4
4
  export { Header, HeaderProps } from './components/Header.js';
5
5
  export { OverlayContent } from './components/OverlayContent.js';
6
6
  export { PortalSwitcher } from './components/PortalSwitcher.js';
7
- export { ListAction, SelectionList, SelectionListProps } from './components/SelectionList.js';
8
- export { Toaster } from './components/Toaster.js';
9
7
  export { ActionItem, MenuContent, MenuGroup, Title } from './components/menu/MenuContent.js';
10
8
  export { MenuSections } from './components/menu/MenuSections.js';
11
9
  export * from './components/menu/types.js';
12
10
  export * from './components/types.js';
13
11
  export * from './elements.js';
14
12
  export * from './errors.js';
15
- export { Logo as StackspotLogo } from './svg/Logo.js';
16
13
  export * from './utils.js';
17
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,YAAY,CAAA;AAClD,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
package/dist/index.js CHANGED
@@ -4,14 +4,11 @@ export { Dialog } from './components/Dialog.js';
4
4
  export { Header } from './components/Header.js';
5
5
  export { OverlayContent } from './components/OverlayContent.js';
6
6
  export { PortalSwitcher } from './components/PortalSwitcher.js';
7
- export { SelectionList } from './components/SelectionList.js';
8
- export { Toaster } from './components/Toaster.js';
9
7
  export { ActionItem, MenuContent, MenuGroup, Title } from './components/menu/MenuContent.js';
10
8
  export { MenuSections } from './components/menu/MenuSections.js';
11
9
  export * from './components/menu/types.js';
12
10
  export * from './components/types.js';
13
11
  export * from './elements.js';
14
12
  export * from './errors.js';
15
- export { Logo as StackspotLogo } from './svg/Logo.js';
16
13
  export * from './utils.js';
17
14
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAc,aAAa,EAAsB,MAAM,4BAA4B,CAAA;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,YAAY,CAAA;AAClD,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
package/dist/layout.css CHANGED
@@ -245,6 +245,7 @@ body {
245
245
  pointer-events: none;
246
246
  z-index: 1;
247
247
  transition: opacity 0.3s;
248
+ overflow-y: auto;
248
249
  }
249
250
 
250
251
  #menuContentOverlay.visible {
@@ -252,11 +253,6 @@ body {
252
253
  pointer-events: auto;
253
254
  }
254
255
 
255
- #menuContentOverlay > div {
256
- flex: 1;
257
- overflow: auto;
258
- }
259
-
260
256
  #menuContent {
261
257
  width: var(--menu-content-width);
262
258
  transition: left ease-out var(--menu-animation-duration);
package/dist/toaster.d.ts CHANGED
@@ -1,23 +1,88 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import 'react-toastify/dist/ReactToastify.css';
3
3
  type ToastType = 'error' | 'success' | 'warning' | 'info';
4
- interface BaseProps {
4
+ interface BaseOptions {
5
+ /**
6
+ * An identifier for the toaster, if not provided, `Math.random()` will be used.
7
+ *
8
+ * The id can be used to programmatically control the toaster.
9
+ */
10
+ id?: number | string;
11
+ /**
12
+ * The message to show.
13
+ * Can be either a string or a React element.
14
+ */
15
+ message: React.ReactNode;
16
+ /**
17
+ * Level/severity of this message.
18
+ * @default 'info'
19
+ */
5
20
  type?: ToastType;
6
21
  /**
7
22
  * Seconds until auto-close or false to not auto-close.
8
- * @default 3 for success toast and 10 for the others
23
+ * @default 3s for success toast and 10s for the others
9
24
  */
10
25
  autoClose?: number | false;
26
+ /**
27
+ * If true, `message` must be a React Element and none of the default toaster UI is rendered (title, icon and close button).
28
+ * @default false
29
+ */
30
+ custom?: boolean;
31
+ /**
32
+ * Whether or not to close the toaster when the user clicks it.
33
+ * @default false
34
+ */
35
+ closeOnClick?: boolean;
11
36
  }
12
- interface BasicMessageProps extends BaseProps {
13
- message: string;
37
+ interface ToasterAction {
38
+ /**
39
+ * The button's label.
40
+ */
41
+ label: string;
42
+ /**
43
+ * A function to run once the button is clicked.
44
+ */
45
+ onClick?: (event: React.MouseEvent) => void;
46
+ /**
47
+ * If this is set, instead of a button, an anchor is rendered with this href.
48
+ */
49
+ href?: string;
50
+ /**
51
+ * Whether or not to close the toaster once the button is clicked.
52
+ * @default true
53
+ */
54
+ closeOnClick?: boolean;
55
+ }
56
+ export interface DefaultToasterOptions extends BaseOptions {
57
+ /**
58
+ * The title of the toaster.
59
+ */
14
60
  title?: string;
61
+ /**
62
+ * A function to call when the user clicks the toaster. By default, it closes the toaster.
63
+ */
15
64
  onClick?: () => void;
65
+ /**
66
+ * A set of buttons (or links/anchors) to show after the message.
67
+ */
68
+ actions?: ToasterAction[];
69
+ custom?: false;
16
70
  }
17
- interface RichMessageProps extends BaseProps {
18
- content: React.ReactElement;
71
+ export interface CustomToasterOptions extends BaseOptions {
72
+ /**
73
+ * The whole content to render inside the toaster.
74
+ */
75
+ message: React.ReactElement;
76
+ custom: true;
77
+ /**
78
+ * A close button to render on the top right corner of the toaster. If not provided, a close button won't be rendered.
79
+ */
80
+ closeButton?: React.ReactElement;
19
81
  }
20
- type Props = BasicMessageProps | RichMessageProps;
21
- export declare function showToaster({ type, autoClose, ...props }: Props): void;
82
+ export type ToasterOptions = DefaultToasterOptions | CustomToasterOptions | React.ReactNode;
83
+ export declare function showToaster(defaultToasterConfig: DefaultToasterOptions): number | string;
84
+ export declare function showToaster(customToasterConfig: CustomToasterOptions): number | string;
85
+ export declare function showToaster(message: React.ReactNode): number | string;
86
+ export declare function closeReactToaster(id: number | string): void;
22
87
  export {};
23
88
  //# sourceMappingURL=toaster.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toaster.d.ts","sourceRoot":"","sources":["../src/toaster.tsx"],"names":[],"mappings":";AAGA,OAAO,uCAAuC,CAAA;AAE9C,KAAK,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAA;AAEzD,UAAU,SAAS;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC5B;AAED,UAAU,iBAAkB,SAAQ,SAAS;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,UAAU,gBAAiB,SAAQ,SAAS;IAC1C,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC;CAC7B;AAED,KAAK,KAAK,GAAG,iBAAiB,GAAG,gB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AAK,CAAC,YAAY,CAAC;IAC5B,MAAM,EAAE,IAAI,CAAC;IACb;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;CAClC;AAED,MAAM,MAAM,cAAc,GAAG,qBAAqB,GAAG,oBAAoB,GAAG,KAAK,CAAC,SAAS,CAAA;AAyB3F,wBAAgB,WAAW,CAAC,oBAAoB,EAAE,qBAAqB,GAAG,MAAM,GAAG,MAAM,CAAA;AACzF,wBAAgB,WAAW,CAAC,mBAAmB,EAAE,oBAAoB,GAAG,MAAM,GAAG,MAAM,CAAA;AACvF,wBAAgB,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,GAAG,MAAM,CAAA;AAmEtE,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,QAEpD"}
package/dist/toaster.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { IconBox } from '@citric/core';
2
+ import { Flex, IconBox, Text } from '@citric/core';
3
3
  import { CheckCircleFill, ExclamationCircleFill, ExclamationTriangleFill, InfoCircleFill } from '@citric/icons';
4
4
  import { toast } from 'react-toastify';
5
5
  import 'react-toastify/dist/ReactToastify.css';
@@ -25,22 +25,48 @@ const toasterConfig = {
25
25
  duration: 10,
26
26
  },
27
27
  };
28
- export function showToaster({ type = 'info', autoClose, ...props }) {
28
+ export function showToaster(options) {
29
+ const isToasterConfig = options && typeof options === 'object' && 'message' in options;
30
+ const { type = 'info', autoClose, ...opts } = isToasterConfig
31
+ ? options
32
+ : { message: options };
29
33
  const config = toasterConfig[type];
34
+ const id = opts.id ?? Math.random();
30
35
  const closeTime = autoClose ? autoClose : config.duration;
31
36
  const bg = `var(--${config.color}-500)`;
32
37
  const bgDark = `var(--${config.color}-600)`;
33
38
  const fg = `var(--${config.color}-contrastText)`;
34
- toast('message' in props
35
- ? _jsxs("div", { onClick: props.onClick, children: [_jsx("h1", { style: { textTransform: 'capitalize' }, children: props.title ?? type }), _jsx("p", { children: props.message })] })
36
- : props.content, {
39
+ const actionStyle = {
40
+ background: 'transparent',
41
+ border: 'none',
42
+ padding: 0,
43
+ color: 'inherit',
44
+ font: 'inherit',
45
+ fontWeight: 500,
46
+ cursor: 'pointer',
47
+ };
48
+ const buttons = opts.custom ? null : opts.actions?.map(({ label, href, onClick, closeOnClick = true }) => (_jsx(Text, { as: href ? 'a' : 'button', href: href, style: actionStyle, onClick: (event) => {
49
+ onClick?.(event);
50
+ if (closeOnClick)
51
+ closeReactToaster(id);
52
+ }, children: label }, label)));
53
+ toast(opts.custom
54
+ ? opts.message
55
+ : (_jsxs("div", { onClick: opts.onClick, children: [_jsx("h1", { style: { textTransform: 'capitalize' }, children: opts.title ?? type }), typeof opts.message === 'string' ? _jsx("p", { children: opts.message }) : opts.message, buttons?.length ? _jsx(Flex, { style: { gap: '12px', marginTop: '12px' }, children: buttons }) : null] })), {
56
+ toastId: id,
37
57
  type,
38
58
  autoClose: autoClose === false ? false : closeTime * 1000,
39
59
  className: 'main-toaster',
40
60
  style: { backgroundColor: bg, color: fg },
41
61
  progressStyle: { background: bgDark },
42
62
  bodyClassName: 'toast-body',
43
- icon: 'message' in props ? () => (_jsx(IconBox, { colorIcon: `${config.color}.contrastText`, size: "xs", children: config.element })) : undefined,
63
+ icon: opts.custom ? false : () => (_jsx(IconBox, { colorIcon: `${config.color}.contrastText`, size: "xs", children: config.element })),
64
+ closeOnClick: opts.closeOnClick ?? false,
65
+ closeButton: opts.custom ? (opts.closeButton ?? false) : undefined,
44
66
  });
67
+ return id;
68
+ }
69
+ export function closeReactToaster(id) {
70
+ toast.dismiss(id);
45
71
  }
46
72
  //# sourceMappingURL=toaster.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toaster.js","sourceRoot":"","sources":["../src/toaster.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAiC,MAAM,cAAc,CAAA;AACrE,OAAO,EAAE,eA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