@lglab/react-qr-code 1.1.0 → 1.2.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/README.md CHANGED
@@ -1,6 +1,52 @@
1
+ ![React QR Code Header](https://github.com/LGLabGreg/react-qr-code/raw/main/media/repo-header.png)
2
+
1
3
  # @lglab/react-qr-code
2
4
 
3
5
  A highly customizable and lightweight QR code generator for React applications.
4
6
 
5
7
  🚀 **Live Demo:** [reactqrcode.com/demo](https://reactqrcode.com/demo)
6
8
  📖 **Documentation:** [reactqrcode.com](https://reactqrcode.com/)
9
+
10
+ ## Quick Features
11
+
12
+ - **Highly Customizable** - Style the finder patterns, modules, and colors exactly how you want.
13
+ - **Performance Optimized** - Generates QR codes efficiently without sacrificing quality.
14
+ - **SVG-Based Rendering** - Crisp and scalable output for web and print
15
+ - **Developer-Friendly** - Style the finder patterns, modules, and colors exactly how you want.
16
+ - **Highly Customizable** - Built with TypeScript, easy to use, and well-documented
17
+
18
+ ## Install
19
+
20
+ ```
21
+ pnpm add @lglab/react-qr-code
22
+ ```
23
+
24
+ or
25
+
26
+ ```
27
+ npm i @lglab/react-qr-code
28
+ ```
29
+
30
+ or
31
+
32
+ ```
33
+ yarn add @lglab/react-qr-code
34
+ ```
35
+
36
+ or
37
+
38
+ ```
39
+ bun add @lglab/react-qr-code
40
+ ```
41
+
42
+ ## Quick Start
43
+
44
+ ```
45
+ import { ReactQRCode } from '@lglab/react-qr-code'
46
+
47
+ const Page = () => {
48
+ return (
49
+ <ReactQRCode value='https://reactqrcode.com' />
50
+ );
51
+ }
52
+ ```
package/dist/index.d.ts CHANGED
@@ -1,5 +1,9 @@
1
1
  import { JSX } from 'react/jsx-runtime';
2
- import { Ref } from 'react';
2
+
3
+ /**
4
+ * ReactQRCode props.
5
+ */
6
+ export declare type BackgroundSettings = string | GradientSettings;
3
7
 
4
8
  export declare type CrossOrigin = 'anonymous' | 'use-credentials' | '' | undefined;
5
9
 
@@ -9,9 +13,6 @@ export declare interface DataModulesSettings {
9
13
  randomSize?: boolean;
10
14
  }
11
15
 
12
- /**
13
- * ReactQRCode props.
14
- */
15
16
  export declare type DataModulesStyle = 'square' | 'square-sm' | 'rounded' | 'leaf' | 'vertical-line' | 'horizontal-line' | 'circle' | 'diamond' | 'star' | 'heart';
16
17
 
17
18
  export declare type DownloadFileFormat = 'svg' | 'png' | 'jpeg';
@@ -49,6 +50,19 @@ export declare interface FinderPatternOuterSettings {
49
50
 
50
51
  export declare type FinderPatternOuterStyle = 'square' | 'rounded-sm' | 'rounded' | 'rounded-lg' | 'circle' | 'inpoint-sm' | 'inpoint' | 'inpoint-lg' | 'outpoint-sm' | 'outpoint' | 'outpoint-lg' | 'leaf-sm' | 'leaf' | 'leaf-lg';
51
52
 
53
+ export declare interface GradientSettings {
54
+ type: GradientSettingsType;
55
+ stops: GradientSettingsStop[];
56
+ rotation?: number;
57
+ }
58
+
59
+ export declare interface GradientSettingsStop {
60
+ offset: string;
61
+ color: string;
62
+ }
63
+
64
+ export declare type GradientSettingsType = 'linear' | 'radial';
65
+
52
66
  /**
53
67
  * Image settings for the QR Code.
54
68
  */
@@ -210,7 +224,7 @@ export declare const ReactQRCode: {
210
224
  };
211
225
 
212
226
  export declare interface ReactQRCodeProps {
213
- ref?: Ref<ReactQRCodeRef>;
227
+ ref?: React.Ref<ReactQRCodeRef>;
214
228
  /**
215
229
  * The value to encode into the QR Code. An array of strings can be passed in
216
230
  * to represent multiple segments to further optimize the QR Code.
@@ -250,11 +264,14 @@ export declare interface ReactQRCodeProps {
250
264
  */
251
265
  boostLevel?: boolean;
252
266
  /**
253
- * The background color used to render the QR Code.
254
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
267
+ * The QR code background either a hex color or GradientSettings.
255
268
  * @defaultValue #FFFFFF
256
269
  */
257
- bgColor?: string;
270
+ background?: BackgroundSettings;
271
+ /**
272
+ * The gradient settings applied to the qr code data modules and finder patterns.
273
+ */
274
+ gradient?: GradientSettings;
258
275
  /**
259
276
  * The settings for the data modules.
260
277
  */