@zentauri-ui/zentauri-components 2.2.2 → 2.3.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 +10 -6
- package/cli/props.json +526 -0
- package/cli/registry.json +11 -0
- package/dist/chunk-4U6PVVST.mjs +15 -0
- package/dist/chunk-4U6PVVST.mjs.map +1 -0
- package/dist/{chunk-DIAA5VH4.mjs → chunk-CIZQQ32L.mjs} +3 -3
- package/dist/chunk-CIZQQ32L.mjs.map +1 -0
- package/dist/chunk-EZNR7VLJ.js +65 -0
- package/dist/chunk-EZNR7VLJ.js.map +1 -0
- package/dist/{chunk-PQ2XTY3M.js → chunk-G36ZV446.js} +13 -13
- package/dist/{chunk-PQ2XTY3M.js.map → chunk-G36ZV446.js.map} +1 -1
- package/dist/{chunk-H3BJOK22.js → chunk-HNAUUCR5.js} +3 -3
- package/dist/chunk-HNAUUCR5.js.map +1 -0
- package/dist/{chunk-UZ6Y5CSV.js → chunk-K7UU3K54.js} +39 -18
- package/dist/chunk-K7UU3K54.js.map +1 -0
- package/dist/chunk-MY3DQVNF.js +19 -0
- package/dist/{chunk-ILPPXWR3.js.map → chunk-MY3DQVNF.js.map} +1 -1
- package/dist/{chunk-ATE5SCTR.mjs → chunk-N6Q4ZLQR.mjs} +3 -3
- package/dist/{chunk-ATE5SCTR.mjs.map → chunk-N6Q4ZLQR.mjs.map} +1 -1
- package/dist/{chunk-GFE6ZX5Y.mjs → chunk-PJATBFEK.mjs} +30 -9
- package/dist/chunk-PJATBFEK.mjs.map +1 -0
- package/dist/chunk-PVVYOIU2.js +38 -0
- package/dist/chunk-PVVYOIU2.js.map +1 -0
- package/dist/chunk-PWEZB53R.js +90 -0
- package/dist/chunk-PWEZB53R.js.map +1 -0
- package/dist/chunk-PWYEC3KY.mjs +30 -0
- package/dist/chunk-PWYEC3KY.mjs.map +1 -0
- package/dist/{chunk-5I4GAURE.js → chunk-RBNZNWYQ.js} +6 -6
- package/dist/{chunk-5I4GAURE.js.map → chunk-RBNZNWYQ.js.map} +1 -1
- package/dist/chunk-RDYR4DHG.mjs +62 -0
- package/dist/chunk-RDYR4DHG.mjs.map +1 -0
- package/dist/chunk-RWF3NVZP.mjs +29 -0
- package/dist/chunk-RWF3NVZP.mjs.map +1 -0
- package/dist/{chunk-NUV2I337.mjs → chunk-STWXN5EM.mjs} +3 -3
- package/dist/{chunk-NUV2I337.mjs.map → chunk-STWXN5EM.mjs.map} +1 -1
- package/dist/{chunk-W5MTZJPE.mjs → chunk-TTKTPERV.mjs} +3 -3
- package/dist/{chunk-W5MTZJPE.mjs.map → chunk-TTKTPERV.mjs.map} +1 -1
- package/dist/chunk-UBQY572I.mjs +81 -0
- package/dist/chunk-UBQY572I.mjs.map +1 -0
- package/dist/{chunk-IY72Z65Z.js → chunk-UN5RRNPV.js} +12 -12
- package/dist/{chunk-IY72Z65Z.js.map → chunk-UN5RRNPV.js.map} +1 -1
- package/dist/{chunk-N2G7IWHS.mjs → chunk-VMVG2RVZ.mjs} +4 -4
- package/dist/{chunk-N2G7IWHS.mjs.map → chunk-VMVG2RVZ.mjs.map} +1 -1
- package/dist/chunk-XUK5P37Y.js +19 -0
- package/dist/chunk-XUK5P37Y.js.map +1 -0
- package/dist/chunk-YRQN3AV4.js +38 -0
- package/dist/chunk-YRQN3AV4.js.map +1 -0
- package/dist/design-system/facade.js +12 -9
- package/dist/design-system/facade.js.map +1 -1
- package/dist/design-system/facade.mjs +11 -8
- package/dist/design-system/facade.mjs.map +1 -1
- package/dist/design-system/hash-generator.d.ts +15 -0
- package/dist/design-system/hash-generator.d.ts.map +1 -0
- package/dist/design-system/index.d.ts +3 -0
- package/dist/design-system/index.d.ts.map +1 -1
- package/dist/design-system/qr-code.d.ts +4 -0
- package/dist/design-system/qr-code.d.ts.map +1 -0
- package/dist/design-system/qr-scanner.d.ts +11 -0
- package/dist/design-system/qr-scanner.d.ts.map +1 -0
- package/dist/design-system/secret-reveal.d.ts +1 -1
- package/dist/design-system/secret-reveal.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useHash/index.d.ts +2 -0
- package/dist/hooks/useHash/index.d.ts.map +1 -0
- package/dist/hooks/useHash/useHash.d.ts +20 -0
- package/dist/hooks/useHash/useHash.d.ts.map +1 -0
- package/dist/hooks/useHash.js +18 -0
- package/dist/hooks/useHash.js.map +1 -0
- package/dist/hooks/useHash.mjs +5 -0
- package/dist/hooks/useHash.mjs.map +1 -0
- package/dist/ui/buttons/animated.js +14 -11
- package/dist/ui/buttons/animated.js.map +1 -1
- package/dist/ui/buttons/animated.mjs +12 -9
- package/dist/ui/buttons/animated.mjs.map +1 -1
- package/dist/ui/buttons.js +15 -12
- package/dist/ui/buttons.mjs +13 -10
- package/dist/ui/data-table.js +24 -21
- package/dist/ui/data-table.js.map +1 -1
- package/dist/ui/data-table.mjs +14 -11
- package/dist/ui/data-table.mjs.map +1 -1
- package/dist/ui/dynamic-stepper.js +24 -21
- package/dist/ui/dynamic-stepper.js.map +1 -1
- package/dist/ui/dynamic-stepper.mjs +13 -10
- package/dist/ui/dynamic-stepper.mjs.map +1 -1
- package/dist/ui/hash-generator/hash-generator-base.d.ts +6 -0
- package/dist/ui/hash-generator/hash-generator-base.d.ts.map +1 -0
- package/dist/ui/hash-generator/hash-generator.d.ts +2 -0
- package/dist/ui/hash-generator/hash-generator.d.ts.map +1 -0
- package/dist/ui/hash-generator/index.d.ts +5 -0
- package/dist/ui/hash-generator/index.d.ts.map +1 -0
- package/dist/ui/hash-generator/types.d.ts +17 -0
- package/dist/ui/hash-generator/types.d.ts.map +1 -0
- package/dist/ui/hash-generator/variants.d.ts +10 -0
- package/dist/ui/hash-generator/variants.d.ts.map +1 -0
- package/dist/ui/hash-generator.js +126 -0
- package/dist/ui/hash-generator.js.map +1 -0
- package/dist/ui/hash-generator.mjs +117 -0
- package/dist/ui/hash-generator.mjs.map +1 -0
- package/dist/ui/pagination.js +16 -13
- package/dist/ui/pagination.mjs +13 -10
- package/dist/ui/qr-code/animated/animations.d.ts +8 -0
- package/dist/ui/qr-code/animated/animations.d.ts.map +1 -0
- package/dist/ui/qr-code/animated/index.d.ts +4 -0
- package/dist/ui/qr-code/animated/index.d.ts.map +1 -0
- package/dist/ui/qr-code/animated/qr-code-animated.d.ts +6 -0
- package/dist/ui/qr-code/animated/qr-code-animated.d.ts.map +1 -0
- package/dist/ui/qr-code/animated/types.d.ts +9 -0
- package/dist/ui/qr-code/animated/types.d.ts.map +1 -0
- package/dist/ui/qr-code/animated.js +156 -0
- package/dist/ui/qr-code/animated.js.map +1 -0
- package/dist/ui/qr-code/animated.mjs +149 -0
- package/dist/ui/qr-code/animated.mjs.map +1 -0
- package/dist/ui/qr-code/index.d.ts +5 -0
- package/dist/ui/qr-code/index.d.ts.map +1 -0
- package/dist/ui/qr-code/qr-code-base.d.ts +47 -0
- package/dist/ui/qr-code/qr-code-base.d.ts.map +1 -0
- package/dist/ui/qr-code/qr-code.d.ts +2 -0
- package/dist/ui/qr-code/qr-code.d.ts.map +1 -0
- package/dist/ui/qr-code/types.d.ts +14 -0
- package/dist/ui/qr-code/types.d.ts.map +1 -0
- package/dist/ui/qr-code/variants.d.ts +4 -0
- package/dist/ui/qr-code/variants.d.ts.map +1 -0
- package/dist/ui/qr-code.js +35 -0
- package/dist/ui/qr-code.js.map +1 -0
- package/dist/ui/qr-code.mjs +17 -0
- package/dist/ui/qr-code.mjs.map +1 -0
- package/dist/ui/qr-scanner/index.d.ts +4 -0
- package/dist/ui/qr-scanner/index.d.ts.map +1 -0
- package/dist/ui/qr-scanner/qr-scanner-base.d.ts +62 -0
- package/dist/ui/qr-scanner/qr-scanner-base.d.ts.map +1 -0
- package/dist/ui/qr-scanner/qr-scanner.d.ts +2 -0
- package/dist/ui/qr-scanner/qr-scanner.d.ts.map +1 -0
- package/dist/ui/qr-scanner/types.d.ts +28 -0
- package/dist/ui/qr-scanner/types.d.ts.map +1 -0
- package/dist/ui/qr-scanner/variants.d.ts +9 -0
- package/dist/ui/qr-scanner/variants.d.ts.map +1 -0
- package/dist/ui/qr-scanner.js +316 -0
- package/dist/ui/qr-scanner.js.map +1 -0
- package/dist/ui/qr-scanner.mjs +308 -0
- package/dist/ui/qr-scanner.mjs.map +1 -0
- package/dist/ui/secret-reveal/animated/secret-reveal-animated.d.ts.map +1 -1
- package/dist/ui/secret-reveal/animated.js +10 -7
- package/dist/ui/secret-reveal/animated.js.map +1 -1
- package/dist/ui/secret-reveal/animated.mjs +6 -3
- package/dist/ui/secret-reveal/animated.mjs.map +1 -1
- package/dist/ui/secret-reveal/secret-reveal-base.d.ts.map +1 -1
- package/dist/ui/secret-reveal.js +14 -11
- package/dist/ui/secret-reveal.js.map +1 -1
- package/dist/ui/secret-reveal.mjs +7 -4
- package/dist/ui/secret-reveal.mjs.map +1 -1
- package/dist/ui/split-button.js +26 -23
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/split-button.mjs +13 -10
- package/dist/ui/split-button.mjs.map +1 -1
- package/package.json +5 -2
- package/src/design-system/hash-generator.ts +34 -0
- package/src/design-system/index.ts +3 -0
- package/src/design-system/qr-code.ts +13 -0
- package/src/design-system/qr-scanner.ts +32 -0
- package/src/design-system/secret-reveal.ts +1 -1
- package/src/hooks/index.ts +6 -0
- package/src/hooks/useHash/index.ts +6 -0
- package/src/hooks/useHash/useHash.test.ts +77 -0
- package/src/hooks/useHash/useHash.ts +89 -0
- package/src/ui/hash-generator/hash-generator-base.tsx +106 -0
- package/src/ui/hash-generator/hash-generator.test.tsx +73 -0
- package/src/ui/hash-generator/hash-generator.tsx +1 -0
- package/src/ui/hash-generator/index.ts +18 -0
- package/src/ui/hash-generator/types.ts +29 -0
- package/src/ui/hash-generator/variants.ts +31 -0
- package/src/ui/qr-code/animated/animations.ts +51 -0
- package/src/ui/qr-code/animated/index.ts +5 -0
- package/src/ui/qr-code/animated/qr-code-animated.tsx +111 -0
- package/src/ui/qr-code/animated/types.ts +10 -0
- package/src/ui/qr-code/index.ts +10 -0
- package/src/ui/qr-code/qr-code-base.tsx +149 -0
- package/src/ui/qr-code/qr-code.test.tsx +58 -0
- package/src/ui/qr-code/qr-code.tsx +2 -0
- package/src/ui/qr-code/types.ts +22 -0
- package/src/ui/qr-code/variants.ts +11 -0
- package/src/ui/qr-scanner/index.ts +17 -0
- package/src/ui/qr-scanner/qr-scanner-base.tsx +568 -0
- package/src/ui/qr-scanner/qr-scanner.test.tsx +61 -0
- package/src/ui/qr-scanner/qr-scanner.tsx +2 -0
- package/src/ui/qr-scanner/types.ts +32 -0
- package/src/ui/qr-scanner/variants.ts +26 -0
- package/src/ui/secret-reveal/animated/secret-reveal-animated.tsx +4 -1
- package/src/ui/secret-reveal/secret-reveal-base.tsx +4 -1
- package/dist/chunk-DIAA5VH4.mjs.map +0 -1
- package/dist/chunk-GFE6ZX5Y.mjs.map +0 -1
- package/dist/chunk-H3BJOK22.js.map +0 -1
- package/dist/chunk-ILPPXWR3.js +0 -19
- package/dist/chunk-UZ6Y5CSV.js.map +0 -1
package/dist/ui/pagination.mjs
CHANGED
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { Pagination, paginationEllipsisVariants, paginationListVariants } from '../chunk-
|
|
2
|
+
export { Pagination, paginationEllipsisVariants, paginationListVariants } from '../chunk-VMVG2RVZ.mjs';
|
|
3
3
|
export { usePagination } from '../chunk-YNBJAFI2.mjs';
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-STWXN5EM.mjs';
|
|
5
|
+
import '../chunk-PJATBFEK.mjs';
|
|
6
6
|
import '../chunk-2NQKFH26.mjs';
|
|
7
|
+
import '../chunk-ZBAKTM2R.mjs';
|
|
8
|
+
import '../chunk-4ZBMDWWY.mjs';
|
|
9
|
+
import '../chunk-YH6MOKHR.mjs';
|
|
7
10
|
import '../chunk-T4ZLTKV2.mjs';
|
|
8
11
|
import '../chunk-EMZC6ICD.mjs';
|
|
9
12
|
import '../chunk-PUSCPBT2.mjs';
|
|
13
|
+
import '../chunk-CIZQQ32L.mjs';
|
|
14
|
+
import '../chunk-LRYKMXKI.mjs';
|
|
15
|
+
import '../chunk-XFJIX2YP.mjs';
|
|
10
16
|
import '../chunk-4WG3VNVL.mjs';
|
|
11
17
|
import '../chunk-YPTHTFVF.mjs';
|
|
12
18
|
import '../chunk-XY3TKIIH.mjs';
|
|
13
19
|
import '../chunk-FX5KR2GP.mjs';
|
|
14
|
-
import '../chunk-
|
|
15
|
-
import '../chunk-4ZBMDWWY.mjs';
|
|
16
|
-
import '../chunk-YH6MOKHR.mjs';
|
|
20
|
+
import '../chunk-3IE4IELX.mjs';
|
|
17
21
|
import '../chunk-BUEI4RMR.mjs';
|
|
22
|
+
import '../chunk-4U6PVVST.mjs';
|
|
23
|
+
import '../chunk-PWYEC3KY.mjs';
|
|
18
24
|
import '../chunk-5AOVTY2X.mjs';
|
|
19
25
|
import '../chunk-523VQLCW.mjs';
|
|
20
26
|
import '../chunk-3VW4HMJT.mjs';
|
|
21
|
-
import '../chunk-
|
|
22
|
-
import '../chunk-LRYKMXKI.mjs';
|
|
23
|
-
import '../chunk-XFJIX2YP.mjs';
|
|
27
|
+
import '../chunk-RWF3NVZP.mjs';
|
|
24
28
|
import '../chunk-34LHS26H.mjs';
|
|
25
29
|
import '../chunk-JEDMUBYI.mjs';
|
|
26
30
|
import '../chunk-EJ3UMMCS.mjs';
|
|
27
31
|
import '../chunk-EE53BIXR.mjs';
|
|
28
32
|
import '../chunk-YXU2MJMT.mjs';
|
|
29
33
|
import '../chunk-LOEKM3FL.mjs';
|
|
30
|
-
import '../chunk-3IE4IELX.mjs';
|
|
31
34
|
import '../chunk-U64ISRUX.mjs';
|
|
32
35
|
import '../chunk-SS3T3BUL.mjs';
|
|
33
36
|
import '../chunk-SCWQSQBJ.mjs';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Transition, Variants } from "framer-motion";
|
|
2
|
+
export type QrCodeAnimation = "none" | "fade-in" | "zoom-in" | "slide-up" | "rotate-in";
|
|
3
|
+
export type QrCodeAnimationPresets = Record<QrCodeAnimation, {
|
|
4
|
+
transition: Transition;
|
|
5
|
+
variants: Variants;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const qrCodeAnimationPresets: QrCodeAnimationPresets;
|
|
8
|
+
//# sourceMappingURL=animations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animations.d.ts","sourceRoot":"","sources":["../../../../src/ui/qr-code/animated/animations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,SAAS,GACT,SAAS,GACT,UAAU,GACV,WAAW,CAAC;AAEhB,MAAM,MAAM,sBAAsB,GAAG,MAAM,CACzC,eAAe,EACf;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE,CAC/C,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,sBAoCpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/qr-code/animated/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { QrCodeAnimatedProps } from "./types";
|
|
2
|
+
export declare function QrCodeAnimated({ animation, value, canvasSize, level, bgColor, fgColor, margin, caption, className, ...props }: QrCodeAnimatedProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare namespace QrCodeAnimated {
|
|
4
|
+
var displayName: string;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=qr-code-animated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qr-code-animated.d.ts","sourceRoot":"","sources":["../../../../src/ui/qr-code/animated/qr-code-animated.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD,wBAAgB,cAAc,CAAC,EAC7B,SAAkB,EAClB,KAAK,EACL,UAAgB,EAChB,KAAW,EACX,OAAmB,EACnB,OAAmB,EACnB,MAAU,EACV,OAAO,EACP,SAAS,EACT,GAAG,KAAK,EACT,EAAE,mBAAmB,2CAsFrB;yBAjGe,cAAc"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Ref } from "react";
|
|
2
|
+
import type { QrCodeBaseProps } from "../types";
|
|
3
|
+
import type { QrCodeAnimation } from "./animations";
|
|
4
|
+
export type { QrCodeAnimation };
|
|
5
|
+
export type QrCodeAnimatedProps = QrCodeBaseProps & {
|
|
6
|
+
animation?: QrCodeAnimation;
|
|
7
|
+
ref?: Ref<HTMLDivElement>;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ui/qr-code/animated/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG;IAClD,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B,CAAC"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var chunkPWEZB53R_js = require('../../chunk-PWEZB53R.js');
|
|
5
|
+
require('../../chunk-XUK5P37Y.js');
|
|
6
|
+
var chunkZS5756ZC_js = require('../../chunk-ZS5756ZC.js');
|
|
7
|
+
require('../../chunk-PZ5AY32C.js');
|
|
8
|
+
var react = require('react');
|
|
9
|
+
var framerMotion = require('framer-motion');
|
|
10
|
+
var QRCode = require('qrcode');
|
|
11
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
12
|
+
|
|
13
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
|
|
15
|
+
var QRCode__default = /*#__PURE__*/_interopDefault(QRCode);
|
|
16
|
+
|
|
17
|
+
// src/ui/qr-code/animated/animations.ts
|
|
18
|
+
var qrCodeAnimationPresets = {
|
|
19
|
+
none: {
|
|
20
|
+
transition: { duration: 0 },
|
|
21
|
+
variants: {
|
|
22
|
+
initial: { opacity: 1 },
|
|
23
|
+
animate: { opacity: 1 }
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"fade-in": {
|
|
27
|
+
transition: { duration: 0.3, ease: "easeOut" },
|
|
28
|
+
variants: {
|
|
29
|
+
initial: { opacity: 0 },
|
|
30
|
+
animate: { opacity: 1 }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"zoom-in": {
|
|
34
|
+
transition: { type: "spring", stiffness: 300, damping: 24 },
|
|
35
|
+
variants: {
|
|
36
|
+
initial: { opacity: 0, scale: 0.85 },
|
|
37
|
+
animate: { opacity: 1, scale: 1 }
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"slide-up": {
|
|
41
|
+
transition: { type: "spring", stiffness: 280, damping: 22 },
|
|
42
|
+
variants: {
|
|
43
|
+
initial: { opacity: 0, y: 20 },
|
|
44
|
+
animate: { opacity: 1, y: 0 }
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"rotate-in": {
|
|
48
|
+
transition: { type: "spring", stiffness: 200, damping: 18 },
|
|
49
|
+
variants: {
|
|
50
|
+
initial: { opacity: 0, rotate: -90, scale: 0.8 },
|
|
51
|
+
animate: { opacity: 1, rotate: 0, scale: 1 }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
function QrCodeAnimated({
|
|
56
|
+
animation = "none",
|
|
57
|
+
value,
|
|
58
|
+
canvasSize = 200,
|
|
59
|
+
level = "M",
|
|
60
|
+
bgColor = "#ffffff",
|
|
61
|
+
fgColor = "#000000",
|
|
62
|
+
margin = 2,
|
|
63
|
+
caption,
|
|
64
|
+
className,
|
|
65
|
+
...props
|
|
66
|
+
}) {
|
|
67
|
+
const canvasRef = react.useRef(null);
|
|
68
|
+
react.useEffect(() => {
|
|
69
|
+
const canvas = canvasRef.current;
|
|
70
|
+
if (!canvas || animation === "none") return;
|
|
71
|
+
if (!value) {
|
|
72
|
+
const ctx = canvas.getContext("2d");
|
|
73
|
+
if (ctx) {
|
|
74
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
75
|
+
}
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
QRCode__default.default.toCanvas(
|
|
79
|
+
canvas,
|
|
80
|
+
value,
|
|
81
|
+
{
|
|
82
|
+
width: canvasSize,
|
|
83
|
+
margin,
|
|
84
|
+
color: {
|
|
85
|
+
dark: fgColor,
|
|
86
|
+
light: bgColor
|
|
87
|
+
},
|
|
88
|
+
errorCorrectionLevel: level
|
|
89
|
+
},
|
|
90
|
+
(error) => {
|
|
91
|
+
if (error) {
|
|
92
|
+
console.error("QR Code generation error:", error);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}, [value, canvasSize, level, bgColor, fgColor, margin, animation]);
|
|
97
|
+
if (animation === "none") {
|
|
98
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
99
|
+
chunkPWEZB53R_js.QrCodeBase,
|
|
100
|
+
{
|
|
101
|
+
value,
|
|
102
|
+
canvasSize,
|
|
103
|
+
level,
|
|
104
|
+
bgColor,
|
|
105
|
+
fgColor,
|
|
106
|
+
margin,
|
|
107
|
+
caption,
|
|
108
|
+
className,
|
|
109
|
+
...props
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
const preset = qrCodeAnimationPresets[animation];
|
|
114
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
115
|
+
framerMotion.motion.div,
|
|
116
|
+
{
|
|
117
|
+
"data-slot": "qr-code",
|
|
118
|
+
className: chunkZS5756ZC_js.cn(
|
|
119
|
+
"inline-flex flex-col items-center gap-3 rounded-2xl border p-6 border-[color:var(--zui-qr-code-border,var(--zui-border,#0000001a))] dark:border-[color:var(--zui-qr-code-border-dark,var(--zui-border-dark,#ffffff1a))] bg-[var(--zui-qr-code-bg,var(--zui-surface,oklch(98.4%_0.003_247.858)))] dark:bg-[var(--zui-qr-code-bg-dark,var(--zui-surface-dark,oklch(12.9%_0.042_264.695)))]",
|
|
120
|
+
className
|
|
121
|
+
),
|
|
122
|
+
variants: preset.variants,
|
|
123
|
+
initial: "initial",
|
|
124
|
+
animate: "animate",
|
|
125
|
+
transition: preset.transition,
|
|
126
|
+
...props,
|
|
127
|
+
children: [
|
|
128
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden rounded-xl bg-[var(--zui-qr-code-canvas-bg,var(--zui-surface-muted,oklch(92.9%_0.013_255.508)))] dark:bg-[var(--zui-qr-code-canvas-bg-dark,var(--zui-surface-muted-dark,oklch(27.9%_0.041_260.031)))]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
129
|
+
"canvas",
|
|
130
|
+
{
|
|
131
|
+
ref: canvasRef,
|
|
132
|
+
width: canvasSize,
|
|
133
|
+
height: canvasSize,
|
|
134
|
+
"data-slot": "qr-code-canvas",
|
|
135
|
+
className: "block h-auto max-w-full",
|
|
136
|
+
"aria-label": `QR code for ${value}`
|
|
137
|
+
}
|
|
138
|
+
) }),
|
|
139
|
+
caption ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
140
|
+
"span",
|
|
141
|
+
{
|
|
142
|
+
"data-slot": "qr-code-caption",
|
|
143
|
+
className: "text-xs text-center text-[color:var(--zui-qr-code-caption-fg,var(--zui-fg-muted,oklch(55.2%_0.046_257.417)))] dark:text-[color:var(--zui-qr-code-caption-fg-dark,var(--zui-fg-muted-dark,oklch(70.8%_0.015_256.243)))] max-w-full truncate px-2",
|
|
144
|
+
children: caption
|
|
145
|
+
}
|
|
146
|
+
) : null
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
QrCodeAnimated.displayName = "QrCodeAnimated";
|
|
152
|
+
|
|
153
|
+
exports.QrCodeAnimated = QrCodeAnimated;
|
|
154
|
+
exports.qrCodeAnimationPresets = qrCodeAnimationPresets;
|
|
155
|
+
//# sourceMappingURL=animated.js.map
|
|
156
|
+
//# sourceMappingURL=animated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/qr-code/animated/animations.ts","../../../src/ui/qr-code/animated/qr-code-animated.tsx"],"names":["useRef","useEffect","QRCode","jsx","QrCodeBase","jsxs","motion","cn"],"mappings":";;;;;;;;;;;;;;;;AAcO,IAAM,sBAAA,GAAiD;AAAA,EAC5D,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY,EAAE,QAAA,EAAU,CAAA,EAAE;AAAA,IAC1B,QAAA,EAAU;AAAA,MACR,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,MACtB,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA;AAAE;AACxB,GACF;AAAA,EACA,SAAA,EAAW;AAAA,IACT,UAAA,EAAY,EAAE,QAAA,EAAU,GAAA,EAAK,MAAM,SAAA,EAAU;AAAA,IAC7C,QAAA,EAAU;AAAA,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,SAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA,EAEJ;AAEA,EAAA,MAAM,MAAA,GAAS,uBAAuB,SAAS,CAAA;AAE/C,EAAA,uBACEC,eAAA;AAAA,IAACC,mBAAA,CAAO,GAAA;AAAA,IAAP;AAAA,MACC,WAAA,EAAU,SAAA;AAAA,MACV,SAAA,EAAWC,mBAAA;AAAA,QACT,0XAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,UAAU,MAAA,CAAO,QAAA;AAAA,MACjB,OAAA,EAAQ,SAAA;AAAA,MACR,OAAA,EAAQ,SAAA;AAAA,MACR,YAAY,MAAA,CAAO,UAAA;AAAA,MAClB,GAAI,KAAA;AAAA,MAEL,QAAA,EAAA;AAAA,wBAAAJ,cAAA,CAAC,KAAA,EAAA,EAAI,WAAU,uNAAA,EACb,QAAA,kBAAAA,cAAA;AAAA,UAAC,QAAA;AAAA,UAAA;AAAA,YACC,GAAA,EAAK,SAAA;AAAA,YACL,KAAA,EAAO,UAAA;AAAA,YACP,MAAA,EAAQ,UAAA;AAAA,YACR,WAAA,EAAU,gBAAA;AAAA,YACV,SAAA,EAAU,yBAAA;AAAA,YACV,YAAA,EAAY,eAAe,KAAK,CAAA;AAAA;AAAA,SAClC,EACF,CAAA;AAAA,QACC,OAAA,mBACCA,cAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,WAAA,EAAU,iBAAA;AAAA,YACV,SAAA,EAAU,iPAAA;AAAA,YAET,QAAA,EAAA;AAAA;AAAA,SACH,GACE;AAAA;AAAA;AAAA,GACN;AAEJ;AAEA,cAAA,CAAe,WAAA,GAAc,gBAAA","file":"animated.js","sourcesContent":["import type { Transition, Variants } from \"framer-motion\";\n\nexport type QrCodeAnimation =\n | \"none\"\n | \"fade-in\"\n | \"zoom-in\"\n | \"slide-up\"\n | \"rotate-in\";\n\nexport type QrCodeAnimationPresets = Record<\n QrCodeAnimation,\n { transition: Transition; variants: Variants }\n>;\n\nexport const qrCodeAnimationPresets: QrCodeAnimationPresets = {\n none: {\n transition: { duration: 0 },\n variants: {\n initial: { opacity: 1 },\n animate: { opacity: 1 },\n },\n },\n \"fade-in\": {\n transition: { duration: 0.3, ease: \"easeOut\" },\n variants: {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n },\n },\n \"zoom-in\": {\n transition: { type: \"spring\", stiffness: 300, damping: 24 },\n variants: {\n initial: { opacity: 0, scale: 0.85 },\n animate: { opacity: 1, scale: 1 },\n },\n },\n \"slide-up\": {\n transition: { type: \"spring\", stiffness: 280, damping: 22 },\n variants: {\n initial: { opacity: 0, y: 20 },\n animate: { opacity: 1, y: 0 },\n },\n },\n \"rotate-in\": {\n transition: { type: \"spring\", stiffness: 200, damping: 18 },\n variants: {\n initial: { opacity: 0, rotate: -90, scale: 0.8 },\n animate: { opacity: 1, rotate: 0, scale: 1 },\n },\n },\n};\n","\"use client\";\n\nimport { useEffect, useRef } from \"react\";\nimport { motion } from \"framer-motion\";\nimport QRCode from \"qrcode\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { qrCodeAnimationPresets } from \"./animations\";\nimport type { QrCodeAnimatedProps } from \"./types\";\nimport { QrCodeBase } from \"../qr-code-base\";\n\nexport function QrCodeAnimated({\n animation = \"none\",\n value,\n canvasSize = 200,\n level = \"M\",\n bgColor = \"#ffffff\",\n fgColor = \"#000000\",\n margin = 2,\n caption,\n className,\n ...props\n}: QrCodeAnimatedProps) {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n\n useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas || animation === \"none\") return;\n\n if (!value) {\n const ctx = canvas.getContext(\"2d\");\n if (ctx) {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n }\n return;\n }\n\n QRCode.toCanvas(\n canvas,\n value,\n {\n width: canvasSize,\n margin,\n color: {\n dark: fgColor,\n light: bgColor,\n },\n errorCorrectionLevel: level,\n },\n (error) => {\n if (error) {\n console.error(\"QR Code generation error:\", error);\n }\n },\n );\n }, [value, canvasSize, level, bgColor, fgColor, margin, animation]);\n\n if (animation === \"none\") {\n return (\n <QrCodeBase\n value={value}\n canvasSize={canvasSize}\n level={level}\n bgColor={bgColor}\n fgColor={fgColor}\n margin={margin}\n caption={caption}\n className={className}\n {...props}\n />\n );\n }\n\n const preset = qrCodeAnimationPresets[animation];\n\n return (\n <motion.div\n data-slot=\"qr-code\"\n className={cn(\n \"inline-flex flex-col items-center gap-3 rounded-2xl border p-6 border-[color:var(--zui-qr-code-border,var(--zui-border,#0000001a))] dark:border-[color:var(--zui-qr-code-border-dark,var(--zui-border-dark,#ffffff1a))] bg-[var(--zui-qr-code-bg,var(--zui-surface,oklch(98.4%_0.003_247.858)))] dark:bg-[var(--zui-qr-code-bg-dark,var(--zui-surface-dark,oklch(12.9%_0.042_264.695)))]\",\n className,\n )}\n variants={preset.variants}\n initial=\"initial\"\n animate=\"animate\"\n transition={preset.transition}\n {...(props as Record<string, unknown>)}\n >\n <div className=\"overflow-hidden rounded-xl bg-[var(--zui-qr-code-canvas-bg,var(--zui-surface-muted,oklch(92.9%_0.013_255.508)))] dark:bg-[var(--zui-qr-code-canvas-bg-dark,var(--zui-surface-muted-dark,oklch(27.9%_0.041_260.031)))]\">\n <canvas\n ref={canvasRef}\n width={canvasSize}\n height={canvasSize}\n data-slot=\"qr-code-canvas\"\n className=\"block h-auto max-w-full\"\n aria-label={`QR code for ${value}`}\n />\n </div>\n {caption ? (\n <span\n data-slot=\"qr-code-caption\"\n className=\"text-xs text-center text-[color:var(--zui-qr-code-caption-fg,var(--zui-fg-muted,oklch(55.2%_0.046_257.417)))] dark:text-[color:var(--zui-qr-code-caption-fg-dark,var(--zui-fg-muted-dark,oklch(70.8%_0.015_256.243)))] max-w-full truncate px-2\"\n >\n {caption}\n </span>\n ) : null}\n </motion.div>\n );\n}\n\nQrCodeAnimated.displayName = \"QrCodeAnimated\";\n"]}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { QrCodeBase } from '../../chunk-UBQY572I.mjs';
|
|
3
|
+
import '../../chunk-4U6PVVST.mjs';
|
|
4
|
+
import { cn } from '../../chunk-4D54YOL6.mjs';
|
|
5
|
+
import '../../chunk-J5LGTIGS.mjs';
|
|
6
|
+
import { useRef, useEffect } from 'react';
|
|
7
|
+
import { motion } from 'framer-motion';
|
|
8
|
+
import QRCode from 'qrcode';
|
|
9
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
// src/ui/qr-code/animated/animations.ts
|
|
12
|
+
var qrCodeAnimationPresets = {
|
|
13
|
+
none: {
|
|
14
|
+
transition: { duration: 0 },
|
|
15
|
+
variants: {
|
|
16
|
+
initial: { opacity: 1 },
|
|
17
|
+
animate: { opacity: 1 }
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"fade-in": {
|
|
21
|
+
transition: { duration: 0.3, ease: "easeOut" },
|
|
22
|
+
variants: {
|
|
23
|
+
initial: { opacity: 0 },
|
|
24
|
+
animate: { opacity: 1 }
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"zoom-in": {
|
|
28
|
+
transition: { type: "spring", stiffness: 300, damping: 24 },
|
|
29
|
+
variants: {
|
|
30
|
+
initial: { opacity: 0, scale: 0.85 },
|
|
31
|
+
animate: { opacity: 1, scale: 1 }
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"slide-up": {
|
|
35
|
+
transition: { type: "spring", stiffness: 280, damping: 22 },
|
|
36
|
+
variants: {
|
|
37
|
+
initial: { opacity: 0, y: 20 },
|
|
38
|
+
animate: { opacity: 1, y: 0 }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"rotate-in": {
|
|
42
|
+
transition: { type: "spring", stiffness: 200, damping: 18 },
|
|
43
|
+
variants: {
|
|
44
|
+
initial: { opacity: 0, rotate: -90, scale: 0.8 },
|
|
45
|
+
animate: { opacity: 1, rotate: 0, scale: 1 }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
function QrCodeAnimated({
|
|
50
|
+
animation = "none",
|
|
51
|
+
value,
|
|
52
|
+
canvasSize = 200,
|
|
53
|
+
level = "M",
|
|
54
|
+
bgColor = "#ffffff",
|
|
55
|
+
fgColor = "#000000",
|
|
56
|
+
margin = 2,
|
|
57
|
+
caption,
|
|
58
|
+
className,
|
|
59
|
+
...props
|
|
60
|
+
}) {
|
|
61
|
+
const canvasRef = useRef(null);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
const canvas = canvasRef.current;
|
|
64
|
+
if (!canvas || animation === "none") return;
|
|
65
|
+
if (!value) {
|
|
66
|
+
const ctx = canvas.getContext("2d");
|
|
67
|
+
if (ctx) {
|
|
68
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
69
|
+
}
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
QRCode.toCanvas(
|
|
73
|
+
canvas,
|
|
74
|
+
value,
|
|
75
|
+
{
|
|
76
|
+
width: canvasSize,
|
|
77
|
+
margin,
|
|
78
|
+
color: {
|
|
79
|
+
dark: fgColor,
|
|
80
|
+
light: bgColor
|
|
81
|
+
},
|
|
82
|
+
errorCorrectionLevel: level
|
|
83
|
+
},
|
|
84
|
+
(error) => {
|
|
85
|
+
if (error) {
|
|
86
|
+
console.error("QR Code generation error:", error);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}, [value, canvasSize, level, bgColor, fgColor, margin, animation]);
|
|
91
|
+
if (animation === "none") {
|
|
92
|
+
return /* @__PURE__ */ jsx(
|
|
93
|
+
QrCodeBase,
|
|
94
|
+
{
|
|
95
|
+
value,
|
|
96
|
+
canvasSize,
|
|
97
|
+
level,
|
|
98
|
+
bgColor,
|
|
99
|
+
fgColor,
|
|
100
|
+
margin,
|
|
101
|
+
caption,
|
|
102
|
+
className,
|
|
103
|
+
...props
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
const preset = qrCodeAnimationPresets[animation];
|
|
108
|
+
return /* @__PURE__ */ jsxs(
|
|
109
|
+
motion.div,
|
|
110
|
+
{
|
|
111
|
+
"data-slot": "qr-code",
|
|
112
|
+
className: cn(
|
|
113
|
+
"inline-flex flex-col items-center gap-3 rounded-2xl border p-6 border-[color:var(--zui-qr-code-border,var(--zui-border,#0000001a))] dark:border-[color:var(--zui-qr-code-border-dark,var(--zui-border-dark,#ffffff1a))] bg-[var(--zui-qr-code-bg,var(--zui-surface,oklch(98.4%_0.003_247.858)))] dark:bg-[var(--zui-qr-code-bg-dark,var(--zui-surface-dark,oklch(12.9%_0.042_264.695)))]",
|
|
114
|
+
className
|
|
115
|
+
),
|
|
116
|
+
variants: preset.variants,
|
|
117
|
+
initial: "initial",
|
|
118
|
+
animate: "animate",
|
|
119
|
+
transition: preset.transition,
|
|
120
|
+
...props,
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-xl bg-[var(--zui-qr-code-canvas-bg,var(--zui-surface-muted,oklch(92.9%_0.013_255.508)))] dark:bg-[var(--zui-qr-code-canvas-bg-dark,var(--zui-surface-muted-dark,oklch(27.9%_0.041_260.031)))]", children: /* @__PURE__ */ jsx(
|
|
123
|
+
"canvas",
|
|
124
|
+
{
|
|
125
|
+
ref: canvasRef,
|
|
126
|
+
width: canvasSize,
|
|
127
|
+
height: canvasSize,
|
|
128
|
+
"data-slot": "qr-code-canvas",
|
|
129
|
+
className: "block h-auto max-w-full",
|
|
130
|
+
"aria-label": `QR code for ${value}`
|
|
131
|
+
}
|
|
132
|
+
) }),
|
|
133
|
+
caption ? /* @__PURE__ */ jsx(
|
|
134
|
+
"span",
|
|
135
|
+
{
|
|
136
|
+
"data-slot": "qr-code-caption",
|
|
137
|
+
className: "text-xs text-center text-[color:var(--zui-qr-code-caption-fg,var(--zui-fg-muted,oklch(55.2%_0.046_257.417)))] dark:text-[color:var(--zui-qr-code-caption-fg-dark,var(--zui-fg-muted-dark,oklch(70.8%_0.015_256.243)))] max-w-full truncate px-2",
|
|
138
|
+
children: caption
|
|
139
|
+
}
|
|
140
|
+
) : null
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
QrCodeAnimated.displayName = "QrCodeAnimated";
|
|
146
|
+
|
|
147
|
+
export { QrCodeAnimated, qrCodeAnimationPresets };
|
|
148
|
+
//# sourceMappingURL=animated.mjs.map
|
|
149
|
+
//# sourceMappingURL=animated.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/qr-code/animated/animations.ts","../../../src/ui/qr-code/animated/qr-code-animated.tsx"],"names":[],"mappings":";;;;;;;;;;AAcO,IAAM,sBAAA,GAAiD;AAAA,EAC5D,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY,EAAE,QAAA,EAAU,CAAA,EAAE;AAAA,IAC1B,QAAA,EAAU;AAAA,MACR,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,MACtB,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA;AAAE;AACxB,GACF;AAAA,EACA,SAAA,EAAW;AAAA,IACT,UAAA,EAAY,EAAE,QAAA,EAAU,GAAA,EAAK,MAAM,SAAA,EAAU;AAAA,IAC7C,QAAA,EAAU;AAAA,MACR,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,MACtB,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA;AAAE;AACxB,GACF;AAAA,EACA,SAAA,EAAW;AAAA,IACT,YAAY,EAAE,IAAA,EAAM,UAAU,SAAA,EAAW,GAAA,EAAK,SAAS,EAAA,EAAG;AAAA,IAC1D,QAAA,EAAU;AAAA,MACR,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAG,OAAO,IAAA,EAAK;AAAA,MACnC,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAG,OAAO,CAAA;AAAE;AAClC,G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AAAA,MAClB,GAAI,KAAA;AAAA,MAEL,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,WAAU,uNAAA,EACb,QAAA,kBAAA,GAAA;AAAA,UAAC,QAAA;AAAA,UAAA;AAAA,YACC,GAAA,EAAK,SAAA;AAAA,YACL,KAAA,EAAO,UAAA;AAAA,YACP,MAAA,EAAQ,UAAA;AAAA,YACR,WAAA,EAAU,gBAAA;AAAA,YACV,SAAA,EAAU,yBAAA;AAAA,YACV,YAAA,EAAY,eAAe,KAAK,CAAA;AAAA;AAAA,SAClC,EACF,CAAA;AAAA,QACC,OAAA,mBACC,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,WAAA,EAAU,iBAAA;AAAA,YACV,SAAA,EAAU,iPAAA;AAAA,YAET,QAAA,EAAA;AAAA;AAAA,SACH,GACE;AAAA;AAAA;AAAA,GACN;AAEJ;AAEA,cAAA,CAAe,WAAA,GAAc,gBAAA","file":"animated.mjs","sourcesContent":["import type { Transition, Variants } from \"framer-motion\";\n\nexport type QrCodeAnimation =\n | \"none\"\n | \"fade-in\"\n | \"zoom-in\"\n | \"slide-up\"\n | \"rotate-in\";\n\nexport type QrCodeAnimationPresets = Record<\n QrCodeAnimation,\n { transition: Transition; variants: Variants }\n>;\n\nexport const qrCodeAnimationPresets: QrCodeAnimationPresets = {\n none: {\n transition: { duration: 0 },\n variants: {\n initial: { opacity: 1 },\n animate: { opacity: 1 },\n },\n },\n \"fade-in\": {\n transition: { duration: 0.3, ease: \"easeOut\" },\n variants: {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n },\n },\n \"zoom-in\": {\n transition: { type: \"spring\", stiffness: 300, damping: 24 },\n variants: {\n initial: { opacity: 0, scale: 0.85 },\n animate: { opacity: 1, scale: 1 },\n },\n },\n \"slide-up\": {\n transition: { type: \"spring\", stiffness: 280, damping: 22 },\n variants: {\n initial: { opacity: 0, y: 20 },\n animate: { opacity: 1, y: 0 },\n },\n },\n \"rotate-in\": {\n transition: { type: \"spring\", stiffness: 200, damping: 18 },\n variants: {\n initial: { opacity: 0, rotate: -90, scale: 0.8 },\n animate: { opacity: 1, rotate: 0, scale: 1 },\n },\n },\n};\n","\"use client\";\n\nimport { useEffect, useRef } from \"react\";\nimport { motion } from \"framer-motion\";\nimport QRCode from \"qrcode\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { qrCodeAnimationPresets } from \"./animations\";\nimport type { QrCodeAnimatedProps } from \"./types\";\nimport { QrCodeBase } from \"../qr-code-base\";\n\nexport function QrCodeAnimated({\n animation = \"none\",\n value,\n canvasSize = 200,\n level = \"M\",\n bgColor = \"#ffffff\",\n fgColor = \"#000000\",\n margin = 2,\n caption,\n className,\n ...props\n}: QrCodeAnimatedProps) {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n\n useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas || animation === \"none\") return;\n\n if (!value) {\n const ctx = canvas.getContext(\"2d\");\n if (ctx) {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n }\n return;\n }\n\n QRCode.toCanvas(\n canvas,\n value,\n {\n width: canvasSize,\n margin,\n color: {\n dark: fgColor,\n light: bgColor,\n },\n errorCorrectionLevel: level,\n },\n (error) => {\n if (error) {\n console.error(\"QR Code generation error:\", error);\n }\n },\n );\n }, [value, canvasSize, level, bgColor, fgColor, margin, animation]);\n\n if (animation === \"none\") {\n return (\n <QrCodeBase\n value={value}\n canvasSize={canvasSize}\n level={level}\n bgColor={bgColor}\n fgColor={fgColor}\n margin={margin}\n caption={caption}\n className={className}\n {...props}\n />\n );\n }\n\n const preset = qrCodeAnimationPresets[animation];\n\n return (\n <motion.div\n data-slot=\"qr-code\"\n className={cn(\n \"inline-flex flex-col items-center gap-3 rounded-2xl border p-6 border-[color:var(--zui-qr-code-border,var(--zui-border,#0000001a))] dark:border-[color:var(--zui-qr-code-border-dark,var(--zui-border-dark,#ffffff1a))] bg-[var(--zui-qr-code-bg,var(--zui-surface,oklch(98.4%_0.003_247.858)))] dark:bg-[var(--zui-qr-code-bg-dark,var(--zui-surface-dark,oklch(12.9%_0.042_264.695)))]\",\n className,\n )}\n variants={preset.variants}\n initial=\"initial\"\n animate=\"animate\"\n transition={preset.transition}\n {...(props as Record<string, unknown>)}\n >\n <div className=\"overflow-hidden rounded-xl bg-[var(--zui-qr-code-canvas-bg,var(--zui-surface-muted,oklch(92.9%_0.013_255.508)))] dark:bg-[var(--zui-qr-code-canvas-bg-dark,var(--zui-surface-muted-dark,oklch(27.9%_0.041_260.031)))]\">\n <canvas\n ref={canvasRef}\n width={canvasSize}\n height={canvasSize}\n data-slot=\"qr-code-canvas\"\n className=\"block h-auto max-w-full\"\n aria-label={`QR code for ${value}`}\n />\n </div>\n {caption ? (\n <span\n data-slot=\"qr-code-caption\"\n className=\"text-xs text-center text-[color:var(--zui-qr-code-caption-fg,var(--zui-fg-muted,oklch(55.2%_0.046_257.417)))] dark:text-[color:var(--zui-qr-code-caption-fg-dark,var(--zui-fg-muted-dark,oklch(70.8%_0.015_256.243)))] max-w-full truncate px-2\"\n >\n {caption}\n </span>\n ) : null}\n </motion.div>\n );\n}\n\nQrCodeAnimated.displayName = \"QrCodeAnimated\";\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { QrCode } from "./qr-code";
|
|
2
|
+
export type { QrCodeBaseProps, QrCodeLevel, QrCodeProps } from "./types";
|
|
3
|
+
export { QR_CODE_LEVEL_LABELS } from "./types";
|
|
4
|
+
export { qrCodeCanvasWrapperVariants, qrCodeCaptionVariants, qrCodeVariants, } from "./variants";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/qr-code/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,cAAc,GACf,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { QrCodeBaseProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* QrCodeBase renders a QR code onto a `<canvas>` element using the `qrcode`
|
|
4
|
+
* npm package. It is the static (non-animated) implementation of the public
|
|
5
|
+
* `QrCode` component.
|
|
6
|
+
*
|
|
7
|
+
* --- Props ---
|
|
8
|
+
*
|
|
9
|
+
* - `value` — The string to encode. When empty/falsy the canvas is cleared.
|
|
10
|
+
* - `canvasSize` — Pixel dimensions of the canvas (default: 200). Both width
|
|
11
|
+
* and height are set to this value, producing a square QR code.
|
|
12
|
+
* - `level` — Error correction level (`"L"` | `"M"` | `"Q"` | `"H"`). Higher
|
|
13
|
+
* levels survive more visual damage but hold less data.
|
|
14
|
+
* - `bgColor` / `fgColor` — Background and foreground colours passed to the
|
|
15
|
+
* underlying `QRCode.toCanvas` options.
|
|
16
|
+
* - `margin` — Quiet-zone width in QR modules (default: 2). Passed directly
|
|
17
|
+
* to the `qrcode` library.
|
|
18
|
+
* - `caption` — Optional label rendered below the QR code.
|
|
19
|
+
* - `ref` — React 19 ref forwarded to the root `<div>` element.
|
|
20
|
+
* - `className` / `...rest` — Spread onto the root `<div>` for layout or
|
|
21
|
+
* style overrides.
|
|
22
|
+
*
|
|
23
|
+
* --- Rendering lifecycle ---
|
|
24
|
+
*
|
|
25
|
+
* A `useEffect` watches `[value, canvasSize, level, bgColor, fgColor, margin]`.
|
|
26
|
+
* On every change it:
|
|
27
|
+
* 1. Grabs the canvas element from the ref.
|
|
28
|
+
* 2. If `value` is empty, clears the canvas with `ctx.clearRect` so a stale
|
|
29
|
+
* QR code doesn't persist.
|
|
30
|
+
* 3. Otherwise calls `QRCode.toCanvas()` which draws the QR pattern
|
|
31
|
+
* asynchronously (via callback) onto the canvas element.
|
|
32
|
+
*
|
|
33
|
+
* The outer `<div>` uses design-system variants (`qrCodeVariants`) for
|
|
34
|
+
* consistent theming and carries `data-slot="qr-code"` for scoped styling and
|
|
35
|
+
* testing.
|
|
36
|
+
*
|
|
37
|
+
* --- Accessibility ---
|
|
38
|
+
*
|
|
39
|
+
* The `<canvas>` has an `aria-label` describing it as a "QR code for {value}".
|
|
40
|
+
* Screen readers will announce the purpose, though the raw value is exposed
|
|
41
|
+
* (consider truncating for secrets).
|
|
42
|
+
*/
|
|
43
|
+
export declare function QrCodeBase({ value, canvasSize, level, bgColor, fgColor, margin, caption, className, ref, ...rest }: QrCodeBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export declare namespace QrCodeBase {
|
|
45
|
+
var displayName: string;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=qr-code-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qr-code-base.d.ts","sourceRoot":"","sources":["../../../src/ui/qr-code/qr-code-base.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAO/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,UAAgB,EAChB,KAAW,EACX,OAAmB,EACnB,OAAmB,EACnB,MAAU,EACV,OAAO,EACP,SAAS,EACT,GAAG,EACH,GAAG,IAAI,EACR,EAAE,eAAe,2CAgFjB;yBA3Fe,UAAU"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qr-code.d.ts","sourceRoot":"","sources":["../../../src/ui/qr-code/qr-code.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
|
+
export type QrCodeLevel = "L" | "M" | "Q" | "H";
|
|
3
|
+
export interface QrCodeBaseProps extends ComponentPropsWithRef<"div"> {
|
|
4
|
+
value: string;
|
|
5
|
+
canvasSize?: number;
|
|
6
|
+
level?: QrCodeLevel;
|
|
7
|
+
bgColor?: string;
|
|
8
|
+
fgColor?: string;
|
|
9
|
+
margin?: number;
|
|
10
|
+
caption?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export type QrCodeProps = QrCodeBaseProps;
|
|
13
|
+
export declare const QR_CODE_LEVEL_LABELS: Record<QrCodeLevel, string>;
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/ui/qr-code/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEhD,MAAM,WAAW,eAAgB,SAAQ,qBAAqB,CAAC,KAAK,CAAC;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC;AAE1C,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAKnD,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const qrCodeVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
|
+
export declare const qrCodeCanvasWrapperVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
3
|
+
export declare const qrCodeCaptionVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
4
|
+
//# sourceMappingURL=variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../src/ui/qr-code/variants.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,cAAc,oFAAqB,CAAC;AACjD,eAAO,MAAM,2BAA2B,oFAA8B,CAAC;AACvE,eAAO,MAAM,qBAAqB,oFAA4B,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var chunkPWEZB53R_js = require('../chunk-PWEZB53R.js');
|
|
5
|
+
require('../chunk-XUK5P37Y.js');
|
|
6
|
+
require('../chunk-ZS5756ZC.js');
|
|
7
|
+
require('../chunk-PZ5AY32C.js');
|
|
8
|
+
|
|
9
|
+
// src/ui/qr-code/types.ts
|
|
10
|
+
var QR_CODE_LEVEL_LABELS = {
|
|
11
|
+
L: "Low (7%)",
|
|
12
|
+
M: "Medium (15%)",
|
|
13
|
+
Q: "Quartile (25%)",
|
|
14
|
+
H: "High (30%)"
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
Object.defineProperty(exports, "QrCode", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return chunkPWEZB53R_js.QrCodeBase; }
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, "qrCodeCanvasWrapperVariants", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return chunkPWEZB53R_js.qrCodeCanvasWrapperVariants; }
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "qrCodeCaptionVariants", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return chunkPWEZB53R_js.qrCodeCaptionVariants; }
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(exports, "qrCodeVariants", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () { return chunkPWEZB53R_js.qrCodeVariants; }
|
|
32
|
+
});
|
|
33
|
+
exports.QR_CODE_LEVEL_LABELS = QR_CODE_LEVEL_LABELS;
|
|
34
|
+
//# sourceMappingURL=qr-code.js.map
|
|
35
|
+
//# sourceMappingURL=qr-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/qr-code/types.ts"],"names":[],"mappings":";;;;;;;;AAgBO,IAAM,oBAAA,GAAoD;AAAA,EAC/D,CAAA,EAAG,UAAA;AAAA,EACH,CAAA,EAAG,cAAA;AAAA,EACH,CAAA,EAAG,gBAAA;AAAA,EACH,CAAA,EAAG;AACL","file":"qr-code.js","sourcesContent":["import type { ComponentPropsWithRef, ReactNode } from \"react\";\n\nexport type QrCodeLevel = \"L\" | \"M\" | \"Q\" | \"H\";\n\nexport interface QrCodeBaseProps extends ComponentPropsWithRef<\"div\"> {\n value: string;\n canvasSize?: number;\n level?: QrCodeLevel;\n bgColor?: string;\n fgColor?: string;\n margin?: number;\n caption?: ReactNode;\n}\n\nexport type QrCodeProps = QrCodeBaseProps;\n\nexport const QR_CODE_LEVEL_LABELS: Record<QrCodeLevel, string> = {\n L: \"Low (7%)\",\n M: \"Medium (15%)\",\n Q: \"Quartile (25%)\",\n H: \"High (30%)\",\n} as const;\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
export { QrCodeBase as QrCode, qrCodeCanvasWrapperVariants, qrCodeCaptionVariants, qrCodeVariants } from '../chunk-UBQY572I.mjs';
|
|
3
|
+
import '../chunk-4U6PVVST.mjs';
|
|
4
|
+
import '../chunk-4D54YOL6.mjs';
|
|
5
|
+
import '../chunk-J5LGTIGS.mjs';
|
|
6
|
+
|
|
7
|
+
// src/ui/qr-code/types.ts
|
|
8
|
+
var QR_CODE_LEVEL_LABELS = {
|
|
9
|
+
L: "Low (7%)",
|
|
10
|
+
M: "Medium (15%)",
|
|
11
|
+
Q: "Quartile (25%)",
|
|
12
|
+
H: "High (30%)"
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { QR_CODE_LEVEL_LABELS };
|
|
16
|
+
//# sourceMappingURL=qr-code.mjs.map
|
|
17
|
+
//# sourceMappingURL=qr-code.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/qr-code/types.ts"],"names":[],"mappings":";;;;;;AAgBO,IAAM,oBAAA,GAAoD;AAAA,EAC/D,CAAA,EAAG,UAAA;AAAA,EACH,CAAA,EAAG,cAAA;AAAA,EACH,CAAA,EAAG,gBAAA;AAAA,EACH,CAAA,EAAG;AACL","file":"qr-code.mjs","sourcesContent":["import type { ComponentPropsWithRef, ReactNode } from \"react\";\n\nexport type QrCodeLevel = \"L\" | \"M\" | \"Q\" | \"H\";\n\nexport interface QrCodeBaseProps extends ComponentPropsWithRef<\"div\"> {\n value: string;\n canvasSize?: number;\n level?: QrCodeLevel;\n bgColor?: string;\n fgColor?: string;\n margin?: number;\n caption?: ReactNode;\n}\n\nexport type QrCodeProps = QrCodeBaseProps;\n\nexport const QR_CODE_LEVEL_LABELS: Record<QrCodeLevel, string> = {\n L: \"Low (7%)\",\n M: \"Medium (15%)\",\n Q: \"Quartile (25%)\",\n H: \"High (30%)\",\n} as const;\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { QrScanner } from "./qr-scanner";
|
|
2
|
+
export type { QrScannerBaseProps, QrScannerProps, QrScannerRef, QrScannerVariantProps, } from "./types";
|
|
3
|
+
export { qrScannerFallbackVariants, qrScannerOverlayVariants, qrScannerStatusVariants, qrScannerVariants, qrScannerVideoVariants, qrScannerViewfinderVariants, } from "./variants";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/qr-scanner/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,YAAY,CAAC"}
|