@doneisbetter/gds-theme 2.6.1 → 2.6.3

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.
@@ -36,7 +36,31 @@ function GdsProvider({
36
36
  ] }) }) }) }) });
37
37
  }
38
38
 
39
+ // src/notifications.ts
40
+ import { notifications } from "@mantine/notifications";
41
+ var toneColorMap = {
42
+ success: "teal",
43
+ error: "red",
44
+ warning: "yellow",
45
+ info: "blue",
46
+ neutral: "gray"
47
+ };
48
+ function showGdsNotification({
49
+ message,
50
+ title,
51
+ tone = "info",
52
+ autoClose
53
+ }) {
54
+ notifications.show({
55
+ message,
56
+ title,
57
+ color: toneColorMap[tone],
58
+ autoClose
59
+ });
60
+ }
61
+
39
62
  export {
40
63
  useGdsTranslation,
41
- GdsProvider
64
+ GdsProvider,
65
+ showGdsNotification
42
66
  };
package/dist/client.d.mts CHANGED
@@ -26,4 +26,13 @@ declare function useGdsTranslation(): {
26
26
  locale: string;
27
27
  };
28
28
 
29
- export { GdsProvider, type GdsProviderProps, useGdsTranslation };
29
+ type GdsNotificationTone = 'success' | 'error' | 'warning' | 'info' | 'neutral';
30
+ interface GdsNotificationOptions {
31
+ message: string;
32
+ title?: string;
33
+ tone?: GdsNotificationTone;
34
+ autoClose?: number | false;
35
+ }
36
+ declare function showGdsNotification({ message, title, tone, autoClose, }: GdsNotificationOptions): void;
37
+
38
+ export { type GdsNotificationOptions, type GdsNotificationTone, GdsProvider, type GdsProviderProps, showGdsNotification, useGdsTranslation };
package/dist/client.d.ts CHANGED
@@ -26,4 +26,13 @@ declare function useGdsTranslation(): {
26
26
  locale: string;
27
27
  };
28
28
 
29
- export { GdsProvider, type GdsProviderProps, useGdsTranslation };
29
+ type GdsNotificationTone = 'success' | 'error' | 'warning' | 'info' | 'neutral';
30
+ interface GdsNotificationOptions {
31
+ message: string;
32
+ title?: string;
33
+ tone?: GdsNotificationTone;
34
+ autoClose?: number | false;
35
+ }
36
+ declare function showGdsNotification({ message, title, tone, autoClose, }: GdsNotificationOptions): void;
37
+
38
+ export { type GdsNotificationOptions, type GdsNotificationTone, GdsProvider, type GdsProviderProps, showGdsNotification, useGdsTranslation };
package/dist/client.js CHANGED
@@ -27,6 +27,7 @@ __export(client_exports, {
27
27
  gdsEditorialPublicTheme: () => gdsEditorialPublicTheme,
28
28
  gdsFlatSurfaceTheme: () => gdsFlatSurfaceTheme,
29
29
  gdsTheme: () => gdsTheme,
30
+ showGdsNotification: () => showGdsNotification,
30
31
  useGdsTranslation: () => useGdsTranslation,
31
32
  withGdsMotion: () => withGdsMotion
32
33
  });
@@ -276,6 +277,29 @@ function GdsProvider({
276
277
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core2.Box, { dir, h: "100%", children })
277
278
  ] }) }) }) }) });
278
279
  }
280
+
281
+ // src/notifications.ts
282
+ var import_notifications2 = require("@mantine/notifications");
283
+ var toneColorMap = {
284
+ success: "teal",
285
+ error: "red",
286
+ warning: "yellow",
287
+ info: "blue",
288
+ neutral: "gray"
289
+ };
290
+ function showGdsNotification({
291
+ message,
292
+ title,
293
+ tone = "info",
294
+ autoClose
295
+ }) {
296
+ import_notifications2.notifications.show({
297
+ message,
298
+ title,
299
+ color: toneColorMap[tone],
300
+ autoClose
301
+ });
302
+ }
279
303
  // Annotate the CommonJS export names for ESM import in node:
