qrdx 0.0.2-beta.2 → 0.0.42

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.
Files changed (47) hide show
  1. package/dist/cli.js +4231 -0
  2. package/dist/index.js +2 -2
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +2 -2
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/src/api.d.ts.map +1 -1
  7. package/dist/src/constants.d.ts +5 -3
  8. package/dist/src/constants.d.ts.map +1 -1
  9. package/dist/src/corner-dot.d.ts.map +1 -1
  10. package/dist/src/corner-eye.d.ts +1 -1
  11. package/dist/src/corner-eye.d.ts.map +1 -1
  12. package/dist/src/detection.d.ts.map +1 -1
  13. package/dist/src/download.d.ts +1 -1
  14. package/dist/src/download.d.ts.map +1 -1
  15. package/dist/src/index.d.ts.map +1 -1
  16. package/dist/src/utils/color.d.ts +12 -0
  17. package/dist/src/utils/color.d.ts.map +1 -0
  18. package/dist/src/utils.d.ts +1 -0
  19. package/dist/src/utils.d.ts.map +1 -1
  20. package/dist/types/color.d.ts +92 -0
  21. package/dist/types/color.d.ts.map +1 -0
  22. package/dist/types/corner-dot.d.ts +9 -2
  23. package/dist/types/corner-dot.d.ts.map +1 -1
  24. package/dist/types/corner-eye.d.ts +7 -2
  25. package/dist/types/corner-eye.d.ts.map +1 -1
  26. package/dist/types/image-pattern.d.ts +4 -3
  27. package/dist/types/image-pattern.d.ts.map +1 -1
  28. package/dist/types/index.d.ts +4 -0
  29. package/dist/types/index.d.ts.map +1 -1
  30. package/dist/types/qr.d.ts +90 -12
  31. package/dist/types/qr.d.ts.map +1 -1
  32. package/package.json +22 -17
  33. package/src/api.tsx +7 -2
  34. package/src/constants.ts +5 -3
  35. package/src/corner-dot.tsx +83 -2
  36. package/src/corner-eye.ts +170 -23
  37. package/src/detection.ts +0 -3
  38. package/src/download.tsx +102 -2
  39. package/src/index.tsx +95 -29
  40. package/src/utils/color.ts +34 -0
  41. package/src/utils.tsx +557 -64
  42. package/types/color.ts +133 -0
  43. package/types/corner-dot.ts +8 -1
  44. package/types/corner-eye.ts +5 -0
  45. package/types/image-pattern.ts +2 -1
  46. package/types/index.ts +24 -5
  47. package/types/qr.ts +9 -8
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAY3C,wBAAsB,UAAU,CAAC,KAAK,EAAE,UAAU,wCAwEjD"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAa3C,wBAAsB,UAAU,CAAC,KAAK,EAAE,UAAU,wCA4EjD"}
@@ -29,9 +29,11 @@ export declare const DEFAULT_EYECOLOR = "#000000";
29
29
  */
30
30
  export declare const DEFAULT_DOTCOLOR = "#000000";
31
31
  /**
32
- * Default margin around the QR code
32
+ * Default margin around the QR code.
33
+ * The QR spec requires a minimum quiet zone of 4 modules on all sides
34
+ * for reliable scanning.
33
35
  */
34
- export declare const DEFAULT_MARGIN = 0;
36
+ export declare const DEFAULT_MARGIN = 4;
35
37
  /**
36
38
  * Available QR error correction levels
37
39
  */
@@ -46,5 +48,5 @@ export declare const DEFAULT_IMG_SCALE = 0.1;
46
48
  /**
47
49
  * Default logo URL for QR codes
48
50
  */
