react-notify-sdk 1.0.22 → 1.0.24

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.
@@ -10,6 +10,6 @@ top: ${(props) => props.message?.position === 'top' ? '24px' : ''};
10
10
  bottom: ${(props) => props.message?.position === 'bottom' ? '24px' : ''};
11
11
  left: 50%;
12
12
  transform: translateX(-50%);
13
- z-index: 5;
13
+ z-index: 5000;
14
14
  `;
15
15
  export default FadeWrapper;
@@ -1,5 +1,19 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  const NotificationMessage = ({ message }) => {
3
+ function hexToRgba(hex, alpha) {
4
+ // Remove leading #
5
+ hex = hex.replace(/^#/, "");
6
+ // Expand shorthand form (#03F → #0033FF)
7
+ if (hex.length === 3) {
8
+ hex = hex.split("").map(x => x + x).join("");
9
+ }
10
+ // Parse into r, g, b
11
+ const bigint = parseInt(hex, 16);
12
+ const r = (bigint >> 16) & 255;
13
+ const g = (bigint >> 8) & 255;
14
+ const b = bigint & 255;
15
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
16
+ }
3
17
  return (_jsxs("div", { style: {
4
18
  width: '100%',
5
19
  paddingTop: '4px', // p-4 = 1rem
@@ -7,8 +21,10 @@ const NotificationMessage = ({ message }) => {
7
21
  paddingLeft: '12px',
8
22
  paddingRight: '12px',
9
23
  backgroundColor: message?.backgroundColor,
10
- border: `1px solid ${message?.textColor}`, // Completed border style
11
- borderRadius: "8px"
24
+ borderRadius: "8px",
25
+ borderWidth: "1px",
26
+ borderColor: `${hexToRgba(message.borderColor, 0.3)}`,
27
+ boxShadow: `0 10px 15px -3px ${hexToRgba(message.borderColor, 0.4)}, 0 4px 6px -4px ${hexToRgba(message.borderColor, 0.4)}`
12
28
  }, children: [_jsxs("div", { className: 'w-full flex flex-row', style: {
13
29
  width: '100%',
14
30
  display: 'flex',
@@ -1,2 +1,2 @@
1
1
  import { NotifyMessageProviderProps } from './types';
2
- export declare const NotifyProvider: ({ projectKey, onClear, }: NotifyMessageProviderProps) => import("react/jsx-runtime").JSX.Element | null;
2
+ export declare const NotifyProvider: ({ projectKey, }: NotifyMessageProviderProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -19,7 +19,7 @@ const routeMatches = (pattern, path) => {
19
19
  return false;
20
20
  }
21
21
  };
22
- export const NotifyProvider = ({ projectKey, onClear,
22
+ export const NotifyProvider = ({ projectKey,
23
23
  //className,
24
24
  //style,
25
25
  //disableDefaultStyles = true,
@@ -28,10 +28,6 @@ export const NotifyProvider = ({ projectKey, onClear,
28
28
  const [visible, setVisible] = useState(false);
29
29
  const location = useLocation();
30
30
  const device = useDeviceDetection();
31
- const clearMessage = () => {
32
- setVisible(false);
33
- setMessage(null);
34
- };
35
31
  useEffect(() => {
36
32
  if (typeof window === 'undefined')
37
33
  return; // Skip on server
@@ -75,13 +71,10 @@ export const NotifyProvider = ({ projectKey, onClear,
75
71
  }
76
72
  })
77
73
  .subscribe();
78
- if (onClear) {
79
- clearMessage;
80
- }
81
74
  return () => {
82
75
  supabase.removeChannel(subscription);
83
76
  };
84
- }, [location.pathname, projectKey, onClear]);
77
+ }, [location.pathname, projectKey]);
85
78
  if (!message)
86
79
  return null;
87
80
  //const defaultClasses = `absolute ${message?.position}-6 left-1/2 transform -translate-x-1/2 z-20 w-full md:w-[${message?.width}%] px-3 py-1 bg-[${message?.backgroundColor}] border border-[${message?.borderColor}] text-[${message?.textColor}] rounded-lg shadow`;
package/dist/types.d.ts CHANGED
@@ -17,5 +17,4 @@ export type NotifyMessage = {
17
17
  };
18
18
  export type NotifyMessageProviderProps = {
19
19
  projectKey: string;
20
- onClear: boolean;
21
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-notify-sdk",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "SDK for displaying real-time route-specific messages in React apps",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,7 +17,8 @@
17
17
  "dependencies": {
18
18
  "@supabase/supabase-js": "^2.50.0",
19
19
  "clsx": "^2.1.1",
20
- "goober": "^2.1.16"
20
+ "goober": "^2.1.16",
21
+ "lucide-react": "^0.541.0"
21
22
  },
22
23
  "devDependencies": {
23
24
  "@types/react": "^19.1.8",