280
304
  0 && (module.exports = {
281
305
  GdsProvider,
@@ -285,6 +309,7 @@ function GdsProvider({
285
309
  gdsEditorialPublicTheme,
286
310
  gdsFlatSurfaceTheme,
287
311
  gdsTheme,
312
+ showGdsNotification,
288
313
  useGdsTranslation,
289
314
  withGdsMotion
290
315
  });
package/dist/client.mjs CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  GdsProvider,
3
+ showGdsNotification,
3
4
  useGdsTranslation
4
- } from "./chunk-TAI4BSAN.mjs";
5
+ } from "./chunk-VBEW3PJF.mjs";
5
6
  import {
6
7
  createPublicBrandTheme,
7
8
  extendGdsTheme,
@@ -19,6 +20,7 @@ export {
19
20
  gdsEditorialPublicTheme,
20
21
  gdsFlatSurfaceTheme,
21
22
  gdsTheme,
23
+ showGdsNotification,
22
24
  useGdsTranslation,
23
25
  withGdsMotion
24
26
  };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { createPublicBrandTheme, extendGdsTheme, gdsDarkPublicTheme, gdsEditorialPublicTheme, gdsFlatSurfaceTheme, gdsTheme, withGdsMotion } from './server.mjs';
2
- export { GdsProvider, GdsProviderProps, useGdsTranslation } from './client.mjs';
2
+ export { GdsNotificationOptions, GdsNotificationTone, GdsProvider, GdsProviderProps, showGdsNotification, useGdsTranslation } from './client.mjs';
3
3
  import '@mantine/core';
4
4
  import 'react/jsx-runtime';
5
5
  import 'react';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { createPublicBrandTheme, extendGdsTheme, gdsDarkPublicTheme, gdsEditorialPublicTheme, gdsFlatSurfaceTheme, gdsTheme, withGdsMotion } from './server.js';
2
- export { GdsProvider, GdsProviderProps, useGdsTranslation } from './client.js';
2
+ export { GdsNotificationOptions, GdsNotificationTone, GdsProvider, GdsProviderProps, showGdsNotification, useGdsTranslation } from './client.js';
3
3
  import '@mantine/core';
4
4
  import 'react/jsx-runtime';
5
5
  import 'react';
package/dist/index.js CHANGED
@@ -27,6 +27,7 @@ __export(index_exports, {
27
27
  gdsEditorialPublicTheme: () => gdsEditorialPublicTheme,
28
28
  gdsFlatSurfaceTheme: () => gdsFlatSurfaceTheme,
29
29
  gdsTheme: () => gdsTheme,
30
+ showGdsNotification: () => showGdsNotification,
30
31
  useGdsTranslation: () => useGdsTranslation,
31
32
  withGdsMotion: () => withGdsMotion
32
33
  });
@@ -276,6 +277,29 @@ function GdsProvider({
276
277
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core2.Box, { dir, h: "100%", children })
277
278
  ] }) }) }) }) });
278
279
  }
280
+
281
+ // src/notifications.ts
282
+ var import_notifications2 = require("@mantine/notifications");
283
+ var toneColorMap = {
284
+ success: "teal",
285
+ error: "red",
286
+ warning: "yellow",
287
+ info: "blue",
288
+ neutral: "gray"
289
+ };
290
+ function showGdsNotification({
291
+ message,
292
+ title,
293
+ tone = "info",
294
+ autoClose
295
+ }) {
296
+ import_notifications2.notifications.show({
297
+ message,
298
+ title,
299
+ color: toneColorMap[tone],
300
+ autoClose
301
+ });
302
+ }
279
303
  // Annotate the CommonJS export names for ESM import in node:
280
304
  0 && (module.exports = {
281
305
  GdsProvider,
@@ -285,6 +309,7 @@ function GdsProvider({
285
309
  gdsEditorialPublicTheme,
286
310
  gdsFlatSurfaceTheme,
287
311
  gdsTheme,
312
+ showGdsNotification,
288
313
  useGdsTranslation,
289
314
  withGdsMotion
290
315
  });
package/dist/index.mjs CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  GdsProvider,
3
+ showGdsNotification,
3
4
  useGdsTranslation
4
- } from "./chunk-TAI4BSAN.mjs";
5
+ } from "./chunk-VBEW3PJF.mjs";
5
6
  import {
6
7
  createPublicBrandTheme,
7
8
  extendGdsTheme,
@@ -19,6 +20,7 @@ export {
19
20
  gdsEditorialPublicTheme,
20
21
  gdsFlatSurfaceTheme,
21
22
  gdsTheme,
23
+ showGdsNotification,
22
24
  useGdsTranslation,
23
25
  withGdsMotion
24
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doneisbetter/gds-theme",
3
- "version": "2.6.1",
3
+ "version": "2.6.3",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -38,10 +38,10 @@
38
38
  "dev": "tsup --watch"
39
39
  },
40
40
  "peerDependencies": {
41
- "@mantine/core": "^7.9.0 || ^8.3.0",
42
- "@mantine/hooks": "^7.9.0 || ^8.3.0",
43
- "@mantine/modals": "^7.9.0 || ^8.3.0",
44
- "@mantine/notifications": "^7.9.0 || ^8.3.0",
41
+ "@mantine/core": "^7.9.0 || ^8.3.0 || ^9.0.0",
42
+ "@mantine/hooks": "^7.9.0 || ^8.3.0 || ^9.0.0",
43
+ "@mantine/modals": "^7.9.0 || ^8.3.0 || ^9.0.0",
44
+ "@mantine/notifications": "^7.9.0 || ^8.3.0 || ^9.0.0",
45
45
  "react": "^18.2.0 || ^19.0.0",
46
46
  "react-dom": "^18.2.0 || ^19.0.0"
47
47
  },