49
- export declare const FLAM_QR_LOGO = "https://instant.flamapp.ai/flogo-qr.svg";
51
+ export declare const FLAM_QR_LOGO = "https://qrdx.dev/logo.png";
50
52
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC;;GAEG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O,MAAM,cAAc,IAAI,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS,UAAU,EAAkC,CAAC;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,YAAY,8BAA8B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"corner-dot.d.ts","sourceRoot":"","sources":["../../src/corner-dot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,mBAA8B,GACtC,GAAG,CAAC,OAAO,CAgDb"}
1
+ {"version":3,"file":"corner-dot.d.ts","sourceRoot":"","sources":["../../src/corner-dot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,mBAA8B,GACtC,GAAG,CAAC,OAAO,CAiIb"}
@@ -7,5 +7,5 @@ import type { CornerEyePattern } from "../types/corner-eye";
7
7
  * @param pattern - Pattern type for the corner eye
8
8
  * @returns SVG path string for the pattern
9
9
  */
10
- export declare function generateCornerSquarePath(offsetX: number, offsetY: number, size: number, pattern?: CornerEyePattern): string;
10
+ export declare function generateCornerSquarePath(offsetX: number, offsetY: number, size: number, pattern: CornerEyePattern): string;
11
11
  //# sourceMappingURL=corner-eye.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"corner-eye.d.ts","sourceRoot":"","sources":["../../src/corner-eye.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAyE5D;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,gBAAyB,GACjC,MAAM,CAYR"}
1
+ {"version":3,"file":"corner-eye.d.ts","sourceRoot":"","sources":["../../src/corner-eye.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAmN5D;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,gBAAgB,GACxB,MAAM,CAqBR"}
@@ -1 +1 @@
1
- {"version":3,"file":"detection.d.ts","sourceRoot":"","sources":["../../src/detection.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,WAAW,SAAS,EACpB,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,UAAU,MAAM,SA6BjB,CAAC;AAuHF,eAAO,MAAM,eAAe,GAC1B,eAAe,gBAAgB,EAC/B,OAAO,MAAM,EACb,wBAAsB,iBA2CvB,CAAC;AAEF;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,gBAAgB,EAC5B,WAAW,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,EACvC,QAAQ,EAAE,MAAM,QAsDjB"}
1
+ {"version":3,"file":"detection.d.ts","sourceRoot":"","sources":["../../src/detection.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,WAAW,SAAS,EACpB,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,UAAU,MAAM,SA2BjB,CAAC;AAsHF,eAAO,MAAM,eAAe,GAC1B,eAAe,gBAAgB,EAC/B,OAAO,MAAM,EACb,wBAAsB,iBA2CvB,CAAC;AAEF;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,gBAAgB,EAC5B,WAAW,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,EACvC,QAAQ,EAAE,MAAM,QAsDjB"}
@@ -1,5 +1,5 @@
1
1
  import type { QRProps } from "../types";
2
- export type DownloadFormat = "png" | "jpg" | "svg";
2
+ export type DownloadFormat = "png" | "jpg" | "svg" | "pdf";
3
3
  export type DownloadSize = {
4
4
  width: number;
5
5
  height: number;
@@ -1 +1 @@
1
- {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/download.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAIxC,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAOrD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CA0BA;AAqCD;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,OAA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AsB,gBAAgB,CACpC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC,MAAM,CAAC,CA6BjB;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,OAAO,EAChB,IAAI,GAAE,YAA4D,GACjE,OAAO,CAAC,IAAI,CAAC,CA2Cf;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAGpE"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,iEAAiE;AACjE,qEAAqE;AACrE,qFAAqF;AACrF,qEAAqE;AACrE,sFAAsF;AAEtF;;;;GAIG;AACH,OAAO,EAAE,KAAK,GAAG,EAA+B,MAAM,OAAO,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAiBvD,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AAExB,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,eA6HhD;AAED,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,OAAO,mBA4CrD;AAwCD,wBAAsB,aAAa,CACjC,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,OAAO,GAClB,OAAO,CAAC,iBAAiB,GAAG,MAAM,CAAC,CAkDrC;AAED,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,iEAAiE;AACjE,qEAAqE;AACrE,qFAAqF;AACrF,qEAAqE;AACrE,sFAAsF;AAEtF;;;;GAIG;AACH,OAAO,EAAE,KAAK,GAAG,EAA+B,MAAM,OAAO,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAkBvD,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AAExB,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,eAuIhD;AAED,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,OAAO,mBA+CrD;AA6DD,wBAAsB,aAAa,CACjC,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,OAAO,GAClB,OAAO,CAAC,iBAAiB,GAAG,MAAM,CAAC,CAiFrC;AAED,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { ColorConfig } from "../../types/color";
2
+ /**
3
+ * Get solid color representation from ColorConfig
4
+ * For gradients, returns the first stop color as representative
5
+ * This is useful for cases where you need a single color value (e.g., CSS backgrounds, color displays)
6
+ *
7
+ * @param colorConfig - The color configuration (can be string, solid, linear, or radial gradient)
8
+ * @param fallback - Fallback color if colorConfig is undefined or invalid
9
+ * @returns A solid color hex string
10
+ */
11
+ export declare function getSolidColor(colorConfig: ColorConfig | undefined, fallback?: string): string;
12
+ //# sourceMappingURL=color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/utils/color.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,QAAQ,SAAY,GACnB,MAAM,CAmBR"}
@@ -2,6 +2,7 @@ import type { JSX } from "react";
2
2
  import type { Excavation, ImageSettings, Modules, QRPropsSVG } from "../types";
3
3
  export declare function excavateModules(modules: Modules, excavation: Excavation): Modules;
4
4
  export declare function generatePath(modules: Modules, margin?: number): string;
5
+ export { getSolidColor } from "./utils/color";
5
6
  export declare function getImageSettings(cells: Modules, size: number, _margin: number, imageSettings?: ImageSettings): null | {
6
7
  x: number;
7
8
  y: number;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,KAAK,EAEV,UAAU,EACV,aAAa,EACb,OAAO,EACP,UAAU,EACX,MAAM,UAAU,CAAC;AAiBlB,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,GACrB,OAAO,CAYT;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAI,GAAG,MAAM,CA0CjE;AA2LD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,GAAG;IACR,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;CAC/B,CA2BA;AAED,wBAAgB,4BAA4B,CAC1C,uBAAuB,EAAE;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,UAAU,GAAG,IAAI,CA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AAE,aAAa,GAC5B,IAAI,GAAG;IACR,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;CAC/B,CA2BA;AAED,wBAAgB,4BAA4B,CAC1C,uBAAuB,EAAE;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;CAC/B,EACD,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM;;;;;EASf;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,eAsiB1C;AAOD,eAAO,MAAM,eAAe,SAOxB,CAAC;AAGL,eAAO,MAAM,QAAQ,GACnB,KAAK,MAAM,KACV;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IASxC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,MAM9D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM,KAAG,MAejE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,OAAO,MAAM,KACZ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAmBpD,CAAC"}
@@ -0,0 +1,92 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Color type discriminator
4
+ */
5
+ export declare const colorTypeSchema: z.ZodEnum<{
6
+ solid: "solid";
7
+ linear: "linear";
8
+ radial: "radial";
9
+ }>;
10
+ export type ColorType = z.infer<typeof colorTypeSchema>;
11
+ /**
12
+ * Solid color configuration
13
+ */
14
+ export declare const solidColorSchema: z.ZodObject<{
15
+ type: z.ZodLiteral<"solid">;
16
+ color: z.ZodString;
17
+ }, z.core.$strip>;
18
+ export type SolidColor = z.infer<typeof solidColorSchema>;
19
+ /**
20
+ * Gradient stop configuration
21
+ */
22
+ export declare const gradientStopSchema: z.ZodObject<{
23
+ color: z.ZodString;
24
+ offset: z.ZodNumber;
25
+ }, z.core.$strip>;
26
+ export type GradientStop = z.infer<typeof gradientStopSchema>;
27
+ /**
28
+ * Linear gradient configuration
29
+ */
30
+ export declare const linearGradientSchema: z.ZodObject<{
31
+ type: z.ZodLiteral<"linear">;
32
+ stops: z.ZodArray<z.ZodObject<{
33
+ color: z.ZodString;
34
+ offset: z.ZodNumber;
35
+ }, z.core.$strip>>;
36
+ angle: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
37
+ }, z.core.$strip>;
38
+ export type LinearGradient = z.infer<typeof linearGradientSchema>;
39
+ /**
40
+ * Radial gradient configuration
41
+ * Note: cx, cy, r, fx, fy are calculated automatically based on QR size
42
+ * They use userSpaceOnUse units (absolute pixels)
43
+ */
44
+ export declare const radialGradientSchema: z.ZodObject<{
45
+ type: z.ZodLiteral<"radial">;
46
+ stops: z.ZodArray<z.ZodObject<{
47
+ color: z.ZodString;
48
+ offset: z.ZodNumber;
49
+ }, z.core.$strip>>;
50
+ }, z.core.$strip>;
51
+ export type RadialGradient = z.infer<typeof radialGradientSchema>;
52
+ /**
53
+ * Union type for color configuration
54
+ * Supports:
55
+ * - string: backward compatible solid color
56
+ * - SolidColor: explicit solid color object
57
+ * - LinearGradient: linear gradient with start/end colors and angle
58
+ * - RadialGradient: radial gradient with start/end colors and positioning
59
+ */
60
+ export declare const colorConfigSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
61
+ type: z.ZodLiteral<"solid">;
62
+ color: z.ZodString;
63
+ }, z.core.$strip>, z.ZodObject<{
64
+ type: z.ZodLiteral<"linear">;
65
+ stops: z.ZodArray<z.ZodObject<{
66
+ color: z.ZodString;
67
+ offset: z.ZodNumber;
68
+ }, z.core.$strip>>;
69
+ angle: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
70
+ }, z.core.$strip>, z.ZodObject<{
71
+ type: z.ZodLiteral<"radial">;
72
+ stops: z.ZodArray<z.ZodObject<{
73
+ color: z.ZodString;
74
+ offset: z.ZodNumber;
75
+ }, z.core.$strip>>;
76
+ }, z.core.$strip>]>;
77
+ export type ColorConfig = z.infer<typeof colorConfigSchema>;
78
+ /**
79
+ * Helper to normalize color config to object format
80
+ */
81
+ export declare function normalizeColorConfig(color: ColorConfig | undefined, fallback?: string): SolidColor | LinearGradient | RadialGradient;
82
+ /**
83
+ * Helper to check if color is gradient
84
+ */
85
+ export declare function isGradient(color: ColorConfig | undefined): color is LinearGradient | RadialGradient;
86
+ /**
87
+ * Helper to get a solid color string from any ColorConfig
88
+ * For gradients, returns the first stop color
89
+ */
90
+ export declare function getColorString(color: ColorConfig | undefined, fallback?: string): string;
91
+ export declare function getNormalizedColor(color: ColorConfig | string | undefined): string;
92
+ //# sourceMappingURL=color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../types/color.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,eAAe;;;;EAAwC,CAAC;AACrE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;iBAG3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;iBAI/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;iBAG/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;mBAK5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,WAAW,GAAG,SAAS,EAC9B,QAAQ,SAAY,GACnB,UAAU,GAAG,cAAc,GAAG,cAAc,CAQ9C;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,WAAW,GAAG,SAAS,GAC7B,KAAK,IAAI,cAAc,GAAG,cAAc,CAK1C;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,WAAW,GAAG,SAAS,EAC9B,QAAQ,SAAY,GACnB,MAAM,CAMR;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,GACtC,MAAM,CAwBR"}
@@ -1,10 +1,17 @@
1
1
  import { z } from "zod";
2
- export declare const CORNER_EYE_DOT_PATTERNS: readonly ["square", "rounded-square", "circle", "diamond"];
2
+ export declare const CORNER_EYE_DOT_PATTERNS: readonly ["square", "rounded", "circle", "diamond", "message", "message-reverse", "diya", "diya-reverse", "rounded-triangle", "star", "banner"];
3
3
  export declare const cornerEyeDotPatternSchema: z.ZodEnum<{
4
+ message: "message";
4
5
  square: "square";
5
- "rounded-square": "rounded-square";
6
+ rounded: "rounded";
6
7
  circle: "circle";
7
8
  diamond: "diamond";
9
+ "message-reverse": "message-reverse";
10
+ diya: "diya";
11
+ "diya-reverse": "diya-reverse";
12
+ "rounded-triangle": "rounded-triangle";
13
+ star: "star";
14
+ banner: "banner";
8
15
  }>;
9
16
  export type CornerEyeDotPattern = z.infer<typeof cornerEyeDotPatternSchema>;
10
17
  //# sourceMappingURL=corner-dot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"corner-dot.d.ts","sourceRoot":"","sources":["../../types/corner-dot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB,4DAK1B,CAAC;AAGX,eAAO,MAAM,yBAAyB;;;;;EAAkC,CAAC;AAGzE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
1
+ {"version":3,"file":"corner-dot.d.ts","sourceRoot":"","sources":["../../types/corner-dot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB,iJAY1B,CAAC;AAGX,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAAkC,CAAC;AAGzE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -1,10 +1,15 @@
1
1
  import { z } from "zod";
2
- export declare const CORNER_EYE_PATTERNS: readonly ["square", "rounded", "gear", "circle"];
2
+ export declare const CORNER_EYE_PATTERNS: readonly ["square", "rounded", "gear", "circle", "diya", "extra-rounded", "message", "pointy", "curly"];
3
3
  export declare const cornerEyePatternSchema: z.ZodEnum<{
4
+ message: "message";
4
5
  square: "square";
5
- circle: "circle";
6
6
  rounded: "rounded";
7
+ circle: "circle";
8
+ diya: "diya";
7
9
  gear: "gear";
10
+ "extra-rounded": "extra-rounded";
11
+ pointy: "pointy";
12
+ curly: "curly";
8
13
  }>;
9
14
  export type CornerEyePattern = z.infer<typeof cornerEyePatternSchema>;
10
15
  //# sourceMappingURL=corner-eye.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"corner-eye.d.ts","sourceRoot":"","sources":["../../types/corner-eye.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB,kDAKtB,CAAC;AAGX,eAAO,MAAM,sBAAsB;;;;;EAA8B,CAAC;AAGlE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
1
+ {"version":3,"file":"corner-eye.d.ts","sourceRoot":"","sources":["../../types/corner-eye.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB,yGAUtB,CAAC;AAGX,eAAO,MAAM,sBAAsB;;;;;;;;;;EAA8B,CAAC;AAGlE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -1,14 +1,15 @@
1
1
  import { z } from "zod";
2
- export declare const BODY_PATTERN: readonly ["circle", "circle-large", "square", "diamond", "circle-mixed", "pacman", "rounded", "clean-square"];
2
+ export declare const BODY_PATTERN: readonly ["circle", "circle-large", "square", "diamond", "circle-mixed", "pacman", "rounded", "small-square", "vertical-line"];
3
3
  export declare const bodyPatternSchema: z.ZodEnum<{
4
4
  square: "square";
5
+ rounded: "rounded";
5
6
  circle: "circle";
6
7
  diamond: "diamond";
7
- rounded: "rounded";
8
8
  "circle-large": "circle-large";
9
9
  "circle-mixed": "circle-mixed";
10
10
  pacman: "pacman";
11
- "clean-square": "clean-square";
11
+ "small-square": "small-square";
12
+ "vertical-line": "vertical-line";
12
13
  }>;
13
14
  export type BodyPattern = z.infer<typeof bodyPatternSchema>;
14
15
  //# sourceMappingURL=image-pattern.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"image-pattern.d.ts","sourceRoot":"","sources":["../../types/image-pattern.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,YAAY,+GASf,CAAC;AAGX,eAAO,MAAM,iBAAiB;;;;;;;;;EAAuB,CAAC;AAGtD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
1
+ {"version":3,"file":"image-pattern.d.ts","sourceRoot":"","sources":["../../types/image-pattern.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,YAAY,gIAUf,CAAC;AAGX,eAAO,MAAM,iBAAiB;;;;;;;;;;EAAuB,CAAC;AAGtD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -1,3 +1,6 @@
1
+ export { getSolidColor } from "../src/utils/color";
2
+ export type { ColorConfig, ColorType, GradientStop, LinearGradient, RadialGradient, SolidColor, } from "./color";
3
+ export { colorConfigSchema, colorTypeSchema, getColorString, getNormalizedColor, gradientStopSchema, isGradient, linearGradientSchema, normalizeColorConfig, radialGradientSchema, solidColorSchema, } from "./color";
1
4
  export type { Excavation, Modules } from "./common";
2
5
  export { excavationSchema } from "./common";
3
6
  export type { CornerEyeDotPattern } from "./corner-dot";
@@ -6,6 +9,7 @@ export type { CornerEyePattern } from "./corner-eye";
6
9
  export { CORNER_EYE_PATTERNS, cornerEyePatternSchema } from "./corner-eye";
7
10
  export type { BodyPattern } from "./image-pattern";
8
11
  export { BODY_PATTERN, bodyPatternSchema } from "./image-pattern";
12
+ export { DEFAULT_MARGIN } from "../src/constants";
9
13
  export type { ErrorLevel, ImageSettings, QRProps, QRPropsCanvas, QRPropsSVG, } from "./qr";
10
14
  export { errorLevelSchema, imageSettingsSchema, qrPropsSchema, } from "./qr";
11
15
  export type { BaseTemplateProps, TemplateConfig, TemplateDefinition, } from "./template";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EACL,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3E,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAElE,YAAY,EACV,UAAU,EACV,aAAa,EACb,OAAO,EACP,aAAa,EACb,UAAU,GACX,MAAM,MAAM,CAAC;AACd,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,GACd,MAAM,MAAM,CAAC;AAEd,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EACV,WAAW,EACX,SAAS,EACT,YAAY,EACZ,cAAc,EACd,cAAc,EACd,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EACL,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3E,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EACV,UAAU,EACV,aAAa,EACb,OAAO,EACP,aAAa,EACb,UAAU,GACX,MAAM,MAAM,CAAC;AACd,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,GACd,MAAM,MAAM,CAAC;AACd,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,YAAY,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { CSSProperties } from "react";
2
2
  import { z } from "zod";
3
+ import { type ColorConfig } from "./color";
3
4
  import { type CornerEyeDotPattern } from "./corner-dot";
4
5
  import { type CornerEyePattern } from "./corner-eye";
5
6
  import { type BodyPattern } from "./image-pattern";
@@ -27,31 +28,108 @@ export declare const qrPropsSchema: z.ZodObject<{
27
28
  Q: "Q";
28
29
  H: "H";
29
30
  }>>;
30
- bgColor: z.ZodOptional<z.ZodString>;
31
- fgColor: z.ZodOptional<z.ZodString>;
32
- eyeColor: z.ZodOptional<z.ZodString>;
33
- dotColor: z.ZodOptional<z.ZodString>;
31
+ bgColor: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
32
+ type: z.ZodLiteral<"solid">;
33
+ color: z.ZodString;
34
+ }, z.core.$strip>, z.ZodObject<{
35
+ type: z.ZodLiteral<"linear">;
36
+ stops: z.ZodArray<z.ZodObject<{
37
+ color: z.ZodString;
38
+ offset: z.ZodNumber;
39
+ }, z.core.$strip>>;
40
+ angle: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
41
+ }, z.core.$strip>, z.ZodObject<{
42
+ type: z.ZodLiteral<"radial">;
43
+ stops: z.ZodArray<z.ZodObject<{
44
+ color: z.ZodString;
45
+ offset: z.ZodNumber;
46
+ }, z.core.$strip>>;
47
+ }, z.core.$strip>]>>;
48
+ fgColor: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
49
+ type: z.ZodLiteral<"solid">;
50
+ color: z.ZodString;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ type: z.ZodLiteral<"linear">;
53
+ stops: z.ZodArray<z.ZodObject<{
54
+ color: z.ZodString;
55
+ offset: z.ZodNumber;
56
+ }, z.core.$strip>>;
57
+ angle: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
58
+ }, z.core.$strip>, z.ZodObject<{
59
+ type: z.ZodLiteral<"radial">;
60
+ stops: z.ZodArray<z.ZodObject<{
61
+ color: z.ZodString;
62
+ offset: z.ZodNumber;
63
+ }, z.core.$strip>>;
64
+ }, z.core.$strip>]>>;
65
+ eyeColor: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
66
+ type: z.ZodLiteral<"solid">;
67
+ color: z.ZodString;
68
+ }, z.core.$strip>, z.ZodObject<{
69
+ type: z.ZodLiteral<"linear">;
70
+ stops: z.ZodArray<z.ZodObject<{
71
+ color: z.ZodString;
72
+ offset: z.ZodNumber;
73
+ }, z.core.$strip>>;
74
+ angle: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
75
+ }, z.core.$strip>, z.ZodObject<{
76
+ type: z.ZodLiteral<"radial">;
77
+ stops: z.ZodArray<z.ZodObject<{
78
+ color: z.ZodString;
79
+ offset: z.ZodNumber;
80
+ }, z.core.$strip>>;
81
+ }, z.core.$strip>]>>;
82
+ dotColor: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
83
+ type: z.ZodLiteral<"solid">;
84
+ color: z.ZodString;
85
+ }, z.core.$strip>, z.ZodObject<{
86
+ type: z.ZodLiteral<"linear">;
87
+ stops: z.ZodArray<z.ZodObject<{
88
+ color: z.ZodString;
89
+ offset: z.ZodNumber;
90
+ }, z.core.$strip>>;
91
+ angle: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
92
+ }, z.core.$strip>, z.ZodObject<{
93
+ type: z.ZodLiteral<"radial">;
94
+ stops: z.ZodArray<z.ZodObject<{
95
+ color: z.ZodString;
96
+ offset: z.ZodNumber;
97
+ }, z.core.$strip>>;
98
+ }, z.core.$strip>]>>;
34
99
  bodyPattern: z.ZodOptional<z.ZodEnum<{
35
100
  square: "square";
101
+ rounded: "rounded";
36
102
  circle: "circle";
37
103
  diamond: "diamond";
38
- rounded: "rounded";
39
104
  "circle-large": "circle-large";
40
105
  "circle-mixed": "circle-mixed";
41
106
  pacman: "pacman";
42
- "clean-square": "clean-square";
107
+ "small-square": "small-square";
108
+ "vertical-line": "vertical-line";
43
109
  }>>;
44
110
  cornerEyePattern: z.ZodOptional<z.ZodEnum<{
111
+ message: "message";
45
112
  square: "square";
46
- circle: "circle";
47
113
  rounded: "rounded";
114
+ circle: "circle";
115
+ diya: "diya";
48
116
  gear: "gear";
117
+ "extra-rounded": "extra-rounded";
118
+ pointy: "pointy";
119
+ curly: "curly";
49
120
  }>>;
50
121
  cornerEyeDotPattern: z.ZodOptional<z.ZodEnum<{
122
+ message: "message";
51
123
  square: "square";
52
- "rounded-square": "rounded-square";
124
+ rounded: "rounded";
53
125
  circle: "circle";
54
126
  diamond: "diamond";
127
+ "message-reverse": "message-reverse";
128
+ diya: "diya";
129
+ "diya-reverse": "diya-reverse";
130
+ "rounded-triangle": "rounded-triangle";
131
+ star: "star";
132
+ banner: "banner";
55
133
  }>>;
56
134
  margin: z.ZodOptional<z.ZodNumber>;
57
135
  imageSettings: z.ZodOptional<z.ZodObject<{
@@ -72,10 +150,10 @@ export type QRProps = {
72
150
  value: string;
73
151
  size?: number;
74
152
  level?: ErrorLevel;
75
- bgColor?: string;
76
- fgColor?: string;
77
- eyeColor?: string;
78
- dotColor?: string;
153
+ bgColor?: ColorConfig;
154
+ fgColor?: ColorConfig;
155
+ eyeColor?: ColorConfig;
156
+ dotColor?: ColorConfig;
79
157
  bodyPattern?: BodyPattern;
80
158
  cornerEyePattern?: CornerEyePattern;
81
159
  cornerEyeDotPattern?: CornerEyeDotPattern;
@@ -1 +1 @@
1
- {"version":3,"file":"qr.d.ts","sourceRoot":"","sources":["../../types/qr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGrD,eAAO,MAAM,mBAAmB;;;;;;;iBAO9B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;EAA+B,CAAC;AAE7D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgBxB,CAAC;AAGH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,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,CAAC,EAAE,MAAM,CAAC;IAEpB,cAAc,CAAC,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAGzC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,OAAO,GACjC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAChD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qrdx",
3
- "version": "0.0.2-beta.2",
3
+ "version": "0.0.42",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/src/index.d.ts",
@@ -21,32 +21,37 @@
21
21
  "require": "./types/index.ts"
22
22
  }
23
23
  },
24
+ "bin": {
25
+ "qrdx": "./dist/cli.js"
26
+ },
24
27
  "files": [
25
28
  "dist",
26
29
  "types",
27
30
  "src"
28
31
  ],
29
- "scripts": {
30
- "preinstall": "pnpm build",
31
- "build": "tsup && tsc --project tsconfig.build.json --emitDeclarationOnly",
32
- "clean": "git clean -xdf .cache .turbo dist node_modules",
33
- "typecheck": "tsc --noEmit"
34
- },
35
32
  "dependencies": {
33
+ "jspdf": "^3.0.4",
36
34
  "jsqr": "^1.4.0",
37
- "react": "19.2.0",
38
- "zod": "^4.1.12"
35
+ "react": "19.2.3",
36
+ "sharp": "^0.34.2",
37
+ "zod": "^4.3.5"
39
38
  },
40
39
  "devDependencies": {
41
- "@repo/typescript-config": "workspace:*",
42
- "@types/node": "24.9.2",
43
- "@types/react": "19.2.2",
44
- "@types/react-dom": "19.2.2",
45
- "next": "16.0.1",
46
- "tsup": "^8.3.5",
47
- "typescript": "5.9.3"
40
+ "@types/node": "25.1.0",
41
+ "@types/react": "19.2.7",
42
+ "@types/react-dom": "19.2.3",
43
+ "next": "16.1.1",
44
+ "tsup": "^8.5.1",
45
+ "typescript": "5.9.3",
46
+ "@repo/typescript-config": "0.0.0"
48
47
  },
49
48
  "peerDependencies": {
50
49
  "react-dom": ">=18.0.0"
50
+ },
51
+ "scripts": {
52
+ "preinstall": "pnpm build",
53
+ "build": "tsup && tsc --project tsconfig.build.json --emitDeclarationOnly",
54
+ "clean": "git clean -xdf .cache .turbo dist node_modules",
55
+ "typecheck": "tsc --noEmit"
51
56
  }
52
- }
57
+ }
package/src/api.tsx CHANGED
@@ -9,6 +9,7 @@ import {
9
9
  ERROR_LEVEL_MAP,
10
10
  } from "./constants";
11
11
  import { excavateModules, generatePath, getImageSettings } from "./utils";
12
+ import { getSolidColor } from "./utils/color";
12
13
 
13
14
  export async function getQRAsSVG(props: QRPropsSVG) {
14
15
  const {
@@ -75,10 +76,14 @@ export async function getQRAsSVG(props: QRPropsSVG) {
75
76
  >
76
77
  <path
77
78
  d={`M0,0 h${numCells}v${numCells}H0z`}
78
- fill={bgColor}
79
+ fill={getSolidColor(bgColor, DEFAULT_BGCOLOR)}
80
+ shapeRendering="crispEdges"
81
+ />
82
+ <path
83
+ d={fgPath}
84
+ fill={getSolidColor(fgColor, DEFAULT_FGCOLOR)}
79
85
  shapeRendering="crispEdges"
80
86
  />
81
- <path d={fgPath} fill={fgColor} shapeRendering="crispEdges" />
82
87
  {image}
83
88
  </svg>
84
89
  );
package/src/constants.ts CHANGED
@@ -42,9 +42,11 @@ export const DEFAULT_EYECOLOR = "#000000";
42
42
  export const DEFAULT_DOTCOLOR = "#000000";
43
43
 
44
44
  /**
45
- * Default margin around the QR code
45
+ * Default margin around the QR code.
46
+ * The QR spec requires a minimum quiet zone of 4 modules on all sides
47
+ * for reliable scanning.
46
48
  */
47
- export const DEFAULT_MARGIN = 0;
49
+ export const DEFAULT_MARGIN = 4;
48
50
 
49
51
  /**
50
52
  * Available QR error correction levels
@@ -62,4 +64,4 @@ export const DEFAULT_IMG_SCALE = 0.1;
62
64
  /**
63
65
  * Default logo URL for QR codes
64
66
  */
65
- export const FLAM_QR_LOGO = "https://instant.flamapp.ai/flogo-qr.svg";
67
+ export const FLAM_QR_LOGO = "https://qrdx.dev/logo.png";