@tempoxyz/id 0.0.0-pr-187.sha-eed04d3
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 +81 -0
- package/dist/App.d.ts +20 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/App.js +26 -0
- package/dist/App.js.map +1 -0
- package/dist/app/client/.assetsignore +2 -0
- package/dist/app/client/assets/BRLA-CZvVDNYr.png +0 -0
- package/dist/app/client/assets/CHFAU-DCedc4aH.png +0 -0
- package/dist/app/client/assets/DLUSD-BnRXm3EI.png +0 -0
- package/dist/app/client/assets/PRIME-CiFp2-3e.svg +14 -0
- package/dist/app/client/assets/Pilat-Bold-C1t1eIrF.woff2 +0 -0
- package/dist/app/client/assets/Pilat-Book-CbS8ofT8.woff2 +0 -0
- package/dist/app/client/assets/Pilat-Demi-CADSbPAt.woff2 +0 -0
- package/dist/app/client/assets/Pilat-Regular-Bx8vzE7q.woff2 +0 -0
- package/dist/app/client/assets/USD1-COVcO_PB.svg +30 -0
- package/dist/app/client/assets/YLDS-CRh8Zw0g.svg +3 -0
- package/dist/app/client/assets/ccip-Cq1mMiVl.js +1 -0
- package/dist/app/client/assets/frxUSD-n9pTpinR.svg +1 -0
- package/dist/app/client/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
- package/dist/app/client/assets/index-B7YJVP00.css +1 -0
- package/dist/app/client/assets/index-UXTxXCLk.js +55 -0
- package/dist/app/client/assets/pathUSD-BvaO6ooS.svg +25 -0
- package/dist/app/client/assets/reset-co-CHrff.css +1 -0
- package/dist/app/client/assets/wYLDS-CaCKDrO-.svg +10 -0
- package/dist/app/db/auth.d.ts +3207 -0
- package/dist/app/db/auth.d.ts.map +1 -0
- package/dist/app/db/auth.js +330 -0
- package/dist/app/db/auth.js.map +1 -0
- package/dist/app/db/schema.d.ts +932 -0
- package/dist/app/db/schema.d.ts.map +1 -0
- package/dist/app/db/schema.js +171 -0
- package/dist/app/db/schema.js.map +1 -0
- package/dist/app/server/.vite/manifest.json +489 -0
- package/dist/app/server/assets/BRLA-CZvVDNYr.png +0 -0
- package/dist/app/server/assets/CHFAU-DCedc4aH.png +0 -0
- package/dist/app/server/assets/DLUSD-BnRXm3EI.png +0 -0
- package/dist/app/server/assets/PRIME-CiFp2-3e.svg +14 -0
- package/dist/app/server/assets/Pilat-Bold-C1t1eIrF.woff2 +0 -0
- package/dist/app/server/assets/Pilat-Book-CbS8ofT8.woff2 +0 -0
- package/dist/app/server/assets/Pilat-Demi-CADSbPAt.woff2 +0 -0
- package/dist/app/server/assets/Pilat-Regular-Bx8vzE7q.woff2 +0 -0
- package/dist/app/server/assets/USD1-COVcO_PB.svg +30 -0
- package/dist/app/server/assets/YLDS-CRh8Zw0g.svg +3 -0
- package/dist/app/server/assets/_tanstack-start-manifest_v-DjQNeRZp.js +1 -0
- package/dist/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js +2 -0
- package/dist/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js.map +1 -0
- package/dist/app/server/assets/authorize-C95F-9E1-CbESJKGU.js +31 -0
- package/dist/app/server/assets/authorize-C95F-9E1-CbESJKGU.js.map +1 -0
- package/dist/app/server/assets/bun-sqlite-dialect-DoOVo4ja-CtyBkVMb.js +2 -0
- package/dist/app/server/assets/bun-sqlite-dialect-DoOVo4ja-CtyBkVMb.js.map +1 -0
- package/dist/app/server/assets/call-UQamaCKN.js +32 -0
- package/dist/app/server/assets/call-UQamaCKN.js.map +1 -0
- package/dist/app/server/assets/ccip-CbNKFO4n.js +2 -0
- package/dist/app/server/assets/ccip-CbNKFO4n.js.map +1 -0
- package/dist/app/server/assets/compiled-query-Ds2NVcFT.js +2 -0
- package/dist/app/server/assets/compiled-query-Ds2NVcFT.js.map +1 -0
- package/dist/app/server/assets/convert-BIC8n32x.js +2 -0
- package/dist/app/server/assets/convert-BIC8n32x.js.map +1 -0
- package/dist/app/server/assets/cookie-CS900nSP.css +1 -0
- package/dist/app/server/assets/cookie-Cce9CrIP.js +10 -0
- package/dist/app/server/assets/cookie-Cce9CrIP.js.map +1 -0
- package/dist/app/server/assets/core-B1HCXUmx.js +56 -0
- package/dist/app/server/assets/core-B1HCXUmx.js.map +1 -0
- package/dist/app/server/assets/d1-sqlite-dialect-m0f01-4z-Cv-csE1u.js +2 -0
- package/dist/app/server/assets/d1-sqlite-dialect-m0f01-4z-Cv-csE1u.js.map +1 -0
- package/dist/app/server/assets/default-u_dwuiYb-BJJ9PwCi.js +2 -0
- package/dist/app/server/assets/default-u_dwuiYb-BJJ9PwCi.js.map +1 -0
- package/dist/app/server/assets/dist-BxSwugSY.js +1 -0
- package/dist/app/server/assets/dist-CZGFhmQd.js +2 -0
- package/dist/app/server/assets/dist-CZGFhmQd.js.map +1 -0
- package/dist/app/server/assets/dist-Dg3PQqiW.js +15 -0
- package/dist/app/server/assets/dist-Dg3PQqiW.js.map +1 -0
- package/dist/app/server/assets/effect-QlVUlMFu-2tSPDT2b.js +2 -0
- package/dist/app/server/assets/effect-QlVUlMFu-2tSPDT2b.js.map +1 -0
- package/dist/app/server/assets/empty-plugin-adapters-BaGcmrjC.js +2 -0
- package/dist/app/server/assets/empty-plugin-adapters-BaGcmrjC.js.map +1 -0
- package/dist/app/server/assets/factory-ipHlJXZY.js +5 -0
- package/dist/app/server/assets/factory-ipHlJXZY.js.map +1 -0
- package/dist/app/server/assets/frxUSD-n9pTpinR.svg +1 -0
- package/dist/app/server/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
- package/dist/app/server/assets/get-id-field-B0x109VU.js +6 -0
- package/dist/app/server/assets/get-id-field-B0x109VU.js.map +1 -0
- package/dist/app/server/assets/index-CLddUTqr-xpSuLpBt.js +2 -0
- package/dist/app/server/assets/index-CLddUTqr-xpSuLpBt.js.map +1 -0
- package/dist/app/server/assets/index-DZEfthgZ-8Uq5s5Pt.js +2 -0
- package/dist/app/server/assets/index-DZEfthgZ-8Uq5s5Pt.js.map +1 -0
- package/dist/app/server/assets/kysely-adapter-MkHAI9Jk.js +1 -0
- package/dist/app/server/assets/node-sqlite-dialect-BowWLXvK.js +2 -0
- package/dist/app/server/assets/node-sqlite-dialect-BowWLXvK.js.map +1 -0
- package/dist/app/server/assets/pathUSD-BvaO6ooS.svg +25 -0
- package/dist/app/server/assets/reset-co-CHrff.css +1 -0
- package/dist/app/server/assets/rolldown-runtime-B0Z9INg1.js +1 -0
- package/dist/app/server/assets/router-CcbyBCI4.css +1 -0
- package/dist/app/server/assets/router-xjZtEeaI.js +7 -0
- package/dist/app/server/assets/router-xjZtEeaI.js.map +1 -0
- package/dist/app/server/assets/schema-check-Cf7QOZZD.js +9 -0
- package/dist/app/server/assets/schema-check-Cf7QOZZD.js.map +1 -0
- package/dist/app/server/assets/schemas-C2lCYmR5.js +2 -0
- package/dist/app/server/assets/schemas-C2lCYmR5.js.map +1 -0
- package/dist/app/server/assets/secp256k1-buM5g4AL.js +2 -0
- package/dist/app/server/assets/secp256k1-buM5g4AL.js.map +1 -0
- package/dist/app/server/assets/sqlite-adapter-C_LAV4e3.js +2 -0
- package/dist/app/server/assets/sqlite-adapter-C_LAV4e3.js.map +1 -0
- package/dist/app/server/assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js +6 -0
- package/dist/app/server/assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js.map +1 -0
- package/dist/app/server/assets/standard-json-Cg1N07hM.js +2 -0
- package/dist/app/server/assets/standard-json-Cg1N07hM.js.map +1 -0
- package/dist/app/server/assets/standard-json-DY77efq0.js +2 -0
- package/dist/app/server/assets/standard-json-DY77efq0.js.map +1 -0
- package/dist/app/server/assets/standard-json-ig2t0wRt.js +2 -0
- package/dist/app/server/assets/standard-json-ig2t0wRt.js.map +1 -0
- package/dist/app/server/assets/standard-json-t-LNckA6.js +2 -0
- package/dist/app/server/assets/standard-json-t-LNckA6.js.map +1 -0
- package/dist/app/server/assets/standard-openapi-CONmVRl8.js +2 -0
- package/dist/app/server/assets/standard-openapi-CONmVRl8.js.map +1 -0
- package/dist/app/server/assets/start-C63VetBp.js +2 -0
- package/dist/app/server/assets/start-C63VetBp.js.map +1 -0
- package/dist/app/server/assets/sury-CWZTCd75-xt1mWc9f.js +2 -0
- package/dist/app/server/assets/sury-CWZTCd75-xt1mWc9f.js.map +1 -0
- package/dist/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js +2 -0
- package/dist/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js.map +1 -0
- package/dist/app/server/assets/utils-C4ZXZIZW.js +2 -0
- package/dist/app/server/assets/utils-C4ZXZIZW.js.map +1 -0
- package/dist/app/server/assets/valibot--1zFm7rT-NSoY2xTp.js +2 -0
- package/dist/app/server/assets/valibot--1zFm7rT-NSoY2xTp.js.map +1 -0
- package/dist/app/server/assets/valibot-D_HTw1Gn-CJwWeOUE.js +2 -0
- package/dist/app/server/assets/valibot-D_HTw1Gn-CJwWeOUE.js.map +1 -0
- package/dist/app/server/assets/wYLDS-CaCKDrO-.svg +10 -0
- package/dist/app/server/assets/zod-Bwrt9trS-CV38yPnQ.js +2 -0
- package/dist/app/server/assets/zod-Bwrt9trS-CV38yPnQ.js.map +1 -0
- package/dist/app/server/assets/zod-DSgpEGAE-BvlnBE2L.js +2 -0
- package/dist/app/server/assets/zod-DSgpEGAE-BvlnBE2L.js.map +1 -0
- package/dist/app/server/index.js +574 -0
- package/dist/app/server/index.js.map +1 -0
- package/dist/app/server/wrangler.json +1 -0
- package/dist/cli/Admin.d.ts +38 -0
- package/dist/cli/Admin.d.ts.map +1 -0
- package/dist/cli/Admin.js +62 -0
- package/dist/cli/Admin.js.map +1 -0
- package/dist/cli/Apps.d.ts +9 -0
- package/dist/cli/Apps.d.ts.map +1 -0
- package/dist/cli/Apps.js +36 -0
- package/dist/cli/Apps.js.map +1 -0
- package/dist/cli/Cli.d.ts +14 -0
- package/dist/cli/Cli.d.ts.map +1 -0
- package/dist/cli/Cli.js +27 -0
- package/dist/cli/Cli.js.map +1 -0
- package/dist/cli/Project.d.ts +20 -0
- package/dist/cli/Project.d.ts.map +1 -0
- package/dist/cli/Project.js +88 -0
- package/dist/cli/Project.js.map +1 -0
- package/dist/cli/Realms.d.ts +24 -0
- package/dist/cli/Realms.d.ts.map +1 -0
- package/dist/cli/Realms.js +49 -0
- package/dist/cli/Realms.js.map +1 -0
- package/dist/cli/Session.d.ts +85 -0
- package/dist/cli/Session.d.ts.map +1 -0
- package/dist/cli/Session.js +178 -0
- package/dist/cli/Session.js.map +1 -0
- package/dist/cli/User.d.ts +29 -0
- package/dist/cli/User.d.ts.map +1 -0
- package/dist/cli/User.js +39 -0
- package/dist/cli/User.js.map +1 -0
- package/dist/cli/V1.d.ts +35 -0
- package/dist/cli/V1.d.ts.map +1 -0
- package/dist/cli/V1.js +41 -0
- package/dist/cli/V1.js.map +1 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +46 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/admin/apps/create.d.ts +23 -0
- package/dist/cli/commands/admin/apps/create.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/create.js +89 -0
- package/dist/cli/commands/admin/apps/create.js.map +1 -0
- package/dist/cli/commands/admin/apps/delete.d.ts +14 -0
- package/dist/cli/commands/admin/apps/delete.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/delete.js +41 -0
- package/dist/cli/commands/admin/apps/delete.js.map +1 -0
- package/dist/cli/commands/admin/apps/index.d.ts +5 -0
- package/dist/cli/commands/admin/apps/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/index.js +14 -0
- package/dist/cli/commands/admin/apps/index.js.map +1 -0
- package/dist/cli/commands/admin/apps/list.d.ts +9 -0
- package/dist/cli/commands/admin/apps/list.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/list.js +26 -0
- package/dist/cli/commands/admin/apps/list.js.map +1 -0
- package/dist/cli/commands/admin/apps/rotate-secret.d.ts +16 -0
- package/dist/cli/commands/admin/apps/rotate-secret.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/rotate-secret.js +47 -0
- package/dist/cli/commands/admin/apps/rotate-secret.js.map +1 -0
- package/dist/cli/commands/admin/apps/update.d.ts +20 -0
- package/dist/cli/commands/admin/apps/update.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/update.js +76 -0
- package/dist/cli/commands/admin/apps/update.js.map +1 -0
- package/dist/cli/commands/admin/index.d.ts +5 -0
- package/dist/cli/commands/admin/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/index.js +13 -0
- package/dist/cli/commands/admin/index.js.map +1 -0
- package/dist/cli/commands/admin/migrate.d.ts +9 -0
- package/dist/cli/commands/admin/migrate.d.ts.map +1 -0
- package/dist/cli/commands/admin/migrate.js +17 -0
- package/dist/cli/commands/admin/migrate.js.map +1 -0
- package/dist/cli/commands/admin/realms/add.d.ts +12 -0
- package/dist/cli/commands/admin/realms/add.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/add.js +42 -0
- package/dist/cli/commands/admin/realms/add.js.map +1 -0
- package/dist/cli/commands/admin/realms/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/index.js +13 -0
- package/dist/cli/commands/admin/realms/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/list.d.ts +13 -0
- package/dist/cli/commands/admin/realms/list.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/list.js +36 -0
- package/dist/cli/commands/admin/realms/list.js.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/passkeys/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/index.js +13 -0
- package/dist/cli/commands/admin/realms/passkeys/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/set.d.ts +16 -0
- package/dist/cli/commands/admin/realms/passkeys/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/set.js +46 -0
- package/dist/cli/commands/admin/realms/passkeys/set.js.map +1 -0
- package/dist/cli/commands/admin/realms/privy/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/privy/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/privy/index.js +13 -0
- package/dist/cli/commands/admin/realms/privy/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/privy/set.d.ts +18 -0
- package/dist/cli/commands/admin/realms/privy/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/privy/set.js +66 -0
- package/dist/cli/commands/admin/realms/privy/set.js.map +1 -0
- package/dist/cli/commands/admin/realms/remove.d.ts +11 -0
- package/dist/cli/commands/admin/realms/remove.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/remove.js +35 -0
- package/dist/cli/commands/admin/realms/remove.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.d.ts +15 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.js +42 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.d.ts +15 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.js +42 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.d.ts +9 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.js +17 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/set.d.ts +16 -0
- package/dist/cli/commands/admin/realms/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/set.js +46 -0
- package/dist/cli/commands/admin/realms/set.js.map +1 -0
- package/dist/cli/commands/admin/rotate-key.d.ts +15 -0
- package/dist/cli/commands/admin/rotate-key.d.ts.map +1 -0
- package/dist/cli/commands/admin/rotate-key.js +46 -0
- package/dist/cli/commands/admin/rotate-key.js.map +1 -0
- package/dist/cli/commands/init.d.ts +11 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +34 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/login.d.ts +12 -0
- package/dist/cli/commands/login.d.ts.map +1 -0
- package/dist/cli/commands/login.js +29 -0
- package/dist/cli/commands/login.js.map +1 -0
- package/dist/cli/commands/logout.d.ts +8 -0
- package/dist/cli/commands/logout.d.ts.map +1 -0
- package/dist/cli/commands/logout.js +19 -0
- package/dist/cli/commands/logout.js.map +1 -0
- package/dist/cli/commands/whoami.d.ts +12 -0
- package/dist/cli/commands/whoami.d.ts.map +1 -0
- package/dist/cli/commands/whoami.js +24 -0
- package/dist/cli/commands/whoami.js.map +1 -0
- package/dist/client/Actions.d.ts +101 -0
- package/dist/client/Actions.d.ts.map +1 -0
- package/dist/client/Actions.js +90 -0
- package/dist/client/Actions.js.map +1 -0
- package/dist/client/Auth.d.ts +161 -0
- package/dist/client/Auth.d.ts.map +1 -0
- package/dist/client/Auth.js +113 -0
- package/dist/client/Auth.js.map +1 -0
- package/dist/client/Authorization.d.ts +29 -0
- package/dist/client/Authorization.d.ts.map +1 -0
- package/dist/client/Authorization.js +12 -0
- package/dist/client/Authorization.js.map +1 -0
- package/dist/client/Decorator.d.ts +170 -0
- package/dist/client/Decorator.d.ts.map +1 -0
- package/dist/client/Decorator.js +227 -0
- package/dist/client/Decorator.js.map +1 -0
- package/dist/client/Key.d.ts +85 -0
- package/dist/client/Key.d.ts.map +1 -0
- package/dist/client/Key.js +83 -0
- package/dist/client/Key.js.map +1 -0
- package/dist/client/Pending.d.ts +39 -0
- package/dist/client/Pending.d.ts.map +1 -0
- package/dist/client/Pending.js +12 -0
- package/dist/client/Pending.js.map +1 -0
- package/dist/client/Permissions.d.ts +34 -0
- package/dist/client/Permissions.d.ts.map +1 -0
- package/dist/client/Permissions.js +16 -0
- package/dist/client/Permissions.js.map +1 -0
- package/dist/client/Provider.d.ts +16 -0
- package/dist/client/Provider.d.ts.map +1 -0
- package/dist/client/Provider.js +12 -0
- package/dist/client/Provider.js.map +1 -0
- package/dist/client/Step.d.ts +21 -0
- package/dist/client/Step.d.ts.map +1 -0
- package/dist/client/Step.js +16 -0
- package/dist/client/Step.js.map +1 -0
- package/dist/client/Storage.d.ts +27 -0
- package/dist/client/Storage.d.ts.map +1 -0
- package/dist/client/Storage.js +16 -0
- package/dist/client/Storage.js.map +1 -0
- package/dist/client/TempoAccount.d.ts +40 -0
- package/dist/client/TempoAccount.d.ts.map +1 -0
- package/dist/client/TempoAccount.js +16 -0
- package/dist/client/TempoAccount.js.map +1 -0
- package/dist/client/Tokens.d.ts +25 -0
- package/dist/client/Tokens.d.ts.map +1 -0
- package/dist/client/Tokens.js +12 -0
- package/dist/client/Tokens.js.map +1 -0
- package/dist/client/User.d.ts +21 -0
- package/dist/client/User.d.ts.map +1 -0
- package/dist/client/User.js +12 -0
- package/dist/client/User.js.map +1 -0
- package/dist/client/actions/account.d.ts +25 -0
- package/dist/client/actions/account.d.ts.map +1 -0
- package/dist/client/actions/account.js +34 -0
- package/dist/client/actions/account.js.map +1 -0
- package/dist/client/actions/device.d.ts +53 -0
- package/dist/client/actions/device.d.ts.map +1 -0
- package/dist/client/actions/device.js +79 -0
- package/dist/client/actions/device.js.map +1 -0
- package/dist/client/actions/email.d.ts +84 -0
- package/dist/client/actions/email.d.ts.map +1 -0
- package/dist/client/actions/email.js +63 -0
- package/dist/client/actions/email.js.map +1 -0
- package/dist/client/actions/oauth.d.ts +115 -0
- package/dist/client/actions/oauth.d.ts.map +1 -0
- package/dist/client/actions/oauth.js +105 -0
- package/dist/client/actions/oauth.js.map +1 -0
- package/dist/client/actions/passkey.d.ts +88 -0
- package/dist/client/actions/passkey.d.ts.map +1 -0
- package/dist/client/actions/passkey.js +60 -0
- package/dist/client/actions/passkey.js.map +1 -0
- package/dist/client/actions/provider.d.ts +49 -0
- package/dist/client/actions/provider.d.ts.map +1 -0
- package/dist/client/actions/provider.js +34 -0
- package/dist/client/actions/provider.js.map +1 -0
- package/dist/client/actions/realm.d.ts +24 -0
- package/dist/client/actions/realm.d.ts.map +1 -0
- package/dist/client/actions/realm.js +15 -0
- package/dist/client/actions/realm.js.map +1 -0
- package/dist/client/actions/redirect.d.ts +153 -0
- package/dist/client/actions/redirect.d.ts.map +1 -0
- package/dist/client/actions/redirect.js +236 -0
- package/dist/client/actions/redirect.js.map +1 -0
- package/dist/client/internal/accessKey.d.ts +21 -0
- package/dist/client/internal/accessKey.d.ts.map +1 -0
- package/dist/client/internal/accessKey.js +38 -0
- package/dist/client/internal/accessKey.js.map +1 -0
- package/dist/client/internal/account.d.ts +14 -0
- package/dist/client/internal/account.d.ts.map +1 -0
- package/dist/client/internal/account.js +3 -0
- package/dist/client/internal/account.js.map +1 -0
- package/dist/client/internal/api.d.ts +106 -0
- package/dist/client/internal/api.d.ts.map +1 -0
- package/dist/client/internal/api.js +129 -0
- package/dist/client/internal/api.js.map +1 -0
- package/dist/client/internal/headless.d.ts +33 -0
- package/dist/client/internal/headless.d.ts.map +1 -0
- package/dist/client/internal/headless.js +46 -0
- package/dist/client/internal/headless.js.map +1 -0
- package/dist/client/internal/indexedDb.d.ts +9 -0
- package/dist/client/internal/indexedDb.d.ts.map +1 -0
- package/dist/client/internal/indexedDb.js +32 -0
- package/dist/client/internal/indexedDb.js.map +1 -0
- package/dist/client/internal/request.d.ts +58 -0
- package/dist/client/internal/request.d.ts.map +1 -0
- package/dist/client/internal/request.js +45 -0
- package/dist/client/internal/request.js.map +1 -0
- package/dist/client/internal/store.d.ts +12 -0
- package/dist/client/internal/store.d.ts.map +1 -0
- package/dist/client/internal/store.js +15 -0
- package/dist/client/internal/store.js.map +1 -0
- package/dist/client.d.ts +20 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +20 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/Apps.d.ts +3051 -0
- package/dist/internal/Apps.d.ts.map +1 -0
- package/dist/internal/Apps.js +472 -0
- package/dist/internal/Apps.js.map +1 -0
- package/dist/internal/Auth.d.ts +4058 -0
- package/dist/internal/Auth.d.ts.map +1 -0
- package/dist/internal/Auth.js +137 -0
- package/dist/internal/Auth.js.map +1 -0
- package/dist/internal/Authorize.d.ts +532 -0
- package/dist/internal/Authorize.d.ts.map +1 -0
- package/dist/internal/Authorize.js +326 -0
- package/dist/internal/Authorize.js.map +1 -0
- package/dist/internal/Device.d.ts +371 -0
- package/dist/internal/Device.d.ts.map +1 -0
- package/dist/internal/Device.js +271 -0
- package/dist/internal/Device.js.map +1 -0
- package/dist/internal/Env.d.ts +57 -0
- package/dist/internal/Env.d.ts.map +1 -0
- package/dist/internal/Env.js +2 -0
- package/dist/internal/Env.js.map +1 -0
- package/dist/internal/ErrorResponse.d.ts +609 -0
- package/dist/internal/ErrorResponse.d.ts.map +1 -0
- package/dist/internal/ErrorResponse.js +679 -0
- package/dist/internal/ErrorResponse.js.map +1 -0
- package/dist/internal/Id.d.ts +10 -0
- package/dist/internal/Id.d.ts.map +1 -0
- package/dist/internal/Id.js +34 -0
- package/dist/internal/Id.js.map +1 -0
- package/dist/internal/KeyAuthorization.d.ts +1456 -0
- package/dist/internal/KeyAuthorization.d.ts.map +1 -0
- package/dist/internal/KeyAuthorization.js +1030 -0
- package/dist/internal/KeyAuthorization.js.map +1 -0
- package/dist/internal/Limits.d.ts +65 -0
- package/dist/internal/Limits.d.ts.map +1 -0
- package/dist/internal/Limits.js +35 -0
- package/dist/internal/Limits.js.map +1 -0
- package/dist/internal/Log.d.ts +49 -0
- package/dist/internal/Log.d.ts.map +1 -0
- package/dist/internal/Log.js +101 -0
- package/dist/internal/Log.js.map +1 -0
- package/dist/internal/LogLine.d.ts +33 -0
- package/dist/internal/LogLine.d.ts.map +1 -0
- package/dist/internal/LogLine.js +56 -0
- package/dist/internal/LogLine.js.map +1 -0
- package/dist/internal/Migrations.d.ts +19 -0
- package/dist/internal/Migrations.d.ts.map +1 -0
- package/dist/internal/Migrations.js +57 -0
- package/dist/internal/Migrations.js.map +1 -0
- package/dist/internal/Owner.d.ts +146 -0
- package/dist/internal/Owner.d.ts.map +1 -0
- package/dist/internal/Owner.js +65 -0
- package/dist/internal/Owner.js.map +1 -0
- package/dist/internal/Passkey.d.ts +528 -0
- package/dist/internal/Passkey.d.ts.map +1 -0
- package/dist/internal/Passkey.js +658 -0
- package/dist/internal/Passkey.js.map +1 -0
- package/dist/internal/PendingKey.d.ts +49 -0
- package/dist/internal/PendingKey.d.ts.map +1 -0
- package/dist/internal/PendingKey.js +58 -0
- package/dist/internal/PendingKey.js.map +1 -0
- package/dist/internal/Privy.d.ts +105 -0
- package/dist/internal/Privy.d.ts.map +1 -0
- package/dist/internal/Privy.js +224 -0
- package/dist/internal/Privy.js.map +1 -0
- package/dist/internal/RateLimit.d.ts +190 -0
- package/dist/internal/RateLimit.d.ts.map +1 -0
- package/dist/internal/RateLimit.js +148 -0
- package/dist/internal/RateLimit.js.map +1 -0
- package/dist/internal/Realm.d.ts +281 -0
- package/dist/internal/Realm.d.ts.map +1 -0
- package/dist/internal/Realm.js +477 -0
- package/dist/internal/Realm.js.map +1 -0
- package/dist/internal/RequestId.d.ts +16 -0
- package/dist/internal/RequestId.d.ts.map +1 -0
- package/dist/internal/RequestId.js +78 -0
- package/dist/internal/RequestId.js.map +1 -0
- package/dist/internal/SigningKey.d.ts +115 -0
- package/dist/internal/SigningKey.d.ts.map +1 -0
- package/dist/internal/SigningKey.js +197 -0
- package/dist/internal/SigningKey.js.map +1 -0
- package/dist/internal/TestInbox.d.ts +42 -0
- package/dist/internal/TestInbox.d.ts.map +1 -0
- package/dist/internal/TestInbox.js +20 -0
- package/dist/internal/TestInbox.js.map +1 -0
- package/dist/internal/Timing.d.ts +51 -0
- package/dist/internal/Timing.d.ts.map +1 -0
- package/dist/internal/Timing.js +103 -0
- package/dist/internal/Timing.js.map +1 -0
- package/dist/internal/Validation.d.ts +52 -0
- package/dist/internal/Validation.d.ts.map +1 -0
- package/dist/internal/Validation.js +22 -0
- package/dist/internal/Validation.js.map +1 -0
- package/dist/internal/Wallet.d.ts +37 -0
- package/dist/internal/Wallet.d.ts.map +1 -0
- package/dist/internal/Wallet.js +43 -0
- package/dist/internal/Wallet.js.map +1 -0
- package/dist/worker.d.ts +12 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +12 -0
- package/dist/worker.js.map +1 -0
- package/package.json +82 -0
- package/src/Api.ts +151 -0
- package/src/App.ts +56 -0
- package/src/api/account.ts +311 -0
- package/src/api/authenticate.ts +1290 -0
- package/src/api/authorize.ts +1030 -0
- package/src/api/device.ts +874 -0
- package/src/api/health.ts +72 -0
- package/src/api/lib/AccountStep.ts +335 -0
- package/src/api/lib/Auth.ts +134 -0
- package/src/api/lib/Consent.ts +339 -0
- package/src/api/lib/Cors.ts +107 -0
- package/src/api/lib/Database.ts +10 -0
- package/src/api/lib/DeviceRequest.ts +265 -0
- package/src/api/lib/FirstAccount.ts +90 -0
- package/src/api/lib/KeySigner.ts +393 -0
- package/src/api/lib/PasskeyLink.ts +162 -0
- package/src/api/lib/Session.ts +34 -0
- package/src/api/lib/SignInConsent.ts +316 -0
- package/src/api/oauth.ts +1282 -0
- package/src/api/provider.ts +441 -0
- package/src/app/components/Button.tsx +128 -0
- package/src/app/components/CodeInput.tsx +186 -0
- package/src/app/components/ErrorMessage.tsx +66 -0
- package/src/app/components/Grant.tsx +323 -0
- package/src/app/components/Input.tsx +48 -0
- package/src/app/components/Tooltip.tsx +45 -0
- package/src/app/components/icons/BRLA.png +0 -0
- package/src/app/components/icons/BRZ.svg +1 -0
- package/src/app/components/icons/CHFAU.png +0 -0
- package/src/app/components/icons/DLUSD.png +0 -0
- package/src/app/components/icons/EURAU.svg +1 -0
- package/src/app/components/icons/EURC.e.svg +1 -0
- package/src/app/components/icons/GBPA.svg +4 -0
- package/src/app/components/icons/GUSD.svg +1 -0
- package/src/app/components/icons/MACH.svg +4 -0
- package/src/app/components/icons/OUSD.svg +5 -0
- package/src/app/components/icons/PRIME.svg +14 -0
- package/src/app/components/icons/SBC.svg +1 -0
- package/src/app/components/icons/SEKAU.svg +5 -0
- package/src/app/components/icons/USD1.svg +30 -0
- package/src/app/components/icons/USDB.svg +11 -0
- package/src/app/components/icons/USDC.e.svg +1 -0
- package/src/app/components/icons/USDT0.svg +1 -0
- package/src/app/components/icons/USDY.svg +16 -0
- package/src/app/components/icons/USDe.svg +1 -0
- package/src/app/components/icons/YLDS.svg +3 -0
- package/src/app/components/icons/alphaUSD.svg +1 -0
- package/src/app/components/icons/betaUSD.svg +1 -0
- package/src/app/components/icons/cUSD.svg +1 -0
- package/src/app/components/icons/cbBTC.svg +1 -0
- package/src/app/components/icons/frxUSD.svg +1 -0
- package/src/app/components/icons/goUSD.svg +5 -0
- package/src/app/components/icons/iUSD.svg +1 -0
- package/src/app/components/icons/pathUSD.svg +25 -0
- package/src/app/components/icons/rUSD.svg +1 -0
- package/src/app/components/icons/reUSD.svg +1 -0
- package/src/app/components/icons/sUSDe.svg +1 -0
- package/src/app/components/icons/siUSD.svg +1 -0
- package/src/app/components/icons/stcUSD.svg +1 -0
- package/src/app/components/icons/syrupUSDC.svg +5 -0
- package/src/app/components/icons/thetaUSD.svg +1 -0
- package/src/app/components/icons/wYLDS.svg +10 -0
- package/src/app/components/icons/wsrUSD.svg +1 -0
- package/src/app/components/logos/OUSD.dark.svg +17 -0
- package/src/app/components/logos/OUSD.light.svg +17 -0
- package/src/app/crons/cleanup.ts +42 -0
- package/src/app/db/auth.ts +416 -0
- package/src/app/db/migrations/0000_better_auth.sql +53 -0
- package/src/app/db/migrations/0001_oauth_provider.sql +162 -0
- package/src/app/db/migrations/0002_device_code.sql +17 -0
- package/src/app/db/migrations/0003_realms.sql +27 -0
- package/src/app/db/migrations/0004_default_realm.sql +2 -0
- package/src/app/db/migrations/0005_passkeys.sql +30 -0
- package/src/app/db/migrations/0006_first_accounts.sql +9 -0
- package/src/app/db/migrations/0007_pending_keys.sql +13 -0
- package/src/app/db/migrations/0008_secp256k1_owners.sql +18 -0
- package/src/app/db/migrations/0009_device_requests.sql +8 -0
- package/src/app/db/migrations/0010_device_keys.sql +4 -0
- package/src/app/db/migrations/meta/0000_snapshot.json +362 -0
- package/src/app/db/migrations/meta/0001_snapshot.json +1487 -0
- package/src/app/db/migrations/meta/0002_snapshot.json +1603 -0
- package/src/app/db/migrations/meta/0003_snapshot.json +1760 -0
- package/src/app/db/migrations/meta/0004_snapshot.json +1760 -0
- package/src/app/db/migrations/meta/0005_snapshot.json +1911 -0
- package/src/app/db/migrations/meta/0006_snapshot.json +1967 -0
- package/src/app/db/migrations/meta/0007_snapshot.json +2047 -0
- package/src/app/db/migrations/meta/0008_snapshot.json +2157 -0
- package/src/app/db/migrations/meta/0009_snapshot.json +2207 -0
- package/src/app/db/migrations/meta/0010_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/_journal.json +83 -0
- package/src/app/db/schema.ts +218 -0
- package/src/app/env.ts +49 -0
- package/src/app/lib/Client.ts +82 -0
- package/src/app/lib/Loader.ts +24 -0
- package/src/app/package.json +8 -0
- package/src/app/routeTree.gen.ts +198 -0
- package/src/app/router.tsx +48 -0
- package/src/app/routes/[_].flows.tsx +3001 -0
- package/src/app/routes/__root.tsx +91 -0
- package/src/app/routes/authorize.tsx +197 -0
- package/src/app/routes/choose-account.tsx +111 -0
- package/src/app/routes/deposit.tsx +105 -0
- package/src/app/routes/device.tsx +227 -0
- package/src/app/routes/index.tsx +115 -0
- package/src/app/routes/login.tsx +506 -0
- package/src/app/screens/Account.tsx +347 -0
- package/src/app/screens/Approval.tsx +276 -0
- package/src/app/screens/ChooseAccount.tsx +240 -0
- package/src/app/screens/Deposit.tsx +762 -0
- package/src/app/screens/DeviceApproval.tsx +480 -0
- package/src/app/screens/SignIn.tsx +362 -0
- package/src/app/screens/chains/base.svg +3 -0
- package/src/app/screens/chains/ethereum.svg +11 -0
- package/src/app/screens/chains/solana.svg +4 -0
- package/src/app/screens/chains/tempo.svg +4 -0
- package/src/app/server.ts +204 -0
- package/src/app/vite.config.ts +95 -0
- package/src/app/void.config.ts +29 -0
- package/src/app/zyzz.config.ts +274 -0
- package/src/cli/Admin.ts +73 -0
- package/src/cli/Apps.ts +29 -0
- package/src/cli/Cli.ts +42 -0
- package/src/cli/Project.ts +117 -0
- package/src/cli/Realms.ts +50 -0
- package/src/cli/Session.ts +239 -0
- package/src/cli/User.ts +45 -0
- package/src/cli/V1.ts +57 -0
- package/src/cli/bin.ts +44 -0
- package/src/cli/commands/admin/apps/create.ts +101 -0
- package/src/cli/commands/admin/apps/delete.ts +38 -0
- package/src/cli/commands/admin/apps/index.ts +15 -0
- package/src/cli/commands/admin/apps/list.ts +25 -0
- package/src/cli/commands/admin/apps/rotate-secret.ts +47 -0
- package/src/cli/commands/admin/apps/update.ts +86 -0
- package/src/cli/commands/admin/index.ts +14 -0
- package/src/cli/commands/admin/migrate.ts +16 -0
- package/src/cli/commands/admin/realms/add.ts +40 -0
- package/src/cli/commands/admin/realms/index.ts +14 -0
- package/src/cli/commands/admin/realms/list.ts +38 -0
- package/src/cli/commands/admin/realms/passkeys/index.ts +15 -0
- package/src/cli/commands/admin/realms/passkeys/set.ts +44 -0
- package/src/cli/commands/admin/realms/privy/index.ts +14 -0
- package/src/cli/commands/admin/realms/privy/set.ts +69 -0
- package/src/cli/commands/admin/realms/remove.ts +33 -0
- package/src/cli/commands/admin/realms/secp256k1/disable.ts +40 -0
- package/src/cli/commands/admin/realms/secp256k1/enable.ts +40 -0
- package/src/cli/commands/admin/realms/secp256k1/index.ts +19 -0
- package/src/cli/commands/admin/realms/set.ts +46 -0
- package/src/cli/commands/admin/rotate-key.ts +47 -0
- package/src/cli/commands/init.ts +42 -0
- package/src/cli/commands/login.ts +32 -0
- package/src/cli/commands/logout.ts +19 -0
- package/src/cli/commands/whoami.ts +23 -0
- package/src/client/Actions.ts +168 -0
- package/src/client/Auth.ts +285 -0
- package/src/client/Authorization.ts +34 -0
- package/src/client/Decorator.ts +410 -0
- package/src/client/Key.ts +140 -0
- package/src/client/Pending.ts +46 -0
- package/src/client/Permissions.ts +39 -0
- package/src/client/Provider.ts +18 -0
- package/src/client/Step.ts +24 -0
- package/src/client/Storage.ts +29 -0
- package/src/client/TempoAccount.ts +42 -0
- package/src/client/Tokens.ts +27 -0
- package/src/client/User.ts +23 -0
- package/src/client/actions/account.ts +57 -0
- package/src/client/actions/device.ts +151 -0
- package/src/client/actions/email.ts +141 -0
- package/src/client/actions/oauth.ts +182 -0
- package/src/client/actions/passkey.ts +141 -0
- package/src/client/actions/provider.ts +70 -0
- package/src/client/actions/realm.ts +36 -0
- package/src/client/actions/redirect.ts +408 -0
- package/src/client/internal/accessKey.ts +54 -0
- package/src/client/internal/account.ts +15 -0
- package/src/client/internal/api.ts +224 -0
- package/src/client/internal/headless.ts +77 -0
- package/src/client/internal/indexedDb.ts +44 -0
- package/src/client/internal/request.ts +71 -0
- package/src/client/internal/store.ts +20 -0
- package/src/client.ts +19 -0
- package/src/index.ts +6 -0
- package/src/internal/Apps.ts +718 -0
- package/src/internal/Auth.ts +203 -0
- package/src/internal/Authorize.ts +424 -0
- package/src/internal/Balance.ts +168 -0
- package/src/internal/BodyLimit.ts +36 -0
- package/src/internal/Chain.ts +16 -0
- package/src/internal/Device.ts +469 -0
- package/src/internal/Env.ts +58 -0
- package/src/internal/ErrorResponse.ts +854 -0
- package/src/internal/Id.ts +41 -0
- package/src/internal/KeyAuthorization.ts +1339 -0
- package/src/internal/Limits.ts +39 -0
- package/src/internal/Log.ts +178 -0
- package/src/internal/LogLine.ts +87 -0
- package/src/internal/Logout.ts +336 -0
- package/src/internal/Migrations.ts +86 -0
- package/src/internal/OpenApi.ts +300 -0
- package/src/internal/Owner.ts +211 -0
- package/src/internal/Passkey.ts +1052 -0
- package/src/internal/PendingKey.ts +104 -0
- package/src/internal/Privy.ts +402 -0
- package/src/internal/Provider.ts +125 -0
- package/src/internal/RateLimit.ts +259 -0
- package/src/internal/Realm.ts +768 -0
- package/src/internal/RequestId.ts +118 -0
- package/src/internal/SignInGrant.ts +168 -0
- package/src/internal/SigningKey.ts +286 -0
- package/src/internal/TempoAccount.ts +342 -0
- package/src/internal/TestInbox.ts +51 -0
- package/src/internal/Timing.ts +158 -0
- package/src/internal/Validation.ts +52 -0
- package/src/internal/Wallet.ts +62 -0
- package/src/internal/owners/Passkey.ts +72 -0
- package/src/internal/owners/Privy.ts +81 -0
- package/src/internal/owners/Secp256k1.ts +143 -0
- package/src/types/app.d.ts +19 -0
- package/src/worker.ts +11 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders a one-time code field as a row of boxes, after Link's sign-in screen.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
import {
|
|
6
|
+
type ChangeEvent,
|
|
7
|
+
type FocusEvent,
|
|
8
|
+
Fragment,
|
|
9
|
+
type InputHTMLAttributes,
|
|
10
|
+
type ReactNode,
|
|
11
|
+
useEffect,
|
|
12
|
+
useRef,
|
|
13
|
+
useState,
|
|
14
|
+
} from 'react'
|
|
15
|
+
import { style } from '../zyzz.config.js'
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* One native input drawn as `length` boxes. The input stays uncontrolled, so forms read it from
|
|
19
|
+
* `FormData`, and autofill and paste fill every box at once. The boxes show its letters and digits,
|
|
20
|
+
* uppercased. `aria-invalid` draws them in red until the next keystroke. When `aria-invalid` turns
|
|
21
|
+
* on, the field clears, takes focus, and shakes, so a refused code can be typed again at once.
|
|
22
|
+
* `verified` tints the boxes green.
|
|
23
|
+
*/
|
|
24
|
+
export function CodeInput(props: CodeInput.Props): ReactNode {
|
|
25
|
+
const { length, onBlur, onChange, onFocus, separator, verified, ...rest } =
|
|
26
|
+
props
|
|
27
|
+
const [value, setValue] = useState(String(rest.defaultValue ?? ''))
|
|
28
|
+
const [focused, setFocused] = useState(false)
|
|
29
|
+
// Typing after a refusal clears the red, while the refusal stands until the next submission.
|
|
30
|
+
const [edited, setEdited] = useState(false)
|
|
31
|
+
const [nudging, setNudging] = useState(false)
|
|
32
|
+
const input = useRef<HTMLInputElement>(null)
|
|
33
|
+
|
|
34
|
+
const characters = clean(value)
|
|
35
|
+
const active = Math.min(characters.length, length - 1)
|
|
36
|
+
const invalid =
|
|
37
|
+
rest['aria-invalid'] === true || rest['aria-invalid'] === 'true'
|
|
38
|
+
|
|
39
|
+
// A field that renders invalid keeps its value, so only a later refusal clears it.
|
|
40
|
+
const previous = useRef(invalid)
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
const refused = invalid && !previous.current
|
|
43
|
+
previous.current = invalid
|
|
44
|
+
if (!refused || !input.current) return
|
|
45
|
+
input.current.value = ''
|
|
46
|
+
input.current.focus()
|
|
47
|
+
setEdited(false)
|
|
48
|
+
setNudging(true)
|
|
49
|
+
setValue('')
|
|
50
|
+
}, [invalid])
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<div {...styles.root()}>
|
|
54
|
+
<div
|
|
55
|
+
{...styles.boxes()}
|
|
56
|
+
aria-hidden
|
|
57
|
+
data-nudging={nudging}
|
|
58
|
+
onAnimationEnd={() => setNudging(false)}
|
|
59
|
+
>
|
|
60
|
+
{Array.from({ length }, (_, index) => (
|
|
61
|
+
<Fragment key={index}>
|
|
62
|
+
{index === separator ? <span {...styles.separator()} /> : null}
|
|
63
|
+
<span
|
|
64
|
+
{...styles.box()}
|
|
65
|
+
data-active={focused && !rest.readOnly && index === active}
|
|
66
|
+
data-invalid={invalid && !edited}
|
|
67
|
+
data-verified={Boolean(verified)}
|
|
68
|
+
>
|
|
69
|
+
{characters[index]}
|
|
70
|
+
</span>
|
|
71
|
+
</Fragment>
|
|
72
|
+
))}
|
|
73
|
+
</div>
|
|
74
|
+
<input
|
|
75
|
+
autoCapitalize="characters"
|
|
76
|
+
autoComplete="one-time-code"
|
|
77
|
+
spellCheck={false}
|
|
78
|
+
{...rest}
|
|
79
|
+
{...styles.input()}
|
|
80
|
+
ref={input}
|
|
81
|
+
onBlur={(event: FocusEvent<HTMLInputElement>) => {
|
|
82
|
+
setFocused(false)
|
|
83
|
+
onBlur?.(event)
|
|
84
|
+
}}
|
|
85
|
+
onChange={(event: ChangeEvent<HTMLInputElement>) => {
|
|
86
|
+
// The input holds only what the boxes show, so a paste cannot submit hidden characters.
|
|
87
|
+
const characters = clean(event.currentTarget.value).slice(0, length)
|
|
88
|
+
if (characters !== event.currentTarget.value)
|
|
89
|
+
event.currentTarget.value = characters
|
|
90
|
+
setEdited(true)
|
|
91
|
+
setValue(characters)
|
|
92
|
+
onChange?.(event)
|
|
93
|
+
}}
|
|
94
|
+
onFocus={(event: FocusEvent<HTMLInputElement>) => {
|
|
95
|
+
setFocused(true)
|
|
96
|
+
onFocus?.(event)
|
|
97
|
+
}}
|
|
98
|
+
/>
|
|
99
|
+
</div>
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** A code's letters and digits, uppercased. */
|
|
104
|
+
function clean(value: string) {
|
|
105
|
+
return value.replace(/[^0-9a-z]/gi, '').toUpperCase()
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export declare namespace CodeInput {
|
|
109
|
+
/** A text input's attributes, except `value`, since the input stays uncontrolled. */
|
|
110
|
+
type Props = Omit<InputHTMLAttributes<HTMLInputElement>, 'value'> & {
|
|
111
|
+
/** The number of boxes. */
|
|
112
|
+
length: number
|
|
113
|
+
/** The box index a dash precedes, as in `BCDF–GHJK`. */
|
|
114
|
+
separator?: number | undefined
|
|
115
|
+
/** Whether the code was accepted, which tints the boxes green. */
|
|
116
|
+
verified?: boolean | undefined
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
namespace styles {
|
|
121
|
+
// The boxes match `Input`: a gray fill, and a border in the text color on the active box.
|
|
122
|
+
export const box = style({
|
|
123
|
+
alignItems: 'center',
|
|
124
|
+
aspectRatio: 'code',
|
|
125
|
+
backgroundColor: 'gray.100',
|
|
126
|
+
border: '2px solid',
|
|
127
|
+
borderColor: 'transparent',
|
|
128
|
+
borderRadius: 'xl',
|
|
129
|
+
display: 'flex',
|
|
130
|
+
flex: '1 1 0',
|
|
131
|
+
justifyContent: 'center',
|
|
132
|
+
maxWidth: 12,
|
|
133
|
+
transitionDuration: '150ms',
|
|
134
|
+
transitionProperty: 'background-color, border-color, color',
|
|
135
|
+
transitionTimingFunction: 'in-out',
|
|
136
|
+
typography: 'label.20',
|
|
137
|
+
'&[data-active="true"]': { borderColor: 'foreground' },
|
|
138
|
+
// An empty active box shows a caret, since the real input's caret is hidden.
|
|
139
|
+
'&[data-active="true"]:empty::after': {
|
|
140
|
+
backgroundColor: 'foreground',
|
|
141
|
+
content: '""',
|
|
142
|
+
height: 5,
|
|
143
|
+
width: 'px',
|
|
144
|
+
'@media (prefers-reduced-motion: no-preference)': { animation: 'pulse' },
|
|
145
|
+
},
|
|
146
|
+
'&[data-invalid="true"]': { borderColor: 'red.800', color: 'gray.700' },
|
|
147
|
+
'&[data-verified="true"]': {
|
|
148
|
+
backgroundColor: 'green.100',
|
|
149
|
+
borderColor: 'green.700',
|
|
150
|
+
color: 'green.900',
|
|
151
|
+
},
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
export const boxes = style({
|
|
155
|
+
display: 'flex',
|
|
156
|
+
gap: 2,
|
|
157
|
+
justifyContent: 'center',
|
|
158
|
+
'&[data-nudging="true"]': {
|
|
159
|
+
'@media (prefers-reduced-motion: no-preference)': { animation: 'nudge' },
|
|
160
|
+
},
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
// Covers the boxes so a tap anywhere on them focuses the input, which draws nothing itself.
|
|
164
|
+
export const input = style({
|
|
165
|
+
backgroundColor: 'transparent',
|
|
166
|
+
border: 'none',
|
|
167
|
+
caretColor: 'transparent',
|
|
168
|
+
color: 'transparent',
|
|
169
|
+
cursor: 'text',
|
|
170
|
+
inset: 0,
|
|
171
|
+
outline: 'none',
|
|
172
|
+
position: 'absolute',
|
|
173
|
+
width: 'full',
|
|
174
|
+
'::selection': { backgroundColor: 'transparent' },
|
|
175
|
+
})
|
|
176
|
+
|
|
177
|
+
export const root = style({ position: 'relative' })
|
|
178
|
+
|
|
179
|
+
export const separator = style({
|
|
180
|
+
alignSelf: 'center',
|
|
181
|
+
backgroundColor: 'gray.500',
|
|
182
|
+
flexShrink: 0,
|
|
183
|
+
height: 'px',
|
|
184
|
+
width: 3,
|
|
185
|
+
})
|
|
186
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** Renders an inline error, which also serves as a page's live status region. @module */
|
|
2
|
+
import type { ReactNode } from 'react'
|
|
3
|
+
import Alert from '~icons/lucide/circle-alert'
|
|
4
|
+
import type { Props } from 'zyzz'
|
|
5
|
+
import { style, variants } from '../zyzz.config.js'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* An error message with an alert icon, aligned to the start or the center. It always renders its
|
|
9
|
+
* live region, so screen readers announce a message that appears after the page loads.
|
|
10
|
+
*/
|
|
11
|
+
export function ErrorMessage(props: ErrorMessage.Props): ReactNode {
|
|
12
|
+
return (
|
|
13
|
+
<p
|
|
14
|
+
{...styles.message({ align: props.align })}
|
|
15
|
+
aria-live="polite"
|
|
16
|
+
id={props.id}
|
|
17
|
+
role="status"
|
|
18
|
+
>
|
|
19
|
+
{props.children ? (
|
|
20
|
+
<>
|
|
21
|
+
<Alert {...styles.icon()} aria-hidden />
|
|
22
|
+
<span>{props.children}</span>
|
|
23
|
+
</>
|
|
24
|
+
) : null}
|
|
25
|
+
</p>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export declare namespace ErrorMessage {
|
|
30
|
+
/** The message, its alignment, and an `id` that controls reference. */
|
|
31
|
+
type Props = Props.Variants<typeof styles.message> & {
|
|
32
|
+
/** The message. Nothing shows without one. */
|
|
33
|
+
children?: ReactNode | undefined
|
|
34
|
+
/** Lets a control name the message with `aria-describedby`. */
|
|
35
|
+
id?: string | undefined
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
namespace styles {
|
|
40
|
+
export const icon = style({
|
|
41
|
+
flexShrink: 0,
|
|
42
|
+
height: 4,
|
|
43
|
+
marginTop: 'px',
|
|
44
|
+
width: 4,
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
export const message = variants({
|
|
48
|
+
base: {
|
|
49
|
+
alignItems: 'start',
|
|
50
|
+
color: 'red.900',
|
|
51
|
+
display: 'flex',
|
|
52
|
+
gap: 2,
|
|
53
|
+
typography: 'copy.14',
|
|
54
|
+
// An empty region leaves the layout, so its parent's gap does not reserve space for it. The
|
|
55
|
+
// region stays rendered, so screen readers still announce a message that appears.
|
|
56
|
+
':empty': { position: 'absolute' },
|
|
57
|
+
},
|
|
58
|
+
defaultVariants: { align: 'start' },
|
|
59
|
+
variants: {
|
|
60
|
+
align: {
|
|
61
|
+
center: { justifyContent: 'center', textAlign: 'center' },
|
|
62
|
+
start: {},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
}
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a key that an app requests may do, its spending limits and expiry, as the approval and device
|
|
3
|
+
* screens show it.
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { type ReactNode, useId } from 'react'
|
|
7
|
+
import Info from '~icons/lucide/info'
|
|
8
|
+
import type * as KeyAuthorization from '../../internal/KeyAuthorization.js'
|
|
9
|
+
import { style } from '../zyzz.config.js'
|
|
10
|
+
import { Tooltip } from './Tooltip.js'
|
|
11
|
+
|
|
12
|
+
/** Each listed token's icon URL, by symbol. */
|
|
13
|
+
const icons = Object.fromEntries(
|
|
14
|
+
Object.entries(
|
|
15
|
+
import.meta.glob<string>('./icons/*.{png,svg,webp}', {
|
|
16
|
+
eager: true,
|
|
17
|
+
import: 'default',
|
|
18
|
+
query: '?url',
|
|
19
|
+
}),
|
|
20
|
+
).map(([file, url]) => [
|
|
21
|
+
file.slice('./icons/'.length, file.lastIndexOf('.')),
|
|
22
|
+
url,
|
|
23
|
+
]),
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Logos in `logos/`, as `<symbol>.light.svg` and `<symbol>.dark.svg`, by symbol and the color
|
|
28
|
+
* scheme each one stands out on. They take the place of an icon.
|
|
29
|
+
*/
|
|
30
|
+
const logos = Object.entries(
|
|
31
|
+
import.meta.glob<string>('./logos/*.{light,dark}.{png,svg,webp}', {
|
|
32
|
+
eager: true,
|
|
33
|
+
import: 'default',
|
|
34
|
+
query: '?url',
|
|
35
|
+
}),
|
|
36
|
+
).reduce<Record<string, { dark?: string; light?: string }>>(
|
|
37
|
+
(result, [file, url]) => {
|
|
38
|
+
const [, symbol, scheme] = file.match(
|
|
39
|
+
/^\.\/logos\/(.+)\.(light|dark)\.\w+$/,
|
|
40
|
+
)!
|
|
41
|
+
result[symbol!] = { ...result[symbol!], [scheme!]: url }
|
|
42
|
+
return result
|
|
43
|
+
},
|
|
44
|
+
{},
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
/** What the key that an app requests may do: its limits and expiry. */
|
|
48
|
+
export function Grant(props: Grant.Props): ReactNode {
|
|
49
|
+
// Several grants can share a document, so each derives its own ID.
|
|
50
|
+
const id = useId()
|
|
51
|
+
const { expiry, limits } = props.keyAuthorization
|
|
52
|
+
const Heading = props.heading ?? 'h2'
|
|
53
|
+
// A one-time limit states this beside periodic ones, which would otherwise read the same.
|
|
54
|
+
const periodic = limits.some((limit) => limit.period)
|
|
55
|
+
return (
|
|
56
|
+
<section {...styles.section()} aria-labelledby={id}>
|
|
57
|
+
<Heading {...styles.heading()} id={id}>
|
|
58
|
+
This app can spend up to
|
|
59
|
+
</Heading>
|
|
60
|
+
<ul {...styles.list()}>
|
|
61
|
+
{limits.map((limit) => (
|
|
62
|
+
<li
|
|
63
|
+
{...styles.limit()}
|
|
64
|
+
key={`${limit.currency}:${limit.period ?? 0}`}
|
|
65
|
+
>
|
|
66
|
+
<span>
|
|
67
|
+
{(() => {
|
|
68
|
+
if (limit.period)
|
|
69
|
+
return `${format(limit)} ${every(limit.period)}`
|
|
70
|
+
if (periodic) return `${format(limit)} in total`
|
|
71
|
+
return format(limit)
|
|
72
|
+
})()}
|
|
73
|
+
</span>
|
|
74
|
+
<span {...styles.icons()}>
|
|
75
|
+
{limit.tokens.map((token) => {
|
|
76
|
+
// Each token's own limit shows on its icon, since the total spans several.
|
|
77
|
+
const label = `${token.symbol}: ${format({ amount: token.amount, currency: limit.currency })}`
|
|
78
|
+
const logo = logos[token.symbol]
|
|
79
|
+
const icon = logo?.light ?? icons[token.symbol]
|
|
80
|
+
return (
|
|
81
|
+
<Tooltip key={token.symbol} label={label}>
|
|
82
|
+
<span {...styles.token()} tabIndex={0}>
|
|
83
|
+
{icon ? (
|
|
84
|
+
// The page follows the system color scheme, so the image does too.
|
|
85
|
+
<picture>
|
|
86
|
+
{logo?.dark ? (
|
|
87
|
+
<source
|
|
88
|
+
media="(prefers-color-scheme: dark)"
|
|
89
|
+
srcSet={logo.dark}
|
|
90
|
+
/>
|
|
91
|
+
) : null}
|
|
92
|
+
<img
|
|
93
|
+
{...styles.icon()}
|
|
94
|
+
alt={label}
|
|
95
|
+
height={20}
|
|
96
|
+
src={icon}
|
|
97
|
+
width={20}
|
|
98
|
+
/>
|
|
99
|
+
</picture>
|
|
100
|
+
) : (
|
|
101
|
+
// A token without a logo shows its initial.
|
|
102
|
+
<span
|
|
103
|
+
{...styles.placeholder()}
|
|
104
|
+
aria-label={label}
|
|
105
|
+
role="img"
|
|
106
|
+
>
|
|
107
|
+
{token.symbol[0]}
|
|
108
|
+
</span>
|
|
109
|
+
)}
|
|
110
|
+
</span>
|
|
111
|
+
</Tooltip>
|
|
112
|
+
)
|
|
113
|
+
})}
|
|
114
|
+
</span>
|
|
115
|
+
</li>
|
|
116
|
+
))}
|
|
117
|
+
</ul>
|
|
118
|
+
<dl {...styles.details()}>
|
|
119
|
+
<div>
|
|
120
|
+
<dt {...styles.term()}>Expires</dt>{' '}
|
|
121
|
+
<dd {...styles.value()}>
|
|
122
|
+
{until(expiry)}{' '}
|
|
123
|
+
{/* The tooltip's text never reaches the server render, so it shows the visitor's own time zone. */}
|
|
124
|
+
<Tooltip
|
|
125
|
+
label={new Date(expiry * 1000).toLocaleString(undefined, {
|
|
126
|
+
day: 'numeric',
|
|
127
|
+
hour: 'numeric',
|
|
128
|
+
minute: '2-digit',
|
|
129
|
+
month: 'short',
|
|
130
|
+
timeZoneName: 'short',
|
|
131
|
+
year: 'numeric',
|
|
132
|
+
})}
|
|
133
|
+
>
|
|
134
|
+
<Info
|
|
135
|
+
{...styles.info()}
|
|
136
|
+
aria-label="Expiry date"
|
|
137
|
+
role="img"
|
|
138
|
+
tabIndex={0}
|
|
139
|
+
/>
|
|
140
|
+
</Tooltip>
|
|
141
|
+
</dd>
|
|
142
|
+
</div>
|
|
143
|
+
</dl>
|
|
144
|
+
</section>
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export declare namespace Grant {
|
|
149
|
+
type Props = {
|
|
150
|
+
/** The level of the section's heading, one below the screen's title: `h2` by default, or `h5` on the flows canvas. */
|
|
151
|
+
heading?: 'h2' | 'h5' | undefined
|
|
152
|
+
/** The key that the app requests. */
|
|
153
|
+
keyAuthorization: KeyAuthorization.Description
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** Groups thousands and keeps every decimal the amount has. */
|
|
158
|
+
const decimal = new Intl.NumberFormat('en-US', { maximumFractionDigits: 20 })
|
|
159
|
+
|
|
160
|
+
/** The expiry's distance from now, such as `in 7 days`. */
|
|
161
|
+
const relative = new Intl.RelativeTimeFormat('en-US', { numeric: 'always' })
|
|
162
|
+
|
|
163
|
+
/** Spans an expiry reads in, largest first. Months and years are approximate. */
|
|
164
|
+
const spans = [
|
|
165
|
+
['year', 31_536_000],
|
|
166
|
+
['month', 2_592_000],
|
|
167
|
+
['week', 604_800],
|
|
168
|
+
['day', 86_400],
|
|
169
|
+
['hour', 3_600],
|
|
170
|
+
['minute', 60],
|
|
171
|
+
] as const
|
|
172
|
+
|
|
173
|
+
/** Units a period reads in, largest first. */
|
|
174
|
+
const units = [
|
|
175
|
+
['week', 604_800],
|
|
176
|
+
['day', 86_400],
|
|
177
|
+
['hour', 3_600],
|
|
178
|
+
['minute', 60],
|
|
179
|
+
['second', 1],
|
|
180
|
+
] as const
|
|
181
|
+
|
|
182
|
+
/** How often a limit resets, such as `per day` or `every 2 weeks`. */
|
|
183
|
+
function every(period: number) {
|
|
184
|
+
const [unit, seconds] = units.find((entry) => period % entry[1] === 0)!
|
|
185
|
+
const count = period / seconds
|
|
186
|
+
return count === 1 ? `per ${unit}` : `every ${count} ${unit}s`
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** A limit in its currency's format, such as `$1,000`, or with its code when Intl has no currency for it. */
|
|
190
|
+
function format(
|
|
191
|
+
limit: Pick<
|
|
192
|
+
KeyAuthorization.Description['limits'][number],
|
|
193
|
+
'amount' | 'currency'
|
|
194
|
+
>,
|
|
195
|
+
) {
|
|
196
|
+
const amount = limit.amount as Intl.StringNumericLiteral
|
|
197
|
+
try {
|
|
198
|
+
return new Intl.NumberFormat('en-US', {
|
|
199
|
+
currency: limit.currency,
|
|
200
|
+
maximumFractionDigits: 6,
|
|
201
|
+
style: 'currency',
|
|
202
|
+
trailingZeroDisplay: 'stripIfInteger',
|
|
203
|
+
}).format(amount)
|
|
204
|
+
} catch {
|
|
205
|
+
// A yield-bearing token's own symbol is not a currency code.
|
|
206
|
+
return `${decimal.format(amount)} ${limit.currency}`
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* How long until `expiry`, in Unix seconds, in its largest whole span, such as `in 3 months`. A
|
|
212
|
+
* span counts from a minute short of it, so a key that lasts a year reads `in 1 year` while the
|
|
213
|
+
* page loads.
|
|
214
|
+
*/
|
|
215
|
+
function until(expiry: number) {
|
|
216
|
+
const remaining = expiry - Date.now() / 1000
|
|
217
|
+
const [unit, seconds] =
|
|
218
|
+
spans.find((entry) => remaining + 60 >= entry[1]) ?? spans.at(-1)!
|
|
219
|
+
return relative.format(Math.max(1, Math.round(remaining / seconds)), unit)
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
namespace styles {
|
|
223
|
+
// Each term and its value read as one line of text.
|
|
224
|
+
export const details = style({
|
|
225
|
+
display: 'grid',
|
|
226
|
+
gap: 2,
|
|
227
|
+
margin: 0,
|
|
228
|
+
typography: 'copy.14',
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
export const heading = style({
|
|
232
|
+
color: 'gray.900',
|
|
233
|
+
margin: 0,
|
|
234
|
+
typography: 'copy.14',
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
export const icon = style({
|
|
238
|
+
borderRadius: 'full',
|
|
239
|
+
display: 'block',
|
|
240
|
+
height: 5,
|
|
241
|
+
width: 5,
|
|
242
|
+
})
|
|
243
|
+
|
|
244
|
+
// Several tokens overlap, and spread apart while hovered so each symbol can show.
|
|
245
|
+
export const icons = style({
|
|
246
|
+
display: 'flex',
|
|
247
|
+
flexShrink: 0,
|
|
248
|
+
'& > span + span': { marginInlineStart: 'overlap' },
|
|
249
|
+
'&:hover > span + span': { marginInlineStart: 1 },
|
|
250
|
+
})
|
|
251
|
+
|
|
252
|
+
export const info = style({
|
|
253
|
+
color: 'gray.900',
|
|
254
|
+
display: 'inline',
|
|
255
|
+
height: 4,
|
|
256
|
+
outline: 'none',
|
|
257
|
+
verticalAlign: 'middle',
|
|
258
|
+
width: 4,
|
|
259
|
+
':focus-visible': {
|
|
260
|
+
outline: '2px solid',
|
|
261
|
+
outlineColor: 'blue.700',
|
|
262
|
+
outlineOffset: '2px',
|
|
263
|
+
},
|
|
264
|
+
})
|
|
265
|
+
|
|
266
|
+
export const limit = style({
|
|
267
|
+
alignItems: 'center',
|
|
268
|
+
display: 'flex',
|
|
269
|
+
gap: 2,
|
|
270
|
+
})
|
|
271
|
+
|
|
272
|
+
export const list = style({
|
|
273
|
+
display: 'grid',
|
|
274
|
+
gap: 2,
|
|
275
|
+
listStyle: 'none',
|
|
276
|
+
margin: 0,
|
|
277
|
+
padding: 0,
|
|
278
|
+
typography: 'copy.16.strong',
|
|
279
|
+
})
|
|
280
|
+
|
|
281
|
+
export const placeholder = style({
|
|
282
|
+
alignItems: 'center',
|
|
283
|
+
backgroundColor: 'background.surface',
|
|
284
|
+
borderRadius: 'full',
|
|
285
|
+
color: 'gray.900',
|
|
286
|
+
display: 'flex',
|
|
287
|
+
height: 5,
|
|
288
|
+
justifyContent: 'center',
|
|
289
|
+
typography: 'label.12',
|
|
290
|
+
width: 5,
|
|
291
|
+
})
|
|
292
|
+
|
|
293
|
+
export const section = style({
|
|
294
|
+
backgroundColor: 'gray.100',
|
|
295
|
+
borderRadius: '2xl',
|
|
296
|
+
display: 'grid',
|
|
297
|
+
gap: 3,
|
|
298
|
+
margin: 0,
|
|
299
|
+
padding: 5,
|
|
300
|
+
})
|
|
301
|
+
|
|
302
|
+
export const term = style({ color: 'gray.900', display: 'inline' })
|
|
303
|
+
|
|
304
|
+
// The ring matches the section's fill, so overlapping tokens stay apart.
|
|
305
|
+
export const token = style({
|
|
306
|
+
borderRadius: 'full',
|
|
307
|
+
outline: '2px solid',
|
|
308
|
+
outlineColor: 'gray.100',
|
|
309
|
+
':focus-visible': { outlineColor: 'blue.700' },
|
|
310
|
+
// Under reduced motion, the tokens spread apart without a transition.
|
|
311
|
+
'@media (prefers-reduced-motion: no-preference)': {
|
|
312
|
+
transitionDuration: '150ms',
|
|
313
|
+
transitionProperty: 'margin',
|
|
314
|
+
transitionTimingFunction: 'in-out',
|
|
315
|
+
},
|
|
316
|
+
})
|
|
317
|
+
|
|
318
|
+
export const value = style({
|
|
319
|
+
display: 'inline',
|
|
320
|
+
margin: 0,
|
|
321
|
+
overflowWrap: 'anywhere',
|
|
322
|
+
})
|
|
323
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Renders the text input. @module */
|
|
2
|
+
import type { InputHTMLAttributes, ReactNode } from 'react'
|
|
3
|
+
import type { Props } from 'zyzz'
|
|
4
|
+
import { variants } from '../zyzz.config.js'
|
|
5
|
+
|
|
6
|
+
/** A text input in the `medium` or `large` size. `aria-invalid` draws it in red. */
|
|
7
|
+
export function Input(props: Input.Props): ReactNode {
|
|
8
|
+
const { size, ...rest } = props
|
|
9
|
+
return <input {...rest} {...styles.input({ size })} />
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export declare namespace Input {
|
|
13
|
+
/** The size, with a text input's attributes. */
|
|
14
|
+
type Props = Props.Variants<typeof styles.input> &
|
|
15
|
+
Omit<InputHTMLAttributes<HTMLInputElement>, 'size'>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
namespace styles {
|
|
19
|
+
// A gray fill with no visible border. Focus draws the border in the text color.
|
|
20
|
+
export const input = variants({
|
|
21
|
+
base: {
|
|
22
|
+
backgroundColor: 'gray.100',
|
|
23
|
+
border: '2px solid',
|
|
24
|
+
borderColor: 'transparent',
|
|
25
|
+
borderRadius: 'xl',
|
|
26
|
+
color: 'foreground',
|
|
27
|
+
minWidth: 0,
|
|
28
|
+
outline: 'none',
|
|
29
|
+
paddingInline: 4,
|
|
30
|
+
transitionDuration: '150ms',
|
|
31
|
+
transitionProperty: 'background-color, border-color',
|
|
32
|
+
transitionTimingFunction: 'in-out',
|
|
33
|
+
width: 'full',
|
|
34
|
+
'::placeholder': { color: 'gray.900' },
|
|
35
|
+
':hover': { backgroundColor: 'gray.200' },
|
|
36
|
+
':focus': { backgroundColor: 'gray.100', borderColor: 'foreground' },
|
|
37
|
+
'&[aria-invalid="true"]': { borderColor: 'red.800' },
|
|
38
|
+
':disabled': { color: 'gray.700', cursor: 'not-allowed' },
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: { size: 'large' },
|
|
41
|
+
variants: {
|
|
42
|
+
size: {
|
|
43
|
+
large: { height: 12, typography: 'copy.16' },
|
|
44
|
+
medium: { height: 9, typography: 'copy.14' },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
})
|
|
48
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Renders a hint above an element while it is hovered or focused, on Base UI's tooltip. @module */
|
|
2
|
+
import { Tooltip as Base } from '@base-ui/react/tooltip'
|
|
3
|
+
import type { ReactElement, ReactNode } from 'react'
|
|
4
|
+
import { style } from '../zyzz.config.js'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Shows `label` above `children` while it is hovered or focused. `children` is the trigger element,
|
|
8
|
+
* which receives the tooltip's props and ref, so it renders a DOM element.
|
|
9
|
+
*/
|
|
10
|
+
export function Tooltip(props: Tooltip.Props): ReactNode {
|
|
11
|
+
return (
|
|
12
|
+
<Base.Root>
|
|
13
|
+
<Base.Trigger delay={150} render={props.children} />
|
|
14
|
+
<Base.Portal>
|
|
15
|
+
<Base.Positioner sideOffset={8}>
|
|
16
|
+
<Base.Popup {...styles.popup()}>{props.label}</Base.Popup>
|
|
17
|
+
</Base.Positioner>
|
|
18
|
+
</Base.Portal>
|
|
19
|
+
</Base.Root>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export declare namespace Tooltip {
|
|
24
|
+
type Props = {
|
|
25
|
+
/** The element the tooltip attaches to. */
|
|
26
|
+
children: ReactElement
|
|
27
|
+
/** The hint. */
|
|
28
|
+
label: ReactNode
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
namespace styles {
|
|
33
|
+
export const popup = style({
|
|
34
|
+
backgroundColor: 'foreground',
|
|
35
|
+
borderRadius: 'lg',
|
|
36
|
+
color: 'background.primary',
|
|
37
|
+
paddingBlock: 1,
|
|
38
|
+
paddingInline: 2,
|
|
39
|
+
transitionDuration: '150ms',
|
|
40
|
+
transitionProperty: 'opacity',
|
|
41
|
+
transitionTimingFunction: 'in-out',
|
|
42
|
+
typography: 'label.12',
|
|
43
|
+
'&[data-starting-style], &[data-ending-style]': { opacity: 0 },
|
|
44
|
+
})
|
|
45
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?><svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg"> <g id="sub_brz-Brand assets"> <g id="sub_brz-Frame 11"> <g id="sub_brz-Frame 55"> <g id="sub_brz-Frame 53"> <g id="sub_brz-Currencies" clip-path="url(#sub_brz-clip0_1741_2949)"> <g id="sub_brz-BRZ"> <path id="sub_brz-Background" d="M40 80C62.0914 80 80 62.0914 80 40C80 17.9086 62.0914 0 40 0C17.9086 0 0 17.9086 0 40C0 62.0914 17.9086 80 40 80Z" fill="url(#sub_brz-paint0_linear_1741_2949)"/> <path id="sub_brz-Inner Circle" d="M39.9998 76.144C59.9616 76.144 76.1438 59.9617 76.1438 40C76.1438 20.0382 59.9616 3.85596 39.9998 3.85596C20.0381 3.85596 3.85583 20.0382 3.85583 40C3.85583 59.9617 20.0381 76.144 39.9998 76.144Z" fill="#160F29"/> <g id="sub_brz-Icon"> <path id="sub_brz-Path 1" d="M40.0025 43.5679L32.609 50.9614L40.0025 58.3549L47.396 50.9614L40.0025 43.5679Z" fill="white"/> <path id="sub_brz-Path 2" d="M62.1799 36.1719L54.7879 28.7759L47.392 36.1719L39.9999 28.7759H25.2119L17.8199 36.1719L25.2119 43.5639L32.6079 36.1719L39.9999 43.5639H54.7879L62.1799 36.1719Z" fill="white"/> </g> </g> </g> </g> </g> </g> </g> <defs> <linearGradient id="sub_brz-paint0_linear_1741_2949" x1="11.196" y1="68.804" x2="67.692" y2="12.308" gradientUnits="userSpaceOnUse"> <stop offset="0.04" stop-color="#FFC100"/> <stop offset="1" stop-color="#00C800"/> </linearGradient> <clipPath id="sub_brz-clip0_1741_2949"> <rect width="80" height="80" fill="white"/> </clipPath> </defs> </svg>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="720" height="714" fill="none" viewBox="0 0 720 714"><circle cx="357" cy="357" r="357" fill="#000"/><path fill="#fff" d="M405.18 357.091H457C452.59 408.451 417.308 440 363.65 440c-55.863 0-90.778-33.751-99.598-95.015H242l4.778-25.68h14.701V304.63H242l4.778-25.679h16.539c8.82-63.1 44.102-97.951 101.435-97.951 54.394 0 87.838 31.183 91.146 81.809H405.18c-3.675-23.479-17.641-38.153-40.428-38.153-26.094 0-43 18.71-48.88 54.295h80.487l-4.777 25.679h-77.915v14.675h74.974l-4.777 25.68h-67.257c5.881 33.75 22.051 51.359 47.043 51.359 22.786 0 37.855-15.041 41.53-39.253"/><path fill="url(#a)" d="M357 96.15c143.852 0 260.465 116.148 260.465 259.425h96.768C714.233 159.197 554.165 0 357 0S0 159.197 0 355.575h96.536C96.536 212.298 213.148 96.151 357 96.151"/><path fill="url(#b)" d="M357.001 514.313c-88.02 0-159.375-71.07-159.375-158.739H96.536c0 143.278 116.613 259.425 260.465 259.425s260.465-116.147 260.464-259.425H516.376c0 87.669-71.354 158.739-159.375 158.739"/><defs><linearGradient id="a" x1="714.233" x2="51.769" y1="355.575" y2="-78.929" gradientUnits="userSpaceOnUse"><stop stop-color="#30c0fe"/><stop offset="1" stop-color="#00ffea"/></linearGradient><linearGradient id="b" x1="617.466" x2="134.2" y1="614.999" y2="298.132" gradientUnits="userSpaceOnUse"><stop stop-color="#30c0fe"/><stop offset="1" stop-color="#00ffea"/></linearGradient></defs></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 96 96"><g clip-path="url(#a)"><path fill="#0b53bf" d="M48 96c26.51 0 48-21.49 48-48S74.51 0 48 0 0 21.49 0 48s21.49 48 48 48"/><path fill="#fff" stroke="#0b53bf" stroke-miterlimit="10" stroke-width=".03" d="M58.2 59.43c-2.1.84-4.38 1.32-6.57 1.32-4.337 0-8.426-1.847-10.38-6.3h9.54l1.86-4.5H40.14q-.09-.93-.09-1.95c0-1.02.03-1.33.09-1.95h14.1l1.86-4.5H41.25c1.954-4.452 6.043-6.3 10.38-6.3 2.19 0 4.47.48 6.57 1.32l1.92-4.56c-2.58-1.35-5.49-2.01-8.4-2.01-7.024 0-14.123 3.927-16.693 11.55H30.42v4.5h3.684a22.5 22.5 0 0 0 0 3.9H30.42v4.5h4.607C37.597 62.075 44.697 66 51.72 66c2.91 0 5.82-.66 8.4-2.01z"/><path fill="#fff" stroke="#0b53bf" stroke-miterlimit="10" stroke-width=".03" d="M18 48c0-13.59 9.03-25.05 21.36-28.77v-6.18C23.64 16.89 12 31.08 12 48s11.64 31.11 27.36 34.95v-6.18C27.03 73.08 18 61.59 18 48Zm38.64-34.95v6.18C68.97 22.95 78 34.41 78 48s-9.03 25.05-21.36 28.77v6.18C72.36 79.11 84 64.92 84 48S72.36 16.89 56.64 13.05Z"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h96v96H0z"/></clipPath></defs></svg>
|