@paybutton/react 5.1.1 → 5.2.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.
@@ -14,11 +14,11 @@ export interface WidgetProps {
14
14
  disablePaymentId?: boolean;
15
15
  text?: string;
16
16
  ButtonComponent?: React.ComponentType;
17
- success: boolean;
17
+ success?: boolean;
18
18
  successText?: string;
19
19
  theme?: ThemeName | Theme;
20
20
  foot?: React.ReactNode;
21
- disabled: boolean;
21
+ disabled?: boolean;
22
22
  goalAmount?: number | string | null;
23
23
  currency?: Currency;
24
24
  animation?: animation;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Converts a hex color to RGB values
3
+ */
4
+ export declare const hexToRgb: (hex: string) => {
5
+ r: number;
6
+ g: number;
7
+ b: number;
8
+ } | null;
9
+ /**
10
+ * Normalizes any CSS color value to a hex code using the browser's canvas API
11
+ * Handles hex codes, named colors (e.g., "navy"), rgb(), hsl(), etc.
12
+ */
13
+ export declare const normalizeColorToHex: (color: string) => string | null;
14
+ /**
15
+ * Calculates the relative luminance of a color
16
+ * Based on WCAG 2.0 formula: https://www.w3.org/TR/WCAG20/#relativeluminancedef
17
+ * Returns a value between 0 (black) and 1 (white)
18
+ */
19
+ export declare const getLuminance: (color: string) => number;
20
+ /**
21
+ * Determines if dark mode should be used based on the color
22
+ * Dark mode is enabled when the color is light (luminance > 0.5)
23
+ * This threshold can be adjusted based on needs
24
+ */
25
+ export declare const darkMode: (color: string, threshold?: number) => boolean;
@@ -1,6 +1,7 @@
1
1
  export * from './address';
2
2
  export * from './api-client';
3
3
  export * from './cashtab';
4
+ export * from './color';
4
5
  export * from './constants';
5
6
  export * from './format';
6
7
  export * from './opReturn';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paybutton/react",
3
- "version": "5.1.1",
3
+ "version": "5.2.0",
4
4
  "description": "The easiest way to accept eCash online",
5
5
  "author": "Blockchain Ventures Corp.",
6
6
  "license": "MIT",
@@ -88,7 +88,6 @@
88
88
  "dependencies": {
89
89
  "@emotion/react": "^11.14.0",
90
90
  "@emotion/styled": "^11.14.1",
91
- "@mui/lab": "^7.0.1-beta.18",
92
91
  "@mui/material": "^7.3.4",
93
92
  "@types/crypto-js": "^4.2.1",
94
93
  "@types/jest": "^29.5.11",
@@ -104,7 +103,6 @@
104
103
  "lodash": "4.17.21",
105
104
  "notistack": "3.0.0",
106
105
  "qrcode.react": "3",
107
- "react-jss": "10.10.0",
108
106
  "react-number-format": "^5.4.4",
109
107
  "socket.io-client": "4.7.4",
110
108
  "ts-jest": "^29.4.5",