@ttoss/react-notifications 1.22.26 → 1.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -144,22 +144,38 @@ var NotificationsBox = ({
144
144
  };
145
145
 
146
146
  // src/NotificationsModal.tsx
147
+ import { Button as Button2, Icon } from "@ttoss/ui";
147
148
  import { Modal } from "@ttoss/components";
148
- import { jsx as jsx3 } from "react/jsx-runtime";
149
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
149
150
  var NotificationsModal = () => {
150
151
  const {
151
- notifications
152
+ notifications,
153
+ setNotifications
152
154
  } = useNotifications();
153
- return /* @__PURE__ */jsx3(Modal, {
155
+ return /* @__PURE__ */jsxs2(Modal, {
154
156
  isOpen: !!notifications,
155
157
  style: {
156
158
  content: {
157
- minWidth: "30%"
159
+ minWidth: "30%",
160
+ display: "flex",
161
+ flexDirection: "column",
162
+ alignItems: "center"
158
163
  }
159
164
  },
160
- children: /* @__PURE__ */jsx3(NotificationsBox, {
165
+ children: [/* @__PURE__ */jsx3(Button2, {
166
+ placeholder: "Close",
167
+ style: {
168
+ alignSelf: "flex-end"
169
+ },
170
+ onClick: () => {
171
+ setNotifications(void 0);
172
+ },
173
+ children: /* @__PURE__ */jsx3(Icon, {
174
+ icon: "close"
175
+ })
176
+ }), /* @__PURE__ */jsx3(NotificationsBox, {
161
177
  direction: "row"
162
- })
178
+ })]
163
179
  });
164
180
  };
165
181
  export { NotificationsBox, NotificationsModal, NotificationsProvider, useNotifications };
package/dist/index.js CHANGED
@@ -189,22 +189,38 @@ var NotificationsBox = ({
189
189
  };
190
190
 
191
191
  // src/NotificationsModal.tsx
192
+ var import_ui3 = require("@ttoss/ui");
192
193
  var import_components = require("@ttoss/components");
193
194
  var import_jsx_runtime3 = require("react/jsx-runtime");
194
195
  var NotificationsModal = () => {
195
196
  const {
196
- notifications
197
+ notifications,
198
+ setNotifications
197
199
  } = useNotifications();
198
- return /* @__PURE__ */(0, import_jsx_runtime3.jsx)(import_components.Modal, {
200
+ return /* @__PURE__ */(0, import_jsx_runtime3.jsxs)(import_components.Modal, {
199
201
  isOpen: !!notifications,
200
202
  style: {
201
203
  content: {
202
- minWidth: "30%"
204
+ minWidth: "30%",
205
+ display: "flex",
206
+ flexDirection: "column",
207
+ alignItems: "center"
203
208
  }
204
209
  },
205
- children: /* @__PURE__ */(0, import_jsx_runtime3.jsx)(NotificationsBox, {
210
+ children: [/* @__PURE__ */(0, import_jsx_runtime3.jsx)(import_ui3.Button, {
211
+ placeholder: "Close",
212
+ style: {
213
+ alignSelf: "flex-end"
214
+ },
215
+ onClick: () => {
216
+ setNotifications(void 0);
217
+ },
218
+ children: /* @__PURE__ */(0, import_jsx_runtime3.jsx)(import_ui3.Icon, {
219
+ icon: "close"
220
+ })
221
+ }), /* @__PURE__ */(0, import_jsx_runtime3.jsx)(NotificationsBox, {
206
222
  direction: "row"
207
- })
223
+ })]
208
224
  });
209
225
  };
210
226
  // Annotate the CommonJS export names for ESM import in node:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/react-notifications",
3
- "version": "1.22.26",
3
+ "version": "1.23.1",
4
4
  "description": "ttoss notifications module for React apps.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "ttoss",
@@ -22,15 +22,15 @@
22
22
  "typings": "dist/index.d.ts",
23
23
  "peerDependencies": {
24
24
  "react": ">=16.8.0",
25
- "@ttoss/components": "^1.29.8",
26
- "@ttoss/ui": "^2.0.4"
25
+ "@ttoss/components": "^1.29.9",
26
+ "@ttoss/ui": "^2.0.5"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/react": "^18.2.12",
30
30
  "jest": "^29.6.1",
31
31
  "react": "^18.2.0",
32
32
  "tsup": "^7.1.0",
33
- "@ttoss/components": "^1.29.8",
33
+ "@ttoss/components": "^1.29.9",
34
34
  "@ttoss/config": "^1.30.5",
35
35
  "@ttoss/test-utils": "^1.23.6"
36
36
  },
@@ -1,12 +1,32 @@
1
+ import { Button, Icon } from '@ttoss/ui';
1
2
  import { Modal } from '@ttoss/components';
2
3
  import { NotificationsBox } from './NotificationsBox';
3
4
  import { useNotifications } from './Provider';
4
5
 
5
6
  export const NotificationsModal = () => {
6
- const { notifications } = useNotifications();
7
+ const { notifications, setNotifications } = useNotifications();
7
8
 
8
9
  return (
9
- <Modal isOpen={!!notifications} style={{ content: { minWidth: '30%' } }}>
10
+ <Modal
11
+ isOpen={!!notifications}
12
+ style={{
13
+ content: {
14
+ minWidth: '30%',
15
+ display: 'flex',
16
+ flexDirection: 'column',
17
+ alignItems: 'center',
18
+ },
19
+ }}
20
+ >
21
+ <Button
22
+ placeholder="Close"
23
+ style={{ alignSelf: 'flex-end' }}
24
+ onClick={() => {
25
+ setNotifications(undefined);
26
+ }}
27
+ >
28
+ <Icon icon={'close'}></Icon>
29
+ </Button>
10
30
  <NotificationsBox direction="row" />
11
31
  </Modal>
12
32
  );